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,1791 @@
1
+ import { H as getDiagramTitle, J as setDiagramTitle, m as setAccDescription, n as getAccDescription, o as getAccTitle, q as setAccTitle, r as getConfig, v as log$1, u as select, O as utils, X as setupGraphViewbox, M as clear$2, C as common$1, Y as random } from "./MilkdownMarkdownEditor-bLPxrCVb.js";
2
+ import "./index-BqDyyRCx.js";
3
+ var parser = function() {
4
+ var o = function(k, v, o2, l) {
5
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
6
+ ;
7
+ return o2;
8
+ }, $V0 = [1, 3], $V1 = [1, 6], $V2 = [1, 4], $V3 = [1, 5], $V4 = [2, 5], $V5 = [1, 12], $V6 = [5, 7, 13, 19, 21, 23, 24, 26, 28, 31, 37, 40, 47], $V7 = [7, 13, 19, 21, 23, 24, 26, 28, 31, 37, 40], $V8 = [7, 12, 13, 19, 21, 23, 24, 26, 28, 31, 37, 40], $V9 = [7, 13, 47], $Va = [1, 42], $Vb = [1, 41], $Vc = [7, 13, 29, 32, 35, 38, 47], $Vd = [1, 55], $Ve = [1, 56], $Vf = [1, 57], $Vg = [7, 13, 32, 35, 42, 47];
9
+ var parser2 = {
10
+ trace: function trace() {
11
+ },
12
+ yy: {},
13
+ symbols_: { "error": 2, "start": 3, "eol": 4, "GG": 5, "document": 6, "EOF": 7, ":": 8, "DIR": 9, "options": 10, "body": 11, "OPT": 12, "NL": 13, "line": 14, "statement": 15, "commitStatement": 16, "mergeStatement": 17, "cherryPickStatement": 18, "acc_title": 19, "acc_title_value": 20, "acc_descr": 21, "acc_descr_value": 22, "acc_descr_multiline_value": 23, "section": 24, "branchStatement": 25, "CHECKOUT": 26, "ref": 27, "BRANCH": 28, "ORDER": 29, "NUM": 30, "CHERRY_PICK": 31, "COMMIT_ID": 32, "STR": 33, "PARENT_COMMIT": 34, "COMMIT_TAG": 35, "EMPTYSTR": 36, "MERGE": 37, "COMMIT_TYPE": 38, "commitType": 39, "COMMIT": 40, "commit_arg": 41, "COMMIT_MSG": 42, "NORMAL": 43, "REVERSE": 44, "HIGHLIGHT": 45, "ID": 46, ";": 47, "$accept": 0, "$end": 1 },
14
+ terminals_: { 2: "error", 5: "GG", 7: "EOF", 8: ":", 9: "DIR", 12: "OPT", 13: "NL", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "section", 26: "CHECKOUT", 28: "BRANCH", 29: "ORDER", 30: "NUM", 31: "CHERRY_PICK", 32: "COMMIT_ID", 33: "STR", 34: "PARENT_COMMIT", 35: "COMMIT_TAG", 36: "EMPTYSTR", 37: "MERGE", 38: "COMMIT_TYPE", 40: "COMMIT", 42: "COMMIT_MSG", 43: "NORMAL", 44: "REVERSE", 45: "HIGHLIGHT", 46: "ID", 47: ";" },
15
+ productions_: [0, [3, 2], [3, 3], [3, 4], [3, 5], [6, 0], [6, 2], [10, 2], [10, 1], [11, 0], [11, 2], [14, 2], [14, 1], [15, 1], [15, 1], [15, 1], [15, 2], [15, 2], [15, 1], [15, 1], [15, 1], [15, 2], [25, 2], [25, 4], [18, 3], [18, 5], [18, 5], [18, 7], [18, 7], [18, 5], [18, 5], [18, 5], [18, 7], [18, 7], [18, 7], [18, 7], [17, 2], [17, 4], [17, 4], [17, 4], [17, 6], [17, 6], [17, 6], [17, 6], [17, 6], [17, 6], [17, 8], [17, 8], [17, 8], [17, 8], [17, 8], [17, 8], [16, 2], [16, 3], [16, 3], [16, 5], [16, 5], [16, 3], [16, 5], [16, 5], [16, 5], [16, 5], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 3], [16, 5], [16, 5], [16, 5], [16, 5], [16, 5], [16, 5], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [41, 0], [41, 1], [39, 1], [39, 1], [39, 1], [27, 1], [27, 1], [4, 1], [4, 1], [4, 1]],
16
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
17
+ var $0 = $$.length - 1;
18
+ switch (yystate) {
19
+ case 2:
20
+ return $$[$0];
21
+ case 3:
22
+ return $$[$0 - 1];
23
+ case 4:
24
+ yy.setDirection($$[$0 - 3]);
25
+ return $$[$0 - 1];
26
+ case 6:
27
+ yy.setOptions($$[$0 - 1]);
28
+ this.$ = $$[$0];
29
+ break;
30
+ case 7:
31
+ $$[$0 - 1] += $$[$0];
32
+ this.$ = $$[$0 - 1];
33
+ break;
34
+ case 9:
35
+ this.$ = [];
36
+ break;
37
+ case 10:
38
+ $$[$0 - 1].push($$[$0]);
39
+ this.$ = $$[$0 - 1];
40
+ break;
41
+ case 11:
42
+ this.$ = $$[$0 - 1];
43
+ break;
44
+ case 16:
45
+ this.$ = $$[$0].trim();
46
+ yy.setAccTitle(this.$);
47
+ break;
48
+ case 17:
49
+ case 18:
50
+ this.$ = $$[$0].trim();
51
+ yy.setAccDescription(this.$);
52
+ break;
53
+ case 19:
54
+ yy.addSection($$[$0].substr(8));
55
+ this.$ = $$[$0].substr(8);
56
+ break;
57
+ case 21:
58
+ yy.checkout($$[$0]);
59
+ break;
60
+ case 22:
61
+ yy.branch($$[$0]);
62
+ break;
63
+ case 23:
64
+ yy.branch($$[$0 - 2], $$[$0]);
65
+ break;
66
+ case 24:
67
+ yy.cherryPick($$[$0], "", void 0);
68
+ break;
69
+ case 25:
70
+ yy.cherryPick($$[$0 - 2], "", void 0, $$[$0]);
71
+ break;
72
+ case 26:
73
+ yy.cherryPick($$[$0 - 2], "", $$[$0]);
74
+ break;
75
+ case 27:
76
+ yy.cherryPick($$[$0 - 4], "", $$[$0], $$[$0 - 2]);
77
+ break;
78
+ case 28:
79
+ yy.cherryPick($$[$0 - 4], "", $$[$0 - 2], $$[$0]);
80
+ break;
81
+ case 29:
82
+ yy.cherryPick($$[$0], "", $$[$0 - 2]);
83
+ break;
84
+ case 30:
85
+ yy.cherryPick($$[$0], "", "");
86
+ break;
87
+ case 31:
88
+ yy.cherryPick($$[$0 - 2], "", "");
89
+ break;
90
+ case 32:
91
+ yy.cherryPick($$[$0 - 4], "", "", $$[$0 - 2]);
92
+ break;
93
+ case 33:
94
+ yy.cherryPick($$[$0 - 4], "", "", $$[$0]);
95
+ break;
96
+ case 34:
97
+ yy.cherryPick($$[$0 - 2], "", $$[$0 - 4], $$[$0]);
98
+ break;
99
+ case 35:
100
+ yy.cherryPick($$[$0 - 2], "", "", $$[$0]);
101
+ break;
102
+ case 36:
103
+ yy.merge($$[$0], "", "", "");
104
+ break;
105
+ case 37:
106
+ yy.merge($$[$0 - 2], $$[$0], "", "");
107
+ break;
108
+ case 38:
109
+ yy.merge($$[$0 - 2], "", $$[$0], "");
110
+ break;
111
+ case 39:
112
+ yy.merge($$[$0 - 2], "", "", $$[$0]);
113
+ break;
114
+ case 40:
115
+ yy.merge($$[$0 - 4], $$[$0], "", $$[$0 - 2]);
116
+ break;
117
+ case 41:
118
+ yy.merge($$[$0 - 4], "", $$[$0], $$[$0 - 2]);
119
+ break;
120
+ case 42:
121
+ yy.merge($$[$0 - 4], "", $$[$0 - 2], $$[$0]);
122
+ break;
123
+ case 43:
124
+ yy.merge($$[$0 - 4], $$[$0 - 2], $$[$0], "");
125
+ break;
126
+ case 44:
127
+ yy.merge($$[$0 - 4], $$[$0 - 2], "", $$[$0]);
128
+ break;
129
+ case 45:
130
+ yy.merge($$[$0 - 4], $$[$0], $$[$0 - 2], "");
131
+ break;
132
+ case 46:
133
+ yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]);
134
+ break;
135
+ case 47:
136
+ yy.merge($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]);
137
+ break;
138
+ case 48:
139
+ yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]);
140
+ break;
141
+ case 49:
142
+ yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]);
143
+ break;
144
+ case 50:
145
+ yy.merge($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]);
146
+ break;
147
+ case 51:
148
+ yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]);
149
+ break;
150
+ case 52:
151
+ yy.commit($$[$0]);
152
+ break;
153
+ case 53:
154
+ yy.commit("", "", yy.commitType.NORMAL, $$[$0]);
155
+ break;
156
+ case 54:
157
+ yy.commit("", "", $$[$0], "");
158
+ break;
159
+ case 55:
160
+ yy.commit("", "", $$[$0], $$[$0 - 2]);
161
+ break;
162
+ case 56:
163
+ yy.commit("", "", $$[$0 - 2], $$[$0]);
164
+ break;
165
+ case 57:
166
+ yy.commit("", $$[$0], yy.commitType.NORMAL, "");
167
+ break;
168
+ case 58:
169
+ yy.commit("", $$[$0 - 2], yy.commitType.NORMAL, $$[$0]);
170
+ break;
171
+ case 59:
172
+ yy.commit("", $$[$0], yy.commitType.NORMAL, $$[$0 - 2]);
173
+ break;
174
+ case 60:
175
+ yy.commit("", $$[$0 - 2], $$[$0], "");
176
+ break;
177
+ case 61:
178
+ yy.commit("", $$[$0], $$[$0 - 2], "");
179
+ break;
180
+ case 62:
181
+ yy.commit("", $$[$0 - 4], $$[$0 - 2], $$[$0]);
182
+ break;
183
+ case 63:
184
+ yy.commit("", $$[$0 - 4], $$[$0], $$[$0 - 2]);
185
+ break;
186
+ case 64:
187
+ yy.commit("", $$[$0 - 2], $$[$0 - 4], $$[$0]);
188
+ break;
189
+ case 65:
190
+ yy.commit("", $$[$0], $$[$0 - 4], $$[$0 - 2]);
191
+ break;
192
+ case 66:
193
+ yy.commit("", $$[$0], $$[$0 - 2], $$[$0 - 4]);
194
+ break;
195
+ case 67:
196
+ yy.commit("", $$[$0 - 2], $$[$0], $$[$0 - 4]);
197
+ break;
198
+ case 68:
199
+ yy.commit($$[$0], "", yy.commitType.NORMAL, "");
200
+ break;
201
+ case 69:
202
+ yy.commit($$[$0], "", yy.commitType.NORMAL, $$[$0 - 2]);
203
+ break;
204
+ case 70:
205
+ yy.commit($$[$0 - 2], "", yy.commitType.NORMAL, $$[$0]);
206
+ break;
207
+ case 71:
208
+ yy.commit($$[$0 - 2], "", $$[$0], "");
209
+ break;
210
+ case 72:
211
+ yy.commit($$[$0], "", $$[$0 - 2], "");
212
+ break;
213
+ case 73:
214
+ yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, "");
215
+ break;
216
+ case 74:
217
+ yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, "");
218
+ break;
219
+ case 75:
220
+ yy.commit($$[$0 - 4], "", $$[$0 - 2], $$[$0]);
221
+ break;
222
+ case 76:
223
+ yy.commit($$[$0 - 4], "", $$[$0], $$[$0 - 2]);
224
+ break;
225
+ case 77:
226
+ yy.commit($$[$0 - 2], "", $$[$0 - 4], $$[$0]);
227
+ break;
228
+ case 78:
229
+ yy.commit($$[$0], "", $$[$0 - 4], $$[$0 - 2]);
230
+ break;
231
+ case 79:
232
+ yy.commit($$[$0], "", $$[$0 - 2], $$[$0 - 4]);
233
+ break;
234
+ case 80:
235
+ yy.commit($$[$0 - 2], "", $$[$0], $$[$0 - 4]);
236
+ break;
237
+ case 81:
238
+ yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], "");
239
+ break;
240
+ case 82:
241
+ yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], "");
242
+ break;
243
+ case 83:
244
+ yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], "");
245
+ break;
246
+ case 84:
247
+ yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], "");
248
+ break;
249
+ case 85:
250
+ yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], "");
251
+ break;
252
+ case 86:
253
+ yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], "");
254
+ break;
255
+ case 87:
256
+ yy.commit($$[$0 - 4], $$[$0], yy.commitType.NORMAL, $$[$0 - 2]);
257
+ break;
258
+ case 88:
259
+ yy.commit($$[$0 - 4], $$[$0 - 2], yy.commitType.NORMAL, $$[$0]);
260
+ break;
261
+ case 89:
262
+ yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, $$[$0 - 4]);
263
+ break;
264
+ case 90:
265
+ yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, $$[$0 - 4]);
266
+ break;
267
+ case 91:
268
+ yy.commit($$[$0], $$[$0 - 4], yy.commitType.NORMAL, $$[$0 - 2]);
269
+ break;
270
+ case 92:
271
+ yy.commit($$[$0 - 2], $$[$0 - 4], yy.commitType.NORMAL, $$[$0]);
272
+ break;
273
+ case 93:
274
+ yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]);
275
+ break;
276
+ case 94:
277
+ yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]);
278
+ break;
279
+ case 95:
280
+ yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]);
281
+ break;
282
+ case 96:
283
+ yy.commit($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]);
284
+ break;
285
+ case 97:
286
+ yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]);
287
+ break;
288
+ case 98:
289
+ yy.commit($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]);
290
+ break;
291
+ case 99:
292
+ yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0 - 2], $$[$0]);
293
+ break;
294
+ case 100:
295
+ yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0], $$[$0 - 2]);
296
+ break;
297
+ case 101:
298
+ yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0 - 4], $$[$0]);
299
+ break;
300
+ case 102:
301
+ yy.commit($$[$0], $$[$0 - 6], $$[$0 - 4], $$[$0 - 2]);
302
+ break;
303
+ case 103:
304
+ yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0], $$[$0 - 4]);
305
+ break;
306
+ case 104:
307
+ yy.commit($$[$0], $$[$0 - 6], $$[$0 - 2], $$[$0 - 4]);
308
+ break;
309
+ case 105:
310
+ yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], $$[$0 - 6]);
311
+ break;
312
+ case 106:
313
+ yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], $$[$0 - 6]);
314
+ break;
315
+ case 107:
316
+ yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], $$[$0 - 6]);
317
+ break;
318
+ case 108:
319
+ yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], $$[$0 - 6]);
320
+ break;
321
+ case 109:
322
+ yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], $$[$0 - 6]);
323
+ break;
324
+ case 110:
325
+ yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 6]);
326
+ break;
327
+ case 111:
328
+ yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0 - 6], $$[$0]);
329
+ break;
330
+ case 112:
331
+ yy.commit($$[$0], $$[$0 - 4], $$[$0 - 6], $$[$0 - 2]);
332
+ break;
333
+ case 113:
334
+ yy.commit($$[$0 - 2], $$[$0], $$[$0 - 6], $$[$0 - 4]);
335
+ break;
336
+ case 114:
337
+ yy.commit($$[$0], $$[$0 - 2], $$[$0 - 6], $$[$0 - 4]);
338
+ break;
339
+ case 115:
340
+ yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0 - 6], $$[$0]);
341
+ break;
342
+ case 116:
343
+ yy.commit($$[$0 - 4], $$[$0], $$[$0 - 6], $$[$0 - 2]);
344
+ break;
345
+ case 117:
346
+ this.$ = "";
347
+ break;
348
+ case 118:
349
+ this.$ = $$[$0];
350
+ break;
351
+ case 119:
352
+ this.$ = yy.commitType.NORMAL;
353
+ break;
354
+ case 120:
355
+ this.$ = yy.commitType.REVERSE;
356
+ break;
357
+ case 121:
358
+ this.$ = yy.commitType.HIGHLIGHT;
359
+ break;
360
+ }
361
+ },
362
+ table: [{ 3: 1, 4: 2, 5: $V0, 7: $V1, 13: $V2, 47: $V3 }, { 1: [3] }, { 3: 7, 4: 2, 5: $V0, 7: $V1, 13: $V2, 47: $V3 }, { 6: 8, 7: $V4, 8: [1, 9], 9: [1, 10], 10: 11, 13: $V5 }, o($V6, [2, 124]), o($V6, [2, 125]), o($V6, [2, 126]), { 1: [2, 1] }, { 7: [1, 13] }, { 6: 14, 7: $V4, 10: 11, 13: $V5 }, { 8: [1, 15] }, o($V7, [2, 9], { 11: 16, 12: [1, 17] }), o($V8, [2, 8]), { 1: [2, 2] }, { 7: [1, 18] }, { 6: 19, 7: $V4, 10: 11, 13: $V5 }, { 7: [2, 6], 13: [1, 22], 14: 20, 15: 21, 16: 23, 17: 24, 18: 25, 19: [1, 26], 21: [1, 27], 23: [1, 28], 24: [1, 29], 25: 30, 26: [1, 31], 28: [1, 35], 31: [1, 34], 37: [1, 33], 40: [1, 32] }, o($V8, [2, 7]), { 1: [2, 3] }, { 7: [1, 36] }, o($V7, [2, 10]), { 4: 37, 7: $V1, 13: $V2, 47: $V3 }, o($V7, [2, 12]), o($V9, [2, 13]), o($V9, [2, 14]), o($V9, [2, 15]), { 20: [1, 38] }, { 22: [1, 39] }, o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), { 27: 40, 33: $Va, 46: $Vb }, o($V9, [2, 117], { 41: 43, 32: [1, 46], 33: [1, 48], 35: [1, 44], 38: [1, 45], 42: [1, 47] }), { 27: 49, 33: $Va, 46: $Vb }, { 32: [1, 50], 35: [1, 51] }, { 27: 52, 33: $Va, 46: $Vb }, { 1: [2, 4] }, o($V7, [2, 11]), o($V9, [2, 16]), o($V9, [2, 17]), o($V9, [2, 21]), o($Vc, [2, 122]), o($Vc, [2, 123]), o($V9, [2, 52]), { 33: [1, 53] }, { 39: 54, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 58] }, { 33: [1, 59] }, o($V9, [2, 118]), o($V9, [2, 36], { 32: [1, 60], 35: [1, 62], 38: [1, 61] }), { 33: [1, 63] }, { 33: [1, 64], 36: [1, 65] }, o($V9, [2, 22], { 29: [1, 66] }), o($V9, [2, 53], { 32: [1, 68], 38: [1, 67], 42: [1, 69] }), o($V9, [2, 54], { 32: [1, 71], 35: [1, 70], 42: [1, 72] }), o($Vg, [2, 119]), o($Vg, [2, 120]), o($Vg, [2, 121]), o($V9, [2, 57], { 35: [1, 73], 38: [1, 74], 42: [1, 75] }), o($V9, [2, 68], { 32: [1, 78], 35: [1, 76], 38: [1, 77] }), { 33: [1, 79] }, { 39: 80, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 81] }, o($V9, [2, 24], { 34: [1, 82], 35: [1, 83] }), { 32: [1, 84] }, { 32: [1, 85] }, { 30: [1, 86] }, { 39: 87, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 88] }, { 33: [1, 89] }, { 33: [1, 90] }, { 33: [1, 91] }, { 33: [1, 92] }, { 33: [1, 93] }, { 39: 94, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 95] }, { 33: [1, 96] }, { 39: 97, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 98] }, o($V9, [2, 37], { 35: [1, 100], 38: [1, 99] }), o($V9, [2, 38], { 32: [1, 102], 35: [1, 101] }), o($V9, [2, 39], { 32: [1, 103], 38: [1, 104] }), { 33: [1, 105] }, { 33: [1, 106], 36: [1, 107] }, { 33: [1, 108] }, { 33: [1, 109] }, o($V9, [2, 23]), o($V9, [2, 55], { 32: [1, 110], 42: [1, 111] }), o($V9, [2, 59], { 38: [1, 112], 42: [1, 113] }), o($V9, [2, 69], { 32: [1, 115], 38: [1, 114] }), o($V9, [2, 56], { 32: [1, 116], 42: [1, 117] }), o($V9, [2, 61], { 35: [1, 118], 42: [1, 119] }), o($V9, [2, 72], { 32: [1, 121], 35: [1, 120] }), o($V9, [2, 58], { 38: [1, 122], 42: [1, 123] }), o($V9, [2, 60], { 35: [1, 124], 42: [1, 125] }), o($V9, [2, 73], { 35: [1, 127], 38: [1, 126] }), o($V9, [2, 70], { 32: [1, 129], 38: [1, 128] }), o($V9, [2, 71], { 32: [1, 131], 35: [1, 130] }), o($V9, [2, 74], { 35: [1, 133], 38: [1, 132] }), { 39: 134, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 135] }, { 33: [1, 136] }, { 33: [1, 137] }, { 33: [1, 138] }, { 39: 139, 43: $Vd, 44: $Ve, 45: $Vf }, o($V9, [2, 25], { 35: [1, 140] }), o($V9, [2, 26], { 34: [1, 141] }), o($V9, [2, 31], { 34: [1, 142] }), o($V9, [2, 29], { 34: [1, 143] }), o($V9, [2, 30], { 34: [1, 144] }), { 33: [1, 145] }, { 33: [1, 146] }, { 39: 147, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 148] }, { 39: 149, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 150] }, { 33: [1, 151] }, { 33: [1, 152] }, { 33: [1, 153] }, { 33: [1, 154] }, { 33: [1, 155] }, { 33: [1, 156] }, { 39: 157, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 158] }, { 33: [1, 159] }, { 33: [1, 160] }, { 39: 161, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 162] }, { 39: 163, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 164] }, { 33: [1, 165] }, { 33: [1, 166] }, { 39: 167, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 168] }, o($V9, [2, 43], { 35: [1, 169] }), o($V9, [2, 44], { 38: [1, 170] }), o($V9, [2, 42], { 32: [1, 171] }), o($V9, [2, 45], { 35: [1, 172] }), o($V9, [2, 40], { 38: [1, 173] }), o($V9, [2, 41], { 32: [1, 174] }), { 33: [1, 175], 36: [1, 176] }, { 33: [1, 177] }, { 33: [1, 178] }, { 33: [1, 179] }, { 33: [1, 180] }, o($V9, [2, 66], { 42: [1, 181] }), o($V9, [2, 79], { 32: [1, 182] }), o($V9, [2, 67], { 42: [1, 183] }), o($V9, [2, 90], { 38: [1, 184] }), o($V9, [2, 80], { 32: [1, 185] }), o($V9, [2, 89], { 38: [1, 186] }), o($V9, [2, 65], { 42: [1, 187] }), o($V9, [2, 78], { 32: [1, 188] }), o($V9, [2, 64], { 42: [1, 189] }), o($V9, [2, 84], { 35: [1, 190] }), o($V9, [2, 77], { 32: [1, 191] }), o($V9, [2, 83], { 35: [1, 192] }), o($V9, [2, 63], { 42: [1, 193] }), o($V9, [2, 91], { 38: [1, 194] }), o($V9, [2, 62], { 42: [1, 195] }), o($V9, [2, 85], { 35: [1, 196] }), o($V9, [2, 86], { 35: [1, 197] }), o($V9, [2, 92], { 38: [1, 198] }), o($V9, [2, 76], { 32: [1, 199] }), o($V9, [2, 87], { 38: [1, 200] }), o($V9, [2, 75], { 32: [1, 201] }), o($V9, [2, 81], { 35: [1, 202] }), o($V9, [2, 82], { 35: [1, 203] }), o($V9, [2, 88], { 38: [1, 204] }), { 33: [1, 205] }, { 39: 206, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 207] }, { 33: [1, 208] }, { 39: 209, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 210] }, o($V9, [2, 27]), o($V9, [2, 32]), o($V9, [2, 28]), o($V9, [2, 33]), o($V9, [2, 34]), o($V9, [2, 35]), { 33: [1, 211] }, { 33: [1, 212] }, { 33: [1, 213] }, { 39: 214, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 215] }, { 39: 216, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 217] }, { 33: [1, 218] }, { 33: [1, 219] }, { 33: [1, 220] }, { 33: [1, 221] }, { 33: [1, 222] }, { 33: [1, 223] }, { 39: 224, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 225] }, { 33: [1, 226] }, { 33: [1, 227] }, { 39: 228, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 229] }, { 39: 230, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 231] }, { 33: [1, 232] }, { 33: [1, 233] }, { 39: 234, 43: $Vd, 44: $Ve, 45: $Vf }, o($V9, [2, 46]), o($V9, [2, 48]), o($V9, [2, 47]), o($V9, [2, 49]), o($V9, [2, 51]), o($V9, [2, 50]), o($V9, [2, 107]), o($V9, [2, 108]), o($V9, [2, 105]), o($V9, [2, 106]), o($V9, [2, 110]), o($V9, [2, 109]), o($V9, [2, 114]), o($V9, [2, 113]), o($V9, [2, 112]), o($V9, [2, 111]), o($V9, [2, 116]), o($V9, [2, 115]), o($V9, [2, 104]), o($V9, [2, 103]), o($V9, [2, 102]), o($V9, [2, 101]), o($V9, [2, 99]), o($V9, [2, 100]), o($V9, [2, 98]), o($V9, [2, 97]), o($V9, [2, 96]), o($V9, [2, 95]), o($V9, [2, 93]), o($V9, [2, 94])],
363
+ defaultActions: { 7: [2, 1], 13: [2, 2], 18: [2, 3], 36: [2, 4] },
364
+ parseError: function parseError(str, hash) {
365
+ if (hash.recoverable) {
366
+ this.trace(str);
367
+ } else {
368
+ var error = new Error(str);
369
+ error.hash = hash;
370
+ throw error;
371
+ }
372
+ },
373
+ parse: function parse(input) {
374
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
375
+ var args = lstack.slice.call(arguments, 1);
376
+ var lexer2 = Object.create(this.lexer);
377
+ var sharedState = { yy: {} };
378
+ for (var k in this.yy) {
379
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
380
+ sharedState.yy[k] = this.yy[k];
381
+ }
382
+ }
383
+ lexer2.setInput(input, sharedState.yy);
384
+ sharedState.yy.lexer = lexer2;
385
+ sharedState.yy.parser = this;
386
+ if (typeof lexer2.yylloc == "undefined") {
387
+ lexer2.yylloc = {};
388
+ }
389
+ var yyloc = lexer2.yylloc;
390
+ lstack.push(yyloc);
391
+ var ranges = lexer2.options && lexer2.options.ranges;
392
+ if (typeof sharedState.yy.parseError === "function") {
393
+ this.parseError = sharedState.yy.parseError;
394
+ } else {
395
+ this.parseError = Object.getPrototypeOf(this).parseError;
396
+ }
397
+ function lex() {
398
+ var token;
399
+ token = tstack.pop() || lexer2.lex() || EOF;
400
+ if (typeof token !== "number") {
401
+ if (token instanceof Array) {
402
+ tstack = token;
403
+ token = tstack.pop();
404
+ }
405
+ token = self.symbols_[token] || token;
406
+ }
407
+ return token;
408
+ }
409
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
410
+ while (true) {
411
+ state = stack[stack.length - 1];
412
+ if (this.defaultActions[state]) {
413
+ action = this.defaultActions[state];
414
+ } else {
415
+ if (symbol === null || typeof symbol == "undefined") {
416
+ symbol = lex();
417
+ }
418
+ action = table[state] && table[state][symbol];
419
+ }
420
+ if (typeof action === "undefined" || !action.length || !action[0]) {
421
+ var errStr = "";
422
+ expected = [];
423
+ for (p in table[state]) {
424
+ if (this.terminals_[p] && p > TERROR) {
425
+ expected.push("'" + this.terminals_[p] + "'");
426
+ }
427
+ }
428
+ if (lexer2.showPosition) {
429
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
430
+ } else {
431
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
432
+ }
433
+ this.parseError(errStr, {
434
+ text: lexer2.match,
435
+ token: this.terminals_[symbol] || symbol,
436
+ line: lexer2.yylineno,
437
+ loc: yyloc,
438
+ expected
439
+ });
440
+ }
441
+ if (action[0] instanceof Array && action.length > 1) {
442
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
443
+ }
444
+ switch (action[0]) {
445
+ case 1:
446
+ stack.push(symbol);
447
+ vstack.push(lexer2.yytext);
448
+ lstack.push(lexer2.yylloc);
449
+ stack.push(action[1]);
450
+ symbol = null;
451
+ {
452
+ yyleng = lexer2.yyleng;
453
+ yytext = lexer2.yytext;
454
+ yylineno = lexer2.yylineno;
455
+ yyloc = lexer2.yylloc;
456
+ }
457
+ break;
458
+ case 2:
459
+ len = this.productions_[action[1]][1];
460
+ yyval.$ = vstack[vstack.length - len];
461
+ yyval._$ = {
462
+ first_line: lstack[lstack.length - (len || 1)].first_line,
463
+ last_line: lstack[lstack.length - 1].last_line,
464
+ first_column: lstack[lstack.length - (len || 1)].first_column,
465
+ last_column: lstack[lstack.length - 1].last_column
466
+ };
467
+ if (ranges) {
468
+ yyval._$.range = [
469
+ lstack[lstack.length - (len || 1)].range[0],
470
+ lstack[lstack.length - 1].range[1]
471
+ ];
472
+ }
473
+ r = this.performAction.apply(yyval, [
474
+ yytext,
475
+ yyleng,
476
+ yylineno,
477
+ sharedState.yy,
478
+ action[1],
479
+ vstack,
480
+ lstack
481
+ ].concat(args));
482
+ if (typeof r !== "undefined") {
483
+ return r;
484
+ }
485
+ if (len) {
486
+ stack = stack.slice(0, -1 * len * 2);
487
+ vstack = vstack.slice(0, -1 * len);
488
+ lstack = lstack.slice(0, -1 * len);
489
+ }
490
+ stack.push(this.productions_[action[1]][0]);
491
+ vstack.push(yyval.$);
492
+ lstack.push(yyval._$);
493
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
494
+ stack.push(newState);
495
+ break;
496
+ case 3:
497
+ return true;
498
+ }
499
+ }
500
+ return true;
501
+ }
502
+ };
503
+ var lexer = /* @__PURE__ */ function() {
504
+ var lexer2 = {
505
+ EOF: 1,
506
+ parseError: function parseError(str, hash) {
507
+ if (this.yy.parser) {
508
+ this.yy.parser.parseError(str, hash);
509
+ } else {
510
+ throw new Error(str);
511
+ }
512
+ },
513
+ // resets the lexer, sets new input
514
+ setInput: function(input, yy) {
515
+ this.yy = yy || this.yy || {};
516
+ this._input = input;
517
+ this._more = this._backtrack = this.done = false;
518
+ this.yylineno = this.yyleng = 0;
519
+ this.yytext = this.matched = this.match = "";
520
+ this.conditionStack = ["INITIAL"];
521
+ this.yylloc = {
522
+ first_line: 1,
523
+ first_column: 0,
524
+ last_line: 1,
525
+ last_column: 0
526
+ };
527
+ if (this.options.ranges) {
528
+ this.yylloc.range = [0, 0];
529
+ }
530
+ this.offset = 0;
531
+ return this;
532
+ },
533
+ // consumes and returns one char from the input
534
+ input: function() {
535
+ var ch = this._input[0];
536
+ this.yytext += ch;
537
+ this.yyleng++;
538
+ this.offset++;
539
+ this.match += ch;
540
+ this.matched += ch;
541
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
542
+ if (lines) {
543
+ this.yylineno++;
544
+ this.yylloc.last_line++;
545
+ } else {
546
+ this.yylloc.last_column++;
547
+ }
548
+ if (this.options.ranges) {
549
+ this.yylloc.range[1]++;
550
+ }
551
+ this._input = this._input.slice(1);
552
+ return ch;
553
+ },
554
+ // unshifts one char (or a string) into the input
555
+ unput: function(ch) {
556
+ var len = ch.length;
557
+ var lines = ch.split(/(?:\r\n?|\n)/g);
558
+ this._input = ch + this._input;
559
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
560
+ this.offset -= len;
561
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
562
+ this.match = this.match.substr(0, this.match.length - 1);
563
+ this.matched = this.matched.substr(0, this.matched.length - 1);
564
+ if (lines.length - 1) {
565
+ this.yylineno -= lines.length - 1;
566
+ }
567
+ var r = this.yylloc.range;
568
+ this.yylloc = {
569
+ first_line: this.yylloc.first_line,
570
+ last_line: this.yylineno + 1,
571
+ first_column: this.yylloc.first_column,
572
+ 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
573
+ };
574
+ if (this.options.ranges) {
575
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
576
+ }
577
+ this.yyleng = this.yytext.length;
578
+ return this;
579
+ },
580
+ // When called from action, caches matched text and appends it on next action
581
+ more: function() {
582
+ this._more = true;
583
+ return this;
584
+ },
585
+ // 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.
586
+ reject: function() {
587
+ if (this.options.backtrack_lexer) {
588
+ this._backtrack = true;
589
+ } else {
590
+ 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(), {
591
+ text: "",
592
+ token: null,
593
+ line: this.yylineno
594
+ });
595
+ }
596
+ return this;
597
+ },
598
+ // retain first n characters of the match
599
+ less: function(n) {
600
+ this.unput(this.match.slice(n));
601
+ },
602
+ // displays already matched input, i.e. for error messages
603
+ pastInput: function() {
604
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
605
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
606
+ },
607
+ // displays upcoming input, i.e. for error messages
608
+ upcomingInput: function() {
609
+ var next = this.match;
610
+ if (next.length < 20) {
611
+ next += this._input.substr(0, 20 - next.length);
612
+ }
613
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
614
+ },
615
+ // displays the character position where the lexing error occurred, i.e. for error messages
616
+ showPosition: function() {
617
+ var pre = this.pastInput();
618
+ var c = new Array(pre.length + 1).join("-");
619
+ return pre + this.upcomingInput() + "\n" + c + "^";
620
+ },
621
+ // test the lexed token: return FALSE when not a match, otherwise return token
622
+ test_match: function(match, indexed_rule) {
623
+ var token, lines, backup;
624
+ if (this.options.backtrack_lexer) {
625
+ backup = {
626
+ yylineno: this.yylineno,
627
+ yylloc: {
628
+ first_line: this.yylloc.first_line,
629
+ last_line: this.last_line,
630
+ first_column: this.yylloc.first_column,
631
+ last_column: this.yylloc.last_column
632
+ },
633
+ yytext: this.yytext,
634
+ match: this.match,
635
+ matches: this.matches,
636
+ matched: this.matched,
637
+ yyleng: this.yyleng,
638
+ offset: this.offset,
639
+ _more: this._more,
640
+ _input: this._input,
641
+ yy: this.yy,
642
+ conditionStack: this.conditionStack.slice(0),
643
+ done: this.done
644
+ };
645
+ if (this.options.ranges) {
646
+ backup.yylloc.range = this.yylloc.range.slice(0);
647
+ }
648
+ }
649
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
650
+ if (lines) {
651
+ this.yylineno += lines.length;
652
+ }
653
+ this.yylloc = {
654
+ first_line: this.yylloc.last_line,
655
+ last_line: this.yylineno + 1,
656
+ first_column: this.yylloc.last_column,
657
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
658
+ };
659
+ this.yytext += match[0];
660
+ this.match += match[0];
661
+ this.matches = match;
662
+ this.yyleng = this.yytext.length;
663
+ if (this.options.ranges) {
664
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
665
+ }
666
+ this._more = false;
667
+ this._backtrack = false;
668
+ this._input = this._input.slice(match[0].length);
669
+ this.matched += match[0];
670
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
671
+ if (this.done && this._input) {
672
+ this.done = false;
673
+ }
674
+ if (token) {
675
+ return token;
676
+ } else if (this._backtrack) {
677
+ for (var k in backup) {
678
+ this[k] = backup[k];
679
+ }
680
+ return false;
681
+ }
682
+ return false;
683
+ },
684
+ // return next match in input
685
+ next: function() {
686
+ if (this.done) {
687
+ return this.EOF;
688
+ }
689
+ if (!this._input) {
690
+ this.done = true;
691
+ }
692
+ var token, match, tempMatch, index;
693
+ if (!this._more) {
694
+ this.yytext = "";
695
+ this.match = "";
696
+ }
697
+ var rules = this._currentRules();
698
+ for (var i = 0; i < rules.length; i++) {
699
+ tempMatch = this._input.match(this.rules[rules[i]]);
700
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
701
+ match = tempMatch;
702
+ index = i;
703
+ if (this.options.backtrack_lexer) {
704
+ token = this.test_match(tempMatch, rules[i]);
705
+ if (token !== false) {
706
+ return token;
707
+ } else if (this._backtrack) {
708
+ match = false;
709
+ continue;
710
+ } else {
711
+ return false;
712
+ }
713
+ } else if (!this.options.flex) {
714
+ break;
715
+ }
716
+ }
717
+ }
718
+ if (match) {
719
+ token = this.test_match(match, rules[index]);
720
+ if (token !== false) {
721
+ return token;
722
+ }
723
+ return false;
724
+ }
725
+ if (this._input === "") {
726
+ return this.EOF;
727
+ } else {
728
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
729
+ text: "",
730
+ token: null,
731
+ line: this.yylineno
732
+ });
733
+ }
734
+ },
735
+ // return next match that has a token
736
+ lex: function lex() {
737
+ var r = this.next();
738
+ if (r) {
739
+ return r;
740
+ } else {
741
+ return this.lex();
742
+ }
743
+ },
744
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
745
+ begin: function begin(condition) {
746
+ this.conditionStack.push(condition);
747
+ },
748
+ // pop the previously active lexer condition state off the condition stack
749
+ popState: function popState() {
750
+ var n = this.conditionStack.length - 1;
751
+ if (n > 0) {
752
+ return this.conditionStack.pop();
753
+ } else {
754
+ return this.conditionStack[0];
755
+ }
756
+ },
757
+ // produce the lexer rule set which is active for the currently active lexer condition state
758
+ _currentRules: function _currentRules() {
759
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
760
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
761
+ } else {
762
+ return this.conditions["INITIAL"].rules;
763
+ }
764
+ },
765
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
766
+ topState: function topState(n) {
767
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
768
+ if (n >= 0) {
769
+ return this.conditionStack[n];
770
+ } else {
771
+ return "INITIAL";
772
+ }
773
+ },
774
+ // alias for begin(condition)
775
+ pushState: function pushState(condition) {
776
+ this.begin(condition);
777
+ },
778
+ // return the number of states currently on the stack
779
+ stateStackSize: function stateStackSize() {
780
+ return this.conditionStack.length;
781
+ },
782
+ options: { "case-insensitive": true },
783
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
784
+ switch ($avoiding_name_collisions) {
785
+ case 0:
786
+ this.begin("acc_title");
787
+ return 19;
788
+ case 1:
789
+ this.popState();
790
+ return "acc_title_value";
791
+ case 2:
792
+ this.begin("acc_descr");
793
+ return 21;
794
+ case 3:
795
+ this.popState();
796
+ return "acc_descr_value";
797
+ case 4:
798
+ this.begin("acc_descr_multiline");
799
+ break;
800
+ case 5:
801
+ this.popState();
802
+ break;
803
+ case 6:
804
+ return "acc_descr_multiline_value";
805
+ case 7:
806
+ return 13;
807
+ case 8:
808
+ break;
809
+ case 9:
810
+ break;
811
+ case 10:
812
+ return 5;
813
+ case 11:
814
+ return 40;
815
+ case 12:
816
+ return 32;
817
+ case 13:
818
+ return 38;
819
+ case 14:
820
+ return 42;
821
+ case 15:
822
+ return 43;
823
+ case 16:
824
+ return 44;
825
+ case 17:
826
+ return 45;
827
+ case 18:
828
+ return 35;
829
+ case 19:
830
+ return 28;
831
+ case 20:
832
+ return 29;
833
+ case 21:
834
+ return 37;
835
+ case 22:
836
+ return 31;
837
+ case 23:
838
+ return 34;
839
+ case 24:
840
+ return 26;
841
+ case 25:
842
+ return 9;
843
+ case 26:
844
+ return 9;
845
+ case 27:
846
+ return 8;
847
+ case 28:
848
+ return "CARET";
849
+ case 29:
850
+ this.begin("options");
851
+ break;
852
+ case 30:
853
+ this.popState();
854
+ break;
855
+ case 31:
856
+ return 12;
857
+ case 32:
858
+ return 36;
859
+ case 33:
860
+ this.begin("string");
861
+ break;
862
+ case 34:
863
+ this.popState();
864
+ break;
865
+ case 35:
866
+ return 33;
867
+ case 36:
868
+ return 30;
869
+ case 37:
870
+ return 46;
871
+ case 38:
872
+ return 7;
873
+ }
874
+ },
875
+ rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gitGraph\b)/i, /^(?:commit(?=\s|$))/i, /^(?:id:)/i, /^(?:type:)/i, /^(?:msg:)/i, /^(?:NORMAL\b)/i, /^(?:REVERSE\b)/i, /^(?:HIGHLIGHT\b)/i, /^(?:tag:)/i, /^(?:branch(?=\s|$))/i, /^(?:order:)/i, /^(?:merge(?=\s|$))/i, /^(?:cherry-pick(?=\s|$))/i, /^(?:parent:)/i, /^(?:checkout(?=\s|$))/i, /^(?:LR\b)/i, /^(?:TB\b)/i, /^(?::)/i, /^(?:\^)/i, /^(?:options\r?\n)/i, /^(?:[ \r\n\t]+end\b)/i, /^(?:[\s\S]+(?=[ \r\n\t]+end))/i, /^(?:["]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[0-9]+(?=\s|$))/i, /^(?:\w([-\./\w]*[-\w])?)/i, /^(?:$)/i, /^(?:\s+)/i],
876
+ conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "options": { "rules": [30, 31], "inclusive": false }, "string": { "rules": [34, 35], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 36, 37, 38, 39], "inclusive": true } }
877
+ };
878
+ return lexer2;
879
+ }();
880
+ parser2.lexer = lexer;
881
+ function Parser() {
882
+ this.yy = {};
883
+ }
884
+ Parser.prototype = parser2;
885
+ parser2.Parser = Parser;
886
+ return new Parser();
887
+ }();
888
+ parser.parser = parser;
889
+ const gitGraphParser = parser;
890
+ let mainBranchName = getConfig().gitGraph.mainBranchName;
891
+ let mainBranchOrder = getConfig().gitGraph.mainBranchOrder;
892
+ let commits = {};
893
+ let head = null;
894
+ let branchesConfig = {};
895
+ branchesConfig[mainBranchName] = { name: mainBranchName, order: mainBranchOrder };
896
+ let branches = {};
897
+ branches[mainBranchName] = head;
898
+ let curBranch = mainBranchName;
899
+ let direction = "LR";
900
+ let seq = 0;
901
+ function getId() {
902
+ return random({ length: 7 });
903
+ }
904
+ function uniqBy(list, fn) {
905
+ const recordMap = /* @__PURE__ */ Object.create(null);
906
+ return list.reduce((out, item) => {
907
+ const key = fn(item);
908
+ if (!recordMap[key]) {
909
+ recordMap[key] = true;
910
+ out.push(item);
911
+ }
912
+ return out;
913
+ }, []);
914
+ }
915
+ const setDirection = function(dir2) {
916
+ direction = dir2;
917
+ };
918
+ let options = {};
919
+ const setOptions = function(rawOptString) {
920
+ log$1.debug("options str", rawOptString);
921
+ rawOptString = rawOptString && rawOptString.trim();
922
+ rawOptString = rawOptString || "{}";
923
+ try {
924
+ options = JSON.parse(rawOptString);
925
+ } catch (e) {
926
+ log$1.error("error while parsing gitGraph options", e.message);
927
+ }
928
+ };
929
+ const getOptions = function() {
930
+ return options;
931
+ };
932
+ const commit = function(msg, id, type, tag) {
933
+ log$1.debug("Entering commit:", msg, id, type, tag);
934
+ id = common$1.sanitizeText(id, getConfig());
935
+ msg = common$1.sanitizeText(msg, getConfig());
936
+ tag = common$1.sanitizeText(tag, getConfig());
937
+ const commit2 = {
938
+ id: id ? id : seq + "-" + getId(),
939
+ message: msg,
940
+ seq: seq++,
941
+ type: type ? type : commitType$1.NORMAL,
942
+ tag: tag ? tag : "",
943
+ parents: head == null ? [] : [head.id],
944
+ branch: curBranch
945
+ };
946
+ head = commit2;
947
+ commits[commit2.id] = commit2;
948
+ branches[curBranch] = commit2.id;
949
+ log$1.debug("in pushCommit " + commit2.id);
950
+ };
951
+ const branch = function(name, order) {
952
+ name = common$1.sanitizeText(name, getConfig());
953
+ if (branches[name] === void 0) {
954
+ branches[name] = head != null ? head.id : null;
955
+ branchesConfig[name] = { name, order: order ? parseInt(order, 10) : null };
956
+ checkout(name);
957
+ log$1.debug("in createBranch");
958
+ } else {
959
+ let error = new Error(
960
+ 'Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + name + '")'
961
+ );
962
+ error.hash = {
963
+ text: "branch " + name,
964
+ token: "branch " + name,
965
+ line: "1",
966
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
967
+ expected: ['"checkout ' + name + '"']
968
+ };
969
+ throw error;
970
+ }
971
+ };
972
+ const merge = function(otherBranch, custom_id, override_type, custom_tag) {
973
+ otherBranch = common$1.sanitizeText(otherBranch, getConfig());
974
+ custom_id = common$1.sanitizeText(custom_id, getConfig());
975
+ const currentCommit = commits[branches[curBranch]];
976
+ const otherCommit = commits[branches[otherBranch]];
977
+ if (curBranch === otherBranch) {
978
+ let error = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
979
+ error.hash = {
980
+ text: "merge " + otherBranch,
981
+ token: "merge " + otherBranch,
982
+ line: "1",
983
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
984
+ expected: ["branch abc"]
985
+ };
986
+ throw error;
987
+ } else if (currentCommit === void 0 || !currentCommit) {
988
+ let error = new Error(
989
+ 'Incorrect usage of "merge". Current branch (' + curBranch + ")has no commits"
990
+ );
991
+ error.hash = {
992
+ text: "merge " + otherBranch,
993
+ token: "merge " + otherBranch,
994
+ line: "1",
995
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
996
+ expected: ["commit"]
997
+ };
998
+ throw error;
999
+ } else if (branches[otherBranch] === void 0) {
1000
+ let error = new Error(
1001
+ 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") does not exist"
1002
+ );
1003
+ error.hash = {
1004
+ text: "merge " + otherBranch,
1005
+ token: "merge " + otherBranch,
1006
+ line: "1",
1007
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1008
+ expected: ["branch " + otherBranch]
1009
+ };
1010
+ throw error;
1011
+ } else if (otherCommit === void 0 || !otherCommit) {
1012
+ let error = new Error(
1013
+ 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") has no commits"
1014
+ );
1015
+ error.hash = {
1016
+ text: "merge " + otherBranch,
1017
+ token: "merge " + otherBranch,
1018
+ line: "1",
1019
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1020
+ expected: ['"commit"']
1021
+ };
1022
+ throw error;
1023
+ } else if (currentCommit === otherCommit) {
1024
+ let error = new Error('Incorrect usage of "merge". Both branches have same head');
1025
+ error.hash = {
1026
+ text: "merge " + otherBranch,
1027
+ token: "merge " + otherBranch,
1028
+ line: "1",
1029
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1030
+ expected: ["branch abc"]
1031
+ };
1032
+ throw error;
1033
+ } else if (custom_id && commits[custom_id] !== void 0) {
1034
+ let error = new Error(
1035
+ 'Incorrect usage of "merge". Commit with id:' + custom_id + " already exists, use different custom Id"
1036
+ );
1037
+ error.hash = {
1038
+ text: "merge " + otherBranch + custom_id + override_type + custom_tag,
1039
+ token: "merge " + otherBranch + custom_id + override_type + custom_tag,
1040
+ line: "1",
1041
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1042
+ expected: [
1043
+ "merge " + otherBranch + " " + custom_id + "_UNIQUE " + override_type + " " + custom_tag
1044
+ ]
1045
+ };
1046
+ throw error;
1047
+ }
1048
+ const commit2 = {
1049
+ id: custom_id ? custom_id : seq + "-" + getId(),
1050
+ message: "merged branch " + otherBranch + " into " + curBranch,
1051
+ seq: seq++,
1052
+ parents: [head == null ? null : head.id, branches[otherBranch]],
1053
+ branch: curBranch,
1054
+ type: commitType$1.MERGE,
1055
+ customType: override_type,
1056
+ customId: custom_id ? true : false,
1057
+ tag: custom_tag ? custom_tag : ""
1058
+ };
1059
+ head = commit2;
1060
+ commits[commit2.id] = commit2;
1061
+ branches[curBranch] = commit2.id;
1062
+ log$1.debug(branches);
1063
+ log$1.debug("in mergeBranch");
1064
+ };
1065
+ const cherryPick = function(sourceId, targetId, tag, parentCommitId) {
1066
+ log$1.debug("Entering cherryPick:", sourceId, targetId, tag);
1067
+ sourceId = common$1.sanitizeText(sourceId, getConfig());
1068
+ targetId = common$1.sanitizeText(targetId, getConfig());
1069
+ tag = common$1.sanitizeText(tag, getConfig());
1070
+ parentCommitId = common$1.sanitizeText(parentCommitId, getConfig());
1071
+ if (!sourceId || commits[sourceId] === void 0) {
1072
+ let error = new Error(
1073
+ 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
1074
+ );
1075
+ error.hash = {
1076
+ text: "cherryPick " + sourceId + " " + targetId,
1077
+ token: "cherryPick " + sourceId + " " + targetId,
1078
+ line: "1",
1079
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1080
+ expected: ["cherry-pick abc"]
1081
+ };
1082
+ throw error;
1083
+ }
1084
+ let sourceCommit = commits[sourceId];
1085
+ let sourceCommitBranch = sourceCommit.branch;
1086
+ if (parentCommitId && !(Array.isArray(sourceCommit.parents) && sourceCommit.parents.includes(parentCommitId))) {
1087
+ let error = new Error(
1088
+ "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
1089
+ );
1090
+ throw error;
1091
+ }
1092
+ if (sourceCommit.type === commitType$1.MERGE && !parentCommitId) {
1093
+ let error = new Error(
1094
+ "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
1095
+ );
1096
+ throw error;
1097
+ }
1098
+ if (!targetId || commits[targetId] === void 0) {
1099
+ if (sourceCommitBranch === curBranch) {
1100
+ let error = new Error(
1101
+ 'Incorrect usage of "cherryPick". Source commit is already on current branch'
1102
+ );
1103
+ error.hash = {
1104
+ text: "cherryPick " + sourceId + " " + targetId,
1105
+ token: "cherryPick " + sourceId + " " + targetId,
1106
+ line: "1",
1107
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1108
+ expected: ["cherry-pick abc"]
1109
+ };
1110
+ throw error;
1111
+ }
1112
+ const currentCommit = commits[branches[curBranch]];
1113
+ if (currentCommit === void 0 || !currentCommit) {
1114
+ let error = new Error(
1115
+ 'Incorrect usage of "cherry-pick". Current branch (' + curBranch + ")has no commits"
1116
+ );
1117
+ error.hash = {
1118
+ text: "cherryPick " + sourceId + " " + targetId,
1119
+ token: "cherryPick " + sourceId + " " + targetId,
1120
+ line: "1",
1121
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1122
+ expected: ["cherry-pick abc"]
1123
+ };
1124
+ throw error;
1125
+ }
1126
+ const commit2 = {
1127
+ id: seq + "-" + getId(),
1128
+ message: "cherry-picked " + sourceCommit + " into " + curBranch,
1129
+ seq: seq++,
1130
+ parents: [head == null ? null : head.id, sourceCommit.id],
1131
+ branch: curBranch,
1132
+ type: commitType$1.CHERRY_PICK,
1133
+ tag: tag ?? `cherry-pick:${sourceCommit.id}${sourceCommit.type === commitType$1.MERGE ? `|parent:${parentCommitId}` : ""}`
1134
+ };
1135
+ head = commit2;
1136
+ commits[commit2.id] = commit2;
1137
+ branches[curBranch] = commit2.id;
1138
+ log$1.debug(branches);
1139
+ log$1.debug("in cherryPick");
1140
+ }
1141
+ };
1142
+ const checkout = function(branch2) {
1143
+ branch2 = common$1.sanitizeText(branch2, getConfig());
1144
+ if (branches[branch2] === void 0) {
1145
+ let error = new Error(
1146
+ 'Trying to checkout branch which is not yet created. (Help try using "branch ' + branch2 + '")'
1147
+ );
1148
+ error.hash = {
1149
+ text: "checkout " + branch2,
1150
+ token: "checkout " + branch2,
1151
+ line: "1",
1152
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1153
+ expected: ['"branch ' + branch2 + '"']
1154
+ };
1155
+ throw error;
1156
+ } else {
1157
+ curBranch = branch2;
1158
+ const id = branches[curBranch];
1159
+ head = commits[id];
1160
+ }
1161
+ };
1162
+ function upsert(arr, key, newVal) {
1163
+ const index = arr.indexOf(key);
1164
+ if (index === -1) {
1165
+ arr.push(newVal);
1166
+ } else {
1167
+ arr.splice(index, 1, newVal);
1168
+ }
1169
+ }
1170
+ function prettyPrintCommitHistory(commitArr) {
1171
+ const commit2 = commitArr.reduce((out, commit3) => {
1172
+ if (out.seq > commit3.seq) {
1173
+ return out;
1174
+ }
1175
+ return commit3;
1176
+ }, commitArr[0]);
1177
+ let line = "";
1178
+ commitArr.forEach(function(c) {
1179
+ if (c === commit2) {
1180
+ line += " *";
1181
+ } else {
1182
+ line += " |";
1183
+ }
1184
+ });
1185
+ const label = [line, commit2.id, commit2.seq];
1186
+ for (let branch2 in branches) {
1187
+ if (branches[branch2] === commit2.id) {
1188
+ label.push(branch2);
1189
+ }
1190
+ }
1191
+ log$1.debug(label.join(" "));
1192
+ if (commit2.parents && commit2.parents.length == 2) {
1193
+ const newCommit = commits[commit2.parents[0]];
1194
+ upsert(commitArr, commit2, newCommit);
1195
+ commitArr.push(commits[commit2.parents[1]]);
1196
+ } else if (commit2.parents.length == 0) {
1197
+ return;
1198
+ } else {
1199
+ const nextCommit = commits[commit2.parents];
1200
+ upsert(commitArr, commit2, nextCommit);
1201
+ }
1202
+ commitArr = uniqBy(commitArr, (c) => c.id);
1203
+ prettyPrintCommitHistory(commitArr);
1204
+ }
1205
+ const prettyPrint = function() {
1206
+ log$1.debug(commits);
1207
+ const node = getCommitsArray()[0];
1208
+ prettyPrintCommitHistory([node]);
1209
+ };
1210
+ const clear$1 = function() {
1211
+ commits = {};
1212
+ head = null;
1213
+ let mainBranch = getConfig().gitGraph.mainBranchName;
1214
+ let mainBranchOrder2 = getConfig().gitGraph.mainBranchOrder;
1215
+ branches = {};
1216
+ branches[mainBranch] = null;
1217
+ branchesConfig = {};
1218
+ branchesConfig[mainBranch] = { name: mainBranch, order: mainBranchOrder2 };
1219
+ curBranch = mainBranch;
1220
+ seq = 0;
1221
+ clear$2();
1222
+ };
1223
+ const getBranchesAsObjArray = function() {
1224
+ const branchesArray = Object.values(branchesConfig).map((branchConfig, i) => {
1225
+ if (branchConfig.order !== null) {
1226
+ return branchConfig;
1227
+ }
1228
+ return {
1229
+ ...branchConfig,
1230
+ order: parseFloat(`0.${i}`, 10)
1231
+ };
1232
+ }).sort((a, b) => a.order - b.order).map(({ name }) => ({ name }));
1233
+ return branchesArray;
1234
+ };
1235
+ const getBranches = function() {
1236
+ return branches;
1237
+ };
1238
+ const getCommits = function() {
1239
+ return commits;
1240
+ };
1241
+ const getCommitsArray = function() {
1242
+ const commitArr = Object.keys(commits).map(function(key) {
1243
+ return commits[key];
1244
+ });
1245
+ commitArr.forEach(function(o) {
1246
+ log$1.debug(o.id);
1247
+ });
1248
+ commitArr.sort((a, b) => a.seq - b.seq);
1249
+ return commitArr;
1250
+ };
1251
+ const getCurrentBranch = function() {
1252
+ return curBranch;
1253
+ };
1254
+ const getDirection = function() {
1255
+ return direction;
1256
+ };
1257
+ const getHead = function() {
1258
+ return head;
1259
+ };
1260
+ const commitType$1 = {
1261
+ NORMAL: 0,
1262
+ REVERSE: 1,
1263
+ HIGHLIGHT: 2,
1264
+ MERGE: 3,
1265
+ CHERRY_PICK: 4
1266
+ };
1267
+ const gitGraphDb = {
1268
+ getConfig: () => getConfig().gitGraph,
1269
+ setDirection,
1270
+ setOptions,
1271
+ getOptions,
1272
+ commit,
1273
+ branch,
1274
+ merge,
1275
+ cherryPick,
1276
+ checkout,
1277
+ //reset,
1278
+ prettyPrint,
1279
+ clear: clear$1,
1280
+ getBranchesAsObjArray,
1281
+ getBranches,
1282
+ getCommits,
1283
+ getCommitsArray,
1284
+ getCurrentBranch,
1285
+ getDirection,
1286
+ getHead,
1287
+ setAccTitle,
1288
+ getAccTitle,
1289
+ getAccDescription,
1290
+ setAccDescription,
1291
+ setDiagramTitle,
1292
+ getDiagramTitle,
1293
+ commitType: commitType$1
1294
+ };
1295
+ let allCommitsDict = {};
1296
+ const commitType = {
1297
+ NORMAL: 0,
1298
+ REVERSE: 1,
1299
+ HIGHLIGHT: 2,
1300
+ MERGE: 3,
1301
+ CHERRY_PICK: 4
1302
+ };
1303
+ const THEME_COLOR_LIMIT = 8;
1304
+ let branchPos = {};
1305
+ let commitPos = {};
1306
+ let lanes = [];
1307
+ let maxPos = 0;
1308
+ let dir = "LR";
1309
+ const clear = () => {
1310
+ branchPos = {};
1311
+ commitPos = {};
1312
+ allCommitsDict = {};
1313
+ maxPos = 0;
1314
+ lanes = [];
1315
+ dir = "LR";
1316
+ };
1317
+ const drawText = (txt) => {
1318
+ const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
1319
+ let rows = [];
1320
+ if (typeof txt === "string") {
1321
+ rows = txt.split(/\\n|\n|<br\s*\/?>/gi);
1322
+ } else if (Array.isArray(txt)) {
1323
+ rows = txt;
1324
+ } else {
1325
+ rows = [];
1326
+ }
1327
+ for (const row of rows) {
1328
+ const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1329
+ tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
1330
+ tspan.setAttribute("dy", "1em");
1331
+ tspan.setAttribute("x", "0");
1332
+ tspan.setAttribute("class", "row");
1333
+ tspan.textContent = row.trim();
1334
+ svgLabel.appendChild(tspan);
1335
+ }
1336
+ return svgLabel;
1337
+ };
1338
+ const findClosestParent = (parents) => {
1339
+ let closestParent = "";
1340
+ let maxPosition = 0;
1341
+ parents.forEach((parent) => {
1342
+ const parentPosition = dir === "TB" ? commitPos[parent].y : commitPos[parent].x;
1343
+ if (parentPosition >= maxPosition) {
1344
+ closestParent = parent;
1345
+ maxPosition = parentPosition;
1346
+ }
1347
+ });
1348
+ return closestParent || void 0;
1349
+ };
1350
+ const drawCommits = (svg, commits2, modifyGraph) => {
1351
+ const gitGraphConfig = getConfig().gitGraph;
1352
+ const gBullets = svg.append("g").attr("class", "commit-bullets");
1353
+ const gLabels = svg.append("g").attr("class", "commit-labels");
1354
+ let pos = 0;
1355
+ if (dir === "TB") {
1356
+ pos = 30;
1357
+ }
1358
+ const keys = Object.keys(commits2);
1359
+ const sortedKeys = keys.sort((a, b) => {
1360
+ return commits2[a].seq - commits2[b].seq;
1361
+ });
1362
+ const isParallelCommits = gitGraphConfig.parallelCommits;
1363
+ const layoutOffset = 10;
1364
+ const commitStep = 40;
1365
+ sortedKeys.forEach((key) => {
1366
+ const commit2 = commits2[key];
1367
+ if (isParallelCommits) {
1368
+ if (commit2.parents.length) {
1369
+ const closestParent = findClosestParent(commit2.parents);
1370
+ pos = dir === "TB" ? commitPos[closestParent].y + commitStep : commitPos[closestParent].x + commitStep;
1371
+ } else {
1372
+ pos = 0;
1373
+ if (dir === "TB") {
1374
+ pos = 30;
1375
+ }
1376
+ }
1377
+ }
1378
+ const posWithOffset = pos + layoutOffset;
1379
+ const y = dir === "TB" ? posWithOffset : branchPos[commit2.branch].pos;
1380
+ const x = dir === "TB" ? branchPos[commit2.branch].pos : posWithOffset;
1381
+ if (modifyGraph) {
1382
+ let typeClass;
1383
+ let commitSymbolType = commit2.customType !== void 0 && commit2.customType !== "" ? commit2.customType : commit2.type;
1384
+ switch (commitSymbolType) {
1385
+ case commitType.NORMAL:
1386
+ typeClass = "commit-normal";
1387
+ break;
1388
+ case commitType.REVERSE:
1389
+ typeClass = "commit-reverse";
1390
+ break;
1391
+ case commitType.HIGHLIGHT:
1392
+ typeClass = "commit-highlight";
1393
+ break;
1394
+ case commitType.MERGE:
1395
+ typeClass = "commit-merge";
1396
+ break;
1397
+ case commitType.CHERRY_PICK:
1398
+ typeClass = "commit-cherry-pick";
1399
+ break;
1400
+ default:
1401
+ typeClass = "commit-normal";
1402
+ }
1403
+ if (commitSymbolType === commitType.HIGHLIGHT) {
1404
+ const circle = gBullets.append("rect");
1405
+ circle.attr("x", x - 10);
1406
+ circle.attr("y", y - 10);
1407
+ circle.attr("height", 20);
1408
+ circle.attr("width", 20);
1409
+ circle.attr(
1410
+ "class",
1411
+ `commit ${commit2.id} commit-highlight${branchPos[commit2.branch].index % THEME_COLOR_LIMIT} ${typeClass}-outer`
1412
+ );
1413
+ gBullets.append("rect").attr("x", x - 6).attr("y", y - 6).attr("height", 12).attr("width", 12).attr(
1414
+ "class",
1415
+ `commit ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT} ${typeClass}-inner`
1416
+ );
1417
+ } else if (commitSymbolType === commitType.CHERRY_PICK) {
1418
+ gBullets.append("circle").attr("cx", x).attr("cy", y).attr("r", 10).attr("class", `commit ${commit2.id} ${typeClass}`);
1419
+ gBullets.append("circle").attr("cx", x - 3).attr("cy", y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`);
1420
+ gBullets.append("circle").attr("cx", x + 3).attr("cy", y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`);
1421
+ gBullets.append("line").attr("x1", x + 3).attr("y1", y + 1).attr("x2", x).attr("y2", y - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`);
1422
+ gBullets.append("line").attr("x1", x - 3).attr("y1", y + 1).attr("x2", x).attr("y2", y - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`);
1423
+ } else {
1424
+ const circle = gBullets.append("circle");
1425
+ circle.attr("cx", x);
1426
+ circle.attr("cy", y);
1427
+ circle.attr("r", commit2.type === commitType.MERGE ? 9 : 10);
1428
+ circle.attr(
1429
+ "class",
1430
+ `commit ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}`
1431
+ );
1432
+ if (commitSymbolType === commitType.MERGE) {
1433
+ const circle2 = gBullets.append("circle");
1434
+ circle2.attr("cx", x);
1435
+ circle2.attr("cy", y);
1436
+ circle2.attr("r", 6);
1437
+ circle2.attr(
1438
+ "class",
1439
+ `commit ${typeClass} ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}`
1440
+ );
1441
+ }
1442
+ if (commitSymbolType === commitType.REVERSE) {
1443
+ const cross = gBullets.append("path");
1444
+ cross.attr("d", `M ${x - 5},${y - 5}L${x + 5},${y + 5}M${x - 5},${y + 5}L${x + 5},${y - 5}`).attr(
1445
+ "class",
1446
+ `commit ${typeClass} ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}`
1447
+ );
1448
+ }
1449
+ }
1450
+ }
1451
+ if (dir === "TB") {
1452
+ commitPos[commit2.id] = { x, y: posWithOffset };
1453
+ } else {
1454
+ commitPos[commit2.id] = { x: posWithOffset, y };
1455
+ }
1456
+ if (modifyGraph) {
1457
+ const px = 4;
1458
+ const py = 2;
1459
+ if (commit2.type !== commitType.CHERRY_PICK && (commit2.customId && commit2.type === commitType.MERGE || commit2.type !== commitType.MERGE) && gitGraphConfig.showCommitLabel) {
1460
+ const wrapper = gLabels.append("g");
1461
+ const labelBkg = wrapper.insert("rect").attr("class", "commit-label-bkg");
1462
+ const text = wrapper.append("text").attr("x", pos).attr("y", y + 25).attr("class", "commit-label").text(commit2.id);
1463
+ let bbox = text.node().getBBox();
1464
+ labelBkg.attr("x", posWithOffset - bbox.width / 2 - py).attr("y", y + 13.5).attr("width", bbox.width + 2 * py).attr("height", bbox.height + 2 * py);
1465
+ if (dir === "TB") {
1466
+ labelBkg.attr("x", x - (bbox.width + 4 * px + 5)).attr("y", y - 12);
1467
+ text.attr("x", x - (bbox.width + 4 * px)).attr("y", y + bbox.height - 12);
1468
+ }
1469
+ if (dir !== "TB") {
1470
+ text.attr("x", posWithOffset - bbox.width / 2);
1471
+ }
1472
+ if (gitGraphConfig.rotateCommitLabel) {
1473
+ if (dir === "TB") {
1474
+ text.attr("transform", "rotate(-45, " + x + ", " + y + ")");
1475
+ labelBkg.attr("transform", "rotate(-45, " + x + ", " + y + ")");
1476
+ } else {
1477
+ let r_x = -7.5 - (bbox.width + 10) / 25 * 9.5;
1478
+ let r_y = 10 + bbox.width / 25 * 8.5;
1479
+ wrapper.attr(
1480
+ "transform",
1481
+ "translate(" + r_x + ", " + r_y + ") rotate(-45, " + pos + ", " + y + ")"
1482
+ );
1483
+ }
1484
+ }
1485
+ }
1486
+ if (commit2.tag) {
1487
+ const rect = gLabels.insert("polygon");
1488
+ const hole = gLabels.append("circle");
1489
+ const tag = gLabels.append("text").attr("y", y - 16).attr("class", "tag-label").text(commit2.tag);
1490
+ let tagBbox = tag.node().getBBox();
1491
+ tag.attr("x", posWithOffset - tagBbox.width / 2);
1492
+ const h2 = tagBbox.height / 2;
1493
+ const ly = y - 19.2;
1494
+ rect.attr("class", "tag-label-bkg").attr(
1495
+ "points",
1496
+ `
1497
+ ${pos - tagBbox.width / 2 - px / 2},${ly + py}
1498
+ ${pos - tagBbox.width / 2 - px / 2},${ly - py}
1499
+ ${posWithOffset - tagBbox.width / 2 - px},${ly - h2 - py}
1500
+ ${posWithOffset + tagBbox.width / 2 + px},${ly - h2 - py}
1501
+ ${posWithOffset + tagBbox.width / 2 + px},${ly + h2 + py}
1502
+ ${posWithOffset - tagBbox.width / 2 - px},${ly + h2 + py}`
1503
+ );
1504
+ hole.attr("cx", pos - tagBbox.width / 2 + px / 2).attr("cy", ly).attr("r", 1.5).attr("class", "tag-hole");
1505
+ if (dir === "TB") {
1506
+ rect.attr("class", "tag-label-bkg").attr(
1507
+ "points",
1508
+ `
1509
+ ${x},${pos + py}
1510
+ ${x},${pos - py}
1511
+ ${x + layoutOffset},${pos - h2 - py}
1512
+ ${x + layoutOffset + tagBbox.width + px},${pos - h2 - py}
1513
+ ${x + layoutOffset + tagBbox.width + px},${pos + h2 + py}
1514
+ ${x + layoutOffset},${pos + h2 + py}`
1515
+ ).attr("transform", "translate(12,12) rotate(45, " + x + "," + pos + ")");
1516
+ hole.attr("cx", x + px / 2).attr("cy", pos).attr("transform", "translate(12,12) rotate(45, " + x + "," + pos + ")");
1517
+ tag.attr("x", x + 5).attr("y", pos + 3).attr("transform", "translate(14,14) rotate(45, " + x + "," + pos + ")");
1518
+ }
1519
+ }
1520
+ }
1521
+ pos += commitStep + layoutOffset;
1522
+ if (pos > maxPos) {
1523
+ maxPos = pos;
1524
+ }
1525
+ });
1526
+ };
1527
+ const shouldRerouteArrow = (commitA, commitB, p1, p2, allCommits) => {
1528
+ const commitBIsFurthest = dir === "TB" ? p1.x < p2.x : p1.y < p2.y;
1529
+ const branchToGetCurve = commitBIsFurthest ? commitB.branch : commitA.branch;
1530
+ const isOnBranchToGetCurve = (x) => x.branch === branchToGetCurve;
1531
+ const isBetweenCommits = (x) => x.seq > commitA.seq && x.seq < commitB.seq;
1532
+ return Object.values(allCommits).some((commitX) => {
1533
+ return isBetweenCommits(commitX) && isOnBranchToGetCurve(commitX);
1534
+ });
1535
+ };
1536
+ const findLane = (y1, y2, depth = 0) => {
1537
+ const candidate = y1 + Math.abs(y1 - y2) / 2;
1538
+ if (depth > 5) {
1539
+ return candidate;
1540
+ }
1541
+ let ok = lanes.every((lane) => Math.abs(lane - candidate) >= 10);
1542
+ if (ok) {
1543
+ lanes.push(candidate);
1544
+ return candidate;
1545
+ }
1546
+ const diff = Math.abs(y1 - y2);
1547
+ return findLane(y1, y2 - diff / 5, depth + 1);
1548
+ };
1549
+ const drawArrow = (svg, commitA, commitB, allCommits) => {
1550
+ const p1 = commitPos[commitA.id];
1551
+ const p2 = commitPos[commitB.id];
1552
+ const arrowNeedsRerouting = shouldRerouteArrow(commitA, commitB, p1, p2, allCommits);
1553
+ let arc = "";
1554
+ let arc2 = "";
1555
+ let radius = 0;
1556
+ let offset = 0;
1557
+ let colorClassNum = branchPos[commitB.branch].index;
1558
+ if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) {
1559
+ colorClassNum = branchPos[commitA.branch].index;
1560
+ }
1561
+ let lineDef;
1562
+ if (arrowNeedsRerouting) {
1563
+ arc = "A 10 10, 0, 0, 0,";
1564
+ arc2 = "A 10 10, 0, 0, 1,";
1565
+ radius = 10;
1566
+ offset = 10;
1567
+ const lineY = p1.y < p2.y ? findLane(p1.y, p2.y) : findLane(p2.y, p1.y);
1568
+ const lineX = p1.x < p2.x ? findLane(p1.x, p2.x) : findLane(p2.x, p1.x);
1569
+ if (dir === "TB") {
1570
+ if (p1.x < p2.x) {
1571
+ lineDef = `M ${p1.x} ${p1.y} L ${lineX - radius} ${p1.y} ${arc2} ${lineX} ${p1.y + offset} L ${lineX} ${p2.y - radius} ${arc} ${lineX + offset} ${p2.y} L ${p2.x} ${p2.y}`;
1572
+ } else {
1573
+ colorClassNum = branchPos[commitA.branch].index;
1574
+ lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius} ${p1.y} ${arc} ${lineX} ${p1.y + offset} L ${lineX} ${p2.y - radius} ${arc2} ${lineX - offset} ${p2.y} L ${p2.x} ${p2.y}`;
1575
+ }
1576
+ } else {
1577
+ if (p1.y < p2.y) {
1578
+ lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY - radius} ${arc} ${p1.x + offset} ${lineY} L ${p2.x - radius} ${lineY} ${arc2} ${p2.x} ${lineY + offset} L ${p2.x} ${p2.y}`;
1579
+ } else {
1580
+ colorClassNum = branchPos[commitA.branch].index;
1581
+ lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY + radius} ${arc2} ${p1.x + offset} ${lineY} L ${p2.x - radius} ${lineY} ${arc} ${p2.x} ${lineY - offset} L ${p2.x} ${p2.y}`;
1582
+ }
1583
+ }
1584
+ } else {
1585
+ arc = "A 20 20, 0, 0, 0,";
1586
+ arc2 = "A 20 20, 0, 0, 1,";
1587
+ radius = 20;
1588
+ offset = 20;
1589
+ if (dir === "TB") {
1590
+ if (p1.x < p2.x) {
1591
+ if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) {
1592
+ lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`;
1593
+ } else {
1594
+ lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc2} ${p2.x} ${p1.y + offset} L ${p2.x} ${p2.y}`;
1595
+ }
1596
+ }
1597
+ if (p1.x > p2.x) {
1598
+ arc = "A 20 20, 0, 0, 0,";
1599
+ arc2 = "A 20 20, 0, 0, 1,";
1600
+ radius = 20;
1601
+ offset = 20;
1602
+ if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) {
1603
+ lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc2} ${p1.x - offset} ${p2.y} L ${p2.x} ${p2.y}`;
1604
+ } else {
1605
+ lineDef = `M ${p1.x} ${p1.y} L ${p2.x + radius} ${p1.y} ${arc} ${p2.x} ${p1.y + offset} L ${p2.x} ${p2.y}`;
1606
+ }
1607
+ }
1608
+ if (p1.x === p2.x) {
1609
+ lineDef = `M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`;
1610
+ }
1611
+ } else {
1612
+ if (p1.y < p2.y) {
1613
+ if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) {
1614
+ lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc2} ${p2.x} ${p1.y + offset} L ${p2.x} ${p2.y}`;
1615
+ } else {
1616
+ lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`;
1617
+ }
1618
+ }
1619
+ if (p1.y > p2.y) {
1620
+ if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) {
1621
+ lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc} ${p2.x} ${p1.y - offset} L ${p2.x} ${p2.y}`;
1622
+ } else {
1623
+ lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y + radius} ${arc2} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`;
1624
+ }
1625
+ }
1626
+ if (p1.y === p2.y) {
1627
+ lineDef = `M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`;
1628
+ }
1629
+ }
1630
+ }
1631
+ svg.append("path").attr("d", lineDef).attr("class", "arrow arrow" + colorClassNum % THEME_COLOR_LIMIT);
1632
+ };
1633
+ const drawArrows = (svg, commits2) => {
1634
+ const gArrows = svg.append("g").attr("class", "commit-arrows");
1635
+ Object.keys(commits2).forEach((key) => {
1636
+ const commit2 = commits2[key];
1637
+ if (commit2.parents && commit2.parents.length > 0) {
1638
+ commit2.parents.forEach((parent) => {
1639
+ drawArrow(gArrows, commits2[parent], commit2, commits2);
1640
+ });
1641
+ }
1642
+ });
1643
+ };
1644
+ const drawBranches = (svg, branches2) => {
1645
+ const gitGraphConfig = getConfig().gitGraph;
1646
+ const g = svg.append("g");
1647
+ branches2.forEach((branch2, index) => {
1648
+ const adjustIndexForTheme = index % THEME_COLOR_LIMIT;
1649
+ const pos = branchPos[branch2.name].pos;
1650
+ const line = g.append("line");
1651
+ line.attr("x1", 0);
1652
+ line.attr("y1", pos);
1653
+ line.attr("x2", maxPos);
1654
+ line.attr("y2", pos);
1655
+ line.attr("class", "branch branch" + adjustIndexForTheme);
1656
+ if (dir === "TB") {
1657
+ line.attr("y1", 30);
1658
+ line.attr("x1", pos);
1659
+ line.attr("y2", maxPos);
1660
+ line.attr("x2", pos);
1661
+ }
1662
+ lanes.push(pos);
1663
+ let name = branch2.name;
1664
+ const labelElement = drawText(name);
1665
+ const bkg = g.insert("rect");
1666
+ const branchLabel = g.insert("g").attr("class", "branchLabel");
1667
+ const label = branchLabel.insert("g").attr("class", "label branch-label" + adjustIndexForTheme);
1668
+ label.node().appendChild(labelElement);
1669
+ let bbox = labelElement.getBBox();
1670
+ bkg.attr("class", "branchLabelBkg label" + adjustIndexForTheme).attr("rx", 4).attr("ry", 4).attr("x", -bbox.width - 4 - (gitGraphConfig.rotateCommitLabel === true ? 30 : 0)).attr("y", -bbox.height / 2 + 8).attr("width", bbox.width + 18).attr("height", bbox.height + 4);
1671
+ label.attr(
1672
+ "transform",
1673
+ "translate(" + (-bbox.width - 14 - (gitGraphConfig.rotateCommitLabel === true ? 30 : 0)) + ", " + (pos - bbox.height / 2 - 1) + ")"
1674
+ );
1675
+ if (dir === "TB") {
1676
+ bkg.attr("x", pos - bbox.width / 2 - 10).attr("y", 0);
1677
+ label.attr("transform", "translate(" + (pos - bbox.width / 2 - 5) + ", 0)");
1678
+ }
1679
+ if (dir !== "TB") {
1680
+ bkg.attr("transform", "translate(-19, " + (pos - bbox.height / 2) + ")");
1681
+ }
1682
+ });
1683
+ };
1684
+ const draw = function(txt, id, ver, diagObj) {
1685
+ clear();
1686
+ const conf = getConfig();
1687
+ const gitGraphConfig = conf.gitGraph;
1688
+ log$1.debug("in gitgraph renderer", txt + "\n", "id:", id, ver);
1689
+ allCommitsDict = diagObj.db.getCommits();
1690
+ const branches2 = diagObj.db.getBranchesAsObjArray();
1691
+ dir = diagObj.db.getDirection();
1692
+ const diagram2 = select(`[id="${id}"]`);
1693
+ let pos = 0;
1694
+ branches2.forEach((branch2, index) => {
1695
+ const labelElement = drawText(branch2.name);
1696
+ const g = diagram2.append("g");
1697
+ const branchLabel = g.insert("g").attr("class", "branchLabel");
1698
+ const label = branchLabel.insert("g").attr("class", "label branch-label");
1699
+ label.node().appendChild(labelElement);
1700
+ let bbox = labelElement.getBBox();
1701
+ branchPos[branch2.name] = { pos, index };
1702
+ pos += 50 + (gitGraphConfig.rotateCommitLabel ? 40 : 0) + (dir === "TB" ? bbox.width / 2 : 0);
1703
+ label.remove();
1704
+ branchLabel.remove();
1705
+ g.remove();
1706
+ });
1707
+ drawCommits(diagram2, allCommitsDict, false);
1708
+ if (gitGraphConfig.showBranches) {
1709
+ drawBranches(diagram2, branches2);
1710
+ }
1711
+ drawArrows(diagram2, allCommitsDict);
1712
+ drawCommits(diagram2, allCommitsDict, true);
1713
+ utils.insertTitle(
1714
+ diagram2,
1715
+ "gitTitleText",
1716
+ gitGraphConfig.titleTopMargin,
1717
+ diagObj.db.getDiagramTitle()
1718
+ );
1719
+ setupGraphViewbox(
1720
+ void 0,
1721
+ diagram2,
1722
+ gitGraphConfig.diagramPadding,
1723
+ gitGraphConfig.useMaxWidth ?? conf.useMaxWidth
1724
+ );
1725
+ };
1726
+ const gitGraphRenderer = {
1727
+ draw
1728
+ };
1729
+ const getStyles = (options2) => `
1730
+ .commit-id,
1731
+ .commit-msg,
1732
+ .branch-label {
1733
+ fill: lightgrey;
1734
+ color: lightgrey;
1735
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
1736
+ font-family: var(--mermaid-font-family);
1737
+ }
1738
+ ${[0, 1, 2, 3, 4, 5, 6, 7].map(
1739
+ (i) => `
1740
+ .branch-label${i} { fill: ${options2["gitBranchLabel" + i]}; }
1741
+ .commit${i} { stroke: ${options2["git" + i]}; fill: ${options2["git" + i]}; }
1742
+ .commit-highlight${i} { stroke: ${options2["gitInv" + i]}; fill: ${options2["gitInv" + i]}; }
1743
+ .label${i} { fill: ${options2["git" + i]}; }
1744
+ .arrow${i} { stroke: ${options2["git" + i]}; }
1745
+ `
1746
+ ).join("\n")}
1747
+
1748
+ .branch {
1749
+ stroke-width: 1;
1750
+ stroke: ${options2.lineColor};
1751
+ stroke-dasharray: 2;
1752
+ }
1753
+ .commit-label { font-size: ${options2.commitLabelFontSize}; fill: ${options2.commitLabelColor};}
1754
+ .commit-label-bkg { font-size: ${options2.commitLabelFontSize}; fill: ${options2.commitLabelBackground}; opacity: 0.5; }
1755
+ .tag-label { font-size: ${options2.tagLabelFontSize}; fill: ${options2.tagLabelColor};}
1756
+ .tag-label-bkg { fill: ${options2.tagLabelBackground}; stroke: ${options2.tagLabelBorder}; }
1757
+ .tag-hole { fill: ${options2.textColor}; }
1758
+
1759
+ .commit-merge {
1760
+ stroke: ${options2.primaryColor};
1761
+ fill: ${options2.primaryColor};
1762
+ }
1763
+ .commit-reverse {
1764
+ stroke: ${options2.primaryColor};
1765
+ fill: ${options2.primaryColor};
1766
+ stroke-width: 3;
1767
+ }
1768
+ .commit-highlight-outer {
1769
+ }
1770
+ .commit-highlight-inner {
1771
+ stroke: ${options2.primaryColor};
1772
+ fill: ${options2.primaryColor};
1773
+ }
1774
+
1775
+ .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
1776
+ .gitTitleText {
1777
+ text-anchor: middle;
1778
+ font-size: 18px;
1779
+ fill: ${options2.textColor};
1780
+ }
1781
+ `;
1782
+ const gitGraphStyles = getStyles;
1783
+ const diagram = {
1784
+ parser: gitGraphParser,
1785
+ db: gitGraphDb,
1786
+ renderer: gitGraphRenderer,
1787
+ styles: gitGraphStyles
1788
+ };
1789
+ export {
1790
+ diagram
1791
+ };