import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/assertThisInitialized";import o from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import{PureComponent as l}from"react";import{Picker as a}from"emoji-mart";import c from"prop-types";import p from"@material-ui/core/Popover";import m from"./IconButton/index.js";import u from"./Icons/EmojiIcon.js";import{jsxs as f,Fragment as h,jsx as d}from"react/jsx-runtime";function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=n(e);if(t){var s=n(this).constructor;r=Reflect.construct(o,arguments,s)}else r=o.apply(this,arguments);return i(this,r)}}var j=function(i){o(c,l);var n=b(c);function c(t){var o;return e(this,c),o=n.call(this,t),s(r(o),"onSelect",(function(e){var t=o.props,r=t.handleSelectEmoji,i=t.closeOnSelect;r(e),i&&o.setState({openEmojiPicker:!1})})),o.state={openEmojiPicker:!1},o}return t(c,[{key:"render",value:function(){var e=this;return f(h,{children:[d(m,{"data-testid":this.props["data-testid"],buttonRef:function(t){e.anchorEl=t},"aria-label":"Emoji",onClick:function(){return e.setState({openEmojiPicker:!0})},disableRipple:this.props.disableRipple,className:this.props.emojiIconClassName,tooltipProps:this.props.tooltipProps,children:d(u,{})}),d(p,{open:this.state.openEmojiPicker,anchorEl:this.anchorEl,onClose:function(){return e.setState({openEmojiPicker:!1})},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d(a,{onSelect:this.onSelect,theme:"dark"})})]})}}]),c}();j.propTypes={handleSelectEmoji:c.func.isRequired,emojiIconClassName:c.string,disableRipple:c.bool,closeOnSelect:c.bool,"data-testid":c.string,tooltipProps:c.shape({})},j.defaultProps={emojiIconClassName:void 0,disableRipple:!1,closeOnSelect:!0,"data-testid":"generic_emojiButton",tooltipProps:{title:"Add Emoji"}};export{j as default};
//# sourceMappingURL=EmojiIconButton.js.map
