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