"use strict";

exports.__esModule = true;
exports.default = exports.computeFinalRequestProcessingState = void 0;

var _constants = require("./../constants");

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var computeFinalRequestProcessingState = function computeFinalRequestProcessingState() {
  var states = arguments;
  var idleCount = 0;

  for (var i = 0; i < states.length; i++) {
    switch (states[i]) {
      case _constants.requestStates.fail:
        return _constants.requestStates.fail;

      case _constants.requestStates.processing:
        return _constants.requestStates.processing;

      case _constants.requestStates.idle:
        idleCount++;
        continue;

      case _constants.requestStates.success:
        continue;

      default:
        throw Error("You have to pass just requestStates type");
    }
  }

  return idleCount === states.length ? _constants.requestStates.idle : _constants.requestStates.success;
};

exports.computeFinalRequestProcessingState = computeFinalRequestProcessingState;
var _default = computeFinalRequestProcessingState;
var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(computeFinalRequestProcessingState, "computeFinalRequestProcessingState", "/home/vsts/work/1/s/src/utils/requestProcessingHelper.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/utils/requestProcessingHelper.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();

;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(computeFinalRequestProcessingState, "computeFinalRequestProcessingState", "/home/vsts/work/1/s/src/utils/requestProcessingHelper.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/utils/requestProcessingHelper.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();