import{r as e,h as t}from"./p-fdd3ce28.js";import{E as i}from"./p-93061dfe.js";const o=class{constructor(t){e(this,t),this.label={name:"Checkbox",labelQuestion:"Formulate your question",labelRequired:"Required",labelMax:"Max answers",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=e=>{this.handler.set("options",e.target.value),this.handler.set("other",e.detail,{emit:!0})},this.transformMax={path:"validation",get:e=>`max:${e}`,set:e=>e.slice(4)}}prop(e,t={}){return this.handler.prop(e,Object.assign(Object.assign({},t),{label:this.label}))}render(){const{labelOrientationH:e,labelOrientationV:o}=this.label,{options:l}=this.value;return t(i,{question:this.prop("question",{localize:!0}),required:this.prop("required")},t("bce-option-creator",Object.assign({},this.prop("options",{default:()=>[],localize:!0}),{"allow-other":!0,label:this.label,other:this.handler.get("other"),onOther:this.handleOther})),t("bce-input",Object.assign({},this.prop("max",{transform:this.transformMax}),{type:"number",min:l.length?"1":"0",max:""+l.length})),t("bce-select",Object.assign({},this.prop("orientation"),{type:"radio"}),t("bce-option",{value:"horizontal"},e),t("bce-option",{value:"vertical"},o)),t("slot",null))}};export{o as bce_element_checkbox_editor};