import{af as n,ck as e,aZ as t}from"./index-ip5gDR6L.js";const o=new Map;if(t){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of o.values())for(const{documentHandler:o}of t)o(e,n);n=void 0}})}function a(t,o){let a=[];return n(o.arg)?a=o.arg:e(o.arg)&&a.push(o.arg),function(n,e){const s=o.instance.popperRef,d=n.target,i=null==e?void 0:e.target,u=!o||!o.instance,c=!d||!i,l=t.contains(d)||t.contains(i),r=t===d,f=a.length&&a.some(n=>null==n?void 0:n.contains(d))||a.length&&a.includes(i),g=s&&(s.contains(d)||s.contains(i));u||c||l||r||f||g||o.value(n,e)}}const s={beforeMount(n,e){o.has(n)||o.set(n,[]),o.get(n).push({documentHandler:a(n,e),bindingFn:e.value})},updated(n,e){o.has(n)||o.set(n,[]);const t=o.get(n),s=t.findIndex(n=>n.bindingFn===e.oldValue),d={documentHandler:a(n,e),bindingFn:e.value};s>=0?t.splice(s,1,d):t.push(d)},unmounted(n){o.delete(n)}};export{s as C};
