"use strict";

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

var _tslib = require("tslib");

var _consoleComponents = require("@alicloud/console-components");

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

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var LPSwitch =
/** @class */
function (_super) {
  (0, _tslib.__extends)(LPSwitch, _super);

  function LPSwitch(props, context) {
    return _super.call(this, props, context) || this;
  }

  LPSwitch.prototype.render = function () {
    var _a = this.props,
        loading = _a.loading,
        checkedChildren = _a.checkedChildren,
        unCheckedChildren = _a.unCheckedChildren,
        res = (0, _tslib.__rest)(_a, ["loading", "checkedChildren", "unCheckedChildren"]);
    return loading === undefined ? /*#__PURE__*/_react["default"].createElement(_consoleComponents.Switch, (0, _tslib.__assign)({
      checkedChildren: /*#__PURE__*/_react["default"].createElement("span", null, checkedChildren),
      unCheckedChildren: /*#__PURE__*/_react["default"].createElement("span", null, unCheckedChildren)
    }, res)) : /*#__PURE__*/_react["default"].createElement(_consoleComponents.Switch, (0, _tslib.__assign)({
      checkedChildren: /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_consoleComponents.Icon, {
        type: "loading",
        size: 'small',
        style: {
          display: loading ? 'initial' : 'none'
        }
      }), /*#__PURE__*/_react["default"].createElement("span", {
        style: {
          display: loading ? 'none' : 'block'
        }
      }, checkedChildren)),
      unCheckedChildren: /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
        style: {
          display: loading ? 'none' : 'block'
        }
      }, unCheckedChildren), /*#__PURE__*/_react["default"].createElement(_consoleComponents.Icon, {
        type: "loading",
        size: 'small',
        style: {
          display: loading ? 'initial' : 'none'
        }
      }))
    }, res));
  };

  return LPSwitch;
}(_react["default"].Component);

var _default = LPSwitch;
exports["default"] = _default;