import { _ as __assign } from '../../chunks/bundle-7oF7KbGv.js';
import React__default from 'react';
import { M as MessageInputWrapperView } from '../../chunks/bundle-Ci146LvO.js';
export { V as VoiceMessageInputWrapper } from '../../chunks/bundle-Ci146LvO.js';
import { useGroupChannelContext } from '../context.js';
import { useIIFE } from '@sendbird/uikit-tools';
import { g as getSuggestedReplies, e as isSendableMessage } from '../../chunks/bundle-BWCGFXhj.js';
import { useSendbirdStateContext } from '../../useSendbirdStateContext.js';
import '../../chunks/bundle-BvG71y_P.js';
import '../../chunks/bundle-Bx5vhTbU.js';
import '../../chunks/bundle-C8im5l9B.js';
import '../../chunks/bundle-C1ds4cil.js';
import './SuggestedMentionList.js';
import '../../chunks/bundle-DlfN5GTa.js';
import '../../chunks/bundle-LYAWKk4n.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-ByvmbZD0.js';
import '../../chunks/bundle-CNJMLyGJ.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-CT8ZXUi2.js';
import '../../chunks/bundle-BJ46V6XQ.js';
import '../../chunks/bundle-BOSnopxk.js';
import '../../chunks/bundle-QxUVt4Ms.js';
import '../../withSendbird.js';
import '../../Message/hooks/useDirtyGetMentions.js';
import '../../ui/QuoteMessageInput.js';
import '../../chunks/bundle-DDhhxSv0.js';
import '../../VoicePlayer/useVoicePlayer.js';
import '../../chunks/bundle-CIwVkd-E.js';
import '../../chunks/bundle-CD9AzC6s.js';
import '../../chunks/bundle-C4Z-NWqF.js';
import 'react-dom';
import '../../chunks/bundle-Diqj6For.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import 'css-vars-ponyfill';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '@sendbird/chat/groupChannel';
import '../../chunks/bundle-BbWD2VuS.js';
import '../../VoiceRecorder/useVoiceRecorder.js';
import '../../chunks/bundle-BZd5IHBF.js';
import '../../ui/PlaybackTime.js';
import '../../ui/ProgressBar.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-HoQqraNc.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-DO1vNias.js';
import 'dompurify';
import '../../chunks/bundle-B5N2u5f-.js';
import '../../chunks/bundle-DSOf9RKe.js';
import '../../chunks/bundle-DQ2q-zNM.js';
import '../../chunks/bundle-DpGWywZ5.js';
import '../../chunks/bundle-3amhHjNa.js';
import '@sendbird/chat/message';
import '../../chunks/bundle-B7barEsR.js';
import '../../chunks/bundle-oCSRGy9i.js';
import '../../chunks/bundle-BtY8jyVv.js';
import '../../chunks/bundle-DaoHZIZy.js';
import '../../chunks/bundle-DDkUg3Os.js';
import '../../chunks/bundle-uBJzoaNT.js';
import '../../chunks/bundle-2uJIsyo2.js';
import '../../chunks/bundle-BWuyd0AD.js';
import '../../chunks/bundle-Jir4hfa9.js';
import '../../utils/message/getOutgoingMessageState.js';

var MessageInputWrapper = function (props) {
    var _a;
    var config = useSendbirdStateContext().config;
    var context = useGroupChannelContext();
    var messages = context.messages, currentChannel = context.currentChannel;
    var lastMessage = currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.lastMessage;
    var isLastMessageSuggestedRepliesEnabled = useIIFE(function () {
        var _a;
        if (!((_a = config === null || config === void 0 ? void 0 : config.groupChannel) === null || _a === void 0 ? void 0 : _a.enableSuggestedReplies))
            return false;
        if (getSuggestedReplies(lastMessage).length === 0)
            return false;
        var lastMessageInContext = messages[messages.length - 1];
        if (isSendableMessage(lastMessageInContext) && lastMessageInContext.sendingStatus !== 'succeeded')
            return false;
        return true;
    });
    var disableMessageInput = props.disabled
        || isLastMessageSuggestedRepliesEnabled && !!((_a = lastMessage.extendedMessagePayload) === null || _a === void 0 ? void 0 : _a['disable_chat_input']);
    return (React__default.createElement(MessageInputWrapperView, __assign({}, props, context, { disabled: disableMessageInput })));
};

export { MessageInputWrapper, MessageInputWrapper as default };
//# sourceMappingURL=MessageInputWrapper.js.map
