(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports);
    global.actions = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.socketError = _exports.socketConnect = _exports.reconnectError = _exports.reconnectDone = _exports.reconnectFailed = _exports.reconnect = _exports.newMessage = _exports.disconnect = _exports.getClient = _exports.createClient = _exports.connectTimeout = _exports.connectError = _exports.connect = _exports.NEW_MESSAGE = _exports.RECONNECT_FAILED = _exports.RECONNECT_ERROR = _exports.RECONNECT_DONE = _exports.RECONNECT = _exports.DISCONNECT = _exports.CONNECT_TIMEOUT = _exports.CONNECT_ERROR = _exports.CONNECT = _exports.SOCKET_READY = _exports.SOCKET_ERROR = _exports.CLIENT_CREATE = _exports.CLIENT_GET = void 0;
  const CLIENT_GET = 'sockets/GET';
  _exports.CLIENT_GET = CLIENT_GET;
  const CLIENT_CREATE = 'sockets/CREATE';
  _exports.CLIENT_CREATE = CLIENT_CREATE;
  const SOCKET_ERROR = 'sockets/ERROR';
  _exports.SOCKET_ERROR = SOCKET_ERROR;
  const SOCKET_READY = 'sockets/READY';
  _exports.SOCKET_READY = SOCKET_READY;
  const CONNECT = 'connections/CONNECT';
  _exports.CONNECT = CONNECT;
  const CONNECT_ERROR = 'connections/ERROR';
  _exports.CONNECT_ERROR = CONNECT_ERROR;
  const CONNECT_TIMEOUT = 'connections/TIMEOUT';
  _exports.CONNECT_TIMEOUT = CONNECT_TIMEOUT;
  const DISCONNECT = 'connections/DISCONNECT';
  _exports.DISCONNECT = DISCONNECT;
  const RECONNECT = 'connections/RECONNECT';
  _exports.RECONNECT = RECONNECT;
  const RECONNECT_DONE = 'connections/RECONNECT_DONE';
  _exports.RECONNECT_DONE = RECONNECT_DONE;
  const RECONNECT_ERROR = 'connections/RECONNECT_ERROR';
  _exports.RECONNECT_ERROR = RECONNECT_ERROR;
  const RECONNECT_FAILED = 'connections/RECONNECT_FAILED';
  _exports.RECONNECT_FAILED = RECONNECT_FAILED;
  const NEW_MESSAGE = 'messages/NEW';
  _exports.NEW_MESSAGE = NEW_MESSAGE;

  const connect = function connect(startTime) {
    return {
      type: CONNECT,
      data: {
        startTime: startTime || new Date()
      }
    };
  };

  _exports.connect = connect;

  const connectError = function connectError({
    error
  }) {
    return {
      error,
      type: CONNECT_ERROR
    };
  };

  _exports.connectError = connectError;

  const connectTimeout = function connectTimeout({
    timeout
  }) {
    return {
      type: CONNECT_TIMEOUT,
      data: {
        timeout
      }
    };
  };

  _exports.connectTimeout = connectTimeout;

  const createClient = function createClient({
    client
  }) {
    return {
      type: CLIENT_CREATE,
      data: {
        client
      }
    };
  };

  _exports.createClient = createClient;

  const getClient = function getClient({
    client
  }) {
    return {
      type: CLIENT_GET,
      data: {
        client
      }
    };
  };

  _exports.getClient = getClient;

  const disconnect = function disconnect({
    reason
  }) {
    return {
      type: DISCONNECT,
      data: {
        reason
      }
    };
  };

  _exports.disconnect = disconnect;

  const newMessage = function newMessage({
    message
  }) {
    return {
      type: NEW_MESSAGE,
      data: {
        message
      }
    };
  };

  _exports.newMessage = newMessage;

  const reconnect = function reconnect(attemptNumber) {
    return {
      type: RECONNECT,
      data: {
        attemptNumber
      }
    };
  };

  _exports.reconnect = reconnect;

  const reconnectFailed = function reconnectFailed(attemptNumber) {
    return {
      type: RECONNECT_FAILED,
      data: {
        attemptNumber
      }
    };
  };

  _exports.reconnectFailed = reconnectFailed;

  const reconnectDone = function reconnectDone(startTime) {
    return {
      type: RECONNECT_DONE,
      startTime: startTime || new Date()
    };
  };

  _exports.reconnectDone = reconnectDone;

  const reconnectError = function reconnectError({
    error
  }) {
    return {
      error,
      type: RECONNECT_ERROR
    };
  };

  _exports.reconnectError = reconnectError;

  const socketConnect = function socketConnect({
    client
  }) {
    return {
      type: CONNECT,
      data: {
        client
      }
    };
  };

  _exports.socketConnect = socketConnect;

  const socketError = function socketError(error) {
    return {
      error,
      type: SOCKET_ERROR
    };
  };

  _exports.socketError = socketError;
});
//# sourceMappingURL=actions.js.map