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