"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("@vueuse/core");require("../../scroll-bar/index.js");const u=require("../../scroll-bar/utils/index.js"),l={horizontal:"x",vertical:"y"},d=()=>{},S=e=>1-(1-e)**3,f=({scrollOffset:e,maxScrollDistance:m,timer:p=500,onScroll:r=d,onScrollEnd:g=d})=>{let a,t,c;const{pause:o,resume:T,isActive:b}=R.useRafFn(()=>{const n=Date.now(),s=l[t],y=n-a,i=u.ensureRangeValue(y/p,0,1),D=S(i);i===1?(e[s]=0,o(),r(t),g(t)):(e[s]=u.ensureRangeValue(c*(1-D),0,m[s]),r(t))},{immediate:!1});function q(n){t=n,a=Date.now(),c=e[l[n]],T()}function v(){o()}return{start:q,stop:v,isActive:b}};exports.useScrollBack=f;
