import{defineComponent as u,getCurrentInstance as f,computed as v,onMounted as p,watch as b,nextTick as g,onBeforeUnmount as h}from"vue";import C from"../../config-provider/hooks/useConfigInject.mjs";import N from"../../vc-util/Dom/isVisible.mjs";import k from"../classNames.mjs";import{findDOMNode as a}from"../props-util/index.mjs";import w from"./style.mjs";import E from"./useWave.mjs";const A=u({compatConfig:{MODE:3},name:"Wave",props:{disabled:Boolean},setup(n,{slots:c}){const o=f(),{prefixCls:r,wave:d}=C("wave",n),[,l]=w(r),m=E(v(()=>k(r.value,l.value)),d);let t;const i=()=>{a(o).removeEventListener("click",t,!0)};return p(()=>{b(()=>n.disabled,()=>{i(),g(()=>{const e=a(o);e?.removeEventListener("click",t,!0),!(!e||e.nodeType!==1||n.disabled)&&(t=s=>{s.target.tagName==="INPUT"||!N(s.target)||!e.getAttribute||e.getAttribute("disabled")||e.disabled||e.className.includes("disabled")||e.className.includes("-leave")||m()},e.addEventListener("click",t,!0))})},{immediate:!0,flush:"post"})}),h(()=>{i()}),()=>c.default?.()[0]}});export{A as default};
