import{easeInOutCubic as p}from"./easings.mjs";import u,{isWindow as w}from"./getScroll.mjs";import l from"./raf.mjs";function g(i,r={}){const{getContainer:a=()=>window,callback:c,duration:t=450}=r,o=a(),m=u(o),f=Date.now(),s=()=>{const n=Date.now()-f,e=p(n>t?t:n,m,i,t);w(o)?o.scrollTo(window.scrollX,e):o instanceof Document?o.documentElement.scrollTop=e:o.scrollTop=e,n<t?l(s):typeof c=="function"&&c()};l(s)}export{g as default};
