Liferay.Loader.define("portal-workflow-metrics-web@2.0.46/js/shared/components/chart/TooltipChart.es", ['module', 'exports', 'require', 'frontend-js-react-web$classnames'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

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

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

    function _toConsumableArray(arr) {
      return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
    }

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

    function _iterableToArray(iter) {
      if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
    }

    function _arrayWithoutHoles(arr) {
      if (Array.isArray(arr)) {
        for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
          arr2[i] = arr[i];
        }return arr2;
      }
    }

    function _defineProperty(obj, key, value) {
      if (key in obj) {
        Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }return obj;
    }

    var CLASSNAME = 'workflow-tooltip-chart';

    var Body = function Body() {
      for (var _len = arguments.length, children = new Array(_len), _key = 0; _key < _len; _key++) {
        children[_key] = arguments[_key];
      }

      return "<tbody class=\"".concat(CLASSNAME, "-body\">").concat(children.join(''), "</tbody>");
    };

    var Column = function Column(_ref) {
      var _getCN;

      var align = _ref.align,
          children = _ref.children,
          _ref$className = _ref.className,
          className = _ref$className === void 0 ? '' : _ref$className,
          weight = _ref.weight;
      var classes = (0, _classnames.default)("".concat(CLASSNAME, "-column"), className, (_getCN = {}, _defineProperty(_getCN, "font-weight-".concat(weight), weight), _defineProperty(_getCN, "text-".concat(align), align), _getCN));
      return "\n\t\t<td>\n\t\t\t<div class=\"".concat(CLASSNAME, "-content ").concat(classes, "\">\n\t\t\t").concat(children, "\n\t\t\t</div>\n\t\t</td>\n\t\t");
    };

    var Header = function Header() {
      for (var _len2 = arguments.length, children = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        children[_key2] = arguments[_key2];
      }

      return "<thead class=\"".concat(CLASSNAME, "-header\">").concat(children.join(''), "</thead>");
    };

    var Row = function Row() {
      for (var _len3 = arguments.length, children = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
        children[_key3] = arguments[_key3];
      }

      return "<tr class=\"".concat(CLASSNAME, "-row\">").concat(children.join(''), "</tr>");
    };

    var TooltipChart = function TooltipChart(_ref2) {
      var header = _ref2.header,
          rows = _ref2.rows;
      var columnRows = rows.map(function (_ref3) {
        var columns = _ref3.columns;
        return columns[0];
      });
      return "\n\t\t<table class=\"".concat(CLASSNAME, "\">\n\t\t\t").concat(Header(Row(header.map(function (_ref4) {
        var label = _ref4.label,
            weight = _ref4.weight,
            width = _ref4.width;
        return Column({
          children: label,
          weight: weight,
          width: width
        });
      }))), "\n\n\t\t\t").concat(Body(Row.apply(void 0, _toConsumableArray(columnRows.map(function (_ref5) {
        var label = _ref5.label,
            weight = _ref5.weight;
        return Column({
          children: label,
          weight: weight
        });
      })))), "\n\t\t</table>\n\t");
    };

    var _default = TooltipChart;
    exports.default = _default;
    //# sourceMappingURL=TooltipChart.es.js.map
  }
});
//# sourceMappingURL=TooltipChart.es.js.map