research-copilot 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -0
  3. package/app/build/icon.icns +0 -0
  4. package/app/build/icon.ico +0 -0
  5. package/app/build/icon.png +0 -0
  6. package/app/out/main/index.mjs +6719 -0
  7. package/app/out/preload/index.js +141 -0
  8. package/app/out/renderer/assets/Inter-Variable-Latin-8kRkwJBP.woff2 +0 -0
  9. package/app/out/renderer/assets/Inter-Variable-LatinExt-B_-bZUTo.woff2 +0 -0
  10. package/app/out/renderer/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  11. package/app/out/renderer/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  12. package/app/out/renderer/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  13. package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  14. package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  15. package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  16. package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  17. package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  18. package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  19. package/app/out/renderer/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  20. package/app/out/renderer/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  21. package/app/out/renderer/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  22. package/app/out/renderer/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  23. package/app/out/renderer/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  24. package/app/out/renderer/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  25. package/app/out/renderer/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  26. package/app/out/renderer/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  27. package/app/out/renderer/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  28. package/app/out/renderer/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  29. package/app/out/renderer/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  30. package/app/out/renderer/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  31. package/app/out/renderer/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  32. package/app/out/renderer/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  33. package/app/out/renderer/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  34. package/app/out/renderer/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  35. package/app/out/renderer/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  36. package/app/out/renderer/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  37. package/app/out/renderer/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  38. package/app/out/renderer/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  39. package/app/out/renderer/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  40. package/app/out/renderer/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  41. package/app/out/renderer/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  42. package/app/out/renderer/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  43. package/app/out/renderer/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  44. package/app/out/renderer/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  45. package/app/out/renderer/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  46. package/app/out/renderer/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  47. package/app/out/renderer/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  48. package/app/out/renderer/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  49. package/app/out/renderer/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  50. package/app/out/renderer/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  51. package/app/out/renderer/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  52. package/app/out/renderer/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  53. package/app/out/renderer/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  54. package/app/out/renderer/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  55. package/app/out/renderer/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  56. package/app/out/renderer/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  57. package/app/out/renderer/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  58. package/app/out/renderer/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  59. package/app/out/renderer/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  60. package/app/out/renderer/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  61. package/app/out/renderer/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  62. package/app/out/renderer/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  63. package/app/out/renderer/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  64. package/app/out/renderer/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  65. package/app/out/renderer/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  66. package/app/out/renderer/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  67. package/app/out/renderer/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  68. package/app/out/renderer/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  69. package/app/out/renderer/assets/MilkdownMarkdownEditor-bLPxrCVb.js +89821 -0
  70. package/app/out/renderer/assets/MilkdownMarkdownEditor-tTNRIB2K.css +2555 -0
  71. package/app/out/renderer/assets/Tableau10-BqnYsPR6.js +9 -0
  72. package/app/out/renderer/assets/apl-fqmucPXA.js +140 -0
  73. package/app/out/renderer/assets/arc-J47ePHZ2.js +132 -0
  74. package/app/out/renderer/assets/array-DgktLKBx.js +6 -0
  75. package/app/out/renderer/assets/asciiarmor-DucZyvP0.js +56 -0
  76. package/app/out/renderer/assets/asn1-BnOEsgAm.js +144 -0
  77. package/app/out/renderer/assets/asterisk-QAlztEwS.js +345 -0
  78. package/app/out/renderer/assets/blockDiagram-c4efeb88-5uRQXgQJ.js +1817 -0
  79. package/app/out/renderer/assets/brainfuck-DZVCuF_t.js +53 -0
  80. package/app/out/renderer/assets/c4Diagram-c83219d4-C4iCTPEL.js +2464 -0
  81. package/app/out/renderer/assets/channel-ZAmhHE3g.js +7 -0
  82. package/app/out/renderer/assets/classDiagram-beda092f-7NOZxq_W.js +357 -0
  83. package/app/out/renderer/assets/classDiagram-v2-2358418a-5fPT-cUH.js +291 -0
  84. package/app/out/renderer/assets/clike-xqXYL6ge.js +805 -0
  85. package/app/out/renderer/assets/clojure-BhXMqnxz.js +849 -0
  86. package/app/out/renderer/assets/clone-CsnzsYXQ.js +8 -0
  87. package/app/out/renderer/assets/cmake-BGaNd9E7.js +71 -0
  88. package/app/out/renderer/assets/cobol-4yqQntpt.js +120 -0
  89. package/app/out/renderer/assets/coffeescript-D2dXvhEc.js +308 -0
  90. package/app/out/renderer/assets/commonlisp-CF_VNHQR.js +130 -0
  91. package/app/out/renderer/assets/createText-1719965b-Cji7KN4K.js +4904 -0
  92. package/app/out/renderer/assets/crystal-DyuLTqLs.js +398 -0
  93. package/app/out/renderer/assets/css-c-jst79C.js +1783 -0
  94. package/app/out/renderer/assets/cypher-Dlu_3r4V.js +121 -0
  95. package/app/out/renderer/assets/d-UURgV0Ux.js +179 -0
  96. package/app/out/renderer/assets/diff-B_Bi2Crb.js +25 -0
  97. package/app/out/renderer/assets/dockerfile-Bvk733Ga.js +201 -0
  98. package/app/out/renderer/assets/dtd-Dy74G54E.js +114 -0
  99. package/app/out/renderer/assets/dylan-TSb-Nfix.js +314 -0
  100. package/app/out/renderer/assets/ebnf-DAomQUbD.js +139 -0
  101. package/app/out/renderer/assets/ecl-B59qGGVg.js +178 -0
  102. package/app/out/renderer/assets/edges-96097737-CD0EvAZQ.js +1844 -0
  103. package/app/out/renderer/assets/eiffel-Dze7nlu3.js +134 -0
  104. package/app/out/renderer/assets/elm-DG7jkhNZ.js +176 -0
  105. package/app/out/renderer/assets/erDiagram-0228fc6a-DRYXBpi7.js +1321 -0
  106. package/app/out/renderer/assets/erlang-BO6gOnGA.js +674 -0
  107. package/app/out/renderer/assets/factor-CMxFHDqz.js +65 -0
  108. package/app/out/renderer/assets/fcl-CDDUNjTj.js +141 -0
  109. package/app/out/renderer/assets/flowDb-c6c81e3f-CuoIN-Cy.js +1713 -0
  110. package/app/out/renderer/assets/flowDiagram-50d868cf-CPWPLOml.js +1272 -0
  111. package/app/out/renderer/assets/flowDiagram-v2-4f6560a1-C_R12s4S.js +33 -0
  112. package/app/out/renderer/assets/flowchart-elk-definition-6af322e1-BdKUSFpi.js +92921 -0
  113. package/app/out/renderer/assets/forth-B9D2JCeE.js +116 -0
  114. package/app/out/renderer/assets/fortran-CAG2BFbe.js +467 -0
  115. package/app/out/renderer/assets/ganttDiagram-a2739b55-ygqT5HlG.js +3399 -0
  116. package/app/out/renderer/assets/gas-d3KEcW3x.js +294 -0
  117. package/app/out/renderer/assets/gherkin-DhZlEZiy.js +115 -0
  118. package/app/out/renderer/assets/gitGraphDiagram-82fe8481-D97GT4iA.js +1791 -0
  119. package/app/out/renderer/assets/graph-DpC13d95.js +1237 -0
  120. package/app/out/renderer/assets/groovy-CpwJiBl7.js +223 -0
  121. package/app/out/renderer/assets/haskell-BlGBCCe3.js +459 -0
  122. package/app/out/renderer/assets/haxe-7MlzfeYV.js +514 -0
  123. package/app/out/renderer/assets/http-BqypyemW.js +79 -0
  124. package/app/out/renderer/assets/idl-4HIGJlDI.js +985 -0
  125. package/app/out/renderer/assets/index-4-ziknCv.js +292 -0
  126. package/app/out/renderer/assets/index-5325376f-Bbs7Fbqr.js +663 -0
  127. package/app/out/renderer/assets/index-B2jip-rk.js +2489 -0
  128. package/app/out/renderer/assets/index-BKTVfokE.js +312 -0
  129. package/app/out/renderer/assets/index-BiJbFgVG.js +118 -0
  130. package/app/out/renderer/assets/index-Bn433Fat.js +83 -0
  131. package/app/out/renderer/assets/index-BqDyyRCx.js +39679 -0
  132. package/app/out/renderer/assets/index-BzFMeMPn.js +158 -0
  133. package/app/out/renderer/assets/index-C-_uCjZJ.css +2701 -0
  134. package/app/out/renderer/assets/index-C1ithNW1.js +1765 -0
  135. package/app/out/renderer/assets/index-CAJkRYkO.js +407 -0
  136. package/app/out/renderer/assets/index-CleO0-yj.js +690 -0
  137. package/app/out/renderer/assets/index-Cq4MH3sY.js +1020 -0
  138. package/app/out/renderer/assets/index-CtA0Xj22.js +705 -0
  139. package/app/out/renderer/assets/index-CvAZkqBZ.js +83 -0
  140. package/app/out/renderer/assets/index-D3UDN-5c.js +152 -0
  141. package/app/out/renderer/assets/index-D4F9R5ao.js +179 -0
  142. package/app/out/renderer/assets/index-D6RguhZ5.js +328 -0
  143. package/app/out/renderer/assets/index-DnEowqXv.js +386 -0
  144. package/app/out/renderer/assets/index-K8c8Mqdy.js +98 -0
  145. package/app/out/renderer/assets/index-Kh14gO6K.js +62 -0
  146. package/app/out/renderer/assets/index-WFd2jRnA.js +333 -0
  147. package/app/out/renderer/assets/index-WgMfkRFp.js +313 -0
  148. package/app/out/renderer/assets/index-Y4lKyF6t.js +1042 -0
  149. package/app/out/renderer/assets/index-fx307_f1.js +643 -0
  150. package/app/out/renderer/assets/infoDiagram-8eee0895-ptaVSwzq.js +511 -0
  151. package/app/out/renderer/assets/init-ZxktEp_H.js +16 -0
  152. package/app/out/renderer/assets/javascript-C3MnDRiU.js +994 -0
  153. package/app/out/renderer/assets/journeyDiagram-c64418c1-aloEGOQp.js +1184 -0
  154. package/app/out/renderer/assets/julia-Bs6JJhYG.js +407 -0
  155. package/app/out/renderer/assets/layout-ZeuHE_aY.js +2217 -0
  156. package/app/out/renderer/assets/line-CAgaGl-S.js +45 -0
  157. package/app/out/renderer/assets/linear-DIg7lTe1.js +539 -0
  158. package/app/out/renderer/assets/livescript-DmzgM3Yt.js +296 -0
  159. package/app/out/renderer/assets/lua-8cJgIlqe.js +256 -0
  160. package/app/out/renderer/assets/mathematica-DNLOL9PQ.js +110 -0
  161. package/app/out/renderer/assets/mbox-Ga7d4MMN.js +117 -0
  162. package/app/out/renderer/assets/mindmap-definition-8da855dc-B8XVoUxz.js +36054 -0
  163. package/app/out/renderer/assets/mirc-Dma3B8rS.js +107 -0
  164. package/app/out/renderer/assets/mllike-DHn7xckP.js +334 -0
  165. package/app/out/renderer/assets/modelica-0d55jYY0.js +147 -0
  166. package/app/out/renderer/assets/mscgen-DdqZYINH.js +135 -0
  167. package/app/out/renderer/assets/mumps-Btr8VblO.js +93 -0
  168. package/app/out/renderer/assets/nginx-DTDtBDVN.js +141 -0
  169. package/app/out/renderer/assets/nsis-3zG7tgur.js +62 -0
  170. package/app/out/renderer/assets/ntriples-CvgOYMpL.js +153 -0
  171. package/app/out/renderer/assets/octave-DYBj3-tl.js +200 -0
  172. package/app/out/renderer/assets/ordinal-DSZU4PqD.js +76 -0
  173. package/app/out/renderer/assets/oz-R_e8WMIi.js +231 -0
  174. package/app/out/renderer/assets/pascal-GD8iposT.js +105 -0
  175. package/app/out/renderer/assets/path-Cp2qmpkd.js +109 -0
  176. package/app/out/renderer/assets/perl-DL9mHpoi.js +1105 -0
  177. package/app/out/renderer/assets/pieDiagram-a8764435-DlwoeBU2.js +770 -0
  178. package/app/out/renderer/assets/pig-C_4T4YIV.js +101 -0
  179. package/app/out/renderer/assets/powershell-B0suO7Vd.js +328 -0
  180. package/app/out/renderer/assets/properties-BR-vP1aU.js +58 -0
  181. package/app/out/renderer/assets/protobuf-BxgpyhoW.js +77 -0
  182. package/app/out/renderer/assets/pug-By0kVCfm.js +405 -0
  183. package/app/out/renderer/assets/puppet-Bdao66PW.js +137 -0
  184. package/app/out/renderer/assets/python-CvWbmiX4.js +427 -0
  185. package/app/out/renderer/assets/q-CrbCVq4a.js +131 -0
  186. package/app/out/renderer/assets/quadrantDiagram-1e28029f-BaSi1XB4.js +1200 -0
  187. package/app/out/renderer/assets/r-V7nswm59.js +170 -0
  188. package/app/out/renderer/assets/requirementDiagram-08caed73-D3EFyegZ.js +1092 -0
  189. package/app/out/renderer/assets/rpm-C-DLY-If.js +109 -0
  190. package/app/out/renderer/assets/ruby-JDKLJNK0.js +330 -0
  191. package/app/out/renderer/assets/sankeyDiagram-a04cb91d-Cv44AsnM.js +1174 -0
  192. package/app/out/renderer/assets/sas-D2UG-yhZ.js +207 -0
  193. package/app/out/renderer/assets/scheme-BKzrkGJD.js +222 -0
  194. package/app/out/renderer/assets/sequenceDiagram-c5b8d532-CuUBu-x4.js +3337 -0
  195. package/app/out/renderer/assets/shell-BlsXDxCn.js +222 -0
  196. package/app/out/renderer/assets/sieve-CjwBwOY5.js +135 -0
  197. package/app/out/renderer/assets/simple-mode-DMneyfDu.js +130 -0
  198. package/app/out/renderer/assets/smalltalk-BOIGQuhN.js +121 -0
  199. package/app/out/renderer/assets/solr-CwD7U71z.js +69 -0
  200. package/app/out/renderer/assets/sparql-DYskk2vE.js +249 -0
  201. package/app/out/renderer/assets/spreadsheet-Bgtt3oLP.js +87 -0
  202. package/app/out/renderer/assets/sql-BSrOzCRI.js +354 -0
  203. package/app/out/renderer/assets/stateDiagram-1ecb1508-BOU34Zp4.js +454 -0
  204. package/app/out/renderer/assets/stateDiagram-v2-c2b004d7-BgRoffou.js +326 -0
  205. package/app/out/renderer/assets/stex-B6LNC55o.js +231 -0
  206. package/app/out/renderer/assets/styles-b4e223ce-BMr9TPuj.js +1483 -0
  207. package/app/out/renderer/assets/styles-ca3715f6-DgbNw99p.js +1363 -0
  208. package/app/out/renderer/assets/styles-d45a18b0-DtRYKYKf.js +574 -0
  209. package/app/out/renderer/assets/stylus-BkS-boTH.js +565 -0
  210. package/app/out/renderer/assets/svgDrawCommon-b86b1483-Bein03PD.js +100 -0
  211. package/app/out/renderer/assets/swift-FRZi1uvB.js +291 -0
  212. package/app/out/renderer/assets/tcl-CUcaCdmq.js +114 -0
  213. package/app/out/renderer/assets/textile-BnFpjsrl.js +414 -0
  214. package/app/out/renderer/assets/tiddlywiki-CjprD-Qp.js +218 -0
  215. package/app/out/renderer/assets/tiki-B4EPSQ1G.js +265 -0
  216. package/app/out/renderer/assets/timeline-definition-faaaa080-BlWpLE_4.js +1212 -0
  217. package/app/out/renderer/assets/toml-BOuWGMcf.js +76 -0
  218. package/app/out/renderer/assets/troff-E1bJ0PPL.js +61 -0
  219. package/app/out/renderer/assets/ttcn-cfg-Dc39-fIP.js +133 -0
  220. package/app/out/renderer/assets/ttcn-tKd4HLu4.js +192 -0
  221. package/app/out/renderer/assets/turtle-Dq7-1WAf.js +124 -0
  222. package/app/out/renderer/assets/vb-Dp90gtsv.js +196 -0
  223. package/app/out/renderer/assets/vbscript-CI6_mxxU.js +479 -0
  224. package/app/out/renderer/assets/velocity-BwIZK1TH.js +149 -0
  225. package/app/out/renderer/assets/verilog-DDCYnHN8.js +430 -0
  226. package/app/out/renderer/assets/vhdl-DCkMIyT9.js +158 -0
  227. package/app/out/renderer/assets/webidl-BTLTThCm.js +204 -0
  228. package/app/out/renderer/assets/xquery-BgiOC5Ce.js +525 -0
  229. package/app/out/renderer/assets/xychartDiagram-f5964ef8-Bhga-YXm.js +1799 -0
  230. package/app/out/renderer/assets/yacas-b5lAVEIl.js +130 -0
  231. package/app/out/renderer/assets/z80-BZV19vqv.js +93 -0
  232. package/app/out/renderer/index.html +13 -0
  233. package/app/out/skills/community-builtin/README.md +29 -0
  234. package/app/out/skills/community-builtin/document-docx/SKILL.md +44 -0
  235. package/app/out/skills/community-builtin/document-docx/scripts/docx-to-markdown.sh +20 -0
  236. package/app/out/skills/community-builtin/document-docx/scripts/extract-docx-text.sh +28 -0
  237. package/app/out/skills/community-builtin/document-docx/scripts/init-docx-template.sh +32 -0
  238. package/app/out/skills/community-builtin/document-docx/scripts/setup-docx-tools.sh +10 -0
  239. package/app/out/skills/community-builtin/markitdown/SKILL.md +105 -0
  240. package/app/out/skills/community-builtin/markitdown/scripts/batch-convert.sh +40 -0
  241. package/app/out/skills/community-builtin/markitdown/scripts/convert-file.sh +24 -0
  242. package/app/out/skills/community-builtin/markitdown/scripts/setup-markitdown.sh +10 -0
  243. package/app/out/skills/community-builtin/repo-quick-audit/SKILL.md +27 -0
  244. package/app/out/skills/community-builtin/repo-quick-audit/scripts/audit-basics.sh +19 -0
  245. package/app/out/skills/research-pilot-default-project-skills/README.md +23 -0
  246. package/app/out/skills/research-pilot-default-project-skills/citation-management/SKILL.md +39 -0
  247. package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/doi-to-bibtex.sh +25 -0
  248. package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/normalize-bibtex-keys.sh +51 -0
  249. package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/setup-citation-tools.sh +10 -0
  250. package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/validate-bib.sh +31 -0
  251. package/app/out/skills/research-pilot-default-project-skills/matplotlib/SKILL.md +34 -0
  252. package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/api_reference.md +412 -0
  253. package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/common_issues.md +563 -0
  254. package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/plot_types.md +476 -0
  255. package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/styling_guide.md +589 -0
  256. package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/subagent_quickstart.md +30 -0
  257. package/app/out/skills/research-pilot-default-project-skills/matplotlib/scripts/plot_template.py +401 -0
  258. package/app/out/skills/research-pilot-default-project-skills/matplotlib/scripts/style_configurator.py +409 -0
  259. package/app/out/skills/research-pilot-default-project-skills/research-grants/SKILL.md +38 -0
  260. package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/check-grant-compliance.sh +40 -0
  261. package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/grant-summary-card.sh +32 -0
  262. package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/init-grant-structure.sh +70 -0
  263. package/app/package.json +77 -0
  264. package/bin/cli.mjs +56 -0
  265. package/lib/README.md +145 -0
  266. package/lib/skills/_generated.ts +13 -0
  267. package/lib/skills/builtin/brainstorming-research-ideas/SKILL.md +280 -0
  268. package/lib/skills/builtin/coding/SKILL.md +114 -0
  269. package/lib/skills/builtin/creative-thinking-for-research/SKILL.md +273 -0
  270. package/lib/skills/builtin/matplotlib/SKILL.md +361 -0
  271. package/lib/skills/builtin/matplotlib/references/api_reference.md +412 -0
  272. package/lib/skills/builtin/matplotlib/references/common_issues.md +563 -0
  273. package/lib/skills/builtin/matplotlib/references/plot_types.md +476 -0
  274. package/lib/skills/builtin/matplotlib/references/styling_guide.md +589 -0
  275. package/lib/skills/builtin/matplotlib/scripts/plot_template.py +401 -0
  276. package/lib/skills/builtin/matplotlib/scripts/style_configurator.py +409 -0
  277. package/lib/skills/builtin/paper-writing/SKILL.md +554 -0
  278. package/lib/skills/builtin/paper-writing/references/checklists.md +524 -0
  279. package/lib/skills/builtin/paper-writing/references/citation-workflow.md +562 -0
  280. package/lib/skills/builtin/paper-writing/references/reviewer-guidelines.md +462 -0
  281. package/lib/skills/builtin/paper-writing/references/sources.md +189 -0
  282. package/lib/skills/builtin/paper-writing/references/systems-conferences.md +260 -0
  283. package/lib/skills/builtin/paper-writing/references/writing-guide.md +476 -0
  284. package/lib/skills/builtin/paper-writing/templates/README.md +408 -0
  285. package/lib/skills/builtin/paper-writing/templates/aaai2026/README.md +534 -0
  286. package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
  287. package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
  288. package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.bib +111 -0
  289. package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
  290. package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.sty +315 -0
  291. package/lib/skills/builtin/paper-writing/templates/acl/README.md +50 -0
  292. package/lib/skills/builtin/paper-writing/templates/acl/acl.sty +312 -0
  293. package/lib/skills/builtin/paper-writing/templates/acl/acl_latex.tex +377 -0
  294. package/lib/skills/builtin/paper-writing/templates/acl/acl_lualatex.tex +101 -0
  295. package/lib/skills/builtin/paper-writing/templates/acl/acl_natbib.bst +1940 -0
  296. package/lib/skills/builtin/paper-writing/templates/acl/anthology.bib.txt +26 -0
  297. package/lib/skills/builtin/paper-writing/templates/acl/custom.bib +70 -0
  298. package/lib/skills/builtin/paper-writing/templates/acl/formatting.md +326 -0
  299. package/lib/skills/builtin/paper-writing/templates/asplos2027/main.tex +459 -0
  300. package/lib/skills/builtin/paper-writing/templates/asplos2027/references.bib +135 -0
  301. package/lib/skills/builtin/paper-writing/templates/colm2025/README.md +3 -0
  302. package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
  303. package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
  304. package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
  305. package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
  306. package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
  307. package/lib/skills/builtin/paper-writing/templates/colm2025/fancyhdr.sty +485 -0
  308. package/lib/skills/builtin/paper-writing/templates/colm2025/math_commands.tex +508 -0
  309. package/lib/skills/builtin/paper-writing/templates/colm2025/natbib.sty +1246 -0
  310. package/lib/skills/builtin/paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
  311. package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
  312. package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
  313. package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
  314. package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
  315. package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
  316. package/lib/skills/builtin/paper-writing/templates/iclr2026/math_commands.tex +508 -0
  317. package/lib/skills/builtin/paper-writing/templates/iclr2026/natbib.sty +1246 -0
  318. package/lib/skills/builtin/paper-writing/templates/icml2026/algorithm.sty +79 -0
  319. package/lib/skills/builtin/paper-writing/templates/icml2026/algorithmic.sty +201 -0
  320. package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.bib +75 -0
  321. package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.pdf +0 -0
  322. package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.tex +662 -0
  323. package/lib/skills/builtin/paper-writing/templates/icml2026/fancyhdr.sty +864 -0
  324. package/lib/skills/builtin/paper-writing/templates/icml2026/icml2026.bst +1443 -0
  325. package/lib/skills/builtin/paper-writing/templates/icml2026/icml2026.sty +767 -0
  326. package/lib/skills/builtin/paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
  327. package/lib/skills/builtin/paper-writing/templates/neurips2025/Makefile +36 -0
  328. package/lib/skills/builtin/paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
  329. package/lib/skills/builtin/paper-writing/templates/neurips2025/main.tex +38 -0
  330. package/lib/skills/builtin/paper-writing/templates/neurips2025/neurips.sty +382 -0
  331. package/lib/skills/builtin/paper-writing/templates/nsdi2027/main.tex +426 -0
  332. package/lib/skills/builtin/paper-writing/templates/nsdi2027/references.bib +151 -0
  333. package/lib/skills/builtin/paper-writing/templates/nsdi2027/usenix-2020-09.sty +83 -0
  334. package/lib/skills/builtin/paper-writing/templates/osdi2026/main.tex +429 -0
  335. package/lib/skills/builtin/paper-writing/templates/osdi2026/references.bib +150 -0
  336. package/lib/skills/builtin/paper-writing/templates/osdi2026/usenix-2020-09.sty +83 -0
  337. package/lib/skills/builtin/paper-writing/templates/sosp2026/main.tex +532 -0
  338. package/lib/skills/builtin/paper-writing/templates/sosp2026/references.bib +148 -0
  339. package/lib/skills/builtin/research-grants/SKILL.md +958 -0
  340. package/lib/skills/builtin/research-grants/assets/budget_justification_template.md +453 -0
  341. package/lib/skills/builtin/research-grants/assets/nih_specific_aims_template.md +166 -0
  342. package/lib/skills/builtin/research-grants/assets/nsf_project_summary_template.md +92 -0
  343. package/lib/skills/builtin/research-grants/references/README.md +285 -0
  344. package/lib/skills/builtin/research-grants/references/broader_impacts.md +392 -0
  345. package/lib/skills/builtin/research-grants/references/darpa_guidelines.md +636 -0
  346. package/lib/skills/builtin/research-grants/references/doe_guidelines.md +586 -0
  347. package/lib/skills/builtin/research-grants/references/nih_guidelines.md +851 -0
  348. package/lib/skills/builtin/research-grants/references/nsf_guidelines.md +570 -0
  349. package/lib/skills/builtin/research-grants/references/nstc_guidelines.md +733 -0
  350. package/lib/skills/builtin/research-grants/references/specific_aims_guide.md +458 -0
  351. package/lib/skills/builtin/rewrite-humanize/SKILL.md +116 -0
  352. package/lib/skills/builtin/rewrite-humanize/references/cs-venue-tone.md +57 -0
  353. package/lib/skills/builtin/rewrite-humanize/references/lexicon.md +50 -0
  354. package/lib/skills/builtin/scholar-evaluation/SKILL.md +300 -0
  355. package/lib/skills/builtin/scholar-evaluation/references/evaluation_framework.md +663 -0
  356. package/lib/skills/builtin/scholar-evaluation/scripts/calculate_scores.py +379 -0
  357. package/lib/skills/builtin/scientific-schematics/SKILL.md +603 -0
  358. package/lib/skills/builtin/scientific-schematics/references/QUICK_REFERENCE.md +182 -0
  359. package/lib/skills/builtin/scientific-schematics/references/README.md +292 -0
  360. package/lib/skills/builtin/scientific-schematics/references/best_practices.md +560 -0
  361. package/lib/skills/builtin/scientific-schematics/scripts/__pycache__/generate_schematic.cpython-312.pyc +0 -0
  362. package/lib/skills/builtin/scientific-schematics/scripts/__pycache__/generate_schematic_ai.cpython-312.pyc +0 -0
  363. package/lib/skills/builtin/scientific-schematics/scripts/example_usage.sh +85 -0
  364. package/lib/skills/builtin/scientific-schematics/scripts/generate_schematic.py +141 -0
  365. package/lib/skills/builtin/scientific-schematics/scripts/generate_schematic_ai.py +910 -0
  366. package/lib/skills/builtin/scientific-visualization/SKILL.md +749 -0
  367. package/lib/skills/builtin/scientific-visualization/assets/color_palettes.py +197 -0
  368. package/lib/skills/builtin/scientific-visualization/assets/nature.mplstyle +63 -0
  369. package/lib/skills/builtin/scientific-visualization/assets/presentation.mplstyle +61 -0
  370. package/lib/skills/builtin/scientific-visualization/assets/publication.mplstyle +68 -0
  371. package/lib/skills/builtin/scientific-visualization/references/color_palettes.md +348 -0
  372. package/lib/skills/builtin/scientific-visualization/references/journal_requirements.md +320 -0
  373. package/lib/skills/builtin/scientific-visualization/references/matplotlib_examples.md +620 -0
  374. package/lib/skills/builtin/scientific-visualization/references/publication_guidelines.md +205 -0
  375. package/lib/skills/builtin/scientific-visualization/scripts/figure_export.py +343 -0
  376. package/lib/skills/builtin/scientific-visualization/scripts/style_presets.py +416 -0
  377. package/lib/skills/builtin/scientific-writing/SKILL.md +745 -0
  378. package/lib/skills/builtin/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
  379. package/lib/skills/builtin/scientific-writing/assets/scientific_report.sty +606 -0
  380. package/lib/skills/builtin/scientific-writing/assets/scientific_report_template.tex +449 -0
  381. package/lib/skills/builtin/scientific-writing/references/citation_styles.md +720 -0
  382. package/lib/skills/builtin/scientific-writing/references/figures_tables.md +806 -0
  383. package/lib/skills/builtin/scientific-writing/references/imrad_structure.md +686 -0
  384. package/lib/skills/builtin/scientific-writing/references/professional_report_formatting.md +664 -0
  385. package/lib/skills/builtin/scientific-writing/references/reporting_guidelines.md +748 -0
  386. package/lib/skills/builtin/scientific-writing/references/writing_principles.md +824 -0
  387. package/lib/skills/builtin/seaborn/SKILL.md +674 -0
  388. package/lib/skills/builtin/seaborn/references/examples.md +822 -0
  389. package/lib/skills/builtin/seaborn/references/function_reference.md +770 -0
  390. package/lib/skills/builtin/seaborn/references/objects_interface.md +964 -0
  391. package/lib/skills/data-analysis/SKILL.md +285 -0
  392. package/lib/skills/generate-skill-content.mjs +58 -0
  393. package/lib/skills/index.ts +34 -0
  394. package/lib/skills/loader.ts +452 -0
  395. package/package.json +62 -0
