'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index$1 = require('./index-457520a1.js');
const elementQuestionBase = require('./element-question-base-a6f39464.js');

const ElementRadioEditor = class {
    constructor(hostRef) {
        index$1.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 (index$1.h(elementQuestionBase.ElementQuestionBase, { question: this.prop('question', { localize: true }), required: this.prop('required') }, index$1.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 })), index$1.h("bce-select", Object.assign({}, this.prop('orientation'), { type: "radio" }), index$1.h("bce-option", { value: "horizontal" }, labelOrientationH), index$1.h("bce-option", { value: "vertical" }, labelOrientationV)), index$1.h("slot", null)));
    }
};

exports.bce_element_radio_editor = ElementRadioEditor;
