import { _ as __assign } from '../../chunks/bundle-KIf79auh.js';
import React__default from 'react';
import { M as MessageInputWrapperView } from '../../chunks/bundle-DbZW44FD.js';
export { V as VoiceMessageInputWrapper } from '../../chunks/bundle-DbZW44FD.js';
import { useGroupChannelContext } from '../context.js';
import { useIIFE } from '@sendbird/uikit-tools';
import { g as getSuggestedReplies, e as isSendableMessage } from '../../chunks/bundle-LTiCF37t.js';
import { useSendbirdStateContext } from '../../useSendbirdStateContext.js';
import '../../chunks/bundle-39Y3yv8j.js';
import '../../chunks/bundle-wpc1Fted.js';
import '../../chunks/bundle-XDy3Cf54.js';
import '../../chunks/bundle-wWnN6K3w.js';
import './SuggestedMentionList.js';
import '../../chunks/bundle-NntyZyeL.js';
import '../../chunks/bundle-9c5vLDe9.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-DHw1C5gJ.js';
import '../../chunks/bundle-b2jLXyrm.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-Sl-oiala.js';
import '../../chunks/bundle-hjFxrcMW.js';
import '../../chunks/bundle-yIputEl7.js';
import '../../chunks/bundle-AaDwp4eU.js';
import '../../withSendbird.js';
import '../../Message/hooks/useDirtyGetMentions.js';
import '../../ui/QuoteMessageInput.js';
import '../../chunks/bundle-2AR3a1T9.js';
import '../../chunks/bundle-0QDb7-Y_.js';
import '../../VoicePlayer/useVoicePlayer.js';
import '../../chunks/bundle-bg3dRlK7.js';
import '../../chunks/bundle-xC7o7NLR.js';
import '../../VoiceRecorder/context.js';
import '../../chunks/bundle-22Jw6ztq.js';
import 'react-dom';
import '../../chunks/bundle-Y3ZVN9yF.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../VoiceRecorder/useVoiceRecorder.js';
import '../../chunks/bundle-NwEKq2eQ.js';
import '../../ui/PlaybackTime.js';
import '../../ui/ProgressBar.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-n2BmCgGV.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-zy69cX9t.js';
import 'dompurify';
import '../../chunks/bundle-9C7b_-hs.js';
import '../../chunks/bundle-0Vur_TKy.js';
import '../../chunks/bundle-4gcxTdvH.js';
import '../../chunks/bundle-Sm0-7tTm.js';
import '../../hooks/useModal.js';
import '../../chunks/bundle-y909vBn9.js';
import '@sendbird/chat/message';
import '@sendbird/chat/groupChannel';
import '../../chunks/bundle-_hGurAcC.js';
import '../../chunks/bundle-npMrmwG6.js';
import '../../chunks/bundle-9QigDxkR.js';
import '../../chunks/bundle-Ueye8-sz.js';
import '../../chunks/bundle-NQDEdVJA.js';
import '../../chunks/bundle-X7gl5vNX.js';
import '../../chunks/bundle-PdtvfqJT.js';
import '../../chunks/bundle-3E-IANjq.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