@@ -0,0 +1,1321 @@
1
+ import { H as getDiagramTitle, J as setDiagramTitle, n as getAccDescription, m as setAccDescription, o as getAccTitle, q as setAccTitle, r as getConfig, v as log$1, u as select, O as utils, w as configureSvgSize, M as clear$1, R as curveBasis, aj as parseGenericTypes } from "./MilkdownMarkdownEditor-bLPxrCVb.js";
2
+ import { G as Graph } from "./graph-DpC13d95.js";
3
+ import { l as layout } from "./layout-ZeuHE_aY.js";
4
+ import { l as line } from "./line-CAgaGl-S.js";
5
+ import "./index-BqDyyRCx.js";
6
+ import "./array-DgktLKBx.js";
7
+ import "./path-Cp2qmpkd.js";
8
+ 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;
9
+ function validate(uuid) {
10
+ return typeof uuid === "string" && REGEX.test(uuid);
11
+ }
12
+ const byteToHex = [];
13
+ for (let i = 0; i < 256; ++i) {
14
+ byteToHex.push((i + 256).toString(16).slice(1));
15
+ }
16
+ function unsafeStringify(arr, offset = 0) {
17
+ 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]];
18
+ }
19
+ function parse(uuid) {
20
+ if (!validate(uuid)) {
21
+ throw TypeError("Invalid UUID");
22
+ }
23
+ let v;
24
+ const arr = new Uint8Array(16);
25
+ arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
26
+ arr[1] = v >>> 16 & 255;
27
+ arr[2] = v >>> 8 & 255;
28
+ arr[3] = v & 255;
29
+ arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
30
+ arr[5] = v & 255;
31
+ arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
32
+ arr[7] = v & 255;
33
+ arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
34
+ arr[9] = v & 255;
35
+ arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255;
36
+ arr[11] = v / 4294967296 & 255;
37
+ arr[12] = v >>> 24 & 255;
38
+ arr[13] = v >>> 16 & 255;
39
+ arr[14] = v >>> 8 & 255;
40
+ arr[15] = v & 255;
41
+ return arr;
42
+ }
43
+ function stringToBytes(str) {
44
+ str = unescape(encodeURIComponent(str));
45
+ const bytes = [];
46
+ for (let i = 0; i < str.length; ++i) {
47
+ bytes.push(str.charCodeAt(i));
48
+ }
49
+ return bytes;
50
+ }
51
+ const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
52
+ const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
53
+ function v35(name, version, hashfunc) {
54
+ function generateUUID(value, namespace, buf, offset) {
55
+ var _namespace;
56
+ if (typeof value === "string") {
57
+ value = stringToBytes(value);
58
+ }
59
+ if (typeof namespace === "string") {
60
+ namespace = parse(namespace);
61
+ }
62
+ if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
63
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
64
+ }
65
+ let bytes = new Uint8Array(16 + value.length);
66
+ bytes.set(namespace);
67
+ bytes.set(value, namespace.length);
68
+ bytes = hashfunc(bytes);
69
+ bytes[6] = bytes[6] & 15 | version;
70
+ bytes[8] = bytes[8] & 63 | 128;
71
+ if (buf) {
72
+ offset = offset || 0;
73
+ for (let i = 0; i < 16; ++i) {
74
+ buf[offset + i] = bytes[i];
75
+ }
76
+ return buf;
77
+ }
78
+ return unsafeStringify(bytes);
79
+ }
80
+ try {
81
+ generateUUID.name = name;
82
+ } catch (err) {
83
+ }
84
+ generateUUID.DNS = DNS;
85
+ generateUUID.URL = URL;
86
+ return generateUUID;
87
+ }
88
+ function f(s, x, y, z) {
89
+ switch (s) {
90
+ case 0:
91
+ return x & y ^ ~x & z;
92
+ case 1:
93
+ return x ^ y ^ z;
94
+ case 2:
95
+ return x & y ^ x & z ^ y & z;
96
+ case 3:
97
+ return x ^ y ^ z;
98
+ }
99
+ }
100
+ function ROTL(x, n) {
101
+ return x << n | x >>> 32 - n;
102
+ }
103
+ function sha1(bytes) {
104
+ const K = [1518500249, 1859775393, 2400959708, 3395469782];
105
+ const H = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
106
+ if (typeof bytes === "string") {
107
+ const msg = unescape(encodeURIComponent(bytes));
108
+ bytes = [];
109
+ for (let i = 0; i < msg.length; ++i) {
110
+ bytes.push(msg.charCodeAt(i));
111
+ }
112
+ } else if (!Array.isArray(bytes)) {
113
+ bytes = Array.prototype.slice.call(bytes);
114
+ }
115
+ bytes.push(128);
116
+ const l = bytes.length / 4 + 2;
117
+ const N = Math.ceil(l / 16);
118
+ const M = new Array(N);
119
+ for (let i = 0; i < N; ++i) {
120
+ const arr = new Uint32Array(16);
121
+ for (let j = 0; j < 16; ++j) {
122
+ 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];
123
+ }
124
+ M[i] = arr;
125
+ }
126
+ M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
127
+ M[N - 1][14] = Math.floor(M[N - 1][14]);
128
+ M[N - 1][15] = (bytes.length - 1) * 8 & 4294967295;
129
+ for (let i = 0; i < N; ++i) {
130
+ const W = new Uint32Array(80);
131
+ for (let t = 0; t < 16; ++t) {
132
+ W[t] = M[i][t];
133
+ }
134
+ for (let t = 16; t < 80; ++t) {
135
+ W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
136
+ }
137
+ let a = H[0];
138
+ let b = H[1];
139
+ let c = H[2];
140
+ let d = H[3];
141
+ let e = H[4];
142
+ for (let t = 0; t < 80; ++t) {
143
+ const s = Math.floor(t / 20);
144
+ const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
145
+ e = d;
146
+ d = c;
147
+ c = ROTL(b, 30) >>> 0;
148
+ b = a;
149
+ a = T;
150
+ }
151
+ H[0] = H[0] + a >>> 0;
152
+ H[1] = H[1] + b >>> 0;
153
+ H[2] = H[2] + c >>> 0;
154
+ H[3] = H[3] + d >>> 0;
155
+ H[4] = H[4] + e >>> 0;
156
+ }
157
+ 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];
158
+ }
159
+ const v5 = v35("v5", 80, sha1);
160
+ var parser = function() {
161
+ var o = function(k, v, o2, l) {
162
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
163
+ ;
164
+ return o2;
165
+ }, $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];
166
+ var parser2 = {
167
+ trace: function trace() {
168
+ },
169
+ yy: {},
170
+ 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 },
171
+ 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" },
172
+ 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]],
173
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
174
+ var $0 = $$.length - 1;
175
+ switch (yystate) {
176
+ case 1:
177
+ break;
178
+ case 2:
179
+ this.$ = [];
180
+ break;
181
+ case 3:
182
+ $$[$0 - 1].push($$[$0]);
183
+ this.$ = $$[$0 - 1];
184
+ break;
185
+ case 4:
186
+ case 5:
187
+ this.$ = $$[$0];
188
+ break;
189
+ case 6:
190
+ case 7:
191
+ this.$ = [];
192
+ break;
193
+ case 8:
194
+ yy.addEntity($$[$0 - 4]);
195
+ yy.addEntity($$[$0 - 2]);
196
+ yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);
197
+ break;
198
+ case 9:
199
+ yy.addEntity($$[$0 - 3]);
200
+ yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
201
+ break;
202
+ case 10:
203
+ yy.addEntity($$[$0 - 2]);
204
+ break;
205
+ case 11:
206
+ yy.addEntity($$[$0]);
207
+ break;
208
+ case 12:
209
+ yy.addEntity($$[$0 - 6], $$[$0 - 4]);
210
+ yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
211
+ break;
212
+ case 13:
213
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
214
+ break;
215
+ case 14:
216
+ yy.addEntity($$[$0 - 3], $$[$0 - 1]);
217
+ break;
218
+ case 15:
219
+ case 16:
220
+ this.$ = $$[$0].trim();
221
+ yy.setAccTitle(this.$);
222
+ break;
223
+ case 17:
224
+ case 18:
225
+ this.$ = $$[$0].trim();
226
+ yy.setAccDescription(this.$);
227
+ break;
228
+ case 19:
229
+ case 43:
230
+ this.$ = $$[$0];
231
+ break;
232
+ case 20:
233
+ case 41:
234
+ case 42:
235
+ this.$ = $$[$0].replace(/"/g, "");
236
+ break;
237
+ case 21:
238
+ case 29:
239
+ this.$ = [$$[$0]];
240
+ break;
241
+ case 22:
242
+ $$[$0].push($$[$0 - 1]);
243
+ this.$ = $$[$0];
244
+ break;
245
+ case 23:
246
+ this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] };
247
+ break;
248
+ case 24:
249
+ this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] };
250
+ break;
251
+ case 25:
252
+ this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] };
253
+ break;
254
+ case 26:
255
+ this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] };
256
+ break;
257
+ case 27:
258
+ case 28:
259
+ case 31:
260
+ this.$ = $$[$0];
261
+ break;
262
+ case 30:
263
+ $$[$0 - 2].push($$[$0]);
264
+ this.$ = $$[$0 - 2];
265
+ break;
266
+ case 32:
267
+ this.$ = $$[$0].replace(/"/g, "");
268
+ break;
269
+ case 33:
270
+ this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] };
271
+ break;
272
+ case 34:
273
+ this.$ = yy.Cardinality.ZERO_OR_ONE;
274
+ break;
275
+ case 35:
276
+ this.$ = yy.Cardinality.ZERO_OR_MORE;
277
+ break;
278
+ case 36:
279
+ this.$ = yy.Cardinality.ONE_OR_MORE;
280
+ break;
281
+ case 37:
282
+ this.$ = yy.Cardinality.ONLY_ONE;
283
+ break;
284
+ case 38:
285
+ this.$ = yy.Cardinality.MD_PARENT;
286
+ break;
287
+ case 39:
288
+ this.$ = yy.Identification.NON_IDENTIFYING;
289
+ break;
290
+ case 40:
291
+ this.$ = yy.Identification.IDENTIFYING;
292
+ break;
293
+ }
294
+ },
295
+ 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])],
296
+ defaultActions: { 34: [2, 27], 41: [2, 22] },
297
+ parseError: function parseError(str, hash) {
298
+ if (hash.recoverable) {
299
+ this.trace(str);
300
+ } else {
301
+ var error = new Error(str);
302
+ error.hash = hash;
303
+ throw error;
304
+ }
305
+ },
306
+ parse: function parse2(input) {
307
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
308
+ var args = lstack.slice.call(arguments, 1);
309
+ var lexer2 = Object.create(this.lexer);
310
+ var sharedState = { yy: {} };
311
+ for (var k in this.yy) {
312
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
313
+ sharedState.yy[k] = this.yy[k];
314
+ }
315
+ }
316
+ lexer2.setInput(input, sharedState.yy);
317
+ sharedState.yy.lexer = lexer2;
318
+ sharedState.yy.parser = this;
319
+ if (typeof lexer2.yylloc == "undefined") {
320
+ lexer2.yylloc = {};
321
+ }
322
+ var yyloc = lexer2.yylloc;
323
+ lstack.push(yyloc);
324
+ var ranges = lexer2.options && lexer2.options.ranges;
325
+ if (typeof sharedState.yy.parseError === "function") {
326
+ this.parseError = sharedState.yy.parseError;
327
+ } else {
328
+ this.parseError = Object.getPrototypeOf(this).parseError;
329
+ }
330
+ function lex() {
331
+ var token;
332
+ token = tstack.pop() || lexer2.lex() || EOF;
333
+ if (typeof token !== "number") {
334
+ if (token instanceof Array) {
335
+ tstack = token;
336
+ token = tstack.pop();
337
+ }
338
+ token = self.symbols_[token] || token;
339
+ }
340
+ return token;
341
+ }
342
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
343
+ while (true) {
344
+ state = stack[stack.length - 1];
345
+ if (this.defaultActions[state]) {
346
+ action = this.defaultActions[state];
347
+ } else {
348
+ if (symbol === null || typeof symbol == "undefined") {
349
+ symbol = lex();
350
+ }
351
+ action = table[state] && table[state][symbol];
352
+ }
353
+ if (typeof action === "undefined" || !action.length || !action[0]) {
354
+ var errStr = "";
355
+ expected = [];
356
+ for (p in table[state]) {
357
+ if (this.terminals_[p] && p > TERROR) {
358
+ expected.push("'" + this.terminals_[p] + "'");
359
+ }
360
+ }
361
+ if (lexer2.showPosition) {
362
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
363
+ } else {
364
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
365
+ }
366
+ this.parseError(errStr, {
367
+ text: lexer2.match,
368
+ token: this.terminals_[symbol] || symbol,
369
+ line: lexer2.yylineno,
370
+ loc: yyloc,
371
+ expected
372
+ });
373
+ }
374
+ if (action[0] instanceof Array && action.length > 1) {
375
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
376
+ }
377
+ switch (action[0]) {
378
+ case 1:
379
+ stack.push(symbol);
380
+ vstack.push(lexer2.yytext);
381
+ lstack.push(lexer2.yylloc);
382
+ stack.push(action[1]);
383
+ symbol = null;
384
+ {
385
+ yyleng = lexer2.yyleng;
386
+ yytext = lexer2.yytext;
387
+ yylineno = lexer2.yylineno;
388
+ yyloc = lexer2.yylloc;
389
+ }
390
+ break;
391
+ case 2:
392
+ len = this.productions_[action[1]][1];
393
+ yyval.$ = vstack[vstack.length - len];
394
+ yyval._$ = {
395
+ first_line: lstack[lstack.length - (len || 1)].first_line,
396
+ last_line: lstack[lstack.length - 1].last_line,
397
+ first_column: lstack[lstack.length - (len || 1)].first_column,
398
+ last_column: lstack[lstack.length - 1].last_column
399
+ };
400
+ if (ranges) {
401
+ yyval._$.range = [
402
+ lstack[lstack.length - (len || 1)].range[0],
403
+ lstack[lstack.length - 1].range[1]
404
+ ];
405
+ }
406
+ r = this.performAction.apply(yyval, [
407
+ yytext,
408
+ yyleng,
409
+ yylineno,
410
+ sharedState.yy,
411
+ action[1],
412
+ vstack,
413
+ lstack
414
+ ].concat(args));
415
+ if (typeof r !== "undefined") {
416
+ return r;
417
+ }
418
+ if (len) {
419
+ stack = stack.slice(0, -1 * len * 2);
420
+ vstack = vstack.slice(0, -1 * len);
421
+ lstack = lstack.slice(0, -1 * len);
422
+ }
423
+ stack.push(this.productions_[action[1]][0]);
424
+ vstack.push(yyval.$);
425
+ lstack.push(yyval._$);
426
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
427
+ stack.push(newState);
428
+ break;
429
+ case 3:
430
+ return true;
431
+ }
432
+ }
433
+ return true;
434
+ }
435
+ };
436
+ var lexer = /* @__PURE__ */ function() {
437
+ var lexer2 = {
438
+ EOF: 1,
439
+ parseError: function parseError(str, hash) {
440
+ if (this.yy.parser) {
441
+ this.yy.parser.parseError(str, hash);
442
+ } else {
443
+ throw new Error(str);
444
+ }
445
+ },
446
+ // resets the lexer, sets new input
447
+ setInput: function(input, yy) {
448
+ this.yy = yy || this.yy || {};
449
+ this._input = input;
450
+ this._more = this._backtrack = this.done = false;
451
+ this.yylineno = this.yyleng = 0;
452
+ this.yytext = this.matched = this.match = "";
453
+ this.conditionStack = ["INITIAL"];
454
+ this.yylloc = {
455
+ first_line: 1,
456
+ first_column: 0,
457
+ last_line: 1,
458
+ last_column: 0
459
+ };
460
+ if (this.options.ranges) {
461
+ this.yylloc.range = [0, 0];
462
+ }
463
+ this.offset = 0;
464
+ return this;
465
+ },
466
+ // consumes and returns one char from the input
467
+ input: function() {
468
+ var ch = this._input[0];
469
+ this.yytext += ch;
470
+ this.yyleng++;
471
+ this.offset++;
472
+ this.match += ch;
473
+ this.matched += ch;
474
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
475
+ if (lines) {
476
+ this.yylineno++;
477
+ this.yylloc.last_line++;
478
+ } else {
479
+ this.yylloc.last_column++;
480
+ }
481
+ if (this.options.ranges) {
482
+ this.yylloc.range[1]++;
483
+ }
484
+ this._input = this._input.slice(1);
485
+ return ch;
486
+ },
487
+ // unshifts one char (or a string) into the input
488
+ unput: function(ch) {
489
+ var len = ch.length;
490
+ var lines = ch.split(/(?:\r\n?|\n)/g);
491
+ this._input = ch + this._input;
492
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
493
+ this.offset -= len;
494
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
495
+ this.match = this.match.substr(0, this.match.length - 1);
496
+ this.matched = this.matched.substr(0, this.matched.length - 1);
497
+ if (lines.length - 1) {
498
+ this.yylineno -= lines.length - 1;
499
+ }
500
+ var r = this.yylloc.range;
501
+ this.yylloc = {
502
+ first_line: this.yylloc.first_line,
503
+ last_line: this.yylineno + 1,
504
+ first_column: this.yylloc.first_column,
505
+ 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
506
+ };
507
+ if (this.options.ranges) {
508
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
509
+ }
510
+ this.yyleng = this.yytext.length;
511
+ return this;
512
+ },
513
+ // When called from action, caches matched text and appends it on next action
514
+ more: function() {
515
+ this._more = true;
516
+ return this;
517
+ },
518
+ // 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.
519
+ reject: function() {
520
+ if (this.options.backtrack_lexer) {
521
+ this._backtrack = true;
522
+ } else {
523
+ 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(), {
524
+ text: "",
525
+ token: null,
526
+ line: this.yylineno
527
+ });
528
+ }
529
+ return this;
530
+ },
531
+ // retain first n characters of the match
532
+ less: function(n) {
533
+ this.unput(this.match.slice(n));
534
+ },
535
+ // displays already matched input, i.e. for error messages
536
+ pastInput: function() {
537
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
538
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
539
+ },
540
+ // displays upcoming input, i.e. for error messages
541
+ upcomingInput: function() {
542
+ var next = this.match;
543
+ if (next.length < 20) {
544
+ next += this._input.substr(0, 20 - next.length);
545
+ }
546
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
547
+ },
548
+ // displays the character position where the lexing error occurred, i.e. for error messages
549
+ showPosition: function() {
550
+ var pre = this.pastInput();
551
+ var c = new Array(pre.length + 1).join("-");
552
+ return pre + this.upcomingInput() + "\n" + c + "^";
553
+ },
554
+ // test the lexed token: return FALSE when not a match, otherwise return token
555
+ test_match: function(match, indexed_rule) {
556
+ var token, lines, backup;
557
+ if (this.options.backtrack_lexer) {
558
+ backup = {
559
+ yylineno: this.yylineno,
560
+ yylloc: {
561
+ first_line: this.yylloc.first_line,
562
+ last_line: this.last_line,
563
+ first_column: this.yylloc.first_column,
564
+ last_column: this.yylloc.last_column
565
+ },
566
+ yytext: this.yytext,
567
+ match: this.match,
568
+ matches: this.matches,
569
+ matched: this.matched,
570
+ yyleng: this.yyleng,
571
+ offset: this.offset,
572
+ _more: this._more,
573
+ _input: this._input,
574
+ yy: this.yy,
575
+ conditionStack: this.conditionStack.slice(0),
576
+ done: this.done
577
+ };
578
+ if (this.options.ranges) {
579
+ backup.yylloc.range = this.yylloc.range.slice(0);
580
+ }
581
+ }
582
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
583
+ if (lines) {
584
+ this.yylineno += lines.length;
585
+ }
586
+ this.yylloc = {
587
+ first_line: this.yylloc.last_line,
588
+ last_line: this.yylineno + 1,
589
+ first_column: this.yylloc.last_column,
590
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
591
+ };
592
+ this.yytext += match[0];
593
+ this.match += match[0];
594
+ this.matches = match;
595
+ this.yyleng = this.yytext.length;
596
+ if (this.options.ranges) {
597
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
598
+ }
599
+ this._more = false;
600
+ this._backtrack = false;
601
+ this._input = this._input.slice(match[0].length);
602
+ this.matched += match[0];
603
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
604
+ if (this.done && this._input) {
605
+ this.done = false;
606
+ }
607
+ if (token) {
608
+ return token;
609
+ } else if (this._backtrack) {
610
+ for (var k in backup) {
611
+ this[k] = backup[k];
612
+ }
613
+ return false;
614
+ }
615
+ return false;
616
+ },
617
+ // return next match in input
618
+ next: function() {
619
+ if (this.done) {
620
+ return this.EOF;
621
+ }
622
+ if (!this._input) {
623
+ this.done = true;
624
+ }
625
+ var token, match, tempMatch, index;
626
+ if (!this._more) {
627
+ this.yytext = "";
628
+ this.match = "";
629
+ }
630
+ var rules = this._currentRules();
631
+ for (var i = 0; i < rules.length; i++) {
632
+ tempMatch = this._input.match(this.rules[rules[i]]);
633
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
634
+ match = tempMatch;
635
+ index = i;
636
+ if (this.options.backtrack_lexer) {
637
+ token = this.test_match(tempMatch, rules[i]);
638
+ if (token !== false) {
639
+ return token;
640
+ } else if (this._backtrack) {
641
+ match = false;
642
+ continue;
643
+ } else {
644
+ return false;
645
+ }
646
+ } else if (!this.options.flex) {
647
+ break;
648
+ }
649
+ }
650
+ }
651
+ if (match) {
652
+ token = this.test_match(match, rules[index]);
653
+ if (token !== false) {
654
+ return token;
655
+ }
656
+ return false;
657
+ }
658
+ if (this._input === "") {
659
+ return this.EOF;
660
+ } else {
661
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
662
+ text: "",
663
+ token: null,
664
+ line: this.yylineno
665
+ });
666
+ }
667
+ },
668
+ // return next match that has a token
669
+ lex: function lex() {
670
+ var r = this.next();
671
+ if (r) {
672
+ return r;
673
+ } else {
674
+ return this.lex();
675
+ }
676
+ },
677
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
678
+ begin: function begin(condition) {
679
+ this.conditionStack.push(condition);
680
+ },
681
+ // pop the previously active lexer condition state off the condition stack
682
+ popState: function popState() {
683
+ var n = this.conditionStack.length - 1;
684
+ if (n > 0) {
685
+ return this.conditionStack.pop();
686
+ } else {
687
+ return this.conditionStack[0];
688
+ }
689
+ },
690
+ // produce the lexer rule set which is active for the currently active lexer condition state
691
+ _currentRules: function _currentRules() {
692
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
693
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
694
+ } else {
695
+ return this.conditions["INITIAL"].rules;
696
+ }
697
+ },
698
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
699
+ topState: function topState(n) {
700
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
701
+ if (n >= 0) {
702
+ return this.conditionStack[n];
703
+ } else {
704
+ return "INITIAL";
705
+ }
706
+ },
707
+ // alias for begin(condition)
708
+ pushState: function pushState(condition) {
709
+ this.begin(condition);
710
+ },
711
+ // return the number of states currently on the stack
712
+ stateStackSize: function stateStackSize() {
713
+ return this.conditionStack.length;
714
+ },
715
+ options: { "case-insensitive": true },
716
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
717
+ switch ($avoiding_name_collisions) {
718
+ case 0:
719
+ this.begin("acc_title");
720
+ return 22;
721
+ case 1:
722
+ this.popState();
723
+ return "acc_title_value";
724
+ case 2:
725
+ this.begin("acc_descr");
726
+ return 24;
727
+ case 3:
728
+ this.popState();
729
+ return "acc_descr_value";
730
+ case 4:
731
+ this.begin("acc_descr_multiline");
732
+ break;
733
+ case 5:
734
+ this.popState();
735
+ break;
736
+ case 6:
737
+ return "acc_descr_multiline_value";
738
+ case 7:
739
+ return 10;
740
+ case 8:
741
+ break;
742
+ case 9:
743
+ return 8;
744
+ case 10:
745
+ return 28;
746
+ case 11:
747
+ return 48;
748
+ case 12:
749
+ return 4;
750
+ case 13:
751
+ this.begin("block");
752
+ return 15;
753
+ case 14:
754
+ return 36;
755
+ case 15:
756
+ break;
757
+ case 16:
758
+ return 37;
759
+ case 17:
760
+ return 34;
761
+ case 18:
762
+ return 34;
763
+ case 19:
764
+ return 38;
765
+ case 20:
766
+ break;
767
+ case 21:
768
+ this.popState();
769
+ return 17;
770
+ case 22:
771
+ return yy_.yytext[0];
772
+ case 23:
773
+ return 18;
774
+ case 24:
775
+ return 19;
776
+ case 25:
777
+ return 41;
778
+ case 26:
779
+ return 43;
780
+ case 27:
781
+ return 43;
782
+ case 28:
783
+ return 43;
784
+ case 29:
785
+ return 41;
786
+ case 30:
787
+ return 41;
788
+ case 31:
789
+ return 42;
790
+ case 32:
791
+ return 42;
792
+ case 33:
793
+ return 42;
794
+ case 34:
795
+ return 42;
796
+ case 35:
797
+ return 42;
798
+ case 36:
799
+ return 43;
800
+ case 37:
801
+ return 42;
802
+ case 38:
803
+ return 43;
804
+ case 39:
805
+ return 44;
806
+ case 40:
807
+ return 44;
808
+ case 41:
809
+ return 44;
810
+ case 42:
811
+ return 44;
812
+ case 43:
813
+ return 41;
814
+ case 44:
815
+ return 42;
816
+ case 45:
817
+ return 43;
818
+ case 46:
819
+ return 45;
820
+ case 47:
821
+ return 46;
822
+ case 48:
823
+ return 47;
824
+ case 49:
825
+ return 47;
826
+ case 50:
827
+ return 46;
828
+ case 51:
829
+ return 46;
830
+ case 52:
831
+ return 46;
832
+ case 53:
833
+ return 27;
834
+ case 54:
835
+ return yy_.yytext[0];
836
+ case 55:
837
+ return 6;
838
+ }
839
+ },
840
+ 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],
841
+ 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 } }
842
+ };
843
+ return lexer2;
844
+ }();
845
+ parser2.lexer = lexer;
846
+ function Parser() {
847
+ this.yy = {};
848
+ }
849
+ Parser.prototype = parser2;
850
+ parser2.Parser = Parser;
851
+ return new Parser();
852
+ }();
853
+ parser.parser = parser;
854
+ const erParser = parser;
855
+ let entities = {};
856
+ let relationships = [];
857
+ const Cardinality = {
858
+ ZERO_OR_ONE: "ZERO_OR_ONE",
859
+ ZERO_OR_MORE: "ZERO_OR_MORE",
860
+ ONE_OR_MORE: "ONE_OR_MORE",
861
+ ONLY_ONE: "ONLY_ONE",
862
+ MD_PARENT: "MD_PARENT"
863
+ };
864
+ const Identification = {
865
+ NON_IDENTIFYING: "NON_IDENTIFYING",
866
+ IDENTIFYING: "IDENTIFYING"
867
+ };
868
+ const addEntity = function(name, alias = void 0) {
869
+ if (entities[name] === void 0) {
870
+ entities[name] = { attributes: [], alias };
871
+ log$1.info("Added new entity :", name);
872
+ } else if (entities[name] && !entities[name].alias && alias) {
873
+ entities[name].alias = alias;
874
+ log$1.info(`Add alias '${alias}' to entity '${name}'`);
875
+ }
876
+ return entities[name];
877
+ };
878
+ const getEntities = () => entities;
879
+ const addAttributes = function(entityName, attribs) {
880
+ let entity = addEntity(entityName);
881
+ let i;
882
+ for (i = attribs.length - 1; i >= 0; i--) {
883
+ entity.attributes.push(attribs[i]);
884
+ log$1.debug("Added attribute ", attribs[i].attributeName);
885
+ }
886
+ };
887
+ const addRelationship = function(entA, rolA, entB, rSpec) {
888
+ let rel = {
889
+ entityA: entA,
890
+ roleA: rolA,
891
+ entityB: entB,
892
+ relSpec: rSpec
893
+ };
894
+ relationships.push(rel);
895
+ log$1.debug("Added new relationship :", rel);
896
+ };
897
+ const getRelationships = () => relationships;
898
+ const clear = function() {
899
+ entities = {};
900
+ relationships = [];
901
+ clear$1();
902
+ };
903
+ const erDb = {
904
+ Cardinality,
905
+ Identification,
906
+ getConfig: () => getConfig().er,
907
+ addEntity,
908
+ addAttributes,
909
+ getEntities,
910
+ addRelationship,
911
+ getRelationships,
912
+ clear,
913
+ setAccTitle,
914
+ getAccTitle,
915
+ setAccDescription,
916
+ getAccDescription,
917
+ setDiagramTitle,
918
+ getDiagramTitle
919
+ };
920
+ const ERMarkers = {
921
+ ONLY_ONE_START: "ONLY_ONE_START",
922
+ ONLY_ONE_END: "ONLY_ONE_END",
923
+ ZERO_OR_ONE_START: "ZERO_OR_ONE_START",
924
+ ZERO_OR_ONE_END: "ZERO_OR_ONE_END",
925
+ ONE_OR_MORE_START: "ONE_OR_MORE_START",
926
+ ONE_OR_MORE_END: "ONE_OR_MORE_END",
927
+ ZERO_OR_MORE_START: "ZERO_OR_MORE_START",
928
+ ZERO_OR_MORE_END: "ZERO_OR_MORE_END",
929
+ MD_PARENT_END: "MD_PARENT_END",
930
+ MD_PARENT_START: "MD_PARENT_START"
931
+ };
932
+ const insertMarkers = function(elem, conf2) {
933
+ let marker;
934
+ 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");
935
+ 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");
936
+ 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");
937
+ 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");
938
+ 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");
939
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
940
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18");
941
+ 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");
942
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
943
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,0 L21,18");
944
+ 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");
945
+ 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");
946
+ 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");
947
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
948
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
949
+ 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");
950
+ marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
951
+ marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
952
+ return;
953
+ };
954
+ const erMarkers = {
955
+ ERMarkers,
956
+ insertMarkers
957
+ };
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$1.info("Drawing ER diagram");
1213
+ const securityLevel = getConfig().securityLevel;
1214
+ let sandboxElement;
1215
+ if (securityLevel === "sandbox") {
1216
+ sandboxElement = select("#i" + id);
1217
+ }
1218
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("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)}${v5(
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
+ };