import { h } from "@stencil/core";
export class BpSdkCreateAppForm {
    constructor() {
        this.createAppFormHandler = undefined;
        this.buttonDisabled = false;
        this.text = 'Create New App Form';
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-create-app-form');
        customElements.whenDefined('bp-sdk-external-create-app-form').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-create-app-form", { buttonDisabled: this.buttonDisabled, createAppFormHandler: this.createAppFormHandler, text: this.text }));
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-create-app-form__container" }, h("bp-sdk-create-app-form-button", { text: this.text, buttonDisabled: this.buttonDisabled, onClick: this.createAppFormHandler })));
    }
    static get is() { return "bp-sdk-create-app-form"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-create-app-form.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-create-app-form.css"]
        };
    }
    static get properties() {
        return {
            "createAppFormHandler": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "() => void",
                    "resolved": "() => void",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "On create app form handler"
                }
            },
            "buttonDisabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is button disabled"
                },
                "attribute": "button-disabled",
                "reflect": false,
                "defaultValue": "false"
            },
            "text": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Text to display"
                },
                "attribute": "text",
                "reflect": false,
                "defaultValue": "'Create New App Form'"
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
