"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

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

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

var _utils = require("@mui/utils");

var _createBreakpoints = _interopRequireDefault(require("./createBreakpoints"));

var _shape = _interopRequireDefault(require("./shape"));

var _createSpacing = _interopRequireDefault(require("./createSpacing"));

const _excluded = ["breakpoints", "palette", "spacing", "shape"];

function createTheme(options = {}, ...args) {
  const {
    breakpoints: breakpointsInput = {},
    palette: paletteInput = {},
    spacing: spacingInput,
    shape: shapeInput = {}
  } = options,
        other = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);
  const breakpoints = (0, _createBreakpoints.default)(breakpointsInput);
  const spacing = (0, _createSpacing.default)(spacingInput);
  let muiTheme = (0, _utils.deepmerge)({
    breakpoints,
    direction: 'ltr',
    components: {},
    // Inject component definitions.
    palette: (0, _extends2.default)({
      mode: 'light'
    }, paletteInput),
    spacing,
    shape: (0, _extends2.default)({}, _shape.default, shapeInput)
  }, other);
  muiTheme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), muiTheme);
  return muiTheme;
}

var _default = createTheme;
exports.default = _default;