"use strict";

exports.__esModule = true;
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _Divider = _interopRequireDefault(require("@material-ui/core/Divider"));

var _styles = require("@material-ui/core/styles");

var _dividerProps = _interopRequireWildcard(require("./dividerProps"));

var _classnames = _interopRequireDefault(require("classnames"));

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; }

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

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var useStyles = (0, _styles.makeStyles)(function (theme) {
  return {
    dividerRoot: {
      backgroundColor: theme.palette.grey.dark
    },
    dividerLight: {
      backgroundColor: theme.palette.grey.borders
    },
    dividerVertical: {
      margin: "0 ".concat(theme.spacing(2))
    },
    inheritedWidth: {
      width: "inherit"
    }
  };
});

var Divider = function Divider(_ref) {
  var dividerProps = _ref.dividerProps;
  var classes = useStyles();

  if ((0, _dividerProps.isDividerProps)(dividerProps) === false) {
    throw new TypeError("dividerProps property is not of type DividerProps");
  }

  var orientation = (dividerProps == null ? void 0 : dividerProps.get(_dividerProps.default.propNames.orientation)) || "horizontal";
  var light = (dividerProps == null ? void 0 : dividerProps.get(_dividerProps.default.propNames.light)) || false;
  var variant = (dividerProps == null ? void 0 : dividerProps.get(_dividerProps.default.propNames.variant)) || "fullWidth";
  var flexItem = (dividerProps == null ? void 0 : dividerProps.get(_dividerProps.default.propNames.flexItem)) || false;
  var fullWidthHorizontalStyle = variant === "fullWidth" && orientation === "horizontal" ? classes.inheritedWidth : null;
  return /*#__PURE__*/_react.default.createElement(_Divider.default, {
    orientation: orientation,
    light: light,
    variant: variant,
    flexItem: flexItem,
    classes: {
      root: (0, _classnames.default)(classes.dividerRoot, fullWidthHorizontalStyle, dividerProps == null ? void 0 : dividerProps.getStyle(_dividerProps.default.ruleNames.root)),
      light: (0, _classnames.default)(classes.dividerLight, dividerProps == null ? void 0 : dividerProps.getStyle(_dividerProps.default.ruleNames.light)),
      vertical: (0, _classnames.default)(classes.dividerVertical, dividerProps == null ? void 0 : dividerProps.getStyle(_dividerProps.default.ruleNames.vertical)),
      middle: (0, _classnames.default)(dividerProps == null ? void 0 : dividerProps.getStyle(_dividerProps.default.ruleNames.middle)),
      inset: (0, _classnames.default)(dividerProps == null ? void 0 : dividerProps.getStyle(_dividerProps.default.ruleNames.inset))
    }
  });
};

__signature__(Divider, "useStyles{classes}", function () {
  return [useStyles];
});

__signature__(Divider, "useStyles{classes}", function () {
  return [useStyles];
});

var _default = Divider;
var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Divider.js");
  reactHotLoader.register(Divider, "Divider", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Divider.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Divider.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();

;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Divider.js");
  reactHotLoader.register(Divider, "Divider", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Divider.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/Divider.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();