import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { Input } from './Input';
import { OptionsModal } from './OptionsModal';
import { useLogic } from './useLogic';
export const TreeAutocomplete = forwardRef((props, forwardedRef) => {
    const { inputProps, optionsModalProps } = useLogic(props);
    const { className, value, options, isDisabled, isError, isLoading, isLoadingError, loadingErrorMsg, filterOptions, dialogProps, treeProps, onBlur, onRetry, onChange, ...externalInputProps } = props;
    return (_jsxs(_Fragment, { children: [_jsx(Input, { ref: forwardedRef, disabled: isDisabled, error: isError, ...externalInputProps, ...inputProps, onChange: onChange }), _jsx(OptionsModal, { initialValue: value, options: options, isLoading: isLoading, isLoadingError: isLoadingError, loadingErrorMsg: loadingErrorMsg, filterOptions: filterOptions, treeProps: treeProps, ...dialogProps, ...optionsModalProps, onRetry: onRetry, onChange: onChange })] }));
});
