From 7cf2a4996ec8e7c45e4e73cbe3efbc53b64f9e74 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sat, 3 Dec 2022 10:54:54 -0800 Subject: [PATCH] switch dagre to goja --- d2layouts/d2dagrelayout/dagre.js | 10559 ++++++++++------------------ d2layouts/d2dagrelayout/layout.go | 18 +- d2plugin/plugin_dagre.go | 2 +- go.mod | 2 + go.sum | 8 + 5 files changed, 3827 insertions(+), 6762 deletions(-) diff --git a/d2layouts/d2dagrelayout/dagre.js b/d2layouts/d2dagrelayout/dagre.js index 58613b1ae..c1e1b462d 100644 --- a/d2layouts/d2dagrelayout/dagre.js +++ b/d2layouts/d2dagrelayout/dagre.js @@ -1,6754 +1,3809 @@ -!(function (e) { - "object" == typeof exports && "undefined" != typeof module - ? (module.exports = e()) - : "function" == typeof define && define.amd - ? define([], e) - : (("undefined" != typeof window - ? window - : "undefined" != typeof global - ? global - : "undefined" != typeof self - ? self - : this - ).dagre = e()); -})(function () { - return (function r(o, a, i) { - function s(t, e) { - if (!a[t]) { - if (!o[t]) { - var n = "function" == typeof require && require; - if (!e && n) return n(t, !0); - if (u) return u(t, !0); - throw ( - (((n = new Error("Cannot find module '" + t + "'")).code = - "MODULE_NOT_FOUND"), - n) - ); +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.dagre=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0;--i){entry=buckets[i].dequeue();if(entry){results=results.concat(removeNode(g,buckets,zeroIdx,entry,true));break}}}}return results}function removeNode(g,buckets,zeroIdx,entry,collectPredecessors){var results=collectPredecessors?[]:undefined;_.forEach(g.inEdges(entry.v),function(edge){var weight=g.edge(edge);var uEntry=g.node(edge.v);if(collectPredecessors){results.push({v:edge.v,w:edge.w})}uEntry.out-=weight;assignBucket(buckets,zeroIdx,uEntry)});_.forEach(g.outEdges(entry.v),function(edge){var weight=g.edge(edge);var w=edge.w;var wEntry=g.node(w);wEntry["in"]-=weight;assignBucket(buckets,zeroIdx,wEntry)});g.removeNode(entry.v);return results}function buildState(g,weightFn){var fasGraph=new Graph;var maxIn=0;var maxOut=0;_.forEach(g.nodes(),function(v){fasGraph.setNode(v,{v:v,in:0,out:0})}); +// Aggregate weights on nodes, but also sum the weights across multi-edges +// into a single edge for the fasGraph. +_.forEach(g.edges(),function(e){var prevWeight=fasGraph.edge(e.v,e.w)||0;var weight=weightFn(e);var edgeWeight=prevWeight+weight;fasGraph.setEdge(e.v,e.w,edgeWeight);maxOut=Math.max(maxOut,fasGraph.node(e.v).out+=weight);maxIn=Math.max(maxIn,fasGraph.node(e.w)["in"]+=weight)});var buckets=_.range(maxOut+maxIn+3).map(function(){return new List});var zeroIdx=maxIn+1;_.forEach(fasGraph.nodes(),function(v){assignBucket(buckets,zeroIdx,fasGraph.node(v))});return{graph:fasGraph,buckets:buckets,zeroIdx:zeroIdx}}function assignBucket(buckets,zeroIdx,entry){if(!entry.out){buckets[0].enqueue(entry)}else if(!entry["in"]){buckets[buckets.length-1].enqueue(entry)}else{buckets[entry.out-entry["in"]+zeroIdx].enqueue(entry)}}},{"./data/list":5,"./graphlib":7,"./lodash":10}],9:[function(require,module,exports){"use strict";var _=require("./lodash");var acyclic=require("./acyclic");var normalize=require("./normalize");var rank=require("./rank");var normalizeRanks=require("./util").normalizeRanks;var parentDummyChains=require("./parent-dummy-chains");var removeEmptyRanks=require("./util").removeEmptyRanks;var nestingGraph=require("./nesting-graph");var addBorderSegments=require("./add-border-segments");var coordinateSystem=require("./coordinate-system");var order=require("./order");var position=require("./position");var util=require("./util");var Graph=require("./graphlib").Graph;module.exports=layout;function layout(g,opts){var time=opts&&opts.debugTiming?util.time:util.notime;time("layout",function(){var layoutGraph=time(" buildLayoutGraph",function(){return buildLayoutGraph(g)});time(" runLayout",function(){runLayout(layoutGraph,time)});time(" updateInputGraph",function(){updateInputGraph(g,layoutGraph)})})}function runLayout(g,time){time(" makeSpaceForEdgeLabels",function(){makeSpaceForEdgeLabels(g)});time(" removeSelfEdges",function(){removeSelfEdges(g)});time(" acyclic",function(){acyclic.run(g)});time(" nestingGraph.run",function(){nestingGraph.run(g)});time(" rank",function(){rank(util.asNonCompoundGraph(g))});time(" injectEdgeLabelProxies",function(){injectEdgeLabelProxies(g)});time(" removeEmptyRanks",function(){removeEmptyRanks(g)});time(" nestingGraph.cleanup",function(){nestingGraph.cleanup(g)});time(" normalizeRanks",function(){normalizeRanks(g)});time(" assignRankMinMax",function(){assignRankMinMax(g)});time(" removeEdgeLabelProxies",function(){removeEdgeLabelProxies(g)});time(" normalize.run",function(){normalize.run(g)});time(" parentDummyChains",function(){parentDummyChains(g)});time(" addBorderSegments",function(){addBorderSegments(g)});time(" order",function(){order(g)});time(" insertSelfEdges",function(){insertSelfEdges(g)});time(" adjustCoordinateSystem",function(){coordinateSystem.adjust(g)});time(" position",function(){position(g)});time(" positionSelfEdges",function(){positionSelfEdges(g)});time(" removeBorderNodes",function(){removeBorderNodes(g)});time(" normalize.undo",function(){normalize.undo(g)});time(" fixupEdgeLabelCoords",function(){fixupEdgeLabelCoords(g)});time(" undoCoordinateSystem",function(){coordinateSystem.undo(g)});time(" translateGraph",function(){translateGraph(g)});time(" assignNodeIntersects",function(){assignNodeIntersects(g)});time(" reversePoints",function(){reversePointsForReversedEdges(g)});time(" acyclic.undo",function(){acyclic.undo(g)})} +/* + * Copies final layout information from the layout graph back to the input + * graph. This process only copies whitelisted attributes from the layout graph + * to the input graph, so it serves as a good place to determine what + * attributes can influence layout. + */function updateInputGraph(inputGraph,layoutGraph){_.forEach(inputGraph.nodes(),function(v){var inputLabel=inputGraph.node(v);var layoutLabel=layoutGraph.node(v);if(inputLabel){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y;if(layoutGraph.children(v).length){inputLabel.width=layoutLabel.width;inputLabel.height=layoutLabel.height}}});_.forEach(inputGraph.edges(),function(e){var inputLabel=inputGraph.edge(e);var layoutLabel=layoutGraph.edge(e);inputLabel.points=layoutLabel.points;if(_.has(layoutLabel,"x")){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y}});inputGraph.graph().width=layoutGraph.graph().width;inputGraph.graph().height=layoutGraph.graph().height}var graphNumAttrs=["nodesep","edgesep","ranksep","marginx","marginy"];var graphDefaults={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"};var graphAttrs=["acyclicer","ranker","rankdir","align"];var nodeNumAttrs=["width","height"];var nodeDefaults={width:0,height:0};var edgeNumAttrs=["minlen","weight","width","height","labeloffset"];var edgeDefaults={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"};var edgeAttrs=["labelpos"]; +/* + * Constructs a new graph from the input graph, which can be used for layout. + * This process copies only whitelisted attributes from the input graph to the + * layout graph. Thus this function serves as a good place to determine what + * attributes can influence layout. + */function buildLayoutGraph(inputGraph){var g=new Graph({multigraph:true,compound:true});var graph=canonicalize(inputGraph.graph());g.setGraph(_.merge({},graphDefaults,selectNumberAttrs(graph,graphNumAttrs),_.pick(graph,graphAttrs)));_.forEach(inputGraph.nodes(),function(v){var node=canonicalize(inputGraph.node(v));g.setNode(v,_.defaults(selectNumberAttrs(node,nodeNumAttrs),nodeDefaults));g.setParent(v,inputGraph.parent(v))});_.forEach(inputGraph.edges(),function(e){var edge=canonicalize(inputGraph.edge(e));g.setEdge(e,_.merge({},edgeDefaults,selectNumberAttrs(edge,edgeNumAttrs),_.pick(edge,edgeAttrs)))});return g} +/* + * This idea comes from the Gansner paper: to account for edge labels in our + * layout we split each rank in half by doubling minlen and halving ranksep. + * Then we can place labels at these mid-points between nodes. + * + * We also add some minimal padding to the width to push the label for the edge + * away from the edge itself a bit. + */function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.forEach(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(edge.labelpos.toLowerCase()!=="c"){if(graph.rankdir==="TB"||graph.rankdir==="BT"){edge.width+=edge.labeloffset}else{edge.height+=edge.labeloffset}}})} +/* + * Creates temporary dummy nodes that capture the rank in which each edge's + * label is going to, if it has one of non-zero width and height. We do this + * so that we can safely remove empty ranks while preserving balance for the + * label's position. + */function injectEdgeLabelProxies(g){_.forEach(g.edges(),function(e){var edge=g.edge(e);if(edge.width&&edge.height){var v=g.node(e.v);var w=g.node(e.w);var label={rank:(w.rank-v.rank)/2+v.rank,e:e};util.addDummyNode(g,"edge-proxy",label,"_ep")}})}function assignRankMinMax(g){var maxRank=0;_.forEach(g.nodes(),function(v){var node=g.node(v);if(node.borderTop){node.minRank=g.node(node.borderTop).rank;node.maxRank=g.node(node.borderBottom).rank;maxRank=_.max(maxRank,node.maxRank)}});g.graph().maxRank=maxRank}function removeEdgeLabelProxies(g){_.forEach(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="edge-proxy"){g.edge(node.e).labelRank=node.rank;g.removeNode(v)}})}function translateGraph(g){var minX=Number.POSITIVE_INFINITY;var maxX=0;var minY=Number.POSITIVE_INFINITY;var maxY=0;var graphLabel=g.graph();var marginX=graphLabel.marginx||0;var marginY=graphLabel.marginy||0;function getExtremes(attrs){var x=attrs.x;var y=attrs.y;var w=attrs.width;var h=attrs.height;minX=Math.min(minX,x-w/2);maxX=Math.max(maxX,x+w/2);minY=Math.min(minY,y-h/2);maxY=Math.max(maxY,y+h/2)}_.forEach(g.nodes(),function(v){getExtremes(g.node(v))});_.forEach(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){getExtremes(edge)}});minX-=marginX;minY-=marginY;_.forEach(g.nodes(),function(v){var node=g.node(v);node.x-=minX;node.y-=minY});_.forEach(g.edges(),function(e){var edge=g.edge(e);_.forEach(edge.points,function(p){p.x-=minX;p.y-=minY});if(_.has(edge,"x")){edge.x-=minX}if(_.has(edge,"y")){edge.y-=minY}});graphLabel.width=maxX-minX+marginX;graphLabel.height=maxY-minY+marginY}function assignNodeIntersects(g){_.forEach(g.edges(),function(e){var edge=g.edge(e);var nodeV=g.node(e.v);var nodeW=g.node(e.w);var p1,p2;if(!edge.points){edge.points=[];p1=nodeW;p2=nodeV}else{p1=edge.points[0];p2=edge.points[edge.points.length-1]}edge.points.unshift(util.intersectRect(nodeV,p1));edge.points.push(util.intersectRect(nodeW,p2))})}function fixupEdgeLabelCoords(g){_.forEach(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){if(edge.labelpos==="l"||edge.labelpos==="r"){edge.width-=edge.labeloffset}switch(edge.labelpos){case"l":edge.x-=edge.width/2+edge.labeloffset;break;case"r":edge.x+=edge.width/2+edge.labeloffset;break}}})}function reversePointsForReversedEdges(g){_.forEach(g.edges(),function(e){var edge=g.edge(e);if(edge.reversed){edge.points.reverse()}})}function removeBorderNodes(g){_.forEach(g.nodes(),function(v){if(g.children(v).length){var node=g.node(v);var t=g.node(node.borderTop);var b=g.node(node.borderBottom);var l=g.node(_.last(node.borderLeft));var r=g.node(_.last(node.borderRight));node.width=Math.abs(r.x-l.x);node.height=Math.abs(b.y-t.y);node.x=l.x+node.width/2;node.y=t.y+node.height/2}});_.forEach(g.nodes(),function(v){if(g.node(v).dummy==="border"){g.removeNode(v)}})}function removeSelfEdges(g){_.forEach(g.edges(),function(e){if(e.v===e.w){var node=g.node(e.v);if(!node.selfEdges){node.selfEdges=[]}node.selfEdges.push({e:e,label:g.edge(e)});g.removeEdge(e)}})}function insertSelfEdges(g){var layers=util.buildLayerMatrix(g);_.forEach(layers,function(layer){var orderShift=0;_.forEach(layer,function(v,i){var node=g.node(v);node.order=i+orderShift;_.forEach(node.selfEdges,function(selfEdge){util.addDummyNode(g,"selfedge",{width:selfEdge.label.width,height:selfEdge.label.height,rank:node.rank,order:i+ ++orderShift,e:selfEdge.e,label:selfEdge.label},"_se")});delete node.selfEdges})})}function positionSelfEdges(g){_.forEach(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="selfedge"){var selfNode=g.node(node.e.v);var x=selfNode.x+selfNode.width/2;var y=selfNode.y;var dx=node.x-x;var dy=selfNode.height/2;g.setEdge(node.e,node.label);g.removeNode(v);node.label.points=[{x:x+2*dx/3,y:y-dy},{x:x+5*dx/6,y:y-dy},{x:x+dx,y:y},{x:x+5*dx/6,y:y+dy},{x:x+2*dx/3,y:y+dy}];node.label.x=node.x;node.label.y=node.y}})}function selectNumberAttrs(obj,attrs){return _.mapValues(_.pick(obj,attrs),Number)}function canonicalize(attrs){var newAttrs={};_.forEach(attrs,function(v,k){newAttrs[k.toLowerCase()]=v});return newAttrs}},{"./acyclic":2,"./add-border-segments":3,"./coordinate-system":4,"./graphlib":7,"./lodash":10,"./nesting-graph":11,"./normalize":12,"./order":17,"./parent-dummy-chains":22,"./position":24,"./rank":26,"./util":29}],10:[function(require,module,exports){ +/* global window */ +var lodash;if(typeof require==="function"){try{lodash={cloneDeep:require("lodash/cloneDeep"),constant:require("lodash/constant"),defaults:require("lodash/defaults"),each:require("lodash/each"),filter:require("lodash/filter"),find:require("lodash/find"),flatten:require("lodash/flatten"),forEach:require("lodash/forEach"),forIn:require("lodash/forIn"),has:require("lodash/has"),isUndefined:require("lodash/isUndefined"),last:require("lodash/last"),map:require("lodash/map"),mapValues:require("lodash/mapValues"),max:require("lodash/max"),merge:require("lodash/merge"),min:require("lodash/min"),minBy:require("lodash/minBy"),now:require("lodash/now"),pick:require("lodash/pick"),range:require("lodash/range"),reduce:require("lodash/reduce"),sortBy:require("lodash/sortBy"),uniqueId:require("lodash/uniqueId"),values:require("lodash/values"),zipObject:require("lodash/zipObject")}}catch(e){ +// continue regardless of error +}}if(!lodash){lodash=window._}module.exports=lodash},{"lodash/cloneDeep":227,"lodash/constant":228,"lodash/defaults":229,"lodash/each":230,"lodash/filter":232,"lodash/find":233,"lodash/flatten":235,"lodash/forEach":236,"lodash/forIn":237,"lodash/has":239,"lodash/isUndefined":258,"lodash/last":261,"lodash/map":262,"lodash/mapValues":263,"lodash/max":264,"lodash/merge":266,"lodash/min":267,"lodash/minBy":268,"lodash/now":270,"lodash/pick":271,"lodash/range":273,"lodash/reduce":274,"lodash/sortBy":276,"lodash/uniqueId":286,"lodash/values":287,"lodash/zipObject":288}],11:[function(require,module,exports){var _=require("./lodash");var util=require("./util");module.exports={run:run,cleanup:cleanup}; +/* + * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, + * adds appropriate edges to ensure that all cluster nodes are placed between + * these boundries, and ensures that the graph is connected. + * + * In addition we ensure, through the use of the minlen property, that nodes + * and subgraph border nodes to not end up on the same rank. + * + * Preconditions: + * + * 1. Input graph is a DAG + * 2. Nodes in the input graph has a minlen attribute + * + * Postconditions: + * + * 1. Input graph is connected. + * 2. Dummy nodes are added for the tops and bottoms of subgraphs. + * 3. The minlen attribute for nodes is adjusted to ensure nodes do not + * get placed on the same rank as subgraph border nodes. + * + * The nesting graph idea comes from Sander, "Layout of Compound Directed + * Graphs." + */function run(g){var root=util.addDummyNode(g,"root",{},"_root");var depths=treeDepths(g);var height=_.max(_.values(depths))-1;// Note: depths is an Object not an array +var nodeSep=2*height+1;g.graph().nestingRoot=root; +// Multiply minlen by nodeSep to align nodes on non-border ranks. +_.forEach(g.edges(),function(e){g.edge(e).minlen*=nodeSep}); +// Calculate a weight that is sufficient to keep subgraphs vertically compact +var weight=sumWeights(g)+1; +// Create border nodes and link them up +_.forEach(g.children(),function(child){dfs(g,root,nodeSep,weight,height,depths,child)}); +// Save the multiplier for node layers for later removal of empty border +// layers. +g.graph().nodeRankFactor=nodeSep}function dfs(g,root,nodeSep,weight,height,depths,v){var children=g.children(v);if(!children.length){if(v!==root){g.setEdge(root,v,{weight:0,minlen:nodeSep})}return}var top=util.addBorderNode(g,"_bt");var bottom=util.addBorderNode(g,"_bb");var label=g.node(v);g.setParent(top,v);label.borderTop=top;g.setParent(bottom,v);label.borderBottom=bottom;_.forEach(children,function(child){dfs(g,root,nodeSep,weight,height,depths,child);var childNode=g.node(child);var childTop=childNode.borderTop?childNode.borderTop:child;var childBottom=childNode.borderBottom?childNode.borderBottom:child;var thisWeight=childNode.borderTop?weight:2*weight;var minlen=childTop!==childBottom?1:height-depths[v]+1;g.setEdge(top,childTop,{weight:thisWeight,minlen:minlen,nestingEdge:true});g.setEdge(childBottom,bottom,{weight:thisWeight,minlen:minlen,nestingEdge:true})});if(!g.parent(v)){g.setEdge(root,top,{weight:0,minlen:height+depths[v]})}}function treeDepths(g){var depths={};function dfs(v,depth){var children=g.children(v);if(children&&children.length){_.forEach(children,function(child){dfs(child,depth+1)})}depths[v]=depth}_.forEach(g.children(),function(v){dfs(v,1)});return depths}function sumWeights(g){return _.reduce(g.edges(),function(acc,e){return acc+g.edge(e).weight},0)}function cleanup(g){var graphLabel=g.graph();g.removeNode(graphLabel.nestingRoot);delete graphLabel.nestingRoot;_.forEach(g.edges(),function(e){var edge=g.edge(e);if(edge.nestingEdge){g.removeEdge(e)}})}},{"./lodash":10,"./util":29}],12:[function(require,module,exports){"use strict";var _=require("./lodash");var util=require("./util");module.exports={run:run,undo:undo}; +/* + * Breaks any long edges in the graph into short segments that span 1 layer + * each. This operation is undoable with the denormalize function. + * + * Pre-conditions: + * + * 1. The input graph is a DAG. + * 2. Each node in the graph has a "rank" property. + * + * Post-condition: + * + * 1. All edges in the graph have a length of 1. + * 2. Dummy nodes are added where edges have been split into segments. + * 3. The graph is augmented with a "dummyChains" attribute which contains + * the first dummy in each chain of dummy nodes produced. + */function run(g){g.graph().dummyChains=[];_.forEach(g.edges(),function(edge){normalizeEdge(g,edge)})}function normalizeEdge(g,e){var v=e.v;var vRank=g.node(v).rank;var w=e.w;var wRank=g.node(w).rank;var name=e.name;var edgeLabel=g.edge(e);var labelRank=edgeLabel.labelRank;if(wRank===vRank+1)return;g.removeEdge(e);var dummy,attrs,i;for(i=0,++vRank;vRank> 1)] += e.weight); - s += e.weight * n; - }) - ), - s - ); - })(e, t[r - 1], t[r]); - return n; - }; - }, - { "../lodash": 10 }, - ], - 17: [ - function (e, t, n) { - "use strict"; - var f = e("../lodash"), - d = e("./init-order"), - h = e("./cross-count"), - l = e("./sort-subgraph"), - r = e("./build-layer-graph"), - p = e("./add-subgraph-constraints"), - _ = e("../graphlib").Graph, - v = e("../util"); - function g(t, e, n) { - return f.map(e, function (e) { - return r(t, e, n); - }); - } - function y(n, e) { - f.forEach(e, function (e) { - f.forEach(e, function (e, t) { - n.node(e).order = t; - }); - }); - } - t.exports = function (e) { - var t = v.maxRank(e), - n = g(e, f.range(1, t + 1), "inEdges"), - r = g(e, f.range(t - 1, -1, -1), "outEdges"), - o = d(e); - y(e, o); - for (var a, i = Number.POSITIVE_INFINITY, s = 0, u = 0; u < 4; ++s, ++u) { - !(function (e, t) { - var r = new _(); - f.forEach(e, function (n) { - var e = n.graph().root, - e = l(n, e, r, t); - f.forEach(e.vs, function (e, t) { - n.node(e).order = t; - }), - p(n, r, e.vs); - }); - })(s % 2 ? n : r, 2 <= s % 4), - (o = v.buildLayerMatrix(e)); - var c = h(e, o); - c < i && ((u = 0), (a = f.cloneDeep(o)), (i = c)); - } - y(e, a); - }; - }, - { - "../graphlib": 7, - "../lodash": 10, - "../util": 29, - "./add-subgraph-constraints": 13, - "./build-layer-graph": 15, - "./cross-count": 16, - "./init-order": 18, - "./sort-subgraph": 20, - }, - ], - 18: [ - function (e, t, n) { - "use strict"; - var i = e("../lodash"); - t.exports = function (r) { - var o = {}, - e = i.filter(r.nodes(), function (e) { - return !r.children(e).length; - }), - t = i.max( - i.map(e, function (e) { - return r.node(e).rank; - }) - ), - a = i.map(i.range(t + 1), function () { - return []; - }); - e = i.sortBy(e, function (e) { - return r.node(e).rank; - }); - return ( - i.forEach(e, function e(t) { - if (i.has(o, t)) return; - o[t] = !0; - var n = r.node(t); - a[n.rank].push(t); - i.forEach(r.successors(t), e); - }), - a - ); - }; - }, - { "../lodash": 10 }, - ], - 19: [ - function (e, t, n) { - "use strict"; - var a = e("../lodash"); - t.exports = function (e, t) { - var r = {}; - return ( - a.forEach(e, function (e, t) { - t = r[e.v] = { indegree: 0, in: [], out: [], vs: [e.v], i: t }; - a.isUndefined(e.barycenter) || - ((t.barycenter = e.barycenter), (t.weight = e.weight)); - }), - a.forEach(t.edges(), function (e) { - var t = r[e.v], - n = r[e.w]; - a.isUndefined(t) || - a.isUndefined(n) || - (n.indegree++, t.out.push(r[e.w])); - }), - (function (n) { - var e = []; - function t(o) { - return function (e) { - var t, n, r; - e.merged || - ((a.isUndefined(e.barycenter) || - a.isUndefined(o.barycenter) || - e.barycenter >= o.barycenter) && - ((t = e), - (r = n = 0), - (e = o).weight && - ((n += e.barycenter * e.weight), (r += e.weight)), - t.weight && ((n += t.barycenter * t.weight), (r += t.weight)), - (e.vs = t.vs.concat(e.vs)), - (e.barycenter = n / r), - (e.weight = r), - (e.i = Math.min(t.i, e.i)), - (t.merged = !0))); - }; - } - for (; n.length; ) { - var r = n.pop(); - e.push(r), - a.forEach(r.in.reverse(), t(r)), - a.forEach( - r.out, - (function (t) { - return function (e) { - e.in.push(t), 0 == --e.indegree && n.push(e); - }; - })(r) - ); - } - return a.map( - a.filter(e, function (e) { - return !e.merged; - }), - function (e) { - return a.pick(e, ["vs", "i", "barycenter", "weight"]); - } - ); - })( - a.filter(r, function (e) { - return !e.indegree; - }) - ) - ); - }; - }, - { "../lodash": 10 }, - ], - 20: [ - function (e, t, n) { - var f = e("../lodash"), - d = e("./barycenter"), - h = e("./resolve-conflicts"), - l = e("./sort"); - function p(e, t) { - f.forEach(e, function (e) { - e.vs = f.flatten( - e.vs.map(function (e) { - return t[e] ? t[e].vs : e; - }), - !0 - ); - }); - } - function _(e, t) { - f.isUndefined(e.barycenter) - ? ((e.barycenter = t.barycenter), (e.weight = t.weight)) - : ((e.barycenter = - (e.barycenter * e.weight + t.barycenter * t.weight) / - (e.weight + t.weight)), - (e.weight += t.weight)); - } - t.exports = function n(r, e, o, a) { - var t = r.children(e); - var i = r.node(e); - var s = i ? i.borderLeft : void 0; - var u = i ? i.borderRight : void 0; - var c = {}; - s && - (t = f.filter(t, function (e) { - return e !== s && e !== u; - })); - e = d(r, t); - f.forEach(e, function (e) { - var t; - r.children(e.v).length && - ((t = n(r, e.v, o, a)), (c[e.v] = t), f.has(t, "barycenter") && _(e, t)); - }); - i = h(e, o); - p(i, c); - var t = l(i, a); - s && - ((t.vs = f.flatten([s, t.vs, u], !0)), - r.predecessors(s).length && - ((e = r.node(r.predecessors(s)[0])), - (i = r.node(r.predecessors(u)[0])), - f.has(t, "barycenter") || ((t.barycenter = 0), (t.weight = 0)), - (t.barycenter = - (t.barycenter * t.weight + e.order + i.order) / (t.weight + 2)), - (t.weight += 2))); - return t; - }; - }, - { - "../lodash": 10, - "./barycenter": 14, - "./resolve-conflicts": 19, - "./sort": 21, - }, - ], - 21: [ - function (e, t, n) { - var u = e("../lodash"), - c = e("../util"); - function f(e, t, n) { - for (var r; t.length && (r = u.last(t)).i <= n; ) t.pop(), e.push(r.vs), n++; - return n; - } - t.exports = function (e, t) { - var n = c.partition(e, function (e) { - return u.has(e, "barycenter"); - }), - e = n.lhs, - r = u.sortBy(n.rhs, function (e) { - return -e.i; - }), - o = [], - a = 0, - i = 0, - s = 0; - e.sort( - (function (n) { - return function (e, t) { - return e.barycenter < t.barycenter - ? -1 - : e.barycenter > t.barycenter - ? 1 - : n - ? t.i - e.i - : e.i - t.i; - }; - })(!!t) - ), - (s = f(o, r, s)), - u.forEach(e, function (e) { - (s += e.vs.length), - o.push(e.vs), - (a += e.barycenter * e.weight), - (i += e.weight), - (s = f(o, r, s)); - }); - e = { vs: u.flatten(o, !0) }; - i && ((e.barycenter = a / i), (e.weight = i)); - return e; - }; - }, - { "../lodash": 10, "../util": 29 }, - ], - 22: [ - function (e, t, n) { - var i = e("./lodash"); - t.exports = function (c) { - var f = (function (r) { - var o = {}, - a = 0; - return ( - i.forEach(r.children(), function e(t) { - var n = a; - i.forEach(r.children(t), e); - o[t] = { low: n, lim: a++ }; - }), - o - ); - })(c); - i.forEach(c.graph().dummyChains, function (e) { - for ( - var t = c.node(e), - n = t.edgeObj, - r = (function (e, t, n, r) { - var o, - a, - i = [], - s = [], - u = Math.min(t[n].low, t[r].low), - c = Math.max(t[n].lim, t[r].lim); - o = n; - for ( - ; - (o = e.parent(o)), i.push(o), o && (t[o].low > u || c > t[o].lim); - - ); - (a = o), (o = r); - for (; (o = e.parent(o)) !== a; ) s.push(o); - return { path: i.concat(s.reverse()), lca: a }; - })(c, f, n.v, n.w), - o = r.path, - a = r.lca, - i = 0, - s = o[i], - u = !0; - e !== n.w; - - ) { - if (((t = c.node(e)), u)) { - for (; (s = o[i]) !== a && c.node(s).maxRank < t.rank; ) i++; - s === a && (u = !1); - } - if (!u) { - for (; i < o.length - 1 && c.node((s = o[i + 1])).minRank <= t.rank; ) - i++; - s = o[i]; - } - c.setParent(e, s), (e = c.successors(e)[0]); - } - }); - }; - }, - { "./lodash": 10 }, - ], - 23: [ - function (e, t, n) { - "use strict"; - var _ = e("../lodash"), - v = e("../graphlib").Graph, - s = e("../util"); - function u(c, e) { - var f = {}; - return ( - _.reduce(e, function (e, r) { - var a = 0, - i = 0, - s = e.length, - u = _.last(r); - return ( - _.forEach(r, function (e, t) { - var n = (function (t, e) { - if (t.node(e).dummy) - return _.find(t.predecessors(e), function (e) { - return t.node(e).dummy; - }); - })(c, e), - o = n ? c.node(n).order : s; - (!n && e !== u) || - (_.forEach(r.slice(i, t + 1), function (r) { - _.forEach(c.predecessors(r), function (e) { - var t = c.node(e), - n = t.order; - !(n < a || o < n) || (t.dummy && c.node(r).dummy) || d(f, e, r); - }); - }), - (i = t + 1), - (a = o)); - }), - r - ); - }), - f - ); - } - function c(s, e) { - var i = {}; - function u(t, e, n, r, o) { - var a; - _.forEach(_.range(e, n), function (e) { - (a = t[e]), - s.node(a).dummy && - _.forEach(s.predecessors(a), function (e) { - var t = s.node(e); - t.dummy && (t.order < r || t.order > o) && d(i, e, a); - }); - }); - } - return ( - _.reduce(e, function (n, r) { - var o, - a = -1, - i = 0; - return ( - _.forEach(r, function (e, t) { - "border" !== s.node(e).dummy || - ((e = s.predecessors(e)).length && - ((o = s.node(e[0]).order), u(r, i, t, a, o), (i = t), (a = o))), - u(r, i, r.length, o, n.length); - }), - r - ); - }), - i - ); - } - function d(e, t, n) { - n < t && ((r = t), (t = n), (n = r)); - var r = e[t]; - r || (e[t] = r = {}), (r[n] = !0); - } - function h(e, t, n) { - var r; - return n < t && ((r = t), (t = n), (n = r)), _.has(e[t], n); - } - function f(e, t, s, u) { - var c = {}, - f = {}, - d = {}; - return ( - _.forEach(t, function (e) { - _.forEach(e, function (e, t) { - (c[e] = e), (f[e] = e), (d[e] = t); - }); - }), - _.forEach(t, function (e) { - var i = -1; - _.forEach(e, function (e) { - var t = u(e); - if (t.length) - for ( - var n = - ((t = _.sortBy(t, function (e) { - return d[e]; - })).length - - 1) / - 2, - r = Math.floor(n), - o = Math.ceil(n); - r <= o; - ++r - ) { - var a = t[r]; - f[e] === e && - i < d[a] && - !h(s, e, a) && - ((f[a] = e), (f[e] = c[e] = c[a]), (i = d[a])); - } - }); - }), - { root: c, align: f } - ); - } - function l(r, e, t, n, o) { - var a, - i, - s, - u, - c, - f, - d = {}, - h = - ((a = r), - (i = e), - (s = t), - (u = o), - (c = new v()), - (e = a.graph()), - (f = (function (i, s, u) { - return function (e, t, n) { - var r, - o = e.node(t), - a = e.node(n), - n = 0; - if (((n += o.width / 2), _.has(o, "labelpos"))) - switch (o.labelpos.toLowerCase()) { - case "l": - r = -o.width / 2; - break; - case "r": - r = o.width / 2; - } - if ( - (r && (n += u ? r : -r), - (r = 0), - (n += (o.dummy ? s : i) / 2), - (n += (a.dummy ? s : i) / 2), - (n += a.width / 2), - _.has(a, "labelpos")) - ) - switch (a.labelpos.toLowerCase()) { - case "l": - r = a.width / 2; - break; - case "r": - r = -a.width / 2; - } - return r && (n += u ? r : -r), (r = 0), n; - }; - })(e.nodesep, e.edgesep, u)), - _.forEach(i, function (e) { - var o; - _.forEach(e, function (e) { - var t, - n, - r = s[e]; - c.setNode(r), - o && - ((t = s[o]), - (n = c.edge(t, r)), - c.setEdge(t, r, Math.max(f(a, e, o), n || 0))), - (o = e); - }); - }), - c), - l = o ? "borderLeft" : "borderRight"; - function p(e, t) { - for (var n = h.nodes(), r = n.pop(), o = {}; r; ) - o[r] ? e(r) : ((o[r] = !0), n.push(r), (n = n.concat(t(r)))), - (r = n.pop()); - } - return ( - p(function (e) { - d[e] = h.inEdges(e).reduce(function (e, t) { - return Math.max(e, d[t.v] + h.edge(t)); - }, 0); - }, h.predecessors.bind(h)), - p(function (e) { - var t = h.outEdges(e).reduce(function (e, t) { - return Math.min(e, d[t.w] - h.edge(t)); - }, Number.POSITIVE_INFINITY), - n = r.node(e); - t !== Number.POSITIVE_INFINITY && - n.borderType !== l && - (d[e] = Math.max(d[e], t)); - }, h.successors.bind(h)), - _.forEach(n, function (e) { - d[e] = d[t[e]]; - }), - d - ); - } - function p(o, e) { - return _.minBy(_.values(e), function (e) { - var n = Number.NEGATIVE_INFINITY, - r = Number.POSITIVE_INFINITY; - return ( - _.forIn(e, function (e, t) { - (t = t), (t = o.node(t).width / 2); - (n = Math.max(e + t, n)), (r = Math.min(e - t, r)); - }), - n - r - ); - }); - } - function g(i, s) { - var e = _.values(s), - u = _.min(e), - c = _.max(e); - _.forEach(["u", "d"], function (a) { - _.forEach(["l", "r"], function (e) { - var t, - n, - r = a + e, - o = i[r]; - o !== s && - ((t = _.values(o)), - (n = "l" === e ? u - _.min(t) : c - _.max(t)) && - (i[r] = _.mapValues(o, function (e) { - return e + n; - }))); - }); - }); - } - function y(n, r) { - return _.mapValues(n.ul, function (e, t) { - if (r) return n[r.toLowerCase()][t]; - t = _.sortBy(_.map(n, t)); - return (t[1] + t[2]) / 2; - }); - } - t.exports = { - positionX: function (r) { - var o, - e = s.buildLayerMatrix(r), - a = _.merge(u(r, e), c(r, e)), - i = {}; - _.forEach(["u", "d"], function (n) { - (o = "u" === n ? e : _.values(e).reverse()), - _.forEach(["l", "r"], function (e) { - "r" === e && - (o = _.map(o, function (e) { - return _.values(e).reverse(); - })); - var t = ("u" === n ? r.predecessors : r.successors).bind(r), - t = f(0, o, a, t), - t = l(r, o, t.root, t.align, "r" === e); - "r" === e && - (t = _.mapValues(t, function (e) { - return -e; - })), - (i[n + e] = t); - }); - }); - var t = p(r, i); - return g(i, t), y(i, r.graph().align); - }, - findType1Conflicts: u, - findType2Conflicts: c, - addConflict: d, - hasConflict: h, - verticalAlignment: f, - horizontalCompaction: l, - alignCoordinates: g, - findSmallestWidthAlignment: p, - balance: y, - }; - }, - { "../graphlib": 7, "../lodash": 10, "../util": 29 }, - ], - 24: [ - function (e, t, n) { - "use strict"; - var a = e("../lodash"), - i = e("../util"), - r = e("./bk").positionX; - t.exports = function (n) { - (function (n) { - var e = i.buildLayerMatrix(n), - r = n.graph().ranksep, - o = 0; - a.forEach(e, function (e) { - var t = a.max( - a.map(e, function (e) { - return n.node(e).height; - }) - ); - a.forEach(e, function (e) { - n.node(e).y = o + t / 2; - }), - (o += t + r); - }); - })((n = i.asNonCompoundGraph(n))), - a.forEach(r(n), function (e, t) { - n.node(t).x = e; - }); - }; - }, - { "../lodash": 10, "../util": 29, "./bk": 23 }, - ], - 25: [ - function (e, t, n) { - "use strict"; - var i = e("../lodash"), - a = e("../graphlib").Graph, - s = e("./util").slack; - t.exports = function (e) { - var t, - r = new a({ directed: !1 }), - n = e.nodes()[0], - o = e.nodeCount(); - r.setNode(n, {}); - for ( - ; - (function (o, a) { - return ( - i.forEach(o.nodes(), function n(r) { - i.forEach(a.nodeEdges(r), function (e) { - var t = e.v, - t = r === t ? e.w : t; - o.hasNode(t) || - s(a, e) || - (o.setNode(t, {}), o.setEdge(r, t, {}), n(t)); - }); - }), - o.nodeCount() - ); - })(r, e) < o; - - ) - (t = (function (t, n) { - return i.minBy(n.edges(), function (e) { - if (t.hasNode(e.v) !== t.hasNode(e.w)) return s(n, e); - }); - })(r, e)), - (t = r.hasNode(t.v) ? s(e, t) : -s(e, t)), - (function (t, n) { - i.forEach(r.nodes(), function (e) { - t.node(e).rank += n; - }); - })(e, t); - return r; - }; - }, - { "../graphlib": 7, "../lodash": 10, "./util": 28 }, - ], - 26: [ - function (e, t, n) { - "use strict"; - var r = e("./util").longestPath, - o = e("./feasible-tree"), - a = e("./network-simplex"); - t.exports = function (e) { - switch (e.graph().ranker) { - case "network-simplex": - s(e); - break; - case "tight-tree": - !(function (e) { - r(e), o(e); - })(e); - break; - case "longest-path": - i(e); - break; - default: - s(e); - } - }; - var i = r; - function s(e) { - a(e); - } - }, - { "./feasible-tree": 25, "./network-simplex": 27, "./util": 28 }, - ], - 27: [ - function (e, t, n) { - "use strict"; - var f = e("../lodash"), - r = e("./feasible-tree"), - s = e("./util").slack, - o = e("./util").longestPath, - u = e("../graphlib").alg.preorder, - i = e("../graphlib").alg.postorder, - a = e("../util").simplify; - function c(e) { - (e = a(e)), o(e); - var t, - n = r(e); - for (l(n), d(n, e); (t = p(n)); ) v(n, e, t, _(n, e, t)); - } - function d(o, a) { - var e = (e = i(o, o.nodes())).slice(0, e.length - 1); - f.forEach(e, function (e) { - var t, n, r; - (n = a), - (r = e), - (e = (t = o).node(r).parent), - (t.edge(r, e).cutvalue = h(t, n, r)); - }); - } - function h(o, a, i) { - var s = o.node(i).parent, - u = !0, - e = a.edge(i, s), - c = 0; - return ( - e || ((u = !1), (e = a.edge(s, i))), - (c = e.weight), - f.forEach(a.nodeEdges(i), function (e) { - var t, - n = e.v === i, - r = n ? e.w : e.v; - r !== s && - ((t = n === u), - (n = a.edge(e).weight), - (c += t ? n : -n), - (e = i), - (n = r), - o.hasEdge(e, n) && ((r = o.edge(i, r).cutvalue), (c += t ? -r : r))); - }), - c - ); - } - function l(e, t) { - arguments.length < 2 && (t = e.nodes()[0]), - (function t(n, r, o, a, e) { - var i = o; - var s = n.node(a); - r[a] = !0; - f.forEach(n.neighbors(a), function (e) { - f.has(r, e) || (o = t(n, r, o, e, a)); - }); - s.low = i; - s.lim = o++; - e ? (s.parent = e) : delete s.parent; - return o; - })(e, {}, 1, t); - } - function p(t) { - return f.find(t.edges(), function (e) { - return t.edge(e).cutvalue < 0; - }); - } - function _(t, n, e) { - var r = e.v, - o = e.w; - n.hasEdge(r, o) || ((r = e.w), (o = e.v)); - var r = t.node(r), - o = t.node(o), - a = r, - i = !1; - r.lim > o.lim && ((a = o), (i = !0)); - o = f.filter(n.edges(), function (e) { - return i === g(0, t.node(e.v), a) && i !== g(0, t.node(e.w), a); - }); - return f.minBy(o, function (e) { - return s(n, e); - }); - } - function v(e, t, n, r) { - var o, - a, - i = n.v, - n = n.w; - e.removeEdge(i, n), - e.setEdge(r.v, r.w, {}), - l(e), - d(e, t), - (o = e), - (a = t), - (t = f.find(o.nodes(), function (e) { - return !a.node(e).parent; - })), - (t = (t = u(o, t)).slice(1)), - f.forEach(t, function (e) { - var t = o.node(e).parent, - n = a.edge(e, t), - r = !1; - n || ((n = a.edge(t, e)), (r = !0)), - (a.node(e).rank = a.node(t).rank + (r ? n.minlen : -n.minlen)); - }); - } - function g(e, t, n) { - return n.low <= t.lim && t.lim <= n.lim; - } - ((t.exports = c).initLowLimValues = l), - (c.initCutValues = d), - (c.calcCutValue = h), - (c.leaveEdge = p), - (c.enterEdge = _), - (c.exchangeEdges = v); - }, - { - "../graphlib": 7, - "../lodash": 10, - "../util": 29, - "./feasible-tree": 25, - "./util": 28, - }, - ], - 28: [ - function (e, t, n) { - "use strict"; - var a = e("../lodash"); - t.exports = { - longestPath: function (r) { - var o = {}; - a.forEach(r.sources(), function t(e) { - var n = r.node(e); - if (a.has(o, e)) return n.rank; - o[e] = !0; - e = a.min( - a.map(r.outEdges(e), function (e) { - return t(e.w) - r.edge(e).minlen; - }) - ); - return ( - (e !== Number.POSITIVE_INFINITY && null != e) || (e = 0), (n.rank = e) - ); - }); - }, - slack: function (e, t) { - return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen; - }, - }; - }, - { "../lodash": 10 }, - ], - 29: [ - function (e, t, n) { - "use strict"; - var s = e("./lodash"), - a = e("./graphlib").Graph; - function i(e, t, n, r) { - for (var o; (o = s.uniqueId(r)), e.hasNode(o); ); - return (n.dummy = t), e.setNode(o, n), o; - } - function u(t) { - return s.max( - s.map(t.nodes(), function (e) { - e = t.node(e).rank; - if (!s.isUndefined(e)) return e; - }) - ); - } - t.exports = { - addDummyNode: i, - simplify: function (r) { - var o = new a().setGraph(r.graph()); - return ( - s.forEach(r.nodes(), function (e) { - o.setNode(e, r.node(e)); - }), - s.forEach(r.edges(), function (e) { - var t = o.edge(e.v, e.w) || { weight: 0, minlen: 1 }, - n = r.edge(e); - o.setEdge(e.v, e.w, { - weight: t.weight + n.weight, - minlen: Math.max(t.minlen, n.minlen), - }); - }), - o - ); - }, - asNonCompoundGraph: function (t) { - var n = new a({ multigraph: t.isMultigraph() }).setGraph(t.graph()); - return ( - s.forEach(t.nodes(), function (e) { - t.children(e).length || n.setNode(e, t.node(e)); - }), - s.forEach(t.edges(), function (e) { - n.setEdge(e, t.edge(e)); - }), - n - ); - }, - successorWeights: function (n) { - var e = s.map(n.nodes(), function (e) { - var t = {}; - return ( - s.forEach(n.outEdges(e), function (e) { - t[e.w] = (t[e.w] || 0) + n.edge(e).weight; - }), - t - ); - }); - return s.zipObject(n.nodes(), e); - }, - predecessorWeights: function (n) { - var e = s.map(n.nodes(), function (e) { - var t = {}; - return ( - s.forEach(n.inEdges(e), function (e) { - t[e.v] = (t[e.v] || 0) + n.edge(e).weight; - }), - t - ); - }); - return s.zipObject(n.nodes(), e); - }, - intersectRect: function (e, t) { - var n, - r = e.x, - o = e.y, - a = t.x - r, - i = t.y - o, - t = e.width / 2, - e = e.height / 2; - if (!a && !i) - throw new Error( - "Not possible to find intersection inside of the rectangle" - ); - a = - Math.abs(i) * t > Math.abs(a) * e - ? (i < 0 && (e = -e), (n = (e * a) / i), e) - : (a < 0 && (t = -t), ((n = t) * i) / a); - return { x: r + n, y: o + a }; - }, - buildLayerMatrix: function (r) { - var o = s.map(s.range(u(r) + 1), function () { - return []; - }); - return ( - s.forEach(r.nodes(), function (e) { - var t = r.node(e), - n = t.rank; - s.isUndefined(n) || (o[n][t.order] = e); - }), - o - ); - }, - normalizeRanks: function (t) { - var n = s.min( - s.map(t.nodes(), function (e) { - return t.node(e).rank; - }) - ); - s.forEach(t.nodes(), function (e) { - e = t.node(e); - s.has(e, "rank") && (e.rank -= n); - }); - }, - removeEmptyRanks: function (n) { - var r = s.min( - s.map(n.nodes(), function (e) { - return n.node(e).rank; - }) - ), - o = []; - s.forEach(n.nodes(), function (e) { - var t = n.node(e).rank - r; - o[t] || (o[t] = []), o[t].push(e); - }); - var a = 0, - i = n.graph().nodeRankFactor; - s.forEach(o, function (e, t) { - s.isUndefined(e) && t % i != 0 - ? --a - : a && - s.forEach(e, function (e) { - n.node(e).rank += a; - }); - }); - }, - addBorderNode: function (e, t, n, r) { - var o = { width: 0, height: 0 }; - 4 <= arguments.length && ((o.rank = n), (o.order = r)); - return i(e, "border", o, t); - }, - maxRank: u, - partition: function (e, t) { - var n = { lhs: [], rhs: [] }; - return ( - s.forEach(e, function (e) { - (t(e) ? n.lhs : n.rhs).push(e); - }), - n - ); - }, - time: function (e, t) { - var n = s.now(); - try { - return t(); - } finally { - console.log(e + " time: " + (s.now() - n) + "ms"); - } - }, - notime: function (e, t) { - return t(); - }, - }; - }, - { "./graphlib": 7, "./lodash": 10 }, - ], - 30: [ - function (e, t, n) { - t.exports = "0.8.5"; - }, - {}, - ], - 31: [ - function (e, t, n) { - var r = e("./lib"); - t.exports = { - Graph: r.Graph, - json: e("./lib/json"), - alg: e("./lib/alg"), - version: r.version, - }; - }, - { "./lib": 47, "./lib/alg": 38, "./lib/json": 48 }, - ], - 32: [ - function (e, t, n) { - var i = e("../lodash"); - t.exports = function (t) { - var n, - r = {}, - o = []; - function a(e) { - i.has(r, e) || - ((r[e] = !0), - n.push(e), - i.each(t.successors(e), a), - i.each(t.predecessors(e), a)); - } - return ( - i.each(t.nodes(), function (e) { - (n = []), a(e), n.length && o.push(n); - }), - o - ); - }; - }, - { "../lodash": 49 }, - ], - 33: [ - function (e, t, n) { - var s = e("../lodash"); - t.exports = function (t, e, n) { - s.isArray(e) || (e = [e]); - var r = (t.isDirected() ? t.successors : t.neighbors).bind(t), - o = [], - a = {}; - return ( - s.each(e, function (e) { - if (!t.hasNode(e)) throw new Error("Graph does not have node: " + e); - !(function t(n, e, r, o, a, i) { - s.has(o, e) || - ((o[e] = !0), - r || i.push(e), - s.each(a(e), function (e) { - t(n, e, r, o, a, i); - }), - r && i.push(e)); - })(t, e, "post" === n, a, r, o); - }), - o - ); - }; - }, - { "../lodash": 49 }, - ], - 34: [ - function (e, t, n) { - var a = e("./dijkstra"), - i = e("../lodash"); - t.exports = function (n, r, o) { - return i.transform( - n.nodes(), - function (e, t) { - e[t] = a(n, t, r, o); - }, - {} - ); - }; - }, - { "../lodash": 49, "./dijkstra": 35 }, - ], - 35: [ - function (e, t, n) { - var r = e("../lodash"), - o = e("../data/priority-queue"); - t.exports = function (t, e, n, r) { - return (function (e, n, a, t) { - function r(e) { - var t = e.v !== i ? e.v : e.w, - n = u[t], - r = a(e), - o = s.distance + r; - if (r < 0) - throw new Error( - "dijkstra does not allow negative edge weights. Bad edge: " + - e + - " Weight: " + - r - ); - o < n.distance && - ((n.distance = o), (n.predecessor = i), c.decrease(t, o)); - } - var i, - s, - u = {}, - c = new o(); - e.nodes().forEach(function (e) { - var t = e === n ? 0 : Number.POSITIVE_INFINITY; - (u[e] = { distance: t }), c.add(e, t); - }); - for ( - ; - 0 < c.size() && - ((i = c.removeMin()), (s = u[i]).distance !== Number.POSITIVE_INFINITY); - - ) - t(i).forEach(r); - return u; - })( - t, - String(e), - n || a, - r || - function (e) { - return t.outEdges(e); - } - ); - }; - var a = r.constant(1); - }, - { "../data/priority-queue": 45, "../lodash": 49 }, - ], - 36: [ - function (e, t, n) { - var r = e("../lodash"), - o = e("./tarjan"); - t.exports = function (t) { - return r.filter(o(t), function (e) { - return 1 < e.length || (1 === e.length && t.hasEdge(e[0], e[0])); - }); - }; - }, - { "../lodash": 49, "./tarjan": 43 }, - ], - 37: [ - function (e, t, n) { - e = e("../lodash"); - t.exports = function (t, e, n) { - return (function (e, r, t) { - var i = {}, - s = e.nodes(); - return ( - s.forEach(function (n) { - (i[n] = {}), - (i[n][n] = { distance: 0 }), - s.forEach(function (e) { - n !== e && (i[n][e] = { distance: Number.POSITIVE_INFINITY }); - }), - t(n).forEach(function (e) { - var t = e.v === n ? e.w : e.v, - e = r(e); - i[n][t] = { distance: e, predecessor: n }; - }); - }), - s.forEach(function (o) { - var a = i[o]; - s.forEach(function (e) { - var r = i[e]; - s.forEach(function (e) { - var t = r[o], - n = a[e], - e = r[e], - t = t.distance + n.distance; - t < e.distance && - ((e.distance = t), (e.predecessor = n.predecessor)); - }); - }); - }), - i - ); - })( - t, - e || r, - n || - function (e) { - return t.outEdges(e); - } - ); - }; - var r = e.constant(1); - }, - { "../lodash": 49 }, - ], - 38: [ - function (e, t, n) { - t.exports = { - components: e("./components"), - dijkstra: e("./dijkstra"), - dijkstraAll: e("./dijkstra-all"), - findCycles: e("./find-cycles"), - floydWarshall: e("./floyd-warshall"), - isAcyclic: e("./is-acyclic"), - postorder: e("./postorder"), - preorder: e("./preorder"), - prim: e("./prim"), - tarjan: e("./tarjan"), - topsort: e("./topsort"), - }; - }, - { - "./components": 32, - "./dijkstra": 35, - "./dijkstra-all": 34, - "./find-cycles": 36, - "./floyd-warshall": 37, - "./is-acyclic": 39, - "./postorder": 40, - "./preorder": 41, - "./prim": 42, - "./tarjan": 43, - "./topsort": 44, - }, - ], - 39: [ - function (e, t, n) { - var r = e("./topsort"); - t.exports = function (e) { - try { - r(e); - } catch (e) { - if (e instanceof r.CycleException) return !1; - throw e; - } - return !0; - }; - }, - { "./topsort": 44 }, - ], - 40: [ - function (e, t, n) { - var r = e("./dfs"); - t.exports = function (e, t) { - return r(e, t, "post"); - }; - }, - { "./dfs": 33 }, - ], - 41: [ - function (e, t, n) { - var r = e("./dfs"); - t.exports = function (e, t) { - return r(e, t, "pre"); - }; - }, - { "./dfs": 33 }, - ], - 42: [ - function (e, t, n) { - var u = e("../lodash"), - c = e("../graph"), - f = e("../data/priority-queue"); - t.exports = function (e, r) { - var o, - t = new c(), - a = {}, - i = new f(); - function n(e) { - var t = e.v === o ? e.w : e.v, - n = i.priority(t); - void 0 === n || ((e = r(e)) < n && ((a[t] = o), i.decrease(t, e))); - } - if (0 === e.nodeCount()) return t; - u.each(e.nodes(), function (e) { - i.add(e, Number.POSITIVE_INFINITY), t.setNode(e); - }), - i.decrease(e.nodes()[0], 0); - var s = !1; - for (; 0 < i.size(); ) { - if (((o = i.removeMin()), u.has(a, o))) t.setEdge(o, a[o]); - else { - if (s) throw new Error("Input graph is not connected: " + e); - s = !0; - } - e.nodeEdges(o).forEach(n); - } - return t; - }; - }, - { "../data/priority-queue": 45, "../graph": 46, "../lodash": 49 }, - ], - 43: [ - function (e, t, n) { - var f = e("../lodash"); - t.exports = function (a) { - var i = 0, - s = [], - u = {}, - c = []; - return ( - a.nodes().forEach(function (e) { - f.has(u, e) || - !(function t(e) { - var n = (u[e] = { onStack: !0, lowlink: i, index: i++ }); - s.push(e); - a.successors(e).forEach(function (e) { - f.has(u, e) - ? u[e].onStack && (n.lowlink = Math.min(n.lowlink, u[e].index)) - : (t(e), (n.lowlink = Math.min(n.lowlink, u[e].lowlink))); - }); - if (n.lowlink === n.index) { - for ( - var r, o = []; - (r = s.pop()), (u[r].onStack = !1), o.push(r), e !== r; - - ); - c.push(o); - } - })(e); - }), - c - ); - }; - }, - { "../lodash": 49 }, - ], - 44: [ - function (e, t, n) { - var i = e("../lodash"); - function r(n) { - var r = {}, - o = {}, - a = []; - if ( - (i.each(n.sinks(), function e(t) { - if (i.has(o, t)) throw new s(); - i.has(r, t) || - ((o[t] = !0), - (r[t] = !0), - i.each(n.predecessors(t), e), - delete o[t], - a.push(t)); - }), - i.size(r) !== n.nodeCount()) - ) - throw new s(); - return a; - } - function s() {} - ((t.exports = r).CycleException = s).prototype = new Error(); - }, - { "../lodash": 49 }, - ], - 45: [ - function (e, t, n) { - var a = e("../lodash"); - function r() { - (this._arr = []), (this._keyIndices = {}); - } - ((t.exports = r).prototype.size = function () { - return this._arr.length; - }), - (r.prototype.keys = function () { - return this._arr.map(function (e) { - return e.key; - }); - }), - (r.prototype.has = function (e) { - return a.has(this._keyIndices, e); - }), - (r.prototype.priority = function (e) { - e = this._keyIndices[e]; - if (void 0 !== e) return this._arr[e].priority; - }), - (r.prototype.min = function () { - if (0 === this.size()) throw new Error("Queue underflow"); - return this._arr[0].key; - }), - (r.prototype.add = function (e, t) { - var n = this._keyIndices; - if (((e = String(e)), a.has(n, e))) return !1; - var r = this._arr, - o = r.length; - return (n[e] = o), r.push({ key: e, priority: t }), this._decrease(o), !0; - }), - (r.prototype.removeMin = function () { - this._swap(0, this._arr.length - 1); - var e = this._arr.pop(); - return delete this._keyIndices[e.key], this._heapify(0), e.key; - }), - (r.prototype.decrease = function (e, t) { - var n = this._keyIndices[e]; - if (t > this._arr[n].priority) - throw new Error( - "New priority is greater than current priority. Key: " + - e + - " Old: " + - this._arr[n].priority + - " New: " + - t - ); - (this._arr[n].priority = t), this._decrease(n); - }), - (r.prototype._heapify = function (e) { - var t = this._arr, - n = 2 * e, - r = 1 + n, - o = e; - n < t.length && - ((o = t[n].priority < t[o].priority ? n : o), - r < t.length && (o = t[r].priority < t[o].priority ? r : o), - o !== e && (this._swap(e, o), this._heapify(o))); - }), - (r.prototype._decrease = function (e) { - for ( - var t, n = this._arr, r = n[e].priority; - 0 !== e && !(n[(t = e >> 1)].priority < r); - - ) - this._swap(e, t), (e = t); - }), - (r.prototype._swap = function (e, t) { - var n = this._arr, - r = this._keyIndices, - o = n[e], - a = n[t]; - (n[e] = a), (n[t] = o), (r[a.key] = e), (r[o.key] = t); - }); - }, - { "../lodash": 49 }, - ], - 46: [ - function (e, t, n) { - "use strict"; - var i = e("./lodash"); - t.exports = s; - var o = "\0", - r = "\0", - a = ""; - function s(e) { - (this._isDirected = !i.has(e, "directed") || e.directed), - (this._isMultigraph = !!i.has(e, "multigraph") && e.multigraph), - (this._isCompound = !!i.has(e, "compound") && e.compound), - (this._label = void 0), - (this._defaultNodeLabelFn = i.constant(void 0)), - (this._defaultEdgeLabelFn = i.constant(void 0)), - (this._nodes = {}), - this._isCompound && - ((this._parent = {}), (this._children = {}), (this._children[r] = {})), - (this._in = {}), - (this._preds = {}), - (this._out = {}), - (this._sucs = {}), - (this._edgeObjs = {}), - (this._edgeLabels = {}); - } - function u(e, t) { - e[t] ? e[t]++ : (e[t] = 1); - } - function c(e, t) { - --e[t] || delete e[t]; - } - function f(e, t, n, r) { - (t = "" + t), (n = "" + n); - return ( - !e && n < t && ((e = t), (t = n), (n = e)), - t + a + n + a + (i.isUndefined(r) ? o : r) - ); - } - function d(e, t) { - return f(e, t.v, t.w, t.name); - } - (s.prototype._nodeCount = 0), - (s.prototype._edgeCount = 0), - (s.prototype.isDirected = function () { - return this._isDirected; - }), - (s.prototype.isMultigraph = function () { - return this._isMultigraph; - }), - (s.prototype.isCompound = function () { - return this._isCompound; - }), - (s.prototype.setGraph = function (e) { - return (this._label = e), this; - }), - (s.prototype.graph = function () { - return this._label; - }), - (s.prototype.setDefaultNodeLabel = function (e) { - return ( - i.isFunction(e) || (e = i.constant(e)), - (this._defaultNodeLabelFn = e), - this - ); - }), - (s.prototype.nodeCount = function () { - return this._nodeCount; - }), - (s.prototype.nodes = function () { - return i.keys(this._nodes); - }), - (s.prototype.sources = function () { - var t = this; - return i.filter(this.nodes(), function (e) { - return i.isEmpty(t._in[e]); - }); - }), - (s.prototype.sinks = function () { - var t = this; - return i.filter(this.nodes(), function (e) { - return i.isEmpty(t._out[e]); - }); - }), - (s.prototype.setNodes = function (e, t) { - var n = arguments, - r = this; - return ( - i.each(e, function (e) { - 1 < n.length ? r.setNode(e, t) : r.setNode(e); - }), - this - ); - }), - (s.prototype.setNode = function (e, t) { - return ( - i.has(this._nodes, e) - ? 1 < arguments.length && (this._nodes[e] = t) - : ((this._nodes[e] = - 1 < arguments.length ? t : this._defaultNodeLabelFn(e)), - this._isCompound && - ((this._parent[e] = r), - (this._children[e] = {}), - (this._children[r][e] = !0)), - (this._in[e] = {}), - (this._preds[e] = {}), - (this._out[e] = {}), - (this._sucs[e] = {}), - ++this._nodeCount), - this - ); - }), - (s.prototype.node = function (e) { - return this._nodes[e]; - }), - (s.prototype.hasNode = function (e) { - return i.has(this._nodes, e); - }), - (s.prototype.removeNode = function (e) { - var t, - n = this; - return ( - i.has(this._nodes, e) && - ((t = function (e) { - n.removeEdge(n._edgeObjs[e]); - }), - delete this._nodes[e], - this._isCompound && - (this._removeFromParentsChildList(e), - delete this._parent[e], - i.each(this.children(e), function (e) { - n.setParent(e); - }), - delete this._children[e]), - i.each(i.keys(this._in[e]), t), - delete this._in[e], - delete this._preds[e], - i.each(i.keys(this._out[e]), t), - delete this._out[e], - delete this._sucs[e], - --this._nodeCount), - this - ); - }), - (s.prototype.setParent = function (e, t) { - if (!this._isCompound) - throw new Error("Cannot set parent in a non-compound graph"); - if (i.isUndefined(t)) t = r; - else { - for (var n = (t += ""); !i.isUndefined(n); n = this.parent(n)) - if (n === e) - throw new Error( - "Setting " + t + " as parent of " + e + " would create a cycle" - ); - this.setNode(t); - } - return ( - this.setNode(e), - this._removeFromParentsChildList(e), - (this._parent[e] = t), - (this._children[t][e] = !0), - this - ); - }), - (s.prototype._removeFromParentsChildList = function (e) { - delete this._children[this._parent[e]][e]; - }), - (s.prototype.parent = function (e) { - if (this._isCompound) { - e = this._parent[e]; - if (e !== r) return e; - } - }), - (s.prototype.children = function (e) { - if ((i.isUndefined(e) && (e = r), !this._isCompound)) - return e === r ? this.nodes() : this.hasNode(e) ? [] : void 0; - e = this._children[e]; - return e ? i.keys(e) : void 0; - }), - (s.prototype.predecessors = function (e) { - e = this._preds[e]; - if (e) return i.keys(e); - }), - (s.prototype.successors = function (e) { - e = this._sucs[e]; - if (e) return i.keys(e); - }), - (s.prototype.neighbors = function (e) { - var t = this.predecessors(e); - if (t) return i.union(t, this.successors(e)); - }), - (s.prototype.isLeaf = function (e) { - e = this.isDirected() ? this.successors(e) : this.neighbors(e); - return 0 === e.length; - }), - (s.prototype.filterNodes = function (n) { - var r = new this.constructor({ - directed: this._isDirected, - multigraph: this._isMultigraph, - compound: this._isCompound, - }); - r.setGraph(this.graph()); - var o = this; - i.each(this._nodes, function (e, t) { - n(t) && r.setNode(t, e); - }), - i.each(this._edgeObjs, function (e) { - r.hasNode(e.v) && r.hasNode(e.w) && r.setEdge(e, o.edge(e)); - }); - var a = {}; - return ( - this._isCompound && - i.each(r.nodes(), function (e) { - r.setParent( - e, - (function e(t) { - var n = o.parent(t); - return void 0 === n || r.hasNode(n) - ? (a[t] = n) - : n in a - ? a[n] - : e(n); - })(e) - ); - }), - r - ); - }), - (s.prototype.setDefaultEdgeLabel = function (e) { - return ( - i.isFunction(e) || (e = i.constant(e)), - (this._defaultEdgeLabelFn = e), - this - ); - }), - (s.prototype.edgeCount = function () { - return this._edgeCount; - }), - (s.prototype.edges = function () { - return i.values(this._edgeObjs); - }), - (s.prototype.setPath = function (e, n) { - var r = this, - o = arguments; - return ( - i.reduce(e, function (e, t) { - return 1 < o.length ? r.setEdge(e, t, n) : r.setEdge(e, t), t; - }), - this - ); - }), - (s.prototype.setEdge = function () { - var e, - t = !1, - n = arguments[0]; - "object" == typeof n && null !== n && "v" in n - ? ((o = n.v), - (a = n.w), - (r = n.name), - 2 === arguments.length && ((e = arguments[1]), (t = !0))) - : ((o = n), - (a = arguments[1]), - (r = arguments[3]), - 2 < arguments.length && ((e = arguments[2]), (t = !0))), - (o = "" + o), - (a = "" + a), - i.isUndefined(r) || (r = "" + r); - n = f(this._isDirected, o, a, r); - if (i.has(this._edgeLabels, n)) return t && (this._edgeLabels[n] = e), this; - if (!i.isUndefined(r) && !this._isMultigraph) - throw new Error("Cannot set a named edge when isMultigraph = false"); - this.setNode(o), - this.setNode(a), - (this._edgeLabels[n] = t ? e : this._defaultEdgeLabelFn(o, a, r)); - var r = (function (e, t, n, r) { - (t = "" + t), (n = "" + n); - !e && n < t && ((e = t), (t = n), (n = e)); - n = { v: t, w: n }; - r && (n.name = r); - return n; - })(this._isDirected, o, a, r), - o = r.v, - a = r.w; - return ( - Object.freeze(r), - (this._edgeObjs[n] = r), - u(this._preds[a], o), - u(this._sucs[o], a), - (this._in[a][n] = r), - (this._out[o][n] = r), - this._edgeCount++, - this - ); - }), - (s.prototype.edge = function (e, t, n) { - n = - 1 === arguments.length - ? d(this._isDirected, e) - : f(this._isDirected, e, t, n); - return this._edgeLabels[n]; - }), - (s.prototype.hasEdge = function (e, t, n) { - n = - 1 === arguments.length - ? d(this._isDirected, e) - : f(this._isDirected, e, t, n); - return i.has(this._edgeLabels, n); - }), - (s.prototype.removeEdge = function (e, t, n) { - var r = - 1 === arguments.length - ? d(this._isDirected, arguments[0]) - : f(this._isDirected, e, t, n), - n = this._edgeObjs[r]; - return ( - n && - ((e = n.v), - (t = n.w), - delete this._edgeLabels[r], - delete this._edgeObjs[r], - c(this._preds[t], e), - c(this._sucs[e], t), - delete this._in[t][r], - delete this._out[e][r], - this._edgeCount--), - this - ); - }), - (s.prototype.inEdges = function (e, t) { - e = this._in[e]; - if (e) { - e = i.values(e); - return t - ? i.filter(e, function (e) { - return e.v === t; - }) - : e; - } - }), - (s.prototype.outEdges = function (e, t) { - e = this._out[e]; - if (e) { - e = i.values(e); - return t - ? i.filter(e, function (e) { - return e.w === t; - }) - : e; - } - }), - (s.prototype.nodeEdges = function (e, t) { - var n = this.inEdges(e, t); - if (n) return n.concat(this.outEdges(e, t)); - }); - }, - { "./lodash": 49 }, - ], - 47: [ - function (e, t, n) { - t.exports = { Graph: e("./graph"), version: e("./version") }; - }, - { "./graph": 46, "./version": 50 }, - ], - 48: [ - function (e, t, n) { - var o = e("./lodash"), - r = e("./graph"); - t.exports = { - write: function (e) { - var t = { - options: { - directed: e.isDirected(), - multigraph: e.isMultigraph(), - compound: e.isCompound(), - }, - nodes: (function (r) { - return o.map(r.nodes(), function (e) { - var t = r.node(e), - n = r.parent(e), - e = { v: e }; - return ( - o.isUndefined(t) || (e.value = t), - o.isUndefined(n) || (e.parent = n), - e - ); - }); - })(e), - edges: (function (r) { - return o.map(r.edges(), function (e) { - var t = r.edge(e), - n = { v: e.v, w: e.w }; - return ( - o.isUndefined(e.name) || (n.name = e.name), - o.isUndefined(t) || (n.value = t), - n - ); - }); - })(e), - }; - o.isUndefined(e.graph()) || (t.value = o.clone(e.graph())); - return t; - }, - read: function (e) { - var t = new r(e.options).setGraph(e.value); - return ( - o.each(e.nodes, function (e) { - t.setNode(e.v, e.value), e.parent && t.setParent(e.v, e.parent); - }), - o.each(e.edges, function (e) { - t.setEdge({ v: e.v, w: e.w, name: e.name }, e.value); - }), - t - ); - }, - }; - }, - { "./graph": 46, "./lodash": 49 }, - ], - 49: [ - function (e, t, n) { - var r; - if ("function" == typeof e) - try { - r = { - clone: e("lodash/clone"), - constant: e("lodash/constant"), - each: e("lodash/each"), - filter: e("lodash/filter"), - has: e("lodash/has"), - isArray: e("lodash/isArray"), - isEmpty: e("lodash/isEmpty"), - isFunction: e("lodash/isFunction"), - isUndefined: e("lodash/isUndefined"), - keys: e("lodash/keys"), - map: e("lodash/map"), - reduce: e("lodash/reduce"), - size: e("lodash/size"), - transform: e("lodash/transform"), - union: e("lodash/union"), - values: e("lodash/values"), - }; - } catch (e) {} - (r = r || window._), (t.exports = r); - }, - { - "lodash/clone": 226, - "lodash/constant": 228, - "lodash/each": 230, - "lodash/filter": 232, - "lodash/has": 239, - "lodash/isArray": 243, - "lodash/isEmpty": 247, - "lodash/isFunction": 248, - "lodash/isUndefined": 258, - "lodash/keys": 259, - "lodash/map": 262, - "lodash/reduce": 274, - "lodash/size": 275, - "lodash/transform": 284, - "lodash/union": 285, - "lodash/values": 287, - }, - ], - 50: [ - function (e, t, n) { - t.exports = "2.1.8"; - }, - {}, - ], - 51: [ - function (e, t, n) { - e = e("./_getNative")(e("./_root"), "DataView"); - t.exports = e; - }, - { "./_getNative": 163, "./_root": 208 }, - ], - 52: [ - function (e, t, n) { - var r = e("./_hashClear"), - o = e("./_hashDelete"), - a = e("./_hashGet"), - i = e("./_hashHas"), - e = e("./_hashSet"); - function s(e) { - var t = -1, - n = null == e ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var r = e[t]; - this.set(r[0], r[1]); - } - } - (s.prototype.clear = r), - (s.prototype.delete = o), - (s.prototype.get = a), - (s.prototype.has = i), - (s.prototype.set = e), - (t.exports = s); - }, - { - "./_hashClear": 172, - "./_hashDelete": 173, - "./_hashGet": 174, - "./_hashHas": 175, - "./_hashSet": 176, - }, - ], - 53: [ - function (e, t, n) { - var r = e("./_listCacheClear"), - o = e("./_listCacheDelete"), - a = e("./_listCacheGet"), - i = e("./_listCacheHas"), - e = e("./_listCacheSet"); - function s(e) { - var t = -1, - n = null == e ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var r = e[t]; - this.set(r[0], r[1]); - } - } - (s.prototype.clear = r), - (s.prototype.delete = o), - (s.prototype.get = a), - (s.prototype.has = i), - (s.prototype.set = e), - (t.exports = s); - }, - { - "./_listCacheClear": 188, - "./_listCacheDelete": 189, - "./_listCacheGet": 190, - "./_listCacheHas": 191, - "./_listCacheSet": 192, - }, - ], - 54: [ - function (e, t, n) { - e = e("./_getNative")(e("./_root"), "Map"); - t.exports = e; - }, - { "./_getNative": 163, "./_root": 208 }, - ], - 55: [ - function (e, t, n) { - var r = e("./_mapCacheClear"), - o = e("./_mapCacheDelete"), - a = e("./_mapCacheGet"), - i = e("./_mapCacheHas"), - e = e("./_mapCacheSet"); - function s(e) { - var t = -1, - n = null == e ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var r = e[t]; - this.set(r[0], r[1]); - } - } - (s.prototype.clear = r), - (s.prototype.delete = o), - (s.prototype.get = a), - (s.prototype.has = i), - (s.prototype.set = e), - (t.exports = s); - }, - { - "./_mapCacheClear": 193, - "./_mapCacheDelete": 194, - "./_mapCacheGet": 195, - "./_mapCacheHas": 196, - "./_mapCacheSet": 197, - }, - ], - 56: [ - function (e, t, n) { - e = e("./_getNative")(e("./_root"), "Promise"); - t.exports = e; - }, - { "./_getNative": 163, "./_root": 208 }, - ], - 57: [ - function (e, t, n) { - e = e("./_getNative")(e("./_root"), "Set"); - t.exports = e; - }, - { "./_getNative": 163, "./_root": 208 }, - ], - 58: [ - function (e, t, n) { - var r = e("./_MapCache"), - o = e("./_setCacheAdd"), - e = e("./_setCacheHas"); - function a(e) { - var t = -1, - n = null == e ? 0 : e.length; - for (this.__data__ = new r(); ++t < n; ) this.add(e[t]); - } - (a.prototype.add = a.prototype.push = o), - (a.prototype.has = e), - (t.exports = a); - }, - { "./_MapCache": 55, "./_setCacheAdd": 210, "./_setCacheHas": 211 }, - ], - 59: [ - function (e, t, n) { - var r = e("./_ListCache"), - o = e("./_stackClear"), - a = e("./_stackDelete"), - i = e("./_stackGet"), - s = e("./_stackHas"), - e = e("./_stackSet"); - function u(e) { - e = this.__data__ = new r(e); - this.size = e.size; - } - (u.prototype.clear = o), - (u.prototype.delete = a), - (u.prototype.get = i), - (u.prototype.has = s), - (u.prototype.set = e), - (t.exports = u); - }, - { - "./_ListCache": 53, - "./_stackClear": 215, - "./_stackDelete": 216, - "./_stackGet": 217, - "./_stackHas": 218, - "./_stackSet": 219, - }, - ], - 60: [ - function (e, t, n) { - e = e("./_root").Symbol; - t.exports = e; - }, - { "./_root": 208 }, - ], - 61: [ - function (e, t, n) { - e = e("./_root").Uint8Array; - t.exports = e; - }, - { "./_root": 208 }, - ], - 62: [ - function (e, t, n) { - e = e("./_getNative")(e("./_root"), "WeakMap"); - t.exports = e; - }, - { "./_getNative": 163, "./_root": 208 }, - ], - 63: [ - function (e, t, n) { - t.exports = function (e, t, n) { - switch (n.length) { - case 0: - return e.call(t); - case 1: - return e.call(t, n[0]); - case 2: - return e.call(t, n[0], n[1]); - case 3: - return e.call(t, n[0], n[1], n[2]); - } - return e.apply(t, n); - }; - }, - {}, - ], - 64: [ - function (e, t, n) { - t.exports = function (e, t) { - for ( - var n = -1, r = null == e ? 0 : e.length; - ++n < r && !1 !== t(e[n], n, e); - - ); - return e; - }; - }, - {}, - ], - 65: [ - function (e, t, n) { - t.exports = function (e, t) { - for (var n = -1, r = null == e ? 0 : e.length, o = 0, a = []; ++n < r; ) { - var i = e[n]; - t(i, n, e) && (a[o++] = i); - } - return a; - }; - }, - {}, - ], - 66: [ - function (e, t, n) { - var r = e("./_baseIndexOf"); - t.exports = function (e, t) { - return !!(null == e ? 0 : e.length) && -1 < r(e, t, 0); - }; - }, - { "./_baseIndexOf": 95 }, - ], - 67: [ - function (e, t, n) { - t.exports = function (e, t, n) { - for (var r = -1, o = null == e ? 0 : e.length; ++r < o; ) - if (n(t, e[r])) return !0; - return !1; - }; - }, - {}, - ], - 68: [ - function (e, t, n) { - var f = e("./_baseTimes"), - d = e("./isArguments"), - h = e("./isArray"), - l = e("./isBuffer"), - p = e("./_isIndex"), - _ = e("./isTypedArray"), - v = Object.prototype.hasOwnProperty; - t.exports = function (e, t) { - var n, - r = h(e), - o = !r && d(e), - a = !r && !o && l(e), - i = !r && !o && !a && _(e), - s = r || o || a || i, - u = s ? f(e.length, String) : [], - c = u.length; - for (n in e) - (!t && !v.call(e, n)) || - (s && - ("length" == n || - (a && ("offset" == n || "parent" == n)) || - (i && ("buffer" == n || "byteLength" == n || "byteOffset" == n)) || - p(n, c))) || - u.push(n); - return u; - }; - }, - { - "./_baseTimes": 125, - "./_isIndex": 181, - "./isArguments": 242, - "./isArray": 243, - "./isBuffer": 246, - "./isTypedArray": 257, - }, - ], - 69: [ - function (e, t, n) { - t.exports = function (e, t) { - for (var n = -1, r = null == e ? 0 : e.length, o = Array(r); ++n < r; ) - o[n] = t(e[n], n, e); - return o; - }; - }, - {}, - ], - 70: [ - function (e, t, n) { - t.exports = function (e, t) { - for (var n = -1, r = t.length, o = e.length; ++n < r; ) e[o + n] = t[n]; - return e; - }; - }, - {}, - ], - 71: [ - function (e, t, n) { - t.exports = function (e, t, n, r) { - var o = -1, - a = null == e ? 0 : e.length; - for (r && a && (n = e[++o]); ++o < a; ) n = t(n, e[o], o, e); - return n; - }; - }, - {}, - ], - 72: [ - function (e, t, n) { - t.exports = function (e, t) { - for (var n = -1, r = null == e ? 0 : e.length; ++n < r; ) - if (t(e[n], n, e)) return !0; - return !1; - }; - }, - {}, - ], - 73: [ - function (e, t, n) { - e = e("./_baseProperty")("length"); - t.exports = e; - }, - { "./_baseProperty": 117 }, - ], - 74: [ - function (e, t, n) { - var r = e("./_baseAssignValue"), - o = e("./eq"); - t.exports = function (e, t, n) { - ((void 0 === n || o(e[t], n)) && (void 0 !== n || t in e)) || r(e, t, n); - }; - }, - { "./_baseAssignValue": 79, "./eq": 231 }, - ], - 75: [ - function (e, t, n) { - var o = e("./_baseAssignValue"), - a = e("./eq"), - i = Object.prototype.hasOwnProperty; - t.exports = function (e, t, n) { - var r = e[t]; - (i.call(e, t) && a(r, n) && (void 0 !== n || t in e)) || o(e, t, n); - }; - }, - { "./_baseAssignValue": 79, "./eq": 231 }, - ], - 76: [ - function (e, t, n) { - var r = e("./eq"); - t.exports = function (e, t) { - for (var n = e.length; n--; ) if (r(e[n][0], t)) return n; - return -1; - }; - }, - { "./eq": 231 }, - ], - 77: [ - function (e, t, n) { - var r = e("./_copyObject"), - o = e("./keys"); - t.exports = function (e, t) { - return e && r(t, o(t), e); - }; - }, - { "./_copyObject": 143, "./keys": 259 }, - ], - 78: [ - function (e, t, n) { - var r = e("./_copyObject"), - o = e("./keysIn"); - t.exports = function (e, t) { - return e && r(t, o(t), e); - }; - }, - { "./_copyObject": 143, "./keysIn": 260 }, - ], - 79: [ - function (e, t, n) { - var r = e("./_defineProperty"); - t.exports = function (e, t, n) { - "__proto__" == t && r - ? r(e, t, { - configurable: !0, - enumerable: !0, - value: n, - writable: !0, - }) - : (e[t] = n); - }; - }, - { "./_defineProperty": 153 }, - ], - 80: [ - function (e, t, n) { - var p = e("./_Stack"), - _ = e("./_arrayEach"), - v = e("./_assignValue"), - g = e("./_baseAssign"), - y = e("./_baseAssignIn"), - b = e("./_cloneBuffer"), - m = e("./_copyArray"), - x = e("./_copySymbols"), - w = e("./_copySymbolsIn"), - E = e("./_getAllKeys"), - j = e("./_getAllKeysIn"), - k = e("./_getTag"), - A = e("./_initCloneArray"), - O = e("./_initCloneByTag"), - I = e("./_initCloneObject"), - S = e("./isArray"), - C = e("./isBuffer"), - N = e("./isMap"), - L = e("./isObject"), - M = e("./isSet"), - T = e("./keys"), - P = 1, - F = 2, - B = 4, - D = "[object Arguments]", - G = "[object Function]", - R = "[object GeneratorFunction]", - U = "[object Object]", - z = {}; - (z[D] = - z["[object Array]"] = - z["[object ArrayBuffer]"] = - z["[object DataView]"] = - z["[object Boolean]"] = - z["[object Date]"] = - z["[object Float32Array]"] = - z["[object Float64Array]"] = - z["[object Int8Array]"] = - z["[object Int16Array]"] = - z["[object Int32Array]"] = - z["[object Map]"] = - z["[object Number]"] = - z[U] = - z["[object RegExp]"] = - z["[object Set]"] = - z["[object String]"] = - z["[object Symbol]"] = - z["[object Uint8Array]"] = - z["[object Uint8ClampedArray]"] = - z["[object Uint16Array]"] = - z["[object Uint32Array]"] = - !0), - (z["[object Error]"] = z[G] = z["[object WeakMap]"] = !1), - (t.exports = function n(r, o, a, e, t, i) { - var s, - u = o & P, - c = o & F, - f = o & B; - if ((a && (s = t ? a(r, e, t, i) : a(r)), void 0 !== s)) return s; - if (!L(r)) return r; - var d = S(r); - if (d) { - if (((s = A(r)), !u)) return m(r, s); - } else { - var h = k(r), - e = h == G || h == R; - if (C(r)) return b(r, u); - if (h == U || h == D || (e && !t)) { - if (((s = c || e ? {} : I(r)), !u)) - return c ? w(r, y(s, r)) : x(r, g(s, r)); - } else { - if (!z[h]) return t ? r : {}; - s = O(r, h, u); - } - } - u = (i = i || new p()).get(r); - if (u) return u; - i.set(r, s), - M(r) - ? r.forEach(function (e) { - s.add(n(e, o, a, e, r, i)); - }) - : N(r) && - r.forEach(function (e, t) { - s.set(t, n(e, o, a, t, r, i)); - }); - var c = f ? (c ? j : E) : c ? keysIn : T, - l = d ? void 0 : c(r); - return ( - _(l || r, function (e, t) { - l && (e = r[(t = e)]), v(s, t, n(e, o, a, t, r, i)); - }), - s - ); - }); - }, - { - "./_Stack": 59, - "./_arrayEach": 64, - "./_assignValue": 75, - "./_baseAssign": 77, - "./_baseAssignIn": 78, - "./_cloneBuffer": 135, - "./_copyArray": 142, - "./_copySymbols": 144, - "./_copySymbolsIn": 145, - "./_getAllKeys": 159, - "./_getAllKeysIn": 160, - "./_getTag": 168, - "./_initCloneArray": 177, - "./_initCloneByTag": 178, - "./_initCloneObject": 179, - "./isArray": 243, - "./isBuffer": 246, - "./isMap": 250, - "./isObject": 251, - "./isSet": 254, - "./keys": 259, - }, - ], - 81: [ - function (e, t, n) { - var r = e("./isObject"), - o = Object.create, - e = function (e) { - if (!r(e)) return {}; - if (o) return o(e); - a.prototype = e; - e = new a(); - return (a.prototype = void 0), e; - }; - function a() {} - t.exports = e; - }, - { "./isObject": 251 }, - ], - 82: [ - function (e, t, n) { - var r = e("./_baseForOwn"), - r = e("./_createBaseEach")(r); - t.exports = r; - }, - { "./_baseForOwn": 88, "./_createBaseEach": 148 }, - ], - 83: [ - function (e, t, n) { - var c = e("./isSymbol"); - t.exports = function (e, t, n) { - for (var r = -1, o = e.length; ++r < o; ) { - var a, - i, - s = e[r], - u = t(s); - null != u && - (void 0 === a ? u == u && !c(u) : n(u, a)) && - ((a = u), (i = s)); - } - return i; - }; - }, - { "./isSymbol": 256 }, - ], - 84: [ - function (e, t, n) { - var a = e("./_baseEach"); - t.exports = function (e, r) { - var o = []; - return ( - a(e, function (e, t, n) { - r(e, t, n) && o.push(e); - }), - o - ); - }; - }, - { "./_baseEach": 82 }, - ], - 85: [ - function (e, t, n) { - t.exports = function (e, t, n, r) { - for (var o = e.length, a = n + (r ? 1 : -1); r ? a-- : ++a < o; ) - if (t(e[a], a, e)) return a; - return -1; - }; - }, - {}, - ], - 86: [ - function (e, t, n) { - var c = e("./_arrayPush"), - f = e("./_isFlattenable"); - t.exports = function e(t, n, r, o, a) { - var i = -1, - s = t.length; - for (r = r || f, a = a || []; ++i < s; ) { - var u = t[i]; - 0 < n && r(u) - ? 1 < n - ? e(u, n - 1, r, o, a) - : c(a, u) - : o || (a[a.length] = u); - } - return a; - }; - }, - { "./_arrayPush": 70, "./_isFlattenable": 180 }, - ], - 87: [ - function (e, t, n) { - e = e("./_createBaseFor")(); - t.exports = e; - }, - { "./_createBaseFor": 149 }, - ], - 88: [ - function (e, t, n) { - var r = e("./_baseFor"), - o = e("./keys"); - t.exports = function (e, t) { - return e && r(e, t, o); - }; - }, - { "./_baseFor": 87, "./keys": 259 }, - ], - 89: [ - function (e, t, n) { - var o = e("./_castPath"), - a = e("./_toKey"); - t.exports = function (e, t) { - for (var n = 0, r = (t = o(t, e)).length; null != e && n < r; ) - e = e[a(t[n++])]; - return n && n == r ? e : void 0; - }; - }, - { "./_castPath": 133, "./_toKey": 223 }, - ], - 90: [ - function (e, t, n) { - var r = e("./_arrayPush"), - o = e("./isArray"); - t.exports = function (e, t, n) { - return (t = t(e)), o(e) ? t : r(t, n(e)); - }; - }, - { "./_arrayPush": 70, "./isArray": 243 }, - ], - 91: [ - function (e, t, n) { - var r = e("./_Symbol"), - o = e("./_getRawTag"), - a = e("./_objectToString"), - i = r ? r.toStringTag : void 0; - t.exports = function (e) { - return null == e - ? void 0 === e - ? "[object Undefined]" - : "[object Null]" - : (i && i in Object(e) ? o : a)(e); - }; - }, - { "./_Symbol": 60, "./_getRawTag": 165, "./_objectToString": 205 }, - ], - 92: [ - function (e, t, n) { - t.exports = function (e, t) { - return t < e; - }; - }, - {}, - ], - 93: [ - function (e, t, n) { - var r = Object.prototype.hasOwnProperty; - t.exports = function (e, t) { - return null != e && r.call(e, t); - }; - }, - {}, - ], - 94: [ - function (e, t, n) { - t.exports = function (e, t) { - return null != e && t in Object(e); - }; - }, - {}, - ], - 95: [ - function (e, t, n) { - var r = e("./_baseFindIndex"), - o = e("./_baseIsNaN"), - a = e("./_strictIndexOf"); - t.exports = function (e, t, n) { - return t == t ? a(e, t, n) : r(e, o, n); - }; - }, - { - "./_baseFindIndex": 85, - "./_baseIsNaN": 101, - "./_strictIndexOf": 220, - }, - ], - 96: [ - function (e, t, n) { - var r = e("./_baseGetTag"), - o = e("./isObjectLike"); - t.exports = function (e) { - return o(e) && "[object Arguments]" == r(e); - }; - }, - { "./_baseGetTag": 91, "./isObjectLike": 252 }, - ], - 97: [ - function (e, t, n) { - var i = e("./_baseIsEqualDeep"), - s = e("./isObjectLike"); - t.exports = function e(t, n, r, o, a) { - return ( - t === n || - (null == t || null == n || (!s(t) && !s(n)) - ? t != t && n != n - : i(t, n, r, o, e, a)) - ); - }; - }, - { "./_baseIsEqualDeep": 98, "./isObjectLike": 252 }, - ], - 98: [ - function (e, t, n) { - var d = e("./_Stack"), - h = e("./_equalArrays"), - l = e("./_equalByTag"), - p = e("./_equalObjects"), - _ = e("./_getTag"), - v = e("./isArray"), - g = e("./isBuffer"), - y = e("./isTypedArray"), - b = "[object Arguments]", - m = "[object Array]", - x = "[object Object]", - w = Object.prototype.hasOwnProperty; - t.exports = function (e, t, n, r, o, a) { - var i = v(e), - s = v(t), - u = i ? m : _(e), - c = s ? m : _(t), - f = (u = u == b ? x : u) == x, - s = (c = c == b ? x : c) == x; - if ((c = u == c) && g(e)) { - if (!g(t)) return !1; - f = !(i = !0); - } - if (c && !f) - return ( - (a = a || new d()), - i || y(e) ? h(e, t, n, r, o, a) : l(e, t, u, n, r, o, a) - ); - if (!(1 & n)) { - (f = f && w.call(e, "__wrapped__")), (s = s && w.call(t, "__wrapped__")); - if (f || s) - return o(f ? e.value() : e, s ? t.value() : t, n, r, (a = a || new d())); - } - return !!c && ((a = a || new d()), p(e, t, n, r, o, a)); - }; - }, - { - "./_Stack": 59, - "./_equalArrays": 154, - "./_equalByTag": 155, - "./_equalObjects": 156, - "./_getTag": 168, - "./isArray": 243, - "./isBuffer": 246, - "./isTypedArray": 257, - }, - ], - 99: [ - function (e, t, n) { - var r = e("./_getTag"), - o = e("./isObjectLike"); - t.exports = function (e) { - return o(e) && "[object Map]" == r(e); - }; - }, - { "./_getTag": 168, "./isObjectLike": 252 }, - ], - 100: [ - function (e, t, n) { - var l = e("./_Stack"), - p = e("./_baseIsEqual"); - t.exports = function (e, t, n, r) { - var o = n.length, - a = o, - i = !r; - if (null == e) return !a; - for (e = Object(e); o--; ) { - var s = n[o]; - if (i && s[2] ? s[1] !== e[s[0]] : !(s[0] in e)) return !1; - } - for (; ++o < a; ) { - var u = (s = n[o])[0], - c = e[u], - f = s[1]; - if (i && s[2]) { - if (void 0 === c && !(u in e)) return !1; - } else { - var d, - h = new l(); - if ( - (r && (d = r(c, f, u, e, t, h)), !(void 0 === d ? p(f, c, 3, r, h) : d)) - ) - return !1; - } - } - return !0; - }; - }, - { "./_Stack": 59, "./_baseIsEqual": 97 }, - ], - 101: [ - function (e, t, n) { - t.exports = function (e) { - return e != e; - }; - }, - {}, - ], - 102: [ - function (e, t, n) { - var r = e("./isFunction"), - o = e("./_isMasked"), - a = e("./isObject"), - i = e("./_toSource"), - s = /^\[object .+?Constructor\]$/, - u = Function.prototype, - e = Object.prototype, - u = u.toString, - e = e.hasOwnProperty, - c = RegExp( - "^" + - u - .call(e) - .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&") - .replace( - /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, - "$1.*?" - ) + - "$" - ); - t.exports = function (e) { - return !(!a(e) || o(e)) && (r(e) ? c : s).test(i(e)); - }; - }, - { - "./_isMasked": 185, - "./_toSource": 224, - "./isFunction": 248, - "./isObject": 251, - }, - ], - 103: [ - function (e, t, n) { - var r = e("./_getTag"), - o = e("./isObjectLike"); - t.exports = function (e) { - return o(e) && "[object Set]" == r(e); - }; - }, - { "./_getTag": 168, "./isObjectLike": 252 }, - ], - 104: [ - function (e, t, n) { - var r = e("./_baseGetTag"), - o = e("./isLength"), - a = e("./isObjectLike"), - i = {}; - (i["[object Float32Array]"] = - i["[object Float64Array]"] = - i["[object Int8Array]"] = - i["[object Int16Array]"] = - i["[object Int32Array]"] = - i["[object Uint8Array]"] = - i["[object Uint8ClampedArray]"] = - i["[object Uint16Array]"] = - i["[object Uint32Array]"] = - !0), - (i["[object Arguments]"] = - i["[object Array]"] = - i["[object ArrayBuffer]"] = - i["[object Boolean]"] = - i["[object DataView]"] = - i["[object Date]"] = - i["[object Error]"] = - i["[object Function]"] = - i["[object Map]"] = - i["[object Number]"] = - i["[object Object]"] = - i["[object RegExp]"] = - i["[object Set]"] = - i["[object String]"] = - i["[object WeakMap]"] = - !1), - (t.exports = function (e) { - return a(e) && o(e.length) && !!i[r(e)]; - }); - }, - { "./_baseGetTag": 91, "./isLength": 249, "./isObjectLike": 252 }, - ], - 105: [ - function (e, t, n) { - var r = e("./_baseMatches"), - o = e("./_baseMatchesProperty"), - a = e("./identity"), - i = e("./isArray"), - s = e("./property"); - t.exports = function (e) { - return "function" == typeof e - ? e - : null == e - ? a - : "object" == typeof e - ? i(e) - ? o(e[0], e[1]) - : r(e) - : s(e); - }; - }, - { - "./_baseMatches": 110, - "./_baseMatchesProperty": 111, - "./identity": 241, - "./isArray": 243, - "./property": 272, - }, - ], - 106: [ - function (e, t, n) { - var r = e("./_isPrototype"), - o = e("./_nativeKeys"), - a = Object.prototype.hasOwnProperty; - t.exports = function (e) { - if (!r(e)) return o(e); - var t, - n = []; - for (t in Object(e)) a.call(e, t) && "constructor" != t && n.push(t); - return n; - }; - }, - { "./_isPrototype": 186, "./_nativeKeys": 202 }, - ], - 107: [ - function (e, t, n) { - var o = e("./isObject"), - a = e("./_isPrototype"), - i = e("./_nativeKeysIn"), - s = Object.prototype.hasOwnProperty; - t.exports = function (e) { - if (!o(e)) return i(e); - var t, - n = a(e), - r = []; - for (t in e) ("constructor" != t || (!n && s.call(e, t))) && r.push(t); - return r; - }; - }, - { "./_isPrototype": 186, "./_nativeKeysIn": 203, "./isObject": 251 }, - ], - 108: [ - function (e, t, n) { - t.exports = function (e, t) { - return e < t; - }; - }, - {}, - ], - 109: [ - function (e, t, n) { - var i = e("./_baseEach"), - s = e("./isArrayLike"); - t.exports = function (e, r) { - var o = -1, - a = s(e) ? Array(e.length) : []; - return ( - i(e, function (e, t, n) { - a[++o] = r(e, t, n); - }), - a - ); - }; - }, - { "./_baseEach": 82, "./isArrayLike": 244 }, - ], - 110: [ - function (e, t, n) { - var r = e("./_baseIsMatch"), - o = e("./_getMatchData"), - a = e("./_matchesStrictComparable"); - t.exports = function (t) { - var n = o(t); - return 1 == n.length && n[0][2] - ? a(n[0][0], n[0][1]) - : function (e) { - return e === t || r(e, t, n); - }; - }; - }, - { - "./_baseIsMatch": 100, - "./_getMatchData": 162, - "./_matchesStrictComparable": 199, - }, - ], - 111: [ - function (e, t, n) { - var o = e("./_baseIsEqual"), - a = e("./get"), - i = e("./hasIn"), - s = e("./_isKey"), - u = e("./_isStrictComparable"), - c = e("./_matchesStrictComparable"), - f = e("./_toKey"); - t.exports = function (n, r) { - return s(n) && u(r) - ? c(f(n), r) - : function (e) { - var t = a(e, n); - return void 0 === t && t === r ? i(e, n) : o(r, t, 3); - }; - }; - }, - { - "./_baseIsEqual": 97, - "./_isKey": 183, - "./_isStrictComparable": 187, - "./_matchesStrictComparable": 199, - "./_toKey": 223, - "./get": 238, - "./hasIn": 240, - }, - ], - 112: [ - function (e, t, n) { - var c = e("./_Stack"), - f = e("./_assignMergeValue"), - d = e("./_baseFor"), - h = e("./_baseMergeDeep"), - l = e("./isObject"), - p = e("./keysIn"), - _ = e("./_safeGet"); - t.exports = function r(o, a, i, s, u) { - o !== a && - d( - a, - function (e, t) { - var n; - (u = u || new c()), - l(e) - ? h(o, a, t, i, r, s, u) - : (void 0 === (n = s ? s(_(o, t), e, t + "", o, a, u) : void 0) && - (n = e), - f(o, t, n)); - }, - p - ); - }; - }, - { - "./_Stack": 59, - "./_assignMergeValue": 74, - "./_baseFor": 87, - "./_baseMergeDeep": 113, - "./_safeGet": 209, - "./isObject": 251, - "./keysIn": 260, - }, - ], - 113: [ - function (e, t, n) { - var l = e("./_assignMergeValue"), - p = e("./_cloneBuffer"), - _ = e("./_cloneTypedArray"), - v = e("./_copyArray"), - g = e("./_initCloneObject"), - y = e("./isArguments"), - b = e("./isArray"), - m = e("./isArrayLikeObject"), - x = e("./isBuffer"), - w = e("./isFunction"), - E = e("./isObject"), - j = e("./isPlainObject"), - k = e("./isTypedArray"), - A = e("./_safeGet"), - O = e("./toPlainObject"); - t.exports = function (e, t, n, r, o, a, i) { - var s, - u, - c, - f = A(e, n), - d = A(t, n), - h = i.get(d); - h - ? l(e, n, h) - : ((s = void 0 === (c = a ? a(f, d, n + "", e, t, i) : void 0)) && - ((h = !(u = b(d)) && x(d)), - (t = !u && !h && k(d)), - (c = d), - u || h || t - ? (c = b(f) - ? f - : m(f) - ? v(f) - : h - ? p(d, !(s = !1)) - : t - ? _(d, !(s = !1)) - : []) - : j(d) || y(d) - ? y((c = f)) - ? (c = O(f)) - : (E(f) && !w(f)) || (c = g(d)) - : (s = !1)), - s && (i.set(d, c), o(c, d, r, a, i), i.delete(d)), - l(e, n, c)); - }; - }, - { - "./_assignMergeValue": 74, - "./_cloneBuffer": 135, - "./_cloneTypedArray": 139, - "./_copyArray": 142, - "./_initCloneObject": 179, - "./_safeGet": 209, - "./isArguments": 242, - "./isArray": 243, - "./isArrayLikeObject": 245, - "./isBuffer": 246, - "./isFunction": 248, - "./isObject": 251, - "./isPlainObject": 253, - "./isTypedArray": 257, - "./toPlainObject": 282, - }, - ], - 114: [ - function (e, t, n) { - var a = e("./_arrayMap"), - i = e("./_baseIteratee"), - s = e("./_baseMap"), - u = e("./_baseSortBy"), - c = e("./_baseUnary"), - f = e("./_compareMultiple"), - d = e("./identity"); - t.exports = function (e, r, n) { - var o = -1; - return ( - (r = a(r.length ? r : [d], c(i))), - (e = s(e, function (t, e, n) { - return { - criteria: a(r, function (e) { - return e(t); - }), - index: ++o, - value: t, - }; - })), - u(e, function (e, t) { - return f(e, t, n); - }) - ); - }; - }, - { - "./_arrayMap": 69, - "./_baseIteratee": 105, - "./_baseMap": 109, - "./_baseSortBy": 124, - "./_baseUnary": 127, - "./_compareMultiple": 141, - "./identity": 241, - }, - ], - 115: [ - function (e, t, n) { - var r = e("./_basePickBy"), - o = e("./hasIn"); - t.exports = function (n, e) { - return r(n, e, function (e, t) { - return o(n, t); - }); - }; - }, - { "./_basePickBy": 116, "./hasIn": 240 }, - ], - 116: [ - function (e, t, n) { - var u = e("./_baseGet"), - c = e("./_baseSet"), - f = e("./_castPath"); - t.exports = function (e, t, n) { - for (var r = -1, o = t.length, a = {}; ++r < o; ) { - var i = t[r], - s = u(e, i); - n(s, i) && c(a, f(i, e), s); - } - return a; - }; - }, - { "./_baseGet": 89, "./_baseSet": 122, "./_castPath": 133 }, - ], - 117: [ - function (e, t, n) { - t.exports = function (t) { - return function (e) { - return null == e ? void 0 : e[t]; - }; - }; - }, - {}, - ], - 118: [ - function (e, t, n) { - var r = e("./_baseGet"); - t.exports = function (t) { - return function (e) { - return r(e, t); - }; - }; - }, - { "./_baseGet": 89 }, - ], - 119: [ - function (e, t, n) { - var s = Math.ceil, - u = Math.max; - t.exports = function (e, t, n, r) { - for (var o = -1, a = u(s((t - e) / (n || 1)), 0), i = Array(a); a--; ) - (i[r ? a : ++o] = e), (e += n); - return i; - }; - }, - {}, - ], - 120: [ - function (e, t, n) { - t.exports = function (e, r, o, a, t) { - return ( - t(e, function (e, t, n) { - o = a ? ((a = !1), e) : r(o, e, t, n); - }), - o - ); - }; - }, - {}, - ], - 121: [ - function (e, t, n) { - var r = e("./identity"), - o = e("./_overRest"), - a = e("./_setToString"); - t.exports = function (e, t) { - return a(o(e, t, r), e + ""); - }; - }, - { "./_overRest": 207, "./_setToString": 213, "./identity": 241 }, - ], - 122: [ - function (e, t, n) { - var d = e("./_assignValue"), - h = e("./_castPath"), - l = e("./_isIndex"), - p = e("./isObject"), - _ = e("./_toKey"); - t.exports = function (e, t, n, r) { - if (!p(e)) return e; - for ( - var o = -1, a = (t = h(t, e)).length, i = a - 1, s = e; - null != s && ++o < a; - - ) { - var u, - c = _(t[o]), - f = n; - o != i && - ((u = s[c]), - void 0 === (f = r ? r(u, c, s) : void 0) && - (f = p(u) ? u : l(t[o + 1]) ? [] : {})), - d(s, c, f), - (s = s[c]); - } - return e; - }; - }, - { - "./_assignValue": 75, - "./_castPath": 133, - "./_isIndex": 181, - "./_toKey": 223, - "./isObject": 251, - }, - ], - 123: [ - function (e, t, n) { - var r = e("./constant"), - o = e("./_defineProperty"), - e = e("./identity"), - e = o - ? function (e, t) { - return o(e, "toString", { - configurable: !0, - enumerable: !1, - value: r(t), - writable: !0, - }); - } - : e; - t.exports = e; - }, - { "./_defineProperty": 153, "./constant": 228, "./identity": 241 }, - ], - 124: [ - function (e, t, n) { - t.exports = function (e, t) { - var n = e.length; - for (e.sort(t); n--; ) e[n] = e[n].value; - return e; - }; - }, - {}, - ], - 125: [ - function (e, t, n) { - t.exports = function (e, t) { - for (var n = -1, r = Array(e); ++n < e; ) r[n] = t(n); - return r; - }; - }, - {}, - ], - 126: [ - function (e, t, n) { - var r = e("./_Symbol"), - o = e("./_arrayMap"), - a = e("./isArray"), - i = e("./isSymbol"), - s = 1 / 0, - r = r ? r.prototype : void 0, - u = r ? r.toString : void 0; - t.exports = function e(t) { - if ("string" == typeof t) return t; - if (a(t)) return o(t, e) + ""; - if (i(t)) return u ? u.call(t) : ""; - var n = t + ""; - return "0" == n && 1 / t == -s ? "-0" : n; - }; - }, - { - "./_Symbol": 60, - "./_arrayMap": 69, - "./isArray": 243, - "./isSymbol": 256, - }, - ], - 127: [ - function (e, t, n) { - t.exports = function (t) { - return function (e) { - return t(e); - }; - }; - }, - {}, - ], - 128: [ - function (e, t, n) { - var l = e("./_SetCache"), - p = e("./_arrayIncludes"), - _ = e("./_arrayIncludesWith"), - v = e("./_cacheHas"), - g = e("./_createSet"), - y = e("./_setToArray"); - t.exports = function (e, t, n) { - var r = -1, - o = p, - a = e.length, - i = !0, - s = [], - u = s; - if (n) (i = !1), (o = _); - else if (200 <= a) { - var c = t ? null : g(e); - if (c) return y(c); - (i = !1), (o = v), (u = new l()); - } else u = t ? [] : s; - e: for (; ++r < a; ) { - var f = e[r], - d = t ? t(f) : f, - f = n || 0 !== f ? f : 0; - if (i && d == d) { - for (var h = u.length; h--; ) if (u[h] === d) continue e; - t && u.push(d), s.push(f); - } else o(u, d, n) || (u !== s && u.push(d), s.push(f)); - } - return s; - }; - }, - { - "./_SetCache": 58, - "./_arrayIncludes": 66, - "./_arrayIncludesWith": 67, - "./_cacheHas": 131, - "./_createSet": 152, - "./_setToArray": 212, - }, - ], - 129: [ - function (e, t, n) { - var r = e("./_arrayMap"); - t.exports = function (t, e) { - return r(e, function (e) { - return t[e]; - }); - }; - }, - { "./_arrayMap": 69 }, - ], - 130: [ - function (e, t, n) { - t.exports = function (e, t, n) { - for (var r = -1, o = e.length, a = t.length, i = {}; ++r < o; ) { - var s = r < a ? t[r] : void 0; - n(i, e[r], s); - } - return i; - }; - }, - {}, - ], - 131: [ - function (e, t, n) { - t.exports = function (e, t) { - return e.has(t); - }; - }, - {}, - ], - 132: [ - function (e, t, n) { - var r = e("./identity"); - t.exports = function (e) { - return "function" == typeof e ? e : r; - }; - }, - { "./identity": 241 }, - ], - 133: [ - function (e, t, n) { - var r = e("./isArray"), - o = e("./_isKey"), - a = e("./_stringToPath"), - i = e("./toString"); - t.exports = function (e, t) { - return r(e) ? e : o(e, t) ? [e] : a(i(e)); - }; - }, - { - "./_isKey": 183, - "./_stringToPath": 222, - "./isArray": 243, - "./toString": 283, - }, - ], - 134: [ - function (e, t, n) { - var r = e("./_Uint8Array"); - t.exports = function (e) { - var t = new e.constructor(e.byteLength); - return new r(t).set(new r(e)), t; - }; - }, - { "./_Uint8Array": 61 }, - ], - 135: [ - function (e, t, n) { - var r = e("./_root"), - e = "object" == typeof n && n && !n.nodeType && n, - n = e && "object" == typeof t && t && !t.nodeType && t, - r = n && n.exports === e ? r.Buffer : void 0, - o = r ? r.allocUnsafe : void 0; - t.exports = function (e, t) { - return t - ? e.slice() - : ((t = e.length), (t = o ? o(t) : new e.constructor(t)), e.copy(t), t); - }; - }, - { "./_root": 208 }, - ], - 136: [ - function (e, t, n) { - var r = e("./_cloneArrayBuffer"); - t.exports = function (e, t) { - return ( - (t = t ? r(e.buffer) : e.buffer), - new e.constructor(t, e.byteOffset, e.byteLength) - ); - }; - }, - { "./_cloneArrayBuffer": 134 }, - ], - 137: [ - function (e, t, n) { - var r = /\w*$/; - t.exports = function (e) { - var t = new e.constructor(e.source, r.exec(e)); - return (t.lastIndex = e.lastIndex), t; - }; - }, - {}, - ], - 138: [ - function (e, t, n) { - var e = e("./_Symbol"), - e = e ? e.prototype : void 0, - r = e ? e.valueOf : void 0; - t.exports = function (e) { - return r ? Object(r.call(e)) : {}; - }; - }, - { "./_Symbol": 60 }, - ], - 139: [ - function (e, t, n) { - var r = e("./_cloneArrayBuffer"); - t.exports = function (e, t) { - return ( - (t = t ? r(e.buffer) : e.buffer), - new e.constructor(t, e.byteOffset, e.length) - ); - }; - }, - { "./_cloneArrayBuffer": 134 }, - ], - 140: [ - function (e, t, n) { - var f = e("./isSymbol"); - t.exports = function (e, t) { - if (e !== t) { - var n = void 0 !== e, - r = null === e, - o = e == e, - a = f(e), - i = void 0 !== t, - s = null === t, - u = t == t, - c = f(t); - if ( - (!s && !c && !a && t < e) || - (a && i && u && !s && !c) || - (r && i && u) || - (!n && u) || - !o - ) - return 1; - if ( - (!r && !a && !c && e < t) || - (c && n && o && !r && !a) || - (s && n && o) || - (!i && o) || - !u - ) - return -1; - } - return 0; - }; - }, - { "./isSymbol": 256 }, - ], - 141: [ - function (e, t, n) { - var c = e("./_compareAscending"); - t.exports = function (e, t, n) { - for ( - var r = -1, o = e.criteria, a = t.criteria, i = o.length, s = n.length; - ++r < i; - - ) { - var u = c(o[r], a[r]); - if (u) return s <= r ? u : u * ("desc" == n[r] ? -1 : 1); - } - return e.index - t.index; - }; - }, - { "./_compareAscending": 140 }, - ], - 142: [ - function (e, t, n) { - t.exports = function (e, t) { - var n = -1, - r = e.length; - for (t = t || Array(r); ++n < r; ) t[n] = e[n]; - return t; - }; - }, - {}, - ], - 143: [ - function (e, t, n) { - var c = e("./_assignValue"), - f = e("./_baseAssignValue"); - t.exports = function (e, t, n, r) { - var o = !n; - n = n || {}; - for (var a = -1, i = t.length; ++a < i; ) { - var s = t[a], - u = r ? r(n[s], e[s], s, n, e) : void 0; - void 0 === u && (u = e[s]), (o ? f : c)(n, s, u); - } - return n; - }; - }, - { "./_assignValue": 75, "./_baseAssignValue": 79 }, - ], - 144: [ - function (e, t, n) { - var r = e("./_copyObject"), - o = e("./_getSymbols"); - t.exports = function (e, t) { - return r(e, o(e), t); - }; - }, - { "./_copyObject": 143, "./_getSymbols": 166 }, - ], - 145: [ - function (e, t, n) { - var r = e("./_copyObject"), - o = e("./_getSymbolsIn"); - t.exports = function (e, t) { - return r(e, o(e), t); - }; - }, - { "./_copyObject": 143, "./_getSymbolsIn": 167 }, - ], - 146: [ - function (e, t, n) { - e = e("./_root")["__core-js_shared__"]; - t.exports = e; - }, - { "./_root": 208 }, - ], - 147: [ - function (e, t, n) { - var r = e("./_baseRest"), - u = e("./_isIterateeCall"); - t.exports = function (s) { - return r(function (e, t) { - var n = -1, - r = t.length, - o = 1 < r ? t[r - 1] : void 0, - a = 2 < r ? t[2] : void 0, - o = 3 < s.length && "function" == typeof o ? (r--, o) : void 0; - for ( - a && u(t[0], t[1], a) && ((o = r < 3 ? void 0 : o), (r = 1)), - e = Object(e); - ++n < r; - - ) { - var i = t[n]; - i && s(e, i, n, o); - } - return e; - }); - }; - }, - { "./_baseRest": 121, "./_isIterateeCall": 182 }, - ], - 148: [ - function (e, t, n) { - var s = e("./isArrayLike"); - t.exports = function (a, i) { - return function (e, t) { - if (null == e) return e; - if (!s(e)) return a(e, t); - for ( - var n = e.length, r = i ? n : -1, o = Object(e); - (i ? r-- : ++r < n) && !1 !== t(o[r], r, o); - - ); - return e; - }; - }; - }, - { "./isArrayLike": 244 }, - ], - 149: [ - function (e, t, n) { - t.exports = function (u) { - return function (e, t, n) { - for (var r = -1, o = Object(e), a = n(e), i = a.length; i--; ) { - var s = a[u ? i : ++r]; - if (!1 === t(o[s], s, o)) break; - } - return e; - }; - }; - }, - {}, - ], - 150: [ - function (e, t, n) { - var i = e("./_baseIteratee"), - s = e("./isArrayLike"), - u = e("./keys"); - t.exports = function (a) { - return function (e, t, n) { - var r, - o = Object(e); - s(e) || - ((r = i(t, 3)), - (e = u(e)), - (t = function (e) { - return r(o[e], e, o); - })); - n = a(e, t, n); - return -1 < n ? o[r ? e[n] : n] : void 0; - }; - }; - }, - { "./_baseIteratee": 105, "./isArrayLike": 244, "./keys": 259 }, - ], - 151: [ - function (e, t, n) { - var o = e("./_baseRange"), - a = e("./_isIterateeCall"), - i = e("./toFinite"); - t.exports = function (r) { - return function (e, t, n) { - return ( - n && "number" != typeof n && a(e, t, n) && (t = n = void 0), - (e = i(e)), - void 0 === t ? ((t = e), (e = 0)) : (t = i(t)), - (n = void 0 === n ? (e < t ? 1 : -1) : i(n)), - o(e, t, n, r) - ); - }; - }; - }, - { "./_baseRange": 119, "./_isIterateeCall": 182, "./toFinite": 279 }, - ], - 152: [ - function (e, t, n) { - var r = e("./_Set"), - o = e("./noop"), - e = e("./_setToArray"), - o = - r && 1 / e(new r([, -0]))[1] == 1 / 0 - ? function (e) { - return new r(e); - } - : o; - t.exports = o; - }, - { "./_Set": 57, "./_setToArray": 212, "./noop": 269 }, - ], - 153: [ - function (e, t, n) { - var r = e("./_getNative"), - e = (function () { - try { - var e = r(Object, "defineProperty"); - return e({}, "", {}), e; - } catch (e) {} - })(); - t.exports = e; - }, - { "./_getNative": 163 }, - ], - 154: [ - function (e, t, n) { - var _ = e("./_SetCache"), - v = e("./_arraySome"), - g = e("./_cacheHas"); - t.exports = function (e, t, n, r, o, a) { - var i = 1 & n, - s = e.length, - u = t.length; - if (s != u && !(i && s < u)) return !1; - if ((u = a.get(e)) && a.get(t)) return u == t; - var c = -1, - f = !0, - d = 2 & n ? new _() : void 0; - for (a.set(e, t), a.set(t, e); ++c < s; ) { - var h, - l = e[c], - p = t[c]; - if ( - (r && (h = i ? r(p, l, c, t, e, a) : r(l, p, c, e, t, a)), void 0 !== h) - ) { - if (h) continue; - f = !1; - break; - } - if (d) { - if ( - !v(t, function (e, t) { - if (!g(d, t) && (l === e || o(l, e, n, r, a))) return d.push(t); - }) - ) { - f = !1; - break; - } - } else if (l !== p && !o(l, p, n, r, a)) { - f = !1; - break; - } - } - return a.delete(e), a.delete(t), f; - }; - }, - { "./_SetCache": 58, "./_arraySome": 72, "./_cacheHas": 131 }, - ], - 155: [ - function (e, t, n) { - var r = e("./_Symbol"), - c = e("./_Uint8Array"), - f = e("./eq"), - d = e("./_equalArrays"), - h = e("./_mapToArray"), - l = e("./_setToArray"), - r = r ? r.prototype : void 0, - p = r ? r.valueOf : void 0; - t.exports = function (e, t, n, r, o, a, i) { - switch (n) { - case "[object DataView]": - if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) - return !1; - (e = e.buffer), (t = t.buffer); - case "[object ArrayBuffer]": - return e.byteLength == t.byteLength && a(new c(e), new c(t)) ? !0 : !1; - case "[object Boolean]": - case "[object Date]": - case "[object Number]": - return f(+e, +t); - case "[object Error]": - return e.name == t.name && e.message == t.message; - case "[object RegExp]": - case "[object String]": - return e == t + ""; - case "[object Map]": - var s = h; - case "[object Set]": - var u = 1 & r, - s = s || l; - if (e.size != t.size && !u) return !1; - u = i.get(e); - if (u) return u == t; - (r |= 2), i.set(e, t); - s = d(s(e), s(t), r, o, a, i); - return i.delete(e), s; - case "[object Symbol]": - if (p) return p.call(e) == p.call(t); - } - return !1; - }; - }, - { - "./_Symbol": 60, - "./_Uint8Array": 61, - "./_equalArrays": 154, - "./_mapToArray": 198, - "./_setToArray": 212, - "./eq": 231, - }, - ], - 156: [ - function (e, t, n) { - var y = e("./_getAllKeys"), - b = Object.prototype.hasOwnProperty; - t.exports = function (e, t, n, r, o, a) { - var i = 1 & n, - s = y(e), - u = s.length; - if (u != y(t).length && !i) return !1; - for (var c = u; c--; ) { - var f = s[c]; - if (!(i ? f in t : b.call(t, f))) return !1; - } - var d = a.get(e); - if (d && a.get(t)) return d == t; - var h = !0; - a.set(e, t), a.set(t, e); - for (var l, p = i; ++c < u; ) { - var _, - v = e[(f = s[c])], - g = t[f]; - if ( - (r && (_ = i ? r(g, v, f, t, e, a) : r(v, g, f, e, t, a)), - !(void 0 === _ ? v === g || o(v, g, n, r, a) : _)) - ) { - h = !1; - break; - } - p = p || "constructor" == f; - } - return ( - !h || - p || - ((l = e.constructor) != (d = t.constructor) && - "constructor" in e && - "constructor" in t && - !( - "function" == typeof l && - l instanceof l && - "function" == typeof d && - d instanceof d - ) && - (h = !1)), - a.delete(e), - a.delete(t), - h - ); - }; - }, - { "./_getAllKeys": 159 }, - ], - 157: [ - function (e, t, n) { - var r = e("./flatten"), - o = e("./_overRest"), - a = e("./_setToString"); - t.exports = function (e) { - return a(o(e, void 0, r), e + ""); - }; - }, - { "./_overRest": 207, "./_setToString": 213, "./flatten": 235 }, - ], - 158: [ - function (e, t, n) { - (function (e) { - e = "object" == typeof e && e && e.Object === Object && e; - t.exports = e; - }.call( - this, - "undefined" != typeof global - ? global - : "undefined" != typeof self - ? self - : "undefined" != typeof window - ? window - : {} - )); - }, - {}, - ], - 159: [ - function (e, t, n) { - var r = e("./_baseGetAllKeys"), - o = e("./_getSymbols"), - a = e("./keys"); - t.exports = function (e) { - return r(e, a, o); - }; - }, - { "./_baseGetAllKeys": 90, "./_getSymbols": 166, "./keys": 259 }, - ], - 160: [ - function (e, t, n) { - var r = e("./_baseGetAllKeys"), - o = e("./_getSymbolsIn"), - a = e("./keysIn"); - t.exports = function (e) { - return r(e, a, o); - }; - }, - { "./_baseGetAllKeys": 90, "./_getSymbolsIn": 167, "./keysIn": 260 }, - ], - 161: [ - function (e, t, n) { - var r = e("./_isKeyable"); - t.exports = function (e, t) { - return ( - (e = e.__data__), r(t) ? e["string" == typeof t ? "string" : "hash"] : e.map - ); - }; - }, - { "./_isKeyable": 184 }, - ], - 162: [ - function (e, t, n) { - var a = e("./_isStrictComparable"), - i = e("./keys"); - t.exports = function (e) { - for (var t = i(e), n = t.length; n--; ) { - var r = t[n], - o = e[r]; - t[n] = [r, o, a(o)]; - } - return t; - }; - }, - { "./_isStrictComparable": 187, "./keys": 259 }, - ], - 163: [ - function (e, t, n) { - var r = e("./_baseIsNative"), - o = e("./_getValue"); - t.exports = function (e, t) { - return (t = o(e, t)), r(t) ? t : void 0; - }; - }, - { "./_baseIsNative": 102, "./_getValue": 169 }, - ], - 164: [ - function (e, t, n) { - e = e("./_overArg")(Object.getPrototypeOf, Object); - t.exports = e; - }, - { "./_overArg": 206 }, - ], - 165: [ - function (e, t, n) { - var r = e("./_Symbol"), - e = Object.prototype, - a = e.hasOwnProperty, - i = e.toString, - s = r ? r.toStringTag : void 0; - t.exports = function (e) { - var t = a.call(e, s), - n = e[s]; - try { - var r = !(e[s] = void 0); - } catch (e) {} - var o = i.call(e); - return r && (t ? (e[s] = n) : delete e[s]), o; - }; - }, - { "./_Symbol": 60 }, - ], - 166: [ - function (e, t, n) { - var r = e("./_arrayFilter"), - e = e("./stubArray"), - o = Object.prototype.propertyIsEnumerable, - a = Object.getOwnPropertySymbols, - e = a - ? function (t) { - return null == t - ? [] - : ((t = Object(t)), - r(a(t), function (e) { - return o.call(t, e); - })); - } - : e; - t.exports = e; - }, - { "./_arrayFilter": 65, "./stubArray": 277 }, - ], - 167: [ - function (e, t, n) { - var r = e("./_arrayPush"), - o = e("./_getPrototype"), - a = e("./_getSymbols"), - e = e("./stubArray"), - e = Object.getOwnPropertySymbols - ? function (e) { - for (var t = []; e; ) r(t, a(e)), (e = o(e)); - return t; - } - : e; - t.exports = e; - }, - { - "./_arrayPush": 70, - "./_getPrototype": 164, - "./_getSymbols": 166, - "./stubArray": 277, - }, - ], - 168: [ - function (e, t, n) { - var r = e("./_DataView"), - o = e("./_Map"), - a = e("./_Promise"), - i = e("./_Set"), - s = e("./_WeakMap"), - u = e("./_baseGetTag"), - c = e("./_toSource"), - f = "[object Map]", - d = "[object Promise]", - h = "[object Set]", - l = "[object WeakMap]", - p = "[object DataView]", - _ = c(r), - v = c(o), - g = c(a), - y = c(i), - b = c(s), - e = u; - ((r && e(new r(new ArrayBuffer(1))) != p) || - (o && e(new o()) != f) || - (a && e(a.resolve()) != d) || - (i && e(new i()) != h) || - (s && e(new s()) != l)) && - (e = function (e) { - var t = u(e), - e = "[object Object]" == t ? e.constructor : void 0, - e = e ? c(e) : ""; - if (e) - switch (e) { - case _: - return p; - case v: - return f; - case g: - return d; - case y: - return h; - case b: - return l; - } - return t; - }), - (t.exports = e); - }, - { - "./_DataView": 51, - "./_Map": 54, - "./_Promise": 56, - "./_Set": 57, - "./_WeakMap": 62, - "./_baseGetTag": 91, - "./_toSource": 224, - }, - ], - 169: [ - function (e, t, n) { - t.exports = function (e, t) { - return null == e ? void 0 : e[t]; - }; - }, - {}, - ], - 170: [ - function (e, t, n) { - var s = e("./_castPath"), - u = e("./isArguments"), - c = e("./isArray"), - f = e("./_isIndex"), - d = e("./isLength"), - h = e("./_toKey"); - t.exports = function (e, t, n) { - for (var r = -1, o = (t = s(t, e)).length, a = !1; ++r < o; ) { - var i = h(t[r]); - if (!(a = null != e && n(e, i))) break; - e = e[i]; - } - return a || ++r != o - ? a - : !!(o = null == e ? 0 : e.length) && d(o) && f(i, o) && (c(e) || u(e)); - }; - }, - { - "./_castPath": 133, - "./_isIndex": 181, - "./_toKey": 223, - "./isArguments": 242, - "./isArray": 243, - "./isLength": 249, - }, - ], - 171: [ - function (e, t, n) { - var r = RegExp( - "[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]" - ); - t.exports = function (e) { - return r.test(e); - }; - }, - {}, - ], - 172: [ - function (e, t, n) { - var r = e("./_nativeCreate"); - t.exports = function () { - (this.__data__ = r ? r(null) : {}), (this.size = 0); - }; - }, - { "./_nativeCreate": 201 }, - ], - 173: [ - function (e, t, n) { - t.exports = function (e) { - return ( - (e = this.has(e) && delete this.__data__[e]), (this.size -= e ? 1 : 0), e - ); - }; - }, - {}, - ], - 174: [ - function (e, t, n) { - var r = e("./_nativeCreate"), - o = Object.prototype.hasOwnProperty; - t.exports = function (e) { - var t = this.__data__; - if (r) { - var n = t[e]; - return "__lodash_hash_undefined__" === n ? void 0 : n; - } - return o.call(t, e) ? t[e] : void 0; - }; - }, - { "./_nativeCreate": 201 }, - ], - 175: [ - function (e, t, n) { - var r = e("./_nativeCreate"), - o = Object.prototype.hasOwnProperty; - t.exports = function (e) { - var t = this.__data__; - return r ? void 0 !== t[e] : o.call(t, e); - }; - }, - { "./_nativeCreate": 201 }, - ], - 176: [ - function (e, t, n) { - var r = e("./_nativeCreate"); - t.exports = function (e, t) { - var n = this.__data__; - return ( - (this.size += this.has(e) ? 0 : 1), - (n[e] = r && void 0 === t ? "__lodash_hash_undefined__" : t), - this - ); - }; - }, - { "./_nativeCreate": 201 }, - ], - 177: [ - function (e, t, n) { - var r = Object.prototype.hasOwnProperty; - t.exports = function (e) { - var t = e.length, - n = new e.constructor(t); - return ( - t && - "string" == typeof e[0] && - r.call(e, "index") && - ((n.index = e.index), (n.input = e.input)), - n - ); - }; - }, - {}, - ], - 178: [ - function (e, t, n) { - var o = e("./_cloneArrayBuffer"), - a = e("./_cloneDataView"), - i = e("./_cloneRegExp"), - s = e("./_cloneSymbol"), - u = e("./_cloneTypedArray"); - t.exports = function (e, t, n) { - var r = e.constructor; - switch (t) { - case "[object ArrayBuffer]": - return o(e); - case "[object Boolean]": - case "[object Date]": - return new r(+e); - case "[object DataView]": - return a(e, n); - case "[object Float32Array]": - case "[object Float64Array]": - case "[object Int8Array]": - case "[object Int16Array]": - case "[object Int32Array]": - case "[object Uint8Array]": - case "[object Uint8ClampedArray]": - case "[object Uint16Array]": - case "[object Uint32Array]": - return u(e, n); - case "[object Map]": - return new r(); - case "[object Number]": - case "[object String]": - return new r(e); - case "[object RegExp]": - return i(e); - case "[object Set]": - return new r(); - case "[object Symbol]": - return s(e); - } - }; - }, - { - "./_cloneArrayBuffer": 134, - "./_cloneDataView": 136, - "./_cloneRegExp": 137, - "./_cloneSymbol": 138, - "./_cloneTypedArray": 139, - }, - ], - 179: [ - function (e, t, n) { - var r = e("./_baseCreate"), - o = e("./_getPrototype"), - a = e("./_isPrototype"); - t.exports = function (e) { - return "function" != typeof e.constructor || a(e) ? {} : r(o(e)); - }; - }, - { "./_baseCreate": 81, "./_getPrototype": 164, "./_isPrototype": 186 }, - ], - 180: [ - function (e, t, n) { - var r = e("./_Symbol"), - o = e("./isArguments"), - a = e("./isArray"), - i = r ? r.isConcatSpreadable : void 0; - t.exports = function (e) { - return a(e) || o(e) || !!(i && e && e[i]); - }; - }, - { "./_Symbol": 60, "./isArguments": 242, "./isArray": 243 }, - ], - 181: [ - function (e, t, n) { - var r = /^(?:0|[1-9]\d*)$/; - t.exports = function (e, t) { - var n = typeof e; - return ( - !!(t = null == t ? 9007199254740991 : t) && - ("number" == n || ("symbol" != n && r.test(e))) && - -1 < e && - e % 1 == 0 && - e < t - ); - }; - }, - {}, - ], - 182: [ - function (e, t, n) { - var o = e("./eq"), - a = e("./isArrayLike"), - i = e("./_isIndex"), - s = e("./isObject"); - t.exports = function (e, t, n) { - if (!s(n)) return !1; - var r = typeof t; - return ( - !!("number" == r ? a(n) && i(t, n.length) : "string" == r && t in n) && - o(n[t], e) - ); - }; - }, - { - "./_isIndex": 181, - "./eq": 231, - "./isArrayLike": 244, - "./isObject": 251, - }, - ], - 183: [ - function (e, t, n) { - var r = e("./isArray"), - o = e("./isSymbol"), - a = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - i = /^\w*$/; - t.exports = function (e, t) { - if (r(e)) return !1; - var n = typeof e; - return ( - !("number" != n && "symbol" != n && "boolean" != n && null != e && !o(e)) || - i.test(e) || - !a.test(e) || - (null != t && e in Object(t)) - ); - }; - }, - { "./isArray": 243, "./isSymbol": 256 }, - ], - 184: [ - function (e, t, n) { - t.exports = function (e) { - var t = typeof e; - return "string" == t || "number" == t || "symbol" == t || "boolean" == t - ? "__proto__" !== e - : null === e; - }; - }, - {}, - ], - 185: [ - function (e, t, n) { - var e = e("./_coreJsData"), - r = (e = /[^.]+$/.exec((e && e.keys && e.keys.IE_PROTO) || "")) - ? "Symbol(src)_1." + e - : ""; - t.exports = function (e) { - return !!r && r in e; - }; - }, - { "./_coreJsData": 146 }, - ], - 186: [ - function (e, t, n) { - var r = Object.prototype; - t.exports = function (e) { - var t = e && e.constructor; - return e === (("function" == typeof t && t.prototype) || r); - }; - }, - {}, - ], - 187: [ - function (e, t, n) { - var r = e("./isObject"); - t.exports = function (e) { - return e == e && !r(e); - }; - }, - { "./isObject": 251 }, - ], - 188: [ - function (e, t, n) { - t.exports = function () { - (this.__data__ = []), (this.size = 0); - }; - }, - {}, - ], - 189: [ - function (e, t, n) { - var r = e("./_assocIndexOf"), - o = Array.prototype.splice; - t.exports = function (e) { - var t = this.__data__; - return ( - !((e = r(t, e)) < 0) && - (e == t.length - 1 ? t.pop() : o.call(t, e, 1), --this.size, !0) - ); - }; - }, - { "./_assocIndexOf": 76 }, - ], - 190: [ - function (e, t, n) { - var r = e("./_assocIndexOf"); - t.exports = function (e) { - var t = this.__data__; - return (e = r(t, e)) < 0 ? void 0 : t[e][1]; - }; - }, - { "./_assocIndexOf": 76 }, - ], - 191: [ - function (e, t, n) { - var r = e("./_assocIndexOf"); - t.exports = function (e) { - return -1 < r(this.__data__, e); - }; - }, - { "./_assocIndexOf": 76 }, - ], - 192: [ - function (e, t, n) { - var o = e("./_assocIndexOf"); - t.exports = function (e, t) { - var n = this.__data__, - r = o(n, e); - return r < 0 ? (++this.size, n.push([e, t])) : (n[r][1] = t), this; - }; - }, - { "./_assocIndexOf": 76 }, - ], - 193: [ - function (e, t, n) { - var r = e("./_Hash"), - o = e("./_ListCache"), - a = e("./_Map"); - t.exports = function () { - (this.size = 0), - (this.__data__ = { - hash: new r(), - map: new (a || o)(), - string: new r(), - }); - }; - }, - { "./_Hash": 52, "./_ListCache": 53, "./_Map": 54 }, - ], - 194: [ - function (e, t, n) { - var r = e("./_getMapData"); - t.exports = function (e) { - return (e = r(this, e).delete(e)), (this.size -= e ? 1 : 0), e; - }; - }, - { "./_getMapData": 161 }, - ], - 195: [ - function (e, t, n) { - var r = e("./_getMapData"); - t.exports = function (e) { - return r(this, e).get(e); - }; - }, - { "./_getMapData": 161 }, - ], - 196: [ - function (e, t, n) { - var r = e("./_getMapData"); - t.exports = function (e) { - return r(this, e).has(e); - }; - }, - { "./_getMapData": 161 }, - ], - 197: [ - function (e, t, n) { - var o = e("./_getMapData"); - t.exports = function (e, t) { - var n = o(this, e), - r = n.size; - return n.set(e, t), (this.size += n.size == r ? 0 : 1), this; - }; - }, - { "./_getMapData": 161 }, - ], - 198: [ - function (e, t, n) { - t.exports = function (e) { - var n = -1, - r = Array(e.size); - return ( - e.forEach(function (e, t) { - r[++n] = [t, e]; - }), - r - ); - }; - }, - {}, - ], - 199: [ - function (e, t, n) { - t.exports = function (t, n) { - return function (e) { - return null != e && e[t] === n && (void 0 !== n || t in Object(e)); - }; - }; - }, - {}, - ], - 200: [ - function (e, t, n) { - var r = e("./memoize"); - t.exports = function (e) { - var t = (e = r(e, function (e) { - return 500 === t.size && t.clear(), e; - })).cache; - return e; - }; - }, - { "./memoize": 265 }, - ], - 201: [ - function (e, t, n) { - e = e("./_getNative")(Object, "create"); - t.exports = e; - }, - { "./_getNative": 163 }, - ], - 202: [ - function (e, t, n) { - e = e("./_overArg")(Object.keys, Object); - t.exports = e; - }, - { "./_overArg": 206 }, - ], - 203: [ - function (e, t, n) { - t.exports = function (e) { - var t = []; - if (null != e) for (var n in Object(e)) t.push(n); - return t; - }; - }, - {}, - ], - 204: [ - function (e, t, n) { - var e = e("./_freeGlobal"), - n = "object" == typeof n && n && !n.nodeType && n, - r = n && "object" == typeof t && t && !t.nodeType && t, - o = r && r.exports === n && e.process, - e = (function () { - try { - var e = r && r.require && r.require("util").types; - return e ? e : o && o.binding && o.binding("util"); - } catch (e) {} - })(); - t.exports = e; - }, - { "./_freeGlobal": 158 }, - ], - 205: [ - function (e, t, n) { - var r = Object.prototype.toString; - t.exports = function (e) { - return r.call(e); - }; - }, - {}, - ], - 206: [ - function (e, t, n) { - t.exports = function (t, n) { - return function (e) { - return t(n(e)); - }; - }; - }, - {}, - ], - 207: [ - function (e, t, n) { - var u = e("./_apply"), - c = Math.max; - t.exports = function (a, i, s) { - return ( - (i = c(void 0 === i ? a.length - 1 : i, 0)), - function () { - for ( - var e = arguments, t = -1, n = c(e.length - i, 0), r = Array(n); - ++t < n; - - ) - r[t] = e[i + t]; - t = -1; - for (var o = Array(i + 1); ++t < i; ) o[t] = e[t]; - return (o[i] = s(r)), u(a, this, o); - } - ); - }; - }, - { "./_apply": 63 }, - ], - 208: [ - function (e, t, n) { - var r = e("./_freeGlobal"), - e = "object" == typeof self && self && self.Object === Object && self, - e = r || e || Function("return this")(); - t.exports = e; - }, - { "./_freeGlobal": 158 }, - ], - 209: [ - function (e, t, n) { - t.exports = function (e, t) { - if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) - return e[t]; - }; - }, - {}, - ], - 210: [ - function (e, t, n) { - t.exports = function (e) { - return this.__data__.set(e, "__lodash_hash_undefined__"), this; - }; - }, - {}, - ], - 211: [ - function (e, t, n) { - t.exports = function (e) { - return this.__data__.has(e); - }; - }, - {}, - ], - 212: [ - function (e, t, n) { - t.exports = function (e) { - var t = -1, - n = Array(e.size); - return ( - e.forEach(function (e) { - n[++t] = e; - }), - n - ); - }; - }, - {}, - ], - 213: [ - function (e, t, n) { - var r = e("./_baseSetToString"), - r = e("./_shortOut")(r); - t.exports = r; - }, - { "./_baseSetToString": 123, "./_shortOut": 214 }, - ], - 214: [ - function (e, t, n) { - var a = Date.now; - t.exports = function (n) { - var r = 0, - o = 0; - return function () { - var e = a(), - t = 16 - (e - o); - if (((o = e), 0 < t)) { - if (800 <= ++r) return arguments[0]; - } else r = 0; - return n.apply(void 0, arguments); - }; - }; - }, - {}, - ], - 215: [ - function (e, t, n) { - var r = e("./_ListCache"); - t.exports = function () { - (this.__data__ = new r()), (this.size = 0); - }; - }, - { "./_ListCache": 53 }, - ], - 216: [ - function (e, t, n) { - t.exports = function (e) { - var t = this.__data__, - e = t.delete(e); - return (this.size = t.size), e; - }; - }, - {}, - ], - 217: [ - function (e, t, n) { - t.exports = function (e) { - return this.__data__.get(e); - }; - }, - {}, - ], - 218: [ - function (e, t, n) { - t.exports = function (e) { - return this.__data__.has(e); - }; - }, - {}, - ], - 219: [ - function (e, t, n) { - var o = e("./_ListCache"), - a = e("./_Map"), - i = e("./_MapCache"); - t.exports = function (e, t) { - var n = this.__data__; - if (n instanceof o) { - var r = n.__data__; - if (!a || r.length < 199) - return r.push([e, t]), (this.size = ++n.size), this; - n = this.__data__ = new i(r); - } - return n.set(e, t), (this.size = n.size), this; - }; - }, - { "./_ListCache": 53, "./_Map": 54, "./_MapCache": 55 }, - ], - 220: [ - function (e, t, n) { - t.exports = function (e, t, n) { - for (var r = n - 1, o = e.length; ++r < o; ) if (e[r] === t) return r; - return -1; - }; - }, - {}, - ], - 221: [ - function (e, t, n) { - var r = e("./_asciiSize"), - o = e("./_hasUnicode"), - a = e("./_unicodeSize"); - t.exports = function (e) { - return (o(e) ? a : r)(e); - }; - }, - { "./_asciiSize": 73, "./_hasUnicode": 171, "./_unicodeSize": 225 }, - ], - 222: [ - function (e, t, n) { - var e = e("./_memoizeCapped"), - r = - /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, - a = /\\(\\)?/g, - e = e(function (e) { - var o = []; - return ( - 46 === e.charCodeAt(0) && o.push(""), - e.replace(r, function (e, t, n, r) { - o.push(n ? r.replace(a, "$1") : t || e); - }), - o - ); - }); - t.exports = e; - }, - { "./_memoizeCapped": 200 }, - ], - 223: [ - function (e, t, n) { - var r = e("./isSymbol"); - t.exports = function (e) { - if ("string" == typeof e || r(e)) return e; - var t = e + ""; - return "0" == t && 1 / e == -1 / 0 ? "-0" : t; - }; - }, - { "./isSymbol": 256 }, - ], - 224: [ - function (e, t, n) { - var r = Function.prototype.toString; - t.exports = function (e) { - if (null != e) { - try { - return r.call(e); - } catch (e) {} - try { - return e + ""; - } catch (e) {} - } - return ""; - }; - }, - {}, - ], - 225: [ - function (e, t, n) { - var r = "\\ud800-\\udfff", - o = "[" + r + "]", - a = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", - i = "\\ud83c[\\udffb-\\udfff]", - s = "[^" + r + "]", - u = "(?:\\ud83c[\\udde6-\\uddff]){2}", - c = "[\\ud800-\\udbff][\\udc00-\\udfff]", - f = "(?:" + a + "|" + i + ")" + "?", - r = "[\\ufe0e\\ufe0f]?", - f = r + f + ("(?:\\u200d(?:" + [s, u, c].join("|") + ")" + r + f + ")*"), - o = "(?:" + [s + a + "?", a, u, c, o].join("|") + ")", - d = RegExp(i + "(?=" + i + ")|" + o + f, "g"); - t.exports = function (e) { - for (var t = (d.lastIndex = 0); d.test(e); ) ++t; - return t; - }; - }, - {}, - ], - 226: [ - function (e, t, n) { - var r = e("./_baseClone"); - t.exports = function (e) { - return r(e, 4); - }; - }, - { "./_baseClone": 80 }, - ], - 227: [ - function (e, t, n) { - var r = e("./_baseClone"); - t.exports = function (e) { - return r(e, 5); - }; - }, - { "./_baseClone": 80 }, - ], - 228: [ - function (e, t, n) { - t.exports = function (e) { - return function () { - return e; - }; - }; - }, - {}, - ], - 229: [ - function (e, t, n) { - var r = e("./_baseRest"), - d = e("./eq"), - h = e("./_isIterateeCall"), - l = e("./keysIn"), - p = Object.prototype, - _ = p.hasOwnProperty, - r = r(function (e, t) { - e = Object(e); - var n = -1, - r = t.length, - o = 2 < r ? t[2] : void 0; - for (o && h(t[0], t[1], o) && (r = 1); ++n < r; ) - for (var a = t[n], i = l(a), s = -1, u = i.length; ++s < u; ) { - var c = i[s], - f = e[c]; - (void 0 === f || (d(f, p[c]) && !_.call(e, c))) && (e[c] = a[c]); - } - return e; - }); - t.exports = r; - }, - { - "./_baseRest": 121, - "./_isIterateeCall": 182, - "./eq": 231, - "./keysIn": 260, - }, - ], - 230: [ - function (e, t, n) { - t.exports = e("./forEach"); - }, - { "./forEach": 236 }, - ], - 231: [ - function (e, t, n) { - t.exports = function (e, t) { - return e === t || (e != e && t != t); - }; - }, - {}, - ], - 232: [ - function (e, t, n) { - var r = e("./_arrayFilter"), - o = e("./_baseFilter"), - a = e("./_baseIteratee"), - i = e("./isArray"); - t.exports = function (e, t) { - return (i(e) ? r : o)(e, a(t, 3)); - }; - }, - { - "./_arrayFilter": 65, - "./_baseFilter": 84, - "./_baseIteratee": 105, - "./isArray": 243, - }, - ], - 233: [ - function (e, t, n) { - e = e("./_createFind")(e("./findIndex")); - t.exports = e; - }, - { "./_createFind": 150, "./findIndex": 234 }, - ], - 234: [ - function (e, t, n) { - var o = e("./_baseFindIndex"), - a = e("./_baseIteratee"), - i = e("./toInteger"), - s = Math.max; - t.exports = function (e, t, n) { - var r = null == e ? 0 : e.length; - return r - ? ((n = null == n ? 0 : i(n)) < 0 && (n = s(r + n, 0)), o(e, a(t, 3), n)) - : -1; - }; - }, - { "./_baseFindIndex": 85, "./_baseIteratee": 105, "./toInteger": 280 }, - ], - 235: [ - function (e, t, n) { - var r = e("./_baseFlatten"); - t.exports = function (e) { - return (null == e ? 0 : e.length) ? r(e, 1) : []; - }; - }, - { "./_baseFlatten": 86 }, - ], - 236: [ - function (e, t, n) { - var r = e("./_arrayEach"), - o = e("./_baseEach"), - a = e("./_castFunction"), - i = e("./isArray"); - t.exports = function (e, t) { - return (i(e) ? r : o)(e, a(t)); - }; - }, - { - "./_arrayEach": 64, - "./_baseEach": 82, - "./_castFunction": 132, - "./isArray": 243, - }, - ], - 237: [ - function (e, t, n) { - var r = e("./_baseFor"), - o = e("./_castFunction"), - a = e("./keysIn"); - t.exports = function (e, t) { - return null == e ? e : r(e, o(t), a); - }; - }, - { "./_baseFor": 87, "./_castFunction": 132, "./keysIn": 260 }, - ], - 238: [ - function (e, t, n) { - var r = e("./_baseGet"); - t.exports = function (e, t, n) { - return void 0 === (t = null == e ? void 0 : r(e, t)) ? n : t; - }; - }, - { "./_baseGet": 89 }, - ], - 239: [ - function (e, t, n) { - var r = e("./_baseHas"), - o = e("./_hasPath"); - t.exports = function (e, t) { - return null != e && o(e, t, r); - }; - }, - { "./_baseHas": 93, "./_hasPath": 170 }, - ], - 240: [ - function (e, t, n) { - var r = e("./_baseHasIn"), - o = e("./_hasPath"); - t.exports = function (e, t) { - return null != e && o(e, t, r); - }; - }, - { "./_baseHasIn": 94, "./_hasPath": 170 }, - ], - 241: [ - function (e, t, n) { - t.exports = function (e) { - return e; - }; - }, - {}, - ], - 242: [ - function (e, t, n) { - var r = e("./_baseIsArguments"), - o = e("./isObjectLike"), - e = Object.prototype, - a = e.hasOwnProperty, - i = e.propertyIsEnumerable, - r = r( - (function () { - return arguments; - })() - ) - ? r - : function (e) { - return o(e) && a.call(e, "callee") && !i.call(e, "callee"); - }; - t.exports = r; - }, - { "./_baseIsArguments": 96, "./isObjectLike": 252 }, - ], - 243: [ - function (e, t, n) { - var r = Array.isArray; - t.exports = r; - }, - {}, - ], - 244: [ - function (e, t, n) { - var r = e("./isFunction"), - o = e("./isLength"); - t.exports = function (e) { - return null != e && o(e.length) && !r(e); - }; - }, - { "./isFunction": 248, "./isLength": 249 }, - ], - 245: [ - function (e, t, n) { - var r = e("./isArrayLike"), - o = e("./isObjectLike"); - t.exports = function (e) { - return o(e) && r(e); - }; - }, - { "./isArrayLike": 244, "./isObjectLike": 252 }, - ], - 246: [ - function (e, t, n) { - var r = e("./_root"), - o = e("./stubFalse"), - e = "object" == typeof n && n && !n.nodeType && n, - n = e && "object" == typeof t && t && !t.nodeType && t, - r = n && n.exports === e ? r.Buffer : void 0, - o = (r ? r.isBuffer : void 0) || o; - t.exports = o; - }, - { "./_root": 208, "./stubFalse": 278 }, - ], - 247: [ - function (e, t, n) { - var r = e("./_baseKeys"), - o = e("./_getTag"), - a = e("./isArguments"), - i = e("./isArray"), - s = e("./isArrayLike"), - u = e("./isBuffer"), - c = e("./_isPrototype"), - f = e("./isTypedArray"), - d = Object.prototype.hasOwnProperty; - t.exports = function (e) { - if (null == e) return !0; - if ( - s(e) && - (i(e) || - "string" == typeof e || - "function" == typeof e.splice || - u(e) || - f(e) || - a(e)) - ) - return !e.length; - var t, - n = o(e); - if ("[object Map]" == n || "[object Set]" == n) return !e.size; - if (c(e)) return !r(e).length; - for (t in e) if (d.call(e, t)) return !1; - return !0; - }; - }, - { - "./_baseKeys": 106, - "./_getTag": 168, - "./_isPrototype": 186, - "./isArguments": 242, - "./isArray": 243, - "./isArrayLike": 244, - "./isBuffer": 246, - "./isTypedArray": 257, - }, - ], - 248: [ - function (e, t, n) { - var r = e("./_baseGetTag"), - o = e("./isObject"); - t.exports = function (e) { - return ( - !!o(e) && - ("[object Function]" == (e = r(e)) || - "[object GeneratorFunction]" == e || - "[object AsyncFunction]" == e || - "[object Proxy]" == e) - ); - }; - }, - { "./_baseGetTag": 91, "./isObject": 251 }, - ], - 249: [ - function (e, t, n) { - t.exports = function (e) { - return "number" == typeof e && -1 < e && e % 1 == 0 && e <= 9007199254740991; - }; - }, - {}, - ], - 250: [ - function (e, t, n) { - var r = e("./_baseIsMap"), - o = e("./_baseUnary"), - e = e("./_nodeUtil"), - e = e && e.isMap, - r = e ? o(e) : r; - t.exports = r; - }, - { "./_baseIsMap": 99, "./_baseUnary": 127, "./_nodeUtil": 204 }, - ], - 251: [ - function (e, t, n) { - t.exports = function (e) { - var t = typeof e; - return null != e && ("object" == t || "function" == t); - }; - }, - {}, - ], - 252: [ - function (e, t, n) { - t.exports = function (e) { - return null != e && "object" == typeof e; - }; - }, - {}, - ], - 253: [ - function (e, t, n) { - var r = e("./_baseGetTag"), - o = e("./_getPrototype"), - a = e("./isObjectLike"), - i = Function.prototype, - e = Object.prototype, - s = i.toString, - u = e.hasOwnProperty, - c = s.call(Object); - t.exports = function (e) { - return ( - !(!a(e) || "[object Object]" != r(e)) && - (null === (e = o(e)) || - ("function" == typeof (e = u.call(e, "constructor") && e.constructor) && - e instanceof e && - s.call(e) == c)) - ); - }; - }, - { "./_baseGetTag": 91, "./_getPrototype": 164, "./isObjectLike": 252 }, - ], - 254: [ - function (e, t, n) { - var r = e("./_baseIsSet"), - o = e("./_baseUnary"), - e = e("./_nodeUtil"), - e = e && e.isSet, - r = e ? o(e) : r; - t.exports = r; - }, - { "./_baseIsSet": 103, "./_baseUnary": 127, "./_nodeUtil": 204 }, - ], - 255: [ - function (e, t, n) { - var r = e("./_baseGetTag"), - o = e("./isArray"), - a = e("./isObjectLike"); - t.exports = function (e) { - return "string" == typeof e || (!o(e) && a(e) && "[object String]" == r(e)); - }; - }, - { "./_baseGetTag": 91, "./isArray": 243, "./isObjectLike": 252 }, - ], - 256: [ - function (e, t, n) { - var r = e("./_baseGetTag"), - o = e("./isObjectLike"); - t.exports = function (e) { - return "symbol" == typeof e || (o(e) && "[object Symbol]" == r(e)); - }; - }, - { "./_baseGetTag": 91, "./isObjectLike": 252 }, - ], - 257: [ - function (e, t, n) { - var r = e("./_baseIsTypedArray"), - o = e("./_baseUnary"), - e = e("./_nodeUtil"), - e = e && e.isTypedArray, - r = e ? o(e) : r; - t.exports = r; - }, - { "./_baseIsTypedArray": 104, "./_baseUnary": 127, "./_nodeUtil": 204 }, - ], - 258: [ - function (e, t, n) { - t.exports = function (e) { - return void 0 === e; - }; - }, - {}, - ], - 259: [ - function (e, t, n) { - var r = e("./_arrayLikeKeys"), - o = e("./_baseKeys"), - a = e("./isArrayLike"); - t.exports = function (e) { - return (a(e) ? r : o)(e); - }; - }, - { "./_arrayLikeKeys": 68, "./_baseKeys": 106, "./isArrayLike": 244 }, - ], - 260: [ - function (e, t, n) { - var r = e("./_arrayLikeKeys"), - o = e("./_baseKeysIn"), - a = e("./isArrayLike"); - t.exports = function (e) { - return a(e) ? r(e, !0) : o(e); - }; - }, - { "./_arrayLikeKeys": 68, "./_baseKeysIn": 107, "./isArrayLike": 244 }, - ], - 261: [ - function (e, t, n) { - t.exports = function (e) { - var t = null == e ? 0 : e.length; - return t ? e[t - 1] : void 0; - }; - }, - {}, - ], - 262: [ - function (e, t, n) { - var r = e("./_arrayMap"), - o = e("./_baseIteratee"), - a = e("./_baseMap"), - i = e("./isArray"); - t.exports = function (e, t) { - return (i(e) ? r : a)(e, o(t, 3)); - }; - }, - { - "./_arrayMap": 69, - "./_baseIteratee": 105, - "./_baseMap": 109, - "./isArray": 243, - }, - ], - 263: [ - function (e, t, n) { - var a = e("./_baseAssignValue"), - i = e("./_baseForOwn"), - s = e("./_baseIteratee"); - t.exports = function (e, r) { - var o = {}; - return ( - (r = s(r, 3)), - i(e, function (e, t, n) { - a(o, t, r(e, t, n)); - }), - o - ); - }; - }, - { - "./_baseAssignValue": 79, - "./_baseForOwn": 88, - "./_baseIteratee": 105, - }, - ], - 264: [ - function (e, t, n) { - var r = e("./_baseExtremum"), - o = e("./_baseGt"), - a = e("./identity"); - t.exports = function (e) { - return e && e.length ? r(e, a, o) : void 0; - }; - }, - { "./_baseExtremum": 83, "./_baseGt": 92, "./identity": 241 }, - ], - 265: [ - function (e, t, n) { - var i = e("./_MapCache"), - s = "Expected a function"; - function u(r, o) { - if ("function" != typeof r || (null != o && "function" != typeof o)) - throw new TypeError(s); - var a = function () { - var e = arguments, - t = o ? o.apply(this, e) : e[0], - n = a.cache; - if (n.has(t)) return n.get(t); - e = r.apply(this, e); - return (a.cache = n.set(t, e) || n), e; - }; - return (a.cache = new (u.Cache || i)()), a; - } - (u.Cache = i), (t.exports = u); - }, - { "./_MapCache": 55 }, - ], - 266: [ - function (e, t, n) { - var r = e("./_baseMerge"), - e = e("./_createAssigner")(function (e, t, n) { - r(e, t, n); - }); - t.exports = e; - }, - { "./_baseMerge": 112, "./_createAssigner": 147 }, - ], - 267: [ - function (e, t, n) { - var r = e("./_baseExtremum"), - o = e("./_baseLt"), - a = e("./identity"); - t.exports = function (e) { - return e && e.length ? r(e, a, o) : void 0; - }; - }, - { "./_baseExtremum": 83, "./_baseLt": 108, "./identity": 241 }, - ], - 268: [ - function (e, t, n) { - var r = e("./_baseExtremum"), - o = e("./_baseIteratee"), - a = e("./_baseLt"); - t.exports = function (e, t) { - return e && e.length ? r(e, o(t, 2), a) : void 0; - }; - }, - { "./_baseExtremum": 83, "./_baseIteratee": 105, "./_baseLt": 108 }, - ], - 269: [ - function (e, t, n) { - t.exports = function () {}; - }, - {}, - ], - 270: [ - function (e, t, n) { - var r = e("./_root"); - t.exports = function () { - return r.Date.now(); - }; - }, - { "./_root": 208 }, - ], - 271: [ - function (e, t, n) { - var r = e("./_basePick"), - e = e("./_flatRest")(function (e, t) { - return null == e ? {} : r(e, t); - }); - t.exports = e; - }, - { "./_basePick": 115, "./_flatRest": 157 }, - ], - 272: [ - function (e, t, n) { - var r = e("./_baseProperty"), - o = e("./_basePropertyDeep"), - a = e("./_isKey"), - i = e("./_toKey"); - t.exports = function (e) { - return a(e) ? r(i(e)) : o(e); - }; - }, - { - "./_baseProperty": 117, - "./_basePropertyDeep": 118, - "./_isKey": 183, - "./_toKey": 223, - }, - ], - 273: [ - function (e, t, n) { - e = e("./_createRange")(); - t.exports = e; - }, - { "./_createRange": 151 }, - ], - 274: [ - function (e, t, n) { - var a = e("./_arrayReduce"), - i = e("./_baseEach"), - s = e("./_baseIteratee"), - u = e("./_baseReduce"), - c = e("./isArray"); - t.exports = function (e, t, n) { - var r = c(e) ? a : u, - o = arguments.length < 3; - return r(e, s(t, 4), n, o, i); - }; - }, - { - "./_arrayReduce": 71, - "./_baseEach": 82, - "./_baseIteratee": 105, - "./_baseReduce": 120, - "./isArray": 243, - }, - ], - 275: [ - function (e, t, n) { - var r = e("./_baseKeys"), - o = e("./_getTag"), - a = e("./isArrayLike"), - i = e("./isString"), - s = e("./_stringSize"); - t.exports = function (e) { - if (null == e) return 0; - if (a(e)) return i(e) ? s(e) : e.length; - var t = o(e); - return "[object Map]" == t || "[object Set]" == t ? e.size : r(e).length; - }; - }, - { - "./_baseKeys": 106, - "./_getTag": 168, - "./_stringSize": 221, - "./isArrayLike": 244, - "./isString": 255, - }, - ], - 276: [ - function (e, t, n) { - var r = e("./_baseFlatten"), - o = e("./_baseOrderBy"), - a = e("./_baseRest"), - i = e("./_isIterateeCall"), - a = a(function (e, t) { - if (null == e) return []; - var n = t.length; - return ( - 1 < n && i(e, t[0], t[1]) - ? (t = []) - : 2 < n && i(t[0], t[1], t[2]) && (t = [t[0]]), - o(e, r(t, 1), []) - ); - }); - t.exports = a; - }, - { - "./_baseFlatten": 86, - "./_baseOrderBy": 114, - "./_baseRest": 121, - "./_isIterateeCall": 182, - }, - ], - 277: [ - function (e, t, n) { - t.exports = function () { - return []; - }; - }, - {}, - ], - 278: [ - function (e, t, n) { - t.exports = function () { - return !1; - }; - }, - {}, - ], - 279: [ - function (e, t, n) { - var r = e("./toNumber"); - t.exports = function (e) { - return e - ? (e = r(e)) !== 1 / 0 && e !== -1 / 0 - ? e == e - ? e - : 0 - : 17976931348623157e292 * (e < 0 ? -1 : 1) - : 0 === e - ? e - : 0; - }; - }, - { "./toNumber": 281 }, - ], - 280: [ - function (e, t, n) { - var r = e("./toFinite"); - t.exports = function (e) { - var t = r(e), - e = t % 1; - return t == t ? (e ? t - e : t) : 0; - }; - }, - { "./toFinite": 279 }, - ], - 281: [ - function (e, t, n) { - var r = e("./isObject"), - o = e("./isSymbol"), - a = /^\s+|\s+$/g, - i = /^[-+]0x[0-9a-f]+$/i, - s = /^0b[01]+$/i, - u = /^0o[0-7]+$/i, - c = parseInt; - t.exports = function (e) { - if ("number" == typeof e) return e; - if (o(e)) return NaN; - if ( - (r(e) && - ((t = "function" == typeof e.valueOf ? e.valueOf() : e), - (e = r(t) ? t + "" : t)), - "string" != typeof e) - ) - return 0 === e ? e : +e; - e = e.replace(a, ""); - var t = s.test(e); - return t || u.test(e) ? c(e.slice(2), t ? 2 : 8) : i.test(e) ? NaN : +e; - }; - }, - { "./isObject": 251, "./isSymbol": 256 }, - ], - 282: [ - function (e, t, n) { - var r = e("./_copyObject"), - o = e("./keysIn"); - t.exports = function (e) { - return r(e, o(e)); - }; - }, - { "./_copyObject": 143, "./keysIn": 260 }, - ], - 283: [ - function (e, t, n) { - var r = e("./_baseToString"); - t.exports = function (e) { - return null == e ? "" : r(e); - }; - }, - { "./_baseToString": 126 }, - ], - 284: [ - function (e, t, n) { - var i = e("./_arrayEach"), - s = e("./_baseCreate"), - u = e("./_baseForOwn"), - c = e("./_baseIteratee"), - f = e("./_getPrototype"), - d = e("./isArray"), - h = e("./isBuffer"), - l = e("./isFunction"), - p = e("./isObject"), - _ = e("./isTypedArray"); - t.exports = function (e, r, o) { - var t, - n = d(e), - a = n || h(e) || _(e); - return ( - (r = c(r, 4)), - null == o && - ((t = e && e.constructor), - (o = a ? (n ? new t() : []) : p(e) && l(t) ? s(f(e)) : {})), - (a ? i : u)(e, function (e, t, n) { - return r(o, e, t, n); - }), - o - ); - }; - }, - { - "./_arrayEach": 64, - "./_baseCreate": 81, - "./_baseForOwn": 88, - "./_baseIteratee": 105, - "./_getPrototype": 164, - "./isArray": 243, - "./isBuffer": 246, - "./isFunction": 248, - "./isObject": 251, - "./isTypedArray": 257, - }, - ], - 285: [ - function (e, t, n) { - var r = e("./_baseFlatten"), - o = e("./_baseRest"), - a = e("./_baseUniq"), - i = e("./isArrayLikeObject"), - o = o(function (e) { - return a(r(e, 1, i, !0)); - }); - t.exports = o; - }, - { - "./_baseFlatten": 86, - "./_baseRest": 121, - "./_baseUniq": 128, - "./isArrayLikeObject": 245, - }, - ], - 286: [ - function (e, t, n) { - var r = e("./toString"), - o = 0; - t.exports = function (e) { - var t = ++o; - return r(e) + t; - }; - }, - { "./toString": 283 }, - ], - 287: [ - function (e, t, n) { - var r = e("./_baseValues"), - o = e("./keys"); - t.exports = function (e) { - return null == e ? [] : r(e, o(e)); - }; - }, - { "./_baseValues": 129, "./keys": 259 }, - ], - 288: [ - function (e, t, n) { - var r = e("./_assignValue"), - o = e("./_baseZipObject"); - t.exports = function (e, t) { - return o(e || [], t || [], r); - }; - }, - { "./_assignValue": 75, "./_baseZipObject": 130 }, - ], - }, - {}, - [1] - )(1); -}); + return g.node(v).order; + } + dfs(undefined); + */}},{"../lodash":10}],14:[function(require,module,exports){var _=require("../lodash");module.exports=barycenter;function barycenter(g,movable){return _.map(movable,function(v){var inV=g.inEdges(v);if(!inV.length){return{v:v}}else{var result=_.reduce(inV,function(acc,e){var edge=g.edge(e),nodeU=g.node(e.v);return{sum:acc.sum+edge.weight*nodeU.order,weight:acc.weight+edge.weight}},{sum:0,weight:0});return{v:v,barycenter:result.sum/result.weight,weight:result.weight}}})}},{"../lodash":10}],15:[function(require,module,exports){var _=require("../lodash");var Graph=require("../graphlib").Graph;module.exports=buildLayerGraph; +/* + * Constructs a graph that can be used to sort a layer of nodes. The graph will + * contain all base and subgraph nodes from the request layer in their original + * hierarchy and any edges that are incident on these nodes and are of the type + * requested by the "relationship" parameter. + * + * Nodes from the requested rank that do not have parents are assigned a root + * node in the output graph, which is set in the root graph attribute. This + * makes it easy to walk the hierarchy of movable nodes during ordering. + * + * Pre-conditions: + * + * 1. Input graph is a DAG + * 2. Base nodes in the input graph have a rank attribute + * 3. Subgraph nodes in the input graph has minRank and maxRank attributes + * 4. Edges have an assigned weight + * + * Post-conditions: + * + * 1. Output graph has all nodes in the movable rank with preserved + * hierarchy. + * 2. Root nodes in the movable layer are made children of the node + * indicated by the root attribute of the graph. + * 3. Non-movable nodes incident on movable nodes, selected by the + * relationship parameter, are included in the graph (without hierarchy). + * 4. Edges incident on movable nodes, selected by the relationship + * parameter, are added to the output graph. + * 5. The weights for copied edges are aggregated as need, since the output + * graph is not a multi-graph. + */function buildLayerGraph(g,rank,relationship){var root=createRootNode(g),result=new Graph({compound:true}).setGraph({root:root}).setDefaultNodeLabel(function(v){return g.node(v)});_.forEach(g.nodes(),function(v){var node=g.node(v),parent=g.parent(v);if(node.rank===rank||node.minRank<=rank&&rank<=node.maxRank){result.setNode(v);result.setParent(v,parent||root); +// This assumes we have only short edges! +_.forEach(g[relationship](v),function(e){var u=e.v===v?e.w:e.v,edge=result.edge(u,v),weight=!_.isUndefined(edge)?edge.weight:0;result.setEdge(u,v,{weight:g.edge(e).weight+weight})});if(_.has(node,"minRank")){result.setNode(v,{borderLeft:node.borderLeft[rank],borderRight:node.borderRight[rank]})}}});return result}function createRootNode(g){var v;while(g.hasNode(v=_.uniqueId("_root")));return v}},{"../graphlib":7,"../lodash":10}],16:[function(require,module,exports){"use strict";var _=require("../lodash");module.exports=crossCount; +/* + * A function that takes a layering (an array of layers, each with an array of + * ordererd nodes) and a graph and returns a weighted crossing count. + * + * Pre-conditions: + * + * 1. Input graph must be simple (not a multigraph), directed, and include + * only simple edges. + * 2. Edges in the input graph must have assigned weights. + * + * Post-conditions: + * + * 1. The graph and layering matrix are left unchanged. + * + * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." + */function crossCount(g,layering){var cc=0;for(var i=1;i0){if(index%2){weightSum+=tree[index+1]}index=index-1>>1;tree[index]+=entry.weight}cc+=entry.weight*weightSum}));return cc}},{"../lodash":10}],17:[function(require,module,exports){"use strict";var _=require("../lodash");var initOrder=require("./init-order");var crossCount=require("./cross-count");var sortSubgraph=require("./sort-subgraph");var buildLayerGraph=require("./build-layer-graph");var addSubgraphConstraints=require("./add-subgraph-constraints");var Graph=require("../graphlib").Graph;var util=require("../util");module.exports=order; +/* + * Applies heuristics to minimize edge crossings in the graph and sets the best + * order solution as an order attribute on each node. + * + * Pre-conditions: + * + * 1. Graph must be DAG + * 2. Graph nodes must be objects with a "rank" attribute + * 3. Graph edges must have the "weight" attribute + * + * Post-conditions: + * + * 1. Graph nodes will have an "order" attribute based on the results of the + * algorithm. + */function order(g){var maxRank=util.maxRank(g),downLayerGraphs=buildLayerGraphs(g,_.range(1,maxRank+1),"inEdges"),upLayerGraphs=buildLayerGraphs(g,_.range(maxRank-1,-1,-1),"outEdges");var layering=initOrder(g);assignOrder(g,layering);var bestCC=Number.POSITIVE_INFINITY,best;for(var i=0,lastBest=0;lastBest<4;++i,++lastBest){sweepLayerGraphs(i%2?downLayerGraphs:upLayerGraphs,i%4>=2);layering=util.buildLayerMatrix(g);var cc=crossCount(g,layering);if(cc=vEntry.barycenter){mergeEntries(vEntry,uEntry)}}}function handleOut(vEntry){return function(wEntry){wEntry["in"].push(vEntry);if(--wEntry.indegree===0){sourceSet.push(wEntry)}}}while(sourceSet.length){var entry=sourceSet.pop();entries.push(entry);_.forEach(entry["in"].reverse(),handleIn(entry));_.forEach(entry.out,handleOut(entry))}return _.map(_.filter(entries,function(entry){return!entry.merged}),function(entry){return _.pick(entry,["vs","i","barycenter","weight"])})}function mergeEntries(target,source){var sum=0;var weight=0;if(target.weight){sum+=target.barycenter*target.weight;weight+=target.weight}if(source.weight){sum+=source.barycenter*source.weight;weight+=source.weight}target.vs=source.vs.concat(target.vs);target.barycenter=sum/weight;target.weight=weight;target.i=Math.min(source.i,target.i);source.merged=true}},{"../lodash":10}],20:[function(require,module,exports){var _=require("../lodash");var barycenter=require("./barycenter");var resolveConflicts=require("./resolve-conflicts");var sort=require("./sort");module.exports=sortSubgraph;function sortSubgraph(g,v,cg,biasRight){var movable=g.children(v);var node=g.node(v);var bl=node?node.borderLeft:undefined;var br=node?node.borderRight:undefined;var subgraphs={};if(bl){movable=_.filter(movable,function(w){return w!==bl&&w!==br})}var barycenters=barycenter(g,movable);_.forEach(barycenters,function(entry){if(g.children(entry.v).length){var subgraphResult=sortSubgraph(g,entry.v,cg,biasRight);subgraphs[entry.v]=subgraphResult;if(_.has(subgraphResult,"barycenter")){mergeBarycenters(entry,subgraphResult)}}});var entries=resolveConflicts(barycenters,cg);expandSubgraphs(entries,subgraphs);var result=sort(entries,biasRight);if(bl){result.vs=_.flatten([bl,result.vs,br],true);if(g.predecessors(bl).length){var blPred=g.node(g.predecessors(bl)[0]),brPred=g.node(g.predecessors(br)[0]);if(!_.has(result,"barycenter")){result.barycenter=0;result.weight=0}result.barycenter=(result.barycenter*result.weight+blPred.order+brPred.order)/(result.weight+2);result.weight+=2}}return result}function expandSubgraphs(entries,subgraphs){_.forEach(entries,function(entry){entry.vs=_.flatten(entry.vs.map(function(v){if(subgraphs[v]){return subgraphs[v].vs}return v}),true)})}function mergeBarycenters(target,other){if(!_.isUndefined(target.barycenter)){target.barycenter=(target.barycenter*target.weight+other.barycenter*other.weight)/(target.weight+other.weight);target.weight+=other.weight}else{target.barycenter=other.barycenter;target.weight=other.weight}}},{"../lodash":10,"./barycenter":14,"./resolve-conflicts":19,"./sort":21}],21:[function(require,module,exports){var _=require("../lodash");var util=require("../util");module.exports=sort;function sort(entries,biasRight){var parts=util.partition(entries,function(entry){return _.has(entry,"barycenter")});var sortable=parts.lhs,unsortable=_.sortBy(parts.rhs,function(entry){return-entry.i}),vs=[],sum=0,weight=0,vsIndex=0;sortable.sort(compareWithBias(!!biasRight));vsIndex=consumeUnsortable(vs,unsortable,vsIndex);_.forEach(sortable,function(entry){vsIndex+=entry.vs.length;vs.push(entry.vs);sum+=entry.barycenter*entry.weight;weight+=entry.weight;vsIndex=consumeUnsortable(vs,unsortable,vsIndex)});var result={vs:_.flatten(vs,true)};if(weight){result.barycenter=sum/weight;result.weight=weight}return result}function consumeUnsortable(vs,unsortable,index){var last;while(unsortable.length&&(last=_.last(unsortable)).i<=index){unsortable.pop();vs.push(last.vs);index++}return index}function compareWithBias(bias){return function(entryV,entryW){if(entryV.barycenterentryW.barycenter){return 1}return!bias?entryV.i-entryW.i:entryW.i-entryV.i}}},{"../lodash":10,"../util":29}],22:[function(require,module,exports){var _=require("./lodash");module.exports=parentDummyChains;function parentDummyChains(g){var postorderNums=postorder(g);_.forEach(g.graph().dummyChains,function(v){var node=g.node(v);var edgeObj=node.edgeObj;var pathData=findPath(g,postorderNums,edgeObj.v,edgeObj.w);var path=pathData.path;var lca=pathData.lca;var pathIdx=0;var pathV=path[pathIdx];var ascending=true;while(v!==edgeObj.w){node=g.node(v);if(ascending){while((pathV=path[pathIdx])!==lca&&g.node(pathV).maxRanklow||lim>postorderNums[parent].lim));lca=parent; +// Traverse from w to LCA +parent=w;while((parent=g.parent(parent))!==lca){wPath.push(parent)}return{path:vPath.concat(wPath.reverse()),lca:lca}}function postorder(g){var result={};var lim=0;function dfs(v){var low=lim;_.forEach(g.children(v),dfs);result[v]={low:low,lim:lim++}}_.forEach(g.children(),dfs);return result}},{"./lodash":10}],23:[function(require,module,exports){"use strict";var _=require("../lodash");var Graph=require("../graphlib").Graph;var util=require("../util"); +/* + * This module provides coordinate assignment based on Brandes and Köpf, "Fast + * and Simple Horizontal Coordinate Assignment." + */module.exports={positionX:positionX,findType1Conflicts:findType1Conflicts,findType2Conflicts:findType2Conflicts,addConflict:addConflict,hasConflict:hasConflict,verticalAlignment:verticalAlignment,horizontalCompaction:horizontalCompaction,alignCoordinates:alignCoordinates,findSmallestWidthAlignment:findSmallestWidthAlignment,balance:balance}; +/* + * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" + * property. A type-1 conflict is one where a non-inner segment crosses an + * inner segment. An inner segment is an edge with both incident nodes marked + * with the "dummy" property. + * + * This algorithm scans layer by layer, starting with the second, for type-1 + * conflicts between the current layer and the previous layer. For each layer + * it scans the nodes from left to right until it reaches one that is incident + * on an inner segment. It then scans predecessors to determine if they have + * edges that cross that inner segment. At the end a final scan is done for all + * nodes on the current rank to see if they cross the last visited inner + * segment. + * + * This algorithm (safely) assumes that a dummy node will only be incident on a + * single node in the layers being scanned. + */function findType1Conflicts(g,layering){var conflicts={};function visitLayer(prevLayer,layer){var +// last visited node in the previous layer that is incident on an inner +// segment. +k0=0, +// Tracks the last node in this layer scanned for crossings with a type-1 +// segment. +scanPos=0,prevLayerLength=prevLayer.length,lastNode=_.last(layer);_.forEach(layer,function(v,i){var w=findOtherInnerSegmentNode(g,v),k1=w?g.node(w).order:prevLayerLength;if(w||v===lastNode){_.forEach(layer.slice(scanPos,i+1),function(scanNode){_.forEach(g.predecessors(scanNode),function(u){var uLabel=g.node(u),uPos=uLabel.order;if((uPosnextNorthBorder)){addConflict(conflicts,u,v)}})}})}function visitLayer(north,south){var prevNorthPos=-1,nextNorthPos,southPos=0;_.forEach(south,function(v,southLookahead){if(g.node(v).dummy==="border"){var predecessors=g.predecessors(v);if(predecessors.length){nextNorthPos=g.node(predecessors[0]).order;scan(south,southPos,southLookahead,prevNorthPos,nextNorthPos);southPos=southLookahead;prevNorthPos=nextNorthPos}}scan(south,southPos,south.length,nextNorthPos,north.length)});return south}_.reduce(layering,visitLayer);return conflicts}function findOtherInnerSegmentNode(g,v){if(g.node(v).dummy){return _.find(g.predecessors(v),function(u){return g.node(u).dummy})}}function addConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}var conflictsV=conflicts[v];if(!conflictsV){conflicts[v]=conflictsV={}}conflictsV[w]=true}function hasConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}return _.has(conflicts[v],w)} +/* + * Try to align nodes into vertical "blocks" where possible. This algorithm + * attempts to align a node with one of its median neighbors. If the edge + * connecting a neighbor is a type-1 conflict then we ignore that possibility. + * If a previous node has already formed a block with a node after the node + * we're trying to form a block with, we also ignore that possibility - our + * blocks would be split in that scenario. + */function verticalAlignment(g,layering,conflicts,neighborFn){var root={},align={},pos={}; +// We cache the position here based on the layering because the graph and +// layering may be out of sync. The layering matrix is manipulated to +// generate different extreme alignments. +_.forEach(layering,function(layer){_.forEach(layer,function(v,order){root[v]=v;align[v]=v;pos[v]=order})});_.forEach(layering,function(layer){var prevIdx=-1;_.forEach(layer,function(v){var ws=neighborFn(v);if(ws.length){ws=_.sortBy(ws,function(w){return pos[w]});var mp=(ws.length-1)/2;for(var i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];if(align[v]===v&&prevIdxwLabel.lim){tailLabel=wLabel;flip=true}var candidates=_.filter(g.edges(),function(edge){return flip===isDescendant(t,t.node(edge.v),tailLabel)&&flip!==isDescendant(t,t.node(edge.w),tailLabel)});return _.minBy(candidates,function(edge){return slack(g,edge)})}function exchangeEdges(t,g,e,f){var v=e.v;var w=e.w;t.removeEdge(v,w);t.setEdge(f.v,f.w,{});initLowLimValues(t);initCutValues(t,g);updateRanks(t,g)}function updateRanks(t,g){var root=_.find(t.nodes(),function(v){return!g.node(v).parent});var vs=preorder(t,root);vs=vs.slice(1);_.forEach(vs,function(v){var parent=t.node(v).parent,edge=g.edge(v,parent),flipped=false;if(!edge){edge=g.edge(parent,v);flipped=true}g.node(v).rank=g.node(parent).rank+(flipped?edge.minlen:-edge.minlen)})} +/* + * Returns true if the edge is in the tree. + */function isTreeEdge(tree,u,v){return tree.hasEdge(u,v)} +/* + * Returns true if the specified node is descendant of the root node per the + * assigned low and lim attributes in the tree. + */function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}},{"../graphlib":7,"../lodash":10,"../util":29,"./feasible-tree":25,"./util":28}],28:[function(require,module,exports){"use strict";var _=require("../lodash");module.exports={longestPath:longestPath,slack:slack}; +/* + * Initializes ranks for the input graph using the longest path algorithm. This + * algorithm scales well and is fast in practice, it yields rather poor + * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom + * ranks wide and leaving edges longer than necessary. However, due to its + * speed, this algorithm is good for getting an initial ranking that can be fed + * into other algorithms. + * + * This algorithm does not normalize layers because it will be used by other + * algorithms in most cases. If using this algorithm directly, be sure to + * run normalize at the end. + * + * Pre-conditions: + * + * 1. Input graph is a DAG. + * 2. Input graph node labels can be assigned properties. + * + * Post-conditions: + * + * 1. Each node will be assign an (unnormalized) "rank" property. + */function longestPath(g){var visited={};function dfs(v){var label=g.node(v);if(_.has(visited,v)){return label.rank}visited[v]=true;var rank=_.min(_.map(g.outEdges(v),function(e){return dfs(e.w)-g.edge(e).minlen}));if(rank===Number.POSITIVE_INFINITY||// return value of _.map([]) for Lodash 3 +rank===undefined||// return value of _.map([]) for Lodash 4 +rank===null){// return value of _.map([null]) +rank=0}return label.rank=rank}_.forEach(g.sources(),dfs)} +/* + * Returns the amount of slack for the given edge. The slack is defined as the + * difference between the length of the edge and its minimum length. + */function slack(g,e){return g.node(e.w).rank-g.node(e.v).rank-g.edge(e).minlen}},{"../lodash":10}],29:[function(require,module,exports){ +/* eslint "no-console": off */ +"use strict";var _=require("./lodash");var Graph=require("./graphlib").Graph;module.exports={addDummyNode:addDummyNode,simplify:simplify,asNonCompoundGraph:asNonCompoundGraph,successorWeights:successorWeights,predecessorWeights:predecessorWeights,intersectRect:intersectRect,buildLayerMatrix:buildLayerMatrix,normalizeRanks:normalizeRanks,removeEmptyRanks:removeEmptyRanks,addBorderNode:addBorderNode,maxRank:maxRank,partition:partition,time:time,notime:notime}; +/* + * Adds a dummy node to the graph and return v. + */function addDummyNode(g,type,attrs,name){var v;do{v=_.uniqueId(name)}while(g.hasNode(v));attrs.dummy=type;g.setNode(v,attrs);return v} +/* + * Returns a new graph with only simple edges. Handles aggregation of data + * associated with multi-edges. + */function simplify(g){var simplified=(new Graph).setGraph(g.graph());_.forEach(g.nodes(),function(v){simplified.setNode(v,g.node(v))});_.forEach(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1};var label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})});return simplified}function asNonCompoundGraph(g){var simplified=new Graph({multigraph:g.isMultigraph()}).setGraph(g.graph());_.forEach(g.nodes(),function(v){if(!g.children(v).length){simplified.setNode(v,g.node(v))}});_.forEach(g.edges(),function(e){simplified.setEdge(e,g.edge(e))});return simplified}function successorWeights(g){var weightMap=_.map(g.nodes(),function(v){var sucs={};_.forEach(g.outEdges(v),function(e){sucs[e.w]=(sucs[e.w]||0)+g.edge(e).weight});return sucs});return _.zipObject(g.nodes(),weightMap)}function predecessorWeights(g){var weightMap=_.map(g.nodes(),function(v){var preds={};_.forEach(g.inEdges(v),function(e){preds[e.v]=(preds[e.v]||0)+g.edge(e).weight});return preds});return _.zipObject(g.nodes(),weightMap)} +/* + * Finds where a line starting at point ({x, y}) would intersect a rectangle + * ({x, y, width, height}) if it were pointing at the rectangle's center. + */function intersectRect(rect,point){var x=rect.x;var y=rect.y; +// Rectangle intersection algorithm from: +// http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes +var dx=point.x-x;var dy=point.y-y;var w=rect.width/2;var h=rect.height/2;if(!dx&&!dy){throw new Error("Not possible to find intersection inside of the rectangle")}var sx,sy;if(Math.abs(dy)*w>Math.abs(dx)*h){ +// Intersection is top or bottom of rect. +if(dy<0){h=-h}sx=h*dx/dy;sy=h}else{ +// Intersection is left or right of rect. +if(dx<0){w=-w}sx=w;sy=w*dy/dx}return{x:x+sx,y:y+sy}} +/* + * Given a DAG with each node assigned "rank" and "order" properties, this + * function will produce a matrix with the ids of each node. + */function buildLayerMatrix(g){var layering=_.map(_.range(maxRank(g)+1),function(){return[]});_.forEach(g.nodes(),function(v){var node=g.node(v);var rank=node.rank;if(!_.isUndefined(rank)){layering[rank][node.order]=v}});return layering} +/* + * Adjusts the ranks for all nodes in the graph such that all nodes v have + * rank(v) >= 0 and at least one node w has rank(w) = 0. + */function normalizeRanks(g){var min=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));_.forEach(g.nodes(),function(v){var node=g.node(v);if(_.has(node,"rank")){node.rank-=min}})}function removeEmptyRanks(g){ +// Ranks may not start at 0, so we need to offset them +var offset=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));var layers=[];_.forEach(g.nodes(),function(v){var rank=g.node(v).rank-offset;if(!layers[rank]){layers[rank]=[]}layers[rank].push(v)});var delta=0;var nodeRankFactor=g.graph().nodeRankFactor;_.forEach(layers,function(vs,i){if(_.isUndefined(vs)&&i%nodeRankFactor!==0){--delta}else if(delta){_.forEach(vs,function(v){g.node(v).rank+=delta})}})}function addBorderNode(g,prefix,rank,order){var node={width:0,height:0};if(arguments.length>=4){node.rank=rank;node.order=order}return addDummyNode(g,"border",node,prefix)}function maxRank(g){return _.max(_.map(g.nodes(),function(v){var rank=g.node(v).rank;if(!_.isUndefined(rank)){return rank}}))} +/* + * Partition a collection into two groups: `lhs` and `rhs`. If the supplied + * function returns true for an entry it goes into `lhs`. Otherwise it goes + * into `rhs. + */function partition(collection,fn){var result={lhs:[],rhs:[]};_.forEach(collection,function(value){if(fn(value)){result.lhs.push(value)}else{result.rhs.push(value)}});return result} +/* + * Returns a new function that wraps `fn` with a timer. The wrapper logs the + * time it takes to execute the function. + */function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":7,"./lodash":10}],30:[function(require,module,exports){module.exports="0.8.5"},{}],31:[function(require,module,exports){ +/** + * Copyright (c) 2014, Chris Pettitt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +var lib=require("./lib");module.exports={Graph:lib.Graph,json:require("./lib/json"),alg:require("./lib/alg"),version:lib.version}},{"./lib":47,"./lib/alg":38,"./lib/json":48}],32:[function(require,module,exports){var _=require("../lodash");module.exports=components;function components(g){var visited={};var cmpts=[];var cmpt;function dfs(v){if(_.has(visited,v))return;visited[v]=true;cmpt.push(v);_.each(g.successors(v),dfs);_.each(g.predecessors(v),dfs)}_.each(g.nodes(),function(v){cmpt=[];dfs(v);if(cmpt.length){cmpts.push(cmpt)}});return cmpts}},{"../lodash":49}],33:[function(require,module,exports){var _=require("../lodash");module.exports=dfs; +/* + * A helper that preforms a pre- or post-order traversal on the input graph + * and returns the nodes in the order they were visited. If the graph is + * undirected then this algorithm will navigate using neighbors. If the graph + * is directed then this algorithm will navigate using successors. + * + * Order must be one of "pre" or "post". + */function dfs(g,vs,order){if(!_.isArray(vs)){vs=[vs]}var navigation=(g.isDirected()?g.successors:g.neighbors).bind(g);var acc=[];var visited={};_.each(vs,function(v){if(!g.hasNode(v)){throw new Error("Graph does not have node: "+v)}doDfs(g,v,order==="post",visited,navigation,acc)});return acc}function doDfs(g,v,postorder,visited,navigation,acc){if(!_.has(visited,v)){visited[v]=true;if(!postorder){acc.push(v)}_.each(navigation(v),function(w){doDfs(g,w,postorder,visited,navigation,acc)});if(postorder){acc.push(v)}}}},{"../lodash":49}],34:[function(require,module,exports){var dijkstra=require("./dijkstra");var _=require("../lodash");module.exports=dijkstraAll;function dijkstraAll(g,weightFunc,edgeFunc){return _.transform(g.nodes(),function(acc,v){acc[v]=dijkstra(g,v,weightFunc,edgeFunc)},{})}},{"../lodash":49,"./dijkstra":35}],35:[function(require,module,exports){var _=require("../lodash");var PriorityQueue=require("../data/priority-queue");module.exports=dijkstra;var DEFAULT_WEIGHT_FUNC=_.constant(1);function dijkstra(g,source,weightFn,edgeFn){return runDijkstra(g,String(source),weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runDijkstra(g,source,weightFn,edgeFn){var results={};var pq=new PriorityQueue;var v,vEntry;var updateNeighbors=function(edge){var w=edge.v!==v?edge.v:edge.w;var wEntry=results[w];var weight=weightFn(edge);var distance=vEntry.distance+weight;if(weight<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+edge+" Weight: "+weight)}if(distance0){v=pq.removeMin();vEntry=results[v];if(vEntry.distance===Number.POSITIVE_INFINITY){break}edgeFn(v).forEach(updateNeighbors)}return results}},{"../data/priority-queue":45,"../lodash":49}],36:[function(require,module,exports){var _=require("../lodash");var tarjan=require("./tarjan");module.exports=findCycles;function findCycles(g){return _.filter(tarjan(g),function(cmpt){return cmpt.length>1||cmpt.length===1&&g.hasEdge(cmpt[0],cmpt[0])})}},{"../lodash":49,"./tarjan":43}],37:[function(require,module,exports){var _=require("../lodash");module.exports=floydWarshall;var DEFAULT_WEIGHT_FUNC=_.constant(1);function floydWarshall(g,weightFn,edgeFn){return runFloydWarshall(g,weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runFloydWarshall(g,weightFn,edgeFn){var results={};var nodes=g.nodes();nodes.forEach(function(v){results[v]={};results[v][v]={distance:0};nodes.forEach(function(w){if(v!==w){results[v][w]={distance:Number.POSITIVE_INFINITY}}});edgeFn(v).forEach(function(edge){var w=edge.v===v?edge.w:edge.v;var d=weightFn(edge);results[v][w]={distance:d,predecessor:v}})});nodes.forEach(function(k){var rowK=results[k];nodes.forEach(function(i){var rowI=results[i];nodes.forEach(function(j){var ik=rowI[k];var kj=rowK[j];var ij=rowI[j];var altDistance=ik.distance+kj.distance;if(altDistance0){v=pq.removeMin();if(_.has(parents,v)){result.setEdge(v,parents[v])}else if(init){throw new Error("Input graph is not connected: "+g)}else{init=true}g.nodeEdges(v).forEach(updateNeighbors)}return result}},{"../data/priority-queue":45,"../graph":46,"../lodash":49}],43:[function(require,module,exports){var _=require("../lodash");module.exports=tarjan;function tarjan(g){var index=0;var stack=[];var visited={};// node id -> { onStack, lowlink, index } +var results=[];function dfs(v){var entry=visited[v]={onStack:true,lowlink:index,index:index++};stack.push(v);g.successors(v).forEach(function(w){if(!_.has(visited,w)){dfs(w);entry.lowlink=Math.min(entry.lowlink,visited[w].lowlink)}else if(visited[w].onStack){entry.lowlink=Math.min(entry.lowlink,visited[w].index)}});if(entry.lowlink===entry.index){var cmpt=[];var w;do{w=stack.pop();visited[w].onStack=false;cmpt.push(w)}while(v!==w);results.push(cmpt)}}g.nodes().forEach(function(v){if(!_.has(visited,v)){dfs(v)}});return results}},{"../lodash":49}],44:[function(require,module,exports){var _=require("../lodash");module.exports=topsort;topsort.CycleException=CycleException;function topsort(g){var visited={};var stack={};var results=[];function visit(node){if(_.has(stack,node)){throw new CycleException}if(!_.has(visited,node)){stack[node]=true;visited[node]=true;_.each(g.predecessors(node),visit);delete stack[node];results.push(node)}}_.each(g.sinks(),visit);if(_.size(visited)!==g.nodeCount()){throw new CycleException}return results}function CycleException(){}CycleException.prototype=new Error;// must be an instance of Error to pass testing +},{"../lodash":49}],45:[function(require,module,exports){var _=require("../lodash");module.exports=PriorityQueue; +/** + * A min-priority queue data structure. This algorithm is derived from Cormen, + * et al., "Introduction to Algorithms". The basic idea of a min-priority + * queue is that you can efficiently (in O(1) time) get the smallest key in + * the queue. Adding and removing elements takes O(log n) time. A key can + * have its priority decreased in O(log n) time. + */function PriorityQueue(){this._arr=[];this._keyIndices={}} +/** + * Returns the number of elements in the queue. Takes `O(1)` time. + */PriorityQueue.prototype.size=function(){return this._arr.length}; +/** + * Returns the keys that are in the queue. Takes `O(n)` time. + */PriorityQueue.prototype.keys=function(){return this._arr.map(function(x){return x.key})}; +/** + * Returns `true` if **key** is in the queue and `false` if not. + */PriorityQueue.prototype.has=function(key){return _.has(this._keyIndices,key)}; +/** + * Returns the priority for **key**. If **key** is not present in the queue + * then this function returns `undefined`. Takes `O(1)` time. + * + * @param {Object} key + */PriorityQueue.prototype.priority=function(key){var index=this._keyIndices[key];if(index!==undefined){return this._arr[index].priority}}; +/** + * Returns the key for the minimum element in this queue. If the queue is + * empty this function throws an Error. Takes `O(1)` time. + */PriorityQueue.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key}; +/** + * Inserts a new key into the priority queue. If the key already exists in + * the queue this function returns `false`; otherwise it will return `true`. + * Takes `O(n)` time. + * + * @param {Object} key the key to add + * @param {Number} priority the initial priority for the key + */PriorityQueue.prototype.add=function(key,priority){var keyIndices=this._keyIndices;key=String(key);if(!_.has(keyIndices,key)){var arr=this._arr;var index=arr.length;keyIndices[key]=index;arr.push({key:key,priority:priority});this._decrease(index);return true}return false}; +/** + * Removes and returns the smallest key in the queue. Takes `O(log n)` time. + */PriorityQueue.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var min=this._arr.pop();delete this._keyIndices[min.key];this._heapify(0);return min.key}; +/** + * Decreases the priority for **key** to **priority**. If the new priority is + * greater than the previous priority, this function will throw an Error. + * + * @param {Object} key the key for which to raise priority + * @param {Number} priority the new priority for the key + */PriorityQueue.prototype.decrease=function(key,priority){var index=this._keyIndices[key];if(priority>this._arr[index].priority){throw new Error("New priority is greater than current priority. "+"Key: "+key+" Old: "+this._arr[index].priority+" New: "+priority)}this._arr[index].priority=priority;this._decrease(index)};PriorityQueue.prototype._heapify=function(i){var arr=this._arr;var l=2*i;var r=l+1;var largest=i;if(l>1;if(arr[parent].priority label +this._nodes={};if(this._isCompound){ +// v -> parent +this._parent={}; +// v -> children +this._children={};this._children[GRAPH_NODE]={}} +// v -> edgeObj +this._in={}; +// u -> v -> Number +this._preds={}; +// v -> edgeObj +this._out={}; +// v -> w -> Number +this._sucs={}; +// e -> edgeObj +this._edgeObjs={}; +// e -> label +this._edgeLabels={}} +/* Number of nodes in the graph. Should only be changed by the implementation. */Graph.prototype._nodeCount=0; +/* Number of edges in the graph. Should only be changed by the implementation. */Graph.prototype._edgeCount=0; +/* === Graph functions ========= */Graph.prototype.isDirected=function(){return this._isDirected};Graph.prototype.isMultigraph=function(){return this._isMultigraph};Graph.prototype.isCompound=function(){return this._isCompound};Graph.prototype.setGraph=function(label){this._label=label;return this};Graph.prototype.graph=function(){return this._label}; +/* === Node functions ========== */Graph.prototype.setDefaultNodeLabel=function(newDefault){if(!_.isFunction(newDefault)){newDefault=_.constant(newDefault)}this._defaultNodeLabelFn=newDefault;return this};Graph.prototype.nodeCount=function(){return this._nodeCount};Graph.prototype.nodes=function(){return _.keys(this._nodes)};Graph.prototype.sources=function(){var self=this;return _.filter(this.nodes(),function(v){return _.isEmpty(self._in[v])})};Graph.prototype.sinks=function(){var self=this;return _.filter(this.nodes(),function(v){return _.isEmpty(self._out[v])})};Graph.prototype.setNodes=function(vs,value){var args=arguments;var self=this;_.each(vs,function(v){if(args.length>1){self.setNode(v,value)}else{self.setNode(v)}});return this};Graph.prototype.setNode=function(v,value){if(_.has(this._nodes,v)){if(arguments.length>1){this._nodes[v]=value}return this}this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v);if(this._isCompound){this._parent[v]=GRAPH_NODE;this._children[v]={};this._children[GRAPH_NODE][v]=true}this._in[v]={};this._preds[v]={};this._out[v]={};this._sucs[v]={};++this._nodeCount;return this};Graph.prototype.node=function(v){return this._nodes[v]};Graph.prototype.hasNode=function(v){return _.has(this._nodes,v)};Graph.prototype.removeNode=function(v){var self=this;if(_.has(this._nodes,v)){var removeEdge=function(e){self.removeEdge(self._edgeObjs[e])};delete this._nodes[v];if(this._isCompound){this._removeFromParentsChildList(v);delete this._parent[v];_.each(this.children(v),function(child){self.setParent(child)});delete this._children[v]}_.each(_.keys(this._in[v]),removeEdge);delete this._in[v];delete this._preds[v];_.each(_.keys(this._out[v]),removeEdge);delete this._out[v];delete this._sucs[v];--this._nodeCount}return this};Graph.prototype.setParent=function(v,parent){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(_.isUndefined(parent)){parent=GRAPH_NODE}else{ +// Coerce parent to string +parent+="";for(var ancestor=parent;!_.isUndefined(ancestor);ancestor=this.parent(ancestor)){if(ancestor===v){throw new Error("Setting "+parent+" as parent of "+v+" would create a cycle")}}this.setNode(parent)}this.setNode(v);this._removeFromParentsChildList(v);this._parent[v]=parent;this._children[parent][v]=true;return this};Graph.prototype._removeFromParentsChildList=function(v){delete this._children[this._parent[v]][v]};Graph.prototype.parent=function(v){if(this._isCompound){var parent=this._parent[v];if(parent!==GRAPH_NODE){return parent}}};Graph.prototype.children=function(v){if(_.isUndefined(v)){v=GRAPH_NODE}if(this._isCompound){var children=this._children[v];if(children){return _.keys(children)}}else if(v===GRAPH_NODE){return this.nodes()}else if(this.hasNode(v)){return[]}};Graph.prototype.predecessors=function(v){var predsV=this._preds[v];if(predsV){return _.keys(predsV)}};Graph.prototype.successors=function(v){var sucsV=this._sucs[v];if(sucsV){return _.keys(sucsV)}};Graph.prototype.neighbors=function(v){var preds=this.predecessors(v);if(preds){return _.union(preds,this.successors(v))}};Graph.prototype.isLeaf=function(v){var neighbors;if(this.isDirected()){neighbors=this.successors(v)}else{neighbors=this.neighbors(v)}return neighbors.length===0};Graph.prototype.filterNodes=function(filter){var copy=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});copy.setGraph(this.graph());var self=this;_.each(this._nodes,function(value,v){if(filter(v)){copy.setNode(v,value)}});_.each(this._edgeObjs,function(e){if(copy.hasNode(e.v)&©.hasNode(e.w)){copy.setEdge(e,self.edge(e))}});var parents={};function findParent(v){var parent=self.parent(v);if(parent===undefined||copy.hasNode(parent)){parents[v]=parent;return parent}else if(parent in parents){return parents[parent]}else{return findParent(parent)}}if(this._isCompound){_.each(copy.nodes(),function(v){copy.setParent(v,findParent(v))})}return copy}; +/* === Edge functions ========== */Graph.prototype.setDefaultEdgeLabel=function(newDefault){if(!_.isFunction(newDefault)){newDefault=_.constant(newDefault)}this._defaultEdgeLabelFn=newDefault;return this};Graph.prototype.edgeCount=function(){return this._edgeCount};Graph.prototype.edges=function(){return _.values(this._edgeObjs)};Graph.prototype.setPath=function(vs,value){var self=this;var args=arguments;_.reduce(vs,function(v,w){if(args.length>1){self.setEdge(v,w,value)}else{self.setEdge(v,w)}return w});return this}; +/* + * setEdge(v, w, [value, [name]]) + * setEdge({ v, w, [name] }, [value]) + */Graph.prototype.setEdge=function(){var v,w,name,value;var valueSpecified=false;var arg0=arguments[0];if(typeof arg0==="object"&&arg0!==null&&"v"in arg0){v=arg0.v;w=arg0.w;name=arg0.name;if(arguments.length===2){value=arguments[1];valueSpecified=true}}else{v=arg0;w=arguments[1];name=arguments[3];if(arguments.length>2){value=arguments[2];valueSpecified=true}}v=""+v;w=""+w;if(!_.isUndefined(name)){name=""+name}var e=edgeArgsToId(this._isDirected,v,w,name);if(_.has(this._edgeLabels,e)){if(valueSpecified){this._edgeLabels[e]=value}return this}if(!_.isUndefined(name)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")} +// It didn't exist, so we need to create it. +// First ensure the nodes exist. +this.setNode(v);this.setNode(w);this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=edgeArgsToObj(this._isDirected,v,w,name); +// Ensure we add undirected edges in a consistent way. +v=edgeObj.v;w=edgeObj.w;Object.freeze(edgeObj);this._edgeObjs[e]=edgeObj;incrementOrInitEntry(this._preds[w],v);incrementOrInitEntry(this._sucs[v],w);this._in[w][e]=edgeObj;this._out[v][e]=edgeObj;this._edgeCount++;return this};Graph.prototype.edge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]};Graph.prototype.hasEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return _.has(this._edgeLabels,e)};Graph.prototype.removeEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);var edge=this._edgeObjs[e];if(edge){v=edge.v;w=edge.w;delete this._edgeLabels[e];delete this._edgeObjs[e];decrementOrRemoveEntry(this._preds[w],v);decrementOrRemoveEntry(this._sucs[v],w);delete this._in[w][e];delete this._out[v][e];this._edgeCount--}return this};Graph.prototype.inEdges=function(v,u){var inV=this._in[v];if(inV){var edges=_.values(inV);if(!u){return edges}return _.filter(edges,function(edge){return edge.v===u})}};Graph.prototype.outEdges=function(v,w){var outV=this._out[v];if(outV){var edges=_.values(outV);if(!w){return edges}return _.filter(edges,function(edge){return edge.w===w})}};Graph.prototype.nodeEdges=function(v,w){var inEdges=this.inEdges(v,w);if(inEdges){return inEdges.concat(this.outEdges(v,w))}};function incrementOrInitEntry(map,k){if(map[k]){map[k]++}else{map[k]=1}}function decrementOrRemoveEntry(map,k){if(!--map[k]){delete map[k]}}function edgeArgsToId(isDirected,v_,w_,name){var v=""+v_;var w=""+w_;if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}return v+EDGE_KEY_DELIM+w+EDGE_KEY_DELIM+(_.isUndefined(name)?DEFAULT_EDGE_NAME:name)}function edgeArgsToObj(isDirected,v_,w_,name){var v=""+v_;var w=""+w_;if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}var edgeObj={v:v,w:w};if(name){edgeObj.name=name}return edgeObj}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}},{"./lodash":49}],47:[function(require,module,exports){ +// Includes only the "core" of graphlib +module.exports={Graph:require("./graph"),version:require("./version")}},{"./graph":46,"./version":50}],48:[function(require,module,exports){var _=require("./lodash");var Graph=require("./graph");module.exports={write:write,read:read};function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};if(!_.isUndefined(g.graph())){json.value=_.clone(g.graph())}return json}function writeNodes(g){return _.map(g.nodes(),function(v){var nodeValue=g.node(v);var parent=g.parent(v);var node={v:v};if(!_.isUndefined(nodeValue)){node.value=nodeValue}if(!_.isUndefined(parent)){node.parent=parent}return node})}function writeEdges(g){return _.map(g.edges(),function(e){var edgeValue=g.edge(e);var edge={v:e.v,w:e.w};if(!_.isUndefined(e.name)){edge.name=e.name}if(!_.isUndefined(edgeValue)){edge.value=edgeValue}return edge})}function read(json){var g=new Graph(json.options).setGraph(json.value);_.each(json.nodes,function(entry){g.setNode(entry.v,entry.value);if(entry.parent){g.setParent(entry.v,entry.parent)}});_.each(json.edges,function(entry){g.setEdge({v:entry.v,w:entry.w,name:entry.name},entry.value)});return g}},{"./graph":46,"./lodash":49}],49:[function(require,module,exports){ +/* global window */ +var lodash;if(typeof require==="function"){try{lodash={clone:require("lodash/clone"),constant:require("lodash/constant"),each:require("lodash/each"),filter:require("lodash/filter"),has:require("lodash/has"),isArray:require("lodash/isArray"),isEmpty:require("lodash/isEmpty"),isFunction:require("lodash/isFunction"),isUndefined:require("lodash/isUndefined"),keys:require("lodash/keys"),map:require("lodash/map"),reduce:require("lodash/reduce"),size:require("lodash/size"),transform:require("lodash/transform"),union:require("lodash/union"),values:require("lodash/values")}}catch(e){ +// continue regardless of error +}}if(!lodash){lodash=window._}module.exports=lodash},{"lodash/clone":226,"lodash/constant":228,"lodash/each":230,"lodash/filter":232,"lodash/has":239,"lodash/isArray":243,"lodash/isEmpty":247,"lodash/isFunction":248,"lodash/isUndefined":258,"lodash/keys":259,"lodash/map":262,"lodash/reduce":274,"lodash/size":275,"lodash/transform":284,"lodash/union":285,"lodash/values":287}],50:[function(require,module,exports){module.exports="2.1.8"},{}],51:[function(require,module,exports){var getNative=require("./_getNative"),root=require("./_root"); +/* Built-in method references that are verified to be native. */var DataView=getNative(root,"DataView");module.exports=DataView},{"./_getNative":163,"./_root":208}],52:[function(require,module,exports){var hashClear=require("./_hashClear"),hashDelete=require("./_hashDelete"),hashGet=require("./_hashGet"),hashHas=require("./_hashHas"),hashSet=require("./_hashSet"); +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */function Hash(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index-1}module.exports=arrayIncludes},{"./_baseIndexOf":95}],67:[function(require,module,exports){ +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array,value,comparator){var index=-1,length=array==null?0:array.length;while(++index0&&predicate(value)){if(depth>1){ +// Recursively flatten arrays (susceptible to call stack limits). +baseFlatten(value,depth-1,predicate,isStrict,result)}else{arrayPush(result,value)}}else if(!isStrict){result[result.length]=value}}return result}module.exports=baseFlatten},{"./_arrayPush":70,"./_isFlattenable":180}],87:[function(require,module,exports){var createBaseFor=require("./_createBaseFor"); +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */var baseFor=createBaseFor();module.exports=baseFor},{"./_createBaseFor":149}],88:[function(require,module,exports){var baseFor=require("./_baseFor"),keys=require("./keys"); +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}module.exports=baseForOwn},{"./_baseFor":87,"./keys":259}],89:[function(require,module,exports){var castPath=require("./_castPath"),toKey=require("./_toKey"); +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */function baseGet(object,path){path=castPath(path,object);var index=0,length=path.length;while(object!=null&&indexother}module.exports=baseGt},{}],93:[function(require,module,exports){ +/** Used for built-in method references. */ +var objectProto=Object.prototype; +/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty; +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */function baseHas(object,key){return object!=null&&hasOwnProperty.call(object,key)}module.exports=baseHas},{}],94:[function(require,module,exports){ +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object,key){return object!=null&&key in Object(object)}module.exports=baseHasIn},{}],95:[function(require,module,exports){var baseFindIndex=require("./_baseFindIndex"),baseIsNaN=require("./_baseIsNaN"),strictIndexOf=require("./_strictIndexOf"); +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */function baseIndexOf(array,value,fromIndex){return value===value?strictIndexOf(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}module.exports=baseIndexOf},{"./_baseFindIndex":85,"./_baseIsNaN":101,"./_strictIndexOf":220}],96:[function(require,module,exports){var baseGetTag=require("./_baseGetTag"),isObjectLike=require("./isObjectLike"); +/** `Object#toString` result references. */var argsTag="[object Arguments]"; +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}module.exports=baseIsArguments},{"./_baseGetTag":91,"./isObjectLike":252}],97:[function(require,module,exports){var baseIsEqualDeep=require("./_baseIsEqualDeep"),isObjectLike=require("./isObjectLike"); +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */function baseIsEqual(value,other,bitmask,customizer,stack){if(value===other){return true}if(value==null||other==null||!isObjectLike(value)&&!isObjectLike(other)){return value!==value&&other!==other}return baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack)}module.exports=baseIsEqual},{"./_baseIsEqualDeep":98,"./isObjectLike":252}],98:[function(require,module,exports){var Stack=require("./_Stack"),equalArrays=require("./_equalArrays"),equalByTag=require("./_equalByTag"),equalObjects=require("./_equalObjects"),getTag=require("./_getTag"),isArray=require("./isArray"),isBuffer=require("./isBuffer"),isTypedArray=require("./isTypedArray"); +/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG=1; +/** `Object#toString` result references. */var argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]"; +/** Used for built-in method references. */var objectProto=Object.prototype; +/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty; +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag;othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other)){return false}objIsArr=true;objIsObj=false}if(isSameTag&&!objIsObj){stack||(stack=new Stack);return objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack)}if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;stack||(stack=new Stack);return equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}if(!isSameTag){return false}stack||(stack=new Stack);return equalObjects(object,other,bitmask,customizer,equalFunc,stack)}module.exports=baseIsEqualDeep},{"./_Stack":59,"./_equalArrays":154,"./_equalByTag":155,"./_equalObjects":156,"./_getTag":168,"./isArray":243,"./isBuffer":246,"./isTypedArray":257}],99:[function(require,module,exports){var getTag=require("./_getTag"),isObjectLike=require("./isObjectLike"); +/** `Object#toString` result references. */var mapTag="[object Map]"; +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */function baseIsMap(value){return isObjectLike(value)&&getTag(value)==mapTag}module.exports=baseIsMap},{"./_getTag":168,"./isObjectLike":252}],100:[function(require,module,exports){var Stack=require("./_Stack"),baseIsEqual=require("./_baseIsEqual"); +/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2; +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(object==null){return!length}object=Object(object);while(index--){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object)){return false}}while(++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set){return setToArray(set)}isCommon=false;includes=cacheHas;seen=new SetCache}else{seen=iteratee?[]:result}outer:while(++indexother||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive){return 1}if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength){return result}var order=orders[index];return result*(order=="desc"?-1:1)}} +// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications +// that causes it, under certain circumstances, to provide the same value for +// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 +// for more details. +// +// This also ensures a stable sort in V8 and other engines. +// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. +return object.index-other.index}module.exports=compareMultiple},{"./_compareAscending":140}],142:[function(require,module,exports){ +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer=="function"?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1}object=Object(object);while(++index-1?iterable[iteratee?collection[index]:index]:undefined}}module.exports=createFind},{"./_baseIteratee":105,"./isArrayLike":244,"./keys":259}],151:[function(require,module,exports){var baseRange=require("./_baseRange"),isIterateeCall=require("./_isIterateeCall"),toFinite=require("./toFinite"); +/** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */function createRange(fromRight){return function(start,end,step){if(step&&typeof step!="number"&&isIterateeCall(start,end,step)){end=step=undefined} +// Ensure the sign of `-0` is preserved. +start=toFinite(start);if(end===undefined){end=start;start=0}else{end=toFinite(end)}step=step===undefined?startarrLength)){return false} +// Assume cyclic values are equal. +var stacked=stack.get(array);if(stacked&&stack.get(other)){return stacked==other}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:undefined;stack.set(array,other);stack.set(other,array); +// Ignore non-index properties. +while(++index-1&&value%1==0&&value-1}module.exports=listCacheHas},{"./_assocIndexOf":76}],192:[function(require,module,exports){var assocIndexOf=require("./_assocIndexOf"); +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value])}else{data[index][1]=value}return this}module.exports=listCacheSet},{"./_assocIndexOf":76}],193:[function(require,module,exports){var Hash=require("./_Hash"),ListCache=require("./_ListCache"),Map=require("./_Map"); +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */function mapCacheClear(){this.size=0;this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}module.exports=mapCacheClear},{"./_Hash":52,"./_ListCache":53,"./_Map":54}],194:[function(require,module,exports){var getMapData=require("./_getMapData"); +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */function mapCacheDelete(key){var result=getMapData(this,key)["delete"](key);this.size-=result?1:0;return result}module.exports=mapCacheDelete},{"./_getMapData":161}],195:[function(require,module,exports){var getMapData=require("./_getMapData"); +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */function mapCacheGet(key){return getMapData(this,key).get(key)}module.exports=mapCacheGet},{"./_getMapData":161}],196:[function(require,module,exports){var getMapData=require("./_getMapData"); +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */function mapCacheHas(key){return getMapData(this,key).has(key)}module.exports=mapCacheHas},{"./_getMapData":161}],197:[function(require,module,exports){var getMapData=require("./_getMapData"); +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this}module.exports=mapCacheSet},{"./_getMapData":161}],198:[function(require,module,exports){ +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value]});return result}module.exports=mapToArray},{}],199:[function(require,module,exports){ +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key,srcValue){return function(object){if(object==null){return false}return object[key]===srcValue&&(srcValue!==undefined||key in Object(object))}}module.exports=matchesStrictComparable},{}],200:[function(require,module,exports){var memoize=require("./memoize"); +/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE=500; +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */function memoizeCapped(func){var result=memoize(func,function(key){if(cache.size===MAX_MEMOIZE_SIZE){cache.clear()}return key});var cache=result.cache;return result}module.exports=memoizeCapped},{"./memoize":265}],201:[function(require,module,exports){var getNative=require("./_getNative"); +/* Built-in method references that are verified to be native. */var nativeCreate=getNative(Object,"create");module.exports=nativeCreate},{"./_getNative":163}],202:[function(require,module,exports){var overArg=require("./_overArg"); +/* Built-in method references for those with the same name as other `lodash` methods. */var nativeKeys=overArg(Object.keys,Object);module.exports=nativeKeys},{"./_overArg":206}],203:[function(require,module,exports){ +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object){var result=[];if(object!=null){for(var key in Object(object)){result.push(key)}}return result}module.exports=nativeKeysIn},{}],204:[function(require,module,exports){var freeGlobal=require("./_freeGlobal"); +/** Detect free variable `exports`. */var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports; +/** Detect free variable `module`. */var freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module; +/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports; +/** Detect free variable `process` from Node.js. */var freeProcess=moduleExports&&freeGlobal.process; +/** Used to access faster Node.js helpers. */var nodeUtil=function(){try{ +// Use `util.types` for Node.js 10+. +var types=freeModule&&freeModule.require&&freeModule.require("util").types;if(types){return types} +// Legacy `process.binding('util')` for Node.js < 10. +return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}();module.exports=nodeUtil},{"./_freeGlobal":158}],205:[function(require,module,exports){ +/** Used for built-in method references. */ +var objectProto=Object.prototype; +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */var nativeObjectToString=objectProto.toString; +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */function objectToString(value){return nativeObjectToString.call(value)}module.exports=objectToString},{}],206:[function(require,module,exports){ +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func,transform){return function(arg){return func(transform(arg))}}module.exports=overArg},{}],207:[function(require,module,exports){var apply=require("./_apply"); +/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax=Math.max; +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */function overRest(func,start,transform){start=nativeMax(start===undefined?func.length-1:start,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index0){if(++count>=HOT_COUNT){return arguments[0]}}else{count=0}return func.apply(undefined,arguments)}}module.exports=shortOut},{}],215:[function(require,module,exports){var ListCache=require("./_ListCache"); +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */function stackClear(){this.__data__=new ListCache;this.size=0}module.exports=stackClear},{"./_ListCache":53}],216:[function(require,module,exports){ +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key){var data=this.__data__,result=data["delete"](key);this.size=data.size;return result}module.exports=stackDelete},{}],217:[function(require,module,exports){ +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key){return this.__data__.get(key)}module.exports=stackGet},{}],218:[function(require,module,exports){ +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key){return this.__data__.has(key)}module.exports=stackHas},{}],219:[function(require,module,exports){var ListCache=require("./_ListCache"),Map=require("./_Map"),MapCache=require("./_MapCache"); +/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200; +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length true + */function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG)}module.exports=clone},{"./_baseClone":80}],227:[function(require,module,exports){var baseClone=require("./_baseClone"); +/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG=1,CLONE_SYMBOLS_FLAG=4; +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}module.exports=cloneDeep},{"./_baseClone":80}],228:[function(require,module,exports){ +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value){return function(){return value}}module.exports=constant},{}],229:[function(require,module,exports){var baseRest=require("./_baseRest"),eq=require("./eq"),isIterateeCall=require("./_isIterateeCall"),keysIn=require("./keysIn"); +/** Used for built-in method references. */var objectProto=Object.prototype; +/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty; +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */var defaults=baseRest(function(object,sources){object=Object(object);var index=-1;var length=sources.length;var guard=length>2?sources[2]:undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){length=1}while(++index true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value,other){return value===other||value!==value&&other!==other}module.exports=eq},{}],232:[function(require,module,exports){var arrayFilter=require("./_arrayFilter"),baseFilter=require("./_baseFilter"),baseIteratee=require("./_baseIteratee"),isArray=require("./isArray"); +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,baseIteratee(predicate,3))}module.exports=filter},{"./_arrayFilter":65,"./_baseFilter":84,"./_baseIteratee":105,"./isArray":243}],233:[function(require,module,exports){var createFind=require("./_createFind"),findIndex=require("./findIndex"); +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */var find=createFind(findIndex);module.exports=find},{"./_createFind":150,"./findIndex":234}],234:[function(require,module,exports){var baseFindIndex=require("./_baseFindIndex"),baseIteratee=require("./_baseIteratee"),toInteger=require("./toInteger"); +/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax=Math.max; +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */function findIndex(array,predicate,fromIndex){var length=array==null?0:array.length;if(!length){return-1}var index=fromIndex==null?0:toInteger(fromIndex);if(index<0){index=nativeMax(length+index,0)}return baseFindIndex(array,baseIteratee(predicate,3),index)}module.exports=findIndex},{"./_baseFindIndex":85,"./_baseIteratee":105,"./toInteger":280}],235:[function(require,module,exports){var baseFlatten=require("./_baseFlatten"); +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */function flatten(array){var length=array==null?0:array.length;return length?baseFlatten(array,1):[]}module.exports=flatten},{"./_baseFlatten":86}],236:[function(require,module,exports){var arrayEach=require("./_arrayEach"),baseEach=require("./_baseEach"),castFunction=require("./_castFunction"),isArray=require("./isArray"); +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,castFunction(iteratee))}module.exports=forEach},{"./_arrayEach":64,"./_baseEach":82,"./_castFunction":132,"./isArray":243}],237:[function(require,module,exports){var baseFor=require("./_baseFor"),castFunction=require("./_castFunction"),keysIn=require("./keysIn"); +/** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */function forIn(object,iteratee){return object==null?object:baseFor(object,castFunction(iteratee),keysIn)}module.exports=forIn},{"./_baseFor":87,"./_castFunction":132,"./keysIn":260}],238:[function(require,module,exports){var baseGet=require("./_baseGet"); +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,path);return result===undefined?defaultValue:result}module.exports=get},{"./_baseGet":89}],239:[function(require,module,exports){var baseHas=require("./_baseHas"),hasPath=require("./_hasPath"); +/** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */function has(object,path){return object!=null&&hasPath(object,path,baseHas)}module.exports=has},{"./_baseHas":93,"./_hasPath":170}],240:[function(require,module,exports){var baseHasIn=require("./_baseHasIn"),hasPath=require("./_hasPath"); +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */function hasIn(object,path){return object!=null&&hasPath(object,path,baseHasIn)}module.exports=hasIn},{"./_baseHasIn":94,"./_hasPath":170}],241:[function(require,module,exports){ +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value){return value}module.exports=identity},{}],242:[function(require,module,exports){var baseIsArguments=require("./_baseIsArguments"),isObjectLike=require("./isObjectLike"); +/** Used for built-in method references. */var objectProto=Object.prototype; +/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty; +/** Built-in value references. */var propertyIsEnumerable=objectProto.propertyIsEnumerable; +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")};module.exports=isArguments},{"./_baseIsArguments":96,"./isObjectLike":252}],243:[function(require,module,exports){ +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray=Array.isArray;module.exports=isArray},{}],244:[function(require,module,exports){var isFunction=require("./isFunction"),isLength=require("./isLength"); +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value)}module.exports=isArrayLike},{"./isFunction":248,"./isLength":249}],245:[function(require,module,exports){var isArrayLike=require("./isArrayLike"),isObjectLike=require("./isObjectLike"); +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}module.exports=isArrayLikeObject},{"./isArrayLike":244,"./isObjectLike":252}],246:[function(require,module,exports){var root=require("./_root"),stubFalse=require("./stubFalse"); +/** Detect free variable `exports`. */var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports; +/** Detect free variable `module`. */var freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module; +/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports; +/** Built-in value references. */var Buffer=moduleExports?root.Buffer:undefined; +/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsBuffer=Buffer?Buffer.isBuffer:undefined; +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */var isBuffer=nativeIsBuffer||stubFalse;module.exports=isBuffer},{"./_root":208,"./stubFalse":278}],247:[function(require,module,exports){var baseKeys=require("./_baseKeys"),getTag=require("./_getTag"),isArguments=require("./isArguments"),isArray=require("./isArray"),isArrayLike=require("./isArrayLike"),isBuffer=require("./isBuffer"),isPrototype=require("./_isPrototype"),isTypedArray=require("./isTypedArray"); +/** `Object#toString` result references. */var mapTag="[object Map]",setTag="[object Set]"; +/** Used for built-in method references. */var objectProto=Object.prototype; +/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty; +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */function isEmpty(value){if(value==null){return true}if(isArrayLike(value)&&(isArray(value)||typeof value=="string"||typeof value.splice=="function"||isBuffer(value)||isTypedArray(value)||isArguments(value))){return!value.length}var tag=getTag(value);if(tag==mapTag||tag==setTag){return!value.size}if(isPrototype(value)){return!baseKeys(value).length}for(var key in value){if(hasOwnProperty.call(value,key)){return false}}return true}module.exports=isEmpty},{"./_baseKeys":106,"./_getTag":168,"./_isPrototype":186,"./isArguments":242,"./isArray":243,"./isArrayLike":244,"./isBuffer":246,"./isTypedArray":257}],248:[function(require,module,exports){var baseGetTag=require("./_baseGetTag"),isObject=require("./isObject"); +/** `Object#toString` result references. */var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]"; +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */function isFunction(value){if(!isObject(value)){return false} +// The use of `Object#toString` avoids issues with the `typeof` operator +// in Safari 9 which returns 'object' for typed arrays and other constructors. +var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}module.exports=isFunction},{"./_baseGetTag":91,"./isObject":251}],249:[function(require,module,exports){ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER=9007199254740991; +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}module.exports=isLength},{}],250:[function(require,module,exports){var baseIsMap=require("./_baseIsMap"),baseUnary=require("./_baseUnary"),nodeUtil=require("./_nodeUtil"); +/* Node.js helper references. */var nodeIsMap=nodeUtil&&nodeUtil.isMap; +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */var isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap;module.exports=isMap},{"./_baseIsMap":99,"./_baseUnary":127,"./_nodeUtil":204}],251:[function(require,module,exports){ +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value){var type=typeof value;return value!=null&&(type=="object"||type=="function")}module.exports=isObject},{}],252:[function(require,module,exports){ +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value){return value!=null&&typeof value=="object"}module.exports=isObjectLike},{}],253:[function(require,module,exports){var baseGetTag=require("./_baseGetTag"),getPrototype=require("./_getPrototype"),isObjectLike=require("./isObjectLike"); +/** `Object#toString` result references. */var objectTag="[object Object]"; +/** Used for built-in method references. */var funcProto=Function.prototype,objectProto=Object.prototype; +/** Used to resolve the decompiled source of functions. */var funcToString=funcProto.toString; +/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty; +/** Used to infer the `Object` constructor. */var objectCtorString=funcToString.call(Object); +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag){return false}var proto=getPrototype(value);if(proto===null){return true}var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return typeof Ctor=="function"&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}module.exports=isPlainObject},{"./_baseGetTag":91,"./_getPrototype":164,"./isObjectLike":252}],254:[function(require,module,exports){var baseIsSet=require("./_baseIsSet"),baseUnary=require("./_baseUnary"),nodeUtil=require("./_nodeUtil"); +/* Node.js helper references. */var nodeIsSet=nodeUtil&&nodeUtil.isSet; +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */var isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet;module.exports=isSet},{"./_baseIsSet":103,"./_baseUnary":127,"./_nodeUtil":204}],255:[function(require,module,exports){var baseGetTag=require("./_baseGetTag"),isArray=require("./isArray"),isObjectLike=require("./isObjectLike"); +/** `Object#toString` result references. */var stringTag="[object String]"; +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */function isString(value){return typeof value=="string"||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}module.exports=isString},{"./_baseGetTag":91,"./isArray":243,"./isObjectLike":252}],256:[function(require,module,exports){var baseGetTag=require("./_baseGetTag"),isObjectLike=require("./isObjectLike"); +/** `Object#toString` result references. */var symbolTag="[object Symbol]"; +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */function isSymbol(value){return typeof value=="symbol"||isObjectLike(value)&&baseGetTag(value)==symbolTag}module.exports=isSymbol},{"./_baseGetTag":91,"./isObjectLike":252}],257:[function(require,module,exports){var baseIsTypedArray=require("./_baseIsTypedArray"),baseUnary=require("./_baseUnary"),nodeUtil=require("./_nodeUtil"); +/* Node.js helper references. */var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray; +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray},{"./_baseIsTypedArray":104,"./_baseUnary":127,"./_nodeUtil":204}],258:[function(require,module,exports){ +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value){return value===undefined}module.exports=isUndefined},{}],259:[function(require,module,exports){var arrayLikeKeys=require("./_arrayLikeKeys"),baseKeys=require("./_baseKeys"),isArrayLike=require("./isArrayLike"); +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}module.exports=keys},{"./_arrayLikeKeys":68,"./_baseKeys":106,"./isArrayLike":244}],260:[function(require,module,exports){var arrayLikeKeys=require("./_arrayLikeKeys"),baseKeysIn=require("./_baseKeysIn"),isArrayLike=require("./isArrayLike"); +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,true):baseKeysIn(object)}module.exports=keysIn},{"./_arrayLikeKeys":68,"./_baseKeysIn":107,"./isArrayLike":244}],261:[function(require,module,exports){ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array){var length=array==null?0:array.length;return length?array[length-1]:undefined}module.exports=last},{}],262:[function(require,module,exports){var arrayMap=require("./_arrayMap"),baseIteratee=require("./_baseIteratee"),baseMap=require("./_baseMap"),isArray=require("./isArray"); +/** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,baseIteratee(iteratee,3))}module.exports=map},{"./_arrayMap":69,"./_baseIteratee":105,"./_baseMap":109,"./isArray":243}],263:[function(require,module,exports){var baseAssignValue=require("./_baseAssignValue"),baseForOwn=require("./_baseForOwn"),baseIteratee=require("./_baseIteratee"); +/** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */function mapValues(object,iteratee){var result={};iteratee=baseIteratee(iteratee,3);baseForOwn(object,function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object))});return result}module.exports=mapValues},{"./_baseAssignValue":79,"./_baseForOwn":88,"./_baseIteratee":105}],264:[function(require,module,exports){var baseExtremum=require("./_baseExtremum"),baseGt=require("./_baseGt"),identity=require("./identity"); +/** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined}module.exports=max},{"./_baseExtremum":83,"./_baseGt":92,"./identity":241}],265:[function(require,module,exports){var MapCache=require("./_MapCache"); +/** Error message constants. */var FUNC_ERROR_TEXT="Expected a function"; +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */function memoize(func,resolver){if(typeof func!="function"||resolver!=null&&typeof resolver!="function"){throw new TypeError(FUNC_ERROR_TEXT)}var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key)}var result=func.apply(this,args);memoized.cache=cache.set(key,result)||cache;return result};memoized.cache=new(memoize.Cache||MapCache);return memoized} +// Expose `MapCache`. +memoize.Cache=MapCache;module.exports=memoize},{"./_MapCache":55}],266:[function(require,module,exports){var baseMerge=require("./_baseMerge"),createAssigner=require("./_createAssigner"); +/** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */var merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex)});module.exports=merge},{"./_baseMerge":112,"./_createAssigner":147}],267:[function(require,module,exports){var baseExtremum=require("./_baseExtremum"),baseLt=require("./_baseLt"),identity=require("./identity"); +/** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined}module.exports=min},{"./_baseExtremum":83,"./_baseLt":108,"./identity":241}],268:[function(require,module,exports){var baseExtremum=require("./_baseExtremum"),baseIteratee=require("./_baseIteratee"),baseLt=require("./_baseLt"); +/** + * This method is like `_.min` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {*} Returns the minimum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.minBy(objects, function(o) { return o.n; }); + * // => { 'n': 1 } + * + * // The `_.property` iteratee shorthand. + * _.minBy(objects, 'n'); + * // => { 'n': 1 } + */function minBy(array,iteratee){return array&&array.length?baseExtremum(array,baseIteratee(iteratee,2),baseLt):undefined}module.exports=minBy},{"./_baseExtremum":83,"./_baseIteratee":105,"./_baseLt":108}],269:[function(require,module,exports){ +/** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ +function noop(){ +// No operation performed. +}module.exports=noop},{}],270:[function(require,module,exports){var root=require("./_root"); +/** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */var now=function(){return root.Date.now()};module.exports=now},{"./_root":208}],271:[function(require,module,exports){var basePick=require("./_basePick"),flatRest=require("./_flatRest"); +/** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */var pick=flatRest(function(object,paths){return object==null?{}:basePick(object,paths)});module.exports=pick},{"./_basePick":115,"./_flatRest":157}],272:[function(require,module,exports){var baseProperty=require("./_baseProperty"),basePropertyDeep=require("./_basePropertyDeep"),isKey=require("./_isKey"),toKey=require("./_toKey"); +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}module.exports=property},{"./_baseProperty":117,"./_basePropertyDeep":118,"./_isKey":183,"./_toKey":223}],273:[function(require,module,exports){var createRange=require("./_createRange"); +/** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to, but not including, `end`. A step of `-1` is used if a negative + * `start` is specified without an `end` or `step`. If `end` is not specified, + * it's set to `start` with `start` then set to `0`. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the range of numbers. + * @see _.inRange, _.rangeRight + * @example + * + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(-4); + * // => [0, -1, -2, -3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */var range=createRange();module.exports=range},{"./_createRange":151}],274:[function(require,module,exports){var arrayReduce=require("./_arrayReduce"),baseEach=require("./_baseEach"),baseIteratee=require("./_baseIteratee"),baseReduce=require("./_baseReduce"),isArray=require("./isArray"); +/** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee,4),accumulator,initAccum,baseEach)}module.exports=reduce},{"./_arrayReduce":71,"./_baseEach":82,"./_baseIteratee":105,"./_baseReduce":120,"./isArray":243}],275:[function(require,module,exports){var baseKeys=require("./_baseKeys"),getTag=require("./_getTag"),isArrayLike=require("./isArrayLike"),isString=require("./isString"),stringSize=require("./_stringSize"); +/** `Object#toString` result references. */var mapTag="[object Map]",setTag="[object Set]"; +/** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */function size(collection){if(collection==null){return 0}if(isArrayLike(collection)){return isString(collection)?stringSize(collection):collection.length}var tag=getTag(collection);if(tag==mapTag||tag==setTag){return collection.size}return baseKeys(collection).length}module.exports=size},{"./_baseKeys":106,"./_getTag":168,"./_stringSize":221,"./isArrayLike":244,"./isString":255}],276:[function(require,module,exports){var baseFlatten=require("./_baseFlatten"),baseOrderBy=require("./_baseOrderBy"),baseRest=require("./_baseRest"),isIterateeCall=require("./_isIterateeCall"); +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */var sortBy=baseRest(function(collection,iteratees){if(collection==null){return[]}var length=iteratees.length;if(length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])){iteratees=[]}else if(length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])){iteratees=[iteratees[0]]}return baseOrderBy(collection,baseFlatten(iteratees,1),[])});module.exports=sortBy},{"./_baseFlatten":86,"./_baseOrderBy":114,"./_baseRest":121,"./_isIterateeCall":182}],277:[function(require,module,exports){ +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray(){return[]}module.exports=stubArray},{}],278:[function(require,module,exports){ +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse(){return false}module.exports=stubFalse},{}],279:[function(require,module,exports){var toNumber=require("./toNumber"); +/** Used as references for various `Number` constants. */var INFINITY=1/0,MAX_INTEGER=17976931348623157e292; +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */function toFinite(value){if(!value){return value===0?value:0}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}return value===value?value:0}module.exports=toFinite},{"./toNumber":281}],280:[function(require,module,exports){var toFinite=require("./toFinite"); +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}module.exports=toInteger},{"./toFinite":279}],281:[function(require,module,exports){var isObject=require("./isObject"),isSymbol=require("./isSymbol"); +/** Used as references for various `Number` constants. */var NAN=0/0; +/** Used to match leading and trailing whitespace. */var reTrim=/^\s+|\s+$/g; +/** Used to detect bad signed hexadecimal string values. */var reIsBadHex=/^[-+]0x[0-9a-f]+$/i; +/** Used to detect binary string values. */var reIsBinary=/^0b[01]+$/i; +/** Used to detect octal string values. */var reIsOctal=/^0o[0-7]+$/i; +/** Built-in method references without a dependency on `root`. */var freeParseInt=parseInt; +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */function toNumber(value){if(typeof value=="number"){return value}if(isSymbol(value)){return NAN}if(isObject(value)){var other=typeof value.valueOf=="function"?value.valueOf():value;value=isObject(other)?other+"":other}if(typeof value!="string"){return value===0?value:+value}value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}module.exports=toNumber},{"./isObject":251,"./isSymbol":256}],282:[function(require,module,exports){var copyObject=require("./_copyObject"),keysIn=require("./keysIn"); +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */function toPlainObject(value){return copyObject(value,keysIn(value))}module.exports=toPlainObject},{"./_copyObject":143,"./keysIn":260}],283:[function(require,module,exports){var baseToString=require("./_baseToString"); +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */function toString(value){return value==null?"":baseToString(value)}module.exports=toString},{"./_baseToString":126}],284:[function(require,module,exports){var arrayEach=require("./_arrayEach"),baseCreate=require("./_baseCreate"),baseForOwn=require("./_baseForOwn"),baseIteratee=require("./_baseIteratee"),getPrototype=require("./_getPrototype"),isArray=require("./isArray"),isBuffer=require("./isBuffer"),isFunction=require("./isFunction"),isObject=require("./isObject"),isTypedArray=require("./isTypedArray"); +/** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */function transform(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);iteratee=baseIteratee(iteratee,4);if(accumulator==null){var Ctor=object&&object.constructor;if(isArrLike){accumulator=isArr?new Ctor:[]}else if(isObject(object)){accumulator=isFunction(Ctor)?baseCreate(getPrototype(object)):{}}else{accumulator={}}}(isArrLike?arrayEach:baseForOwn)(object,function(value,index,object){return iteratee(accumulator,value,index,object)});return accumulator}module.exports=transform},{"./_arrayEach":64,"./_baseCreate":81,"./_baseForOwn":88,"./_baseIteratee":105,"./_getPrototype":164,"./isArray":243,"./isBuffer":246,"./isFunction":248,"./isObject":251,"./isTypedArray":257}],285:[function(require,module,exports){var baseFlatten=require("./_baseFlatten"),baseRest=require("./_baseRest"),baseUniq=require("./_baseUniq"),isArrayLikeObject=require("./isArrayLikeObject"); +/** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */var union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true))});module.exports=union},{"./_baseFlatten":86,"./_baseRest":121,"./_baseUniq":128,"./isArrayLikeObject":245}],286:[function(require,module,exports){var toString=require("./toString"); +/** Used to generate unique IDs. */var idCounter=0; +/** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}module.exports=uniqueId},{"./toString":283}],287:[function(require,module,exports){var baseValues=require("./_baseValues"),keys=require("./keys"); +/** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */function values(object){return object==null?[]:baseValues(object,keys(object))}module.exports=values},{"./_baseValues":129,"./keys":259}],288:[function(require,module,exports){var assignValue=require("./_assignValue"),baseZipObject=require("./_baseZipObject"); +/** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */function zipObject(props,values){return baseZipObject(props||[],values||[],assignValue)}module.exports=zipObject},{"./_assignValue":75,"./_baseZipObject":130}]},{},[1])(1)}); diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index e4543573e..b6dd281ad 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -9,7 +9,7 @@ import ( "strings" "cdr.dev/slog" - v8 "rogchap.com/v8go" + "github.com/dop251/goja" "oss.terrastruct.com/util-go/xdefer" @@ -54,11 +54,11 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) { defer xdefer.Errorf(&err, "failed to dagre layout") debugJS := false - v8ctx := v8.NewContext() - if _, err := v8ctx.RunScript(dagreJS, "dagre.js"); err != nil { + vm := goja.New() + if _, err := vm.RunString(dagreJS); err != nil { return err } - if _, err := v8ctx.RunScript(setupJS, "setup.js"); err != nil { + if _, err := vm.RunString(setupJS); err != nil { return err } @@ -80,7 +80,7 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) { rootAttrs.rankdir = "TB" } configJS := setGraphAttrs(rootAttrs) - if _, err := v8ctx.RunScript(configJS, "config.js"); err != nil { + if _, err := vm.RunString(configJS); err != nil { return err } @@ -116,11 +116,11 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) { log.Debug(ctx, "script", slog.F("all", setupJS+configJS+loadScript)) } - if _, err := v8ctx.RunScript(loadScript, "load.js"); err != nil { + if _, err := vm.RunString(loadScript); err != nil { return err } - if _, err := v8ctx.RunScript(`dagre.layout(g)`, "layout.js"); err != nil { + if _, err := vm.RunString(`dagre.layout(g)`); err != nil { if debugJS { log.Warn(ctx, "layout error", slog.F("err", err)) } @@ -128,7 +128,7 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) { } for i := range g.Objects { - val, err := v8ctx.RunScript(fmt.Sprintf("JSON.stringify(g.node(g.nodes()[%d]))", i), "value.js") + val, err := vm.RunString(fmt.Sprintf("JSON.stringify(g.node(g.nodes()[%d]))", i)) if err != nil { return err } @@ -162,7 +162,7 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) { } for i, edge := range g.Edges { - val, err := v8ctx.RunScript(fmt.Sprintf("JSON.stringify(g.edge(g.edges()[%d]))", i), "value.js") + val, err := vm.RunString(fmt.Sprintf("JSON.stringify(g.edge(g.edges()[%d]))", i)) if err != nil { return err } diff --git a/d2plugin/plugin_dagre.go b/d2plugin/plugin_dagre.go index c0285787f..228011ac0 100644 --- a/d2plugin/plugin_dagre.go +++ b/d2plugin/plugin_dagre.go @@ -1,4 +1,4 @@ -//go:build cgo && !nodagre +//go:build !nodagre package d2plugin diff --git a/go.mod b/go.mod index c77b9cbfb..beb929fa2 100644 --- a/go.mod +++ b/go.mod @@ -30,9 +30,11 @@ require ( github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect + github.com/dop251/goja v0.0.0-20221118162653-d4bf6fde1b86 // indirect github.com/fatih/color v1.13.0 // indirect github.com/gin-gonic/gin v1.7.7 // indirect github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/json-iterator/go v1.1.12 // indirect diff --git a/go.sum b/go.sum index d54b439b3..87957fe3f 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,14 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20221118162653-d4bf6fde1b86 h1:E2wycakfddWJ26v+ZyEY91Lb/HEZyaiZhbMX+KQcdmc= +github.com/dop251/goja v0.0.0-20221118162653-d4bf6fde1b86/go.mod h1:yRkwfj0CBpOGre+TwBsqPV0IH0Pk73e4PXJOeNDboGs= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= +github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -133,6 +139,8 @@ github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=