@diagrammo/dgmo 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/.cursorrules +6 -2
  2. package/.github/copilot-instructions.md +6 -2
  3. package/.windsurfrules +6 -2
  4. package/SKILL.md +6 -2
  5. package/dist/advanced.d.ts +419 -12
  6. package/dist/advanced.js +557 -195
  7. package/dist/auto.js +129 -119
  8. package/dist/auto.mjs +11543 -4815
  9. package/dist/block.js +145 -48
  10. package/dist/{charts-d3-EW3YQTEA.js → charts-d3-DKUD7MQE.js} +5 -5
  11. package/dist/{chunk-5FGDJIJX.js → chunk-2C56LEML.js} +3 -3
  12. package/dist/{chunk-35BBZDFE.js → chunk-2JJ2KNPI.js} +4 -4
  13. package/dist/{chunk-ZTLWVRNS.js → chunk-2QYTMIRR.js} +2 -2
  14. package/dist/{chunk-VC3TR4NL.js → chunk-3G6TMNVF.js} +3 -3
  15. package/dist/{chunk-ZDUQGL3N.js → chunk-3LKM6FMW.js} +2 -2
  16. package/dist/{chunk-4BD7EVPK.js → chunk-3P2DKJCG.js} +2 -2
  17. package/dist/{chunk-6CLKNXVP.js → chunk-3TDRHT4J.js} +457 -78
  18. package/dist/chunk-3XPUDB7B.js +420 -0
  19. package/dist/{chunk-DDTJ5N7Q.js → chunk-3ZPC476N.js} +6 -6
  20. package/dist/{chunk-BPIJLRYE.js → chunk-4BMJQFNK.js} +3 -3
  21. package/dist/{chunk-N4J5KGWG.js → chunk-4S723I74.js} +8 -8
  22. package/dist/{chunk-4YNP6O47.js → chunk-5JSWBPZZ.js} +3 -3
  23. package/dist/{chunk-KUBBJ2CD.js → chunk-5Z736BSU.js} +6 -6
  24. package/dist/{chunk-MJCG5K2O.js → chunk-6BFZKBGD.js} +2 -2
  25. package/dist/{chunk-XCC2RENT.js → chunk-6IAA2QQ2.js} +2 -2
  26. package/dist/{chunk-FUCAB3KQ.js → chunk-6M5PJFQG.js} +3 -3
  27. package/dist/{chunk-T7IKPCMI.js → chunk-6X4AKWLF.js} +3 -3
  28. package/dist/{chunk-JFPY3UJ7.js → chunk-6ZT4U37Q.js} +8 -8
  29. package/dist/{chunk-CLR4A2N2.js → chunk-7G2ER4CY.js} +4 -4
  30. package/dist/chunk-7PQYTZMA.js +681 -0
  31. package/dist/{chunk-LG4TWW4U.js → chunk-7RB5Q6MB.js} +8 -8
  32. package/dist/{chunk-7OVSJI2V.js → chunk-A3WQVFBS.js} +3 -3
  33. package/dist/{chunk-X2CH42BN.js → chunk-ASS5YYIZ.js} +7 -7
  34. package/dist/{chunk-3NFJWFNP.js → chunk-BDXC7MDK.js} +1045 -124
  35. package/dist/chunk-BTUTZMPT.js +482 -0
  36. package/dist/{chunk-UVCXZEGU.js → chunk-CVV36CWI.js} +2 -2
  37. package/dist/{chunk-TC3YWBFO.js → chunk-DMJJ3CEQ.js} +29 -8
  38. package/dist/{chunk-NVT6C2VE.js → chunk-EJTKV7CY.js} +4 -4
  39. package/dist/{chunk-4NQ3IKUM.js → chunk-ER5SCQWQ.js} +5 -5
  40. package/dist/{chunk-7VLUGEMJ.js → chunk-F5UDBSJY.js} +4 -4
  41. package/dist/{chunk-IHLSHCPZ.js → chunk-FAL7NOK3.js} +5 -5
  42. package/dist/{chunk-YRVLP7UU.js → chunk-FB2WHOEQ.js} +4 -4
  43. package/dist/chunk-FL4IOQ37.js +379 -0
  44. package/dist/{chunk-6VE3VLWM.js → chunk-GBE54KY6.js} +6 -5
  45. package/dist/{chunk-ZXL6MB4R.js → chunk-GL5UZ6NY.js} +3 -3
  46. package/dist/{chunk-3BIAFYD2.js → chunk-GPWHQ5FJ.js} +2 -2
  47. package/dist/chunk-GROQGHCT.js +960 -0
  48. package/dist/{chunk-GB3YZTAM.js → chunk-H73FP42Q.js} +5 -5
  49. package/dist/{chunk-O5MQPK7E.js → chunk-I4IFRCUB.js} +3 -3
  50. package/dist/{chunk-IUK7AGD4.js → chunk-I7F2A35O.js} +2 -2
  51. package/dist/{chunk-YTN572Q2.js → chunk-IA3FJYWR.js} +2 -2
  52. package/dist/{chunk-RI4NIMFP.js → chunk-JFYIP7XU.js} +75 -35
  53. package/dist/{chunk-UWDO3O52.js → chunk-JZNMXEIV.js} +2 -2
  54. package/dist/chunk-KJXIHOVL.js +940 -0
  55. package/dist/{chunk-26RVGM44.js → chunk-L2ZTFHAY.js} +2 -2
  56. package/dist/{chunk-PU3AUQPA.js → chunk-M5RXSRO2.js} +2 -2
  57. package/dist/{chunk-XKTN7CZF.js → chunk-NFFIKVNO.js} +4 -4
  58. package/dist/{chunk-SVDWQGX2.js → chunk-NISQC5KW.js} +139 -78
  59. package/dist/{chunk-4HVNZ7WF.js → chunk-O4VUFXIH.js} +3 -3
  60. package/dist/{chunk-F743CM2N.js → chunk-O76UD6VJ.js} +3 -3
  61. package/dist/{chunk-TLKMTQYL.js → chunk-OHQEMBLI.js} +3 -3
  62. package/dist/{chunk-BGJV5ATD.js → chunk-ONA5KPV3.js} +2 -2
  63. package/dist/{chunk-ZNQX6QWH.js → chunk-OTAL43EH.js} +6 -2
  64. package/dist/{chunk-FMKTYMP4.js → chunk-OTP5KVLO.js} +3 -3
  65. package/dist/{chunk-5ZZLLBFK.js → chunk-PGEGPSCZ.js} +2 -2
  66. package/dist/{chunk-XJ7J6WOO.js → chunk-PJUGRJHJ.js} +4 -4
  67. package/dist/{chunk-6SA7FJE4.js → chunk-PLZI6KPM.js} +10 -10
  68. package/dist/{chunk-AJ2PEY7J.js → chunk-PMN3Q7RJ.js} +2 -2
  69. package/dist/chunk-Q4V4XQWV.js +158 -0
  70. package/dist/{chunk-5XCM7UUW.js → chunk-QDFNCATJ.js} +99 -35
  71. package/dist/{chunk-CEHZOPGM.js → chunk-QFQ35BTO.js} +2 -2
  72. package/dist/{chunk-4UDKKGHH.js → chunk-QUJGFNFN.js} +2 -2
  73. package/dist/{chunk-IBC35BTK.js → chunk-R56LASIN.js} +2 -2
  74. package/dist/{chunk-SJEGO2QL.js → chunk-RV26LTUU.js} +4 -4
  75. package/dist/chunk-RV6A2B5S.js +354 -0
  76. package/dist/{chunk-65RTDUZH.js → chunk-S5GRONXL.js} +3 -3
  77. package/dist/{chunk-K6HNAY5V.js → chunk-SCHXJTZL.js} +2 -2
  78. package/dist/{chunk-ALRHIR6I.js → chunk-SGFZZAUO.js} +4 -4
  79. package/dist/{chunk-KV6Y2HE6.js → chunk-SU2VBK4L.js} +4 -4
  80. package/dist/{chunk-D5AVQCDN.js → chunk-T4BRO3Z6.js} +3 -3
  81. package/dist/{chunk-IFK3GIUW.js → chunk-TSA237IM.js} +2 -2
  82. package/dist/{chunk-SQDFK5ZQ.js → chunk-TWCLK2GA.js} +3 -3
  83. package/dist/{chunk-DKEPS5LH.js → chunk-U2HGPLZS.js} +36 -2
  84. package/dist/{chunk-EYN7VFKL.js → chunk-URSQLCTR.js} +3 -3
  85. package/dist/{chunk-BCT5G2VN.js → chunk-UUS2GIJZ.js} +5 -5
  86. package/dist/{chunk-LVHPTBO3.js → chunk-UXOSVCLJ.js} +4 -4
  87. package/dist/{chunk-HBVD67XG.js → chunk-WCUHAQKB.js} +2 -2
  88. package/dist/{chunk-YYX3SU6H.js → chunk-WWN566I7.js} +257 -101
  89. package/dist/{chunk-YM2BSPYW.js → chunk-X2NMFTG3.js} +2 -2
  90. package/dist/{chunk-ZREZOIGS.js → chunk-XCLHOZAM.js} +6 -6
  91. package/dist/{chunk-KQAEKMIX.js → chunk-XDXNDSKO.js} +2 -2
  92. package/dist/{chunk-RTERS6S5.js → chunk-XMVQ5F4M.js} +4 -4
  93. package/dist/{chunk-4FIV4K4Z.js → chunk-YA7D2N2O.js} +7 -7
  94. package/dist/{chunk-B57V3DWN.js → chunk-YB3FW24O.js} +3 -3
  95. package/dist/chunk-YNRDWYZP.js +295 -0
  96. package/dist/{chunk-2WMBWZY2.js → chunk-YZLMKW4T.js} +3 -3
  97. package/dist/{chunk-SGHSY3LU.js → chunk-Z6XJQ6KO.js} +81 -6
  98. package/dist/cli.cjs +153 -144
  99. package/dist/clock.d.ts +10 -0
  100. package/dist/clock.js +235 -0
  101. package/dist/countdown.d.ts +12 -0
  102. package/dist/countdown.js +450 -0
  103. package/dist/dgmo-router-QOMFCOOV.js +84 -0
  104. package/dist/{dimensions-WSIJXT5Q.js → dimensions-P5FSX2QN.js} +5 -5
  105. package/dist/editor.js +39 -1
  106. package/dist/element.js +131 -121
  107. package/dist/element.mjs +11543 -4815
  108. package/dist/{flowchart-parser-IVZN7CQN.js → flowchart-parser-OE4WHLTF.js} +4 -4
  109. package/dist/{flowchart-renderer-GMI2U3DD.js → flowchart-renderer-GPCSMTOR.js} +6 -6
  110. package/dist/highlight.d.ts +17 -1
  111. package/dist/highlight.js +156 -5
  112. package/dist/index.js +50 -45
  113. package/dist/{layout-HQMBPJVS.js → layout-46366KBT.js} +2 -2
  114. package/dist/{layout-D42XE4RE.js → layout-5BG6DFCU.js} +3 -3
  115. package/dist/{layout-K2ZN3Q42.js → layout-T3OZU5QW.js} +4 -4
  116. package/dist/{layout-S3EK4IYO.js → layout-TJIWF7EM.js} +4 -4
  117. package/dist/{layout-GZ2CWONU.js → layout-VYELEAW7.js} +4 -4
  118. package/dist/{layout-4Z5JM7PT.js → layout-WZHNDT2O.js} +4 -4
  119. package/dist/{parser-OBQG655V.js → parser-45DENHFZ.js} +4 -4
  120. package/dist/{parser-MCJWF5G3.js → parser-4AI5ZN5F.js} +3 -3
  121. package/dist/{parser-SMBJO3XN.js → parser-4P36TUVD.js} +4 -4
  122. package/dist/{parser-ZYC3XGNS.js → parser-5AURY4A6.js} +4 -4
  123. package/dist/{parser-WISPH7LW.js → parser-A2BEFMGK.js} +4 -4
  124. package/dist/parser-B5FVS7O6.js +11 -0
  125. package/dist/{parser-KPMN5KKE.js → parser-C2HF2C2E.js} +4 -4
  126. package/dist/parser-CSFUN3CT.js +14 -0
  127. package/dist/{parser-TITK4YW6.js → parser-D3QT6GWN.js} +5 -5
  128. package/dist/{parser-ZKF5K2H2.js → parser-D5637H5H.js} +4 -4
  129. package/dist/{parser-IKZFTLOJ.js → parser-DFFEDKHH.js} +3 -3
  130. package/dist/parser-DOKMZXVZ.js +13 -0
  131. package/dist/parser-FMPCVFRK.js +15 -0
  132. package/dist/{parser-UBGPTIZD.js → parser-HYRTF3DO.js} +3 -3
  133. package/dist/{parser-TNYX5S7E.js → parser-I2UIJKVQ.js} +4 -4
  134. package/dist/{parser-K647FRI4.js → parser-IBWNAPY4.js} +3 -3
  135. package/dist/{parser-JD7OQ2E6.js → parser-KUQWRPIT.js} +4 -4
  136. package/dist/{parser-HVJFTOXL.js → parser-LWKKBNSA.js} +3 -3
  137. package/dist/{parser-4ROBKVUR.js → parser-O4QFCUW7.js} +5 -5
  138. package/dist/{parser-BL7Z72EY.js → parser-PGMQDD4G.js} +4 -4
  139. package/dist/{parser-QJYS7KQQ.js → parser-Q4QKCIWQ.js} +4 -4
  140. package/dist/{parser-UGA23PYK.js → parser-QTOB4KFL.js} +4 -4
  141. package/dist/{parser-DERPY5KC.js → parser-QYYM4QVW.js} +4 -4
  142. package/dist/{parser-GFSOPDB7.js → parser-RZMQP7MM.js} +4 -4
  143. package/dist/parser-RZPVAQVX.js +11 -0
  144. package/dist/parser-SOUJOEYI.js +13 -0
  145. package/dist/{parser-MBJSBTL5.js → parser-UQE5OWZI.js} +5 -5
  146. package/dist/{parser-MRBPXXIV.js → parser-WAV5JRPT.js} +4 -4
  147. package/dist/{parser-4BKIFG2C.js → parser-YLKYBRIT.js} +5 -5
  148. package/dist/{parser-D6ONJQFR.js → parser-YS7TOS2K.js} +3 -3
  149. package/dist/{parser-CLMFZWCC.js → parser-ZSOWUBML.js} +5 -5
  150. package/dist/{parser-XWUDFJ7P.js → parser-ZTBATMLX.js} +4 -4
  151. package/dist/{renderer-LWGJFT3D.js → renderer-35HSIDMZ.js} +5 -5
  152. package/dist/{renderer-BB5PREMY.js → renderer-4ITCHBT7.js} +4 -4
  153. package/dist/{renderer-YHXPN3GF.js → renderer-67NPCBIS.js} +7 -7
  154. package/dist/{renderer-TPIBXNOS.js → renderer-6GHYK7DX.js} +6 -6
  155. package/dist/{renderer-VICQ4WNY.js → renderer-6RNGHC5Z.js} +5 -5
  156. package/dist/renderer-72LGR2YF.js +14 -0
  157. package/dist/{renderer-W5RMOURB.js → renderer-7SWMIFMM.js} +6 -6
  158. package/dist/{renderer-6L3NBEY5.js → renderer-BBCEFILK.js} +6 -6
  159. package/dist/{renderer-VFUVRNLK.js → renderer-BSW7SRIZ.js} +4 -4
  160. package/dist/{renderer-CGW7QPNA.js → renderer-BY533UWU.js} +7 -7
  161. package/dist/{renderer-V3JEMWMM.js → renderer-BZSBPTZJ.js} +6 -6
  162. package/dist/{renderer-DKESNMU5.js → renderer-CXUC4KAD.js} +6 -6
  163. package/dist/{renderer-XEKIRPI6.js → renderer-FZUKFUNZ.js} +5 -5
  164. package/dist/renderer-G2NLGNKF.js +17 -0
  165. package/dist/{renderer-THD6V5TL.js → renderer-GO3FE3RA.js} +9 -7
  166. package/dist/{renderer-ROV756WT.js → renderer-HPGR6USK.js} +5 -5
  167. package/dist/renderer-ICJN2SA2.js +24 -0
  168. package/dist/{renderer-4IUPINAE.js → renderer-INEXO7B6.js} +7 -7
  169. package/dist/{renderer-SQ3JUAI7.js → renderer-KDYCFRBX.js} +6 -6
  170. package/dist/renderer-KY4KQBTF.js +19 -0
  171. package/dist/{renderer-MJDDU27W.js → renderer-LBN65V45.js} +10 -10
  172. package/dist/{renderer-UZF3JROD.js → renderer-MGBWOCXG.js} +8 -8
  173. package/dist/{renderer-MFJ7HY2H.js → renderer-O4JKUGKO.js} +5 -5
  174. package/dist/{renderer-QL5KO6SK.js → renderer-OOGFODWP.js} +7 -7
  175. package/dist/{renderer-A5VFZQQK.js → renderer-Q6ZKPLS6.js} +6 -6
  176. package/dist/{renderer-TYXRHMRI.js → renderer-SZQ326M5.js} +9 -9
  177. package/dist/{renderer-6T3KK4S3.js → renderer-TKG6LS4U.js} +7 -7
  178. package/dist/{renderer-QNHUXCRL.js → renderer-TQMZGDAX.js} +9 -9
  179. package/dist/{renderer-radial-MHO2VDXN.js → renderer-radial-JELMHQ24.js} +6 -6
  180. package/dist/{state-parser-RX3GXOIB.js → state-parser-3REXRK3R.js} +4 -4
  181. package/dist/{state-renderer-AJUKGNWU.js → state-renderer-XYLNRWXR.js} +6 -6
  182. package/docs/ai-integration.md +6 -2
  183. package/docs/language-reference.md +253 -22
  184. package/gallery/fixtures/body.dgmo +17 -0
  185. package/gallery/fixtures/bracket.dgmo +30 -0
  186. package/gallery/fixtures/clock.dgmo +8 -0
  187. package/gallery/fixtures/countdown.dgmo +3 -0
  188. package/gallery/fixtures/goal.dgmo +4 -0
  189. package/package.json +12 -4
  190. package/dist/dgmo-router-ODKPEJ3P.js +0 -79
  191. package/dist/parser-667RGSUW.js +0 -13
  192. package/dist/parser-J3P2D6IP.js +0 -13
