let e=require("vue");var t=14/15;function n(n,r,i){let a=!1,o=0,s=null,c=null,l=()=>{s&&(s.removeEventListener(`touchmove`,u),s.removeEventListener(`touchend`,d))},u=e=>{if(a){let n=Math.ceil(e.touches[0].pageY),r=o-n;o=n,i(r)&&e.preventDefault(),clearInterval(c),c=setInterval(()=>{r*=t,(!i(r,!0)||Math.abs(r)<=.1)&&clearInterval(c)},16)}},d=()=>{a=!1,l()},f=e=>{l(),e.touches.length===1&&!a&&(a=!0,o=Math.ceil(e.touches[0].pageY),s=e.target,s.addEventListener(`touchmove`,u,{passive:!1}),s.addEventListener(`touchend`,d))},p=()=>{};(0,e.onMounted)(()=>{document.addEventListener(`touchmove`,p,{passive:!1}),(0,e.watch)(n,e=>{r.value.removeEventListener(`touchstart`,f),l(),clearInterval(c),e&&r.value.addEventListener(`touchstart`,f,{passive:!1})},{immediate:!0})}),(0,e.onBeforeUnmount)(()=>{document.removeEventListener(`touchmove`,p)})}exports.default=n;