'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var icons = require('@transferwise/icons');
var clsx = require('clsx');
var Alert = require('../alert/Alert.js');
require('../common/theme.js');
require('../common/direction.js');
require('@transferwise/neptune-tokens');
require('../common/propsValues/control.js');
require('../common/propsValues/size.js');
require('../common/propsValues/typography.js');
require('../common/propsValues/width.js');
require('../common/propsValues/type.js');
require('../common/propsValues/dateMode.js');
require('../common/propsValues/monthFormat.js');
require('../common/propsValues/position.js');
require('../common/propsValues/layouts.js');
require('../common/propsValues/status.js');
var sentiment = require('../common/propsValues/sentiment.js');
require('../common/propsValues/profileType.js');
require('../common/propsValues/variant.js');
require('../common/propsValues/scroll.js');
require('../common/propsValues/markdownNodeType.js');
require('../common/fileType.js');
require('@transferwise/formatting');
require('react');
require('react-intl');
require('../common/closeButton/CloseButton.messages.js');
var jsxRuntime = require('react/jsx-runtime');
var Circle = require('../common/circle/Circle.js');
var SentimentSurface = require('../sentimentSurface/SentimentSurface.js');

const makeSurface = sentiment => {
  const Surface = props => /*#__PURE__*/jsxRuntime.jsx(SentimentSurface.default, {
    as: "span",
    emphasis: "elevated",
    sentiment: sentiment,
    ...props
  });
  Surface.displayName = `CriticalCommsSurface(${sentiment})`;
  return Surface;
};
const iconBySentiment = {
  [sentiment.Sentiment.NEGATIVE]: /*#__PURE__*/jsxRuntime.jsx(Circle.default, {
    as: makeSurface(sentiment.Sentiment.NEGATIVE),
    size: 32,
    className: "status-circle negative",
    children: /*#__PURE__*/jsxRuntime.jsx(icons.Alert, {
      className: "status-icon light"
    })
  }),
  [sentiment.Sentiment.WARNING]: /*#__PURE__*/jsxRuntime.jsx(Circle.default, {
    as: makeSurface(sentiment.Sentiment.WARNING),
    size: 32,
    className: "status-circle warning",
    children: /*#__PURE__*/jsxRuntime.jsx(icons.Alert, {
      className: "status-icon dark"
    })
  }),
  [sentiment.Sentiment.NEUTRAL]: /*#__PURE__*/jsxRuntime.jsx(Circle.default, {
    as: makeSurface(sentiment.Sentiment.NEUTRAL),
    size: 32,
    className: "status-circle neutral",
    children: /*#__PURE__*/jsxRuntime.jsx(icons.ClockBorderless, {
      className: "status-icon dark"
    })
  })
};
/**
 * @deprecated `CriticalCommsBanner` component is deprecated and now replaced by the `CriticalBanner` component.
 */
function CriticalCommsBanner({
  title,
  subtitle,
  action,
  sentiment: sentiment$1 = sentiment.Sentiment.NEGATIVE,
  className
}) {
  return /*#__PURE__*/jsxRuntime.jsx(SentimentSurface.default, {
    sentiment: sentiment$1,
    emphasis: "elevated",
    className: clsx.clsx('critical-comms', className),
    children: /*#__PURE__*/jsxRuntime.jsx(Alert.default, {
      title: title,
      message: subtitle,
      action: action && {
        onClick: action.onClick,
        href: action.href,
        target: action.target,
        text: action.label,
        as: 'button'
      },
      className: className,
      type: sentiment$1,
      icon: iconBySentiment[sentiment$1]
    })
  });
}

exports.default = CriticalCommsBanner;
//# sourceMappingURL=CriticalCommsBanner.js.map
