@copilotkitnext/react 0.0.22-alpha.7 → 0.0.22-alpha.8

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 (236) hide show
  1. package/package.json +4 -4
  2. package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  3. package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  4. package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  5. package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  6. package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  7. package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  8. package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  9. package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  10. package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  11. package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  12. package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  13. package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  14. package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  15. package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  16. package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  17. package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  18. package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  19. package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  20. package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  21. package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  22. package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  23. package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  24. package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  25. package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  26. package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  27. package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  28. package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  29. package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  30. package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  31. package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  32. package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  33. package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  34. package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  35. package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  36. package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  37. package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  38. package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  39. package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  40. package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  41. package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  42. package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  43. package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  44. package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  45. package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  46. package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  47. package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  48. package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  49. package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  50. package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  51. package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  52. package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  53. package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  54. package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  55. package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  56. package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  57. package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  58. package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  59. package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  60. package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  61. package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  62. package/dist/angular-html-LD6QEAZE.mjs +0 -7
  63. package/dist/angular-html-LD6QEAZE.mjs.map +0 -1
  64. package/dist/angular-ts-FGK7I2F5.mjs +0 -37
  65. package/dist/angular-ts-FGK7I2F5.mjs.map +0 -1
  66. package/dist/angular-ts-XZTE5LQS.mjs +0 -37
  67. package/dist/angular-ts-XZTE5LQS.mjs.map +0 -1
  68. package/dist/apl-VB2EG5RZ.mjs +0 -22
  69. package/dist/apl-VB2EG5RZ.mjs.map +0 -1
  70. package/dist/architectureDiagram-VXUJARFQ-PPLKSFYC.mjs +0 -8712
  71. package/dist/architectureDiagram-VXUJARFQ-PPLKSFYC.mjs.map +0 -1
  72. package/dist/blade-EZDWULER.mjs +0 -26
  73. package/dist/blade-EZDWULER.mjs.map +0 -1
  74. package/dist/blade-HS4Z7O3Y.mjs +0 -26
  75. package/dist/blade-HS4Z7O3Y.mjs.map +0 -1
  76. package/dist/blockDiagram-VD42YOAC-7SIEWHYD.mjs +0 -3618
  77. package/dist/blockDiagram-VD42YOAC-7SIEWHYD.mjs.map +0 -1
  78. package/dist/c4Diagram-YG6GDRKO-G2UUBRHQ.mjs +0 -2495
  79. package/dist/c4Diagram-YG6GDRKO-G2UUBRHQ.mjs.map +0 -1
  80. package/dist/chunk-2BAFECUC.mjs +0 -28
  81. package/dist/chunk-2BAFECUC.mjs.map +0 -1
  82. package/dist/chunk-BF5LDW2L.mjs +0 -65
  83. package/dist/chunk-BF5LDW2L.mjs.map +0 -1
  84. package/dist/chunk-BUEC2HNL.mjs +0 -762
  85. package/dist/chunk-BUEC2HNL.mjs.map +0 -1
  86. package/dist/chunk-CRGJ2YCV.mjs +0 -109
  87. package/dist/chunk-CRGJ2YCV.mjs.map +0 -1
  88. package/dist/chunk-DKZXT4VQ.mjs +0 -19
  89. package/dist/chunk-DKZXT4VQ.mjs.map +0 -1
  90. package/dist/chunk-DYQXFOGA.mjs +0 -34
  91. package/dist/chunk-DYQXFOGA.mjs.map +0 -1
  92. package/dist/chunk-ENI667QL.mjs +0 -806
  93. package/dist/chunk-ENI667QL.mjs.map +0 -1
  94. package/dist/chunk-GEUZOPED.mjs +0 -1834
  95. package/dist/chunk-GEUZOPED.mjs.map +0 -1
  96. package/dist/chunk-GU7334FJ.mjs +0 -538
  97. package/dist/chunk-GU7334FJ.mjs.map +0 -1
  98. package/dist/chunk-HNKEYT4A.mjs +0 -4693
  99. package/dist/chunk-HNKEYT4A.mjs.map +0 -1
  100. package/dist/chunk-HTMHAYGC.mjs +0 -14
  101. package/dist/chunk-HTMHAYGC.mjs.map +0 -1
  102. package/dist/chunk-JRLFMJ6U.mjs +0 -1923
  103. package/dist/chunk-JRLFMJ6U.mjs.map +0 -1
  104. package/dist/chunk-JYRND4DC.mjs +0 -22
  105. package/dist/chunk-JYRND4DC.mjs.map +0 -1
  106. package/dist/chunk-KFEPUFID.mjs +0 -52
  107. package/dist/chunk-KFEPUFID.mjs.map +0 -1
  108. package/dist/chunk-M3UH7XZX.mjs +0 -6222
  109. package/dist/chunk-M3UH7XZX.mjs.map +0 -1
  110. package/dist/chunk-ND4RYWG7.mjs +0 -12
  111. package/dist/chunk-ND4RYWG7.mjs.map +0 -1
  112. package/dist/chunk-VLSLBZME.mjs +0 -51
  113. package/dist/chunk-VLSLBZME.mjs.map +0 -1
  114. package/dist/chunk-WJBV3P3K.mjs +0 -55
  115. package/dist/chunk-WJBV3P3K.mjs.map +0 -1
  116. package/dist/chunk-X2TQ2HDS.mjs +0 -44
  117. package/dist/chunk-X2TQ2HDS.mjs.map +0 -1
  118. package/dist/chunk-YIDZOZG3.mjs +0 -103
  119. package/dist/chunk-YIDZOZG3.mjs.map +0 -1
  120. package/dist/chunk-YLW7IP7V.mjs +0 -14525
  121. package/dist/chunk-YLW7IP7V.mjs.map +0 -1
  122. package/dist/classDiagram-2ON5EDUG-WUV4PTK5.mjs +0 -38
  123. package/dist/classDiagram-2ON5EDUG-WUV4PTK5.mjs.map +0 -1
  124. package/dist/classDiagram-v2-WZHVMYZB-J4QNVYPE.mjs +0 -38
  125. package/dist/classDiagram-v2-WZHVMYZB-J4QNVYPE.mjs.map +0 -1
  126. package/dist/cobol-PNTKRG5I.mjs +0 -17
  127. package/dist/cobol-PNTKRG5I.mjs.map +0 -1
  128. package/dist/crystal-BSMHK65A.mjs +0 -23
  129. package/dist/crystal-BSMHK65A.mjs.map +0 -1
  130. package/dist/dagre-6UL2VRFP-XN667C7N.mjs +0 -710
  131. package/dist/dagre-6UL2VRFP-XN667C7N.mjs.map +0 -1
  132. package/dist/diagram-PSM6KHXK-VA2CF5LZ.mjs +0 -538
  133. package/dist/diagram-PSM6KHXK-VA2CF5LZ.mjs.map +0 -1
  134. package/dist/diagram-QEK2KX5R-H3EHES33.mjs +0 -319
  135. package/dist/diagram-QEK2KX5R-H3EHES33.mjs.map +0 -1
  136. package/dist/diagram-S2PKOQOG-FOQYPB22.mjs +0 -231
  137. package/dist/diagram-S2PKOQOG-FOQYPB22.mjs.map +0 -1
  138. package/dist/edge-JOI74UJM.mjs +0 -19
  139. package/dist/edge-JOI74UJM.mjs.map +0 -1
  140. package/dist/elixir-FEL6DDPJ.mjs +0 -15
  141. package/dist/elixir-FEL6DDPJ.mjs.map +0 -1
  142. package/dist/erDiagram-Q2GNP2WA-IXNJSD2A.mjs +0 -1175
  143. package/dist/erDiagram-Q2GNP2WA-IXNJSD2A.mjs.map +0 -1
  144. package/dist/erb-Q2D6FWX3.mjs +0 -32
  145. package/dist/erb-Q2D6FWX3.mjs.map +0 -1
  146. package/dist/flowDiagram-NV44I4VS-ISKGEBMD.mjs +0 -2349
  147. package/dist/flowDiagram-NV44I4VS-ISKGEBMD.mjs.map +0 -1
  148. package/dist/ganttDiagram-LVOFAZNH-OAL7V7IR.mjs +0 -2344
  149. package/dist/ganttDiagram-LVOFAZNH-OAL7V7IR.mjs.map +0 -1
  150. package/dist/gitGraphDiagram-NY62KEGX-RKN2CCAZ.mjs +0 -1221
  151. package/dist/gitGraphDiagram-NY62KEGX-RKN2CCAZ.mjs.map +0 -1
  152. package/dist/glimmer-js-B32LCGFA.mjs +0 -19
  153. package/dist/glimmer-js-B32LCGFA.mjs.map +0 -1
  154. package/dist/glimmer-ts-4PHFAQCG.mjs +0 -19
  155. package/dist/glimmer-ts-4PHFAQCG.mjs.map +0 -1
  156. package/dist/hack-3ZNSL4KD.mjs +0 -17
  157. package/dist/hack-3ZNSL4KD.mjs.map +0 -1
  158. package/dist/handlebars-ICBC3AZK.mjs +0 -19
  159. package/dist/handlebars-ICBC3AZK.mjs.map +0 -1
  160. package/dist/html-BGY5P773.mjs +0 -6
  161. package/dist/html-BGY5P773.mjs.map +0 -1
  162. package/dist/html-derivative-3HGXHHFE.mjs +0 -7
  163. package/dist/html-derivative-3HGXHHFE.mjs.map +0 -1
  164. package/dist/index.css +0 -2385
  165. package/dist/index.css.map +0 -1
  166. package/dist/infoDiagram-F6ZHWCRC-Z7KMJJ45.mjs +0 -49
  167. package/dist/infoDiagram-F6ZHWCRC-Z7KMJJ45.mjs.map +0 -1
  168. package/dist/jinja-WL6HNMB5.mjs +0 -22
  169. package/dist/jinja-WL6HNMB5.mjs.map +0 -1
  170. package/dist/journeyDiagram-XKPGCS4Q-BMTOBHZ4.mjs +0 -1259
  171. package/dist/journeyDiagram-XKPGCS4Q-BMTOBHZ4.mjs.map +0 -1
  172. package/dist/kanban-definition-3W4ZIXB7-MVFRARF4.mjs +0 -1062
  173. package/dist/kanban-definition-3W4ZIXB7-MVFRARF4.mjs.map +0 -1
  174. package/dist/katex-4R42CMCB.mjs +0 -4
  175. package/dist/katex-4R42CMCB.mjs.map +0 -1
  176. package/dist/liquid-YS3YPW54.mjs +0 -19
  177. package/dist/liquid-YS3YPW54.mjs.map +0 -1
  178. package/dist/logo-mark-OHF64HAY.svg +0 -8
  179. package/dist/mdc-A66KLOT4.mjs +0 -20
  180. package/dist/mdc-A66KLOT4.mjs.map +0 -1
  181. package/dist/mermaid.core-4OWTNZSL.mjs +0 -1587
  182. package/dist/mermaid.core-4OWTNZSL.mjs.map +0 -1
  183. package/dist/mermaid.core-7AUE4M6E.mjs +0 -1587
  184. package/dist/mermaid.core-7AUE4M6E.mjs.map +0 -1
  185. package/dist/mindmap-definition-VGOIOE7T-7FMA2CPY.mjs +0 -1112
  186. package/dist/mindmap-definition-VGOIOE7T-7FMA2CPY.mjs.map +0 -1
  187. package/dist/mindmap-definition-VGOIOE7T-VNF7JZOY.mjs +0 -1112
  188. package/dist/mindmap-definition-VGOIOE7T-VNF7JZOY.mjs.map +0 -1
  189. package/dist/nim-HUBKBJHZ.mjs +0 -26
  190. package/dist/nim-HUBKBJHZ.mjs.map +0 -1
  191. package/dist/perl-QHAMWWQ5.mjs +0 -22
  192. package/dist/perl-QHAMWWQ5.mjs.map +0 -1
  193. package/dist/php-FS5GKSPN.mjs +0 -11
  194. package/dist/php-FS5GKSPN.mjs.map +0 -1
  195. package/dist/pieDiagram-ADFJNKIX-EER3WTCU.mjs +0 -200
  196. package/dist/pieDiagram-ADFJNKIX-EER3WTCU.mjs.map +0 -1
  197. package/dist/pug-WTY5FMEA.mjs +0 -17
  198. package/dist/pug-WTY5FMEA.mjs.map +0 -1
  199. package/dist/quadrantDiagram-AYHSOK5B-WQCIRJOK.mjs +0 -1344
  200. package/dist/quadrantDiagram-AYHSOK5B-WQCIRJOK.mjs.map +0 -1
  201. package/dist/razor-BAB7LFWZ.mjs +0 -17
  202. package/dist/razor-BAB7LFWZ.mjs.map +0 -1
  203. package/dist/requirementDiagram-UZGBJVZJ-RVM6Q2TT.mjs +0 -1179
  204. package/dist/requirementDiagram-UZGBJVZJ-RVM6Q2TT.mjs.map +0 -1
  205. package/dist/rst-AY7U27YM.mjs +0 -41
  206. package/dist/rst-AY7U27YM.mjs.map +0 -1
  207. package/dist/rst-Y2VLYMJI.mjs +0 -41
  208. package/dist/rst-Y2VLYMJI.mjs.map +0 -1
  209. package/dist/ruby-K4BNEYWG.mjs +0 -22
  210. package/dist/ruby-K4BNEYWG.mjs.map +0 -1
  211. package/dist/sankeyDiagram-TZEHDZUN-H7BVEXGO.mjs +0 -1230
  212. package/dist/sankeyDiagram-TZEHDZUN-H7BVEXGO.mjs.map +0 -1
  213. package/dist/sequenceDiagram-WL72ISMW-XBGZSOYI.mjs +0 -3885
  214. package/dist/sequenceDiagram-WL72ISMW-XBGZSOYI.mjs.map +0 -1
  215. package/dist/soy-5QMQV2KL.mjs +0 -15
  216. package/dist/soy-5QMQV2KL.mjs.map +0 -1
  217. package/dist/stateDiagram-FKZM4ZOC-WRIBVFSJ.mjs +0 -467
  218. package/dist/stateDiagram-FKZM4ZOC-WRIBVFSJ.mjs.map +0 -1
  219. package/dist/stateDiagram-v2-4FDKWEC3-SPDO7R6D.mjs +0 -37
  220. package/dist/stateDiagram-v2-4FDKWEC3-SPDO7R6D.mjs.map +0 -1
  221. package/dist/templ-VSARRSO2.mjs +0 -17
  222. package/dist/templ-VSARRSO2.mjs.map +0 -1
  223. package/dist/timeline-definition-IT6M3QCI-PX4A2RIH.mjs +0 -1226
  224. package/dist/timeline-definition-IT6M3QCI-PX4A2RIH.mjs.map +0 -1
  225. package/dist/ts-tags-YK3Q2LIW.mjs +0 -68
  226. package/dist/ts-tags-YK3Q2LIW.mjs.map +0 -1
  227. package/dist/twig-HNMWLN6H.mjs +0 -40
  228. package/dist/twig-HNMWLN6H.mjs.map +0 -1
  229. package/dist/vue-7OSX6ZY5.mjs +0 -10
  230. package/dist/vue-7OSX6ZY5.mjs.map +0 -1
  231. package/dist/vue-html-AQH2V2EU.mjs +0 -20
  232. package/dist/vue-html-AQH2V2EU.mjs.map +0 -1
  233. package/dist/vue-vine-GCYT2IGV.mjs +0 -29
  234. package/dist/vue-vine-GCYT2IGV.mjs.map +0 -1
  235. package/dist/xychartDiagram-PRI3JC2R-65KZQZDU.mjs +0 -1865
  236. package/dist/xychartDiagram-PRI3JC2R-65KZQZDU.mjs.map +0 -1
