"use strict";Liferay.Loader.define("portal-workflow-kaleo-designer-web$dagre@0.8.2/lib/acyclic",["module","exports","require","./lodash","./greedy-fas"],(function(e,r,d){window;var n=d("./lodash"),o=d("./greedy-fas");e.exports={run:function run(e){var r="greedy"===e.graph().acyclicer?o(e,function weightFn(e){return function(r){return e.edge(r).weight}}(e)):function dfsFAS(e){var r=[],d={},o={};return n.forEach(e.nodes(),(function dfs(a){n.has(o,a)||(o[a]=!0,d[a]=!0,n.forEach(e.outEdges(a),(function(e){n.has(d,e.w)?r.push(e):dfs(e.w)})),delete d[a])})),r}(e);n.forEach(r,(function(r){var d=e.edge(r);e.removeEdge(r),d.forwardName=r.name,d.reversed=!0,e.setEdge(r.w,r.v,d,n.uniqueId("rev"))}))},undo:function undo(e){n.forEach(e.edges(),(function(r){var d=e.edge(r);if(d.reversed){e.removeEdge(r);var n=d.forwardName;delete d.reversed,delete d.forwardName,e.setEdge(r.w,r.v,d,n)}}))}}}));
//# sourceMappingURL=acyclic.js.map