import{slicedToArray as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import o,{useState as n}from"react";import l from"../hooks/useDropdownCombobox.js";import t from"../components/DropdownWrapperUI.js";var i=function(i){var u=i.options,r=i.isMenuOpen,s=i.autoFocus,d=i.closeMenuOnSelect,a=void 0===d||d,c=i.defaultValue,p=i.value,g=i.inputValue,v=i.onChange,m=i.onInputChange,f=i.onMenuClose,O=i.onMenuOpen,b=i.onOptionSelect,I=i.filterOption,h=i.showSelectedOptions,P=void 0===h||h,M=i.clearable,w=void 0===M||M,x=i.searchable,j=void 0===x||x,B=i.multi,C=void 0!==B&&B,S=i.dropdownRef,y=i.onFocus,D=i.onBlur,F=i.onKeyDown,V=i.onClear,K=i.loading,R=void 0!==K&&K,T=i.size,z=void 0===T?"medium":T,L=i.id,_=i.readOnly,k=i.disabled,A=i.boxMode,E=void 0!==A&&A,H=n(!1),U=e(H,2),W=U[0],q=U[1],G=l(u,E?void 0:r,s,a,c,p,g,v,m,f,O,(function(e){null==b||b(e),e&&q(!1)}),I,P,L),J=G.isOpen,N=G.inputValue,Q=G.highlightedIndex,X=G.getToggleButtonProps,Y=G.getLabelProps,Z=G.getMenuProps,$=G.getItemProps,ee=G.getInputProps,oe=G.reset,ne=G.filteredOptions,le=G.selectedItem,te=G.toggleMenu,ie=Object.assign(Object.assign({},i),{isOpen:!!E||J,inputValue:null!=N?N:null,highlightedIndex:Q,selectedItem:le,selectedItems:[],filteredOptions:ne,getToggleButtonProps:X,getLabelProps:Y,getMenuProps:Z,getItemProps:$,getInputProps:function(e){return ee(Object.assign(Object.assign({},e||{}),{disabled:_||k,onFocus:function(o){var n;q(!0),null==y||y(o),null===(n=null==e?void 0:e.onFocus)||void 0===n||n.call(e,o)},onBlur:function(o){var n;q(!1),null==D||D(o),null===(n=null==e?void 0:e.onBlur)||void 0===n||n.call(e,o)},onKeyDown:function(o){var n;null==F||F(o),null===(n=null==e?void 0:e.onKeyDown)||void 0===n||n.call(e,o)}}))},reset:oe,contextOnClear:function(){oe(),null==V||V()},contextOnOptionRemove:function(){},addSelectedItem:void 0,removeSelectedItem:void 0,isFocused:W,clearable:w,searchable:j,multi:C,closeMenuOnSelect:a,size:z,toggleMenu:te,loading:R});return o.createElement(t,{contextValue:ie,dropdownRef:S})};export{i as default};
//# sourceMappingURL=DropdownComboboxController.js.map
