"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

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

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 _react = _interopRequireWildcard(require("react"));

var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));

var _platform = _interopRequireDefault(require("platform"));

var _ToggleDetails = _interopRequireDefault(require("@instructure/ui-toggle-details/lib/components/ToggleDetails"));

var _Table = _interopRequireDefault(require("@instructure/ui-elements/lib/components/Table"));

var _ScreenReaderContent = _interopRequireDefault(require("@instructure/ui-a11y/lib/components/ScreenReaderContent"));

var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/lib/format-message"));

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

  function SessionStartEvent() {
    (0, _classCallCheck2.default)(this, SessionStartEvent);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(SessionStartEvent).apply(this, arguments));
  }

  (0, _createClass2.default)(SessionStartEvent, [{
    key: "render",
    value: function render() {
      var event = this.props.event;

      var userPlatform = _platform.default.parse(event.getIn(['eventData', 'userAgent']));

      return _react.default.createElement(_ToggleDetails.default, {
        summary: "Detalles del sistema capturados"
      }, _react.default.createElement(_Table.default, {
        caption: _react.default.createElement(_ScreenReaderContent.default, null, "Detalles del sistema")
      }, _react.default.createElement("thead", null, _react.default.createElement("tr", null, _react.default.createElement("th", null, "atributo"), _react.default.createElement("th", null, "valor"))), _react.default.createElement("tbody", null, _react.default.createElement("tr", null, _react.default.createElement("td", null, "Navegador"), _react.default.createElement("td", null, "".concat(userPlatform.name, " ").concat(userPlatform.version))), _react.default.createElement("tr", null, _react.default.createElement("td", null, "Sistema operativo"), _react.default.createElement("td", null, userPlatform.os.toString())))));
    }
  }]);
  SessionStartEvent.displayName = "SessionStartEvent";
  return SessionStartEvent;
}(_react.Component);

exports.default = SessionStartEvent;
SessionStartEvent.propTypes = {
  event: _reactImmutableProptypes.default.record.isRequired
};