import { h } from "@stencil/core";
export class BpSdkNextButton {
    constructor() {
        this.text = '';
        this.icon = 'chevron-right';
        this.buttonDisabled = false;
        this.cssClasses = undefined;
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-next-button');
        customElements.whenDefined('bp-sdk-external-next-button').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-next-button", { buttonDisabled: this.buttonDisabled, cssClasses: this.cssClasses, icon: this.icon, text: this.text }));
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-next-button__container" }, h("bp-sdk-button", { onClick: () => this.navigateNext.emit(), text: this.text, buttonDisabled: this.buttonDisabled, class: this.cssClasses }, h("bp-sdk-icon-container", { name: this.icon }))));
    }
    static get is() { return "bp-sdk-next-button"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-next-button.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-next-button.css"]
        };
    }
    static get properties() {
        return {
            "text": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Forward button text"
                },
                "attribute": "text",
                "reflect": false,
                "defaultValue": "''"
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Icon name"
                },
                "attribute": "icon",
                "reflect": false,
                "defaultValue": "'chevron-right'"
            },
            "buttonDisabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Controls disabled state of button"
                },
                "attribute": "button-disabled",
                "reflect": false,
                "defaultValue": "false"
            },
            "cssClasses": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Extra CSS classes to be added onto the next button"
                },
                "attribute": "css-classes",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
    static get events() {
        return [{
                "method": "navigateNext",
                "name": "navigateNext",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Navigate event"
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }];
    }
}
