import { h } from "@stencil/core";
export class BpSdkQuoteRequestLogo {
    constructor() {
        this.logoUrl = undefined;
        this.name = undefined;
        this.showLogo = undefined;
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-quote-request-logo');
        customElements.whenDefined('bp-sdk-external-quote-request-logo').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-quote-request-logo", { logoUrl: this.logoUrl, name: this.name, showLogo: this.showLogo });
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-quote-request-logo__container" }, this.showLogo && h("img", { class: "bp-sdk-online-quote__carrier-logo bp-sdk-quote__carrier-logo", src: this.logoUrl, alt: this.name })));
    }
    static get is() { return "bp-sdk-quote-request-logo"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-quote-request-logo.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-quote-request-logo.css"]
        };
    }
    static get properties() {
        return {
            "logoUrl": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Logo url"
                },
                "attribute": "logo-url",
                "reflect": false
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Carrier name"
                },
                "attribute": "name",
                "reflect": false
            },
            "showLogo": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Show logo"
                },
                "attribute": "show-logo",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
