"use strict";

exports.__esModule = true;
exports.selectActivity = exports.requestRunningSelector = exports.logoutSelector = void 0;
var _reselect = require("reselect");
var _utils = require("../utils");
var _request = require("../reducers/request");
(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 viewData = function viewData(state) {
  return state.get("view");
};
var requestData = function requestData(state) {
  return state.get("requests");
};
var selectActivity = exports.selectActivity = (0, _utils.memoize)(function (requestName) {
  return (0, _reselect.createSelector)(requestData, function (reqs) {
    return reqs.getIn(["actives", requestName]);
  });
});
var logoutSelector = exports.logoutSelector = (0, _reselect.createSelector)(requestData, function (reqs) {
  return reqs.get(_request.LOGOUT);
});
var requestRunningSelector = exports.requestRunningSelector = (0, _reselect.createSelector)(requestData, viewData, function (requestData, viewData) {
  return (
    // Be default, we display the loadingScreen when a request is active. If it needs to be deactivated for
    // a specific use case, it is important to activate it back when done. use it with care please.
    requestData.get("actives").size > 0 && viewData.getIn(["loadingScreen", "enabled"]) !== false
  );
});
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(viewData, "viewData", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(requestData, "requestData", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(selectActivity, "selectActivity", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(logoutSelector, "logoutSelector", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(requestRunningSelector, "requestRunningSelector", "/home/vsts/work/1/s/src/selectors/requests.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(viewData, "viewData", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(requestData, "requestData", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(selectActivity, "selectActivity", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(logoutSelector, "logoutSelector", "/home/vsts/work/1/s/src/selectors/requests.js");
  reactHotLoader.register(requestRunningSelector, "requestRunningSelector", "/home/vsts/work/1/s/src/selectors/requests.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();