"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_mdts_frontend"] = self["webpackChunk_mdts_frontend"] || []).push([["vendors-node_modules_mermaid_dist_chunks_mermaid_core_cynefinDiagram-TSTJHNR4_mjs"],{

/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs"
/*!**************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs ***!
  \**************************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   populateCommonDb: () => (/* binding */ populateCommonDb)\n/* harmony export */ });\n/* harmony import */ var _chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-Y2CYZVJY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs\");\n\n\n// src/diagrams/common/populateCommonDb.ts\nfunction populateCommonDb(ast, db) {\n  if (ast.accDescr) {\n    db.setAccDescription?.(ast.accDescr);\n  }\n  if (ast.accTitle) {\n    db.setAccTitle?.(ast.accTitle);\n  }\n  if (ast.title) {\n    db.setDiagramTitle?.(ast.title);\n  }\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_0__.__name)(populateCommonDb, \"populateCommonDb\");\n\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs?\n}");

/***/ },

/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-TSTJHNR4.mjs"
/*!***********************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-TSTJHNR4.mjs ***!
  \***********************************************************************************/
(__unused_webpack___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 _chunk_JWPE2WC7_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-JWPE2WC7.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs\");\n/* harmony import */ var _chunk_VAUOI2AC_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-VAUOI2AC.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-VAUOI2AC.mjs\");\n/* harmony import */ var _chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-ICXQ74PX.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICXQ74PX.mjs\");\n/* harmony import */ var _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-WYO6CB5R.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-WYO6CB5R.mjs\");\n/* harmony import */ var _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-X3CZISLH.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-X3CZISLH.mjs\");\n/* harmony import */ var _chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chunk-Y2CYZVJY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs\");\n/* harmony import */ var _mermaid_js_parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @mermaid-js/parser */ \"./node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs\");\n\n\n\n\n\n\n\n// src/diagrams/cynefin/cynefinParser.ts\n\n\n// src/diagrams/cynefin/cynefinDb.ts\nvar createDefaultData = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => ({\n  domains: /* @__PURE__ */ new Map(),\n  transitions: []\n}), \"createDefaultData\");\nvar data = createDefaultData();\nvar getDomains = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => data.domains, \"getDomains\");\nvar getTransitions = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => data.transitions, \"getTransitions\");\nvar setDomains = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((blocks) => {\n  if (!blocks) {\n    return;\n  }\n  for (const block of blocks) {\n    const domainName = block.domain;\n    const items = (block.items ?? []).map((item) => ({\n      label: item.label\n    }));\n    data.domains.set(domainName, {\n      name: domainName,\n      items\n    });\n  }\n}, \"setDomains\");\nvar setTransitions = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((transitions) => {\n  if (!transitions) {\n    return;\n  }\n  data.transitions = transitions.filter((t) => {\n    if (t.from === t.to) {\n      _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.warn(\n        `Cynefin: self-loop transition on domain \"${t.from}\" is not meaningful and will be skipped.`\n      );\n      return false;\n    }\n    return true;\n  }).map((t) => ({\n    from: t.from,\n    to: t.to,\n    label: t.label || void 0\n  }));\n}, \"setTransitions\");\nvar getConfig2 = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => {\n  return (0,_chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_2__.cleanAndMerge)({\n    ..._chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.defaultConfig_default.cynefin,\n    ...(0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getConfig)().cynefin\n  });\n}, \"getConfig\");\nvar clear2 = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => {\n  (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.clear)();\n  data = createDefaultData();\n}, \"clear\");\nvar db = {\n  getDomains,\n  getTransitions,\n  setDomains,\n  setTransitions,\n  getConfig: getConfig2,\n  clear: clear2,\n  setAccTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.setAccTitle,\n  getAccTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getAccTitle,\n  setDiagramTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.setDiagramTitle,\n  getDiagramTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getDiagramTitle,\n  getAccDescription: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getAccDescription,\n  setAccDescription: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.setAccDescription\n};\n\n// src/diagrams/cynefin/cynefinParser.ts\nvar populate = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((ast) => {\n  (0,_chunk_JWPE2WC7_mjs__WEBPACK_IMPORTED_MODULE_0__.populateCommonDb)(ast, db);\n  db.setDomains(ast.domains);\n  db.setTransitions(ast.transitions);\n}, \"populate\");\nvar parser = {\n  parse: /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(async (input) => {\n    const ast = await (0,_mermaid_js_parser__WEBPACK_IMPORTED_MODULE_6__.parse)(\"cynefin\", input);\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(ast);\n    populate(ast);\n  }, \"parse\")\n};\n\n// src/diagrams/cynefin/cynefinBoundaries.ts\nfunction seededRandom(seed) {\n  let t = seed + 1831565813 | 0;\n  t = Math.imul(t ^ t >>> 15, t | 1);\n  t ^= t + Math.imul(t ^ t >>> 7, t | 61);\n  return ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(seededRandom, \"seededRandom\");\nfunction hashString(str) {\n  let hash = 0;\n  for (let i = 0; i < str.length; i++) {\n    const ch = str.charCodeAt(i);\n    hash = (hash << 5) - hash + ch;\n    hash |= 0;\n  }\n  return hash;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(hashString, \"hashString\");\nfunction resolveSeed(configuredSeed, id) {\n  if (typeof configuredSeed === \"number\" && Number.isFinite(configuredSeed) && configuredSeed !== 0) {\n    return configuredSeed;\n  }\n  return hashString(id);\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(resolveSeed, \"resolveSeed\");\nfunction generateFoldPath(width, height, seed, amplitudeOverride) {\n  const cx = width / 2;\n  const amplitude = amplitudeOverride ?? width * 0.015;\n  const segments = 7;\n  const segHeight = height / segments;\n  const points = [];\n  for (let i = 0; i <= segments; i++) {\n    const jitter = seededRandom(seed + i * 17) * amplitude * 2 - amplitude;\n    points.push({ x: cx + jitter, y: i * segHeight });\n  }\n  let d = `M${points[0].x},${points[0].y}`;\n  for (let i = 0; i < points.length - 1; i++) {\n    const p0 = points[i];\n    const p1 = points[i + 1];\n    const midY = (p0.y + p1.y) / 2;\n    const dir = i % 2 === 0 ? 1 : -1;\n    const offset = amplitude * 1.5 * dir * seededRandom(seed + i * 31 + 7);\n    const cp1x = p0.x + offset;\n    const cp1y = midY;\n    const cp2x = p1.x - offset;\n    const cp2y = midY;\n    d += ` C${cp1x},${cp1y} ${cp2x},${cp2y} ${p1.x},${p1.y}`;\n  }\n  return d;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(generateFoldPath, \"generateFoldPath\");\nfunction generateHorizontalBoundary(width, height, seed, amplitudeOverride) {\n  const cy = height / 2;\n  const amplitude = amplitudeOverride ?? height * 0.015;\n  const segments = 7;\n  const segWidth = width / segments;\n  const points = [];\n  for (let i = 0; i <= segments; i++) {\n    const jitter = seededRandom(seed + i * 23) * amplitude * 2 - amplitude;\n    points.push({ x: i * segWidth, y: cy + jitter });\n  }\n  let d = `M${points[0].x},${points[0].y}`;\n  for (let i = 0; i < points.length - 1; i++) {\n    const p0 = points[i];\n    const p1 = points[i + 1];\n    const midX = (p0.x + p1.x) / 2;\n    const dir = i % 2 === 0 ? 1 : -1;\n    const offset = amplitude * 1.5 * dir * seededRandom(seed + i * 37 + 11);\n    const cp1x = midX;\n    const cp1y = p0.y + offset;\n    const cp2x = midX;\n    const cp2y = p1.y - offset;\n    d += ` C${cp1x},${cp1y} ${cp2x},${cp2y} ${p1.x},${p1.y}`;\n  }\n  return d;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(generateHorizontalBoundary, \"generateHorizontalBoundary\");\nfunction generateCliffPath(width, height) {\n  const cx = width / 2;\n  const topY = height * 0.5;\n  const bottomY = height;\n  const amplitude = width * 0.03;\n  return [\n    `M${cx},${topY}`,\n    `C${cx + amplitude},${topY + (bottomY - topY) * 0.2}`,\n    `${cx - amplitude * 1.5},${topY + (bottomY - topY) * 0.55}`,\n    `${cx + amplitude * 0.5},${topY + (bottomY - topY) * 0.75}`,\n    `C${cx - amplitude},${topY + (bottomY - topY) * 0.85}`,\n    `${cx + amplitude * 0.3},${topY + (bottomY - topY) * 0.95}`,\n    `${cx},${bottomY}`\n  ].join(\" \");\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(generateCliffPath, \"generateCliffPath\");\nfunction generateConfusionPath(cx, cy, rx, ry) {\n  return [\n    `M${cx - rx},${cy}`,\n    `A${rx},${ry} 0 1,1 ${cx + rx},${cy}`,\n    `A${rx},${ry} 0 1,1 ${cx - rx},${cy}`,\n    \"Z\"\n  ].join(\" \");\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(generateConfusionPath, \"generateConfusionPath\");\n\n// src/diagrams/cynefin/cynefinRenderer.ts\nvar DOMAIN_META = {\n  complex: { model: \"Probe \\u2192 Sense \\u2192 Respond\", practice: \"Emergent Practices\" },\n  complicated: { model: \"Sense \\u2192 Analyse \\u2192 Respond\", practice: \"Good Practices\" },\n  clear: { model: \"Sense \\u2192 Categorise \\u2192 Respond\", practice: \"Best Practices\" },\n  chaotic: { model: \"Act \\u2192 Sense \\u2192 Respond\", practice: \"Novel Practices\" },\n  confusion: { model: \"\", practice: \"Disorder\" }\n};\nvar getDomainLayouts = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((width, height) => {\n  const hw = width / 2;\n  const hh = height / 2;\n  return {\n    complex: { cx: hw / 2, cy: hh / 2, x: 0, y: 0, w: hw, h: hh },\n    complicated: { cx: hw + hw / 2, cy: hh / 2, x: hw, y: 0, w: hw, h: hh },\n    chaotic: { cx: hw / 2, cy: hh + hh / 2, x: 0, y: hh, w: hw, h: hh },\n    clear: { cx: hw + hw / 2, cy: hh + hh / 2, x: hw, y: hh, w: hw, h: hh },\n    confusion: { cx: hw, cy: hh, x: hw * 0.7, y: hh * 0.7, w: hw * 0.6, h: hh * 0.6 }\n  };\n}, \"getDomainLayouts\");\nvar getCynefinDomainColors = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => {\n  const defaultThemeVariables = (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getThemeVariables)();\n  const currentConfig = (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getConfig)();\n  const themeVariables = (0,_chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_2__.cleanAndMerge)(defaultThemeVariables, currentConfig.themeVariables);\n  return themeVariables.cynefin;\n}, \"getCynefinDomainColors\");\nvar MAX_CONFUSION_ITEMS = 3;\nvar draw = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((_text, id, _version, diagram2) => {\n  const db2 = diagram2.db;\n  const domains = db2.getDomains();\n  const transitions = db2.getTransitions();\n  const title = db2.getDiagramTitle();\n  const accTitle = db2.getAccTitle();\n  const accDescription = db2.getAccDescription();\n  const config = db2.getConfig();\n  const domainColors = getCynefinDomainColors();\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(\"Rendering Cynefin diagram\");\n  const width = config.width;\n  const height = config.height;\n  const padding = config.padding;\n  const showDomainDescriptions = config.showDomainDescriptions;\n  const boundaryAmplitude = config.boundaryAmplitude;\n  const totalWidth = width + padding * 2;\n  const totalHeight = height + padding * 2;\n  const domainBg = {\n    complex: domainColors.complexBg,\n    complicated: domainColors.complicatedBg,\n    clear: domainColors.clearBg,\n    chaotic: domainColors.chaoticBg,\n    confusion: domainColors.confusionBg\n  };\n  const svg = (0,_chunk_VAUOI2AC_mjs__WEBPACK_IMPORTED_MODULE_1__.selectSvgElement)(id);\n  (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.configureSvgSize)(svg, totalHeight, totalWidth, config.useMaxWidth ?? true);\n  svg.attr(\"viewBox\", `0 0 ${totalWidth} ${totalHeight}`);\n  if (accTitle) {\n    svg.append(\"title\").text(accTitle);\n  }\n  if (accDescription) {\n    svg.append(\"desc\").text(accDescription);\n  }\n  const root = svg.append(\"g\").attr(\"transform\", `translate(${padding}, ${padding})`);\n  const layouts = getDomainLayouts(width, height);\n  const seed = resolveSeed(config.seed, id);\n  const bgGroup = root.append(\"g\").attr(\"class\", \"cynefin-backgrounds\");\n  const quadrantDomains = [\"complex\", \"complicated\", \"chaotic\", \"clear\"];\n  for (const domainName of quadrantDomains) {\n    const layout = layouts[domainName];\n    bgGroup.append(\"rect\").attr(\"class\", \"cynefinDomain\").attr(\"x\", layout.x).attr(\"y\", layout.y).attr(\"width\", layout.w).attr(\"height\", layout.h).attr(\"fill\", domainBg[domainName]).attr(\"fill-opacity\", 0.4).attr(\"stroke\", \"none\");\n  }\n  const boundaryGroup = root.append(\"g\").attr(\"class\", \"cynefin-boundaries\");\n  boundaryGroup.append(\"path\").attr(\"class\", \"cynefinBoundary\").attr(\"d\", generateFoldPath(width, height, seed, boundaryAmplitude)).attr(\"fill\", \"none\");\n  boundaryGroup.append(\"path\").attr(\"class\", \"cynefinBoundary\").attr(\"d\", generateHorizontalBoundary(width, height, seed + 100, boundaryAmplitude)).attr(\"fill\", \"none\");\n  boundaryGroup.append(\"path\").attr(\"class\", \"cynefinCliff\").attr(\"d\", generateCliffPath(width, height)).attr(\"fill\", \"none\");\n  const confusionRx = width * 0.15;\n  const confusionRy = height * 0.15;\n  root.append(\"path\").attr(\"class\", \"cynefinConfusion\").attr(\"d\", generateConfusionPath(width / 2, height / 2, confusionRx, confusionRy)).attr(\"fill\", domainBg.confusion).attr(\"fill-opacity\", 0.5);\n  const labelGroup = root.append(\"g\").attr(\"class\", \"cynefin-labels\");\n  for (const domainName of quadrantDomains) {\n    const layout = layouts[domainName];\n    labelGroup.append(\"text\").attr(\"class\", \"cynefinDomainLabel\").attr(\"x\", layout.cx).attr(\"y\", showDomainDescriptions ? layout.cy - 30 : layout.cy).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(domainName.charAt(0).toUpperCase() + domainName.slice(1));\n  }\n  labelGroup.append(\"text\").attr(\"class\", \"cynefinDomainLabel\").attr(\"x\", width / 2).attr(\"y\", showDomainDescriptions ? height / 2 - 10 : height / 2).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(\"Confusion\");\n  if (showDomainDescriptions) {\n    const subtitleGroup = root.append(\"g\").attr(\"class\", \"cynefin-subtitles\");\n    for (const domainName of quadrantDomains) {\n      const layout = layouts[domainName];\n      const meta = DOMAIN_META[domainName];\n      subtitleGroup.append(\"text\").attr(\"class\", \"cynefinSubtitle\").attr(\"x\", layout.cx).attr(\"y\", layout.cy - 10).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(meta.model);\n      subtitleGroup.append(\"text\").attr(\"class\", \"cynefinSubtitle\").attr(\"x\", layout.cx).attr(\"y\", layout.cy + 5).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(meta.practice);\n    }\n    subtitleGroup.append(\"text\").attr(\"class\", \"cynefinSubtitle\").attr(\"x\", width / 2).attr(\"y\", height / 2 + 8).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(DOMAIN_META.confusion.practice);\n  }\n  const itemGroup = root.append(\"g\").attr(\"class\", \"cynefin-items\");\n  const itemHeight = 26;\n  const itemPaddingX = 10;\n  const allDomains = [\"complex\", \"complicated\", \"chaotic\", \"clear\", \"confusion\"];\n  for (const domainName of allDomains) {\n    const domain = domains.get(domainName);\n    if (!domain || domain.items.length === 0) {\n      continue;\n    }\n    const layout = layouts[domainName];\n    const isConfusion = domainName === \"confusion\";\n    let itemsToRender = domain.items;\n    let overflowCount = 0;\n    if (isConfusion && domain.items.length > MAX_CONFUSION_ITEMS) {\n      overflowCount = domain.items.length - MAX_CONFUSION_ITEMS;\n      itemsToRender = domain.items.slice(0, MAX_CONFUSION_ITEMS);\n    }\n    let startY;\n    if (isConfusion) {\n      const labelOffset = showDomainDescriptions ? 22 : 14;\n      startY = layout.cy + labelOffset;\n    } else {\n      startY = layout.cy + (showDomainDescriptions ? 25 : 15);\n    }\n    [...itemsToRender].forEach((item, idx) => {\n      const itemY = startY + idx * (itemHeight + 4);\n      const g = itemGroup.append(\"g\");\n      const textEl = g.append(\"text\").attr(\"class\", \"cynefinItemText\").attr(\"x\", 0).attr(\"y\", itemHeight / 2).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"central\").text(item.label);\n      let measuredWidth = item.label.length * 7;\n      const textNode = textEl.node();\n      if (textNode && typeof textNode.getBBox === \"function\") {\n        const bbox = textNode.getBBox();\n        if (bbox.width > 0) {\n          measuredWidth = bbox.width;\n        }\n      }\n      const badgeWidth = measuredWidth + itemPaddingX * 2;\n      const itemX = layout.cx - badgeWidth / 2;\n      g.attr(\"transform\", `translate(${itemX}, ${itemY})`);\n      g.insert(\"rect\", \"text\").attr(\"class\", \"cynefinItem\").attr(\"x\", 0).attr(\"y\", 0).attr(\"width\", badgeWidth).attr(\"height\", itemHeight).attr(\"rx\", 4).attr(\"ry\", 4).attr(\"fill\", domainBg[domainName]).attr(\"fill-opacity\", 0.95);\n      textEl.attr(\"x\", badgeWidth / 2).attr(\"y\", itemHeight / 2);\n    });\n    if (overflowCount > 0) {\n      const overflowY = startY + itemsToRender.length * (itemHeight + 4);\n      const overflowLabel = `+${overflowCount} more`;\n      const g = itemGroup.append(\"g\");\n      const textEl = g.append(\"text\").attr(\"class\", \"cynefinItemText\").attr(\"x\", 0).attr(\"y\", itemHeight / 2).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"central\").text(overflowLabel);\n      let measuredWidth = overflowLabel.length * 7;\n      const textNode = textEl.node();\n      if (textNode && typeof textNode.getBBox === \"function\") {\n        const bbox = textNode.getBBox();\n        if (bbox.width > 0) {\n          measuredWidth = bbox.width;\n        }\n      }\n      const badgeWidth = measuredWidth + itemPaddingX * 2;\n      const itemX = layout.cx - badgeWidth / 2;\n      g.attr(\"transform\", `translate(${itemX}, ${overflowY})`);\n      g.insert(\"rect\", \"text\").attr(\"class\", \"cynefinItemOverflow\").attr(\"x\", 0).attr(\"y\", 0).attr(\"width\", badgeWidth).attr(\"height\", itemHeight).attr(\"rx\", 4).attr(\"ry\", 4).attr(\"fill\", domainBg[domainName]).attr(\"fill-opacity\", 0.6);\n      textEl.attr(\"x\", badgeWidth / 2).attr(\"y\", itemHeight / 2);\n    }\n  }\n  if (transitions.length > 0) {\n    const defs = svg.select(\"defs\").empty() ? svg.append(\"defs\") : svg.select(\"defs\");\n    const markerId = `cynefin-arrow-${id}`;\n    defs.append(\"marker\").attr(\"id\", markerId).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 6).attr(\"markerHeight\", 6).attr(\"orient\", \"auto-start-reverse\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"class\", \"cynefinArrowHead\");\n    const arrowGroup = root.append(\"g\").attr(\"class\", \"cynefin-arrows\");\n    transitions.forEach((transition) => {\n      const fromLayout = layouts[transition.from];\n      const toLayout = layouts[transition.to];\n      if (!fromLayout || !toLayout) {\n        return;\n      }\n      if (transition.from === transition.to) {\n        _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.warn(`Cynefin renderer: skipping self-loop on domain \"${transition.from}\"`);\n        return;\n      }\n      const x1 = fromLayout.cx;\n      const y1 = fromLayout.cy;\n      const x2 = toLayout.cx;\n      const y2 = toLayout.cy;\n      const mx = (x1 + x2) / 2;\n      const my = (y1 + y2) / 2;\n      const dx = x2 - x1;\n      const dy = y2 - y1;\n      const len = Math.sqrt(dx * dx + dy * dy);\n      const offsetAmount = len * 0.15;\n      const nx = -dy / len;\n      const ny = dx / len;\n      const cpx = mx + nx * offsetAmount;\n      const cpy = my + ny * offsetAmount;\n      arrowGroup.append(\"path\").attr(\"class\", \"cynefinArrowLine\").attr(\"d\", `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}`).attr(\"fill\", \"none\").attr(\"marker-end\", `url(#${markerId})`);\n      if (transition.label) {\n        arrowGroup.append(\"text\").attr(\"class\", \"cynefinArrowLabel\").attr(\"x\", cpx).attr(\"y\", cpy - 6).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"auto\").text(transition.label);\n      }\n    });\n  }\n  if (title) {\n    root.append(\"text\").attr(\"class\", \"cynefinTitle\").attr(\"x\", width / 2).attr(\"y\", -padding / 2).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(title);\n  }\n}, \"draw\");\nvar renderer = { draw };\n\n// src/diagrams/cynefin/styles.ts\nvar getCynefinTheme = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => {\n  const defaultThemeVariables = (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getThemeVariables)();\n  const currentConfig = (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getConfig)();\n  const themeVariables = (0,_chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_2__.cleanAndMerge)(defaultThemeVariables, currentConfig.themeVariables);\n  return themeVariables.cynefin;\n}, \"getCynefinTheme\");\nvar styles = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => {\n  const t = getCynefinTheme();\n  return `\n\t.cynefinDomain {\n\t\tstroke: none;\n\t}\n\t.cynefinDomainLabel {\n\t\tfont-size: ${t.domainFontSize}px;\n\t\tfont-weight: bold;\n\t\tfill: ${t.labelColor};\n\t}\n\t.cynefinSubtitle {\n\t\tfont-size: ${t.itemFontSize - 1}px;\n\t\tfill: ${t.textColor};\n\t\tfont-style: italic;\n\t}\n\t.cynefinItem {\n\t\tfill-opacity: 0.95;\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1;\n\t}\n\t.cynefinItemText {\n\t\tfont-size: ${t.itemFontSize}px;\n\t\tfill: ${t.textColor};\n\t}\n\t.cynefinItemOverflow {\n\t\tfill-opacity: 0.6;\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1;\n\t\tstroke-dasharray: 3 2;\n\t}\n\t.cynefinBoundary {\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: ${t.boundaryWidth};\n\t\tstroke-dasharray: 6 3;\n\t}\n\t.cynefinCliff {\n\t\tstroke: ${t.cliffColor};\n\t\tstroke-width: ${t.cliffWidth};\n\t}\n\t.cynefinConfusion {\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1.5;\n\t\tstroke-dasharray: 4 2;\n\t}\n\t.cynefinArrowLine {\n\t\tstroke: ${t.arrowColor};\n\t\tstroke-width: ${t.arrowWidth};\n\t\tfill: none;\n\t}\n\t.cynefinArrowHead {\n\t\tfill: ${t.arrowColor};\n\t\tstroke: none;\n\t}\n\t.cynefinArrowLabel {\n\t\tfont-size: ${t.itemFontSize - 1}px;\n\t\tfill: ${t.textColor};\n\t}\n\t.cynefinTitle {\n\t\tfont-size: ${t.domainFontSize + 2}px;\n\t\tfont-weight: bold;\n\t\tfill: ${t.labelColor};\n\t}\n\t`;\n}, \"styles\");\nvar styles_default = styles;\n\n// src/diagrams/cynefin/cynefinDiagram.ts\nvar diagram = {\n  parser,\n  db,\n  renderer,\n  styles: styles_default\n};\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-TSTJHNR4.mjs?\n}");

/***/ }

}]);