@cyberismo/backend 0.0.24 → 0.0.26

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 (194) hide show
  1. package/dist/app.d.ts +3 -3
  2. package/dist/app.js +58 -29
  3. package/dist/app.js.map +1 -1
  4. package/dist/domain/cards/lib.js +8 -1
  5. package/dist/domain/cards/lib.js.map +1 -1
  6. package/dist/domain/cards/service.js +6 -1
  7. package/dist/domain/cards/service.js.map +1 -1
  8. package/dist/domain/mcp/index.d.ts +8 -2
  9. package/dist/domain/mcp/index.js +68 -65
  10. package/dist/domain/mcp/index.js.map +1 -1
  11. package/dist/domain/projects/index.d.ts +15 -0
  12. package/dist/domain/projects/index.js +35 -0
  13. package/dist/domain/projects/index.js.map +1 -0
  14. package/dist/domain/resources/service.js +2 -2
  15. package/dist/domain/resources/service.js.map +1 -1
  16. package/dist/export.d.ts +7 -3
  17. package/dist/export.js +32 -16
  18. package/dist/export.js.map +1 -1
  19. package/dist/index.d.ts +5 -4
  20. package/dist/index.js +4 -3
  21. package/dist/index.js.map +1 -1
  22. package/dist/main.js +41 -6
  23. package/dist/main.js.map +1 -1
  24. package/dist/middleware/auth.js +10 -0
  25. package/dist/middleware/auth.js.map +1 -1
  26. package/dist/middleware/commandManager.d.ts +12 -0
  27. package/dist/middleware/commandManager.js +33 -7
  28. package/dist/middleware/commandManager.js.map +1 -1
  29. package/dist/project-registry.d.ts +50 -0
  30. package/dist/project-registry.js +77 -0
  31. package/dist/project-registry.js.map +1 -0
  32. package/dist/public/THIRD-PARTY.txt +3482 -4525
  33. package/dist/public/assets/architecture-7EHR7CIX-BhpB9ddF.js +1 -0
  34. package/dist/public/assets/architectureDiagram-3BPJPVTR-BQYiU_EO.js +36 -0
  35. package/dist/public/assets/blockDiagram-GPEHLZMM-DuyikC3X.js +132 -0
  36. package/dist/public/assets/{c4Diagram-AHTNJAMY-CW7AUKhY.js → c4Diagram-AAUBKEIU-BG8_sPEr.js} +6 -6
  37. package/dist/public/assets/channel-BxgB7fMy.js +1 -0
  38. package/dist/public/assets/chunk-2J33WTMH-vNq8B1aw.js +1 -0
  39. package/dist/public/assets/chunk-4BX2VUAB-DFDBsmSo.js +1 -0
  40. package/dist/public/assets/chunk-55IACEB6-DCVUQPWM.js +1 -0
  41. package/dist/public/assets/chunk-727SXJPM-C5ihZMyl.js +206 -0
  42. package/dist/public/assets/chunk-AQP2D5EJ-XGOtp2xP.js +231 -0
  43. package/dist/public/assets/{chunk-FMBD7UC4-DChB7ne2.js → chunk-FMBD7UC4-Da1lR6Mn.js} +1 -1
  44. package/dist/public/assets/chunk-ND2GUHAM-ZOvpvr6K.js +1 -0
  45. package/dist/public/assets/chunk-QZHKN3VN-D33jzvFT.js +1 -0
  46. package/dist/public/assets/classDiagram-4FO5ZUOK-hWfZv7hZ.js +1 -0
  47. package/dist/public/assets/classDiagram-v2-Q7XG4LA2-hWfZv7hZ.js +1 -0
  48. package/dist/public/assets/cose-bilkent-S5V4N54A-DO4z-ix4.js +1 -0
  49. package/dist/public/assets/{cytoscape.esm-DpmcErfs.js → cytoscape.esm-C8YCVR3_.js} +3 -3
  50. package/dist/public/assets/dagre-BM42HDAG-DlpRfzgA.js +4 -0
  51. package/dist/public/assets/dagre-Bx709z4p.js +1 -0
  52. package/dist/public/assets/diagram-2AECGRRQ-D-t_ImBP.js +43 -0
  53. package/dist/public/assets/diagram-5GNKFQAL-CBgUMlXz.js +10 -0
  54. package/dist/public/assets/diagram-KO2AKTUF-XoB2TgQt.js +3 -0
  55. package/dist/public/assets/diagram-LMA3HP47-D1Sbl_eS.js +24 -0
  56. package/dist/public/assets/diagram-OG6HWLK6-DKP4aiIY.js +24 -0
  57. package/dist/public/assets/erDiagram-TEJ5UH35-DYxfHOOK.js +85 -0
  58. package/dist/public/assets/eventmodeling-FCH6USID-cF_1Mq4g.js +1 -0
  59. package/dist/public/assets/flowDiagram-I6XJVG4X-BDHPsmlq.js +162 -0
  60. package/dist/public/assets/ganttDiagram-6RSMTGT7-bGgIvBPN.js +292 -0
  61. package/dist/public/assets/gitGraph-WXDBUCRP-DOFshjLy.js +1 -0
  62. package/dist/public/assets/gitGraphDiagram-PVQCEYII-xSwLjGd-.js +106 -0
  63. package/dist/public/assets/graphlib-B8gBHxth.js +1 -0
  64. package/dist/public/assets/index-DGPv1qic.js +1028 -0
  65. package/dist/public/assets/index-DvHiopvR.css +1 -0
  66. package/dist/public/assets/info-J43DQDTF-BuJNK7zQ.js +1 -0
  67. package/dist/public/assets/infoDiagram-5YYISTIA-BanxuIib.js +2 -0
  68. package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-B3HoSFaq.js → ishikawaDiagram-YF4QCWOH-DWNWYxz5.js} +6 -6
  69. package/dist/public/assets/{journeyDiagram-VCZTEJTY-kH30WNF3.js → journeyDiagram-JHISSGLW-I58P5XNg.js} +6 -6
  70. package/dist/public/assets/kanban-definition-UN3LZRKU-CMRWbDti.js +89 -0
  71. package/dist/public/assets/mermaid-parser.core-Dz__fM3g.js +161 -0
  72. package/dist/public/assets/{mindmap-definition-QFDTVHPH-CNWWI4MF.js → mindmap-definition-RKZ34NQL-C47gCcpC.js} +29 -29
  73. package/dist/public/assets/packet-YPE3B663-Cczitw2-.js +1 -0
  74. package/dist/public/assets/pie-LRSECV5Y-rO-Aqx6h.js +1 -0
  75. package/dist/public/assets/pieDiagram-4H26LBE5-VZAxHzjD.js +30 -0
  76. package/dist/public/assets/quadrantDiagram-W4KKPZXB-BY8JORvE.js +7 -0
  77. package/dist/public/assets/radar-GUYGQ44K-SSIGuQjW.js +1 -0
  78. package/dist/public/assets/requirementDiagram-4Y6WPE33-XhNBeFwj.js +84 -0
  79. package/dist/public/assets/sankeyDiagram-5OEKKPKP-H7I2OESy.js +40 -0
  80. package/dist/public/assets/sequenceDiagram-3UESZ5HK-jnTLwq-X.js +162 -0
  81. package/dist/public/assets/stateDiagram-AJRCARHV-BKcf2bdX.js +1 -0
  82. package/dist/public/assets/stateDiagram-v2-BHNVJYJU-wpO0gnsG.js +1 -0
  83. package/dist/public/assets/{timeline-definition-GMOUNBTQ-9MnBod43.js → timeline-definition-PNZ67QCA-BZbaBDRH.js} +8 -8
  84. package/dist/public/assets/treeView-BLDUP644-DkGx4HkR.js +1 -0
  85. package/dist/public/assets/treemap-LRROVOQU-yCyuONQh.js +1 -0
  86. package/dist/public/assets/vennDiagram-CIIHVFJN-nY9Pep3o.js +34 -0
  87. package/dist/public/assets/wardley-L42UT6IY-CXWWFUgk.js +1 -0
  88. package/dist/public/assets/wardleyDiagram-YWT4CUSO-CM0yrkHd.js +78 -0
  89. package/dist/public/assets/{xychartDiagram-5P7HB3ND-BcqyvmmW.js → xychartDiagram-2RQKCTM6-1ZAtqvyQ.js} +6 -6
  90. package/dist/public/config.json +1 -0
  91. package/dist/public/index.html +2 -31
  92. package/package.json +9 -5
  93. package/src/app.ts +71 -31
  94. package/src/domain/cards/lib.ts +13 -1
  95. package/src/domain/cards/service.ts +11 -1
  96. package/src/domain/mcp/index.ts +83 -78
  97. package/src/domain/projects/index.ts +39 -0
  98. package/src/domain/resources/service.ts +2 -0
  99. package/src/export.ts +44 -21
  100. package/src/index.ts +6 -5
  101. package/src/main.ts +46 -6
  102. package/src/middleware/auth.ts +10 -0
  103. package/src/middleware/commandManager.ts +47 -9
  104. package/src/project-registry.ts +110 -0
  105. package/dist/public/assets/arc-DFTvTCxD.js +0 -1
  106. package/dist/public/assets/architecture-YZFGNWBL-DsWVZJri.js +0 -1
  107. package/dist/public/assets/architectureDiagram-Q4EWVU46-AN0fWZIG.js +0 -36
  108. package/dist/public/assets/array-xS8TccZC.js +0 -1
  109. package/dist/public/assets/blockDiagram-DXYQGD6D-RrIidZT3.js +0 -132
  110. package/dist/public/assets/channel-BxffgrNT.js +0 -1
  111. package/dist/public/assets/chunk-2KRD3SAO-D5XH6bj9.js +0 -1
  112. package/dist/public/assets/chunk-336JU56O-CVDEj5x8.js +0 -2
  113. package/dist/public/assets/chunk-426QAEUC-CIWkCWTf.js +0 -1
  114. package/dist/public/assets/chunk-4BX2VUAB-O8dxzEpn.js +0 -1
  115. package/dist/public/assets/chunk-4TB4RGXK-Bt4fWDlh.js +0 -206
  116. package/dist/public/assets/chunk-55IACEB6-R-yr7oHq.js +0 -1
  117. package/dist/public/assets/chunk-5FUZZQ4R-D7L4hZzZ.js +0 -62
  118. package/dist/public/assets/chunk-5PVQY5BW-D46cRkay.js +0 -2
  119. package/dist/public/assets/chunk-67CJDMHE-1fLguPDq.js +0 -1
  120. package/dist/public/assets/chunk-7N4EOEYR-BPbEiVZr.js +0 -1
  121. package/dist/public/assets/chunk-AA7GKIK3-DZOqN73n.js +0 -1
  122. package/dist/public/assets/chunk-BSJP7CBP-BQPMRa-Q.js +0 -1
  123. package/dist/public/assets/chunk-CFjPhJqf.js +0 -1
  124. package/dist/public/assets/chunk-CIAEETIT-CoKBG93U.js +0 -1
  125. package/dist/public/assets/chunk-EDXVE4YY-BxmMvdBY.js +0 -1
  126. package/dist/public/assets/chunk-ENJZ2VHE-BrjxYY_T.js +0 -10
  127. package/dist/public/assets/chunk-FOC6F5B3-DyK4SoM2.js +0 -1
  128. package/dist/public/assets/chunk-ICPOFSXX-6-ABzkfw.js +0 -122
  129. package/dist/public/assets/chunk-K5T4RW27-432kjUXO.js +0 -94
  130. package/dist/public/assets/chunk-KGLVRYIC-ChpiuJys.js +0 -1
  131. package/dist/public/assets/chunk-LIHQZDEY-C65uflEj.js +0 -1
  132. package/dist/public/assets/chunk-ORNJ4GCN-DPvOqXKg.js +0 -1
  133. package/dist/public/assets/chunk-OYMX7WX6-BecMUsrL.js +0 -231
  134. package/dist/public/assets/chunk-QZHKN3VN-d1i_Lm1t.js +0 -1
  135. package/dist/public/assets/chunk-U2HBQHQK-C6yvwOAo.js +0 -70
  136. package/dist/public/assets/chunk-X2U36JSP-D1C3tOED.js +0 -1
  137. package/dist/public/assets/chunk-XPW4576I-BH37LuuF.js +0 -32
  138. package/dist/public/assets/chunk-YZCP3GAM-D83gHdmx.js +0 -1
  139. package/dist/public/assets/chunk-ZZ45TVLE-DrCjtkdu.js +0 -1
  140. package/dist/public/assets/classDiagram-6PBFFD2Q-CRYacdjd.js +0 -1
  141. package/dist/public/assets/classDiagram-v2-HSJHXN6E-qOJXC_A9.js +0 -1
  142. package/dist/public/assets/clone-Bno0nirE.js +0 -1
  143. package/dist/public/assets/colors-DZGTowqM.js +0 -1
  144. package/dist/public/assets/cose-bilkent-S5V4N54A-BdSMsFO7.js +0 -1
  145. package/dist/public/assets/dagre-D0KOcyEK.js +0 -1
  146. package/dist/public/assets/dagre-KV5264BT-C_l1Bck_.js +0 -4
  147. package/dist/public/assets/defaultLocale-B6dPnyNg.js +0 -1
  148. package/dist/public/assets/diagram-5BDNPKRD-D6FxiIv1.js +0 -10
  149. package/dist/public/assets/diagram-G4DWMVQ6-COGBv7tQ.js +0 -24
  150. package/dist/public/assets/diagram-MMDJMWI5-U6E9w334.js +0 -43
  151. package/dist/public/assets/diagram-TYMM5635-Tvfdnlo4.js +0 -24
  152. package/dist/public/assets/dist-C6vvxvVV.js +0 -1
  153. package/dist/public/assets/erDiagram-SMLLAGMA-VcPXkmy9.js +0 -85
  154. package/dist/public/assets/flatten-BKeNCJRx.js +0 -1
  155. package/dist/public/assets/flowDiagram-DWJPFMVM-PRQdlypB.js +0 -162
  156. package/dist/public/assets/ganttDiagram-T4ZO3ILL-CSVaTciZ.js +0 -292
  157. package/dist/public/assets/gitGraph-7Q5UKJZL-C6GVmHC4.js +0 -1
  158. package/dist/public/assets/gitGraphDiagram-UUTBAWPF-DMa-Gcy1.js +0 -106
  159. package/dist/public/assets/graphlib-BYojtb6k.js +0 -1
  160. package/dist/public/assets/identity-nF-8qK2-.js +0 -1
  161. package/dist/public/assets/index-oVbUFngg.js +0 -737
  162. package/dist/public/assets/index-ypsafPwV.css +0 -1
  163. package/dist/public/assets/info-OMHHGYJF-CjsmQeYR.js +0 -1
  164. package/dist/public/assets/infoDiagram-42DDH7IO-COL_Na4w.js +0 -2
  165. package/dist/public/assets/init-B9nbfZCT.js +0 -1
  166. package/dist/public/assets/isEmpty-Di-NpihJ.js +0 -1
  167. package/dist/public/assets/kanban-definition-6JOO6SKY-RdjEsejt.js +0 -89
  168. package/dist/public/assets/line-DrKJYWGi.js +0 -1
  169. package/dist/public/assets/linear-C8MDrvxz.js +0 -1
  170. package/dist/public/assets/mermaid-parser.core-BeZK8g2G.js +0 -4
  171. package/dist/public/assets/ordinal-BXaEVJbT.js +0 -1
  172. package/dist/public/assets/packet-4T2RLAQJ-Dq0Z9G3r.js +0 -1
  173. package/dist/public/assets/path-C7Bv0Qdk.js +0 -1
  174. package/dist/public/assets/pie-ZZUOXDRM-Coeb8Atk.js +0 -1
  175. package/dist/public/assets/pieDiagram-DEJITSTG-CrDW-30P.js +0 -30
  176. package/dist/public/assets/quadrantDiagram-34T5L4WZ-BoDA5WQ-.js +0 -7
  177. package/dist/public/assets/radar-PYXPWWZC-BF2NN2TG.js +0 -1
  178. package/dist/public/assets/range-DuD7Go1R.js +0 -1
  179. package/dist/public/assets/reduce-5tLTMRkg.js +0 -1
  180. package/dist/public/assets/requirementDiagram-MS252O5E-BnG7epLH.js +0 -84
  181. package/dist/public/assets/rough.esm-DE7XMpOC.js +0 -1
  182. package/dist/public/assets/sankeyDiagram-XADWPNL6-oyTFoxhB.js +0 -10
  183. package/dist/public/assets/sequenceDiagram-FGHM5R23-hwG2jT_2.js +0 -157
  184. package/dist/public/assets/src-ps-3oTnY.js +0 -1
  185. package/dist/public/assets/stateDiagram-FHFEXIEX-BiYqw63j.js +0 -1
  186. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-CggSrcDh.js +0 -1
  187. package/dist/public/assets/time-Bgnk7ODM.js +0 -1
  188. package/dist/public/assets/treeView-SZITEDCU-IRdgIoRV.js +0 -1
  189. package/dist/public/assets/treemap-DK8fitek.js +0 -1
  190. package/dist/public/assets/treemap-W4RFUUIX-C-JBwyWW.js +0 -1
  191. package/dist/public/assets/vennDiagram-DHZGUBPP-sEA6JNL-.js +0 -34
  192. package/dist/public/assets/wardley-RL74JXVD-DdU04Q7E.js +0 -1
  193. package/dist/public/assets/wardleyDiagram-NUSXRM2D-Dws321pY.js +0 -20
  194. /package/dist/public/assets/{katex-Bfn1OZEl.js → katex-C4eR7coU.js} +0 -0
