'use strict';

var React = require('react');
var LocalizationContext = require('../../chunks/bundle-BmMxoxjN.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../chunks/bundle-Dwc89Q_t.js');
require('../../chunks/bundle-Dqor5-v9.js');
require('../../chunks/bundle-pG37uJy2.js');
require('../../chunks/bundle-DpraIGlW.js');
require('../../chunks/bundle-BsNnhtXP.js');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../chunks/bundle-CY_gcwTl.js');
require('../../chunks/bundle-BEl3UJGv.js');
require('dompurify');
require('../../chunks/bundle-CULVYVIF.js');
require('../../chunks/bundle-CmCUchSm.js');
require('../../chunks/bundle-CpIO_wkc.js');
require('../../ui/Icon.js');
require('../../chunks/bundle-DXT1Y4Vj.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../chunks/bundle-slo-uj1z.js');
require('@sendbird/chat/groupChannel');
require('../../utils/message/getOutgoingMessageState.js');
require('../../chunks/bundle-BS4UAC4Z.js');
require('../../chunks/bundle-DRUCFhOE.js');
require('../../chunks/bundle-CXXt3nEF.js');
require('../../chunks/bundle-ClfGWuhE.js');
require('../../chunks/bundle-DJNCbN6b.js');
require('@sendbird/uikit-tools');
require('../../chunks/bundle-dudJtubx.js');
require('react-dom');
require('../../chunks/bundle-CTIC4U7B.js');
require('css-vars-ponyfill');
require('@sendbird/chat');
require('../../chunks/bundle-DIZXTVPY.js');
require('@sendbird/chat/openChannel');
require('../../chunks/bundle-BbgSFL3H.js');
require('../../chunks/bundle-B6pik6Q8.js');
require('../../ui/SortByRow.js');
require('../../chunks/bundle-DCSdwR_f.js');
require('../../chunks/bundle-DCgRyaAA.js');
require('../../chunks/bundle-DCgXy78i.js');
require('../../chunks/bundle-CT-nv6tW.js');

function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefaultCompat(React);

var OpenChannelInput = React__default.default.forwardRef(function (props, ref) {
    var _a = OpenChannel_context.useOpenChannelContext(), currentOpenChannel = _a.currentOpenChannel, disabled = _a.disabled, handleSendMessage = _a.handleSendMessage, handleFileUpload = _a.handleFileUpload, amIMuted = _a.amIMuted;
    var channel = currentOpenChannel;
    var stringSet = React.useContext(LocalizationContext.LocalizationContext).stringSet;
    var value = props.value;
    function getPlaceHolderString() {
        if (amIMuted) {
            return stringSet.MESSAGE_INPUT__PLACE_HOLDER__MUTED;
        }
        if (disabled) {
            return stringSet.MESSAGE_INPUT__PLACE_HOLDER__DISABLED;
        }
        return '';
    }
    if (!channel) {
        return null;
    }
    return (React__default.default.createElement("div", { className: "sendbird-openchannel-footer" },
        React__default.default.createElement(ui_MessageInput, { channel: currentOpenChannel, ref: ref, value: value, disabled: disabled, isVoiceMessageEnabled: false, onSendMessage: handleSendMessage, onFileUpload: handleFileUpload, placeholder: getPlaceHolderString() })));
});

module.exports = OpenChannelInput;
//# sourceMappingURL=OpenChannelInput.js.map
