/*! smooth-scroll v11.1.0 | (c) 2017 chris ferdinandi | gpl-3.0 license | http://github.com/cferdinandi/smooth-scroll */ !(function(e,t){"function"==typeof define&&define.amd?define([],t(e)):"object"==typeof exports?module.exports=t(e):e.smoothscroll=t(e)})("undefined"!=typeof global?global:this.window||this.global,(function(e){"use strict";var t,n,o,r,a,i,c,l={},s="queryselector"in document&&"addeventlistener"in e,u={selector:"[data-scroll]",ignore:"[data-scroll-ignore]",selectorheader:null,speed:500,offset:0,easing:"easeinoutcubic",easingpatterns:{},before:function(){},after:function(){}},f=function(){var e={},t=!1,n=0,o=arguments.length;"[object boolean]"===object.prototype.tostring.call(arguments[0])&&(t=arguments[0],n++);for(;n=0&&t.item(n)!==this;);return n>-1});e&&e!==document;e=e.parentnode)if(e.matches(t))return e;return null},m=function(e){"#"===e.charat(0)&&(e=e.substr(1));for(var t,n=string(e),o=n.length,r=-1,a="",i=n.charcodeat(0);++r=1&&t<=31||127==t||0===r&&t>=48&&t<=57||1===r&&t>=48&&t<=57&&45===i?a+="\\"+t.tostring(16)+" ":a+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charat(r):"\\"+n.charat(r)}return"#"+a},g=function(e,t){var n;return"easeinquad"===e.easing&&(n=t*t),"easeoutquad"===e.easing&&(n=t*(2-t)),"easeinoutquad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeincubic"===e.easing&&(n=t*t*t),"easeoutcubic"===e.easing&&(n=--t*t*t+1),"easeinoutcubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeinquart"===e.easing&&(n=t*t*t*t),"easeoutquart"===e.easing&&(n=1- --t*t*t*t),"easeinoutquart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeinquint"===e.easing&&(n=t*t*t*t*t),"easeoutquint"===e.easing&&(n=1+--t*t*t*t*t),"easeinoutquint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.easingpatterns[e.easing]&&(n=e.easingpatterns[e.easing](t)),n||t},p=function(e,t,n){var o=0;if(e.offsetparent)do{o+=e.offsettop,e=e.offsetparent}while(e);return o=math.max(o-t-n,0),math.min(o,y()-b())},b=function(){return math.max(document.documentelement.clientheight,e.innerheight||0)},y=function(){return math.max(document.body.scrollheight,document.documentelement.scrollheight,document.body.offsetheight,document.documentelement.offsetheight,document.body.clientheight,document.documentelement.clientheight)},v=function(e){return e&&"object"==typeof json&&"function"==typeof json.parse?json.parse(e):{}},o=function(e){return e?d(e)+e.offsettop:0},s=function(t,n,o){o||(t.focus(),document.activeelement.id!==t.id&&(t.setattribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollto(0,n))};l.animatescroll=function(n,o,i){var l=v(o?o.getattribute("data-options"):null),s=f(t||u,i||{},l),d="[object number]"===object.prototype.tostring.call(n),h=d||!n.tagname?null:n;if(d||h){var m=e.pageyoffset;s.selectorheader&&!r&&(r=document.queryselector(s.selectorheader)),a||(a=o(r));var b,e,i=d?n:p(h,a,parseint("function"==typeof s.offset?s.offset():s.offset,10)),h=i-m,a=y(),j=0,c=function(t,r,a){var i=e.pageyoffset;(t==r||i==r||e.innerheight+i>=a)&&(clearinterval(a),s(n,r,d),s.after(n,o))},m=function(){j+=16,b=j/parseint(s.speed,10),b=b>1?1:b,e=m+h*g(s,b),e.scrollto(0,math.floor(e)),c(e,i,c)};0===e.pageyoffset&&e.scrollto(0,0),s.before(n,o),(function(){clearinterval(c),c=setinterval(m,16)})()}};var e=function(t){try{m(decodeuricomponent(e.location.hash))}catch(t){m(e.location.hash)}n&&(n.id=n.getattribute("data-scroll-id"),l.animatescroll(n,o),n=null,o=null)},i=function(r){if(0===r.button&&!r.metakey&&!r.ctrlkey&&(o=h(r.target,t.selector))&&"a"===o.tagname.tolowercase()&&!h(r.target,t.ignore)&&o.hostname===e.location.hostname&&o.pathname===e.location.pathname&&/#/.test(o.href)){var a;try{a=m(decodeuricomponent(o.hash))}catch(e){a=m(o.hash)}if("#"===a){r.preventdefault(),n=document.body;var i=n.id?n.id:"smooth-scroll-top";return n.setattribute("data-scroll-id",i),n.id="",void(e.location.hash.substring(1)===i?e():e.location.hash=i)}n=document.queryselector(a),n&&(n.setattribute("data-scroll-id",n.id),n.id="",o.hash===e.location.hash&&(r.preventdefault(),e()))}},h=function(e){i||(i=settimeout((function(){i=null,a=o(r)}),66))};return l.destroy=function(){t&&(document.removeeventlistener("click",i,!1),e.removeeventlistener("resize",h,!1),t=null,n=null,o=null,r=null,a=null,i=null,c=null)},l.init=function(n){s&&(l.destroy(),t=f(u,n||{}),r=t.selectorheader?document.queryselector(t.selectorheader):null,a=o(r),document.addeventlistener("click",i,!1),e.addeventlistener("hashchange",e,!1),r&&e.addeventlistener("resize",h,!1))},l}));