'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-ceff47a0.js');
const index_esm_min = require('./index.esm.min-2e158fd8.js');

const bpSdkButtonCss = ".bp-sdk-button{--bp-sdk-button-color:var(--theme-color);color:var(--bp-sdk-button-color)}.bp-sdk-button__text{pointer-events:none}";
const BpSdkButtonStyle0 = bpSdkButtonCss;

const BpSdkButton = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.text = undefined;
        this.buttonId = index_esm_min.e$(8);
        this.buttonDisabled = false;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-button');
        customElements.whenDefined('bp-sdk-external-button').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (index.h("bp-sdk-external-button", { buttonId: this.buttonId, text: this.text, buttonDisabled: this.buttonDisabled }, index.h("slot", null)));
    }
    renderInternal() {
        return (index.h("button", { type: "button", class: "bp-sdk-button", id: this.buttonId, disabled: this.buttonDisabled }, index.h("slot", null), index.h("span", { class: "bp-sdk-button__text" }, this.text)));
    }
};
BpSdkButton.style = BpSdkButtonStyle0;

exports.bp_sdk_button = BpSdkButton;
