"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_stateDiagram-b8fc1844_js"],{

/***/ "../node_modules/mermaid/dist/stateDiagram-b8fc1844.js":
/*!*************************************************************!*\
  !*** ../node_modules/mermaid/dist/stateDiagram-b8fc1844.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 */   diagram: () => (/* binding */ diagram)\n/* harmony export */ });\n/* harmony import */ var _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./styles-401768ef.js */ \"../node_modules/mermaid/dist/styles-401768ef.js\");\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ \"../node_modules/d3/src/index.js\");\n/* harmony import */ var dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_1__ = __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_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 _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mermaid-04fb0060.js */ \"../node_modules/mermaid/dist/mermaid-04fb0060.js\");\n/* harmony import */ var ts_dedent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ts-dedent */ \"../node_modules/ts-dedent/esm/index.js\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dayjs */ \"../node_modules/dayjs/dayjs.min.js\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @braintree/sanitize-url */ \"../node_modules/@braintree/sanitize-url/dist/index.js\");\n/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dompurify */ \"../node_modules/dompurify/dist/purify.js\");\n/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst idCache = {};\nconst set = (key, val) => {\n  idCache[key] = val;\n};\nconst get = (k) => idCache[k];\nconst keys = () => Object.keys(idCache);\nconst size = () => keys().length;\nconst idCache$1 = {\n  get,\n  set,\n  keys,\n  size\n};\nconst drawStartState = (g) => g.append(\"circle\").attr(\"class\", \"start-state\").attr(\"r\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit).attr(\"cx\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit).attr(\"cy\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit);\nconst drawDivider = (g) => g.append(\"line\").style(\"stroke\", \"grey\").style(\"stroke-dasharray\", \"3\").attr(\"x1\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight).attr(\"class\", \"divider\").attr(\"x2\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight * 2).attr(\"y1\", 0).attr(\"y2\", 0);\nconst drawSimpleState = (g, stateDef) => {\n  const state = g.append(\"text\").attr(\"x\", 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"y\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"font-size\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.fontSize).attr(\"class\", \"state-title\").text(stateDef.id);\n  const classBox = state.node().getBBox();\n  g.insert(\"rect\", \":first-child\").attr(\"x\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"y\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"width\", classBox.width + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"height\", classBox.height + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"rx\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.radius);\n  return state;\n};\nconst drawDescrState = (g, stateDef) => {\n  const addTspan = function(textEl, txt, isFirst2) {\n    const tSpan = textEl.append(\"tspan\").attr(\"x\", 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).text(txt);\n    if (!isFirst2) {\n      tSpan.attr(\"dy\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight);\n    }\n  };\n  const title = g.append(\"text\").attr(\"x\", 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"y\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight + 1.3 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"font-size\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.fontSize).attr(\"class\", \"state-title\").text(stateDef.descriptions[0]);\n  const titleBox = title.node().getBBox();\n  const titleHeight = titleBox.height;\n  const description = g.append(\"text\").attr(\"x\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\n    \"y\",\n    titleHeight + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding * 0.4 + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.dividerMargin + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight\n  ).attr(\"class\", \"state-description\");\n  let isFirst = true;\n  let isSecond = true;\n  stateDef.descriptions.forEach(function(descr) {\n    if (!isFirst) {\n      addTspan(description, descr, isSecond);\n      isSecond = false;\n    }\n    isFirst = false;\n  });\n  const descrLine = g.append(\"line\").attr(\"x1\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"y1\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + titleHeight + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.dividerMargin / 2).attr(\"y2\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + titleHeight + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.dividerMargin / 2).attr(\"class\", \"descr-divider\");\n  const descrBox = description.node().getBBox();\n  const width = Math.max(descrBox.width, titleBox.width);\n  descrLine.attr(\"x2\", width + 3 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding);\n  g.insert(\"rect\", \":first-child\").attr(\"x\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"y\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"width\", width + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"height\", descrBox.height + titleHeight + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"rx\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.radius);\n  return g;\n};\nconst addTitleAndBox = (g, stateDef, altBkg) => {\n  const pad = (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding;\n  const dblPad = 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding;\n  const orgBox = g.node().getBBox();\n  const orgWidth = orgBox.width;\n  const orgX = orgBox.x;\n  const title = g.append(\"text\").attr(\"x\", 0).attr(\"y\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.titleShift).attr(\"font-size\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.fontSize).attr(\"class\", \"state-title\").text(stateDef.id);\n  const titleBox = title.node().getBBox();\n  const titleWidth = titleBox.width + dblPad;\n  let width = Math.max(titleWidth, orgWidth);\n  if (width === orgWidth) {\n    width = width + dblPad;\n  }\n  let startX;\n  const graphBox = g.node().getBBox();\n  if (stateDef.doc)\n    ;\n  startX = orgX - pad;\n  if (titleWidth > orgWidth) {\n    startX = (orgWidth - width) / 2 + pad;\n  }\n  if (Math.abs(orgX - graphBox.x) < pad && titleWidth > orgWidth) {\n    startX = orgX - (titleWidth - orgWidth) / 2;\n  }\n  const lineY = 1 - (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight;\n  g.insert(\"rect\", \":first-child\").attr(\"x\", startX).attr(\"y\", lineY).attr(\"class\", altBkg ? \"alt-composit\" : \"composit\").attr(\"width\", width).attr(\n    \"height\",\n    graphBox.height + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.titleShift + 1\n  ).attr(\"rx\", \"0\");\n  title.attr(\"x\", startX + pad);\n  if (titleWidth <= orgWidth) {\n    title.attr(\"x\", orgX + (width - dblPad) / 2 - titleWidth / 2 + pad);\n  }\n  g.insert(\"rect\", \":first-child\").attr(\"x\", startX).attr(\n    \"y\",\n    (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.titleShift - (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight - (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding\n  ).attr(\"width\", width).attr(\"height\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight * 3).attr(\"rx\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.radius);\n  g.insert(\"rect\", \":first-child\").attr(\"x\", startX).attr(\n    \"y\",\n    (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.titleShift - (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight - (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding\n  ).attr(\"width\", width).attr(\"height\", graphBox.height + 3 + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.textHeight).attr(\"rx\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.radius);\n  return g;\n};\nconst drawEndState = (g) => {\n  g.append(\"circle\").attr(\"class\", \"end-state-outer\").attr(\"r\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.miniPadding).attr(\n    \"cx\",\n    (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.miniPadding\n  ).attr(\n    \"cy\",\n    (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.miniPadding\n  );\n  return g.append(\"circle\").attr(\"class\", \"end-state-inner\").attr(\"r\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit).attr(\"cx\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit + 2).attr(\"cy\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.sizeUnit + 2);\n};\nconst drawForkJoinState = (g, stateDef) => {\n  let width = (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.forkWidth;\n  let height = (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.forkHeight;\n  if (stateDef.parentId) {\n    let tmp = width;\n    width = height;\n    height = tmp;\n  }\n  return g.append(\"rect\").style(\"stroke\", \"black\").style(\"fill\", \"black\").attr(\"width\", width).attr(\"height\", height).attr(\"x\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"y\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding);\n};\nconst _drawLongText = (_text, x, y, g) => {\n  let textHeight = 0;\n  const textElem = g.append(\"text\");\n  textElem.style(\"text-anchor\", \"start\");\n  textElem.attr(\"class\", \"noteText\");\n  let text = _text.replace(/\\r\\n/g, \"<br/>\");\n  text = text.replace(/\\n/g, \"<br/>\");\n  const lines = text.split(_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.e.lineBreakRegex);\n  let tHeight = 1.25 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.noteMargin;\n  for (const line2 of lines) {\n    const txt = line2.trim();\n    if (txt.length > 0) {\n      const span = textElem.append(\"tspan\");\n      span.text(txt);\n      if (tHeight === 0) {\n        const textBounds = span.node().getBBox();\n        tHeight += textBounds.height;\n      }\n      textHeight += tHeight;\n      span.attr(\"x\", x + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.noteMargin);\n      span.attr(\"y\", y + textHeight + 1.25 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.noteMargin);\n    }\n  }\n  return { textWidth: textElem.node().getBBox().width, textHeight };\n};\nconst drawNote = (text, g) => {\n  g.attr(\"class\", \"state-note\");\n  const note = g.append(\"rect\").attr(\"x\", 0).attr(\"y\", (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding);\n  const rectElem = g.append(\"g\");\n  const { textWidth, textHeight } = _drawLongText(text, 0, 0, rectElem);\n  note.attr(\"height\", textHeight + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.noteMargin);\n  note.attr(\"width\", textWidth + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.noteMargin * 2);\n  return note;\n};\nconst drawState = function(elem, stateDef) {\n  const id = stateDef.id;\n  const stateInfo = {\n    id,\n    label: stateDef.id,\n    width: 0,\n    height: 0\n  };\n  const g = elem.append(\"g\").attr(\"id\", id).attr(\"class\", \"stateGroup\");\n  if (stateDef.type === \"start\") {\n    drawStartState(g);\n  }\n  if (stateDef.type === \"end\") {\n    drawEndState(g);\n  }\n  if (stateDef.type === \"fork\" || stateDef.type === \"join\") {\n    drawForkJoinState(g, stateDef);\n  }\n  if (stateDef.type === \"note\") {\n    drawNote(stateDef.note.text, g);\n  }\n  if (stateDef.type === \"divider\") {\n    drawDivider(g);\n  }\n  if (stateDef.type === \"default\" && stateDef.descriptions.length === 0) {\n    drawSimpleState(g, stateDef);\n  }\n  if (stateDef.type === \"default\" && stateDef.descriptions.length > 0) {\n    drawDescrState(g, stateDef);\n  }\n  const stateBox = g.node().getBBox();\n  stateInfo.width = stateBox.width + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding;\n  stateInfo.height = stateBox.height + 2 * (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding;\n  idCache$1.set(id, stateInfo);\n  return stateInfo;\n};\nlet edgeCount = 0;\nconst drawEdge = function(elem, path, relation) {\n  const getRelationType = function(type) {\n    switch (type) {\n      case _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d.relationType.AGGREGATION:\n        return \"aggregation\";\n      case _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d.relationType.EXTENSION:\n        return \"extension\";\n      case _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d.relationType.COMPOSITION:\n        return \"composition\";\n      case _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d.relationType.DEPENDENCY:\n        return \"dependency\";\n    }\n  };\n  path.points = path.points.filter((p) => !Number.isNaN(p.y));\n  const lineData = path.points;\n  const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__.line)().x(function(d) {\n    return d.x;\n  }).y(function(d) {\n    return d.y;\n  }).curve(d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis);\n  const svgPath = elem.append(\"path\").attr(\"d\", lineFunction(lineData)).attr(\"id\", \"edge\" + edgeCount).attr(\"class\", \"transition\");\n  let url = \"\";\n  if ((0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.arrowMarkerAbsolute) {\n    url = window.location.protocol + \"//\" + window.location.host + window.location.pathname + window.location.search;\n    url = url.replace(/\\(/g, \"\\\\(\");\n    url = url.replace(/\\)/g, \"\\\\)\");\n  }\n  svgPath.attr(\n    \"marker-end\",\n    \"url(\" + url + \"#\" + getRelationType(_styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d.relationType.DEPENDENCY) + \"End)\"\n  );\n  if (relation.title !== void 0) {\n    const label = elem.append(\"g\").attr(\"class\", \"stateLabel\");\n    const { x, y } = _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.u.calcLabelPosition(path.points);\n    const rows = _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.e.getRows(relation.title);\n    let titleHeight = 0;\n    const titleRows = [];\n    let maxWidth = 0;\n    let minX = 0;\n    for (let i = 0; i <= rows.length; i++) {\n      const title = label.append(\"text\").attr(\"text-anchor\", \"middle\").text(rows[i]).attr(\"x\", x).attr(\"y\", y + titleHeight);\n      const boundstmp = title.node().getBBox();\n      maxWidth = Math.max(maxWidth, boundstmp.width);\n      minX = Math.min(minX, boundstmp.x);\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.info(boundstmp.x, x, y + titleHeight);\n      if (titleHeight === 0) {\n        const titleBox = title.node().getBBox();\n        titleHeight = titleBox.height;\n        _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.info(\"Title height\", titleHeight, y);\n      }\n      titleRows.push(title);\n    }\n    let boxHeight = titleHeight * rows.length;\n    if (rows.length > 1) {\n      const heightAdj = (rows.length - 1) * titleHeight * 0.5;\n      titleRows.forEach((title, i) => title.attr(\"y\", y + i * titleHeight - heightAdj));\n      boxHeight = titleHeight * rows.length;\n    }\n    const bounds = label.node().getBBox();\n    label.insert(\"rect\", \":first-child\").attr(\"class\", \"box\").attr(\"x\", x - maxWidth / 2 - (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding / 2).attr(\"y\", y - boxHeight / 2 - (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding / 2 - 3.5).attr(\"width\", maxWidth + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding).attr(\"height\", boxHeight + (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state.padding);\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.info(bounds);\n  }\n  edgeCount++;\n};\nlet conf;\nconst transformationLog = {};\nconst setConf = function() {\n};\nconst insertMarkers = function(elem) {\n  elem.append(\"defs\").append(\"marker\").attr(\"id\", \"dependencyEnd\").attr(\"refX\", 19).attr(\"refY\", 7).attr(\"markerWidth\", 20).attr(\"markerHeight\", 28).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 19,7 L9,13 L14,7 L9,1 Z\");\n};\nconst draw = function(text, id, _version, diagObj) {\n  conf = (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().state;\n  const securityLevel = (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.c)().securityLevel;\n  let sandboxElement;\n  if (securityLevel === \"sandbox\") {\n    sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(\"#i\" + id);\n  }\n  const root = securityLevel === \"sandbox\" ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(\"body\");\n  const doc = securityLevel === \"sandbox\" ? sandboxElement.nodes()[0].contentDocument : document;\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(\"Rendering diagram \" + text);\n  const diagram2 = root.select(`[id='${id}']`);\n  insertMarkers(diagram2);\n  const rootDoc = diagObj.db.getRootDoc();\n  renderDoc(rootDoc, diagram2, void 0, false, root, doc, diagObj);\n  const padding = conf.padding;\n  const bounds = diagram2.node().getBBox();\n  const width = bounds.width + padding * 2;\n  const height = bounds.height + padding * 2;\n  const svgWidth = width * 1.75;\n  (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.i)(diagram2, height, svgWidth, conf.useMaxWidth);\n  diagram2.attr(\n    \"viewBox\",\n    `${bounds.x - conf.padding}  ${bounds.y - conf.padding} ` + width + \" \" + height\n  );\n};\nconst getLabelWidth = (text) => {\n  return text ? text.length * conf.fontSizeFactor : 1;\n};\nconst renderDoc = (doc, diagram2, parentId, altBkg, root, domDocument, diagObj) => {\n  const graph = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_2__.Graph({\n    compound: true,\n    multigraph: true\n  });\n  let i;\n  let edgeFreeDoc = true;\n  for (i = 0; i < doc.length; i++) {\n    if (doc[i].stmt === \"relation\") {\n      edgeFreeDoc = false;\n      break;\n    }\n  }\n  if (parentId) {\n    graph.setGraph({\n      rankdir: \"LR\",\n      multigraph: true,\n      compound: true,\n      // acyclicer: 'greedy',\n      ranker: \"tight-tree\",\n      ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,\n      nodeSep: edgeFreeDoc ? 1 : 50,\n      isMultiGraph: true\n      // ranksep: 5,\n      // nodesep: 1\n    });\n  } else {\n    graph.setGraph({\n      rankdir: \"TB\",\n      multigraph: true,\n      compound: true,\n      // isCompound: true,\n      // acyclicer: 'greedy',\n      // ranker: 'longest-path'\n      ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,\n      nodeSep: edgeFreeDoc ? 1 : 50,\n      ranker: \"tight-tree\",\n      // ranker: 'network-simplex'\n      isMultiGraph: true\n    });\n  }\n  graph.setDefaultEdgeLabel(function() {\n    return {};\n  });\n  diagObj.db.extract(doc);\n  const states = diagObj.db.getStates();\n  const relations = diagObj.db.getRelations();\n  const keys2 = Object.keys(states);\n  for (const key of keys2) {\n    const stateDef = states[key];\n    if (parentId) {\n      stateDef.parentId = parentId;\n    }\n    let node;\n    if (stateDef.doc) {\n      let sub = diagram2.append(\"g\").attr(\"id\", stateDef.id).attr(\"class\", \"stateGroup\");\n      node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg, root, domDocument, diagObj);\n      {\n        sub = addTitleAndBox(sub, stateDef, altBkg);\n        let boxBounds = sub.node().getBBox();\n        node.width = boxBounds.width;\n        node.height = boxBounds.height + conf.padding / 2;\n        transformationLog[stateDef.id] = { y: conf.compositTitleSize };\n      }\n    } else {\n      node = drawState(diagram2, stateDef);\n    }\n    if (stateDef.note) {\n      const noteDef = {\n        descriptions: [],\n        id: stateDef.id + \"-note\",\n        note: stateDef.note,\n        type: \"note\"\n      };\n      const note = drawState(diagram2, noteDef);\n      if (stateDef.note.position === \"left of\") {\n        graph.setNode(node.id + \"-note\", note);\n        graph.setNode(node.id, node);\n      } else {\n        graph.setNode(node.id, node);\n        graph.setNode(node.id + \"-note\", note);\n      }\n      graph.setParent(node.id, node.id + \"-group\");\n      graph.setParent(node.id + \"-note\", node.id + \"-group\");\n    } else {\n      graph.setNode(node.id, node);\n    }\n  }\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(\"Count=\", graph.nodeCount(), graph);\n  let cnt = 0;\n  relations.forEach(function(relation) {\n    cnt++;\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(\"Setting edge\", relation);\n    graph.setEdge(\n      relation.id1,\n      relation.id2,\n      {\n        relation,\n        width: getLabelWidth(relation.title),\n        height: conf.labelHeight * _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.e.getRows(relation.title).length,\n        labelpos: \"c\"\n      },\n      \"id\" + cnt\n    );\n  });\n  (0,dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_1__.layout)(graph);\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(\"Graph after layout\", graph.nodes());\n  const svgElem = diagram2.node();\n  graph.nodes().forEach(function(v) {\n    if (v !== void 0 && graph.node(v) !== void 0) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.warn(\"Node \" + v + \": \" + JSON.stringify(graph.node(v)));\n      root.select(\"#\" + svgElem.id + \" #\" + v).attr(\n        \"transform\",\n        \"translate(\" + (graph.node(v).x - graph.node(v).width / 2) + \",\" + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + \" )\"\n      );\n      root.select(\"#\" + svgElem.id + \" #\" + v).attr(\"data-x-shift\", graph.node(v).x - graph.node(v).width / 2);\n      const dividers = domDocument.querySelectorAll(\"#\" + svgElem.id + \" #\" + v + \" .divider\");\n      dividers.forEach((divider) => {\n        const parent = divider.parentElement;\n        let pWidth = 0;\n        let pShift = 0;\n        if (parent) {\n          if (parent.parentElement) {\n            pWidth = parent.parentElement.getBBox().width;\n          }\n          pShift = parseInt(parent.getAttribute(\"data-x-shift\"), 10);\n          if (Number.isNaN(pShift)) {\n            pShift = 0;\n          }\n        }\n        divider.setAttribute(\"x1\", 0 - pShift + 8);\n        divider.setAttribute(\"x2\", pWidth - pShift - 8);\n      });\n    } else {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(\"No Node \" + v + \": \" + JSON.stringify(graph.node(v)));\n    }\n  });\n  let stateBox = svgElem.getBBox();\n  graph.edges().forEach(function(e) {\n    if (e !== void 0 && graph.edge(e) !== void 0) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n      drawEdge(diagram2, graph.edge(e), graph.edge(e).relation);\n    }\n  });\n  stateBox = svgElem.getBBox();\n  const stateInfo = {\n    id: parentId ? parentId : \"root\",\n    label: parentId ? parentId : \"root\",\n    width: 0,\n    height: 0\n  };\n  stateInfo.width = stateBox.width + 2 * conf.padding;\n  stateInfo.height = stateBox.height + 2 * conf.padding;\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(\"Doc rendered\", stateInfo, graph);\n  return stateInfo;\n};\nconst renderer = {\n  setConf,\n  draw\n};\nconst diagram = {\n  parser: _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.p,\n  db: _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d,\n  renderer,\n  styles: _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.s,\n  init: (cnf) => {\n    if (!cnf.state) {\n      cnf.state = {};\n    }\n    cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n    _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d.clear();\n  }\n};\n\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/mermaid/dist/stateDiagram-b8fc1844.js?");

/***/ })

}]);