@bkm016/basalt 0.1.9 → 0.1.11

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 (188) hide show
  1. package/{chunk-0xd9mnc2.js → chunk-jymx3a77.js} +165 -152
  2. package/{chunk-66h5qpc6.js → chunk-zq32mwxj.js} +134 -134
  3. package/compiled.js +1 -1
  4. package/package.json +1 -1
  5. package/ui-test-worker.js +1 -1
  6. package/web/{chunk-9yfftz38.js → chunk-05mvzx00.js} +1 -1
  7. package/web/chunk-086dshck.js +1 -0
  8. package/web/chunk-0fy590s0.js +1 -0
  9. package/web/{chunk-4a6gdrbs.js → chunk-0hvxb5d5.js} +1 -1
  10. package/web/chunk-0mdf1qja.js +1 -0
  11. package/web/{chunk-dz7g1gnv.js → chunk-0y971zgq.js} +2 -2
  12. package/web/{chunk-fjb3ksfd.js → chunk-1t38sgrk.js} +2 -2
  13. package/web/{chunk-66wb0p6e.js → chunk-1zfxaafq.js} +1 -1
  14. package/web/{chunk-p9hfcamx.js → chunk-27812gqr.js} +5 -5
  15. package/web/{chunk-sk1wkgjw.js → chunk-2ds0a2z1.js} +3 -3
  16. package/web/{chunk-ddyyc20r.js → chunk-2f2agfpj.js} +11 -11
  17. package/web/{chunk-3ecrkvr3.js → chunk-2tsxj613.js} +3 -3
  18. package/web/{chunk-y2rzeb4v.js → chunk-2weaa3gn.js} +2 -2
  19. package/web/{chunk-0pghpg4y.js → chunk-3020mmp1.js} +1 -1
  20. package/web/{chunk-mykrm8ba.js → chunk-30aeb767.js} +2 -2
  21. package/web/chunk-32zmk3f5.js +1 -0
  22. package/web/{chunk-zb2bkr7f.js → chunk-36dc7tcg.js} +2 -2
  23. package/web/{chunk-nnyc889n.js → chunk-3a57m7xm.js} +3 -3
  24. package/web/{chunk-8w7fyb3v.js → chunk-3b4wqmnh.js} +7 -7
  25. package/web/chunk-3d3wnh8a.js +2 -0
  26. package/web/{chunk-601k823s.js → chunk-3ftb27f3.js} +8 -8
  27. package/web/{chunk-c6yacwbc.js → chunk-47mbbmst.js} +3 -3
  28. package/web/chunk-48479gnx.js +1 -0
  29. package/web/{chunk-qsqtwf34.js → chunk-4gc663j0.js} +2 -2
  30. package/web/{chunk-kcjz03h5.js → chunk-4rwwtfnd.js} +2 -2
  31. package/web/{chunk-eqndhs21.js → chunk-4wwd3pfz.js} +2 -2
  32. package/web/{chunk-myd6sc76.js → chunk-57pyz29y.js} +2 -2
  33. package/web/{chunk-mdfksj61.js → chunk-59nk506k.js} +1 -1
  34. package/web/{chunk-db3twjvk.js → chunk-5ahx98zj.js} +9 -9
  35. package/web/chunk-6cjm2yr7.js +1 -0
  36. package/web/{chunk-frnh4zqf.js → chunk-6jb2zyp6.js} +2 -2
  37. package/web/{chunk-ts6jsfdk.js → chunk-793m5jjh.js} +1 -1
  38. package/web/{chunk-3ak5dg10.js → chunk-7dycbjxn.js} +4 -4
  39. package/web/chunk-7ycxz39p.js +1 -0
  40. package/web/{chunk-tftc5v89.js → chunk-8151c970.js} +1 -1
  41. package/web/{chunk-jccz14ye.js → chunk-885kpj14.js} +2 -2
  42. package/web/{chunk-79e08rk1.js → chunk-8csw0mvf.js} +2 -2
  43. package/web/{chunk-m9q5nr8f.js → chunk-8z7texmv.js} +1 -1
  44. package/web/{chunk-v1exk5wd.js → chunk-90fkdzx3.js} +8 -8
  45. package/web/chunk-94denx9h.js +39 -0
  46. package/web/{chunk-5baeh8q7.js → chunk-96xhmmqz.js} +6 -6
  47. package/web/chunk-9jy8nc4r.js +1 -0
  48. package/web/{chunk-5dr4tkem.js → chunk-9kkzmss7.js} +3 -3
  49. package/web/chunk-9wr33d0t.js +1 -0
  50. package/web/{chunk-3pd0qt83.js → chunk-a3pye9ag.js} +3 -3
  51. package/web/chunk-a4tdrxdh.js +1 -0
  52. package/web/chunk-a9fvsyc1.js +1 -0
  53. package/web/chunk-apvbvg4d.js +1 -0
  54. package/web/{chunk-gn8kyz76.js → chunk-b3j07x0n.js} +6 -6
  55. package/web/{chunk-ff1pmd3g.js → chunk-b6sqwmq7.js} +1 -1
  56. package/web/chunk-bkxcc7v5.js +1 -0
  57. package/web/chunk-bve354k7.js +1 -0
  58. package/web/{chunk-zdyys4ar.js → chunk-cbwvfedy.js} +8 -8
  59. package/web/{chunk-eadfxfkw.js → chunk-cpshsp24.js} +1 -1
  60. package/web/chunk-cwpxakby.js +1 -0
  61. package/web/chunk-d3f763n7.js +2 -0
  62. package/web/{chunk-8z0r0wtk.js → chunk-d4519smc.js} +14 -14
  63. package/web/chunk-de29pe57.js +1 -0
  64. package/web/chunk-dk0fnj87.js +1 -0
  65. package/web/{chunk-c57f714b.js → chunk-drchr3yn.js} +2 -2
  66. package/web/chunk-dsbyfvwz.js +1 -0
  67. package/web/{chunk-3hr3ew9w.js → chunk-dtrh40vr.js} +1 -1
  68. package/web/chunk-e68jw0bg.js +1 -0
  69. package/web/{chunk-veam6vk4.js → chunk-e763h2px.js} +67 -67
  70. package/web/{chunk-nvpp0ghj.js → chunk-enryqmj7.js} +5 -5
  71. package/web/{chunk-fpb2dd2d.js → chunk-f79ajymt.js} +2 -2
  72. package/web/{chunk-qq6m2my8.js → chunk-fj753yzt.js} +2 -2
  73. package/web/{chunk-9ctg0f30.js → chunk-g0rtcedn.js} +3 -3
  74. package/web/{chunk-2x4g9t37.js → chunk-g31dbnzm.js} +4 -4
  75. package/web/{chunk-w3w18stt.js → chunk-g4as4zzd.js} +4 -4
  76. package/web/{chunk-6e87m0nm.js → chunk-gten0rpx.js} +2 -2
  77. package/web/{chunk-a0ryzdnp.js → chunk-gyhr27dm.js} +1 -1
  78. package/web/{chunk-98y92vmh.js → chunk-hjyev38w.js} +6 -6
  79. package/web/{chunk-wzd2a4k5.js → chunk-hm8thq7c.js} +4 -4
  80. package/web/{chunk-07agqp8h.js → chunk-j4gvtszc.js} +2 -2
  81. package/web/chunk-jd7npyv9.js +8 -0
  82. package/web/chunk-jhpg2kcf.js +1 -0
  83. package/web/{chunk-9fnr00kv.js → chunk-jqqbkdtw.js} +2 -2
  84. package/web/chunk-jzz5htxp.js +1 -0
  85. package/web/chunk-ka3q31t1.js +1 -0
  86. package/web/chunk-kahab58k.js +1139 -0
  87. package/web/{chunk-af9evdza.js → chunk-kfbgvh0c.js} +1 -1
  88. package/web/chunk-krgvx75q.js +1 -0
  89. package/web/chunk-kxeaj44h.js +1 -0
  90. package/web/chunk-m1rdyvb5.js +1 -0
  91. package/web/{chunk-5v2c0aqk.js → chunk-m24yb8md.js} +2 -2
  92. package/web/chunk-m7k4wr3k.js +1 -0
  93. package/web/chunk-mdj3r75b.js +1 -0
  94. package/web/{chunk-ewx42c11.js → chunk-mpdeqzc9.js} +10 -10
  95. package/web/{chunk-b5h52neg.js → chunk-mykbcvqz.js} +1 -1
  96. package/web/{chunk-7qkav30b.js → chunk-n33753da.js} +1 -1
  97. package/web/{chunk-rasjtvsb.js → chunk-nafe18y9.js} +10 -10
  98. package/web/chunk-nbcpbqq4.js +1 -0
  99. package/web/{chunk-24jhbz82.js → chunk-nhx8pw7p.js} +1 -1
  100. package/web/chunk-nkpdd9hw.js +1 -0
  101. package/web/{chunk-dwjmr0zj.js → chunk-p1yc8hwn.js} +1 -1
  102. package/web/chunk-p29brxyt.js +1 -0
  103. package/web/chunk-p8fbes0t.js +1 -0
  104. package/web/chunk-pbp1p5ex.js +1 -0
  105. package/web/{chunk-xx11yv61.js → chunk-ppjw1mps.js} +4 -4
  106. package/web/{chunk-7tkgbbf9.js → chunk-pq56b3mq.js} +2 -2
  107. package/web/{chunk-vvvd3grf.js → chunk-pzg25qqe.js} +2 -2
  108. package/web/{chunk-spbs56wz.js → chunk-q65zxczs.js} +7 -7
  109. package/web/{chunk-t893141g.js → chunk-q8v5j963.js} +2 -2
  110. package/web/{chunk-vsjpnwsr.js → chunk-qykt7avq.js} +2 -2
  111. package/web/chunk-r6q1301x.js +1 -0
  112. package/web/chunk-r8kghrkb.js +1 -0
  113. package/web/chunk-rhxn7mxg.js +1 -0
  114. package/web/{chunk-2dvbeqt0.js → chunk-rqympya7.js} +2 -2
  115. package/web/{chunk-30b33r2w.js → chunk-s0xy00v5.js} +2 -2
  116. package/web/chunk-svqshmpg.js +1 -0
  117. package/web/chunk-swzxq7r3.css +1 -0
  118. package/web/{chunk-8jcvdd5d.js → chunk-t18tn37m.js} +2 -2
  119. package/web/chunk-tbsaseer.js +1 -0
  120. package/web/{chunk-5jdrev9p.js → chunk-tggja45g.js} +3 -3
  121. package/web/chunk-tgkdyxbn.js +1 -0
  122. package/web/{chunk-rrpn5r5w.js → chunk-tpdcrrf1.js} +1 -1
  123. package/web/chunk-v0zfnvc1.js +1 -0
  124. package/web/{chunk-5a4mj3qz.js → chunk-v3dn9bfw.js} +1 -1
  125. package/web/chunk-vj31fs16.js +1 -0
  126. package/web/chunk-vr79r8vh.js +1 -0
  127. package/web/chunk-wb9tax0m.js +1 -0
  128. package/web/{chunk-rayf24gy.js → chunk-wbwets5x.js} +23 -23
  129. package/web/chunk-x9eghjjd.js +1 -0
  130. package/web/{chunk-awkdw9rw.js → chunk-xbyrgyy0.js} +2 -2
  131. package/web/{chunk-60axh4sa.js → chunk-xjc5fmcr.js} +24 -24
  132. package/web/{chunk-qh62nkem.js → chunk-ydtrc1ay.js} +2 -2
  133. package/web/chunk-yrh86m0n.js +1 -0
  134. package/web/chunk-z3ky5ews.js +2 -0
  135. package/web/{chunk-ctzkqx2g.js → chunk-zdhyq3ch.js} +13 -13
  136. package/web/{chunk-0zwc2rvh.js → chunk-zv73g4qq.js} +2 -2
  137. package/web/index.html +1 -1
  138. package/web/chunk-08sq3cwm.js +0 -1
  139. package/web/chunk-12qf1r6m.js +0 -1
  140. package/web/chunk-24fjnnee.js +0 -1
  141. package/web/chunk-2hrswh3d.js +0 -2
  142. package/web/chunk-2j2atyjw.js +0 -1
  143. package/web/chunk-3h3g3ca3.js +0 -1
  144. package/web/chunk-3pcrxg6m.js +0 -1
  145. package/web/chunk-3txxt0a7.js +0 -1
  146. package/web/chunk-43g4wd7a.js +0 -1
  147. package/web/chunk-5z2n4z9x.css +0 -1
  148. package/web/chunk-6y55gk1n.js +0 -1
  149. package/web/chunk-7qq1ypvj.js +0 -1
  150. package/web/chunk-814kkkmq.js +0 -8
  151. package/web/chunk-8w8atrdh.js +0 -1
  152. package/web/chunk-935mjq1c.js +0 -39
  153. package/web/chunk-942g3eqn.js +0 -1
  154. package/web/chunk-a61zrp66.js +0 -1
  155. package/web/chunk-arnzrqnm.js +0 -1
  156. package/web/chunk-avxk6jpc.js +0 -2
  157. package/web/chunk-bwy3e58v.js +0 -1
  158. package/web/chunk-dnv8dx72.js +0 -1
  159. package/web/chunk-f7jpakwh.js +0 -1
  160. package/web/chunk-fmthkpff.js +0 -1
  161. package/web/chunk-gv99c8zv.js +0 -1
  162. package/web/chunk-h0767tjv.js +0 -1
  163. package/web/chunk-h0c42zy3.js +0 -1
  164. package/web/chunk-hqynf99g.js +0 -1
  165. package/web/chunk-ket6g0yd.js +0 -1
  166. package/web/chunk-mbwwj216.js +0 -1
  167. package/web/chunk-me7dza1c.js +0 -1
  168. package/web/chunk-mzzaet63.js +0 -1
  169. package/web/chunk-n0wazxgz.js +0 -1
  170. package/web/chunk-nvt9tkt4.js +0 -1139
  171. package/web/chunk-ph1dgffm.js +0 -1
  172. package/web/chunk-q34as3v6.js +0 -1
  173. package/web/chunk-qz6r9v1z.js +0 -1
  174. package/web/chunk-rad2s9ha.js +0 -1
  175. package/web/chunk-s37beysw.js +0 -1
  176. package/web/chunk-s60s09mb.js +0 -1
  177. package/web/chunk-tfvcs2xx.js +0 -1
  178. package/web/chunk-tj1fn8v2.js +0 -1
  179. package/web/chunk-vqmj6peg.js +0 -1
  180. package/web/chunk-wdq2tp9e.js +0 -1
  181. package/web/chunk-wkf5xfyr.js +0 -1
  182. package/web/chunk-xa43ndfj.js +0 -2
  183. package/web/chunk-xh4xn1az.js +0 -1
  184. package/web/chunk-xzwxcxb4.js +0 -1
  185. package/web/chunk-y1qty77a.js +0 -1
  186. package/web/chunk-ys2tns0p.js +0 -1
  187. package/web/chunk-z05x9cbm.js +0 -1
  188. package/web/chunk-zgavhnt8.js +0 -1
