"use strict";

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

var _typeof = require("@babel/runtime/helpers/typeof");

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

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

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

var _dialog = require("../dialog");

var _theme = _interopRequireDefault(require("./theme.css"));

var _typography = require("../typography");

var _box = _interopRequireDefault(require("../box"));

var _marketingButton = _interopRequireDefault(require("../marketingButton"));

var _flex = _interopRequireDefault(require("../flex"));

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

var MarketingDialog = function MarketingDialog(_ref) {
  var active = _ref.active,
      onCloseClick = _ref.onCloseClick,
      onEscKeyDown = _ref.onEscKeyDown,
      onOverlayClick = _ref.onOverlayClick,
      title = _ref.title,
      graphic = _ref.graphic,
      subtitle = _ref.subtitle,
      body = _ref.body,
      primaryAction = _ref.primaryAction,
      secondaryAction = _ref.secondaryAction;
  var ctaRef = (0, _react.useRef)(null);
  return /*#__PURE__*/_react.default.createElement(_dialog.DialogBase, {
    active: active,
    onCloseClick: onCloseClick,
    onEscKeyDown: onEscKeyDown,
    onOverlayClick: onOverlayClick,
    className: _theme.default['marketing-dialog'],
    initialFocusRef: ctaRef
  }, /*#__PURE__*/_react.default.createElement(_dialog.DialogBase.Header, {
    onCloseClick: onCloseClick
  }, /*#__PURE__*/_react.default.createElement(_typography.Heading3, null, title)), /*#__PURE__*/_react.default.createElement(_dialog.DialogBase.Body, {
    scrollable: true,
    display: "flex",
    flexDirection: "row",
    padding: 6,
    justifyContent: "space-between",
    alignItems: "center"
  }, /*#__PURE__*/_react.default.createElement(_box.default, {
    borderWidth: 1,
    borderRadius: "rounded",
    overflow: "hidden"
  }, /*#__PURE__*/(0, _react.cloneElement)(graphic, {
    width: '480',
    height: '270',
    className: _theme.default['marketing-dialog-graphic']
  })), /*#__PURE__*/_react.default.createElement(_box.default, {
    className: _theme.default['marketing-dialog-text']
  }, /*#__PURE__*/_react.default.createElement(_typography.Heading1, null, subtitle), /*#__PURE__*/_react.default.createElement(_typography.TextBody, {
    marginTop: 3,
    marginBottom: 4
  }, body), /*#__PURE__*/_react.default.createElement(_flex.default, {
    direction: "column",
    alignItems: "center",
    gap: 3
  }, /*#__PURE__*/_react.default.createElement(_marketingButton.default, (0, _extends2.default)({
    ref: ctaRef
  }, primaryAction, {
    level: "primary",
    fullWidth: true
  })), secondaryAction && /*#__PURE__*/_react.default.createElement(_marketingButton.default, (0, _extends2.default)({}, secondaryAction, {
    level: "link",
    fullWidth: true
  }))))));
};

var _default = MarketingDialog;
exports.default = _default;