mio-previewer 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +218 -0
  3. package/README.zh-CN.md +206 -0
  4. package/dist/MdRenderer.vue_vue_type_style_index_0_lang-ClzqKjX4.js +4562 -0
  5. package/dist/MdRenderer.vue_vue_type_style_index_0_lang-Dpnz3CdM.cjs +16 -0
  6. package/dist/_basePickBy-CZxbwAvt.cjs +1 -0
  7. package/dist/_basePickBy-nvL1-X4h.js +151 -0
  8. package/dist/_baseUniq-Cwhfu1XM.js +614 -0
  9. package/dist/_baseUniq-DunUk-cd.cjs +1 -0
  10. package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
  11. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  12. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  13. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  14. package/dist/arc-C9I4pYLv.js +83 -0
  15. package/dist/arc-fCflz0gB.cjs +1 -0
  16. package/dist/architecture-O4VJ6CD3-D00QJU0o.js +5 -0
  17. package/dist/architecture-O4VJ6CD3-dKuizgWO.cjs +1 -0
  18. package/dist/architectureDiagram-VXUJARFQ-DQ-YD3RX.cjs +36 -0
  19. package/dist/architectureDiagram-VXUJARFQ-VWr1UuPv.js +4662 -0
  20. package/dist/assets/parser.worker-67NQKZt5.js +16 -0
  21. package/dist/blockDiagram-VD42YOAC-DuC96I2Q.js +2261 -0
  22. package/dist/blockDiagram-VD42YOAC-EC2x5LwN.cjs +122 -0
  23. package/dist/c4Diagram-YG6GDRKO-Dm5d0BWL.cjs +10 -0
  24. package/dist/c4Diagram-YG6GDRKO-OB8wIuF8.js +1580 -0
  25. package/dist/channel-C-uR528Z.js +5 -0
  26. package/dist/channel-YfH5CBV-.cjs +1 -0
  27. package/dist/chunk-4BX2VUAB-3Liht_XN.cjs +1 -0
  28. package/dist/chunk-4BX2VUAB-j8LeaMvy.js +8 -0
  29. package/dist/chunk-55IACEB6-Dm3mi3ha.cjs +1 -0
  30. package/dist/chunk-55IACEB6-IYAIzfR4.js +8 -0
  31. package/dist/chunk-B4BG7PRW-CpqTB0S5.cjs +165 -0
  32. package/dist/chunk-B4BG7PRW-DB5df3Iz.js +1375 -0
  33. package/dist/chunk-DI55MBZ5-BoFZpvY3.js +1370 -0
  34. package/dist/chunk-DI55MBZ5-wqsoqtNw.cjs +220 -0
  35. package/dist/chunk-FMBD7UC4-BZS_4hun.cjs +15 -0
  36. package/dist/chunk-FMBD7UC4-CdmoYYnM.js +19 -0
  37. package/dist/chunk-QN33PNHL-BuyP9RXS.js +19 -0
  38. package/dist/chunk-QN33PNHL-CHI_-zix.cjs +1 -0
  39. package/dist/chunk-QZHKN3VN-15dJyQk0.js +15 -0
  40. package/dist/chunk-QZHKN3VN-DfH9qQ3T.cjs +1 -0
  41. package/dist/chunk-TZMSLE5B-BgFWf03M.js +64 -0
  42. package/dist/chunk-TZMSLE5B-qIo1h7Gz.cjs +1 -0
  43. package/dist/classDiagram-2ON5EDUG-BQz3UzKi.js +16 -0
  44. package/dist/classDiagram-2ON5EDUG-CZWeacVd.cjs +1 -0
  45. package/dist/classDiagram-v2-WZHVMYZB-BQz3UzKi.js +16 -0
  46. package/dist/classDiagram-v2-WZHVMYZB-CZWeacVd.cjs +1 -0
  47. package/dist/clone-ByeQKKoW.cjs +1 -0
  48. package/dist/clone-D6h_cwF4.js +8 -0
  49. package/dist/cose-bilkent-S5V4N54A-5dO3qpr4.cjs +1 -0
  50. package/dist/cose-bilkent-S5V4N54A-D2q7jBXB.js +2609 -0
  51. package/dist/cytoscape.esm-DHF7mANN.cjs +331 -0
  52. package/dist/cytoscape.esm-DfdJODL8.js +18735 -0
  53. package/dist/dagre-6UL2VRFP-Cfh4UdSr.js +444 -0
  54. package/dist/dagre-6UL2VRFP-DS2Ki9Dv.cjs +4 -0
  55. package/dist/defaultLocale-D7EN2tov.js +171 -0
  56. package/dist/defaultLocale-DIVzfLaQ.cjs +1 -0
  57. package/dist/diagram-PSM6KHXK-BZDEX43o.js +531 -0
  58. package/dist/diagram-PSM6KHXK-CTsP6f2a.cjs +24 -0
  59. package/dist/diagram-QEK2KX5R-BDKMNi97.cjs +43 -0
  60. package/dist/diagram-QEK2KX5R-Dda_FEDc.js +217 -0
  61. package/dist/diagram-S2PKOQOG-CmfsKOvs.cjs +24 -0
  62. package/dist/diagram-S2PKOQOG-Cnw4b7LB.js +142 -0
  63. package/dist/entries/md.cjs.js +1 -0
  64. package/dist/entries/md.es.js +5 -0
  65. package/dist/entries/plugin-alert.cjs.js +1 -0
  66. package/dist/entries/plugin-alert.es.js +27 -0
  67. package/dist/entries/plugin-codeblock.cjs.js +9 -0
  68. package/dist/entries/plugin-codeblock.es.js +3441 -0
  69. package/dist/entries/plugin-emoji.cjs.js +1 -0
  70. package/dist/entries/plugin-emoji.es.js +28 -0
  71. package/dist/entries/plugin-katex.cjs.js +1 -0
  72. package/dist/entries/plugin-katex.es.js +92 -0
  73. package/dist/entries/plugin-mermaid.cjs.js +1 -0
  74. package/dist/entries/plugin-mermaid.es.js +4 -0
  75. package/dist/erDiagram-Q2GNP2WA-DE4JLeNF.cjs +60 -0
  76. package/dist/erDiagram-Q2GNP2WA-qAdA8fbE.js +841 -0
  77. package/dist/favicon.ico +0 -0
  78. package/dist/flowDiagram-NV44I4VS-C7YBx4JP.js +1620 -0
  79. package/dist/flowDiagram-NV44I4VS-j3dB-fjF.cjs +162 -0
  80. package/dist/ganttDiagram-LVOFAZNH-BL-Yjadx.js +2506 -0
  81. package/dist/ganttDiagram-LVOFAZNH-CBhzET57.cjs +267 -0
  82. package/dist/gitGraph-ZV4HHKMB-Dr9sn7R3.js +5 -0
  83. package/dist/gitGraph-ZV4HHKMB-DyXW77WY.cjs +1 -0
  84. package/dist/gitGraphDiagram-NY62KEGX-DDklxVnY.cjs +65 -0
  85. package/dist/gitGraphDiagram-NY62KEGX-DFn7h5BH.js +699 -0
  86. package/dist/graph-CHoeKkVR.cjs +1 -0
  87. package/dist/graph-DiGqaw_6.js +247 -0
  88. package/dist/info-63CPKGFF-BGxbI0Qv.cjs +1 -0
  89. package/dist/info-63CPKGFF-xflgSxfH.js +5 -0
  90. package/dist/infoDiagram-F6ZHWCRC-DOtGa28U.js +24 -0
  91. package/dist/infoDiagram-F6ZHWCRC-Duylo4r7.cjs +2 -0
  92. package/dist/init-CHZsXQcr.cjs +1 -0
  93. package/dist/init-DjUOC4st.js +16 -0
  94. package/dist/journeyDiagram-XKPGCS4Q-bJncB3oe.js +834 -0
  95. package/dist/journeyDiagram-XKPGCS4Q-h-CtcfbS.cjs +139 -0
  96. package/dist/kanban-definition-3W4ZIXB7-C3y0C_bw.cjs +89 -0
  97. package/dist/kanban-definition-3W4ZIXB7-nMPCi8GW.js +719 -0
  98. package/dist/katex-CmGeg_OO.js +11692 -0
  99. package/dist/katex-DEiiRhcn.cjs +261 -0
  100. package/dist/layout-BG4AbhIW.cjs +1 -0
  101. package/dist/layout-CHaNS4g6.js +1324 -0
  102. package/dist/linear-Bqd4C_Yb.cjs +1 -0
  103. package/dist/linear-CPFNaVnw.js +259 -0
  104. package/dist/mermaid-parser.core-CR8Rcyps.cjs +128 -0
  105. package/dist/mermaid-parser.core-CkQKh-yb.js +12966 -0
  106. package/dist/mindmap-definition-VGOIOE7T-C63AEIdU.js +784 -0
  107. package/dist/mindmap-definition-VGOIOE7T-CHI9UFtA.cjs +68 -0
  108. package/dist/mio-previewer.cjs.js +3 -0
  109. package/dist/mio-previewer.css +1 -0
  110. package/dist/mio-previewer.es.js +25 -0
  111. package/dist/ordinal-CagbB1m8.cjs +1 -0
  112. package/dist/ordinal-DfAQgscy.js +61 -0
  113. package/dist/packet-HUATNLJX-BeAGxpDF.cjs +1 -0
  114. package/dist/packet-HUATNLJX-dnmrn2-l.js +5 -0
  115. package/dist/parser.worker.js +21 -0
  116. package/dist/pie-WTHONI2E-BKoHQt0i.js +5 -0
  117. package/dist/pie-WTHONI2E-BifrFKgo.cjs +1 -0
  118. package/dist/pieDiagram-ADFJNKIX-B9OONHi_.cjs +30 -0
  119. package/dist/pieDiagram-ADFJNKIX-CEMFAt9B.js +161 -0
  120. package/dist/plugin-mermaid-FTki7cN8.cjs +255 -0
  121. package/dist/plugin-mermaid-y4lbJ7sL.js +15369 -0
  122. package/dist/quadrantDiagram-AYHSOK5B-DobvzsAU.js +1022 -0
  123. package/dist/quadrantDiagram-AYHSOK5B-DqXDgyBD.cjs +7 -0
  124. package/dist/radar-NJJJXTRR-BPN19Spv.cjs +1 -0
  125. package/dist/radar-NJJJXTRR-Bj9rI8mr.js +5 -0
  126. package/dist/requirementDiagram-UZGBJVZJ-CVbmNF7M.cjs +64 -0
  127. package/dist/requirementDiagram-UZGBJVZJ-M-MPvTnX.js +850 -0
  128. package/dist/sankeyDiagram-TZEHDZUN-C-ESiLJA.cjs +10 -0
  129. package/dist/sankeyDiagram-TZEHDZUN-Czsin99f.js +810 -0
  130. package/dist/sequenceDiagram-WL72ISMW-BJByNQsK.js +2511 -0
  131. package/dist/sequenceDiagram-WL72ISMW-DApIQwP-.cjs +145 -0
  132. package/dist/stateDiagram-FKZM4ZOC-BuKL2w66.cjs +1 -0
  133. package/dist/stateDiagram-FKZM4ZOC-jAiBDhVn.js +263 -0
  134. package/dist/stateDiagram-v2-4FDKWEC3-Ct5PFxdd.cjs +1 -0
  135. package/dist/stateDiagram-v2-4FDKWEC3-umSVoFht.js +16 -0
  136. package/dist/timeline-definition-IT6M3QCI-BfAvK0gf.cjs +61 -0
  137. package/dist/timeline-definition-IT6M3QCI-I--lBLTi.js +795 -0
  138. package/dist/treemap-75Q7IDZK-DNt-zuL8.cjs +1 -0
  139. package/dist/treemap-75Q7IDZK-bjql9DgL.js +5 -0
  140. package/dist/types/entries/md.d.ts +3 -0
  141. package/dist/types/entries/plugin-alert.d.ts +1 -0
  142. package/dist/types/entries/plugin-codeblock.d.ts +1 -0
  143. package/dist/types/entries/plugin-emoji.d.ts +1 -0
  144. package/dist/types/entries/plugin-katex.d.ts +1 -0
  145. package/dist/types/entries/plugin-mermaid.d.ts +1 -0
  146. package/dist/types/helpers/containerHelpers.d.ts +47 -0
  147. package/dist/types/helpers/index.d.ts +4 -0
  148. package/dist/types/index.d.ts +5 -0
  149. package/dist/types/main-plugin-demo.d.ts +1 -0
  150. package/dist/types/main.d.ts +1 -0
  151. package/dist/types/plugins/AlertPlugin.d.ts +16 -0
  152. package/dist/types/plugins/CodeBlockPlugin.d.ts +9 -0
  153. package/dist/types/plugins/EmojiPlugin.d.ts +11 -0
  154. package/dist/types/plugins/katexPlugin.d.ts +8 -0
  155. package/dist/types/plugins/mermaidPlugin.d.ts +13 -0
  156. package/dist/types/types.d.ts +77 -0
  157. package/dist/xychartDiagram-PRI3JC2R-BN9e47xe.cjs +7 -0
  158. package/dist/xychartDiagram-PRI3JC2R-XrOK_egj.js +1340 -0
  159. package/package.json +114 -0
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-CR8Rcyps.cjs");exports.TreemapModule=e.TreemapModule;exports.createTreemapServices=e.createTreemapServices;
@@ -0,0 +1,5 @@
1
+ import { T as a, h as m } from "./mermaid-parser.core-CkQKh-yb.js";
2
+ export {
3
+ a as TreemapModule,
4
+ m as createTreemapServices
5
+ };
@@ -0,0 +1,3 @@
1
+ import MdRenderer from '../MdRenderer.vue';
2
+ export { MdRenderer };
3
+ export default MdRenderer;
@@ -0,0 +1 @@
1
+ export { AlertPlugin } from '../plugins/AlertPlugin';
@@ -0,0 +1 @@
1
+ export { CodeBlockPlugin } from '../plugins/CodeBlockPlugin';
@@ -0,0 +1 @@
1
+ export { EmojiPlugin } from '../plugins/EmojiPlugin';
@@ -0,0 +1 @@
1
+ export { katexPlugin } from '../plugins/katexPlugin';
@@ -0,0 +1 @@
1
+ export { mermaidPlugin } from '../plugins/mermaidPlugin';
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Helper functions for configuring markdown-it-container plugins
3
+ *
4
+ * 简化 markdown-it-container 的配置过程
5
+ */
6
+ import type { MarkdownItPluginConfig } from '../types';
7
+ /**
8
+ * 创建一个 Alert 容器配置
9
+ *
10
+ * @param type - Alert 类型 (info, warning, error, success)
11
+ * @returns markdown-it-container 配置对象
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { createAlertContainer } from 'mio-previewer/helpers';
16
+ *
17
+ * const markdownItPlugins = [
18
+ * createAlertContainer('info'),
19
+ * createAlertContainer('warning'),
20
+ * createAlertContainer('error'),
21
+ * createAlertContainer('success')
22
+ * ];
23
+ * ```
24
+ *
25
+ * 使用方式:
26
+ * ```markdown
27
+ * ::: info
28
+ * 这是一个 **info** 类型的警告框
29
+ * :::
30
+ * ```
31
+ */
32
+ export declare function createAlertContainer(type: 'info' | 'warning' | 'error' | 'success', plugin: any): MarkdownItPluginConfig;
33
+ /**
34
+ * 创建所有 Alert 容器配置的便捷函数
35
+ *
36
+ * @param plugin - markdown-it-container 插件
37
+ * @returns 包含所有 alert 类型的配置数组
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * import markdownItContainer from 'markdown-it-container';
42
+ * import { createAllAlertContainers } from 'mio-previewer/helpers';
43
+ *
44
+ * const markdownItPlugins = createAllAlertContainers(markdownItContainer);
45
+ * ```
46
+ */
47
+ export declare function createAllAlertContainers(plugin: any): MarkdownItPluginConfig[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Helper functions and utilities for mio-previewer
3
+ */
4
+ export * from './containerHelpers';
@@ -0,0 +1,5 @@
1
+ import MdRenderer from './MdRenderer.vue';
2
+ export type { ASTNode, CustomPlugin, MarkdownItPluginConfig, MdRendererProps } from './types';
3
+ export { createAlertContainer, createAllAlertContainers } from './helpers';
4
+ export { MdRenderer };
5
+ export default MdRenderer;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import 'github-markdown-css/github-markdown.css';
@@ -0,0 +1,16 @@
1
+ import type { CustomPlugin } from '../types';
2
+ /**
3
+ * AlertPlugin - 自定义警告框渲染插件
4
+ *
5
+ * 配合 markdown-it-container 使用,支持以下 markdown 语法:
6
+ *
7
+ * ::: info
8
+ * 这是 info 类型的警告框,支持 **Markdown** 语法
9
+ * :::
10
+ *
11
+ * 或者使用 HTML 标签(但内部 Markdown 不会被解析):
12
+ * <div class="alert" data-type="info">纯文本内容</div>
13
+ *
14
+ * 支持的类型: info, warning, error, success
15
+ */
16
+ export declare const AlertPlugin: CustomPlugin;
@@ -0,0 +1,9 @@
1
+ import type { CustomPlugin } from '../types';
2
+ /**
3
+ * CodeBlockPlugin - 代码块渲染插件
4
+ *
5
+ * 使用 Prism 进行语法高亮,并提供复制和 HTML 预览功能
6
+ *
7
+ * 优先级: 70 (高于默认渲染)
8
+ */
9
+ export declare const CodeBlockPlugin: CustomPlugin;
@@ -0,0 +1,11 @@
1
+ import type { CustomPlugin } from '../types';
2
+ /**
3
+ * EmojiPlugin - Emoji 文本替换插件
4
+ *
5
+ * 将文本中的 :emoji_code: 替换为对应的 emoji 符号
6
+ *
7
+ * 支持的 emoji:
8
+ * :smile: 😊, :heart: ❤️, :fire: 🔥, :rocket: 🚀, :star: ⭐
9
+ * :thumbsup: 👍, :tada: 🎉, :check: ✅, :cross: ❌
10
+ */
11
+ export declare const EmojiPlugin: CustomPlugin;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Enhanced KaTeX plugin for markdown-it
3
+ *
4
+ * Supports multiple math delimiters (in priority order):
5
+ * - Block math: $$...$$, \[...\]
6
+ * - Inline math: \(...\), $...$
7
+ */
8
+ export declare function katexPlugin(md: any): void;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Mermaid Plugin for RecursiveRenderer
3
+ * Detects code blocks with language="mermaid" and renders them as interactive diagrams
4
+ */
5
+ import type { CustomPlugin } from '../types';
6
+ /**
7
+ * Mermaid Plugin
8
+ * Test: matches <pre><code class="language-mermaid">
9
+ * Render: creates MermaidDiagram component with code content
10
+ *
11
+ * Priority: 80 (higher than CodeBlock to intercept mermaid blocks)
12
+ */
13
+ export declare const mermaidPlugin: CustomPlugin;
@@ -0,0 +1,77 @@
1
+ import type { VNode } from 'vue';
2
+ /**
3
+ * AST 节点类型(htmlparser2 输出)
4
+ */
5
+ export type ASTNode = {
6
+ type: 'tag' | 'text' | 'comment' | 'component' | 'root' | 'document' | 'script' | 'style';
7
+ name?: string;
8
+ attribs?: Record<string, string>;
9
+ children?: ASTNode[];
10
+ data?: string;
11
+ };
12
+ /**
13
+ * Custom 插件接口
14
+ */
15
+ export type CustomPlugin = {
16
+ /**
17
+ * 插件名称(用于调试)
18
+ */
19
+ name?: string;
20
+ /**
21
+ * 优先级(数字越大越先执行,默认 0)
22
+ */
23
+ priority?: number;
24
+ /**
25
+ * 测试函数:判断节点是否匹配此插件
26
+ */
27
+ test: (node: ASTNode) => boolean;
28
+ /**
29
+ * 渲染函数:返回 VNode、字符串或 null
30
+ * @param node 当前 AST 节点
31
+ * @param renderChildren 渲染子节点的函数
32
+ * @param h Vue 的 h 函数
33
+ */
34
+ render: (node: ASTNode, renderChildren: () => (VNode | string | null)[], h: typeof import('vue').h) => VNode | string | null;
35
+ };
36
+ /**
37
+ * Markdown-it 插件配置
38
+ */
39
+ export type MarkdownItPluginConfig = {
40
+ /**
41
+ * markdown-it 插件函数
42
+ */
43
+ plugin: (md: any, options?: any) => void;
44
+ /**
45
+ * 插件选项
46
+ */
47
+ options?: any;
48
+ };
49
+ /**
50
+ * MdRenderer Props
51
+ */
52
+ export type MdRendererProps = {
53
+ /**
54
+ * Markdown 文本
55
+ */
56
+ md: string;
57
+ /**
58
+ * 是否处于流式模式
59
+ */
60
+ isStreaming?: boolean;
61
+ /**
62
+ * 是否使用 Worker 进行解析
63
+ */
64
+ useWorker?: boolean;
65
+ /**
66
+ * Markdown-it 插件配置
67
+ */
68
+ markdownItPlugins?: MarkdownItPluginConfig[];
69
+ /**
70
+ * Markdown-it 配置选项
71
+ */
72
+ markdownItOptions?: Record<string, any>;
73
+ /**
74
+ * Custom 渲染插件
75
+ */
76
+ customPlugins?: CustomPlugin[];
77
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./plugin-mermaid-FTki7cN8.cjs"),oe=require("./init-CHZsXQcr.cjs"),he=require("./ordinal-CagbB1m8.cjs"),Bt=require("./linear-Bqd4C_Yb.cjs");function le(i,t,e){i=+i,t=+t,e=(a=arguments.length)<2?(t=i,i=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((t-i)/e))|0,o=new Array(a);++s<a;)o[s]=i+s*e;return o}function yt(){var i=he.ordinal().unknown(void 0),t=i.domain,e=i.range,s=0,a=1,o,g,m=!1,p=0,k=0,v=.5;delete i.unknown;function w(){var _=t().length,E=a<s,D=E?a:s,P=E?s:a;o=(P-D)/Math.max(1,_-p+k*2),m&&(o=Math.floor(o)),D+=(P-D-o*(_-p))*v,g=o*(1-p),m&&(D=Math.round(D),g=Math.round(g));var M=le(_).map(function(y){return D+o*y});return e(E?M.reverse():M)}return i.domain=function(_){return arguments.length?(t(_),w()):t()},i.range=function(_){return arguments.length?([s,a]=_,s=+s,a=+a,w()):[s,a]},i.rangeRound=function(_){return[s,a]=_,s=+s,a=+a,m=!0,w()},i.bandwidth=function(){return g},i.step=function(){return o},i.round=function(_){return arguments.length?(m=!!_,w()):m},i.padding=function(_){return arguments.length?(p=Math.min(1,k=+_),w()):p},i.paddingInner=function(_){return arguments.length?(p=Math.min(1,_),w()):p},i.paddingOuter=function(_){return arguments.length?(k=+_,w()):k},i.align=function(_){return arguments.length?(v=Math.max(0,Math.min(1,_)),w()):v},i.copy=function(){return yt(t(),[s,a]).round(m).paddingInner(p).paddingOuter(k).align(v)},oe.initRange.apply(w(),arguments)}var _t=(function(){var i=n.__name(function(O,h,u,x){for(u=u||{},x=O.length;x--;u[O[x]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],o=[1,6],g=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],p=[1,25],k=[1,26],v=[1,28],w=[1,29],_=[1,30],E=[1,31],D=[1,32],P=[1,33],M=[1,34],y=[1,35],S=[1,36],c=[1,37],W=[1,43],z=[1,42],U=[1,47],X=[1,50],l=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],T=[1,64],$={trace:n.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:n.__name(function(h,u,x,d,A,r,at){var f=r.length-1;switch(A){case 5:d.setOrientation(r[f]);break;case 9:d.setDiagramTitle(r[f].text.trim());break;case 12:d.setLineData({text:"",type:"text"},r[f]);break;case 13:d.setLineData(r[f-1],r[f]);break;case 14:d.setBarData({text:"",type:"text"},r[f]);break;case 15:d.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),d.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:this.$=[Number(r[f-2]),...r[f]];break;case 21:this.$=[Number(r[f])];break;case 22:d.setXAxisTitle(r[f]);break;case 23:d.setXAxisTitle(r[f-1]);break;case 24:d.setXAxisTitle({type:"text",text:""});break;case 25:d.setXAxisBand(r[f]);break;case 26:d.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 27:this.$=r[f-1];break;case 28:this.$=[r[f-2],...r[f]];break;case 29:this.$=[r[f]];break;case 30:d.setYAxisTitle(r[f]);break;case 31:d.setYAxisTitle(r[f-1]);break;case 32:d.setYAxisTitle({type:"text",text:""});break;case 33:d.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 37:this.$={text:r[f],type:"text"};break;case 38:this.$={text:r[f],type:"text"};break;case 39:this.$={text:r[f],type:"markdown"};break;case 40:this.$=r[f];break;case 41:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[i(t,e,{3:1,4:2,7:4,5:s,34:a,35:o,36:g}),{1:[3]},i(t,e,{4:2,7:4,3:8,5:s,34:a,35:o,36:g}),i(t,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:a,35:o,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},i(m,[2,34]),i(m,[2,35]),i(m,[2,36]),{1:[2,1]},i(t,e,{4:2,7:4,3:21,5:s,34:a,35:o,36:g}),{1:[2,3]},i(m,[2,5]),i(t,[2,7],{4:22,34:a,35:o,36:g}),{11:23,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:45,15:44,27:U,33:46,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:49,17:48,24:X,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:52,17:51,24:X,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{20:[1,53]},{22:[1,54]},i(l,[2,18]),{1:[2,2]},i(l,[2,8]),i(l,[2,9]),i(L,[2,37],{40:55,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c}),i(L,[2,38]),i(L,[2,39]),i(C,[2,40]),i(C,[2,42]),i(C,[2,43]),i(C,[2,44]),i(C,[2,45]),i(C,[2,46]),i(C,[2,47]),i(C,[2,48]),i(C,[2,49]),i(C,[2,50]),i(C,[2,51]),i(l,[2,10]),i(l,[2,22],{30:41,29:56,24:W,27:z}),i(l,[2,24]),i(l,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},i(l,[2,11]),i(l,[2,30],{33:60,27:U}),i(l,[2,32]),{31:[1,61]},i(l,[2,12]),{17:62,24:X},{25:63,27:T},i(l,[2,14]),{17:65,24:X},i(l,[2,16]),i(l,[2,17]),i(C,[2,41]),i(l,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},i(l,[2,31]),{27:[1,69]},i(l,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},i(l,[2,15]),i(l,[2,26]),i(l,[2,27]),{11:59,32:72,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},i(l,[2,33]),i(l,[2,19]),{25:73,27:T},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n.__name(function(h,u){if(u.recoverable)this.trace(h);else{var x=new Error(h);throw x.hash=u,x}},"parseError"),parse:n.__name(function(h){var u=this,x=[0],d=[],A=[null],r=[],at=this.table,f="",lt=0,Et=0,se=2,Mt=1,ne=r.slice.call(arguments,1),R=Object.create(this.lexer),Y={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(Y.yy[dt]=this.yy[dt]);R.setInput(h,Y.yy),Y.yy.lexer=R,Y.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var ft=R.yylloc;r.push(ft);var ae=R.options&&R.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(V){x.length=x.length-2*V,A.length=A.length-V,r.length=r.length-V}n.__name(re,"popStack");function It(){var V;return V=d.pop()||R.lex()||Mt,typeof V!="number"&&(V instanceof Array&&(d=V,V=d.pop()),V=u.symbols_[V]||V),V}n.__name(It,"lex");for(var I,H,B,pt,q={},ct,F,Vt,ut;;){if(H=x[x.length-1],this.defaultActions[H]?B=this.defaultActions[H]:((I===null||typeof I>"u")&&(I=It()),B=at[H]&&at[H][I]),typeof B>"u"||!B.length||!B[0]){var mt="";ut=[];for(ct in at[H])this.terminals_[ct]&&ct>se&&ut.push("'"+this.terminals_[ct]+"'");R.showPosition?mt="Parse error on line "+(lt+1)+`:
2
+ `+R.showPosition()+`
3
+ Expecting `+ut.join(", ")+", got '"+(this.terminals_[I]||I)+"'":mt="Parse error on line "+(lt+1)+": Unexpected "+(I==Mt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(mt,{text:R.match,token:this.terminals_[I]||I,line:R.yylineno,loc:ft,expected:ut})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+I);switch(B[0]){case 1:x.push(I),A.push(R.yytext),r.push(R.yylloc),x.push(B[1]),I=null,Et=R.yyleng,f=R.yytext,lt=R.yylineno,ft=R.yylloc;break;case 2:if(F=this.productions_[B[1]][1],q.$=A[A.length-F],q._$={first_line:r[r.length-(F||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(F||1)].first_column,last_column:r[r.length-1].last_column},ae&&(q._$.range=[r[r.length-(F||1)].range[0],r[r.length-1].range[1]]),pt=this.performAction.apply(q,[f,Et,lt,Y.yy,B[1],A,r].concat(ne)),typeof pt<"u")return pt;F&&(x=x.slice(0,-1*F*2),A=A.slice(0,-1*F),r=r.slice(0,-1*F)),x.push(this.productions_[B[1]][0]),A.push(q.$),r.push(q._$),Vt=at[x[x.length-2]][x[x.length-1]],x.push(Vt);break;case 3:return!0}}return!0},"parse")},Lt=(function(){var O={EOF:1,parseError:n.__name(function(u,x){if(this.yy.parser)this.yy.parser.parseError(u,x);else throw new Error(u)},"parseError"),setInput:n.__name(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n.__name(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n.__name(function(h){var u=h.length,x=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===d.length?this.yylloc.first_column:0)+d[d.length-x.length].length-x[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n.__name(function(){return this._more=!0,this},"more"),reject:n.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n.__name(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n.__name(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n.__name(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n.__name(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
+ `+u+"^"},"showPosition"),test_match:n.__name(function(h,u){var x,d,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),d=h[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],x=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var r in A)this[r]=A[r];return!1}return!1},"test_match"),next:n.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,u,x,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),r=0;r<A.length;r++)if(x=this._input.match(this.rules[A[r]]),x&&(!u||x[0].length>u[0].length)){if(u=x,d=r,this.options.backtrack_lexer){if(h=this.test_match(x,A[r]),h!==!1)return h;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(h=this.test_match(u,A[d]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n.__name(function(){var u=this.next();return u||this.lex()},"lex"),begin:n.__name(function(u){this.conditionStack.push(u)},"begin"),popState:n.__name(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n.__name(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:n.__name(function(u){this.begin(u)},"pushState"),stateStackSize:n.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n.__name(function(u,x,d,A){switch(d){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return O})();$.lexer=Lt;function N(){this.yy={}}return n.__name(N,"Parser"),N.prototype=$,$.Parser=N,new N})();_t.parser=_t;var ce=_t;function bt(i){return i.type==="bar"}n.__name(bt,"isBarPlot");function Ct(i){return i.type==="band"}n.__name(Ct,"isBandAxisData");function j(i){return i.type==="linear"}n.__name(j,"isLinearAxisData");var G,Ot=(G=class{constructor(t){this.parentGroup=t}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce((o,g)=>Math.max(g.length,o),0)*e,height:e};const s={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const o of t){const g=n.computeDimensionOfText(a,1,o),m=g?g.width:o.length*e,p=g?g.height:e;s.width=Math.max(s.width,m),s.height=Math.max(s.height,p)}return a.remove(),s}},n.__name(G,"TextDimensionCalculatorWithFont"),G),Wt=.7,zt=.2,Q,Ft=(Q=class{constructor(t,e,s,a){this.axisConfig=t,this.title=e,this.textDimensionCalculator=s,this.axisThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Wt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Wt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=zt*t.width;this.outerPadding=Math.min(s.width/2,a);const o=s.height+this.axisConfig.labelPadding*2;this.labelTextHeight=s.height,o<=e&&(e-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=e&&(e-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=zt*t.height;this.outerPadding=Math.min(s.height/2,a);const o=s.width+this.axisConfig.labelPadding*2;o<=e&&(e-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=e&&(e-=a,this.showTitle=!0)}this.boundingRect.width=t.width-e,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const e=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${e},${this.getScaleValue(s)} L ${e-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const e=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${e} L ${this.getScaleValue(s)},${e+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const e=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${e+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},n.__name(Q,"BaseAxis"),Q),K,ue=(K=class extends Ft{constructor(t,e,s,a,o){super(t,a,o,e),this.categories=s,this.scale=yt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=yt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),n.log.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n.__name(K,"BandAxis"),K),Z,ge=(Z=class extends Ft{constructor(t,e,s,a,o){super(t,a,o,e),this.domain=s,this.scale=Bt.linear().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Bt.linear().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n.__name(Z,"LinearAxis"),Z);function At(i,t,e,s){const a=new Ot(s);return Ct(i)?new ue(t,e,i.categories,i.title,a):new ge(t,e,[i.min,i.max],i.title,a)}n.__name(At,"getAxis");var J,xe=(J=class{constructor(t,e,s,a){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=s,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(e.width,t.width),a=e.height+2*this.chartConfig.titlePadding;return e.width<=s&&e.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=a,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},n.__name(J,"ChartTitle"),J);function Xt(i,t,e,s){const a=new Ot(s);return new xe(a,i,t,e)}n.__name(Xt,"getChartTitleComponent");var tt,de=(tt=class{constructor(t,e,s,a,o){this.plotData=t,this.xAxis=e,this.yAxis=s,this.orientation=a,this.plotIndex=o}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let e;return this.orientation==="horizontal"?e=n.line().y(s=>s[0]).x(s=>s[1])(t):e=n.line().x(s=>s[0]).y(s=>s[1])(t),e?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},n.__name(tt,"LinePlot"),tt),et,fe=(et=class{constructor(t,e,s,a,o,g){this.barData=t,this.boundingRect=e,this.xAxis=s,this.yAxis=a,this.orientation=o,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(o=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:this.boundingRect.x,y:o[0]-a,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:o[0]-a,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n.__name(et,"BarPlot"),et),it,pe=(it=class{constructor(t,e,s){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,e){this.xAxis=t,this.yAxis=e}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[e,s]of this.chartData.plots.entries())switch(s.type){case"line":{const a=new de(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...a.getDrawableElement())}break;case"bar":{const a=new fe(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...a.getDrawableElement())}break}return t}},n.__name(it,"BasePlot"),it);function Nt(i,t,e){return new pe(i,t,e)}n.__name(Nt,"getPlotComponent");var st,me=(st=class{constructor(t,e,s,a){this.chartConfig=t,this.chartData=e,this.componentStore={title:Xt(t,e,s,a),plot:Nt(t,e,s),xAxis:At(e.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},a),yAxis:At(e.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,s=0,a=0,o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),m=this.componentStore.plot.calculateSpace({width:o,height:g});t-=m.width,e-=m.height,m=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),a=m.height,e-=m.height,this.componentStore.xAxis.setAxisPosition("bottom"),m=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=m.height,this.componentStore.yAxis.setAxisPosition("left"),m=this.componentStore.yAxis.calculateSpace({width:t,height:e}),s=m.width,t-=m.width,t>0&&(o+=t,t=0),e>0&&(g+=e,e=0),this.componentStore.plot.calculateSpace({width:o,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.xAxis.setRange([s,s+o]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:a+g}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(p=>bt(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,s=0,a=0,o=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),m=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:g,height:m});t-=p.width,e-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),s=p.height,e-=p.height,this.componentStore.xAxis.setAxisPosition("left"),p=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=p.width,a=p.width,this.componentStore.yAxis.setAxisPosition("top"),p=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=p.height,o=s+p.height,t>0&&(g+=t,t=0),e>0&&(m+=e,e=0),this.componentStore.plot.calculateSpace({width:g,height:m}),this.componentStore.plot.setBoundingBoxXY({x:a,y:o}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:s}),this.componentStore.xAxis.setRange([o,o+m]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some(k=>bt(k))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},n.__name(st,"Orchestrator"),st),nt,ye=(nt=class{static build(t,e,s,a){return new me(t,e,s,a).getDrawableElement()}},n.__name(nt,"XYChartBuilder"),nt),rt=0,Yt,ot=Tt(),ht=kt(),b=Rt(),wt=ht.plotColorPalette.split(",").map(i=>i.trim()),gt=!1,St=!1;function kt(){const i=n.getThemeVariables3(),t=n.getConfig();return n.cleanAndMerge(i.xyChart,t.themeVariables.xyChart)}n.__name(kt,"getChartDefaultThemeConfig");function Tt(){const i=n.getConfig();return n.cleanAndMerge(n.defaultConfig_default.xyChart,i.xyChart)}n.__name(Tt,"getChartDefaultConfig");function Rt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n.__name(Rt,"getChartDefaultData");function xt(i){const t=n.getConfig();return n.sanitizeText(i.trim(),t)}n.__name(xt,"textSanitizer");function Ht(i){Yt=i}n.__name(Ht,"setTmpSVGG");function Ut(i){i==="horizontal"?ot.chartOrientation="horizontal":ot.chartOrientation="vertical"}n.__name(Ut,"setOrientation");function $t(i){b.xAxis.title=xt(i.text)}n.__name($t,"setXAxisTitle");function Dt(i,t){b.xAxis={type:"linear",title:b.xAxis.title,min:i,max:t},gt=!0}n.__name(Dt,"setXAxisRangeData");function qt(i){b.xAxis={type:"band",title:b.xAxis.title,categories:i.map(t=>xt(t.text))},gt=!0}n.__name(qt,"setXAxisBand");function jt(i){b.yAxis.title=xt(i.text)}n.__name(jt,"setYAxisTitle");function Gt(i,t){b.yAxis={type:"linear",title:b.yAxis.title,min:i,max:t},St=!0}n.__name(Gt,"setYAxisRangeData");function Qt(i){const t=Math.min(...i),e=Math.max(...i),s=j(b.yAxis)?b.yAxis.min:1/0,a=j(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(s,t),max:Math.max(a,e)}}n.__name(Qt,"setYAxisRangeFromPlotData");function vt(i){let t=[];if(i.length===0)return t;if(!gt){const e=j(b.xAxis)?b.xAxis.min:1/0,s=j(b.xAxis)?b.xAxis.max:-1/0;Dt(Math.min(e,1),Math.max(s,i.length))}if(St||Qt(i),Ct(b.xAxis)&&(t=b.xAxis.categories.map((e,s)=>[e,i[s]])),j(b.xAxis)){const e=b.xAxis.min,s=b.xAxis.max,a=(s-e)/(i.length-1),o=[];for(let g=e;g<=s;g+=a)o.push(`${g}`);t=o.map((g,m)=>[g,i[m]])}return t}n.__name(vt,"transformDataWithoutCategory");function Pt(i){return wt[i===0?0:i%wt.length]}n.__name(Pt,"getPlotColorFromPalette");function Kt(i,t){const e=vt(t);b.plots.push({type:"line",strokeFill:Pt(rt),strokeWidth:2,data:e}),rt++}n.__name(Kt,"setLineData");function Zt(i,t){const e=vt(t);b.plots.push({type:"bar",fill:Pt(rt),data:e}),rt++}n.__name(Zt,"setBarData");function Jt(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=n.getDiagramTitle(),ye.build(ot,b,ht,Yt)}n.__name(Jt,"getDrawableElem");function te(){return ht}n.__name(te,"getChartThemeConfig");function ee(){return ot}n.__name(ee,"getChartConfig");function ie(){return b}n.__name(ie,"getXYChartData");var _e=n.__name(function(){n.clear(),rt=0,ot=Tt(),b=Rt(),ht=kt(),wt=ht.plotColorPalette.split(",").map(i=>i.trim()),gt=!1,St=!1},"clear"),be={getDrawableElem:Jt,clear:_e,setAccTitle:n.setAccTitle,getAccTitle:n.getAccTitle,setDiagramTitle:n.setDiagramTitle,getDiagramTitle:n.getDiagramTitle,getAccDescription:n.getAccDescription,setAccDescription:n.setAccDescription,setOrientation:Ut,setXAxisTitle:$t,setXAxisRangeData:Dt,setXAxisBand:qt,setYAxisTitle:jt,setYAxisRangeData:Gt,setLineData:Kt,setBarData:Zt,setTmpSVGG:Ht,getChartThemeConfig:te,getChartConfig:ee,getXYChartData:ie},Ae=n.__name((i,t,e,s)=>{const a=s.db,o=a.getChartThemeConfig(),g=a.getChartConfig(),m=a.getXYChartData().plots[0].data.map(y=>y[1]);function p(y){return y==="top"?"text-before-edge":"middle"}n.__name(p,"getDominantBaseLine");function k(y){return y==="left"?"start":y==="right"?"end":"middle"}n.__name(k,"getTextAnchor");function v(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}n.__name(v,"getTextTransformation"),n.log.debug(`Rendering xychart chart
7
+ `+i);const w=n.selectSvgElement(t),_=w.append("g").attr("class","main"),E=_.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");n.configureSvgSize(w,g.height,g.width,!0),w.attr("viewBox",`0 0 ${g.width} ${g.height}`),E.attr("fill",o.backgroundColor),a.setTmpSVGG(w.append("g").attr("class","mermaid-tmp-group"));const D=a.getDrawableElem(),P={};function M(y){let S=_,c="";for(const[W]of y.entries()){let z=_;W>0&&P[c]&&(z=P[c]),c+=y[W],S=P[c],S||(S=P[c]=z.append("g").attr("class",y[W]))}return S}n.__name(M,"getGroup");for(const y of D){if(y.data.length===0)continue;const S=M(y.groupTexts);switch(y.type){case"rect":if(S.selectAll("rect").data(y.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),g.showDataLabel)if(g.chartOrientation==="horizontal"){let c=function(l,L){const{data:C,label:T}=l;return L*T.length*W<=C.width-10};n.__name(c,"fitsHorizontally");const W=.7,z=y.data.map((l,L)=>({data:l,label:m[L].toString()})).filter(l=>l.data.width>0&&l.data.height>0),U=z.map(l=>{const{data:L}=l;let C=L.height*.7;for(;!c(l,C)&&C>0;)C-=1;return C}),X=Math.floor(Math.min(...U));S.selectAll("text").data(z).enter().append("text").attr("x",l=>l.data.x+l.data.width-10).attr("y",l=>l.data.y+l.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${X}px`).text(l=>l.label)}else{let c=function(l,L,C){const{data:T,label:$}=l,N=L*$.length*.7,O=T.x+T.width/2,h=O-N/2,u=O+N/2,x=h>=T.x&&u<=T.x+T.width,d=T.y+C+L<=T.y+T.height;return x&&d};n.__name(c,"fitsInBar");const W=10,z=y.data.map((l,L)=>({data:l,label:m[L].toString()})).filter(l=>l.data.width>0&&l.data.height>0),U=z.map(l=>{const{data:L,label:C}=l;let T=L.width/(C.length*.7);for(;!c(l,T,W)&&T>0;)T-=1;return T}),X=Math.floor(Math.min(...U));S.selectAll("text").data(z).enter().append("text").attr("x",l=>l.data.x+l.data.width/2).attr("y",l=>l.data.y+W).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${X}px`).text(l=>l.label)}break;case"text":S.selectAll("text").data(y.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>p(c.verticalPos)).attr("text-anchor",c=>k(c.horizontalPos)).attr("transform",c=>v(c)).text(c=>c.text);break;case"path":S.selectAll("path").data(y.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),we={draw:Ae},Ce={parser:ce,db:be,renderer:we};exports.diagram=Ce;