import{c as t,M as s,V as i}from"./p-dcc98162.js";import{O as e}from"./p-331a62d5.js";import{C as c}from"./p-816f6fc6.js";import{b as n}from"./p-2ade684f.js";var o=function(t,s,i,e){var c,n=arguments.length,o=n<3?s:null===e?e=Object.getOwnPropertyDescriptor(s,i):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,i,e);else for(var a=t.length-1;a>=0;a--)(c=t[a])&&(o=(n<3?c(o):n>3?c(s,i,o):c(s,i))||o);return n>3&&o&&Object.defineProperty(s,i,o),o};class a extends i{constructor(t,s,i){super(),this.acceptableResultMap=new WeakMap,this.isAcceptableObserverPayload=t=>{let s=!1;return"function"==typeof this.customAcceptableHandle?s=this.customAcceptableHandle(t):this.host&&t.host&&(this.acceptableResultMap.has(t.host)?s=!!this.acceptableResultMap.get(t.host):(s=this.host!==t.host&&n(t.host,this.host),this.acceptableResultMap.set(t.host,s))),s},this.handleObserver=t=>{"function"==typeof this.callback&&this.callback(t)},this.subject=t,this.callback=s,this.customAcceptableHandle=i}connectedCallback(){this.subject&&(this.notifyObserver=new e(this.isAcceptableObserverPayload.bind(this),this.handleObserver),c.register(this.subject,this.notifyObserver))}disconnectedCallback(){this.subject&&c.unregister(this.subject,this.notifyObserver)}}o([t()],a.prototype,"host",void 0),o([s("connectedCallback")],a.prototype,"connectedCallback",null),o([s("disconnectedCallback")],a.prototype,"disconnectedCallback",null);export{a as C}