"use strict";

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _core = require("@emotion/core");

var _reactShare = require("react-share");

var _lodash = require("lodash");

var _window = _interopRequireDefault(require("global/window"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _templateObject4() {
  var data = _taggedTemplateLiteral(["\n  max-width: 700px;\n  text-align: center;\n  margin: 60px auto;\n"]);

  _templateObject4 = function _templateObject4() {
    return data;
  };

  return data;
}

function _templateObject3() {
  var data = _taggedTemplateLiteral(["\n  display: inline-block;\n"]);

  _templateObject3 = function _templateObject3() {
    return data;
  };

  return data;
}

function _templateObject2() {
  var data = _taggedTemplateLiteral(["\n  font-size: 18px;\n  text-align: center;\n  display: flex;\n  justify-content: center;\n  line-height: 40px;\n"]);

  _templateObject2 = function _templateObject2() {
    return data;
  };

  return data;
}

function _templateObject() {
  var data = _taggedTemplateLiteral(["\n  font-family: \"Merriweather\", serif;\n  font-size: 24px;\n  color: #1e62bd;\n  margin-bottom: 12px;\n"]);

  _templateObject = function _templateObject() {
    return data;
  };

  return data;
}

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var quoteClass = (0, _core.css)(_templateObject());
var attributionClass = (0, _core.css)(_templateObject2());
var iconClass = (0, _core.css)(_templateObject3());
var wrapperClass = (0, _core.css)(_templateObject4());

var PullQuote = function PullQuote(_ref) {
  var quoteText = _ref.quoteText,
      quoteAttribution = _ref.quoteAttribution,
      url = _ref.url;
  return (0, _core.jsx)("div", {
    css: wrapperClass
  }, (0, _core.jsx)(_reactShare.TwitterShareButton, {
    url: url || (0, _lodash.get)(_window["default"], "location.href", ""),
    title: quoteText
  }, (0, _core.jsx)("blockquote", {
    css: quoteClass
  }, "\u201C", quoteText, "\u201D", (0, _core.jsx)("br", null), quoteAttribution ? (0, _core.jsx)("span", {
    css: attributionClass
  }, "\u2014 ", quoteAttribution) : null), (0, _core.jsx)("div", {
    css: iconClass
  }, (0, _core.jsx)(_reactShare.TwitterIcon, {
    size: 24,
    round: true,
    iconBgStyle: {
      fill: "#1E62BD"
    }
  }))));
};

PullQuote.displayName = "PullQuote";
PullQuote.propTypes = {
  quoteText: _propTypes["default"].string,
  quoteAttribution: _propTypes["default"].string,
  url: _propTypes["default"].string
};
var _default = PullQuote;
exports["default"] = _default;