import{g as t}from"./p-4f9c953c.js";function n(n="",o=!0){return(s,e)=>{"__slots"in s||(s.__slots={}),"slot"in s||(s.__slot=null);const{componentDidLoad:l,disconnectedCallback:c}=s;function a(){const l=t(this),c=function(t,n){const o=n?`slot[name="${n}"]`:"slot:not([name])";return t.shadowRoot?t.shadowRoot.querySelector(o):t.querySelector(o)}(l,n),a=s[e].bind(this,c),i={slot:c,host:l,slotName:n,handler:a};c?(""==n?s.__slot=i:s.__slots[n]=i,c.addEventListener("slotChange",a),o&&a()):console.error("The requested slot was not found")}s.componentDidLoad=function(){return a.apply(this),l&&l.apply(this)},s.disconnectedCallback=function(){return s.__slot&&(s.__slot.slot.removeEventListener("slotChange",s.__slot.handler),s.__slot=null),Object.values(s.__slots).forEach(({slotName:t,slot:n,handler:o})=>{n.removeEventListener("slotChange",o),delete s.__slots[t]}),c&&c.apply(this)}}}export{n as S}