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