import{r as t,c as s,h as a,H as e,a as i}from"./p-DBTJNfo7.js";import{d as h}from"./p-z_E3sq3p.js";const o=class{constructor(a){t(this,a),this.changeTab=s(this,"changeTab"),this.tabs=[],this.slotElements=[],this.handleChangeTabs=this.handleChangeTabs.bind(this),this.setSlotElements=this.setSlotElements.bind(this),this.setTabStatus=this.setTabStatus.bind(this)}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}initialize(){const t=this.getSlot();t&&(t.addEventListener("slotchange",this.setSlotElements),this.setSlotElements(),this.tabs.forEach(this.setTabStatus))}disconnectedCallback(){this.getSlot().removeEventListener("slotchange",this.setSlotElements)}tabsChanged(){this.hidePanels(),this.tabs.forEach(this.setTabStatus)}render(){return a(e,{key:"72cfa3773a3e1a963d2212dbab203d85a9b0a0c6",onChangeTab:this.handleChangeTabs},a("div",{key:"1faa5cd3c361acce5141a27791fb0fb401dab968",class:"tab-panel"},a("limel-tab-bar",{key:"c7b9cef34448d5e96d3ddb851a0e2bdca876ee80",tabs:this.tabs}),a("div",{key:"b1cba255e44496a03f7bffcea062e0686b2725f2",class:"tab-content"},a("slot",{key:"44152fc36221478d7d8656a8e199e36044584283"}))))}setSlotElements(){const t=this.getSlot();this.hidePanels(),this.slotElements=Array.prototype.slice.call(t.assignedElements()),this.tabs.forEach(this.setTabStatus)}setTabStatus(t){const s=this.slotElements.find((s=>s.id===t.id));s&&(s.style.display=t.active?"":"none",s.tab=t)}handleChangeTabs(t){this.tabs=this.tabs.map((s=>s.id===t.detail.id?t.detail:s)),this.setTabStatus(t.detail),setTimeout(h)}getSlot(){return this.host.shadowRoot.querySelector("slot")}hidePanels(){for(const t of this.slotElements)t.style.display="none"}get host(){return i(this)}static get watchers(){return{tabs:[{tabsChanged:0}]}}};o.style=":host(limel-tab-panel){--tab-panel-background-color:rgb(var(--contrast-100));display:block;height:100%}.tab-panel{height:100%;position:relative;display:flex;flex-direction:column}.tab-content{height:100%;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;background-color:var(--tab-panel-background-color)}";export{o as limel_tab_panel}