@zettelgeist/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +64 -0
  3. package/dist/bin.js +2211 -0
  4. package/dist/bin.js.map +7 -0
  5. package/dist/templates/export.html +27 -0
  6. package/dist/templates/skill/SKILL.md +220 -0
  7. package/dist/viewer-bundle/architecture-YZFGNWBL-W2K3EQOM.js +14 -0
  8. package/dist/viewer-bundle/architecture-YZFGNWBL-W2K3EQOM.js.map +7 -0
  9. package/dist/viewer-bundle/architectureDiagram-Q4EWVU46-LCGRUEWT.js +8884 -0
  10. package/dist/viewer-bundle/architectureDiagram-Q4EWVU46-LCGRUEWT.js.map +7 -0
  11. package/dist/viewer-bundle/base.css +248 -0
  12. package/dist/viewer-bundle/blockDiagram-DXYQGD6D-KAM7BOAP.js +3777 -0
  13. package/dist/viewer-bundle/blockDiagram-DXYQGD6D-KAM7BOAP.js.map +7 -0
  14. package/dist/viewer-bundle/board.css +370 -0
  15. package/dist/viewer-bundle/c4Diagram-AHTNJAMY-C3FIQYXA.js +2596 -0
  16. package/dist/viewer-bundle/c4Diagram-AHTNJAMY-C3FIQYXA.js.map +7 -0
  17. package/dist/viewer-bundle/chunk-2QXGXAO5.js +68 -0
  18. package/dist/viewer-bundle/chunk-2QXGXAO5.js.map +7 -0
  19. package/dist/viewer-bundle/chunk-5PZT7VUU.js +67 -0
  20. package/dist/viewer-bundle/chunk-5PZT7VUU.js.map +7 -0
  21. package/dist/viewer-bundle/chunk-5YJCJF2C.js +112 -0
  22. package/dist/viewer-bundle/chunk-5YJCJF2C.js.map +7 -0
  23. package/dist/viewer-bundle/chunk-6LYV7PBV.js +1011 -0
  24. package/dist/viewer-bundle/chunk-6LYV7PBV.js.map +7 -0
  25. package/dist/viewer-bundle/chunk-6VW7D5WX.js +48 -0
  26. package/dist/viewer-bundle/chunk-6VW7D5WX.js.map +7 -0
  27. package/dist/viewer-bundle/chunk-76C5OSD4.js +2048 -0
  28. package/dist/viewer-bundle/chunk-76C5OSD4.js.map +7 -0
  29. package/dist/viewer-bundle/chunk-7NZMPQDX.js +6957 -0
  30. package/dist/viewer-bundle/chunk-7NZMPQDX.js.map +7 -0
  31. package/dist/viewer-bundle/chunk-A634GTZN.js +122 -0
  32. package/dist/viewer-bundle/chunk-A634GTZN.js.map +7 -0
  33. package/dist/viewer-bundle/chunk-AJQJUKMU.js +133 -0
  34. package/dist/viewer-bundle/chunk-AJQJUKMU.js.map +7 -0
  35. package/dist/viewer-bundle/chunk-BM2KPNFW.js +5556 -0
  36. package/dist/viewer-bundle/chunk-BM2KPNFW.js.map +7 -0
  37. package/dist/viewer-bundle/chunk-CIDUOCCG.js +25 -0
  38. package/dist/viewer-bundle/chunk-CIDUOCCG.js.map +7 -0
  39. package/dist/viewer-bundle/chunk-CZHJHAOR.js +6397 -0
  40. package/dist/viewer-bundle/chunk-CZHJHAOR.js.map +7 -0
  41. package/dist/viewer-bundle/chunk-D5RLIWY4.js +125 -0
  42. package/dist/viewer-bundle/chunk-D5RLIWY4.js.map +7 -0
  43. package/dist/viewer-bundle/chunk-DI52DQAC.js +44 -0
  44. package/dist/viewer-bundle/chunk-DI52DQAC.js.map +7 -0
  45. package/dist/viewer-bundle/chunk-EXJQLTIV.js +51 -0
  46. package/dist/viewer-bundle/chunk-EXJQLTIV.js.map +7 -0
  47. package/dist/viewer-bundle/chunk-G3PPZWPW.js +96 -0
  48. package/dist/viewer-bundle/chunk-G3PPZWPW.js.map +7 -0
  49. package/dist/viewer-bundle/chunk-GTW4IDD4.js +30297 -0
  50. package/dist/viewer-bundle/chunk-GTW4IDD4.js.map +7 -0
  51. package/dist/viewer-bundle/chunk-GVE7OA3Z.js +59 -0
  52. package/dist/viewer-bundle/chunk-GVE7OA3Z.js.map +7 -0
  53. package/dist/viewer-bundle/chunk-JBUVKVPY.js +2042 -0
  54. package/dist/viewer-bundle/chunk-JBUVKVPY.js.map +7 -0
  55. package/dist/viewer-bundle/chunk-JQLVOAQB.js +20 -0
  56. package/dist/viewer-bundle/chunk-JQLVOAQB.js.map +7 -0
  57. package/dist/viewer-bundle/chunk-LQMQSYLO.js +101 -0
  58. package/dist/viewer-bundle/chunk-LQMQSYLO.js.map +7 -0
  59. package/dist/viewer-bundle/chunk-MBFAQ3IK.js +34 -0
  60. package/dist/viewer-bundle/chunk-MBFAQ3IK.js.map +7 -0
  61. package/dist/viewer-bundle/chunk-N7G7IIKG.js +25 -0
  62. package/dist/viewer-bundle/chunk-N7G7IIKG.js.map +7 -0
  63. package/dist/viewer-bundle/chunk-NW4YG3NS.js +171 -0
  64. package/dist/viewer-bundle/chunk-NW4YG3NS.js.map +7 -0
  65. package/dist/viewer-bundle/chunk-ODEP5TKB.js +61 -0
  66. package/dist/viewer-bundle/chunk-ODEP5TKB.js.map +7 -0
  67. package/dist/viewer-bundle/chunk-OGKINV23.js +1050 -0
  68. package/dist/viewer-bundle/chunk-OGKINV23.js.map +7 -0
  69. package/dist/viewer-bundle/chunk-OGMSNDVH.js +1994 -0
  70. package/dist/viewer-bundle/chunk-OGMSNDVH.js.map +7 -0
  71. package/dist/viewer-bundle/chunk-QJVSDNAW.js +25 -0
  72. package/dist/viewer-bundle/chunk-QJVSDNAW.js.map +7 -0
  73. package/dist/viewer-bundle/chunk-RBTT26R4.js +2721 -0
  74. package/dist/viewer-bundle/chunk-RBTT26R4.js.map +7 -0
  75. package/dist/viewer-bundle/chunk-RQIPIIE2.js +48 -0
  76. package/dist/viewer-bundle/chunk-RQIPIIE2.js.map +7 -0
  77. package/dist/viewer-bundle/chunk-SRTYTXTX.js +22 -0
  78. package/dist/viewer-bundle/chunk-SRTYTXTX.js.map +7 -0
  79. package/dist/viewer-bundle/chunk-TRL7YIZG.js +1663 -0
  80. package/dist/viewer-bundle/chunk-TRL7YIZG.js.map +7 -0
  81. package/dist/viewer-bundle/chunk-U5T7X4BV.js +172 -0
  82. package/dist/viewer-bundle/chunk-U5T7X4BV.js.map +7 -0
  83. package/dist/viewer-bundle/chunk-UCAW6C6C.js +48 -0
  84. package/dist/viewer-bundle/chunk-UCAW6C6C.js.map +7 -0
  85. package/dist/viewer-bundle/chunk-UEAG4BJQ.js +93 -0
  86. package/dist/viewer-bundle/chunk-UEAG4BJQ.js.map +7 -0
  87. package/dist/viewer-bundle/chunk-UVRE3R6A.js +1039 -0
  88. package/dist/viewer-bundle/chunk-UVRE3R6A.js.map +7 -0
  89. package/dist/viewer-bundle/chunk-VODO7SV4.js +25029 -0
  90. package/dist/viewer-bundle/chunk-VODO7SV4.js.map +7 -0
  91. package/dist/viewer-bundle/chunk-YEU62MVS.js +682 -0
  92. package/dist/viewer-bundle/chunk-YEU62MVS.js.map +7 -0
  93. package/dist/viewer-bundle/chunk-YFQT7PPW.js +987 -0
  94. package/dist/viewer-bundle/chunk-YFQT7PPW.js.map +7 -0
  95. package/dist/viewer-bundle/chunk-Z4G7FG27.js +48 -0
  96. package/dist/viewer-bundle/chunk-Z4G7FG27.js.map +7 -0
  97. package/dist/viewer-bundle/chunk-ZW4Y7DIF.js +2044 -0
  98. package/dist/viewer-bundle/chunk-ZW4Y7DIF.js.map +7 -0
  99. package/dist/viewer-bundle/classDiagram-6PBFFD2Q-7VKYXLUX.js +46 -0
  100. package/dist/viewer-bundle/classDiagram-6PBFFD2Q-7VKYXLUX.js.map +7 -0
  101. package/dist/viewer-bundle/classDiagram-v2-HSJHXN6E-ACCNN7EN.js +46 -0
  102. package/dist/viewer-bundle/classDiagram-v2-HSJHXN6E-ACCNN7EN.js.map +7 -0
  103. package/dist/viewer-bundle/cose-bilkent-S5V4N54A-MUJHAA34.js +5009 -0
  104. package/dist/viewer-bundle/cose-bilkent-S5V4N54A-MUJHAA34.js.map +7 -0
  105. package/dist/viewer-bundle/dagre-KV5264BT-YC5VV3WF.js +739 -0
  106. package/dist/viewer-bundle/dagre-KV5264BT-YC5VV3WF.js.map +7 -0
  107. package/dist/viewer-bundle/dark.css +13 -0
  108. package/dist/viewer-bundle/detail.css +539 -0
  109. package/dist/viewer-bundle/diagram-5BDNPKRD-RXFPVFYK.js +214 -0
  110. package/dist/viewer-bundle/diagram-5BDNPKRD-RXFPVFYK.js.map +7 -0
  111. package/dist/viewer-bundle/diagram-G4DWMVQ6-KN7CBNBQ.js +578 -0
  112. package/dist/viewer-bundle/diagram-G4DWMVQ6-KN7CBNBQ.js.map +7 -0
  113. package/dist/viewer-bundle/diagram-MMDJMWI5-ZN6TQ7ZC.js +345 -0
  114. package/dist/viewer-bundle/diagram-MMDJMWI5-ZN6TQ7ZC.js.map +7 -0
  115. package/dist/viewer-bundle/diagram-TYMM5635-MMTUJ4KA.js +255 -0
  116. package/dist/viewer-bundle/diagram-TYMM5635-MMTUJ4KA.js.map +7 -0
  117. package/dist/viewer-bundle/docs.css +88 -0
  118. package/dist/viewer-bundle/edit-modal-BEGC2AO6.js +176 -0
  119. package/dist/viewer-bundle/edit-modal-BEGC2AO6.js.map +7 -0
  120. package/dist/viewer-bundle/erDiagram-SMLLAGMA-TBHMLD2E.js +1349 -0
  121. package/dist/viewer-bundle/erDiagram-SMLLAGMA-TBHMLD2E.js.map +7 -0
  122. package/dist/viewer-bundle/flowDiagram-DWJPFMVM-BZHLK6QB.js +2501 -0
  123. package/dist/viewer-bundle/flowDiagram-DWJPFMVM-BZHLK6QB.js.map +7 -0
  124. package/dist/viewer-bundle/ganttDiagram-T4ZO3ILL-YBARPTQR.js +2654 -0
  125. package/dist/viewer-bundle/ganttDiagram-T4ZO3ILL-YBARPTQR.js.map +7 -0
  126. package/dist/viewer-bundle/gitGraph-7Q5UKJZL-HENKIQDX.js +14 -0
  127. package/dist/viewer-bundle/gitGraph-7Q5UKJZL-HENKIQDX.js.map +7 -0
  128. package/dist/viewer-bundle/gitGraphDiagram-UUTBAWPF-M4VV3YVA.js +1946 -0
  129. package/dist/viewer-bundle/gitGraphDiagram-UUTBAWPF-M4VV3YVA.js.map +7 -0
  130. package/dist/viewer-bundle/index.html +28 -0
  131. package/dist/viewer-bundle/info-OMHHGYJF-E773USRS.js +14 -0
  132. package/dist/viewer-bundle/info-OMHHGYJF-E773USRS.js.map +7 -0
  133. package/dist/viewer-bundle/infoDiagram-42DDH7IO-C7JGUXKK.js +59 -0
  134. package/dist/viewer-bundle/infoDiagram-42DDH7IO-C7JGUXKK.js.map +7 -0
  135. package/dist/viewer-bundle/ishikawaDiagram-UXIWVN3A-YBC4X4VB.js +1012 -0
  136. package/dist/viewer-bundle/ishikawaDiagram-UXIWVN3A-YBC4X4VB.js.map +7 -0
  137. package/dist/viewer-bundle/journeyDiagram-VCZTEJTY-6WKVEOOO.js +1303 -0
  138. package/dist/viewer-bundle/journeyDiagram-VCZTEJTY-6WKVEOOO.js.map +7 -0
  139. package/dist/viewer-bundle/kanban-definition-6JOO6SKY-URTTHHO4.js +1131 -0
  140. package/dist/viewer-bundle/kanban-definition-6JOO6SKY-URTTHHO4.js.map +7 -0
  141. package/dist/viewer-bundle/katex-QN5266ZE.js +14318 -0
  142. package/dist/viewer-bundle/katex-QN5266ZE.js.map +7 -0
  143. package/dist/viewer-bundle/light.css +15 -0
  144. package/dist/viewer-bundle/main.js +4816 -0
  145. package/dist/viewer-bundle/main.js.map +7 -0
  146. package/dist/viewer-bundle/mermaid.core-AEBXU2JK.js +1708 -0
  147. package/dist/viewer-bundle/mermaid.core-AEBXU2JK.js.map +7 -0
  148. package/dist/viewer-bundle/mindmap-definition-QFDTVHPH-KUMAMRSF.js +1277 -0
  149. package/dist/viewer-bundle/mindmap-definition-QFDTVHPH-KUMAMRSF.js.map +7 -0
  150. package/dist/viewer-bundle/packet-4T2RLAQJ-IRYWWA66.js +14 -0
  151. package/dist/viewer-bundle/packet-4T2RLAQJ-IRYWWA66.js.map +7 -0
  152. package/dist/viewer-bundle/pico.classless.min.css +4 -0
  153. package/dist/viewer-bundle/pie-ZZUOXDRM-JYO4VL5N.js +14 -0
  154. package/dist/viewer-bundle/pie-ZZUOXDRM-JYO4VL5N.js.map +7 -0
  155. package/dist/viewer-bundle/pieDiagram-DEJITSTG-QOEHQN3N.js +238 -0
  156. package/dist/viewer-bundle/pieDiagram-DEJITSTG-QOEHQN3N.js.map +7 -0
  157. package/dist/viewer-bundle/prompt-modal-C4LHI7BS.js +12 -0
  158. package/dist/viewer-bundle/prompt-modal-C4LHI7BS.js.map +7 -0
  159. package/dist/viewer-bundle/quadrantDiagram-34T5L4WZ-SJNPUU5N.js +1409 -0
  160. package/dist/viewer-bundle/quadrantDiagram-34T5L4WZ-SJNPUU5N.js.map +7 -0
  161. package/dist/viewer-bundle/radar-PYXPWWZC-45BRYQSB.js +14 -0
  162. package/dist/viewer-bundle/radar-PYXPWWZC-45BRYQSB.js.map +7 -0
  163. package/dist/viewer-bundle/reason-modal-MK34MQ73.js +68 -0
  164. package/dist/viewer-bundle/reason-modal-MK34MQ73.js.map +7 -0
  165. package/dist/viewer-bundle/requirementDiagram-MS252O5E-UOMT3FCC.js +1311 -0
  166. package/dist/viewer-bundle/requirementDiagram-MS252O5E-UOMT3FCC.js.map +7 -0
  167. package/dist/viewer-bundle/sankeyDiagram-XADWPNL6-LAVJ5C6A.js +1263 -0
  168. package/dist/viewer-bundle/sankeyDiagram-XADWPNL6-LAVJ5C6A.js.map +7 -0
  169. package/dist/viewer-bundle/sequenceDiagram-FGHM5R23-3IWTOUNQ.js +4655 -0
  170. package/dist/viewer-bundle/sequenceDiagram-FGHM5R23-3IWTOUNQ.js.map +7 -0
  171. package/dist/viewer-bundle/stateDiagram-FHFEXIEX-S2OVQQON.js +495 -0
  172. package/dist/viewer-bundle/stateDiagram-FHFEXIEX-S2OVQQON.js.map +7 -0
  173. package/dist/viewer-bundle/stateDiagram-v2-QKLJ7IA2-XNZ3XXSV.js +44 -0
  174. package/dist/viewer-bundle/stateDiagram-v2-QKLJ7IA2-XNZ3XXSV.js.map +7 -0
  175. package/dist/viewer-bundle/timeline-definition-GMOUNBTQ-FHVZ7MHE.js +1646 -0
  176. package/dist/viewer-bundle/timeline-definition-GMOUNBTQ-FHVZ7MHE.js.map +7 -0
  177. package/dist/viewer-bundle/treeView-SZITEDCU-RXZXNYAM.js +14 -0
  178. package/dist/viewer-bundle/treeView-SZITEDCU-RXZXNYAM.js.map +7 -0
  179. package/dist/viewer-bundle/treemap-W4RFUUIX-2IGOFSJM.js +14 -0
  180. package/dist/viewer-bundle/treemap-W4RFUUIX-2IGOFSJM.js.map +7 -0
  181. package/dist/viewer-bundle/vennDiagram-DHZGUBPP-HEAOEXEZ.js +2544 -0
  182. package/dist/viewer-bundle/vennDiagram-DHZGUBPP-HEAOEXEZ.js.map +7 -0
  183. package/dist/viewer-bundle/wardley-RL74JXVD-VSPCLOX2.js +14 -0
  184. package/dist/viewer-bundle/wardley-RL74JXVD-VSPCLOX2.js.map +7 -0
  185. package/dist/viewer-bundle/wardleyDiagram-NUSXRM2D-EBY4FG3X.js +938 -0
  186. package/dist/viewer-bundle/wardleyDiagram-NUSXRM2D-EBY4FG3X.js.map +7 -0
  187. package/dist/viewer-bundle/xychartDiagram-5P7HB3ND-SSMUQEXK.js +1952 -0
  188. package/dist/viewer-bundle/xychartDiagram-5P7HB3ND-SSMUQEXK.js.map +7 -0
  189. package/package.json +51 -0