@@ -25,13 +25,13 @@ import {
25
25
  } from "./chunk-3CIOJ5YJ.js";
26
26
  import {
27
27
  layoutOrg
28
- } from "./chunk-IBC35BTK.js";
28
+ } from "./chunk-R56LASIN.js";
29
29
  import {
30
30
  ScaleContext
31
31
  } from "./chunk-YYVTBZZC.js";
32
32
  import {
33
33
  renderIntegratedLegend
34
- } from "./chunk-4UDKKGHH.js";
34
+ } from "./chunk-QUJGFNFN.js";
35
35
  import {
36
36
  getMaxLegendReservedHeight
37
37
  } from "./chunk-7UEMZREK.js";
@@ -55,7 +55,7 @@ import {
55
55
  } from "./chunk-5LWQH6QV.js";
56
56
  import {
57
57
  parseOrg
58
- } from "./chunk-F743CM2N.js";
58
+ } from "./chunk-O76UD6VJ.js";
59
59
  import {
60
60
  contrastText,
61
61
  mix,
@@ -65,7 +65,7 @@ import {
65
65
  import {
66
66
  resolveTagColor,
67
67
  tagAttrKey
68
- } from "./chunk-HBVD67XG.js";
68
+ } from "./chunk-WCUHAQKB.js";
69
69
 
70
70
  // src/org/renderer.ts
71
71
  import * as d3Selection from "d3-selection";
@@ -484,4 +484,4 @@ export {
484
484
  renderOrg,
485
485
  renderOrgForExport
486
486
  };
487
- //# sourceMappingURL=chunk-IHLSHCPZ.js.map
487
+ //# sourceMappingURL=chunk-FAL7NOK3.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MAP_DIRECTIVE_KEY_SET
3
- } from "./chunk-DKEPS5LH.js";
3
+ } from "./chunk-U2HGPLZS.js";
4
4
  import {
5
5
  AUTO_TAG_COLOR_SENTINEL,
6
6
  finalizeAutoTagColors,
@@ -8,7 +8,7 @@ import {
8
8
  stripDefaultModifier,
9
9
  tagAttrKey,
10
10
  validateTagGroupNames
11
- } from "./chunk-HBVD67XG.js";
11
+ } from "./chunk-WCUHAQKB.js";
12
12
  import {
13
13
  parseInArrowLabel
14
14
  } from "./chunk-FFUN5D66.js";
