Liferay.Loader.define("analytics-reports-web@1.0.47/js/components/CustomTooltip", ['module', 'exports', 'require', 'frontend-js-react-web$prop-types', 'frontend-js-react-web$react'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = CustomTooltip;

    var _propTypes = _interopRequireDefault(require("frontend-js-react-web$prop-types"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    function _slicedToArray(arr, i) {
      return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
    }

    function _nonIterableRest() {
      throw new TypeError("Invalid attempt to destructure non-iterable instance");
    }

    function _iterableToArrayLimit(arr, i) {
      if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
        return;
      }var _arr = [];var _n = true;var _d = false;var _e = undefined;try {
        for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
          _arr.push(_s.value);if (i && _arr.length === i) break;
        }
      } catch (err) {
        _d = true;_e = err;
      } finally {
        try {
          if (!_n && _i["return"] != null) _i["return"]();
        } finally {
          if (_d) throw _e;
        }
      }return _arr;
    }

    function _arrayWithHoles(arr) {
      if (Array.isArray(arr)) return arr;
    }

    /**
     * Component to customize the content of recharts Tooltip
     * http://recharts.org/en-US/api/Tooltip#content
     */
    function CustomTooltip(props) {
      var formatter = props.formatter,
          label = props.label,
          labelFormatter = props.labelFormatter,
          payload = props.payload,
          publishDateFill = props.publishDateFill,
          _props$separator = props.separator,
          separator = _props$separator === void 0 ? '' : _props$separator,
          showPublishedDateLabel = props.showPublishedDateLabel;
      return label ? /*#__PURE__*/_react.default.createElement("div", {
        className: "custom-tooltip"
      }, /*#__PURE__*/_react.default.createElement("p", {
        className: "mb-1 mt-0"
      }, /*#__PURE__*/_react.default.createElement("b", null, labelFormatter ? labelFormatter(label) : label)), /*#__PURE__*/_react.default.createElement("hr", {
        className: "mb-1 mt-1"
      }), showPublishedDateLabel && /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("span", {
        className: 'custom-circle mr-1',
        style: {
          backgroundColor: 'white',
          border: "2px solid ".concat(publishDateFill)
        }
      }), Liferay.Language.get('published')), /*#__PURE__*/_react.default.createElement("ul", {
        className: "list-unstyled mb-0"
      }, payload.map(function (item) {
        var _ref = formatter ? formatter(item.value, item.name, item.iconType) : [item.value, item.name, item.iconType],
            _ref2 = _slicedToArray(_ref, 3),
            value = _ref2[0],
            name = _ref2[1],
            iconType = _ref2[2];

        return (/*#__PURE__*/_react.default.createElement("li", {
            key: item.name
          }, /*#__PURE__*/_react.default.createElement("span", {
            className: "custom-".concat(iconType, " mr-1"),
            style: {
              backgroundColor: item.color
            }
          }), name, separator, /*#__PURE__*/_react.default.createElement("b", null, value))
        );
      }))) : null;
    }
    //# sourceMappingURL=CustomTooltip.js.map
  }
});
//# sourceMappingURL=CustomTooltip.js.map