@@ -1,7 +1,7 @@
1
- import{B as e,C as t,E as n,L as r,V as i,W as a,_ as o,a as s,c,d as l,v as u,y as d}from"./chunk-ICPOFSXX-6-ABzkfw.js";import{_ as f,v as p}from"./src-ps-3oTnY.js";import{t as m}from"./linear-C8MDrvxz.js";import{n as h}from"./ordinal-BXaEVJbT.js";import{t as g}from"./range-DuD7Go1R.js";import{n as _}from"./init-B9nbfZCT.js";import{r as v}from"./chunk-5PVQY5BW-D46cRkay.js";import{t as y}from"./line-DrKJYWGi.js";import{t as b}from"./chunk-426QAEUC-CIWkCWTf.js";import{t as x}from"./chunk-U2HBQHQK-C6yvwOAo.js";function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=g(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},_.apply(d(),arguments)}var C=(function(){var e=f(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],a=[1,6],o=[1,7],s=[1,5,10,12,14,16,18,19,21,23,34,35,36],c=[1,25],l=[1,26],u=[1,28],d=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],D=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],O=[1,64],k={trace:f(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,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$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`,27:`NUMBER_WITH_DECIMAL`,28:`COMMA`,31:`ARROW_DELIMITER`,34:`NEWLINE`,35:`SEMI`,36:`EOF`,38:`STR`,39:`MD_STR`,41:`AMP`,42:`NUM`,43:`ALPHA`,44:`PLUS`,45:`EQUALS`,46:`MULT`,47:`DOT`,48:`BRKT`,49:`MINUS`,50:`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],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:f(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:`text`,text:``});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 27:this.$=a[s-1];break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:`text`,text:``});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:this.$={text:a[s],type:`text`};break;case 38:this.$={text:a[s],type:`text`};break;case 39:this.$={text:a[s],type:`markdown`};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(t,n,{3:1,4:2,7:4,5:r,34:i,35:a,36:o}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:r,34:i,35:a,36:o}),e(t,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],34:i,35:a,36:o}),{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(s,[2,34]),e(s,[2,35]),e(s,[2,36]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:r,34:i,35:a,36:o}),{1:[2,3]},e(s,[2,5]),e(t,[2,7],{4:22,34:i,35:a,36:o}),{11:23,37:24,38:c,39:l,40:27,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:39,13:38,24:x,27:S,29:40,30:41,37:24,38:c,39:l,40:27,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:45,15:44,27:C,33:46,37:24,38:c,39:l,40:27,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:49,17:48,24:w,37:24,38:c,39:l,40:27,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:52,17:51,24:w,37:24,38:c,39:l,40:27,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,37],{40:55,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b}),e(E,[2,38]),e(E,[2,39]),e(D,[2,40]),e(D,[2,42]),e(D,[2,43]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:S}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:c,39:l,40:27,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:C}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:O},e(T,[2,14]),{17:65,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:c,39:l,40:27,41:u,42:d,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:O},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:f(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:f(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,p=1,m=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}f(b,`popStack`);function x(){var e=r.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}f(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>d&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(c+1)+`:
1
+ import{$t as e,An as t,Gt as n,Lt as r,Rt as i,Xt as a,_ as o,_n as s,cn as c,gn as l,gt as u,hn as d,in as f,jn as p,k as m,mt as h,nn as g,on as _,rn as v,tn as y,yn as b,zt as x}from"./index-DGPv1qic.js";function S(){var e=i().unknown(void 0),t=e.domain,r=e.range,a=0,o=1,s,c,l=!1,u=0,d=0,f=.5;delete e.unknown;function p(){var e=t().length,i=o<a,p=i?o:a,m=i?a:o;s=(m-p)/Math.max(1,e-u+d*2),l&&(s=Math.floor(s)),p+=(m-p-s*(e-u))*f,c=s*(1-u),l&&(p=Math.round(p),c=Math.round(c));var h=n(e).map(function(e){return p+s*e});return r(i?h.reverse():h)}return e.domain=function(e){return arguments.length?(t(e),p()):t()},e.range=function(e){return arguments.length?([a,o]=e,a=+a,o=+o,p()):[a,o]},e.rangeRound=function(e){return[a,o]=e,a=+a,o=+o,l=!0,p()},e.bandwidth=function(){return c},e.step=function(){return s},e.round=function(e){return arguments.length?(l=!!e,p()):l},e.padding=function(e){return arguments.length?(u=Math.min(1,d=+e),p()):u},e.paddingInner=function(e){return arguments.length?(u=Math.min(1,e),p()):u},e.paddingOuter=function(e){return arguments.length?(d=+e,p()):d},e.align=function(e){return arguments.length?(f=Math.max(0,Math.min(1,e)),p()):f},e.copy=function(){return S(t(),[a,o]).round(l).paddingInner(u).paddingOuter(d).align(f)},x.apply(p(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],D=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],O=[1,64],k={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,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$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`,27:`NUMBER_WITH_DECIMAL`,28:`COMMA`,31:`ARROW_DELIMITER`,34:`NEWLINE`,35:`SEMI`,36:`EOF`,38:`STR`,39:`MD_STR`,41:`AMP`,42:`NUM`,43:`ALPHA`,44:`PLUS`,45:`EQUALS`,46:`MULT`,47:`DOT`,48:`BRKT`,49:`MINUS`,50:`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],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:`text`,text:``});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 27:this.$=a[s-1];break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:`text`,text:``});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:this.$={text:a[s],type:`text`};break;case 38:this.$={text:a[s],type:`text`};break;case 39:this.$={text:a[s],type:`markdown`};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,34:a,35:o,36:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,34:a,35:o,36:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],34:a,35:o,36:s}),{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(c,[2,34]),e(c,[2,35]),e(c,[2,36]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,34:a,35:o,36:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,34:a,35:o,36:s}),{11:23,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:39,13:38,24:x,27:S,29:40,30:41,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:45,15:44,27:C,33:46,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:49,17:48,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:52,17:51,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,37],{40:55,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b}),e(E,[2,38]),e(E,[2,39]),e(D,[2,40]),e(D,[2,42]),e(D,[2,43]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:S}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:C}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:O},e(T,[2,14]),{17:65,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:O},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
- Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(l=h.yyleng,s=h.yytext,c=h.yylineno,v=h.yylloc,u>0&&u--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,g.yy,T[1],i,a].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};k.lexer=(function(){return{EOF:1,parseError:f(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:f(function(e,t){return this.yy=t||this.yy||{},this._input=e,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]),this.offset=0,this},`setInput`),input:f(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:f(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);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 i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:f(function(){return this._more=!0,this},`more`),reject:f(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
- `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:f(function(e){this.unput(this.match.slice(e))},`less`),pastInput:f(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:f(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:f(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
- `+t+`^`},`showPosition`),test_match:f(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(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))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:f(function(){return this.next()||this.lex()},`lex`),begin:f(function(e){this.conditionStack.push(e)},`begin`),popState:f(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:f(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:f(function(e){this.begin(e)},`pushState`),stateStackSize:f(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:f(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;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`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 31;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 27;case 25:return this.popState(),26;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 43;case 33:return`COLON`;case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},`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}}}})();function A(){this.yy={}}return f(A,`Parser`),A.prototype=k,k.Parser=A,new A})();C.parser=C;var w=C;function T(e){return e.type===`bar`}f(T,`isBarPlot`);function E(e){return e.type===`band`}f(E,`isBandAxisData`);function D(e){return e.type===`linear`}f(D,`isLinearAxisData`);var O=class{constructor(e){this.parentGroup=e}static{f(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=x(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},k=.7,A=.2,j=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,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.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`}static{f(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]: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(){k*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(k*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${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(e=>({text:e.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(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return 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`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return 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`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=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},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),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`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return 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`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},M=class extends j{static{f(this,`BandAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=S().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=S().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),p.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ee=class extends j{static{f(this,`LinearAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=m().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=m().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function N(e,t,n,r){let i=new O(r);return E(e)?new M(t,n,e.categories,e.title,i):new ee(t,n,[e.min,e.max],e.title,i)}f(N,`getAxis`);var te=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{f(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return 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}]}),e}};function ne(e,t,n,r){return new te(new O(r),e,t,n)}f(ne,`getChartTitleComponent`);var re=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{f(this,`LinePlot`)}getDrawableElement(){let e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t;return t=this.orientation===`horizontal`?y().y(e=>e[0]).x(e=>e[1])(e):y().x(e=>e[0]).y(e=>e[1])(e),t?[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},ie=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{f(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ae=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{f(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}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[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new re(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new ie(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break}return e}};function P(e,t,n){return new ae(e,t,n)}f(P,`getPlotComponent`);var oe=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:ne(e,t,n,r),plot:P(e,t,n),xAxis:N(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:N(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{f(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition(`bottom`),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition(`left`),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`left`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition(`top`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},se=class{static{f(this,`XYChartBuilder`)}static build(e,t,n,r){return new oe(e,t,n,r).getDrawableElement()}},F=0,I,L=W(),R=U(),z=G(),B=R.plotColorPalette.split(`,`).map(e=>e.trim()),V=!1,H=!1;function U(){let e=n(),t=d();return v(e.xyChart,t.themeVariables.xyChart)}f(U,`getChartDefaultThemeConfig`);function W(){let e=d();return v(l.xyChart,e.xyChart)}f(W,`getChartDefaultConfig`);function G(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}f(G,`getChartDefaultData`);function K(e){let t=d();return r(e.trim(),t)}f(K,`textSanitizer`);function q(e){I=e}f(q,`setTmpSVGG`);function J(e){e===`horizontal`?L.chartOrientation=`horizontal`:L.chartOrientation=`vertical`}f(J,`setOrientation`);function Y(e){z.xAxis.title=K(e.text)}f(Y,`setXAxisTitle`);function X(e,t){z.xAxis={type:`linear`,title:z.xAxis.title,min:e,max:t},V=!0}f(X,`setXAxisRangeData`);function ce(e){z.xAxis={type:`band`,title:z.xAxis.title,categories:e.map(e=>K(e.text))},V=!0}f(ce,`setXAxisBand`);function le(e){z.yAxis.title=K(e.text)}f(le,`setYAxisTitle`);function ue(e,t){z.yAxis={type:`linear`,title:z.yAxis.title,min:e,max:t},H=!0}f(ue,`setYAxisRangeData`);function de(e){let t=Math.min(...e),n=Math.max(...e),r=D(z.yAxis)?z.yAxis.min:1/0,i=D(z.yAxis)?z.yAxis.max:-1/0;z.yAxis={type:`linear`,title:z.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}f(de,`setYAxisRangeFromPlotData`);function Z(e){let t=[];if(e.length===0)return t;if(!V){let t=D(z.xAxis)?z.xAxis.min:1/0,n=D(z.xAxis)?z.xAxis.max:-1/0;X(Math.min(t,1),Math.max(n,e.length))}if(H||de(e),E(z.xAxis)&&(t=z.xAxis.categories.map((t,n)=>[t,e[n]])),D(z.xAxis)){let n=z.xAxis.min,r=z.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}f(Z,`transformDataWithoutCategory`);function Q(e){return B[e===0?0:e%B.length]}f(Q,`getPlotColorFromPalette`);function fe(e,t){let n=Z(t);z.plots.push({type:`line`,strokeFill:Q(F),strokeWidth:2,data:n}),F++}f(fe,`setLineData`);function pe(e,t){let n=Z(t);z.plots.push({type:`bar`,fill:Q(F),data:n}),F++}f(pe,`setBarData`);function me(){if(z.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return z.title=t(),se.build(L,z,R,I)}f(me,`getDrawableElem`);function he(){return R}f(he,`getChartThemeConfig`);function ge(){return L}f(ge,`getChartConfig`);function $(){return z}f($,`getXYChartData`);var _e={parser:w,db:{getDrawableElem:me,clear:f(function(){s(),F=0,L=W(),z=G(),R=U(),B=R.plotColorPalette.split(`,`).map(e=>e.trim()),V=!1,H=!1},`clear`),setAccTitle:i,getAccTitle:u,setDiagramTitle:a,getDiagramTitle:t,getAccDescription:o,setAccDescription:e,setOrientation:J,setXAxisTitle:Y,setXAxisRangeData:X,setXAxisBand:ce,setYAxisTitle:le,setYAxisRangeData:ue,setLineData:fe,setBarData:pe,setTmpSVGG:q,getChartThemeConfig:he,getChartConfig:ge,getXYChartData:$},renderer:{draw:f((e,t,n,r)=>{let i=r.db,a=i.getChartThemeConfig(),o=i.getChartConfig(),s=i.getXYChartData().plots[0].data.map(e=>e[1]);function l(e){return e===`top`?`text-before-edge`:`middle`}f(l,`getDominantBaseLine`);function u(e){return e===`left`?`start`:e===`right`?`end`:`middle`}f(u,`getTextAnchor`);function d(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}f(d,`getTextTransformation`),p.debug(`Rendering xychart chart
7
- `+e);let m=b(t),h=m.append(`g`).attr(`class`,`main`),g=h.append(`rect`).attr(`width`,o.width).attr(`height`,o.height).attr(`class`,`background`);c(m,o.height,o.width,!0),m.attr(`viewBox`,`0 0 ${o.width} ${o.height}`),g.attr(`fill`,a.backgroundColor),i.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let _=i.getDrawableElem(),v={};function y(e){let t=h,n=``;for(let[r]of e.entries()){let i=h;r>0&&v[n]&&(i=v[n]),n+=e[r],t=v[n],t||=v[n]=i.append(`g`).attr(`class`,e[r])}return t}f(y,`getGroup`);for(let e of _){if(e.data.length===0)continue;let t=y(e.groupTexts);switch(e.type){case`rect`:if(t.selectAll(`rect`).data(e.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),o.showDataLabel){let n=o.showDataLabelOutsideBar;if(o.chartOrientation===`horizontal`){let r=function(e,t){let{data:n,label:r}=e;return t*r.length*i<=n.width-o};f(r,`fitsHorizontally`);let i=.7,o=10,c=e.data.map((e,t)=>({data:e,label:s[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),l=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!r(e,n)&&n>0;)--n;return n}),u=Math.floor(Math.min(...l)),d=f(e=>n?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);t.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,d).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,n?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,a.dataLabelColor).attr(`font-size`,`${u}px`).text(e=>e.label)}else{let r=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};f(r,`fitsInBar`);let i=e.data.map((e,t)=>({data:e,label:s[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=i.map(e=>{let{data:t,label:n}=e,i=t.width/(n.length*.7);for(;!r(e,i,10)&&i>0;)--i;return i}),c=Math.floor(Math.min(...o)),l=f(e=>n?e.data.y-10:e.data.y+10,`determineLabelYPosition`);t.selectAll(`text`).data(i).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,l).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,n?`auto`:`hanging`).attr(`fill`,a.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:t.selectAll(`text`).data(e.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>l(e.verticalPos)).attr(`text-anchor`,e=>u(e.horizontalPos)).attr(`transform`,e=>d(e)).text(e=>e.text);break;case`path`:t.selectAll(`path`).data(e.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth);break}}},`draw`)}};export{_e as diagram};
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};k.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,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]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);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 i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(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))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;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`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 31;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 27;case 25:return this.popState(),26;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 43;case 33:return`COLON`;case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},`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}}}})();function A(){this.yy={}}return t(A,`Parser`),A.prototype=k,k.Parser=A,new A})();C.parser=C;var w=C;function T(e){return e.type===`bar`}t(T,`isBarPlot`);function E(e){return e.type===`band`}t(E,`isBandAxisData`);function D(e){return e.type===`linear`}t(D,`isLinearAxisData`);var O=class{constructor(e){this.parentGroup=e}static{t(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=o(r,1,i),a=e?e.width:i.length*t,s=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,s)}return r.remove(),n}},k=.7,A=.2,j=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,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.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`}static{t(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]: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(){k*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(k*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${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(e=>({text:e.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(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return 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`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return 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`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=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},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),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`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return 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`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},M=class extends j{static{t(this,`BandAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=S().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=S().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),p.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ee=class extends j{static{t(this,`LinearAxis`)}constructor(e,t,n,i,a){super(e,i,a,t),this.domain=n,this.scale=r().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=r().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function N(e,t,n,r){let i=new O(r);return E(e)?new M(t,n,e.categories,e.title,i):new ee(t,n,[e.min,e.max],e.title,i)}t(N,`getAxis`);var te=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,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 t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return 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}]}),e}};function ne(e,t,n,r){return new te(new O(r),e,t,n)}t(ne,`getChartTitleComponent`);var re=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{t(this,`LinePlot`)}getDrawableElement(){let e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t;return t=this.orientation===`horizontal`?u().y(e=>e[0]).x(e=>e[1])(e):u().x(e=>e[0]).y(e=>e[1])(e),t?[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},ie=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{t(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ae=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}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[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new re(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new ie(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break}return e}};function P(e,t,n){return new ae(e,t,n)}t(P,`getPlotComponent`);var oe=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:ne(e,t,n,r),plot:P(e,t,n),xAxis:N(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:N(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{t(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition(`bottom`),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition(`left`),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`left`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition(`top`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},se=class{static{t(this,`XYChartBuilder`)}static build(e,t,n,r){return new oe(e,t,n,r).getDrawableElement()}},F=0,I,L=W(),R=U(),z=G(),B=R.plotColorPalette.split(`,`).map(e=>e.trim()),V=!1,H=!1;function U(){let e=c(),t=f();return m(e.xyChart,t.themeVariables.xyChart)}t(U,`getChartDefaultThemeConfig`);function W(){let e=f();return m(y.xyChart,e.xyChart)}t(W,`getChartDefaultConfig`);function G(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}t(G,`getChartDefaultData`);function K(e){let t=f();return d(e.trim(),t)}t(K,`textSanitizer`);function q(e){I=e}t(q,`setTmpSVGG`);function J(e){e===`horizontal`?L.chartOrientation=`horizontal`:L.chartOrientation=`vertical`}t(J,`setOrientation`);function Y(e){z.xAxis.title=K(e.text)}t(Y,`setXAxisTitle`);function X(e,t){z.xAxis={type:`linear`,title:z.xAxis.title,min:e,max:t},V=!0}t(X,`setXAxisRangeData`);function ce(e){z.xAxis={type:`band`,title:z.xAxis.title,categories:e.map(e=>K(e.text))},V=!0}t(ce,`setXAxisBand`);function le(e){z.yAxis.title=K(e.text)}t(le,`setYAxisTitle`);function ue(e,t){z.yAxis={type:`linear`,title:z.yAxis.title,min:e,max:t},H=!0}t(ue,`setYAxisRangeData`);function de(e){let t=Math.min(...e),n=Math.max(...e),r=D(z.yAxis)?z.yAxis.min:1/0,i=D(z.yAxis)?z.yAxis.max:-1/0;z.yAxis={type:`linear`,title:z.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}t(de,`setYAxisRangeFromPlotData`);function Z(e){let t=[];if(e.length===0)return t;if(!V){let t=D(z.xAxis)?z.xAxis.min:1/0,n=D(z.xAxis)?z.xAxis.max:-1/0;X(Math.min(t,1),Math.max(n,e.length))}if(H||de(e),E(z.xAxis)&&(t=z.xAxis.categories.map((t,n)=>[t,e[n]])),D(z.xAxis)){let n=z.xAxis.min,r=z.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}t(Z,`transformDataWithoutCategory`);function Q(e){return B[e===0?0:e%B.length]}t(Q,`getPlotColorFromPalette`);function fe(e,t){let n=Z(t);z.plots.push({type:`line`,strokeFill:Q(F),strokeWidth:2,data:n}),F++}t(fe,`setLineData`);function pe(e,t){let n=Z(t);z.plots.push({type:`bar`,fill:Q(F),data:n}),F++}t(pe,`setBarData`);function me(){if(z.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return z.title=_(),se.build(L,z,R,I)}t(me,`getDrawableElem`);function he(){return R}t(he,`getChartThemeConfig`);function ge(){return L}t(ge,`getChartConfig`);function $(){return z}t($,`getXYChartData`);var _e={parser:w,db:{getDrawableElem:me,clear:t(function(){a(),F=0,L=W(),z=G(),R=U(),B=R.plotColorPalette.split(`,`).map(e=>e.trim()),V=!1,H=!1},`clear`),setAccTitle:s,getAccTitle:v,setDiagramTitle:b,getDiagramTitle:_,getAccDescription:g,setAccDescription:l,setOrientation:J,setXAxisTitle:Y,setXAxisRangeData:X,setXAxisBand:ce,setYAxisTitle:le,setYAxisRangeData:ue,setLineData:fe,setBarData:pe,setTmpSVGG:q,getChartThemeConfig:he,getChartConfig:ge,getXYChartData:$},renderer:{draw:t((n,r,i,a)=>{let o=a.db,s=o.getChartThemeConfig(),c=o.getChartConfig(),l=o.getXYChartData().plots[0].data.map(e=>e[1]);function u(e){return e===`top`?`text-before-edge`:`middle`}t(u,`getDominantBaseLine`);function d(e){return e===`left`?`start`:e===`right`?`end`:`middle`}t(d,`getTextAnchor`);function f(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}t(f,`getTextTransformation`),p.debug(`Rendering xychart chart
7
+ `+n);let m=h(r),g=m.append(`g`).attr(`class`,`main`),_=g.append(`rect`).attr(`width`,c.width).attr(`height`,c.height).attr(`class`,`background`);e(m,c.height,c.width,!0),m.attr(`viewBox`,`0 0 ${c.width} ${c.height}`),_.attr(`fill`,s.backgroundColor),o.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let v=o.getDrawableElem(),y={};function b(e){let t=g,n=``;for(let[r]of e.entries()){let i=g;r>0&&y[n]&&(i=y[n]),n+=e[r],t=y[n],t||=y[n]=i.append(`g`).attr(`class`,e[r])}return t}t(b,`getGroup`);for(let e of v){if(e.data.length===0)continue;let n=b(e.groupTexts);switch(e.type){case`rect`:if(n.selectAll(`rect`).data(e.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),c.showDataLabel){let r=c.showDataLabelOutsideBar;if(c.chartOrientation===`horizontal`){let i=function(e,t){let{data:n,label:r}=e;return t*r.length*a<=n.width-o};t(i,`fitsHorizontally`);let a=.7,o=10,c=e.data.map((e,t)=>({data:e,label:l[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),u=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!i(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...u)),f=t(e=>r?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);n.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,r?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let i=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};t(i,`fitsInBar`);let a=e.data.map((e,t)=>({data:e,label:l[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=a.map(e=>{let{data:t,label:n}=e,r=t.width/(n.length*.7);for(;!i(e,r,10)&&r>0;)--r;return r}),c=Math.floor(Math.min(...o)),u=t(e=>r?e.data.y-10:e.data.y+10,`determineLabelYPosition`);n.selectAll(`text`).data(a).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,u).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,r?`auto`:`hanging`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:n.selectAll(`text`).data(e.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>u(e.verticalPos)).attr(`text-anchor`,e=>d(e.horizontalPos)).attr(`transform`,e=>f(e)).text(e=>e.text);break;case`path`:n.selectAll(`path`).data(e.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth);break}}},`draw`)}};export{_e as diagram};
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "logoutUrl": "",
3
+ "presenceEnabled": false,
3
4
  "staticMode": false
4
5
  }
@@ -11,37 +11,8 @@
11
11
  name="msapplication-TileImage"
12
12
  content="/cropped-favicon-270x270.png"
13
13
  />
14
- <script type="module" crossorigin src="/assets/index-oVbUFngg.js"></script>
15
- <link rel="modulepreload" crossorigin href="/assets/chunk-CFjPhJqf.js">
16
- <link rel="modulepreload" crossorigin href="/assets/src-ps-3oTnY.js">
17
- <link rel="modulepreload" crossorigin href="/assets/chunk-ICPOFSXX-6-ABzkfw.js">
18
- <link rel="modulepreload" crossorigin href="/assets/dist-C6vvxvVV.js">
19
- <link rel="modulepreload" crossorigin href="/assets/identity-nF-8qK2-.js">
20
- <link rel="modulepreload" crossorigin href="/assets/chunk-5PVQY5BW-D46cRkay.js">
21
- <link rel="modulepreload" crossorigin href="/assets/chunk-U2HBQHQK-C6yvwOAo.js">
22
- <link rel="modulepreload" crossorigin href="/assets/defaultLocale-B6dPnyNg.js">
23
- <link rel="modulepreload" crossorigin href="/assets/init-B9nbfZCT.js">
24
- <link rel="modulepreload" crossorigin href="/assets/linear-C8MDrvxz.js">
25
- <link rel="modulepreload" crossorigin href="/assets/time-Bgnk7ODM.js">
26
- <link rel="modulepreload" crossorigin href="/assets/range-DuD7Go1R.js">
27
- <link rel="modulepreload" crossorigin href="/assets/treemap-DK8fitek.js">
28
- <link rel="modulepreload" crossorigin href="/assets/path-C7Bv0Qdk.js">
29
- <link rel="modulepreload" crossorigin href="/assets/colors-DZGTowqM.js">
30
- <link rel="modulepreload" crossorigin href="/assets/ordinal-BXaEVJbT.js">
31
- <link rel="modulepreload" crossorigin href="/assets/arc-DFTvTCxD.js">
32
- <link rel="modulepreload" crossorigin href="/assets/array-xS8TccZC.js">
33
- <link rel="modulepreload" crossorigin href="/assets/line-DrKJYWGi.js">
34
- <link rel="modulepreload" crossorigin href="/assets/isEmpty-Di-NpihJ.js">
35
- <link rel="modulepreload" crossorigin href="/assets/chunk-X2U36JSP-D1C3tOED.js">
36
- <link rel="modulepreload" crossorigin href="/assets/chunk-ZZ45TVLE-DrCjtkdu.js">
37
- <link rel="modulepreload" crossorigin href="/assets/rough.esm-DE7XMpOC.js">
38
- <link rel="modulepreload" crossorigin href="/assets/chunk-5FUZZQ4R-D7L4hZzZ.js">
39
- <link rel="modulepreload" crossorigin href="/assets/chunk-BSJP7CBP-BQPMRa-Q.js">
40
- <link rel="modulepreload" crossorigin href="/assets/chunk-ENJZ2VHE-BrjxYY_T.js">
41
- <link rel="modulepreload" crossorigin href="/assets/chunk-336JU56O-CVDEj5x8.js">
42
- <link rel="modulepreload" crossorigin href="/assets/chunk-426QAEUC-CIWkCWTf.js">
43
- <link rel="modulepreload" crossorigin href="/assets/chunk-XPW4576I-BH37LuuF.js">
44
- <link rel="stylesheet" crossorigin href="/assets/index-ypsafPwV.css">
14
+ <script type="module" crossorigin src="/assets/index-DGPv1qic.js"></script>
15
+ <link rel="stylesheet" crossorigin href="/assets/index-DvHiopvR.css">
45
16
  </head>
46
17
  <body>
47
18
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyberismo/backend",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "Express backend for Cyberismo",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [],
@@ -12,19 +12,23 @@
12
12
  "url": "git+https://github.com/CyberismoCom/cyberismo.git"
13
13
  },
14
14
  "bugs": "https://github.com/CyberismoCom/cyberismo/issues",
15
+ "engines": {
16
+ "node": ">=22"
17
+ },
15
18
  "dependencies": {
16
19
  "@asciidoctor/core": "^3.0.4",
17
- "@modelcontextprotocol/sdk": "^1.29.0",
20
+ "@hono/mcp": "^0.2.5",
18
21
  "@hono/node-server": "^1.19.13",
19
22
  "@hono/zod-validator": "^0.7.6",
23
+ "@modelcontextprotocol/sdk": "^1.29.0",
20
24
  "@types/mime-types": "^3.0.1",
21
25
  "dotenv": "^17.3.1",
22
- "hono": "^4.12.14",
26
+ "hono": "^4.12.18",
23
27
  "jose": "^6.2.3",
24
28
  "mime-types": "^3.0.2",
25
29
  "zod": "^4.3.6",
26
- "@cyberismo/data-handler": "0.0.24",
27
- "@cyberismo/mcp": "0.0.24"
30
+ "@cyberismo/data-handler": "0.0.26",
31
+ "@cyberismo/mcp": "0.0.26"
28
32
  },
29
33
  "devDependencies": {
30
34
  "@cyberismo/app": "0.0.2"
package/src/app.ts CHANGED
@@ -10,10 +10,10 @@
10
10
  details. You should have received a copy of the GNU Affero General Public
11
11
  License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
12
  */
13
- import { Hono } from 'hono';
13
+ import { Hono, type MiddlewareHandler } from 'hono';
14
14
  import { staticFrontendDirRelative } from './utils.js';
15
15
  import { serveStatic } from '@hono/node-server/serve-static';
16
- import { attachCommandManager } from './middleware/commandManager.js';
16
+ import { attachProjectRegistry } from './middleware/commandManager.js';
17
17
  import calculationsRouter from './domain/calculations/index.js';
18
18
  import cardsRouter from './domain/cards/index.js';
19
19
  import cardTypesRouter from './domain/cardTypes/index.js';
@@ -32,61 +32,98 @@ import path from 'node:path';
32
32
  import resourcesRouter from './domain/resources/index.js';
33
33
  import logicProgramsRouter from './domain/logicPrograms/index.js';
34
34
  import { isSSGContext } from 'hono/ssg';
35
- import type { CommandManager } from '@cyberismo/data-handler';
36
35
  import type { AppVars, TreeOptions } from './types.js';
37
36
  import treeMiddleware from './middleware/tree.js';
38
37
  import projectRouter from './domain/project/index.js';
39
- import mcpRouter from './domain/mcp/index.js';
38
+ import { createMcpRouter } from './domain/mcp/index.js';
40
39
  import { createAuthRouter } from './domain/auth/index.js';
41
40
  import { createAuthMiddleware } from './middleware/auth.js';
42
41
  import type { AuthProvider } from './auth/types.js';
42
+ import type { ProjectRegistry } from './project-registry.js';
43
+ import { createProjectsRouter } from './domain/projects/index.js';
44
+ import { simpleMcpAuthRouter } from '@hono/mcp';
45
+
46
+ /**
47
+ * Create a Hono sub-app with all project-scoped routes.
48
+ */
49
+ function createProjectScopedRoutes(
50
+ middleware: MiddlewareHandler,
51
+ ): Hono<{ Variables: AppVars }> {
52
+ const projectScoped = new Hono<{ Variables: AppVars }>();
53
+ projectScoped.use('*', middleware);
54
+ projectScoped.route('/calculations', calculationsRouter);
55
+ projectScoped.route('/cards', cardsRouter);
56
+ projectScoped.route('/cardTypes', cardTypesRouter);
57
+ projectScoped.route('/connectors', connectorsRouter);
58
+ projectScoped.route('/fieldTypes', fieldTypesRouter);
59
+ projectScoped.route('/graphModels', graphModelsRouter);
60
+ projectScoped.route('/graphViews', graphViewsRouter);
61
+ projectScoped.route('/linkTypes', linkTypesRouter);
62
+ projectScoped.route('/reports', reportsRouter);
63
+ projectScoped.route('/templates', templatesRouter);
64
+ projectScoped.route('/tree', treeRouter);
65
+ projectScoped.route('/workflows', workflowsRouter);
66
+ projectScoped.route('/resources', resourcesRouter);
67
+ projectScoped.route('/logicPrograms', logicProgramsRouter);
68
+ projectScoped.route('/labels', labelsRouter);
69
+ projectScoped.route('/project', projectRouter);
70
+ return projectScoped;
71
+ }
43
72
 
44
73
  /**
45
74
  * Create the Hono app for the backend
46
75
  * @param authProvider - Authentication provider
47
- * @param commands - CommandManager instance for the project
76
+ * @param registry - ProjectRegistry holding all project CommandManagers
48
77
  */
49
78
  export function createApp(
50
79
  authProvider: AuthProvider,
51
- commands: CommandManager,
80
+ registry: ProjectRegistry,
52
81
  opts?: TreeOptions,
82
+ exportMode = false,
53
83
  ) {
54
84
  const app = new Hono<{ Variables: AppVars }>();
55
85
 
86
+ // Public — no auth middleware (MCP clients call this before they have a token)
87
+ // RFC 9728 resource metadata & OAuth authorization server metadata via @hono/mcp
88
+ const issuer = process.env.OIDC_ISSUER;
89
+ if (issuer) {
90
+ const origin = new URL(issuer).origin;
91
+ app.route(
92
+ '/',
93
+ simpleMcpAuthRouter({
94
+ issuer,
95
+ resourceServerUrl: new URL(`${origin}/mcp`),
96
+ }),
97
+ );
98
+ }
99
+
56
100
  app.use(treeMiddleware(opts));
57
101
  // Apply authentication middleware to all API and MCP routes
58
102
  app.use('/api/*', createAuthMiddleware(authProvider));
59
103
  app.use('/mcp', createAuthMiddleware(authProvider));
60
104
  app.use('/mcp/*', createAuthMiddleware(authProvider));
61
105
 
62
- // Attach CommandManager to API and MCP routes
63
- const commandManagerMiddleware = attachCommandManager(commands);
64
- app.use('/api/*', commandManagerMiddleware);
65
- app.use('/mcp', commandManagerMiddleware);
66
- app.use('/mcp/*', commandManagerMiddleware);
67
- // Wire up routes
106
+ // Global routes (no project-specific CommandManager needed)
68
107
  app.route('/api/auth', createAuthRouter());
108
+ app.route('/api/projects', createProjectsRouter(registry));
69
109
 
70
- // Mount routers
71
- app.route('/api/calculations', calculationsRouter);
72
- app.route('/api/cards', cardsRouter);
73
- app.route('/api/cardTypes', cardTypesRouter);
74
- app.route('/api/connectors', connectorsRouter);
75
- app.route('/api/fieldTypes', fieldTypesRouter);
76
- app.route('/api/graphModels', graphModelsRouter);
77
- app.route('/api/graphViews', graphViewsRouter);
78
- app.route('/api/linkTypes', linkTypesRouter);
79
- app.route('/api/reports', reportsRouter);
80
- app.route('/api/templates', templatesRouter);
81
- app.route('/api/tree', treeRouter);
82
- app.route('/api/workflows', workflowsRouter);
83
- app.route('/api/resources', resourcesRouter);
84
- app.route('/api/logicPrograms', logicProgramsRouter);
85
- app.route('/api/labels', labelsRouter);
86
- app.route('/api/project', projectRouter);
110
+ if (exportMode) {
111
+ // Export mode: mount at each concrete prefix so SSG sees
112
+ // static routes instead of dynamic :prefix patterns it would skip.
113
+ for (const { prefix } of registry.list()) {
114
+ const scoped = createProjectScopedRoutes(
115
+ attachProjectRegistry(registry, prefix),
116
+ );
117
+ app.route(`/api/projects/${prefix}`, scoped);
118
+ }
119
+ } else {
120
+ // Normal mode: dynamic :prefix param
121
+ const scoped = createProjectScopedRoutes(attachProjectRegistry(registry));
122
+ app.route('/api/projects/:prefix', scoped);
123
+ }
87
124
 
88
125
  // MCP endpoint for AI assistant integration
89
- app.route('/mcp', mcpRouter);
126
+ app.route('/mcp', createMcpRouter(registry));
90
127
 
91
128
  app.use(
92
129
  '*',
@@ -97,7 +134,10 @@ export function createApp(
97
134
 
98
135
  // serve index.html for all other routes
99
136
  app.notFound(async (c) => {
100
- if (c.req.path.startsWith('/api')) {
137
+ if (
138
+ c.req.path.startsWith('/api') ||
139
+ c.req.path.startsWith('/.well-known')
140
+ ) {
101
141
  return c.text('Not Found', 404);
102
142
  }
103
143
  const file = await readFile(
@@ -15,6 +15,7 @@ import Processor from '@asciidoctor/core';
15
15
  import type { Card } from '@cyberismo/data-handler/interfaces/project-interfaces';
16
16
  import { type CommandManager, evaluateMacros } from '@cyberismo/data-handler';
17
17
  import { preprocessMermaidBlocksForHtml } from '@cyberismo/data-handler/utils/mermaid-renderer';
18
+ import { rewriteAsciidocCardXrefs } from '@cyberismo/data-handler/utils/asciidoc-xref';
18
19
  import { getCardQueryResult } from '../../export.js';
19
20
  import type { TreeOptions } from '../../types.js';
20
21
  import type { QueryResult } from '@cyberismo/data-handler/types/queries';
@@ -61,11 +62,20 @@ export async function getCardDetails(
61
62
  // Convert [mermaid] AsciiDoc blocks to passthrough HTML before asciidoctor processes them
62
63
  asciidocContent = preprocessMermaidBlocksForHtml(asciidocContent);
63
64
 
65
+ // Rewrite native AsciiDoc xrefs that target other cards into
66
+ // /projects/<prefix>/cards/<key> links.
67
+ asciidocContent = rewriteAsciidocCardXrefs(
68
+ asciidocContent,
69
+ commands.project,
70
+ staticMode ? 'staticSite' : 'inject',
71
+ );
72
+
73
+ const projectPrefix = commands.project.projectPrefix;
64
74
  const htmlContent = Processor()
65
75
  .convert(asciidocContent, {
66
76
  safe: 'safe',
67
77
  attributes: {
68
- imagesdir: `/api/cards/${key}/a`,
78
+ imagesdir: `/api/projects/${projectPrefix}/cards/${key}/a`,
69
79
  icons: 'font',
70
80
  },
71
81
  })
@@ -128,6 +138,7 @@ export async function getCardDetails(
128
138
  rawContent: cardDetailsResponse.content || '',
129
139
  parsedContent: htmlContent,
130
140
  attachments: cardDetailsResponse.attachments,
141
+ path: cardDetailsResponse.path,
131
142
  },
132
143
  };
133
144
  }
@@ -149,6 +160,7 @@ export async function getCardDetails(
149
160
  rawContent: cardDetailsResponse.content || '',
150
161
  parsedContent: htmlContent,
151
162
  attachments: cardDetailsResponse.attachments,
163
+ path: cardDetailsResponse.path,
152
164
  },
153
165
  };
154
166
  });
@@ -19,6 +19,7 @@ import type {
19
19
  import type { attachmentPayload } from '@cyberismo/data-handler/interfaces/request-status-interfaces';
20
20
  import { type CommandManager, evaluateMacros } from '@cyberismo/data-handler';
21
21
  import { preprocessMermaidBlocksForHtml } from '@cyberismo/data-handler/utils/mermaid-renderer';
22
+ import { rewriteAsciidocCardXrefs } from '@cyberismo/data-handler/utils/asciidoc-xref';
22
23
  import { allCards } from './lib.js';
23
24
  import type { TreeOptions } from '../../types.js';
24
25
 
@@ -172,12 +173,21 @@ export async function parseContent(
172
173
  // Convert [mermaid] AsciiDoc blocks to passthrough HTML before asciidoctor processes them
173
174
  asciidocContent = preprocessMermaidBlocksForHtml(asciidocContent);
174
175
 
176
+ // Rewrite native AsciiDoc xrefs that target other cards into
177
+ // /projects/<prefix>/cards/<key> links.
178
+ asciidocContent = rewriteAsciidocCardXrefs(
179
+ asciidocContent,
180
+ commands.project,
181
+ 'inject',
182
+ );
183
+
175
184
  const processor = Processor();
185
+ const projectPrefix = commands.project.projectPrefix;
176
186
  const parsedContent = processor
177
187
  .convert(asciidocContent, {
178
188
  safe: 'safe',
179
189
  attributes: {
180
- imagesdir: `/api/cards/${key}/a`,
190
+ imagesdir: `/api/projects/${projectPrefix}/cards/${key}/a`,
181
191
  icons: 'font',
182
192
  },
183
193
  })