/*! * (C) Ionic http://ionicframework.com - MIT License */ import{r as t,e as a,w as n,h as i,i as e,f as o}from"./p-9ad82dba.js";import{b as r}from"./p-6994c97a.js";const s=class{constructor(a){t(this,a),this.type="bounded"}async addRipple(t,i){return new Promise((e=>{a((()=>{const a=this.el.getBoundingClientRect(),o=a.width,r=a.height,s=Math.sqrt(o*o+r*r),l=Math.max(r,o),d=this.unbounded?l:s+m,u=Math.floor(l*f),p=d/u;let b=t-a.left,w=i-a.top;this.unbounded&&(b=.5*o,w=.5*r);const k=b-.5*u,y=w-.5*u,h=.5*o-b,g=.5*r-w;n((()=>{const t=document.createElement("div");t.classList.add("ripple-effect");const a=t.style;a.top=y+"px",a.left=k+"px",a.width=a.height=u+"px",a.setProperty("--final-scale",`${p}`),a.setProperty("--translate-end",`${h}px, ${g}px`),(this.el.shadowRoot||this.el).appendChild(t),setTimeout((()=>{e((()=>{c(t)}))}),325)}))}))}))}get unbounded(){return"unbounded"===this.type}render(){const t=r(this);return i(o,{key:"ca0ab0deaa7902cbc95e62d4b0c5baeac4387b41",role:"presentation",class:{[t]:!0,unbounded:this.unbounded}})}get el(){return e(this)}},c=t=>{t.classList.add("fade-out"),setTimeout((()=>{t.remove()}),200)},m=10,f=.5;s.style=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;-webkit-animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1));-webkit-animation:150ms fadeOutAnimation forwards;animation:150ms fadeOutAnimation forwards}@-webkit-keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@-webkit-keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@-webkit-keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}@keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}";export{s as ion_ripple_effect}