@@ -19,7 +19,7 @@ import {
19
19
  peelRampColors,
20
20
  splitNameAndMeta,
21
21
  withTagAliases
22
- } from "./chunk-ZNQX6QWH.js";
22
+ } from "./chunk-OTAL43EH.js";
23
23
  import {
24
24
  formatDgmoError,
25
25
  makeDgmoError
@@ -610,4 +610,4 @@ export {
610
610
  looksLikeMap,
611
611
  parseMap
612
612
  };
613
- //# sourceMappingURL=chunk-YRVLP7UU.js.map
613
+ //# sourceMappingURL=chunk-FB2WHOEQ.js.map
@@ -0,0 +1,379 @@
1
+ import {
2
+ preprocessDescriptionLine
3
+ } from "./chunk-IYULMRBE.js";
4
+ import {
5
+ AUTO_TAG_COLOR_SENTINEL,
6
+ finalizeAutoTagColors,
7
+ matchTagBlockHeading,
8
+ resolveActiveTagGroup,
9
+ stripDefaultModifier,
10
+ tagAttrKey
11
+ } from "./chunk-WCUHAQKB.js";
12
+ import {
13
+ extractColor,
14
+ measureIndent,
15
+ parseFirstLine,
16
+ splitNameAndMeta
17
+ } from "./chunk-OTAL43EH.js";
18
+ import {
19
+ makeDgmoError,
20
+ makeFail
21
+ } from "./chunk-CXK4DZH3.js";
22
+
23
+ // src/bracket/parser.ts
24
+ var BEATS_RE = /^(.+?)\s+beats\s+(.+)$/i;
25
+ var VS_RE = /^(.+?)\s+vs\s+(.+)$/i;
26
+ var SCORE_RE = /\s+(\d+\s*[-–]\s*\d+)$/;
27
+ var HOME_RE = /\s+@\s+(.+)$/;
28
+ var SEED_RE = /^seed\s+(\d+)\s+(.+)$/i;
29
+ var MODE_FLAGS = /* @__PURE__ */ new Set(["single-elim", "double-elim", "seeded"]);
30
+ function splitMatch(body) {
31
+ let rest = body;
32
+ let home = null;
33
+ const hm = rest.match(HOME_RE);
34
+ if (hm) {
35
+ home = hm[1].trim();
36
+ rest = rest.slice(0, hm.index).trimEnd();
37
+ }
38
+ let score = null;
39
+ const sm = rest.match(SCORE_RE);
40
+ if (sm) {
41
+ score = sm[1].replace(/\s+/g, "");
42
+ rest = rest.slice(0, sm.index).trimEnd();
43
+ }
44
+ const m = rest.match(BEATS_RE);
45
+ if (m) return { left: m[1].trim(), right: m[2].trim(), score, home };
46
+ return null;
47
+ }
48
+ function parseBracket(content, palette) {
49
+ const result = {
50
+ type: "bracket",
51
+ title: null,
52
+ titleLineNumber: null,
53
+ mode: "single-elim",
54
+ seeded: false,
55
+ roundNames: [],
56
+ sides: [],
57
+ matches: [],
58
+ seeds: [],
59
+ tagGroups: [],
60
+ competitorMeta: /* @__PURE__ */ new Map(),
61
+ activeTag: null,
62
+ noLegend: false,
63
+ noRounds: false,
64
+ diagnostics: [],
65
+ error: null
66
+ };
67
+ const matches = [];
68
+ const seeds = [];
69
+ const sides = [];
70
+ const sideSeen = /* @__PURE__ */ new Set();
71
+ const tagGroups = [];
72
+ const metaAliasMap = /* @__PURE__ */ new Map();
73
+ const competitorMeta = /* @__PURE__ */ new Map();
74
+ const fail = makeFail(result);
75
+ const warn = (line, message) => {
76
+ result.diagnostics.push(makeDgmoError(line, message, "warning"));
77
+ };
78
+ const softError = (line, message) => {
79
+ result.diagnostics.push(makeDgmoError(line, message, "error"));
80
+ };
81
+ if (!content?.trim()) return fail(0, "No content provided");
82
+ const registry = () => ({
83
+ keys: /* @__PURE__ */ new Set(),
84
+ tagAliases: new Set(metaAliasMap.keys())
85
+ });
86
+ const takeMeta = (rest, lineNum) => {
87
+ const split = splitNameAndMeta(
88
+ rest,
89
+ registry(),
90
+ metaAliasMap,
91
+ palette,
92
+ result.diagnostics,
93
+ lineNum
94
+ );
95
+ if (Object.keys(split.meta).length > 0) {
96
+ const prev = competitorMeta.get(split.name) ?? {};
97
+ competitorMeta.set(split.name, { ...prev, ...split.meta });
98
+ }
99
+ return split.name;
100
+ };
101
+ const lines = content.split("\n");
102
+ let headerParsed = false;
103
+ let currentSide = null;
104
+ let currentTagGroup = null;
105
+ let commentaryTarget = null;
106
+ let commentaryIndent = 0;
107
+ let inRoundsBlock = false;
108
+ const roundDefs = [];
109
+ for (let i = 0; i < lines.length; i++) {
110
+ const lineNum = i + 1;
111
+ const raw = lines[i];
112
+ const trimmed = raw.trim();
113
+ if (!trimmed || trimmed.startsWith("//") || trimmed.startsWith("#")) {
114
+ currentTagGroup = null;
115
+ commentaryTarget = null;
116
+ inRoundsBlock = false;
117
+ continue;
118
+ }
119
+ if (!headerParsed) {
120
+ const first = parseFirstLine(trimmed);
121
+ if (first?.chartType !== "bracket") {
122
+ return fail(lineNum, 'Expected "bracket [Title]" as the first line.');
123
+ }
124
+ if (first.title) {
125
+ const { label } = extractColor(
126
+ first.title,
127
+ palette,
128
+ result.diagnostics,
129
+ lineNum
130
+ );
131
+ result.title = label || null;
132
+ }
133
+ result.titleLineNumber = lineNum;
134
+ headerParsed = true;
135
+ continue;
136
+ }
137
+ const indent = measureIndent(raw);
138
+ if (commentaryTarget && indent > commentaryIndent) {
139
+ commentaryTarget.commentary.push(preprocessDescriptionLine(trimmed));
140
+ continue;
141
+ }
142
+ commentaryTarget = null;
143
+ if (inRoundsBlock) {
144
+ if (indent > 0) {
145
+ const { label, color } = extractColor(
146
+ trimmed,
147
+ palette,
148
+ result.diagnostics,
149
+ lineNum
150
+ );
151
+ if (label)
152
+ roundDefs.push(
153
+ color !== void 0 ? { name: label, color } : { name: label }
154
+ );
155
+ continue;
156
+ }
157
+ inRoundsBlock = false;
158
+ }
159
+ const tagHead = matchTagBlockHeading(trimmed);
160
+ if (tagHead) {
161
+ currentTagGroup = {
162
+ name: tagHead.name,
163
+ ...tagHead.alias !== void 0 && { alias: tagHead.alias },
164
+ entries: [],
165
+ lineNumber: lineNum
166
+ };
167
+ if (tagHead.alias) {
168
+ metaAliasMap.set(tagHead.alias.toLowerCase(), tagAttrKey(tagHead.name));
169
+ }
170
+ metaAliasMap.set(tagAttrKey(tagHead.name), tagAttrKey(tagHead.name));
171
+ tagGroups.push(currentTagGroup);
172
+ continue;
173
+ }
174
+ if (currentTagGroup && indent > 0) {
175
+ const { text: cleanEntry, isDefault } = stripDefaultModifier(trimmed);
176
+ const { label, color } = extractColor(
177
+ cleanEntry,
178
+ palette,
179
+ result.diagnostics,
180
+ lineNum
181
+ );
182
+ if (isDefault || currentTagGroup.entries.length === 0) {
183
+ currentTagGroup.defaultValue = label;
184
+ }
185
+ currentTagGroup.entries.push({
186
+ value: label,
187
+ color: color ?? AUTO_TAG_COLOR_SENTINEL,
188
+ lineNumber: lineNum
189
+ });
190
+ continue;
191
+ }
192
+ currentTagGroup = null;
193
+ if (indent === 0) currentSide = null;
194
+ const lower = trimmed.toLowerCase();
195
+ const roundsM = trimmed.match(/^rounds\b(.*)$/i);
196
+ if (roundsM) {
197
+ const rest = roundsM[1].trim();
198
+ if (rest) {
199
+ for (const name of rest.split(",").map((s) => s.trim()).filter(Boolean))
200
+ roundDefs.push({ name });
201
+ } else {
202
+ inRoundsBlock = true;
203
+ }
204
+ continue;
205
+ }
206
+ if (MODE_FLAGS.has(lower)) {
207
+ if (lower === "seeded") result.seeded = true;
208
+ else result.mode = lower;
209
+ continue;
210
+ }
211
+ if (lower === "no-legend") {
212
+ result.noLegend = true;
213
+ continue;
214
+ }
215
+ if (lower === "no-round" || lower === "no-rounds") {
216
+ result.noRounds = true;
217
+ continue;
218
+ }
219
+ const accentM = trimmed.match(/^accent\s+(.+)$/i);
220
+ if (accentM) {
221
+ const { color } = extractColor(
222
+ `x ${accentM[1].trim()}`,
223
+ palette,
224
+ result.diagnostics,
225
+ lineNum
226
+ );
227
+ if (color !== void 0) result.accentColor = color;
228
+ continue;
229
+ }
230
+ const sideM = trimmed.match(/^\[(.+?)\](.*)$/);
231
+ if (sideM) {
232
+ const label = sideM[1].trim();
233
+ if (MODE_FLAGS.has(label.toLowerCase())) {
234
+ const lk = label.toLowerCase();
235
+ if (lk === "seeded") result.seeded = true;
236
+ else result.mode = lk;
237
+ continue;
238
+ }
239
+ const { label: cleanLabel, color } = extractColor(
240
+ sideM[2].trim() ? `${label} ${sideM[2].trim()}` : label,
241
+ palette,
242
+ result.diagnostics,
243
+ lineNum
244
+ );
245
+ currentSide = cleanLabel;
246
+ if (!sideSeen.has(cleanLabel)) {
247
+ sideSeen.add(cleanLabel);
248
+ sides.push(
249
+ color !== void 0 ? { label: cleanLabel, color } : { label: cleanLabel }
250
+ );
251
+ }
252
+ continue;
253
+ }
254
+ const side = indent > 0 ? currentSide : null;
255
+ const seedM = trimmed.match(SEED_RE);
256
+ if (seedM) {
257
+ const n = parseInt(seedM[1], 10);
258
+ const name = takeMeta(seedM[2].trim(), lineNum);
259
+ result.seeded = true;
260
+ seeds.push({ seed: n, name, side, lineNumber: lineNum });
261
+ continue;
262
+ }
263
+ const decided = splitMatch(trimmed);
264
+ if (decided) {
265
+ if (decided.left === decided.right) {
266
+ softError(
267
+ lineNum,
268
+ `A match can't be "${decided.left}" against itself.`
269
+ );
270
+ continue;
271
+ }
272
+ if (decided.score) {
273
+ const parts = decided.score.split(/[-–]/).map((x) => parseInt(x, 10));
274
+ if (parts.length === 2 && parts[0] < parts[1]) {
275
+ warn(
276
+ lineNum,
277
+ `Score ${decided.score} shows "${decided.left}" losing, but they're on the winning side \u2014 keeping "${decided.left}" as the winner.`
278
+ );
279
+ }
280
+ }
281
+ const match = {
282
+ p1: decided.left,
283
+ p2: decided.right,
284
+ decided: true,
285
+ score: decided.score,
286
+ side,
287
+ home: decided.home,
288
+ commentary: [],
289
+ lineNumber: lineNum
290
+ };
291
+ matches.push(match);
292
+ commentaryTarget = match;
293
+ commentaryIndent = indent;
294
+ continue;
295
+ }
296
+ let vsBody = trimmed;
297
+ let vsHome = null;
298
+ const vhm = vsBody.match(HOME_RE);
299
+ if (vhm && VS_RE.test(vsBody.slice(0, vhm.index))) {
300
+ vsHome = vhm[1].trim();
301
+ vsBody = vsBody.slice(0, vhm.index).trimEnd();
302
+ }
303
+ const pending = vsBody.match(VS_RE);
304
+ if (pending) {
305
+ const a = pending[1].trim();
306
+ const b = pending[2].trim();
307
+ if (a === b) {
308
+ softError(lineNum, `A match can't be "${a}" against itself.`);
309
+ continue;
310
+ }
311
+ const match = {
312
+ p1: a,
313
+ p2: b,
314
+ decided: false,
315
+ score: null,
316
+ side,
317
+ home: vsHome,
318
+ commentary: [],
319
+ lineNumber: lineNum
320
+ };
321
+ matches.push(match);
322
+ commentaryTarget = match;
323
+ commentaryIndent = indent;
324
+ continue;
325
+ }
326
+ const rosterSplit = splitNameAndMeta(
327
+ trimmed,
328
+ registry(),
329
+ metaAliasMap,
330
+ palette,
331
+ result.diagnostics,
332
+ lineNum
333
+ );
334
+ if (Object.keys(rosterSplit.meta).length > 0) {
335
+ const prev = competitorMeta.get(rosterSplit.name) ?? {};
336
+ competitorMeta.set(rosterSplit.name, { ...prev, ...rosterSplit.meta });
337
+ continue;
338
+ }
339
+ warn(lineNum, `Unrecognized line "${trimmed}".`);
340
+ }
341
+ if (result.mode === "double-elim") {
342
+ warn(
343
+ result.titleLineNumber ?? 1,
344
+ "Double-elimination brackets are not yet supported \u2014 rendering the winners\u2019 side only."
345
+ );
346
+ }
347
+ const seedNames = /* @__PURE__ */ new Map();
348
+ for (const s of seeds) {
349
+ const prev = seedNames.get(s.name);
350
+ if (prev !== void 0) {
351
+ softError(
352
+ s.lineNumber,
353
+ `Duplicate competitor "${s.name}" (already seeded on line ${prev}). Rename one \u2014 names are identifiers.`
354
+ );
355
+ } else {
356
+ seedNames.set(s.name, s.lineNumber);
357
+ }
358
+ }
359
+ finalizeAutoTagColors(tagGroups, palette);
360
+ result.sides = sides;
361
+ result.matches = matches;
362
+ result.seeds = seeds;
363
+ result.roundNames = roundDefs;
364
+ result.tagGroups = tagGroups;
365
+ result.competitorMeta = competitorMeta;
366
+ result.activeTag = resolveActiveTagGroup(tagGroups, void 0);
367
+ if (!result.seeded && matches.length === 0) {
368
+ warn(
369
+ result.titleLineNumber ?? 1,
370
+ 'No matches \u2014 add "A beats B" or "A vs B" lines.'
371
+ );
372
+ }
373
+ return result;
374
+ }
375
+
376
+ export {
377
+ parseBracket
378
+ };
379
+ //# sourceMappingURL=chunk-FL4IOQ37.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-I46X5VUA.js";
4
4
  import {
5
5
  tryCollectNote
6
- } from "./chunk-K6HNAY5V.js";
6
+ } from "./chunk-SCHXJTZL.js";
7
7
  import {
8
8
  resolveNotes
9
9
  } from "./chunk-FMDSF3OV.js";
