@infinilabs/ai-chat 0.0.0 → 0.0.2

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 (119) hide show
  1. package/README.md +310 -56
  2. package/dist/_baseUniq-BFn6cCm9.js +152 -0
  3. package/dist/_baseUniq-nfJyj2zU.cjs +151 -0
  4. package/dist/arc-BWSMkwk2.cjs +130 -0
  5. package/dist/arc-DODeX7B9.js +131 -0
  6. package/dist/architecture-U656AL7Q-B4C0nw6C.js +5 -0
  7. package/dist/architecture-U656AL7Q-CVURQXwt.cjs +5 -0
  8. package/dist/architectureDiagram-VXUJARFQ-2UbdzpNz.cjs +8681 -0
  9. package/dist/architectureDiagram-VXUJARFQ-NCVmzKuE.js +8681 -0
  10. package/dist/blockDiagram-VD42YOAC-B3yCPK1N.cjs +3606 -0
  11. package/dist/blockDiagram-VD42YOAC-C4FsmQfk.js +3606 -0
  12. package/dist/c4Diagram-YG6GDRKO-ATyoKzFV.js +2481 -0
  13. package/dist/c4Diagram-YG6GDRKO-COwVcHWj.cjs +2481 -0
  14. package/dist/channel-2Y73gsu9.cjs +6 -0
  15. package/dist/channel-oB8MffQV.js +7 -0
  16. package/dist/chunk-4BX2VUAB-C3diNHZw.cjs +15 -0
  17. package/dist/chunk-4BX2VUAB-sd2zFBFz.js +16 -0
  18. package/dist/chunk-55IACEB6-6ohTnYE3.js +13 -0
  19. package/dist/chunk-55IACEB6-T-CzlJke.cjs +12 -0
  20. package/dist/chunk-B4BG7PRW-B1zqG62l.cjs +1825 -0
  21. package/dist/chunk-B4BG7PRW-E1dti26Y.js +1826 -0
  22. package/dist/chunk-DI55MBZ5-Dk0kfYBV.cjs +1914 -0
  23. package/dist/chunk-DI55MBZ5-DpHw-vMw.js +1915 -0
  24. package/dist/chunk-FMBD7UC4-B1vXpasq.js +19 -0
  25. package/dist/chunk-FMBD7UC4-CShN9-qf.cjs +18 -0
  26. package/dist/chunk-QN33PNHL-Cw7FG91D.js +24 -0
  27. package/dist/chunk-QN33PNHL-DJi1fhak.cjs +23 -0
  28. package/dist/chunk-QZHKN3VN-BweiBR9P.js +17 -0
  29. package/dist/chunk-QZHKN3VN-DfUW_gDw.cjs +16 -0
  30. package/dist/chunk-TZMSLE5B-DY2Kbag4.cjs +107 -0
  31. package/dist/chunk-TZMSLE5B-ZQ2Esoix.js +108 -0
  32. package/dist/classDiagram-2ON5EDUG-D2tIbkjc.js +19 -0
  33. package/dist/classDiagram-2ON5EDUG-DRhRmkUb.cjs +19 -0
  34. package/dist/classDiagram-v2-WZHVMYZB-D2tIbkjc.js +19 -0
  35. package/dist/classDiagram-v2-WZHVMYZB-DRhRmkUb.cjs +19 -0
  36. package/dist/clone-BMkj3yun.cjs +7 -0
  37. package/dist/clone-ChHXIoR6.js +8 -0
  38. package/dist/cose-bilkent-S5V4N54A-BXnWH5Od.cjs +4942 -0
  39. package/dist/cose-bilkent-S5V4N54A-D15BmpCb.js +4942 -0
  40. package/dist/cytoscape.esm-BfvZ3QT_.js +30239 -0
  41. package/dist/cytoscape.esm-D8IBYQeQ.cjs +30238 -0
  42. package/dist/dagre-6UL2VRFP-DGQ6TW_g.cjs +693 -0
  43. package/dist/dagre-6UL2VRFP-WmhUYWg8.js +693 -0
  44. package/dist/defaultLocale-DVr69WTU.js +206 -0
  45. package/dist/defaultLocale-DwYGIg9G.cjs +203 -0
  46. package/dist/diagram-PSM6KHXK-DSfHBoUT.js +845 -0
  47. package/dist/diagram-PSM6KHXK-J4qyGeN7.cjs +845 -0
  48. package/dist/diagram-QEK2KX5R-D96wT5cH.cjs +300 -0
  49. package/dist/diagram-QEK2KX5R-I_nyexpY.js +300 -0
  50. package/dist/diagram-S2PKOQOG-BC_WyKEe.cjs +210 -0
  51. package/dist/diagram-S2PKOQOG-aooXSMNo.js +210 -0
  52. package/dist/erDiagram-Q2GNP2WA-DQ8Lquay.cjs +1158 -0
  53. package/dist/erDiagram-Q2GNP2WA-DWF8e6EL.js +1158 -0
  54. package/dist/flowDiagram-NV44I4VS-CM9c4F1o.js +2331 -0
  55. package/dist/flowDiagram-NV44I4VS-DpYNkyM2.cjs +2331 -0
  56. package/dist/ganttDiagram-JELNMOA3-CAsoD6rZ.js +3679 -0
  57. package/dist/ganttDiagram-JELNMOA3-DfKahpj4.cjs +3679 -0
  58. package/dist/gitGraph-F6HP7TQM-BX2fz4_i.js +5 -0
  59. package/dist/gitGraph-F6HP7TQM-DRkGg4T1.cjs +5 -0
  60. package/dist/gitGraphDiagram-NY62KEGX-PXpI94u6.js +1203 -0
  61. package/dist/gitGraphDiagram-NY62KEGX-YhnKpooH.cjs +1203 -0
  62. package/dist/graph-BvxpI7Xc.js +596 -0
  63. package/dist/graph-CI_TWBSn.cjs +595 -0
  64. package/dist/index-BctLGjTK.cjs +120500 -0
  65. package/dist/index-CjSgoo1P.js +120485 -0
  66. package/dist/index.cjs +19 -0
  67. package/dist/index.js +12 -19961
  68. package/dist/info-NVLQJR56-BGbTE7dw.cjs +5 -0
  69. package/dist/info-NVLQJR56-DRxIh-N8.js +5 -0
  70. package/dist/infoDiagram-WHAUD3N6-BB2Bnbnh.cjs +31 -0
  71. package/dist/infoDiagram-WHAUD3N6-D_RrgwxS.js +31 -0
  72. package/dist/init-DevvdK2U.cjs +15 -0
  73. package/dist/init-ZxktEp_H.js +16 -0
  74. package/dist/journeyDiagram-XKPGCS4Q-BJjXlMIj.js +1254 -0
  75. package/dist/journeyDiagram-XKPGCS4Q-BcBLsfI9.cjs +1254 -0
  76. package/dist/kanban-definition-3W4ZIXB7-0wwNBZ93.js +1047 -0
  77. package/dist/kanban-definition-3W4ZIXB7-CaY0q4j9.cjs +1047 -0
  78. package/dist/katex-BhpYeT3b.cjs +14523 -0
  79. package/dist/katex-ei8sH3Uy.js +14524 -0
  80. package/dist/layout-CcghncRv.js +2183 -0
  81. package/dist/layout-CvwzED_C.cjs +2182 -0
  82. package/dist/linear-CYow-mAK.cjs +339 -0
  83. package/dist/linear-D_gKQzVp.js +340 -0
  84. package/dist/mermaid-parser.core-CzmkR-3i.cjs +18703 -0
  85. package/dist/mermaid-parser.core-DCMDT-Cp.js +18704 -0
  86. package/dist/min-BBp7Smma.js +41 -0
  87. package/dist/min-Gu1I_bJ9.cjs +40 -0
  88. package/dist/mindmap-definition-VGOIOE7T-D16Pp1u5.cjs +1126 -0
  89. package/dist/mindmap-definition-VGOIOE7T-PjSLRtz4.js +1126 -0
  90. package/dist/ordinal-CxptdPJm.js +76 -0
  91. package/dist/ordinal-D7sQNqXZ.cjs +75 -0
  92. package/dist/packet-BFZMPI3H-BvdogPiS.js +5 -0
  93. package/dist/packet-BFZMPI3H-C7pOHUWY.cjs +5 -0
  94. package/dist/pie-7BOR55EZ-D-DxSHbP.cjs +5 -0
  95. package/dist/pie-7BOR55EZ-DEWJe4Xn.js +5 -0
  96. package/dist/pieDiagram-ADFJNKIX-CoDddKZl.js +237 -0
  97. package/dist/pieDiagram-ADFJNKIX-DjN4DU9l.cjs +237 -0
  98. package/dist/quadrantDiagram-AYHSOK5B-BZOg0JMm.js +1335 -0
  99. package/dist/quadrantDiagram-AYHSOK5B-DXjTSOL4.cjs +1335 -0
  100. package/dist/radar-NHE76QYJ-BrnDXy9q.cjs +5 -0
  101. package/dist/radar-NHE76QYJ-C2WmPmJ4.js +5 -0
  102. package/dist/requirementDiagram-UZGBJVZJ-CCW1O1xH.js +1161 -0
  103. package/dist/requirementDiagram-UZGBJVZJ-e5F3-dDI.cjs +1161 -0
  104. package/dist/sankeyDiagram-TZEHDZUN-BaGzCxTp.js +1193 -0
  105. package/dist/sankeyDiagram-TZEHDZUN-DtIvOvVI.cjs +1193 -0
  106. package/dist/sequenceDiagram-WL72ISMW-0vFhYnxn.cjs +3874 -0
  107. package/dist/sequenceDiagram-WL72ISMW-DL3B7U56.js +3874 -0
  108. package/dist/stateDiagram-FKZM4ZOC-CXW608BR.cjs +447 -0
  109. package/dist/stateDiagram-FKZM4ZOC-Ddw6HxPD.js +447 -0
  110. package/dist/stateDiagram-v2-4FDKWEC3-DZCkQKmp.js +19 -0
  111. package/dist/stateDiagram-v2-4FDKWEC3-DefWUbvq.cjs +19 -0
  112. package/dist/timeline-definition-IT6M3QCI-C3TfA9lE.cjs +1222 -0
  113. package/dist/timeline-definition-IT6M3QCI-DiS88lUo.js +1222 -0
  114. package/dist/treemap-KMMF4GRG-Bl-H6j2c.cjs +5 -0
  115. package/dist/treemap-KMMF4GRG-DGGr_R9A.js +5 -0
  116. package/dist/xychartDiagram-PRI3JC2R-BrOwRjfF.js +1886 -0
  117. package/dist/xychartDiagram-PRI3JC2R-CM06DttH.cjs +1886 -0
  118. package/package.json +22 -11
  119. package/dist/index.css +0 -1582
