/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
"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;
require("./index.compiled.css");
var React = _interopRequireWildcard(require("react"));
var _runtime = require("@compiled/react/runtime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _reactIntl = require("react-intl");
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
var _link = _interopRequireDefault(require("@atlaskit/link"));
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
var _messages = require("../../../messages");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var breakWordsCss = null;
var WarningModal = function WarningModal(props) {
  var isOpen = props.isOpen,
    unsafeLinkText = props.unsafeLinkText,
    url = props.url,
    onClose = props.onClose,
    onContinue = props.onContinue,
    intl = props.intl;
  var content = /*#__PURE__*/React.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(_modalDialog.default, {
    onClose: onClose,
    testId: "link-with-safety-warning"
  }, /*#__PURE__*/React.createElement(_modalDialog.ModalHeader, {
    hasCloseButton: true
  }, /*#__PURE__*/React.createElement(_modalDialog.ModalTitle, {
    appearance: "warning"
  }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.messages.check_this_link))), /*#__PURE__*/React.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/React.createElement("div", {
    className: (0, _runtime.ax)(["_o5726vc6 _1nmz9jpi"])
  }, url && unsafeLinkText && /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, _messages.messages.link_safety_warning_message, {
    values: {
      unsafeLinkText: unsafeLinkText,
      a: function a() {
        return /*#__PURE__*/React.createElement(_link.default, {
          href: url,
          target: "_blank",
          rel: "noopener noreferrer"
        }, url);
      }
    }
  })))), /*#__PURE__*/React.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/React.createElement(_standardButton.default, {
    appearance: "subtle",
    onClick: onClose
  }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.messages.go_back)), /*#__PURE__*/React.createElement(_standardButton.default, {
    appearance: "warning",
    onClick: onContinue,
    autoFocus: true
  }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.messages.continue)))));
  return intl ? content : /*#__PURE__*/React.createElement(_reactIntl.IntlProvider, {
    locale: "en"
  }, content);
};
var _default_1 = (0, _reactIntl.injectIntl)(WarningModal, {
  enforceContext: false
});
var _default = exports.default = _default_1;