import{r as t,h as i,g as s}from"./p-3ba9c73c.js";import{B as e}from"./p-4aa42112.js";import{l as h}from"./p-2b74e80e.js";import{E as o}from"./p-b72d14f0.js";const n=class{constructor(i){t(this,i),this.optionIcon=e.ICON_MAP[e.Type.Checkbox],this.question="",this.required=!1,this.options=[],this.other=!1,this.orientation="vertical",this.answer=[],this.labelQuestion="Formulate your question",this.labelRequired="Required",this.labelOCAddButton="Add",this.labelOCRemoveButton="Delete",this.labelOCOther="Other",this.labelOCImage="Image",this.labelOrientation="Oriëntation",this.labelOrientationH="Horizontal",this.labelOrientationV="Vertical",this.placeholderOptions="Option",this._link=h(this,this.handleInput),this._question=this._link("question"),this._required=this._link("required"),this._options=this._link("options"),this._orientation=this._link("orientation"),this.handleOther=t=>{const i=t.target;i&&(this.other=t.detail,this.value=this.updateValue({options:i.value,other:t.detail}),this.el.dispatchEvent(new Event("input",{bubbles:!0})))}}handleInput(t,i){const s=i.target;s&&(i.cancelBubble=!0,this[t]=s.value,this.value=this.updateValue({[t]:s.value}),this.el.dispatchEvent(new Event("input",{bubbles:!0})))}updateValue(t={}){return Object.assign({},{question:this.question,required:this.required,options:this.options,other:this.other,orientation:this.orientation,answer:this.answer},t)}componentDidLoad(){this.value=this.updateValue(),this.el.dispatchEvent(new Event("input",{bubbles:!0}))}render(){const t=Object.assign({icon:this.optionIcon,labelOCAddButton:this.labelOCAddButton,labelOCRemoveButton:this.labelOCRemoveButton,labelOCOther:this.labelOCOther,labelOCImage:this.labelOCImage,other:this.other,onOther:this.handleOther,allowOther:!0},this._options);return i(o,{question:this._question,required:this._required},i("bce-option-creator",Object.assign({},t)),i("bce-input",Object.assign({type:"radio",value:this.orientation},this._orientation),i("bce-option",{value:"horizontal"},this.labelOrientationH),i("bce-option",{value:"vertical"},this.labelOrientationV)))}get el(){return s(this)}};export{n as bce_element_checkbox_template};