@@ -1,1923 +0,0 @@
1
- import { getDiagramElement } from './chunk-7EWC2ACY.mjs';
2
- import { setupViewPortForSVG } from './chunk-2BAFECUC.mjs';
3
- import { render } from './chunk-BF5LDW2L.mjs';
4
- import { generateId, utils_default } from './chunk-GU7334FJ.mjs';
5
- import { getAccTitle, setAccTitle, getAccDescription, setAccDescription, setDiagramTitle, getDiagramTitle, getConfig2, common_default, clear } from './chunk-HNKEYT4A.mjs';
6
- import { __name, log } from './chunk-WHXHCOFP.mjs';
7
-
8
- // ../../node_modules/.pnpm/mermaid@11.12.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DI55MBZ5.mjs
9
- var parser = function() {
10
- var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
11
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
12
- return o2;
13
- }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 16], $V7 = [1, 17], $V8 = [1, 18], $V9 = [1, 19], $Va = [1, 33], $Vb = [1, 20], $Vc = [1, 21], $Vd = [1, 22], $Ve = [1, 23], $Vf = [1, 24], $Vg = [1, 26], $Vh = [1, 27], $Vi = [1, 28], $Vj = [1, 29], $Vk = [1, 30], $Vl = [1, 31], $Vm = [1, 32], $Vn = [1, 35], $Vo = [1, 36], $Vp = [1, 37], $Vq = [1, 38], $Vr = [1, 34], $Vs = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], $Vt = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 39, 40, 41, 45, 48, 51, 52, 53, 54, 57], $Vu = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57];
14
- var parser2 = {
15
- trace: /* @__PURE__ */ __name(function trace() {
16
- }, "trace"),
17
- yy: {},
18
- symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "classDefStatement": 10, "styleStatement": 11, "cssClassStatement": 12, "idStatement": 13, "DESCR": 14, "-->": 15, "HIDE_EMPTY": 16, "scale": 17, "WIDTH": 18, "COMPOSIT_STATE": 19, "STRUCT_START": 20, "STRUCT_STOP": 21, "STATE_DESCR": 22, "AS": 23, "ID": 24, "FORK": 25, "JOIN": 26, "CHOICE": 27, "CONCURRENT": 28, "note": 29, "notePosition": 30, "NOTE_TEXT": 31, "direction": 32, "acc_title": 33, "acc_title_value": 34, "acc_descr": 35, "acc_descr_value": 36, "acc_descr_multiline_value": 37, "CLICK": 38, "STRING": 39, "HREF": 40, "classDef": 41, "CLASSDEF_ID": 42, "CLASSDEF_STYLEOPTS": 43, "DEFAULT": 44, "style": 45, "STYLE_IDS": 46, "STYLEDEF_STYLEOPTS": 47, "class": 48, "CLASSENTITY_IDS": 49, "STYLECLASS": 50, "direction_tb": 51, "direction_bt": 52, "direction_rl": 53, "direction_lr": 54, "eol": 55, ";": 56, "EDGE_STATE": 57, "STYLE_SEPARATOR": 58, "left_of": 59, "right_of": 60, "$accept": 0, "$end": 1 },
19
- terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "CLICK", 39: "STRING", 40: "HREF", 41: "classDef", 42: "CLASSDEF_ID", 43: "CLASSDEF_STYLEOPTS", 44: "DEFAULT", 45: "style", 46: "STYLE_IDS", 47: "STYLEDEF_STYLEOPTS", 48: "class", 49: "CLASSENTITY_IDS", 50: "STYLECLASS", 51: "direction_tb", 52: "direction_bt", 53: "direction_rl", 54: "direction_lr", 56: ";", 57: "EDGE_STATE", 58: "STYLE_SEPARATOR", 59: "left_of", 60: "right_of" },
20
- productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [9, 5], [9, 5], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [55, 1], [55, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]],
21
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
22
- var $0 = $$.length - 1;
23
- switch (yystate) {
24
- case 3:
25
- yy.setRootDoc($$[$0]);
26
- return $$[$0];
27
- case 4:
28
- this.$ = [];
29
- break;
30
- case 5:
31
- if ($$[$0] != "nl") {
32
- $$[$0 - 1].push($$[$0]);
33
- this.$ = $$[$0 - 1];
34
- }
35
- break;
36
- case 6:
37
- case 7:
38
- this.$ = $$[$0];
39
- break;
40
- case 8:
41
- this.$ = "nl";
42
- break;
43
- case 12:
44
- this.$ = $$[$0];
45
- break;
46
- case 13:
47
- const stateStmt = $$[$0 - 1];
48
- stateStmt.description = yy.trimColon($$[$0]);
49
- this.$ = stateStmt;
50
- break;
51
- case 14:
52
- this.$ = { stmt: "relation", state1: $$[$0 - 2], state2: $$[$0] };
53
- break;
54
- case 15:
55
- const relDescription = yy.trimColon($$[$0]);
56
- this.$ = { stmt: "relation", state1: $$[$0 - 3], state2: $$[$0 - 1], description: relDescription };
57
- break;
58
- case 19:
59
- this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: "", doc: $$[$0 - 1] };
60
- break;
61
- case 20:
62
- var id = $$[$0];
63
- var description = $$[$0 - 2].trim();
64
- if ($$[$0].match(":")) {
65
- var parts = $$[$0].split(":");
66
- id = parts[0];
67
- description = [description, parts[1]];
68
- }
69
- this.$ = { stmt: "state", id, type: "default", description };
70
- break;
71
- case 21:
72
- this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: $$[$0 - 5], doc: $$[$0 - 1] };
73
- break;
74
- case 22:
75
- this.$ = { stmt: "state", id: $$[$0], type: "fork" };
76
- break;
77
- case 23:
78
- this.$ = { stmt: "state", id: $$[$0], type: "join" };
79
- break;
80
- case 24:
81
- this.$ = { stmt: "state", id: $$[$0], type: "choice" };
82
- break;
83
- case 25:
84
- this.$ = { stmt: "state", id: yy.getDividerId(), type: "divider" };
85
- break;
86
- case 26:
87
- this.$ = { stmt: "state", id: $$[$0 - 1].trim(), note: { position: $$[$0 - 2].trim(), text: $$[$0].trim() } };
88
- break;
89
- case 29:
90
- this.$ = $$[$0].trim();
91
- yy.setAccTitle(this.$);
92
- break;
93
- case 30:
94
- case 31:
95
- this.$ = $$[$0].trim();
96
- yy.setAccDescription(this.$);
97
- break;
98
- case 32:
99
- this.$ = {
100
- stmt: "click",
101
- id: $$[$0 - 3],
102
- url: $$[$0 - 2],
103
- tooltip: $$[$0 - 1]
104
- };
105
- break;
106
- case 33:
107
- this.$ = {
108
- stmt: "click",
109
- id: $$[$0 - 3],
110
- url: $$[$0 - 1],
111
- tooltip: ""
112
- };
113
- break;
114
- case 34:
115
- case 35:
116
- this.$ = { stmt: "classDef", id: $$[$0 - 1].trim(), classes: $$[$0].trim() };
117
- break;
118
- case 36:
119
- this.$ = { stmt: "style", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
120
- break;
121
- case 37:
122
- this.$ = { stmt: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
123
- break;
124
- case 38:
125
- yy.setDirection("TB");
126
- this.$ = { stmt: "dir", value: "TB" };
127
- break;
128
- case 39:
129
- yy.setDirection("BT");
130
- this.$ = { stmt: "dir", value: "BT" };
131
- break;
132
- case 40:
133
- yy.setDirection("RL");
134
- this.$ = { stmt: "dir", value: "RL" };
135
- break;
136
- case 41:
137
- yy.setDirection("LR");
138
- this.$ = { stmt: "dir", value: "LR" };
139
- break;
140
- case 44:
141
- case 45:
142
- this.$ = { stmt: "state", id: $$[$0].trim(), type: "default", description: "" };
143
- break;
144
- case 46:
145
- this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" };
146
- break;
147
- case 47:
148
- this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" };
149
- break;
150
- }
151
- }, "anonymous"),
152
- table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 41: $Vk, 45: $Vl, 48: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 54: $Vq, 57: $Vr }, o($Vs, [2, 5]), { 9: 39, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 41: $Vk, 45: $Vl, 48: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 54: $Vq, 57: $Vr }, o($Vs, [2, 7]), o($Vs, [2, 8]), o($Vs, [2, 9]), o($Vs, [2, 10]), o($Vs, [2, 11]), o($Vs, [2, 12], { 14: [1, 40], 15: [1, 41] }), o($Vs, [2, 16]), { 18: [1, 42] }, o($Vs, [2, 18], { 20: [1, 43] }), { 23: [1, 44] }, o($Vs, [2, 22]), o($Vs, [2, 23]), o($Vs, [2, 24]), o($Vs, [2, 25]), { 30: 45, 31: [1, 46], 59: [1, 47], 60: [1, 48] }, o($Vs, [2, 28]), { 34: [1, 49] }, { 36: [1, 50] }, o($Vs, [2, 31]), { 13: 51, 24: $Va, 57: $Vr }, { 42: [1, 52], 44: [1, 53] }, { 46: [1, 54] }, { 49: [1, 55] }, o($Vt, [2, 44], { 58: [1, 56] }), o($Vt, [2, 45], { 58: [1, 57] }), o($Vs, [2, 38]), o($Vs, [2, 39]), o($Vs, [2, 40]), o($Vs, [2, 41]), o($Vs, [2, 6]), o($Vs, [2, 13]), { 13: 58, 24: $Va, 57: $Vr }, o($Vs, [2, 17]), o($Vu, $V3, { 7: 59 }), { 24: [1, 60] }, { 24: [1, 61] }, { 23: [1, 62] }, { 24: [2, 48] }, { 24: [2, 49] }, o($Vs, [2, 29]), o($Vs, [2, 30]), { 39: [1, 63], 40: [1, 64] }, { 43: [1, 65] }, { 43: [1, 66] }, { 47: [1, 67] }, { 50: [1, 68] }, { 24: [1, 69] }, { 24: [1, 70] }, o($Vs, [2, 14], { 14: [1, 71] }), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 72], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 41: $Vk, 45: $Vl, 48: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 54: $Vq, 57: $Vr }, o($Vs, [2, 20], { 20: [1, 73] }), { 31: [1, 74] }, { 24: [1, 75] }, { 39: [1, 76] }, { 39: [1, 77] }, o($Vs, [2, 34]), o($Vs, [2, 35]), o($Vs, [2, 36]), o($Vs, [2, 37]), o($Vt, [2, 46]), o($Vt, [2, 47]), o($Vs, [2, 15]), o($Vs, [2, 19]), o($Vu, $V3, { 7: 78 }), o($Vs, [2, 26]), o($Vs, [2, 27]), { 5: [1, 79] }, { 5: [1, 80] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 81], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 41: $Vk, 45: $Vl, 48: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 54: $Vq, 57: $Vr }, o($Vs, [2, 32]), o($Vs, [2, 33]), o($Vs, [2, 21])],
153
- defaultActions: { 5: [2, 1], 6: [2, 2], 47: [2, 48], 48: [2, 49] },
154
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
155
- if (hash.recoverable) {
156
- this.trace(str);
157
- } else {
158
- var error = new Error(str);
159
- error.hash = hash;
160
- throw error;
161
- }
162
- }, "parseError"),
163
- parse: /* @__PURE__ */ __name(function parse(input) {
164
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
165
- var args = lstack.slice.call(arguments, 1);
166
- var lexer2 = Object.create(this.lexer);
167
- var sharedState = { yy: {} };
168
- for (var k in this.yy) {
169
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
170
- sharedState.yy[k] = this.yy[k];
171
- }
172
- }
173
- lexer2.setInput(input, sharedState.yy);
174
- sharedState.yy.lexer = lexer2;
175
- sharedState.yy.parser = this;
176
- if (typeof lexer2.yylloc == "undefined") {
177
- lexer2.yylloc = {};
178
- }
179
- var yyloc = lexer2.yylloc;
180
- lstack.push(yyloc);
181
- var ranges = lexer2.options && lexer2.options.ranges;
182
- if (typeof sharedState.yy.parseError === "function") {
183
- this.parseError = sharedState.yy.parseError;
184
- } else {
185
- this.parseError = Object.getPrototypeOf(this).parseError;
186
- }
187
- function popStack(n) {
188
- stack.length = stack.length - 2 * n;
189
- vstack.length = vstack.length - n;
190
- lstack.length = lstack.length - n;
191
- }
192
- __name(popStack, "popStack");
193
- function lex() {
194
- var token;
195
- token = tstack.pop() || lexer2.lex() || EOF;
196
- if (typeof token !== "number") {
197
- if (token instanceof Array) {
198
- tstack = token;
199
- token = tstack.pop();
200
- }
201
- token = self.symbols_[token] || token;
202
- }
203
- return token;
204
- }
205
- __name(lex, "lex");
206
- var symbol, state, action, r, yyval = {}, p, len, newState, expected;
207
- while (true) {
208
- state = stack[stack.length - 1];
209
- if (this.defaultActions[state]) {
210
- action = this.defaultActions[state];
211
- } else {
212
- if (symbol === null || typeof symbol == "undefined") {
213
- symbol = lex();
214
- }
215
- action = table[state] && table[state][symbol];
216
- }
217
- if (typeof action === "undefined" || !action.length || !action[0]) {
218
- var errStr = "";
219
- expected = [];
220
- for (p in table[state]) {
221
- if (this.terminals_[p] && p > TERROR) {
222
- expected.push("'" + this.terminals_[p] + "'");
223
- }
224
- }
225
- if (lexer2.showPosition) {
226
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
227
- } else {
228
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
229
- }
230
- this.parseError(errStr, {
231
- text: lexer2.match,
232
- token: this.terminals_[symbol] || symbol,
233
- line: lexer2.yylineno,
234
- loc: yyloc,
235
- expected
236
- });
237
- }
238
- if (action[0] instanceof Array && action.length > 1) {
239
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
240
- }
241
- switch (action[0]) {
242
- case 1:
243
- stack.push(symbol);
244
- vstack.push(lexer2.yytext);
245
- lstack.push(lexer2.yylloc);
246
- stack.push(action[1]);
247
- symbol = null;
248
- {
249
- yyleng = lexer2.yyleng;
250
- yytext = lexer2.yytext;
251
- yylineno = lexer2.yylineno;
252
- yyloc = lexer2.yylloc;
253
- }
254
- break;
255
- case 2:
256
- len = this.productions_[action[1]][1];
257
- yyval.$ = vstack[vstack.length - len];
258
- yyval._$ = {
259
- first_line: lstack[lstack.length - (len || 1)].first_line,
260
- last_line: lstack[lstack.length - 1].last_line,
261
- first_column: lstack[lstack.length - (len || 1)].first_column,
262
- last_column: lstack[lstack.length - 1].last_column
263
- };
264
- if (ranges) {
265
- yyval._$.range = [
266
- lstack[lstack.length - (len || 1)].range[0],
267
- lstack[lstack.length - 1].range[1]
268
- ];
269
- }
270
- r = this.performAction.apply(yyval, [
271
- yytext,
272
- yyleng,
273
- yylineno,
274
- sharedState.yy,
275
- action[1],
276
- vstack,
277
- lstack
278
- ].concat(args));
279
- if (typeof r !== "undefined") {
280
- return r;
281
- }
282
- if (len) {
283
- stack = stack.slice(0, -1 * len * 2);
284
- vstack = vstack.slice(0, -1 * len);
285
- lstack = lstack.slice(0, -1 * len);
286
- }
287
- stack.push(this.productions_[action[1]][0]);
288
- vstack.push(yyval.$);
289
- lstack.push(yyval._$);
290
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
291
- stack.push(newState);
292
- break;
293
- case 3:
294
- return true;
295
- }
296
- }
297
- return true;
298
- }, "parse")
299
- };
300
- var lexer = /* @__PURE__ */ function() {
301
- var lexer2 = {
302
- EOF: 1,
303
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
304
- if (this.yy.parser) {
305
- this.yy.parser.parseError(str, hash);
306
- } else {
307
- throw new Error(str);
308
- }
309
- }, "parseError"),
310
- // resets the lexer, sets new input
311
- setInput: /* @__PURE__ */ __name(function(input, yy) {
312
- this.yy = yy || this.yy || {};
313
- this._input = input;
314
- this._more = this._backtrack = this.done = false;
315
- this.yylineno = this.yyleng = 0;
316
- this.yytext = this.matched = this.match = "";
317
- this.conditionStack = ["INITIAL"];
318
- this.yylloc = {
319
- first_line: 1,
320
- first_column: 0,
321
- last_line: 1,
322
- last_column: 0
323
- };
324
- if (this.options.ranges) {
325
- this.yylloc.range = [0, 0];
326
- }
327
- this.offset = 0;
328
- return this;
329
- }, "setInput"),
330
- // consumes and returns one char from the input
331
- input: /* @__PURE__ */ __name(function() {
332
- var ch = this._input[0];
333
- this.yytext += ch;
334
- this.yyleng++;
335
- this.offset++;
336
- this.match += ch;
337
- this.matched += ch;
338
- var lines = ch.match(/(?:\r\n?|\n).*/g);
339
- if (lines) {
340
- this.yylineno++;
341
- this.yylloc.last_line++;
342
- } else {
343
- this.yylloc.last_column++;
344
- }
345
- if (this.options.ranges) {
346
- this.yylloc.range[1]++;
347
- }
348
- this._input = this._input.slice(1);
349
- return ch;
350
- }, "input"),
351
- // unshifts one char (or a string) into the input
352
- unput: /* @__PURE__ */ __name(function(ch) {
353
- var len = ch.length;
354
- var lines = ch.split(/(?:\r\n?|\n)/g);
355
- this._input = ch + this._input;
356
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
357
- this.offset -= len;
358
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
359
- this.match = this.match.substr(0, this.match.length - 1);
360
- this.matched = this.matched.substr(0, this.matched.length - 1);
361
- if (lines.length - 1) {
362
- this.yylineno -= lines.length - 1;
363
- }
364
- var r = this.yylloc.range;
365
- this.yylloc = {
366
- first_line: this.yylloc.first_line,
367
- last_line: this.yylineno + 1,
368
- first_column: this.yylloc.first_column,
369
- 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
370
- };
371
- if (this.options.ranges) {
372
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
373
- }
374
- this.yyleng = this.yytext.length;
375
- return this;
376
- }, "unput"),
377
- // When called from action, caches matched text and appends it on next action
378
- more: /* @__PURE__ */ __name(function() {
379
- this._more = true;
380
- return this;
381
- }, "more"),
382
- // 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.
383
- reject: /* @__PURE__ */ __name(function() {
384
- if (this.options.backtrack_lexer) {
385
- this._backtrack = true;
386
- } else {
387
- 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(), {
388
- text: "",
389
- token: null,
390
- line: this.yylineno
391
- });
392
- }
393
- return this;
394
- }, "reject"),
395
- // retain first n characters of the match
396
- less: /* @__PURE__ */ __name(function(n) {
397
- this.unput(this.match.slice(n));
398
- }, "less"),
399
- // displays already matched input, i.e. for error messages
400
- pastInput: /* @__PURE__ */ __name(function() {
401
- var past = this.matched.substr(0, this.matched.length - this.match.length);
402
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
403
- }, "pastInput"),
404
- // displays upcoming input, i.e. for error messages
405
- upcomingInput: /* @__PURE__ */ __name(function() {
406
- var next = this.match;
407
- if (next.length < 20) {
408
- next += this._input.substr(0, 20 - next.length);
409
- }
410
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
411
- }, "upcomingInput"),
412
- // displays the character position where the lexing error occurred, i.e. for error messages
413
- showPosition: /* @__PURE__ */ __name(function() {
414
- var pre = this.pastInput();
415
- var c = new Array(pre.length + 1).join("-");
416
- return pre + this.upcomingInput() + "\n" + c + "^";
417
- }, "showPosition"),
418
- // test the lexed token: return FALSE when not a match, otherwise return token
419
- test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
420
- var token, lines, backup;
421
- if (this.options.backtrack_lexer) {
422
- backup = {
423
- yylineno: this.yylineno,
424
- yylloc: {
425
- first_line: this.yylloc.first_line,
426
- last_line: this.last_line,
427
- first_column: this.yylloc.first_column,
428
- last_column: this.yylloc.last_column
429
- },
430
- yytext: this.yytext,
431
- match: this.match,
432
- matches: this.matches,
433
- matched: this.matched,
434
- yyleng: this.yyleng,
435
- offset: this.offset,
436
- _more: this._more,
437
- _input: this._input,
438
- yy: this.yy,
439
- conditionStack: this.conditionStack.slice(0),
440
- done: this.done
441
- };
442
- if (this.options.ranges) {
443
- backup.yylloc.range = this.yylloc.range.slice(0);
444
- }
445
- }
446
- lines = match[0].match(/(?:\r\n?|\n).*/g);
447
- if (lines) {
448
- this.yylineno += lines.length;
449
- }
450
- this.yylloc = {
451
- first_line: this.yylloc.last_line,
452
- last_line: this.yylineno + 1,
453
- first_column: this.yylloc.last_column,
454
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
455
- };
456
- this.yytext += match[0];
457
- this.match += match[0];
458
- this.matches = match;
459
- this.yyleng = this.yytext.length;
460
- if (this.options.ranges) {
461
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
462
- }
463
- this._more = false;
464
- this._backtrack = false;
465
- this._input = this._input.slice(match[0].length);
466
- this.matched += match[0];
467
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
468
- if (this.done && this._input) {
469
- this.done = false;
470
- }
471
- if (token) {
472
- return token;
473
- } else if (this._backtrack) {
474
- for (var k in backup) {
475
- this[k] = backup[k];
476
- }
477
- return false;
478
- }
479
- return false;
480
- }, "test_match"),
481
- // return next match in input
482
- next: /* @__PURE__ */ __name(function() {
483
- if (this.done) {
484
- return this.EOF;
485
- }
486
- if (!this._input) {
487
- this.done = true;
488
- }
489
- var token, match, tempMatch, index;
490
- if (!this._more) {
491
- this.yytext = "";
492
- this.match = "";
493
- }
494
- var rules = this._currentRules();
495
- for (var i = 0; i < rules.length; i++) {
496
- tempMatch = this._input.match(this.rules[rules[i]]);
497
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
498
- match = tempMatch;
499
- index = i;
500
- if (this.options.backtrack_lexer) {
501
- token = this.test_match(tempMatch, rules[i]);
502
- if (token !== false) {
503
- return token;
504
- } else if (this._backtrack) {
505
- match = false;
506
- continue;
507
- } else {
508
- return false;
509
- }
510
- } else if (!this.options.flex) {
511
- break;
512
- }
513
- }
514
- }
515
- if (match) {
516
- token = this.test_match(match, rules[index]);
517
- if (token !== false) {
518
- return token;
519
- }
520
- return false;
521
- }
522
- if (this._input === "") {
523
- return this.EOF;
524
- } else {
525
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
526
- text: "",
527
- token: null,
528
- line: this.yylineno
529
- });
530
- }
531
- }, "next"),
532
- // return next match that has a token
533
- lex: /* @__PURE__ */ __name(function lex() {
534
- var r = this.next();
535
- if (r) {
536
- return r;
537
- } else {
538
- return this.lex();
539
- }
540
- }, "lex"),
541
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
542
- begin: /* @__PURE__ */ __name(function begin(condition) {
543
- this.conditionStack.push(condition);
544
- }, "begin"),
545
- // pop the previously active lexer condition state off the condition stack
546
- popState: /* @__PURE__ */ __name(function popState() {
547
- var n = this.conditionStack.length - 1;
548
- if (n > 0) {
549
- return this.conditionStack.pop();
550
- } else {
551
- return this.conditionStack[0];
552
- }
553
- }, "popState"),
554
- // produce the lexer rule set which is active for the currently active lexer condition state
555
- _currentRules: /* @__PURE__ */ __name(function _currentRules() {
556
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
557
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
558
- } else {
559
- return this.conditions["INITIAL"].rules;
560
- }
561
- }, "_currentRules"),
562
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
563
- topState: /* @__PURE__ */ __name(function topState(n) {
564
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
565
- if (n >= 0) {
566
- return this.conditionStack[n];
567
- } else {
568
- return "INITIAL";
569
- }
570
- }, "topState"),
571
- // alias for begin(condition)
572
- pushState: /* @__PURE__ */ __name(function pushState(condition) {
573
- this.begin(condition);
574
- }, "pushState"),
575
- // return the number of states currently on the stack
576
- stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
577
- return this.conditionStack.length;
578
- }, "stateStackSize"),
579
- options: { "case-insensitive": true },
580
- performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
581
- switch ($avoiding_name_collisions) {
582
- case 0:
583
- return 38;
584
- case 1:
585
- return 40;
586
- case 2:
587
- return 39;
588
- case 3:
589
- return 44;
590
- case 4:
591
- return 51;
592
- case 5:
593
- return 52;
594
- case 6:
595
- return 53;
596
- case 7:
597
- return 54;
598
- case 8:
599
- break;
600
- case 9:
601
- break;
602
- case 10:
603
- return 5;
604
- case 11:
605
- break;
606
- case 12:
607
- break;
608
- case 13:
609
- break;
610
- case 14:
611
- break;
612
- case 15:
613
- this.pushState("SCALE");
614
- return 17;
615
- case 16:
616
- return 18;
617
- case 17:
618
- this.popState();
619
- break;
620
- case 18:
621
- this.begin("acc_title");
622
- return 33;
623
- case 19:
624
- this.popState();
625
- return "acc_title_value";
626
- case 20:
627
- this.begin("acc_descr");
628
- return 35;
629
- case 21:
630
- this.popState();
631
- return "acc_descr_value";
632
- case 22:
633
- this.begin("acc_descr_multiline");
634
- break;
635
- case 23:
636
- this.popState();
637
- break;
638
- case 24:
639
- return "acc_descr_multiline_value";
640
- case 25:
641
- this.pushState("CLASSDEF");
642
- return 41;
643
- case 26:
644
- this.popState();
645
- this.pushState("CLASSDEFID");
646
- return "DEFAULT_CLASSDEF_ID";
647
- case 27:
648
- this.popState();
649
- this.pushState("CLASSDEFID");
650
- return 42;
651
- case 28:
652
- this.popState();
653
- return 43;
654
- case 29:
655
- this.pushState("CLASS");
656
- return 48;
657
- case 30:
658
- this.popState();
659
- this.pushState("CLASS_STYLE");
660
- return 49;
661
- case 31:
662
- this.popState();
663
- return 50;
664
- case 32:
665
- this.pushState("STYLE");
666
- return 45;
667
- case 33:
668
- this.popState();
669
- this.pushState("STYLEDEF_STYLES");
670
- return 46;
671
- case 34:
672
- this.popState();
673
- return 47;
674
- case 35:
675
- this.pushState("SCALE");
676
- return 17;
677
- case 36:
678
- return 18;
679
- case 37:
680
- this.popState();
681
- break;
682
- case 38:
683
- this.pushState("STATE");
684
- break;
685
- case 39:
686
- this.popState();
687
- yy_.yytext = yy_.yytext.slice(0, -8).trim();
688
- return 25;
689
- case 40:
690
- this.popState();
691
- yy_.yytext = yy_.yytext.slice(0, -8).trim();
692
- return 26;
693
- case 41:
694
- this.popState();
695
- yy_.yytext = yy_.yytext.slice(0, -10).trim();
696
- return 27;
697
- case 42:
698
- this.popState();
699
- yy_.yytext = yy_.yytext.slice(0, -8).trim();
700
- return 25;
701
- case 43:
702
- this.popState();
703
- yy_.yytext = yy_.yytext.slice(0, -8).trim();
704
- return 26;
705
- case 44:
706
- this.popState();
707
- yy_.yytext = yy_.yytext.slice(0, -10).trim();
708
- return 27;
709
- case 45:
710
- return 51;
711
- case 46:
712
- return 52;
713
- case 47:
714
- return 53;
715
- case 48:
716
- return 54;
717
- case 49:
718
- this.pushState("STATE_STRING");
719
- break;
720
- case 50:
721
- this.pushState("STATE_ID");
722
- return "AS";
723
- case 51:
724
- this.popState();
725
- return "ID";
726
- case 52:
727
- this.popState();
728
- break;
729
- case 53:
730
- return "STATE_DESCR";
731
- case 54:
732
- return 19;
733
- case 55:
734
- this.popState();
735
- break;
736
- case 56:
737
- this.popState();
738
- this.pushState("struct");
739
- return 20;
740
- case 57:
741
- break;
742
- case 58:
743
- this.popState();
744
- return 21;
745
- case 59:
746
- break;
747
- case 60:
748
- this.begin("NOTE");
749
- return 29;
750
- case 61:
751
- this.popState();
752
- this.pushState("NOTE_ID");
753
- return 59;
754
- case 62:
755
- this.popState();
756
- this.pushState("NOTE_ID");
757
- return 60;
758
- case 63:
759
- this.popState();
760
- this.pushState("FLOATING_NOTE");
761
- break;
762
- case 64:
763
- this.popState();
764
- this.pushState("FLOATING_NOTE_ID");
765
- return "AS";
766
- case 65:
767
- break;
768
- case 66:
769
- return "NOTE_TEXT";
770
- case 67:
771
- this.popState();
772
- return "ID";
773
- case 68:
774
- this.popState();
775
- this.pushState("NOTE_TEXT");
776
- return 24;
777
- case 69:
778
- this.popState();
779
- yy_.yytext = yy_.yytext.substr(2).trim();
780
- return 31;
781
- case 70:
782
- this.popState();
783
- yy_.yytext = yy_.yytext.slice(0, -8).trim();
784
- return 31;
785
- case 71:
786
- return 6;
787
- case 72:
788
- return 6;
789
- case 73:
790
- return 16;
791
- case 74:
792
- return 57;
793
- case 75:
794
- return 24;
795
- case 76:
796
- yy_.yytext = yy_.yytext.trim();
797
- return 14;
798
- case 77:
799
- return 15;
800
- case 78:
801
- return 28;
802
- case 79:
803
- return 58;
804
- case 80:
805
- return 5;
806
- case 81:
807
- return "INVALID";
808
- }
809
- }, "anonymous"),
810
- rules: [/^(?:click\b)/i, /^(?:href\b)/i, /^(?:"[^"]*")/i, /^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:style\s+)/i, /^(?:[\w,]+\s+)/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<<fork>>)/i, /^(?:.*<<join>>)/i, /^(?:.*<<choice>>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i],
811
- conditions: { "LINE": { "rules": [12, 13], "inclusive": false }, "struct": { "rules": [12, 13, 25, 29, 32, 38, 45, 46, 47, 48, 57, 58, 59, 60, 74, 75, 76, 77, 78], "inclusive": false }, "FLOATING_NOTE_ID": { "rules": [67], "inclusive": false }, "FLOATING_NOTE": { "rules": [64, 65, 66], "inclusive": false }, "NOTE_TEXT": { "rules": [69, 70], "inclusive": false }, "NOTE_ID": { "rules": [68], "inclusive": false }, "NOTE": { "rules": [61, 62, 63], "inclusive": false }, "STYLEDEF_STYLEOPTS": { "rules": [], "inclusive": false }, "STYLEDEF_STYLES": { "rules": [34], "inclusive": false }, "STYLE_IDS": { "rules": [], "inclusive": false }, "STYLE": { "rules": [33], "inclusive": false }, "CLASS_STYLE": { "rules": [31], "inclusive": false }, "CLASS": { "rules": [30], "inclusive": false }, "CLASSDEFID": { "rules": [28], "inclusive": false }, "CLASSDEF": { "rules": [26, 27], "inclusive": false }, "acc_descr_multiline": { "rules": [23, 24], "inclusive": false }, "acc_descr": { "rules": [21], "inclusive": false }, "acc_title": { "rules": [19], "inclusive": false }, "SCALE": { "rules": [16, 17, 36, 37], "inclusive": false }, "ALIAS": { "rules": [], "inclusive": false }, "STATE_ID": { "rules": [51], "inclusive": false }, "STATE_STRING": { "rules": [52, 53], "inclusive": false }, "FORK_STATE": { "rules": [], "inclusive": false }, "STATE": { "rules": [12, 13, 39, 40, 41, 42, 43, 44, 49, 50, 54, 55, 56], "inclusive": false }, "ID": { "rules": [12, 13], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 18, 20, 22, 25, 29, 32, 35, 38, 56, 60, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81], "inclusive": true } }
812
- };
813
- return lexer2;
814
- }();
815
- parser2.lexer = lexer;
816
- function Parser() {
817
- this.yy = {};
818
- }
819
- __name(Parser, "Parser");
820
- Parser.prototype = parser2;
821
- parser2.Parser = Parser;
822
- return new Parser();
823
- }();
824
- parser.parser = parser;
825
- var stateDiagram_default = parser;
826
- var DEFAULT_DIAGRAM_DIRECTION = "TB";
827
- var DEFAULT_NESTED_DOC_DIR = "TB";
828
- var STMT_DIRECTION = "dir";
829
- var STMT_STATE = "state";
830
- var STMT_ROOT = "root";
831
- var STMT_RELATION = "relation";
832
- var STMT_CLASSDEF = "classDef";
833
- var STMT_STYLEDEF = "style";
834
- var STMT_APPLYCLASS = "applyClass";
835
- var DEFAULT_STATE_TYPE = "default";
836
- var DIVIDER_TYPE = "divider";
837
- var G_EDGE_STYLE = "fill:none";
838
- var G_EDGE_ARROWHEADSTYLE = "fill: #333";
839
- var G_EDGE_LABELPOS = "c";
840
- var G_EDGE_LABELTYPE = "text";
841
- var G_EDGE_THICKNESS = "normal";
842
- var SHAPE_STATE = "rect";
843
- var SHAPE_STATE_WITH_DESC = "rectWithTitle";
844
- var SHAPE_START = "stateStart";
845
- var SHAPE_END = "stateEnd";
846
- var SHAPE_DIVIDER = "divider";
847
- var SHAPE_GROUP = "roundedWithTitle";
848
- var SHAPE_NOTE = "note";
849
- var SHAPE_NOTEGROUP = "noteGroup";
850
- var CSS_DIAGRAM = "statediagram";
851
- var CSS_STATE = "state";
852
- var CSS_DIAGRAM_STATE = `${CSS_DIAGRAM}-${CSS_STATE}`;
853
- var CSS_EDGE = "transition";
854
- var CSS_NOTE = "note";
855
- var CSS_NOTE_EDGE = "note-edge";
856
- var CSS_EDGE_NOTE_EDGE = `${CSS_EDGE} ${CSS_NOTE_EDGE}`;
857
- var CSS_DIAGRAM_NOTE = `${CSS_DIAGRAM}-${CSS_NOTE}`;
858
- var CSS_CLUSTER = "cluster";
859
- var CSS_DIAGRAM_CLUSTER = `${CSS_DIAGRAM}-${CSS_CLUSTER}`;
860
- var CSS_CLUSTER_ALT = "cluster-alt";
861
- var CSS_DIAGRAM_CLUSTER_ALT = `${CSS_DIAGRAM}-${CSS_CLUSTER_ALT}`;
862
- var PARENT = "parent";
863
- var NOTE = "note";
864
- var DOMID_STATE = "state";
865
- var DOMID_TYPE_SPACER = "----";
866
- var NOTE_ID = `${DOMID_TYPE_SPACER}${NOTE}`;
867
- var PARENT_ID = `${DOMID_TYPE_SPACER}${PARENT}`;
868
- var getDir = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
869
- if (!parsedItem.doc) {
870
- return defaultDir;
871
- }
872
- let dir = defaultDir;
873
- for (const parsedItemDoc of parsedItem.doc) {
874
- if (parsedItemDoc.stmt === "dir") {
875
- dir = parsedItemDoc.value;
876
- }
877
- }
878
- return dir;
879
- }, "getDir");
880
- var getClasses = /* @__PURE__ */ __name(function(text, diagramObj) {
881
- return diagramObj.db.getClasses();
882
- }, "getClasses");
883
- var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag) {
884
- log.info("REF0:");
885
- log.info("Drawing state diagram (v2)", id);
886
- const { securityLevel, state: conf, layout } = getConfig2();
887
- diag.db.extract(diag.db.getRootDocV2());
888
- const data4Layout = diag.db.getData();
889
- const svg = getDiagramElement(id, securityLevel);
890
- data4Layout.type = diag.type;
891
- data4Layout.layoutAlgorithm = layout;
892
- data4Layout.nodeSpacing = conf?.nodeSpacing || 50;
893
- data4Layout.rankSpacing = conf?.rankSpacing || 50;
894
- data4Layout.markers = ["barb"];
895
- data4Layout.diagramId = id;
896
- await render(data4Layout, svg);
897
- const padding = 8;
898
- try {
899
- const links = typeof diag.db.getLinks === "function" ? diag.db.getLinks() : /* @__PURE__ */ new Map();
900
- links.forEach((linkInfo, key) => {
901
- const stateId = typeof key === "string" ? key : typeof key?.id === "string" ? key.id : "";
902
- if (!stateId) {
903
- log.warn("\u26A0\uFE0F Invalid or missing stateId from key:", JSON.stringify(key));
904
- return;
905
- }
906
- const allNodes = svg.node()?.querySelectorAll("g");
907
- let matchedElem;
908
- allNodes?.forEach((g) => {
909
- const text2 = g.textContent?.trim();
910
- if (text2 === stateId) {
911
- matchedElem = g;
912
- }
913
- });
914
- if (!matchedElem) {
915
- log.warn("\u26A0\uFE0F Could not find node matching text:", stateId);
916
- return;
917
- }
918
- const parent = matchedElem.parentNode;
919
- if (!parent) {
920
- log.warn("\u26A0\uFE0F Node has no parent, cannot wrap:", stateId);
921
- return;
922
- }
923
- const a = document.createElementNS("http://www.w3.org/2000/svg", "a");
924
- const cleanedUrl = linkInfo.url.replace(/^"+|"+$/g, "");
925
- a.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", cleanedUrl);
926
- a.setAttribute("target", "_blank");
927
- if (linkInfo.tooltip) {
928
- const tooltip = linkInfo.tooltip.replace(/^"+|"+$/g, "");
929
- a.setAttribute("title", tooltip);
930
- }
931
- parent.replaceChild(a, matchedElem);
932
- a.appendChild(matchedElem);
933
- log.info("\u{1F517} Wrapped node in <a> tag for:", stateId, linkInfo.url);
934
- });
935
- } catch (err) {
936
- log.error("\u274C Error injecting clickable links:", err);
937
- }
938
- utils_default.insertTitle(
939
- svg,
940
- "statediagramTitleText",
941
- conf?.titleTopMargin ?? 25,
942
- diag.db.getDiagramTitle()
943
- );
944
- setupViewPortForSVG(svg, padding, CSS_DIAGRAM, conf?.useMaxWidth ?? true);
945
- }, "draw");
946
- var stateRenderer_v3_unified_default = {
947
- getClasses,
948
- draw,
949
- getDir
950
- };
951
- var nodeDb = /* @__PURE__ */ new Map();
952
- var graphItemCount = 0;
953
- function stateDomId(itemId = "", counter = 0, type = "", typeSpacer = DOMID_TYPE_SPACER) {
954
- const typeStr = type !== null && type.length > 0 ? `${typeSpacer}${type}` : "";
955
- return `${DOMID_STATE}-${itemId}${typeStr}-${counter}`;
956
- }
957
- __name(stateDomId, "stateDomId");
958
- var setupDoc = /* @__PURE__ */ __name((parentParsedItem, doc, diagramStates, nodes, edges, altFlag, look, classes) => {
959
- log.trace("items", doc);
960
- doc.forEach((item) => {
961
- switch (item.stmt) {
962
- case STMT_STATE:
963
- dataFetcher(parentParsedItem, item, diagramStates, nodes, edges, altFlag, look, classes);
964
- break;
965
- case DEFAULT_STATE_TYPE:
966
- dataFetcher(parentParsedItem, item, diagramStates, nodes, edges, altFlag, look, classes);
967
- break;
968
- case STMT_RELATION:
969
- {
970
- dataFetcher(
971
- parentParsedItem,
972
- item.state1,
973
- diagramStates,
974
- nodes,
975
- edges,
976
- altFlag,
977
- look,
978
- classes
979
- );
980
- dataFetcher(
981
- parentParsedItem,
982
- item.state2,
983
- diagramStates,
984
- nodes,
985
- edges,
986
- altFlag,
987
- look,
988
- classes
989
- );
990
- const edgeData = {
991
- id: "edge" + graphItemCount,
992
- start: item.state1.id,
993
- end: item.state2.id,
994
- arrowhead: "normal",
995
- arrowTypeEnd: "arrow_barb",
996
- style: G_EDGE_STYLE,
997
- labelStyle: "",
998
- label: common_default.sanitizeText(item.description ?? "", getConfig2()),
999
- arrowheadStyle: G_EDGE_ARROWHEADSTYLE,
1000
- labelpos: G_EDGE_LABELPOS,
1001
- labelType: G_EDGE_LABELTYPE,
1002
- thickness: G_EDGE_THICKNESS,
1003
- classes: CSS_EDGE,
1004
- look
1005
- };
1006
- edges.push(edgeData);
1007
- graphItemCount++;
1008
- }
1009
- break;
1010
- }
1011
- });
1012
- }, "setupDoc");
1013
- var getDir2 = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
1014
- let dir = defaultDir;
1015
- if (parsedItem.doc) {
1016
- for (const parsedItemDoc of parsedItem.doc) {
1017
- if (parsedItemDoc.stmt === "dir") {
1018
- dir = parsedItemDoc.value;
1019
- }
1020
- }
1021
- }
1022
- return dir;
1023
- }, "getDir");
1024
- function insertOrUpdateNode(nodes, nodeData, classes) {
1025
- if (!nodeData.id || nodeData.id === "</join></fork>" || nodeData.id === "</choice>") {
1026
- return;
1027
- }
1028
- if (nodeData.cssClasses) {
1029
- if (!Array.isArray(nodeData.cssCompiledStyles)) {
1030
- nodeData.cssCompiledStyles = [];
1031
- }
1032
- nodeData.cssClasses.split(" ").forEach((cssClass) => {
1033
- const classDef = classes.get(cssClass);
1034
- if (classDef) {
1035
- nodeData.cssCompiledStyles = [...nodeData.cssCompiledStyles ?? [], ...classDef.styles];
1036
- }
1037
- });
1038
- }
1039
- const existingNodeData = nodes.find((node) => node.id === nodeData.id);
1040
- if (existingNodeData) {
1041
- Object.assign(existingNodeData, nodeData);
1042
- } else {
1043
- nodes.push(nodeData);
1044
- }
1045
- }
1046
- __name(insertOrUpdateNode, "insertOrUpdateNode");
1047
- function getClassesFromDbInfo(dbInfoItem) {
1048
- return dbInfoItem?.classes?.join(" ") ?? "";
1049
- }
1050
- __name(getClassesFromDbInfo, "getClassesFromDbInfo");
1051
- function getStylesFromDbInfo(dbInfoItem) {
1052
- return dbInfoItem?.styles ?? [];
1053
- }
1054
- __name(getStylesFromDbInfo, "getStylesFromDbInfo");
1055
- var dataFetcher = /* @__PURE__ */ __name((parent, parsedItem, diagramStates, nodes, edges, altFlag, look, classes) => {
1056
- const itemId = parsedItem.id;
1057
- const dbState = diagramStates.get(itemId);
1058
- const classStr = getClassesFromDbInfo(dbState);
1059
- const style = getStylesFromDbInfo(dbState);
1060
- const config = getConfig2();
1061
- log.info("dataFetcher parsedItem", parsedItem, dbState, style);
1062
- if (itemId !== "root") {
1063
- let shape = SHAPE_STATE;
1064
- if (parsedItem.start === true) {
1065
- shape = SHAPE_START;
1066
- } else if (parsedItem.start === false) {
1067
- shape = SHAPE_END;
1068
- }
1069
- if (parsedItem.type !== DEFAULT_STATE_TYPE) {
1070
- shape = parsedItem.type;
1071
- }
1072
- if (!nodeDb.get(itemId)) {
1073
- nodeDb.set(itemId, {
1074
- id: itemId,
1075
- shape,
1076
- description: common_default.sanitizeText(itemId, config),
1077
- cssClasses: `${classStr} ${CSS_DIAGRAM_STATE}`,
1078
- cssStyles: style
1079
- });
1080
- }
1081
- const newNode = nodeDb.get(itemId);
1082
- if (parsedItem.description) {
1083
- if (Array.isArray(newNode.description)) {
1084
- newNode.shape = SHAPE_STATE_WITH_DESC;
1085
- newNode.description.push(parsedItem.description);
1086
- } else {
1087
- if (newNode.description?.length && newNode.description.length > 0) {
1088
- newNode.shape = SHAPE_STATE_WITH_DESC;
1089
- if (newNode.description === itemId) {
1090
- newNode.description = [parsedItem.description];
1091
- } else {
1092
- newNode.description = [newNode.description, parsedItem.description];
1093
- }
1094
- } else {
1095
- newNode.shape = SHAPE_STATE;
1096
- newNode.description = parsedItem.description;
1097
- }
1098
- }
1099
- newNode.description = common_default.sanitizeTextOrArray(newNode.description, config);
1100
- }
1101
- if (newNode.description?.length === 1 && newNode.shape === SHAPE_STATE_WITH_DESC) {
1102
- if (newNode.type === "group") {
1103
- newNode.shape = SHAPE_GROUP;
1104
- } else {
1105
- newNode.shape = SHAPE_STATE;
1106
- }
1107
- }
1108
- if (!newNode.type && parsedItem.doc) {
1109
- log.info("Setting cluster for XCX", itemId, getDir2(parsedItem));
1110
- newNode.type = "group";
1111
- newNode.isGroup = true;
1112
- newNode.dir = getDir2(parsedItem);
1113
- newNode.shape = parsedItem.type === DIVIDER_TYPE ? SHAPE_DIVIDER : SHAPE_GROUP;
1114
- newNode.cssClasses = `${newNode.cssClasses} ${CSS_DIAGRAM_CLUSTER} ${altFlag ? CSS_DIAGRAM_CLUSTER_ALT : ""}`;
1115
- }
1116
- const nodeData = {
1117
- labelStyle: "",
1118
- shape: newNode.shape,
1119
- label: newNode.description,
1120
- cssClasses: newNode.cssClasses,
1121
- cssCompiledStyles: [],
1122
- cssStyles: newNode.cssStyles,
1123
- id: itemId,
1124
- dir: newNode.dir,
1125
- domId: stateDomId(itemId, graphItemCount),
1126
- type: newNode.type,
1127
- isGroup: newNode.type === "group",
1128
- padding: 8,
1129
- rx: 10,
1130
- ry: 10,
1131
- look
1132
- };
1133
- if (nodeData.shape === SHAPE_DIVIDER) {
1134
- nodeData.label = "";
1135
- }
1136
- if (parent && parent.id !== "root") {
1137
- log.trace("Setting node ", itemId, " to be child of its parent ", parent.id);
1138
- nodeData.parentId = parent.id;
1139
- }
1140
- nodeData.centerLabel = true;
1141
- if (parsedItem.note) {
1142
- const noteData = {
1143
- labelStyle: "",
1144
- shape: SHAPE_NOTE,
1145
- label: parsedItem.note.text,
1146
- cssClasses: CSS_DIAGRAM_NOTE,
1147
- // useHtmlLabels: false,
1148
- cssStyles: [],
1149
- cssCompiledStyles: [],
1150
- id: itemId + NOTE_ID + "-" + graphItemCount,
1151
- domId: stateDomId(itemId, graphItemCount, NOTE),
1152
- type: newNode.type,
1153
- isGroup: newNode.type === "group",
1154
- padding: config.flowchart?.padding,
1155
- look,
1156
- position: parsedItem.note.position
1157
- };
1158
- const parentNodeId = itemId + PARENT_ID;
1159
- const groupData = {
1160
- labelStyle: "",
1161
- shape: SHAPE_NOTEGROUP,
1162
- label: parsedItem.note.text,
1163
- cssClasses: newNode.cssClasses,
1164
- cssStyles: [],
1165
- id: itemId + PARENT_ID,
1166
- domId: stateDomId(itemId, graphItemCount, PARENT),
1167
- type: "group",
1168
- isGroup: true,
1169
- padding: 16,
1170
- //getConfig().flowchart.padding
1171
- look,
1172
- position: parsedItem.note.position
1173
- };
1174
- graphItemCount++;
1175
- groupData.id = parentNodeId;
1176
- noteData.parentId = parentNodeId;
1177
- insertOrUpdateNode(nodes, groupData, classes);
1178
- insertOrUpdateNode(nodes, noteData, classes);
1179
- insertOrUpdateNode(nodes, nodeData, classes);
1180
- let from = itemId;
1181
- let to = noteData.id;
1182
- if (parsedItem.note.position === "left of") {
1183
- from = noteData.id;
1184
- to = itemId;
1185
- }
1186
- edges.push({
1187
- id: from + "-" + to,
1188
- start: from,
1189
- end: to,
1190
- arrowhead: "none",
1191
- arrowTypeEnd: "",
1192
- style: G_EDGE_STYLE,
1193
- labelStyle: "",
1194
- classes: CSS_EDGE_NOTE_EDGE,
1195
- arrowheadStyle: G_EDGE_ARROWHEADSTYLE,
1196
- labelpos: G_EDGE_LABELPOS,
1197
- labelType: G_EDGE_LABELTYPE,
1198
- thickness: G_EDGE_THICKNESS,
1199
- look
1200
- });
1201
- } else {
1202
- insertOrUpdateNode(nodes, nodeData, classes);
1203
- }
1204
- }
1205
- if (parsedItem.doc) {
1206
- log.trace("Adding nodes children ");
1207
- setupDoc(parsedItem, parsedItem.doc, diagramStates, nodes, edges, !altFlag, look, classes);
1208
- }
1209
- }, "dataFetcher");
1210
- var reset = /* @__PURE__ */ __name(() => {
1211
- nodeDb.clear();
1212
- graphItemCount = 0;
1213
- }, "reset");
1214
- var CONSTANTS = {
1215
- START_NODE: "[*]",
1216
- START_TYPE: "start",
1217
- END_NODE: "[*]",
1218
- END_TYPE: "end",
1219
- COLOR_KEYWORD: "color",
1220
- FILL_KEYWORD: "fill",
1221
- BG_FILL: "bgFill",
1222
- STYLECLASS_SEP: ","
1223
- };
1224
- var newClassesList = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Map(), "newClassesList");
1225
- var newDoc = /* @__PURE__ */ __name(() => ({
1226
- relations: [],
1227
- states: /* @__PURE__ */ new Map(),
1228
- documents: {}
1229
- }), "newDoc");
1230
- var clone = /* @__PURE__ */ __name((o) => JSON.parse(JSON.stringify(o)), "clone");
1231
- var StateDB = class {
1232
- constructor(version) {
1233
- this.version = version;
1234
- this.nodes = [];
1235
- this.edges = [];
1236
- this.rootDoc = [];
1237
- this.classes = newClassesList();
1238
- this.documents = { root: newDoc() };
1239
- this.currentDocument = this.documents.root;
1240
- this.startEndCount = 0;
1241
- this.dividerCnt = 0;
1242
- this.links = /* @__PURE__ */ new Map();
1243
- this.getAccTitle = getAccTitle;
1244
- this.setAccTitle = setAccTitle;
1245
- this.getAccDescription = getAccDescription;
1246
- this.setAccDescription = setAccDescription;
1247
- this.setDiagramTitle = setDiagramTitle;
1248
- this.getDiagramTitle = getDiagramTitle;
1249
- this.clear();
1250
- this.setRootDoc = this.setRootDoc.bind(this);
1251
- this.getDividerId = this.getDividerId.bind(this);
1252
- this.setDirection = this.setDirection.bind(this);
1253
- this.trimColon = this.trimColon.bind(this);
1254
- }
1255
- static {
1256
- __name(this, "StateDB");
1257
- }
1258
- static {
1259
- this.relationType = {
1260
- AGGREGATION: 0,
1261
- EXTENSION: 1,
1262
- COMPOSITION: 2,
1263
- DEPENDENCY: 3
1264
- };
1265
- }
1266
- /**
1267
- * Convert all of the statements (stmts) that were parsed into states and relationships.
1268
- * This is done because a state diagram may have nested sections,
1269
- * where each section is a 'document' and has its own set of statements.
1270
- * Ex: the section within a fork has its own statements, and incoming and outgoing statements
1271
- * refer to the fork as a whole (document).
1272
- * See the parser grammar: the definition of a document is a document then a 'line', where a line can be a statement.
1273
- * This will push the statement into the list of statements for the current document.
1274
- */
1275
- extract(statements) {
1276
- this.clear(true);
1277
- for (const item of Array.isArray(statements) ? statements : statements.doc) {
1278
- switch (item.stmt) {
1279
- case STMT_STATE:
1280
- this.addState(item.id.trim(), item.type, item.doc, item.description, item.note);
1281
- break;
1282
- case STMT_RELATION:
1283
- this.addRelation(item.state1, item.state2, item.description);
1284
- break;
1285
- case STMT_CLASSDEF:
1286
- this.addStyleClass(item.id.trim(), item.classes);
1287
- break;
1288
- case STMT_STYLEDEF:
1289
- this.handleStyleDef(item);
1290
- break;
1291
- case STMT_APPLYCLASS:
1292
- this.setCssClass(item.id.trim(), item.styleClass);
1293
- break;
1294
- case "click":
1295
- this.addLink(item.id, item.url, item.tooltip);
1296
- break;
1297
- }
1298
- }
1299
- const diagramStates = this.getStates();
1300
- const config = getConfig2();
1301
- reset();
1302
- dataFetcher(
1303
- void 0,
1304
- this.getRootDocV2(),
1305
- diagramStates,
1306
- this.nodes,
1307
- this.edges,
1308
- true,
1309
- config.look,
1310
- this.classes
1311
- );
1312
- for (const node of this.nodes) {
1313
- if (!Array.isArray(node.label)) {
1314
- continue;
1315
- }
1316
- node.description = node.label.slice(1);
1317
- if (node.isGroup && node.description.length > 0) {
1318
- throw new Error(
1319
- `Group nodes can only have label. Remove the additional description for node [${node.id}]`
1320
- );
1321
- }
1322
- node.label = node.label[0];
1323
- }
1324
- }
1325
- handleStyleDef(item) {
1326
- const ids = item.id.trim().split(",");
1327
- const styles = item.styleClass.split(",");
1328
- for (const id of ids) {
1329
- let state = this.getState(id);
1330
- if (!state) {
1331
- const trimmedId = id.trim();
1332
- this.addState(trimmedId);
1333
- state = this.getState(trimmedId);
1334
- }
1335
- if (state) {
1336
- state.styles = styles.map((s) => s.replace(/;/g, "")?.trim());
1337
- }
1338
- }
1339
- }
1340
- setRootDoc(o) {
1341
- log.info("Setting root doc", o);
1342
- this.rootDoc = o;
1343
- if (this.version === 1) {
1344
- this.extract(o);
1345
- } else {
1346
- this.extract(this.getRootDocV2());
1347
- }
1348
- }
1349
- docTranslator(parent, node, first) {
1350
- if (node.stmt === STMT_RELATION) {
1351
- this.docTranslator(parent, node.state1, true);
1352
- this.docTranslator(parent, node.state2, false);
1353
- return;
1354
- }
1355
- if (node.stmt === STMT_STATE) {
1356
- if (node.id === CONSTANTS.START_NODE) {
1357
- node.id = parent.id + (first ? "_start" : "_end");
1358
- node.start = first;
1359
- } else {
1360
- node.id = node.id.trim();
1361
- }
1362
- }
1363
- if (node.stmt !== STMT_ROOT && node.stmt !== STMT_STATE || !node.doc) {
1364
- return;
1365
- }
1366
- const doc = [];
1367
- let currentDoc = [];
1368
- for (const stmt of node.doc) {
1369
- if (stmt.type === DIVIDER_TYPE) {
1370
- const newNode = clone(stmt);
1371
- newNode.doc = clone(currentDoc);
1372
- doc.push(newNode);
1373
- currentDoc = [];
1374
- } else {
1375
- currentDoc.push(stmt);
1376
- }
1377
- }
1378
- if (doc.length > 0 && currentDoc.length > 0) {
1379
- const newNode = {
1380
- stmt: STMT_STATE,
1381
- id: generateId(),
1382
- type: "divider",
1383
- doc: clone(currentDoc)
1384
- };
1385
- doc.push(clone(newNode));
1386
- node.doc = doc;
1387
- }
1388
- node.doc.forEach((docNode) => this.docTranslator(node, docNode, true));
1389
- }
1390
- getRootDocV2() {
1391
- this.docTranslator(
1392
- { id: STMT_ROOT, stmt: STMT_ROOT },
1393
- { id: STMT_ROOT, stmt: STMT_ROOT, doc: this.rootDoc },
1394
- true
1395
- );
1396
- return { id: STMT_ROOT, doc: this.rootDoc };
1397
- }
1398
- /**
1399
- * Function called by parser when a node definition has been found.
1400
- *
1401
- * @param descr - description for the state. Can be a string or a list or strings
1402
- * @param classes - class styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 class, convert it to an array of that 1 class.
1403
- * @param styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style.
1404
- * @param textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style.
1405
- */
1406
- addState(id, type = DEFAULT_STATE_TYPE, doc = void 0, descr = void 0, note = void 0, classes = void 0, styles = void 0, textStyles = void 0) {
1407
- const trimmedId = id?.trim();
1408
- if (!this.currentDocument.states.has(trimmedId)) {
1409
- log.info("Adding state ", trimmedId, descr);
1410
- this.currentDocument.states.set(trimmedId, {
1411
- stmt: STMT_STATE,
1412
- id: trimmedId,
1413
- descriptions: [],
1414
- type,
1415
- doc,
1416
- note,
1417
- classes: [],
1418
- styles: [],
1419
- textStyles: []
1420
- });
1421
- } else {
1422
- const state = this.currentDocument.states.get(trimmedId);
1423
- if (!state) {
1424
- throw new Error(`State not found: ${trimmedId}`);
1425
- }
1426
- if (!state.doc) {
1427
- state.doc = doc;
1428
- }
1429
- if (!state.type) {
1430
- state.type = type;
1431
- }
1432
- }
1433
- if (descr) {
1434
- log.info("Setting state description", trimmedId, descr);
1435
- const descriptions = Array.isArray(descr) ? descr : [descr];
1436
- descriptions.forEach((des) => this.addDescription(trimmedId, des.trim()));
1437
- }
1438
- if (note) {
1439
- const doc2 = this.currentDocument.states.get(trimmedId);
1440
- if (!doc2) {
1441
- throw new Error(`State not found: ${trimmedId}`);
1442
- }
1443
- doc2.note = note;
1444
- doc2.note.text = common_default.sanitizeText(doc2.note.text, getConfig2());
1445
- }
1446
- if (classes) {
1447
- log.info("Setting state classes", trimmedId, classes);
1448
- const classesList = Array.isArray(classes) ? classes : [classes];
1449
- classesList.forEach((cssClass) => this.setCssClass(trimmedId, cssClass.trim()));
1450
- }
1451
- if (styles) {
1452
- log.info("Setting state styles", trimmedId, styles);
1453
- const stylesList = Array.isArray(styles) ? styles : [styles];
1454
- stylesList.forEach((style) => this.setStyle(trimmedId, style.trim()));
1455
- }
1456
- if (textStyles) {
1457
- log.info("Setting state styles", trimmedId, styles);
1458
- const textStylesList = Array.isArray(textStyles) ? textStyles : [textStyles];
1459
- textStylesList.forEach((textStyle) => this.setTextStyle(trimmedId, textStyle.trim()));
1460
- }
1461
- }
1462
- clear(saveCommon) {
1463
- this.nodes = [];
1464
- this.edges = [];
1465
- this.documents = { root: newDoc() };
1466
- this.currentDocument = this.documents.root;
1467
- this.startEndCount = 0;
1468
- this.classes = newClassesList();
1469
- if (!saveCommon) {
1470
- this.links = /* @__PURE__ */ new Map();
1471
- clear();
1472
- }
1473
- }
1474
- getState(id) {
1475
- return this.currentDocument.states.get(id);
1476
- }
1477
- getStates() {
1478
- return this.currentDocument.states;
1479
- }
1480
- logDocuments() {
1481
- log.info("Documents = ", this.documents);
1482
- }
1483
- getRelations() {
1484
- return this.currentDocument.relations;
1485
- }
1486
- /**
1487
- * Adds a clickable link to a state.
1488
- */
1489
- addLink(stateId, url, tooltip) {
1490
- this.links.set(stateId, { url, tooltip });
1491
- log.warn("Adding link", stateId, url, tooltip);
1492
- }
1493
- /**
1494
- * Get all registered links.
1495
- */
1496
- getLinks() {
1497
- return this.links;
1498
- }
1499
- /**
1500
- * If the id is a start node ( [*] ), then return a new id constructed from
1501
- * the start node name and the current start node count.
1502
- * else return the given id
1503
- */
1504
- startIdIfNeeded(id = "") {
1505
- if (id === CONSTANTS.START_NODE) {
1506
- this.startEndCount++;
1507
- return `${CONSTANTS.START_TYPE}${this.startEndCount}`;
1508
- }
1509
- return id;
1510
- }
1511
- /**
1512
- * If the id is a start node ( [*] ), then return the start type ('start')
1513
- * else return the given type
1514
- */
1515
- startTypeIfNeeded(id = "", type = DEFAULT_STATE_TYPE) {
1516
- return id === CONSTANTS.START_NODE ? CONSTANTS.START_TYPE : type;
1517
- }
1518
- /**
1519
- * If the id is an end node ( [*] ), then return a new id constructed from
1520
- * the end node name and the current start_end node count.
1521
- * else return the given id
1522
- */
1523
- endIdIfNeeded(id = "") {
1524
- if (id === CONSTANTS.END_NODE) {
1525
- this.startEndCount++;
1526
- return `${CONSTANTS.END_TYPE}${this.startEndCount}`;
1527
- }
1528
- return id;
1529
- }
1530
- /**
1531
- * If the id is an end node ( [*] ), then return the end type
1532
- * else return the given type
1533
- *
1534
- */
1535
- endTypeIfNeeded(id = "", type = DEFAULT_STATE_TYPE) {
1536
- return id === CONSTANTS.END_NODE ? CONSTANTS.END_TYPE : type;
1537
- }
1538
- addRelationObjs(item1, item2, relationTitle = "") {
1539
- const id1 = this.startIdIfNeeded(item1.id.trim());
1540
- const type1 = this.startTypeIfNeeded(item1.id.trim(), item1.type);
1541
- const id2 = this.startIdIfNeeded(item2.id.trim());
1542
- const type2 = this.startTypeIfNeeded(item2.id.trim(), item2.type);
1543
- this.addState(
1544
- id1,
1545
- type1,
1546
- item1.doc,
1547
- item1.description,
1548
- item1.note,
1549
- item1.classes,
1550
- item1.styles,
1551
- item1.textStyles
1552
- );
1553
- this.addState(
1554
- id2,
1555
- type2,
1556
- item2.doc,
1557
- item2.description,
1558
- item2.note,
1559
- item2.classes,
1560
- item2.styles,
1561
- item2.textStyles
1562
- );
1563
- this.currentDocument.relations.push({
1564
- id1,
1565
- id2,
1566
- relationTitle: common_default.sanitizeText(relationTitle, getConfig2())
1567
- });
1568
- }
1569
- /**
1570
- * Add a relation between two items. The items may be full objects or just the string id of a state.
1571
- */
1572
- addRelation(item1, item2, title) {
1573
- if (typeof item1 === "object" && typeof item2 === "object") {
1574
- this.addRelationObjs(item1, item2, title);
1575
- } else if (typeof item1 === "string" && typeof item2 === "string") {
1576
- const id1 = this.startIdIfNeeded(item1.trim());
1577
- const type1 = this.startTypeIfNeeded(item1);
1578
- const id2 = this.endIdIfNeeded(item2.trim());
1579
- const type2 = this.endTypeIfNeeded(item2);
1580
- this.addState(id1, type1);
1581
- this.addState(id2, type2);
1582
- this.currentDocument.relations.push({
1583
- id1,
1584
- id2,
1585
- relationTitle: title ? common_default.sanitizeText(title, getConfig2()) : void 0
1586
- });
1587
- }
1588
- }
1589
- addDescription(id, descr) {
1590
- const theState = this.currentDocument.states.get(id);
1591
- const _descr = descr.startsWith(":") ? descr.replace(":", "").trim() : descr;
1592
- theState?.descriptions?.push(common_default.sanitizeText(_descr, getConfig2()));
1593
- }
1594
- cleanupLabel(label) {
1595
- return label.startsWith(":") ? label.slice(2).trim() : label.trim();
1596
- }
1597
- getDividerId() {
1598
- this.dividerCnt++;
1599
- return `divider-id-${this.dividerCnt}`;
1600
- }
1601
- /**
1602
- * Called when the parser comes across a (style) class definition
1603
- * @example classDef my-style fill:#f96;
1604
- *
1605
- * @param id - the id of this (style) class
1606
- * @param styleAttributes - the string with 1 or more style attributes (each separated by a comma)
1607
- */
1608
- addStyleClass(id, styleAttributes = "") {
1609
- if (!this.classes.has(id)) {
1610
- this.classes.set(id, { id, styles: [], textStyles: [] });
1611
- }
1612
- const foundClass = this.classes.get(id);
1613
- if (styleAttributes && foundClass) {
1614
- styleAttributes.split(CONSTANTS.STYLECLASS_SEP).forEach((attrib) => {
1615
- const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
1616
- if (RegExp(CONSTANTS.COLOR_KEYWORD).exec(attrib)) {
1617
- const newStyle1 = fixedAttrib.replace(CONSTANTS.FILL_KEYWORD, CONSTANTS.BG_FILL);
1618
- const newStyle2 = newStyle1.replace(CONSTANTS.COLOR_KEYWORD, CONSTANTS.FILL_KEYWORD);
1619
- foundClass.textStyles.push(newStyle2);
1620
- }
1621
- foundClass.styles.push(fixedAttrib);
1622
- });
1623
- }
1624
- }
1625
- getClasses() {
1626
- return this.classes;
1627
- }
1628
- /**
1629
- * Add a (style) class or css class to a state with the given id.
1630
- * If the state isn't already in the list of known states, add it.
1631
- * Might be called by parser when a style class or CSS class should be applied to a state
1632
- *
1633
- * @param itemIds - The id or a list of ids of the item(s) to apply the css class to
1634
- * @param cssClassName - CSS class name
1635
- */
1636
- setCssClass(itemIds, cssClassName) {
1637
- itemIds.split(",").forEach((id) => {
1638
- let foundState = this.getState(id);
1639
- if (!foundState) {
1640
- const trimmedId = id.trim();
1641
- this.addState(trimmedId);
1642
- foundState = this.getState(trimmedId);
1643
- }
1644
- foundState?.classes?.push(cssClassName);
1645
- });
1646
- }
1647
- /**
1648
- * Add a style to a state with the given id.
1649
- * @example style stateId fill:#f9f,stroke:#333,stroke-width:4px
1650
- * where 'style' is the keyword
1651
- * stateId is the id of a state
1652
- * the rest of the string is the styleText (all of the attributes to be applied to the state)
1653
- *
1654
- * @param itemId - The id of item to apply the style to
1655
- * @param styleText - the text of the attributes for the style
1656
- */
1657
- setStyle(itemId, styleText) {
1658
- this.getState(itemId)?.styles?.push(styleText);
1659
- }
1660
- /**
1661
- * Add a text style to a state with the given id
1662
- *
1663
- * @param itemId - The id of item to apply the css class to
1664
- * @param cssClassName - CSS class name
1665
- */
1666
- setTextStyle(itemId, cssClassName) {
1667
- this.getState(itemId)?.textStyles?.push(cssClassName);
1668
- }
1669
- /**
1670
- * Finds the direction statement in the root document.
1671
- * @returns the direction statement if present
1672
- */
1673
- getDirectionStatement() {
1674
- return this.rootDoc.find((doc) => doc.stmt === STMT_DIRECTION);
1675
- }
1676
- getDirection() {
1677
- return this.getDirectionStatement()?.value ?? DEFAULT_DIAGRAM_DIRECTION;
1678
- }
1679
- setDirection(dir) {
1680
- const doc = this.getDirectionStatement();
1681
- if (doc) {
1682
- doc.value = dir;
1683
- } else {
1684
- this.rootDoc.unshift({ stmt: STMT_DIRECTION, value: dir });
1685
- }
1686
- }
1687
- trimColon(str) {
1688
- return str.startsWith(":") ? str.slice(1).trim() : str.trim();
1689
- }
1690
- getData() {
1691
- const config = getConfig2();
1692
- return {
1693
- nodes: this.nodes,
1694
- edges: this.edges,
1695
- other: {},
1696
- config,
1697
- direction: getDir(this.getRootDocV2())
1698
- };
1699
- }
1700
- getConfig() {
1701
- return getConfig2().state;
1702
- }
1703
- };
1704
- var getStyles = /* @__PURE__ */ __name((options) => `
1705
- defs #statediagram-barbEnd {
1706
- fill: ${options.transitionColor};
1707
- stroke: ${options.transitionColor};
1708
- }
1709
- g.stateGroup text {
1710
- fill: ${options.nodeBorder};
1711
- stroke: none;
1712
- font-size: 10px;
1713
- }
1714
- g.stateGroup text {
1715
- fill: ${options.textColor};
1716
- stroke: none;
1717
- font-size: 10px;
1718
-
1719
- }
1720
- g.stateGroup .state-title {
1721
- font-weight: bolder;
1722
- fill: ${options.stateLabelColor};
1723
- }
1724
-
1725
- g.stateGroup rect {
1726
- fill: ${options.mainBkg};
1727
- stroke: ${options.nodeBorder};
1728
- }
1729
-
1730
- g.stateGroup line {
1731
- stroke: ${options.lineColor};
1732
- stroke-width: 1;
1733
- }
1734
-
1735
- .transition {
1736
- stroke: ${options.transitionColor};
1737
- stroke-width: 1;
1738
- fill: none;
1739
- }
1740
-
1741
- .stateGroup .composit {
1742
- fill: ${options.background};
1743
- border-bottom: 1px
1744
- }
1745
-
1746
- .stateGroup .alt-composit {
1747
- fill: #e0e0e0;
1748
- border-bottom: 1px
1749
- }
1750
-
1751
- .state-note {
1752
- stroke: ${options.noteBorderColor};
1753
- fill: ${options.noteBkgColor};
1754
-
1755
- text {
1756
- fill: ${options.noteTextColor};
1757
- stroke: none;
1758
- font-size: 10px;
1759
- }
1760
- }
1761
-
1762
- .stateLabel .box {
1763
- stroke: none;
1764
- stroke-width: 0;
1765
- fill: ${options.mainBkg};
1766
- opacity: 0.5;
1767
- }
1768
-
1769
- .edgeLabel .label rect {
1770
- fill: ${options.labelBackgroundColor};
1771
- opacity: 0.5;
1772
- }
1773
- .edgeLabel {
1774
- background-color: ${options.edgeLabelBackground};
1775
- p {
1776
- background-color: ${options.edgeLabelBackground};
1777
- }
1778
- rect {
1779
- opacity: 0.5;
1780
- background-color: ${options.edgeLabelBackground};
1781
- fill: ${options.edgeLabelBackground};
1782
- }
1783
- text-align: center;
1784
- }
1785
- .edgeLabel .label text {
1786
- fill: ${options.transitionLabelColor || options.tertiaryTextColor};
1787
- }
1788
- .label div .edgeLabel {
1789
- color: ${options.transitionLabelColor || options.tertiaryTextColor};
1790
- }
1791
-
1792
- .stateLabel text {
1793
- fill: ${options.stateLabelColor};
1794
- font-size: 10px;
1795
- font-weight: bold;
1796
- }
1797
-
1798
- .node circle.state-start {
1799
- fill: ${options.specialStateColor};
1800
- stroke: ${options.specialStateColor};
1801
- }
1802
-
1803
- .node .fork-join {
1804
- fill: ${options.specialStateColor};
1805
- stroke: ${options.specialStateColor};
1806
- }
1807
-
1808
- .node circle.state-end {
1809
- fill: ${options.innerEndBackground};
1810
- stroke: ${options.background};
1811
- stroke-width: 1.5
1812
- }
1813
- .end-state-inner {
1814
- fill: ${options.compositeBackground || options.background};
1815
- // stroke: ${options.background};
1816
- stroke-width: 1.5
1817
- }
1818
-
1819
- .node rect {
1820
- fill: ${options.stateBkg || options.mainBkg};
1821
- stroke: ${options.stateBorder || options.nodeBorder};
1822
- stroke-width: 1px;
1823
- }
1824
- .node polygon {
1825
- fill: ${options.mainBkg};
1826
- stroke: ${options.stateBorder || options.nodeBorder};;
1827
- stroke-width: 1px;
1828
- }
1829
- #statediagram-barbEnd {
1830
- fill: ${options.lineColor};
1831
- }
1832
-
1833
- .statediagram-cluster rect {
1834
- fill: ${options.compositeTitleBackground};
1835
- stroke: ${options.stateBorder || options.nodeBorder};
1836
- stroke-width: 1px;
1837
- }
1838
-
1839
- .cluster-label, .nodeLabel {
1840
- color: ${options.stateLabelColor};
1841
- // line-height: 1;
1842
- }
1843
-
1844
- .statediagram-cluster rect.outer {
1845
- rx: 5px;
1846
- ry: 5px;
1847
- }
1848
- .statediagram-state .divider {
1849
- stroke: ${options.stateBorder || options.nodeBorder};
1850
- }
1851
-
1852
- .statediagram-state .title-state {
1853
- rx: 5px;
1854
- ry: 5px;
1855
- }
1856
- .statediagram-cluster.statediagram-cluster .inner {
1857
- fill: ${options.compositeBackground || options.background};
1858
- }
1859
- .statediagram-cluster.statediagram-cluster-alt .inner {
1860
- fill: ${options.altBackground ? options.altBackground : "#efefef"};
1861
- }
1862
-
1863
- .statediagram-cluster .inner {
1864
- rx:0;
1865
- ry:0;
1866
- }
1867
-
1868
- .statediagram-state rect.basic {
1869
- rx: 5px;
1870
- ry: 5px;
1871
- }
1872
- .statediagram-state rect.divider {
1873
- stroke-dasharray: 10,10;
1874
- fill: ${options.altBackground ? options.altBackground : "#efefef"};
1875
- }
1876
-
1877
- .note-edge {
1878
- stroke-dasharray: 5;
1879
- }
1880
-
1881
- .statediagram-note rect {
1882
- fill: ${options.noteBkgColor};
1883
- stroke: ${options.noteBorderColor};
1884
- stroke-width: 1px;
1885
- rx: 0;
1886
- ry: 0;
1887
- }
1888
- .statediagram-note rect {
1889
- fill: ${options.noteBkgColor};
1890
- stroke: ${options.noteBorderColor};
1891
- stroke-width: 1px;
1892
- rx: 0;
1893
- ry: 0;
1894
- }
1895
-
1896
- .statediagram-note text {
1897
- fill: ${options.noteTextColor};
1898
- }
1899
-
1900
- .statediagram-note .nodeLabel {
1901
- color: ${options.noteTextColor};
1902
- }
1903
- .statediagram .edgeLabel {
1904
- color: red; // ${options.noteTextColor};
1905
- }
1906
-
1907
- #dependencyStart, #dependencyEnd {
1908
- fill: ${options.lineColor};
1909
- stroke: ${options.lineColor};
1910
- stroke-width: 1;
1911
- }
1912
-
1913
- .statediagramTitleText {
1914
- text-anchor: middle;
1915
- font-size: 18px;
1916
- fill: ${options.textColor};
1917
- }
1918
- `, "getStyles");
1919
- var styles_default = getStyles;
1920
-
1921
- export { StateDB, stateDiagram_default, stateRenderer_v3_unified_default, styles_default };
1922
- //# sourceMappingURL=chunk-JRLFMJ6U.mjs.map
1923
- //# sourceMappingURL=chunk-JRLFMJ6U.mjs.map