import{onBeforeUnmount as e,onMounted as t}from"vue";function n(n,r,i){function a(e){let t=e.target;t.shadowRoot&&e.composed&&(t=e.composedPath()[0]||t);let a=[n[0]?.value,n[1]?.value?.getPopupElement()];r.value&&a.every(e=>e&&!e.contains(t)&&e!==t)&&i(!1)}t(()=>{window.addEventListener(`mousedown`,a)}),e(()=>{window.removeEventListener(`mousedown`,a)})}export{n as default};