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,1321 @@
1
+ import { c as getConfig, s as setAccTitle, g as getAccTitle, b as setAccDescription, a as getAccDescription, C as setDiagramTitle, D as getDiagramTitle, l as log, E as clear$1, j as d3select, A as utils, k as configureSvgSize, F as curveBasis, G as parseGenericTypes } from "./mermaid-dcacb631.js";
2
+ import { G as Graph } from "./graph-fe24fab6.js";
3
+ import { l as layout } from "./layout-163b9689.js";
4
+ import { l as line } from "./line-87f517ef.js";
5
+ import "./array-b7dcf730.js";
6
+ import "./path-39bad7e2.js";
7
+ var parser = function() {
8
+ var o = function(k, v, o2, l) {
9
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
10
+ ;
11
+ return o2;
12
+ }, $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];
13
+ var parser2 = {
14
+ trace: function trace() {
15
+ },
16
+ yy: {},
17
+ 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 },
18
+ 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" },
19
+ 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]],
20
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
21
+ var $0 = $$.length - 1;
22
+ switch (yystate) {
23
+ case 1:
24
+ break;
25
+ case 2:
26
+ this.$ = [];
27
+ break;
28
+ case 3:
29
+ $$[$0 - 1].push($$[$0]);
30
+ this.$ = $$[$0 - 1];
31
+ break;
32
+ case 4:
33
+ case 5:
34
+ this.$ = $$[$0];
35
+ break;
36
+ case 6:
37
+ case 7:
38
+ this.$ = [];
39
+ break;
40
+ case 8:
41
+ yy.addEntity($$[$0 - 4]);
42
+ yy.addEntity($$[$0 - 2]);
43
+ yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);
44
+ break;
45
+ case 9:
46
+ yy.addEntity($$[$0 - 3]);
47
+ yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
48
+ break;
49
+ case 10:
50
+ yy.addEntity($$[$0 - 2]);
51
+ break;
52
+ case 11:
53
+ yy.addEntity($$[$0]);
54
+ break;
55
+ case 12:
56
+ yy.addEntity($$[$0 - 6], $$[$0 - 4]);
57
+ yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
58
+ break;
59
+ case 13:
60
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
61
+ break;
62
+ case 14:
63
+ yy.addEntity($$[$0 - 3], $$[$0 - 1]);
64
+ break;
65
+ case 15:
66
+ case 16:
67
+ this.$ = $$[$0].trim();
68
+ yy.setAccTitle(this.$);
69
+ break;
70
+ case 17:
71
+ case 18:
72
+ this.$ = $$[$0].trim();
73
+ yy.setAccDescription(this.$);
74
+ break;
75
+ case 19:
76
+ case 43:
77
+ this.$ = $$[$0];
78
+ break;
79
+ case 20:
80
+ case 41:
81
+ case 42:
82
+ this.$ = $$[$0].replace(/"/g, "");
83
+ break;
84
+ case 21:
85
+ case 29:
86
+ this.$ = [$$[$0]];
87
+ break;
88
+ case 22:
89
+ $$[$0].push($$[$0 - 1]);
90
+ this.$ = $$[$0];
91
+ break;
92
+ case 23:
93
+ this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] };
94
+ break;
95
+ case 24:
96
+ this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] };
97
+ break;
98
+ case 25:
99
+ this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] };
100
+ break;
101
+ case 26:
102
+ this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] };
103
+ break;
104
+ case 27:
105
+ case 28:
106
+ case 31:
107
+ this.$ = $$[$0];
108
+ break;
109
+ case 30:
110
+ $$[$0 - 2].push($$[$0]);
111
+ this.$ = $$[$0 - 2];
112
+ break;
113
+ case 32:
114
+ this.$ = $$[$0].replace(/"/g, "");
115
+ break;
116
+ case 33:
117
+ this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] };
118
+ break;
119
+ case 34:
120
+ this.$ = yy.Cardinality.ZERO_OR_ONE;
121
+ break;
122
+ case 35:
123
+ this.$ = yy.Cardinality.ZERO_OR_MORE;
124
+ break;
125
+ case 36:
126
+ this.$ = yy.Cardinality.ONE_OR_MORE;
127
+ break;
128
+ case 37:
129
+ this.$ = yy.Cardinality.ONLY_ONE;
130
+ break;
131
+ case 38:
132
+ this.$ = yy.Cardinality.MD_PARENT;
133
+ break;
134
+ case 39:
135
+ this.$ = yy.Identification.NON_IDENTIFYING;
136
+ break;
137
+ case 40:
138
+ this.$ = yy.Identification.IDENTIFYING;
139
+ break;
140
+ }
141
+ },
142
+ 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])],
143
+ defaultActions: { 34: [2, 27], 41: [2, 22] },
144
+ parseError: function parseError(str, hash) {
145
+ if (hash.recoverable) {
146
+ this.trace(str);
147
+ } else {
148
+ var error = new Error(str);
149
+ error.hash = hash;
150
+ throw error;
151
+ }
152
+ },
153
+ parse: function parse2(input) {
154
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
155
+ var args = lstack.slice.call(arguments, 1);
156
+ var lexer2 = Object.create(this.lexer);
157
+ var sharedState = { yy: {} };
158
+ for (var k in this.yy) {
159
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
160
+ sharedState.yy[k] = this.yy[k];
161
+ }
162
+ }
163
+ lexer2.setInput(input, sharedState.yy);
164
+ sharedState.yy.lexer = lexer2;
165
+ sharedState.yy.parser = this;
166
+ if (typeof lexer2.yylloc == "undefined") {
167
+ lexer2.yylloc = {};
168
+ }
169
+ var yyloc = lexer2.yylloc;
170
+ lstack.push(yyloc);
171
+ var ranges = lexer2.options && lexer2.options.ranges;
172
+ if (typeof sharedState.yy.parseError === "function") {
173
+ this.parseError = sharedState.yy.parseError;
174
+ } else {
175
+ this.parseError = Object.getPrototypeOf(this).parseError;
176
+ }
177
+ function lex() {
178
+ var token;
179
+ token = tstack.pop() || lexer2.lex() || EOF;
180
+ if (typeof token !== "number") {
181
+ if (token instanceof Array) {
182
+ tstack = token;
183
+ token = tstack.pop();
184
+ }
185
+ token = self.symbols_[token] || token;
186
+ }
187
+ return token;
188
+ }
189
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
190
+ while (true) {
191
+ state = stack[stack.length - 1];
192
+ if (this.defaultActions[state]) {
193
+ action = this.defaultActions[state];
194
+ } else {
195
+ if (symbol === null || typeof symbol == "undefined") {
196
+ symbol = lex();
197
+ }
198
+ action = table[state] && table[state][symbol];
199
+ }
200
+ if (typeof action === "undefined" || !action.length || !action[0]) {
201
+ var errStr = "";
202
+ expected = [];
203
+ for (p in table[state]) {
204
+ if (this.terminals_[p] && p > TERROR) {
205
+ expected.push("'" + this.terminals_[p] + "'");
206
+ }
207
+ }
208
+ if (lexer2.showPosition) {
209
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
210
+ } else {
211
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
212
+ }
213
+ this.parseError(errStr, {
214
+ text: lexer2.match,
215
+ token: this.terminals_[symbol] || symbol,
216
+ line: lexer2.yylineno,
217
+ loc: yyloc,
218
+ expected
219
+ });
220
+ }
221
+ if (action[0] instanceof Array && action.length > 1) {
222
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
223
+ }
224
+ switch (action[0]) {
225
+ case 1:
226
+ stack.push(symbol);
227
+ vstack.push(lexer2.yytext);
228
+ lstack.push(lexer2.yylloc);
229
+ stack.push(action[1]);
230
+ symbol = null;
231
+ {
232
+ yyleng = lexer2.yyleng;
233
+ yytext = lexer2.yytext;
234
+ yylineno = lexer2.yylineno;
235
+ yyloc = lexer2.yylloc;
236
+ }
237
+ break;
238
+ case 2:
239
+ len = this.productions_[action[1]][1];
240
+ yyval.$ = vstack[vstack.length - len];
241
+ yyval._$ = {
242
+ first_line: lstack[lstack.length - (len || 1)].first_line,
243
+ last_line: lstack[lstack.length - 1].last_line,
244
+ first_column: lstack[lstack.length - (len || 1)].first_column,
245
+ last_column: lstack[lstack.length - 1].last_column
246
+ };
247
+ if (ranges) {
248
+ yyval._$.range = [
249
+ lstack[lstack.length - (len || 1)].range[0],
250
+ lstack[lstack.length - 1].range[1]
251
+ ];
252
+ }
253
+ r = this.performAction.apply(yyval, [
254
+ yytext,
255
+ yyleng,
256
+ yylineno,
257
+ sharedState.yy,
258
+ action[1],
259
+ vstack,
260
+ lstack
261
+ ].concat(args));
262
+ if (typeof r !== "undefined") {
263
+ return r;
264
+ }
265
+ if (len) {
266
+ stack = stack.slice(0, -1 * len * 2);
267
+ vstack = vstack.slice(0, -1 * len);
268
+ lstack = lstack.slice(0, -1 * len);
269
+ }
270
+ stack.push(this.productions_[action[1]][0]);
271
+ vstack.push(yyval.$);
272
+ lstack.push(yyval._$);
273
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
274
+ stack.push(newState);
275
+ break;
276
+ case 3:
277
+ return true;
278
+ }
279
+ }
280
+ return true;
281
+ }
282
+ };
283
+ var lexer = function() {
284
+ var lexer2 = {
285
+ EOF: 1,
286
+ parseError: function parseError(str, hash) {
287
+ if (this.yy.parser) {
288
+ this.yy.parser.parseError(str, hash);
289
+ } else {
290
+ throw new Error(str);
291
+ }
292
+ },
293
+ // resets the lexer, sets new input
294
+ setInput: function(input, yy) {
295
+ this.yy = yy || this.yy || {};
296
+ this._input = input;
297
+ this._more = this._backtrack = this.done = false;
298
+ this.yylineno = this.yyleng = 0;
299
+ this.yytext = this.matched = this.match = "";
300
+ this.conditionStack = ["INITIAL"];
301
+ this.yylloc = {
302
+ first_line: 1,
303
+ first_column: 0,
304
+ last_line: 1,
305
+ last_column: 0
306
+ };
307
+ if (this.options.ranges) {
308
+ this.yylloc.range = [0, 0];
309
+ }
310
+ this.offset = 0;
311
+ return this;
312
+ },
313
+ // consumes and returns one char from the input
314
+ input: function() {
315
+ var ch = this._input[0];
316
+ this.yytext += ch;
317
+ this.yyleng++;
318
+ this.offset++;
319
+ this.match += ch;
320
+ this.matched += ch;
321
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
322
+ if (lines) {
323
+ this.yylineno++;
324
+ this.yylloc.last_line++;
325
+ } else {
326
+ this.yylloc.last_column++;
327
+ }
328
+ if (this.options.ranges) {
329
+ this.yylloc.range[1]++;
330
+ }
331
+ this._input = this._input.slice(1);
332
+ return ch;
333
+ },
334
+ // unshifts one char (or a string) into the input
335
+ unput: function(ch) {
336
+ var len = ch.length;
337
+ var lines = ch.split(/(?:\r\n?|\n)/g);
338
+ this._input = ch + this._input;
339
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
340
+ this.offset -= len;
341
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
342
+ this.match = this.match.substr(0, this.match.length - 1);
343
+ this.matched = this.matched.substr(0, this.matched.length - 1);
344
+ if (lines.length - 1) {
345
+ this.yylineno -= lines.length - 1;
346
+ }
347
+ var r = this.yylloc.range;
348
+ this.yylloc = {
349
+ first_line: this.yylloc.first_line,
350
+ last_line: this.yylineno + 1,
351
+ first_column: this.yylloc.first_column,
352
+ 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
353
+ };
354
+ if (this.options.ranges) {
355
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
356
+ }
357
+ this.yyleng = this.yytext.length;
358
+ return this;
359
+ },
360
+ // When called from action, caches matched text and appends it on next action
361
+ more: function() {
362
+ this._more = true;
363
+ return this;
364
+ },
365
+ // 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.
366
+ reject: function() {
367
+ if (this.options.backtrack_lexer) {
368
+ this._backtrack = true;
369
+ } else {
370
+ 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(), {
371
+ text: "",
372
+ token: null,
373
+ line: this.yylineno
374
+ });
375
+ }
376
+ return this;
377
+ },
378
+ // retain first n characters of the match
379
+ less: function(n) {
380
+ this.unput(this.match.slice(n));
381
+ },
382
+ // displays already matched input, i.e. for error messages
383
+ pastInput: function() {
384
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
385
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
386
+ },
387
+ // displays upcoming input, i.e. for error messages
388
+ upcomingInput: function() {
389
+ var next = this.match;
390
+ if (next.length < 20) {
391
+ next += this._input.substr(0, 20 - next.length);
392
+ }
393
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
394
+ },
395
+ // displays the character position where the lexing error occurred, i.e. for error messages
396
+ showPosition: function() {
397
+ var pre = this.pastInput();
398
+ var c = new Array(pre.length + 1).join("-");
399
+ return pre + this.upcomingInput() + "\n" + c + "^";
400
+ },
401
+ // test the lexed token: return FALSE when not a match, otherwise return token
402
+ test_match: function(match, indexed_rule) {
403
+ var token, lines, backup;
404
+ if (this.options.backtrack_lexer) {
405
+ backup = {
406
+ yylineno: this.yylineno,
407
+ yylloc: {
408
+ first_line: this.yylloc.first_line,
409
+ last_line: this.last_line,
410
+ first_column: this.yylloc.first_column,
411
+ last_column: this.yylloc.last_column
412
+ },
413
+ yytext: this.yytext,
414
+ match: this.match,
415
+ matches: this.matches,
416
+ matched: this.matched,
417
+ yyleng: this.yyleng,
418
+ offset: this.offset,
419
+ _more: this._more,
420
+ _input: this._input,
421
+ yy: this.yy,
422
+ conditionStack: this.conditionStack.slice(0),
423
+ done: this.done
424
+ };
425
+ if (this.options.ranges) {
426
+ backup.yylloc.range = this.yylloc.range.slice(0);
427
+ }
428
+ }
429
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
430
+ if (lines) {
431
+ this.yylineno += lines.length;
432
+ }
433
+ this.yylloc = {
434
+ first_line: this.yylloc.last_line,
435
+ last_line: this.yylineno + 1,
436
+ first_column: this.yylloc.last_column,
437
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
438
+ };
439
+ this.yytext += match[0];
440
+ this.match += match[0];
441
+ this.matches = match;
442
+ this.yyleng = this.yytext.length;
443
+ if (this.options.ranges) {
444
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
445
+ }
446
+ this._more = false;
447
+ this._backtrack = false;
448
+ this._input = this._input.slice(match[0].length);
449
+ this.matched += match[0];
450
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
451
+ if (this.done && this._input) {
452
+ this.done = false;
453
+ }
454
+ if (token) {
455
+ return token;
456
+ } else if (this._backtrack) {
457
+ for (var k in backup) {
458
+ this[k] = backup[k];
459
+ }
460
+ return false;
461
+ }
462
+ return false;
463
+ },
464
+ // return next match in input
465
+ next: function() {
466
+ if (this.done) {
467
+ return this.EOF;
468
+ }
469
+ if (!this._input) {
470
+ this.done = true;
471
+ }
472
+ var token, match, tempMatch, index;
473
+ if (!this._more) {
474
+ this.yytext = "";
475
+ this.match = "";
476
+ }
477
+ var rules = this._currentRules();
478
+ for (var i = 0; i < rules.length; i++) {
479
+ tempMatch = this._input.match(this.rules[rules[i]]);
480
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
481
+ match = tempMatch;
482
+ index = i;
483
+ if (this.options.backtrack_lexer) {
484
+ token = this.test_match(tempMatch, rules[i]);
485
+ if (token !== false) {
486
+ return token;
487
+ } else if (this._backtrack) {
488
+ match = false;
489
+ continue;
490
+ } else {
491
+ return false;
492
+ }
493
+ } else if (!this.options.flex) {
494
+ break;
495
+ }
496
+ }
497
+ }
498
+ if (match) {
499
+ token = this.test_match(match, rules[index]);
500
+ if (token !== false) {
501
+ return token;
502
+ }
503
+ return false;
504
+ }
505
+ if (this._input === "") {
506
+ return this.EOF;
507
+ } else {
508
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
509
+ text: "",
510
+ token: null,
511
+ line: this.yylineno
512
+ });
513
+ }
514
+ },
515
+ // return next match that has a token
516
+ lex: function lex() {
517
+ var r = this.next();
518
+ if (r) {
519
+ return r;
520
+ } else {
521
+ return this.lex();
522
+ }
523
+ },
524
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
525
+ begin: function begin(condition) {
526
+ this.conditionStack.push(condition);
527
+ },
528
+ // pop the previously active lexer condition state off the condition stack
529
+ popState: function popState() {
530
+ var n = this.conditionStack.length - 1;
531
+ if (n > 0) {
532
+ return this.conditionStack.pop();
533
+ } else {
534
+ return this.conditionStack[0];
535
+ }
536
+ },
537
+ // produce the lexer rule set which is active for the currently active lexer condition state
538
+ _currentRules: function _currentRules() {
539
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
540
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
541
+ } else {
542
+ return this.conditions["INITIAL"].rules;
543
+ }
544
+ },
545
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
546
+ topState: function topState(n) {
547
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
548
+ if (n >= 0) {
549
+ return this.conditionStack[n];
550
+ } else {
551
+ return "INITIAL";
552
+ }
553
+ },
554
+ // alias for begin(condition)
555
+ pushState: function pushState(condition) {
556
+ this.begin(condition);
557
+ },
558
+ // return the number of states currently on the stack
559
+ stateStackSize: function stateStackSize() {
560
+ return this.conditionStack.length;
561
+ },
562
+ options: { "case-insensitive": true },
563
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
564
+ switch ($avoiding_name_collisions) {
565
+ case 0:
566
+ this.begin("acc_title");
567
+ return 22;
568
+ case 1:
569
+ this.popState();
570
+ return "acc_title_value";
571
+ case 2:
572
+ this.begin("acc_descr");
573
+ return 24;
574
+ case 3:
575
+ this.popState();
576
+ return "acc_descr_value";
577
+ case 4:
578
+ this.begin("acc_descr_multiline");
579
+ break;
580
+ case 5:
581
+ this.popState();
582
+ break;
583
+ case 6:
584
+ return "acc_descr_multiline_value";
585
+ case 7:
586
+ return 10;
587
+ case 8:
588
+ break;
589
+ case 9:
590
+ return 8;
591
+ case 10:
592
+ return 28;
593
+ case 11:
594
+ return 48;
595
+ case 12:
596
+ return 4;
597
+ case 13:
598
+ this.begin("block");
599
+ return 15;
600
+ case 14:
601
+ return 36;
602
+ case 15:
603
+ break;
604
+ case 16:
605
+ return 37;
606
+ case 17:
607
+ return 34;
608
+ case 18:
609
+ return 34;
610
+ case 19:
611
+ return 38;
612
+ case 20:
613
+ break;
614
+ case 21:
615
+ this.popState();
616
+ return 17;
617
+ case 22:
618
+ return yy_.yytext[0];
619
+ case 23:
620
+ return 18;
621
+ case 24:
622
+ return 19;
623
+ case 25:
624
+ return 41;
625
+ case 26:
626
+ return 43;
627
+ case 27:
628
+ return 43;
629
+ case 28:
630
+ return 43;
631
+ case 29:
632
+ return 41;
633
+ case 30:
634
+ return 41;
635
+ case 31:
636
+ return 42;
637
+ case 32:
638
+ return 42;
639
+ case 33:
640
+ return 42;
641
+ case 34:
642
+ return 42;
643
+ case 35:
644
+ return 42;
645
+ case 36:
646
+ return 43;
647
+ case 37:
648
+ return 42;
649
+ case 38:
650
+ return 43;
651
+ case 39:
652
+ return 44;
653
+ case 40:
654
+ return 44;
655
+ case 41:
656
+ return 44;
657
+ case 42:
658
+ return 44;
659
+ case 43:
660
+ return 41;
661
+ case 44:
662
+ return 42;
663
+ case 45:
664
+ return 43;
665
+ case 46:
666
+ return 45;
667
+ case 47:
668
+ return 46;
669
+ case 48:
670
+ return 47;
671
+ case 49:
672
+ return 47;
673
+ case 50:
674
+ return 46;
675
+ case 51:
676
+ return 46;
677
+ case 52:
678
+ return 46;
679
+ case 53:
680
+ return 27;
681
+ case 54:
682
+ return yy_.yytext[0];
683
+ case 55:
684
+ return 6;
685
+ }
686
+ },
687
+ 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],
688
+ 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 } }
689
+ };
690
+ return lexer2;
691
+ }();
692
+ parser2.lexer = lexer;
693
+ function Parser() {
694
+ this.yy = {};
695
+ }
696
+ Parser.prototype = parser2;
697
+ parser2.Parser = Parser;
698
+ return new Parser();
699
+ }();
700
+ parser.parser = parser;
701
+ const erParser = parser;
702
+ let entities = {};
703
+ let relationships = [];
704
+ const Cardinality = {
705
+ ZERO_OR_ONE: "ZERO_OR_ONE",
706
+ ZERO_OR_MORE: "ZERO_OR_MORE",
707
+ ONE_OR_MORE: "ONE_OR_MORE",
708
+ ONLY_ONE: "ONLY_ONE",
709
+ MD_PARENT: "MD_PARENT"
710
+ };
711
+ const Identification = {
712
+ NON_IDENTIFYING: "NON_IDENTIFYING",
713
+ IDENTIFYING: "IDENTIFYING"
714
+ };
715
+ const addEntity = function(name, alias = void 0) {
716
+ if (entities[name] === void 0) {
717
+ entities[name] = { attributes: [], alias };
718
+ log.info("Added new entity :", name);
719
+ } else if (entities[name] && !entities[name].alias && alias) {
720
+ entities[name].alias = alias;
721
+ log.info(`Add alias '${alias}' to entity '${name}'`);
722
+ }
723
+ return entities[name];
724
+ };
725
+ const getEntities = () => entities;
726
+ const addAttributes = function(entityName, attribs) {
727
+ let entity = addEntity(entityName);
728
+ let i;
729
+ for (i = attribs.length - 1; i >= 0; i--) {
730
+ entity.attributes.push(attribs[i]);
731
+ log.debug("Added attribute ", attribs[i].attributeName);
732
+ }
733
+ };
734
+ const addRelationship = function(entA, rolA, entB, rSpec) {
735
+ let rel = {
736
+ entityA: entA,
737
+ roleA: rolA,
738
+ entityB: entB,
739
+ relSpec: rSpec
740
+ };
741
+ relationships.push(rel);
742
+ log.debug("Added new relationship :", rel);
743
+ };
744
+ const getRelationships = () => relationships;
745
+ const clear = function() {
746
+ entities = {};
747
+ relationships = [];
748
+ clear$1();
749
+ };
750
+ const erDb = {
751
+ Cardinality,
752
+ Identification,
753
+ getConfig: () => getConfig().er,
754
+ addEntity,
755
+ addAttributes,
756
+ getEntities,
757
+ addRelationship,
758
+ getRelationships,
759
+ clear,
760
+ setAccTitle,
761
+ getAccTitle,
762
+ setAccDescription,
763
+ getAccDescription,
764
+ setDiagramTitle,
765
+ getDiagramTitle
766
+ };
767
+ const ERMarkers = {
768
+ ONLY_ONE_START: "ONLY_ONE_START",
769
+ ONLY_ONE_END: "ONLY_ONE_END",
770
+ ZERO_OR_ONE_START: "ZERO_OR_ONE_START",
771
+ ZERO_OR_ONE_END: "ZERO_OR_ONE_END",
772
+ ONE_OR_MORE_START: "ONE_OR_MORE_START",
773
+ ONE_OR_MORE_END: "ONE_OR_MORE_END",
774
+ ZERO_OR_MORE_START: "ZERO_OR_MORE_START",
775
+ ZERO_OR_MORE_END: "ZERO_OR_MORE_END",
776
+ MD_PARENT_END: "MD_PARENT_END",
777
+ MD_PARENT_START: "MD_PARENT_START"
778
+ };
779
+ const insertMarkers = function(elem, conf2) {
780
+ let marker;
781
+ 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");
782
+ 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");
783
+ 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");
784
+ 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");
785
+ 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");
786
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
787
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18");
788
+ 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");
789
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
790
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,0 L21,18");
791
+ 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");
792
+ 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");
793
+ 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");
794
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
795
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
796
+ 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");
797
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
798
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
799
+ return;
800
+ };
801
+ const erMarkers = {
802
+ ERMarkers,
803
+ insertMarkers
804
+ };
805
+ const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
806
+ function validate(uuid) {
807
+ return typeof uuid === "string" && REGEX.test(uuid);
808
+ }
809
+ const byteToHex = [];
810
+ for (let i = 0; i < 256; ++i) {
811
+ byteToHex.push((i + 256).toString(16).slice(1));
812
+ }
813
+ function unsafeStringify(arr, offset = 0) {
814
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
815
+ }
816
+ function parse(uuid) {
817
+ if (!validate(uuid)) {
818
+ throw TypeError("Invalid UUID");
819
+ }
820
+ let v;
821
+ const arr = new Uint8Array(16);
822
+ arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
823
+ arr[1] = v >>> 16 & 255;
824
+ arr[2] = v >>> 8 & 255;
825
+ arr[3] = v & 255;
826
+ arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
827
+ arr[5] = v & 255;
828
+ arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
829
+ arr[7] = v & 255;
830
+ arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
831
+ arr[9] = v & 255;
832
+ arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255;
833
+ arr[11] = v / 4294967296 & 255;
834
+ arr[12] = v >>> 24 & 255;
835
+ arr[13] = v >>> 16 & 255;
836
+ arr[14] = v >>> 8 & 255;
837
+ arr[15] = v & 255;
838
+ return arr;
839
+ }
840
+ function stringToBytes(str) {
841
+ str = unescape(encodeURIComponent(str));
842
+ const bytes = [];
843
+ for (let i = 0; i < str.length; ++i) {
844
+ bytes.push(str.charCodeAt(i));
845
+ }
846
+ return bytes;
847
+ }
848
+ const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
849
+ const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
850
+ function v35(name, version, hashfunc) {
851
+ function generateUUID(value, namespace, buf, offset) {
852
+ var _namespace;
853
+ if (typeof value === "string") {
854
+ value = stringToBytes(value);
855
+ }
856
+ if (typeof namespace === "string") {
857
+ namespace = parse(namespace);
858
+ }
859
+ if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
860
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
861
+ }
862
+ let bytes = new Uint8Array(16 + value.length);
863
+ bytes.set(namespace);
864
+ bytes.set(value, namespace.length);
865
+ bytes = hashfunc(bytes);
866
+ bytes[6] = bytes[6] & 15 | version;
867
+ bytes[8] = bytes[8] & 63 | 128;
868
+ if (buf) {
869
+ offset = offset || 0;
870
+ for (let i = 0; i < 16; ++i) {
871
+ buf[offset + i] = bytes[i];
872
+ }
873
+ return buf;
874
+ }
875
+ return unsafeStringify(bytes);
876
+ }
877
+ try {
878
+ generateUUID.name = name;
879
+ } catch (err) {
880
+ }
881
+ generateUUID.DNS = DNS;
882
+ generateUUID.URL = URL;
883
+ return generateUUID;
884
+ }
885
+ function f(s, x, y, z) {
886
+ switch (s) {
887
+ case 0:
888
+ return x & y ^ ~x & z;
889
+ case 1:
890
+ return x ^ y ^ z;
891
+ case 2:
892
+ return x & y ^ x & z ^ y & z;
893
+ case 3:
894
+ return x ^ y ^ z;
895
+ }
896
+ }
897
+ function ROTL(x, n) {
898
+ return x << n | x >>> 32 - n;
899
+ }
900
+ function sha1(bytes) {
901
+ const K = [1518500249, 1859775393, 2400959708, 3395469782];
902
+ const H = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
903
+ if (typeof bytes === "string") {
904
+ const msg = unescape(encodeURIComponent(bytes));
905
+ bytes = [];
906
+ for (let i = 0; i < msg.length; ++i) {
907
+ bytes.push(msg.charCodeAt(i));
908
+ }
909
+ } else if (!Array.isArray(bytes)) {
910
+ bytes = Array.prototype.slice.call(bytes);
911
+ }
912
+ bytes.push(128);
913
+ const l = bytes.length / 4 + 2;
914
+ const N = Math.ceil(l / 16);
915
+ const M = new Array(N);
916
+ for (let i = 0; i < N; ++i) {
917
+ const arr = new Uint32Array(16);
918
+ for (let j = 0; j < 16; ++j) {
919
+ arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
920
+ }
921
+ M[i] = arr;
922
+ }
923
+ M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
924
+ M[N - 1][14] = Math.floor(M[N - 1][14]);
925
+ M[N - 1][15] = (bytes.length - 1) * 8 & 4294967295;
926
+ for (let i = 0; i < N; ++i) {
927
+ const W = new Uint32Array(80);
928
+ for (let t = 0; t < 16; ++t) {
929
+ W[t] = M[i][t];
930
+ }
931
+ for (let t = 16; t < 80; ++t) {
932
+ W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
933
+ }
934
+ let a = H[0];
935
+ let b = H[1];
936
+ let c = H[2];
937
+ let d = H[3];
938
+ let e = H[4];
939
+ for (let t = 0; t < 80; ++t) {
940
+ const s = Math.floor(t / 20);
941
+ const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
942
+ e = d;
943
+ d = c;
944
+ c = ROTL(b, 30) >>> 0;
945
+ b = a;
946
+ a = T;
947
+ }
948
+ H[0] = H[0] + a >>> 0;
949
+ H[1] = H[1] + b >>> 0;
950
+ H[2] = H[2] + c >>> 0;
951
+ H[3] = H[3] + d >>> 0;
952
+ H[4] = H[4] + e >>> 0;
953
+ }
954
+ return [H[0] >> 24 & 255, H[0] >> 16 & 255, H[0] >> 8 & 255, H[0] & 255, H[1] >> 24 & 255, H[1] >> 16 & 255, H[1] >> 8 & 255, H[1] & 255, H[2] >> 24 & 255, H[2] >> 16 & 255, H[2] >> 8 & 255, H[2] & 255, H[3] >> 24 & 255, H[3] >> 16 & 255, H[3] >> 8 & 255, H[3] & 255, H[4] >> 24 & 255, H[4] >> 16 & 255, H[4] >> 8 & 255, H[4] & 255];
955
+ }
956
+ const v5 = v35("v5", 80, sha1);
957
+ const uuid5 = v5;
958
+ const BAD_ID_CHARS_REGEXP = /[^\dA-Za-z](\W)*/g;
959
+ let conf = {};
960
+ let entityNameIds = /* @__PURE__ */ new Map();
961
+ const setConf = function(cnf) {
962
+ const keys = Object.keys(cnf);
963
+ for (const key of keys) {
964
+ conf[key] = cnf[key];
965
+ }
966
+ };
967
+ const drawAttributes = (groupNode, entityTextNode, attributes) => {
968
+ const heightPadding = conf.entityPadding / 3;
969
+ const widthPadding = conf.entityPadding / 3;
970
+ const attrFontSize = conf.fontSize * 0.85;
971
+ const labelBBox = entityTextNode.node().getBBox();
972
+ const attributeNodes = [];
973
+ let hasKeyType = false;
974
+ let hasComment = false;
975
+ let maxTypeWidth = 0;
976
+ let maxNameWidth = 0;
977
+ let maxKeyWidth = 0;
978
+ let maxCommentWidth = 0;
979
+ let cumulativeHeight = labelBBox.height + heightPadding * 2;
980
+ let attrNum = 1;
981
+ attributes.forEach((item) => {
982
+ if (item.attributeKeyTypeList !== void 0 && item.attributeKeyTypeList.length > 0) {
983
+ hasKeyType = true;
984
+ }
985
+ if (item.attributeComment !== void 0) {
986
+ hasComment = true;
987
+ }
988
+ });
989
+ attributes.forEach((item) => {
990
+ const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`;
991
+ let nodeHeight = 0;
992
+ const attributeType = parseGenericTypes(item.attributeType);
993
+ 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);
994
+ 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);
995
+ const attributeNode = {};
996
+ attributeNode.tn = typeNode;
997
+ attributeNode.nn = nameNode;
998
+ const typeBBox = typeNode.node().getBBox();
999
+ const nameBBox = nameNode.node().getBBox();
1000
+ maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width);
1001
+ maxNameWidth = Math.max(maxNameWidth, nameBBox.width);
1002
+ nodeHeight = Math.max(typeBBox.height, nameBBox.height);
1003
+ if (hasKeyType) {
1004
+ const keyTypeNodeText = item.attributeKeyTypeList !== void 0 ? item.attributeKeyTypeList.join(",") : "";
1005
+ 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);
1006
+ attributeNode.kn = keyTypeNode;
1007
+ const keyTypeBBox = keyTypeNode.node().getBBox();
1008
+ maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width);
1009
+ nodeHeight = Math.max(nodeHeight, keyTypeBBox.height);
1010
+ }
1011
+ if (hasComment) {
1012
+ 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 || "");
1013
+ attributeNode.cn = commentNode;
1014
+ const commentNodeBBox = commentNode.node().getBBox();
1015
+ maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width);
1016
+ nodeHeight = Math.max(nodeHeight, commentNodeBBox.height);
1017
+ }
1018
+ attributeNode.height = nodeHeight;
1019
+ attributeNodes.push(attributeNode);
1020
+ cumulativeHeight += nodeHeight + heightPadding * 2;
1021
+ attrNum += 1;
1022
+ });
1023
+ let widthPaddingFactor = 4;
1024
+ if (hasKeyType) {
1025
+ widthPaddingFactor += 2;
1026
+ }
1027
+ if (hasComment) {
1028
+ widthPaddingFactor += 2;
1029
+ }
1030
+ const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth;
1031
+ const bBox = {
1032
+ width: Math.max(
1033
+ conf.minEntityWidth,
1034
+ Math.max(
1035
+ labelBBox.width + conf.entityPadding * 2,
1036
+ maxWidth + widthPadding * widthPaddingFactor
1037
+ )
1038
+ ),
1039
+ height: attributes.length > 0 ? cumulativeHeight : Math.max(conf.minEntityHeight, labelBBox.height + conf.entityPadding * 2)
1040
+ };
1041
+ if (attributes.length > 0) {
1042
+ const spareColumnWidth = Math.max(
1043
+ 0,
1044
+ (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2)
1045
+ );
1046
+ entityTextNode.attr(
1047
+ "transform",
1048
+ "translate(" + bBox.width / 2 + "," + (heightPadding + labelBBox.height / 2) + ")"
1049
+ );
1050
+ let heightOffset = labelBBox.height + heightPadding * 2;
1051
+ let attribStyle = "attributeBoxOdd";
1052
+ attributeNodes.forEach((attributeNode) => {
1053
+ const alignY = heightOffset + heightPadding + attributeNode.height / 2;
1054
+ attributeNode.tn.attr("transform", "translate(" + widthPadding + "," + alignY + ")");
1055
+ 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);
1056
+ const nameXOffset = parseFloat(typeRect.attr("x")) + parseFloat(typeRect.attr("width"));
1057
+ attributeNode.nn.attr(
1058
+ "transform",
1059
+ "translate(" + (nameXOffset + widthPadding) + "," + alignY + ")"
1060
+ );
1061
+ 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);
1062
+ let keyTypeAndCommentXOffset = parseFloat(nameRect.attr("x")) + parseFloat(nameRect.attr("width"));
1063
+ if (hasKeyType) {
1064
+ attributeNode.kn.attr(
1065
+ "transform",
1066
+ "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
1067
+ );
1068
+ 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);
1069
+ keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr("x")) + parseFloat(keyTypeRect.attr("width"));
1070
+ }
1071
+ if (hasComment) {
1072
+ attributeNode.cn.attr(
1073
+ "transform",
1074
+ "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
1075
+ );
1076
+ 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);
1077
+ }
1078
+ heightOffset += attributeNode.height + heightPadding * 2;
1079
+ attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd";
1080
+ });
1081
+ } else {
1082
+ bBox.height = Math.max(conf.minEntityHeight, cumulativeHeight);
1083
+ entityTextNode.attr("transform", "translate(" + bBox.width / 2 + "," + bBox.height / 2 + ")");
1084
+ }
1085
+ return bBox;
1086
+ };
1087
+ const drawEntities = function(svgNode, entities2, graph) {
1088
+ const keys = Object.keys(entities2);
1089
+ let firstOne;
1090
+ keys.forEach(function(entityName) {
1091
+ const entityId = generateId(entityName, "entity");
1092
+ entityNameIds.set(entityName, entityId);
1093
+ const groupNode = svgNode.append("g").attr("id", entityId);
1094
+ firstOne = firstOne === void 0 ? entityId : firstOne;
1095
+ const textId = "text-" + entityId;
1096
+ 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);
1097
+ const { width: entityWidth, height: entityHeight } = drawAttributes(
1098
+ groupNode,
1099
+ textNode,
1100
+ entities2[entityName].attributes
1101
+ );
1102
+ const rectNode = groupNode.insert("rect", "#" + textId).classed("er entityBox", true).attr("x", 0).attr("y", 0).attr("width", entityWidth).attr("height", entityHeight);
1103
+ const rectBBox = rectNode.node().getBBox();
1104
+ graph.setNode(entityId, {
1105
+ width: rectBBox.width,
1106
+ height: rectBBox.height,
1107
+ shape: "rect",
1108
+ id: entityId
1109
+ });
1110
+ });
1111
+ return firstOne;
1112
+ };
1113
+ const adjustEntities = function(svgNode, graph) {
1114
+ graph.nodes().forEach(function(v) {
1115
+ if (v !== void 0 && graph.node(v) !== void 0) {
1116
+ svgNode.select("#" + v).attr(
1117
+ "transform",
1118
+ "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y - graph.node(v).height / 2) + " )"
1119
+ );
1120
+ }
1121
+ });
1122
+ };
1123
+ const getEdgeName = function(rel) {
1124
+ return (rel.entityA + rel.roleA + rel.entityB).replace(/\s/g, "");
1125
+ };
1126
+ const addRelationships = function(relationships2, g) {
1127
+ relationships2.forEach(function(r) {
1128
+ g.setEdge(
1129
+ entityNameIds.get(r.entityA),
1130
+ entityNameIds.get(r.entityB),
1131
+ { relationship: r },
1132
+ getEdgeName(r)
1133
+ );
1134
+ });
1135
+ return relationships2;
1136
+ };
1137
+ let relCnt = 0;
1138
+ const drawRelationshipFromLayout = function(svg, rel, g, insert, diagObj) {
1139
+ relCnt++;
1140
+ const edge = g.edge(
1141
+ entityNameIds.get(rel.entityA),
1142
+ entityNameIds.get(rel.entityB),
1143
+ getEdgeName(rel)
1144
+ );
1145
+ const lineFunction = line().x(function(d) {
1146
+ return d.x;
1147
+ }).y(function(d) {
1148
+ return d.y;
1149
+ }).curve(curveBasis);
1150
+ const svgPath = svg.insert("path", "#" + insert).classed("er relationshipLine", true).attr("d", lineFunction(edge.points)).style("stroke", conf.stroke).style("fill", "none");
1151
+ if (rel.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) {
1152
+ svgPath.attr("stroke-dasharray", "8,8");
1153
+ }
1154
+ let url = "";
1155
+ if (conf.arrowMarkerAbsolute) {
1156
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
1157
+ url = url.replace(/\(/g, "\\(");
1158
+ url = url.replace(/\)/g, "\\)");
1159
+ }
1160
+ switch (rel.relSpec.cardA) {
1161
+ case diagObj.db.Cardinality.ZERO_OR_ONE:
1162
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_END + ")");
1163
+ break;
1164
+ case diagObj.db.Cardinality.ZERO_OR_MORE:
1165
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_END + ")");
1166
+ break;
1167
+ case diagObj.db.Cardinality.ONE_OR_MORE:
1168
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_END + ")");
1169
+ break;
1170
+ case diagObj.db.Cardinality.ONLY_ONE:
1171
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_END + ")");
1172
+ break;
1173
+ case diagObj.db.Cardinality.MD_PARENT:
1174
+ svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.MD_PARENT_END + ")");
1175
+ break;
1176
+ }
1177
+ switch (rel.relSpec.cardB) {
1178
+ case diagObj.db.Cardinality.ZERO_OR_ONE:
1179
+ svgPath.attr(
1180
+ "marker-start",
1181
+ "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_START + ")"
1182
+ );
1183
+ break;
1184
+ case diagObj.db.Cardinality.ZERO_OR_MORE:
1185
+ svgPath.attr(
1186
+ "marker-start",
1187
+ "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_START + ")"
1188
+ );
1189
+ break;
1190
+ case diagObj.db.Cardinality.ONE_OR_MORE:
1191
+ svgPath.attr(
1192
+ "marker-start",
1193
+ "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_START + ")"
1194
+ );
1195
+ break;
1196
+ case diagObj.db.Cardinality.ONLY_ONE:
1197
+ svgPath.attr("marker-start", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_START + ")");
1198
+ break;
1199
+ case diagObj.db.Cardinality.MD_PARENT:
1200
+ svgPath.attr("marker-start", "url(" + url + "#" + erMarkers.ERMarkers.MD_PARENT_START + ")");
1201
+ break;
1202
+ }
1203
+ const len = svgPath.node().getTotalLength();
1204
+ const labelPoint = svgPath.node().getPointAtLength(len * 0.5);
1205
+ const labelId = "rel" + relCnt;
1206
+ 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);
1207
+ const labelBBox = labelNode.node().getBBox();
1208
+ 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);
1209
+ };
1210
+ const draw = function(text, id, _version, diagObj) {
1211
+ conf = getConfig().er;
1212
+ log.info("Drawing ER diagram");
1213
+ const securityLevel = getConfig().securityLevel;
1214
+ let sandboxElement;
1215
+ if (securityLevel === "sandbox") {
1216
+ sandboxElement = d3select("#i" + id);
1217
+ }
1218
+ const root = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body");
1219
+ const svg = root.select(`[id='${id}']`);
1220
+ erMarkers.insertMarkers(svg, conf);
1221
+ let g;
1222
+ g = new Graph({
1223
+ multigraph: true,
1224
+ directed: true,
1225
+ compound: false
1226
+ }).setGraph({
1227
+ rankdir: conf.layoutDirection,
1228
+ marginx: 20,
1229
+ marginy: 20,
1230
+ nodesep: 100,
1231
+ edgesep: 100,
1232
+ ranksep: 100
1233
+ }).setDefaultEdgeLabel(function() {
1234
+ return {};
1235
+ });
1236
+ const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g);
1237
+ const relationships2 = addRelationships(diagObj.db.getRelationships(), g);
1238
+ layout(g);
1239
+ adjustEntities(svg, g);
1240
+ relationships2.forEach(function(rel) {
1241
+ drawRelationshipFromLayout(svg, rel, g, firstEntity, diagObj);
1242
+ });
1243
+ const padding = conf.diagramPadding;
1244
+ utils.insertTitle(svg, "entityTitleText", conf.titleTopMargin, diagObj.db.getDiagramTitle());
1245
+ const svgBounds = svg.node().getBBox();
1246
+ const width = svgBounds.width + padding * 2;
1247
+ const height = svgBounds.height + padding * 2;
1248
+ configureSvgSize(svg, height, width, conf.useMaxWidth);
1249
+ svg.attr("viewBox", `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);
1250
+ };
1251
+ const MERMAID_ERDIAGRAM_UUID = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c";
1252
+ function generateId(str = "", prefix = "") {
1253
+ const simplifiedStr = str.replace(BAD_ID_CHARS_REGEXP, "");
1254
+ return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${uuid5(
1255
+ str,
1256
+ MERMAID_ERDIAGRAM_UUID
1257
+ )}`;
1258
+ }
1259
+ function strWithHyphen(str = "") {
1260
+ return str.length > 0 ? `${str}-` : "";
1261
+ }
1262
+ const erRenderer = {
1263
+ setConf,
1264
+ draw
1265
+ };
1266
+ const getStyles = (options) => `
1267
+ .entityBox {
1268
+ fill: ${options.mainBkg};
1269
+ stroke: ${options.nodeBorder};
1270
+ }
1271
+
1272
+ .attributeBoxOdd {
1273
+ fill: ${options.attributeBackgroundColorOdd};
1274
+ stroke: ${options.nodeBorder};
1275
+ }
1276
+
1277
+ .attributeBoxEven {
1278
+ fill: ${options.attributeBackgroundColorEven};
1279
+ stroke: ${options.nodeBorder};
1280
+ }
1281
+
1282
+ .relationshipLabelBox {
1283
+ fill: ${options.tertiaryColor};
1284
+ opacity: 0.7;
1285
+ background-color: ${options.tertiaryColor};
1286
+ rect {
1287
+ opacity: 0.5;
1288
+ }
1289
+ }
1290
+
1291
+ .relationshipLine {
1292
+ stroke: ${options.lineColor};
1293
+ }
1294
+
1295
+ .entityTitleText {
1296
+ text-anchor: middle;
1297
+ font-size: 18px;
1298
+ fill: ${options.textColor};
1299
+ }
1300
+ #MD_PARENT_START {
1301
+ fill: #f5f5f5 !important;
1302
+ stroke: ${options.lineColor} !important;
1303
+ stroke-width: 1;
1304
+ }
1305
+ #MD_PARENT_END {
1306
+ fill: #f5f5f5 !important;
1307
+ stroke: ${options.lineColor} !important;
1308
+ stroke-width: 1;
1309
+ }
1310
+
1311
+ `;
1312
+ const erStyles = getStyles;
1313
+ const diagram = {
1314
+ parser: erParser,
1315
+ db: erDb,
1316
+ renderer: erRenderer,
1317
+ styles: erStyles
1318
+ };
1319
+ export {
1320
+ diagram
1321
+ };