'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 bpSdkDriverQuestionSetButtonCss = "";
const BpSdkDriverQuestionSetButtonStyle0 = bpSdkDriverQuestionSetButtonCss;

const BpSdkDriverQuestionSetButton = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.text = '';
        this.buttonId = index_esm_min.e$(8);
        this.buttonDisabled = false;
        this.extraCssClasses = undefined;
        this.useExternal = false;
        this.cssClasses = 'bp-sdk-driver-question-set-button__container';
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-driver-question-set-button');
        customElements.whenDefined('bp-sdk-external-driver-question-set-button').then(() => {
            this.useExternal = true;
        });
        this.calculateButtonClasses(this.extraCssClasses);
    }
    calculateButtonClasses(extraClasses = '') {
        this.cssClasses = `bp-sdk-driver-question-set-button__container ${extraClasses}`;
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return index.h("bp-sdk-external-driver-question-set-button", { class: this.extraCssClasses, text: this.text, buttonId: this.buttonId, buttonDisabled: this.buttonDisabled });
    }
    renderInternal() {
        return index.h("bp-sdk-button", { class: this.cssClasses, text: this.text, buttonId: this.buttonId, buttonDisabled: this.buttonDisabled });
    }
    static get watchers() { return {
        "extraCssClasses": ["calculateButtonClasses"]
    }; }
};
BpSdkDriverQuestionSetButton.style = BpSdkDriverQuestionSetButtonStyle0;

exports.bp_sdk_driver_question_set_button = BpSdkDriverQuestionSetButton;
