"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports["default"] = void 0;

var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));

var React = _interopRequireWildcard(require("react"));

var _css = require("@emotion/css");

var _TreeNode = _interopRequireDefault(require("./TreeNode"));

var _templateObject;

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

/**
 * The root of the hierarchy tree
 */
function Tree(_ref) {
  var children = _ref.children,
      label = _ref.label,
      _ref$lineHeight = _ref.lineHeight,
      lineHeight = _ref$lineHeight === void 0 ? '20px' : _ref$lineHeight,
      _ref$lineWidth = _ref.lineWidth,
      lineWidth = _ref$lineWidth === void 0 ? '1px' : _ref$lineWidth,
      _ref$lineColor = _ref.lineColor,
      lineColor = _ref$lineColor === void 0 ? 'black' : _ref$lineColor,
      _ref$nodePadding = _ref.nodePadding,
      nodePadding = _ref$nodePadding === void 0 ? '5px' : _ref$nodePadding,
      _ref$lineStyle = _ref.lineStyle,
      lineStyle = _ref$lineStyle === void 0 ? 'solid' : _ref$lineStyle,
      _ref$lineBorderRadius = _ref.lineBorderRadius,
      lineBorderRadius = _ref$lineBorderRadius === void 0 ? '5px' : _ref$lineBorderRadius;
  return /*#__PURE__*/React.createElement("ul", {
    className: (0, _css.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n        padding-inline-start: 0;\n        margin: 0;\n        display: flex;\n\n        --line-height: ", ";\n        --line-width: ", ";\n        --line-color: ", ";\n        --line-border-radius: ", ";\n        --line-style: ", ";\n        --node-padding: ", ";\n\n        --tree-line-height: var(--line-height, 20px);\n        --tree-line-width: var(--line-width, 1px);\n        --tree-line-color: var(--line-color, black);\n        --tree-line-border-radius: var(--line-border-radius, 5px);\n        --tree-node-line-style: var(--line-style, solid);\n        --tree-node-padding: var(--node-padding, 5px);\n      "])), lineHeight, lineWidth, lineColor, lineBorderRadius, lineStyle, nodePadding)
  }, /*#__PURE__*/React.createElement(_TreeNode["default"], {
    label: label
  }, children));
}

var _default = Tree;
exports["default"] = _default;