import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn, d as _getPrototypeOf, e as _createClass } from '../inherits-6cb67931.js';
import React from 'react';
import 'react-dom';
import { ModalCMD } from '../Modal/index.js';
import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
import { _ as _defineProperty } from '../defineProperty-18999f8e.js';
import { c as classnames } from '../index-b8d80d39.js';
import { Divider, Input, Button } from 'antd';

var img = "data:image/png;base64,[encoded data, 5884 characters]";

var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAABXFBMVEUAAAD/////1Sr/vyD/sxr/uRf/vxX/sSf/tiT/ryD/tB7/uBz/rhv/sxr/sRb/sR3/rxj/tBf/sRX/rhT/sRr/rhn6rxT6sRn6rRf7rhb7rhX7sBX7sRX7rhf7sBf7rhb7rxb7rhX8sBX8rhT8rRf8rhf8rxb8rxX8sBX8rxb8rhX8rhX8rxX6rhb6rRb6rxX6rRX6rhX6rRT6rhT7rhT7rxb7rhb7rxb7rhX7rxX7rRT7rRX7rhX7rhX7rRT7rhX7rhX8rxX8rhX8rRT6rRT6rhb6rhX6rRT6rhT6rRT6rhb6rRX7rhX7rRX7rhX7rRT7rhT7rRT7rhX7rhT7rhT7rRT7rhT7rhX7rhX7rhX7rhX7rhT6rRT6rhT6rhX6rRX6rRX7rRT7rRX7rhX7rhX7rhX7rhT7rhT7rRT7rhT7rRX7rRX7rhX7rRX7rRT7rRT7rRT7rRT7rhT6rRTUe0hUAAAAc3RSTlMAAQYICgsMDQ4QERITFBcaICIkJicpMzQ4OTw9PkJERUZISkxOT1BWV11hYmNoamxtbnBxcnN1dnd5fYOEhYmQkZKUlpmaoKKjpaaoq6ytr7Gyuby9vr/AwsPGytTV2d3e5Ofo6evu7/Dy8/T19vn6/P3+5CYzAwAAAlJJREFUOMuVletXUkEUxQ+FmZWWaAZB2EOI3laUCZU9xCIJMewaPW6FBkJRxO//X6sPF2buXOa6VufTzJ69Zs05Z88+ImZE4sWy43Y7rlMuxiNyWKTXm/iiuZ4OpSYajEUjbqXOVgHo1fK5VCyWyuVrPQCqs+PcxRYwqGSjGopmKgOgNfaW5T5QXwjCC3Wgv2yCz4D2ku11S21gzbgXcOfsac+5gO/uxT7sToUVaWoX+urdsy1wNXdm1fn29f2j05rtQmtUkyq09Rvu/fQq/GtVNXCuDdVhLwCd23PdkNeKvQQkRESkAXXFvQ78KFy8VNgDVhS8Aw0RkUUYqPpO7MHHGRGR6XfQnVb1HkBaREpQUTdchc4Zb3lyH26pgwqsi0SakFHYS3g1Wq/BhjrIQjMiCehpPWzB3dH6DmxpnfQgLkWo6QYU+HN2tH4KJX2yDUV5A3lfuy6ogp/ah5v6IA9lcSBna3JkCw4m9T4HjriQtJHXgBu+fQpc6ULMwn0CbPqBGHSlYyWvAPUjAXJHXEiNcS//hU+TBpQC15pg9Dt8PmFiOXCkbJZORERuQzf4p/NQDjRFCfxxEKtBUeJGu73YoB9M2mt3pAnZwMnxB+eDF3tCMiUaGp5EJe0Xf1iMxG9+KxERueK8OGoidfhg+bDDZO6btgTEbVYgMvEbHvq589oKgiYjcu3L5jG/JflN5r/s63BjnA8Yoyd1u+VmDoKWG2rm53YsZq7GRMY/JrJv7WPCGEDJWCyZy2+HD6Cw0ZYIH5olc2iW0ocqZjiOu9Zx/A8JqORwPqNn9gAAAABJRU5ErkJggg==";

