'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _extends = require('@babel/runtime/helpers/extends');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
var React = require('react');
var emoji = require('@evo/emoji');
var Image = require('@prom-ui/core/Image');

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

function _interopNamespaceCompat(e) {
    if (e && typeof e === 'object' && 'default' in e) return e;
    var n = Object.create(null);
    if (e) {
        Object.keys(e).forEach(function (k) {
            if (k !== 'default') {
                var d = Object.getOwnPropertyDescriptor(e, k);
                Object.defineProperty(n, k, d.get ? d : {
                    enumerable: true,
                    get: function () { return e[k]; }
                });
            }
        });
    }
    n.default = e;
    return Object.freeze(n);
}

var _extends__default = /*#__PURE__*/_interopDefaultCompat(_extends);
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultCompat(_objectWithoutProperties);
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);

var _excluded = ["shortName", "viewType", "width", "height"];
var ImageEmoji = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
  var shortName = _ref.shortName,
    _ref$viewType = _ref.viewType,
    viewType = _ref$viewType === void 0 ? 'apple' : _ref$viewType,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? 20 : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? 20 : _ref$height,
    props = _objectWithoutProperties__default.default(_ref, _excluded);
  return /*#__PURE__*/React__namespace.createElement(Image.Image, _extends__default.default({
    "image-as": emoji.Emoji,
    "image-alt": "hidden",
    alt: shortName ? ":".concat(shortName, ":") : ''
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    ,
    width: width
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    ,
    height: height
  }, props, {
    name: shortName,
    type: viewType,
    ref: ref
  }));
});
ImageEmoji.displayName = 'ImageEmoji';

exports.ImageEmoji = ImageEmoji;
