const p = (t, e = null) => {
  const s = e || t.currentTarget, o = s.getBoundingClientRect(), n = document.createElement("span"), c = Math.max(s.clientWidth, s.clientHeight), i = c / 2;
  if (n.style.width = n.style.height = `${c}px`, t instanceof MouseEvent && (n.style.left = `${t.clientX - o.left - i}px`, n.style.top = `${t.clientY - o.top - i}px`), window.TouchEvent && t instanceof window.TouchEvent) {
    const a = t.touches[0];
    n.style.left = `${a.clientX - o.left - i}px`, n.style.top = `${a.clientY - o.top - i}px`;
  }
  n.classList.add("btn-ripple");
  const l = s.getElementsByClassName("btn-ripple")[0];
  l && l.remove(), s.appendChild(n), setTimeout(() => n.remove(), 1e3);
}, u = (t) => {
  if (!t || !t.className)
    return !1;
  const { className: e = "" } = t;
  if (typeof e != "string")
    return !1;
  const s = e.includes("btn "), o = !e.includes("btn-component"), n = !e.includes("btn-link"), c = !e.includes("close"), i = !e.includes("btn-action"), l = !e.includes("disabled");
  return s && o && l && n && c && i;
}, r = (t) => {
  const e = t.target;
  if (e) {
    const s = u(e), o = !s && u(e.parentElement);
    (s || o) && p(t, o ? e.parentElement : e);
  }
};
((t) => {
  t && (t.addEventListener("mousedown", r, !1), t.addEventListener("touchstart", r, !1));
})(document);
export {
  p as createButtonRipple
};
//# sourceMappingURL=buttonEffect.js.map