var css = ".WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_middle__1UdIU {\n  color: #e1ad28;\n  font-size: 17px;\n  margin-top: 21px;\n}\n.WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_middle__1UdIU .WantedPublishView_wanted_cover__30Gn1 {\n  width: 95px;\n}\n.WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_bottom__3EIE0 .WantedPublishView_wanted_bottom_title__2LAKy {\n  color: #565656;\n  font-size: 14px;\n}\n.WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_bottom__3EIE0 .WantedPublishView_wanted_input_number__2Afkg {\n  margin: 11px auto;\n  width: 266px;\n  height: 36px;\n}\n.WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_bottom__3EIE0 .WantedPublishView_wanted_input_number__2Afkg .ant-input {\n  color: #fb4b56;\n  font-size: 16px;\n  text-align: center;\n}\n.WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_bottom__3EIE0 .WantedPublishView_wanted_input_number__2Afkg .ant-input:focus,\n.WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_bottom__3EIE0 .WantedPublishView_wanted_input_number__2Afkg .ant-input:hover {\n  outline: none;\n  box-shadow: none;\n  border-color: #fb4b56;\n}\n.WantedPublishView_wrapper__3lkb6 .WantedPublishView_wanted_bottom__3EIE0 .WantedPublishView_wanted_bottom_tips__19Je0 {\n  color: #9b9b9b;\n  font-size: 12px;\n}\n.WantedPublishView_wrapper__3lkb6 footer {\n  margin-top: 40px;\n}\n.WantedPublishView_wrapper__3lkb6 footer .WantedPublishView_wanted_confirm_button__1JBhv {\n  font-size: 16px;\n  color: white;\n  background-color: #71c135;\n}\n.WantedPublishView_wrapper__3lkb6 footer .WantedPublishView_wanted_confirm_button__1JBhv:hover,\n.WantedPublishView_wrapper__3lkb6 footer .WantedPublishView_wanted_confirm_button__1JBhv:focus {\n  color: white;\n  outline: none;\n  box-shadow: none;\n  background-color: #8cd158;\n  border-color: #fafdf8;\n}\n.WantedPublishView_wrapper__3lkb6 footer .WantedPublishView_wanted_cancel_button__CosmE {\n  margin-top: 12px;\n  color: #787f8c;\n  font-size: 12px;\n  cursor: pointer;\n}\n.WantedPublishView_wrapper__3lkb6 footer .WantedPublishView_wanted_cancel_button__CosmE:hover,\n.WantedPublishView_wrapper__3lkb6 footer .WantedPublishView_wanted_cancel_button__CosmE:focus {\n  color: #787f8c;\n  text-shadow: #565656;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 {\n  width: 320px;\n  padding: 32px 32px 24px 32px;\n  box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.2);\n  background-color: white;\n  border-radius: 4px;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 .WantedPublishView_top__2bV0z {\n  display: flex;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 .WantedPublishView_top__2bV0z .WantedPublishView_questionIcon__13EXq {\n  width: 22px;\n  height: 22px;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 .WantedPublishView_top__2bV0z .WantedPublishView_questionIcon__13EXq img {\n  width: 100%;\n  height: 100%;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 .WantedPublishView_top__2bV0z .WantedPublishView_title__dsQ9f {\n  font-size: 16px;\n  color: rgba(0, 0, 0, 0.85);\n  font-weight: bold;\n  margin-left: 16px;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 .WantedPublishView_content__b2kHo {\n  margin-left: 38px;\n  font-size: 14px;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 footer {\n  display: flex;\n  justify-content: flex-end;\n  align-items: center;\n  margin-top: 20px;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 footer .WantedPublishView_modalOk__3d3JO {\n  margin-left: 8px;\n  background-color: #71c135;\n  color: white;\n}\n.WantedPublishView_wantedCancelModal__2ODM1 footer .WantedPublishView_modalOk__3d3JO:hover,\n.WantedPublishView_wantedCancelModal__2ODM1 footer .WantedPublishView_modalOk__3d3JO:focus {\n  color: white;\n  outline: none;\n  box-shadow: none;\n  background-color: #8cd158;\n  border-color: #fafdf8;\n}\n";
var styles = {
  "wrapper": "WantedPublishView_wrapper__3lkb6",
  "wanted_middle": "WantedPublishView_wanted_middle__1UdIU",
  "wanted_cover": "WantedPublishView_wanted_cover__30Gn1",
  "wanted_bottom": "WantedPublishView_wanted_bottom__3EIE0",
  "wanted_bottom_title": "WantedPublishView_wanted_bottom_title__2LAKy",
  "wanted_input_number": "WantedPublishView_wanted_input_number__2Afkg",
  "wanted_bottom_tips": "WantedPublishView_wanted_bottom_tips__19Je0",
  "wanted_confirm_button": "WantedPublishView_wanted_confirm_button__1JBhv",
  "wanted_cancel_button": "WantedPublishView_wanted_cancel_button__CosmE",
  "wantedCancelModal": "WantedPublishView_wantedCancelModal__2ODM1",
  "top": "WantedPublishView_top__2bV0z",
  "questionIcon": "WantedPublishView_questionIcon__13EXq",
  "title": "WantedPublishView_title__dsQ9f",
  "content": "WantedPublishView_content__b2kHo",
  "modalOk": "WantedPublishView_modalOk__3d3JO",
  "wantedMiddle": "WantedPublishView_wanted_middle__1UdIU",
  "wantedCover": "WantedPublishView_wanted_cover__30Gn1",
  "wantedBottom": "WantedPublishView_wanted_bottom__3EIE0",
  "wantedBottomTitle": "WantedPublishView_wanted_bottom_title__2LAKy",
  "wantedInputNumber": "WantedPublishView_wanted_input_number__2Afkg",
  "wantedBottomTips": "WantedPublishView_wanted_bottom_tips__19Je0",
  "wantedConfirmButton": "WantedPublishView_wanted_confirm_button__1JBhv",
  "wantedCancelButton": "WantedPublishView_wanted_cancel_button__CosmE"
};
styleInject(css);

