import n from"@babel/runtime/helpers/slicedToArray";import{useState as t,useMemo as r,useCallback as e}from"react";var o=function(o){var u=o.value,i=o.optionIds,a=o.onChange,l=t(null),c=n(l,2),f=c[0],m=c[1],p=t(!1),h=n(p,2),s=h[0],v=h[1],d=r((function(){return 0===u.length?i:u}),[i,u]),g=r((function(){return s&&null!=f?f:d}),[d,f,s]),I=e((function(){s||(m(d),v(!0))}),[d,s]),b=e((function(){m(null),v(!1)}),[]);return{value:g,onChange:e((function(n){m(n),a(n)}),[a]),startInteraction:I,endInteraction:b}};export{o as useMultiSelectDraftValue};
//# sourceMappingURL=useMultiSelectDraftValue.js.map
