import e from "../../../../lodash-es/map.js";
import t from "../../../../lodash-es/min.js";
import n from "../../../../lodash-es/forEach.js";
//#region ../../node_modules/dagre-d3-es/src/dagre/rank/util.js
function r(r) {
	var i = {};
	function a(n) {
		var o = r.node(n);
		if (Object.prototype.hasOwnProperty.call(i, n)) return o.rank;
		i[n] = !0;
		var s = t(e(r.outEdges(n), function(e) {
			return a(e.w) - r.edge(e).minlen;
		}));
		return (s === Infinity || s == null) && (s = 0), o.rank = s;
	}
	n(r.sources(), a);
}
function i(e, t) {
	return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
}
//#endregion
export { r as longestPath, i as slack };
