"use strict";

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

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")), _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")), _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")), _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")), _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")), _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")), _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")), _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")), _react = _interopRequireWildcard(require("react")), _propTypes = _interopRequireDefault(require("prop-types")), _dt2react = require("dt2react"), _amosIcon = _interopRequireDefault(require("amos-icon")), _DevicePropertyPanel = _interopRequireDefault(require("./DevicePropertyPanel")), _DeviceCapacityPanel = _interopRequireDefault(require("./DeviceCapacityPanel")), _CapacityInterfacePanel = _interopRequireDefault(require("./CapacityInterfacePanel"));

function _getRequireWildcardCache(e) {
  if ("function" != typeof WeakMap) return null;
  var t = new WeakMap, a = new WeakMap;
  return (_getRequireWildcardCache = function(e) {
    return e ? a : t;
  })(e);
}

function _interopRequireWildcard(e, t) {
  if (!t && e && e.__esModule) return e;
  if (null === e || "object" !== _typeof(e) && "function" != typeof e) return {
    default: e
  };
  var a = _getRequireWildcardCache(t);
  if (a && a.has(e)) return a.get(e);
  var r = {}, i = Object.defineProperty && Object.getOwnPropertyDescriptor;
  for (var n in e) if ("default" !== n && Object.prototype.hasOwnProperty.call(e, n)) {
    var c = i ? Object.getOwnPropertyDescriptor(e, n) : null;
    c && (c.get || c.set) ? Object.defineProperty(r, n, c) : r[n] = e[n];
  }
  return r.default = e, a && a.set(e, r), r;
}

function _createSuper(e) {
  var t = _isNativeReflectConstruct();
  return function() {
    var a, r = (0, _getPrototypeOf2.default)(e);
    if (t) {
      var i = (0, _getPrototypeOf2.default)(this).constructor;
      a = Reflect.construct(r, arguments, i);
    } else a = r.apply(this, arguments);
    return (0, _possibleConstructorReturn2.default)(this, a);
  };
}

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

var ConfigPanel = function(e) {
  (0, _inherits2.default)(a, e);
  var t = _createSuper(a);
  function a(e) {
    var r;
    return (0, _classCallCheck2.default)(this, a), r = t.call(this, e), (0, _defineProperty2.default)((0, 
    _assertThisInitialized2.default)(r), "closeDeviceCapacityPanel", (function() {
      (0, _dt2react.addStyle)(r.deviceCapacityPanel, "display", "none"), (0, _dt2react.addStyle)(r.capacityInterfacePanel, "display", "none");
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(r), "closeCapacityInterfacePanel", (function() {
      (0, _dt2react.addStyle)(r.capacityInterfacePanel, "display", "none");
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(r), "showDeviceCapacityPanel", (function(e, t) {
      (0, _dt2react.addStyle)(r.deviceCapacityPanel, "display", "inline"), void 0 !== e && r.setState({
        capacityBasicInfo: e,
        getCurrentEquipment: t
      }), r.deviceCapacityNode.changeCollapseSize();
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(r), "showCapacityInterfacePanel", (function(e, t) {
      (0, _dt2react.addStyle)(r.capacityInterfacePanel, "display", "inline"), void 0 !== e && r.setState({
        interfaceBasicInfo: e,
        getCurrentEquipment: t
      }), r.capacityInterfaceNode.changeCollapseSize();
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(r), "clickPanel", (function() {
      var e = r.state.expandStyle;
      e = "empty-property-root-hide" === e ? "empty-property-root" : "empty-property-root-hide", 
      r.setState({
        expandStyle: e
      });
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(r), "showPanel", (function() {
      r.setState({
        expandStyle: "empty-property-root"
      });
    })), r.state = {
      capacityBasicInfo: {},
      interfaceBasicInfo: {},
      expandStyle: "empty-property-root"
    }, r;
  }
  return (0, _createClass2.default)(a, [ {
    key: "componentDidMount",
    value: function() {}
  }, {
    key: "componentWillReceiveProps",
    value: function(e) {}
  }, {
    key: "render",
    value: function() {
      var e = this, t = this.state, a = t.capacityBasicInfo, r = t.interfaceBasicInfo, i = t.getCurrentEquipment, n = t.expandStyle;
      return _react.default.createElement("div", {
        className: n
      }, _react.default.createElement("div", {
        className: "empty-property-btn",
        onClick: this.clickPanel
      }, _react.default.createElement(_amosIcon.default, {
        icon: "empty-property-root-hide" === n ? "left" : "right"
      })), _react.default.createElement("div", {
        className: "empty-property-panel"
      }, _react.default.createElement("div", {
        className: "config-panel"
      }, _react.default.createElement("div", {
        className: "capacity-interface-panel",
        ref: function(t) {
          return e.capacityInterfacePanel = t;
        }
      }, _react.default.createElement(_CapacityInterfacePanel.default, (0, _extends2.default)({
        closeCapacityInterfacePanel: this.closeCapacityInterfacePanel,
        interfaceBasicInfo: r,
        getCurrentEquipment: i,
        capacityBasicInfo: a,
        ref: function(t) {
          return e.capacityInterfaceNode = t;
        }
      }, this.props))), _react.default.createElement("div", {
        className: "device-capacity-panel",
        ref: function(t) {
          return e.deviceCapacityPanel = t;
        }
      }, _react.default.createElement(_DeviceCapacityPanel.default, (0, _extends2.default)({
        capacityBasicInfo: a,
        closeDeviceCapacityPanel: this.closeDeviceCapacityPanel,
        showCapacityInterfacePanel: this.showCapacityInterfacePanel,
        getCurrentEquipment: i,
        ref: function(t) {
          return e.deviceCapacityNode = t;
        }
      }, this.props))), _react.default.createElement(_DevicePropertyPanel.default, (0, 
      _extends2.default)({
        showDeviceCapacityPanel: this.showDeviceCapacityPanel,
        closeCapacityInterfacePanel: this.closeCapacityInterfacePanel
      }, this.props)))));
    }
  } ]), a;
}(_react.Component);

ConfigPanel.displayName = "ConfigPanel", ConfigPanel.propTypes = {
  config: _propTypes.default.object,
  getSubgraphData: _propTypes.default,
  subviewId: _propTypes.default.string,
  nodeId: _propTypes.default.string,
  equipmentId: _propTypes.default.number,
  updateNodeConfig: _propTypes.default.func,
  cfgParamJson: _propTypes.default.object,
  deviceLabel: _propTypes.default.string,
  deleteNode: _propTypes.default.func,
  doHiddenProperty: _propTypes.default.func
};

var _default = ConfigPanel;

exports.default = _default;