"use strict";

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

var _branding = require("../../../mixins/branding");

var BACKGROUND_COLORS = {
  secondary: 'brand-secondary-bg',
  primary: 'brand-primary-bg',
  success: 'success-bg',
  info: 'info-bg',
  error: 'error-bg',
  greyscale: 'greyscale-light'
};
var FOREGROUND_COLORS = {
  secondary: 'brand-secondary-fg',
  primary: 'brand-primary-fg',
  success: 'success-fg',
  info: 'info-fg',
  error: 'error-fg',
  greyscale: 'greyscale-black',
  white: 'white'
};

var getBackground = function getBackground(_ref) {
  var theme = _ref.theme,
      inverted = _ref.inverted,
      color = _ref.color;

  if (color === undefined) {
    return (0, _branding.getPaletteColor)(inverted ? FOREGROUND_COLORS.secondary : BACKGROUND_COLORS.secondary)({
      theme: theme
    });
  }

  return (0, _branding.getPaletteColor)(inverted ? FOREGROUND_COLORS[color] : BACKGROUND_COLORS[color])({
    theme: theme
  });
};

exports.getBackground = getBackground;

var getForegroundColor = function getForegroundColor(_ref2) {
  var theme = _ref2.theme,
      inverted = _ref2.inverted,
      color = _ref2.color;

  if (color === undefined) {
    return (0, _branding.getPaletteColor)(inverted ? FOREGROUND_COLORS.white : FOREGROUND_COLORS.secondary)({
      theme: theme
    });
  }

  return (0, _branding.getPaletteColor)(inverted ? BACKGROUND_COLORS[color] : FOREGROUND_COLORS[color])({
    theme: theme
  });
};

exports.getForegroundColor = getForegroundColor;