"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),c=require("../../scroll-bar/utils/index.js"),z=()=>{const e=t.shallowRef(),a=t.reactive({x:0,y:0}),i=t.reactive({x:0,y:0}),n=t.shallowRef(),s=t.shallowRef();t.watch(()=>e.value,()=>{u()});function u(){const l=t.unref(e);if(!l)return;const{visibleSize:o,totalSize:r}=c.getScrollable(l,"horizontal"),{visibleSize:S,totalSize:b}=c.getScrollable(l,"vertical");a.x=r-o,a.y=b-S}function v(){if(!e.value)return;const{totalSize:l,visibleSize:o}=c.getScrollable(e.value,"vertical"),r=i.y/(l-o||1)*100;s.value?.scroll(r)}function f(){if(!e.value)return;const{totalSize:l,visibleSize:o}=c.getScrollable(e.value,"horizontal"),r=i.x/(l-o||1)*100;n.value?.scroll(r)}return{maxScrollDistance:a,scrollOffset:i,xBarRef:n,yBarRef:s,scrollYBar:v,scrollXBar:f,containerRef:e,updateMaxScrollDistance:u}};exports.default=z;
