"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _get = _interopRequireDefault(require("lodash/get"));
var _styles = require("@material-ui/core/styles");
var _withWidth = _interopRequireDefault(require("@material-ui/core/withWidth"));
var _colors = require("@material-ui/core/colors");
var _Card = _interopRequireDefault(require("@material-ui/core/Card"));
var _CardContent = _interopRequireDefault(require("@material-ui/core/CardContent"));
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
var _Icon = _interopRequireDefault(require("@material-ui/core/Icon"));
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
var _FormControlLabel = _interopRequireDefault(require("@material-ui/core/FormControlLabel"));
var _Switch = _interopRequireDefault(require("@material-ui/core/Switch"));
var _i18n = require("../../../../../Framework/i18n");
var _AnalyticsWrapper = _interopRequireDefault(require("../../../../Shared/Components/Analytics/AnalyticsWrapper"));
var _InformationTag = _interopRequireDefault(require("../../../../Shared/Components/InformationTag/InformationTag"));
var _customClassName = _interopRequireDefault(require("../../../../Utils/customClassName"));
var _PopupAreaProvider = require("../../Layouts/PopupAreaProvider");
var _ColorPalettes = _interopRequireDefault(require("../../Containers/ColorPalettes"));
var _Select = _interopRequireDefault(require("../Select"));
var _ObjectTools = _interopRequireDefault(require("../ObjectTools"));
var _TextFormatIcon = require("./TextFormatIcon");
var _excluded = ["children", "editorBackgroundColor"];
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var styles = function styles(theme) {
  var _textControlboxIconsG, _WrapperAlignment, _cardContentRoot;
  return {
    card: {
      borderTop: '7px solid ' + theme.palette.primary.main,
      position: 'relative',
      overflow: 'visible'
    },
    cardUnboxed: {
      borderTop: 'none',
      boxShadow: 'none',
      borderRadius: 0
    },
    CardContentWrapper: _defineProperty({
      padding: 8
    }, theme.breakpoints.down('xs'), {
      '&:last-child': {
        paddingBottom: 8
      }
    }),
    listItemText: {
      textAlign: 'left'
    },
    fontFamilyList: _defineProperty({
      height: 40
    }, theme.breakpoints.down('xs'), {
      height: 56
    }),
    listFontItemText: {
      fontSize: '12px',
      color: theme.palette.text.secondary,
      textAlign: 'center',
      lineHeight: 2.1,
      cursor: 'default'
    },
    GridItemXS: _defineProperty({
      padding: '0 2px'
    }, theme.breakpoints.down('xs'), {
      display: 'flex'
    }),
    disabledIncrementButton: {
      opacity: 0.2
    },
    disabledDecrementButton: {
      opacity: 0.2
    },
    activeIncrementButton: {
      opacity: 1,
      cursor: 'pointer',
      color: theme.palette.text.secondary
    },
    activeDecrementButton: {
      opacity: 1,
      cursor: 'pointer',
      color: theme.palette.text.secondary
    },
    textToolButton: _defineProperty({
      width: 40,
      height: 40,
      minWidth: 30,
      minHeight: 30,
      margin: '16px 8px 0 0'
    }, theme.breakpoints.down('xs'), {
      width: 42,
      height: 42,
      marginRight: 8,
      marginTop: 8
    }),
    textToolButtonPressed: {
      background: '#ddd'
    },
    textToolButtonAlignment: _defineProperty({
      margin: '16px 8px 0 0'
    }, theme.breakpoints.down('xs'), {
      margin: 0,
      marginRight: 8
    }),
    textControlboxIconsGrid: (_textControlboxIconsG = {
      display: 'inline-flex',
      '@media only screen and (min-device-width: 568px) and (max-device-width : 725px) and  (orientation: portrait)': {
        '& div': {
          flexWrap: 'wrap'
        }
      }
    }, _defineProperty(_textControlboxIconsG, theme.breakpoints.between('xs', 'sm'), {
      '& div': {
        display: 'flex'
      }
    }), _defineProperty(_textControlboxIconsG, theme.breakpoints.down('xs'), {
      '& button:last-child': {
        marginRight: 0
      },
      justifyContent: 'space-around',
      '& .object-btn': {
        marginRight: 8,
        width: 42,
        height: 42
      }
    }), _textControlboxIconsG),
    WrapperAlignment: (_WrapperAlignment = {
      textAlign: 'end'
    }, _defineProperty(_WrapperAlignment, theme.breakpoints.between('xs', 'sm'), {
      textAlign: 'start'
    }), _defineProperty(_WrapperAlignment, theme.breakpoints.down('xs'), {
      textAlign: 'end'
    }), _WrapperAlignment),
    textToolButtonAlign: _defineProperty({
      margin: '15px 0',
      '&.Mui-disabled': {
        opacity: 0.5
      }
    }, theme.breakpoints.down('xs'), {
      marginTop: 8
    }),
    inputTextfield: {
      padding: '11.5px 14px'
    },
    colorSwitchBase: {
      color: _colors.grey[100],
      '&$colorChecked': {
        color: '#ED1C29',
        '& + $colorBar': {
          backgroundColor: '#FA9798'
        }
      }
    },
    colorBar: {},
    colorChecked: {},
    textEditor: {
      marginBottom: 16,
      '& > div': {
        height: '56px'
      }
    },
    switchRoot: {
      margin: '0 5px 0 15px'
    },
    switchLabel: {
      '& > span': {
        fontSize: 15
      }
    },
    cardContentRoot: (_cardContentRoot = {}, _defineProperty(_cardContentRoot, theme.breakpoints.down('xs'), {
      padding: 0,
      '&:last-child': {
        paddingBottom: 24
      }
    }), _defineProperty(_cardContentRoot, "padding", 8), _cardContentRoot),
    icon: {
      height: 16,
      padding: 4
    }
  };
};
var ContainerField = /*#__PURE__*/function (_React$Component) {
  _inherits(ContainerField, _React$Component);
  var _super = _createSuper(ContainerField);
  function ContainerField() {
    _classCallCheck(this, ContainerField);
    return _super.apply(this, arguments);
  }
  _createClass(ContainerField, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
        children = _this$props.children,
        editorBackgroundColor = _this$props.editorBackgroundColor,
        otherProps = _objectWithoutProperties(_this$props, _excluded);
      return /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
        InputProps: {
          startAdornment: children,
          inputComponent: function inputComponent() {
            return null;
          },
          style: {
            background: editorBackgroundColor
          }
        }
      }, otherProps));
    }
  }]);
  return ContainerField;
}(_react["default"].Component);
var TextControlbox = /*#__PURE__*/function (_React$Component2) {
  _inherits(TextControlbox, _React$Component2);
  var _super2 = _createSuper(TextControlbox);
  function TextControlbox() {
    var _this;
    _classCallCheck(this, TextControlbox);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super2.call.apply(_super2, [this].concat(args));
    _defineProperty(_assertThisInitialized(_this), "onCloseColorPalettes", function () {
      _this.props.popupArea.dismiss();
    });
    return _this;
  }
  _createClass(TextControlbox, [{
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.props.popupArea.dismiss();
    }
  }, {
    key: "render",
    value: function render() {
      var _this2 = this;
      var _this$props2 = this.props,
        classes = _this$props2.classes,
        width = _this$props2.width,
        boxed = _this$props2.boxed,
        textValue = _this$props2.textValue,
        handleChangeText = _this$props2.handleChangeText,
        fontValue = _this$props2.fontValue,
        fonts = _this$props2.fonts,
        handleChangeFont = _this$props2.handleChangeFont,
        renderEditorComponent = _this$props2.renderEditorComponent,
        handleButtonMouseDown = _this$props2.handleButtonMouseDown,
        handleButtonClick = _this$props2.handleButtonClick,
        handleObjectButtonClick = _this$props2.handleObjectButtonClick,
        popupArea = _this$props2.popupArea,
        isBold = _this$props2.isBold,
        boldDisabled = _this$props2.boldDisabled,
        isItalic = _this$props2.isItalic,
        italicDisabled = _this$props2.italicDisabled,
        textAlign = _this$props2.textAlign,
        flipToFrontDisabled = _this$props2.flipToFrontDisabled,
        flipToBackDisabled = _this$props2.flipToBackDisabled,
        colorDisabled = _this$props2.colorDisabled,
        isActiveBulkName = _this$props2.isActiveBulkName,
        isBulkName = _this$props2.isBulkName,
        toggleIsBulkName = _this$props2.toggleIsBulkName,
        editorBackgroundColor = _this$props2.editorBackgroundColor,
        color = _this$props2.color,
        selectedObject = _this$props2.selectedObject,
        FontFamilySelect = _this$props2.components.FontFamilySelect,
        isPortraitMode = _this$props2.isPortraitMode,
        alignVerticalCenterIcon = _this$props2.alignVerticalCenterIcon,
        alignHorizontalCenterIcon = _this$props2.alignHorizontalCenterIcon,
        moveDownIcon = _this$props2.moveDownIcon,
        moveUpIcon = _this$props2.moveUpIcon,
        formatAlignLeftIcon = _this$props2.formatAlignLeftIcon,
        formatAlignCenterIcon = _this$props2.formatAlignCenterIcon,
        formatAlignRightIcon = _this$props2.formatAlignRightIcon,
        formatAlignJustifyIcon = _this$props2.formatAlignJustifyIcon,
        formatBoldIcon = _this$props2.formatBoldIcon,
        formatItalicIcon = _this$props2.formatItalicIcon;
      var textAlignFullEnabled = false;
      var renderEditor = function renderEditor() {
        return renderEditorComponent ? /*#__PURE__*/_react["default"].createElement(ContainerField, {
          className: classes.textEditor,
          label: isBulkName ? '' : (0, _i18n.t)('textControlbox.text'),
          margin: "normal",
          fullWidth: true,
          variant: "outlined",
          translate: "no",
          multiline: true,
          editorBackgroundColor: editorBackgroundColor
        }, renderEditorComponent(_this2.props)) : /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
          className: classes.textEditor,
          label: isBulkName ? '' : (0, _i18n.t)('textControlbox.text'),
          value: textValue,
          onChange: handleChangeText,
          margin: "normal",
          fullWidth: true,
          variant: "outlined",
          translate: "no",
          multiline: true,
          rowsMax: 2,
          InputLabelProps: {
            shrink: true
          }
        });
      };
      var renderBulkName = function renderBulkName() {
        return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
          item: true,
          xs: 10
        }, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
          className: classes.switchLabel,
          control: /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
            classes: {
              root: classes.switchRoot,
              switchBase: classes.colorSwitchBase,
              checked: classes.colorChecked,
              track: classes.colorBar
            },
            onChange: toggleIsBulkName,
            onClick: toggleIsBulkName,
            checked: isBulkName
          }),
          label: (0, _i18n.t)('textControlbox.bulknames')
        })), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
          item: true,
          xs: 2
        }, (0, _i18n.translationExists)('bulkNameInformation') && /*#__PURE__*/_react["default"].createElement("div", {
          className: "info-btn"
        }, /*#__PURE__*/_react["default"].createElement(_InformationTag["default"], {
          infoText: (0, _i18n.t)('bulkNameInformation')
        }))));
      };
      var renderFontFamily = function renderFontFamily() {
        return /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
          targetId: "text_font"
        }, /*#__PURE__*/_react["default"].createElement(FontFamilySelect, {
          bold: true,
          value: fontValue || '',
          autoWidth: width === 'xs',
          onChange: handleChangeFont
        }, fonts.map(function (font) {
          return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
            key: font.isCustomFont ? font.customName : font.name,
            className: classes.fontFamilyList,
            value: font,
            "aria-label": font.name
          }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
            className: classes.listItemText,
            noWrap: true,
            style: {
              fontFamily: font.value
            }
          }, font.isCustomFont ? "".concat(font.customName, " (").concat((0, _i18n.t)('textControlbox.customFont'), ")") : font.name));
        })));
      };
      var renderTextBoldItalics = function renderTextBoldItalics() {
        return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
          targetId: "text_bold"
        }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
          className: classes.textToolButton + (isBold ? ' ' + classes.textToolButtonPressed : ''),
          variant: "outlined",
          value: "bold",
          onMouseDown: handleButtonMouseDown,
          onClick: handleButtonClick,
          disabled: boldDisabled
        }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
          title: (0, _i18n.t)('textControlbox.tooltips.bold')
        }, formatBoldIcon !== null && formatBoldIcon !== void 0 ? formatBoldIcon : /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "format_bold")))), /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
          targetId: "text_italic"
        }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
          className: classes.textToolButton + (isItalic ? ' ' + classes.textToolButtonPressed : ''),
          variant: "outlined",
          value: "italic",
          onMouseDown: handleButtonMouseDown,
          onClick: handleButtonClick,
          disabled: italicDisabled
        }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
          title: (0, _i18n.t)('textControlbox.tooltips.italic')
        }, formatItalicIcon !== null && formatItalicIcon !== void 0 ? formatItalicIcon : /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "format_italic")))));
      };
      var renderTextAlignments = function renderTextAlignments() {
        return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
          targetId: "text_align_left"
        }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
          className: classes.textToolButton + ' ' + classes.textToolButtonAlignment + (textAlign === 'left' || textAlign === 'start' ? ' ' + classes.textToolButtonPressed : ''),
          variant: "outlined",
          value: "justifyLeft",
          onMouseDown: handleButtonMouseDown,
          onClick: handleButtonClick
        }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
          title: (0, _i18n.t)('textControlbox.tooltips.alignLeft')
        }, formatAlignLeftIcon !== null && formatAlignLeftIcon !== void 0 ? formatAlignLeftIcon : /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "format_align_left")))), /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
          targetId: "text_align_center"
        }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
          className: classes.textToolButton + ' ' + classes.textToolButtonAlignment + (textAlign === 'center' ? ' ' + classes.textToolButtonPressed : ''),
          variant: "outlined",
          value: "justifyCenter",
          onMouseDown: handleButtonMouseDown,
          onClick: handleButtonClick
        }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
          title: (0, _i18n.t)('textControlbox.tooltips.alignCenter')
        }, formatAlignCenterIcon !== null && formatAlignCenterIcon !== void 0 ? formatAlignCenterIcon : /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "format_align_center")))), /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
          targetId: "text_align_right"
        }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
          className: classes.textToolButton + ' ' + classes.textToolButtonAlignment + (textAlign === 'right' ? ' ' + classes.textToolButtonPressed : ''),
          variant: "outlined",
          value: "justifyRight",
          onMouseDown: handleButtonMouseDown,
          onClick: handleButtonClick
        }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
          title: (0, _i18n.t)('textControlbox.tooltips.alignRight')
        }, formatAlignRightIcon !== null && formatAlignRightIcon !== void 0 ? formatAlignRightIcon : /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "format_align_right")))), textAlignFullEnabled && /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
          targetId: "text_align_justify"
        }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
          className: classes.textToolButton + ' ' + classes.textToolButtonAlignment + (textAlign === 'full' ? ' ' + classes.textToolButtonPressed : ''),
          variant: "outlined",
          value: "justifyFull",
          onMouseDown: handleButtonMouseDown,
          onClick: handleButtonClick
        }, formatAlignJustifyIcon !== null && formatAlignJustifyIcon !== void 0 ? formatAlignJustifyIcon : /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "format_align_justify"))));
      };
      var renderTextColor = function renderTextColor() {
        return /*#__PURE__*/_react["default"].createElement(_Button["default"], {
          className: classes.textToolButtonAlign + ' ' + classes.textToolButton,
          variant: "outlined",
          value: "color",
          onClick: function onClick() {
            return popupArea.setContent( /*#__PURE__*/_react["default"].createElement(_ColorPalettes["default"], {
              isPortraitMode: isPortraitMode,
              selectedObject: selectedObject,
              closeColorPalettes: _this2.onCloseColorPalettes
            }), {
              hideChildren: !(width !== 'xs' && isPortraitMode)
            });
          },
          disabled: colorDisabled
        }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
          title: (0, _i18n.t)('textControlbox.tooltips.color')
        }, /*#__PURE__*/_react["default"].createElement(_TextFormatIcon.TextFormatIcon, {
          className: classes.icon,
          selectedColor: (0, _get["default"])(color, 'value') || _colors.grey[900]
        })));
      };
      var renderObjectTools = function renderObjectTools() {
        return /*#__PURE__*/_react["default"].createElement(_ObjectTools["default"], {
          handleObjectButtonClick: handleObjectButtonClick,
          flipToFrontDisabled: flipToFrontDisabled,
          flipToBackDisabled: flipToBackDisabled,
          alignVerticalCenterIcon: alignVerticalCenterIcon,
          alignHorizontalCenterIcon: alignHorizontalCenterIcon,
          moveDownIcon: moveDownIcon,
          moveUpIcon: moveUpIcon
        });
      };
      return width === 'xs' ? /*#__PURE__*/_react["default"].createElement(_Card["default"], {
        id: "containerTextControl",
        className: (0, _clsx["default"])(boxed ? classes.card : classes.cardUnboxed, (0, _customClassName["default"])('text-tools-box'))
      }, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], {
        classes: {
          root: classes.cardContentRoot
        }
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        container: true
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        className: classes.GridItemXS
      }, renderEditor()), isActiveBulkName && renderBulkName(), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 6,
        className: classes.GridItemXS
      }, renderFontFamily()), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 6,
        justify: "flex-end",
        className: classes.GridItemXS
      }, renderTextBoldItalics(), renderTextColor()), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        alignItems: "flex-end",
        className: classes.textControlboxIconsGrid
      }, renderObjectTools(), renderTextAlignments())))) : /*#__PURE__*/_react["default"].createElement(_Card["default"], {
        id: "containerTextControl",
        className: (0, _clsx["default"])(boxed ? classes.card : classes.cardUnboxed, (0, _customClassName["default"])('text-tools-box'))
      }, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], {
        className: boxed ? '' : classes.CardContentWrapper
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        container: true
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        md: 12,
        lg: 12,
        className: classes.GridItemXS
      }, renderEditor()), isActiveBulkName && renderBulkName(), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        sm: 12,
        md: 12,
        lg: 12,
        className: classes.GridItemXS
      }, renderFontFamily()), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        md: 12,
        lg: 12,
        className: classes.textControlboxIconsGrid
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 4,
        md: 4
      }, renderTextBoldItalics()), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 6,
        md: 6
      }, renderTextAlignments()), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 2,
        md: 2,
        className: classes.WrapperAlignment
      }, renderTextColor())), renderObjectTools())));
    }
  }]);
  return TextControlbox;
}(_react["default"].Component);
_defineProperty(TextControlbox, "defaultProps", {
  components: {
    FontFamilySelect: _Select["default"]
  }
});
var _default = exports["default"] = (0, _withWidth["default"])()((0, _styles.withStyles)(styles, {
  name: 'TextControlbox'
})((0, _PopupAreaProvider.withPopupArea)(TextControlbox)));