import{Db as a,E as r,Jb as u,Sa as g,Sb as f,V as n,Za as o,be as h,ka as c,na as d}from"./chunk-WL5U2YIT.js";import{e as m}from"./chunk-ADEKKGI2.js";var y,p=m(()=>{d();g();h();h();y=(()=>{let e=class e{constructor(t){this._elRef=t,this.listening=!1,this.clickOutside=new a}ngOnInit(){this.globalClick=r(document,"click").pipe(n(1),c(()=>{this.listening=!0})).subscribe(t=>{this.onGlobalClick(t)})}ngOnDestroy(){this.globalClick&&this.globalClick.unsubscribe()}onGlobalClick(t){t instanceof MouseEvent&&this.listening===!0&&(this.isDescendant(this._elRef.nativeElement,t.target)===!0?this.clickOutside.emit({target:t.target||null,value:!1}):this.clickOutside.emit({target:t.target||null,value:!0}))}isDescendant(t,l){let i=l;for(;i!==null;){if(i===t)return!0;i=i.parentNode}return!1}};e.\u0275fac=function(l){return new(l||e)(u(o))},e.\u0275dir=f({type:e,selectors:[["","sdClickOutside",""]],outputs:{clickOutside:"clickOutside"}});let s=e;return s})()});export{y as a,p as b};
