import { r as registerInstance, h } from './index-77a9c9e7.js';

const bpSdkNotificationCss = "";
const BpSdkNotificationStyle0 = bpSdkNotificationCss;

const BpSdkNotification = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.notification = undefined;
        this.removeNotification = undefined;
        this.text = undefined;
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-notification');
        customElements.whenDefined('bp-sdk-external-notification').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-notification", { notification: this.notification, text: this.text, removeNotification: this.removeNotification });
    }
    renderInternal() {
        var _a;
        return (h("div", { class: "bp-sdk-notification__container" }, h("div", { class: "bp-sdk-notification_button__container" }, h("button", { type: "button", onClick: () => this.removeNotification(this.notification) }, !!this.text ? this.text : 'Close')), h("div", { innerHTML: (_a = this.notification) === null || _a === void 0 ? void 0 : _a.notification })));
    }
};
BpSdkNotification.style = BpSdkNotificationStyle0;

export { BpSdkNotification as bp_sdk_notification };
