import{d as T,ar as L,bm as M,A as n,bn as v,bo as h,bp as r,h as b,a9 as t,bu as B,br as D}from"../../../../common/preload-helper.BAt0wiQU.js";import{p as w}from"../../index.CwVZreOu.js";import{u as N}from"../../../../common/settings-store.DAVbzJl3.js";/* empty css                                                                                      */import"../../../../common/DnDDataTableControl.vue_vue_type_style_index_0_scoped_0b913e4f_lang.CI1SyTf2.js";/* empty css                                                                                                 */import{_ as S}from"../../../../common/LabelControl.vue_vue_type_script_setup_true_lang.8NM1WLzi.js";/* empty css                                                                                        */import{C as R}from"../../../../common/index.BYqQbtL4.js";import"../../../../common/index.Bkgl5HZD.js";import"../../../../common/motion.DDNFslEg.js";import"../../../../common/Checkbox.B6t5acdU.js";import"../../../../common/FormItemContext.B-agHi0o.js";import"../../../../common/createContext.DKLY0CB7.js";const U={class:"wwp-row-handle"},j={class:"wwp-left-content"},q={class:"wwp-right-content"},A=["innerHTML"],E=["innerHTML"],te=T({__name:"CheckboxControl",props:{params:{type:Object,required:!0}},emits:["fieldData"],setup(k,{emit:C}){var c;const y=k,{params:g}=L(y),x=N(),{showPopup:i,componentUpgrade:V}=M(x),e=g.value;let l=!1;(e.default==="yes"||e.default==="true")&&(l=!0);const a=n(l),p=n((c=e.disabled)!=null?c:!1),u=C,o=n([]);a.value&&!p.value&&(o.value[e.id]="yes",u("fieldData",o.value));const H=()=>{typeof e.pro<"u"&&e.pro!==null?(typeof e.pro_on_active<"u"&&e.pro_on_active!==null?e.pro_on_active&&a.value&&(i.value=!0,a.value=!1):(i.value=!0,a.value=!a.value),V.value=e.pro):(o.value[e.id]=a.value?"yes":"no",u("fieldData",o.value))};return(O,d)=>{var m,f;return v(),h("div",U,[r("div",j,[b(t(S),{params:t(e)},null,8,["params"])]),r("div",q,[b(t(R),{class:"wwp-checkbox-control",checked:a.value,"onUpdate:checked":d[0]||(d[0]=s=>a.value=s),name:t(e).id,disabled:p.value,onChange:H},{default:B(()=>{var s,_;return[r("span",{innerHTML:t(w)((_=(s=t(e))==null?void 0:s.input_label)!=null?_:"")},null,8,A)]}),_:1},8,["checked","name","disabled"]),t(e).description!=="undefined"?(v(),h("p",{key:0,innerHTML:t(w)((f=(m=t(e))==null?void 0:m.description)!=null?f:"")},null,8,E)):D("",!0)])])}}});export{te as default};
