"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([["vendors-node_modules_mermaid_dist_index-0980fb80_js"],{

/***/ "../node_modules/dagre-d3-es/src/graphlib/json.js":
/*!********************************************************!*\
  !*** ../node_modules/dagre-d3-es/src/graphlib/json.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   read: () => (/* binding */ read),\n/* harmony export */   write: () => (/* binding */ write)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"../node_modules/lodash-es/isUndefined.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ \"../node_modules/lodash-es/clone.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ \"../node_modules/lodash-es/map.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ \"../node_modules/lodash-es/forEach.js\");\n/* harmony import */ var _graph_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graph.js */ \"../node_modules/dagre-d3-es/src/graphlib/graph.js\");\n\n\n\n\n\nfunction write(g) {\n  var json = {\n    options: {\n      directed: g.isDirected(),\n      multigraph: g.isMultigraph(),\n      compound: g.isCompound(),\n    },\n    nodes: writeNodes(g),\n    edges: writeEdges(g),\n  };\n  if (!lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](g.graph())) {\n    json.value = lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](g.graph());\n  }\n  return json;\n}\n\nfunction writeNodes(g) {\n  return lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](g.nodes(), function (v) {\n    var nodeValue = g.node(v);\n    var parent = g.parent(v);\n    var node = { v: v };\n    if (!lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](nodeValue)) {\n      node.value = nodeValue;\n    }\n    if (!lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](parent)) {\n      node.parent = parent;\n    }\n    return node;\n  });\n}\n\nfunction writeEdges(g) {\n  return lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](g.edges(), function (e) {\n    var edgeValue = g.edge(e);\n    var edge = { v: e.v, w: e.w };\n    if (!lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](e.name)) {\n      edge.name = e.name;\n    }\n    if (!lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](edgeValue)) {\n      edge.value = edgeValue;\n    }\n    return edge;\n  });\n}\n\nfunction read(json) {\n  var g = new _graph_js__WEBPACK_IMPORTED_MODULE_0__.Graph(json.options).setGraph(json.value);\n  lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](json.nodes, function (entry) {\n    g.setNode(entry.v, entry.value);\n    if (entry.parent) {\n      g.setParent(entry.v, entry.parent);\n    }\n  });\n  lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](json.edges, function (entry) {\n    g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n  });\n  return g;\n}\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/dagre-d3-es/src/graphlib/json.js?");

/***/ }),

/***/ "../node_modules/lodash-es/clone.js":
/*!******************************************!*\
  !*** ../node_modules/lodash-es/clone.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ \"../node_modules/lodash-es/_baseClone.js\");\n\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n  return (0,_baseClone_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, CLONE_SYMBOLS_FLAG);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/lodash-es/clone.js?");

/***/ }),