var WantedPublishView =
/*#__PURE__*/
function (_React$Component) {
  _inherits(WantedPublishView, _React$Component);

  function WantedPublishView(props) {
    var _this;

    _classCallCheck(this, WantedPublishView);

    _this = _possibleConstructorReturn(this, _getPrototypeOf(WantedPublishView).call(this, props));
    _this.containerRef = React.createRef();
    _this.state = {};
    return _this;
  }

  _createClass(WantedPublishView, [{
    key: "componentWillUnmount",
    value: function componentWillUnmount() {}
  }, {
    key: "render",
    value: function render() {
      var _this2 = this;

      var _this$props = this.props,
          current_wanted = _this$props.current_wanted,
          wrapperClass = _this$props.wrapperClass,
          _this$props$viewTextO = _this$props.viewTextOptions,
          viewTextOptions = _this$props$viewTextO === void 0 ? {
        viewTitle: "设置悬赏金额",
        imgLabelBottom: "悬赏提问",
        inputTipTop: "设置悬赏金额范围¥5.00～¥10000",
        numberSuffix: "元",
        inputTipBottom: "若5天内没人回答该问题, 所支付的金额将退还至您的钱包"
      } : _this$props$viewTextO,
          _this$props$showInput = _this$props.showInputWantedClear,
          showInputWantedClear = _this$props$showInput === void 0 ? true : _this$props$showInput;
      return React.createElement("div", {
        className: classnames(styles.wrapper, _defineProperty({}, wrapperClass ? wrapperClass : "", true)),
        ref: this.containerRef
      }, React.createElement("header", null, viewTextOptions.viewTitle), React.createElement("section", {
        className: styles.wanted_middle
      }, React.createElement("img", {
        className: styles.wanted_cover,
        src: img,
        alt: "wanted_image"
      }), React.createElement("div", null, viewTextOptions.imgLabelBottom)), React.createElement(Divider, {
        style: {
          minWidth: "auto",
          marginLeft: "auto",
          marginRight: "auto",
          width: "266px"
        }
      }), React.createElement("section", {
        className: styles.wanted_bottom
      }, React.createElement("div", {
        className: styles.wanted_bottom_title
      }, viewTextOptions.inputTipTop), React.createElement(Input, {
        className: styles.wanted_input_number,
        suffix: viewTextOptions.numberSuffix,
        value: current_wanted || "",
        onChange: function onChange(v) {
          if (!/^[.0-9]*$/g.test(v.target.value)) return;

          _this2.props.InputWantedValueChange(v.target.value);
        },
        onPressEnter: function onPressEnter() {
          _this2.props.InputWantedPressEnter(current_wanted);
        },
        onBlur: function onBlur() {
          _this2.props.InputWantedOnBlur(current_wanted);
        },
        autoFocus: true
      }), React.createElement("div", {
        className: styles.wanted_bottom_tips
      }, viewTextOptions.inputTipBottom)), React.createElement("footer", null, React.createElement(Button, {
        className: styles.wanted_confirm_button,
        onClick: function onClick() {
          _this2.props.InputWantedConfirm(_this2.containerRef);
        }
      }, "\u786E\u5B9A"), showInputWantedClear && React.createElement("div", {
        role: "button",
        tabIndex: -1,
        onClick: function onClick() {
          _this2.props.InputWantedClear();
        },
        className: styles.wanted_cancel_button
      }, "\u53D6\u6D88\u60AC\u8D4F")));
    }
  }]);

  return WantedPublishView;
}(React.Component);

function WantedViewWranModel(_ref) {
  var refMount = _ref.refMount,
      actionConfirm = _ref.actionConfirm,
      actionCancel = _ref.actionCancel,
      _ref$viewTextOptions = _ref.viewTextOptions,
      viewTextOptions = _ref$viewTextOptions === void 0 ? {
    warnModalTitle: "确认减少悬赏金额",
    warnModalTip: "若减少悬赏金额，您之前支付的金额中，已分配的赏金无法退回，剩余的￥2.00会退还至您的钱包。"
  } : _ref$viewTextOptions;
  ModalCMD.show({
    container: refMount.current || document.body,
    children: React.createElement("div", {
      className: styles.wantedCancelModal
    }, React.createElement("div", {
      className: styles.top
    }, React.createElement("div", {
      className: styles.questionIcon
    }, React.createElement("img", {
      src: img$1,
      alt: "question"
    })), React.createElement("div", {
      className: styles.title
    }, viewTextOptions.warnModalTitle)), React.createElement("div", {
      className: styles.content
    }, viewTextOptions.warnModalTip), React.createElement("footer", null, React.createElement(Button, {
      className: styles.modalCancel,
      onClick: function onClick() {
        actionCancel();
        ModalCMD.hide();
      }
    }, "\u53D6\u6D88"), React.createElement(Button, {
      className: styles.modalOk,
      onClick: function onClick() {
        actionConfirm();
        ModalCMD.hide();
      }
    }, "\u786E\u8BA4")))
  });
}

export default WantedPublishView;
export { WantedViewWranModel };
//# sourceMappingURL=index.js.map
