import { r as registerInstance, h } from './index-d0047af2.js';
import { E as ElementQuestionBase } from './element-question-base-5ebd9dee.js';

const ElementRadioEditor = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.label = {
            name: 'Header',
            labelQuestion: 'Formulate your question',
            labelRequired: 'Required',
            labelOCOptionAdd: 'Add Option',
            labelOCOptionRemove: 'Delete Option',
            labelOCOther: 'Other',
            labelOCOtherAdd: 'Add "Other"',
            labelOCOtherRemove: 'Remove "Other"',
            labelOCImageUpload: 'Upload Image',
            labelOCImageDelete: 'Delete Image',
            labelOrientation: 'Oriëntation',
            labelOrientationH: 'Horizontal',
            labelOrientationV: 'Vertical',
            placeholderOptions: 'Option'
        };
        this.handleOther = (event) => {
            const target = event.target;
            this.handler.set('options', target.value, { localize: true });
            this.handler.set('other', event.detail, { emit: true, localize: true });
        };
    }
    prop(path, options = {}) {
        return this.handler.prop(path, Object.assign(Object.assign({}, options), { label: this.label }));
    }
    render() {
        const { labelOrientationH, labelOrientationV } = this.label;
        return (h(ElementQuestionBase, { question: this.prop('question', { localize: true }), required: this.prop('required') }, h("bce-option-creator", Object.assign({}, this.prop('options', { default: () => [], localize: true }), { "allow-other": true, label: this.label, other: this.handler.tryGet('other', { localize: true }), onOther: this.handleOther })), h("bce-select", Object.assign({}, this.prop('orientation'), { type: "radio" }), h("bce-option", { value: "horizontal" }, labelOrientationH), h("bce-option", { value: "vertical" }, labelOrientationV)), h("slot", null)));
    }
};

export { ElementRadioEditor as bce_element_radio_editor };
