{"version":3,"file":"graph-HRUG5QTg.chunk.mjs","sources":["../node_modules/lodash-es/_baseAssign.js","../node_modules/lodash-es/_baseAssignIn.js","../node_modules/lodash-es/_copySymbols.js","../node_modules/lodash-es/_getSymbolsIn.js","../node_modules/lodash-es/_copySymbolsIn.js","../node_modules/lodash-es/_getAllKeysIn.js","../node_modules/lodash-es/_initCloneArray.js","../node_modules/lodash-es/_cloneDataView.js","../node_modules/lodash-es/_cloneRegExp.js","../node_modules/lodash-es/_cloneSymbol.js","../node_modules/lodash-es/_initCloneByTag.js","../node_modules/lodash-es/_baseIsMap.js","../node_modules/lodash-es/isMap.js","../node_modules/lodash-es/_baseIsSet.js","../node_modules/lodash-es/isSet.js","../node_modules/lodash-es/_baseClone.js","../node_modules/lodash-es/_baseValues.js","../node_modules/lodash-es/values.js","../node_modules/lodash-es/isUndefined.js","../node_modules/lodash-es/union.js","../node_modules/dagre-d3-es/src/graphlib/graph.js"],"sourcesContent":["import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n  return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n  return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n  return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n  var result = [];\n  while (object) {\n    arrayPush(result, getSymbols(object));\n    object = getPrototype(object);\n  }\n  return result;\n};\n\nexport default getSymbolsIn;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n  return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n  return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n  var length = array.length,\n      result = new array.constructor(length);\n\n  // Add properties assigned by `RegExp#exec`.\n  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n    result.index = array.index;\n    result.input = array.input;\n  }\n  return result;\n}\n\nexport default initCloneArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n  result.lastIndex = regexp.lastIndex;\n  return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n  var Ctor = object.constructor;\n  switch (tag) {\n    case arrayBufferTag:\n      return cloneArrayBuffer(object);\n\n    case boolTag:\n    case dateTag:\n      return new Ctor(+object);\n\n    case dataViewTag:\n      return cloneDataView(object, isDeep);\n\n    case float32Tag: case float64Tag:\n    case int8Tag: case int16Tag: case int32Tag:\n    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n      return cloneTypedArray(object, isDeep);\n\n    case mapTag:\n      return new Ctor;\n\n    case numberTag:\n    case stringTag:\n      return new Ctor(object);\n\n    case regexpTag:\n      return cloneRegExp(object);\n\n    case setTag:\n      return new Ctor;\n\n    case symbolTag:\n      return cloneSymbol(object);\n  }\n}\n\nexport default initCloneByTag;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n  return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n  return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_FLAT_FLAG = 2,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n *  1 - Deep clone\n *  2 - Flatten inherited properties\n *  4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n  var result,\n      isDeep = bitmask & CLONE_DEEP_FLAG,\n      isFlat = bitmask & CLONE_FLAT_FLAG,\n      isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n  if (customizer) {\n    result = object ? customizer(value, key, object, stack) : customizer(value);\n  }\n  if (result !== undefined) {\n    return result;\n  }\n  if (!isObject(value)) {\n    return value;\n  }\n  var isArr = isArray(value);\n  if (isArr) {\n    result = initCloneArray(value);\n    if (!isDeep) {\n      return copyArray(value, result);\n    }\n  } else {\n    var tag = getTag(value),\n        isFunc = tag == funcTag || tag == genTag;\n\n    if (isBuffer(value)) {\n      return cloneBuffer(value, isDeep);\n    }\n    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n      result = (isFlat || isFunc) ? {} : initCloneObject(value);\n      if (!isDeep) {\n        return isFlat\n          ? copySymbolsIn(value, baseAssignIn(result, value))\n          : copySymbols(value, baseAssign(result, value));\n      }\n    } else {\n      if (!cloneableTags[tag]) {\n        return object ? value : {};\n      }\n      result = initCloneByTag(value, tag, isDeep);\n    }\n  }\n  // Check for circular references and return its corresponding clone.\n  stack || (stack = new Stack);\n  var stacked = stack.get(value);\n  if (stacked) {\n    return stacked;\n  }\n  stack.set(value, result);\n\n  if (isSet(value)) {\n    value.forEach(function(subValue) {\n      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n    });\n  } else if (isMap(value)) {\n    value.forEach(function(subValue, key) {\n      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n    });\n  }\n\n  var keysFunc = isFull\n    ? (isFlat ? getAllKeysIn : getAllKeys)\n    : (isFlat ? keysIn : keys);\n\n  var props = isArr ? undefined : keysFunc(value);\n  arrayEach(props || value, function(subValue, key) {\n    if (props) {\n      key = subValue;\n      subValue = value[key];\n    }\n    // Recursively populate clone (susceptible to call stack limits).\n    assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n  });\n  return result;\n}\n\nexport default baseClone;\n","import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n  return arrayMap(props, function(key) {\n    return object[key];\n  });\n}\n\nexport default baseValues;\n","import baseValues from './_baseValues.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n  return object == null ? [] : baseValues(object, keys(object));\n}\n\nexport default values;\n","/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n  return value === undefined;\n}\n\nexport default isUndefined;\n","import baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport baseUniq from './_baseUniq.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n  return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nexport default union;\n","import * as _ from 'lodash-es';\n\nvar DEFAULT_EDGE_NAME = '\\x00';\nvar GRAPH_NODE = '\\x00';\nvar EDGE_KEY_DELIM = '\\x01';\n\n/**\n * @typedef {string} NodeID ID of a node.\n */\n\n/**\n * @typedef {`${string}${typeof EDGE_KEY_DELIM}${string}${typeof EDGE_KEY_DELIM}${string}`} EdgeID ID of an edge.\n * @internal - All public APIs use {@link EdgeObj} instead to refer to edges.\n */\n\n/**\n * @typedef {object} EdgeObj\n * @property {NodeID} v the id of the source or tail node of an edge\n * @property {NodeID} w the id of the target or head node of an edge\n * @property {string | number} [name] Name of the edge. Needed to uniquely identify\n * multiple edges between the same pair of nodes in a multigraph.\n */\n\n/**\n * @template {unknown} T\n * @typedef {T[] | Record<any, T>} Collection\n * Lodash object that can be iterated over with `_.each`.\n *\n * Beware, objects with `.length` are treated as arrays, see\n * https://lodash.com/docs/4.17.15#forEach\n */\n\n// Implementation notes:\n//\n//  * Node id query functions should return string ids for the nodes\n//  * Edge id query functions should return an \"edgeObj\", edge object, that is\n//    composed of enough information to uniquely identify an edge: {v, w, name}.\n//  * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n//    reference edges. This is because we need a performant way to look these\n//    edges up and, object properties, which have string keys, are the closest\n//    we're going to get to a performant hashtable in JavaScript.\n\n// Implementation notes:\n//\n//  * Node id query functions should return string ids for the nodes\n//  * Edge id query functions should return an \"edgeObj\", edge object, that is\n//    composed of enough information to uniquely identify an edge: {v, w, name}.\n//  * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n//    reference edges. This is because we need a performant way to look these\n//    edges up and, object properties, which have string keys, are the closest\n//    we're going to get to a performant hashtable in JavaScript.\n\n/**\n * @typedef {object} GraphOptions\n * @property {boolean | undefined} [directed] - set to `true` to get a\n * directed graph and `false` to get an undirected graph.\n * An undirected graph does not treat the order of nodes in an edge as\n * significant.\n * In other words, `g.edge(\"a\", \"b\") === g.edge(\"b\", \"a\")` for\n * an undirected graph.\n * Default: `true`\n * @property {boolean | undefined} [multigraph] - set to `true` to allow a\n * graph to have multiple edges between the same pair of nodes.\n * Default: `false`.\n * @property {boolean | undefined} [compound] - set to `true` to allow a\n * graph to have compound nodes - nodes which can be the parent of other\n * nodes.\n * Default: `false`.\n */\n\n/**\n * Graphlib has a single graph type: {@link Graph}. To create a new instance:\n *\n * ```js\n * var g = new Graph();\n * ```\n *\n * By default this will create a directed graph that does not allow multi-edges\n * or compound nodes.\n * The following options can be used when constructing a new graph:\n *\n * * {@link GraphOptions#directed}: set to `true` to get a directed graph and `false` to get an\n *   undirected graph.\n *   An undirected graph does not treat the order of nodes in an edge as\n *   significant. In other words,\n *   `g.edge(\"a\", \"b\") === g.edge(\"b\", \"a\")` for an undirected graph.\n *   Default: `true`.\n * * {@link GraphOptions#multigraph}: set to `true` to allow a graph to have multiple edges\n *   between the same pair of nodes. Default: `false`.\n * * {@link GraphOptions#compound}: set to `true` to allow a graph to have compound nodes -\n *   nodes which can be the parent of other nodes. Default: `false`.\n *\n * To set the options, pass in an options object to the `Graph` constructor.\n * For example, to create a directed compound multigraph:\n *\n * ```js\n * var g = new Graph({ directed: true, compound: true, multigraph: true });\n * ```\n *\n * ### Node and Edge Representation\n *\n * In graphlib, a node is represented by a user-supplied String id.\n * All node related functions use this String id as a way to uniquely identify\n * the node. Here is an example of interacting with nodes:\n *\n * ```js\n * var g = new Graph();\n * g.setNode(\"my-id\", \"my-label\");\n * g.node(\"my-id\"); // returns \"my-label\"\n * ```\n *\n * Edges in graphlib are identified by the nodes they connect. For example:\n *\n * ```js\n * var g = new Graph();\n * g.setEdge(\"source\", \"target\", \"my-label\");\n * g.edge(\"source\", \"target\"); // returns \"my-label\"\n * ```\n *\n * However, we need a way to uniquely identify an edge in a single object for\n * various edge queries (e.g. {@link Graph#outEdges}).\n * We use {@link EdgeObj}s for this purpose.\n * They consist of the following properties:\n *\n * * {@link EdgeObj#v}: the id of the source or tail node of an edge\n * * {@link EdgeObj#w}: the id of the target or head node of an edge\n * * {@link EdgeObj#name} (optional): the name that uniquely identifies a multiedge.\n *\n * Any edge function that takes an edge id will also work with an {@link EdgeObj}. For example:\n *\n * ```js\n * var g = new Graph();\n * g.setEdge(\"source\", \"target\", \"my-label\");\n * g.edge({ v: \"source\", w: \"target\" }); // returns \"my-label\"\n * ```\n *\n * ### Multigraphs\n *\n * A [multigraph](https://en.wikipedia.org/wiki/Multigraph) is a graph that can\n * have more than one edge between the same pair of nodes.\n * By default graphlib graphs are not multigraphs, but a multigraph can be\n * constructed by setting the {@link GraphOptions#multigraph} property to true:\n *\n * ```js\n * var g = new Graph({ multigraph: true });\n * ```\n *\n * With multiple edges between two nodes we need some way to uniquely identify\n * each edge. We call this the {@link EdgeObj#name} property.\n * Here's an example of creating a couple of edges between the same nodes:\n *\n * ```js\n * var g = new Graph({ multigraph: true });\n * g.setEdge(\"a\", \"b\", \"edge1-label\", \"edge1\");\n * g.setEdge(\"a\", \"b\", \"edge2-label\", \"edge2\");\n * g.edge(\"a\", \"b\", \"edge1\"); // returns \"edge1-label\"\n * g.edge(\"a\", \"b\", \"edge2\"); // returns \"edge2-label\"\n * g.edges(); // returns [{ v: \"a\", w: \"b\", name: \"edge1\" },\n *            //          { v: \"a\", w: \"b\", name: \"edge2\" }]\n * ```\n *\n * A multigraph still allows an edge with no name to be created:\n *\n * ```js\n * var g = new Graph({ multigraph: true });\n * g.setEdge(\"a\", \"b\", \"my-label\");\n * g.edge({ v: \"a\", w: \"b\" }); // returns \"my-label\"\n * ```\n *\n * ### Compound Graphs\n *\n * A compound graph is one where a node can be the parent of other nodes.\n * The child nodes form a \"subgraph\".\n * Here's an example of constructing and interacting with a compound graph:\n *\n * ```js\n * var g = new Graph({ compound: true });\n * g.setParent(\"a\", \"parent\");\n * g.setParent(\"b\", \"parent\");\n * g.parent(\"a\");      // returns \"parent\"\n * g.parent(\"b\");      // returns \"parent\"\n * g.parent(\"parent\"); // returns undefined\n * ```\n *\n * ### Default Labels\n *\n * When a node or edge is created without a label, a default label can be assigned.\n * See {@link setDefaultNodeLabel} and {@link setDefaultEdgeLabel}.\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * Even though this is a \"label\", this could be any type that the user requires\n * (and may need to be an object for some layout/ranking algorithms in dagre).\n * @template [EdgeLabel=any] - Label of an edge.\n * Even though this is a \"label\", this could be any type that the user requires,\n * (and may need to be a object for ranking in dagre).\n */\nexport class Graph {\n  /**\n   * @param {GraphOptions} [opts] - Graph options.\n   */\n  constructor(opts = {}) {\n    /**\n     * @type {boolean}\n     * @private\n     */\n    this._isDirected = Object.prototype.hasOwnProperty.call(opts, 'directed')\n      ? opts.directed\n      : true;\n    /**\n     * @type {boolean}\n     * @private\n     */\n    this._isMultigraph = Object.prototype.hasOwnProperty.call(opts, 'multigraph')\n      ? opts.multigraph\n      : false;\n    /**\n     * @type {boolean}\n     * @private\n     */\n    this._isCompound = Object.prototype.hasOwnProperty.call(opts, 'compound')\n      ? opts.compound\n      : false;\n\n    /**\n     * @type {GraphLabel | undefined}\n     * Label for the graph itself\n     */\n    this._label = undefined;\n\n    /**\n     * Default label to be set when creating a new node.\n     *\n     * @private\n     * @type {(v: NodeID | number) => NodeLabel}\n     */\n    this._defaultNodeLabelFn = _.constant(undefined);\n\n    /**\n     * Default label to be set when creating a new edge\n     *\n     * @private\n     * @type {(v: NodeID, w: NodeID, name: string | undefined) => EdgeLabel}\n     */\n    this._defaultEdgeLabelFn = _.constant(undefined);\n\n    /**\n     * @type {Record<NodeID, NodeLabel>}\n     * @private\n     *\n     * v -> label\n     */\n    this._nodes = {};\n\n    if (this._isCompound) {\n      /**\n       * @type {Record<NodeID, NodeID>}\n       * @private\n       * v -> parent\n       */\n      this._parent = {};\n\n      /**\n       * @type {Record<NodeID, Record<NodeID, true>>}\n       * @private\n       * v -> children\n       */\n      this._children = {};\n      this._children[GRAPH_NODE] = {};\n    }\n\n    /**\n     * @type {Record<NodeID, Record<EdgeID, EdgeObj>>}\n     * @private\n     * v -> edgeObj\n     */\n    this._in = {};\n\n    /**\n     * @type {Record<NodeID, Record<NodeID, number>>}\n     * @private\n     * u -> v -> Number\n     */\n    this._preds = {};\n\n    /**\n     * @type {Record<NodeID, Record<EdgeID, EdgeObj>>}\n     * @private\n     * v -> edgeObj\n     */\n    this._out = {};\n\n    /**\n     * @type {Record<NodeID, Record<NodeID, number>>}\n     * @private\n     * v -> w -> Number\n     */\n    this._sucs = {};\n\n    /**\n     * @type {Record<EdgeID, EdgeObj>}\n     * @private\n     * e -> edgeObj\n     */\n    this._edgeObjs = {};\n\n    /**\n     * @type {Record<EdgeID, EdgeLabel>}\n     * @private\n     * e -> label\n     */\n    this._edgeLabels = {};\n  }\n\n  /* === Graph functions ========= */\n\n  /**\n   *\n   * @returns {boolean} `true` if the graph is [directed](https://en.wikipedia.org/wiki/Directed_graph).\n   * A directed graph treats the order of nodes in an edge as significant whereas an\n   * [undirected](https://en.wikipedia.org/wiki/Graph_(mathematics)#Undirected_graph)\n   * graph does not.\n   * This example demonstrates the difference:\n   *\n   * @example\n   *\n   * ```js\n   * var directed = new Graph({ directed: true });\n   * directed.setEdge(\"a\", \"b\", \"my-label\");\n   * directed.edge(\"a\", \"b\"); // returns \"my-label\"\n   * directed.edge(\"b\", \"a\"); // returns undefined\n   *\n   * var undirected = new Graph({ directed: false });\n   * undirected.setEdge(\"a\", \"b\", \"my-label\");\n   * undirected.edge(\"a\", \"b\"); // returns \"my-label\"\n   * undirected.edge(\"b\", \"a\"); // returns \"my-label\"\n   * ```\n   */\n  isDirected() {\n    return this._isDirected;\n  }\n  /**\n   * @returns {boolean} `true` if the graph is a multigraph.\n   */\n  isMultigraph() {\n    return this._isMultigraph;\n  }\n  /**\n   * @returns {boolean} `true` if the graph is compound.\n   */\n  isCompound() {\n    return this._isCompound;\n  }\n\n  /**\n   * Sets the label for the graph to `label`.\n   *\n   * @param {GraphLabel} label - Label for the graph.\n   * @returns {this}\n   */\n  setGraph(label) {\n    this._label = label;\n    return this;\n  }\n\n  /**\n   * @returns {GraphLabel | undefined} the currently assigned label for the graph.\n   * If no label has been assigned, returns `undefined`.\n   *\n   * @example\n   *\n   * ```js\n   * var g = new Graph();\n   * g.graph(); // returns undefined\n   * g.setGraph(\"graph-label\");\n   *  g.graph(); // returns \"graph-label\"\n   * ```\n   */\n  graph() {\n    return this._label;\n  }\n  /* === Node functions ========== */\n\n  /**\n   * Sets a new default value that is assigned to nodes that are created without\n   * a label.\n   *\n   * @param {typeof this._defaultNodeLabelFn | NodeLabel} newDefault - If a function,\n   * it is called with the id of the node being created.\n   * Otherwise, it is assigned as the label directly.\n   * @returns {this}\n   */\n  setDefaultNodeLabel(newDefault) {\n    if (!_.isFunction(newDefault)) {\n      newDefault = _.constant(newDefault);\n    }\n    this._defaultNodeLabelFn = newDefault;\n    return this;\n  }\n\n  /**\n   * @returns {number} the number of nodes in the graph.\n   */\n  nodeCount() {\n    return this._nodeCount;\n  }\n\n  /**\n   * @returns {NodeID[]} the ids of the nodes in the graph.\n   *\n   * @remarks\n   * Use {@link node()} to get the label for each node.\n   * Takes `O(|V|)` time.\n   */\n  nodes() {\n    return _.keys(this._nodes);\n  }\n  /**\n   * @returns {NodeID[]} those nodes in the graph that have no in-edges.\n   * @remarks Takes `O(|V|)` time.\n   */\n  sources() {\n    var self = this;\n    return _.filter(this.nodes(), function (v) {\n      return _.isEmpty(self._in[v]);\n    });\n  }\n  /**\n   * @returns {NodeID[]} those nodes in the graph that have no out-edges.\n   * @remarks Takes `O(|V|)` time.\n   */\n  sinks() {\n    var self = this;\n    return _.filter(this.nodes(), function (v) {\n      return _.isEmpty(self._out[v]);\n    });\n  }\n\n  /**\n   * Invokes setNode method for each node in `vs` list.\n   *\n   * @param {Collection<NodeID | number>} vs - List of node IDs to create/set.\n   * @param {NodeLabel} [value] - If set, update all nodes with this value.\n   * @returns {this}\n   * @remarks Complexity: O(|names|).\n   */\n  setNodes(vs, value) {\n    var args = arguments;\n    var self = this;\n    _.each(vs, function (v) {\n      if (args.length > 1) {\n        self.setNode(v, value);\n      } else {\n        self.setNode(v);\n      }\n    });\n    return this;\n  }\n\n  /**\n   * Creates or updates the value for the node `v` in the graph.\n   *\n   * @param {NodeID | number} v - ID of the node to create/set.\n   * @param {NodeLabel} [value] - If supplied, it is set as the value for the node.\n   * If not supplied and the node was created by this call then\n   * {@link setDefaultNodeLabel} will be used to set the node's value.\n   * @returns {this} the graph, allowing this to be chained with other functions.\n   * @remarks Takes `O(1)` time.\n   */\n  setNode(v, value) {\n    if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {\n      if (arguments.length > 1) {\n        this._nodes[v] = value;\n      }\n      return this;\n    }\n\n    this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);\n    if (this._isCompound) {\n      this._parent[v] = GRAPH_NODE;\n      this._children[v] = {};\n      this._children[GRAPH_NODE][v] = true;\n    }\n    this._in[v] = {};\n    this._preds[v] = {};\n    this._out[v] = {};\n    this._sucs[v] = {};\n    ++this._nodeCount;\n    return this;\n  }\n\n  /**\n   * Gets the label of node with specified name.\n   *\n   * @param {NodeID | number} v - Node ID.\n   * @returns {NodeLabel | undefined} the label assigned to the node with the id `v`\n   * if it is in the graph.\n   * Otherwise returns `undefined`.\n   * @remarks Takes `O(1)` time.\n   */\n  node(v) {\n    return this._nodes[v];\n  }\n\n  /**\n   * Detects whether graph has a node with specified name or not.\n   *\n   * @param {NodeID | number} v - Node ID.\n   * @returns {boolean} Returns `true` the graph has a node with the id.\n   * @remarks Takes `O(1)` time.\n   */\n  hasNode(v) {\n    return Object.prototype.hasOwnProperty.call(this._nodes, v);\n  }\n\n  /**\n   * Remove the node with the id `v` in the graph or do nothing if the node is\n   * not in the graph.\n   *\n   * If the node was removed this function also removes any incident edges.\n   *\n   * @param {NodeID | number} v - Node ID to remove.\n   * @returns {this} the graph, allowing this to be chained with other functions.\n   * @remarks Takes `O(|E|)` time.\n   */\n  removeNode(v) {\n    if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {\n      var removeEdge = (e) => this.removeEdge(this._edgeObjs[e]);\n      delete this._nodes[v];\n      if (this._isCompound) {\n        this._removeFromParentsChildList(v);\n        delete this._parent[v];\n        _.each(this.children(v), (child) => {\n          this.setParent(child);\n        });\n        delete this._children[v];\n      }\n      _.each(_.keys(this._in[v]), removeEdge);\n      delete this._in[v];\n      delete this._preds[v];\n      _.each(_.keys(this._out[v]), removeEdge);\n      delete this._out[v];\n      delete this._sucs[v];\n      --this._nodeCount;\n    }\n    return this;\n  }\n\n  /**\n   * Sets the parent for `v` to `parent` if it is defined or removes the parent\n   * for `v` if `parent` is undefined.\n   *\n   * @param {NodeID | number} v - Node ID to set the parent for.\n   * @param {NodeID | number} [parent] - Parent node ID. If not defined, removes the parent.\n   * @returns {this} the graph, allowing this to be chained with other functions.\n   * @throws if the graph is not compound.\n   * @throws if setting the parent would create a cycle.\n   * @remarks Takes `O(1)` time.\n   */\n  setParent(v, parent) {\n    if (!this._isCompound) {\n      throw new Error('Cannot set parent in a non-compound graph');\n    }\n\n    if (_.isUndefined(parent)) {\n      parent = GRAPH_NODE;\n    } else {\n      // Coerce parent to string\n      parent += '';\n      for (var ancestor = parent; !_.isUndefined(ancestor); ancestor = this.parent(ancestor)) {\n        if (ancestor === v) {\n          throw new Error('Setting ' + parent + ' as parent of ' + v + ' would create a cycle');\n        }\n      }\n\n      this.setNode(parent);\n    }\n\n    this.setNode(v);\n    this._removeFromParentsChildList(v);\n    // @ts-expect-error -- We coerced parent to a string above\n    this._parent[v] = parent;\n    this._children[parent][v] = true;\n    return this;\n  }\n\n  /**\n   * @private\n   * @param {NodeID | number} v - Node ID.\n   */\n  _removeFromParentsChildList(v) {\n    delete this._children[this._parent[v]][v];\n  }\n\n  /**\n   * Get parent node for node `v`.\n   *\n   * @param {NodeID | number} v - Node ID.\n   * @returns {NodeID | undefined} the node that is a parent of node `v`\n   * or `undefined` if node `v` does not have a parent or is not a member of\n   * the graph.\n   * Always returns `undefined` for graphs that are not compound.\n   * @remarks Takes `O(1)` time.\n   */\n  parent(v) {\n    if (this._isCompound) {\n      var parent = this._parent[v];\n      if (parent !== GRAPH_NODE) {\n        return parent;\n      }\n    }\n  }\n\n  /**\n   * Gets list of direct children of node v.\n   *\n   * @param {NodeID | number} [v] - Node ID. If not specified, gets nodes\n   * with no parent (top-level nodes).\n   * @returns {NodeID[] | undefined} all nodes that are children of node `v` or\n   * `undefined` if node `v` is not in the graph.\n   * Always returns `[]` for graphs that are not compound.\n   * @remarks Takes `O(|V|)` time.\n   */\n  children(v) {\n    if (_.isUndefined(v)) {\n      v = GRAPH_NODE;\n    }\n\n    if (this._isCompound) {\n      var children = this._children[v];\n      if (children) {\n        return _.keys(children);\n      }\n    } else if (v === GRAPH_NODE) {\n      return this.nodes();\n    } else if (this.hasNode(v)) {\n      return [];\n    }\n  }\n\n  /**\n   * @param {NodeID | number} v - Node ID.\n   * @returns {NodeID[] | undefined} all nodes that are predecessors of the\n   * specified node or `undefined` if node `v` is not in the graph.\n   * @remarks\n   * Behavior is undefined for undirected graphs - use {@link neighbors} instead.\n   * Takes `O(|V|)` time.\n   */\n  predecessors(v) {\n    var predsV = this._preds[v];\n    if (predsV) {\n      return _.keys(predsV);\n    }\n  }\n\n  /**\n   * @param {NodeID | number} v - Node ID.\n   * @returns {NodeID[] | undefined} all nodes that are successors of the\n   * specified node or `undefined` if node `v` is not in the graph.\n   * @remarks\n   * Behavior is undefined for undirected graphs - use {@link neighbors} instead.\n   * Takes `O(|V|)` time.\n   */\n  successors(v) {\n    var sucsV = this._sucs[v];\n    if (sucsV) {\n      return _.keys(sucsV);\n    }\n  }\n\n  /**\n   * @param {NodeID | number} v - Node ID.\n   * @returns {NodeID[] | undefined} all nodes that are predecessors or\n   * successors of the specified node\n   * or `undefined` if node `v` is not in the graph.\n   * @remarks Takes `O(|V|)` time.\n   */\n  neighbors(v) {\n    var preds = this.predecessors(v);\n    if (preds) {\n      return _.union(preds, this.successors(v));\n    }\n  }\n\n  /**\n   * @param {NodeID | number} v - Node ID.\n   * @returns {boolean} True if the node is a leaf (has no successors), false otherwise.\n   */\n  isLeaf(v) {\n    var neighbors;\n    if (this.isDirected()) {\n      neighbors = this.successors(v);\n    } else {\n      neighbors = this.neighbors(v);\n    }\n    return neighbors.length === 0;\n  }\n\n  /**\n   * Creates new graph with nodes filtered via `filter`.\n   * Edges incident to rejected node\n   * are also removed.\n   * \n   * In case of compound graph, if parent is rejected by `filter`,\n   * than all its children are rejected too.\n\n   * @param {(v: NodeID) => boolean} filter - Function that returns `true` for nodes to keep.\n   * @returns {Graph<GraphLabel, NodeLabel, EdgeLabel>} A new graph containing only the nodes for which `filter` returns `true`.\n   * @remarks Average-case complexity: O(|E|+|V|).\n   */\n  filterNodes(filter) {\n    /**\n     * @type {Graph<GraphLabel, NodeLabel, EdgeLabel>}\n     */\n    // @ts-expect-error\n    var copy = new this.constructor({\n      directed: this._isDirected,\n      multigraph: this._isMultigraph,\n      compound: this._isCompound,\n    });\n\n    copy.setGraph(this.graph());\n\n    var self = this;\n    _.each(this._nodes, function (value, v) {\n      if (filter(v)) {\n        copy.setNode(v, value);\n      }\n    });\n\n    _.each(this._edgeObjs, function (e) {\n      if (copy.hasNode(e.v) && copy.hasNode(e.w)) {\n        copy.setEdge(e, self.edge(e));\n      }\n    });\n\n    var parents = {};\n    function findParent(v) {\n      var parent = self.parent(v);\n      if (parent === undefined || copy.hasNode(parent)) {\n        parents[v] = parent;\n        return parent;\n      } else if (parent in parents) {\n        return parents[parent];\n      } else {\n        return findParent(parent);\n      }\n    }\n\n    if (this._isCompound) {\n      _.each(copy.nodes(), function (v) {\n        copy.setParent(v, findParent(v));\n      });\n    }\n\n    return copy;\n  }\n\n  /* === Edge functions ========== */\n\n  /**\n   * Sets a new default value that is assigned to edges that are created without\n   * a label.\n   *\n   * @param {typeof this._defaultEdgeLabelFn | EdgeLabel} newDefault - If a function,\n   * it is called with the parameters `(v, w, name)`.\n   * Otherwise, it is assigned as the label directly.\n   * @returns {this}\n   */\n  setDefaultEdgeLabel(newDefault) {\n    if (!_.isFunction(newDefault)) {\n      newDefault = _.constant(newDefault);\n    }\n    this._defaultEdgeLabelFn = newDefault;\n    return this;\n  }\n\n  /**\n   * @returns {number} the number of edges in the graph.\n   * @remarks Complexity: O(1).\n   */\n  edgeCount() {\n    return this._edgeCount;\n  }\n\n  /**\n   * Gets edges of the graph.\n   *\n   * @returns {EdgeObj[]} the {@link EdgeObj} for each edge in the graph.\n   *\n   * @remarks\n   * In case of compound graph subgraphs are not considered.\n   * Use {@link edge()} to get the label for each edge.\n   * Takes `O(|E|)` time.\n   */\n  edges() {\n    return _.values(this._edgeObjs);\n  }\n\n  /**\n   * Establish an edges path over the nodes in nodes list.\n   *\n   * If some edge is already exists, it will update its label, otherwise it will\n   * create an edge between pair of nodes with label provided or default label\n   * if no label provided.\n   *\n   * @param {Collection<NodeID>} vs - List of node IDs to create edges between.\n   * @param {EdgeLabel} [value] - If set, update all edges with this value.\n   * @returns {this}\n   * @remarks Complexity: O(|nodes|).\n   */\n  setPath(vs, value) {\n    var self = this;\n    var args = arguments;\n    _.reduce(vs, function (v, w) {\n      if (args.length > 1) {\n        self.setEdge(v, w, value);\n      } else {\n        self.setEdge(v, w);\n      }\n      return w;\n    });\n    return this;\n  }\n\n  /**\n   * Creates or updates the label for the edge (`v`, `w`) with the optionally\n   * supplied `name`.\n   *\n   * @overload\n   * @param {EdgeObj} arg0 - Edge object.\n   * @param {EdgeLabel} [value] - If supplied, it is set as the label for the edge.\n   * If not supplied and the edge was created by this call then\n   * {@link setDefaultEdgeLabel} will be used to assign the edge's label.\n   * @returns {this} the graph, allowing this to be chained with other functions.\n   * @remarks Takes `O(1)` time.\n   */\n  /**\n   * Creates or updates the label for the edge (`v`, `w`) with the optionally\n   * supplied `name`.\n   *\n   * @overload\n   * @param {NodeID | number} v - Source node ID. Number values will be coerced to strings.\n   * @param {NodeID | number} w - Target node ID. Number values will be coerced to strings.\n   * @param {EdgeLabel} [value] - If supplied, it is set as the label for the edge.\n   * If not supplied and the edge was created by this call then\n   * {@link setDefaultEdgeLabel} will be used to assign the edge's label.\n   * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n   * @returns {this} the graph, allowing this to be chained with other functions.\n   * @remarks Takes `O(1)` time.\n   */\n  setEdge() {\n    var v, w, name, value;\n    var valueSpecified = false;\n    var arg0 = arguments[0];\n\n    if (typeof arg0 === 'object' && arg0 !== null && 'v' in arg0) {\n      v = arg0.v;\n      w = arg0.w;\n      name = arg0.name;\n      if (arguments.length === 2) {\n        value = arguments[1];\n        valueSpecified = true;\n      }\n    } else {\n      v = arg0;\n      w = arguments[1];\n      name = arguments[3];\n      if (arguments.length > 2) {\n        value = arguments[2];\n        valueSpecified = true;\n      }\n    }\n\n    v = '' + v;\n    w = '' + w;\n    if (!_.isUndefined(name)) {\n      name = '' + name;\n    }\n\n    var e = edgeArgsToId(this._isDirected, v, w, name);\n    if (Object.prototype.hasOwnProperty.call(this._edgeLabels, e)) {\n      if (valueSpecified) {\n        this._edgeLabels[e] = value;\n      }\n      return this;\n    }\n\n    if (!_.isUndefined(name) && !this._isMultigraph) {\n      throw new Error('Cannot set a named edge when isMultigraph = false');\n    }\n\n    // It didn't exist, so we need to create it.\n    // First ensure the nodes exist.\n    this.setNode(v);\n    this.setNode(w);\n\n    this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);\n\n    var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);\n    // Ensure we add undirected edges in a consistent way.\n    v = edgeObj.v;\n    w = edgeObj.w;\n\n    Object.freeze(edgeObj);\n    this._edgeObjs[e] = edgeObj;\n    incrementOrInitEntry(this._preds[w], v);\n    incrementOrInitEntry(this._sucs[v], w);\n    this._in[w][e] = edgeObj;\n    this._out[v][e] = edgeObj;\n    this._edgeCount++;\n    return this;\n  }\n\n  /**\n   * Gets the label for the specified edge.\n   *\n   * @overload\n   * @param {EdgeObj} v - Edge object.\n   * @returns {EdgeLabel | undefined} the label for the edge (`v`, `w`) if the\n   * graph has an edge between `v` and `w` with the optional `name`.\n   * Returned `undefined` if there is no such edge in the graph.\n   * @remarks\n   * `v` and `w` can be interchanged for undirected graphs.\n   * Takes `O(1)` time.\n   */\n  /**\n   * Gets the label for the specified edge.\n   *\n   * @overload\n   * @param {NodeID | number} v - Source node ID.\n   * @param {NodeID | number} w - Target node ID.\n   * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n   * @returns {EdgeLabel | undefined} the label for the edge (`v`, `w`) if the\n   * graph has an edge between `v` and `w` with the optional `name`.\n   * Returned `undefined` if there is no such edge in the graph.\n   * @remarks\n   * `v` and `w` can be interchanged for undirected graphs.\n   * Takes `O(1)` time.\n   */\n  edge(v, w, name) {\n    var e =\n      arguments.length === 1\n        ? edgeObjToId(this._isDirected, arguments[0])\n        : edgeArgsToId(this._isDirected, v, w, name);\n    return this._edgeLabels[e];\n  }\n\n  /**\n   * Detects whether the graph contains specified edge or not.\n   *\n   * @overload\n   * @param {EdgeObj} v - Edge object.\n   * @returns {boolean} `true` if the graph has an edge between `v` and `w`\n   * with the optional `name`.\n   * @remarks\n   * `v` and `w` can be interchanged for undirected graphs.\n   * No subgraphs are considered.\n   * Takes `O(1)` time.\n   */\n  /**\n   * Detects whether the graph contains specified edge or not.\n   *\n   * @overload\n   * @param {NodeID | number} v - Source node ID.\n   * @param {NodeID | number} w - Target node ID.\n   * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n   * @returns {boolean} `true` if the graph has an edge between `v` and `w`\n   * with the optional `name`.\n   * @remarks\n   * `v` and `w` can be interchanged for undirected graphs.\n   * No subgraphs are considered.\n   * Takes `O(1)` time.\n   */\n  hasEdge(v, w, name) {\n    var e =\n      arguments.length === 1\n        ? edgeObjToId(this._isDirected, arguments[0])\n        : edgeArgsToId(this._isDirected, v, w, name);\n    return Object.prototype.hasOwnProperty.call(this._edgeLabels, e);\n  }\n\n  /**\n   * Removes the edge (`v`, `w`) if the graph has an edge between `v` and `w`\n   * with the optional `name`. If not this function does nothing.\n   *\n   * @overload\n   * @param {EdgeObj} v - Edge object.\n   * @returns {this}\n   * @remarks\n   * `v` and `w` can be interchanged for undirected graphs.\n   * No subgraphs are considered.\n   * Takes `O(1)` time.\n   */\n  /**\n   * Removes the edge (`v`, `w`) if the graph has an edge between `v` and `w`\n   * with the optional `name`. If not this function does nothing.\n   *\n   * @overload\n   * @param {NodeID | number} v - Source node ID.\n   * @param {NodeID | number} w - Target node ID.\n   * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n   * @returns {this}\n   * @remarks\n   * `v` and `w` can be interchanged for undirected graphs.\n   * Takes `O(1)` time.\n   */\n  removeEdge(v, w, name) {\n    var e =\n      arguments.length === 1\n        ? edgeObjToId(this._isDirected, arguments[0])\n        : edgeArgsToId(this._isDirected, v, w, name);\n    var edge = this._edgeObjs[e];\n    if (edge) {\n      v = edge.v;\n      w = edge.w;\n      delete this._edgeLabels[e];\n      delete this._edgeObjs[e];\n      decrementOrRemoveEntry(this._preds[w], v);\n      decrementOrRemoveEntry(this._sucs[v], w);\n      delete this._in[w][e];\n      delete this._out[v][e];\n      this._edgeCount--;\n    }\n    return this;\n  }\n\n  /**\n   * @param {NodeID | number} v - Target node ID.\n   * @param {NodeID | number} [u] - Optionally filters edges down to just those\n   * coming from node `u`.\n   * @returns {EdgeObj[] | undefined} all edges that point to the node `v`.\n   * Returns `undefined` if node `v` is not in the graph.\n   * @remarks\n   * Behavior is undefined for undirected graphs - use {@link nodeEdges} instead.\n   * Takes `O(|E|)` time.\n   */\n  inEdges(v, u) {\n    var inV = this._in[v];\n    if (inV) {\n      var edges = _.values(inV);\n      if (!u) {\n        return edges;\n      }\n      return _.filter(edges, function (edge) {\n        return edge.v === u;\n      });\n    }\n  }\n\n  /**\n   * @param {NodeID | number} v - Target node ID.\n   * @param {NodeID | number} [w] - Optionally filters edges down to just those\n   * that point to `w`.\n   * @returns {EdgeObj[] | undefined} all edges that point to the node `v`.\n   * Returns `undefined` if node `v` is not in the graph.\n   * @remarks\n   * Behavior is undefined for undirected graphs - use {@link nodeEdges} instead.\n   * Takes `O(|E|)` time.\n   */\n  outEdges(v, w) {\n    var outV = this._out[v];\n    if (outV) {\n      var edges = _.values(outV);\n      if (!w) {\n        return edges;\n      }\n      return _.filter(edges, function (edge) {\n        return edge.w === w;\n      });\n    }\n  }\n\n  /**\n   * @param {NodeID | number} v - Target Node ID.\n   * @param {NodeID | number} [w] - If set, filters those edges down to just\n   * those between nodes `v` and `w` regardless of direction\n   * @returns {EdgeObj[] | undefined} all edges to or from node `v` regardless\n   * of direction. Returns `undefined` if node `v` is not in the graph.\n   * @remarks Takes `O(|E|)` time.\n   */\n  nodeEdges(v, w) {\n    var inEdges = this.inEdges(v, w);\n    if (inEdges) {\n      return inEdges.concat(this.outEdges(v, w));\n    }\n  }\n}\n\n/* Number of nodes in the graph. Should only be changed by the implementation. */\nGraph.prototype._nodeCount = 0;\n\n/* Number of edges in the graph. Should only be changed by the implementation. */\nGraph.prototype._edgeCount = 0;\n\n/**\n * @param {Record<NodeID, number>} map - Object mapping node IDs to counts.\n * @param {NodeID | number} k - Node ID.\n */\nfunction incrementOrInitEntry(map, k) {\n  if (map[k]) {\n    map[k]++;\n  } else {\n    map[k] = 1;\n  }\n}\n\n/**\n * @param {Record<NodeID, number>} map - Object mapping node IDs to counts.\n * @param {NodeID | number} k - Node ID.\n */\nfunction decrementOrRemoveEntry(map, k) {\n  if (!--map[k]) {\n    delete map[k];\n  }\n}\n\n/**\n * @param {boolean} isDirected - If `false`, sorts v and w to ensure a consistent ID.\n * @param {EdgeObj['v'] | number} v_ - Source node ID.\n * @param {EdgeObj['w'] | number} w_ - Target node ID.\n * @param {EdgeObj['name']} [name] - Edge name (for multiple edges between the same nodes).\n * @returns {EdgeID} Unique ID for the edge.\n */\nfunction edgeArgsToId(isDirected, v_, w_, name) {\n  var v = '' + v_;\n  var w = '' + w_;\n  if (!isDirected && v > w) {\n    var tmp = v;\n    v = w;\n    w = tmp;\n  }\n  return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);\n}\n\n/**\n * @param {boolean} isDirected - If `false`, sorts v and w to ensure a consistent ID.\n * @param {EdgeObj['v'] | number} v_ - Source node ID.\n * @param {EdgeObj['w'] | number} w_ - Target node ID.\n * @param {EdgeObj['name']} [name] - Edge name (for multiple edges between the same nodes).\n * @returns {EdgeObj}\n */\nfunction edgeArgsToObj(isDirected, v_, w_, name) {\n  var v = '' + v_;\n  var w = '' + w_;\n  if (!isDirected && v > w) {\n    var tmp = v;\n    v = w;\n    w = tmp;\n  }\n  var edgeObj = { v: v, w: w };\n  if (name) {\n    edgeObj.name = name;\n  }\n  return edgeObj;\n}\n\n/**\n * @param {boolean} isDirected - If `false`, sorts v and w to ensure a consistent ID.\n * @param {EdgeObj} edgeObj - Edge object.\n * @returns {EdgeID} Unique ID for the edge.\n */\nfunction edgeObjToId(isDirected, edgeObj) {\n  return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);\n}\n"],"names":["baseAssign","object","source","copyObject","keys","baseAssignIn","keysIn","copySymbols","getSymbols","nativeGetSymbols","getSymbolsIn","result","arrayPush","getPrototype","stubArray","copySymbolsIn","getAllKeysIn","baseGetAllKeys","objectProto","hasOwnProperty","initCloneArray","array","length","cloneDataView","dataView","isDeep","buffer","cloneArrayBuffer","reFlags","cloneRegExp","regexp","symbolProto","Symbol","symbolValueOf","cloneSymbol","symbol","boolTag","dateTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","initCloneByTag","tag","Ctor","cloneTypedArray","baseIsMap","value","isObjectLike","getTag","nodeIsMap","nodeUtil","isMap","baseUnary","baseIsSet","nodeIsSet","isSet","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","argsTag","arrayTag","errorTag","funcTag","genTag","objectTag","weakMapTag","cloneableTags","baseClone","bitmask","customizer","key","stack","isFlat","isFull","isObject","isArr","isArray","copyArray","isFunc","isBuffer","cloneBuffer","initCloneObject","Stack","stacked","subValue","keysFunc","getAllKeys","props","arrayEach","assignValue","baseValues","arrayMap","values","isUndefined","union","baseRest","arrays","baseUniq","baseFlatten","isArrayLikeObject","DEFAULT_EDGE_NAME","GRAPH_NODE","EDGE_KEY_DELIM","Graph","opts","_.constant","label","newDefault","_.isFunction","_.keys","self","_.filter","v","_.isEmpty","vs","args","_.each","removeEdge","e","child","parent","_.isUndefined","ancestor","children","predsV","sucsV","preds","_.union","neighbors","filter","copy","parents","findParent","_.values","_.reduce","w","name","valueSpecified","arg0","edgeArgsToId","edgeObj","edgeArgsToObj","incrementOrInitEntry","edgeObjToId","edge","decrementOrRemoveEntry","u","inV","edges","outV","inEdges","map","k","isDirected","v_","w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