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