import{r as s,M as u,j as b,bq as x,c8 as V}from"./index.BEHais2d.js";import{a as U}from"./useBasicWidgetState.DxtD7xs-.js";import"./FormClearHelper.CpsBciie.js";const h=(t,o)=>t.getStringValue(o),v=t=>t.options.length===0||u(t.default)?null:t.options[t.default],C=t=>t.rawValue??null,F=(t,o,e,r)=>{o.setStringValue(t,e.value,{fromUi:e.fromUi},r)},M=({disabled:t,element:o,widgetMgr:e,fragmentId:r})=>{const{options:n,help:i,label:c,labelVisibility:a,placeholder:g,acceptNewOptions:p}=o,[f,l]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:C,updateWidgetMgrState:F,element:o,widgetMgr:e,fragmentId:r}),S=s.useCallback(m=>{l({value:m,fromUi:!0})},[l]),d=u(o.default)&&!t;return b(V,{label:c,labelVisibility:x(a==null?void 0:a.value),options:n,disabled:t,onChange:S,value:f,help:i,placeholder:g,clearable:d,acceptNewOptions:p})},w=s.memo(M);export{w as default};
