import{u as t,p as e}from"./p-8cd54418.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const o=o=>{let f,l,d,p=10*-u,v=0;const m=o.getBoolean("animated",!0)&&o.getBoolean("rippleEffect",!0),h=new WeakMap,w=e=>{p=t(e),x(e)},T=()=>{clearTimeout(d),d=void 0,f&&(k(!1),f=void 0)},b=t=>{f||D(i(t),t)},x=t=>{D(void 0,t)},D=(t,o)=>{if(t&&t===f)return;clearTimeout(d),d=void 0;const{x:i,y:r}=e(o);if(f){if(h.has(f))throw new Error("internal error");f.classList.contains(c)||E(f,i,r),k(!0)}if(t){const e=h.get(t);e&&(clearTimeout(e),h.delete(t));const o=n(t)?0:a;t.classList.remove(c),d=setTimeout((()=>{E(t,i,r),d=void 0}),o)}f=t},E=(t,e,o)=>{if(v=Date.now(),t.classList.add(c),!m)return;const i=r(t);null!==i&&(j(),l=i.addRipple(e,o))},j=()=>{void 0!==l&&(l.then((t=>t())),l=void 0)},k=t=>{j();const e=f;if(!e)return;const o=s-Date.now()+v;if(t&&o>0&&!n(e)){const t=setTimeout((()=>{e.classList.remove(c),h.delete(e)}),s);h.set(e,t)}else e.classList.remove(c)},y=document;y.addEventListener("ionGestureCaptured",T),y.addEventListener("touchstart",(e=>{p=t(e),b(e)}),!0),y.addEventListener("touchcancel",w,!0),y.addEventListener("touchend",w,!0),y.addEventListener("pointercancel",T,!0),y.addEventListener("mousedown",(e=>{if(2===e.button)return;const o=t(e)-u;p<o&&b(e)}),!0),y.addEventListener("mouseup",(e=>{const o=t(e)-u;p<o&&x(e)}),!0)},i=t=>{if(void 0===t.composedPath)return t.target.closest(".ion-activatable");{const e=t.composedPath();for(let t=0;t<e.length-2;t++){const o=e[t];if(!(o instanceof ShadowRoot)&&o.classList.contains("ion-activatable"))return o}}},n=t=>t.classList.contains("ion-activatable-instant"),r=t=>{if(t.shadowRoot){const e=t.shadowRoot.querySelector("ion-ripple-effect");if(e)return e}return t.querySelector("ion-ripple-effect")},c="ion-activated",a=200,s=200,u=2500;export{o as startTapClick}