import{r,v as i,j as S,bB as V,aJ as h}from"./index-D3uELfdo.js";import{S as v}from"./useBasicWidgetState-DqA4I-I_-DtgK63iS.js";import"./FormClearHelper-Dgu5Halt-BxICjxpW.js";const w=(e,t)=>e.getStringValue(t),x=e=>e.options.length===0||i(e.default)?null:e.options[e.default],U=e=>e.rawValue??null,j=(e,t,l,a)=>{t.setStringValue(e,l.value,{fromUi:l.fromUi},a)},y=({disabled:e,element:t,widgetMgr:l,fragmentId:a})=>{const{options:s,help:n,label:u,labelVisibility:m,placeholder:p,acceptNewOptions:d}=t,[g,o]=v({getStateFromWidgetMgr:w,getDefaultStateFromProto:x,getCurrStateFromProto:U,updateWidgetMgrState:j,element:t,widgetMgr:l,fragmentId:a}),f=r.useCallback(c=>{o({value:c,fromUi:!0})},[o]),b=i(t.default)&&!e;return S.jsx(V,{label:u,labelVisibility:h(m?.value),options:s,disabled:e,onChange:f,value:g,help:n,placeholder:p,clearable:b,acceptNewOptions:d??!1})},E=r.memo(y);export{E as default};
