import { r as registerInstance, h } from './index-77a9c9e7.js';

const bpSdkDynamicInputListCss = "";
const BpSdkDynamicInputListStyle0 = bpSdkDynamicInputListCss;

const BpSdkDynamicInputList = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.answers = [];
        this.labelledBy = undefined;
        this.useExternal = false;
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-dynamic-input-list');
        customElements.whenDefined('bp-sdk-external-dynamic-input-list').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-dynamic-input-list", { answers: this.answers, labelledBy: this.labelledBy });
    }
    renderInternal() {
        var _a;
        return (h("div", { class: "bp-sdk-dynamic-input-list__container" }, (_a = this.answers) === null || _a === void 0 ? void 0 : _a.map((answer) => (h("bp-sdk-dynamic-input-redux-container", { code: answer.question.code, answer: answer, labelledBy: this.labelledBy })))));
    }
};
BpSdkDynamicInputList.style = BpSdkDynamicInputListStyle0;

export { BpSdkDynamicInputList as bp_sdk_dynamic_input_list };