@@ -0,0 +1,1646 @@
1
+ import {
2
+ selectSvgElement
3
+ } from "./chunk-N7G7IIKG.js";
4
+ import {
5
+ parseFontSize
6
+ } from "./chunk-UVRE3R6A.js";
7
+ import "./chunk-G3PPZWPW.js";
8
+ import {
9
+ clear,
10
+ commonDb_exports,
11
+ darken_default,
12
+ getConfig,
13
+ getConfig2,
14
+ is_dark_default,
15
+ lighten_default,
16
+ setupGraphViewbox
17
+ } from "./chunk-7NZMPQDX.js";
18
+ import "./chunk-YEU62MVS.js";
19
+ import {
20
+ __export,
21
+ __name,
22
+ arc_default,
23
+ log,
24
+ select_default
25
+ } from "./chunk-CZHJHAOR.js";
26
+ import "./chunk-DI52DQAC.js";
27
+
28
+ // ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.mjs
29
+ var parser = function() {
30
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
31
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
32
+ return o2;
33
+ }, "o"), $V0 = [6, 11, 13, 14, 15, 17, 19, 20, 23, 24], $V1 = [1, 12], $V2 = [1, 13], $V3 = [1, 14], $V4 = [1, 15], $V5 = [1, 16], $V6 = [1, 19], $V7 = [1, 20];
34
+ var parser2 = {
35
+ trace: /* @__PURE__ */ __name(function trace() {
36
+ }, "trace"),
37
+ yy: {},
38
+ symbols_: { "error": 2, "start": 3, "timeline_header": 4, "document": 5, "EOF": 6, "timeline": 7, "timeline_lr": 8, "timeline_td": 9, "line": 10, "SPACE": 11, "statement": 12, "NEWLINE": 13, "title": 14, "acc_title": 15, "acc_title_value": 16, "acc_descr": 17, "acc_descr_value": 18, "acc_descr_multiline_value": 19, "section": 20, "period_statement": 21, "event_statement": 22, "period": 23, "event": 24, "$accept": 0, "$end": 1 },
39
+ terminals_: { 2: "error", 6: "EOF", 7: "timeline", 8: "timeline_lr", 9: "timeline_td", 11: "SPACE", 13: "NEWLINE", 14: "title", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 23: "period", 24: "event" },
40
+ productions_: [0, [3, 3], [4, 1], [4, 1], [4, 1], [5, 0], [5, 2], [10, 2], [10, 1], [10, 1], [10, 1], [12, 1], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [21, 1], [22, 1]],
41
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
42
+ var $0 = $$.length - 1;
43
+ switch (yystate) {
44
+ case 1:
45
+ return $$[$0 - 1];
46
+ break;
47
+ case 3:
48
+ yy.setDirection("LR");
49
+ break;
50
+ case 4:
51
+ yy.setDirection("TD");
52
+ break;
53
+ case 5:
54
+ this.$ = [];
55
+ break;
56
+ case 6:
57
+ $$[$0 - 1].push($$[$0]);
58
+ this.$ = $$[$0 - 1];
59
+ break;
60
+ case 7:
61
+ case 8:
62
+ this.$ = $$[$0];
63
+ break;
64
+ case 9:
65
+ case 10:
66
+ this.$ = [];
67
+ break;
68
+ case 11:
69
+ yy.getCommonDb().setDiagramTitle($$[$0].substr(6));
70
+ this.$ = $$[$0].substr(6);
71
+ break;
72
+ case 12:
73
+ this.$ = $$[$0].trim();
74
+ yy.getCommonDb().setAccTitle(this.$);
75
+ break;
76
+ case 13:
77
+ case 14:
78
+ this.$ = $$[$0].trim();
79
+ yy.getCommonDb().setAccDescription(this.$);
80
+ break;
81
+ case 15:
82
+ yy.addSection($$[$0].substr(8));
83
+ this.$ = $$[$0].substr(8);
84
+ break;
85
+ case 18:
86
+ yy.addTask($$[$0], 0, "");
87
+ this.$ = $$[$0];
88
+ break;
89
+ case 19:
90
+ yy.addEvent($$[$0].substr(2));
91
+ this.$ = $$[$0];
92
+ break;
93
+ }
94
+ }, "anonymous"),
95
+ table: [{ 3: 1, 4: 2, 7: [1, 3], 8: [1, 4], 9: [1, 5] }, { 1: [3] }, o($V0, [2, 5], { 5: 6 }), o($V0, [2, 2]), o($V0, [2, 3]), o($V0, [2, 4]), { 6: [1, 7], 10: 8, 11: [1, 9], 12: 10, 13: [1, 11], 14: $V1, 15: $V2, 17: $V3, 19: $V4, 20: $V5, 21: 17, 22: 18, 23: $V6, 24: $V7 }, o($V0, [2, 10], { 1: [2, 1] }), o($V0, [2, 6]), { 12: 21, 14: $V1, 15: $V2, 17: $V3, 19: $V4, 20: $V5, 21: 17, 22: 18, 23: $V6, 24: $V7 }, o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 11]), { 16: [1, 22] }, { 18: [1, 23] }, o($V0, [2, 14]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), o($V0, [2, 18]), o($V0, [2, 19]), o($V0, [2, 7]), o($V0, [2, 12]), o($V0, [2, 13])],
96
+ defaultActions: {},
97
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
98
+ if (hash.recoverable) {
99
+ this.trace(str);
100
+ } else {
101
+ var error = new Error(str);
102
+ error.hash = hash;
103
+ throw error;
104
+ }
105
+ }, "parseError"),
106
+ parse: /* @__PURE__ */ __name(function parse(input) {
107
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
108
+ var args = lstack.slice.call(arguments, 1);
109
+ var lexer2 = Object.create(this.lexer);
110
+ var sharedState = { yy: {} };
111
+ for (var k in this.yy) {
112
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
113
+ sharedState.yy[k] = this.yy[k];
114
+ }
115
+ }
116
+ lexer2.setInput(input, sharedState.yy);
117
+ sharedState.yy.lexer = lexer2;
118
+ sharedState.yy.parser = this;
119
+ if (typeof lexer2.yylloc == "undefined") {
120
+ lexer2.yylloc = {};
121
+ }
122
+ var yyloc = lexer2.yylloc;
123
+ lstack.push(yyloc);
124
+ var ranges = lexer2.options && lexer2.options.ranges;
125
+ if (typeof sharedState.yy.parseError === "function") {
126
+ this.parseError = sharedState.yy.parseError;
127
+ } else {
128
+ this.parseError = Object.getPrototypeOf(this).parseError;
129
+ }
130
+ function popStack(n) {
131
+ stack.length = stack.length - 2 * n;
132
+ vstack.length = vstack.length - n;
133
+ lstack.length = lstack.length - n;
134
+ }
135
+ __name(popStack, "popStack");
136
+ function lex() {
137
+ var token;
138
+ token = tstack.pop() || lexer2.lex() || EOF;
139
+ if (typeof token !== "number") {
140
+ if (token instanceof Array) {
141
+ tstack = token;
142
+ token = tstack.pop();
143
+ }
144
+ token = self.symbols_[token] || token;
145
+ }
146
+ return token;
147
+ }
148
+ __name(lex, "lex");
149
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
150
+ while (true) {
151
+ state = stack[stack.length - 1];
152
+ if (this.defaultActions[state]) {
153
+ action = this.defaultActions[state];
154
+ } else {
155
+ if (symbol === null || typeof symbol == "undefined") {
156
+ symbol = lex();
157
+ }
158
+ action = table[state] && table[state][symbol];
159
+ }
160
+ if (typeof action === "undefined" || !action.length || !action[0]) {
161
+ var errStr = "";
162
+ expected = [];
163
+ for (p in table[state]) {
164
+ if (this.terminals_[p] && p > TERROR) {
165
+ expected.push("'" + this.terminals_[p] + "'");
166
+ }
167
+ }
168
+ if (lexer2.showPosition) {
169
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
170
+ } else {
171
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
172
+ }
173
+ this.parseError(errStr, {
174
+ text: lexer2.match,
175
+ token: this.terminals_[symbol] || symbol,
176
+ line: lexer2.yylineno,
177
+ loc: yyloc,
178
+ expected
179
+ });
180
+ }
181
+ if (action[0] instanceof Array && action.length > 1) {
182
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
183
+ }
184
+ switch (action[0]) {
185
+ case 1:
186
+ stack.push(symbol);
187
+ vstack.push(lexer2.yytext);
188
+ lstack.push(lexer2.yylloc);
189
+ stack.push(action[1]);
190
+ symbol = null;
191
+ if (!preErrorSymbol) {
192
+ yyleng = lexer2.yyleng;
193
+ yytext = lexer2.yytext;
194
+ yylineno = lexer2.yylineno;
195
+ yyloc = lexer2.yylloc;
196
+ if (recovering > 0) {
197
+ recovering--;
198
+ }
199
+ } else {
200
+ symbol = preErrorSymbol;
201
+ preErrorSymbol = null;
202
+ }
203
+ break;
204
+ case 2:
205
+ len = this.productions_[action[1]][1];
206
+ yyval.$ = vstack[vstack.length - len];
207
+ yyval._$ = {
208
+ first_line: lstack[lstack.length - (len || 1)].first_line,
209
+ last_line: lstack[lstack.length - 1].last_line,
210
+ first_column: lstack[lstack.length - (len || 1)].first_column,
211
+ last_column: lstack[lstack.length - 1].last_column
212
+ };
213
+ if (ranges) {
214
+ yyval._$.range = [
215
+ lstack[lstack.length - (len || 1)].range[0],
216
+ lstack[lstack.length - 1].range[1]
217
+ ];
218
+ }
219
+ r = this.performAction.apply(yyval, [
220
+ yytext,
221
+ yyleng,
222
+ yylineno,
223
+ sharedState.yy,
224
+ action[1],
225
+ vstack,
226
+ lstack
227
+ ].concat(args));
228
+ if (typeof r !== "undefined") {
229
+ return r;
230
+ }
231
+ if (len) {
232
+ stack = stack.slice(0, -1 * len * 2);
233
+ vstack = vstack.slice(0, -1 * len);
234
+ lstack = lstack.slice(0, -1 * len);
235
+ }
236
+ stack.push(this.productions_[action[1]][0]);
237
+ vstack.push(yyval.$);
238
+ lstack.push(yyval._$);
239
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
240
+ stack.push(newState);
241
+ break;
242
+ case 3:
243
+ return true;
244
+ }
245
+ }
246
+ return true;
247
+ }, "parse")
248
+ };
249
+ var lexer = /* @__PURE__ */ function() {
250
+ var lexer2 = {
251
+ EOF: 1,
252
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
253
+ if (this.yy.parser) {
254
+ this.yy.parser.parseError(str, hash);
255
+ } else {
256
+ throw new Error(str);
257
+ }
258
+ }, "parseError"),
259
+ // resets the lexer, sets new input
260
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
261
+ this.yy = yy || this.yy || {};
262
+ this._input = input;
263
+ this._more = this._backtrack = this.done = false;
264
+ this.yylineno = this.yyleng = 0;
265
+ this.yytext = this.matched = this.match = "";
266
+ this.conditionStack = ["INITIAL"];
267
+ this.yylloc = {
268
+ first_line: 1,
269
+ first_column: 0,
270
+ last_line: 1,
271
+ last_column: 0
272
+ };
273
+ if (this.options.ranges) {
274
+ this.yylloc.range = [0, 0];
275
+ }
276
+ this.offset = 0;
277
+ return this;
278
+ }, "setInput"),
279
+ // consumes and returns one char from the input
280
+ input: /* @__PURE__ */ __name(function() {
281
+ var ch = this._input[0];
282
+ this.yytext += ch;
283
+ this.yyleng++;
284
+ this.offset++;
285
+ this.match += ch;
286
+ this.matched += ch;
287
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
288
+ if (lines) {
289
+ this.yylineno++;
290
+ this.yylloc.last_line++;
291
+ } else {
292
+ this.yylloc.last_column++;
293
+ }
294
+ if (this.options.ranges) {
295
+ this.yylloc.range[1]++;
296
+ }
297
+ this._input = this._input.slice(1);
298
+ return ch;
299
+ }, "input"),
300
+ // unshifts one char (or a string) into the input
301
+ unput: /* @__PURE__ */ __name(function(ch) {
302
+ var len = ch.length;
303
+ var lines = ch.split(/(?:\r\n?|\n)/g);
304
+ this._input = ch + this._input;
305
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
306
+ this.offset -= len;
307
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
308
+ this.match = this.match.substr(0, this.match.length - 1);
309
+ this.matched = this.matched.substr(0, this.matched.length - 1);
310
+ if (lines.length - 1) {
311
+ this.yylineno -= lines.length - 1;
312
+ }
313
+ var r = this.yylloc.range;
314
+ this.yylloc = {
315
+ first_line: this.yylloc.first_line,
316
+ last_line: this.yylineno + 1,
317
+ first_column: this.yylloc.first_column,
318
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
319
+ };
320
+ if (this.options.ranges) {
321
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
322
+ }
323
+ this.yyleng = this.yytext.length;
324
+ return this;
325
+ }, "unput"),
326
+ // When called from action, caches matched text and appends it on next action
327
+ more: /* @__PURE__ */ __name(function() {
328
+ this._more = true;
329
+ return this;
330
+ }, "more"),
331
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
332
+ reject: /* @__PURE__ */ __name(function() {
333
+ if (this.options.backtrack_lexer) {
334
+ this._backtrack = true;
335
+ } else {
336
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
337
+ text: "",
338
+ token: null,
339
+ line: this.yylineno
340
+ });
341
+ }
342
+ return this;
343
+ }, "reject"),
344
+ // retain first n characters of the match
345
+ less: /* @__PURE__ */ __name(function(n) {
346
+ this.unput(this.match.slice(n));
347
+ }, "less"),
348
+ // displays already matched input, i.e. for error messages
349
+ pastInput: /* @__PURE__ */ __name(function() {
350
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
351
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
352
+ }, "pastInput"),
353
+ // displays upcoming input, i.e. for error messages
354
+ upcomingInput: /* @__PURE__ */ __name(function() {
355
+ var next = this.match;
356
+ if (next.length < 20) {
357
+ next += this._input.substr(0, 20 - next.length);
358
+ }
359
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
360
+ }, "upcomingInput"),
361
+ // displays the character position where the lexing error occurred, i.e. for error messages
362
+ showPosition: /* @__PURE__ */ __name(function() {
363
+ var pre = this.pastInput();
364
+ var c = new Array(pre.length + 1).join("-");
365
+ return pre + this.upcomingInput() + "\n" + c + "^";
366
+ }, "showPosition"),
367
+ // test the lexed token: return FALSE when not a match, otherwise return token
368
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
369
+ var token, lines, backup;
370
+ if (this.options.backtrack_lexer) {
371
+ backup = {
372
+ yylineno: this.yylineno,
373
+ yylloc: {
374
+ first_line: this.yylloc.first_line,
375
+ last_line: this.last_line,
376
+ first_column: this.yylloc.first_column,
377
+ last_column: this.yylloc.last_column
378
+ },
379
+ yytext: this.yytext,
380
+ match: this.match,
381
+ matches: this.matches,
382
+ matched: this.matched,
383
+ yyleng: this.yyleng,
384
+ offset: this.offset,
385
+ _more: this._more,
386
+ _input: this._input,
387
+ yy: this.yy,
388
+ conditionStack: this.conditionStack.slice(0),
389
+ done: this.done
390
+ };
391
+ if (this.options.ranges) {
392
+ backup.yylloc.range = this.yylloc.range.slice(0);
393
+ }
394
+ }
395
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
396
+ if (lines) {
397
+ this.yylineno += lines.length;
398
+ }
399
+ this.yylloc = {
400
+ first_line: this.yylloc.last_line,
401
+ last_line: this.yylineno + 1,
402
+ first_column: this.yylloc.last_column,
403
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
404
+ };
405
+ this.yytext += match[0];
406
+ this.match += match[0];
407
+ this.matches = match;
408
+ this.yyleng = this.yytext.length;
409
+ if (this.options.ranges) {
410
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
411
+ }
412
+ this._more = false;
413
+ this._backtrack = false;
414
+ this._input = this._input.slice(match[0].length);
415
+ this.matched += match[0];
416
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
417
+ if (this.done && this._input) {
418
+ this.done = false;
419
+ }
420
+ if (token) {
421
+ return token;
422
+ } else if (this._backtrack) {
423
+ for (var k in backup) {
424
+ this[k] = backup[k];
425
+ }
426
+ return false;
427
+ }
428
+ return false;
429
+ }, "test_match"),
430
+ // return next match in input
431
+ next: /* @__PURE__ */ __name(function() {
432
+ if (this.done) {
433
+ return this.EOF;
434
+ }
435
+ if (!this._input) {
436
+ this.done = true;
437
+ }
438
+ var token, match, tempMatch, index;
439
+ if (!this._more) {
440
+ this.yytext = "";
441
+ this.match = "";
442
+ }
443
+ var rules = this._currentRules();
444
+ for (var i = 0; i < rules.length; i++) {
445
+ tempMatch = this._input.match(this.rules[rules[i]]);
446
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
447
+ match = tempMatch;
448
+ index = i;
449
+ if (this.options.backtrack_lexer) {
450
+ token = this.test_match(tempMatch, rules[i]);
451
+ if (token !== false) {
452
+ return token;
453
+ } else if (this._backtrack) {
454
+ match = false;
455
+ continue;
456
+ } else {
457
+ return false;
458
+ }
459
+ } else if (!this.options.flex) {
460
+ break;
461
+ }
462
+ }
463
+ }
464
+ if (match) {
465
+ token = this.test_match(match, rules[index]);
466
+ if (token !== false) {
467
+ return token;
468
+ }
469
+ return false;
470
+ }
471
+ if (this._input === "") {
472
+ return this.EOF;
473
+ } else {
474
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
475
+ text: "",
476
+ token: null,
477
+ line: this.yylineno
478
+ });
479
+ }
480
+ }, "next"),
481
+ // return next match that has a token
482
+ lex: /* @__PURE__ */ __name(function lex() {
483
+ var r = this.next();
484
+ if (r) {
485
+ return r;
486
+ } else {
487
+ return this.lex();
488
+ }
489
+ }, "lex"),
490
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
491
+ begin: /* @__PURE__ */ __name(function begin(condition) {
492
+ this.conditionStack.push(condition);
493
+ }, "begin"),
494
+ // pop the previously active lexer condition state off the condition stack
495
+ popState: /* @__PURE__ */ __name(function popState() {
496
+ var n = this.conditionStack.length - 1;
497
+ if (n > 0) {
498
+ return this.conditionStack.pop();
499
+ } else {
500
+ return this.conditionStack[0];
501
+ }
502
+ }, "popState"),
503
+ // produce the lexer rule set which is active for the currently active lexer condition state
504
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
505
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
506
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
507
+ } else {
508
+ return this.conditions["INITIAL"].rules;
509
+ }
510
+ }, "_currentRules"),
511
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
512
+ topState: /* @__PURE__ */ __name(function topState(n) {
513
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
514
+ if (n >= 0) {
515
+ return this.conditionStack[n];
516
+ } else {
517
+ return "INITIAL";
518
+ }
519
+ }, "topState"),
520
+ // alias for begin(condition)
521
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
522
+ this.begin(condition);
523
+ }, "pushState"),
524
+ // return the number of states currently on the stack
525
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
526
+ return this.conditionStack.length;
527
+ }, "stateStackSize"),
528
+ options: { "case-insensitive": true },
529
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
530
+ var YYSTATE = YY_START;
531
+ switch ($avoiding_name_collisions) {
532
+ case 0:
533
+ break;
534
+ case 1:
535
+ break;
536
+ case 2:
537
+ return 13;
538
+ break;
539
+ case 3:
540
+ break;
541
+ case 4:
542
+ break;
543
+ case 5:
544
+ return 8;
545
+ break;
546
+ case 6:
547
+ return 9;
548
+ break;
549
+ case 7:
550
+ return 7;
551
+ break;
552
+ case 8:
553
+ return 14;
554
+ break;
555
+ case 9:
556
+ this.begin("acc_title");
557
+ return 15;
558
+ break;
559
+ case 10:
560
+ this.popState();
561
+ return "acc_title_value";
562
+ break;
563
+ case 11:
564
+ this.begin("acc_descr");
565
+ return 17;
566
+ break;
567
+ case 12:
568
+ this.popState();
569
+ return "acc_descr_value";
570
+ break;
571
+ case 13:
572
+ this.begin("acc_descr_multiline");
573
+ break;
574
+ case 14:
575
+ this.popState();
576
+ break;
577
+ case 15:
578
+ return "acc_descr_multiline_value";
579
+ break;
580
+ case 16:
581
+ return 20;
582
+ break;
583
+ case 17:
584
+ return 24;
585
+ break;
586
+ case 18:
587
+ return 23;
588
+ break;
589
+ case 19:
590
+ return 6;
591
+ break;
592
+ case 20:
593
+ return "INVALID";
594
+ break;
595
+ }
596
+ }, "anonymous"),
597
+ rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline[ \t]+LR\b)/i, /^(?:timeline[ \t]+TD\b)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s(?:[^:\n]|:(?!\s))+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i],
598
+ conditions: { "acc_descr_multiline": { "rules": [14, 15], "inclusive": false }, "acc_descr": { "rules": [12], "inclusive": false }, "acc_title": { "rules": [10], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 16, 17, 18, 19, 20], "inclusive": true } }
599
+ };
600
+ return lexer2;
601
+ }();
602
+ parser2.lexer = lexer;
603
+ function Parser() {
604
+ this.yy = {};
605
+ }
606
+ __name(Parser, "Parser");
607
+ Parser.prototype = parser2;
608
+ parser2.Parser = Parser;
609
+ return new Parser();
610
+ }();
611
+ parser.parser = parser;
612
+ var timeline_default = parser;
613
+ var timelineDb_exports = {};
614
+ __export(timelineDb_exports, {
615
+ addEvent: () => addEvent,
616
+ addSection: () => addSection,
617
+ addTask: () => addTask,
618
+ addTaskOrg: () => addTaskOrg,
619
+ clear: () => clear2,
620
+ default: () => timelineDb_default,
621
+ getCommonDb: () => getCommonDb,
622
+ getDirection: () => getDirection,
623
+ getSections: () => getSections,
624
+ getTasks: () => getTasks,
625
+ setDirection: () => setDirection
626
+ });
627
+ var currentSection = "";
628
+ var currentTaskId = 0;
629
+ var direction = "LR";
630
+ var sections = [];
631
+ var tasks = [];
632
+ var rawTasks = [];
633
+ var getCommonDb = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb");
634
+ var clear2 = /* @__PURE__ */ __name(function() {
635
+ sections.length = 0;
636
+ tasks.length = 0;
637
+ currentSection = "";
638
+ rawTasks.length = 0;
639
+ direction = "LR";
640
+ clear();
641
+ }, "clear");
642
+ var setDirection = /* @__PURE__ */ __name(function(dir) {
643
+ direction = dir;
644
+ }, "setDirection");
645
+ var getDirection = /* @__PURE__ */ __name(function() {
646
+ return direction;
647
+ }, "getDirection");
648
+ var addSection = /* @__PURE__ */ __name(function(txt) {
649
+ currentSection = txt;
650
+ sections.push(txt);
651
+ }, "addSection");
652
+ var getSections = /* @__PURE__ */ __name(function() {
653
+ return sections;
654
+ }, "getSections");
655
+ var getTasks = /* @__PURE__ */ __name(function() {
656
+ let allItemsProcessed = compileTasks();
657
+ const maxDepth = 100;
658
+ let iterationCount = 0;
659
+ while (!allItemsProcessed && iterationCount < maxDepth) {
660
+ allItemsProcessed = compileTasks();
661
+ iterationCount++;
662
+ }
663
+ tasks.push(...rawTasks);
664
+ return tasks;
665
+ }, "getTasks");
666
+ var addTask = /* @__PURE__ */ __name(function(period, length, event) {
667
+ const rawTask = {
668
+ id: currentTaskId++,
669
+ section: currentSection,
670
+ type: currentSection,
671
+ task: period,
672
+ score: length ? length : 0,
673
+ //if event is defined, then add it the events array
674
+ events: event ? [event] : []
675
+ };
676
+ rawTasks.push(rawTask);
677
+ }, "addTask");
678
+ var addEvent = /* @__PURE__ */ __name(function(event) {
679
+ const currentTask = rawTasks.find((task) => task.id === currentTaskId - 1);
680
+ currentTask.events.push(event);
681
+ }, "addEvent");
682
+ var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
683
+ const newTask = {
684
+ section: currentSection,
685
+ type: currentSection,
686
+ description: descr,
687
+ task: descr,
688
+ classes: []
689
+ };
690
+ tasks.push(newTask);
691
+ }, "addTaskOrg");
692
+ var compileTasks = /* @__PURE__ */ __name(function() {
693
+ const compileTask = /* @__PURE__ */ __name(function(pos) {
694
+ return rawTasks[pos].processed;
695
+ }, "compileTask");
696
+ let allProcessed = true;
697
+ for (const [i, rawTask] of rawTasks.entries()) {
698
+ compileTask(i);
699
+ allProcessed = allProcessed && rawTask.processed;
700
+ }
701
+ return allProcessed;
702
+ }, "compileTasks");
703
+ var timelineDb_default = {
704
+ clear: clear2,
705
+ getCommonDb,
706
+ getDirection,
707
+ setDirection,
708
+ addSection,
709
+ getSections,
710
+ getTasks,
711
+ addTask,
712
+ addTaskOrg,
713
+ addEvent
714
+ };
715
+ var nodeCount = 0;
716
+ var drawRect = /* @__PURE__ */ __name(function(elem, rectData) {
717
+ const rectElem = elem.append("rect");
718
+ rectElem.attr("x", rectData.x);
719
+ rectElem.attr("y", rectData.y);
720
+ rectElem.attr("fill", rectData.fill);
721
+ rectElem.attr("stroke", rectData.stroke);
722
+ rectElem.attr("width", rectData.width);
723
+ rectElem.attr("height", rectData.height);
724
+ rectElem.attr("rx", rectData.rx);
725
+ rectElem.attr("ry", rectData.ry);
726
+ if (rectData.class !== void 0) {
727
+ rectElem.attr("class", rectData.class);
728
+ }
729
+ return rectElem;
730
+ }, "drawRect");
731
+ var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
732
+ const radius = 15;
733
+ const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
734
+ const face = element.append("g");
735
+ face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
736
+ face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
737
+ function smile(face2) {
738
+ const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
739
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
740
+ }
741
+ __name(smile, "smile");
742
+ function sad(face2) {
743
+ const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
744
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
745
+ }
746
+ __name(sad, "sad");
747
+ function ambivalent(face2) {
748
+ face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
749
+ }
750
+ __name(ambivalent, "ambivalent");
751
+ if (faceData.score > 3) {
752
+ smile(face);
753
+ } else if (faceData.score < 3) {
754
+ sad(face);
755
+ } else {
756
+ ambivalent(face);
757
+ }
758
+ return circleElement;
759
+ }, "drawFace");
760
+ var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
761
+ const circleElement = element.append("circle");
762
+ circleElement.attr("cx", circleData.cx);
763
+ circleElement.attr("cy", circleData.cy);
764
+ circleElement.attr("class", "actor-" + circleData.pos);
765
+ circleElement.attr("fill", circleData.fill);
766
+ circleElement.attr("stroke", circleData.stroke);
767
+ circleElement.attr("r", circleData.r);
768
+ if (circleElement.class !== void 0) {
769
+ circleElement.attr("class", circleElement.class);
770
+ }
771
+ if (circleData.title !== void 0) {
772
+ circleElement.append("title").text(circleData.title);
773
+ }
774
+ return circleElement;
775
+ }, "drawCircle");
776
+ var drawText = /* @__PURE__ */ __name(function(elem, textData) {
777
+ const nText = textData.text.replace(/<br\s*\/?>/gi, " ");
778
+ const textElem = elem.append("text");
779
+ textElem.attr("x", textData.x);
780
+ textElem.attr("y", textData.y);
781
+ textElem.attr("class", "legend");
782
+ textElem.style("text-anchor", textData.anchor);
783
+ if (textData.class !== void 0) {
784
+ textElem.attr("class", textData.class);
785
+ }
786
+ const span = textElem.append("tspan");
787
+ span.attr("x", textData.x + textData.textMargin * 2);
788
+ span.text(nText);
789
+ return textElem;
790
+ }, "drawText");
791
+ var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
792
+ function genPoints(x, y, width, height, cut) {
793
+ return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
794
+ }
795
+ __name(genPoints, "genPoints");
796
+ const polygon = elem.append("polygon");
797
+ polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
798
+ polygon.attr("class", "labelBox");
799
+ txtObject.y = txtObject.y + txtObject.labelMargin;
800
+ txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
801
+ drawText(elem, txtObject);
802
+ }, "drawLabel");
803
+ var drawSection = /* @__PURE__ */ __name(function(elem, section, conf) {
804
+ const g = elem.append("g");
805
+ const rect = getNoteRect();
806
+ rect.x = section.x;
807
+ rect.y = section.y;
808
+ rect.fill = section.fill;
809
+ rect.width = conf.width;
810
+ rect.height = conf.height;
811
+ rect.class = "journey-section section-type-" + section.num;
812
+ rect.rx = 3;
813
+ rect.ry = 3;
814
+ drawRect(g, rect);
815
+ _drawTextCandidateFunc(conf)(
816
+ section.text,
817
+ g,
818
+ rect.x,
819
+ rect.y,
820
+ rect.width,
821
+ rect.height,
822
+ { class: "journey-section section-type-" + section.num },
823
+ conf,
824
+ section.colour
825
+ );
826
+ }, "drawSection");
827
+ var taskCount = -1;
828
+ var drawTask = /* @__PURE__ */ __name(function(elem, task, conf, diagramId) {
829
+ const center = task.x + conf.width / 2;
830
+ const g = elem.append("g");
831
+ taskCount++;
832
+ const maxHeight = 300 + 5 * 30;
833
+ g.append("line").attr("id", diagramId + "-task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
834
+ drawFace(g, {
835
+ cx: center,
836
+ cy: 300 + (5 - task.score) * 30,
837
+ score: task.score
838
+ });
839
+ const rect = getNoteRect();
840
+ rect.x = task.x;
841
+ rect.y = task.y;
842
+ rect.fill = task.fill;
843
+ rect.width = conf.width;
844
+ rect.height = conf.height;
845
+ rect.class = "task task-type-" + task.num;
846
+ rect.rx = 3;
847
+ rect.ry = 3;
848
+ drawRect(g, rect);
849
+ _drawTextCandidateFunc(conf)(
850
+ task.task,
851
+ g,
852
+ rect.x,
853
+ rect.y,
854
+ rect.width,
855
+ rect.height,
856
+ { class: "task" },
857
+ conf,
858
+ task.colour
859
+ );
860
+ }, "drawTask");
861
+ var drawBackgroundRect = /* @__PURE__ */ __name(function(elem, bounds) {
862
+ const rectElem = drawRect(elem, {
863
+ x: bounds.startx,
864
+ y: bounds.starty,
865
+ width: bounds.stopx - bounds.startx,
866
+ height: bounds.stopy - bounds.starty,
867
+ fill: bounds.fill,
868
+ class: "rect"
869
+ });
870
+ rectElem.lower();
871
+ }, "drawBackgroundRect");
872
+ var getTextObj = /* @__PURE__ */ __name(function() {
873
+ return {
874
+ x: 0,
875
+ y: 0,
876
+ fill: void 0,
877
+ "text-anchor": "start",
878
+ width: 100,
879
+ height: 100,
880
+ textMargin: 0,
881
+ rx: 0,
882
+ ry: 0
883
+ };
884
+ }, "getTextObj");
885
+ var getNoteRect = /* @__PURE__ */ __name(function() {
886
+ return {
887
+ x: 0,
888
+ y: 0,
889
+ width: 100,
890
+ anchor: "start",
891
+ height: 100,
892
+ rx: 0,
893
+ ry: 0
894
+ };
895
+ }, "getNoteRect");
896
+ var _drawTextCandidateFunc = /* @__PURE__ */ function() {
897
+ function byText(content, g, x, y, width, height, textAttrs, colour) {
898
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
899
+ _setTextAttrs(text, textAttrs);
900
+ }
901
+ __name(byText, "byText");
902
+ function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
903
+ const { taskFontSize, taskFontFamily } = conf;
904
+ const lines = content.split(/<br\s*\/?>/gi);
905
+ for (let i = 0; i < lines.length; i++) {
906
+ const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
907
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
908
+ text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
909
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
910
+ _setTextAttrs(text, textAttrs);
911
+ }
912
+ }
913
+ __name(byTspan, "byTspan");
914
+ function byFo(content, g, x, y, width, height, textAttrs, conf) {
915
+ const body = g.append("switch");
916
+ const f = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed");
917
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
918
+ text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
919
+ byTspan(content, body, x, y, width, height, textAttrs, conf);
920
+ _setTextAttrs(text, textAttrs);
921
+ }
922
+ __name(byFo, "byFo");
923
+ function _setTextAttrs(toText, fromTextAttrsDict) {
924
+ for (const key in fromTextAttrsDict) {
925
+ if (key in fromTextAttrsDict) {
926
+ toText.attr(key, fromTextAttrsDict[key]);
927
+ }
928
+ }
929
+ }
930
+ __name(_setTextAttrs, "_setTextAttrs");
931
+ return function(conf) {
932
+ return conf.textPlacement === "fo" ? byFo : conf.textPlacement === "old" ? byText : byTspan;
933
+ };
934
+ }();
935
+ var initGraphics = /* @__PURE__ */ __name(function(graphics, id) {
936
+ nodeCount = 0;
937
+ taskCount = -1;
938
+ graphics.append("defs").append("marker").attr("id", id + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
939
+ }, "initGraphics");
940
+ function wrap(text, width) {
941
+ text.each(function() {
942
+ var text2 = select_default(this), words = text2.text().split(/(\s+|<br>)/).reverse(), word, line = [], lineHeight = 1.1, y = text2.attr("y"), dy = parseFloat(text2.attr("dy")), tspan = text2.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy + "em");
943
+ for (let j = 0; j < words.length; j++) {
944
+ word = words[words.length - 1 - j];
945
+ line.push(word);
946
+ tspan.text(line.join(" ").trim());
947
+ if (tspan.node().getComputedTextLength() > width || word === "<br>") {
948
+ line.pop();
949
+ tspan.text(line.join(" ").trim());
950
+ if (word === "<br>") {
951
+ line = [""];
952
+ } else {
953
+ line = [word];
954
+ }
955
+ tspan = text2.append("tspan").attr("x", 0).attr("y", y).attr("dy", lineHeight + "em").text(word);
956
+ }
957
+ }
958
+ });
959
+ }
960
+ __name(wrap, "wrap");
961
+ var drawNode = /* @__PURE__ */ __name(function(elem, node, fullSection, conf, diagramId, isEvent = false) {
962
+ const { theme, look } = conf;
963
+ const isReduxTheme = theme?.includes("redux");
964
+ const maxSections = conf?.themeVariables?.THEME_COLOR_LIMIT ?? 12;
965
+ const section = fullSection % maxSections - 1;
966
+ const nodeElem = elem.append("g");
967
+ node.section = section;
968
+ nodeElem.attr(
969
+ "class",
970
+ (node.class ? node.class + " " : "") + "timeline-node " + ("section-" + section)
971
+ );
972
+ const bkgElem = nodeElem.append("g");
973
+ const textElem = nodeElem.append("g");
974
+ const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
975
+ const bbox = txt.node().getBBox();
976
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
977
+ node.height = bbox.height + fontSize * 1.1 * 0.5 + node.padding;
978
+ node.height = Math.max(node.height, node.maxHeight);
979
+ node.width = node.width + 2 * node.padding;
980
+ textElem.attr("transform", "translate(" + node.width / 2 + ", " + node.padding / 2 + ")");
981
+ if (isReduxTheme) {
982
+ textElem.attr(
983
+ "transform",
984
+ `translate(${node.width / 2}, ${isEvent ? node.padding / 2 + 3 : node.padding})`
985
+ );
986
+ }
987
+ defaultBkg(bkgElem, node, section, diagramId, conf);
988
+ if (look === "neo") {
989
+ nodeElem.attr("data-look", `neo`);
990
+ if (isReduxTheme) {
991
+ const isDark2 = theme.includes("dark");
992
+ const rootSvgNode = elem.node()?.ownerSVGElement ?? elem.node();
993
+ const rootSvg = select_default(rootSvgNode);
994
+ const svgId = rootSvg.attr("id") ?? "";
995
+ const dropShadowId = svgId ? `${svgId}-drop-shadow` : "drop-shadow";
996
+ if (rootSvg.select(`#${dropShadowId}`).empty()) {
997
+ const existingDefs = rootSvg.select("defs");
998
+ const defsEl = existingDefs.empty() ? rootSvg.append("defs") : existingDefs;
999
+ defsEl.append("filter").attr("id", dropShadowId).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", isDark2 ? "0.2" : "0.06").attr("flood-color", isDark2 ? "#FFFFFF" : "#000000");
1000
+ }
1001
+ }
1002
+ }
1003
+ return node;
1004
+ }, "drawNode");
1005
+ var getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node, conf) {
1006
+ const textElem = elem.append("g");
1007
+ const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
1008
+ const bbox = txt.node().getBBox();
1009
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
1010
+ textElem.remove();
1011
+ return bbox.height + fontSize * 1.1 * 0.5 + node.padding;
1012
+ }, "getVirtualNodeHeight");
1013
+ var defaultBkg = /* @__PURE__ */ __name(function(elem, node, section, diagramId, config) {
1014
+ const { theme } = config;
1015
+ const r = theme?.includes("redux") ? 0 : 5;
1016
+ const rd = 5;
1017
+ const d = r > 0 ? `M0 ${node.height - rd} v${-node.height + 2 * rd} q0,-${r},${r},-${r} h${node.width - 2 * rd} q${r},0,${r},${r} v${node.height - rd} H0 Z` : `M0 ${node.height - rd} v${-(node.height - rd)} h${node.width} v${node.height} H0 Z`;
1018
+ elem.append("path").attr("id", diagramId + "-node-" + nodeCount++).attr("class", "node-bkg node-" + node.type).attr("d", d);
1019
+ if (!theme?.includes("redux")) {
1020
+ elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node.height).attr("x2", node.width).attr("y2", node.height);
1021
+ }
1022
+ }, "defaultBkg");
1023
+ var svgDraw_default = {
1024
+ drawRect,
1025
+ drawCircle,
1026
+ drawSection,
1027
+ drawText,
1028
+ drawLabel,
1029
+ drawTask,
1030
+ drawBackgroundRect,
1031
+ getTextObj,
1032
+ getNoteRect,
1033
+ initGraphics,
1034
+ drawNode,
1035
+ getVirtualNodeHeight
1036
+ };
1037
+ var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1038
+ const conf = getConfig2();
1039
+ const { look, theme, themeVariables } = conf;
1040
+ const { useGradient, gradientStart, gradientStop } = themeVariables;
1041
+ const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
1042
+ log.debug("timeline", diagObj.db);
1043
+ const securityLevel = conf.securityLevel;
1044
+ let sandboxElement;
1045
+ if (securityLevel === "sandbox") {
1046
+ sandboxElement = select_default("#i" + id);
1047
+ }
1048
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
1049
+ const svg = root.select("#" + id);
1050
+ svg.append("g");
1051
+ const tasks2 = diagObj.db.getTasks();
1052
+ const title = diagObj.db.getCommonDb().getDiagramTitle();
1053
+ log.debug("task", tasks2);
1054
+ svgDraw_default.initGraphics(svg, id);
1055
+ const sections2 = diagObj.db.getSections();
1056
+ log.debug("sections", sections2);
1057
+ let maxSectionHeight = 0;
1058
+ let maxTaskHeight = 0;
1059
+ let depthY = 0;
1060
+ let sectionBeginY = 0;
1061
+ let masterX = 50 + LEFT_MARGIN;
1062
+ let masterY = 50;
1063
+ sectionBeginY = 50;
1064
+ let sectionNumber = 0;
1065
+ let hasSections = true;
1066
+ sections2.forEach(function(section) {
1067
+ const sectionNode = {
1068
+ number: sectionNumber,
1069
+ descr: section,
1070
+ section: sectionNumber,
1071
+ width: 150,
1072
+ padding: 20,
1073
+ maxHeight: maxSectionHeight
1074
+ };
1075
+ const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1076
+ log.debug("sectionHeight before draw", sectionHeight);
1077
+ maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);
1078
+ });
1079
+ let maxEventCount = 0;
1080
+ let maxEventLineLength = 0;
1081
+ log.debug("tasks.length", tasks2.length);
1082
+ for (const [i, task] of tasks2.entries()) {
1083
+ const taskNode = {
1084
+ number: i,
1085
+ descr: task,
1086
+ section: task.section,
1087
+ width: 150,
1088
+ padding: 20,
1089
+ maxHeight: maxTaskHeight
1090
+ };
1091
+ const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1092
+ log.debug("taskHeight before draw", taskHeight);
1093
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);
1094
+ maxEventCount = Math.max(maxEventCount, task.events.length);
1095
+ let maxEventLineLengthTemp = 0;
1096
+ for (const event of task.events) {
1097
+ const eventNode = {
1098
+ descr: event,
1099
+ section: task.section,
1100
+ number: task.section,
1101
+ width: 150,
1102
+ padding: 20,
1103
+ maxHeight: 50
1104
+ };
1105
+ maxEventLineLengthTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1106
+ }
1107
+ if (task.events.length > 0) {
1108
+ maxEventLineLengthTemp += (task.events.length - 1) * 10;
1109
+ }
1110
+ maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);
1111
+ }
1112
+ log.debug("maxSectionHeight before draw", maxSectionHeight);
1113
+ log.debug("maxTaskHeight before draw", maxTaskHeight);
1114
+ if (sections2 && sections2.length > 0) {
1115
+ sections2.forEach((section) => {
1116
+ const tasksForSection = tasks2.filter((task) => task.section === section);
1117
+ const sectionNode = {
1118
+ number: sectionNumber,
1119
+ descr: section,
1120
+ section: sectionNumber,
1121
+ width: 200 * Math.max(tasksForSection.length, 1) - 50,
1122
+ padding: 20,
1123
+ maxHeight: maxSectionHeight
1124
+ };
1125
+ log.debug("sectionNode", sectionNode);
1126
+ const sectionNodeWrapper = svg.append("g");
1127
+ const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf, id);
1128
+ log.debug("sectionNode output", node);
1129
+ sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`);
1130
+ masterY += maxSectionHeight + 50;
1131
+ if (tasksForSection.length > 0) {
1132
+ drawTasks(
1133
+ svg,
1134
+ tasksForSection,
1135
+ sectionNumber,
1136
+ masterX,
1137
+ masterY,
1138
+ maxTaskHeight,
1139
+ conf,
1140
+ maxEventCount,
1141
+ maxEventLineLength,
1142
+ maxSectionHeight,
1143
+ false,
1144
+ id
1145
+ );
1146
+ }
1147
+ masterX += 200 * Math.max(tasksForSection.length, 1);
1148
+ masterY = sectionBeginY;
1149
+ sectionNumber++;
1150
+ });
1151
+ } else {
1152
+ hasSections = false;
1153
+ drawTasks(
1154
+ svg,
1155
+ tasks2,
1156
+ sectionNumber,
1157
+ masterX,
1158
+ masterY,
1159
+ maxTaskHeight,
1160
+ conf,
1161
+ maxEventCount,
1162
+ maxEventLineLength,
1163
+ maxSectionHeight,
1164
+ true,
1165
+ id
1166
+ );
1167
+ }
1168
+ const box = svg.node().getBBox();
1169
+ log.debug("bounds", box);
1170
+ if (title) {
1171
+ svg.append("text").text(title).attr("x", look === "neo" ? box.x * 2 + LEFT_MARGIN : box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1172
+ }
1173
+ depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;
1174
+ const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1175
+ lineWrapper.append("line").attr("x1", LEFT_MARGIN).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", `url(#${id}-arrowhead)`);
1176
+ if (look === "neo" && useGradient && theme !== "neutral") {
1177
+ const existingDefs = svg.select("defs");
1178
+ const defsEl = existingDefs.empty() ? svg.append("defs") : existingDefs;
1179
+ const gradient = defsEl.append("linearGradient").attr("id", svg.attr("id") + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
1180
+ gradient.append("stop").attr("offset", "0%").attr("stop-color", gradientStart).attr("stop-opacity", 1);
1181
+ gradient.append("stop").attr("offset", "100%").attr("stop-color", gradientStop).attr("stop-opacity", 1);
1182
+ }
1183
+ setupGraphViewbox(
1184
+ void 0,
1185
+ svg,
1186
+ conf.timeline?.padding ?? 50,
1187
+ conf.timeline?.useMaxWidth ?? false
1188
+ );
1189
+ }, "draw");
1190
+ var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections, diagramId) {
1191
+ for (const task of tasks2) {
1192
+ const taskNode = {
1193
+ descr: task.task,
1194
+ section: sectionColor,
1195
+ number: sectionColor,
1196
+ width: 150,
1197
+ padding: 20,
1198
+ maxHeight: maxTaskHeight
1199
+ };
1200
+ log.debug("taskNode", taskNode);
1201
+ const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1202
+ const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf, diagramId);
1203
+ const taskHeight = node.height;
1204
+ log.debug("taskHeight after draw", taskHeight);
1205
+ taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1206
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1207
+ if (task.events) {
1208
+ const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1209
+ let lineLength = maxTaskHeight;
1210
+ masterY += 100;
1211
+ lineLength = lineLength + drawEvents(diagram2, task.events, sectionColor, masterX, masterY, conf, diagramId);
1212
+ masterY -= 100;
1213
+ lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr("y2", masterY + maxTaskHeight + 100 + maxEventLineLength + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", `url(#${diagramId}-arrowhead)`).attr("stroke-dasharray", "5,5");
1214
+ }
1215
+ masterX = masterX + 200;
1216
+ if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1217
+ sectionColor++;
1218
+ }
1219
+ }
1220
+ masterY = masterY - 10;
1221
+ }, "drawTasks");
1222
+ var drawEvents = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, masterX, masterY, conf, diagramId) {
1223
+ let maxEventHeight = 0;
1224
+ const eventBeginY = masterY;
1225
+ masterY = masterY + 100;
1226
+ for (const event of events) {
1227
+ const eventNode = {
1228
+ descr: event,
1229
+ section: sectionColor,
1230
+ number: sectionColor,
1231
+ width: 150,
1232
+ padding: 20,
1233
+ maxHeight: 50
1234
+ };
1235
+ log.debug("eventNode", eventNode);
1236
+ const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1237
+ const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf, diagramId, true);
1238
+ const eventHeight = node.height;
1239
+ maxEventHeight = maxEventHeight + eventHeight;
1240
+ eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1241
+ masterY = masterY + 10 + eventHeight;
1242
+ }
1243
+ masterY = eventBeginY;
1244
+ return maxEventHeight;
1245
+ }, "drawEvents");
1246
+ var timelineRenderer_default = {
1247
+ setConf: /* @__PURE__ */ __name(() => {
1248
+ }, "setConf"),
1249
+ draw
1250
+ };
1251
+ var NODE_WIDTH = 200;
1252
+ var NODE_PADDING = 5;
1253
+ var NODE_TOTAL_WIDTH = NODE_WIDTH + NODE_PADDING * 2;
1254
+ var EVENT_WIDTH = NODE_WIDTH + 100;
1255
+ var EVENT_TOTAL_WIDTH = EVENT_WIDTH + NODE_PADDING * 2;
1256
+ var EVENT_SPACING = 10;
1257
+ var EVENT_VERTICAL_GAP = 0;
1258
+ var SECTION_TASK_GAP = 20;
1259
+ var TASK_AXIS_GAP = 20;
1260
+ var TASK_VERTICAL_GAP = 30;
1261
+ var EVENT_AXIS_GAP = 50;
1262
+ var draw2 = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1263
+ const conf = getConfig2();
1264
+ const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
1265
+ log.debug("timeline", diagObj.db);
1266
+ const svg = selectSvgElement(id);
1267
+ svg.append("g");
1268
+ const tasks2 = diagObj.db.getTasks();
1269
+ const title = diagObj.db.getCommonDb().getDiagramTitle();
1270
+ log.debug("task", tasks2);
1271
+ svgDraw_default.initGraphics(svg);
1272
+ const sections2 = diagObj.db.getSections();
1273
+ log.debug("sections", sections2);
1274
+ let maxSectionHeight = 0;
1275
+ let maxTaskHeight = 0;
1276
+ const masterX = 50 + LEFT_MARGIN;
1277
+ let masterY = 50;
1278
+ const contentTopY = masterY;
1279
+ const sectionBeginX = masterX;
1280
+ const leftWidth = NODE_TOTAL_WIDTH + TASK_AXIS_GAP;
1281
+ const rightWidth = EVENT_TOTAL_WIDTH + EVENT_AXIS_GAP;
1282
+ const axisX = sectionBeginX + leftWidth;
1283
+ let sectionNumber = 0;
1284
+ const hasSections = sections2 && sections2.length > 0;
1285
+ const timelineX = hasSections ? axisX : masterX + leftWidth;
1286
+ const sectionWidth = Math.max(50, leftWidth + rightWidth - NODE_PADDING * 2);
1287
+ sections2.forEach(function(section) {
1288
+ const sectionNode = {
1289
+ number: sectionNumber,
1290
+ descr: section,
1291
+ section: sectionNumber,
1292
+ width: sectionWidth,
1293
+ padding: NODE_PADDING,
1294
+ maxHeight: maxSectionHeight
1295
+ };
1296
+ const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1297
+ log.debug("sectionHeight before draw", sectionHeight);
1298
+ maxSectionHeight = Math.max(maxSectionHeight, sectionHeight);
1299
+ });
1300
+ let maxEventStackHeight = 0;
1301
+ log.debug("tasks.length", tasks2.length);
1302
+ for (const [i, task] of tasks2.entries()) {
1303
+ const taskNode = {
1304
+ number: i,
1305
+ descr: task,
1306
+ section: task.section,
1307
+ width: NODE_WIDTH,
1308
+ padding: NODE_PADDING,
1309
+ maxHeight: maxTaskHeight
1310
+ };
1311
+ const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1312
+ log.debug("taskHeight before draw", taskHeight);
1313
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1314
+ let maxEventStackHeightTemp = 0;
1315
+ for (const event of task.events) {
1316
+ const eventNode = {
1317
+ descr: event,
1318
+ section: task.section,
1319
+ number: task.section,
1320
+ width: EVENT_WIDTH,
1321
+ padding: NODE_PADDING,
1322
+ maxHeight: 50
1323
+ };
1324
+ maxEventStackHeightTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1325
+ }
1326
+ if (task.events.length > 0) {
1327
+ maxEventStackHeightTemp += (task.events.length - 1) * EVENT_SPACING;
1328
+ }
1329
+ maxEventStackHeight = Math.max(maxEventStackHeight, maxEventStackHeightTemp) + EVENT_VERTICAL_GAP;
1330
+ }
1331
+ log.debug("maxSectionHeight before draw", maxSectionHeight);
1332
+ log.debug("maxTaskHeight before draw", maxTaskHeight);
1333
+ const taskBlockHeight = Math.max(maxTaskHeight, maxEventStackHeight);
1334
+ const taskSpacing = taskBlockHeight + TASK_VERTICAL_GAP;
1335
+ if (hasSections) {
1336
+ sections2.forEach((section) => {
1337
+ const tasksForSection = tasks2.filter((task) => task.section === section);
1338
+ const sectionNode = {
1339
+ number: sectionNumber,
1340
+ descr: section,
1341
+ section: sectionNumber,
1342
+ width: sectionWidth,
1343
+ padding: NODE_PADDING,
1344
+ maxHeight: maxSectionHeight
1345
+ };
1346
+ log.debug("sectionNode", sectionNode);
1347
+ const sectionNodeWrapper = svg.append("g");
1348
+ const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf);
1349
+ log.debug("sectionNode output", node);
1350
+ const sectionX = timelineX - leftWidth;
1351
+ sectionNodeWrapper.attr("transform", `translate(${sectionX}, ${masterY})`);
1352
+ const taskStartY = masterY + node.height + SECTION_TASK_GAP;
1353
+ if (tasksForSection.length > 0) {
1354
+ drawTasks2(
1355
+ svg,
1356
+ tasksForSection,
1357
+ sectionNumber,
1358
+ timelineX,
1359
+ taskStartY,
1360
+ maxTaskHeight,
1361
+ conf,
1362
+ taskSpacing,
1363
+ false
1364
+ );
1365
+ }
1366
+ const taskCount2 = tasksForSection.length;
1367
+ const sectionHeight = node.height + SECTION_TASK_GAP + taskSpacing * Math.max(taskCount2, 1) - (taskCount2 > 0 ? TASK_VERTICAL_GAP * 2 : 0);
1368
+ masterY += sectionHeight;
1369
+ sectionNumber++;
1370
+ });
1371
+ } else {
1372
+ drawTasks2(
1373
+ svg,
1374
+ tasks2,
1375
+ sectionNumber,
1376
+ timelineX,
1377
+ masterY,
1378
+ maxTaskHeight,
1379
+ conf,
1380
+ taskSpacing,
1381
+ true
1382
+ );
1383
+ }
1384
+ let box = svg.node()?.getBBox();
1385
+ if (!box) {
1386
+ throw new Error("bbox not found");
1387
+ }
1388
+ log.debug("bounds", box);
1389
+ if (title) {
1390
+ svg.append("text").text(title).attr("x", box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1391
+ box = svg.node()?.getBBox();
1392
+ if (!box) {
1393
+ throw new Error("bbox not found");
1394
+ }
1395
+ log.debug("bounds after title", box);
1396
+ }
1397
+ const [fontSize] = parseFontSize(conf.fontSize);
1398
+ const arrowTopOffset = (fontSize ?? 16) * 2;
1399
+ const arrowBottomPadding = (fontSize ?? 16) * 0.5 + 20;
1400
+ const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1401
+ lineWrapper.append("line").attr("x1", timelineX).attr("y1", contentTopY - arrowTopOffset).attr("x2", timelineX).attr("y2", box.y + box.height + arrowBottomPadding).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
1402
+ lineWrapper.lower();
1403
+ setupGraphViewbox(
1404
+ void 0,
1405
+ svg,
1406
+ conf.timeline?.padding ?? 50,
1407
+ conf.timeline?.useMaxWidth ?? false
1408
+ );
1409
+ }, "draw");
1410
+ var drawTasks2 = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, timelineX, masterY, maxTaskHeight, conf, taskSpacing, isWithoutSections) {
1411
+ for (const task of tasks2) {
1412
+ const taskNode = {
1413
+ descr: task.task,
1414
+ section: sectionColor,
1415
+ number: sectionColor,
1416
+ width: NODE_WIDTH,
1417
+ padding: NODE_PADDING,
1418
+ maxHeight: maxTaskHeight
1419
+ };
1420
+ log.debug("taskNode", taskNode);
1421
+ const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1422
+ const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf);
1423
+ const taskHeight = node.height;
1424
+ log.debug("taskHeight after draw", taskHeight);
1425
+ const taskX = timelineX - TASK_AXIS_GAP - node.width;
1426
+ taskWrapper.attr("transform", `translate(${taskX}, ${masterY})`);
1427
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1428
+ if (task.events && task.events.length > 0) {
1429
+ const eventsStartY = masterY;
1430
+ const eventsX = timelineX + EVENT_AXIS_GAP;
1431
+ drawEvents2(diagram2, task.events, sectionColor, timelineX, eventsX, eventsStartY, conf);
1432
+ }
1433
+ masterY = masterY + taskSpacing;
1434
+ if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1435
+ sectionColor++;
1436
+ }
1437
+ }
1438
+ }, "drawTasks");
1439
+ var drawEvents2 = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, axisX, eventsX, startY, conf) {
1440
+ let currentY = startY;
1441
+ for (const event of events) {
1442
+ const eventNode = {
1443
+ descr: event,
1444
+ section: sectionColor,
1445
+ number: sectionColor,
1446
+ width: EVENT_WIDTH,
1447
+ padding: NODE_PADDING,
1448
+ maxHeight: 0
1449
+ };
1450
+ log.debug("eventNode", eventNode);
1451
+ const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1452
+ const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf);
1453
+ const eventHeight = node.height;
1454
+ eventWrapper.attr("transform", `translate(${eventsX}, ${currentY})`);
1455
+ const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1456
+ const lineY = currentY + eventHeight / 2;
1457
+ lineWrapper.append("line").attr("x1", axisX).attr("y1", lineY).attr("x2", eventsX).attr("y2", lineY).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
1458
+ currentY = currentY + eventHeight + EVENT_SPACING;
1459
+ }
1460
+ return currentY - startY;
1461
+ }, "drawEvents");
1462
+ var timelineRendererVertical_default = {
1463
+ setConf: /* @__PURE__ */ __name(() => {
1464
+ }, "setConf"),
1465
+ draw: draw2
1466
+ };
1467
+ var genReduxSections = /* @__PURE__ */ __name((options) => {
1468
+ const { theme } = getConfig();
1469
+ const isDarkTheme = theme?.includes("dark");
1470
+ const isColorTheme = theme?.includes("color");
1471
+ const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1472
+ const scopedDropShadow = rawSvgId ? `url(#${rawSvgId}-drop-shadow)` : options.dropShadow ?? "none";
1473
+ let sections2 = "";
1474
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1475
+ const sw = `${17 - 3 * i}`;
1476
+ const color = isColorTheme ? options.borderColorArray[i] : options.mainBkg;
1477
+ const stroke = isColorTheme ? options.borderColorArray[i] : options.nodeBorder;
1478
+ sections2 += `
1479
+ .section-${i - 1} rect,
1480
+ .section-${i - 1} path,
1481
+ .section-${i - 1} circle {
1482
+ fill: ${isDarkTheme && isColorTheme ? options.mainBkg : color};
1483
+ stroke: ${stroke};
1484
+ stroke-width: ${options.strokeWidth};
1485
+ filter: ${scopedDropShadow};
1486
+ }
1487
+
1488
+ .section-${i - 1} text {
1489
+ fill: ${options.nodeBorder};
1490
+ font-weight: ${options.fontWeight}
1491
+ }
1492
+
1493
+ .node-icon-${i - 1} {
1494
+ font-size: 40px;
1495
+ color: ${options["cScaleLabel" + i]};
1496
+ }
1497
+
1498
+ .section-edge-${i - 1} {
1499
+ stroke: ${options["cScale" + i]};
1500
+ }
1501
+
1502
+ .edge-depth-${i - 1} {
1503
+ stroke-width: ${sw};
1504
+ }
1505
+
1506
+ .section-${i - 1} line {
1507
+ stroke: ${options["cScaleInv" + i]};
1508
+ stroke-width: 3;
1509
+ }
1510
+
1511
+ .lineWrapper line {
1512
+ stroke: ${options.nodeBorder};
1513
+ stroke-width:${options.strokeWidth}
1514
+ }
1515
+
1516
+ .disabled,
1517
+ .disabled circle,
1518
+ .disabled text {
1519
+ fill: ${options.tertiaryColor ?? "lightgray"};
1520
+ }
1521
+
1522
+ .disabled text {
1523
+ fill: ${options.clusterBorder ?? "#efefef"};
1524
+ }
1525
+ `;
1526
+ }
1527
+ return sections2;
1528
+ }, "genReduxSections");
1529
+ var genSections = /* @__PURE__ */ __name((options) => {
1530
+ let sections2 = "";
1531
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1532
+ options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1533
+ if (is_dark_default(options["lineColor" + i])) {
1534
+ options["lineColor" + i] = lighten_default(options["lineColor" + i], 20);
1535
+ } else {
1536
+ options["lineColor" + i] = darken_default(options["lineColor" + i], 20);
1537
+ }
1538
+ }
1539
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1540
+ const sw = "" + (17 - 3 * i);
1541
+ sections2 += `
1542
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} path {
1543
+ fill: ${options["cScale" + i]};
1544
+ }
1545
+ .section-${i - 1} text {
1546
+ fill: ${options["cScaleLabel" + i]};
1547
+ }
1548
+ .node-icon-${i - 1} {
1549
+ font-size: 40px;
1550
+ color: ${options["cScaleLabel" + i]};
1551
+ }
1552
+ .section-edge-${i - 1}{
1553
+ stroke: ${options["cScale" + i]};
1554
+ }
1555
+ .edge-depth-${i - 1}{
1556
+ stroke-width: ${sw};
1557
+ }
1558
+ .section-${i - 1} line {
1559
+ stroke: ${options["cScaleInv" + i]} ;
1560
+ stroke-width: 3;
1561
+ }
1562
+
1563
+ .lineWrapper line{
1564
+ stroke: ${options["cScaleLabel" + i]} ;
1565
+ }
1566
+
1567
+ .disabled, .disabled circle, .disabled text {
1568
+ fill: ${options.tertiaryColor ?? "lightgray"};
1569
+ }
1570
+ .disabled text {
1571
+ fill: ${options.clusterBorder ?? "#efefef"};
1572
+ }
1573
+ `;
1574
+ }
1575
+ return sections2;
1576
+ }, "genSections");
1577
+ var getStyles = /* @__PURE__ */ __name((options) => {
1578
+ const { theme } = getConfig();
1579
+ const isReduxTheme = theme?.includes("redux");
1580
+ const isNeutralTheme = theme === "neutral";
1581
+ const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1582
+ let gradientSections = "";
1583
+ if (options.useGradient && rawSvgId && options.THEME_COLOR_LIMIT && !isNeutralTheme) {
1584
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1585
+ gradientSections += `
1586
+ .section-${i - 1}[data-look="neo"] rect,
1587
+ .section-${i - 1}[data-look="neo"] path,
1588
+ .section-${i - 1}[data-look="neo"] circle {
1589
+ fill: ${options.mainBkg};
1590
+ stroke: url(#${rawSvgId}-gradient);
1591
+ stroke-width: 2;
1592
+ }
1593
+ .section-${i - 1}[data-look="neo"] line {
1594
+ stroke: url(#${rawSvgId}-gradient);
1595
+ stroke-width: 2;
1596
+ }`;
1597
+ }
1598
+ }
1599
+ return `
1600
+ .edge {
1601
+ stroke-width: 3;
1602
+ }
1603
+ ${isReduxTheme ? genReduxSections(options) : genSections(options)}
1604
+ ${gradientSections}
1605
+ .section-root rect, .section-root path, .section-root circle {
1606
+ fill: ${options.git0};
1607
+ }
1608
+ .section-root text {
1609
+ fill: ${options.gitBranchLabel0};
1610
+ }
1611
+ .icon-container {
1612
+ height:100%;
1613
+ display: flex;
1614
+ justify-content: center;
1615
+ align-items: center;
1616
+ }
1617
+ .edge {
1618
+ fill: none;
1619
+ }
1620
+ .eventWrapper {
1621
+ filter: brightness(120%);
1622
+ }
1623
+ `;
1624
+ }, "getStyles");
1625
+ var styles_default = getStyles;
1626
+ var rendererSelector = {
1627
+ setConf: /* @__PURE__ */ __name(() => {
1628
+ }, "setConf"),
1629
+ draw: /* @__PURE__ */ __name((text, id, version, diagObj) => {
1630
+ const direction2 = diagObj?.db?.getDirection?.() ?? "LR";
1631
+ if (direction2 === "TD") {
1632
+ return timelineRendererVertical_default.draw(text, id, version, diagObj);
1633
+ }
1634
+ return timelineRenderer_default.draw(text, id, version, diagObj);
1635
+ }, "draw")
1636
+ };
1637
+ var diagram = {
1638
+ db: timelineDb_exports,
1639
+ renderer: rendererSelector,
1640
+ parser: timeline_default,
1641
+ styles: styles_default
1642
+ };
1643
+ export {
1644
+ diagram
1645
+ };
1646
+ //# sourceMappingURL=timeline-definition-GMOUNBTQ-FHVZ7MHE.js.map