@@ -1,9 +1,9 @@
1
- import{t,a,Re,b,C,S,E,T,A,L,R,l,p,Yi,M,pe,se,le,gt,ge,ye}from"./chunk-veam6vk4.js";import{Ft}from"./chunk-79e08rk1.js";import{he}from"./chunk-rrpn5r5w.js";import{ue}from"./chunk-7qkav30b.js";var Bt=function(){var e=t(function(Q,h,g,n){for(g=g||{},n=Q.length;n--;g[Q[n]]=h);return g},"o"),s=[1,2],c=[1,3],r=[1,4],u=[2,4],f=[1,9],m=[1,11],k=[1,16],o=[1,17],D=[1,18],x=[1,19],G=[1,33],Y=[1,20],j=[1,21],O=[1,22],y=[1,23],V=[1,24],F=[1,26],z=[1,27],W=[1,28],K=[1,29],N=[1,30],st=[1,31],pt=[1,32],St=[1,35],yt=[1,36],mt=[1,37],bt=[1,38],rt=[1,34],_=[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],kt=[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],Mt=[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],Lt={trace:t(function(){},"trace"),yy:{},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},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"},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]],performAction:t(function(h,g,n,v,w,i,it){var d=i.length-1;switch(w){case 3:return v.setRootDoc(i[d]),i[d];break;case 4:this.$=[];break;case 5:if(i[d]!="nl")i[d-1].push(i[d]),this.$=i[d-1];break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:let Et=i[d-1];Et.description=v.trimColon(i[d]),this.$=Et;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:let _t=v.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:_t};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var X=i[d],J=i[d-2].trim();if(i[d].match(":")){var lt=i[d].split(":");X=lt[0],J=[J,lt[1]]}this.$={stmt:"state",id:X,type:"default",description:J};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:v.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),v.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),v.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:v.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:v.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:v.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:v.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:s,5:c,6:r},{1:[3]},{3:5,4:s,5:c,6:r},{3:6,4:s,5:c,6:r},e([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],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:k,17:o,19:D,22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},e(_,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:k,17:o,19:D,22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},e(_,[2,7]),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(_,[2,11]),e(_,[2,12],{14:[1,40],15:[1,41]}),e(_,[2,16]),{18:[1,42]},e(_,[2,18],{20:[1,43]}),{23:[1,44]},e(_,[2,22]),e(_,[2,23]),e(_,[2,24]),e(_,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(_,[2,28]),{34:[1,49]},{36:[1,50]},e(_,[2,31]),{13:51,24:G,57:rt},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(kt,[2,44],{58:[1,56]}),e(kt,[2,45],{58:[1,57]}),e(_,[2,38]),e(_,[2,39]),e(_,[2,40]),e(_,[2,41]),e(_,[2,6]),e(_,[2,13]),{13:58,24:G,57:rt},e(_,[2,17]),e(Mt,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(_,[2,29]),e(_,[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]},e(_,[2,14],{14:[1,71]}),{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:k,17:o,19:D,21:[1,72],22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},e(_,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(_,[2,34]),e(_,[2,35]),e(_,[2,36]),e(_,[2,37]),e(kt,[2,46]),e(kt,[2,47]),e(_,[2,15]),e(_,[2,19]),e(Mt,u,{7:78}),e(_,[2,26]),e(_,[2,27]),{5:[1,79]},{5:[1,80]},{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:k,17:o,19:D,21:[1,81],22:x,24:G,25:Y,26:j,27:O,28:y,29:V,32:25,33:F,35:z,37:W,38:K,41:N,45:st,48:pt,51:St,52:yt,53:mt,54:bt,57:rt},e(_,[2,32]),e(_,[2,33]),e(_,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:t(function(h,g){if(g.recoverable)this.trace(h);else{var n=Error(h);throw n.hash=g,n}},"parseError"),parse:t(function(h){var g=this,n=[0],v=[],w=[null],i=[],it=this.table,d="",X=0,J=0,lt=0,Et=2,_t=1,be=i.slice.call(arguments,1),I=Object.create(this.lexer),tt={yy:{}};for(var wt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,wt))tt.yy[wt]=this.yy[wt];if(I.setInput(h,tt.yy),tt.yy.lexer=I,tt.yy.parser=this,typeof I.yylloc>"u")I.yylloc={};var It=I.yylloc;i.push(It);var ke=I.options&&I.options.ranges;if(typeof tt.yy.parseError==="function")this.parseError=tt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Te(H){n.length=n.length-2*H,w.length=w.length-H,i.length=i.length-H}t(Te,"popStack");function Wt(){var H=v.pop()||I.lex()||_t;if(typeof H!=="number"){if(H instanceof Array)v=H,H=v.pop();H=g.symbols_[H]||H}return H}t(Wt,"lex");var P,Nt,et,U,ts,Ot,at={},vt,q,jt,Dt;while(!0){if(et=n[n.length-1],this.defaultActions[et])U=this.defaultActions[et];else{if(P===null||typeof P>"u")P=Wt();U=it[et]&&it[et][P]}if(typeof U>"u"||!U.length||!U[0]){var Rt="";Dt=[];for(vt in it[et])if(this.terminals_[vt]&&vt>Et)Dt.push("'"+this.terminals_[vt]+"'");if(I.showPosition)Rt="Parse error on line "+(X+1)+`:
1
+ import{t,a,Re,b,C,S,E,T,A,L,R,l,p,Gi,N,pe,se,le,vt,ge,ye}from"./chunk-e763h2px.js";import{Bt}from"./chunk-8csw0mvf.js";import{he}from"./chunk-tpdcrrf1.js";import{ue}from"./chunk-n33753da.js";var Pt=function(){var e=t(function(Q,h,g,n){for(g=g||{},n=Q.length;n--;g[Q[n]]=h);return g},"o"),s=[1,2],c=[1,3],r=[1,4],u=[2,4],f=[1,9],m=[1,11],k=[1,16],o=[1,17],D=[1,18],x=[1,19],Y=[1,33],V=[1,20],j=[1,21],F=[1,22],y=[1,23],M=[1,24],P=[1,26],z=[1,27],W=[1,28],K=[1,29],O=[1,30],st=[1,31],pt=[1,32],St=[1,35],gt=[1,36],yt=[1,37],mt=[1,38],rt=[1,34],_=[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],bt=[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],Mt=[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],Lt={trace:t(function(){},"trace"),yy:{},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},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"},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]],performAction:t(function(h,g,n,v,w,i,it){var d=i.length-1;switch(w){case 3:return v.setRootDoc(i[d]),i[d];break;case 4:this.$=[];break;case 5:if(i[d]!="nl")i[d-1].push(i[d]),this.$=i[d-1];break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:let Tt=i[d-1];Tt.description=v.trimColon(i[d]),this.$=Tt;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:let Et=v.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:Et};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var X=i[d],J=i[d-2].trim();if(i[d].match(":")){var lt=i[d].split(":");X=lt[0],J=[J,lt[1]]}this.$={stmt:"state",id:X,type:"default",description:J};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:v.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),v.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),v.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:v.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:v.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:v.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:v.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:s,5:c,6:r},{1:[3]},{3:5,4:s,5:c,6:r},{3:6,4:s,5:c,6:r},e([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],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:k,17:o,19:D,22:x,24:Y,25:V,26:j,27:F,28:y,29:M,32:25,33:P,35:z,37:W,38:K,41:O,45:st,48:pt,51:St,52:gt,53:yt,54:mt,57:rt},e(_,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:k,17:o,19:D,22:x,24:Y,25:V,26:j,27:F,28:y,29:M,32:25,33:P,35:z,37:W,38:K,41:O,45:st,48:pt,51:St,52:gt,53:yt,54:mt,57:rt},e(_,[2,7]),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(_,[2,11]),e(_,[2,12],{14:[1,40],15:[1,41]}),e(_,[2,16]),{18:[1,42]},e(_,[2,18],{20:[1,43]}),{23:[1,44]},e(_,[2,22]),e(_,[2,23]),e(_,[2,24]),e(_,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(_,[2,28]),{34:[1,49]},{36:[1,50]},e(_,[2,31]),{13:51,24:Y,57:rt},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(bt,[2,44],{58:[1,56]}),e(bt,[2,45],{58:[1,57]}),e(_,[2,38]),e(_,[2,39]),e(_,[2,40]),e(_,[2,41]),e(_,[2,6]),e(_,[2,13]),{13:58,24:Y,57:rt},e(_,[2,17]),e(Mt,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(_,[2,29]),e(_,[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]},e(_,[2,14],{14:[1,71]}),{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:k,17:o,19:D,21:[1,72],22:x,24:Y,25:V,26:j,27:F,28:y,29:M,32:25,33:P,35:z,37:W,38:K,41:O,45:st,48:pt,51:St,52:gt,53:yt,54:mt,57:rt},e(_,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(_,[2,34]),e(_,[2,35]),e(_,[2,36]),e(_,[2,37]),e(bt,[2,46]),e(bt,[2,47]),e(_,[2,15]),e(_,[2,19]),e(Mt,u,{7:78}),e(_,[2,26]),e(_,[2,27]),{5:[1,79]},{5:[1,80]},{4:f,5:m,8:8,9:10,10:12,11:13,12:14,13:15,16:k,17:o,19:D,21:[1,81],22:x,24:Y,25:V,26:j,27:F,28:y,29:M,32:25,33:P,35:z,37:W,38:K,41:O,45:st,48:pt,51:St,52:gt,53:yt,54:mt,57:rt},e(_,[2,32]),e(_,[2,33]),e(_,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:t(function(h,g){if(g.recoverable)this.trace(h);else{var n=Error(h);throw n.hash=g,n}},"parseError"),parse:t(function(h){var g=this,n=[0],v=[],w=[null],i=[],it=this.table,d="",X=0,J=0,lt=0,Tt=2,Et=1,be=i.slice.call(arguments,1),I=Object.create(this.lexer),tt={yy:{}};for(var wt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,wt))tt.yy[wt]=this.yy[wt];if(I.setInput(h,tt.yy),tt.yy.lexer=I,tt.yy.parser=this,typeof I.yylloc>"u")I.yylloc={};var It=I.yylloc;i.push(It);var ke=I.options&&I.options.ranges;if(typeof tt.yy.parseError==="function")this.parseError=tt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Te(H){n.length=n.length-2*H,w.length=w.length-H,i.length=i.length-H}t(Te,"popStack");function Wt(){var H=v.pop()||I.lex()||Et;if(typeof H!=="number"){if(H instanceof Array)v=H,H=v.pop();H=g.symbols_[H]||H}return H}t(Wt,"lex");var B,Nt,et,U,ts,Ot,at={},_t,q,jt,Dt;while(!0){if(et=n[n.length-1],this.defaultActions[et])U=this.defaultActions[et];else{if(B===null||typeof B>"u")B=Wt();U=it[et]&&it[et][B]}if(typeof U>"u"||!U.length||!U[0]){var Rt="";Dt=[];for(_t in it[et])if(this.terminals_[_t]&&_t>Tt)Dt.push("'"+this.terminals_[_t]+"'");if(I.showPosition)Rt="Parse error on line "+(X+1)+`:
2
2
  `+I.showPosition()+`
3
- Expecting `+Dt.join(", ")+", got '"+(this.terminals_[P]||P)+"'";else Rt="Parse error on line "+(X+1)+": Unexpected "+(P==_t?"end of input":"'"+(this.terminals_[P]||P)+"'");this.parseError(Rt,{text:I.match,token:this.terminals_[P]||P,line:I.yylineno,loc:It,expected:Dt})}if(U[0]instanceof Array&&U.length>1)throw Error("Parse Error: multiple actions possible at state: "+et+", token: "+P);switch(U[0]){case 1:if(n.push(P),w.push(I.yytext),i.push(I.yylloc),n.push(U[1]),P=null,!Nt){if(J=I.yyleng,d=I.yytext,X=I.yylineno,It=I.yylloc,lt>0)lt--}else P=Nt,Nt=null;break;case 2:if(q=this.productions_[U[1]][1],at.$=w[w.length-q],at._$={first_line:i[i.length-(q||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(q||1)].first_column,last_column:i[i.length-1].last_column},ke)at._$.range=[i[i.length-(q||1)].range[0],i[i.length-1].range[1]];if(Ot=this.performAction.apply(at,[d,J,X,tt.yy,U[1],w,i].concat(be)),typeof Ot<"u")return Ot;if(q)n=n.slice(0,-1*q*2),w=w.slice(0,-1*q),i=i.slice(0,-1*q);n.push(this.productions_[U[1]][0]),w.push(at.$),i.push(at._$),jt=it[n[n.length-2]][n[n.length-1]],n.push(jt);break;case 3:return!0}}return!0},"parse")},me=function(){var Q={EOF:1,parseError:t(function(g,n){if(this.yy.parser)this.yy.parser.parseError(g,n);else throw Error(g)},"parseError"),setInput:t(function(h,g){if(this.yy=g||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var g=h.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:t(function(h){var g=h.length,n=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var v=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1)this.yylineno-=n.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===v.length?this.yylloc.first_column:0)+v[v.length-n.length].length-n[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
3
+ Expecting `+Dt.join(", ")+", got '"+(this.terminals_[B]||B)+"'";else Rt="Parse error on line "+(X+1)+": Unexpected "+(B==Et?"end of input":"'"+(this.terminals_[B]||B)+"'");this.parseError(Rt,{text:I.match,token:this.terminals_[B]||B,line:I.yylineno,loc:It,expected:Dt})}if(U[0]instanceof Array&&U.length>1)throw Error("Parse Error: multiple actions possible at state: "+et+", token: "+B);switch(U[0]){case 1:if(n.push(B),w.push(I.yytext),i.push(I.yylloc),n.push(U[1]),B=null,!Nt){if(J=I.yyleng,d=I.yytext,X=I.yylineno,It=I.yylloc,lt>0)lt--}else B=Nt,Nt=null;break;case 2:if(q=this.productions_[U[1]][1],at.$=w[w.length-q],at._$={first_line:i[i.length-(q||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(q||1)].first_column,last_column:i[i.length-1].last_column},ke)at._$.range=[i[i.length-(q||1)].range[0],i[i.length-1].range[1]];if(Ot=this.performAction.apply(at,[d,J,X,tt.yy,U[1],w,i].concat(be)),typeof Ot<"u")return Ot;if(q)n=n.slice(0,-1*q*2),w=w.slice(0,-1*q),i=i.slice(0,-1*q);n.push(this.productions_[U[1]][0]),w.push(at.$),i.push(at._$),jt=it[n[n.length-2]][n[n.length-1]],n.push(jt);break;case 3:return!0}}return!0},"parse")},me=function(){var Q={EOF:1,parseError:t(function(g,n){if(this.yy.parser)this.yy.parser.parseError(g,n);else throw Error(g)},"parseError"),setInput:t(function(h,g){if(this.yy=g||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var g=h.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:t(function(h){var g=h.length,n=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var v=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1)this.yylineno-=n.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===v.length?this.yylloc.first_column:0)+v[v.length-n.length].length-n[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(h){this.unput(this.match.slice(h))},"less"),pastInput:t(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var h=this.match;if(h.length<20)h+=this._input.substr(0,20-h.length);return(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var h=this.pastInput(),g=Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
5
  `+g+"^"},"showPosition"),test_match:t(function(h,g){var n,v,w;if(this.options.backtrack_lexer){if(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)w.yylloc.range=this.yylloc.range.slice(0)}if(v=h[0].match(/(?:\r\n?|\n).*/g),v)this.yylineno+=v.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],n=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(n)return n;else if(this._backtrack){for(var i in w)this[i]=w[i];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,g,n,v;if(!this._more)this.yytext="",this.match="";var w=this._currentRules();for(var i=0;i<w.length;i++)if(n=this._input.match(this.rules[w[i]]),n&&(!g||n[0].length>g[0].length)){if(g=n,v=i,this.options.backtrack_lexer)if(h=this.test_match(n,w[i]),h!==!1)return h;else if(this._backtrack){g=!1;continue}else return!1;else if(!this.options.flex)break}if(g){if(h=this.test_match(g,w[v]),h!==!1)return h;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,n,v,w){function i(){let d=n.yytext.indexOf("%%");if(d===0)return!1;if(d>0){let X=n.yytext.slice(0,d),J=n.yytext.slice(d);if(J)g.lexer.unput(J);n.yytext=X}return!0}t(i,"processId");var it=w;switch(v){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;break;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;break;case 17:return this.popState(),"acc_title_value";break;case 18:return this.begin("acc_descr"),35;break;case 19:return this.popState(),"acc_descr_value";break;case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;break;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 25:return this.popState(),this.pushState("CLASSDEFID"),42;break;case 26:return this.popState(),43;break;case 27:return this.pushState("CLASS"),48;break;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;break;case 29:return this.popState(),50;break;case 30:return this.pushState("STYLE"),45;break;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;break;case 32:return this.popState(),47;break;case 33:return this.pushState("SCALE"),17;break;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";break;case 49:if(!i())return;return this.popState(),"ID";break;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw Error('Error: State name must be a single word. Found: "'+n.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;break;case 56:return this.popState(),21;break;case 57:break;case 58:return this.begin("NOTE"),29;break;case 59:return this.popState(),this.pushState("NOTE_ID"),59;break;case 60:return this.popState(),this.pushState("NOTE_ID"),60;break;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";break;case 63:break;case 64:return"NOTE_TEXT";case 65:if(!i())return;return this.popState(),"ID";break;case 66:if(!i())return;return this.popState(),this.pushState("NOTE_TEXT"),24;break;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;break;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;break;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!i())return;return 24;case 74:return n.yytext=n.yytext.trim(),14;break;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),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,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return Q}();Lt.lexer=me;function Tt(){this.yy={}}return t(Tt,"Parser"),Tt.prototype=Lt,Lt.Parser=Tt,new Tt}();Bt.parser=Bt;var Ee=Bt,_e="TB",qt="TB",Ut="dir",ot="state",nt="root",Gt="relation",ve="classDef",De="style",Ce="applyClass",ut="default",Qt="divider",Zt="fill:none",te="fill: #333",ee="c",re="markdown",ie="normal",$t="rect",Pt="rectWithTitle",Ae="stateStart",xe="stateEnd",Yt="divider",Ht="roundedWithTitle",Le="note",we="noteGroup",ft="statediagram",Ie="state",Ne=`${ft}-${Ie}`,ae="transition",Oe="note",$e="note-edge",Fe=`${ae} ${$e}`,Pe=`${ft}-${Oe}`,Be="cluster",Ge=`${ft}-${Be}`,Ye="cluster-alt",Ve=`${ft}-${Ye}`,ne="parent",oe="note",Me="state",Vt="----",We=`${Vt}${oe}`,zt=`${Vt}${ne}`,At=new Map,Z=0,ce=0,ct=new Map,je=t((e,s,c,r)=>{if(e===Yt&&c?.id!==void 0&&ct.has(c.id)){let m=ct.get(c.id);return ct.set(s,m),m}let u=ce++,f=r?void 0:u;return ct.set(s,f),f},"colorSlotFor");function xt(e="",s=0,c="",r=Vt){let u=c!==null&&c.length>0?`${r}${c}`:"";return`${Me}-${e}${u}-${s}`}t(xt,"stateDomId");var Ue=t((e,s,c,r,u,f,m,k)=>{a.trace("items",s),s.forEach((o)=>{switch(o.stmt){case ot:dt(e,o,c,r,u,f,m,k);break;case ut:dt(e,o,c,r,u,f,m,k);break;case Gt:{dt(e,o.state1,c,r,u,f,m,k),dt(e,o.state2,c,r,u,f,m,k);let D=m==="neo",x={id:"edge"+Z,start:o.state1.id,end:o.state2.id,arrowhead:"normal",arrowTypeEnd:D?"arrow_barb_neo":"arrow_barb",style:Zt,labelStyle:"",label:b.sanitizeText(o.description??"",l()),arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,classes:ae,look:m};u.push(x),Z++}break}})},"setupDoc"),Kt=t((e,s=qt)=>{let c=s;if(e.doc){for(let r of e.doc)if(r.stmt==="dir")c=r.value}return c},"getDir");function ht(e,s,c){if(!s.id||s.id==="</join></fork>"||s.id==="</choice>")return;if(s.cssClasses){if(!Array.isArray(s.cssCompiledStyles))s.cssCompiledStyles=[];s.cssClasses.split(" ").forEach((u)=>{let f=c.get(u);if(f)s.cssCompiledStyles=[...s.cssCompiledStyles??[],...f.styles]})}let r=e.find((u)=>u.id===s.id);if(r)Object.assign(r,s);else e.push(s)}t(ht,"insertOrUpdateNode");function de(e){return e?.classes?.join(" ")??""}t(de,"getClassesFromDbInfo");function fe(e){return e?.styles??[]}t(fe,"getStylesFromDbInfo");var dt=t((e,s,c,r,u,f,m,k)=>{let o=s.id,D=c.get(o),x=de(D),G=fe(D),Y=l(),j=x.trim()!==""||G.length>0;if(a.info("dataFetcher parsedItem",s,D,G),o!=="root"){let O=$t;if(s.start===!0)O=Ae;else if(s.start===!1)O=xe;if(s.type!==ut)O=s.type;if(!At.get(o))At.set(o,{id:o,shape:O,description:b.sanitizeText(o,Y),cssClasses:`${x} ${Ne}`,cssStyles:G});let y=At.get(o);if(s.description){if(Array.isArray(y.description))y.shape=Pt,y.description.push(s.description);else if(y.description?.length&&y.description.length>0)if(y.shape=Pt,y.description===o)y.description=[s.description];else y.description=[y.description,s.description];else y.shape=$t,y.description=s.description;y.description=b.sanitizeTextOrArray(y.description,Y)}if(y.description?.length===1&&y.shape===Pt)if(y.type==="group")y.shape=Ht;else y.shape=$t;if(!y.type&&s.doc)a.info("Setting cluster for XCX",o,Kt(s)),y.type="group",y.isGroup=!0,y.dir=Kt(s),y.shape=s.type===Qt?Yt:Ht,y.colorIndex=je(y.shape,o,e,j),y.cssClasses=`${y.cssClasses} ${Ge} ${f?Ve:""}`;let V={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:o,dir:y.dir,domId:xt(o,Z),type:y.type,isGroup:y.type==="group",colorIndex:y.colorIndex,padding:8,rx:10,ry:10,look:m,labelType:"markdown"};if(V.shape===Yt)V.label="";if(e&&e.id!=="root")a.trace("Setting node ",o," to be child of its parent ",e.id),V.parentId=e.id;if(V.centerLabel=!0,s.note){let F={labelStyle:"",shape:Le,label:s.note.text,labelType:"markdown",cssClasses:Pe,cssStyles:[],cssCompiledStyles:[],id:o+We+"-"+Z,domId:xt(o,Z,oe),type:"node",isGroup:!1,padding:Y.flowchart?.padding,look:m,position:s.note.position},z=o+zt,W={labelStyle:"",shape:we,label:s.note.text,cssClasses:y.cssClasses,cssStyles:[],id:o+zt,domId:xt(o,Z,ne),type:"group",isGroup:!0,padding:16,look:m,position:s.note.position};Z++,W.id=z,F.parentId=z,ht(r,W,k),ht(r,F,k),ht(r,V,k);let K=o,N=F.id;if(s.note.position==="left of")K=F.id,N=o;u.push({id:K+"-"+N,start:K,end:N,arrowhead:"none",arrowTypeEnd:"",style:Zt,labelStyle:"",classes:Fe,pattern:"dashed",arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,look:m})}else ht(r,V,k)}if(s.doc)a.trace("Adding nodes children "),Ue(s,s.doc,c,r,u,!f,m,k)},"dataFetcher"),He=t(()=>{At.clear(),Z=0,ce=0,ct.clear()},"reset"),Se=t((e,s=qt)=>{if(!e.doc)return s;let c=s;for(let r of e.doc)if(r.stmt==="dir")c=r.value;return c},"getDir"),ze=t(function(e,s){return s.db.getClasses()},"getClasses"),Ke=t(async function(e,s,c,r){a.info("REF0:"),a.info("Drawing state diagram (v2)",s);let{securityLevel:u,state:f,layout:m}=l();r.db.extract(r.db.getRootDocV2());let k=r.db.getData(),o=he(s,u);if(k.type=r.type,k.layoutAlgorithm=ye(m),k.nodeSpacing=f?.nodeSpacing||50,k.rankSpacing=f?.rankSpacing||50,l().look==="neo")k.markers=["barbNeo"];else k.markers=["barb"];k.diagramId=s,await ge(k,o);let x=8;try{(typeof r.db.getLinks==="function"?r.db.getLinks():new Map).forEach((Y,j)=>{let O=typeof j==="string"?j:typeof j?.id==="string"?j.id:"",y=k.nodes.find((N)=>N.id===O);if(!O){a.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(j));return}let V=o.node()?.querySelectorAll("g.node, g.rough-node"),F;if(V?.forEach((N)=>{let st=N.textContent?.trim();if(N.id===y?.domId||st===O)F=N}),!F){a.warn("⚠️ Could not find node matching text:",O);return}let z=F.parentNode;if(!z){a.warn("⚠️ Node has no parent, cannot wrap:",O);return}let W=document.createElementNS("http://www.w3.org/2000/svg","a"),K=Y.url.replace(/^"+|"+$/g,"");if(W.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",K),W.setAttribute("target","_blank"),Y.tooltip){let N=Y.tooltip.replace(/^"+|"+$/g,"");W.setAttribute("title",N),F.setAttribute("title",N)}z.replaceChild(W,F),W.appendChild(F),a.info("\uD83D\uDD17 Wrapped node in <a> tag for:",O,Y.url)})}catch(G){a.error("❌ Error injecting clickable links:",G)}M.insertTitle(o,"statediagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),ue(o,x,ft,f?.useMaxWidth??!0)},"draw"),Xe={getClasses:ze,draw:Ke,getDir:Se},B={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Xt=t(()=>new Map,"newClassesList"),Jt=t(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Ct=t((e)=>JSON.parse(JSON.stringify(e)),"clone"),Je=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Xt(),this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=E,this.setAccTitle=S,this.getAccDescription=A,this.setAccDescription=T,this.setDiagramTitle=L,this.getDiagramTitle=R,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{t(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let r of Array.isArray(e)?e:e.doc)switch(r.stmt){case ot:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case Gt:this.addRelation(r.state1,r.state2,r.description);break;case ve:this.addStyleClass(r.id.trim(),r.classes);break;case De:this.handleStyleDef(r);break;case Ce:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}let s=this.getStates(),c=l();He(),dt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,c.look,this.classes);for(let r of this.nodes){if(!Array.isArray(r.label))continue;if(r.description=r.label.slice(1),r.isGroup&&r.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`);r.label=r.label[0]}}handleStyleDef(e){let s=e.id.trim().split(","),c=e.styleClass.split(",");for(let r of s){let u=this.getState(r);if(!u){let f=r.trim();this.addState(f),u=this.getState(f)}if(u)u.styles=c.map((f)=>f.replace(/;/g,"")?.trim())}}setRootDoc(e){if(a.info("Setting root doc",e),this.rootDoc=e,this.version===1)this.extract(e);else this.extract(this.getRootDocV2())}docTranslator(e,s,c){if(s.stmt===Gt){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===ot)if(s.id===B.START_NODE)s.id=e.id+(c?"_start":"_end"),s.start=c;else s.id=s.id.trim();if(s.stmt!==nt&&s.stmt!==ot||!s.doc)return;let r=[],u=[];for(let f of s.doc)if(f.type===Qt){let m=Ct(f);m.doc=Ct(u),r.push(m),u=[]}else u.push(f);if(r.length>0&&u.length>0){let f={stmt:ot,id:Yi(),type:"divider",doc:Ct(u)};r.push(Ct(f)),s.doc=r}s.doc.forEach((f)=>this.docTranslator(s,f,!0))}getRootDocV2(){return this.docTranslator({id:nt,stmt:nt},{id:nt,stmt:nt,doc:this.rootDoc},!0),{id:nt,doc:this.rootDoc}}addState(e,s=ut,c=void 0,r=void 0,u=void 0,f=void 0,m=void 0,k=void 0){let o=e?.trim();if(!this.currentDocument.states.has(o))a.info("Adding state ",o,r),this.currentDocument.states.set(o,{stmt:ot,id:o,descriptions:[],type:s,doc:c,note:u,classes:[],styles:[],textStyles:[]});else{let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);if(!D.doc)D.doc=c;if(!D.type)D.type=s}if(r)a.info("Setting state description",o,r),(Array.isArray(r)?r:[r]).forEach((x)=>this.addDescription(o,x.trim()));if(u){let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);D.note=u,D.note.text=b.sanitizeText(D.note.text,l())}if(f)a.info("Setting state classes",o,f),(Array.isArray(f)?f:[f]).forEach((x)=>this.setCssClass(o,x.trim()));if(m)a.info("Setting state styles",o,m),(Array.isArray(m)?m:[m]).forEach((x)=>this.setStyle(o,x.trim()));if(k)a.info("Setting state styles",o,m),(Array.isArray(k)?k:[k]).forEach((x)=>this.setTextStyle(o,x.trim()))}clear(e){if(this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Xt(),!e)this.links=new Map,C()}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){a.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,c){this.links.set(e,{url:s,tooltip:c}),a.warn("Adding link",e,s,c)}getLinks(){return this.links}startIdIfNeeded(e=""){if(e===B.START_NODE)return this.startEndCount++,`${B.START_TYPE}${this.startEndCount}`;return e}startTypeIfNeeded(e="",s=ut){return e===B.START_NODE?B.START_TYPE:s}endIdIfNeeded(e=""){if(e===B.END_NODE)return this.startEndCount++,`${B.END_TYPE}${this.startEndCount}`;return e}endTypeIfNeeded(e="",s=ut){return e===B.END_NODE?B.END_TYPE:s}addRelationObjs(e,s,c=""){let r=this.startIdIfNeeded(e.id.trim()),u=this.startTypeIfNeeded(e.id.trim(),e.type),f=this.startIdIfNeeded(s.id.trim()),m=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,u,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(f,m,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:b.sanitizeText(c,l())})}addRelation(e,s,c){if(typeof e==="object"&&typeof s==="object")this.addRelationObjs(e,s,c);else if(typeof e==="string"&&typeof s==="string"){let r=this.startIdIfNeeded(e.trim()),u=this.startTypeIfNeeded(e),f=this.endIdIfNeeded(s.trim()),m=this.endTypeIfNeeded(s);this.addState(r,u),this.addState(f,m),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:c?b.sanitizeText(c,l()):void 0})}}addDescription(e,s){let c=this.currentDocument.states.get(e),r=s.startsWith(":")?s.replace(":","").trim():s;c?.descriptions?.push(b.sanitizeText(r,l()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){if(!this.classes.has(e))this.classes.set(e,{id:e,styles:[],textStyles:[]});let c=this.classes.get(e);if(s&&c)s.split(B.STYLECLASS_SEP).forEach((r)=>{let u=r.replace(/([^;]*);/,"$1").trim();if(RegExp(B.COLOR_KEYWORD).exec(r)){let m=u.replace(B.FILL_KEYWORD,B.BG_FILL).replace(B.COLOR_KEYWORD,B.FILL_KEYWORD);c.textStyles.push(m)}c.styles.push(u)})}getClasses(){return this.classes}setupToolTips(e){let s=Ft();p(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",(u)=>{let f=p(u.currentTarget),m=f.attr("title");if(m===null)return;let k=u.currentTarget?.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.style("left",window.scrollX+k.left+(k.right-k.left)/2+"px").style("top",window.scrollY+k.bottom+"px"),s.html(Re.sanitize(m)),f.classed("hover",!0)}).on("mouseout",(u)=>{s.transition().duration(500).style("opacity",0),p(u.currentTarget).classed("hover",!1)})}setCssClass(e,s){e.split(",").forEach((c)=>{let r=this.getState(c);if(!r){let u=c.trim();this.addState(u),r=this.getState(u)}r?.classes?.push(s)})}setStyle(e,s){this.getState(e)?.styles?.push(s)}setTextStyle(e,s){this.getState(e)?.textStyles?.push(s)}bindFunctions(e){this.funs.forEach((s)=>{s(e)})}getDirectionStatement(){return this.rootDoc.find((e)=>e.stmt===Ut)}getDirection(){return this.getDirectionStatement()?.value??_e}setDirection(e){let s=this.getDirectionStatement();if(s)s.value=e;else this.rootDoc.unshift({stmt:Ut,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){let e=l();for(let s of this.nodes)if(s.wrappingWidth??=e.state?.wrappingWidth,!s.isGroup)s.minWidth??=e.state?.minNodeWidth;return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Se(this.getRootDocV2())}}getConfig(){return l().state}},qe=t((e)=>{let{theme:s,bkgColorArray:c,borderColorArray:r}=e;if(!se(s,r))return"";let u=le(e.look),f=pe(c),m="";for(let k=0;k<gt(r);k++){let o=r[k],D=f?`fill: ${c[k%c.length]};`:"",x=`[data-look="${u}"][data-color-id="color-${k}"]`;m+=`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,n,v,w){function i(){let d=n.yytext.indexOf("%%");if(d===0)return!1;if(d>0){let X=n.yytext.slice(0,d),J=n.yytext.slice(d);if(J)g.lexer.unput(J);n.yytext=X}return!0}t(i,"processId");var it=w;switch(v){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;break;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;break;case 17:return this.popState(),"acc_title_value";break;case 18:return this.begin("acc_descr"),35;break;case 19:return this.popState(),"acc_descr_value";break;case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;break;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 25:return this.popState(),this.pushState("CLASSDEFID"),42;break;case 26:return this.popState(),43;break;case 27:return this.pushState("CLASS"),48;break;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;break;case 29:return this.popState(),50;break;case 30:return this.pushState("STYLE"),45;break;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;break;case 32:return this.popState(),47;break;case 33:return this.pushState("SCALE"),17;break;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;break;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";break;case 49:if(!i())return;return this.popState(),"ID";break;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw Error('Error: State name must be a single word. Found: "'+n.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;break;case 56:return this.popState(),21;break;case 57:break;case 58:return this.begin("NOTE"),29;break;case 59:return this.popState(),this.pushState("NOTE_ID"),59;break;case 60:return this.popState(),this.pushState("NOTE_ID"),60;break;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";break;case 63:break;case 64:return"NOTE_TEXT";case 65:if(!i())return;return this.popState(),"ID";break;case 66:if(!i())return;return this.popState(),this.pushState("NOTE_TEXT"),24;break;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;break;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;break;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!i())return;return 24;case 74:return n.yytext=n.yytext.trim(),14;break;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),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,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return Q}();Lt.lexer=me;function kt(){this.yy={}}return t(kt,"Parser"),kt.prototype=Lt,Lt.Parser=kt,new kt}();Pt.parser=Pt;var Ee=Pt,_e="TB",qt="TB",Ut="dir",ot="state",nt="root",Gt="relation",ve="classDef",De="style",Ce="applyClass",ut="default",Qt="divider",Zt="fill:none",te="fill: #333",ee="c",re="markdown",ie="normal",$t="rect",Ft="rectWithTitle",Ae="stateStart",xe="stateEnd",Yt="divider",Ht="roundedWithTitle",Le="note",we="noteGroup",ft="statediagram",Ie="state",Ne=`${ft}-${Ie}`,ae="transition",Oe="note",$e="note-edge",Fe=`${ae} ${$e}`,Pe=`${ft}-${Oe}`,Be="cluster",Ge=`${ft}-${Be}`,Ye="cluster-alt",Ve=`${ft}-${Ye}`,ne="parent",oe="note",Me="state",Vt="----",We=`${Vt}${oe}`,zt=`${Vt}${ne}`,At=new Map,Z=0,ce=0,ct=new Map,je=t((e,s,c,r)=>{if(e===Yt&&c?.id!==void 0&&ct.has(c.id)){let m=ct.get(c.id);return ct.set(s,m),m}let u=ce++,f=r?void 0:u;return ct.set(s,f),f},"colorSlotFor");function xt(e="",s=0,c="",r=Vt){let u=c!==null&&c.length>0?`${r}${c}`:"";return`${Me}-${e}${u}-${s}`}t(xt,"stateDomId");var Ue=t((e,s,c,r,u,f,m,k)=>{a.trace("items",s),s.forEach((o)=>{switch(o.stmt){case ot:dt(e,o,c,r,u,f,m,k);break;case ut:dt(e,o,c,r,u,f,m,k);break;case Gt:{dt(e,o.state1,c,r,u,f,m,k),dt(e,o.state2,c,r,u,f,m,k);let D=m==="neo",x={id:"edge"+Z,start:o.state1.id,end:o.state2.id,arrowhead:"normal",arrowTypeEnd:D?"arrow_barb_neo":"arrow_barb",style:Zt,labelStyle:"",label:b.sanitizeText(o.description??"",l()),arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,classes:ae,look:m};u.push(x),Z++}break}})},"setupDoc"),Kt=t((e,s=qt)=>{let c=s;if(e.doc){for(let r of e.doc)if(r.stmt==="dir")c=r.value}return c},"getDir");function ht(e,s,c){if(!s.id||s.id==="</join></fork>"||s.id==="</choice>")return;if(s.cssClasses){if(!Array.isArray(s.cssCompiledStyles))s.cssCompiledStyles=[];s.cssClasses.split(" ").forEach((u)=>{let f=c.get(u);if(f)s.cssCompiledStyles=[...s.cssCompiledStyles??[],...f.styles]})}let r=e.find((u)=>u.id===s.id);if(r)Object.assign(r,s);else e.push(s)}t(ht,"insertOrUpdateNode");function de(e){return e?.classes?.join(" ")??""}t(de,"getClassesFromDbInfo");function fe(e){return e?.styles??[]}t(fe,"getStylesFromDbInfo");var dt=t((e,s,c,r,u,f,m,k)=>{let o=s.id,D=c.get(o),x=de(D),Y=fe(D),V=l(),j=x.trim()!==""||Y.length>0;if(a.info("dataFetcher parsedItem",s,D,Y),o!=="root"){let F=$t;if(s.start===!0)F=Ae;else if(s.start===!1)F=xe;if(s.type!==ut)F=s.type;if(!At.get(o))At.set(o,{id:o,shape:F,description:b.sanitizeText(o,V),cssClasses:`${x} ${Ne}`,cssStyles:Y});let y=At.get(o);if(s.description){if(Array.isArray(y.description))y.shape=Ft,y.description.push(s.description);else if(y.description?.length&&y.description.length>0)if(y.shape=Ft,y.description===o)y.description=[s.description];else y.description=[y.description,s.description];else y.shape=$t,y.description=s.description;y.description=b.sanitizeTextOrArray(y.description,V)}if(y.description?.length===1&&y.shape===Ft)if(y.type==="group")y.shape=Ht;else y.shape=$t;if(!y.type&&s.doc)a.info("Setting cluster for XCX",o,Kt(s)),y.type="group",y.isGroup=!0,y.dir=Kt(s),y.shape=s.type===Qt?Yt:Ht,y.colorIndex=je(y.shape,o,e,j),y.cssClasses=`${y.cssClasses} ${Ge} ${f?Ve:""}`;let M={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:o,dir:y.dir,domId:xt(o,Z),type:y.type,isGroup:y.type==="group",colorIndex:y.colorIndex,padding:8,rx:10,ry:10,look:m,labelType:"markdown"};if(M.shape===Yt)M.label="";if(e&&e.id!=="root")a.trace("Setting node ",o," to be child of its parent ",e.id),M.parentId=e.id;if(M.centerLabel=!0,s.note){let P={labelStyle:"",shape:Le,label:s.note.text,labelType:"markdown",cssClasses:Pe,cssStyles:[],cssCompiledStyles:[],id:o+We+"-"+Z,domId:xt(o,Z,oe),type:"node",isGroup:!1,padding:V.flowchart?.padding,look:m,position:s.note.position},z=o+zt,W={labelStyle:"",shape:we,label:s.note.text,cssClasses:y.cssClasses,cssStyles:[],id:o+zt,domId:xt(o,Z,ne),type:"group",isGroup:!0,padding:16,look:m,position:s.note.position};Z++,W.id=z,P.parentId=z,ht(r,W,k),ht(r,P,k),ht(r,M,k);let K=o,O=P.id;if(s.note.position==="left of")K=P.id,O=o;u.push({id:K+"-"+O,start:K,end:O,arrowhead:"none",arrowTypeEnd:"",style:Zt,labelStyle:"",classes:Fe,pattern:"dashed",arrowheadStyle:te,labelpos:ee,labelType:re,thickness:ie,look:m})}else ht(r,M,k)}if(s.doc)a.trace("Adding nodes children "),Ue(s,s.doc,c,r,u,!f,m,k)},"dataFetcher"),He=t(()=>{At.clear(),Z=0,ce=0,ct.clear()},"reset"),Se=t((e,s=qt)=>{if(!e.doc)return s;let c=s;for(let r of e.doc)if(r.stmt==="dir")c=r.value;return c},"getDir"),ze=t(function(e,s){return s.db.getClasses()},"getClasses"),Ke=t(async function(e,s,c,r){a.info("REF0:"),a.info("Drawing state diagram (v2)",s);let{securityLevel:u,state:f,layout:m}=l();r.db.extract(r.db.getRootDocV2());let k=r.db.getData(),o=he(s,u);if(k.type=r.type,k.layoutAlgorithm=ye(m),k.nodeSpacing=f?.nodeSpacing||50,k.rankSpacing=f?.rankSpacing||50,l().look==="neo")k.markers=["barbNeo"];else k.markers=["barb"];k.diagramId=s,await ge(k,o);let x=8;try{(typeof r.db.getLinks==="function"?r.db.getLinks():new Map).forEach((V,j)=>{let F=typeof j==="string"?j:typeof j?.id==="string"?j.id:"",y=k.nodes.find((O)=>O.id===F);if(!F){a.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(j));return}let M=o.node()?.querySelectorAll("g.node, g.rough-node"),P;if(M?.forEach((O)=>{let st=O.textContent?.trim();if(O.id===y?.domId||st===F)P=O}),!P){a.warn("⚠️ Could not find node matching text:",F);return}let z=P.parentNode;if(!z){a.warn("⚠️ Node has no parent, cannot wrap:",F);return}let W=document.createElementNS("http://www.w3.org/2000/svg","a"),K=V.url.replace(/^"+|"+$/g,"");if(W.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",K),W.setAttribute("target","_blank"),V.tooltip){let O=V.tooltip.replace(/^"+|"+$/g,"");W.setAttribute("title",O),P.setAttribute("title",O)}z.replaceChild(W,P),W.appendChild(P),a.info("\uD83D\uDD17 Wrapped node in <a> tag for:",F,V.url)})}catch(Y){a.error("❌ Error injecting clickable links:",Y)}N.insertTitle(o,"statediagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),ue(o,x,ft,f?.useMaxWidth??!0)},"draw"),Xe={getClasses:ze,draw:Ke,getDir:Se},G={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Xt=t(()=>new Map,"newClassesList"),Jt=t(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Ct=t((e)=>JSON.parse(JSON.stringify(e)),"clone"),Je=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Xt(),this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=E,this.setAccTitle=S,this.getAccDescription=A,this.setAccDescription=T,this.setDiagramTitle=L,this.getDiagramTitle=R,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{t(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let r of Array.isArray(e)?e:e.doc)switch(r.stmt){case ot:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case Gt:this.addRelation(r.state1,r.state2,r.description);break;case ve:this.addStyleClass(r.id.trim(),r.classes);break;case De:this.handleStyleDef(r);break;case Ce:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}let s=this.getStates(),c=l();He(),dt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,c.look,this.classes);for(let r of this.nodes){if(!Array.isArray(r.label))continue;if(r.description=r.label.slice(1),r.isGroup&&r.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`);r.label=r.label[0]}}handleStyleDef(e){let s=e.id.trim().split(","),c=e.styleClass.split(",");for(let r of s){let u=this.getState(r);if(!u){let f=r.trim();this.addState(f),u=this.getState(f)}if(u)u.styles=c.map((f)=>f.replace(/;/g,"")?.trim())}}setRootDoc(e){if(a.info("Setting root doc",e),this.rootDoc=e,this.version===1)this.extract(e);else this.extract(this.getRootDocV2())}docTranslator(e,s,c){if(s.stmt===Gt){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===ot)if(s.id===G.START_NODE)s.id=e.id+(c?"_start":"_end"),s.start=c;else s.id=s.id.trim();if(s.stmt!==nt&&s.stmt!==ot||!s.doc)return;let r=[],u=[];for(let f of s.doc)if(f.type===Qt){let m=Ct(f);m.doc=Ct(u),r.push(m),u=[]}else u.push(f);if(r.length>0&&u.length>0){let f={stmt:ot,id:Gi(),type:"divider",doc:Ct(u)};r.push(Ct(f)),s.doc=r}s.doc.forEach((f)=>this.docTranslator(s,f,!0))}getRootDocV2(){return this.docTranslator({id:nt,stmt:nt},{id:nt,stmt:nt,doc:this.rootDoc},!0),{id:nt,doc:this.rootDoc}}addState(e,s=ut,c=void 0,r=void 0,u=void 0,f=void 0,m=void 0,k=void 0){let o=e?.trim();if(!this.currentDocument.states.has(o))a.info("Adding state ",o,r),this.currentDocument.states.set(o,{stmt:ot,id:o,descriptions:[],type:s,doc:c,note:u,classes:[],styles:[],textStyles:[]});else{let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);if(!D.doc)D.doc=c;if(!D.type)D.type=s}if(r)a.info("Setting state description",o,r),(Array.isArray(r)?r:[r]).forEach((x)=>this.addDescription(o,x.trim()));if(u){let D=this.currentDocument.states.get(o);if(!D)throw Error(`State not found: ${o}`);D.note=u,D.note.text=b.sanitizeText(D.note.text,l())}if(f)a.info("Setting state classes",o,f),(Array.isArray(f)?f:[f]).forEach((x)=>this.setCssClass(o,x.trim()));if(m)a.info("Setting state styles",o,m),(Array.isArray(m)?m:[m]).forEach((x)=>this.setStyle(o,x.trim()));if(k)a.info("Setting state styles",o,m),(Array.isArray(k)?k:[k]).forEach((x)=>this.setTextStyle(o,x.trim()))}clear(e){if(this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Jt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Xt(),!e)this.links=new Map,C()}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){a.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,c){this.links.set(e,{url:s,tooltip:c}),a.warn("Adding link",e,s,c)}getLinks(){return this.links}startIdIfNeeded(e=""){if(e===G.START_NODE)return this.startEndCount++,`${G.START_TYPE}${this.startEndCount}`;return e}startTypeIfNeeded(e="",s=ut){return e===G.START_NODE?G.START_TYPE:s}endIdIfNeeded(e=""){if(e===G.END_NODE)return this.startEndCount++,`${G.END_TYPE}${this.startEndCount}`;return e}endTypeIfNeeded(e="",s=ut){return e===G.END_NODE?G.END_TYPE:s}addRelationObjs(e,s,c=""){let r=this.startIdIfNeeded(e.id.trim()),u=this.startTypeIfNeeded(e.id.trim(),e.type),f=this.startIdIfNeeded(s.id.trim()),m=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,u,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(f,m,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:b.sanitizeText(c,l())})}addRelation(e,s,c){if(typeof e==="object"&&typeof s==="object")this.addRelationObjs(e,s,c);else if(typeof e==="string"&&typeof s==="string"){let r=this.startIdIfNeeded(e.trim()),u=this.startTypeIfNeeded(e),f=this.endIdIfNeeded(s.trim()),m=this.endTypeIfNeeded(s);this.addState(r,u),this.addState(f,m),this.currentDocument.relations.push({id1:r,id2:f,relationTitle:c?b.sanitizeText(c,l()):void 0})}}addDescription(e,s){let c=this.currentDocument.states.get(e),r=s.startsWith(":")?s.replace(":","").trim():s;c?.descriptions?.push(b.sanitizeText(r,l()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){if(!this.classes.has(e))this.classes.set(e,{id:e,styles:[],textStyles:[]});let c=this.classes.get(e);if(s&&c)s.split(G.STYLECLASS_SEP).forEach((r)=>{let u=r.replace(/([^;]*);/,"$1").trim();if(RegExp(G.COLOR_KEYWORD).exec(r)){let m=u.replace(G.FILL_KEYWORD,G.BG_FILL).replace(G.COLOR_KEYWORD,G.FILL_KEYWORD);c.textStyles.push(m)}c.styles.push(u)})}getClasses(){return this.classes}setupToolTips(e){let s=Bt();p(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",(u)=>{let f=p(u.currentTarget),m=f.attr("title");if(m===null)return;let k=u.currentTarget?.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.style("left",window.scrollX+k.left+(k.right-k.left)/2+"px").style("top",window.scrollY+k.bottom+"px"),s.html(Re.sanitize(m)),f.classed("hover",!0)}).on("mouseout",(u)=>{s.transition().duration(500).style("opacity",0),p(u.currentTarget).classed("hover",!1)})}setCssClass(e,s){e.split(",").forEach((c)=>{let r=this.getState(c);if(!r){let u=c.trim();this.addState(u),r=this.getState(u)}r?.classes?.push(s)})}setStyle(e,s){this.getState(e)?.styles?.push(s)}setTextStyle(e,s){this.getState(e)?.textStyles?.push(s)}bindFunctions(e){this.funs.forEach((s)=>{s(e)})}getDirectionStatement(){return this.rootDoc.find((e)=>e.stmt===Ut)}getDirection(){return this.getDirectionStatement()?.value??_e}setDirection(e){let s=this.getDirectionStatement();if(s)s.value=e;else this.rootDoc.unshift({stmt:Ut,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){let e=l();for(let s of this.nodes)if(s.wrappingWidth??=e.state?.wrappingWidth,!s.isGroup)s.minWidth??=e.state?.minNodeWidth;return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Se(this.getRootDocV2())}}getConfig(){return l().state}},qe=t((e)=>{let{theme:s,bkgColorArray:c,borderColorArray:r}=e;if(!se(s,r))return"";let u=le(e.look),f=pe(c),m="";for(let k=0;k<vt(r);k++){let o=r[k],D=f?`fill: ${c[k%c.length]};`:"",x=`[data-look="${u}"][data-color-id="color-${k}"]`;m+=`
7
7
 
8
8
  /* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers
9
9
  the body, so what stays visible of \`outer\` is the band behind the label. */
@@ -0,0 +1 @@
1
+ import{Ii}from"./chunk-xjc5fmcr.js";export{Ii as createArchitectureServices};
@@ -0,0 +1 @@
1
+ import"./chunk-e763h2px.js";import"./chunk-4rwwtfnd.js";import"./chunk-36dc7tcg.js";import{ao}from"./chunk-jqqbkdtw.js";export{ao as render};
@@ -0,0 +1 @@
1
+ import{Di}from"./chunk-xjc5fmcr.js";export{Di as createEventModelingServices};
@@ -1,7 +1,7 @@
1
- import{t,a,ke,N,x,O,F,C,S,E,T,A,L,R,Vn,V,U,Ki}from"./chunk-veam6vk4.js";import"./chunk-9yfftz38.js";import{Xe}from"./chunk-07agqp8h.js";import{kt}from"./chunk-vsjpnwsr.js";import{Ot}from"./chunk-h0c42zy3.js";function Pt(e,i,s){e=+e,i=+i,s=(o=arguments.length)<2?(i=e,e=0,1):o<3?1:+s;var n=-1,o=Math.max(0,Math.ceil((i-e)/s))|0,c=Array(o);while(++n<o)c[n]=e+n*s;return c}function xt(){var e=Xe().unknown(void 0),{domain:i,range:s}=e,n=0,o=1,c,l,p=!1,g=0,y=0,I=0.5;delete e.unknown;function P(){var k=i().length,G=o<n,X=G?o:n,Y=G?n:o;if(c=(Y-X)/Math.max(1,k-g+y*2),p)c=Math.floor(c);if(X+=(Y-X-c*(k-g))*I,l=c*(1-g),p)X=Math.round(X),l=Math.round(l);var j=Pt(k).map(function(it){return X+c*it});return s(G?j.reverse():j)}return e.domain=function(k){return arguments.length?(i(k),P()):i()},e.range=function(k){return arguments.length?([n,o]=k,n=+n,o=+o,P()):[n,o]},e.rangeRound=function(k){return[n,o]=k,n=+n,o=+o,p=!0,P()},e.bandwidth=function(){return l},e.step=function(){return c},e.round=function(k){return arguments.length?(p=!!k,P()):p},e.padding=function(k){return arguments.length?(g=Math.min(1,y=+k),P()):g},e.paddingInner=function(k){return arguments.length?(g=Math.min(1,k),P()):g},e.paddingOuter=function(k){return arguments.length?(y=+k,P()):y},e.align=function(k){return arguments.length?(I=Math.max(0,Math.min(1,k)),P()):I},e.copy=function(){return xt(i(),[n,o]).round(p).paddingInner(g).paddingOuter(y).align(I)},Ot.apply(P(),arguments)}var Lt=function(){var e=t(function(J,h,u,f){for(u=u||{},f=J.length;f--;u[J[f]]=h);return u},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],o=[1,5],c=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],g=[1,25],y=[1,26],I=[1,28],P=[1,29],k=[1,30],G=[1,31],X=[1,32],Y=[1,33],j=[1,34],it=[1,35],nt=[1,36],_=[1,37],K=[1,43],d=[1,42],Q=[1,47],Z=[1,50],v=[1,10,12,14,16,18,19,21,23,36,37,38],ot=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],gt=[1,65],z=[26,28],D={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(h,u,f,m,M,r,rt){var b=r.length-1;switch(M){case 5:m.setOrientation(r[b]);break;case 9:m.setDiagramTitle(r[b].text.trim());break;case 12:m.setLineData({text:"",type:"text"},r[b]);break;case 13:m.setLineData(r[b-1],r[b]);break;case 14:m.setBarData({text:"",type:"text"},r[b]);break;case 15:m.setBarData(r[b-1],r[b]);break;case 16:this.$=r[b].trim(),m.setAccTitle(this.$);break;case 17:case 18:this.$=r[b].trim(),m.setAccDescription(this.$);break;case 19:this.$=r[b-1];break;case 20:case 30:this.$=[r[b-2],...r[b]];break;case 21:case 31:this.$=[r[b]];break;case 22:this.$={value:Number(r[b-1]),label:r[b]};break;case 23:this.$={value:Number(r[b]),label:""};break;case 24:m.setXAxisTitle(r[b]);break;case 25:m.setXAxisTitle(r[b-1]);break;case 26:m.setXAxisTitle({type:"text",text:""});break;case 27:m.setXAxisBand(r[b]);break;case 28:m.setXAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 29:this.$=r[b-1];break;case 32:m.setYAxisTitle(r[b]);break;case 33:m.setYAxisTitle(r[b-1]);break;case 34:m.setYAxisTitle({type:"text",text:""});break;case 35:m.setYAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 39:this.$={text:r[b],type:"text"};break;case 40:this.$={text:r[b],type:"text"};break;case 41:this.$={text:r[b],type:"markdown"};break;case 42:this.$=r[b];break;case 43:this.$=r[b-1]+""+r[b];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:o,37:c,38:l}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:o,37:c,38:l}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:o,37:c,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:o,37:c,38:l}),{1:[2,3]},e(p,[2,5]),e(i,[2,7],{4:22,36:o,37:c,38:l}),{11:23,30:g,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:39,13:38,24:K,29:d,30:g,31:40,32:41,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:45,15:44,29:Q,30:g,35:46,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:49,17:48,24:Z,30:g,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{11:52,17:51,24:Z,30:g,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},{20:[1,53]},{22:[1,54]},e(v,[2,18]),{1:[2,2]},e(v,[2,8]),e(v,[2,9]),e(ot,[2,39],{41:55,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_}),e(ot,[2,40]),e(ot,[2,41]),e(H,[2,42]),e(H,[2,44]),e(H,[2,45]),e(H,[2,46]),e(H,[2,47]),e(H,[2,48]),e(H,[2,49]),e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(v,[2,10]),e(v,[2,24],{32:41,31:56,24:K,29:d}),e(v,[2,26]),e(v,[2,27]),{33:[1,57]},{11:59,30:g,34:58,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},e(v,[2,11]),e(v,[2,32],{35:60,29:Q}),e(v,[2,34]),{33:[1,61]},e(v,[2,12]),{17:62,24:Z},{25:63,27:64,29:gt},e(v,[2,14]),{17:66,24:Z},e(v,[2,16]),e(v,[2,17]),e(H,[2,43]),e(v,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(v,[2,33]),{29:[1,70]},e(v,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(z,[2,23],{30:[1,73]}),e(v,[2,15]),e(v,[2,28]),e(v,[2,29]),{11:59,30:g,34:74,39:24,40:y,41:27,42:I,43:P,44:k,45:G,46:X,47:Y,48:j,49:it,50:nt,51:_},e(v,[2,35]),e(v,[2,19]),{25:75,27:64,29:gt},e(z,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(h,u){if(u.recoverable)this.trace(h);else{var f=Error(h);throw f.hash=u,f}},"parseError"),parse:t(function(h){var u=this,f=[0],m=[],M=[null],r=[],rt=this.table,b="",bt=0,Ht=0,$t=0,fe=2,Ut=1,pe=r.slice.call(arguments,1),W=Object.create(this.lexer),ht={yy:{}};for(var Rt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Rt))ht.yy[Rt]=this.yy[Rt];if(W.setInput(h,ht.yy),ht.yy.lexer=W,ht.yy.parser=this,typeof W.yylloc>"u")W.yylloc={};var _t=W.yylloc;r.push(_t);var me=W.options&&W.options.ranges;if(typeof ht.yy.parseError==="function")this.parseError=ht.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function be(et){f.length=f.length-2*et,M.length=M.length-et,r.length=r.length-et}t(be,"popStack");function qt(){var et=m.pop()||W.lex()||Ut;if(typeof et!=="number"){if(et instanceof Array)m=et,et=m.pop();et=u.symbols_[et]||et}return et}t(qt,"lex");var q,Tt,lt,tt,Oe,Dt,ut={},yt,at,Gt,wt;while(!0){if(lt=f[f.length-1],this.defaultActions[lt])tt=this.defaultActions[lt];else{if(q===null||typeof q>"u")q=qt();tt=rt[lt]&&rt[lt][q]}if(typeof tt>"u"||!tt.length||!tt[0]){var vt="";wt=[];for(yt in rt[lt])if(this.terminals_[yt]&&yt>fe)wt.push("'"+this.terminals_[yt]+"'");if(W.showPosition)vt="Parse error on line "+(bt+1)+`:
2
- `+W.showPosition()+`
3
- Expecting `+wt.join(", ")+", got '"+(this.terminals_[q]||q)+"'";else vt="Parse error on line "+(bt+1)+": Unexpected "+(q==Ut?"end of input":"'"+(this.terminals_[q]||q)+"'");this.parseError(vt,{text:W.match,token:this.terminals_[q]||q,line:W.yylineno,loc:_t,expected:wt})}if(tt[0]instanceof Array&&tt.length>1)throw Error("Parse Error: multiple actions possible at state: "+lt+", token: "+q);switch(tt[0]){case 1:if(f.push(q),M.push(W.yytext),r.push(W.yylloc),f.push(tt[1]),q=null,!Tt){if(Ht=W.yyleng,b=W.yytext,bt=W.yylineno,_t=W.yylloc,$t>0)$t--}else q=Tt,Tt=null;break;case 2:if(at=this.productions_[tt[1]][1],ut.$=M[M.length-at],ut._$={first_line:r[r.length-(at||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(at||1)].first_column,last_column:r[r.length-1].last_column},me)ut._$.range=[r[r.length-(at||1)].range[0],r[r.length-1].range[1]];if(Dt=this.performAction.apply(ut,[b,Ht,bt,ht.yy,tt[1],M,r].concat(pe)),typeof Dt<"u")return Dt;if(at)f=f.slice(0,-1*at*2),M=M.slice(0,-1*at),r=r.slice(0,-1*at);f.push(this.productions_[tt[1]][0]),M.push(ut.$),r.push(ut._$),Gt=rt[f[f.length-2]][f[f.length-1]],f.push(Gt);break;case 3:return!0}}return!0},"parse")},st=function(){var J={EOF:1,parseError:t(function(u,f){if(this.yy.parser)this.yy.parser.parseError(u,f);else throw Error(u)},"parseError"),setInput:t(function(h,u){if(this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);if(u)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:t(function(h){var u=h.length,f=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var m=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1)this.yylineno-=f.length-1;var M=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-u},this.options.ranges)this.yylloc.range=[M[0],M[0]+this.yyleng-u];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
1
+ import{t,a,ke,M,x,O,F,C,S,E,T,A,L,R,jn,V,U,Zi}from"./chunk-e763h2px.js";import"./chunk-05mvzx00.js";import{Ke}from"./chunk-j4gvtszc.js";import{wt}from"./chunk-qykt7avq.js";import{Pt}from"./chunk-p8fbes0t.js";function Lt(e,i,s){e=+e,i=+i,s=(o=arguments.length)<2?(i=e,e=0,1):o<3?1:+s;var n=-1,o=Math.max(0,Math.ceil((i-e)/s))|0,c=Array(o);while(++n<o)c[n]=e+n*s;return c}function xt(){var e=Ke().unknown(void 0),{domain:i,range:s}=e,n=0,o=1,c,l,p=!1,g=0,y=0,B=0.5;delete e.unknown;function P(){var k=i().length,G=o<n,Y=G?o:n,N=G?n:o;if(c=(N-Y)/Math.max(1,k-g+y*2),p)c=Math.floor(c);if(Y+=(N-Y-c*(k-g))*B,l=c*(1-g),p)Y=Math.round(Y),l=Math.round(l);var j=Lt(k).map(function(it){return Y+c*it});return s(G?j.reverse():j)}return e.domain=function(k){return arguments.length?(i(k),P()):i()},e.range=function(k){return arguments.length?([n,o]=k,n=+n,o=+o,P()):[n,o]},e.rangeRound=function(k){return[n,o]=k,n=+n,o=+o,p=!0,P()},e.bandwidth=function(){return l},e.step=function(){return c},e.round=function(k){return arguments.length?(p=!!k,P()):p},e.padding=function(k){return arguments.length?(g=Math.min(1,y=+k),P()):g},e.paddingInner=function(k){return arguments.length?(g=Math.min(1,k),P()):g},e.paddingOuter=function(k){return arguments.length?(y=+k,P()):y},e.align=function(k){return arguments.length?(B=Math.max(0,Math.min(1,k)),P()):B},e.copy=function(){return xt(i(),[n,o]).round(p).paddingInner(g).paddingOuter(y).align(B)},Pt.apply(P(),arguments)}var Et=function(){var e=t(function(J,h,u,f){for(u=u||{},f=J.length;f--;u[J[f]]=h);return u},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],o=[1,5],c=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],g=[1,25],y=[1,26],B=[1,28],P=[1,29],k=[1,30],G=[1,31],Y=[1,32],N=[1,33],j=[1,34],it=[1,35],nt=[1,36],_=[1,37],K=[1,43],d=[1,42],Q=[1,47],Z=[1,50],v=[1,10,12,14,16,18,19,21,23,36,37,38],ot=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],gt=[1,65],W=[26,28],D={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(h,u,f,m,I,r,rt){var b=r.length-1;switch(I){case 5:m.setOrientation(r[b]);break;case 9:m.setDiagramTitle(r[b].text.trim());break;case 12:m.setLineData({text:"",type:"text"},r[b]);break;case 13:m.setLineData(r[b-1],r[b]);break;case 14:m.setBarData({text:"",type:"text"},r[b]);break;case 15:m.setBarData(r[b-1],r[b]);break;case 16:this.$=r[b].trim(),m.setAccTitle(this.$);break;case 17:case 18:this.$=r[b].trim(),m.setAccDescription(this.$);break;case 19:this.$=r[b-1];break;case 20:case 30:this.$=[r[b-2],...r[b]];break;case 21:case 31:this.$=[r[b]];break;case 22:this.$={value:Number(r[b-1]),label:r[b]};break;case 23:this.$={value:Number(r[b]),label:""};break;case 24:m.setXAxisTitle(r[b]);break;case 25:m.setXAxisTitle(r[b-1]);break;case 26:m.setXAxisTitle({type:"text",text:""});break;case 27:m.setXAxisBand(r[b]);break;case 28:m.setXAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 29:this.$=r[b-1];break;case 32:m.setYAxisTitle(r[b]);break;case 33:m.setYAxisTitle(r[b-1]);break;case 34:m.setYAxisTitle({type:"text",text:""});break;case 35:m.setYAxisRangeData(Number(r[b-2]),Number(r[b]));break;case 39:this.$={text:r[b],type:"text"};break;case 40:this.$={text:r[b],type:"text"};break;case 41:this.$={text:r[b],type:"markdown"};break;case 42:this.$=r[b];break;case 43:this.$=r[b-1]+""+r[b];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:o,37:c,38:l}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:o,37:c,38:l}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:o,37:c,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:o,37:c,38:l}),{1:[2,3]},e(p,[2,5]),e(i,[2,7],{4:22,36:o,37:c,38:l}),{11:23,30:g,39:24,40:y,41:27,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:39,13:38,24:K,29:d,30:g,31:40,32:41,39:24,40:y,41:27,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:45,15:44,29:Q,30:g,35:46,39:24,40:y,41:27,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:49,17:48,24:Z,30:g,39:24,40:y,41:27,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{11:52,17:51,24:Z,30:g,39:24,40:y,41:27,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},{20:[1,53]},{22:[1,54]},e(v,[2,18]),{1:[2,2]},e(v,[2,8]),e(v,[2,9]),e(ot,[2,39],{41:55,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_}),e(ot,[2,40]),e(ot,[2,41]),e(H,[2,42]),e(H,[2,44]),e(H,[2,45]),e(H,[2,46]),e(H,[2,47]),e(H,[2,48]),e(H,[2,49]),e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(v,[2,10]),e(v,[2,24],{32:41,31:56,24:K,29:d}),e(v,[2,26]),e(v,[2,27]),{33:[1,57]},{11:59,30:g,34:58,39:24,40:y,41:27,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},e(v,[2,11]),e(v,[2,32],{35:60,29:Q}),e(v,[2,34]),{33:[1,61]},e(v,[2,12]),{17:62,24:Z},{25:63,27:64,29:gt},e(v,[2,14]),{17:66,24:Z},e(v,[2,16]),e(v,[2,17]),e(H,[2,43]),e(v,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(v,[2,33]),{29:[1,70]},e(v,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(W,[2,23],{30:[1,73]}),e(v,[2,15]),e(v,[2,28]),e(v,[2,29]),{11:59,30:g,34:74,39:24,40:y,41:27,42:B,43:P,44:k,45:G,46:Y,47:N,48:j,49:it,50:nt,51:_},e(v,[2,35]),e(v,[2,19]),{25:75,27:64,29:gt},e(W,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(h,u){if(u.recoverable)this.trace(h);else{var f=Error(h);throw f.hash=u,f}},"parseError"),parse:t(function(h){var u=this,f=[0],m=[],I=[null],r=[],rt=this.table,b="",bt=0,Ht=0,$t=0,fe=2,Ut=1,pe=r.slice.call(arguments,1),X=Object.create(this.lexer),ht={yy:{}};for(var Rt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Rt))ht.yy[Rt]=this.yy[Rt];if(X.setInput(h,ht.yy),ht.yy.lexer=X,ht.yy.parser=this,typeof X.yylloc>"u")X.yylloc={};var _t=X.yylloc;r.push(_t);var me=X.options&&X.options.ranges;if(typeof ht.yy.parseError==="function")this.parseError=ht.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function be(et){f.length=f.length-2*et,I.length=I.length-et,r.length=r.length-et}t(be,"popStack");function qt(){var et=m.pop()||X.lex()||Ut;if(typeof et!=="number"){if(et instanceof Array)m=et,et=m.pop();et=u.symbols_[et]||et}return et}t(qt,"lex");var q,Tt,lt,tt,Oe,Dt,ut={},yt,at,Gt,kt;while(!0){if(lt=f[f.length-1],this.defaultActions[lt])tt=this.defaultActions[lt];else{if(q===null||typeof q>"u")q=qt();tt=rt[lt]&&rt[lt][q]}if(typeof tt>"u"||!tt.length||!tt[0]){var vt="";kt=[];for(yt in rt[lt])if(this.terminals_[yt]&&yt>fe)kt.push("'"+this.terminals_[yt]+"'");if(X.showPosition)vt="Parse error on line "+(bt+1)+`:
2
+ `+X.showPosition()+`
3
+ Expecting `+kt.join(", ")+", got '"+(this.terminals_[q]||q)+"'";else vt="Parse error on line "+(bt+1)+": Unexpected "+(q==Ut?"end of input":"'"+(this.terminals_[q]||q)+"'");this.parseError(vt,{text:X.match,token:this.terminals_[q]||q,line:X.yylineno,loc:_t,expected:kt})}if(tt[0]instanceof Array&&tt.length>1)throw Error("Parse Error: multiple actions possible at state: "+lt+", token: "+q);switch(tt[0]){case 1:if(f.push(q),I.push(X.yytext),r.push(X.yylloc),f.push(tt[1]),q=null,!Tt){if(Ht=X.yyleng,b=X.yytext,bt=X.yylineno,_t=X.yylloc,$t>0)$t--}else q=Tt,Tt=null;break;case 2:if(at=this.productions_[tt[1]][1],ut.$=I[I.length-at],ut._$={first_line:r[r.length-(at||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(at||1)].first_column,last_column:r[r.length-1].last_column},me)ut._$.range=[r[r.length-(at||1)].range[0],r[r.length-1].range[1]];if(Dt=this.performAction.apply(ut,[b,Ht,bt,ht.yy,tt[1],I,r].concat(pe)),typeof Dt<"u")return Dt;if(at)f=f.slice(0,-1*at*2),I=I.slice(0,-1*at),r=r.slice(0,-1*at);f.push(this.productions_[tt[1]][0]),I.push(ut.$),r.push(ut._$),Gt=rt[f[f.length-2]][f[f.length-1]],f.push(Gt);break;case 3:return!0}}return!0},"parse")},st=function(){var J={EOF:1,parseError:t(function(u,f){if(this.yy.parser)this.yy.parser.parseError(u,f);else throw Error(u)},"parseError"),setInput:t(function(h,u){if(this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);if(u)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:t(function(h){var u=h.length,f=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var m=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1)this.yylineno-=f.length-1;var I=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-u},this.options.ranges)this.yylloc.range=[I[0],I[0]+this.yyleng-u];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(h){this.unput(this.match.slice(h))},"less"),pastInput:t(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var h=this.match;if(h.length<20)h+=this._input.substr(0,20-h.length);return(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var h=this.pastInput(),u=Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
- `+u+"^"},"showPosition"),test_match:t(function(h,u){var f,m,M;if(this.options.backtrack_lexer){if(M={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)M.yylloc.range=this.yylloc.range.slice(0)}if(m=h[0].match(/(?:\r\n?|\n).*/g),m)this.yylineno+=m.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],f=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else if(this._backtrack){for(var r in M)this[r]=M[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,u,f,m;if(!this._more)this.yytext="",this.match="";var M=this._currentRules();for(var r=0;r<M.length;r++)if(f=this._input.match(this.rules[M[r]]),f&&(!u||f[0].length>u[0].length)){if(u=f,m=r,this.options.backtrack_lexer)if(h=this.test_match(f,M[r]),h!==!1)return h;else if(this._backtrack){u=!1;continue}else return!1;else if(!this.options.flex)break}if(u){if(h=this.test_match(u,M[m]),h!==!1)return h;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var u=this.next();if(u)return u;else return this.lex()},"lex"),begin:t(function(u){this.conditionStack.push(u)},"begin"),popState:t(function(){var u=this.conditionStack.length-1;if(u>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(u){if(u=this.conditionStack.length-1-Math.abs(u||0),u>=0)return this.conditionStack[u];else return"INITIAL"},"topState"),pushState:t(function(u){this.begin(u)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(u,f,m,M){var r=M;switch(m){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return J}();D.lexer=st;function B(){this.yy={}}return t(B,"Parser"),B.prototype=D,D.Parser=B,new B}();Lt.parser=Lt;var ye=Lt;function At(e){return e.type==="bar"}t(At,"isBarPlot");function Ct(e){return e.type==="band"}t(Ct,"isBandAxisData");function dt(e){return e.type==="linear"}t(dt,"isLinearAxisData");var Bt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((g,y)=>Math.max(y.length,g),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),o=n.node()?.getScreenCTM?.(),c=t((g)=>g&&g>0?g:1,"toScale"),l=c(o?.a),p=c(o?.d);for(let g of e){let y=Ki(n,1,g),I=y?y.width/l:g.length*i,P=y?y.height/p:i;s.width=Math.max(s.width,I),s.height=Math.max(s.height,P)}return n.remove(),s}},jt=0.7,Qt=0.2,Kt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(jt*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(jt*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.width;this.outerPadding=Math.min(s.width/2,n);let o=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.height;this.outerPadding=Math.min(s.height/2,n);let o=s.width+this.axisConfig.labelPadding*2;if(o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},we=class extends Kt{static{t(this,"BandAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),a.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},Ae=class extends Kt{static{t(this,"LinearAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.domain=s,this.scale=kt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=kt().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Et(e,i,s,n){let o=new Bt(n);if(Ct(e))return new we(i,s,e.categories,e.title,o);return new Ae(i,s,[e.min,e.max],e.title,o)}t(Et,"getAxis");var Ce=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(n<=e.height&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.titleWidth=i.width,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(e,i){let s=Math.min(this.titleWidth,this.chartConfig.width)/2,n=Math.min(Math.max((e+i)/2,s),this.chartConfig.width-s);this.boundingRect.x=n-s,this.boundingRect.width=s*2}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Zt(e,i,s,n){let o=new Bt(n);return new Ce(o,e,i,s)}t(Zt,"getChartTitleComponent");var Se=0.75,Re=0.5,_e=0.35;function Mt(e){return{fontSize:e,markerSize:e*Se,markerSpacing:e*_e,itemSpacing:e*Re}}t(Mt,"getLegendLayout");var Te=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((g)=>g.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:o}=Mt(this.chartConfig.legendFontSize),c=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((g)=>g.title),i),l=this.chartConfig.legendPadding*2+s+n+c.width,p=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*o;if(l<=e.width&&p<=e.height)this.boundingRect.width=l,this.boundingRect.height=p;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=Mt(this.chartConfig.legendFontSize),o=e+n,c=this.boundingRect.x+this.chartConfig.legendPadding,l=this.boundingRect.y+this.chartConfig.legendPadding,p=[],g=[];for(let[y,I]of this.visiblePlots.entries())if(At(I))p.push({x:c,y:l+y*o,width:i,height:i,fill:I.fill,strokeFill:I.fill,strokeWidth:0});else{let P=l+y*o+i/2;g.push({path:`M ${c},${P} L ${c+i},${P}`,strokeFill:I.strokeFill,strokeWidth:I.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:p},{groupTexts:["legend","markers"],type:"path",data:g},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((y,I)=>({text:y.title,x:c+i+s,y:l+I*o+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Jt(e,i,s,n){let o=new Bt(n);return new Te(o,e,i,s)}t(Jt,"getChartLegendComponent");var De=class{constructor(e,i,s,n,o){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=Vn().y((n)=>n[0]).x((n)=>n[1])(e);else i=Vn().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let c=[];for(let[l,[p,g]]of e.entries()){let y=this.plotData.pointLabels[l];if(!y)continue;if(this.orientation==="horizontal")c.push({x:g+10,y:p,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else c.push({x:p,y:g-10,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(c.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:c})}return s}},ve=class{constructor(e,i,s,n,o,c){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=c}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((o)=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Pe=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new De(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new ve(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function te(e,i,s){return new Pe(e,i,s)}t(te,"getPlotComponent");var Le=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Zt(e,i,s,n),plot:te(e,i,s),legend:Jt(e,i,s,n),xAxis:Et(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Et(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:c,height:l});if(e-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=p.width,e-=p.width,o=this.componentStore.legend.calculateSpace({width:e,height:l}),e-=o.width,e>0)c+=e,e=0;if(i>0)l+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:l}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.title.alignTo(s,s+c),this.componentStore.legend.setBoundingBoxXY({x:s+c,y:n+Math.max((l-o.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+l}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((g)=>At(g)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,c={width:0,height:0},l=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),g=this.componentStore.plot.calculateSpace({width:l,height:p});if(e-=g.width,i-=g.height,g=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=g.height,i-=g.height,this.componentStore.xAxis.setAxisPosition("left"),g=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=g.width,n=g.width,this.componentStore.yAxis.setAxisPosition("top"),g=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=g.height,o=s+g.height,c=this.componentStore.legend.calculateSpace({width:e,height:p}),e-=c.width,e>0)l+=e,e=0;if(i>0)p+=i,i=0;if(this.componentStore.plot.calculateSpace({width:l,height:p}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.title.alignTo(n,n+l),this.componentStore.legend.setBoundingBoxXY({x:n+l,y:o+Math.max((p-c.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some((y)=>At(y)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Ee=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new Le(e,i,s,n).getDrawableElement()}},ft=0,ee,pt=Wt(),mt=Vt(),w=Ft(),It=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,zt=!1;function Vt(){let e=ke(),i=x();return U(e.xyChart,i.themeVariables.xyChart)}t(Vt,"getChartDefaultThemeConfig");function Wt(){let e=x();return U(N.xyChart,e.xyChart)}t(Wt,"getChartDefaultConfig");function Ft(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Ft,"getChartDefaultData");function ct(e){let i=x();return O(e.trim(),i)}t(ct,"textSanitizer");function ie(e){ee=e}t(ie,"setTmpSVGG");function se(e){if(e==="horizontal")pt.chartOrientation="horizontal";else pt.chartOrientation="vertical"}t(se,"setOrientation");function ne(e){w.xAxis.title=ct(e.text)}t(ne,"setXAxisTitle");function Xt(e,i){w.xAxis={type:"linear",title:w.xAxis.title,min:e,max:i},St=!0}t(Xt,"setXAxisRangeData");function ae(e){w.xAxis={type:"band",title:w.xAxis.title,categories:e.map((i)=>ct(i.text))},St=!0}t(ae,"setXAxisBand");function oe(e){w.yAxis.title=ct(e.text)}t(oe,"setYAxisTitle");function re(e,i){w.yAxis={type:"linear",title:w.yAxis.title,min:e,max:i},zt=!0}t(re,"setYAxisRangeData");function he(e){let i=Math.min(...e),s=Math.max(...e),n=dt(w.yAxis)?w.yAxis.min:1/0,o=dt(w.yAxis)?w.yAxis.max:-1/0;w.yAxis={type:"linear",title:w.yAxis.title,min:Math.min(n,i),max:Math.max(o,s)}}t(he,"setYAxisRangeFromPlotData");function Yt(e){let i=[];if(e.length===0)return i;if(!St){let s=dt(w.xAxis)?w.xAxis.min:1/0,n=dt(w.xAxis)?w.xAxis.max:-1/0;Xt(Math.min(s,1),Math.max(n,e.length))}if(Ct(w.xAxis)&&e.length>w.xAxis.categories.length)e=e.slice(0,w.xAxis.categories.length);if(!zt)he(e);if(Ct(w.xAxis))i=w.xAxis.categories.map((s,n)=>[s,e[n]]);if(dt(w.xAxis)){let s=w.xAxis.min,n=w.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let o=(n-s)/(e.length-1);i=e.map((c,l)=>[`${s+l*o}`,c])}}return i}t(Yt,"transformDataWithoutCategory");function Nt(e){return It[e===0?0:e%It.length]}t(Nt,"getPlotColorFromPalette");function le(e,i){let s=i.map((l)=>l.value),n=i.map((l)=>l.label?ct(l.label):""),o=Yt(s),c=n.some((l)=>l!=="");w.plots.push({type:"line",title:ct(e.text),strokeFill:Nt(ft),strokeWidth:2,data:o,...c?{pointLabels:n}:{}}),ft++}t(le,"setLineData");function ce(e,i){let s=i.map((o)=>o.value),n=Yt(s);w.plots.push({type:"bar",title:ct(e.text),fill:Nt(ft),data:n}),ft++}t(ce,"setBarData");function ge(){if(w.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return w.title=R(),Ee.build(pt,w,mt,ee)}t(ge,"getDrawableElem");function ue(){return mt}t(ue,"getChartThemeConfig");function de(){return pt}t(de,"getChartConfig");function xe(){return w}t(xe,"getXYChartData");var Me=t(function(){C(),ft=0,pt=Wt(),w=Ft(),mt=Vt(),It=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,zt=!1},"clear"),Ie={getDrawableElem:ge,clear:Me,setAccTitle:S,getAccTitle:E,setDiagramTitle:L,getDiagramTitle:R,getAccDescription:A,setAccDescription:T,setOrientation:se,setXAxisTitle:ne,setXAxisRangeData:Xt,setXAxisBand:ae,setYAxisTitle:oe,setYAxisRangeData:re,setLineData:le,setBarData:ce,setTmpSVGG:ie,getChartThemeConfig:ue,getChartConfig:de,getXYChartData:xe},Be=t((e,i,s,n)=>{let o=n.db,c=o.getChartThemeConfig(),l=o.getChartConfig(),p=o.getXYChartData().plots[0].data.map((_)=>_[1]);function g(_){return _==="top"?"text-before-edge":"middle"}t(g,"getDominantBaseLine");function y(_){return _==="left"?"start":_==="right"?"end":"middle"}t(y,"getTextAnchor");function I(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}t(I,"getTextTransformation"),a.debug(`Rendering xychart chart
7
- `+e);let P=V(i),k=P.append("g").attr("class","main"),G=k.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");F(P,l.height,l.width,!0),P.attr("viewBox",`0 0 ${l.width} ${l.height}`),G.attr("fill",c.backgroundColor),o.setTmpSVGG(P.append("g").attr("class","mermaid-tmp-group"));let X=o.getDrawableElem(),Y={};function j(_){let K=k,d="";for(let[Q]of _.entries()){let Z=k;if(Q>0&&Y[d])Z=Y[d];if(d+=_[Q],K=Y[d],!K)K=Y[d]=Z.append("g").attr("class",_[Q])}return K}t(j,"getGroup");for(let _ of X){if(_.data.length===0)continue;let K=j(_.groupTexts);switch(_.type){case"rect":if(K.selectAll("rect").data(_.data).enter().append("rect").attr("x",(d)=>d.x).attr("y",(d)=>d.y).attr("width",(d)=>d.width).attr("height",(d)=>d.height).attr("fill",(d)=>d.fill).attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth),l.showDataLabel){let d=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let Q=function(D,st){let{data:B,label:J}=D;return st*J.length*Z<=B.width-v};var it=Q;t(Q,"fitsHorizontally");let Z=0.7,v=10,ot=_.data.map((D,st)=>({data:D,label:p[st].toString()})).filter((D)=>D.data.width>0&&D.data.height>0),H=ot.map((D)=>{let{data:st}=D,B=st.height*0.7;while(!Q(D,B)&&B>0)B-=1;return B}),gt=Math.floor(Math.min(...H)),z=t((D)=>{if(d)return D.data.x+D.data.width+v;else return D.data.x+D.data.width-v},"determineLabelXPosition");K.selectAll("text").data(ot).enter().append("text").attr("x",z).attr("y",(D)=>D.data.y+D.data.height/2).attr("text-anchor",d?"start":"end").attr("dominant-baseline","middle").attr("fill",c.dataLabelColor).attr("font-size",`${gt}px`).text((D)=>D.label)}else{let Q=function(z,D,st){let{data:B,label:J}=z,h=0.7,u=D*J.length*0.7,f=B.x+B.width/2,m=f-u/2,M=f+u/2,r=m>=B.x&&M<=B.x+B.width,rt=B.y+st+D<=B.y+B.height;return r&&rt};var nt=Q;t(Q,"fitsInBar");let Z=10,v=_.data.map((z,D)=>({data:z,label:p[D].toString()})).filter((z)=>z.data.width>0&&z.data.height>0),ot=v.map((z)=>{let{data:D,label:st}=z,B=D.width/(st.length*0.7);while(!Q(z,B,Z)&&B>0)B-=1;return B}),H=Math.floor(Math.min(...ot)),gt=t((z)=>{if(d)return z.data.y-Z;else return z.data.y+Z},"determineLabelYPosition");K.selectAll("text").data(v).enter().append("text").attr("x",(z)=>z.data.x+z.data.width/2).attr("y",gt).attr("text-anchor","middle").attr("dominant-baseline",d?"auto":"hanging").attr("fill",c.dataLabelColor).attr("font-size",`${H}px`).text((z)=>z.label)}}break;case"text":K.selectAll("text").data(_.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(d)=>d.fill).attr("font-size",(d)=>d.fontSize).attr("dominant-baseline",(d)=>g(d.verticalPos)).attr("text-anchor",(d)=>y(d.horizontalPos)).attr("transform",(d)=>I(d)).text((d)=>d.text);break;case"path":K.selectAll("path").data(_.data).enter().append("path").attr("d",(d)=>d.path).attr("fill",(d)=>d.fill?d.fill:"none").attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth);break}}},"draw"),ze={draw:Be},ti={parser:ye,db:Ie,renderer:ze};export{ti as diagram};
5
+ `+u+"^"},"showPosition"),test_match:t(function(h,u){var f,m,I;if(this.options.backtrack_lexer){if(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)I.yylloc.range=this.yylloc.range.slice(0)}if(m=h[0].match(/(?:\r\n?|\n).*/g),m)this.yylineno+=m.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],f=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else if(this._backtrack){for(var r in I)this[r]=I[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,u,f,m;if(!this._more)this.yytext="",this.match="";var I=this._currentRules();for(var r=0;r<I.length;r++)if(f=this._input.match(this.rules[I[r]]),f&&(!u||f[0].length>u[0].length)){if(u=f,m=r,this.options.backtrack_lexer)if(h=this.test_match(f,I[r]),h!==!1)return h;else if(this._backtrack){u=!1;continue}else return!1;else if(!this.options.flex)break}if(u){if(h=this.test_match(u,I[m]),h!==!1)return h;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var u=this.next();if(u)return u;else return this.lex()},"lex"),begin:t(function(u){this.conditionStack.push(u)},"begin"),popState:t(function(){var u=this.conditionStack.length-1;if(u>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(u){if(u=this.conditionStack.length-1-Math.abs(u||0),u>=0)return this.conditionStack[u];else return"INITIAL"},"topState"),pushState:t(function(u){this.begin(u)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(u,f,m,I){var r=I;switch(m){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return J}();D.lexer=st;function z(){this.yy={}}return t(z,"Parser"),z.prototype=D,D.Parser=z,new z}();Et.parser=Et;var ye=Et;function At(e){return e.type==="bar"}t(At,"isBarPlot");function Ct(e){return e.type==="band"}t(Ct,"isBandAxisData");function dt(e){return e.type==="linear"}t(dt,"isLinearAxisData");var zt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((g,y)=>Math.max(y.length,g),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),o=n.node()?.getScreenCTM?.(),c=t((g)=>g&&g>0?g:1,"toScale"),l=c(o?.a),p=c(o?.d);for(let g of e){let y=Zi(n,1,g),B=y?y.width/l:g.length*i,P=y?y.height/p:i;s.width=Math.max(s.width,B),s.height=Math.max(s.height,P)}return n.remove(),s}},jt=0.7,Qt=0.2,Kt=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(jt*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(jt*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.width;this.outerPadding=Math.min(s.width/2,n);let o=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Qt*e.height;this.outerPadding=Math.min(s.height/2,n);let o=s.width+this.axisConfig.labelPadding*2;if(o<=i)i-=o,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},we=class extends Kt{static{t(this,"BandAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),a.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},Ae=class extends Kt{static{t(this,"LinearAxis")}constructor(e,i,s,n,o){super(e,n,o,i);this.domain=s,this.scale=wt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=wt().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Mt(e,i,s,n){let o=new zt(n);if(Ct(e))return new we(i,s,e.categories,e.title,o);return new Ae(i,s,[e.min,e.max],e.title,o)}t(Mt,"getAxis");var Ce=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(n<=e.height&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.titleWidth=i.width,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(e,i){let s=Math.min(this.titleWidth,this.chartConfig.width)/2,n=Math.min(Math.max((e+i)/2,s),this.chartConfig.width-s);this.boundingRect.x=n-s,this.boundingRect.width=s*2}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Zt(e,i,s,n){let o=new zt(n);return new Ce(o,e,i,s)}t(Zt,"getChartTitleComponent");var Se=0.75,Re=0.5,_e=0.35;function It(e){return{fontSize:e,markerSize:e*Se,markerSpacing:e*_e,itemSpacing:e*Re}}t(It,"getLegendLayout");var Te=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((g)=>g.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:o}=It(this.chartConfig.legendFontSize),c=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((g)=>g.title),i),l=this.chartConfig.legendPadding*2+s+n+c.width,p=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*o;if(l<=e.width&&p<=e.height)this.boundingRect.width=l,this.boundingRect.height=p;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=It(this.chartConfig.legendFontSize),o=e+n,c=this.boundingRect.x+this.chartConfig.legendPadding,l=this.boundingRect.y+this.chartConfig.legendPadding,p=[],g=[];for(let[y,B]of this.visiblePlots.entries())if(At(B))p.push({x:c,y:l+y*o,width:i,height:i,fill:B.fill,strokeFill:B.fill,strokeWidth:0});else{let P=l+y*o+i/2;g.push({path:`M ${c},${P} L ${c+i},${P}`,strokeFill:B.strokeFill,strokeWidth:B.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:p},{groupTexts:["legend","markers"],type:"path",data:g},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((y,B)=>({text:y.title,x:c+i+s,y:l+B*o+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Jt(e,i,s,n){let o=new zt(n);return new Te(o,e,i,s)}t(Jt,"getChartLegendComponent");var De=class{constructor(e,i,s,n,o){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=jn().y((n)=>n[0]).x((n)=>n[1])(e);else i=jn().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let c=[];for(let[l,[p,g]]of e.entries()){let y=this.plotData.pointLabels[l];if(!y)continue;if(this.orientation==="horizontal")c.push({x:g+10,y:p,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else c.push({x:p,y:g-10,text:y,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(c.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:c})}return s}},ve=class{constructor(e,i,s,n,o,c){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=c}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((o)=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((o)=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Pe=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new De(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new ve(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function te(e,i,s){return new Pe(e,i,s)}t(te,"getPlotComponent");var Le=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Zt(e,i,s,n),plot:te(e,i,s),legend:Jt(e,i,s,n),xAxis:Mt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Mt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:c,height:l});if(e-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=p.width,e-=p.width,o=this.componentStore.legend.calculateSpace({width:e,height:l}),e-=o.width,e>0)c+=e,e=0;if(i>0)l+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:l}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.title.alignTo(s,s+c),this.componentStore.legend.setBoundingBoxXY({x:s+c,y:n+Math.max((l-o.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+l}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((g)=>At(g)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,c={width:0,height:0},l=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),g=this.componentStore.plot.calculateSpace({width:l,height:p});if(e-=g.width,i-=g.height,g=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=g.height,i-=g.height,this.componentStore.xAxis.setAxisPosition("left"),g=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=g.width,n=g.width,this.componentStore.yAxis.setAxisPosition("top"),g=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=g.height,o=s+g.height,c=this.componentStore.legend.calculateSpace({width:e,height:p}),e-=c.width,e>0)l+=e,e=0;if(i>0)p+=i,i=0;if(this.componentStore.plot.calculateSpace({width:l,height:p}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.title.alignTo(n,n+l),this.componentStore.legend.setBoundingBoxXY({x:n+l,y:o+Math.max((p-c.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+l]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some((y)=>At(y)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Ee=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new Le(e,i,s,n).getDrawableElement()}},ft=0,ee,pt=Wt(),mt=Vt(),w=Ft(),Bt=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,Ot=!1;function Vt(){let e=ke(),i=x();return U(e.xyChart,i.themeVariables.xyChart)}t(Vt,"getChartDefaultThemeConfig");function Wt(){let e=x();return U(M.xyChart,e.xyChart)}t(Wt,"getChartDefaultConfig");function Ft(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Ft,"getChartDefaultData");function ct(e){let i=x();return O(e.trim(),i)}t(ct,"textSanitizer");function ie(e){ee=e}t(ie,"setTmpSVGG");function se(e){if(e==="horizontal")pt.chartOrientation="horizontal";else pt.chartOrientation="vertical"}t(se,"setOrientation");function ne(e){w.xAxis.title=ct(e.text)}t(ne,"setXAxisTitle");function Xt(e,i){w.xAxis={type:"linear",title:w.xAxis.title,min:e,max:i},St=!0}t(Xt,"setXAxisRangeData");function ae(e){w.xAxis={type:"band",title:w.xAxis.title,categories:e.map((i)=>ct(i.text))},St=!0}t(ae,"setXAxisBand");function oe(e){w.yAxis.title=ct(e.text)}t(oe,"setYAxisTitle");function re(e,i){w.yAxis={type:"linear",title:w.yAxis.title,min:e,max:i},Ot=!0}t(re,"setYAxisRangeData");function he(e){let i=Math.min(...e),s=Math.max(...e),n=dt(w.yAxis)?w.yAxis.min:1/0,o=dt(w.yAxis)?w.yAxis.max:-1/0;w.yAxis={type:"linear",title:w.yAxis.title,min:Math.min(n,i),max:Math.max(o,s)}}t(he,"setYAxisRangeFromPlotData");function Yt(e){let i=[];if(e.length===0)return i;if(!St){let s=dt(w.xAxis)?w.xAxis.min:1/0,n=dt(w.xAxis)?w.xAxis.max:-1/0;Xt(Math.min(s,1),Math.max(n,e.length))}if(Ct(w.xAxis)&&e.length>w.xAxis.categories.length)e=e.slice(0,w.xAxis.categories.length);if(!Ot)he(e);if(Ct(w.xAxis))i=w.xAxis.categories.map((s,n)=>[s,e[n]]);if(dt(w.xAxis)){let s=w.xAxis.min,n=w.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let o=(n-s)/(e.length-1);i=e.map((c,l)=>[`${s+l*o}`,c])}}return i}t(Yt,"transformDataWithoutCategory");function Nt(e){return Bt[e===0?0:e%Bt.length]}t(Nt,"getPlotColorFromPalette");function le(e,i){let s=i.map((l)=>l.value),n=i.map((l)=>l.label?ct(l.label):""),o=Yt(s),c=n.some((l)=>l!=="");w.plots.push({type:"line",title:ct(e.text),strokeFill:Nt(ft),strokeWidth:2,data:o,...c?{pointLabels:n}:{}}),ft++}t(le,"setLineData");function ce(e,i){let s=i.map((o)=>o.value),n=Yt(s);w.plots.push({type:"bar",title:ct(e.text),fill:Nt(ft),data:n}),ft++}t(ce,"setBarData");function ge(){if(w.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return w.title=R(),Ee.build(pt,w,mt,ee)}t(ge,"getDrawableElem");function ue(){return mt}t(ue,"getChartThemeConfig");function de(){return pt}t(de,"getChartConfig");function xe(){return w}t(xe,"getXYChartData");var Me=t(function(){C(),ft=0,pt=Wt(),w=Ft(),mt=Vt(),Bt=mt.plotColorPalette.split(",").map((e)=>e.trim()),St=!1,Ot=!1},"clear"),Ie={getDrawableElem:ge,clear:Me,setAccTitle:S,getAccTitle:E,setDiagramTitle:L,getDiagramTitle:R,getAccDescription:A,setAccDescription:T,setOrientation:se,setXAxisTitle:ne,setXAxisRangeData:Xt,setXAxisBand:ae,setYAxisTitle:oe,setYAxisRangeData:re,setLineData:le,setBarData:ce,setTmpSVGG:ie,getChartThemeConfig:ue,getChartConfig:de,getXYChartData:xe},Be=t((e,i,s,n)=>{let o=n.db,c=o.getChartThemeConfig(),l=o.getChartConfig(),p=o.getXYChartData().plots[0].data.map((_)=>_[1]);function g(_){return _==="top"?"text-before-edge":"middle"}t(g,"getDominantBaseLine");function y(_){return _==="left"?"start":_==="right"?"end":"middle"}t(y,"getTextAnchor");function B(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}t(B,"getTextTransformation"),a.debug(`Rendering xychart chart
7
+ `+e);let P=V(i),k=P.append("g").attr("class","main"),G=k.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");F(P,l.height,l.width,!0),P.attr("viewBox",`0 0 ${l.width} ${l.height}`),G.attr("fill",c.backgroundColor),o.setTmpSVGG(P.append("g").attr("class","mermaid-tmp-group"));let Y=o.getDrawableElem(),N={};function j(_){let K=k,d="";for(let[Q]of _.entries()){let Z=k;if(Q>0&&N[d])Z=N[d];if(d+=_[Q],K=N[d],!K)K=N[d]=Z.append("g").attr("class",_[Q])}return K}t(j,"getGroup");for(let _ of Y){if(_.data.length===0)continue;let K=j(_.groupTexts);switch(_.type){case"rect":if(K.selectAll("rect").data(_.data).enter().append("rect").attr("x",(d)=>d.x).attr("y",(d)=>d.y).attr("width",(d)=>d.width).attr("height",(d)=>d.height).attr("fill",(d)=>d.fill).attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth),l.showDataLabel){let d=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let Q=function(D,st){let{data:z,label:J}=D;return st*J.length*Z<=z.width-v};var it=Q;t(Q,"fitsHorizontally");let Z=0.7,v=10,ot=_.data.map((D,st)=>({data:D,label:p[st].toString()})).filter((D)=>D.data.width>0&&D.data.height>0),H=ot.map((D)=>{let{data:st}=D,z=st.height*0.7;while(!Q(D,z)&&z>0)z-=1;return z}),gt=Math.floor(Math.min(...H)),W=t((D)=>{if(d)return D.data.x+D.data.width+v;else return D.data.x+D.data.width-v},"determineLabelXPosition");K.selectAll("text").data(ot).enter().append("text").attr("x",W).attr("y",(D)=>D.data.y+D.data.height/2).attr("text-anchor",d?"start":"end").attr("dominant-baseline","middle").attr("fill",c.dataLabelColor).attr("font-size",`${gt}px`).text((D)=>D.label)}else{let Q=function(W,D,st){let{data:z,label:J}=W,h=0.7,u=D*J.length*0.7,f=z.x+z.width/2,m=f-u/2,I=f+u/2,r=m>=z.x&&I<=z.x+z.width,rt=z.y+st+D<=z.y+z.height;return r&&rt};var nt=Q;t(Q,"fitsInBar");let Z=10,v=_.data.map((W,D)=>({data:W,label:p[D].toString()})).filter((W)=>W.data.width>0&&W.data.height>0),ot=v.map((W)=>{let{data:D,label:st}=W,z=D.width/(st.length*0.7);while(!Q(W,z,Z)&&z>0)z-=1;return z}),H=Math.floor(Math.min(...ot)),gt=t((W)=>{if(d)return W.data.y-Z;else return W.data.y+Z},"determineLabelYPosition");K.selectAll("text").data(v).enter().append("text").attr("x",(W)=>W.data.x+W.data.width/2).attr("y",gt).attr("text-anchor","middle").attr("dominant-baseline",d?"auto":"hanging").attr("fill",c.dataLabelColor).attr("font-size",`${H}px`).text((W)=>W.label)}}break;case"text":K.selectAll("text").data(_.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(d)=>d.fill).attr("font-size",(d)=>d.fontSize).attr("dominant-baseline",(d)=>g(d.verticalPos)).attr("text-anchor",(d)=>y(d.horizontalPos)).attr("transform",(d)=>B(d)).text((d)=>d.text);break;case"path":K.selectAll("path").data(_.data).enter().append("path").attr("d",(d)=>d.path).attr("fill",(d)=>d.fill?d.fill:"none").attr("stroke",(d)=>d.strokeFill).attr("stroke-width",(d)=>d.strokeWidth);break}}},"draw"),ze={draw:Be},ti={parser:ye,db:Ie,renderer:ze};export{ti as diagram};
@@ -1 +1 @@
1
- import{t,a,p}from"./chunk-veam6vk4.js";import{mt,vr}from"./chunk-8w7fyb3v.js";import{Se,Te}from"./chunk-nvt9tkt4.js";var k=Te(function(F,Y){(function(g,r){if(typeof F==="object"&&typeof Y==="object")Y.exports=r(vr());else if(typeof define==="function"&&define.amd)define(["cose-base"],r);else if(typeof F==="object")F.cytoscapeCoseBilkent=r(vr());else g.cytoscapeCoseBilkent=r(g.coseBase)})(F,function(u){return function(g){var r={};function n(o){if(r[o])return r[o].exports;var d=r[o]={i:o,l:!1,exports:{}};return g[o].call(d.exports,d,d.exports,n),d.l=!0,d.exports}return n.m=g,n.c=r,n.i=function(o){return o},n.d=function(o,d,l){if(!n.o(o,d))Object.defineProperty(o,d,{configurable:!1,enumerable:!0,get:l})},n.n=function(o){var d=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(d,"a",d),d},n.o=function(o,d){return Object.prototype.hasOwnProperty.call(o,d)},n.p="",n(n.s=1)}([function(g,r){g.exports=u},function(g,r,n){var o=n(0).layoutBase.LayoutConstants,d=n(0).layoutBase.FDLayoutConstants,l=n(0).CoSEConstants,L=n(0).CoSELayout,b=n(0).CoSENode,H=n(0).layoutBase.PointD,v=n(0).layoutBase.DimensionD,_={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function D(E,e){var f={};for(var s in E)f[s]=E[s];for(var s in e)f[s]=e[s];return f}function I(E){this.options=D(_,E),U(this.options)}var U=function(e){if(e.nodeRepulsion!=null)l.DEFAULT_REPULSION_STRENGTH=d.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion;if(e.idealEdgeLength!=null)l.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=e.idealEdgeLength;if(e.edgeElasticity!=null)l.DEFAULT_SPRING_STRENGTH=d.DEFAULT_SPRING_STRENGTH=e.edgeElasticity;if(e.nestingFactor!=null)l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor;if(e.gravity!=null)l.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=e.gravity;if(e.numIter!=null)l.MAX_ITERATIONS=d.MAX_ITERATIONS=e.numIter;if(e.gravityRange!=null)l.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange;if(e.gravityCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound;if(e.gravityRangeCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound;if(e.initialEnergyOnIncremental!=null)l.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental;if(e.quality=="draft")o.QUALITY=0;else if(e.quality=="proof")o.QUALITY=2;else o.QUALITY=1;l.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!e.randomize,l.ANIMATE=d.ANIMATE=o.ANIMATE=e.animate,l.TILE=e.tile,l.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==="function"?e.tilingPaddingVertical.call():e.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==="function"?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};I.prototype.run=function(){var E,e,f=this.options,s=this.idToLNode={},c=this.layout=new L,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var y=c.newGraphManager();this.gm=y;var T=this.options.eles.nodes(),m=this.options.eles.edges();this.root=y.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(T),c);for(var h=0;h<m.length;h++){var P=m[h],x=this.idToLNode[P.data("source")],O=this.idToLNode[P.data("target")];if(x!==O&&x.getEdgesBetween(O).length==0){var et=y.add(c.newEdge(),x,O);et.id=P.id()}}var V=function(R,B){if(typeof R==="number")R=B;var C=R.data("id"),G=i.idToLNode[C];return{x:G.getRect().getCenterX(),y:G.getRect().getCenterY()}},nt=function X(){var R=function(){if(f.fit)f.cy.fit(f.eles,f.padding);if(!E)E=!0,i.cy.one("layoutready",f.ready),i.cy.trigger({type:"layoutready",layout:i})},B=i.options.refresh,C;for(var G=0;G<B&&!C;G++)C=i.stopped||i.layout.tick();if(C){if(c.checkLayoutSuccess()&&!c.isSubLayout)c.doPostLayout();if(c.tilingPostLayout)c.tilingPostLayout();if(c.isLayoutFinished=!0,i.options.eles.nodes().positions(V),R(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),e)cancelAnimationFrame(e);E=!1;return}var M=i.layout.getPositionsData();f.eles.nodes().positions(function(A,it){if(typeof A==="number")A=it;if(!A.isParent()){var j=A.id(),N=M[j],w=A;while(N==null)if(N=M[w.data("parent")]||M["DummyCompound_"+w.data("parent")],M[j]=N,w=w.parent()[0],w==null)break;if(N!=null)return{x:N.x,y:N.y};else return{x:A.position("x"),y:A.position("y")}}}),R(),e=requestAnimationFrame(X)};if(c.addListener("layoutstarted",function(){if(i.options.animate==="during")e=requestAnimationFrame(nt)}),c.runLayout(),this.options.animate!=="during")i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,V),E=!1;return this},I.prototype.getTopMostNodes=function(E){var e={};for(var f=0;f<E.length;f++)e[E[f].id()]=!0;var s=E.filter(function(c,i){if(typeof c==="number")c=i;var y=c.parent()[0];while(y!=null){if(e[y.id()])return!1;y=y.parent()[0]}return!0});return s},I.prototype.processChildrenList=function(E,e,f){var s=e.length;for(var c=0;c<s;c++){var i=e[c],y=i.children(),T,m=i.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(i.outerWidth()!=null&&i.outerHeight()!=null)T=E.add(new b(f.graphManager,new H(i.position("x")-m.w/2,i.position("y")-m.h/2),new v(parseFloat(m.w),parseFloat(m.h))));else T=E.add(new b(this.graphManager));if(T.id=i.data("id"),T.paddingLeft=parseInt(i.css("padding")),T.paddingTop=parseInt(i.css("padding")),T.paddingRight=parseInt(i.css("padding")),T.paddingBottom=parseInt(i.css("padding")),this.options.nodeDimensionsIncludeLabels){if(i.isParent()){var h=i.boundingBox({includeLabels:!0,includeNodes:!1}).w,P=i.boundingBox({includeLabels:!0,includeNodes:!1}).h,x=i.css("text-halign");T.labelWidth=h,T.labelHeight=P,T.labelPos=x}}if(this.idToLNode[i.data("id")]=T,isNaN(T.rect.x))T.rect.x=0;if(isNaN(T.rect.y))T.rect.y=0;if(y!=null&&y.length>0){var O=f.getGraphManager().add(f.newGraph(),T);this.processChildrenList(O,y,f)}}},I.prototype.stop=function(){return this.stopped=!0,this};var S=function(e){e("layout","cose-bilkent",I)};if(typeof cytoscape<"u")S(cytoscape);g.exports=S}])})});var z=Se(k(),1);mt.use(z.default);function q(u,g){u.forEach((r)=>{let n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach((o)=>{if(!["id","label","height","width","padding","x","y"].includes(o))n[o]=r[o]}),g.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}t(q,"addNodes");function W(u,g){u.forEach((r)=>{let n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach((o)=>{if(!["id","start","end"].includes(o))n[o]=r[o]}),g.add({group:"edges",data:n})})}t(W,"addEdges");function Q(u){return new Promise((g)=>{let r=p("body").append("div").attr("id","cy").attr("style","display:none"),n=mt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),q(u.nodes,n),W(u.edges,n),n.nodes().forEach(function(d){d.layoutDimensions=()=>{let l=d.data();return{w:l.width,h:l.height}}});let o={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(o).run(),n.ready((d)=>{a.info("Cytoscape ready",d),g(n)})})}t(Q,"createCytoscapeInstance");function Z(u){return u.nodes().map((g)=>{let r=g.data(),n=g.position(),o={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach((d)=>{if(d!=="id")o[d]=r[d]}),o})}t(Z,"extractPositionedNodes");function J(u){return u.edges().map((g)=>{let r=g.data(),n=g._private.rscratch,o={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach((d)=>{if(!["id","source","target"].includes(d))o[d]=r[d]}),o})}t(J,"extractPositionedEdges");async function K(u,g){a.debug("Starting cose-bilkent layout algorithm");try{tt(u);let r=await Q(u),n=Z(r),o=J(r);return a.debug(`Layout completed: ${n.length} nodes, ${o.length} edges`),{nodes:n,edges:o}}catch(r){throw a.error("Error in cose-bilkent layout algorithm:",r),r}}t(K,"executeCoseBilkentLayout");function tt(u){if(!u)throw Error("Layout data is required");if(!u.config)throw Error("Configuration is required in layout data");if(!u.rootNode)throw Error("Root node is required");if(!u.nodes||!Array.isArray(u.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(u.edges))throw Error("Edges array is required in layout data");return!0}t(tt,"validateLayoutData");var at=t(async(u,g,{insertCluster:r,insertEdge:n,insertEdgeLabel:o,insertMarkers:d,insertNode:l,log:L,positionEdgeLabel:b},{algorithm:H})=>{let v={},_={},D=g.select("g");d(D,u.markers,u.type,u.diagramId);let I=D.insert("g").attr("class","subgraphs"),U=D.insert("g").attr("class","edgePaths"),S=D.insert("g").attr("class","edgeLabels"),E=D.insert("g").attr("class","nodes");L.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(u.nodes.map(async(s)=>{if(s.isGroup){let c={...s};_[s.id]=c,v[s.id]=c,await r(I,s)}else{let c={...s};v[s.id]=c;let i=await l(E,s,{config:u.config,dir:u.direction||"TB"}),y=i.node().getBBox();c.width=y.width,c.height=y.height,c.domId=i,L.debug(`Node ${s.id} dimensions: ${y.width}x${y.height}`)}})),L.debug("Running cose-bilkent layout algorithm");let e={...u,nodes:u.nodes.map((s)=>{let c=v[s.id];return{...s,width:c.width,height:c.height}})},f=await K(e,u.config);L.debug("Positioning nodes based on layout results"),f.nodes.forEach((s)=>{let c=v[s.id];if(c?.domId)c.domId.attr("transform",`translate(${s.x}, ${s.y})`),c.x=s.x,c.y=s.y,L.debug(`Positioned node ${c.id} at center (${s.x}, ${s.y})`)}),f.edges.forEach((s)=>{let c=u.edges.find((i)=>i.id===s.id);if(c)c.points=[{x:s.startX,y:s.startY},{x:s.midX,y:s.midY},{x:s.endX,y:s.endY}]}),L.debug("Inserting and positioning edges"),await Promise.all(u.edges.map(async(s)=>{let c=await o(S,s),i=v[s.start??""],y=v[s.end??""];if(i&&y){let T=f.edges.find((m)=>m.id===s.id);if(T){L.debug("APA01 positionedEdge",T);let m={...s},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}else{let m={...s,points:[{x:i.x||0,y:i.y||0},{x:y.x||0,y:y.y||0}]},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}}})),L.debug("Cose-bilkent rendering completed")},"render"),ct=at;export{ct as render};
1
+ import{t,a,p}from"./chunk-e763h2px.js";import{ht,gr}from"./chunk-3b4wqmnh.js";import{Se,Te}from"./chunk-kahab58k.js";var k=Te(function(F,Y){(function(g,r){if(typeof F==="object"&&typeof Y==="object")Y.exports=r(gr());else if(typeof define==="function"&&define.amd)define(["cose-base"],r);else if(typeof F==="object")F.cytoscapeCoseBilkent=r(gr());else g.cytoscapeCoseBilkent=r(g.coseBase)})(F,function(u){return function(g){var r={};function n(o){if(r[o])return r[o].exports;var d=r[o]={i:o,l:!1,exports:{}};return g[o].call(d.exports,d,d.exports,n),d.l=!0,d.exports}return n.m=g,n.c=r,n.i=function(o){return o},n.d=function(o,d,l){if(!n.o(o,d))Object.defineProperty(o,d,{configurable:!1,enumerable:!0,get:l})},n.n=function(o){var d=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(d,"a",d),d},n.o=function(o,d){return Object.prototype.hasOwnProperty.call(o,d)},n.p="",n(n.s=1)}([function(g,r){g.exports=u},function(g,r,n){var o=n(0).layoutBase.LayoutConstants,d=n(0).layoutBase.FDLayoutConstants,l=n(0).CoSEConstants,L=n(0).CoSELayout,b=n(0).CoSENode,H=n(0).layoutBase.PointD,v=n(0).layoutBase.DimensionD,_={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function D(E,e){var f={};for(var s in E)f[s]=E[s];for(var s in e)f[s]=e[s];return f}function I(E){this.options=D(_,E),U(this.options)}var U=function(e){if(e.nodeRepulsion!=null)l.DEFAULT_REPULSION_STRENGTH=d.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion;if(e.idealEdgeLength!=null)l.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=e.idealEdgeLength;if(e.edgeElasticity!=null)l.DEFAULT_SPRING_STRENGTH=d.DEFAULT_SPRING_STRENGTH=e.edgeElasticity;if(e.nestingFactor!=null)l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor;if(e.gravity!=null)l.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=e.gravity;if(e.numIter!=null)l.MAX_ITERATIONS=d.MAX_ITERATIONS=e.numIter;if(e.gravityRange!=null)l.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange;if(e.gravityCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound;if(e.gravityRangeCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound;if(e.initialEnergyOnIncremental!=null)l.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental;if(e.quality=="draft")o.QUALITY=0;else if(e.quality=="proof")o.QUALITY=2;else o.QUALITY=1;l.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!e.randomize,l.ANIMATE=d.ANIMATE=o.ANIMATE=e.animate,l.TILE=e.tile,l.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==="function"?e.tilingPaddingVertical.call():e.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==="function"?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};I.prototype.run=function(){var E,e,f=this.options,s=this.idToLNode={},c=this.layout=new L,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var y=c.newGraphManager();this.gm=y;var T=this.options.eles.nodes(),m=this.options.eles.edges();this.root=y.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(T),c);for(var h=0;h<m.length;h++){var P=m[h],x=this.idToLNode[P.data("source")],O=this.idToLNode[P.data("target")];if(x!==O&&x.getEdgesBetween(O).length==0){var et=y.add(c.newEdge(),x,O);et.id=P.id()}}var V=function(R,B){if(typeof R==="number")R=B;var C=R.data("id"),G=i.idToLNode[C];return{x:G.getRect().getCenterX(),y:G.getRect().getCenterY()}},nt=function X(){var R=function(){if(f.fit)f.cy.fit(f.eles,f.padding);if(!E)E=!0,i.cy.one("layoutready",f.ready),i.cy.trigger({type:"layoutready",layout:i})},B=i.options.refresh,C;for(var G=0;G<B&&!C;G++)C=i.stopped||i.layout.tick();if(C){if(c.checkLayoutSuccess()&&!c.isSubLayout)c.doPostLayout();if(c.tilingPostLayout)c.tilingPostLayout();if(c.isLayoutFinished=!0,i.options.eles.nodes().positions(V),R(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),e)cancelAnimationFrame(e);E=!1;return}var M=i.layout.getPositionsData();f.eles.nodes().positions(function(A,it){if(typeof A==="number")A=it;if(!A.isParent()){var j=A.id(),N=M[j],w=A;while(N==null)if(N=M[w.data("parent")]||M["DummyCompound_"+w.data("parent")],M[j]=N,w=w.parent()[0],w==null)break;if(N!=null)return{x:N.x,y:N.y};else return{x:A.position("x"),y:A.position("y")}}}),R(),e=requestAnimationFrame(X)};if(c.addListener("layoutstarted",function(){if(i.options.animate==="during")e=requestAnimationFrame(nt)}),c.runLayout(),this.options.animate!=="during")i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,V),E=!1;return this},I.prototype.getTopMostNodes=function(E){var e={};for(var f=0;f<E.length;f++)e[E[f].id()]=!0;var s=E.filter(function(c,i){if(typeof c==="number")c=i;var y=c.parent()[0];while(y!=null){if(e[y.id()])return!1;y=y.parent()[0]}return!0});return s},I.prototype.processChildrenList=function(E,e,f){var s=e.length;for(var c=0;c<s;c++){var i=e[c],y=i.children(),T,m=i.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(i.outerWidth()!=null&&i.outerHeight()!=null)T=E.add(new b(f.graphManager,new H(i.position("x")-m.w/2,i.position("y")-m.h/2),new v(parseFloat(m.w),parseFloat(m.h))));else T=E.add(new b(this.graphManager));if(T.id=i.data("id"),T.paddingLeft=parseInt(i.css("padding")),T.paddingTop=parseInt(i.css("padding")),T.paddingRight=parseInt(i.css("padding")),T.paddingBottom=parseInt(i.css("padding")),this.options.nodeDimensionsIncludeLabels){if(i.isParent()){var h=i.boundingBox({includeLabels:!0,includeNodes:!1}).w,P=i.boundingBox({includeLabels:!0,includeNodes:!1}).h,x=i.css("text-halign");T.labelWidth=h,T.labelHeight=P,T.labelPos=x}}if(this.idToLNode[i.data("id")]=T,isNaN(T.rect.x))T.rect.x=0;if(isNaN(T.rect.y))T.rect.y=0;if(y!=null&&y.length>0){var O=f.getGraphManager().add(f.newGraph(),T);this.processChildrenList(O,y,f)}}},I.prototype.stop=function(){return this.stopped=!0,this};var S=function(e){e("layout","cose-bilkent",I)};if(typeof cytoscape<"u")S(cytoscape);g.exports=S}])})});var z=Se(k(),1);ht.use(z.default);function q(u,g){u.forEach((r)=>{let n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach((o)=>{if(!["id","label","height","width","padding","x","y"].includes(o))n[o]=r[o]}),g.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}t(q,"addNodes");function W(u,g){u.forEach((r)=>{let n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach((o)=>{if(!["id","start","end"].includes(o))n[o]=r[o]}),g.add({group:"edges",data:n})})}t(W,"addEdges");function Q(u){return new Promise((g)=>{let r=p("body").append("div").attr("id","cy").attr("style","display:none"),n=ht({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),q(u.nodes,n),W(u.edges,n),n.nodes().forEach(function(d){d.layoutDimensions=()=>{let l=d.data();return{w:l.width,h:l.height}}});let o={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(o).run(),n.ready((d)=>{a.info("Cytoscape ready",d),g(n)})})}t(Q,"createCytoscapeInstance");function Z(u){return u.nodes().map((g)=>{let r=g.data(),n=g.position(),o={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach((d)=>{if(d!=="id")o[d]=r[d]}),o})}t(Z,"extractPositionedNodes");function J(u){return u.edges().map((g)=>{let r=g.data(),n=g._private.rscratch,o={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach((d)=>{if(!["id","source","target"].includes(d))o[d]=r[d]}),o})}t(J,"extractPositionedEdges");async function K(u,g){a.debug("Starting cose-bilkent layout algorithm");try{tt(u);let r=await Q(u),n=Z(r),o=J(r);return a.debug(`Layout completed: ${n.length} nodes, ${o.length} edges`),{nodes:n,edges:o}}catch(r){throw a.error("Error in cose-bilkent layout algorithm:",r),r}}t(K,"executeCoseBilkentLayout");function tt(u){if(!u)throw Error("Layout data is required");if(!u.config)throw Error("Configuration is required in layout data");if(!u.rootNode)throw Error("Root node is required");if(!u.nodes||!Array.isArray(u.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(u.edges))throw Error("Edges array is required in layout data");return!0}t(tt,"validateLayoutData");var at=t(async(u,g,{insertCluster:r,insertEdge:n,insertEdgeLabel:o,insertMarkers:d,insertNode:l,log:L,positionEdgeLabel:b},{algorithm:H})=>{let v={},_={},D=g.select("g");d(D,u.markers,u.type,u.diagramId);let I=D.insert("g").attr("class","subgraphs"),U=D.insert("g").attr("class","edgePaths"),S=D.insert("g").attr("class","edgeLabels"),E=D.insert("g").attr("class","nodes");L.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(u.nodes.map(async(s)=>{if(s.isGroup){let c={...s};_[s.id]=c,v[s.id]=c,await r(I,s)}else{let c={...s};v[s.id]=c;let i=await l(E,s,{config:u.config,dir:u.direction||"TB"}),y=i.node().getBBox();c.width=y.width,c.height=y.height,c.domId=i,L.debug(`Node ${s.id} dimensions: ${y.width}x${y.height}`)}})),L.debug("Running cose-bilkent layout algorithm");let e={...u,nodes:u.nodes.map((s)=>{let c=v[s.id];return{...s,width:c.width,height:c.height}})},f=await K(e,u.config);L.debug("Positioning nodes based on layout results"),f.nodes.forEach((s)=>{let c=v[s.id];if(c?.domId)c.domId.attr("transform",`translate(${s.x}, ${s.y})`),c.x=s.x,c.y=s.y,L.debug(`Positioned node ${c.id} at center (${s.x}, ${s.y})`)}),f.edges.forEach((s)=>{let c=u.edges.find((i)=>i.id===s.id);if(c)c.points=[{x:s.startX,y:s.startY},{x:s.midX,y:s.midY},{x:s.endX,y:s.endY}]}),L.debug("Inserting and positioning edges"),await Promise.all(u.edges.map(async(s)=>{let c=await o(S,s),i=v[s.start??""],y=v[s.end??""];if(i&&y){let T=f.edges.find((m)=>m.id===s.id);if(T){L.debug("APA01 positionedEdge",T);let m={...s},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}else{let m={...s,points:[{x:i.x||0,y:i.y||0},{x:y.x||0,y:y.y||0}]},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}}})),L.debug("Cose-bilkent rendering completed")},"render"),ct=at;export{ct as render};
@@ -0,0 +1 @@
1
+ import{tr}from"./chunk-xjc5fmcr.js";export{tr as createRailroadServices};
@@ -0,0 +1 @@
1
+ import{g,o,i,r,f,e,n,y,tn,ne}from"./chunk-kahab58k.js";import{Nr,Pr,Or}from"./chunk-f79ajymt.js";var Z={global:"全局",project:"项目",custom:"自定义",builtin:"内置"};function F({skill:s,issue:N,connection:S}){let{Button:E,CopyButton:d,style:v,useTheme:w}=y();w();let[p,L]=r(),[P,x]=r(),[D,z]=r(0);return o(()=>{let c=!0;x(void 0),L(void 0);let m=new URLSearchParams;if(s.projectID)m.set("projectID",s.projectID);if(s.location)m.set("location",s.location);let I=m.toString()?`?${m.toString()}`:"";return Promise.all([S.request(`/api/skills/${encodeURIComponent(s.name)}/content${I}`),S.request(`/api/skills/${encodeURIComponent(s.name)}/files${I}`)]).then(([b,O])=>{if(c)L({text:b.text,files:O.files})}).catch((b)=>{if(c)x(b instanceof Error?b.message:"读取失败")}),()=>{c=!1}},[S,s.name,s.projectID,s.location,D]),n("div",{className:"min-w-0 space-y-5 text-sm text-ink",children:[e("p",{className:"whitespace-pre-wrap break-words [overflow-wrap:anywhere] text-dim",children:s.description||"暂无描述"}),n("div",{children:[n("p",{className:"break-all text-xs text-dim",children:[Z[s.scope],s.projectName?` · ${s.projectName}`:""]}),n("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[e("code",{className:v("markdown.inlineCode","min-w-0 flex-1 break-all text-xs"),children:s.location}),e(d,{text:s.location,label:"复制完整路径",className:"size-10"})]})]}),n("ul",{className:"space-y-1 break-words text-xs text-dim",children:[e("li",{children:"启用状态按名称生效,影响所有同名技能的新会话可用性。"}),s.disableModelInvocation&&e("li",{children:"仅手动:可由用户调用,不向模型自动提供。"}),s.platforms&&n("li",{children:["平台限制:",s.platforms.join("、")]}),s.disabled&&e("li",{children:"已禁用:不会提供给新会话。"}),N?.overriddenBy&&n("li",{className:"break-all",children:["被覆盖:同名技能优先使用 ",N.overriddenBy]})]}),s.commands?.length?n("div",{children:[e("h3",{className:"font-medium",children:"bin 命令"}),e("p",{className:"mt-1 text-xs text-dim",children:"技能目录中的可执行命令。"}),e("ul",{className:"mt-2 space-y-1 font-mono text-xs",children:s.commands.map((c)=>e("li",{className:"break-all",children:c},c))})]}):null,P?n("div",{role:"alert",className:"space-y-2",children:[n("p",{className:"break-words text-danger",children:["读取失败:",P]}),e(E,{className:"h-10",onClick:()=>z(D+1),children:"重试"})]}):!p?e("p",{role:"status",className:"text-dim",children:"正在读取文件…"}):n(f,{children:[n("section",{children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e("h3",{className:"font-medium",children:"SKILL.md 原文"}),e(d,{text:p.text,label:"复制 SKILL.md 原文",className:"size-10"})]}),n("p",{className:"mb-2 text-xs text-faint",children:[p.text.length.toLocaleString()," 字符 · 约 ",Math.ceil(p.text.length/4).toLocaleString()," ","tokens(估算)"]}),e("pre",{className:v("surface.subtle",v("chat.toolOutput"),"rounded-lg bg-raised p-3 text-xs leading-5 break-all"),children:p.text})]}),n("section",{children:[n("h3",{className:"font-medium",children:["目录文件 · ",p.files.length,p.files.length===200?"(最多显示 200 个)":""]}),e("ul",{className:"mt-2 space-y-1 font-mono text-xs text-dim",children:p.files.map((c)=>e("li",{className:"break-all",children:c},c))})]})]})]})}var A="all",G="non-project",ee="size-4 cursor-pointer rounded border-line text-accent accent-accent focus-visible:outline-2 focus-visible:outline-accent";function me({connection:s}){let{Button:N,Select:S,Dialog:E,style:d,useTheme:v}=y();v();let[w,p]=r([]),[L,P]=r([]),[x,D]=r(A),[z,c]=r([]),[m,I]=r(),[b,O]=r(""),[k,B]=r(),[h,T]=r(!0),[K,R]=r(),[W,H]=r(),u=i(0),j=i(!1),C=g(async(t=!1)=>{let l=++u.current;j.current=!0,T(!0);try{if(t)await s.request("/api/skills/rescan",{method:"POST"});let[a,U,q]=await Promise.all([s.request("/api/skills?all=true"),s.request("/api/skills/settings"),s.request("/api/projects")]);if(l!==u.current)return;p(a.skills),P(q),c(a.issues),I(U),H(new Date),R(void 0)}catch(a){if(l===u.current)R(a instanceof Error?a.message:"读取失败")}finally{if(l===u.current)j.current=!1,T(!1)}},[s]);o(()=>(C(),()=>{u.current++}),[C]);async function Q(t){if(j.current)return;j.current=!0;let l=++u.current;T(!0);try{let a=await s.request("/api/skills/settings",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(l!==u.current)return;I(a),await C()}catch(a){if(l!==u.current)return;R(a instanceof Error?a.message:"保存设置失败"),j.current=!1,T(!1)}}let V=b.trim().toLocaleLowerCase(),J=x===A?w:w.filter((t)=>{if(t.scope!=="project")return!0;return x!==G&&t.projectID===x}),M=J.filter((t)=>`${t.name} ${t.description??""}`.toLocaleLowerCase().includes(V)),_=(t)=>z.find((l)=>l.kind==="overridden"&&(l.path==="<built-in>"?t.scope==="builtin":l.path.replace(/\\/g,"/")===`${t.location.replace(/\\/g,"/")}/SKILL.md`));return n("div",{className:"min-w-0 space-y-6",children:[n("section",{className:"min-w-0",children:[n("div",{className:"mb-2.5 flex flex-wrap items-end justify-between gap-3 px-0.5",children:[n("div",{className:"min-w-0 flex-1 basis-48",children:[e("h2",{className:d("settings.groupTitle"),children:"技能"}),e("p",{"aria-live":"polite",className:d("settings.groupDesc"),children:W&&`找到 ${J.length} 个 · ${W.toLocaleTimeString("zh-CN",{hour12:!1})}`})]}),n("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e(S,{value:x,disabled:h,onValueChange:(t)=>{B(void 0),D(t)},groups:[{options:[{value:A,label:"全部来源"},{value:G,label:"非项目技能"}]},...Nr(L)],className:"w-44"}),n(N,{variant:"ghost",disabled:h,onClick:()=>C(!0),className:"h-9 px-2.5 text-xs",children:[e(ne,{className:`size-3.5 ${h?"animate-spin":""}`}),e("span",{className:"ml-1",children:"重新扫描"})]})]})]}),K&&n("div",{role:"alert",className:"mb-3 flex flex-wrap items-center gap-2 rounded-xl border border-line p-3",children:[n("p",{className:"min-w-0 flex-1 break-words text-sm text-danger",children:["无法更新技能:",K]}),e(N,{disabled:h,onClick:()=>C(),children:"重试"})]}),e(Pr,{label:"搜索技能",placeholder:"搜索技能",value:b,onChange:O}),e("div",{className:d("settings.groupBox"),children:h&&!w.length?e(Or,{}):M.length===0?e("p",{className:"p-4 text-sm text-dim",children:"没有找到匹配的技能"}):e("ul",{className:"divide-y divide-line",children:M.map((t)=>{let l=_(t),a=t.disabled;return n("li",{className:`flex min-w-0 items-center justify-between gap-3 px-4 py-2.5 transition-colors hover:bg-raised/40 ${a?"opacity-55":""}`,children:[n("button",{type:"button",className:"group flex min-h-12 min-w-0 flex-1 cursor-pointer items-center gap-3 py-1 text-left focus-visible:outline-2 focus-visible:outline-accent","aria-label":`查看技能 ${t.name}`,onClick:()=>B(t),children:[n("span",{className:"min-w-0 flex-1",children:[n("span",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[e("span",{className:"truncate text-sm font-medium text-ink",title:t.name,children:t.name}),l&&n("span",{className:"flex shrink-0 items-center gap-1 text-xs text-warning",children:[e(tn,{className:"size-3.5"}),"被覆盖"]})]}),t.description&&e("span",{className:"mt-0.5 block truncate text-xs text-dim",title:t.description,children:t.description})]}),e("span",{className:d("control.badge","shrink-0 text-[11px] text-dim"),children:t.scope==="project"?"项目":t.scope==="builtin"?"built-in":"全局"})]}),e("span",{className:"relative flex size-10 shrink-0 items-center justify-center",children:e("input",{type:"checkbox","aria-label":`启用技能 ${t.name}`,className:ee,disabled:h,checked:!a,onChange:(U)=>{if(!m)return;let q=m.disabled??[],X=U.target.checked?q.filter((Y)=>Y!==t.name):[...q,t.name];Q({...m,disabled:X})}})})]},`${t.scope}:${t.projectID??""}:${t.name}`)})})})]}),e(E,{open:Boolean(k),onOpenChange:(t)=>{if(!t)B(void 0)},title:k?.name??"",size:"lg",footer:e("div",{className:"flex w-full justify-end",children:e(N,{variant:"primary",onClick:()=>B(void 0),children:"关闭"})}),children:k&&e(F,{skill:k,issue:_(k),connection:s})})]})}export{me as SkillsSection};