"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_pieDiagram-ENE6RG2P_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/pieDiagram-ENE6RG2P.mjs"
/*!*******************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ENE6RG2P.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/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! d3 */ \"./node_modules/d3/src/index.js\");\n\n\n\n\n\n\n\n// src/diagrams/pie/pieParser.ts\n\n\n// src/diagrams/pie/pieDb.ts\nvar DEFAULT_PIE_CONFIG = _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.defaultConfig_default.pie;\nvar DEFAULT_PIE_DB = {\n  sections: /* @__PURE__ */ new Map(),\n  showData: false,\n  config: DEFAULT_PIE_CONFIG\n};\nvar sections = DEFAULT_PIE_DB.sections;\nvar showData = DEFAULT_PIE_DB.showData;\nvar config = structuredClone(DEFAULT_PIE_CONFIG);\nvar getConfig2 = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => structuredClone(config), \"getConfig\");\nvar clear2 = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => {\n  sections = /* @__PURE__ */ new Map();\n  showData = DEFAULT_PIE_DB.showData;\n  (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.clear)();\n}, \"clear\");\nvar addSection = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(({ label, value }) => {\n  if (value < 0) {\n    throw new Error(\n      `\"${label}\" has invalid value: ${value}. Negative values are not allowed in pie charts. All slice values must be >= 0.`\n    );\n  }\n  if (!sections.has(label)) {\n    sections.set(label, value);\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(`added new section: ${label}, with value: ${value}`);\n  }\n}, \"addSection\");\nvar getSections = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => sections, \"getSections\");\nvar setShowData = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((toggle) => {\n  showData = toggle;\n}, \"setShowData\");\nvar getShowData = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)(() => showData, \"getShowData\");\nvar db = {\n  getConfig: getConfig2,\n  clear: clear2,\n  setDiagramTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.setDiagramTitle,\n  getDiagramTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getDiagramTitle,\n  setAccTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.setAccTitle,\n  getAccTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getAccTitle,\n  setAccDescription: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.setAccDescription,\n  getAccDescription: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getAccDescription,\n  addSection,\n  getSections,\n  setShowData,\n  getShowData\n};\n\n// src/diagrams/pie/pieParser.ts\nvar populateDb = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((ast, db2) => {\n  (0,_chunk_JWPE2WC7_mjs__WEBPACK_IMPORTED_MODULE_0__.populateCommonDb)(ast, db2);\n  db2.setShowData(ast.showData);\n  ast.sections.map(db2.addSection);\n}, \"populateDb\");\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)(\"pie\", input);\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(ast);\n    populateDb(ast, db);\n  }, \"parse\")\n};\n\n// src/diagrams/pie/pieStyles.ts\nvar getStyles = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((options) => `\n  .pieCircle{\n    stroke: ${options.pieStrokeColor};\n    stroke-width : ${options.pieStrokeWidth};\n    opacity : ${options.pieOpacity};\n  }\n  .pieCircle.highlighted{\n    scale: 1.05;\n    opacity: 1;\n  }\n  .pieCircle.highlightedOnHover:hover{\n    transition-duration: 250ms;\n    scale: 1.05;\n    opacity: 1;\n  }\n  .pieOuterCircle{\n    stroke: ${options.pieOuterStrokeColor};\n    stroke-width: ${options.pieOuterStrokeWidth};\n    fill: none;\n  }\n  .pieTitleText {\n    text-anchor: middle;\n    font-size: ${options.pieTitleTextSize};\n    fill: ${options.pieTitleTextColor};\n    font-family: ${options.fontFamily};\n  }\n  .slice {\n    font-family: ${options.fontFamily};\n    fill: ${options.pieSectionTextColor};\n    font-size:${options.pieSectionTextSize};\n    // fill: white;\n  }\n  .legend text {\n    fill: ${options.pieLegendTextColor};\n    font-family: ${options.fontFamily};\n    font-size: ${options.pieLegendTextSize};\n  }\n`, \"getStyles\");\nvar pieStyles_default = getStyles;\n\n// src/diagrams/pie/pieRenderer.ts\n\nvar createPieArcs = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((sections2) => {\n  const sum = [...sections2.values()].reduce((acc, val) => acc + val, 0);\n  const pieData = [...sections2.entries()].map(([label, value]) => ({ label, value })).filter((d) => d.value / sum * 100 >= 1);\n  const pie = (0,d3__WEBPACK_IMPORTED_MODULE_7__.pie)().value((d) => d.value).sort(null);\n  return pie(pieData);\n}, \"createPieArcs\");\nvar draw = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((text, id, _version, diagObj) => {\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(\"rendering pie chart\\n\" + text);\n  const db2 = diagObj.db;\n  const globalConfig = (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.getConfig2)();\n  const pieConfig = (0,_chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_2__.cleanAndMerge)(db2.getConfig(), globalConfig.pie);\n  const MARGIN = 40;\n  const LEGEND_RECT_SIZE = 18;\n  const LEGEND_SPACING = 4;\n  const height = 450;\n  const pieWidth = height;\n  const svg = (0,_chunk_VAUOI2AC_mjs__WEBPACK_IMPORTED_MODULE_1__.selectSvgElement)(id);\n  const group = svg.append(\"g\");\n  group.attr(\"transform\", \"translate(\" + pieWidth / 2 + \",\" + height / 2 + \")\");\n  const { themeVariables } = globalConfig;\n  let [outerStrokeWidth] = (0,_chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_2__.parseFontSize)(themeVariables.pieOuterStrokeWidth);\n  outerStrokeWidth ??= 2;\n  const legendPosition = pieConfig.legendPosition;\n  const textPosition = pieConfig.textPosition;\n  const innerHole = pieConfig.donutHole > 0 && pieConfig.donutHole <= 0.9 ? pieConfig.donutHole : 0;\n  const radius = Math.min(pieWidth, height) / 2 - MARGIN;\n  const arcGenerator = (0,d3__WEBPACK_IMPORTED_MODULE_7__.arc)().innerRadius(innerHole * radius).outerRadius(radius);\n  const labelArcGenerator = (0,d3__WEBPACK_IMPORTED_MODULE_7__.arc)().innerRadius(radius * textPosition).outerRadius(radius * textPosition);\n  const pie = group.append(\"g\");\n  pie.append(\"circle\").attr(\"cx\", 0).attr(\"cy\", 0).attr(\"r\", radius + outerStrokeWidth / 2).attr(\"class\", \"pieOuterCircle\");\n  const sections2 = db2.getSections();\n  const arcs = createPieArcs(sections2);\n  const myGeneratedColors = [\n    themeVariables.pie1,\n    themeVariables.pie2,\n    themeVariables.pie3,\n    themeVariables.pie4,\n    themeVariables.pie5,\n    themeVariables.pie6,\n    themeVariables.pie7,\n    themeVariables.pie8,\n    themeVariables.pie9,\n    themeVariables.pie10,\n    themeVariables.pie11,\n    themeVariables.pie12\n  ];\n  let sum = 0;\n  sections2.forEach((section) => {\n    sum += section;\n  });\n  const filteredArcs = arcs.filter((datum) => (datum.data.value / sum * 100).toFixed(0) !== \"0\");\n  const color = (0,d3__WEBPACK_IMPORTED_MODULE_7__.scaleOrdinal)(myGeneratedColors).domain([\n    ...sections2.keys()\n  ]);\n  pie.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"path\").attr(\"d\", arcGenerator).attr(\"fill\", (datum) => {\n    return color(datum.data.label);\n  }).attr(\"class\", (datum) => {\n    let className = \"pieCircle\";\n    if (pieConfig.highlightSlice === \"hover\") {\n      className += \" highlightedOnHover\";\n    } else if (pieConfig.highlightSlice === datum.data.label) {\n      className += \" highlighted\";\n    }\n    return className;\n  });\n  pie.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"text\").text((datum) => {\n    return (datum.data.value / sum * 100).toFixed(0) + \"%\";\n  }).attr(\"transform\", (datum) => {\n    return \"translate(\" + labelArcGenerator.centroid(datum) + \")\";\n  }).style(\"text-anchor\", \"middle\").attr(\"class\", \"slice\");\n  const titleText = group.append(\"text\").text(db2.getDiagramTitle()).attr(\"x\", 0).attr(\"y\", -(height - 50) / 2).attr(\"class\", \"pieTitleText\");\n  const allSectionData = [...sections2.entries()].map(([label, value]) => ({\n    label,\n    value\n  }));\n  const legend = group.selectAll(\".legend\").data(allSectionData).enter().append(\"g\").attr(\"class\", \"legend\");\n  legend.append(\"rect\").attr(\"width\", LEGEND_RECT_SIZE).attr(\"height\", LEGEND_RECT_SIZE).style(\"fill\", (d) => color(d.label)).style(\"stroke\", (d) => color(d.label));\n  legend.append(\"text\").attr(\"x\", LEGEND_RECT_SIZE + LEGEND_SPACING).attr(\"y\", LEGEND_RECT_SIZE - LEGEND_SPACING).text((d) => {\n    if (db2.getShowData()) {\n      return `${d.label} [${d.value}]`;\n    }\n    return d.label;\n  });\n  const longestTextWidth = Math.max(\n    ...legend.selectAll(\"text\").nodes().map((node) => node?.getBoundingClientRect().width ?? 0)\n  );\n  let chartAndLegendHeight = height;\n  let chartAndLegendWidth = pieWidth + MARGIN;\n  const legendHeight = LEGEND_RECT_SIZE + LEGEND_SPACING;\n  const totalLegendHeight = allSectionData.length * legendHeight;\n  switch (legendPosition) {\n    case \"center\":\n      legend.attr(\"transform\", (_datum, index) => {\n        const offset = legendHeight * allSectionData.length / 2;\n        const horizontal = -longestTextWidth / 2 - (LEGEND_RECT_SIZE + LEGEND_SPACING);\n        const vertical = index * legendHeight - offset;\n        return \"translate(\" + horizontal + \",\" + vertical + \")\";\n      });\n      break;\n    case \"top\":\n      chartAndLegendHeight += totalLegendHeight;\n      legend.attr(\"transform\", (_datum, index) => {\n        const offset = radius;\n        const horizontal = -longestTextWidth / 2 - (LEGEND_RECT_SIZE + LEGEND_SPACING);\n        const vertical = index * legendHeight - offset;\n        return `translate(${horizontal}, ${vertical})`;\n      });\n      pie.attr(\"transform\", () => {\n        return `translate(0, ${totalLegendHeight + legendHeight})`;\n      });\n      break;\n    case \"bottom\":\n      chartAndLegendHeight += totalLegendHeight;\n      legend.attr(\"transform\", (_datum, index) => {\n        const offset = -radius - legendHeight;\n        const horizontal = -longestTextWidth / 2 - (LEGEND_RECT_SIZE + LEGEND_SPACING);\n        const vertical = index * legendHeight - offset;\n        return \"translate(\" + horizontal + \",\" + vertical + \")\";\n      });\n      break;\n    case \"left\":\n      chartAndLegendWidth += LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;\n      legend.attr(\"transform\", (_datum, index) => {\n        const offset = legendHeight * allSectionData.length / 2;\n        const horizontal = -radius - (LEGEND_RECT_SIZE + LEGEND_SPACING);\n        const vertical = index * legendHeight - offset;\n        return \"translate(\" + horizontal + \",\" + vertical + \")\";\n      });\n      pie.attr(\"transform\", () => {\n        return `translate(${longestTextWidth + LEGEND_RECT_SIZE + LEGEND_SPACING}, 0)`;\n      });\n      break;\n    case \"right\":\n    default:\n      chartAndLegendWidth += LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;\n      legend.attr(\"transform\", (_datum, index) => {\n        const offset = legendHeight * allSectionData.length / 2;\n        const horizontal = 12 * LEGEND_RECT_SIZE;\n        const vertical = index * legendHeight - offset;\n        return \"translate(\" + horizontal + \",\" + vertical + \")\";\n      });\n      break;\n  }\n  const titleWidth = titleText.node()?.getBoundingClientRect().width ?? 0;\n  const titleLeft = pieWidth / 2 - titleWidth / 2;\n  const titleRight = pieWidth / 2 + titleWidth / 2;\n  const viewBoxX = Math.min(0, titleLeft);\n  const viewBoxRight = Math.max(chartAndLegendWidth, titleRight);\n  const totalWidth = viewBoxRight - viewBoxX;\n  svg.attr(\"viewBox\", `${viewBoxX} 0 ${totalWidth} ${chartAndLegendHeight}`);\n  (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__.configureSvgSize)(svg, chartAndLegendHeight, totalWidth, pieConfig.useMaxWidth);\n}, \"draw\");\nvar renderer = { draw };\n\n// src/diagrams/pie/pieDiagram.ts\nvar diagram = {\n  parser,\n  db,\n  renderer,\n  styles: pieStyles_default\n};\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ENE6RG2P.mjs?\n}");

/***/ }

}]);