import{bd as c}from"./index-BKKvzUDD.js";const s="_RepeatClick",f={beforeMount(t,n){const e=n.value,{interval:d=100,delay:l=600}=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{f as v};
