import e from "../../../../lodash-es/forEach.js";
import t from "../../../../lodash-es/filter.js";
import n from "../../../../lodash-es/map.js";
import r from "../../../../lodash-es/has.js";
import i from "../../../../lodash-es/max.js";
import a from "../../../../lodash-es/range.js";
import o from "../../../../lodash-es/sortBy.js";
//#region ../../node_modules/dagre-d3-es/src/dagre/order/init-order.js
function s(s) {
	var c = {}, l = t(s.nodes(), function(e) {
		return !s.children(e).length;
	}), u = n(a(i(n(l, function(e) {
		return s.node(e).rank;
	})) + 1), function() {
		return [];
	});
	function d(t) {
		r(c, t) || (c[t] = !0, u[s.node(t).rank].push(t), e(s.successors(t), d));
	}
	return e(o(l, function(e) {
		return s.node(e).rank;
	}), d), u;
}
//#endregion
export { s as initOrder };

//# sourceMappingURL=init-order.js.map