import{b as t}from"./p-e680e7e4.js";class s{constructor(t){this.notifyCallback=t,this.observers=[]}attach(t){if(this.observers.includes(t))return console.log("Subject: Observer has been attached already.");this.observers.push(t)}detach(t){const s=this.observers.indexOf(t);if(-1===s)return console.log("Subject: Nonexistent observer.");this.observers.splice(s,1)}notify(t){for(const s of this.observers)"function"==typeof s?s(t):this.notifyCallback&&this.notifyCallback(s,t)}}class i{constructor(t){this.notifyCallback=t}attach(t){this.observer=t}detach(){this.observer=void 0}notify(t){this.observer&&("function"==typeof this.observer?this.observer(t):this.notifyCallback&&this.notifyCallback(this.observer,t))}}class e extends s{constructor(){super(...arguments),this.el=void 0}connect(s){s?this.el=s:t.hasWindow&&(this.el=window)}disconnect(){this.el=void 0}add(t){super.attach(t)}remove(t){super.detach(t)}}export{e as L,s as S,i as a}