"use strict";

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

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

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

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

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

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

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

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

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

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

var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));

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

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

var _classnames = _interopRequireDefault(require("classnames"));

var _rcTrigger = _interopRequireDefault(require("../../../libs/rc-trigger"));

var _config = _interopRequireDefault(require("../../../config"));

var _animation = require("../../../style/animation");

var _excluded = ["className", "popupClassName", "trueClassName", "triggerRef"];

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

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var _prefixCls = _config.default.prefixCls;
var prefixCls = _prefixCls + '-popover';
exports.prefixCls = prefixCls;
var animationPrefixCls = prefixCls + '-animation';
exports.animationPrefixCls = animationPrefixCls;
var animationDuration = '0.1s';

var RcTriggerWrap = /*#__PURE__*/function (_Component) {
  (0, _inherits2.default)(RcTriggerWrap, _Component);

  var _super = _createSuper(RcTriggerWrap);

  function RcTriggerWrap() {
    (0, _classCallCheck2.default)(this, RcTriggerWrap);
    return _super.apply(this, arguments);
  }

  (0, _createClass2.default)(RcTriggerWrap, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          className = _this$props.className,
          popupClassName = _this$props.popupClassName,
          trueClassName = _this$props.trueClassName,
          triggerRef = _this$props.triggerRef,
          rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
      return /*#__PURE__*/_react.default.createElement(_rcTrigger.default, (0, _extends2.default)({
        ref: triggerRef,
        className: trueClassName,
        popupClassName: (0, _classnames.default)(className, popupClassName)
      }, rest));
    }
  }]);
  return RcTriggerWrap;
}(_react.Component);

RcTriggerWrap.propTypes = {
  className: _propTypes.default.string,
  popupClassName: _propTypes.default.string,
  trueClassName: _propTypes.default.string,
  triggerRef: _propTypes.default.func
};
var PopoverWrap = ( /*#__PURE__*/0, _styledBase.default)(RcTriggerWrap, {
  target: "e18jm5rj0",
  label: "PopoverWrap"
})("&.", prefixCls, "{position:absolute;left:-9999px;top:-9999px;z-index:1030;display:block;&-hidden{display:none;}}&.", prefixCls, "-animation{&-fade{&-enter,&-appear,&-leave{animation-duration:", animationDuration, ";animation-fill-mode:both;}&-enter,&-appear{animation-name:", _animation.fadeIn, ";}&-leave{animation-name:", _animation.fadeOut, ";}}&-bounce{&-enter,&-appear,&-leave{animation-duration:", animationDuration, ";animation-fill-mode:both;}&-enter,&-appear{animation-name:", _animation.bounceIn, ";}&-leave{animation-name:", _animation.bounceOut, ";}}&-zoom{&-enter,&-appear,&-leave{animation-duration:", animationDuration, ";animation-fill-mode:both;}&-enter,&-appear{animation-name:", _animation.zoomIn, ";}&-leave{animation-name:", _animation.zoomOut, ";}}&-slide-up{&-enter,&-appear{animation-duration:", animationDuration, ";animation-fill-mode:both;transform-origin:0 0;display:block !important;opacity:0;animation-timing-function:cubic-bezier(0.08,0.82,0.17,1);animation-play-state:paused;}&-leave{animation-duration:", animationDuration, ";animation-fill-mode:both;transform-origin:0 0;display:block !important;opacity:1;animation-timing-function:cubic-bezier(0.6,0.04,0.98,0.34);animation-play-state:paused;}&-enter-active.", prefixCls, "-placement-bottomLeft,&-appear-active.", prefixCls, "-placement-bottomLeft,&-enter-active.", prefixCls, "-placement-bottomCenter,&-appear-active.", prefixCls, "-placement-bottomCenter,&-enter-active.", prefixCls, "-placement-bottomRight,&-appear-active.", prefixCls, "-placement-bottomRight{animation-name:", _animation.slideUpIn, ";animation-play-state:running;}&-enter-active.", prefixCls, "-placement-topLeft,&-appear-active.", prefixCls, "-placement-topLeft,&-enter-active.", prefixCls, "-placement-topCenter,&-appear-active.", prefixCls, "-placement-topCenter,&-enter-active.", prefixCls, "-placement-topRight,&-appear-active.", prefixCls, "-placement-topRight{animation-name:", _animation.slideDownIn, ";animation-play-state:running;}&-leave-active.", prefixCls, "-placement-bottomLeft,&-leave-active.", prefixCls, "-placement-bottomCenter,&-leave-active.", prefixCls, "-placement-bottomRight{animation-name:", _animation.slideUpOut, ";animation-play-state:running;}&-leave-active.", prefixCls, "-placement-topLeft,&-leave-active.", prefixCls, "-placement-topCenter,&-leave-active.", prefixCls, "-placement-topRight{animation-name:", _animation.slideDownOut, ";animation-play-state:running;}}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */"));
exports.PopoverWrap = PopoverWrap;