import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';

const BsTabPanel$1 = /*@__PURE__*/ proxyCustomElement(class BsTabPanel extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.activeTabId = undefined;
    this.tabId = undefined;
  }
  get isActive() {
    return this.activeTabId && this.activeTabId === this.tabId;
  }
  get panelId() {
    return this.hostEl.id || `${this.tabId}-panel`;
  }
  // avoid unnecessary re-renders
  componentShouldUpdate(newValue, oldValue, propName) {
    if (newValue === oldValue)
      return false;
    if (propName === 'activeTabId') {
      return newValue === this.tabId || oldValue === this.tabId;
    }
  }
  render() {
    return (h(Host, { id: this.panelId, "aria-labelledby": this.tabId, "data-active": this.isActive, role: "tabpanel" }, h("slot", null)));
  }
  get hostEl() { return this; }
}, [4, "bs-tab-panel", {
    "activeTabId": [1, "active-tab-id"],
    "tabId": [1, "tab-id"]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["bs-tab-panel"];
  components.forEach(tagName => { switch (tagName) {
    case "bs-tab-panel":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, BsTabPanel$1);
      }
      break;
  } });
}

const BsTabPanel = BsTabPanel$1;
const defineCustomElement = defineCustomElement$1;

export { BsTabPanel, defineCustomElement };

//# sourceMappingURL=bs-tab-panel.js.map