/***/ "../node_modules/mermaid/dist/index-0980fb80.js":
/*!******************************************************!*\
  !*** ../node_modules/mermaid/dist/index-0980fb80.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   r: () => (/* binding */ render)\n/* harmony export */ });\n/* harmony import */ var dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre-d3-es/src/dagre/index.js */ \"../node_modules/dagre-d3-es/src/dagre/index.js\");\n/* harmony import */ var dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre-d3-es/src/graphlib/json.js */ \"../node_modules/dagre-d3-es/src/graphlib/json.js\");\n/* harmony import */ var _edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edges-5ec2587c.js */ \"../node_modules/mermaid/dist/edges-5ec2587c.js\");\n/* harmony import */ var _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mermaid-04fb0060.js */ \"../node_modules/mermaid/dist/mermaid-04fb0060.js\");\n/* harmony import */ var dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dagre-d3-es/src/graphlib/index.js */ \"../node_modules/dagre-d3-es/src/graphlib/index.js\");\n/* harmony import */ var _createText_a48a4c90_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createText-a48a4c90.js */ \"../node_modules/mermaid/dist/createText-a48a4c90.js\");\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3 */ \"../node_modules/d3/src/index.js\");\n\n\n\n\n\n\n\nlet clusterDb = {};\nlet descendants = {};\nlet parents = {};\nconst clear$1 = () => {\n  descendants = {};\n  parents = {};\n  clusterDb = {};\n};\nconst isDescendant = (id, ancenstorId) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"In isDecendant\", ancenstorId, \" \", id, \" = \", descendants[ancenstorId].includes(id));\n  if (descendants[ancenstorId].includes(id)) {\n    return true;\n  }\n  return false;\n};\nconst edgeInCluster = (edge, clusterId) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Decendants of \", clusterId, \" is \", descendants[clusterId]);\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Edge is \", edge);\n  if (edge.v === clusterId) {\n    return false;\n  }\n  if (edge.w === clusterId) {\n    return false;\n  }\n  if (!descendants[clusterId]) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Tilt, \", clusterId, \",not in decendants\");\n    return false;\n  }\n  return descendants[clusterId].includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || descendants[clusterId].includes(edge.w);\n};\nconst copy = (clusterId, graph, newGraph, rootId) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\n    \"Copying children of \",\n    clusterId,\n    \"root\",\n    rootId,\n    \"data\",\n    graph.node(clusterId),\n    rootId\n  );\n  const nodes = graph.children(clusterId) || [];\n  if (clusterId !== rootId) {\n    nodes.push(clusterId);\n  }\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Copying (nodes) clusterId\", clusterId, \"nodes\", nodes);\n  nodes.forEach((node) => {\n    if (graph.children(node).length > 0) {\n      copy(node, graph, newGraph, rootId);\n    } else {\n      const data = graph.node(node);\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"cp \", node, \" to \", rootId, \" with parent \", clusterId);\n      newGraph.setNode(node, data);\n      if (rootId !== graph.parent(node)) {\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Setting parent\", node, graph.parent(node));\n        newGraph.setParent(node, graph.parent(node));\n      }\n      if (clusterId !== rootId && node !== clusterId) {\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Setting parent\", node, clusterId);\n        newGraph.setParent(node, clusterId);\n      } else {\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"In copy \", clusterId, \"root\", rootId, \"data\", graph.node(clusterId), rootId);\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\n          \"Not Setting parent for node=\",\n          node,\n          \"cluster!==rootId\",\n          clusterId !== rootId,\n          \"node!==clusterId\",\n          node !== clusterId\n        );\n      }\n      const edges = graph.edges(node);\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Copying Edges\", edges);\n      edges.forEach((edge) => {\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Edge\", edge);\n        const data2 = graph.edge(edge.v, edge.w, edge.name);\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Edge data\", data2, rootId);\n        try {\n          if (edgeInCluster(edge, rootId)) {\n            _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Copying as \", edge.v, edge.w, data2, edge.name);\n            newGraph.setEdge(edge.v, edge.w, data2, edge.name);\n            _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"newGraph edges \", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n          } else {\n            _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\n              \"Skipping copy of edge \",\n              edge.v,\n              \"-->\",\n              edge.w,\n              \" rootId: \",\n              rootId,\n              \" clusterId:\",\n              clusterId\n            );\n          }\n        } catch (e) {\n          _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.error(e);\n        }\n      });\n    }\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Removing node\", node);\n    graph.removeNode(node);\n  });\n};\nconst extractDescendants = (id, graph) => {\n  const children = graph.children(id);\n  let res = [...children];\n  for (const child of children) {\n    parents[child] = id;\n    res = [...res, ...extractDescendants(child, graph)];\n  }\n  return res;\n};\nconst findNonClusterChild = (id, graph) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Searching\", id);\n  const children = graph.children(id);\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Searching children of id \", id, children);\n  if (children.length < 1) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"This is a valid node\", id);\n    return id;\n  }\n  for (const child of children) {\n    const _id = findNonClusterChild(child, graph);\n    if (_id) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Found replacement for\", id, \" => \", _id);\n      return _id;\n    }\n  }\n};\nconst getAnchorId = (id) => {\n  if (!clusterDb[id]) {\n    return id;\n  }\n  if (!clusterDb[id].externalConnections) {\n    return id;\n  }\n  if (clusterDb[id]) {\n    return clusterDb[id].id;\n  }\n  return id;\n};\nconst adjustClustersAndEdges = (graph, depth) => {\n  if (!graph || depth > 10) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Opting out, no graph \");\n    return;\n  } else {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Opting in, graph \");\n  }\n  graph.nodes().forEach(function(id) {\n    const children = graph.children(id);\n    if (children.length > 0) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\n        \"Cluster identified\",\n        id,\n        \" Replacement id in edges: \",\n        findNonClusterChild(id, graph)\n      );\n      descendants[id] = extractDescendants(id, graph);\n      clusterDb[id] = { id: findNonClusterChild(id, graph), clusterData: graph.node(id) };\n    }\n  });\n  graph.nodes().forEach(function(id) {\n    const children = graph.children(id);\n    const edges = graph.edges();\n    if (children.length > 0) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Cluster identified\", id, descendants);\n      edges.forEach((edge) => {\n        if (edge.v !== id && edge.w !== id) {\n          const d1 = isDescendant(edge.v, id);\n          const d2 = isDescendant(edge.w, id);\n          if (d1 ^ d2) {\n            _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Edge: \", edge, \" leaves cluster \", id);\n            _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Decendants of XXX \", id, \": \", descendants[id]);\n            clusterDb[id].externalConnections = true;\n          }\n        }\n      });\n    } else {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Not a cluster \", id, descendants);\n    }\n  });\n  graph.edges().forEach(function(e) {\n    const edge = graph.edge(e);\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n    let v = e.v;\n    let w = e.w;\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\n      \"Fix XXX\",\n      clusterDb,\n      \"ids:\",\n      e.v,\n      e.w,\n      \"Translating: \",\n      clusterDb[e.v],\n      \" --- \",\n      clusterDb[e.w]\n    );\n    if (clusterDb[e.v] && clusterDb[e.w] && clusterDb[e.v] === clusterDb[e.w]) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Fixing and trixing link to self - removing XXX\", e.v, e.w, e.name);\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Fixing and trixing - removing XXX\", e.v, e.w, e.name);\n      v = getAnchorId(e.v);\n      w = getAnchorId(e.w);\n      graph.removeEdge(e.v, e.w, e.name);\n      const specialId = e.w + \"---\" + e.v;\n      graph.setNode(specialId, {\n        domId: specialId,\n        id: specialId,\n        labelStyle: \"\",\n        labelText: edge.label,\n        padding: 0,\n        shape: \"labelRect\",\n        style: \"\"\n      });\n      const edge1 = structuredClone(edge);\n      const edge2 = structuredClone(edge);\n      edge1.label = \"\";\n      edge1.arrowTypeEnd = \"none\";\n      edge2.label = \"\";\n      edge1.fromCluster = e.v;\n      edge2.toCluster = e.v;\n      graph.setEdge(v, specialId, edge1, e.name + \"-cyclic-special\");\n      graph.setEdge(specialId, w, edge2, e.name + \"-cyclic-special\");\n    } else if (clusterDb[e.v] || clusterDb[e.w]) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Fixing and trixing - removing XXX\", e.v, e.w, e.name);\n      v = getAnchorId(e.v);\n      w = getAnchorId(e.w);\n      graph.removeEdge(e.v, e.w, e.name);\n      if (v !== e.v) {\n        edge.fromCluster = e.v;\n      }\n      if (w !== e.w) {\n        edge.toCluster = e.w;\n      }\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Fix Replacing with XXX\", v, w, e.name);\n      graph.setEdge(v, w, edge, e.name);\n    }\n  });\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Adjusted Graph\", dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph));\n  extractor(graph, 0);\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(clusterDb);\n};\nconst extractor = (graph, depth) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"extractor - \", depth, dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph), graph.children(\"D\"));\n  if (depth > 10) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.error(\"Bailing out\");\n    return;\n  }\n  let nodes = graph.nodes();\n  let hasChildren = false;\n  for (const node of nodes) {\n    const children = graph.children(node);\n    hasChildren = hasChildren || children.length > 0;\n  }\n  if (!hasChildren) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Done, no node has children\", graph.nodes());\n    return;\n  }\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Nodes = \", nodes, depth);\n  for (const node of nodes) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\n      \"Extracting node\",\n      node,\n      clusterDb,\n      clusterDb[node] && !clusterDb[node].externalConnections,\n      !graph.parent(node),\n      graph.node(node),\n      graph.children(\"D\"),\n      \" Depth \",\n      depth\n    );\n    if (!clusterDb[node]) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Not a cluster\", node, depth);\n    } else if (!clusterDb[node].externalConnections && // !graph.parent(node) &&\n    graph.children(node) && graph.children(node).length > 0) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\n        \"Cluster without external connections, without a parent and with children\",\n        node,\n        depth\n      );\n      const graphSettings = graph.graph();\n      let dir = graphSettings.rankdir === \"TB\" ? \"LR\" : \"TB\";\n      if (clusterDb[node] && clusterDb[node].clusterData && clusterDb[node].clusterData.dir) {\n        dir = clusterDb[node].clusterData.dir;\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Fixing dir\", clusterDb[node].clusterData.dir, dir);\n      }\n      const clusterGraph = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_2__.Graph({\n        multigraph: true,\n        compound: true\n      }).setGraph({\n        rankdir: dir,\n        // Todo: set proper spacing\n        nodesep: 50,\n        ranksep: 50,\n        marginx: 8,\n        marginy: 8\n      }).setDefaultEdgeLabel(function() {\n        return {};\n      });\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Old graph before copy\", dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph));\n      copy(node, graph, clusterGraph, node);\n      graph.setNode(node, {\n        clusterNode: true,\n        id: node,\n        clusterData: clusterDb[node].clusterData,\n        labelText: clusterDb[node].labelText,\n        graph: clusterGraph\n      });\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"New graph after copy node: (\", node, \")\", dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(clusterGraph));\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(\"Old graph after copy\", dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph));\n    } else {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\n        \"Cluster ** \",\n        node,\n        \" **not meeting the criteria !externalConnections:\",\n        !clusterDb[node].externalConnections,\n        \" no parent: \",\n        !graph.parent(node),\n        \" children \",\n        graph.children(node) && graph.children(node).length > 0,\n        graph.children(\"D\"),\n        depth\n      );\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.debug(clusterDb);\n    }\n  }\n  nodes = graph.nodes();\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"New list of nodes\", nodes);\n  for (const node of nodes) {\n    const data = graph.node(node);\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\" Now next level\", node, data);\n    if (data.clusterNode) {\n      extractor(data.graph, depth + 1);\n    }\n  }\n};\nconst sorter = (graph, nodes) => {\n  if (nodes.length === 0) {\n    return [];\n  }\n  let result = Object.assign(nodes);\n  nodes.forEach((node) => {\n    const children = graph.children(node);\n    const sorted = sorter(graph, children);\n    result = [...result, ...sorted];\n  });\n  return result;\n};\nconst sortNodesByHierarchy = (graph) => sorter(graph, graph.children());\nconst rect = (parent, node) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Creating subgraph rect for \", node.id, node);\n  const shapeSvg = parent.insert(\"g\").attr(\"class\", \"cluster\" + (node.class ? \" \" + node.class : \"\")).attr(\"id\", node.id);\n  const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n  const useHtmlLabels = (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.m)((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.c)().flowchart.htmlLabels);\n  const label = shapeSvg.insert(\"g\").attr(\"class\", \"cluster-label\");\n  const text = node.labelType === \"markdown\" ? (0,_createText_a48a4c90_js__WEBPACK_IMPORTED_MODULE_5__.a)(label, node.labelText, { style: node.labelStyle, useHtmlLabels }) : label.node().appendChild((0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.c)(node.labelText, node.labelStyle, void 0, true));\n  let bbox = text.getBBox();\n  if ((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.m)((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.c)().flowchart.htmlLabels)) {\n    const div = text.children[0];\n    const dv = (0,d3__WEBPACK_IMPORTED_MODULE_3__.select)(text);\n    bbox = div.getBoundingClientRect();\n    dv.attr(\"width\", bbox.width);\n    dv.attr(\"height\", bbox.height);\n  }\n  const padding = 0 * node.padding;\n  const halfPadding = padding / 2;\n  const width = node.width <= bbox.width + padding ? bbox.width + padding : node.width;\n  if (node.width <= bbox.width + padding) {\n    node.diff = (bbox.width - node.width) / 2 - node.padding / 2;\n  } else {\n    node.diff = -node.padding / 2;\n  }\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Data \", node, JSON.stringify(node));\n  rect2.attr(\"style\", node.style).attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"x\", node.x - width / 2).attr(\"y\", node.y - node.height / 2 - halfPadding).attr(\"width\", width).attr(\"height\", node.height + padding);\n  if (useHtmlLabels) {\n    label.attr(\n      \"transform\",\n      // This puts the labal on top of the box instead of inside it\n      \"translate(\" + (node.x - bbox.width / 2) + \", \" + (node.y - node.height / 2) + \")\"\n    );\n  } else {\n    label.attr(\n      \"transform\",\n      // This puts the labal on top of the box instead of inside it\n      \"translate(\" + node.x + \", \" + (node.y - node.height / 2) + \")\"\n    );\n  }\n  const rectBox = rect2.node().getBBox();\n  node.width = rectBox.width;\n  node.height = rectBox.height;\n  node.intersect = function(point) {\n    return (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.i)(node, point);\n  };\n  return shapeSvg;\n};\nconst noteGroup = (parent, node) => {\n  const shapeSvg = parent.insert(\"g\").attr(\"class\", \"note-cluster\").attr(\"id\", node.id);\n  const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n  const padding = 0 * node.padding;\n  const halfPadding = padding / 2;\n  rect2.attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"x\", node.x - node.width / 2 - halfPadding).attr(\"y\", node.y - node.height / 2 - halfPadding).attr(\"width\", node.width + padding).attr(\"height\", node.height + padding).attr(\"fill\", \"none\");\n  const rectBox = rect2.node().getBBox();\n  node.width = rectBox.width;\n  node.height = rectBox.height;\n  node.intersect = function(point) {\n    return (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.i)(node, point);\n  };\n  return shapeSvg;\n};\nconst roundedWithTitle = (parent, node) => {\n  const shapeSvg = parent.insert(\"g\").attr(\"class\", node.classes).attr(\"id\", node.id);\n  const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n  const label = shapeSvg.insert(\"g\").attr(\"class\", \"cluster-label\");\n  const innerRect = shapeSvg.append(\"rect\");\n  const text = label.node().appendChild((0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.c)(node.labelText, node.labelStyle, void 0, true));\n  let bbox = text.getBBox();\n  if ((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.m)((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.c)().flowchart.htmlLabels)) {\n    const div = text.children[0];\n    const dv = (0,d3__WEBPACK_IMPORTED_MODULE_3__.select)(text);\n    bbox = div.getBoundingClientRect();\n    dv.attr(\"width\", bbox.width);\n    dv.attr(\"height\", bbox.height);\n  }\n  bbox = text.getBBox();\n  const padding = 0 * node.padding;\n  const halfPadding = padding / 2;\n  const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;\n  if (node.width <= bbox.width + node.padding) {\n    node.diff = (bbox.width + node.padding * 0 - node.width) / 2;\n  } else {\n    node.diff = -node.padding / 2;\n  }\n  rect2.attr(\"class\", \"outer\").attr(\"x\", node.x - width / 2 - halfPadding).attr(\"y\", node.y - node.height / 2 - halfPadding).attr(\"width\", width + padding).attr(\"height\", node.height + padding);\n  innerRect.attr(\"class\", \"inner\").attr(\"x\", node.x - width / 2 - halfPadding).attr(\"y\", node.y - node.height / 2 - halfPadding + bbox.height - 1).attr(\"width\", width + padding).attr(\"height\", node.height + padding - bbox.height - 3);\n  label.attr(\n    \"transform\",\n    \"translate(\" + (node.x - bbox.width / 2) + \", \" + (node.y - node.height / 2 - node.padding / 3 + ((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.m)((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.c)().flowchart.htmlLabels) ? 5 : 3)) + \")\"\n  );\n  const rectBox = rect2.node().getBBox();\n  node.height = rectBox.height;\n  node.intersect = function(point) {\n    return (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.i)(node, point);\n  };\n  return shapeSvg;\n};\nconst divider = (parent, node) => {\n  const shapeSvg = parent.insert(\"g\").attr(\"class\", node.classes).attr(\"id\", node.id);\n  const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n  const padding = 0 * node.padding;\n  const halfPadding = padding / 2;\n  rect2.attr(\"class\", \"divider\").attr(\"x\", node.x - node.width / 2 - halfPadding).attr(\"y\", node.y - node.height / 2).attr(\"width\", node.width + padding).attr(\"height\", node.height + padding);\n  const rectBox = rect2.node().getBBox();\n  node.width = rectBox.width;\n  node.height = rectBox.height;\n  node.diff = -node.padding / 2;\n  node.intersect = function(point) {\n    return (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.i)(node, point);\n  };\n  return shapeSvg;\n};\nconst shapes = { rect, roundedWithTitle, noteGroup, divider };\nlet clusterElems = {};\nconst insertCluster = (elem, node) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Inserting cluster\");\n  const shape = node.shape || \"rect\";\n  clusterElems[node.id] = shapes[shape](elem, node);\n};\nconst clear = () => {\n  clusterElems = {};\n};\nconst recursiveRender = async (_elem, graph, diagramtype, id, parentCluster) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Graph in recursive render: XXX\", dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph), parentCluster);\n  const dir = graph.graph().rankdir;\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Dir in recursive render - dir:\", dir);\n  const elem = _elem.insert(\"g\").attr(\"class\", \"root\");\n  if (!graph.nodes()) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"No nodes found for\", graph);\n  } else {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Recursive render XXX\", graph.nodes());\n  }\n  if (graph.edges().length > 0) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Recursive edges\", graph.edge(graph.edges()[0]));\n  }\n  const clusters = elem.insert(\"g\").attr(\"class\", \"clusters\");\n  const edgePaths = elem.insert(\"g\").attr(\"class\", \"edgePaths\");\n  const edgeLabels = elem.insert(\"g\").attr(\"class\", \"edgeLabels\");\n  const nodes = elem.insert(\"g\").attr(\"class\", \"nodes\");\n  await Promise.all(\n    graph.nodes().map(async function(v) {\n      const node = graph.node(v);\n      if (parentCluster !== void 0) {\n        const data = JSON.parse(JSON.stringify(parentCluster.clusterData));\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Setting data for cluster XXX (\", v, \") \", data, parentCluster);\n        graph.setNode(parentCluster.id, data);\n        if (!graph.parent(v)) {\n          _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.trace(\"Setting parent\", v, parentCluster.id);\n          graph.setParent(v, parentCluster.id, data);\n        }\n      }\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"(Insert) Node XXX\" + v + \": \" + JSON.stringify(graph.node(v)));\n      if (node && node.clusterNode) {\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Cluster identified\", v, node.width, graph.node(v));\n        const o = await recursiveRender(nodes, node.graph, diagramtype, id, graph.node(v));\n        const newEl = o.elem;\n        (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.u)(node, newEl);\n        node.diff = o.diff || 0;\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Node bounds (abc123)\", v, node, node.width, node.x, node.y);\n        (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.s)(newEl, node);\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Recursive render complete \", newEl, node);\n      } else {\n        if (graph.children(v).length > 0) {\n          _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Cluster - the non recursive path XXX\", v, node.id, node, graph);\n          _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(findNonClusterChild(node.id, graph));\n          clusterDb[node.id] = { id: findNonClusterChild(node.id, graph), node };\n        } else {\n          _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Node - the non recursive path\", v, node.id, node);\n          await (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.e)(nodes, graph.node(v), dir);\n        }\n      }\n    })\n  );\n  graph.edges().forEach(function(e) {\n    const edge = graph.edge(e.v, e.w, e.name);\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Edge \" + e.v + \" -> \" + e.w + \": \", e, \" \", JSON.stringify(graph.edge(e)));\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Fix\", clusterDb, \"ids:\", e.v, e.w, \"Translateing: \", clusterDb[e.v], clusterDb[e.w]);\n    (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.f)(edgeLabels, edge);\n  });\n  graph.edges().forEach(function(e) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n  });\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"#############################################\");\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"###                Layout                 ###\");\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"#############################################\");\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(graph);\n  (0,dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_0__.layout)(graph);\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Graph after layout:\", dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph));\n  let diff = 0;\n  sortNodesByHierarchy(graph).forEach(function(v) {\n    const node = graph.node(v);\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Position \" + v + \": \" + JSON.stringify(graph.node(v)));\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\n      \"Position \" + v + \": (\" + node.x,\n      \",\" + node.y,\n      \") width: \",\n      node.width,\n      \" height: \",\n      node.height\n    );\n    if (node && node.clusterNode) {\n      (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.p)(node);\n    } else {\n      if (graph.children(v).length > 0) {\n        insertCluster(clusters, node);\n        clusterDb[node.id].node = node;\n      } else {\n        (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.p)(node);\n      }\n    }\n  });\n  graph.edges().forEach(function(e) {\n    const edge = graph.edge(e);\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(edge), edge);\n    const paths = (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.g)(edgePaths, e, edge, clusterDb, diagramtype, graph, id);\n    (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.h)(edge, paths);\n  });\n  graph.nodes().forEach(function(v) {\n    const n = graph.node(v);\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.info(v, n.type, n.diff);\n    if (n.type === \"group\") {\n      diff = n.diff;\n    }\n  });\n  return { elem, diff };\n};\nconst render = async (elem, graph, markers, diagramtype, id) => {\n  (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.a)(elem, markers, diagramtype, id);\n  (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.b)();\n  (0,_edges_5ec2587c_js__WEBPACK_IMPORTED_MODULE_6__.d)();\n  clear();\n  clear$1();\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Graph at first:\", JSON.stringify(dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph)));\n  adjustClustersAndEdges(graph);\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.l.warn(\"Graph after:\", JSON.stringify(dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_1__.write(graph)));\n  await recursiveRender(elem, graph, diagramtype, id);\n};\n\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/mermaid/dist/index-0980fb80.js?");

/***/ })

}]);