import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { d as defineCustomElement$4 } from './bal-close2.js';
import { d as defineCustomElement$3 } from './bal-heading2.js';
import { d as defineCustomElement$2 } from './bal-icon2.js';

const ModalHeader = /*@__PURE__*/ proxyCustomElement(class ModalHeader extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.closeHandler = () => {
            if (this.parentModal) {
                this.parentModal.dismiss(undefined, 'model-close');
            }
        };
    }
    get parentModal() {
        return this.el.closest('bal-modal');
    }
    render() {
        var _a;
        return (h(Host, { key: '9c524259d6f60c57d7d682e5453e7abb2432bfe0', class: "bal-modal__header" }, h("div", { key: '7597f303fba32bb3a28b6bf9775b368bb92d1c43', class: "bal-modal__header__title" }, h("bal-heading", { key: 'a7c072e997d9a6863683a895a0b71441abbb1b46', level: "h2", space: "none" }, h("slot", { key: '72f19ac646649a03f1b27c01b10dbad411c6e61d' }))), ((_a = this.parentModal) === null || _a === void 0 ? void 0 : _a.isClosable) ? (h("bal-close", { class: "bal-modal__header__close data-test-modal-close", onClick: this.closeHandler })) : ('')));
    }
    get el() { return this; }
}, [4, "bal-modal-header"]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["bal-modal-header", "bal-close", "bal-heading", "bal-icon"];
    components.forEach(tagName => { switch (tagName) {
        case "bal-modal-header":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, ModalHeader);
            }
            break;
        case "bal-close":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "bal-heading":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "bal-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const BalModalHeader = ModalHeader;
const defineCustomElement = defineCustomElement$1;

export { BalModalHeader, defineCustomElement };
