/* https://github.com/estrattonbailey/updwn */
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):n.updwn=e()}(this,function(){var n=null,e=null,t=u(),i=t.x,r=t.y,o=[];function u(){return"undefined"==typeof window?{}:{x:window.innerWidth,y:window.pageYOffset}}function f(n){requestAnimationFrame(function(){for(var e=u(),t=e.x,f=e.y,d=0;d<o.length;d++)o[d]({y:f,prevY:r,x:t,prevX:i},n);r=f,i=t})}return function(t){var i=t.speed;void 0===i&&(i=20);var r=t.interval;void 0===r&&(r=100);var u,d=null,p=0,a=0,s=[],l=[];return u=function(n,e){var t=n.y,o=n.prevY;p=e.timeStamp-a,a=e.timeStamp;var u=(Math.abs(t-o)/p||0)*r>i;if(t>=o&&"down"!==d&&u){d="down";for(var f=0;f<l.length;f++)l[f]()}else if(t<=o&&"up"!==d&&u){d="up";for(var v=0;v<s.length;v++)s[v]()}},n||window.addEventListener("scroll",f),e||window.addEventListener("resize",f),o.indexOf(u)<0&&o.push(u),{up:function(n){return s.indexOf(n)<0&&s.push(n),function(){return s.splice(s.indexOf(n),1)}},down:function(n){return l.indexOf(n)<0&&l.push(n),function(){return l.splice(l.indexOf(n),1)}},get position(){return d}}}});
