"use strict";

exports.__esModule = true;
exports.default = void 0;
var _reactRedux = require("react-redux");
var _utils = require("../../utils");
var _scope = require("../../selectors/scope");
(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 buildDefaultNodeState = function buildDefaultNodeState(current, getScope) {
  var node = current;
  var nodeState = {};
  while (node = getScope(node.parentScopeId)) {
    nodeState[node.id] = true;
  }
  return nodeState;
};
var useScopeData = function useScopeData() {
  var currentScope = (0, _utils.unwrapImmutable)((0, _reactRedux.useSelector)(_scope.currentScopeSelector));
  var getScope = (0, _reactRedux.useSelector)(_scope.scopeGetter);
  var defaultNodeState = buildDefaultNodeState(currentScope, getScope);
  return [currentScope, defaultNodeState, getScope];
};
__signature__(useScopeData, "useSelector{}\nuseSelector{getScope}", function () {
  return [_reactRedux.useSelector, _reactRedux.useSelector];
});
__signature__(useScopeData, "useSelector{}\nuseSelector{getScope}", function () {
  return [_reactRedux.useSelector, _reactRedux.useSelector];
});
var _default = useScopeData;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(buildDefaultNodeState, "buildDefaultNodeState", "/home/vsts/work/1/s/src/components/Scope/useScopeData.js");
  reactHotLoader.register(useScopeData, "useScopeData", "/home/vsts/work/1/s/src/components/Scope/useScopeData.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Scope/useScopeData.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(buildDefaultNodeState, "buildDefaultNodeState", "/home/vsts/work/1/s/src/components/Scope/useScopeData.js");
  reactHotLoader.register(useScopeData, "useScopeData", "/home/vsts/work/1/s/src/components/Scope/useScopeData.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Scope/useScopeData.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();