Liferay.Loader.define("portal-workflow-kaleo-designer-web$dagre@0.8.2/lib/order/sort",["module","exports","require","../lodash","../util"],(function(r,e,t){window;{var n=t("../lodash"),o=t("../util");function consumeUnsortable(r,e,t){for(var o;e.length&&(o=n.last(e)).i<=t;)e.pop(),r.push(o.vs),t++;return t}r.exports=function sort(r,e){var t=o.partition(r,(function(r){return n.has(r,"barycenter")})),i=t.lhs,a=n.sortBy(t.rhs,(function(r){return-r.i})),s=[],u=0,c=0,l=0;i.sort(function compareWithBias(r){return function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:r?t.i-e.i:e.i-t.i}}(!!e)),l=consumeUnsortable(s,a,l),n.forEach(i,(function(r){l+=r.vs.length,s.push(r.vs),u+=r.barycenter*r.weight,c+=r.weight,l=consumeUnsortable(s,a,l)}));var f={vs:n.flatten(s,!0)};return c&&(f.barycenter=u/c,f.weight=c),f}}}));
//# sourceMappingURL=sort.js.map