import { createSelector } from 'reselect';
export var getNamespacesList = function getNamespacesList(state) {
  return Object.keys(state.dataBus).sort();
};
export var getNamespaceState = function getNamespaceState(state) {
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var namespace = props.namespace;
  return state.dataBus[namespace];
};
export var getProjectMetadata = createSelector([getNamespaceState], function (namespaceState) {
  var projectName = namespaceState.projectName,
      language = namespaceState.language,
      platformPathSeparator = namespaceState.platformPathSeparator,
      fullFeaturesSupport = namespaceState.fullFeaturesSupport;
  return {
    projectName: projectName,
    language: language,
    platformPathSeparator: platformPathSeparator,
    fullFeaturesSupport: fullFeaturesSupport
  };
});
export var getSource = createSelector([getNamespaceState], function (namespaceState) {
  var sourceTree = namespaceState.sourceTree,
      filesMap = namespaceState.filesMap,
      foldersMap = namespaceState.foldersMap;
  return {
    sourceTree: sourceTree,
    filesMap: filesMap,
    foldersMap: foldersMap
  };
});
export var getSourceLayout = createSelector([getNamespaceState], function (namespaceState) {
  var sourceLayoutTree = namespaceState.sourceLayoutTree,
      layoutSize = namespaceState.layoutSize,
      ccAlightPoint = namespaceState.ccAlightPoint,
      filesLayoutMap = namespaceState.filesLayoutMap,
      codecrumbsLayoutMap = namespaceState.codecrumbsLayoutMap;
  return {
    sourceLayoutTree: sourceLayoutTree,
    layoutSize: layoutSize,
    filesLayoutMap: filesLayoutMap,
    codecrumbsLayoutMap: codecrumbsLayoutMap,
    ccAlightPoint: ccAlightPoint
  };
});
export var getSourceUserChoice = createSelector([getNamespaceState], function (namespaceState) {
  var openedFolders = namespaceState.openedFolders,
      activeItemsMap = namespaceState.activeItemsMap,
      selectedNode = namespaceState.selectedNode;
  return {
    openedFolders: openedFolders,
    activeItemsMap: activeItemsMap,
    selectedNode: selectedNode
  };
});
export var getDependenciesUserChoice = createSelector([getNamespaceState], function (namespaceState) {
  var dependenciesEntryName = namespaceState.dependenciesEntryName,
      selectedDependencyEdgeNodes = namespaceState.selectedDependencyEdgeNodes;
  return {
    dependenciesEntryName: dependenciesEntryName,
    selectedDependencyEdgeNodes: selectedDependencyEdgeNodes
  };
});
export var getCodeCrumbsUserChoice = createSelector([getNamespaceState], function (namespaceState) {
  var selectedCodeCrumb = namespaceState.selectedCodeCrumb,
      codeCrumbedFlowsMap = namespaceState.codeCrumbedFlowsMap,
      selectedCrumbedFlowKey = namespaceState.selectedCrumbedFlowKey,
      selectedCcFlowEdgeNodes = namespaceState.selectedCcFlowEdgeNodes;
  return {
    selectedCodeCrumb: selectedCodeCrumb,
    codeCrumbedFlowsMap: codeCrumbedFlowsMap,
    selectedCrumbedFlowKey: selectedCrumbedFlowKey,
    selectedCcFlowEdgeNodes: selectedCcFlowEdgeNodes
  };
});