import{r as e}from"./vendor-react-wBh_31cN.js";const h=(r=!1)=>{const[S,m]=e.useState(r),t=e.useCallback(()=>m(s=>!s),[]),[l,a]=e.useState(null),[c,n]=e.useState(null),[o,u]=e.useState(""),I=e.useCallback((s,d)=>()=>{a(s),d&&n(d),l||t()},[t,l,c]),i=s=>{u(s),o||t()},p=e.useCallback(()=>{a(null),n(null),u(""),t()},[t]);return{isOpen:S,selectedId:l,selectedName:o,selectedFgId:c,handleClose:p,handleSelectItem:I,handleSelectItemByName:i}};export{h as u};
