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