{"version":3,"sources":["ss-archive.js"],"names":["jQuery","$","Vested_SS","sidebar","maxWidth","el","per","height","animate","init","switch","tabContent","window","makeSticky","resize","click","toggleSidebar","scroll","getHeight","body","document","html","documentElement","Math","max","scrollHeight","offsetHeight","clientHeight","round","scrollTop","hasClass","indexOf","animateToggle","padding-right","setTimeout","toggle","toggleClass","innerWidth","unStick","StickySidebar","containerSelector","topSpacing","bottomSpacing","destroy","ready"],"mappings":"AAAAA,OAAQ,SAAWC,GAElB,IAAIC,EAAY,CAIfC,QAAS,KAKTC,SAAU,KAKVC,GAAI,GAKJC,IAAK,CAAE,GAAI,GAAI,IAKfC,OAAQ,KAKRC,SAAS,EAKTC,KAAM,WACLP,EAAUG,GAAK,CACdK,OAAQT,EAAG,+BACXU,WAAYV,EAAG,qBACfW,OAAQX,EAAGW,SAGZV,EAAUW,aACVZ,EAAGW,QAASE,OAAQZ,EAAUY,QAE9BZ,EAAUG,GAAGK,OAAOK,MAAOb,EAAUc,eACrCd,EAAUG,GAAGO,OAAOK,OAAQf,EAAUe,SAQvCC,UAAW,WACV,IAAIC,EAASC,SAASD,KACrBE,EAASD,SAASE,gBAYnB,OAVK,OAASpB,EAAUK,SACvBL,EAAUK,OAASgB,KAAKC,IACvBL,EAAKM,aACLN,EAAKO,aACLL,EAAKM,aACLN,EAAKI,aACLJ,EAAKK,eAIAxB,EAAUK,QAMlBU,OAAQ,WACP,IAAIX,EAAMiB,KAAKK,MAAO1B,EAAUG,GAAGO,OAAOiB,YAAc3B,EAAUgB,YAAc,KAE3EhB,EAAUG,GAAGM,WAAWmB,SAAU,SAIlC5B,EAAUM,UAA2C,EAAhCN,EAAUI,IAAIyB,QAASzB,IAChDJ,EAAU8B,iBAOZA,cAAe,WACd9B,EAAUM,SAAU,EAEpBN,EAAUG,GAAGK,OAAOF,QAAS,CAC5ByB,gBAAiB,QAEjB,QAEDC,WAAY,WACXhC,EAAUG,GAAGK,OAAOF,QAAS,CAC3ByB,gBAAiB,QAElB,OACA,WACC/B,EAAUM,SAAU,KAGpB,IAMJQ,cAAe,WACdd,EAAUG,GAAGK,OAAOyB,SACpBjC,EAAUG,GAAGM,WAAWyB,YAAa,SAMtCtB,OAAQ,WACF,OAASZ,EAAUC,SAAWS,OAAOyB,WAAanC,EAAUE,SAChEF,EAAUoC,UAIN,OAASpC,EAAUC,SACvBD,EAAUW,cAOZA,WAAY,WACND,OAAOyB,WAAanC,EAAUE,WAInCF,EAAUC,QAAU,IAAIoC,cAAe,2BAA4B,CAClEC,kBAAmB,wBACnBC,WAAY,GACZC,cAAe,MAOjBJ,QAAS,WACRpC,EAAUC,QAAQwC,UAClBzC,EAAUC,QAAU,OAItBF,EAAGmB,UAAWwB,MAAO1C,EAAUO","file":"../ss-archive.min.js","sourcesContent":["jQuery( function ( $ ) {\n\n\tvar Vested_SS = {\n\t\t/**\n\t\t * The sticky sidebar.\n\t\t */\n\t\tsidebar: null,\n\n\t\t/**\n\t\t * Max width for the sticky sidebar.\n\t\t */\n\t\tmaxWidth: 1100,\n\n\t\t/**\n\t\t * Elements for the sidebar script.\n\t\t */\n\t\tel: {},\n\n\t\t/**\n\t\t * The page height percentages that should be animated.\n\t\t */\n\t\tper: [ 10, 30, 60 ],\n\n\t\t/**\n\t\t * The page height.\n\t\t */\n\t\theight: null,\n\n\t\t/**\n\t\t * Indicates it is safe to animate the tab.\n\t\t */\n\t\tanimate: true,\n\n\t\t/**\n\t\t * Init all the things.\n\t\t */\n\t\tinit: function() {\n\t\t\tVested_SS.el = {\n\t\t\t\tswitch: $( '.tab-sidebar .switch button' ),\n\t\t\t\ttabContent: $( '.tab-sidebar .tab' ),\n\t\t\t\twindow: $( window )\n\t\t\t};\n\n\t\t\tVested_SS.makeSticky();\n\t\t\t$( window ).resize( Vested_SS.resize );\n\n\t\t\tVested_SS.el.switch.click( Vested_SS.toggleSidebar );\n\t\t\tVested_SS.el.window.scroll( Vested_SS.scroll );\n\n\t\t},\n\t\t/**\n\t\t * Gets the page height.\n\t\t *\n\t\t * @returns {number}\n\t\t */\n\t\tgetHeight: function() {\n\t\t\tvar body = document.body,\n\t\t\t\thtml = document.documentElement;\n\n\t\t\tif ( null === Vested_SS.height ) {\n\t\t\t\tVested_SS.height = Math.max(\n\t\t\t\t\tbody.scrollHeight,\n\t\t\t\t\tbody.offsetHeight,\n\t\t\t\t\thtml.clientHeight,\n\t\t\t\t\thtml.scrollHeight,\n\t\t\t\t\thtml.offsetHeight\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn Vested_SS.height;\n\t\t},\n\n\t\t/**\n\t\t * Checks the window scroll position.\n\t\t */\n\t\tscroll: function() {\n\t\t\tvar per = Math.round( Vested_SS.el.window.scrollTop() / Vested_SS.getHeight() * 100 );\n\n\t\t\tif ( Vested_SS.el.tabContent.hasClass( 'show' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( Vested_SS.animate && Vested_SS.per.indexOf( per ) > -1 ) {\n\t\t\t\tVested_SS.animateToggle();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Animates the toggle.\n\t\t */\n\t\tanimateToggle: function() {\n\t\t\tVested_SS.animate = false;\n\n\t\t\tVested_SS.el.switch.animate( {\n\t\t\t\t'padding-right': '30px'\n\t\t\t\t},\n\t\t\t\t'fast'\n\t\t\t);\n\t\t\tsetTimeout( function() {\n\t\t\t\tVested_SS.el.switch.animate( {\n\t\t\t\t\t\t'padding-right': '20px'\n\t\t\t\t\t},\n\t\t\t\t\t'fast',\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tVested_SS.animate = true;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}, 0 );\n\t\t},\n\n\t\t/**\n\t\t * Toggles the sidebar.\n\t\t */\n\t\ttoggleSidebar: function() {\n\t\t\tVested_SS.el.switch.toggle();\n\t\t\tVested_SS.el.tabContent.toggleClass( 'show' );\n\t\t},\n\n\t\t/**\n\t\t * Checks to see if the sidebar should be sticky or not.\n\t\t */\n\t\tresize: function() {\n\t\t\tif ( null !== Vested_SS.sidebar && window.innerWidth < Vested_SS.maxWidth ) {\n\t\t\t\tVested_SS.unStick();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( null === Vested_SS.sidebar ) {\n\t\t\t\tVested_SS.makeSticky()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Makes the sidebar sticky if window is at least 1100px wide.\n\t\t */\n\t\tmakeSticky: function () {\n\t\t\tif ( window.innerWidth < Vested_SS.maxWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tVested_SS.sidebar = new StickySidebar( '#genesis-sidebar-primary', {\n\t\t\t\tcontainerSelector: '.content-sidebar-wrap',\n\t\t\t\ttopSpacing: 60,\n\t\t\t\tbottomSpacing: 0\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Unsticks the sidebar.\n\t\t */\n\t\tunStick: function() {\n\t\t\tVested_SS.sidebar.destroy();\n\t\t\tVested_SS.sidebar = null;\n\t\t}\n\t};\n\n\t$( document ).ready( Vested_SS.init );\n\n} );\n"]}