@@ -0,0 +1,2481 @@
1
+ var _a, _b;
2
+ import { g as getNoteRect, d as drawRect } from "./chunk-TZMSLE5B-ZQ2Esoix.js";
3
+ import { _ as __name, s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, c as getConfig2, d as select, l as log, e as configureSvgSize, f as assignWithDepth_default, h as calculateTextWidth, i as sanitizeText, j as distExports, w as wrapLabel, k as common_default, m as calculateTextHeight } from "./index-CjSgoo1P.js";
4
+ var parser = (function() {
5
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
6
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
7
+ return o2;
8
+ }, "o"), $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74];
9
+ var parser2 = {
10
+ trace: /* @__PURE__ */ __name(function trace() {
11
+ }, "trace"),
12
+ yy: {},
13
+ symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 },
14
+ terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
15
+ productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
16
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
17
+ var $0 = $$.length - 1;
18
+ switch (yystate) {
19
+ case 3:
20
+ yy.setDirection("TB");
21
+ break;
22
+ case 4:
23
+ yy.setDirection("BT");
24
+ break;
25
+ case 5:
26
+ yy.setDirection("RL");
27
+ break;
28
+ case 6:
29
+ yy.setDirection("LR");
30
+ break;
31
+ case 8:
32
+ case 9:
33
+ case 10:
34
+ case 11:
35
+ case 12:
36
+ yy.setC4Type($$[$0 - 3]);
37
+ break;
38
+ case 19:
39
+ yy.setTitle($$[$0].substring(6));
40
+ this.$ = $$[$0].substring(6);
41
+ break;
42
+ case 20:
43
+ yy.setAccDescription($$[$0].substring(15));
44
+ this.$ = $$[$0].substring(15);
45
+ break;
46
+ case 21:
47
+ this.$ = $$[$0].trim();
48
+ yy.setTitle(this.$);
49
+ break;
50
+ case 22:
51
+ case 23:
52
+ this.$ = $$[$0].trim();
53
+ yy.setAccDescription(this.$);
54
+ break;
55
+ case 28:
56
+ $$[$0].splice(2, 0, "ENTERPRISE");
57
+ yy.addPersonOrSystemBoundary(...$$[$0]);
58
+ this.$ = $$[$0];
59
+ break;
60
+ case 29:
61
+ $$[$0].splice(2, 0, "SYSTEM");
62
+ yy.addPersonOrSystemBoundary(...$$[$0]);
63
+ this.$ = $$[$0];
64
+ break;
65
+ case 30:
66
+ yy.addPersonOrSystemBoundary(...$$[$0]);
67
+ this.$ = $$[$0];
68
+ break;
69
+ case 31:
70
+ $$[$0].splice(2, 0, "CONTAINER");
71
+ yy.addContainerBoundary(...$$[$0]);
72
+ this.$ = $$[$0];
73
+ break;
74
+ case 32:
75
+ yy.addDeploymentNode("node", ...$$[$0]);
76
+ this.$ = $$[$0];
77
+ break;
78
+ case 33:
79
+ yy.addDeploymentNode("nodeL", ...$$[$0]);
80
+ this.$ = $$[$0];
81
+ break;
82
+ case 34:
83
+ yy.addDeploymentNode("nodeR", ...$$[$0]);
84
+ this.$ = $$[$0];
85
+ break;
86
+ case 35:
87
+ yy.popBoundaryParseStack();
88
+ break;
89
+ case 39:
90
+ yy.addPersonOrSystem("person", ...$$[$0]);
91
+ this.$ = $$[$0];
92
+ break;
93
+ case 40:
94
+ yy.addPersonOrSystem("external_person", ...$$[$0]);
95
+ this.$ = $$[$0];
96
+ break;
97
+ case 41:
98
+ yy.addPersonOrSystem("system", ...$$[$0]);
99
+ this.$ = $$[$0];
100
+ break;
101
+ case 42:
102
+ yy.addPersonOrSystem("system_db", ...$$[$0]);
103
+ this.$ = $$[$0];
104
+ break;
105
+ case 43:
106
+ yy.addPersonOrSystem("system_queue", ...$$[$0]);
107
+ this.$ = $$[$0];
108
+ break;
109
+ case 44:
110
+ yy.addPersonOrSystem("external_system", ...$$[$0]);
111
+ this.$ = $$[$0];
112
+ break;
113
+ case 45:
114
+ yy.addPersonOrSystem("external_system_db", ...$$[$0]);
115
+ this.$ = $$[$0];
116
+ break;
117
+ case 46:
118
+ yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
119
+ this.$ = $$[$0];
120
+ break;
121
+ case 47:
122
+ yy.addContainer("container", ...$$[$0]);
123
+ this.$ = $$[$0];
124
+ break;
125
+ case 48:
126
+ yy.addContainer("container_db", ...$$[$0]);
127
+ this.$ = $$[$0];
128
+ break;
129
+ case 49:
130
+ yy.addContainer("container_queue", ...$$[$0]);
131
+ this.$ = $$[$0];
132
+ break;
133
+ case 50:
134
+ yy.addContainer("external_container", ...$$[$0]);
135
+ this.$ = $$[$0];
136
+ break;
137
+ case 51:
138
+ yy.addContainer("external_container_db", ...$$[$0]);
139
+ this.$ = $$[$0];
140
+ break;
141
+ case 52:
142
+ yy.addContainer("external_container_queue", ...$$[$0]);
143
+ this.$ = $$[$0];
144
+ break;
145
+ case 53:
146
+ yy.addComponent("component", ...$$[$0]);
147
+ this.$ = $$[$0];
148
+ break;
149
+ case 54:
150
+ yy.addComponent("component_db", ...$$[$0]);
151
+ this.$ = $$[$0];
152
+ break;
153
+ case 55:
154
+ yy.addComponent("component_queue", ...$$[$0]);
155
+ this.$ = $$[$0];
156
+ break;
157
+ case 56:
158
+ yy.addComponent("external_component", ...$$[$0]);
159
+ this.$ = $$[$0];
160
+ break;
161
+ case 57:
162
+ yy.addComponent("external_component_db", ...$$[$0]);
163
+ this.$ = $$[$0];
164
+ break;
165
+ case 58:
166
+ yy.addComponent("external_component_queue", ...$$[$0]);
167
+ this.$ = $$[$0];
168
+ break;
169
+ case 60:
170
+ yy.addRel("rel", ...$$[$0]);
171
+ this.$ = $$[$0];
172
+ break;
173
+ case 61:
174
+ yy.addRel("birel", ...$$[$0]);
175
+ this.$ = $$[$0];
176
+ break;
177
+ case 62:
178
+ yy.addRel("rel_u", ...$$[$0]);
179
+ this.$ = $$[$0];
180
+ break;
181
+ case 63:
182
+ yy.addRel("rel_d", ...$$[$0]);
183
+ this.$ = $$[$0];
184
+ break;
185
+ case 64:
186
+ yy.addRel("rel_l", ...$$[$0]);
187
+ this.$ = $$[$0];
188
+ break;
189
+ case 65:
190
+ yy.addRel("rel_r", ...$$[$0]);
191
+ this.$ = $$[$0];
192
+ break;
193
+ case 66:
194
+ yy.addRel("rel_b", ...$$[$0]);
195
+ this.$ = $$[$0];
196
+ break;
197
+ case 67:
198
+ $$[$0].splice(0, 1);
199
+ yy.addRel("rel", ...$$[$0]);
200
+ this.$ = $$[$0];
201
+ break;
202
+ case 68:
203
+ yy.updateElStyle("update_el_style", ...$$[$0]);
204
+ this.$ = $$[$0];
205
+ break;
206
+ case 69:
207
+ yy.updateRelStyle("update_rel_style", ...$$[$0]);
208
+ this.$ = $$[$0];
209
+ break;
210
+ case 70:
211
+ yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
212
+ this.$ = $$[$0];
213
+ break;
214
+ case 71:
215
+ this.$ = [$$[$0]];
216
+ break;
217
+ case 72:
218
+ $$[$0].unshift($$[$0 - 1]);
219
+ this.$ = $$[$0];
220
+ break;
221
+ case 73:
222
+ case 75:
223
+ this.$ = $$[$0].trim();
224
+ break;
225
+ case 74:
226
+ let kv = {};
227
+ kv[$$[$0 - 1].trim()] = $$[$0].trim();
228
+ this.$ = kv;
229
+ break;
230
+ case 76:
231
+ this.$ = "";
232
+ break;
233
+ }
234
+ }, "anonymous"),
235
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VH, [2, 14]), o($VI, [2, 16], { 12: [1, 76] }), o($VH, [2, 36], { 12: [1, 77] }), o($VJ, [2, 19]), o($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o($VH, [2, 15]), o($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VJ, [2, 21]), o($VJ, [2, 22]), o($VO, [2, 39]), o($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o($VQ, [2, 73]), { 78: [1, 133] }, o($VQ, [2, 75]), o($VQ, [2, 76]), o($VO, [2, 40]), o($VO, [2, 41]), o($VO, [2, 42]), o($VO, [2, 43]), o($VO, [2, 44]), o($VO, [2, 45]), o($VO, [2, 46]), o($VO, [2, 47]), o($VO, [2, 48]), o($VO, [2, 49]), o($VO, [2, 50]), o($VO, [2, 51]), o($VO, [2, 52]), o($VO, [2, 53]), o($VO, [2, 54]), o($VO, [2, 55]), o($VO, [2, 56]), o($VO, [2, 57]), o($VO, [2, 58]), o($VO, [2, 60]), o($VO, [2, 61]), o($VO, [2, 62]), o($VO, [2, 63]), o($VO, [2, 64]), o($VO, [2, 65]), o($VO, [2, 66]), o($VO, [2, 67]), o($VO, [2, 68]), o($VO, [2, 69]), o($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o($VR, [2, 28]), o($VR, [2, 29]), o($VR, [2, 30]), o($VR, [2, 31]), o($VR, [2, 32]), o($VR, [2, 33]), o($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o($VI, [2, 18]), o($VH, [2, 38]), o($VP, [2, 72]), o($VQ, [2, 74]), o($VO, [2, 24]), o($VO, [2, 35]), o($VS, [2, 25]), o($VS, [2, 26], { 12: [1, 138] }), o($VS, [2, 27])],
236
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
237
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
238
+ if (hash.recoverable) {
239
+ this.trace(str);
240
+ } else {
241
+ var error = new Error(str);
242
+ error.hash = hash;
243
+ throw error;
244
+ }
245
+ }, "parseError"),
246
+ parse: /* @__PURE__ */ __name(function parse(input) {
247
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
248
+ var args = lstack.slice.call(arguments, 1);
249
+ var lexer2 = Object.create(this.lexer);
250
+ var sharedState = { yy: {} };
251
+ for (var k in this.yy) {
252
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
253
+ sharedState.yy[k] = this.yy[k];
254
+ }
255
+ }
256
+ lexer2.setInput(input, sharedState.yy);
257
+ sharedState.yy.lexer = lexer2;
258
+ sharedState.yy.parser = this;
259
+ if (typeof lexer2.yylloc == "undefined") {
260
+ lexer2.yylloc = {};
261
+ }
262
+ var yyloc = lexer2.yylloc;
263
+ lstack.push(yyloc);
264
+ var ranges = lexer2.options && lexer2.options.ranges;
265
+ if (typeof sharedState.yy.parseError === "function") {
266
+ this.parseError = sharedState.yy.parseError;
267
+ } else {
268
+ this.parseError = Object.getPrototypeOf(this).parseError;
269
+ }
270
+ function popStack(n) {
271
+ stack.length = stack.length - 2 * n;
272
+ vstack.length = vstack.length - n;
273
+ lstack.length = lstack.length - n;
274
+ }
275
+ __name(popStack, "popStack");
276
+ function lex() {
277
+ var token;
278
+ token = tstack.pop() || lexer2.lex() || EOF;
279
+ if (typeof token !== "number") {
280
+ if (token instanceof Array) {
281
+ tstack = token;
282
+ token = tstack.pop();
283
+ }
284
+ token = self.symbols_[token] || token;
285
+ }
286
+ return token;
287
+ }
288
+ __name(lex, "lex");
289
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
290
+ while (true) {
291
+ state = stack[stack.length - 1];
292
+ if (this.defaultActions[state]) {
293
+ action = this.defaultActions[state];
294
+ } else {
295
+ if (symbol === null || typeof symbol == "undefined") {
296
+ symbol = lex();
297
+ }
298
+ action = table[state] && table[state][symbol];
299
+ }
300
+ if (typeof action === "undefined" || !action.length || !action[0]) {
301
+ var errStr = "";
302
+ expected = [];
303
+ for (p in table[state]) {
304
+ if (this.terminals_[p] && p > TERROR) {
305
+ expected.push("'" + this.terminals_[p] + "'");
306
+ }
307
+ }
308
+ if (lexer2.showPosition) {
309
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
310
+ } else {
311
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
312
+ }
313
+ this.parseError(errStr, {
314
+ text: lexer2.match,
315
+ token: this.terminals_[symbol] || symbol,
316
+ line: lexer2.yylineno,
317
+ loc: yyloc,
318
+ expected
319
+ });
320
+ }
321
+ if (action[0] instanceof Array && action.length > 1) {
322
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
323
+ }
324
+ switch (action[0]) {
325
+ case 1:
326
+ stack.push(symbol);
327
+ vstack.push(lexer2.yytext);
328
+ lstack.push(lexer2.yylloc);
329
+ stack.push(action[1]);
330
+ symbol = null;
331
+ {
332
+ yyleng = lexer2.yyleng;
333
+ yytext = lexer2.yytext;
334
+ yylineno = lexer2.yylineno;
335
+ yyloc = lexer2.yylloc;
336
+ }
337
+ break;
338
+ case 2:
339
+ len = this.productions_[action[1]][1];
340
+ yyval.$ = vstack[vstack.length - len];
341
+ yyval._$ = {
342
+ first_line: lstack[lstack.length - (len || 1)].first_line,
343
+ last_line: lstack[lstack.length - 1].last_line,
344
+ first_column: lstack[lstack.length - (len || 1)].first_column,
345
+ last_column: lstack[lstack.length - 1].last_column
346
+ };
347
+ if (ranges) {
348
+ yyval._$.range = [
349
+ lstack[lstack.length - (len || 1)].range[0],
350
+ lstack[lstack.length - 1].range[1]
351
+ ];
352
+ }
353
+ r = this.performAction.apply(yyval, [
354
+ yytext,
355
+ yyleng,
356
+ yylineno,
357
+ sharedState.yy,
358
+ action[1],
359
+ vstack,
360
+ lstack
361
+ ].concat(args));
362
+ if (typeof r !== "undefined") {
363
+ return r;
364
+ }
365
+ if (len) {
366
+ stack = stack.slice(0, -1 * len * 2);
367
+ vstack = vstack.slice(0, -1 * len);
368
+ lstack = lstack.slice(0, -1 * len);
369
+ }
370
+ stack.push(this.productions_[action[1]][0]);
371
+ vstack.push(yyval.$);
372
+ lstack.push(yyval._$);
373
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
374
+ stack.push(newState);
375
+ break;
376
+ case 3:
377
+ return true;
378
+ }
379
+ }
380
+ return true;
381
+ }, "parse")
382
+ };
383
+ var lexer = /* @__PURE__ */ (function() {
384
+ var lexer2 = {
385
+ EOF: 1,
386
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
387
+ if (this.yy.parser) {
388
+ this.yy.parser.parseError(str, hash);
389
+ } else {
390
+ throw new Error(str);
391
+ }
392
+ }, "parseError"),
393
+ // resets the lexer, sets new input
394
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
395
+ this.yy = yy || this.yy || {};
396
+ this._input = input;
397
+ this._more = this._backtrack = this.done = false;
398
+ this.yylineno = this.yyleng = 0;
399
+ this.yytext = this.matched = this.match = "";
400
+ this.conditionStack = ["INITIAL"];
401
+ this.yylloc = {
402
+ first_line: 1,
403
+ first_column: 0,
404
+ last_line: 1,
405
+ last_column: 0
406
+ };
407
+ if (this.options.ranges) {
408
+ this.yylloc.range = [0, 0];
409
+ }
410
+ this.offset = 0;
411
+ return this;
412
+ }, "setInput"),
413
+ // consumes and returns one char from the input
414
+ input: /* @__PURE__ */ __name(function() {
415
+ var ch = this._input[0];
416
+ this.yytext += ch;
417
+ this.yyleng++;
418
+ this.offset++;
419
+ this.match += ch;
420
+ this.matched += ch;
421
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
422
+ if (lines) {
423
+ this.yylineno++;
424
+ this.yylloc.last_line++;
425
+ } else {
426
+ this.yylloc.last_column++;
427
+ }
428
+ if (this.options.ranges) {
429
+ this.yylloc.range[1]++;
430
+ }
431
+ this._input = this._input.slice(1);
432
+ return ch;
433
+ }, "input"),
434
+ // unshifts one char (or a string) into the input
435
+ unput: /* @__PURE__ */ __name(function(ch) {
436
+ var len = ch.length;
437
+ var lines = ch.split(/(?:\r\n?|\n)/g);
438
+ this._input = ch + this._input;
439
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
440
+ this.offset -= len;
441
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
442
+ this.match = this.match.substr(0, this.match.length - 1);
443
+ this.matched = this.matched.substr(0, this.matched.length - 1);
444
+ if (lines.length - 1) {
445
+ this.yylineno -= lines.length - 1;
446
+ }
447
+ var r = this.yylloc.range;
448
+ this.yylloc = {
449
+ first_line: this.yylloc.first_line,
450
+ last_line: this.yylineno + 1,
451
+ first_column: this.yylloc.first_column,
452
+ 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
453
+ };
454
+ if (this.options.ranges) {
455
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
456
+ }
457
+ this.yyleng = this.yytext.length;
458
+ return this;
459
+ }, "unput"),
460
+ // When called from action, caches matched text and appends it on next action
461
+ more: /* @__PURE__ */ __name(function() {
462
+ this._more = true;
463
+ return this;
464
+ }, "more"),
465
+ // 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.
466
+ reject: /* @__PURE__ */ __name(function() {
467
+ if (this.options.backtrack_lexer) {
468
+ this._backtrack = true;
469
+ } else {
470
+ 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(), {
471
+ text: "",
472
+ token: null,
473
+ line: this.yylineno
474
+ });
475
+ }
476
+ return this;
477
+ }, "reject"),
478
+ // retain first n characters of the match
479
+ less: /* @__PURE__ */ __name(function(n) {
480
+ this.unput(this.match.slice(n));
481
+ }, "less"),
482
+ // displays already matched input, i.e. for error messages
483
+ pastInput: /* @__PURE__ */ __name(function() {
484
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
485
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
486
+ }, "pastInput"),
487
+ // displays upcoming input, i.e. for error messages
488
+ upcomingInput: /* @__PURE__ */ __name(function() {
489
+ var next = this.match;
490
+ if (next.length < 20) {
491
+ next += this._input.substr(0, 20 - next.length);
492
+ }
493
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
494
+ }, "upcomingInput"),
495
+ // displays the character position where the lexing error occurred, i.e. for error messages
496
+ showPosition: /* @__PURE__ */ __name(function() {
497
+ var pre = this.pastInput();
498
+ var c2 = new Array(pre.length + 1).join("-");
499
+ return pre + this.upcomingInput() + "\n" + c2 + "^";
500
+ }, "showPosition"),
501
+ // test the lexed token: return FALSE when not a match, otherwise return token
502
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
503
+ var token, lines, backup;
504
+ if (this.options.backtrack_lexer) {
505
+ backup = {
506
+ yylineno: this.yylineno,
507
+ yylloc: {
508
+ first_line: this.yylloc.first_line,
509
+ last_line: this.last_line,
510
+ first_column: this.yylloc.first_column,
511
+ last_column: this.yylloc.last_column
512
+ },
513
+ yytext: this.yytext,
514
+ match: this.match,
515
+ matches: this.matches,
516
+ matched: this.matched,
517
+ yyleng: this.yyleng,
518
+ offset: this.offset,
519
+ _more: this._more,
520
+ _input: this._input,
521
+ yy: this.yy,
522
+ conditionStack: this.conditionStack.slice(0),
523
+ done: this.done
524
+ };
525
+ if (this.options.ranges) {
526
+ backup.yylloc.range = this.yylloc.range.slice(0);
527
+ }
528
+ }
529
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
530
+ if (lines) {
531
+ this.yylineno += lines.length;
532
+ }
533
+ this.yylloc = {
534
+ first_line: this.yylloc.last_line,
535
+ last_line: this.yylineno + 1,
536
+ first_column: this.yylloc.last_column,
537
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
538
+ };
539
+ this.yytext += match[0];
540
+ this.match += match[0];
541
+ this.matches = match;
542
+ this.yyleng = this.yytext.length;
543
+ if (this.options.ranges) {
544
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
545
+ }
546
+ this._more = false;
547
+ this._backtrack = false;
548
+ this._input = this._input.slice(match[0].length);
549
+ this.matched += match[0];
550
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
551
+ if (this.done && this._input) {
552
+ this.done = false;
553
+ }
554
+ if (token) {
555
+ return token;
556
+ } else if (this._backtrack) {
557
+ for (var k in backup) {
558
+ this[k] = backup[k];
559
+ }
560
+ return false;
561
+ }
562
+ return false;
563
+ }, "test_match"),
564
+ // return next match in input
565
+ next: /* @__PURE__ */ __name(function() {
566
+ if (this.done) {
567
+ return this.EOF;
568
+ }
569
+ if (!this._input) {
570
+ this.done = true;
571
+ }
572
+ var token, match, tempMatch, index;
573
+ if (!this._more) {
574
+ this.yytext = "";
575
+ this.match = "";
576
+ }
577
+ var rules = this._currentRules();
578
+ for (var i = 0; i < rules.length; i++) {
579
+ tempMatch = this._input.match(this.rules[rules[i]]);
580
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
581
+ match = tempMatch;
582
+ index = i;
583
+ if (this.options.backtrack_lexer) {
584
+ token = this.test_match(tempMatch, rules[i]);
585
+ if (token !== false) {
586
+ return token;
587
+ } else if (this._backtrack) {
588
+ match = false;
589
+ continue;
590
+ } else {
591
+ return false;
592
+ }
593
+ } else if (!this.options.flex) {
594
+ break;
595
+ }
596
+ }
597
+ }
598
+ if (match) {
599
+ token = this.test_match(match, rules[index]);
600
+ if (token !== false) {
601
+ return token;
602
+ }
603
+ return false;
604
+ }
605
+ if (this._input === "") {
606
+ return this.EOF;
607
+ } else {
608
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
609
+ text: "",
610
+ token: null,
611
+ line: this.yylineno
612
+ });
613
+ }
614
+ }, "next"),
615
+ // return next match that has a token
616
+ lex: /* @__PURE__ */ __name(function lex() {
617
+ var r = this.next();
618
+ if (r) {
619
+ return r;
620
+ } else {
621
+ return this.lex();
622
+ }
623
+ }, "lex"),
624
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
625
+ begin: /* @__PURE__ */ __name(function begin(condition) {
626
+ this.conditionStack.push(condition);
627
+ }, "begin"),
628
+ // pop the previously active lexer condition state off the condition stack
629
+ popState: /* @__PURE__ */ __name(function popState() {
630
+ var n = this.conditionStack.length - 1;
631
+ if (n > 0) {
632
+ return this.conditionStack.pop();
633
+ } else {
634
+ return this.conditionStack[0];
635
+ }
636
+ }, "popState"),
637
+ // produce the lexer rule set which is active for the currently active lexer condition state
638
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
639
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
640
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
641
+ } else {
642
+ return this.conditions["INITIAL"].rules;
643
+ }
644
+ }, "_currentRules"),
645
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
646
+ topState: /* @__PURE__ */ __name(function topState(n) {
647
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
648
+ if (n >= 0) {
649
+ return this.conditionStack[n];
650
+ } else {
651
+ return "INITIAL";
652
+ }
653
+ }, "topState"),
654
+ // alias for begin(condition)
655
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
656
+ this.begin(condition);
657
+ }, "pushState"),
658
+ // return the number of states currently on the stack
659
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
660
+ return this.conditionStack.length;
661
+ }, "stateStackSize"),
662
+ options: {},
663
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
664
+ switch ($avoiding_name_collisions) {
665
+ case 0:
666
+ return 6;
667
+ case 1:
668
+ return 7;
669
+ case 2:
670
+ return 8;
671
+ case 3:
672
+ return 9;
673
+ case 4:
674
+ return 22;
675
+ case 5:
676
+ return 23;
677
+ case 6:
678
+ this.begin("acc_title");
679
+ return 24;
680
+ case 7:
681
+ this.popState();
682
+ return "acc_title_value";
683
+ case 8:
684
+ this.begin("acc_descr");
685
+ return 26;
686
+ case 9:
687
+ this.popState();
688
+ return "acc_descr_value";
689
+ case 10:
690
+ this.begin("acc_descr_multiline");
691
+ break;
692
+ case 11:
693
+ this.popState();
694
+ break;
695
+ case 12:
696
+ return "acc_descr_multiline_value";
697
+ case 13:
698
+ break;
699
+ case 14:
700
+ c;
701
+ break;
702
+ case 15:
703
+ return 12;
704
+ case 16:
705
+ break;
706
+ case 17:
707
+ return 11;
708
+ case 18:
709
+ return 15;
710
+ case 19:
711
+ return 16;
712
+ case 20:
713
+ return 17;
714
+ case 21:
715
+ return 18;
716
+ case 22:
717
+ this.begin("person_ext");
718
+ return 45;
719
+ case 23:
720
+ this.begin("person");
721
+ return 44;
722
+ case 24:
723
+ this.begin("system_ext_queue");
724
+ return 51;
725
+ case 25:
726
+ this.begin("system_ext_db");
727
+ return 50;
728
+ case 26:
729
+ this.begin("system_ext");
730
+ return 49;
731
+ case 27:
732
+ this.begin("system_queue");
733
+ return 48;
734
+ case 28:
735
+ this.begin("system_db");
736
+ return 47;
737
+ case 29:
738
+ this.begin("system");
739
+ return 46;
740
+ case 30:
741
+ this.begin("boundary");
742
+ return 37;
743
+ case 31:
744
+ this.begin("enterprise_boundary");
745
+ return 34;
746
+ case 32:
747
+ this.begin("system_boundary");
748
+ return 36;
749
+ case 33:
750
+ this.begin("container_ext_queue");
751
+ return 57;
752
+ case 34:
753
+ this.begin("container_ext_db");
754
+ return 56;
755
+ case 35:
756
+ this.begin("container_ext");
757
+ return 55;
758
+ case 36:
759
+ this.begin("container_queue");
760
+ return 54;
761
+ case 37:
762
+ this.begin("container_db");
763
+ return 53;
764
+ case 38:
765
+ this.begin("container");
766
+ return 52;
767
+ case 39:
768
+ this.begin("container_boundary");
769
+ return 38;
770
+ case 40:
771
+ this.begin("component_ext_queue");
772
+ return 63;
773
+ case 41:
774
+ this.begin("component_ext_db");
775
+ return 62;
776
+ case 42:
777
+ this.begin("component_ext");
778
+ return 61;
779
+ case 43:
780
+ this.begin("component_queue");
781
+ return 60;
782
+ case 44:
783
+ this.begin("component_db");
784
+ return 59;
785
+ case 45:
786
+ this.begin("component");
787
+ return 58;
788
+ case 46:
789
+ this.begin("node");
790
+ return 39;
791
+ case 47:
792
+ this.begin("node");
793
+ return 39;
794
+ case 48:
795
+ this.begin("node_l");
796
+ return 40;
797
+ case 49:
798
+ this.begin("node_r");
799
+ return 41;
800
+ case 50:
801
+ this.begin("rel");
802
+ return 64;
803
+ case 51:
804
+ this.begin("birel");
805
+ return 65;
806
+ case 52:
807
+ this.begin("rel_u");
808
+ return 66;
809
+ case 53:
810
+ this.begin("rel_u");
811
+ return 66;
812
+ case 54:
813
+ this.begin("rel_d");
814
+ return 67;
815
+ case 55:
816
+ this.begin("rel_d");
817
+ return 67;
818
+ case 56:
819
+ this.begin("rel_l");
820
+ return 68;
821
+ case 57:
822
+ this.begin("rel_l");
823
+ return 68;
824
+ case 58:
825
+ this.begin("rel_r");
826
+ return 69;
827
+ case 59:
828
+ this.begin("rel_r");
829
+ return 69;
830
+ case 60:
831
+ this.begin("rel_b");
832
+ return 70;
833
+ case 61:
834
+ this.begin("rel_index");
835
+ return 71;
836
+ case 62:
837
+ this.begin("update_el_style");
838
+ return 72;
839
+ case 63:
840
+ this.begin("update_rel_style");
841
+ return 73;
842
+ case 64:
843
+ this.begin("update_layout_config");
844
+ return 74;
845
+ case 65:
846
+ return "EOF_IN_STRUCT";
847
+ case 66:
848
+ this.begin("attribute");
849
+ return "ATTRIBUTE_EMPTY";
850
+ case 67:
851
+ this.begin("attribute");
852
+ break;
853
+ case 68:
854
+ this.popState();
855
+ this.popState();
856
+ break;
857
+ case 69:
858
+ return 80;
859
+ case 70:
860
+ break;
861
+ case 71:
862
+ return 80;
863
+ case 72:
864
+ this.begin("string");
865
+ break;
866
+ case 73:
867
+ this.popState();
868
+ break;
869
+ case 74:
870
+ return "STR";
871
+ case 75:
872
+ this.begin("string_kv");
873
+ break;
874
+ case 76:
875
+ this.begin("string_kv_key");
876
+ return "STR_KEY";
877
+ case 77:
878
+ this.popState();
879
+ this.begin("string_kv_value");
880
+ break;
881
+ case 78:
882
+ return "STR_VALUE";
883
+ case 79:
884
+ this.popState();
885
+ this.popState();
886
+ break;
887
+ case 80:
888
+ return "STR";
889
+ case 81:
890
+ return "LBRACE";
891
+ case 82:
892
+ return "RBRACE";
893
+ case 83:
894
+ return "SPACE";
895
+ case 84:
896
+ return "EOL";
897
+ case 85:
898
+ return 14;
899
+ }
900
+ }, "anonymous"),
901
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/],
902
+ conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } }
903
+ };
904
+ return lexer2;
905
+ })();
906
+ parser2.lexer = lexer;
907
+ function Parser() {
908
+ this.yy = {};
909
+ }
910
+ __name(Parser, "Parser");
911
+ Parser.prototype = parser2;
912
+ parser2.Parser = Parser;
913
+ return new Parser();
914
+ })();
915
+ parser.parser = parser;
916
+ var c4Diagram_default = parser;
917
+ var c4ShapeArray = [];
918
+ var boundaryParseStack = [""];
919
+ var currentBoundaryParse = "global";
920
+ var parentBoundaryParse = "";
921
+ var boundaries = [
922
+ {
923
+ alias: "global",
924
+ label: { text: "global" },
925
+ type: { text: "global" },
926
+ tags: null,
927
+ link: null,
928
+ parentBoundary: ""
929
+ }
930
+ ];
931
+ var rels = [];
932
+ var title = "";
933
+ var wrapEnabled = false;
934
+ var c4ShapeInRow = 4;
935
+ var c4BoundaryInRow = 2;
936
+ var c4Type;
937
+ var getC4Type = /* @__PURE__ */ __name(function() {
938
+ return c4Type;
939
+ }, "getC4Type");
940
+ var setC4Type = /* @__PURE__ */ __name(function(c4TypeParam) {
941
+ let sanitizedText = sanitizeText(c4TypeParam, getConfig2());
942
+ c4Type = sanitizedText;
943
+ }, "setC4Type");
944
+ var addRel = /* @__PURE__ */ __name(function(type, from, to, label, techn, descr, sprite, tags, link) {
945
+ if (type === void 0 || type === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) {
946
+ return;
947
+ }
948
+ let rel = {};
949
+ const old = rels.find((rel2) => rel2.from === from && rel2.to === to);
950
+ if (old) {
951
+ rel = old;
952
+ } else {
953
+ rels.push(rel);
954
+ }
955
+ rel.type = type;
956
+ rel.from = from;
957
+ rel.to = to;
958
+ rel.label = { text: label };
959
+ if (techn === void 0 || techn === null) {
960
+ rel.techn = { text: "" };
961
+ } else {
962
+ if (typeof techn === "object") {
963
+ let [key, value] = Object.entries(techn)[0];
964
+ rel[key] = { text: value };
965
+ } else {
966
+ rel.techn = { text: techn };
967
+ }
968
+ }
969
+ if (descr === void 0 || descr === null) {
970
+ rel.descr = { text: "" };
971
+ } else {
972
+ if (typeof descr === "object") {
973
+ let [key, value] = Object.entries(descr)[0];
974
+ rel[key] = { text: value };
975
+ } else {
976
+ rel.descr = { text: descr };
977
+ }
978
+ }
979
+ if (typeof sprite === "object") {
980
+ let [key, value] = Object.entries(sprite)[0];
981
+ rel[key] = value;
982
+ } else {
983
+ rel.sprite = sprite;
984
+ }
985
+ if (typeof tags === "object") {
986
+ let [key, value] = Object.entries(tags)[0];
987
+ rel[key] = value;
988
+ } else {
989
+ rel.tags = tags;
990
+ }
991
+ if (typeof link === "object") {
992
+ let [key, value] = Object.entries(link)[0];
993
+ rel[key] = value;
994
+ } else {
995
+ rel.link = link;
996
+ }
997
+ rel.wrap = autoWrap();
998
+ }, "addRel");
999
+ var addPersonOrSystem = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, descr, sprite, tags, link) {
1000
+ if (alias === null || label === null) {
1001
+ return;
1002
+ }
1003
+ let personOrSystem = {};
1004
+ const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
1005
+ if (old && alias === old.alias) {
1006
+ personOrSystem = old;
1007
+ } else {
1008
+ personOrSystem.alias = alias;
1009
+ c4ShapeArray.push(personOrSystem);
1010
+ }
1011
+ if (label === void 0 || label === null) {
1012
+ personOrSystem.label = { text: "" };
1013
+ } else {
1014
+ personOrSystem.label = { text: label };
1015
+ }
1016
+ if (descr === void 0 || descr === null) {
1017
+ personOrSystem.descr = { text: "" };
1018
+ } else {
1019
+ if (typeof descr === "object") {
1020
+ let [key, value] = Object.entries(descr)[0];
1021
+ personOrSystem[key] = { text: value };
1022
+ } else {
1023
+ personOrSystem.descr = { text: descr };
1024
+ }
1025
+ }
1026
+ if (typeof sprite === "object") {
1027
+ let [key, value] = Object.entries(sprite)[0];
1028
+ personOrSystem[key] = value;
1029
+ } else {
1030
+ personOrSystem.sprite = sprite;
1031
+ }
1032
+ if (typeof tags === "object") {
1033
+ let [key, value] = Object.entries(tags)[0];
1034
+ personOrSystem[key] = value;
1035
+ } else {
1036
+ personOrSystem.tags = tags;
1037
+ }
1038
+ if (typeof link === "object") {
1039
+ let [key, value] = Object.entries(link)[0];
1040
+ personOrSystem[key] = value;
1041
+ } else {
1042
+ personOrSystem.link = link;
1043
+ }
1044
+ personOrSystem.typeC4Shape = { text: typeC4Shape };
1045
+ personOrSystem.parentBoundary = currentBoundaryParse;
1046
+ personOrSystem.wrap = autoWrap();
1047
+ }, "addPersonOrSystem");
1048
+ var addContainer = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1049
+ if (alias === null || label === null) {
1050
+ return;
1051
+ }
1052
+ let container = {};
1053
+ const old = c4ShapeArray.find((container2) => container2.alias === alias);
1054
+ if (old && alias === old.alias) {
1055
+ container = old;
1056
+ } else {
1057
+ container.alias = alias;
1058
+ c4ShapeArray.push(container);
1059
+ }
1060
+ if (label === void 0 || label === null) {
1061
+ container.label = { text: "" };
1062
+ } else {
1063
+ container.label = { text: label };
1064
+ }
1065
+ if (techn === void 0 || techn === null) {
1066
+ container.techn = { text: "" };
1067
+ } else {
1068
+ if (typeof techn === "object") {
1069
+ let [key, value] = Object.entries(techn)[0];
1070
+ container[key] = { text: value };
1071
+ } else {
1072
+ container.techn = { text: techn };
1073
+ }
1074
+ }
1075
+ if (descr === void 0 || descr === null) {
1076
+ container.descr = { text: "" };
1077
+ } else {
1078
+ if (typeof descr === "object") {
1079
+ let [key, value] = Object.entries(descr)[0];
1080
+ container[key] = { text: value };
1081
+ } else {
1082
+ container.descr = { text: descr };
1083
+ }
1084
+ }
1085
+ if (typeof sprite === "object") {
1086
+ let [key, value] = Object.entries(sprite)[0];
1087
+ container[key] = value;
1088
+ } else {
1089
+ container.sprite = sprite;
1090
+ }
1091
+ if (typeof tags === "object") {
1092
+ let [key, value] = Object.entries(tags)[0];
1093
+ container[key] = value;
1094
+ } else {
1095
+ container.tags = tags;
1096
+ }
1097
+ if (typeof link === "object") {
1098
+ let [key, value] = Object.entries(link)[0];
1099
+ container[key] = value;
1100
+ } else {
1101
+ container.link = link;
1102
+ }
1103
+ container.wrap = autoWrap();
1104
+ container.typeC4Shape = { text: typeC4Shape };
1105
+ container.parentBoundary = currentBoundaryParse;
1106
+ }, "addContainer");
1107
+ var addComponent = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1108
+ if (alias === null || label === null) {
1109
+ return;
1110
+ }
1111
+ let component = {};
1112
+ const old = c4ShapeArray.find((component2) => component2.alias === alias);
1113
+ if (old && alias === old.alias) {
1114
+ component = old;
1115
+ } else {
1116
+ component.alias = alias;
1117
+ c4ShapeArray.push(component);
1118
+ }
1119
+ if (label === void 0 || label === null) {
1120
+ component.label = { text: "" };
1121
+ } else {
1122
+ component.label = { text: label };
1123
+ }
1124
+ if (techn === void 0 || techn === null) {
1125
+ component.techn = { text: "" };
1126
+ } else {
1127
+ if (typeof techn === "object") {
1128
+ let [key, value] = Object.entries(techn)[0];
1129
+ component[key] = { text: value };
1130
+ } else {
1131
+ component.techn = { text: techn };
1132
+ }
1133
+ }
1134
+ if (descr === void 0 || descr === null) {
1135
+ component.descr = { text: "" };
1136
+ } else {
1137
+ if (typeof descr === "object") {
1138
+ let [key, value] = Object.entries(descr)[0];
1139
+ component[key] = { text: value };
1140
+ } else {
1141
+ component.descr = { text: descr };
1142
+ }
1143
+ }
1144
+ if (typeof sprite === "object") {
1145
+ let [key, value] = Object.entries(sprite)[0];
1146
+ component[key] = value;
1147
+ } else {
1148
+ component.sprite = sprite;
1149
+ }
1150
+ if (typeof tags === "object") {
1151
+ let [key, value] = Object.entries(tags)[0];
1152
+ component[key] = value;
1153
+ } else {
1154
+ component.tags = tags;
1155
+ }
1156
+ if (typeof link === "object") {
1157
+ let [key, value] = Object.entries(link)[0];
1158
+ component[key] = value;
1159
+ } else {
1160
+ component.link = link;
1161
+ }
1162
+ component.wrap = autoWrap();
1163
+ component.typeC4Shape = { text: typeC4Shape };
1164
+ component.parentBoundary = currentBoundaryParse;
1165
+ }, "addComponent");
1166
+ var addPersonOrSystemBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1167
+ if (alias === null || label === null) {
1168
+ return;
1169
+ }
1170
+ let boundary = {};
1171
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1172
+ if (old && alias === old.alias) {
1173
+ boundary = old;
1174
+ } else {
1175
+ boundary.alias = alias;
1176
+ boundaries.push(boundary);
1177
+ }
1178
+ if (label === void 0 || label === null) {
1179
+ boundary.label = { text: "" };
1180
+ } else {
1181
+ boundary.label = { text: label };
1182
+ }
1183
+ if (type === void 0 || type === null) {
1184
+ boundary.type = { text: "system" };
1185
+ } else {
1186
+ if (typeof type === "object") {
1187
+ let [key, value] = Object.entries(type)[0];
1188
+ boundary[key] = { text: value };
1189
+ } else {
1190
+ boundary.type = { text: type };
1191
+ }
1192
+ }
1193
+ if (typeof tags === "object") {
1194
+ let [key, value] = Object.entries(tags)[0];
1195
+ boundary[key] = value;
1196
+ } else {
1197
+ boundary.tags = tags;
1198
+ }
1199
+ if (typeof link === "object") {
1200
+ let [key, value] = Object.entries(link)[0];
1201
+ boundary[key] = value;
1202
+ } else {
1203
+ boundary.link = link;
1204
+ }
1205
+ boundary.parentBoundary = currentBoundaryParse;
1206
+ boundary.wrap = autoWrap();
1207
+ parentBoundaryParse = currentBoundaryParse;
1208
+ currentBoundaryParse = alias;
1209
+ boundaryParseStack.push(parentBoundaryParse);
1210
+ }, "addPersonOrSystemBoundary");
1211
+ var addContainerBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1212
+ if (alias === null || label === null) {
1213
+ return;
1214
+ }
1215
+ let boundary = {};
1216
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1217
+ if (old && alias === old.alias) {
1218
+ boundary = old;
1219
+ } else {
1220
+ boundary.alias = alias;
1221
+ boundaries.push(boundary);
1222
+ }
1223
+ if (label === void 0 || label === null) {
1224
+ boundary.label = { text: "" };
1225
+ } else {
1226
+ boundary.label = { text: label };
1227
+ }
1228
+ if (type === void 0 || type === null) {
1229
+ boundary.type = { text: "container" };
1230
+ } else {
1231
+ if (typeof type === "object") {
1232
+ let [key, value] = Object.entries(type)[0];
1233
+ boundary[key] = { text: value };
1234
+ } else {
1235
+ boundary.type = { text: type };
1236
+ }
1237
+ }
1238
+ if (typeof tags === "object") {
1239
+ let [key, value] = Object.entries(tags)[0];
1240
+ boundary[key] = value;
1241
+ } else {
1242
+ boundary.tags = tags;
1243
+ }
1244
+ if (typeof link === "object") {
1245
+ let [key, value] = Object.entries(link)[0];
1246
+ boundary[key] = value;
1247
+ } else {
1248
+ boundary.link = link;
1249
+ }
1250
+ boundary.parentBoundary = currentBoundaryParse;
1251
+ boundary.wrap = autoWrap();
1252
+ parentBoundaryParse = currentBoundaryParse;
1253
+ currentBoundaryParse = alias;
1254
+ boundaryParseStack.push(parentBoundaryParse);
1255
+ }, "addContainerBoundary");
1256
+ var addDeploymentNode = /* @__PURE__ */ __name(function(nodeType, alias, label, type, descr, sprite, tags, link) {
1257
+ if (alias === null || label === null) {
1258
+ return;
1259
+ }
1260
+ let boundary = {};
1261
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1262
+ if (old && alias === old.alias) {
1263
+ boundary = old;
1264
+ } else {
1265
+ boundary.alias = alias;
1266
+ boundaries.push(boundary);
1267
+ }
1268
+ if (label === void 0 || label === null) {
1269
+ boundary.label = { text: "" };
1270
+ } else {
1271
+ boundary.label = { text: label };
1272
+ }
1273
+ if (type === void 0 || type === null) {
1274
+ boundary.type = { text: "node" };
1275
+ } else {
1276
+ if (typeof type === "object") {
1277
+ let [key, value] = Object.entries(type)[0];
1278
+ boundary[key] = { text: value };
1279
+ } else {
1280
+ boundary.type = { text: type };
1281
+ }
1282
+ }
1283
+ if (descr === void 0 || descr === null) {
1284
+ boundary.descr = { text: "" };
1285
+ } else {
1286
+ if (typeof descr === "object") {
1287
+ let [key, value] = Object.entries(descr)[0];
1288
+ boundary[key] = { text: value };
1289
+ } else {
1290
+ boundary.descr = { text: descr };
1291
+ }
1292
+ }
1293
+ if (typeof tags === "object") {
1294
+ let [key, value] = Object.entries(tags)[0];
1295
+ boundary[key] = value;
1296
+ } else {
1297
+ boundary.tags = tags;
1298
+ }
1299
+ if (typeof link === "object") {
1300
+ let [key, value] = Object.entries(link)[0];
1301
+ boundary[key] = value;
1302
+ } else {
1303
+ boundary.link = link;
1304
+ }
1305
+ boundary.nodeType = nodeType;
1306
+ boundary.parentBoundary = currentBoundaryParse;
1307
+ boundary.wrap = autoWrap();
1308
+ parentBoundaryParse = currentBoundaryParse;
1309
+ currentBoundaryParse = alias;
1310
+ boundaryParseStack.push(parentBoundaryParse);
1311
+ }, "addDeploymentNode");
1312
+ var popBoundaryParseStack = /* @__PURE__ */ __name(function() {
1313
+ currentBoundaryParse = parentBoundaryParse;
1314
+ boundaryParseStack.pop();
1315
+ parentBoundaryParse = boundaryParseStack.pop();
1316
+ boundaryParseStack.push(parentBoundaryParse);
1317
+ }, "popBoundaryParseStack");
1318
+ var updateElStyle = /* @__PURE__ */ __name(function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
1319
+ let old = c4ShapeArray.find((element) => element.alias === elementName);
1320
+ if (old === void 0) {
1321
+ old = boundaries.find((element) => element.alias === elementName);
1322
+ if (old === void 0) {
1323
+ return;
1324
+ }
1325
+ }
1326
+ if (bgColor !== void 0 && bgColor !== null) {
1327
+ if (typeof bgColor === "object") {
1328
+ let [key, value] = Object.entries(bgColor)[0];
1329
+ old[key] = value;
1330
+ } else {
1331
+ old.bgColor = bgColor;
1332
+ }
1333
+ }
1334
+ if (fontColor !== void 0 && fontColor !== null) {
1335
+ if (typeof fontColor === "object") {
1336
+ let [key, value] = Object.entries(fontColor)[0];
1337
+ old[key] = value;
1338
+ } else {
1339
+ old.fontColor = fontColor;
1340
+ }
1341
+ }
1342
+ if (borderColor !== void 0 && borderColor !== null) {
1343
+ if (typeof borderColor === "object") {
1344
+ let [key, value] = Object.entries(borderColor)[0];
1345
+ old[key] = value;
1346
+ } else {
1347
+ old.borderColor = borderColor;
1348
+ }
1349
+ }
1350
+ if (shadowing !== void 0 && shadowing !== null) {
1351
+ if (typeof shadowing === "object") {
1352
+ let [key, value] = Object.entries(shadowing)[0];
1353
+ old[key] = value;
1354
+ } else {
1355
+ old.shadowing = shadowing;
1356
+ }
1357
+ }
1358
+ if (shape !== void 0 && shape !== null) {
1359
+ if (typeof shape === "object") {
1360
+ let [key, value] = Object.entries(shape)[0];
1361
+ old[key] = value;
1362
+ } else {
1363
+ old.shape = shape;
1364
+ }
1365
+ }
1366
+ if (sprite !== void 0 && sprite !== null) {
1367
+ if (typeof sprite === "object") {
1368
+ let [key, value] = Object.entries(sprite)[0];
1369
+ old[key] = value;
1370
+ } else {
1371
+ old.sprite = sprite;
1372
+ }
1373
+ }
1374
+ if (techn !== void 0 && techn !== null) {
1375
+ if (typeof techn === "object") {
1376
+ let [key, value] = Object.entries(techn)[0];
1377
+ old[key] = value;
1378
+ } else {
1379
+ old.techn = techn;
1380
+ }
1381
+ }
1382
+ if (legendText !== void 0 && legendText !== null) {
1383
+ if (typeof legendText === "object") {
1384
+ let [key, value] = Object.entries(legendText)[0];
1385
+ old[key] = value;
1386
+ } else {
1387
+ old.legendText = legendText;
1388
+ }
1389
+ }
1390
+ if (legendSprite !== void 0 && legendSprite !== null) {
1391
+ if (typeof legendSprite === "object") {
1392
+ let [key, value] = Object.entries(legendSprite)[0];
1393
+ old[key] = value;
1394
+ } else {
1395
+ old.legendSprite = legendSprite;
1396
+ }
1397
+ }
1398
+ }, "updateElStyle");
1399
+ var updateRelStyle = /* @__PURE__ */ __name(function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) {
1400
+ const old = rels.find((rel) => rel.from === from && rel.to === to);
1401
+ if (old === void 0) {
1402
+ return;
1403
+ }
1404
+ if (textColor !== void 0 && textColor !== null) {
1405
+ if (typeof textColor === "object") {
1406
+ let [key, value] = Object.entries(textColor)[0];
1407
+ old[key] = value;
1408
+ } else {
1409
+ old.textColor = textColor;
1410
+ }
1411
+ }
1412
+ if (lineColor !== void 0 && lineColor !== null) {
1413
+ if (typeof lineColor === "object") {
1414
+ let [key, value] = Object.entries(lineColor)[0];
1415
+ old[key] = value;
1416
+ } else {
1417
+ old.lineColor = lineColor;
1418
+ }
1419
+ }
1420
+ if (offsetX !== void 0 && offsetX !== null) {
1421
+ if (typeof offsetX === "object") {
1422
+ let [key, value] = Object.entries(offsetX)[0];
1423
+ old[key] = parseInt(value);
1424
+ } else {
1425
+ old.offsetX = parseInt(offsetX);
1426
+ }
1427
+ }
1428
+ if (offsetY !== void 0 && offsetY !== null) {
1429
+ if (typeof offsetY === "object") {
1430
+ let [key, value] = Object.entries(offsetY)[0];
1431
+ old[key] = parseInt(value);
1432
+ } else {
1433
+ old.offsetY = parseInt(offsetY);
1434
+ }
1435
+ }
1436
+ }, "updateRelStyle");
1437
+ var updateLayoutConfig = /* @__PURE__ */ __name(function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
1438
+ let c4ShapeInRowValue = c4ShapeInRow;
1439
+ let c4BoundaryInRowValue = c4BoundaryInRow;
1440
+ if (typeof c4ShapeInRowParam === "object") {
1441
+ const value = Object.values(c4ShapeInRowParam)[0];
1442
+ c4ShapeInRowValue = parseInt(value);
1443
+ } else {
1444
+ c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
1445
+ }
1446
+ if (typeof c4BoundaryInRowParam === "object") {
1447
+ const value = Object.values(c4BoundaryInRowParam)[0];
1448
+ c4BoundaryInRowValue = parseInt(value);
1449
+ } else {
1450
+ c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
1451
+ }
1452
+ if (c4ShapeInRowValue >= 1) {
1453
+ c4ShapeInRow = c4ShapeInRowValue;
1454
+ }
1455
+ if (c4BoundaryInRowValue >= 1) {
1456
+ c4BoundaryInRow = c4BoundaryInRowValue;
1457
+ }
1458
+ }, "updateLayoutConfig");
1459
+ var getC4ShapeInRow = /* @__PURE__ */ __name(function() {
1460
+ return c4ShapeInRow;
1461
+ }, "getC4ShapeInRow");
1462
+ var getC4BoundaryInRow = /* @__PURE__ */ __name(function() {
1463
+ return c4BoundaryInRow;
1464
+ }, "getC4BoundaryInRow");
1465
+ var getCurrentBoundaryParse = /* @__PURE__ */ __name(function() {
1466
+ return currentBoundaryParse;
1467
+ }, "getCurrentBoundaryParse");
1468
+ var getParentBoundaryParse = /* @__PURE__ */ __name(function() {
1469
+ return parentBoundaryParse;
1470
+ }, "getParentBoundaryParse");
1471
+ var getC4ShapeArray = /* @__PURE__ */ __name(function(parentBoundary) {
1472
+ if (parentBoundary === void 0 || parentBoundary === null) {
1473
+ return c4ShapeArray;
1474
+ } else {
1475
+ return c4ShapeArray.filter((personOrSystem) => {
1476
+ return personOrSystem.parentBoundary === parentBoundary;
1477
+ });
1478
+ }
1479
+ }, "getC4ShapeArray");
1480
+ var getC4Shape = /* @__PURE__ */ __name(function(alias) {
1481
+ return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
1482
+ }, "getC4Shape");
1483
+ var getC4ShapeKeys = /* @__PURE__ */ __name(function(parentBoundary) {
1484
+ return Object.keys(getC4ShapeArray(parentBoundary));
1485
+ }, "getC4ShapeKeys");
1486
+ var getBoundaries = /* @__PURE__ */ __name(function(parentBoundary) {
1487
+ if (parentBoundary === void 0 || parentBoundary === null) {
1488
+ return boundaries;
1489
+ } else {
1490
+ return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
1491
+ }
1492
+ }, "getBoundaries");
1493
+ var getBoundarys = getBoundaries;
1494
+ var getRels = /* @__PURE__ */ __name(function() {
1495
+ return rels;
1496
+ }, "getRels");
1497
+ var getTitle = /* @__PURE__ */ __name(function() {
1498
+ return title;
1499
+ }, "getTitle");
1500
+ var setWrap = /* @__PURE__ */ __name(function(wrapSetting) {
1501
+ wrapEnabled = wrapSetting;
1502
+ }, "setWrap");
1503
+ var autoWrap = /* @__PURE__ */ __name(function() {
1504
+ return wrapEnabled;
1505
+ }, "autoWrap");
1506
+ var clear = /* @__PURE__ */ __name(function() {
1507
+ c4ShapeArray = [];
1508
+ boundaries = [
1509
+ {
1510
+ alias: "global",
1511
+ label: { text: "global" },
1512
+ type: { text: "global" },
1513
+ tags: null,
1514
+ link: null,
1515
+ parentBoundary: ""
1516
+ }
1517
+ ];
1518
+ parentBoundaryParse = "";
1519
+ currentBoundaryParse = "global";
1520
+ boundaryParseStack = [""];
1521
+ rels = [];
1522
+ boundaryParseStack = [""];
1523
+ title = "";
1524
+ wrapEnabled = false;
1525
+ c4ShapeInRow = 4;
1526
+ c4BoundaryInRow = 2;
1527
+ }, "clear");
1528
+ var LINETYPE = {
1529
+ SOLID: 0,
1530
+ DOTTED: 1,
1531
+ NOTE: 2,
1532
+ SOLID_CROSS: 3,
1533
+ DOTTED_CROSS: 4,
1534
+ SOLID_OPEN: 5,
1535
+ DOTTED_OPEN: 6,
1536
+ LOOP_START: 10,
1537
+ LOOP_END: 11,
1538
+ ALT_START: 12,
1539
+ ALT_ELSE: 13,
1540
+ ALT_END: 14,
1541
+ OPT_START: 15,
1542
+ OPT_END: 16,
1543
+ ACTIVE_START: 17,
1544
+ ACTIVE_END: 18,
1545
+ PAR_START: 19,
1546
+ PAR_AND: 20,
1547
+ PAR_END: 21,
1548
+ RECT_START: 22,
1549
+ RECT_END: 23,
1550
+ SOLID_POINT: 24,
1551
+ DOTTED_POINT: 25
1552
+ };
1553
+ var ARROWTYPE = {
1554
+ FILLED: 0,
1555
+ OPEN: 1
1556
+ };
1557
+ var PLACEMENT = {
1558
+ LEFTOF: 0,
1559
+ RIGHTOF: 1,
1560
+ OVER: 2
1561
+ };
1562
+ var setTitle = /* @__PURE__ */ __name(function(txt) {
1563
+ let sanitizedText = sanitizeText(txt, getConfig2());
1564
+ title = sanitizedText;
1565
+ }, "setTitle");
1566
+ var c4Db_default = {
1567
+ addPersonOrSystem,
1568
+ addPersonOrSystemBoundary,
1569
+ addContainer,
1570
+ addContainerBoundary,
1571
+ addComponent,
1572
+ addDeploymentNode,
1573
+ popBoundaryParseStack,
1574
+ addRel,
1575
+ updateElStyle,
1576
+ updateRelStyle,
1577
+ updateLayoutConfig,
1578
+ autoWrap,
1579
+ setWrap,
1580
+ getC4ShapeArray,
1581
+ getC4Shape,
1582
+ getC4ShapeKeys,
1583
+ getBoundaries,
1584
+ getBoundarys,
1585
+ getCurrentBoundaryParse,
1586
+ getParentBoundaryParse,
1587
+ getRels,
1588
+ getTitle,
1589
+ getC4Type,
1590
+ getC4ShapeInRow,
1591
+ getC4BoundaryInRow,
1592
+ setAccTitle,
1593
+ getAccTitle,
1594
+ getAccDescription,
1595
+ setAccDescription,
1596
+ getConfig: /* @__PURE__ */ __name(() => getConfig2().c4, "getConfig"),
1597
+ clear,
1598
+ LINETYPE,
1599
+ ARROWTYPE,
1600
+ PLACEMENT,
1601
+ setTitle,
1602
+ setC4Type
1603
+ // apply,
1604
+ };
1605
+ var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
1606
+ return drawRect(elem, rectData);
1607
+ }, "drawRect");
1608
+ var drawImage = /* @__PURE__ */ __name(function(elem, width, height, x, y, link) {
1609
+ const imageElem = elem.append("image");
1610
+ imageElem.attr("width", width);
1611
+ imageElem.attr("height", height);
1612
+ imageElem.attr("x", x);
1613
+ imageElem.attr("y", y);
1614
+ let sanitizedLink = link.startsWith("data:image/png;base64") ? link : distExports.sanitizeUrl(link);
1615
+ imageElem.attr("xlink:href", sanitizedLink);
1616
+ }, "drawImage");
1617
+ var drawRels = /* @__PURE__ */ __name((elem, rels2, conf2) => {
1618
+ const relsElem = elem.append("g");
1619
+ let i = 0;
1620
+ for (let rel of rels2) {
1621
+ let textColor = rel.textColor ? rel.textColor : "#444444";
1622
+ let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
1623
+ let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
1624
+ let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
1625
+ let url = "";
1626
+ if (i === 0) {
1627
+ let line = relsElem.append("line");
1628
+ line.attr("x1", rel.startPoint.x);
1629
+ line.attr("y1", rel.startPoint.y);
1630
+ line.attr("x2", rel.endPoint.x);
1631
+ line.attr("y2", rel.endPoint.y);
1632
+ line.attr("stroke-width", "1");
1633
+ line.attr("stroke", strokeColor);
1634
+ line.style("fill", "none");
1635
+ if (rel.type !== "rel_b") {
1636
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
1637
+ }
1638
+ if (rel.type === "birel" || rel.type === "rel_b") {
1639
+ line.attr("marker-start", "url(" + url + "#arrowend)");
1640
+ }
1641
+ i = -1;
1642
+ } else {
1643
+ let line = relsElem.append("path");
1644
+ line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
1645
+ "d",
1646
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
1647
+ "controlx",
1648
+ rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4
1649
+ ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y)
1650
+ );
1651
+ if (rel.type !== "rel_b") {
1652
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
1653
+ }
1654
+ if (rel.type === "birel" || rel.type === "rel_b") {
1655
+ line.attr("marker-start", "url(" + url + "#arrowend)");
1656
+ }
1657
+ }
1658
+ let messageConf = conf2.messageFont();
1659
+ _drawTextCandidateFunc(conf2)(
1660
+ rel.label.text,
1661
+ relsElem,
1662
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1663
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY,
1664
+ rel.label.width,
1665
+ rel.label.height,
1666
+ { fill: textColor },
1667
+ messageConf
1668
+ );
1669
+ if (rel.techn && rel.techn.text !== "") {
1670
+ messageConf = conf2.messageFont();
1671
+ _drawTextCandidateFunc(conf2)(
1672
+ "[" + rel.techn.text + "]",
1673
+ relsElem,
1674
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1675
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY,
1676
+ Math.max(rel.label.width, rel.techn.width),
1677
+ rel.techn.height,
1678
+ { fill: textColor, "font-style": "italic" },
1679
+ messageConf
1680
+ );
1681
+ }
1682
+ }
1683
+ }, "drawRels");
1684
+ var drawBoundary = /* @__PURE__ */ __name(function(elem, boundary, conf2) {
1685
+ const boundaryElem = elem.append("g");
1686
+ let fillColor = boundary.bgColor ? boundary.bgColor : "none";
1687
+ let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
1688
+ let fontColor = boundary.fontColor ? boundary.fontColor : "black";
1689
+ let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
1690
+ if (boundary.nodeType) {
1691
+ attrsValue = { "stroke-width": 1 };
1692
+ }
1693
+ let rectData = {
1694
+ x: boundary.x,
1695
+ y: boundary.y,
1696
+ fill: fillColor,
1697
+ stroke: strokeColor,
1698
+ width: boundary.width,
1699
+ height: boundary.height,
1700
+ rx: 2.5,
1701
+ ry: 2.5,
1702
+ attrs: attrsValue
1703
+ };
1704
+ drawRect2(boundaryElem, rectData);
1705
+ let boundaryConf = conf2.boundaryFont();
1706
+ boundaryConf.fontWeight = "bold";
1707
+ boundaryConf.fontSize = boundaryConf.fontSize + 2;
1708
+ boundaryConf.fontColor = fontColor;
1709
+ _drawTextCandidateFunc(conf2)(
1710
+ boundary.label.text,
1711
+ boundaryElem,
1712
+ boundary.x,
1713
+ boundary.y + boundary.label.Y,
1714
+ boundary.width,
1715
+ boundary.height,
1716
+ { fill: "#444444" },
1717
+ boundaryConf
1718
+ );
1719
+ if (boundary.type && boundary.type.text !== "") {
1720
+ boundaryConf = conf2.boundaryFont();
1721
+ boundaryConf.fontColor = fontColor;
1722
+ _drawTextCandidateFunc(conf2)(
1723
+ boundary.type.text,
1724
+ boundaryElem,
1725
+ boundary.x,
1726
+ boundary.y + boundary.type.Y,
1727
+ boundary.width,
1728
+ boundary.height,
1729
+ { fill: "#444444" },
1730
+ boundaryConf
1731
+ );
1732
+ }
1733
+ if (boundary.descr && boundary.descr.text !== "") {
1734
+ boundaryConf = conf2.boundaryFont();
1735
+ boundaryConf.fontSize = boundaryConf.fontSize - 2;
1736
+ boundaryConf.fontColor = fontColor;
1737
+ _drawTextCandidateFunc(conf2)(
1738
+ boundary.descr.text,
1739
+ boundaryElem,
1740
+ boundary.x,
1741
+ boundary.y + boundary.descr.Y,
1742
+ boundary.width,
1743
+ boundary.height,
1744
+ { fill: "#444444" },
1745
+ boundaryConf
1746
+ );
1747
+ }
1748
+ }, "drawBoundary");
1749
+ var drawC4Shape = /* @__PURE__ */ __name(function(elem, c4Shape, conf2) {
1750
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"];
1751
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"];
1752
+ let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF";
1753
+ let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1754
+ switch (c4Shape.typeC4Shape.text) {
1755
+ case "person":
1756
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1757
+ break;
1758
+ case "external_person":
1759
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
1760
+ break;
1761
+ }
1762
+ const c4ShapeElem = elem.append("g");
1763
+ c4ShapeElem.attr("class", "person-man");
1764
+ const rect = getNoteRect();
1765
+ switch (c4Shape.typeC4Shape.text) {
1766
+ case "person":
1767
+ case "external_person":
1768
+ case "system":
1769
+ case "external_system":
1770
+ case "container":
1771
+ case "external_container":
1772
+ case "component":
1773
+ case "external_component":
1774
+ rect.x = c4Shape.x;
1775
+ rect.y = c4Shape.y;
1776
+ rect.fill = fillColor;
1777
+ rect.width = c4Shape.width;
1778
+ rect.height = c4Shape.height;
1779
+ rect.stroke = strokeColor;
1780
+ rect.rx = 2.5;
1781
+ rect.ry = 2.5;
1782
+ rect.attrs = { "stroke-width": 0.5 };
1783
+ drawRect2(c4ShapeElem, rect);
1784
+ break;
1785
+ case "system_db":
1786
+ case "external_system_db":
1787
+ case "container_db":
1788
+ case "external_container_db":
1789
+ case "component_db":
1790
+ case "external_component_db":
1791
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1792
+ "d",
1793
+ "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height)
1794
+ );
1795
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1796
+ "d",
1797
+ "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2)
1798
+ );
1799
+ break;
1800
+ case "system_queue":
1801
+ case "external_system_queue":
1802
+ case "container_queue":
1803
+ case "external_container_queue":
1804
+ case "component_queue":
1805
+ case "external_component_queue":
1806
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1807
+ "d",
1808
+ "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2)
1809
+ );
1810
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1811
+ "d",
1812
+ "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2)
1813
+ );
1814
+ break;
1815
+ }
1816
+ let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text);
1817
+ c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>");
1818
+ switch (c4Shape.typeC4Shape.text) {
1819
+ case "person":
1820
+ case "external_person":
1821
+ drawImage(
1822
+ c4ShapeElem,
1823
+ 48,
1824
+ 48,
1825
+ c4Shape.x + c4Shape.width / 2 - 24,
1826
+ c4Shape.y + c4Shape.image.Y,
1827
+ personImg
1828
+ );
1829
+ break;
1830
+ }
1831
+ let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1832
+ textFontConf.fontWeight = "bold";
1833
+ textFontConf.fontSize = textFontConf.fontSize + 2;
1834
+ textFontConf.fontColor = fontColor;
1835
+ _drawTextCandidateFunc(conf2)(
1836
+ c4Shape.label.text,
1837
+ c4ShapeElem,
1838
+ c4Shape.x,
1839
+ c4Shape.y + c4Shape.label.Y,
1840
+ c4Shape.width,
1841
+ c4Shape.height,
1842
+ { fill: fontColor },
1843
+ textFontConf
1844
+ );
1845
+ textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1846
+ textFontConf.fontColor = fontColor;
1847
+ if (c4Shape.techn && c4Shape.techn?.text !== "") {
1848
+ _drawTextCandidateFunc(conf2)(
1849
+ c4Shape.techn.text,
1850
+ c4ShapeElem,
1851
+ c4Shape.x,
1852
+ c4Shape.y + c4Shape.techn.Y,
1853
+ c4Shape.width,
1854
+ c4Shape.height,
1855
+ { fill: fontColor, "font-style": "italic" },
1856
+ textFontConf
1857
+ );
1858
+ } else if (c4Shape.type && c4Shape.type.text !== "") {
1859
+ _drawTextCandidateFunc(conf2)(
1860
+ c4Shape.type.text,
1861
+ c4ShapeElem,
1862
+ c4Shape.x,
1863
+ c4Shape.y + c4Shape.type.Y,
1864
+ c4Shape.width,
1865
+ c4Shape.height,
1866
+ { fill: fontColor, "font-style": "italic" },
1867
+ textFontConf
1868
+ );
1869
+ }
1870
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
1871
+ textFontConf = conf2.personFont();
1872
+ textFontConf.fontColor = fontColor;
1873
+ _drawTextCandidateFunc(conf2)(
1874
+ c4Shape.descr.text,
1875
+ c4ShapeElem,
1876
+ c4Shape.x,
1877
+ c4Shape.y + c4Shape.descr.Y,
1878
+ c4Shape.width,
1879
+ c4Shape.height,
1880
+ { fill: fontColor },
1881
+ textFontConf
1882
+ );
1883
+ }
1884
+ return c4Shape.height;
1885
+ }, "drawC4Shape");
1886
+ var insertDatabaseIcon = /* @__PURE__ */ __name(function(elem) {
1887
+ elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1888
+ "d",
1889
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1890
+ );
1891
+ }, "insertDatabaseIcon");
1892
+ var insertComputerIcon = /* @__PURE__ */ __name(function(elem) {
1893
+ elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1894
+ "d",
1895
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1896
+ );
1897
+ }, "insertComputerIcon");
1898
+ var insertClockIcon = /* @__PURE__ */ __name(function(elem) {
1899
+ elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1900
+ "d",
1901
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1902
+ );
1903
+ }, "insertClockIcon");
1904
+ var insertArrowHead = /* @__PURE__ */ __name(function(elem) {
1905
+ elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
1906
+ }, "insertArrowHead");
1907
+ var insertArrowEnd = /* @__PURE__ */ __name(function(elem) {
1908
+ elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
1909
+ }, "insertArrowEnd");
1910
+ var insertArrowFilledHead = /* @__PURE__ */ __name(function(elem) {
1911
+ elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1912
+ }, "insertArrowFilledHead");
1913
+ var insertDynamicNumber = /* @__PURE__ */ __name(function(elem) {
1914
+ elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1915
+ }, "insertDynamicNumber");
1916
+ var insertArrowCrossHead = /* @__PURE__ */ __name(function(elem) {
1917
+ const defs = elem.append("defs");
1918
+ const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
1919
+ marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z");
1920
+ marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
1921
+ }, "insertArrowCrossHead");
1922
+ var getC4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
1923
+ return {
1924
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
1925
+ fontSize: cnf[typeC4Shape + "FontSize"],
1926
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
1927
+ };
1928
+ }, "getC4ShapeFont");
1929
+ var _drawTextCandidateFunc = /* @__PURE__ */ (function() {
1930
+ function byText(content, g, x, y, width, height, textAttrs) {
1931
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
1932
+ _setTextAttrs(text, textAttrs);
1933
+ }
1934
+ __name(byText, "byText");
1935
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
1936
+ const { fontSize, fontFamily, fontWeight } = conf2;
1937
+ const lines = content.split(common_default.lineBreakRegex);
1938
+ for (let i = 0; i < lines.length; i++) {
1939
+ const dy = i * fontSize - fontSize * (lines.length - 1) / 2;
1940
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily);
1941
+ text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical");
1942
+ _setTextAttrs(text, textAttrs);
1943
+ }
1944
+ }
1945
+ __name(byTspan, "byTspan");
1946
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
1947
+ const s = g.append("switch");
1948
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
1949
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1950
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
1951
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
1952
+ _setTextAttrs(text, textAttrs);
1953
+ }
1954
+ __name(byFo, "byFo");
1955
+ function _setTextAttrs(toText, fromTextAttrsDict) {
1956
+ for (const key in fromTextAttrsDict) {
1957
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
1958
+ toText.attr(key, fromTextAttrsDict[key]);
1959
+ }
1960
+ }
1961
+ }
1962
+ __name(_setTextAttrs, "_setTextAttrs");
1963
+ return function(conf2) {
1964
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
1965
+ };
1966
+ })();
1967
+ var svgDraw_default = {
1968
+ drawRect: drawRect2,
1969
+ drawBoundary,
1970
+ drawC4Shape,
1971
+ drawRels,
1972
+ drawImage,
1973
+ insertArrowHead,
1974
+ insertArrowEnd,
1975
+ insertArrowFilledHead,
1976
+ insertDynamicNumber,
1977
+ insertArrowCrossHead,
1978
+ insertDatabaseIcon,
1979
+ insertComputerIcon,
1980
+ insertClockIcon
1981
+ };
1982
+ var globalBoundaryMaxX = 0;
1983
+ var globalBoundaryMaxY = 0;
1984
+ var c4ShapeInRow2 = 4;
1985
+ var c4BoundaryInRow2 = 2;
1986
+ parser.yy = c4Db_default;
1987
+ var conf = {};
1988
+ var Bounds = (_a = class {
1989
+ constructor(diagObj) {
1990
+ this.name = "";
1991
+ this.data = {};
1992
+ this.data.startx = void 0;
1993
+ this.data.stopx = void 0;
1994
+ this.data.starty = void 0;
1995
+ this.data.stopy = void 0;
1996
+ this.data.widthLimit = void 0;
1997
+ this.nextData = {};
1998
+ this.nextData.startx = void 0;
1999
+ this.nextData.stopx = void 0;
2000
+ this.nextData.starty = void 0;
2001
+ this.nextData.stopy = void 0;
2002
+ this.nextData.cnt = 0;
2003
+ setConf(diagObj.db.getConfig());
2004
+ }
2005
+ setData(startx, stopx, starty, stopy) {
2006
+ this.nextData.startx = this.data.startx = startx;
2007
+ this.nextData.stopx = this.data.stopx = stopx;
2008
+ this.nextData.starty = this.data.starty = starty;
2009
+ this.nextData.stopy = this.data.stopy = stopy;
2010
+ }
2011
+ updateVal(obj, key, val, fun) {
2012
+ if (obj[key] === void 0) {
2013
+ obj[key] = val;
2014
+ } else {
2015
+ obj[key] = fun(val, obj[key]);
2016
+ }
2017
+ }
2018
+ insert(c4Shape) {
2019
+ this.nextData.cnt = this.nextData.cnt + 1;
2020
+ let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
2021
+ let _stopx = _startx + c4Shape.width;
2022
+ let _starty = this.nextData.starty + c4Shape.margin * 2;
2023
+ let _stopy = _starty + c4Shape.height;
2024
+ if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow2) {
2025
+ _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
2026
+ _starty = this.nextData.stopy + c4Shape.margin * 2;
2027
+ this.nextData.stopx = _stopx = _startx + c4Shape.width;
2028
+ this.nextData.starty = this.nextData.stopy;
2029
+ this.nextData.stopy = _stopy = _starty + c4Shape.height;
2030
+ this.nextData.cnt = 1;
2031
+ }
2032
+ c4Shape.x = _startx;
2033
+ c4Shape.y = _starty;
2034
+ this.updateVal(this.data, "startx", _startx, Math.min);
2035
+ this.updateVal(this.data, "starty", _starty, Math.min);
2036
+ this.updateVal(this.data, "stopx", _stopx, Math.max);
2037
+ this.updateVal(this.data, "stopy", _stopy, Math.max);
2038
+ this.updateVal(this.nextData, "startx", _startx, Math.min);
2039
+ this.updateVal(this.nextData, "starty", _starty, Math.min);
2040
+ this.updateVal(this.nextData, "stopx", _stopx, Math.max);
2041
+ this.updateVal(this.nextData, "stopy", _stopy, Math.max);
2042
+ }
2043
+ init(diagObj) {
2044
+ this.name = "";
2045
+ this.data = {
2046
+ startx: void 0,
2047
+ stopx: void 0,
2048
+ starty: void 0,
2049
+ stopy: void 0,
2050
+ widthLimit: void 0
2051
+ };
2052
+ this.nextData = {
2053
+ startx: void 0,
2054
+ stopx: void 0,
2055
+ starty: void 0,
2056
+ stopy: void 0,
2057
+ cnt: 0
2058
+ };
2059
+ setConf(diagObj.db.getConfig());
2060
+ }
2061
+ bumpLastMargin(margin) {
2062
+ this.data.stopx += margin;
2063
+ this.data.stopy += margin;
2064
+ }
2065
+ }, __name(_a, "Bounds"), _a);
2066
+ var setConf = /* @__PURE__ */ __name(function(cnf) {
2067
+ assignWithDepth_default(conf, cnf);
2068
+ if (cnf.fontFamily) {
2069
+ conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
2070
+ }
2071
+ if (cnf.fontSize) {
2072
+ conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
2073
+ }
2074
+ if (cnf.fontWeight) {
2075
+ conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
2076
+ }
2077
+ }, "setConf");
2078
+ var c4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
2079
+ return {
2080
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
2081
+ fontSize: cnf[typeC4Shape + "FontSize"],
2082
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
2083
+ };
2084
+ }, "c4ShapeFont");
2085
+ var boundaryFont = /* @__PURE__ */ __name((cnf) => {
2086
+ return {
2087
+ fontFamily: cnf.boundaryFontFamily,
2088
+ fontSize: cnf.boundaryFontSize,
2089
+ fontWeight: cnf.boundaryFontWeight
2090
+ };
2091
+ }, "boundaryFont");
2092
+ var messageFont = /* @__PURE__ */ __name((cnf) => {
2093
+ return {
2094
+ fontFamily: cnf.messageFontFamily,
2095
+ fontSize: cnf.messageFontSize,
2096
+ fontWeight: cnf.messageFontWeight
2097
+ };
2098
+ }, "messageFont");
2099
+ function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
2100
+ if (!c4Shape[textType].width) {
2101
+ if (c4ShapeTextWrap) {
2102
+ c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
2103
+ c4Shape[textType].textLines = c4Shape[textType].text.split(common_default.lineBreakRegex).length;
2104
+ c4Shape[textType].width = textLimitWidth;
2105
+ c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
2106
+ } else {
2107
+ let lines = c4Shape[textType].text.split(common_default.lineBreakRegex);
2108
+ c4Shape[textType].textLines = lines.length;
2109
+ let lineHeight = 0;
2110
+ c4Shape[textType].height = 0;
2111
+ c4Shape[textType].width = 0;
2112
+ for (const line of lines) {
2113
+ c4Shape[textType].width = Math.max(
2114
+ calculateTextWidth(line, textConf),
2115
+ c4Shape[textType].width
2116
+ );
2117
+ lineHeight = calculateTextHeight(line, textConf);
2118
+ c4Shape[textType].height = c4Shape[textType].height + lineHeight;
2119
+ }
2120
+ }
2121
+ }
2122
+ }
2123
+ __name(calcC4ShapeTextWH, "calcC4ShapeTextWH");
2124
+ var drawBoundary2 = /* @__PURE__ */ __name(function(diagram2, boundary, bounds) {
2125
+ boundary.x = bounds.data.startx;
2126
+ boundary.y = bounds.data.starty;
2127
+ boundary.width = bounds.data.stopx - bounds.data.startx;
2128
+ boundary.height = bounds.data.stopy - bounds.data.starty;
2129
+ boundary.label.y = conf.c4ShapeMargin - 35;
2130
+ let boundaryTextWrap = boundary.wrap && conf.wrap;
2131
+ let boundaryLabelConf = boundaryFont(conf);
2132
+ boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
2133
+ boundaryLabelConf.fontWeight = "bold";
2134
+ let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
2135
+ calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
2136
+ svgDraw_default.drawBoundary(diagram2, boundary, conf);
2137
+ }, "drawBoundary");
2138
+ var drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) {
2139
+ let Y = 0;
2140
+ for (const c4ShapeKey of c4ShapeKeys) {
2141
+ Y = 0;
2142
+ const c4Shape = c4ShapeArray2[c4ShapeKey];
2143
+ let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2144
+ c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
2145
+ c4Shape.typeC4Shape.width = calculateTextWidth(
2146
+ "«" + c4Shape.typeC4Shape.text + "»",
2147
+ c4ShapeTypeConf
2148
+ );
2149
+ c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
2150
+ c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
2151
+ Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
2152
+ c4Shape.image = { width: 0, height: 0, Y: 0 };
2153
+ switch (c4Shape.typeC4Shape.text) {
2154
+ case "person":
2155
+ case "external_person":
2156
+ c4Shape.image.width = 48;
2157
+ c4Shape.image.height = 48;
2158
+ c4Shape.image.Y = Y;
2159
+ Y = c4Shape.image.Y + c4Shape.image.height;
2160
+ break;
2161
+ }
2162
+ if (c4Shape.sprite) {
2163
+ c4Shape.image.width = 48;
2164
+ c4Shape.image.height = 48;
2165
+ c4Shape.image.Y = Y;
2166
+ Y = c4Shape.image.Y + c4Shape.image.height;
2167
+ }
2168
+ let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
2169
+ let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
2170
+ let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2171
+ c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
2172
+ c4ShapeLabelConf.fontWeight = "bold";
2173
+ calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
2174
+ c4Shape.label.Y = Y + 8;
2175
+ Y = c4Shape.label.Y + c4Shape.label.height;
2176
+ if (c4Shape.type && c4Shape.type.text !== "") {
2177
+ c4Shape.type.text = "[" + c4Shape.type.text + "]";
2178
+ let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2179
+ calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
2180
+ c4Shape.type.Y = Y + 5;
2181
+ Y = c4Shape.type.Y + c4Shape.type.height;
2182
+ } else if (c4Shape.techn && c4Shape.techn.text !== "") {
2183
+ c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
2184
+ let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
2185
+ calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
2186
+ c4Shape.techn.Y = Y + 5;
2187
+ Y = c4Shape.techn.Y + c4Shape.techn.height;
2188
+ }
2189
+ let rectHeight = Y;
2190
+ let rectWidth = c4Shape.label.width;
2191
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
2192
+ let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2193
+ calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
2194
+ c4Shape.descr.Y = Y + 20;
2195
+ Y = c4Shape.descr.Y + c4Shape.descr.height;
2196
+ rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
2197
+ rectHeight = Y - c4Shape.descr.textLines * 5;
2198
+ }
2199
+ rectWidth = rectWidth + conf.c4ShapePadding;
2200
+ c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
2201
+ c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
2202
+ c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
2203
+ currentBounds.insert(c4Shape);
2204
+ svgDraw_default.drawC4Shape(diagram2, c4Shape, conf);
2205
+ }
2206
+ currentBounds.bumpLastMargin(conf.c4ShapeMargin);
2207
+ }, "drawC4ShapeArray");
2208
+ var Point = (_b = class {
2209
+ constructor(x, y) {
2210
+ this.x = x;
2211
+ this.y = y;
2212
+ }
2213
+ }, __name(_b, "Point"), _b);
2214
+ var getIntersectPoint = /* @__PURE__ */ __name(function(fromNode, endPoint) {
2215
+ let x1 = fromNode.x;
2216
+ let y1 = fromNode.y;
2217
+ let x2 = endPoint.x;
2218
+ let y2 = endPoint.y;
2219
+ let fromCenterX = x1 + fromNode.width / 2;
2220
+ let fromCenterY = y1 + fromNode.height / 2;
2221
+ let dx = Math.abs(x1 - x2);
2222
+ let dy = Math.abs(y1 - y2);
2223
+ let tanDYX = dy / dx;
2224
+ let fromDYX = fromNode.height / fromNode.width;
2225
+ let returnPoint = null;
2226
+ if (y1 == y2 && x1 < x2) {
2227
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY);
2228
+ } else if (y1 == y2 && x1 > x2) {
2229
+ returnPoint = new Point(x1, fromCenterY);
2230
+ } else if (x1 == x2 && y1 < y2) {
2231
+ returnPoint = new Point(fromCenterX, y1 + fromNode.height);
2232
+ } else if (x1 == x2 && y1 > y2) {
2233
+ returnPoint = new Point(fromCenterX, y1);
2234
+ }
2235
+ if (x1 > x2 && y1 < y2) {
2236
+ if (fromDYX >= tanDYX) {
2237
+ returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2);
2238
+ } else {
2239
+ returnPoint = new Point(
2240
+ fromCenterX - dx / dy * fromNode.height / 2,
2241
+ y1 + fromNode.height
2242
+ );
2243
+ }
2244
+ } else if (x1 < x2 && y1 < y2) {
2245
+ if (fromDYX >= tanDYX) {
2246
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
2247
+ } else {
2248
+ returnPoint = new Point(
2249
+ fromCenterX + dx / dy * fromNode.height / 2,
2250
+ y1 + fromNode.height
2251
+ );
2252
+ }
2253
+ } else if (x1 < x2 && y1 > y2) {
2254
+ if (fromDYX >= tanDYX) {
2255
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
2256
+ } else {
2257
+ returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1);
2258
+ }
2259
+ } else if (x1 > x2 && y1 > y2) {
2260
+ if (fromDYX >= tanDYX) {
2261
+ returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX);
2262
+ } else {
2263
+ returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1);
2264
+ }
2265
+ }
2266
+ return returnPoint;
2267
+ }, "getIntersectPoint");
2268
+ var getIntersectPoints = /* @__PURE__ */ __name(function(fromNode, endNode) {
2269
+ let endIntersectPoint = { x: 0, y: 0 };
2270
+ endIntersectPoint.x = endNode.x + endNode.width / 2;
2271
+ endIntersectPoint.y = endNode.y + endNode.height / 2;
2272
+ let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
2273
+ endIntersectPoint.x = fromNode.x + fromNode.width / 2;
2274
+ endIntersectPoint.y = fromNode.y + fromNode.height / 2;
2275
+ let endPoint = getIntersectPoint(endNode, endIntersectPoint);
2276
+ return { startPoint, endPoint };
2277
+ }, "getIntersectPoints");
2278
+ var drawRels2 = /* @__PURE__ */ __name(function(diagram2, rels2, getC4ShapeObj, diagObj) {
2279
+ let i = 0;
2280
+ for (let rel of rels2) {
2281
+ i = i + 1;
2282
+ let relTextWrap = rel.wrap && conf.wrap;
2283
+ let relConf = messageFont(conf);
2284
+ let diagramType = diagObj.db.getC4Type();
2285
+ if (diagramType === "C4Dynamic") {
2286
+ rel.label.text = i + ": " + rel.label.text;
2287
+ }
2288
+ let textLimitWidth = calculateTextWidth(rel.label.text, relConf);
2289
+ calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth);
2290
+ if (rel.techn && rel.techn.text !== "") {
2291
+ textLimitWidth = calculateTextWidth(rel.techn.text, relConf);
2292
+ calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth);
2293
+ }
2294
+ if (rel.descr && rel.descr.text !== "") {
2295
+ textLimitWidth = calculateTextWidth(rel.descr.text, relConf);
2296
+ calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth);
2297
+ }
2298
+ let fromNode = getC4ShapeObj(rel.from);
2299
+ let endNode = getC4ShapeObj(rel.to);
2300
+ let points = getIntersectPoints(fromNode, endNode);
2301
+ rel.startPoint = points.startPoint;
2302
+ rel.endPoint = points.endPoint;
2303
+ }
2304
+ svgDraw_default.drawRels(diagram2, rels2, conf);
2305
+ }, "drawRels");
2306
+ function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
2307
+ let currentBounds = new Bounds(diagObj);
2308
+ currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow2, currentBoundaries.length);
2309
+ for (let [i, currentBoundary] of currentBoundaries.entries()) {
2310
+ let Y = 0;
2311
+ currentBoundary.image = { width: 0, height: 0, Y: 0 };
2312
+ if (currentBoundary.sprite) {
2313
+ currentBoundary.image.width = 48;
2314
+ currentBoundary.image.height = 48;
2315
+ currentBoundary.image.Y = Y;
2316
+ Y = currentBoundary.image.Y + currentBoundary.image.height;
2317
+ }
2318
+ let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
2319
+ let currentBoundaryLabelConf = boundaryFont(conf);
2320
+ currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
2321
+ currentBoundaryLabelConf.fontWeight = "bold";
2322
+ calcC4ShapeTextWH(
2323
+ "label",
2324
+ currentBoundary,
2325
+ currentBoundaryTextWrap,
2326
+ currentBoundaryLabelConf,
2327
+ currentBounds.data.widthLimit
2328
+ );
2329
+ currentBoundary.label.Y = Y + 8;
2330
+ Y = currentBoundary.label.Y + currentBoundary.label.height;
2331
+ if (currentBoundary.type && currentBoundary.type.text !== "") {
2332
+ currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
2333
+ let currentBoundaryTypeConf = boundaryFont(conf);
2334
+ calcC4ShapeTextWH(
2335
+ "type",
2336
+ currentBoundary,
2337
+ currentBoundaryTextWrap,
2338
+ currentBoundaryTypeConf,
2339
+ currentBounds.data.widthLimit
2340
+ );
2341
+ currentBoundary.type.Y = Y + 5;
2342
+ Y = currentBoundary.type.Y + currentBoundary.type.height;
2343
+ }
2344
+ if (currentBoundary.descr && currentBoundary.descr.text !== "") {
2345
+ let currentBoundaryDescrConf = boundaryFont(conf);
2346
+ currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
2347
+ calcC4ShapeTextWH(
2348
+ "descr",
2349
+ currentBoundary,
2350
+ currentBoundaryTextWrap,
2351
+ currentBoundaryDescrConf,
2352
+ currentBounds.data.widthLimit
2353
+ );
2354
+ currentBoundary.descr.Y = Y + 20;
2355
+ Y = currentBoundary.descr.Y + currentBoundary.descr.height;
2356
+ }
2357
+ if (i == 0 || i % c4BoundaryInRow2 === 0) {
2358
+ let _x = parentBounds.data.startx + conf.diagramMarginX;
2359
+ let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;
2360
+ currentBounds.setData(_x, _x, _y, _y);
2361
+ } else {
2362
+ let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
2363
+ let _y = currentBounds.data.starty;
2364
+ currentBounds.setData(_x, _x, _y, _y);
2365
+ }
2366
+ currentBounds.name = currentBoundary.alias;
2367
+ let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
2368
+ let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
2369
+ if (currentPersonOrSystemKeys.length > 0) {
2370
+ drawC4ShapeArray(
2371
+ currentBounds,
2372
+ diagram2,
2373
+ currentPersonOrSystemArray,
2374
+ currentPersonOrSystemKeys
2375
+ );
2376
+ }
2377
+ parentBoundaryAlias = currentBoundary.alias;
2378
+ let nextCurrentBoundaries = diagObj.db.getBoundaries(parentBoundaryAlias);
2379
+ if (nextCurrentBoundaries.length > 0) {
2380
+ drawInsideBoundary(
2381
+ diagram2,
2382
+ parentBoundaryAlias,
2383
+ currentBounds,
2384
+ nextCurrentBoundaries,
2385
+ diagObj
2386
+ );
2387
+ }
2388
+ if (currentBoundary.alias !== "global") {
2389
+ drawBoundary2(diagram2, currentBoundary, currentBounds);
2390
+ }
2391
+ parentBounds.data.stopy = Math.max(
2392
+ currentBounds.data.stopy + conf.c4ShapeMargin,
2393
+ parentBounds.data.stopy
2394
+ );
2395
+ parentBounds.data.stopx = Math.max(
2396
+ currentBounds.data.stopx + conf.c4ShapeMargin,
2397
+ parentBounds.data.stopx
2398
+ );
2399
+ globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
2400
+ globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
2401
+ }
2402
+ }
2403
+ __name(drawInsideBoundary, "drawInsideBoundary");
2404
+ var draw = /* @__PURE__ */ __name(function(_text, id, _version, diagObj) {
2405
+ conf = getConfig2().c4;
2406
+ const securityLevel = getConfig2().securityLevel;
2407
+ let sandboxElement;
2408
+ if (securityLevel === "sandbox") {
2409
+ sandboxElement = select("#i" + id);
2410
+ }
2411
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
2412
+ let db = diagObj.db;
2413
+ diagObj.db.setWrap(conf.wrap);
2414
+ c4ShapeInRow2 = db.getC4ShapeInRow();
2415
+ c4BoundaryInRow2 = db.getC4BoundaryInRow();
2416
+ log.debug(`C:${JSON.stringify(conf, null, 2)}`);
2417
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
2418
+ svgDraw_default.insertComputerIcon(diagram2);
2419
+ svgDraw_default.insertDatabaseIcon(diagram2);
2420
+ svgDraw_default.insertClockIcon(diagram2);
2421
+ let screenBounds = new Bounds(diagObj);
2422
+ screenBounds.setData(
2423
+ conf.diagramMarginX,
2424
+ conf.diagramMarginX,
2425
+ conf.diagramMarginY,
2426
+ conf.diagramMarginY
2427
+ );
2428
+ screenBounds.data.widthLimit = screen.availWidth;
2429
+ globalBoundaryMaxX = conf.diagramMarginX;
2430
+ globalBoundaryMaxY = conf.diagramMarginY;
2431
+ const title2 = diagObj.db.getTitle();
2432
+ let currentBoundaries = diagObj.db.getBoundaries("");
2433
+ drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj);
2434
+ svgDraw_default.insertArrowHead(diagram2);
2435
+ svgDraw_default.insertArrowEnd(diagram2);
2436
+ svgDraw_default.insertArrowCrossHead(diagram2);
2437
+ svgDraw_default.insertArrowFilledHead(diagram2);
2438
+ drawRels2(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
2439
+ screenBounds.data.stopx = globalBoundaryMaxX;
2440
+ screenBounds.data.stopy = globalBoundaryMaxY;
2441
+ const box = screenBounds.data;
2442
+ let boxHeight = box.stopy - box.starty;
2443
+ let height = boxHeight + 2 * conf.diagramMarginY;
2444
+ let boxWidth = box.stopx - box.startx;
2445
+ const width = boxWidth + 2 * conf.diagramMarginX;
2446
+ if (title2) {
2447
+ diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
2448
+ }
2449
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
2450
+ const extraVertForTitle = title2 ? 60 : 0;
2451
+ diagram2.attr(
2452
+ "viewBox",
2453
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
2454
+ );
2455
+ log.debug(`models:`, box);
2456
+ }, "draw");
2457
+ var c4Renderer_default = {
2458
+ drawPersonOrSystemArray: drawC4ShapeArray,
2459
+ drawBoundary: drawBoundary2,
2460
+ setConf,
2461
+ draw
2462
+ };
2463
+ var getStyles = /* @__PURE__ */ __name((options) => `.person {
2464
+ stroke: ${options.personBorder};
2465
+ fill: ${options.personBkg};
2466
+ }
2467
+ `, "getStyles");
2468
+ var styles_default = getStyles;
2469
+ var diagram = {
2470
+ parser: c4Diagram_default,
2471
+ db: c4Db_default,
2472
+ renderer: c4Renderer_default,
2473
+ styles: styles_default,
2474
+ init: /* @__PURE__ */ __name(({ c4, wrap }) => {
2475
+ c4Renderer_default.setConf(c4);
2476
+ c4Db_default.setWrap(wrap);
2477
+ }, "init")
2478
+ };
2479
+ export {
2480
+ diagram
2481
+ };