"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
require("./index.scss");
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 banner2 = function banner2(_ref) {
  var bgImg = _ref.bgImg,
    text = _ref.text,
    font = _ref.font,
    fontSize = _ref.fontSize,
    fontColor = _ref.fontColor,
    fontOpacity = _ref.fontOpacity,
    tops = _ref.tops,
    MessageLintHight = _ref.MessageLintHight,
    textRoate = _ref.textRoate;
  var fontTextCss = {
    style: {
      opacity: fontOpacity / 100,
      color: fontColor,
      fontSize: fontSize + "px",
      fontFamily: font,
      top: tops + "%",
      transform: "translateX(-50%) rotate(" + textRoate + "deg)",
      height: "20px"
    }
  };
  // const bannerBgStyle = {
  //     style: {
  //         opacity: bgOpacity / 100,
  //         backgroundImage: `url(${bgImg}?imageMogr2/interlace/1)`,
  //     },
  // };
  var LiCSS = {
    style: {
      lineHeight: MessageLintHight + "vw"
    }
  };
  var result = text.split(/\n/g).filter(function (item) {
    return !!item;
  });
  return /*#__PURE__*/React.createElement("div", {
    className: "banner"
  }, /*#__PURE__*/React.createElement("img", {
    src: bgImg
  }), /*#__PURE__*/React.createElement("div", {
    className: "title"
  }, /*#__PURE__*/React.createElement("div", {
    className: "titleName"
  }, /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
    className: "title-text"
  }, fontTextCss), /*#__PURE__*/React.createElement("ul", null, result && result.length > 0 && result.map(function (item, index) {
    return /*#__PURE__*/React.createElement("li", (0, _extends2["default"])({
      key: index
    }, LiCSS), item);
  }))), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
    className: "title-text"
  }, fontTextCss), text))));
};
var _default = banner2;
exports["default"] = _default;