jekyll-ham 1.0.4 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (366) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -2
  3. data/_layouts/default.html +6 -0
  4. data/_layouts/page.html +1 -1
  5. data/assets/mermaid/Diagram.d.ts +33 -0
  6. data/assets/mermaid/Tableau10-31042135.js +10 -0
  7. data/assets/mermaid/Tableau10-558cc280.js +9 -0
  8. data/assets/mermaid/__mocks__/mermaidAPI.d.ts +13 -0
  9. data/assets/mermaid/accessibility.d.ts +27 -0
  10. data/assets/mermaid/accessibility.spec.d.ts +1 -0
  11. data/assets/mermaid/arc-c0f908ab.js +148 -0
  12. data/assets/mermaid/arc-d1f6357e.js +86 -0
  13. data/assets/mermaid/array-2ff2c7a6.js +6 -0
  14. data/assets/mermaid/array-b7dcf730.js +6 -0
  15. data/assets/mermaid/assignWithDepth.d.ts +30 -0
  16. data/assets/mermaid/blockDiagram-5dc23a45.js +1230 -0
  17. data/assets/mermaid/blockDiagram-9f4a6865.js +1822 -0
  18. data/assets/mermaid/blockDiagram-efe38566.js +1818 -0
  19. data/assets/mermaid/c4Diagram-1e775db3.js +1579 -0
  20. data/assets/mermaid/c4Diagram-ae766693.js +2473 -0
  21. data/assets/mermaid/c4Diagram-af207393.js +2463 -0
  22. data/assets/mermaid/channel-ebbc4130.js +5 -0
  23. data/assets/mermaid/channel-f9001828.js +8 -0
  24. data/assets/mermaid/classDiagram-72b9c71d.js +356 -0
  25. data/assets/mermaid/classDiagram-f52caa06.js +220 -0
  26. data/assets/mermaid/classDiagram-fb54d2a0.js +363 -0
  27. data/assets/mermaid/classDiagram-v2-640c694e.js +206 -0
  28. data/assets/mermaid/classDiagram-v2-a2b738ad.js +298 -0
  29. data/assets/mermaid/classDiagram-v2-fedb80f6.js +290 -0
  30. data/assets/mermaid/clone-9ea6bfeb.js +8 -0
  31. data/assets/mermaid/clone-afc2f047.js +8 -0
  32. data/assets/mermaid/config.d.ts +98 -0
  33. data/assets/mermaid/config.spec.d.ts +1 -0
  34. data/assets/mermaid/config.type.d.ts +1534 -0
  35. data/assets/mermaid/createText-03b82060.js +2966 -0
  36. data/assets/mermaid/createText-b70fe78a.js +4929 -0
  37. data/assets/mermaid/createText-ca0c5216.js +251 -0
  38. data/assets/mermaid/dagre-wrapper/blockArrowHelper.d.ts +8 -0
  39. data/assets/mermaid/dagre-wrapper/clusters.d.ts +4 -0
  40. data/assets/mermaid/dagre-wrapper/createLabel.d.ts +9 -0
  41. data/assets/mermaid/dagre-wrapper/edgeMarker.d.ts +12 -0
  42. data/assets/mermaid/dagre-wrapper/edgeMarker.spec.d.ts +1 -0
  43. data/assets/mermaid/dagre-wrapper/edges.d.ts +14 -0
  44. data/assets/mermaid/dagre-wrapper/index.d.ts +1 -0
  45. data/assets/mermaid/dagre-wrapper/intersect/index.d.ts +13 -0
  46. data/assets/mermaid/dagre-wrapper/intersect/intersect-circle.d.ts +10 -0
  47. data/assets/mermaid/dagre-wrapper/intersect/intersect-ellipse.d.ts +11 -0
  48. data/assets/mermaid/dagre-wrapper/intersect/intersect-line.d.ts +13 -0
  49. data/assets/mermaid/dagre-wrapper/intersect/intersect-node.d.ts +6 -0
  50. data/assets/mermaid/dagre-wrapper/intersect/intersect-polygon.d.ts +10 -0
  51. data/assets/mermaid/dagre-wrapper/intersect/intersect-rect.d.ts +5 -0
  52. data/assets/mermaid/dagre-wrapper/markers.d.ts +2 -0
  53. data/assets/mermaid/dagre-wrapper/mermaid-graphlib.d.ts +8 -0
  54. data/assets/mermaid/dagre-wrapper/nodes.d.ts +4 -0
  55. data/assets/mermaid/dagre-wrapper/shapes/note.d.ts +2 -0
  56. data/assets/mermaid/dagre-wrapper/shapes/util.d.ts +14 -0
  57. data/assets/mermaid/defaultConfig.d.ts +12 -0
  58. data/assets/mermaid/diagram-api/comments.d.ts +6 -0
  59. data/assets/mermaid/diagram-api/comments.spec.d.ts +1 -0
  60. data/assets/mermaid/diagram-api/detectType.d.ts +42 -0
  61. data/assets/mermaid/diagram-api/diagram-orchestration.d.ts +1 -0
  62. data/assets/mermaid/diagram-api/diagram-orchestration.spec.d.ts +1 -0
  63. data/assets/mermaid/diagram-api/diagramAPI.d.ts +31 -0
  64. data/assets/mermaid/diagram-api/diagramAPI.spec.d.ts +1 -0
  65. data/assets/mermaid/diagram-api/frontmatter.d.ts +18 -0
  66. data/assets/mermaid/diagram-api/frontmatter.spec.d.ts +1 -0
  67. data/assets/mermaid/diagram-api/loadDiagram.d.ts +1 -0
  68. data/assets/mermaid/diagram-api/regexes.d.ts +3 -0
  69. data/assets/mermaid/diagram-api/types.d.ts +84 -0
  70. data/assets/mermaid/diagram.spec.d.ts +1 -0
  71. data/assets/mermaid/diagrams/block/blockDB.d.ts +54 -0
  72. data/assets/mermaid/diagrams/block/blockDetector.d.ts +3 -0
  73. data/assets/mermaid/diagrams/block/blockDiagram.d.ts +2 -0
  74. data/assets/mermaid/diagrams/block/blockRenderer.d.ts +15 -0
  75. data/assets/mermaid/diagrams/block/blockTypes.d.ts +36 -0
  76. data/assets/mermaid/diagrams/block/blockUtils.d.ts +1 -0
  77. data/assets/mermaid/diagrams/block/layout.d.ts +13 -0
  78. data/assets/mermaid/diagrams/block/layout.spec.d.ts +1 -0
  79. data/assets/mermaid/diagrams/block/parser/block.spec.d.ts +1 -0
  80. data/assets/mermaid/diagrams/block/renderHelpers.d.ts +10 -0
  81. data/assets/mermaid/diagrams/block/styles.d.ts +18 -0
  82. data/assets/mermaid/diagrams/c4/c4Db.d.ts +127 -0
  83. data/assets/mermaid/diagrams/c4/c4Detector.d.ts +3 -0
  84. data/assets/mermaid/diagrams/c4/c4Diagram.d.ts +2 -0
  85. data/assets/mermaid/diagrams/c4/c4Renderer.d.ts +12 -0
  86. data/assets/mermaid/diagrams/c4/styles.d.ts +2 -0
  87. data/assets/mermaid/diagrams/c4/svgDraw.d.ts +36 -0
  88. data/assets/mermaid/diagrams/class/classDb.d.ts +144 -0
  89. data/assets/mermaid/diagrams/class/classDetector-V2.d.ts +3 -0
  90. data/assets/mermaid/diagrams/class/classDetector.d.ts +3 -0
  91. data/assets/mermaid/diagrams/class/classDiagram-v2.d.ts +2 -0
  92. data/assets/mermaid/diagrams/class/classDiagram.d.ts +2 -0
  93. data/assets/mermaid/diagrams/class/classDiagram.spec.d.ts +1 -0
  94. data/assets/mermaid/diagrams/class/classRenderer-v2.d.ts +57 -0
  95. data/assets/mermaid/diagrams/class/classRenderer.d.ts +5 -0
  96. data/assets/mermaid/diagrams/class/classTypes.d.ts +78 -0
  97. data/assets/mermaid/diagrams/class/classTypes.spec.d.ts +1 -0
  98. data/assets/mermaid/diagrams/class/styles.d.ts +2 -0
  99. data/assets/mermaid/diagrams/class/svgDraw.d.ts +25 -0
  100. data/assets/mermaid/diagrams/common/common.d.ts +110 -0
  101. data/assets/mermaid/diagrams/common/common.spec.d.ts +1 -0
  102. data/assets/mermaid/diagrams/common/commonDb.d.ts +7 -0
  103. data/assets/mermaid/diagrams/common/commonTypes.d.ts +51 -0
  104. data/assets/mermaid/diagrams/common/svgDrawCommon.d.ts +15 -0
  105. data/assets/mermaid/diagrams/er/erDb.d.ts +49 -0
  106. data/assets/mermaid/diagrams/er/erDetector.d.ts +3 -0
  107. data/assets/mermaid/diagrams/er/erDiagram.d.ts +34 -0
  108. data/assets/mermaid/diagrams/er/erMarkers.d.ts +24 -0
  109. data/assets/mermaid/diagrams/er/erRenderer.d.ts +19 -0
  110. data/assets/mermaid/diagrams/er/erRenderer.spec.d.ts +1 -0
  111. data/assets/mermaid/diagrams/er/styles.d.ts +2 -0
  112. data/assets/mermaid/diagrams/error/errorDiagram.d.ts +3 -0
  113. data/assets/mermaid/diagrams/error/errorRenderer.d.ts +12 -0
  114. data/assets/mermaid/diagrams/flowchart/elk/detector.d.ts +3 -0
  115. data/assets/mermaid/diagrams/flowchart/elk/detector.spec.d.ts +1 -0
  116. data/assets/mermaid/diagrams/flowchart/elk/flowRenderer-elk.d.ts +10 -0
  117. data/assets/mermaid/diagrams/flowchart/elk/flowchart-elk-definition.d.ts +10 -0
  118. data/assets/mermaid/diagrams/flowchart/elk/render-utils.d.ts +5 -0
  119. data/assets/mermaid/diagrams/flowchart/elk/render-utils.spec.d.ts +1 -0
  120. data/assets/mermaid/diagrams/flowchart/elk/styles.d.ts +19 -0
  121. data/assets/mermaid/diagrams/flowchart/flowChartShapes.d.ts +9 -0
  122. data/assets/mermaid/diagrams/flowchart/flowDb.d.ts +87 -0
  123. data/assets/mermaid/diagrams/flowchart/flowDetector-v2.d.ts +3 -0
  124. data/assets/mermaid/diagrams/flowchart/flowDetector.d.ts +3 -0
  125. data/assets/mermaid/diagrams/flowchart/flowDiagram-v2.d.ts +57 -0
  126. data/assets/mermaid/diagrams/flowchart/flowDiagram.d.ts +57 -0
  127. data/assets/mermaid/diagrams/flowchart/flowRenderer-v2.d.ts +13 -0
  128. data/assets/mermaid/diagrams/flowchart/flowRenderer.d.ts +13 -0
  129. data/assets/mermaid/diagrams/flowchart/styles.d.ts +18 -0
  130. data/assets/mermaid/diagrams/gantt/ganttDb.d.ts +106 -0
  131. data/assets/mermaid/diagrams/gantt/ganttDb.spec.d.ts +1 -0
  132. data/assets/mermaid/diagrams/gantt/ganttDetector.d.ts +3 -0
  133. data/assets/mermaid/diagrams/gantt/ganttDiagram.d.ts +2 -0
  134. data/assets/mermaid/diagrams/gantt/ganttRenderer.d.ts +7 -0
  135. data/assets/mermaid/diagrams/gantt/styles.d.ts +2 -0
  136. data/assets/mermaid/diagrams/git/gitGraphAst.d.ts +61 -0
  137. data/assets/mermaid/diagrams/git/gitGraphDetector.d.ts +3 -0
  138. data/assets/mermaid/diagrams/git/gitGraphDiagram.d.ts +2 -0
  139. data/assets/mermaid/diagrams/git/gitGraphRenderer.d.ts +5 -0
  140. data/assets/mermaid/diagrams/git/styles.d.ts +2 -0
  141. data/assets/mermaid/diagrams/info/info.spec.d.ts +1 -0
  142. data/assets/mermaid/diagrams/info/infoDb.d.ts +5 -0
  143. data/assets/mermaid/diagrams/info/infoDetector.d.ts +2 -0
  144. data/assets/mermaid/diagrams/info/infoDiagram.d.ts +2 -0
  145. data/assets/mermaid/diagrams/info/infoRenderer.d.ts +4 -0
  146. data/assets/mermaid/diagrams/info/infoTypes.d.ts +9 -0
  147. data/assets/mermaid/diagrams/mindmap/detector.d.ts +3 -0
  148. data/assets/mermaid/diagrams/mindmap/mindmap-definition.d.ts +2 -0
  149. data/assets/mermaid/diagrams/mindmap/mindmap.spec.d.ts +1 -0
  150. data/assets/mermaid/diagrams/mindmap/mindmapDb.d.ts +30 -0
  151. data/assets/mermaid/diagrams/mindmap/mindmapRenderer.d.ts +21 -0
  152. data/assets/mermaid/diagrams/mindmap/mindmapTypes.d.ts +20 -0
  153. data/assets/mermaid/diagrams/mindmap/styles.d.ts +3 -0
  154. data/assets/mermaid/diagrams/mindmap/svgDraw.d.ts +13 -0
  155. data/assets/mermaid/diagrams/pie/pie.spec.d.ts +1 -0
  156. data/assets/mermaid/diagrams/pie/pieDb.d.ts +6 -0
  157. data/assets/mermaid/diagrams/pie/pieDetector.d.ts +2 -0
  158. data/assets/mermaid/diagrams/pie/pieDiagram.d.ts +2 -0
  159. data/assets/mermaid/diagrams/pie/pieRenderer.d.ts +13 -0
  160. data/assets/mermaid/diagrams/pie/pieStyles.d.ts +3 -0
  161. data/assets/mermaid/diagrams/pie/pieTypes.d.ts +53 -0
  162. data/assets/mermaid/diagrams/quadrant-chart/parser/quadrant.jison.spec.d.ts +1 -0
  163. data/assets/mermaid/diagrams/quadrant-chart/quadrantBuilder.d.ts +118 -0
  164. data/assets/mermaid/diagrams/quadrant-chart/quadrantDb.d.ts +38 -0
  165. data/assets/mermaid/diagrams/quadrant-chart/quadrantDetector.d.ts +3 -0
  166. data/assets/mermaid/diagrams/quadrant-chart/quadrantDiagram.d.ts +2 -0
  167. data/assets/mermaid/diagrams/quadrant-chart/quadrantRenderer.d.ts +6 -0
  168. data/assets/mermaid/diagrams/requirement/requirementDb.d.ts +70 -0
  169. data/assets/mermaid/diagrams/requirement/requirementDetector.d.ts +3 -0
  170. data/assets/mermaid/diagrams/requirement/requirementDiagram.d.ts +2 -0
  171. data/assets/mermaid/diagrams/requirement/requirementMarkers.d.ts +10 -0
  172. data/assets/mermaid/diagrams/requirement/requirementRenderer.d.ts +7 -0
  173. data/assets/mermaid/diagrams/requirement/styles.d.ts +2 -0
  174. data/assets/mermaid/diagrams/sankey/parser/sankey.spec.d.ts +1 -0
  175. data/assets/mermaid/diagrams/sankey/sankeyDB.d.ts +36 -0
  176. data/assets/mermaid/diagrams/sankey/sankeyDetector.d.ts +3 -0
  177. data/assets/mermaid/diagrams/sankey/sankeyDiagram.d.ts +2 -0
  178. data/assets/mermaid/diagrams/sankey/sankeyRenderer.d.ts +14 -0
  179. data/assets/mermaid/diagrams/sankey/sankeyUtils.d.ts +1 -0
  180. data/assets/mermaid/diagrams/sequence/sequenceDb.d.ts +153 -0
  181. data/assets/mermaid/diagrams/sequence/sequenceDetector.d.ts +3 -0
  182. data/assets/mermaid/diagrams/sequence/sequenceDiagram.d.ts +2 -0
  183. data/assets/mermaid/diagrams/sequence/sequenceRenderer.d.ts +202 -0
  184. data/assets/mermaid/diagrams/sequence/styles.d.ts +2 -0
  185. data/assets/mermaid/diagrams/sequence/svgDraw.d.ts +73 -0
  186. data/assets/mermaid/diagrams/state/id-cache.d.ts +11 -0
  187. data/assets/mermaid/diagrams/state/shapes.d.ts +14 -0
  188. data/assets/mermaid/diagrams/state/stateCommon.d.ts +22 -0
  189. data/assets/mermaid/diagrams/state/stateDb.d.ts +91 -0
  190. data/assets/mermaid/diagrams/state/stateDetector-V2.d.ts +3 -0
  191. data/assets/mermaid/diagrams/state/stateDetector.d.ts +3 -0
  192. data/assets/mermaid/diagrams/state/stateDiagram-v2.d.ts +2 -0
  193. data/assets/mermaid/diagrams/state/stateDiagram.d.ts +2 -0
  194. data/assets/mermaid/diagrams/state/stateRenderer-v2.d.ts +20 -0
  195. data/assets/mermaid/diagrams/state/stateRenderer.d.ts +7 -0
  196. data/assets/mermaid/diagrams/state/styles.d.ts +2 -0
  197. data/assets/mermaid/diagrams/timeline/detector.d.ts +3 -0
  198. data/assets/mermaid/diagrams/timeline/styles.d.ts +2 -0
  199. data/assets/mermaid/diagrams/timeline/svgDraw.d.ts +46 -0
  200. data/assets/mermaid/diagrams/timeline/timeline-definition.d.ts +10 -0
  201. data/assets/mermaid/diagrams/timeline/timelineDb.d.ts +20 -0
  202. data/assets/mermaid/diagrams/timeline/timelineRenderer.d.ts +19 -0
  203. data/assets/mermaid/diagrams/user-journey/journeyDb.d.ts +30 -0
  204. data/assets/mermaid/diagrams/user-journey/journeyDetector.d.ts +3 -0
  205. data/assets/mermaid/diagrams/user-journey/journeyDiagram.d.ts +2 -0
  206. data/assets/mermaid/diagrams/user-journey/journeyRenderer.d.ts +30 -0
  207. data/assets/mermaid/diagrams/user-journey/styles.d.ts +2 -0
  208. data/assets/mermaid/diagrams/user-journey/svgDraw.d.ts +20 -0
  209. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/bandAxis.d.ts +12 -0
  210. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/baseAxis.d.ts +38 -0
  211. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/index.d.ts +12 -0
  212. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/linearAxis.d.ts +11 -0
  213. data/assets/mermaid/diagrams/xychart/chartBuilder/components/chartTitle.d.ts +16 -0
  214. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/barPlot.d.ts +12 -0
  215. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/index.d.ts +20 -0
  216. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/linePlot.d.ts +11 -0
  217. data/assets/mermaid/diagrams/xychart/chartBuilder/index.d.ts +5 -0
  218. data/assets/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts +132 -0
  219. data/assets/mermaid/diagrams/xychart/chartBuilder/orchestrator.d.ts +12 -0
  220. data/assets/mermaid/diagrams/xychart/chartBuilder/textDimensionCalculator.d.ts +10 -0
  221. data/assets/mermaid/diagrams/xychart/parser/xychart.jison.spec.d.ts +1 -0
  222. data/assets/mermaid/diagrams/xychart/xychartDb.d.ts +40 -0
  223. data/assets/mermaid/diagrams/xychart/xychartDetector.d.ts +3 -0
  224. data/assets/mermaid/diagrams/xychart/xychartDiagram.d.ts +2 -0
  225. data/assets/mermaid/diagrams/xychart/xychartRenderer.d.ts +6 -0
  226. data/assets/mermaid/docs/vite.config.d.ts +2 -0
  227. data/assets/mermaid/edges-066a5561.js +1840 -0
  228. data/assets/mermaid/edges-16357fde.js +1083 -0
  229. data/assets/mermaid/edges-ce5cfb7c.js +1840 -0
  230. data/assets/mermaid/erDiagram-09d1c15f.js +1176 -0
  231. data/assets/mermaid/erDiagram-543717f2.js +1321 -0
  232. data/assets/mermaid/erDiagram-c7ff1bec.js +931 -0
  233. data/assets/mermaid/errors.d.ts +3 -0
  234. data/assets/mermaid/flowDb-9a89ea33.js +1126 -0
  235. data/assets/mermaid/flowDb-ba9bd7fa.js +1713 -0
  236. data/assets/mermaid/flowDb-c1833063.js +1714 -0
  237. data/assets/mermaid/flowDiagram-aadb13b0.js +797 -0
  238. data/assets/mermaid/flowDiagram-b222e15a.js +614 -0
  239. data/assets/mermaid/flowDiagram-b5e7ba30.js +1278 -0
  240. data/assets/mermaid/flowDiagram-v2-13329dc7.js +40 -0
  241. data/assets/mermaid/flowDiagram-v2-54711e03.js +32 -0
  242. data/assets/mermaid/flowDiagram-v2-f2119625.js +25 -0
  243. data/assets/mermaid/flowchart-elk-definition-2d49707c.js +93397 -0
  244. data/assets/mermaid/flowchart-elk-definition-ae0efee6.js +814 -0
  245. data/assets/mermaid/flowchart-elk-definition-cf813a97.js +48407 -0
  246. data/assets/mermaid/ganttDiagram-12cf43db.js +3445 -0
  247. data/assets/mermaid/ganttDiagram-3c2fde2b.js +2501 -0
  248. data/assets/mermaid/ganttDiagram-b62c793e.js +2061 -0
  249. data/assets/mermaid/gitGraphDiagram-942e62fe.js +1800 -0
  250. data/assets/mermaid/gitGraphDiagram-b9392a12.js +1790 -0
  251. data/assets/mermaid/gitGraphDiagram-c3a0619c.js +1264 -0
  252. data/assets/mermaid/graph-0ee63739.js +881 -0
  253. data/assets/mermaid/graph-fe24fab6.js +1285 -0
  254. data/assets/mermaid/index-01f381cb.js +622 -0
  255. data/assets/mermaid/index-bb6d8841.js +373 -0
  256. data/assets/mermaid/index-fc479858.js +663 -0
  257. data/assets/mermaid/infoDiagram-2f5c50c0.js +319 -0
  258. data/assets/mermaid/infoDiagram-94cd232f.js +520 -0
  259. data/assets/mermaid/infoDiagram-d0d5c9bd.js +510 -0
  260. data/assets/mermaid/init-cc95ec8e.js +16 -0
  261. data/assets/mermaid/init-f9637058.js +16 -0
  262. data/assets/mermaid/interactionDb.d.ts +2 -0
  263. data/assets/mermaid/journeyDiagram-14fe341a.js +804 -0
  264. data/assets/mermaid/journeyDiagram-6625b456.js +1191 -0
  265. data/assets/mermaid/journeyDiagram-b56e6921.js +1183 -0
  266. data/assets/mermaid/katex-d90b6d29.js +11624 -0
  267. data/assets/mermaid/katex-ffb0e8f1.js +14432 -0
  268. data/assets/mermaid/layout-163b9689.js +2314 -0
  269. data/assets/mermaid/layout-fd473db2.js +1536 -0
  270. data/assets/mermaid/line-24d93f1b.js +34 -0
  271. data/assets/mermaid/line-87f517ef.js +50 -0
  272. data/assets/mermaid/linear-0ad15847.js +595 -0
  273. data/assets/mermaid/linear-9bcf74c4.js +447 -0
  274. data/assets/mermaid/logger.d.ts +9 -0
  275. data/assets/mermaid/mermaid-6dc72991.js +6461 -0
  276. data/assets/mermaid/mermaid-9f2aa176.js +8112 -0
  277. data/assets/mermaid/mermaid-dcacb631.js +12793 -0
  278. data/assets/mermaid/mermaid.core.mjs +14 -0
  279. data/assets/mermaid/mermaid.d.ts +146 -0
  280. data/assets/mermaid/mermaid.esm.min.mjs +4 -0
  281. data/assets/mermaid/mermaid.esm.mjs +4 -0
  282. data/assets/mermaid/mermaid.js +195755 -0
  283. data/assets/mermaid/mermaid.min.js +2029 -0
  284. data/assets/mermaid/mermaid.spec.d.ts +1 -0
  285. data/assets/mermaid/mermaidAPI.d.ts +170 -0
  286. data/assets/mermaid/mermaidAPI.spec.d.ts +1 -0
  287. data/assets/mermaid/mindmap-definition-307c710a.js +1177 -0
  288. data/assets/mermaid/mindmap-definition-696ddea4.js +32342 -0
  289. data/assets/mermaid/mindmap-definition-9399c7e6.js +18760 -0
  290. data/assets/mermaid/ordinal-475e0c0c.js +82 -0
  291. data/assets/mermaid/ordinal-5695958c.js +65 -0
  292. data/assets/mermaid/path-39bad7e2.js +118 -0
  293. data/assets/mermaid/path-428ebac9.js +91 -0
  294. data/assets/mermaid/pieDiagram-828dae43.js +502 -0
  295. data/assets/mermaid/pieDiagram-bb1d19e5.js +722 -0
  296. data/assets/mermaid/pieDiagram-e854eaf0.js +772 -0
  297. data/assets/mermaid/preprocess.d.ts +10 -0
  298. data/assets/mermaid/quadrantDiagram-25a9848b.js +1199 -0
  299. data/assets/mermaid/quadrantDiagram-5fa00455.js +904 -0
  300. data/assets/mermaid/quadrantDiagram-c759a472.js +1207 -0
  301. data/assets/mermaid/rendering-util/createText.d.ts +11 -0
  302. data/assets/mermaid/rendering-util/handle-markdown-text.d.ts +6 -0
  303. data/assets/mermaid/rendering-util/handle-markdown-text.spec.d.ts +1 -0
  304. data/assets/mermaid/rendering-util/selectSvgElement.d.ts +8 -0
  305. data/assets/mermaid/rendering-util/splitText.d.ts +24 -0
  306. data/assets/mermaid/rendering-util/splitText.spec.d.ts +1 -0
  307. data/assets/mermaid/rendering-util/uid.d.ts +8 -0
  308. data/assets/mermaid/requirementDiagram-03163dc4.js +769 -0
  309. data/assets/mermaid/requirementDiagram-87253d64.js +1098 -0
  310. data/assets/mermaid/requirementDiagram-a721e157.js +1091 -0
  311. data/assets/mermaid/sankeyDiagram-33525efb.js +1198 -0
  312. data/assets/mermaid/sankeyDiagram-52ec8976.js +818 -0
  313. data/assets/mermaid/sankeyDiagram-707fac0f.js +660 -0
  314. data/assets/mermaid/sequenceDiagram-6894f283.js +3346 -0
  315. data/assets/mermaid/sequenceDiagram-9813c129.js +3336 -0
  316. data/assets/mermaid/sequenceDiagram-b517d154.js +2234 -0
  317. data/assets/mermaid/setupGraphViewbox.d.ts +3 -0
  318. data/assets/mermaid/stateDiagram-5dee940d.js +474 -0
  319. data/assets/mermaid/stateDiagram-5ec31577.js +467 -0
  320. data/assets/mermaid/stateDiagram-fca82b5b.js +275 -0
  321. data/assets/mermaid/stateDiagram-v2-1992cada.js +333 -0
  322. data/assets/mermaid/stateDiagram-v2-992e82a1.js +325 -0
  323. data/assets/mermaid/stateDiagram-v2-ed04200a.js +190 -0
  324. data/assets/mermaid/styles-0784dbeb.js +1363 -0
  325. data/assets/mermaid/styles-11e81fdd.js +1089 -0
  326. data/assets/mermaid/styles-36a1a2e8.js +1483 -0
  327. data/assets/mermaid/styles-483fbfea.js +509 -0
  328. data/assets/mermaid/styles-727cdd61.js +571 -0
  329. data/assets/mermaid/styles-b83b31c9.js +1484 -0
  330. data/assets/mermaid/styles-cacbff60.js +960 -0
  331. data/assets/mermaid/styles-e75131e4.js +433 -0
  332. data/assets/mermaid/styles-f80da881.js +1363 -0
  333. data/assets/mermaid/styles.d.ts +12 -0
  334. data/assets/mermaid/styles.spec.d.ts +1 -0
  335. data/assets/mermaid/svgDrawCommon-5e1cfd1d.js +101 -0
  336. data/assets/mermaid/svgDrawCommon-d6ab583c.js +100 -0
  337. data/assets/mermaid/svgDrawCommon-ecc5f780.js +64 -0
  338. data/assets/mermaid/tests/MockedD3.d.ts +45 -0
  339. data/assets/mermaid/tests/setup.d.ts +1 -0
  340. data/assets/mermaid/tests/util.d.ts +3 -0
  341. data/assets/mermaid/themes/erDiagram-oldHardcodedValues.d.ts +7 -0
  342. data/assets/mermaid/themes/index.d.ts +24 -0
  343. data/assets/mermaid/themes/theme-base.d.ts +189 -0
  344. data/assets/mermaid/themes/theme-dark.d.ts +177 -0
  345. data/assets/mermaid/themes/theme-default.d.ts +188 -0
  346. data/assets/mermaid/themes/theme-forest.d.ts +185 -0
  347. data/assets/mermaid/themes/theme-helpers.d.ts +1 -0
  348. data/assets/mermaid/themes/theme-neutral.d.ts +182 -0
  349. data/assets/mermaid/timeline-definition-23ce0e2e.js +1211 -0
  350. data/assets/mermaid/timeline-definition-4ee9bff4.js +795 -0
  351. data/assets/mermaid/timeline-definition-bf702344.js +1219 -0
  352. data/assets/mermaid/types.d.ts +31 -0
  353. data/assets/mermaid/utils/imperativeState.d.ts +32 -0
  354. data/assets/mermaid/utils/imperativeState.spec.d.ts +1 -0
  355. data/assets/mermaid/utils/lineWithOffset.d.ts +5 -0
  356. data/assets/mermaid/utils/sanitizeDirective.d.ts +7 -0
  357. data/assets/mermaid/utils/subGraphTitleMargins.d.ts +8 -0
  358. data/assets/mermaid/utils/subGraphTitleMargins.spec.d.ts +1 -0
  359. data/assets/mermaid/utils.d.ts +286 -0
  360. data/assets/mermaid/utils.spec.d.ts +1 -0
  361. data/assets/mermaid/xychartDiagram-de2e5521.js +1800 -0
  362. data/assets/mermaid/xychartDiagram-e5e6b652.js +1284 -0
  363. data/assets/mermaid/xychartDiagram-f11f50a6.js +1745 -0
  364. data/assets/tables.css +23 -0
  365. data/assets/toURI.js +142 -0
  366. metadata +363 -2
