import{a9 as c}from"./index-XuO881sr.js";const m=100,E=600,s="_RepeatClick",p={beforeMount(t,n){const e=n.value,{interval:d=m,delay:l=E}=c(e)?{}:e;let o,r;const i=()=>c(e)?e():e.handler(),a=()=>{r&&(clearTimeout(r),r=void 0),o&&(clearInterval(o),o=void 0)},u=v=>{v.button===0&&(a(),i(),document.addEventListener("mouseup",a,{once:!0}),r=setTimeout(()=>{o=setInterval(()=>{i()},d)},l))};t[s]={start:u,clear:a},t.addEventListener("mousedown",u)},unmounted(t){if(!t[s])return;const{start:n,clear:e}=t[s];n&&t.removeEventListener("mousedown",n),e&&(e(),document.removeEventListener("mouseup",e)),t[s]=null}};export{p as v};
