import { h } from "@stencil/core";
import { generateId } from "@boldpenguin/sdk-utility";
export class BpSdkQuoteRequestCoverageItem {
    constructor() {
        this.amount = undefined;
        this.description = undefined;
        this.useExternal = false;
        this.descriptionId = generateId(8);
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-quote-request-coverage-item');
        customElements.whenDefined('bp-sdk-external-quote-request-coverage-item').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-quote-request-coverage-item", { amount: this.amount, description: this.description });
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-quote-request-coverage-item__container bp-sdk-online-quote__coverage-container bp-sdk-quote__coverage-container" }, h("span", { class: "bp-sdk-quote-request-coverage-item__description bp-sdk-online-quote__coverage-desc bp-sdk-quote__coverage-desc" }, this.description), h("span", { class: "bp-sdk-quote-request-coverage-item__separator" }, ":"), h("span", { class: "bp-sdk-quote-request-coverage-item__amount bp-sdk-online-quote__coverage-value bp-sdk-quote__coverage-value" }, this.amount)));
    }
    static get is() { return "bp-sdk-quote-request-coverage-item"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-quote-request-coverage-item.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-quote-request-coverage-item.css"]
        };
    }
    static get properties() {
        return {
            "amount": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Coverage amount"
                },
                "attribute": "amount",
                "reflect": false
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Coverage description"
                },
                "attribute": "description",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {},
            "descriptionId": {}
        };
    }
}
