import{u as t,p as e}from"./p-f44f0a67.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 w=new WeakMap;const T=e=>{a=t(e);E(e)};const v=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=()=>{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}clearTimeout(m);m=undefined;const{x:o,y:i}=e(n);if(l){if(w.has(l)){throw new Error("internal error")}if(!l.classList.contains(s)){y(l,o,i)}G(true)}if(t){const e=w.get(t);if(e){clearTimeout(e);w.delete(t)}const n=c(t)?0:r;t.classList.remove(s);m=setTimeout((()=>{y(t,o,i);m=undefined}),n)}l=t};const y=(t,e,n)=>{d=Date.now();t.classList.add(s);const o=h&&i(t);if(o&&o.addRipple){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&&!c(e)){const t=setTimeout((()=>{e.classList.remove(s);w.delete(e)}),u);w.set(e,t)}else{e.classList.remove(s)}};const M=document;M.addEventListener("ionGestureCaptured",D);M.addEventListener("touchstart",T,true);M.addEventListener("touchcancel",v,true);M.addEventListener("touchend",v,true);M.addEventListener("pointercancel",D,true);M.addEventListener("mousedown",b,true);M.addEventListener("mouseup",x,true)};const o=t=>{if(t.composedPath){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 c=t=>t.classList.contains("ion-activatable-instant");const i=t=>{if(t.shadowRoot){const e=t.shadowRoot.querySelector("ion-ripple-effect");if(e){return e}}return t.querySelector("ion-ripple-effect")};const s="ion-activated";const r=200;const u=200;const f=2500;export{n as startTapClick};
//# sourceMappingURL=p-843f392f.js.map