"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _mapSearch = _interopRequireDefault(require("./map-search"));
var _layerControl = _interopRequireDefault(require("./layer-control"));
var _dimensionSwitch = _interopRequireDefault(require("./dimension-switch"));
var _baseMapSwitch = _interopRequireDefault(require("./base-map-switch"));
var _itemWrap = _interopRequireDefault(require("./components/item-wrap"));
var _classnames = _interopRequireDefault(require("classnames"));
var _layerControlPopover = _interopRequireDefault(require("./layer-control-popover"));
var _toolBox = _interopRequireDefault(require("./tool-box"));
var _loading = _interopRequireDefault(require("./loading"));
var _tip = _interopRequireDefault(require("./tip"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
var Tools = function Tools(props) {
  var style = props.style,
    _props$mapSearch = props.mapSearch,
    mapSearch = _props$mapSearch === void 0 ? {} : _props$mapSearch,
    _props$layerControl = props.layerControl,
    layerControl = _props$layerControl === void 0 ? {} : _props$layerControl,
    _props$dimensionSwitc = props.dimensionSwitch,
    dimensionSwitch = _props$dimensionSwitc === void 0 ? {} : _props$dimensionSwitc,
    _props$baseMapSwitch = props.baseMapSwitch,
    baseMapSwitch = _props$baseMapSwitch === void 0 ? {} : _props$baseMapSwitch,
    _props$toolbox = props.toolbox,
    toolbox = _props$toolbox === void 0 ? {} : _props$toolbox,
    _props$loading = props.loading,
    loading = _props$loading === void 0 ? {} : _props$loading,
    _props$tip = props.tip,
    tip = _props$tip === void 0 ? {} : _props$tip,
    children = props.children;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("ul", {
    className: (0, _classnames["default"])('cs-tools'),
    style: style
  }, (mapSearch === null || mapSearch === void 0 ? void 0 : mapSearch.show) && /*#__PURE__*/_react["default"].createElement(_mapSearch["default"], mapSearch), (dimensionSwitch === null || dimensionSwitch === void 0 ? void 0 : dimensionSwitch.show) && /*#__PURE__*/_react["default"].createElement(_dimensionSwitch["default"], _extends({}, mapSearch, dimensionSwitch)), (baseMapSwitch === null || baseMapSwitch === void 0 ? void 0 : baseMapSwitch.show) && /*#__PURE__*/_react["default"].createElement(_baseMapSwitch["default"], mapSearch), (toolbox === null || toolbox === void 0 ? void 0 : toolbox.show) && /*#__PURE__*/_react["default"].createElement(_toolBox["default"], toolbox), (layerControl === null || layerControl === void 0 ? void 0 : layerControl.show) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, layerControl.type === 'popover' ? /*#__PURE__*/_react["default"].createElement(_layerControlPopover["default"], layerControl) : /*#__PURE__*/_react["default"].createElement(_layerControl["default"], layerControl)), (tip === null || tip === void 0 ? void 0 : tip.show) && /*#__PURE__*/_react["default"].createElement(_tip["default"], tip), children, (loading === null || loading === void 0 ? void 0 : loading.show) && /*#__PURE__*/_react["default"].createElement(_loading["default"], loading)));
};
Tools.Item = _itemWrap["default"];
Tools.propTypes = {
  mapSearch: _propTypes["default"].object,
  toolbox: _propTypes["default"].object,
  dimensionSwitch: _propTypes["default"].object,
  baseMapSwitch: _propTypes["default"].object,
  layerControl: _propTypes["default"].object,
  tip: _propTypes["default"].object,
  loading: _propTypes["default"].object,
  style: _propTypes["default"].object,
  children: _propTypes["default"].node
};
Tools.defaultProps = {
  mapSearch: {
    show: true
  },
  toolbox: {
    show: true
  },
  dimensionSwitch: {
    show: false
  },
  baseMapSwitch: {
    show: false
  },
  layerControl: {
    show: true,
    showAll: true
  },
  tip: {
    show: false
  },
  loading: {
    show: false
  }
};
var _default = exports["default"] = Tools;
//# sourceMappingURL=index.js.map