@@ -20,7 +20,7 @@ import {
20
20
  measureIndent,
21
21
  parseFirstLine,
22
22
  tryParseSharedOption
23
- } from "./chunk-ZNQX6QWH.js";
23
+ } from "./chunk-OTAL43EH.js";
24
24
  import {
25
25
  NAME_DIAGNOSTIC_CODES,
26
26
  emit,
@@ -367,8 +367,9 @@ function parseFlowchart(content, palette) {
367
367
  continue;
368
368
  }
369
369
  if (!contentStarted) {
370
- if (/^direction-lr$/i.test(trimmed)) {
371
- result.direction = "LR";
370
+ const dirMatch = trimmed.match(/^direction[-\s]+(lr|tb)$/i);
371
+ if (dirMatch) {
372
+ result.direction = dirMatch[1].toUpperCase();
372
373
  continue;
373
374
  }
374
375
  if (/^solid-fill$/i.test(trimmed)) {
@@ -466,4 +467,4 @@ export {
466
467
  looksLikeFlowchart,
467
468
  extractSymbols
468
469
  };
469
- //# sourceMappingURL=chunk-6VE3VLWM.js.map
470
+ //# sourceMappingURL=chunk-GBE54KY6.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryCollectNote
3
- } from "./chunk-K6HNAY5V.js";
3
+ } from "./chunk-SCHXJTZL.js";
4
4
  import {
5
5
  resolveNotes
6
6
  } from "./chunk-FMDSF3OV.js";
@@ -16,7 +16,7 @@ import {
16
16
  measureIndent,
17
17
  parseFirstLine,
18
18
  tryParseSharedOption
19
- } from "./chunk-ZNQX6QWH.js";
19
+ } from "./chunk-OTAL43EH.js";
20
20
  import {
21
21
  resolveColorWithDiagnostic
22
22
  } from "./chunk-TLVIHFRO.js";
@@ -445,4 +445,4 @@ export {
445
445
  looksLikeClassDiagram,
446
446
  extractSymbols
447
447
  };
448
- //# sourceMappingURL=chunk-ZXL6MB4R.js.map
448
+ //# sourceMappingURL=chunk-GL5UZ6NY.js.map
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YYVTBZZC.js";
8
8
  import {
9
9
  renderIntegratedLegend
10
- } from "./chunk-4UDKKGHH.js";
10
+ } from "./chunk-QUJGFNFN.js";
11
11
  import {
12
12
  getMaxLegendReservedHeight
13
13
  } from "./chunk-7UEMZREK.js";
@@ -1601,4 +1601,4 @@ export {
1601
1601
  renderTechRadar,
1602
1602
  renderTechRadarForExport
1603
1603
  };
1604
- //# sourceMappingURL=chunk-3BIAFYD2.js.map
1604
+ //# sourceMappingURL=chunk-GPWHQ5FJ.js.map