import { h, Host } from "@stencil/core";
export class ModalHeader {
    constructor() {
        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: 'b115e1393596c7d7124ce8b3015e4a2c4c56dcd4', class: "bal-modal__header" }, h("div", { key: '06407c1c1848ea62615f30aaa13966facb3e5246', class: "bal-modal__header__title" }, h("bal-heading", { key: 'c0784a83d66a5d28e028fc66f26b8ef72f5689df', level: "h2", space: "none" }, h("slot", { key: '41a254e6b622293d5ef84a65e7b0c02241bc7014' }))), ((_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 })) : ('')));
    }
    static get is() { return "bal-modal-header"; }
    static get elementRef() { return "el"; }
}
