'use strict';

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

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

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

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

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

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

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

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

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

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

var _reactDom = _interopRequireDefault(require("react-dom"));

var _utilUi = require("@the-/util-ui");

var TheMapMarker =
/*#__PURE__*/
function (_React$Component) {
  (0, _inherits2["default"])(TheMapMarker, _React$Component);

  function TheMapMarker() {
    (0, _classCallCheck2["default"])(this, TheMapMarker);
    return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TheMapMarker).apply(this, arguments));
  }

  (0, _createClass2["default"])(TheMapMarker, [{
    key: "render",
    value: function render() {
      var props = this.props,
          _this$props = this.props,
          children = _this$props.children,
          className = _this$props.className,
          container = _this$props.container;

      if (!container) {
        return null;
      }

      return _reactDom["default"].createPortal(_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _utilUi.htmlAttributesFor)(props, {
        except: ['className', 'width', 'height']
      }), (0, _utilUi.eventHandlersFor)(props, {
        except: []
      }), {
        className: (0, _classnames["default"])('the-map-marker', className)
      }), children), container);
    }
  }]);
  return TheMapMarker;
}(_react["default"].Component);

var _default = TheMapMarker;
exports["default"] = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRoZU1hcE1hcmtlci5qc3giXSwibmFtZXMiOlsiVGhlTWFwTWFya2VyIiwicHJvc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