@@ -0,0 +1,1176 @@
1
+ import { c as getConfig, s as setAccTitle, g as getAccTitle, b as setAccDescription, a as getAccDescription, q as setDiagramTitle, t as getDiagramTitle, l as log, v as clear$1, u as utils, i as configureSvgSize, x as parseGenericTypes } from "./mermaid-6dc72991.js";
2
+ import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
3
+ import { select, line, curveBasis } from "d3";
4
+ import { layout } from "dagre-d3-es/src/dagre/index.js";
5
+ import { v5 } from "uuid";
6
+ import "ts-dedent";
7
+ import "dayjs";
8
+ import "@braintree/sanitize-url";
9
+ import "dompurify";
10
+ import "khroma";
11
+ import "lodash-es/memoize.js";
12
+ import "lodash-es/merge.js";
13
+ import "stylis";
14
+ import "lodash-es/isEmpty.js";
15
+ var parser = function() {
16
+ var o = function(k, v, o2, l) {
17
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
18
+ ;
19
+ return o2;
20
+ }, $V0 = [6, 8, 10, 20, 22, 24, 26, 27, 28], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 14], $V6 = [1, 15], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 25], $Vc = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], $Vd = [1, 34], $Ve = [27, 28, 46, 47], $Vf = [41, 42, 43, 44, 45], $Vg = [17, 34], $Vh = [1, 54], $Vi = [1, 53], $Vj = [17, 34, 36, 38];
21
+ var parser2 = {
22
+ trace: function trace() {
23
+ },
24
+ yy: {},
25
+ symbols_: { "error": 2, "start": 3, "ER_DIAGRAM": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "entityName": 11, "relSpec": 12, ":": 13, "role": 14, "BLOCK_START": 15, "attributes": 16, "BLOCK_STOP": 17, "SQS": 18, "SQE": 19, "title": 20, "title_value": 21, "acc_title": 22, "acc_title_value": 23, "acc_descr": 24, "acc_descr_value": 25, "acc_descr_multiline_value": 26, "ALPHANUM": 27, "ENTITY_NAME": 28, "attribute": 29, "attributeType": 30, "attributeName": 31, "attributeKeyTypeList": 32, "attributeComment": 33, "ATTRIBUTE_WORD": 34, "attributeKeyType": 35, "COMMA": 36, "ATTRIBUTE_KEY": 37, "COMMENT": 38, "cardinality": 39, "relType": 40, "ZERO_OR_ONE": 41, "ZERO_OR_MORE": 42, "ONE_OR_MORE": 43, "ONLY_ONE": 44, "MD_PARENT": 45, "NON_IDENTIFYING": 46, "IDENTIFYING": 47, "WORD": 48, "$accept": 0, "$end": 1 },
26
+ terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: ":", 15: "BLOCK_START", 17: "BLOCK_STOP", 18: "SQS", 19: "SQE", 20: "title", 21: "title_value", 22: "acc_title", 23: "acc_title_value", 24: "acc_descr", 25: "acc_descr_value", 26: "acc_descr_multiline_value", 27: "ALPHANUM", 28: "ENTITY_NAME", 34: "ATTRIBUTE_WORD", 36: "COMMA", 37: "ATTRIBUTE_KEY", 38: "COMMENT", 41: "ZERO_OR_ONE", 42: "ZERO_OR_MORE", 43: "ONE_OR_MORE", 44: "ONLY_ONE", 45: "MD_PARENT", 46: "NON_IDENTIFYING", 47: "IDENTIFYING", 48: "WORD" },
27
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 4], [9, 3], [9, 1], [9, 7], [9, 6], [9, 4], [9, 2], [9, 2], [9, 2], [9, 1], [11, 1], [11, 1], [16, 1], [16, 2], [29, 2], [29, 3], [29, 3], [29, 4], [30, 1], [31, 1], [32, 1], [32, 3], [35, 1], [33, 1], [12, 3], [39, 1], [39, 1], [39, 1], [39, 1], [39, 1], [40, 1], [40, 1], [14, 1], [14, 1], [14, 1]],
28
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
29
+ var $0 = $$.length - 1;
30
+ switch (yystate) {
31
+ case 1:
32
+ break;
33
+ case 2:
34
+ this.$ = [];
35
+ break;
36
+ case 3:
37
+ $$[$0 - 1].push($$[$0]);
38
+ this.$ = $$[$0 - 1];
39
+ break;
40
+ case 4:
41
+ case 5:
42
+ this.$ = $$[$0];
43
+ break;
44
+ case 6:
45
+ case 7:
46
+ this.$ = [];
47
+ break;
48
+ case 8:
49
+ yy.addEntity($$[$0 - 4]);
50
+ yy.addEntity($$[$0 - 2]);
51
+ yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);
52
+ break;
53
+ case 9:
54
+ yy.addEntity($$[$0 - 3]);
55
+ yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
56
+ break;
57
+ case 10:
58
+ yy.addEntity($$[$0 - 2]);
59
+ break;
60
+ case 11:
61
+ yy.addEntity($$[$0]);
62
+ break;
63
+ case 12:
64
+ yy.addEntity($$[$0 - 6], $$[$0 - 4]);
65
+ yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
66
+ break;
67
+ case 13:
68
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
69
+ break;
70
+ case 14:
71
+ yy.addEntity($$[$0 - 3], $$[$0 - 1]);
72
+ break;
73
+ case 15:
74
+ case 16:
75
+ this.$ = $$[$0].trim();
76
+ yy.setAccTitle(this.$);
77
+ break;
78
+ case 17:
79
+ case 18:
80
+ this.$ = $$[$0].trim();
81
+ yy.setAccDescription(this.$);
82
+ break;
83
+ case 19:
84
+ case 43:
85
+ this.$ = $$[$0];
86
+ break;
87
+ case 20:
88
+ case 41:
89
+ case 42:
90
+ this.$ = $$[$0].replace(/"/g, "");
91
+ break;
92
+ case 21:
93
+ case 29:
94
+ this.$ = [$$[$0]];
95
+ break;
96
+ case 22:
97
+ $$[$0].push($$[$0 - 1]);
98
+ this.$ = $$[$0];
99
+ break;
100
+ case 23:
101
+ this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] };
102
+ break;
103
+ case 24:
104
+ this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] };
105
+ break;
106
+ case 25:
107
+ this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] };
108
+ break;
109
+ case 26:
110
+ this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] };
111
+ break;
112
+ case 27:
113
+ case 28:
114
+ case 31:
115
+ this.$ = $$[$0];
116
+ break;
117
+ case 30:
118
+ $$[$0 - 2].push($$[$0]);
119
+ this.$ = $$[$0 - 2];
120
+ break;
121
+ case 32:
122
+ this.$ = $$[$0].replace(/"/g, "");
123
+ break;
124
+ case 33:
125
+ this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] };
126
+ break;
127
+ case 34:
128
+ this.$ = yy.Cardinality.ZERO_OR_ONE;
129
+ break;
130
+ case 35:
131
+ this.$ = yy.Cardinality.ZERO_OR_MORE;
132
+ break;
133
+ case 36:
134
+ this.$ = yy.Cardinality.ONE_OR_MORE;
135
+ break;
136
+ case 37:
137
+ this.$ = yy.Cardinality.ONLY_ONE;
138
+ break;
139
+ case 38:
140
+ this.$ = yy.Cardinality.MD_PARENT;
141
+ break;
142
+ case 39:
143
+ this.$ = yy.Identification.NON_IDENTIFYING;
144
+ break;
145
+ case 40:
146
+ this.$ = yy.Identification.IDENTIFYING;
147
+ break;
148
+ }
149
+ },
150
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 16, 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 11], { 12: 17, 39: 20, 15: [1, 18], 18: [1, 19], 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }), { 21: [1, 26] }, { 23: [1, 27] }, { 25: [1, 28] }, o($V0, [2, 18]), o($Vc, [2, 19]), o($Vc, [2, 20]), o($V0, [2, 4]), { 11: 29, 27: $V5, 28: $V6 }, { 16: 30, 17: [1, 31], 29: 32, 30: 33, 34: $Vd }, { 11: 35, 27: $V5, 28: $V6 }, { 40: 36, 46: [1, 37], 47: [1, 38] }, o($Ve, [2, 34]), o($Ve, [2, 35]), o($Ve, [2, 36]), o($Ve, [2, 37]), o($Ve, [2, 38]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), { 13: [1, 39] }, { 17: [1, 40] }, o($V0, [2, 10]), { 16: 41, 17: [2, 21], 29: 32, 30: 33, 34: $Vd }, { 31: 42, 34: [1, 43] }, { 34: [2, 27] }, { 19: [1, 44] }, { 39: 45, 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }, o($Vf, [2, 39]), o($Vf, [2, 40]), { 14: 46, 27: [1, 49], 28: [1, 48], 48: [1, 47] }, o($V0, [2, 9]), { 17: [2, 22] }, o($Vg, [2, 23], { 32: 50, 33: 51, 35: 52, 37: $Vh, 38: $Vi }), o([17, 34, 37, 38], [2, 28]), o($V0, [2, 14], { 15: [1, 55] }), o([27, 28], [2, 33]), o($V0, [2, 8]), o($V0, [2, 41]), o($V0, [2, 42]), o($V0, [2, 43]), o($Vg, [2, 24], { 33: 56, 36: [1, 57], 38: $Vi }), o($Vg, [2, 25]), o($Vj, [2, 29]), o($Vg, [2, 32]), o($Vj, [2, 31]), { 16: 58, 17: [1, 59], 29: 32, 30: 33, 34: $Vd }, o($Vg, [2, 26]), { 35: 60, 37: $Vh }, { 17: [1, 61] }, o($V0, [2, 13]), o($Vj, [2, 30]), o($V0, [2, 12])],
151
+ defaultActions: { 34: [2, 27], 41: [2, 22] },
152
+ parseError: function parseError(str, hash) {
153
+ if (hash.recoverable) {
154
+ this.trace(str);
155
+ } else {
156
+ var error = new Error(str);
157
+ error.hash = hash;
158
+ throw error;
159
+ }
160
+ },
161
+ parse: function parse(input) {
162
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
163
+ var args = lstack.slice.call(arguments, 1);
164
+ var lexer2 = Object.create(this.lexer);
165
+ var sharedState = { yy: {} };
166
+ for (var k in this.yy) {
167
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
168
+ sharedState.yy[k] = this.yy[k];
169
+ }
170
+ }
171
+ lexer2.setInput(input, sharedState.yy);
172
+ sharedState.yy.lexer = lexer2;
173
+ sharedState.yy.parser = this;
174
+ if (typeof lexer2.yylloc == "undefined") {
175
+ lexer2.yylloc = {};
176
+ }
177
+ var yyloc = lexer2.yylloc;
178
+ lstack.push(yyloc);
179
+ var ranges = lexer2.options && lexer2.options.ranges;
180
+ if (typeof sharedState.yy.parseError === "function") {
181
+ this.parseError = sharedState.yy.parseError;
182
+ } else {
183
+ this.parseError = Object.getPrototypeOf(this).parseError;
184
+ }
185
+ function lex() {
186
+ var token;
187
+ token = tstack.pop() || lexer2.lex() || EOF;
188
+ if (typeof token !== "number") {
189
+ if (token instanceof Array) {
190
+ tstack = token;
191
+ token = tstack.pop();
192
+ }
193
+ token = self.symbols_[token] || token;
194
+ }
195
+ return token;
196
+ }
197
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
198
+ while (true) {
199
+ state = stack[stack.length - 1];
200
+ if (this.defaultActions[state]) {
201
+ action = this.defaultActions[state];
202
+ } else {
203
+ if (symbol === null || typeof symbol == "undefined") {
204
+ symbol = lex();
205
+ }
206
+ action = table[state] && table[state][symbol];
207
+ }
208
+ if (typeof action === "undefined" || !action.length || !action[0]) {
209
+ var errStr = "";
210
+ expected = [];
211
+ for (p in table[state]) {
212
+ if (this.terminals_[p] && p > TERROR) {
213
+ expected.push("'" + this.terminals_[p] + "'");
214
+ }
215
+ }
216
+ if (lexer2.showPosition) {
217
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
218
+ } else {
219
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
220
+ }
221
+ this.parseError(errStr, {
222
+ text: lexer2.match,
223
+ token: this.terminals_[symbol] || symbol,
224
+ line: lexer2.yylineno,
225
+ loc: yyloc,
226
+ expected
227
+ });
228
+ }
229
+ if (action[0] instanceof Array && action.length > 1) {
230
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
231
+ }
232
+ switch (action[0]) {
233
+ case 1:
234
+ stack.push(symbol);
235
+ vstack.push(lexer2.yytext);
236
+ lstack.push(lexer2.yylloc);
237
+ stack.push(action[1]);
238
+ symbol = null;
239
+ {
240
+ yyleng = lexer2.yyleng;
241
+ yytext = lexer2.yytext;
242
+ yylineno = lexer2.yylineno;
243
+ yyloc = lexer2.yylloc;
244
+ }
245
+ break;
246
+ case 2:
247
+ len = this.productions_[action[1]][1];
248
+ yyval.$ = vstack[vstack.length - len];
249
+ yyval._$ = {
250
+ first_line: lstack[lstack.length - (len || 1)].first_line,
251
+ last_line: lstack[lstack.length - 1].last_line,
252
+ first_column: lstack[lstack.length - (len || 1)].first_column,
253
+ last_column: lstack[lstack.length - 1].last_column
254
+ };
255
+ if (ranges) {
256
+ yyval._$.range = [
257
+ lstack[lstack.length - (len || 1)].range[0],
258
+ lstack[lstack.length - 1].range[1]
259
+ ];
260
+ }
261
+ r = this.performAction.apply(yyval, [
262
+ yytext,
263
+ yyleng,
264
+ yylineno,
265
+ sharedState.yy,
266
+ action[1],
267
+ vstack,
268
+ lstack
269
+ ].concat(args));
270
+ if (typeof r !== "undefined") {
271
+ return r;
272
+ }
273
+ if (len) {
274
+ stack = stack.slice(0, -1 * len * 2);
275
+ vstack = vstack.slice(0, -1 * len);
276
+ lstack = lstack.slice(0, -1 * len);
277
+ }
278
+ stack.push(this.productions_[action[1]][0]);
279
+ vstack.push(yyval.$);
280
+ lstack.push(yyval._$);
281
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
282
+ stack.push(newState);
283
+ break;
284
+ case 3:
285
+ return true;
286
+ }
287
+ }
288
+ return true;
289
+ }
290
+ };
291
+ var lexer = function() {
292
+ var lexer2 = {
293
+ EOF: 1,
294
+ parseError: function parseError(str, hash) {
295
+ if (this.yy.parser) {
296
+ this.yy.parser.parseError(str, hash);
297
+ } else {
298
+ throw new Error(str);
299
+ }
300
+ },
301
+ // resets the lexer, sets new input
302
+ setInput: function(input, yy) {
303
+ this.yy = yy || this.yy || {};
304
+ this._input = input;
305
+ this._more = this._backtrack = this.done = false;
306
+ this.yylineno = this.yyleng = 0;
307
+ this.yytext = this.matched = this.match = "";
308
+ this.conditionStack = ["INITIAL"];
309
+ this.yylloc = {
310
+ first_line: 1,
311
+ first_column: 0,
312
+ last_line: 1,
313
+ last_column: 0
314
+ };
315
+ if (this.options.ranges) {
316
+ this.yylloc.range = [0, 0];
317
+ }
318
+ this.offset = 0;
319
+ return this;
320
+ },
321
+ // consumes and returns one char from the input
322
+ input: function() {
323
+ var ch = this._input[0];
324
+ this.yytext += ch;
325
+ this.yyleng++;
326
+ this.offset++;
327
+ this.match += ch;
328
+ this.matched += ch;
329
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
330
+ if (lines) {
331
+ this.yylineno++;
332
+ this.yylloc.last_line++;
333
+ } else {
334
+ this.yylloc.last_column++;
335
+ }
336
+ if (this.options.ranges) {
337
+ this.yylloc.range[1]++;
338
+ }
339
+ this._input = this._input.slice(1);
340
+ return ch;
341
+ },
342
+ // unshifts one char (or a string) into the input
343
+ unput: function(ch) {
344
+ var len = ch.length;
345
+ var lines = ch.split(/(?:\r\n?|\n)/g);
346
+ this._input = ch + this._input;
347
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
348
+ this.offset -= len;
349
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
350
+ this.match = this.match.substr(0, this.match.length - 1);
351
+ this.matched = this.matched.substr(0, this.matched.length - 1);
352
+ if (lines.length - 1) {
353
+ this.yylineno -= lines.length - 1;
354
+ }
355
+ var r = this.yylloc.range;
356
+ this.yylloc = {
357
+ first_line: this.yylloc.first_line,
358
+ last_line: this.yylineno + 1,
359
+ first_column: this.yylloc.first_column,
360
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
361
+ };
362
+ if (this.options.ranges) {
363
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
364
+ }
365
+ this.yyleng = this.yytext.length;
366
+ return this;
367
+ },
368
+ // When called from action, caches matched text and appends it on next action
369
+ more: function() {
370
+ this._more = true;
371
+ return this;
372
+ },
373
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
374
+ reject: function() {
375
+ if (this.options.backtrack_lexer) {
376
+ this._backtrack = true;
377
+ } else {
378
+ 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).\n" + this.showPosition(), {
379
+ text: "",
380
+ token: null,
381
+ line: this.yylineno
382
+ });
383
+ }
384
+ return this;
385
+ },
386
+ // retain first n characters of the match
387
+ less: function(n) {
388
+ this.unput(this.match.slice(n));
389
+ },
390
+ // displays already matched input, i.e. for error messages
391
+ pastInput: function() {
392
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
393
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
394
+ },
395
+ // displays upcoming input, i.e. for error messages
396
+ upcomingInput: function() {
397
+ var next = this.match;
398
+ if (next.length < 20) {
399
+ next += this._input.substr(0, 20 - next.length);
400
+ }
401
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
402
+ },
403
+ // displays the character position where the lexing error occurred, i.e. for error messages
404
+ showPosition: function() {
405
+ var pre = this.pastInput();
406
+ var c = new Array(pre.length + 1).join("-");
407
+ return pre + this.upcomingInput() + "\n" + c + "^";
408
+ },
409
+ // test the lexed token: return FALSE when not a match, otherwise return token
410
+ test_match: function(match, indexed_rule) {
411
+ var token, lines, backup;
412
+ if (this.options.backtrack_lexer) {
413
+ backup = {
414
+ yylineno: this.yylineno,
415
+ yylloc: {
416
+ first_line: this.yylloc.first_line,
417
+ last_line: this.last_line,
418
+ first_column: this.yylloc.first_column,
419
+ last_column: this.yylloc.last_column
420
+ },
421
+ yytext: this.yytext,
422
+ match: this.match,
423
+ matches: this.matches,
424
+ matched: this.matched,
425
+ yyleng: this.yyleng,
426
+ offset: this.offset,
427
+ _more: this._more,
428
+ _input: this._input,
429
+ yy: this.yy,
430
+ conditionStack: this.conditionStack.slice(0),
431
+ done: this.done
432
+ };
433
+ if (this.options.ranges) {
434
+ backup.yylloc.range = this.yylloc.range.slice(0);
435
+ }
436
+ }
437
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
438
+ if (lines) {
439
+ this.yylineno += lines.length;
440
+ }
441
+ this.yylloc = {
442
+ first_line: this.yylloc.last_line,
443
+ last_line: this.yylineno + 1,
444
+ first_column: this.yylloc.last_column,
445
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
446
+ };
447
+ this.yytext += match[0];
448
+ this.match += match[0];
449
+ this.matches = match;
450
+ this.yyleng = this.yytext.length;
451
+ if (this.options.ranges) {
452
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
453
+ }
454
+ this._more = false;
455
+ this._backtrack = false;
456
+ this._input = this._input.slice(match[0].length);
457
+ this.matched += match[0];
458
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
459
+ if (this.done && this._input) {
460
+ this.done = false;
461
+ }
462
+ if (token) {
463
+ return token;
464
+ } else if (this._backtrack) {
465
+ for (var k in backup) {
466
+ this[k] = backup[k];
467
+ }
468
+ return false;
469
+ }
470
+ return false;
471
+ },
472
+ // return next match in input
473
+ next: function() {
474
+ if (this.done) {
475
+ return this.EOF;
476
+ }
477
+ if (!this._input) {
478
+ this.done = true;
479
+ }
480
+ var token, match, tempMatch, index;
481
+ if (!this._more) {
482
+ this.yytext = "";
483
+ this.match = "";
484
+ }
485
+ var rules = this._currentRules();
486
+ for (var i = 0; i < rules.length; i++) {
487
+ tempMatch = this._input.match(this.rules[rules[i]]);
488
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
489
+ match = tempMatch;
490
+ index = i;
491
+ if (this.options.backtrack_lexer) {
492
+ token = this.test_match(tempMatch, rules[i]);
493
+ if (token !== false) {
494
+ return token;
495
+ } else if (this._backtrack) {
496
+ match = false;
497
+ continue;
498
+ } else {
499
+ return false;
500
+ }
501
+ } else if (!this.options.flex) {
502
+ break;
503
+ }
504
+ }
505
+ }
506
+ if (match) {
507
+ token = this.test_match(match, rules[index]);
508
+ if (token !== false) {
509
+ return token;
510
+ }
511
+ return false;
512
+ }
513
+ if (this._input === "") {
514
+ return this.EOF;
515
+ } else {
516
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
517
+ text: "",
518
+ token: null,
519
+ line: this.yylineno
520
+ });
521
+ }
522
+ },
523
+ // return next match that has a token
524
+ lex: function lex() {
525
+ var r = this.next();
526
+ if (r) {
527
+ return r;
528
+ } else {
529
+ return this.lex();
530
+ }
531
+ },
532
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
533
+ begin: function begin(condition) {
534
+ this.conditionStack.push(condition);
535
+ },
536
+ // pop the previously active lexer condition state off the condition stack
537
+ popState: function popState() {
538
+ var n = this.conditionStack.length - 1;
539
+ if (n > 0) {
540
+ return this.conditionStack.pop();
541
+ } else {
542
+ return this.conditionStack[0];
543
+ }
544
+ },
545
+ // produce the lexer rule set which is active for the currently active lexer condition state
546
+ _currentRules: function _currentRules() {
547
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
548
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
549
+ } else {
550
+ return this.conditions["INITIAL"].rules;
551
+ }
552
+ },
553
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
554
+ topState: function topState(n) {
555
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
556
+ if (n >= 0) {
557
+ return this.conditionStack[n];
558
+ } else {
559
+ return "INITIAL";
560
+ }
561
+ },
562
+ // alias for begin(condition)
563
+ pushState: function pushState(condition) {
564
+ this.begin(condition);
565
+ },
566
+ // return the number of states currently on the stack
567
+ stateStackSize: function stateStackSize() {
568
+ return this.conditionStack.length;
569
+ },
570
+ options: { "case-insensitive": true },
571
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
572
+ switch ($avoiding_name_collisions) {
573
+ case 0:
574
+ this.begin("acc_title");
575
+ return 22;
576
+ case 1:
577
+ this.popState();
578
+ return "acc_title_value";
579
+ case 2:
580
+ this.begin("acc_descr");
581
+ return 24;
582
+ case 3:
583
+ this.popState();
584
+ return "acc_descr_value";
585
+ case 4:
586
+ this.begin("acc_descr_multiline");
587
+ break;
588
+ case 5:
589
+ this.popState();
590
+ break;
591
+ case 6:
592
+ return "acc_descr_multiline_value";
593
+ case 7:
594
+ return 10;
595
+ case 8:
596
+ break;
597
+ case 9:
598
+ return 8;
599
+ case 10:
600
+ return 28;
601
+ case 11:
602
+ return 48;
603
+ case 12:
604
+ return 4;
605
+ case 13:
606
+ this.begin("block");
607
+ return 15;
608
+ case 14:
609
+ return 36;
610
+ case 15:
611
+ break;
612
+ case 16:
613
+ return 37;
614
+ case 17:
615
+ return 34;
616
+ case 18:
617
+ return 34;
618
+ case 19:
619
+ return 38;
620
+ case 20:
621
+ break;
622
+ case 21:
623
+ this.popState();
624
+ return 17;
625
+ case 22:
626
+ return yy_.yytext[0];
627
+ case 23:
628
+ return 18;
629
+ case 24:
630
+ return 19;
631
+ case 25:
632
+ return 41;
633
+ case 26:
634
+ return 43;
635
+ case 27:
636
+ return 43;
637
+ case 28:
638
+ return 43;
639
+ case 29:
640
+ return 41;
641
+ case 30:
642
+ return 41;
643
+ case 31:
644
+ return 42;
645
+ case 32:
646
+ return 42;
647
+ case 33:
648
+ return 42;
649
+ case 34:
650
+ return 42;
651
+ case 35:
652
+ return 42;
653
+ case 36:
654
+ return 43;
655
+ case 37:
656
+ return 42;
657
+ case 38:
658
+ return 43;
659
+ case 39:
660
+ return 44;
661
+ case 40:
662
+ return 44;
663
+ case 41:
664
+ return 44;
665
+ case 42:
666
+ return 44;
667
+ case 43:
668
+ return 41;
669
+ case 44:
670
+ return 42;
671
+ case 45:
672
+ return 43;
673
+ case 46:
674
+ return 45;
675
+ case 47:
676
+ return 46;
677
+ case 48:
678
+ return 47;
679
+ case 49:
680
+ return 47;
681
+ case 50:
682
+ return 46;
683
+ case 51:
684
+ return 46;
685
+ case 52:
686
+ return 46;
687
+ case 53:
688
+ return 27;
689
+ case 54:
690
+ return yy_.yytext[0];
691
+ case 55:
692
+ return 6;
693
+ }
694
+ },
695
+ rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:,)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i, /^(?:.)/i, /^(?:$)/i],
696
+ conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "block": { "rules": [14, 15, 16, 17, 18, 19, 20, 21, 22], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55], "inclusive": true } }
697
+ };
698
+ return lexer2;
699
+ }();
700
+ parser2.lexer = lexer;
701
+ function Parser() {
702
+ this.yy = {};
703
+ }
704
+ Parser.prototype = parser2;
705
+ parser2.Parser = Parser;
706
+ return new Parser();
707
+ }();
708
+ parser.parser = parser;
709
+ const erParser = parser;
710
+ let entities = {};
711
+ let relationships = [];
712
+ const Cardinality = {
713
+ ZERO_OR_ONE: "ZERO_OR_ONE",
714
+ ZERO_OR_MORE: "ZERO_OR_MORE",
715
+ ONE_OR_MORE: "ONE_OR_MORE",
716
+ ONLY_ONE: "ONLY_ONE",
717
+ MD_PARENT: "MD_PARENT"
718
+ };
719
+ const Identification = {
720
+ NON_IDENTIFYING: "NON_IDENTIFYING",
721
+ IDENTIFYING: "IDENTIFYING"
722
+ };
723
+ const addEntity = function(name, alias = void 0) {
724
+ if (entities[name] === void 0) {
725
+ entities[name] = { attributes: [], alias };
726
+ log.info("Added new entity :", name);
727
+ } else if (entities[name] && !entities[name].alias && alias) {
728
+ entities[name].alias = alias;
729
+ log.info(`Add alias '${alias}' to entity '${name}'`);
730
+ }
731
+ return entities[name];
732
+ };
733
+ const getEntities = () => entities;
734
+ const addAttributes = function(entityName, attribs) {
735
+ let entity = addEntity(entityName);
736
+ let i;
737
+ for (i = attribs.length - 1; i >= 0; i--) {
738
+ entity.attributes.push(attribs[i]);
739
+ log.debug("Added attribute ", attribs[i].attributeName);
740
+ }
741
+ };
742
+ const addRelationship = function(entA, rolA, entB, rSpec) {
743
+ let rel = {
744
+ entityA: entA,
745
+ roleA: rolA,
746
+ entityB: entB,
747
+ relSpec: rSpec
748
+ };
749
+ relationships.push(rel);
750
+ log.debug("Added new relationship :", rel);
751
+ };
752
+ const getRelationships = () => relationships;
753
+ const clear = function() {
754
+ entities = {};
755
+ relationships = [];
756
+ clear$1();
757
+ };
758
+ const erDb = {
759
+ Cardinality,
760
+ Identification,
761
+ getConfig: () => getConfig().er,
762
+ addEntity,
763
+ addAttributes,
764
+ getEntities,
765
+ addRelationship,
766
+ getRelationships,
767
+ clear,
768
+ setAccTitle,
769
+ getAccTitle,
770
+ setAccDescription,
771
+ getAccDescription,
772
+ setDiagramTitle,
773
+ getDiagramTitle
774
+ };
775
+ const ERMarkers = {
776
+ ONLY_ONE_START: "ONLY_ONE_START",
777
+ ONLY_ONE_END: "ONLY_ONE_END",
778
+ ZERO_OR_ONE_START: "ZERO_OR_ONE_START",
779
+ ZERO_OR_ONE_END: "ZERO_OR_ONE_END",
780
+ ONE_OR_MORE_START: "ONE_OR_MORE_START",
781
+ ONE_OR_MORE_END: "ONE_OR_MORE_END",
782
+ ZERO_OR_MORE_START: "ZERO_OR_MORE_START",
783
+ ZERO_OR_MORE_END: "ZERO_OR_MORE_END",
784
+ MD_PARENT_END: "MD_PARENT_END",
785
+ MD_PARENT_START: "MD_PARENT_START"
786
+ };
787
+ const insertMarkers = function(elem, conf2) {
788
+ let marker;
789
+ elem.append("defs").append("marker").attr("id", ERMarkers.MD_PARENT_START).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
790
+ elem.append("defs").append("marker").attr("id", ERMarkers.MD_PARENT_END).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
791
+ elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18");
792
+ elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18");
793
+ marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
794
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
795
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18");
796
+ marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
797
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
798
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,0 L21,18");
799
+ elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
800
+ elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
801
+ marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
802
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
803
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
804
+ marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
805
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
806
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
807
+ return;
808
+ };
809
+ const erMarkers = {
810
+ ERMarkers,
811
+ insertMarkers
812
+ };
813
+ const BAD_ID_CHARS_REGEXP = /[^\dA-Za-z](\W)*/g;
814
+ let conf = {};
815
+ let entityNameIds = /* @__PURE__ */ new Map();
816
+ const setConf = function(cnf) {
817
+ const keys = Object.keys(cnf);
818
+ for (const key of keys) {
819
+ conf[key] = cnf[key];
820
+ }
821
+ };
822
+ const drawAttributes = (groupNode, entityTextNode, attributes) => {
823
+ const heightPadding = conf.entityPadding / 3;
824
+ const widthPadding = conf.entityPadding / 3;
825
+ const attrFontSize = conf.fontSize * 0.85;
826
+ const labelBBox = entityTextNode.node().getBBox();
827
+ const attributeNodes = [];
828
+ let hasKeyType = false;
829
+ let hasComment = false;
830
+ let maxTypeWidth = 0;
831
+ let maxNameWidth = 0;
832
+ let maxKeyWidth = 0;
833
+ let maxCommentWidth = 0;
834
+ let cumulativeHeight = labelBBox.height + heightPadding * 2;
835
+ let attrNum = 1;
836
+ attributes.forEach((item) => {
837
+ if (item.attributeKeyTypeList !== void 0 && item.attributeKeyTypeList.length > 0) {
838
+ hasKeyType = true;
839
+ }
840
+ if (item.attributeComment !== void 0) {
841
+ hasComment = true;
842
+ }
843
+ });
844
+ attributes.forEach((item) => {
845
+ const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`;
846
+ let nodeHeight = 0;
847
+ const attributeType = parseGenericTypes(item.attributeType);
848
+ const typeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-type`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig().fontFamily).style("font-size", attrFontSize + "px").text(attributeType);
849
+ const nameNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-name`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeName);
850
+ const attributeNode = {};
851
+ attributeNode.tn = typeNode;
852
+ attributeNode.nn = nameNode;
853
+ const typeBBox = typeNode.node().getBBox();
854
+ const nameBBox = nameNode.node().getBBox();
855
+ maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width);
856
+ maxNameWidth = Math.max(maxNameWidth, nameBBox.width);
857
+ nodeHeight = Math.max(typeBBox.height, nameBBox.height);
858
+ if (hasKeyType) {
859
+ const keyTypeNodeText = item.attributeKeyTypeList !== void 0 ? item.attributeKeyTypeList.join(",") : "";
860
+ const keyTypeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-key`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig().fontFamily).style("font-size", attrFontSize + "px").text(keyTypeNodeText);
861
+ attributeNode.kn = keyTypeNode;
862
+ const keyTypeBBox = keyTypeNode.node().getBBox();
863
+ maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width);
864
+ nodeHeight = Math.max(nodeHeight, keyTypeBBox.height);
865
+ }
866
+ if (hasComment) {
867
+ const commentNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-comment`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeComment || "");
868
+ attributeNode.cn = commentNode;
869
+ const commentNodeBBox = commentNode.node().getBBox();
870
+ maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width);
871
+ nodeHeight = Math.max(nodeHeight, commentNodeBBox.height);
872
+ }
873
+ attributeNode.height = nodeHeight;
874
+ attributeNodes.push(attributeNode);
875
+ cumulativeHeight += nodeHeight + heightPadding * 2;
876
+ attrNum += 1;
877
+ });
878
+ let widthPaddingFactor = 4;
879
+ if (hasKeyType) {
880
+ widthPaddingFactor += 2;
881
+ }
882
+ if (hasComment) {
883
+ widthPaddingFactor += 2;
884
+ }
885
+ const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth;
886
+ const bBox = {
887
+ width: Math.max(
888
+ conf.minEntityWidth,
889
+ Math.max(
890
+ labelBBox.width + conf.entityPadding * 2,
891
+ maxWidth + widthPadding * widthPaddingFactor
892
+ )
893
+ ),
894
+ height: attributes.length > 0 ? cumulativeHeight : Math.max(conf.minEntityHeight, labelBBox.height + conf.entityPadding * 2)
895
+ };
896
+ if (attributes.length > 0) {
897
+ const spareColumnWidth = Math.max(
898
+ 0,
899
+ (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2)
900
+ );
901
+ entityTextNode.attr(
902
+ "transform",
903
+ "translate(" + bBox.width / 2 + "," + (heightPadding + labelBBox.height / 2) + ")"
904
+ );
905
+ let heightOffset = labelBBox.height + heightPadding * 2;
906
+ let attribStyle = "attributeBoxOdd";
907
+ attributeNodes.forEach((attributeNode) => {
908
+ const alignY = heightOffset + heightPadding + attributeNode.height / 2;
909
+ attributeNode.tn.attr("transform", "translate(" + widthPadding + "," + alignY + ")");
910
+ const typeRect = groupNode.insert("rect", "#" + attributeNode.tn.node().id).classed(`er ${attribStyle}`, true).attr("x", 0).attr("y", heightOffset).attr("width", maxTypeWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
911
+ const nameXOffset = parseFloat(typeRect.attr("x")) + parseFloat(typeRect.attr("width"));
912
+ attributeNode.nn.attr(
913
+ "transform",
914
+ "translate(" + (nameXOffset + widthPadding) + "," + alignY + ")"
915
+ );
916
+ const nameRect = groupNode.insert("rect", "#" + attributeNode.nn.node().id).classed(`er ${attribStyle}`, true).attr("x", nameXOffset).attr("y", heightOffset).attr("width", maxNameWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
917
+ let keyTypeAndCommentXOffset = parseFloat(nameRect.attr("x")) + parseFloat(nameRect.attr("width"));
918
+ if (hasKeyType) {
919
+ attributeNode.kn.attr(
920
+ "transform",
921
+ "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
922
+ );
923
+ const keyTypeRect = groupNode.insert("rect", "#" + attributeNode.kn.node().id).classed(`er ${attribStyle}`, true).attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxKeyWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
924
+ keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr("x")) + parseFloat(keyTypeRect.attr("width"));
925
+ }
926
+ if (hasComment) {
927
+ attributeNode.cn.attr(
928
+ "transform",
929
+ "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
930
+ );
931
+ groupNode.insert("rect", "#" + attributeNode.cn.node().id).classed(`er ${attribStyle}`, "true").attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxCommentWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
932
+ }
933
+ heightOffset += attributeNode.height + heightPadding * 2;
934
+ attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd";
935
+ });
936
+ } else {
937
+ bBox.height = Math.max(conf.minEntityHeight, cumulativeHeight);
938
+ entityTextNode.attr("transform", "translate(" + bBox.width / 2 + "," + bBox.height / 2 + ")");
939
+ }
940
+ return bBox;
941
+ };
942
+ const drawEntities = function(svgNode, entities2, graph) {
943
+ const keys = Object.keys(entities2);
944
+ let firstOne;
945
+ keys.forEach(function(entityName) {
946
+ const entityId = generateId(entityName, "entity");
947
+ entityNameIds.set(entityName, entityId);
948
+ const groupNode = svgNode.append("g").attr("id", entityId);
949
+ firstOne = firstOne === void 0 ? entityId : firstOne;
950
+ const textId = "text-" + entityId;
951
+ const textNode = groupNode.append("text").classed("er entityLabel", true).attr("id", textId).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "middle").style("font-family", getConfig().fontFamily).style("font-size", conf.fontSize + "px").text(entities2[entityName].alias ?? entityName);
952
+ const { width: entityWidth, height: entityHeight } = drawAttributes(
953
+ groupNode,
954
+ textNode,
955
+ entities2[entityName].attributes
956
+ );
957
+ const rectNode = groupNode.insert("rect", "#" + textId).classed("er entityBox", true).attr("x", 0).attr("y", 0).attr("width", entityWidth).attr("height", entityHeight);
958
+ const rectBBox = rectNode.node().getBBox();
959
+ graph.setNode(entityId, {
960
+ width: rectBBox.width,
961
+ height: rectBBox.height,
962
+ shape: "rect",
963
+ id: entityId
964
+ });
965
+ });
966
+ return firstOne;
967
+ };
968
+ const adjustEntities = function(svgNode, graph) {
969
+ graph.nodes().forEach(function(v) {
970
+ if (v !== void 0 && graph.node(v) !== void 0) {
971
+ svgNode.select("#" + v).attr(
972
+ "transform",
973
+ "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y - graph.node(v).height / 2) + " )"
974
+ );
975
+ }
976
+ });
977
+ };
978
+ const getEdgeName = function(rel) {
979
+ return (rel.entityA + rel.roleA + rel.entityB).replace(/\s/g, "");
980
+ };
981
+ const addRelationships = function(relationships2, g) {
982
+ relationships2.forEach(function(r) {
983
+ g.setEdge(
984
+ entityNameIds.get(r.entityA),
985
+ entityNameIds.get(r.entityB),
986
+ { relationship: r },
987
+ getEdgeName(r)
988
+ );
989
+ });
990
+ return relationships2;
991
+ };
992
+ let relCnt = 0;
993
+ const drawRelationshipFromLayout = function(svg, rel, g, insert, diagObj) {
994
+ relCnt++;
995
+ const edge = g.edge(
996
+ entityNameIds.get(rel.entityA),
997
+ entityNameIds.get(rel.entityB),
998
+ getEdgeName(rel)
999
+ );
1000
+ const lineFunction = line().x(function(d) {
1001
+ return d.x;
1002
+ }).y(function(d) {
1003
+ return d.y;
1004
+ }).curve(curveBasis);
1005
+ const svgPath = svg.insert("path", "#" + insert).classed("er relationshipLine", true).attr("d", lineFunction(edge.points)).style("stroke", conf.stroke).style("fill", "none");
1006
+ if (rel.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) {
1007
+ svgPath.attr("stroke-dasharray", "8,8");
1008
+ }
1009
+ let url = "";
1010
+ if (conf.arrowMarkerAbsolute) {
1011
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
1012
+ url = url.replace(/\(/g, "\\(");
1013
+ url = url.replace(/\)/g, "\\)");
1014
+ }
1015
+ switch (rel.relSpec.cardA) {
1016
+ case diagObj.db.Cardinality.ZERO_OR_ONE:
1017
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_END + ")");
1018
+ break;
1019
+ case diagObj.db.Cardinality.ZERO_OR_MORE:
1020
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_END + ")");
1021
+ break;
1022
+ case diagObj.db.Cardinality.ONE_OR_MORE:
1023
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_END + ")");
1024
+ break;
1025
+ case diagObj.db.Cardinality.ONLY_ONE:
1026
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_END + ")");
1027
+ break;
1028
+ case diagObj.db.Cardinality.MD_PARENT:
1029
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.MD_PARENT_END + ")");
1030
+ break;
1031
+ }
1032
+ switch (rel.relSpec.cardB) {
1033
+ case diagObj.db.Cardinality.ZERO_OR_ONE:
1034
+ svgPath.attr(
1035
+ "marker-start",
1036
+ "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_START + ")"
1037
+ );
1038
+ break;
1039
+ case diagObj.db.Cardinality.ZERO_OR_MORE:
1040
+ svgPath.attr(
1041
+ "marker-start",
1042
+ "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_START + ")"
1043
+ );
1044
+ break;
1045
+ case diagObj.db.Cardinality.ONE_OR_MORE:
1046
+ svgPath.attr(
1047
+ "marker-start",
1048
+ "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_START + ")"
1049
+ );
1050
+ break;
1051
+ case diagObj.db.Cardinality.ONLY_ONE:
1052
+ svgPath.attr("marker-start", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_START + ")");
1053
+ break;
1054
+ case diagObj.db.Cardinality.MD_PARENT:
1055
+ svgPath.attr("marker-start", "url(" + url + "#" + erMarkers.ERMarkers.MD_PARENT_START + ")");
1056
+ break;
1057
+ }
1058
+ const len = svgPath.node().getTotalLength();
1059
+ const labelPoint = svgPath.node().getPointAtLength(len * 0.5);
1060
+ const labelId = "rel" + relCnt;
1061
+ const labelNode = svg.append("text").classed("er relationshipLabel", true).attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", getConfig().fontFamily).style("font-size", conf.fontSize + "px").text(rel.roleA);
1062
+ const labelBBox = labelNode.node().getBBox();
1063
+ svg.insert("rect", "#" + labelId).classed("er relationshipLabelBox", true).attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height);
1064
+ };
1065
+ const draw = function(text, id, _version, diagObj) {
1066
+ conf = getConfig().er;
1067
+ log.info("Drawing ER diagram");
1068
+ const securityLevel = getConfig().securityLevel;
1069
+ let sandboxElement;
1070
+ if (securityLevel === "sandbox") {
1071
+ sandboxElement = select("#i" + id);
1072
+ }
1073
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
1074
+ const svg = root.select(`[id='${id}']`);
1075
+ erMarkers.insertMarkers(svg, conf);
1076
+ let g;
1077
+ g = new graphlib.Graph({
1078
+ multigraph: true,
1079
+ directed: true,
1080
+ compound: false
1081
+ }).setGraph({
1082
+ rankdir: conf.layoutDirection,
1083
+ marginx: 20,
1084
+ marginy: 20,
1085
+ nodesep: 100,
1086
+ edgesep: 100,
1087
+ ranksep: 100
1088
+ }).setDefaultEdgeLabel(function() {
1089
+ return {};
1090
+ });
1091
+ const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g);
1092
+ const relationships2 = addRelationships(diagObj.db.getRelationships(), g);
1093
+ layout(g);
1094
+ adjustEntities(svg, g);
1095
+ relationships2.forEach(function(rel) {
1096
+ drawRelationshipFromLayout(svg, rel, g, firstEntity, diagObj);
1097
+ });
1098
+ const padding = conf.diagramPadding;
1099
+ utils.insertTitle(svg, "entityTitleText", conf.titleTopMargin, diagObj.db.getDiagramTitle());
1100
+ const svgBounds = svg.node().getBBox();
1101
+ const width = svgBounds.width + padding * 2;
1102
+ const height = svgBounds.height + padding * 2;
1103
+ configureSvgSize(svg, height, width, conf.useMaxWidth);
1104
+ svg.attr("viewBox", `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);
1105
+ };
1106
+ const MERMAID_ERDIAGRAM_UUID = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c";
1107
+ function generateId(str = "", prefix = "") {
1108
+ const simplifiedStr = str.replace(BAD_ID_CHARS_REGEXP, "");
1109
+ return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${v5(
1110
+ str,
1111
+ MERMAID_ERDIAGRAM_UUID
1112
+ )}`;
1113
+ }
1114
+ function strWithHyphen(str = "") {
1115
+ return str.length > 0 ? `${str}-` : "";
1116
+ }
1117
+ const erRenderer = {
1118
+ setConf,
1119
+ draw
1120
+ };
1121
+ const getStyles = (options) => `
1122
+ .entityBox {
1123
+ fill: ${options.mainBkg};
1124
+ stroke: ${options.nodeBorder};
1125
+ }
1126
+
1127
+ .attributeBoxOdd {
1128
+ fill: ${options.attributeBackgroundColorOdd};
1129
+ stroke: ${options.nodeBorder};
1130
+ }
1131
+
1132
+ .attributeBoxEven {
1133
+ fill: ${options.attributeBackgroundColorEven};
1134
+ stroke: ${options.nodeBorder};
1135
+ }
1136
+
1137
+ .relationshipLabelBox {
1138
+ fill: ${options.tertiaryColor};
1139
+ opacity: 0.7;
1140
+ background-color: ${options.tertiaryColor};
1141
+ rect {
1142
+ opacity: 0.5;
1143
+ }
1144
+ }
1145
+
1146
+ .relationshipLine {
1147
+ stroke: ${options.lineColor};
1148
+ }
1149
+
1150
+ .entityTitleText {
1151
+ text-anchor: middle;
1152
+ font-size: 18px;
1153
+ fill: ${options.textColor};
1154
+ }
1155
+ #MD_PARENT_START {
1156
+ fill: #f5f5f5 !important;
1157
+ stroke: ${options.lineColor} !important;
1158
+ stroke-width: 1;
1159
+ }
1160
+ #MD_PARENT_END {
1161
+ fill: #f5f5f5 !important;
1162
+ stroke: ${options.lineColor} !important;
1163
+ stroke-width: 1;
1164
+ }
1165
+
1166
+ `;
1167
+ const erStyles = getStyles;
1168
+ const diagram = {
1169
+ parser: erParser,
1170
+ db: erDb,
1171
+ renderer: erRenderer,
1172
+ styles: erStyles
1173
+ };
1174
+ export {
1175
+ diagram
1176
+ };