import { h } from "@stencil/core";
export class BpSdkQuoteRequestVehicleCoverage {
    constructor() {
        this.vehicles = [];
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-quote-request-vehicle-coverage');
        customElements.whenDefined('bp-sdk-external-quote-request-vehicle-coverage').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-quote-request-vehicle-coverage", { vehicles: this.vehicles });
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-quote-request-vehicle-coverage__container" }, this.vehicles.map((vehicle) => (h("div", { class: "bp-sdk-online-quote__coverages-vehicle-coverage__item bp-sdk-quote__coverages-vehicle-coverage__item" }, h("div", { class: "bp-sdk-online-quote__coverages-vehicle-description-container bp-sdk-quote__coverages-vehicle-description-container" }, h("span", { class: "bp-sdk-online-quote__coverages-vehicle-description bp-sdk-quote__coverages-vehicle-description" }, `${vehicle.year} ${vehicle.make} ${vehicle.model}`)), h("bp-sdk-quote-request-coverage-list", { coverages: vehicle.limit_and_deductible }))))));
    }
    static get is() { return "bp-sdk-quote-request-vehicle-coverage"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-quote-request-vehicle-coverage.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-quote-request-vehicle-coverage.css"]
        };
    }
    static get properties() {
        return {
            "vehicles": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "ICoverageVehicle[]",
                    "resolved": "ICoverageVehicle[]",
                    "references": {
                        "ICoverageVehicle": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::ICoverageVehicle"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "defaultValue": "[]"
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
