import e from "../../../../lodash-es/map.js";
import t from "../../../../lodash-es/filter.js";
import n from "../../../../lodash-es/forEach.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 = e(a(i(e(l, function(e) {
		return s.node(e).rank;
	})) + 1), function() {
		return [];
	});
	function d(e) {
		r(c, e) || (c[e] = !0, u[s.node(e).rank].push(e), n(s.successors(e), d));
	}
	return n(o(l, function(e) {
		return s.node(e).rank;
	}), d), u;
}
//#endregion
export { s as initOrder };
