@zettelgeist/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +64 -0
  3. package/dist/bin.js +2211 -0
  4. package/dist/bin.js.map +7 -0
  5. package/dist/templates/export.html +27 -0
  6. package/dist/templates/skill/SKILL.md +220 -0
  7. package/dist/viewer-bundle/architecture-YZFGNWBL-W2K3EQOM.js +14 -0
  8. package/dist/viewer-bundle/architecture-YZFGNWBL-W2K3EQOM.js.map +7 -0
  9. package/dist/viewer-bundle/architectureDiagram-Q4EWVU46-LCGRUEWT.js +8884 -0
  10. package/dist/viewer-bundle/architectureDiagram-Q4EWVU46-LCGRUEWT.js.map +7 -0
  11. package/dist/viewer-bundle/base.css +248 -0
  12. package/dist/viewer-bundle/blockDiagram-DXYQGD6D-KAM7BOAP.js +3777 -0
  13. package/dist/viewer-bundle/blockDiagram-DXYQGD6D-KAM7BOAP.js.map +7 -0
  14. package/dist/viewer-bundle/board.css +370 -0
  15. package/dist/viewer-bundle/c4Diagram-AHTNJAMY-C3FIQYXA.js +2596 -0
  16. package/dist/viewer-bundle/c4Diagram-AHTNJAMY-C3FIQYXA.js.map +7 -0
  17. package/dist/viewer-bundle/chunk-2QXGXAO5.js +68 -0
  18. package/dist/viewer-bundle/chunk-2QXGXAO5.js.map +7 -0
  19. package/dist/viewer-bundle/chunk-5PZT7VUU.js +67 -0
  20. package/dist/viewer-bundle/chunk-5PZT7VUU.js.map +7 -0
  21. package/dist/viewer-bundle/chunk-5YJCJF2C.js +112 -0
  22. package/dist/viewer-bundle/chunk-5YJCJF2C.js.map +7 -0
  23. package/dist/viewer-bundle/chunk-6LYV7PBV.js +1011 -0
  24. package/dist/viewer-bundle/chunk-6LYV7PBV.js.map +7 -0
  25. package/dist/viewer-bundle/chunk-6VW7D5WX.js +48 -0
  26. package/dist/viewer-bundle/chunk-6VW7D5WX.js.map +7 -0
  27. package/dist/viewer-bundle/chunk-76C5OSD4.js +2048 -0
  28. package/dist/viewer-bundle/chunk-76C5OSD4.js.map +7 -0
  29. package/dist/viewer-bundle/chunk-7NZMPQDX.js +6957 -0
  30. package/dist/viewer-bundle/chunk-7NZMPQDX.js.map +7 -0
  31. package/dist/viewer-bundle/chunk-A634GTZN.js +122 -0
  32. package/dist/viewer-bundle/chunk-A634GTZN.js.map +7 -0
  33. package/dist/viewer-bundle/chunk-AJQJUKMU.js +133 -0
  34. package/dist/viewer-bundle/chunk-AJQJUKMU.js.map +7 -0
  35. package/dist/viewer-bundle/chunk-BM2KPNFW.js +5556 -0
  36. package/dist/viewer-bundle/chunk-BM2KPNFW.js.map +7 -0
  37. package/dist/viewer-bundle/chunk-CIDUOCCG.js +25 -0
  38. package/dist/viewer-bundle/chunk-CIDUOCCG.js.map +7 -0
  39. package/dist/viewer-bundle/chunk-CZHJHAOR.js +6397 -0
  40. package/dist/viewer-bundle/chunk-CZHJHAOR.js.map +7 -0
  41. package/dist/viewer-bundle/chunk-D5RLIWY4.js +125 -0
  42. package/dist/viewer-bundle/chunk-D5RLIWY4.js.map +7 -0
  43. package/dist/viewer-bundle/chunk-DI52DQAC.js +44 -0
  44. package/dist/viewer-bundle/chunk-DI52DQAC.js.map +7 -0
  45. package/dist/viewer-bundle/chunk-EXJQLTIV.js +51 -0
  46. package/dist/viewer-bundle/chunk-EXJQLTIV.js.map +7 -0
  47. package/dist/viewer-bundle/chunk-G3PPZWPW.js +96 -0
  48. package/dist/viewer-bundle/chunk-G3PPZWPW.js.map +7 -0
  49. package/dist/viewer-bundle/chunk-GTW4IDD4.js +30297 -0
  50. package/dist/viewer-bundle/chunk-GTW4IDD4.js.map +7 -0
  51. package/dist/viewer-bundle/chunk-GVE7OA3Z.js +59 -0
  52. package/dist/viewer-bundle/chunk-GVE7OA3Z.js.map +7 -0
  53. package/dist/viewer-bundle/chunk-JBUVKVPY.js +2042 -0
  54. package/dist/viewer-bundle/chunk-JBUVKVPY.js.map +7 -0
  55. package/dist/viewer-bundle/chunk-JQLVOAQB.js +20 -0
  56. package/dist/viewer-bundle/chunk-JQLVOAQB.js.map +7 -0
  57. package/dist/viewer-bundle/chunk-LQMQSYLO.js +101 -0
  58. package/dist/viewer-bundle/chunk-LQMQSYLO.js.map +7 -0
  59. package/dist/viewer-bundle/chunk-MBFAQ3IK.js +34 -0
  60. package/dist/viewer-bundle/chunk-MBFAQ3IK.js.map +7 -0
  61. package/dist/viewer-bundle/chunk-N7G7IIKG.js +25 -0
  62. package/dist/viewer-bundle/chunk-N7G7IIKG.js.map +7 -0
  63. package/dist/viewer-bundle/chunk-NW4YG3NS.js +171 -0
  64. package/dist/viewer-bundle/chunk-NW4YG3NS.js.map +7 -0
  65. package/dist/viewer-bundle/chunk-ODEP5TKB.js +61 -0
  66. package/dist/viewer-bundle/chunk-ODEP5TKB.js.map +7 -0
  67. package/dist/viewer-bundle/chunk-OGKINV23.js +1050 -0
  68. package/dist/viewer-bundle/chunk-OGKINV23.js.map +7 -0
  69. package/dist/viewer-bundle/chunk-OGMSNDVH.js +1994 -0
  70. package/dist/viewer-bundle/chunk-OGMSNDVH.js.map +7 -0
  71. package/dist/viewer-bundle/chunk-QJVSDNAW.js +25 -0
  72. package/dist/viewer-bundle/chunk-QJVSDNAW.js.map +7 -0
  73. package/dist/viewer-bundle/chunk-RBTT26R4.js +2721 -0
  74. package/dist/viewer-bundle/chunk-RBTT26R4.js.map +7 -0
  75. package/dist/viewer-bundle/chunk-RQIPIIE2.js +48 -0
  76. package/dist/viewer-bundle/chunk-RQIPIIE2.js.map +7 -0
  77. package/dist/viewer-bundle/chunk-SRTYTXTX.js +22 -0
  78. package/dist/viewer-bundle/chunk-SRTYTXTX.js.map +7 -0
  79. package/dist/viewer-bundle/chunk-TRL7YIZG.js +1663 -0
  80. package/dist/viewer-bundle/chunk-TRL7YIZG.js.map +7 -0
  81. package/dist/viewer-bundle/chunk-U5T7X4BV.js +172 -0
  82. package/dist/viewer-bundle/chunk-U5T7X4BV.js.map +7 -0
  83. package/dist/viewer-bundle/chunk-UCAW6C6C.js +48 -0
  84. package/dist/viewer-bundle/chunk-UCAW6C6C.js.map +7 -0
  85. package/dist/viewer-bundle/chunk-UEAG4BJQ.js +93 -0
  86. package/dist/viewer-bundle/chunk-UEAG4BJQ.js.map +7 -0
  87. package/dist/viewer-bundle/chunk-UVRE3R6A.js +1039 -0
  88. package/dist/viewer-bundle/chunk-UVRE3R6A.js.map +7 -0
  89. package/dist/viewer-bundle/chunk-VODO7SV4.js +25029 -0
  90. package/dist/viewer-bundle/chunk-VODO7SV4.js.map +7 -0
  91. package/dist/viewer-bundle/chunk-YEU62MVS.js +682 -0
  92. package/dist/viewer-bundle/chunk-YEU62MVS.js.map +7 -0
  93. package/dist/viewer-bundle/chunk-YFQT7PPW.js +987 -0
  94. package/dist/viewer-bundle/chunk-YFQT7PPW.js.map +7 -0
  95. package/dist/viewer-bundle/chunk-Z4G7FG27.js +48 -0
  96. package/dist/viewer-bundle/chunk-Z4G7FG27.js.map +7 -0
  97. package/dist/viewer-bundle/chunk-ZW4Y7DIF.js +2044 -0
  98. package/dist/viewer-bundle/chunk-ZW4Y7DIF.js.map +7 -0
  99. package/dist/viewer-bundle/classDiagram-6PBFFD2Q-7VKYXLUX.js +46 -0
  100. package/dist/viewer-bundle/classDiagram-6PBFFD2Q-7VKYXLUX.js.map +7 -0
  101. package/dist/viewer-bundle/classDiagram-v2-HSJHXN6E-ACCNN7EN.js +46 -0
  102. package/dist/viewer-bundle/classDiagram-v2-HSJHXN6E-ACCNN7EN.js.map +7 -0
  103. package/dist/viewer-bundle/cose-bilkent-S5V4N54A-MUJHAA34.js +5009 -0
  104. package/dist/viewer-bundle/cose-bilkent-S5V4N54A-MUJHAA34.js.map +7 -0
  105. package/dist/viewer-bundle/dagre-KV5264BT-YC5VV3WF.js +739 -0
  106. package/dist/viewer-bundle/dagre-KV5264BT-YC5VV3WF.js.map +7 -0
  107. package/dist/viewer-bundle/dark.css +13 -0
  108. package/dist/viewer-bundle/detail.css +539 -0
  109. package/dist/viewer-bundle/diagram-5BDNPKRD-RXFPVFYK.js +214 -0
  110. package/dist/viewer-bundle/diagram-5BDNPKRD-RXFPVFYK.js.map +7 -0
  111. package/dist/viewer-bundle/diagram-G4DWMVQ6-KN7CBNBQ.js +578 -0
  112. package/dist/viewer-bundle/diagram-G4DWMVQ6-KN7CBNBQ.js.map +7 -0
  113. package/dist/viewer-bundle/diagram-MMDJMWI5-ZN6TQ7ZC.js +345 -0
  114. package/dist/viewer-bundle/diagram-MMDJMWI5-ZN6TQ7ZC.js.map +7 -0
  115. package/dist/viewer-bundle/diagram-TYMM5635-MMTUJ4KA.js +255 -0
  116. package/dist/viewer-bundle/diagram-TYMM5635-MMTUJ4KA.js.map +7 -0
  117. package/dist/viewer-bundle/docs.css +88 -0
  118. package/dist/viewer-bundle/edit-modal-BEGC2AO6.js +176 -0
  119. package/dist/viewer-bundle/edit-modal-BEGC2AO6.js.map +7 -0
  120. package/dist/viewer-bundle/erDiagram-SMLLAGMA-TBHMLD2E.js +1349 -0
  121. package/dist/viewer-bundle/erDiagram-SMLLAGMA-TBHMLD2E.js.map +7 -0
  122. package/dist/viewer-bundle/flowDiagram-DWJPFMVM-BZHLK6QB.js +2501 -0
  123. package/dist/viewer-bundle/flowDiagram-DWJPFMVM-BZHLK6QB.js.map +7 -0
  124. package/dist/viewer-bundle/ganttDiagram-T4ZO3ILL-YBARPTQR.js +2654 -0
  125. package/dist/viewer-bundle/ganttDiagram-T4ZO3ILL-YBARPTQR.js.map +7 -0
  126. package/dist/viewer-bundle/gitGraph-7Q5UKJZL-HENKIQDX.js +14 -0
  127. package/dist/viewer-bundle/gitGraph-7Q5UKJZL-HENKIQDX.js.map +7 -0
  128. package/dist/viewer-bundle/gitGraphDiagram-UUTBAWPF-M4VV3YVA.js +1946 -0
  129. package/dist/viewer-bundle/gitGraphDiagram-UUTBAWPF-M4VV3YVA.js.map +7 -0
  130. package/dist/viewer-bundle/index.html +28 -0
  131. package/dist/viewer-bundle/info-OMHHGYJF-E773USRS.js +14 -0
  132. package/dist/viewer-bundle/info-OMHHGYJF-E773USRS.js.map +7 -0
  133. package/dist/viewer-bundle/infoDiagram-42DDH7IO-C7JGUXKK.js +59 -0
  134. package/dist/viewer-bundle/infoDiagram-42DDH7IO-C7JGUXKK.js.map +7 -0
  135. package/dist/viewer-bundle/ishikawaDiagram-UXIWVN3A-YBC4X4VB.js +1012 -0
  136. package/dist/viewer-bundle/ishikawaDiagram-UXIWVN3A-YBC4X4VB.js.map +7 -0
  137. package/dist/viewer-bundle/journeyDiagram-VCZTEJTY-6WKVEOOO.js +1303 -0
  138. package/dist/viewer-bundle/journeyDiagram-VCZTEJTY-6WKVEOOO.js.map +7 -0
  139. package/dist/viewer-bundle/kanban-definition-6JOO6SKY-URTTHHO4.js +1131 -0
  140. package/dist/viewer-bundle/kanban-definition-6JOO6SKY-URTTHHO4.js.map +7 -0
  141. package/dist/viewer-bundle/katex-QN5266ZE.js +14318 -0
  142. package/dist/viewer-bundle/katex-QN5266ZE.js.map +7 -0
  143. package/dist/viewer-bundle/light.css +15 -0
  144. package/dist/viewer-bundle/main.js +4816 -0
  145. package/dist/viewer-bundle/main.js.map +7 -0
  146. package/dist/viewer-bundle/mermaid.core-AEBXU2JK.js +1708 -0
  147. package/dist/viewer-bundle/mermaid.core-AEBXU2JK.js.map +7 -0
  148. package/dist/viewer-bundle/mindmap-definition-QFDTVHPH-KUMAMRSF.js +1277 -0
  149. package/dist/viewer-bundle/mindmap-definition-QFDTVHPH-KUMAMRSF.js.map +7 -0
  150. package/dist/viewer-bundle/packet-4T2RLAQJ-IRYWWA66.js +14 -0
  151. package/dist/viewer-bundle/packet-4T2RLAQJ-IRYWWA66.js.map +7 -0
  152. package/dist/viewer-bundle/pico.classless.min.css +4 -0
  153. package/dist/viewer-bundle/pie-ZZUOXDRM-JYO4VL5N.js +14 -0
  154. package/dist/viewer-bundle/pie-ZZUOXDRM-JYO4VL5N.js.map +7 -0
  155. package/dist/viewer-bundle/pieDiagram-DEJITSTG-QOEHQN3N.js +238 -0
  156. package/dist/viewer-bundle/pieDiagram-DEJITSTG-QOEHQN3N.js.map +7 -0
  157. package/dist/viewer-bundle/prompt-modal-C4LHI7BS.js +12 -0
  158. package/dist/viewer-bundle/prompt-modal-C4LHI7BS.js.map +7 -0
  159. package/dist/viewer-bundle/quadrantDiagram-34T5L4WZ-SJNPUU5N.js +1409 -0
  160. package/dist/viewer-bundle/quadrantDiagram-34T5L4WZ-SJNPUU5N.js.map +7 -0
  161. package/dist/viewer-bundle/radar-PYXPWWZC-45BRYQSB.js +14 -0
  162. package/dist/viewer-bundle/radar-PYXPWWZC-45BRYQSB.js.map +7 -0
  163. package/dist/viewer-bundle/reason-modal-MK34MQ73.js +68 -0
  164. package/dist/viewer-bundle/reason-modal-MK34MQ73.js.map +7 -0
  165. package/dist/viewer-bundle/requirementDiagram-MS252O5E-UOMT3FCC.js +1311 -0
  166. package/dist/viewer-bundle/requirementDiagram-MS252O5E-UOMT3FCC.js.map +7 -0
  167. package/dist/viewer-bundle/sankeyDiagram-XADWPNL6-LAVJ5C6A.js +1263 -0
  168. package/dist/viewer-bundle/sankeyDiagram-XADWPNL6-LAVJ5C6A.js.map +7 -0
  169. package/dist/viewer-bundle/sequenceDiagram-FGHM5R23-3IWTOUNQ.js +4655 -0
  170. package/dist/viewer-bundle/sequenceDiagram-FGHM5R23-3IWTOUNQ.js.map +7 -0
  171. package/dist/viewer-bundle/stateDiagram-FHFEXIEX-S2OVQQON.js +495 -0
  172. package/dist/viewer-bundle/stateDiagram-FHFEXIEX-S2OVQQON.js.map +7 -0
  173. package/dist/viewer-bundle/stateDiagram-v2-QKLJ7IA2-XNZ3XXSV.js +44 -0
  174. package/dist/viewer-bundle/stateDiagram-v2-QKLJ7IA2-XNZ3XXSV.js.map +7 -0
  175. package/dist/viewer-bundle/timeline-definition-GMOUNBTQ-FHVZ7MHE.js +1646 -0
  176. package/dist/viewer-bundle/timeline-definition-GMOUNBTQ-FHVZ7MHE.js.map +7 -0
  177. package/dist/viewer-bundle/treeView-SZITEDCU-RXZXNYAM.js +14 -0
  178. package/dist/viewer-bundle/treeView-SZITEDCU-RXZXNYAM.js.map +7 -0
  179. package/dist/viewer-bundle/treemap-W4RFUUIX-2IGOFSJM.js +14 -0
  180. package/dist/viewer-bundle/treemap-W4RFUUIX-2IGOFSJM.js.map +7 -0
  181. package/dist/viewer-bundle/vennDiagram-DHZGUBPP-HEAOEXEZ.js +2544 -0
  182. package/dist/viewer-bundle/vennDiagram-DHZGUBPP-HEAOEXEZ.js.map +7 -0
  183. package/dist/viewer-bundle/wardley-RL74JXVD-VSPCLOX2.js +14 -0
  184. package/dist/viewer-bundle/wardley-RL74JXVD-VSPCLOX2.js.map +7 -0
  185. package/dist/viewer-bundle/wardleyDiagram-NUSXRM2D-EBY4FG3X.js +938 -0
  186. package/dist/viewer-bundle/wardleyDiagram-NUSXRM2D-EBY4FG3X.js.map +7 -0
  187. package/dist/viewer-bundle/xychartDiagram-5P7HB3ND-SSMUQEXK.js +1952 -0
  188. package/dist/viewer-bundle/xychartDiagram-5P7HB3ND-SSMUQEXK.js.map +7 -0
  189. package/package.json +51 -0
@@ -0,0 +1,2596 @@
1
+ import {
2
+ drawRect,
3
+ getNoteRect
4
+ } from "./chunk-AJQJUKMU.js";
5
+ import {
6
+ calculateTextHeight,
7
+ calculateTextWidth,
8
+ wrapLabel
9
+ } from "./chunk-UVRE3R6A.js";
10
+ import {
11
+ require_dist
12
+ } from "./chunk-G3PPZWPW.js";
13
+ import {
14
+ assignWithDepth_default,
15
+ common_default,
16
+ configureSvgSize,
17
+ getAccDescription,
18
+ getAccTitle,
19
+ getConfig2,
20
+ sanitizeText,
21
+ setAccDescription,
22
+ setAccTitle
23
+ } from "./chunk-7NZMPQDX.js";
24
+ import "./chunk-YEU62MVS.js";
25
+ import {
26
+ __name,
27
+ log,
28
+ select_default
29
+ } from "./chunk-CZHJHAOR.js";
30
+ import {
31
+ __toESM
32
+ } from "./chunk-DI52DQAC.js";
33
+
34
+ // ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AHTNJAMY.mjs
35
+ var import_sanitize_url = __toESM(require_dist(), 1);
36
+ var parser = function() {
37
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
38
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
39
+ return o2;
40
+ }, "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];
41
+ var parser2 = {
42
+ trace: /* @__PURE__ */ __name(function trace() {
43
+ }, "trace"),
44
+ yy: {},
45
+ 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 },
46
+ 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" },
47
+ 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]],
48
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
49
+ var $0 = $$.length - 1;
50
+ switch (yystate) {
51
+ case 3:
52
+ yy.setDirection("TB");
53
+ break;
54
+ case 4:
55
+ yy.setDirection("BT");
56
+ break;
57
+ case 5:
58
+ yy.setDirection("RL");
59
+ break;
60
+ case 6:
61
+ yy.setDirection("LR");
62
+ break;
63
+ case 8:
64
+ case 9:
65
+ case 10:
66
+ case 11:
67
+ case 12:
68
+ yy.setC4Type($$[$0 - 3]);
69
+ break;
70
+ case 19:
71
+ yy.setTitle($$[$0].substring(6));
72
+ this.$ = $$[$0].substring(6);
73
+ break;
74
+ case 20:
75
+ yy.setAccDescription($$[$0].substring(15));
76
+ this.$ = $$[$0].substring(15);
77
+ break;
78
+ case 21:
79
+ this.$ = $$[$0].trim();
80
+ yy.setTitle(this.$);
81
+ break;
82
+ case 22:
83
+ case 23:
84
+ this.$ = $$[$0].trim();
85
+ yy.setAccDescription(this.$);
86
+ break;
87
+ case 28:
88
+ $$[$0].splice(2, 0, "ENTERPRISE");
89
+ yy.addPersonOrSystemBoundary(...$$[$0]);
90
+ this.$ = $$[$0];
91
+ break;
92
+ case 29:
93
+ $$[$0].splice(2, 0, "SYSTEM");
94
+ yy.addPersonOrSystemBoundary(...$$[$0]);
95
+ this.$ = $$[$0];
96
+ break;
97
+ case 30:
98
+ yy.addPersonOrSystemBoundary(...$$[$0]);
99
+ this.$ = $$[$0];
100
+ break;
101
+ case 31:
102
+ $$[$0].splice(2, 0, "CONTAINER");
103
+ yy.addContainerBoundary(...$$[$0]);
104
+ this.$ = $$[$0];
105
+ break;
106
+ case 32:
107
+ yy.addDeploymentNode("node", ...$$[$0]);
108
+ this.$ = $$[$0];
109
+ break;
110
+ case 33:
111
+ yy.addDeploymentNode("nodeL", ...$$[$0]);
112
+ this.$ = $$[$0];
113
+ break;
114
+ case 34:
115
+ yy.addDeploymentNode("nodeR", ...$$[$0]);
116
+ this.$ = $$[$0];
117
+ break;
118
+ case 35:
119
+ yy.popBoundaryParseStack();
120
+ break;
121
+ case 39:
122
+ yy.addPersonOrSystem("person", ...$$[$0]);
123
+ this.$ = $$[$0];
124
+ break;
125
+ case 40:
126
+ yy.addPersonOrSystem("external_person", ...$$[$0]);
127
+ this.$ = $$[$0];
128
+ break;
129
+ case 41:
130
+ yy.addPersonOrSystem("system", ...$$[$0]);
131
+ this.$ = $$[$0];
132
+ break;
133
+ case 42:
134
+ yy.addPersonOrSystem("system_db", ...$$[$0]);
135
+ this.$ = $$[$0];
136
+ break;
137
+ case 43:
138
+ yy.addPersonOrSystem("system_queue", ...$$[$0]);
139
+ this.$ = $$[$0];
140
+ break;
141
+ case 44:
142
+ yy.addPersonOrSystem("external_system", ...$$[$0]);
143
+ this.$ = $$[$0];
144
+ break;
145
+ case 45:
146
+ yy.addPersonOrSystem("external_system_db", ...$$[$0]);
147
+ this.$ = $$[$0];
148
+ break;
149
+ case 46:
150
+ yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
151
+ this.$ = $$[$0];
152
+ break;
153
+ case 47:
154
+ yy.addContainer("container", ...$$[$0]);
155
+ this.$ = $$[$0];
156
+ break;
157
+ case 48:
158
+ yy.addContainer("container_db", ...$$[$0]);
159
+ this.$ = $$[$0];
160
+ break;
161
+ case 49:
162
+ yy.addContainer("container_queue", ...$$[$0]);
163
+ this.$ = $$[$0];
164
+ break;
165
+ case 50:
166
+ yy.addContainer("external_container", ...$$[$0]);
167
+ this.$ = $$[$0];
168
+ break;
169
+ case 51:
170
+ yy.addContainer("external_container_db", ...$$[$0]);
171
+ this.$ = $$[$0];
172
+ break;
173
+ case 52:
174
+ yy.addContainer("external_container_queue", ...$$[$0]);
175
+ this.$ = $$[$0];
176
+ break;
177
+ case 53:
178
+ yy.addComponent("component", ...$$[$0]);
179
+ this.$ = $$[$0];
180
+ break;
181
+ case 54:
182
+ yy.addComponent("component_db", ...$$[$0]);
183
+ this.$ = $$[$0];
184
+ break;
185
+ case 55:
186
+ yy.addComponent("component_queue", ...$$[$0]);
187
+ this.$ = $$[$0];
188
+ break;
189
+ case 56:
190
+ yy.addComponent("external_component", ...$$[$0]);
191
+ this.$ = $$[$0];
192
+ break;
193
+ case 57:
194
+ yy.addComponent("external_component_db", ...$$[$0]);
195
+ this.$ = $$[$0];
196
+ break;
197
+ case 58:
198
+ yy.addComponent("external_component_queue", ...$$[$0]);
199
+ this.$ = $$[$0];
200
+ break;
201
+ case 60:
202
+ yy.addRel("rel", ...$$[$0]);
203
+ this.$ = $$[$0];
204
+ break;
205
+ case 61:
206
+ yy.addRel("birel", ...$$[$0]);
207
+ this.$ = $$[$0];
208
+ break;
209
+ case 62:
210
+ yy.addRel("rel_u", ...$$[$0]);
211
+ this.$ = $$[$0];
212
+ break;
213
+ case 63:
214
+ yy.addRel("rel_d", ...$$[$0]);
215
+ this.$ = $$[$0];
216
+ break;
217
+ case 64:
218
+ yy.addRel("rel_l", ...$$[$0]);
219
+ this.$ = $$[$0];
220
+ break;
221
+ case 65:
222
+ yy.addRel("rel_r", ...$$[$0]);
223
+ this.$ = $$[$0];
224
+ break;
225
+ case 66:
226
+ yy.addRel("rel_b", ...$$[$0]);
227
+ this.$ = $$[$0];
228
+ break;
229
+ case 67:
230
+ $$[$0].splice(0, 1);
231
+ yy.addRel("rel", ...$$[$0]);
232
+ this.$ = $$[$0];
233
+ break;
234
+ case 68:
235
+ yy.updateElStyle("update_el_style", ...$$[$0]);
236
+ this.$ = $$[$0];
237
+ break;
238
+ case 69:
239
+ yy.updateRelStyle("update_rel_style", ...$$[$0]);
240
+ this.$ = $$[$0];
241
+ break;
242
+ case 70:
243
+ yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
244
+ this.$ = $$[$0];
245
+ break;
246
+ case 71:
247
+ this.$ = [$$[$0]];
248
+ break;
249
+ case 72:
250
+ $$[$0].unshift($$[$0 - 1]);
251
+ this.$ = $$[$0];
252
+ break;
253
+ case 73:
254
+ case 75:
255
+ this.$ = $$[$0].trim();
256
+ break;
257
+ case 74:
258
+ let kv = {};
259
+ kv[$$[$0 - 1].trim()] = $$[$0].trim();
260
+ this.$ = kv;
261
+ break;
262
+ case 76:
263
+ this.$ = "";
264
+ break;
265
+ }
266
+ }, "anonymous"),
267
+ 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])],
268
+ 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] },
269
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
270
+ if (hash.recoverable) {
271
+ this.trace(str);
272
+ } else {
273
+ var error = new Error(str);
274
+ error.hash = hash;
275
+ throw error;
276
+ }
277
+ }, "parseError"),
278
+ parse: /* @__PURE__ */ __name(function parse(input) {
279
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
280
+ var args = lstack.slice.call(arguments, 1);
281
+ var lexer2 = Object.create(this.lexer);
282
+ var sharedState = { yy: {} };
283
+ for (var k in this.yy) {
284
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
285
+ sharedState.yy[k] = this.yy[k];
286
+ }
287
+ }
288
+ lexer2.setInput(input, sharedState.yy);
289
+ sharedState.yy.lexer = lexer2;
290
+ sharedState.yy.parser = this;
291
+ if (typeof lexer2.yylloc == "undefined") {
292
+ lexer2.yylloc = {};
293
+ }
294
+ var yyloc = lexer2.yylloc;
295
+ lstack.push(yyloc);
296
+ var ranges = lexer2.options && lexer2.options.ranges;
297
+ if (typeof sharedState.yy.parseError === "function") {
298
+ this.parseError = sharedState.yy.parseError;
299
+ } else {
300
+ this.parseError = Object.getPrototypeOf(this).parseError;
301
+ }
302
+ function popStack(n) {
303
+ stack.length = stack.length - 2 * n;
304
+ vstack.length = vstack.length - n;
305
+ lstack.length = lstack.length - n;
306
+ }
307
+ __name(popStack, "popStack");
308
+ function lex() {
309
+ var token;
310
+ token = tstack.pop() || lexer2.lex() || EOF;
311
+ if (typeof token !== "number") {
312
+ if (token instanceof Array) {
313
+ tstack = token;
314
+ token = tstack.pop();
315
+ }
316
+ token = self.symbols_[token] || token;
317
+ }
318
+ return token;
319
+ }
320
+ __name(lex, "lex");
321
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
322
+ while (true) {
323
+ state = stack[stack.length - 1];
324
+ if (this.defaultActions[state]) {
325
+ action = this.defaultActions[state];
326
+ } else {
327
+ if (symbol === null || typeof symbol == "undefined") {
328
+ symbol = lex();
329
+ }
330
+ action = table[state] && table[state][symbol];
331
+ }
332
+ if (typeof action === "undefined" || !action.length || !action[0]) {
333
+ var errStr = "";
334
+ expected = [];
335
+ for (p in table[state]) {
336
+ if (this.terminals_[p] && p > TERROR) {
337
+ expected.push("'" + this.terminals_[p] + "'");
338
+ }
339
+ }
340
+ if (lexer2.showPosition) {
341
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
342
+ } else {
343
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
344
+ }
345
+ this.parseError(errStr, {
346
+ text: lexer2.match,
347
+ token: this.terminals_[symbol] || symbol,
348
+ line: lexer2.yylineno,
349
+ loc: yyloc,
350
+ expected
351
+ });
352
+ }
353
+ if (action[0] instanceof Array && action.length > 1) {
354
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
355
+ }
356
+ switch (action[0]) {
357
+ case 1:
358
+ stack.push(symbol);
359
+ vstack.push(lexer2.yytext);
360
+ lstack.push(lexer2.yylloc);
361
+ stack.push(action[1]);
362
+ symbol = null;
363
+ if (!preErrorSymbol) {
364
+ yyleng = lexer2.yyleng;
365
+ yytext = lexer2.yytext;
366
+ yylineno = lexer2.yylineno;
367
+ yyloc = lexer2.yylloc;
368
+ if (recovering > 0) {
369
+ recovering--;
370
+ }
371
+ } else {
372
+ symbol = preErrorSymbol;
373
+ preErrorSymbol = null;
374
+ }
375
+ break;
376
+ case 2:
377
+ len = this.productions_[action[1]][1];
378
+ yyval.$ = vstack[vstack.length - len];
379
+ yyval._$ = {
380
+ first_line: lstack[lstack.length - (len || 1)].first_line,
381
+ last_line: lstack[lstack.length - 1].last_line,
382
+ first_column: lstack[lstack.length - (len || 1)].first_column,
383
+ last_column: lstack[lstack.length - 1].last_column
384
+ };
385
+ if (ranges) {
386
+ yyval._$.range = [
387
+ lstack[lstack.length - (len || 1)].range[0],
388
+ lstack[lstack.length - 1].range[1]
389
+ ];
390
+ }
391
+ r = this.performAction.apply(yyval, [
392
+ yytext,
393
+ yyleng,
394
+ yylineno,
395
+ sharedState.yy,
396
+ action[1],
397
+ vstack,
398
+ lstack
399
+ ].concat(args));
400
+ if (typeof r !== "undefined") {
401
+ return r;
402
+ }
403
+ if (len) {
404
+ stack = stack.slice(0, -1 * len * 2);
405
+ vstack = vstack.slice(0, -1 * len);
406
+ lstack = lstack.slice(0, -1 * len);
407
+ }
408
+ stack.push(this.productions_[action[1]][0]);
409
+ vstack.push(yyval.$);
410
+ lstack.push(yyval._$);
411
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
412
+ stack.push(newState);
413
+ break;
414
+ case 3:
415
+ return true;
416
+ }
417
+ }
418
+ return true;
419
+ }, "parse")
420
+ };
421
+ var lexer = /* @__PURE__ */ function() {
422
+ var lexer2 = {
423
+ EOF: 1,
424
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
425
+ if (this.yy.parser) {
426
+ this.yy.parser.parseError(str, hash);
427
+ } else {
428
+ throw new Error(str);
429
+ }
430
+ }, "parseError"),
431
+ // resets the lexer, sets new input
432
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
433
+ this.yy = yy || this.yy || {};
434
+ this._input = input;
435
+ this._more = this._backtrack = this.done = false;
436
+ this.yylineno = this.yyleng = 0;
437
+ this.yytext = this.matched = this.match = "";
438
+ this.conditionStack = ["INITIAL"];
439
+ this.yylloc = {
440
+ first_line: 1,
441
+ first_column: 0,
442
+ last_line: 1,
443
+ last_column: 0
444
+ };
445
+ if (this.options.ranges) {
446
+ this.yylloc.range = [0, 0];
447
+ }
448
+ this.offset = 0;
449
+ return this;
450
+ }, "setInput"),
451
+ // consumes and returns one char from the input
452
+ input: /* @__PURE__ */ __name(function() {
453
+ var ch = this._input[0];
454
+ this.yytext += ch;
455
+ this.yyleng++;
456
+ this.offset++;
457
+ this.match += ch;
458
+ this.matched += ch;
459
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
460
+ if (lines) {
461
+ this.yylineno++;
462
+ this.yylloc.last_line++;
463
+ } else {
464
+ this.yylloc.last_column++;
465
+ }
466
+ if (this.options.ranges) {
467
+ this.yylloc.range[1]++;
468
+ }
469
+ this._input = this._input.slice(1);
470
+ return ch;
471
+ }, "input"),
472
+ // unshifts one char (or a string) into the input
473
+ unput: /* @__PURE__ */ __name(function(ch) {
474
+ var len = ch.length;
475
+ var lines = ch.split(/(?:\r\n?|\n)/g);
476
+ this._input = ch + this._input;
477
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
478
+ this.offset -= len;
479
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
480
+ this.match = this.match.substr(0, this.match.length - 1);
481
+ this.matched = this.matched.substr(0, this.matched.length - 1);
482
+ if (lines.length - 1) {
483
+ this.yylineno -= lines.length - 1;
484
+ }
485
+ var r = this.yylloc.range;
486
+ this.yylloc = {
487
+ first_line: this.yylloc.first_line,
488
+ last_line: this.yylineno + 1,
489
+ first_column: this.yylloc.first_column,
490
+ 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
491
+ };
492
+ if (this.options.ranges) {
493
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
494
+ }
495
+ this.yyleng = this.yytext.length;
496
+ return this;
497
+ }, "unput"),
498
+ // When called from action, caches matched text and appends it on next action
499
+ more: /* @__PURE__ */ __name(function() {
500
+ this._more = true;
501
+ return this;
502
+ }, "more"),
503
+ // 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.
504
+ reject: /* @__PURE__ */ __name(function() {
505
+ if (this.options.backtrack_lexer) {
506
+ this._backtrack = true;
507
+ } else {
508
+ 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(), {
509
+ text: "",
510
+ token: null,
511
+ line: this.yylineno
512
+ });
513
+ }
514
+ return this;
515
+ }, "reject"),
516
+ // retain first n characters of the match
517
+ less: /* @__PURE__ */ __name(function(n) {
518
+ this.unput(this.match.slice(n));
519
+ }, "less"),
520
+ // displays already matched input, i.e. for error messages
521
+ pastInput: /* @__PURE__ */ __name(function() {
522
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
523
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
524
+ }, "pastInput"),
525
+ // displays upcoming input, i.e. for error messages
526
+ upcomingInput: /* @__PURE__ */ __name(function() {
527
+ var next = this.match;
528
+ if (next.length < 20) {
529
+ next += this._input.substr(0, 20 - next.length);
530
+ }
531
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
532
+ }, "upcomingInput"),
533
+ // displays the character position where the lexing error occurred, i.e. for error messages
534
+ showPosition: /* @__PURE__ */ __name(function() {
535
+ var pre = this.pastInput();
536
+ var c2 = new Array(pre.length + 1).join("-");
537
+ return pre + this.upcomingInput() + "\n" + c2 + "^";
538
+ }, "showPosition"),
539
+ // test the lexed token: return FALSE when not a match, otherwise return token
540
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
541
+ var token, lines, backup;
542
+ if (this.options.backtrack_lexer) {
543
+ backup = {
544
+ yylineno: this.yylineno,
545
+ yylloc: {
546
+ first_line: this.yylloc.first_line,
547
+ last_line: this.last_line,
548
+ first_column: this.yylloc.first_column,
549
+ last_column: this.yylloc.last_column
550
+ },
551
+ yytext: this.yytext,
552
+ match: this.match,
553
+ matches: this.matches,
554
+ matched: this.matched,
555
+ yyleng: this.yyleng,
556
+ offset: this.offset,
557
+ _more: this._more,
558
+ _input: this._input,
559
+ yy: this.yy,
560
+ conditionStack: this.conditionStack.slice(0),
561
+ done: this.done
562
+ };
563
+ if (this.options.ranges) {
564
+ backup.yylloc.range = this.yylloc.range.slice(0);
565
+ }
566
+ }
567
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
568
+ if (lines) {
569
+ this.yylineno += lines.length;
570
+ }
571
+ this.yylloc = {
572
+ first_line: this.yylloc.last_line,
573
+ last_line: this.yylineno + 1,
574
+ first_column: this.yylloc.last_column,
575
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
576
+ };
577
+ this.yytext += match[0];
578
+ this.match += match[0];
579
+ this.matches = match;
580
+ this.yyleng = this.yytext.length;
581
+ if (this.options.ranges) {
582
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
583
+ }
584
+ this._more = false;
585
+ this._backtrack = false;
586
+ this._input = this._input.slice(match[0].length);
587
+ this.matched += match[0];
588
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
589
+ if (this.done && this._input) {
590
+ this.done = false;
591
+ }
592
+ if (token) {
593
+ return token;
594
+ } else if (this._backtrack) {
595
+ for (var k in backup) {
596
+ this[k] = backup[k];
597
+ }
598
+ return false;
599
+ }
600
+ return false;
601
+ }, "test_match"),
602
+ // return next match in input
603
+ next: /* @__PURE__ */ __name(function() {
604
+ if (this.done) {
605
+ return this.EOF;
606
+ }
607
+ if (!this._input) {
608
+ this.done = true;
609
+ }
610
+ var token, match, tempMatch, index;
611
+ if (!this._more) {
612
+ this.yytext = "";
613
+ this.match = "";
614
+ }
615
+ var rules = this._currentRules();
616
+ for (var i = 0; i < rules.length; i++) {
617
+ tempMatch = this._input.match(this.rules[rules[i]]);
618
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
619
+ match = tempMatch;
620
+ index = i;
621
+ if (this.options.backtrack_lexer) {
622
+ token = this.test_match(tempMatch, rules[i]);
623
+ if (token !== false) {
624
+ return token;
625
+ } else if (this._backtrack) {
626
+ match = false;
627
+ continue;
628
+ } else {
629
+ return false;
630
+ }
631
+ } else if (!this.options.flex) {
632
+ break;
633
+ }
634
+ }
635
+ }
636
+ if (match) {
637
+ token = this.test_match(match, rules[index]);
638
+ if (token !== false) {
639
+ return token;
640
+ }
641
+ return false;
642
+ }
643
+ if (this._input === "") {
644
+ return this.EOF;
645
+ } else {
646
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
647
+ text: "",
648
+ token: null,
649
+ line: this.yylineno
650
+ });
651
+ }
652
+ }, "next"),
653
+ // return next match that has a token
654
+ lex: /* @__PURE__ */ __name(function lex() {
655
+ var r = this.next();
656
+ if (r) {
657
+ return r;
658
+ } else {
659
+ return this.lex();
660
+ }
661
+ }, "lex"),
662
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
663
+ begin: /* @__PURE__ */ __name(function begin(condition) {
664
+ this.conditionStack.push(condition);
665
+ }, "begin"),
666
+ // pop the previously active lexer condition state off the condition stack
667
+ popState: /* @__PURE__ */ __name(function popState() {
668
+ var n = this.conditionStack.length - 1;
669
+ if (n > 0) {
670
+ return this.conditionStack.pop();
671
+ } else {
672
+ return this.conditionStack[0];
673
+ }
674
+ }, "popState"),
675
+ // produce the lexer rule set which is active for the currently active lexer condition state
676
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
677
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
678
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
679
+ } else {
680
+ return this.conditions["INITIAL"].rules;
681
+ }
682
+ }, "_currentRules"),
683
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
684
+ topState: /* @__PURE__ */ __name(function topState(n) {
685
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
686
+ if (n >= 0) {
687
+ return this.conditionStack[n];
688
+ } else {
689
+ return "INITIAL";
690
+ }
691
+ }, "topState"),
692
+ // alias for begin(condition)
693
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
694
+ this.begin(condition);
695
+ }, "pushState"),
696
+ // return the number of states currently on the stack
697
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
698
+ return this.conditionStack.length;
699
+ }, "stateStackSize"),
700
+ options: {},
701
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
702
+ var YYSTATE = YY_START;
703
+ switch ($avoiding_name_collisions) {
704
+ case 0:
705
+ return 6;
706
+ break;
707
+ case 1:
708
+ return 7;
709
+ break;
710
+ case 2:
711
+ return 8;
712
+ break;
713
+ case 3:
714
+ return 9;
715
+ break;
716
+ case 4:
717
+ return 22;
718
+ break;
719
+ case 5:
720
+ return 23;
721
+ break;
722
+ case 6:
723
+ this.begin("acc_title");
724
+ return 24;
725
+ break;
726
+ case 7:
727
+ this.popState();
728
+ return "acc_title_value";
729
+ break;
730
+ case 8:
731
+ this.begin("acc_descr");
732
+ return 26;
733
+ break;
734
+ case 9:
735
+ this.popState();
736
+ return "acc_descr_value";
737
+ break;
738
+ case 10:
739
+ this.begin("acc_descr_multiline");
740
+ break;
741
+ case 11:
742
+ this.popState();
743
+ break;
744
+ case 12:
745
+ return "acc_descr_multiline_value";
746
+ break;
747
+ case 13:
748
+ break;
749
+ case 14:
750
+ c;
751
+ break;
752
+ case 15:
753
+ return 12;
754
+ break;
755
+ case 16:
756
+ break;
757
+ case 17:
758
+ return 11;
759
+ break;
760
+ case 18:
761
+ return 15;
762
+ break;
763
+ case 19:
764
+ return 16;
765
+ break;
766
+ case 20:
767
+ return 17;
768
+ break;
769
+ case 21:
770
+ return 18;
771
+ break;
772
+ case 22:
773
+ this.begin("person_ext");
774
+ return 45;
775
+ break;
776
+ case 23:
777
+ this.begin("person");
778
+ return 44;
779
+ break;
780
+ case 24:
781
+ this.begin("system_ext_queue");
782
+ return 51;
783
+ break;
784
+ case 25:
785
+ this.begin("system_ext_db");
786
+ return 50;
787
+ break;
788
+ case 26:
789
+ this.begin("system_ext");
790
+ return 49;
791
+ break;
792
+ case 27:
793
+ this.begin("system_queue");
794
+ return 48;
795
+ break;
796
+ case 28:
797
+ this.begin("system_db");
798
+ return 47;
799
+ break;
800
+ case 29:
801
+ this.begin("system");
802
+ return 46;
803
+ break;
804
+ case 30:
805
+ this.begin("boundary");
806
+ return 37;
807
+ break;
808
+ case 31:
809
+ this.begin("enterprise_boundary");
810
+ return 34;
811
+ break;
812
+ case 32:
813
+ this.begin("system_boundary");
814
+ return 36;
815
+ break;
816
+ case 33:
817
+ this.begin("container_ext_queue");
818
+ return 57;
819
+ break;
820
+ case 34:
821
+ this.begin("container_ext_db");
822
+ return 56;
823
+ break;
824
+ case 35:
825
+ this.begin("container_ext");
826
+ return 55;
827
+ break;
828
+ case 36:
829
+ this.begin("container_queue");
830
+ return 54;
831
+ break;
832
+ case 37:
833
+ this.begin("container_db");
834
+ return 53;
835
+ break;
836
+ case 38:
837
+ this.begin("container");
838
+ return 52;
839
+ break;
840
+ case 39:
841
+ this.begin("container_boundary");
842
+ return 38;
843
+ break;
844
+ case 40:
845
+ this.begin("component_ext_queue");
846
+ return 63;
847
+ break;
848
+ case 41:
849
+ this.begin("component_ext_db");
850
+ return 62;
851
+ break;
852
+ case 42:
853
+ this.begin("component_ext");
854
+ return 61;
855
+ break;
856
+ case 43:
857
+ this.begin("component_queue");
858
+ return 60;
859
+ break;
860
+ case 44:
861
+ this.begin("component_db");
862
+ return 59;
863
+ break;
864
+ case 45:
865
+ this.begin("component");
866
+ return 58;
867
+ break;
868
+ case 46:
869
+ this.begin("node");
870
+ return 39;
871
+ break;
872
+ case 47:
873
+ this.begin("node");
874
+ return 39;
875
+ break;
876
+ case 48:
877
+ this.begin("node_l");
878
+ return 40;
879
+ break;
880
+ case 49:
881
+ this.begin("node_r");
882
+ return 41;
883
+ break;
884
+ case 50:
885
+ this.begin("rel");
886
+ return 64;
887
+ break;
888
+ case 51:
889
+ this.begin("birel");
890
+ return 65;
891
+ break;
892
+ case 52:
893
+ this.begin("rel_u");
894
+ return 66;
895
+ break;
896
+ case 53:
897
+ this.begin("rel_u");
898
+ return 66;
899
+ break;
900
+ case 54:
901
+ this.begin("rel_d");
902
+ return 67;
903
+ break;
904
+ case 55:
905
+ this.begin("rel_d");
906
+ return 67;
907
+ break;
908
+ case 56:
909
+ this.begin("rel_l");
910
+ return 68;
911
+ break;
912
+ case 57:
913
+ this.begin("rel_l");
914
+ return 68;
915
+ break;
916
+ case 58:
917
+ this.begin("rel_r");
918
+ return 69;
919
+ break;
920
+ case 59:
921
+ this.begin("rel_r");
922
+ return 69;
923
+ break;
924
+ case 60:
925
+ this.begin("rel_b");
926
+ return 70;
927
+ break;
928
+ case 61:
929
+ this.begin("rel_index");
930
+ return 71;
931
+ break;
932
+ case 62:
933
+ this.begin("update_el_style");
934
+ return 72;
935
+ break;
936
+ case 63:
937
+ this.begin("update_rel_style");
938
+ return 73;
939
+ break;
940
+ case 64:
941
+ this.begin("update_layout_config");
942
+ return 74;
943
+ break;
944
+ case 65:
945
+ return "EOF_IN_STRUCT";
946
+ break;
947
+ case 66:
948
+ this.begin("attribute");
949
+ return "ATTRIBUTE_EMPTY";
950
+ break;
951
+ case 67:
952
+ this.begin("attribute");
953
+ break;
954
+ case 68:
955
+ this.popState();
956
+ this.popState();
957
+ break;
958
+ case 69:
959
+ return 80;
960
+ break;
961
+ case 70:
962
+ break;
963
+ case 71:
964
+ return 80;
965
+ break;
966
+ case 72:
967
+ this.begin("string");
968
+ break;
969
+ case 73:
970
+ this.popState();
971
+ break;
972
+ case 74:
973
+ return "STR";
974
+ break;
975
+ case 75:
976
+ this.begin("string_kv");
977
+ break;
978
+ case 76:
979
+ this.begin("string_kv_key");
980
+ return "STR_KEY";
981
+ break;
982
+ case 77:
983
+ this.popState();
984
+ this.begin("string_kv_value");
985
+ break;
986
+ case 78:
987
+ return "STR_VALUE";
988
+ break;
989
+ case 79:
990
+ this.popState();
991
+ this.popState();
992
+ break;
993
+ case 80:
994
+ return "STR";
995
+ break;
996
+ case 81:
997
+ return "LBRACE";
998
+ break;
999
+ case 82:
1000
+ return "RBRACE";
1001
+ break;
1002
+ case 83:
1003
+ return "SPACE";
1004
+ break;
1005
+ case 84:
1006
+ return "EOL";
1007
+ break;
1008
+ case 85:
1009
+ return 14;
1010
+ break;
1011
+ }
1012
+ }, "anonymous"),
1013
+ 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]+)/, /^(?:$)/],
1014
+ 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": [65, 66, 67, 68], "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 } }
1015
+ };
1016
+ return lexer2;
1017
+ }();
1018
+ parser2.lexer = lexer;
1019
+ function Parser() {
1020
+ this.yy = {};
1021
+ }
1022
+ __name(Parser, "Parser");
1023
+ Parser.prototype = parser2;
1024
+ parser2.Parser = Parser;
1025
+ return new Parser();
1026
+ }();
1027
+ parser.parser = parser;
1028
+ var c4Diagram_default = parser;
1029
+ var c4ShapeArray = [];
1030
+ var boundaryParseStack = [""];
1031
+ var currentBoundaryParse = "global";
1032
+ var parentBoundaryParse = "";
1033
+ var boundaries = [
1034
+ {
1035
+ alias: "global",
1036
+ label: { text: "global" },
1037
+ type: { text: "global" },
1038
+ tags: null,
1039
+ link: null,
1040
+ parentBoundary: ""
1041
+ }
1042
+ ];
1043
+ var rels = [];
1044
+ var title = "";
1045
+ var wrapEnabled = false;
1046
+ var c4ShapeInRow = 4;
1047
+ var c4BoundaryInRow = 2;
1048
+ var c4Type;
1049
+ var getC4Type = /* @__PURE__ */ __name(function() {
1050
+ return c4Type;
1051
+ }, "getC4Type");
1052
+ var setC4Type = /* @__PURE__ */ __name(function(c4TypeParam) {
1053
+ let sanitizedText = sanitizeText(c4TypeParam, getConfig2());
1054
+ c4Type = sanitizedText;
1055
+ }, "setC4Type");
1056
+ var addRel = /* @__PURE__ */ __name(function(type, from, to, label, techn, descr, sprite, tags, link) {
1057
+ if (type === void 0 || type === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) {
1058
+ return;
1059
+ }
1060
+ let rel = {};
1061
+ const old = rels.find((rel2) => rel2.from === from && rel2.to === to);
1062
+ if (old) {
1063
+ rel = old;
1064
+ } else {
1065
+ rels.push(rel);
1066
+ }
1067
+ rel.type = type;
1068
+ rel.from = from;
1069
+ rel.to = to;
1070
+ rel.label = { text: label };
1071
+ if (techn === void 0 || techn === null) {
1072
+ rel.techn = { text: "" };
1073
+ } else {
1074
+ if (typeof techn === "object") {
1075
+ let [key, value] = Object.entries(techn)[0];
1076
+ rel[key] = { text: value };
1077
+ } else {
1078
+ rel.techn = { text: techn };
1079
+ }
1080
+ }
1081
+ if (descr === void 0 || descr === null) {
1082
+ rel.descr = { text: "" };
1083
+ } else {
1084
+ if (typeof descr === "object") {
1085
+ let [key, value] = Object.entries(descr)[0];
1086
+ rel[key] = { text: value };
1087
+ } else {
1088
+ rel.descr = { text: descr };
1089
+ }
1090
+ }
1091
+ if (typeof sprite === "object") {
1092
+ let [key, value] = Object.entries(sprite)[0];
1093
+ rel[key] = value;
1094
+ } else {
1095
+ rel.sprite = sprite;
1096
+ }
1097
+ if (typeof tags === "object") {
1098
+ let [key, value] = Object.entries(tags)[0];
1099
+ rel[key] = value;
1100
+ } else {
1101
+ rel.tags = tags;
1102
+ }
1103
+ if (typeof link === "object") {
1104
+ let [key, value] = Object.entries(link)[0];
1105
+ rel[key] = value;
1106
+ } else {
1107
+ rel.link = link;
1108
+ }
1109
+ rel.wrap = autoWrap();
1110
+ }, "addRel");
1111
+ var addPersonOrSystem = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, descr, sprite, tags, link) {
1112
+ if (alias === null || label === null) {
1113
+ return;
1114
+ }
1115
+ let personOrSystem = {};
1116
+ const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
1117
+ if (old && alias === old.alias) {
1118
+ personOrSystem = old;
1119
+ } else {
1120
+ personOrSystem.alias = alias;
1121
+ c4ShapeArray.push(personOrSystem);
1122
+ }
1123
+ if (label === void 0 || label === null) {
1124
+ personOrSystem.label = { text: "" };
1125
+ } else {
1126
+ personOrSystem.label = { text: label };
1127
+ }
1128
+ if (descr === void 0 || descr === null) {
1129
+ personOrSystem.descr = { text: "" };
1130
+ } else {
1131
+ if (typeof descr === "object") {
1132
+ let [key, value] = Object.entries(descr)[0];
1133
+ personOrSystem[key] = { text: value };
1134
+ } else {
1135
+ personOrSystem.descr = { text: descr };
1136
+ }
1137
+ }
1138
+ if (typeof sprite === "object") {
1139
+ let [key, value] = Object.entries(sprite)[0];
1140
+ personOrSystem[key] = value;
1141
+ } else {
1142
+ personOrSystem.sprite = sprite;
1143
+ }
1144
+ if (typeof tags === "object") {
1145
+ let [key, value] = Object.entries(tags)[0];
1146
+ personOrSystem[key] = value;
1147
+ } else {
1148
+ personOrSystem.tags = tags;
1149
+ }
1150
+ if (typeof link === "object") {
1151
+ let [key, value] = Object.entries(link)[0];
1152
+ personOrSystem[key] = value;
1153
+ } else {
1154
+ personOrSystem.link = link;
1155
+ }
1156
+ personOrSystem.typeC4Shape = { text: typeC4Shape };
1157
+ personOrSystem.parentBoundary = currentBoundaryParse;
1158
+ personOrSystem.wrap = autoWrap();
1159
+ }, "addPersonOrSystem");
1160
+ var addContainer = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1161
+ if (alias === null || label === null) {
1162
+ return;
1163
+ }
1164
+ let container = {};
1165
+ const old = c4ShapeArray.find((container2) => container2.alias === alias);
1166
+ if (old && alias === old.alias) {
1167
+ container = old;
1168
+ } else {
1169
+ container.alias = alias;
1170
+ c4ShapeArray.push(container);
1171
+ }
1172
+ if (label === void 0 || label === null) {
1173
+ container.label = { text: "" };
1174
+ } else {
1175
+ container.label = { text: label };
1176
+ }
1177
+ if (techn === void 0 || techn === null) {
1178
+ container.techn = { text: "" };
1179
+ } else {
1180
+ if (typeof techn === "object") {
1181
+ let [key, value] = Object.entries(techn)[0];
1182
+ container[key] = { text: value };
1183
+ } else {
1184
+ container.techn = { text: techn };
1185
+ }
1186
+ }
1187
+ if (descr === void 0 || descr === null) {
1188
+ container.descr = { text: "" };
1189
+ } else {
1190
+ if (typeof descr === "object") {
1191
+ let [key, value] = Object.entries(descr)[0];
1192
+ container[key] = { text: value };
1193
+ } else {
1194
+ container.descr = { text: descr };
1195
+ }
1196
+ }
1197
+ if (typeof sprite === "object") {
1198
+ let [key, value] = Object.entries(sprite)[0];
1199
+ container[key] = value;
1200
+ } else {
1201
+ container.sprite = sprite;
1202
+ }
1203
+ if (typeof tags === "object") {
1204
+ let [key, value] = Object.entries(tags)[0];
1205
+ container[key] = value;
1206
+ } else {
1207
+ container.tags = tags;
1208
+ }
1209
+ if (typeof link === "object") {
1210
+ let [key, value] = Object.entries(link)[0];
1211
+ container[key] = value;
1212
+ } else {
1213
+ container.link = link;
1214
+ }
1215
+ container.wrap = autoWrap();
1216
+ container.typeC4Shape = { text: typeC4Shape };
1217
+ container.parentBoundary = currentBoundaryParse;
1218
+ }, "addContainer");
1219
+ var addComponent = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1220
+ if (alias === null || label === null) {
1221
+ return;
1222
+ }
1223
+ let component = {};
1224
+ const old = c4ShapeArray.find((component2) => component2.alias === alias);
1225
+ if (old && alias === old.alias) {
1226
+ component = old;
1227
+ } else {
1228
+ component.alias = alias;
1229
+ c4ShapeArray.push(component);
1230
+ }
1231
+ if (label === void 0 || label === null) {
1232
+ component.label = { text: "" };
1233
+ } else {
1234
+ component.label = { text: label };
1235
+ }
1236
+ if (techn === void 0 || techn === null) {
1237
+ component.techn = { text: "" };
1238
+ } else {
1239
+ if (typeof techn === "object") {
1240
+ let [key, value] = Object.entries(techn)[0];
1241
+ component[key] = { text: value };
1242
+ } else {
1243
+ component.techn = { text: techn };
1244
+ }
1245
+ }
1246
+ if (descr === void 0 || descr === null) {
1247
+ component.descr = { text: "" };
1248
+ } else {
1249
+ if (typeof descr === "object") {
1250
+ let [key, value] = Object.entries(descr)[0];
1251
+ component[key] = { text: value };
1252
+ } else {
1253
+ component.descr = { text: descr };
1254
+ }
1255
+ }
1256
+ if (typeof sprite === "object") {
1257
+ let [key, value] = Object.entries(sprite)[0];
1258
+ component[key] = value;
1259
+ } else {
1260
+ component.sprite = sprite;
1261
+ }
1262
+ if (typeof tags === "object") {
1263
+ let [key, value] = Object.entries(tags)[0];
1264
+ component[key] = value;
1265
+ } else {
1266
+ component.tags = tags;
1267
+ }
1268
+ if (typeof link === "object") {
1269
+ let [key, value] = Object.entries(link)[0];
1270
+ component[key] = value;
1271
+ } else {
1272
+ component.link = link;
1273
+ }
1274
+ component.wrap = autoWrap();
1275
+ component.typeC4Shape = { text: typeC4Shape };
1276
+ component.parentBoundary = currentBoundaryParse;
1277
+ }, "addComponent");
1278
+ var addPersonOrSystemBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1279
+ if (alias === null || label === null) {
1280
+ return;
1281
+ }
1282
+ let boundary = {};
1283
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1284
+ if (old && alias === old.alias) {
1285
+ boundary = old;
1286
+ } else {
1287
+ boundary.alias = alias;
1288
+ boundaries.push(boundary);
1289
+ }
1290
+ if (label === void 0 || label === null) {
1291
+ boundary.label = { text: "" };
1292
+ } else {
1293
+ boundary.label = { text: label };
1294
+ }
1295
+ if (type === void 0 || type === null) {
1296
+ boundary.type = { text: "system" };
1297
+ } else {
1298
+ if (typeof type === "object") {
1299
+ let [key, value] = Object.entries(type)[0];
1300
+ boundary[key] = { text: value };
1301
+ } else {
1302
+ boundary.type = { text: type };
1303
+ }
1304
+ }
1305
+ if (typeof tags === "object") {
1306
+ let [key, value] = Object.entries(tags)[0];
1307
+ boundary[key] = value;
1308
+ } else {
1309
+ boundary.tags = tags;
1310
+ }
1311
+ if (typeof link === "object") {
1312
+ let [key, value] = Object.entries(link)[0];
1313
+ boundary[key] = value;
1314
+ } else {
1315
+ boundary.link = link;
1316
+ }
1317
+ boundary.parentBoundary = currentBoundaryParse;
1318
+ boundary.wrap = autoWrap();
1319
+ parentBoundaryParse = currentBoundaryParse;
1320
+ currentBoundaryParse = alias;
1321
+ boundaryParseStack.push(parentBoundaryParse);
1322
+ }, "addPersonOrSystemBoundary");
1323
+ var addContainerBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1324
+ if (alias === null || label === null) {
1325
+ return;
1326
+ }
1327
+ let boundary = {};
1328
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1329
+ if (old && alias === old.alias) {
1330
+ boundary = old;
1331
+ } else {
1332
+ boundary.alias = alias;
1333
+ boundaries.push(boundary);
1334
+ }
1335
+ if (label === void 0 || label === null) {
1336
+ boundary.label = { text: "" };
1337
+ } else {
1338
+ boundary.label = { text: label };
1339
+ }
1340
+ if (type === void 0 || type === null) {
1341
+ boundary.type = { text: "container" };
1342
+ } else {
1343
+ if (typeof type === "object") {
1344
+ let [key, value] = Object.entries(type)[0];
1345
+ boundary[key] = { text: value };
1346
+ } else {
1347
+ boundary.type = { text: type };
1348
+ }
1349
+ }
1350
+ if (typeof tags === "object") {
1351
+ let [key, value] = Object.entries(tags)[0];
1352
+ boundary[key] = value;
1353
+ } else {
1354
+ boundary.tags = tags;
1355
+ }
1356
+ if (typeof link === "object") {
1357
+ let [key, value] = Object.entries(link)[0];
1358
+ boundary[key] = value;
1359
+ } else {
1360
+ boundary.link = link;
1361
+ }
1362
+ boundary.parentBoundary = currentBoundaryParse;
1363
+ boundary.wrap = autoWrap();
1364
+ parentBoundaryParse = currentBoundaryParse;
1365
+ currentBoundaryParse = alias;
1366
+ boundaryParseStack.push(parentBoundaryParse);
1367
+ }, "addContainerBoundary");
1368
+ var addDeploymentNode = /* @__PURE__ */ __name(function(nodeType, alias, label, type, descr, sprite, tags, link) {
1369
+ if (alias === null || label === null) {
1370
+ return;
1371
+ }
1372
+ let boundary = {};
1373
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1374
+ if (old && alias === old.alias) {
1375
+ boundary = old;
1376
+ } else {
1377
+ boundary.alias = alias;
1378
+ boundaries.push(boundary);
1379
+ }
1380
+ if (label === void 0 || label === null) {
1381
+ boundary.label = { text: "" };
1382
+ } else {
1383
+ boundary.label = { text: label };
1384
+ }
1385
+ if (type === void 0 || type === null) {
1386
+ boundary.type = { text: "node" };
1387
+ } else {
1388
+ if (typeof type === "object") {
1389
+ let [key, value] = Object.entries(type)[0];
1390
+ boundary[key] = { text: value };
1391
+ } else {
1392
+ boundary.type = { text: type };
1393
+ }
1394
+ }
1395
+ if (descr === void 0 || descr === null) {
1396
+ boundary.descr = { text: "" };
1397
+ } else {
1398
+ if (typeof descr === "object") {
1399
+ let [key, value] = Object.entries(descr)[0];
1400
+ boundary[key] = { text: value };
1401
+ } else {
1402
+ boundary.descr = { text: descr };
1403
+ }
1404
+ }
1405
+ if (typeof tags === "object") {
1406
+ let [key, value] = Object.entries(tags)[0];
1407
+ boundary[key] = value;
1408
+ } else {
1409
+ boundary.tags = tags;
1410
+ }
1411
+ if (typeof link === "object") {
1412
+ let [key, value] = Object.entries(link)[0];
1413
+ boundary[key] = value;
1414
+ } else {
1415
+ boundary.link = link;
1416
+ }
1417
+ boundary.nodeType = nodeType;
1418
+ boundary.parentBoundary = currentBoundaryParse;
1419
+ boundary.wrap = autoWrap();
1420
+ parentBoundaryParse = currentBoundaryParse;
1421
+ currentBoundaryParse = alias;
1422
+ boundaryParseStack.push(parentBoundaryParse);
1423
+ }, "addDeploymentNode");
1424
+ var popBoundaryParseStack = /* @__PURE__ */ __name(function() {
1425
+ currentBoundaryParse = parentBoundaryParse;
1426
+ boundaryParseStack.pop();
1427
+ parentBoundaryParse = boundaryParseStack.pop();
1428
+ boundaryParseStack.push(parentBoundaryParse);
1429
+ }, "popBoundaryParseStack");
1430
+ var updateElStyle = /* @__PURE__ */ __name(function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
1431
+ let old = c4ShapeArray.find((element) => element.alias === elementName);
1432
+ if (old === void 0) {
1433
+ old = boundaries.find((element) => element.alias === elementName);
1434
+ if (old === void 0) {
1435
+ return;
1436
+ }
1437
+ }
1438
+ if (bgColor !== void 0 && bgColor !== null) {
1439
+ if (typeof bgColor === "object") {
1440
+ let [key, value] = Object.entries(bgColor)[0];
1441
+ old[key] = value;
1442
+ } else {
1443
+ old.bgColor = bgColor;
1444
+ }
1445
+ }
1446
+ if (fontColor !== void 0 && fontColor !== null) {
1447
+ if (typeof fontColor === "object") {
1448
+ let [key, value] = Object.entries(fontColor)[0];
1449
+ old[key] = value;
1450
+ } else {
1451
+ old.fontColor = fontColor;
1452
+ }
1453
+ }
1454
+ if (borderColor !== void 0 && borderColor !== null) {
1455
+ if (typeof borderColor === "object") {
1456
+ let [key, value] = Object.entries(borderColor)[0];
1457
+ old[key] = value;
1458
+ } else {
1459
+ old.borderColor = borderColor;
1460
+ }
1461
+ }
1462
+ if (shadowing !== void 0 && shadowing !== null) {
1463
+ if (typeof shadowing === "object") {
1464
+ let [key, value] = Object.entries(shadowing)[0];
1465
+ old[key] = value;
1466
+ } else {
1467
+ old.shadowing = shadowing;
1468
+ }
1469
+ }
1470
+ if (shape !== void 0 && shape !== null) {
1471
+ if (typeof shape === "object") {
1472
+ let [key, value] = Object.entries(shape)[0];
1473
+ old[key] = value;
1474
+ } else {
1475
+ old.shape = shape;
1476
+ }
1477
+ }
1478
+ if (sprite !== void 0 && sprite !== null) {
1479
+ if (typeof sprite === "object") {
1480
+ let [key, value] = Object.entries(sprite)[0];
1481
+ old[key] = value;
1482
+ } else {
1483
+ old.sprite = sprite;
1484
+ }
1485
+ }
1486
+ if (techn !== void 0 && techn !== null) {
1487
+ if (typeof techn === "object") {
1488
+ let [key, value] = Object.entries(techn)[0];
1489
+ old[key] = value;
1490
+ } else {
1491
+ old.techn = techn;
1492
+ }
1493
+ }
1494
+ if (legendText !== void 0 && legendText !== null) {
1495
+ if (typeof legendText === "object") {
1496
+ let [key, value] = Object.entries(legendText)[0];
1497
+ old[key] = value;
1498
+ } else {
1499
+ old.legendText = legendText;
1500
+ }
1501
+ }
1502
+ if (legendSprite !== void 0 && legendSprite !== null) {
1503
+ if (typeof legendSprite === "object") {
1504
+ let [key, value] = Object.entries(legendSprite)[0];
1505
+ old[key] = value;
1506
+ } else {
1507
+ old.legendSprite = legendSprite;
1508
+ }
1509
+ }
1510
+ }, "updateElStyle");
1511
+ var updateRelStyle = /* @__PURE__ */ __name(function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) {
1512
+ const old = rels.find((rel) => rel.from === from && rel.to === to);
1513
+ if (old === void 0) {
1514
+ return;
1515
+ }
1516
+ if (textColor !== void 0 && textColor !== null) {
1517
+ if (typeof textColor === "object") {
1518
+ let [key, value] = Object.entries(textColor)[0];
1519
+ old[key] = value;
1520
+ } else {
1521
+ old.textColor = textColor;
1522
+ }
1523
+ }
1524
+ if (lineColor !== void 0 && lineColor !== null) {
1525
+ if (typeof lineColor === "object") {
1526
+ let [key, value] = Object.entries(lineColor)[0];
1527
+ old[key] = value;
1528
+ } else {
1529
+ old.lineColor = lineColor;
1530
+ }
1531
+ }
1532
+ if (offsetX !== void 0 && offsetX !== null) {
1533
+ if (typeof offsetX === "object") {
1534
+ let [key, value] = Object.entries(offsetX)[0];
1535
+ old[key] = parseInt(value);
1536
+ } else {
1537
+ old.offsetX = parseInt(offsetX);
1538
+ }
1539
+ }
1540
+ if (offsetY !== void 0 && offsetY !== null) {
1541
+ if (typeof offsetY === "object") {
1542
+ let [key, value] = Object.entries(offsetY)[0];
1543
+ old[key] = parseInt(value);
1544
+ } else {
1545
+ old.offsetY = parseInt(offsetY);
1546
+ }
1547
+ }
1548
+ }, "updateRelStyle");
1549
+ var updateLayoutConfig = /* @__PURE__ */ __name(function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
1550
+ let c4ShapeInRowValue = c4ShapeInRow;
1551
+ let c4BoundaryInRowValue = c4BoundaryInRow;
1552
+ if (typeof c4ShapeInRowParam === "object") {
1553
+ const value = Object.values(c4ShapeInRowParam)[0];
1554
+ c4ShapeInRowValue = parseInt(value);
1555
+ } else {
1556
+ c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
1557
+ }
1558
+ if (typeof c4BoundaryInRowParam === "object") {
1559
+ const value = Object.values(c4BoundaryInRowParam)[0];
1560
+ c4BoundaryInRowValue = parseInt(value);
1561
+ } else {
1562
+ c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
1563
+ }
1564
+ if (c4ShapeInRowValue >= 1) {
1565
+ c4ShapeInRow = c4ShapeInRowValue;
1566
+ }
1567
+ if (c4BoundaryInRowValue >= 1) {
1568
+ c4BoundaryInRow = c4BoundaryInRowValue;
1569
+ }
1570
+ }, "updateLayoutConfig");
1571
+ var getC4ShapeInRow = /* @__PURE__ */ __name(function() {
1572
+ return c4ShapeInRow;
1573
+ }, "getC4ShapeInRow");
1574
+ var getC4BoundaryInRow = /* @__PURE__ */ __name(function() {
1575
+ return c4BoundaryInRow;
1576
+ }, "getC4BoundaryInRow");
1577
+ var getCurrentBoundaryParse = /* @__PURE__ */ __name(function() {
1578
+ return currentBoundaryParse;
1579
+ }, "getCurrentBoundaryParse");
1580
+ var getParentBoundaryParse = /* @__PURE__ */ __name(function() {
1581
+ return parentBoundaryParse;
1582
+ }, "getParentBoundaryParse");
1583
+ var getC4ShapeArray = /* @__PURE__ */ __name(function(parentBoundary) {
1584
+ if (parentBoundary === void 0 || parentBoundary === null) {
1585
+ return c4ShapeArray;
1586
+ } else {
1587
+ return c4ShapeArray.filter((personOrSystem) => {
1588
+ return personOrSystem.parentBoundary === parentBoundary;
1589
+ });
1590
+ }
1591
+ }, "getC4ShapeArray");
1592
+ var getC4Shape = /* @__PURE__ */ __name(function(alias) {
1593
+ return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
1594
+ }, "getC4Shape");
1595
+ var getC4ShapeKeys = /* @__PURE__ */ __name(function(parentBoundary) {
1596
+ return Object.keys(getC4ShapeArray(parentBoundary));
1597
+ }, "getC4ShapeKeys");
1598
+ var getBoundaries = /* @__PURE__ */ __name(function(parentBoundary) {
1599
+ if (parentBoundary === void 0 || parentBoundary === null) {
1600
+ return boundaries;
1601
+ } else {
1602
+ return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
1603
+ }
1604
+ }, "getBoundaries");
1605
+ var getBoundarys = getBoundaries;
1606
+ var getRels = /* @__PURE__ */ __name(function() {
1607
+ return rels;
1608
+ }, "getRels");
1609
+ var getTitle = /* @__PURE__ */ __name(function() {
1610
+ return title;
1611
+ }, "getTitle");
1612
+ var setWrap = /* @__PURE__ */ __name(function(wrapSetting) {
1613
+ wrapEnabled = wrapSetting;
1614
+ }, "setWrap");
1615
+ var autoWrap = /* @__PURE__ */ __name(function() {
1616
+ return wrapEnabled;
1617
+ }, "autoWrap");
1618
+ var clear = /* @__PURE__ */ __name(function() {
1619
+ c4ShapeArray = [];
1620
+ boundaries = [
1621
+ {
1622
+ alias: "global",
1623
+ label: { text: "global" },
1624
+ type: { text: "global" },
1625
+ tags: null,
1626
+ link: null,
1627
+ parentBoundary: ""
1628
+ }
1629
+ ];
1630
+ parentBoundaryParse = "";
1631
+ currentBoundaryParse = "global";
1632
+ boundaryParseStack = [""];
1633
+ rels = [];
1634
+ boundaryParseStack = [""];
1635
+ title = "";
1636
+ wrapEnabled = false;
1637
+ c4ShapeInRow = 4;
1638
+ c4BoundaryInRow = 2;
1639
+ }, "clear");
1640
+ var LINETYPE = {
1641
+ SOLID: 0,
1642
+ DOTTED: 1,
1643
+ NOTE: 2,
1644
+ SOLID_CROSS: 3,
1645
+ DOTTED_CROSS: 4,
1646
+ SOLID_OPEN: 5,
1647
+ DOTTED_OPEN: 6,
1648
+ LOOP_START: 10,
1649
+ LOOP_END: 11,
1650
+ ALT_START: 12,
1651
+ ALT_ELSE: 13,
1652
+ ALT_END: 14,
1653
+ OPT_START: 15,
1654
+ OPT_END: 16,
1655
+ ACTIVE_START: 17,
1656
+ ACTIVE_END: 18,
1657
+ PAR_START: 19,
1658
+ PAR_AND: 20,
1659
+ PAR_END: 21,
1660
+ RECT_START: 22,
1661
+ RECT_END: 23,
1662
+ SOLID_POINT: 24,
1663
+ DOTTED_POINT: 25
1664
+ };
1665
+ var ARROWTYPE = {
1666
+ FILLED: 0,
1667
+ OPEN: 1
1668
+ };
1669
+ var PLACEMENT = {
1670
+ LEFTOF: 0,
1671
+ RIGHTOF: 1,
1672
+ OVER: 2
1673
+ };
1674
+ var setTitle = /* @__PURE__ */ __name(function(txt) {
1675
+ let sanitizedText = sanitizeText(txt, getConfig2());
1676
+ title = sanitizedText;
1677
+ }, "setTitle");
1678
+ var c4Db_default = {
1679
+ addPersonOrSystem,
1680
+ addPersonOrSystemBoundary,
1681
+ addContainer,
1682
+ addContainerBoundary,
1683
+ addComponent,
1684
+ addDeploymentNode,
1685
+ popBoundaryParseStack,
1686
+ addRel,
1687
+ updateElStyle,
1688
+ updateRelStyle,
1689
+ updateLayoutConfig,
1690
+ autoWrap,
1691
+ setWrap,
1692
+ getC4ShapeArray,
1693
+ getC4Shape,
1694
+ getC4ShapeKeys,
1695
+ getBoundaries,
1696
+ getBoundarys,
1697
+ getCurrentBoundaryParse,
1698
+ getParentBoundaryParse,
1699
+ getRels,
1700
+ getTitle,
1701
+ getC4Type,
1702
+ getC4ShapeInRow,
1703
+ getC4BoundaryInRow,
1704
+ setAccTitle,
1705
+ getAccTitle,
1706
+ getAccDescription,
1707
+ setAccDescription,
1708
+ getConfig: /* @__PURE__ */ __name(() => getConfig2().c4, "getConfig"),
1709
+ clear,
1710
+ LINETYPE,
1711
+ ARROWTYPE,
1712
+ PLACEMENT,
1713
+ setTitle,
1714
+ setC4Type
1715
+ // apply,
1716
+ };
1717
+ var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
1718
+ return drawRect(elem, rectData);
1719
+ }, "drawRect");
1720
+ var drawImage = /* @__PURE__ */ __name(function(elem, width, height, x, y, link) {
1721
+ const imageElem = elem.append("image");
1722
+ imageElem.attr("width", width);
1723
+ imageElem.attr("height", height);
1724
+ imageElem.attr("x", x);
1725
+ imageElem.attr("y", y);
1726
+ let sanitizedLink = link.startsWith("data:image/png;base64") ? link : (0, import_sanitize_url.sanitizeUrl)(link);
1727
+ imageElem.attr("xlink:href", sanitizedLink);
1728
+ }, "drawImage");
1729
+ var drawRels = /* @__PURE__ */ __name((elem, rels2, conf2, diagramId) => {
1730
+ const relsElem = elem.append("g");
1731
+ let i = 0;
1732
+ for (let rel of rels2) {
1733
+ let textColor = rel.textColor ? rel.textColor : "#444444";
1734
+ let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
1735
+ let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
1736
+ let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
1737
+ let url = "";
1738
+ if (i === 0) {
1739
+ let line = relsElem.append("line");
1740
+ line.attr("x1", rel.startPoint.x);
1741
+ line.attr("y1", rel.startPoint.y);
1742
+ line.attr("x2", rel.endPoint.x);
1743
+ line.attr("y2", rel.endPoint.y);
1744
+ line.attr("stroke-width", "1");
1745
+ line.attr("stroke", strokeColor);
1746
+ line.style("fill", "none");
1747
+ if (rel.type !== "rel_b") {
1748
+ line.attr("marker-end", "url(" + url + "#" + diagramId + "-arrowhead)");
1749
+ }
1750
+ if (rel.type === "birel" || rel.type === "rel_b") {
1751
+ line.attr("marker-start", "url(" + url + "#" + diagramId + "-arrowend)");
1752
+ }
1753
+ i = -1;
1754
+ } else {
1755
+ let line = relsElem.append("path");
1756
+ line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
1757
+ "d",
1758
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
1759
+ "controlx",
1760
+ rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4
1761
+ ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y)
1762
+ );
1763
+ if (rel.type !== "rel_b") {
1764
+ line.attr("marker-end", "url(" + url + "#" + diagramId + "-arrowhead)");
1765
+ }
1766
+ if (rel.type === "birel" || rel.type === "rel_b") {
1767
+ line.attr("marker-start", "url(" + url + "#" + diagramId + "-arrowend)");
1768
+ }
1769
+ }
1770
+ let messageConf = conf2.messageFont();
1771
+ _drawTextCandidateFunc(conf2)(
1772
+ rel.label.text,
1773
+ relsElem,
1774
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1775
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY,
1776
+ rel.label.width,
1777
+ rel.label.height,
1778
+ { fill: textColor },
1779
+ messageConf
1780
+ );
1781
+ if (rel.techn && rel.techn.text !== "") {
1782
+ messageConf = conf2.messageFont();
1783
+ _drawTextCandidateFunc(conf2)(
1784
+ "[" + rel.techn.text + "]",
1785
+ relsElem,
1786
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1787
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY,
1788
+ Math.max(rel.label.width, rel.techn.width),
1789
+ rel.techn.height,
1790
+ { fill: textColor, "font-style": "italic" },
1791
+ messageConf
1792
+ );
1793
+ }
1794
+ }
1795
+ }, "drawRels");
1796
+ var drawBoundary = /* @__PURE__ */ __name(function(elem, boundary, conf2) {
1797
+ const boundaryElem = elem.append("g");
1798
+ let fillColor = boundary.bgColor ? boundary.bgColor : "none";
1799
+ let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
1800
+ let fontColor = boundary.fontColor ? boundary.fontColor : "black";
1801
+ let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
1802
+ if (boundary.nodeType) {
1803
+ attrsValue = { "stroke-width": 1 };
1804
+ }
1805
+ let rectData = {
1806
+ x: boundary.x,
1807
+ y: boundary.y,
1808
+ fill: fillColor,
1809
+ stroke: strokeColor,
1810
+ width: boundary.width,
1811
+ height: boundary.height,
1812
+ rx: 2.5,
1813
+ ry: 2.5,
1814
+ attrs: attrsValue
1815
+ };
1816
+ drawRect2(boundaryElem, rectData);
1817
+ let boundaryConf = conf2.boundaryFont();
1818
+ boundaryConf.fontWeight = "bold";
1819
+ boundaryConf.fontSize = boundaryConf.fontSize + 2;
1820
+ boundaryConf.fontColor = fontColor;
1821
+ _drawTextCandidateFunc(conf2)(
1822
+ boundary.label.text,
1823
+ boundaryElem,
1824
+ boundary.x,
1825
+ boundary.y + boundary.label.Y,
1826
+ boundary.width,
1827
+ boundary.height,
1828
+ { fill: "#444444" },
1829
+ boundaryConf
1830
+ );
1831
+ if (boundary.type && boundary.type.text !== "") {
1832
+ boundaryConf = conf2.boundaryFont();
1833
+ boundaryConf.fontColor = fontColor;
1834
+ _drawTextCandidateFunc(conf2)(
1835
+ boundary.type.text,
1836
+ boundaryElem,
1837
+ boundary.x,
1838
+ boundary.y + boundary.type.Y,
1839
+ boundary.width,
1840
+ boundary.height,
1841
+ { fill: "#444444" },
1842
+ boundaryConf
1843
+ );
1844
+ }
1845
+ if (boundary.descr && boundary.descr.text !== "") {
1846
+ boundaryConf = conf2.boundaryFont();
1847
+ boundaryConf.fontSize = boundaryConf.fontSize - 2;
1848
+ boundaryConf.fontColor = fontColor;
1849
+ _drawTextCandidateFunc(conf2)(
1850
+ boundary.descr.text,
1851
+ boundaryElem,
1852
+ boundary.x,
1853
+ boundary.y + boundary.descr.Y,
1854
+ boundary.width,
1855
+ boundary.height,
1856
+ { fill: "#444444" },
1857
+ boundaryConf
1858
+ );
1859
+ }
1860
+ }, "drawBoundary");
1861
+ var drawC4Shape = /* @__PURE__ */ __name(function(elem, c4Shape, conf2) {
1862
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"];
1863
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"];
1864
+ let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF";
1865
+ let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1866
+ switch (c4Shape.typeC4Shape.text) {
1867
+ case "person":
1868
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1869
+ break;
1870
+ case "external_person":
1871
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
1872
+ break;
1873
+ }
1874
+ const c4ShapeElem = elem.append("g");
1875
+ c4ShapeElem.attr("class", "person-man");
1876
+ const rect = getNoteRect();
1877
+ switch (c4Shape.typeC4Shape.text) {
1878
+ case "person":
1879
+ case "external_person":
1880
+ case "system":
1881
+ case "external_system":
1882
+ case "container":
1883
+ case "external_container":
1884
+ case "component":
1885
+ case "external_component":
1886
+ rect.x = c4Shape.x;
1887
+ rect.y = c4Shape.y;
1888
+ rect.fill = fillColor;
1889
+ rect.width = c4Shape.width;
1890
+ rect.height = c4Shape.height;
1891
+ rect.stroke = strokeColor;
1892
+ rect.rx = 2.5;
1893
+ rect.ry = 2.5;
1894
+ rect.attrs = { "stroke-width": 0.5 };
1895
+ drawRect2(c4ShapeElem, rect);
1896
+ break;
1897
+ case "system_db":
1898
+ case "external_system_db":
1899
+ case "container_db":
1900
+ case "external_container_db":
1901
+ case "component_db":
1902
+ case "external_component_db":
1903
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1904
+ "d",
1905
+ "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)
1906
+ );
1907
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1908
+ "d",
1909
+ "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)
1910
+ );
1911
+ break;
1912
+ case "system_queue":
1913
+ case "external_system_queue":
1914
+ case "container_queue":
1915
+ case "external_container_queue":
1916
+ case "component_queue":
1917
+ case "external_component_queue":
1918
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1919
+ "d",
1920
+ "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)
1921
+ );
1922
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1923
+ "d",
1924
+ "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)
1925
+ );
1926
+ break;
1927
+ }
1928
+ let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text);
1929
+ 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 + ">>");
1930
+ switch (c4Shape.typeC4Shape.text) {
1931
+ case "person":
1932
+ case "external_person":
1933
+ drawImage(
1934
+ c4ShapeElem,
1935
+ 48,
1936
+ 48,
1937
+ c4Shape.x + c4Shape.width / 2 - 24,
1938
+ c4Shape.y + c4Shape.image.Y,
1939
+ personImg
1940
+ );
1941
+ break;
1942
+ }
1943
+ let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1944
+ textFontConf.fontWeight = "bold";
1945
+ textFontConf.fontSize = textFontConf.fontSize + 2;
1946
+ textFontConf.fontColor = fontColor;
1947
+ _drawTextCandidateFunc(conf2)(
1948
+ c4Shape.label.text,
1949
+ c4ShapeElem,
1950
+ c4Shape.x,
1951
+ c4Shape.y + c4Shape.label.Y,
1952
+ c4Shape.width,
1953
+ c4Shape.height,
1954
+ { fill: fontColor },
1955
+ textFontConf
1956
+ );
1957
+ textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1958
+ textFontConf.fontColor = fontColor;
1959
+ if (c4Shape.techn && c4Shape.techn?.text !== "") {
1960
+ _drawTextCandidateFunc(conf2)(
1961
+ c4Shape.techn.text,
1962
+ c4ShapeElem,
1963
+ c4Shape.x,
1964
+ c4Shape.y + c4Shape.techn.Y,
1965
+ c4Shape.width,
1966
+ c4Shape.height,
1967
+ { fill: fontColor, "font-style": "italic" },
1968
+ textFontConf
1969
+ );
1970
+ } else if (c4Shape.type && c4Shape.type.text !== "") {
1971
+ _drawTextCandidateFunc(conf2)(
1972
+ c4Shape.type.text,
1973
+ c4ShapeElem,
1974
+ c4Shape.x,
1975
+ c4Shape.y + c4Shape.type.Y,
1976
+ c4Shape.width,
1977
+ c4Shape.height,
1978
+ { fill: fontColor, "font-style": "italic" },
1979
+ textFontConf
1980
+ );
1981
+ }
1982
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
1983
+ textFontConf = conf2.personFont();
1984
+ textFontConf.fontColor = fontColor;
1985
+ _drawTextCandidateFunc(conf2)(
1986
+ c4Shape.descr.text,
1987
+ c4ShapeElem,
1988
+ c4Shape.x,
1989
+ c4Shape.y + c4Shape.descr.Y,
1990
+ c4Shape.width,
1991
+ c4Shape.height,
1992
+ { fill: fontColor },
1993
+ textFontConf
1994
+ );
1995
+ }
1996
+ return c4Shape.height;
1997
+ }, "drawC4Shape");
1998
+ var insertDatabaseIcon = /* @__PURE__ */ __name(function(elem, id) {
1999
+ elem.append("defs").append("symbol").attr("id", id + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
2000
+ "d",
2001
+ "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"
2002
+ );
2003
+ }, "insertDatabaseIcon");
2004
+ var insertComputerIcon = /* @__PURE__ */ __name(function(elem, id) {
2005
+ elem.append("defs").append("symbol").attr("id", id + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
2006
+ "d",
2007
+ "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"
2008
+ );
2009
+ }, "insertComputerIcon");
2010
+ var insertClockIcon = /* @__PURE__ */ __name(function(elem, id) {
2011
+ elem.append("defs").append("symbol").attr("id", id + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
2012
+ "d",
2013
+ "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"
2014
+ );
2015
+ }, "insertClockIcon");
2016
+ var insertArrowHead = /* @__PURE__ */ __name(function(elem, id) {
2017
+ elem.append("defs").append("marker").attr("id", 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");
2018
+ }, "insertArrowHead");
2019
+ var insertArrowEnd = /* @__PURE__ */ __name(function(elem, id) {
2020
+ elem.append("defs").append("marker").attr("id", 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");
2021
+ }, "insertArrowEnd");
2022
+ var insertArrowFilledHead = /* @__PURE__ */ __name(function(elem, id) {
2023
+ elem.append("defs").append("marker").attr("id", 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");
2024
+ }, "insertArrowFilledHead");
2025
+ var insertArrowCrossHead = /* @__PURE__ */ __name(function(elem, id) {
2026
+ const defs = elem.append("defs");
2027
+ const marker = defs.append("marker").attr("id", id + "-crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
2028
+ 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");
2029
+ 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");
2030
+ }, "insertArrowCrossHead");
2031
+ var getC4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
2032
+ return {
2033
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
2034
+ fontSize: cnf[typeC4Shape + "FontSize"],
2035
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
2036
+ };
2037
+ }, "getC4ShapeFont");
2038
+ var _drawTextCandidateFunc = /* @__PURE__ */ function() {
2039
+ function byText(content, g, x, y, width, height, textAttrs) {
2040
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
2041
+ _setTextAttrs(text, textAttrs);
2042
+ }
2043
+ __name(byText, "byText");
2044
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
2045
+ const { fontSize, fontFamily, fontWeight } = conf2;
2046
+ const lines = content.split(common_default.lineBreakRegex);
2047
+ for (let i = 0; i < lines.length; i++) {
2048
+ const dy = i * fontSize - fontSize * (lines.length - 1) / 2;
2049
+ 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);
2050
+ text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical");
2051
+ _setTextAttrs(text, textAttrs);
2052
+ }
2053
+ }
2054
+ __name(byTspan, "byTspan");
2055
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
2056
+ const s = g.append("switch");
2057
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
2058
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2059
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
2060
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
2061
+ _setTextAttrs(text, textAttrs);
2062
+ }
2063
+ __name(byFo, "byFo");
2064
+ function _setTextAttrs(toText, fromTextAttrsDict) {
2065
+ for (const key in fromTextAttrsDict) {
2066
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
2067
+ toText.attr(key, fromTextAttrsDict[key]);
2068
+ }
2069
+ }
2070
+ }
2071
+ __name(_setTextAttrs, "_setTextAttrs");
2072
+ return function(conf2) {
2073
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
2074
+ };
2075
+ }();
2076
+ var svgDraw_default = {
2077
+ drawRect: drawRect2,
2078
+ drawBoundary,
2079
+ drawC4Shape,
2080
+ drawRels,
2081
+ drawImage,
2082
+ insertArrowHead,
2083
+ insertArrowEnd,
2084
+ insertArrowFilledHead,
2085
+ insertArrowCrossHead,
2086
+ insertDatabaseIcon,
2087
+ insertComputerIcon,
2088
+ insertClockIcon
2089
+ };
2090
+ var globalBoundaryMaxX = 0;
2091
+ var globalBoundaryMaxY = 0;
2092
+ var c4ShapeInRow2 = 4;
2093
+ var c4BoundaryInRow2 = 2;
2094
+ parser.yy = c4Db_default;
2095
+ var conf = {};
2096
+ var Bounds = class {
2097
+ static {
2098
+ __name(this, "Bounds");
2099
+ }
2100
+ constructor(diagObj) {
2101
+ this.name = "";
2102
+ this.data = {};
2103
+ this.data.startx = void 0;
2104
+ this.data.stopx = void 0;
2105
+ this.data.starty = void 0;
2106
+ this.data.stopy = void 0;
2107
+ this.data.widthLimit = void 0;
2108
+ this.nextData = {};
2109
+ this.nextData.startx = void 0;
2110
+ this.nextData.stopx = void 0;
2111
+ this.nextData.starty = void 0;
2112
+ this.nextData.stopy = void 0;
2113
+ this.nextData.cnt = 0;
2114
+ setConf(diagObj.db.getConfig());
2115
+ }
2116
+ setData(startx, stopx, starty, stopy) {
2117
+ this.nextData.startx = this.data.startx = startx;
2118
+ this.nextData.stopx = this.data.stopx = stopx;
2119
+ this.nextData.starty = this.data.starty = starty;
2120
+ this.nextData.stopy = this.data.stopy = stopy;
2121
+ }
2122
+ updateVal(obj, key, val, fun) {
2123
+ if (obj[key] === void 0) {
2124
+ obj[key] = val;
2125
+ } else {
2126
+ obj[key] = fun(val, obj[key]);
2127
+ }
2128
+ }
2129
+ insert(c4Shape) {
2130
+ this.nextData.cnt = this.nextData.cnt + 1;
2131
+ let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
2132
+ let _stopx = _startx + c4Shape.width;
2133
+ let _starty = this.nextData.starty + c4Shape.margin * 2;
2134
+ let _stopy = _starty + c4Shape.height;
2135
+ if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow2) {
2136
+ _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
2137
+ _starty = this.nextData.stopy + c4Shape.margin * 2;
2138
+ this.nextData.stopx = _stopx = _startx + c4Shape.width;
2139
+ this.nextData.starty = this.nextData.stopy;
2140
+ this.nextData.stopy = _stopy = _starty + c4Shape.height;
2141
+ this.nextData.cnt = 1;
2142
+ }
2143
+ c4Shape.x = _startx;
2144
+ c4Shape.y = _starty;
2145
+ this.updateVal(this.data, "startx", _startx, Math.min);
2146
+ this.updateVal(this.data, "starty", _starty, Math.min);
2147
+ this.updateVal(this.data, "stopx", _stopx, Math.max);
2148
+ this.updateVal(this.data, "stopy", _stopy, Math.max);
2149
+ this.updateVal(this.nextData, "startx", _startx, Math.min);
2150
+ this.updateVal(this.nextData, "starty", _starty, Math.min);
2151
+ this.updateVal(this.nextData, "stopx", _stopx, Math.max);
2152
+ this.updateVal(this.nextData, "stopy", _stopy, Math.max);
2153
+ }
2154
+ init(diagObj) {
2155
+ this.name = "";
2156
+ this.data = {
2157
+ startx: void 0,
2158
+ stopx: void 0,
2159
+ starty: void 0,
2160
+ stopy: void 0,
2161
+ widthLimit: void 0
2162
+ };
2163
+ this.nextData = {
2164
+ startx: void 0,
2165
+ stopx: void 0,
2166
+ starty: void 0,
2167
+ stopy: void 0,
2168
+ cnt: 0
2169
+ };
2170
+ setConf(diagObj.db.getConfig());
2171
+ }
2172
+ bumpLastMargin(margin) {
2173
+ this.data.stopx += margin;
2174
+ this.data.stopy += margin;
2175
+ }
2176
+ };
2177
+ var setConf = /* @__PURE__ */ __name(function(cnf) {
2178
+ assignWithDepth_default(conf, cnf);
2179
+ if (cnf.fontFamily) {
2180
+ conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
2181
+ }
2182
+ if (cnf.fontSize) {
2183
+ conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
2184
+ }
2185
+ if (cnf.fontWeight) {
2186
+ conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
2187
+ }
2188
+ }, "setConf");
2189
+ var c4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
2190
+ return {
2191
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
2192
+ fontSize: cnf[typeC4Shape + "FontSize"],
2193
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
2194
+ };
2195
+ }, "c4ShapeFont");
2196
+ var boundaryFont = /* @__PURE__ */ __name((cnf) => {
2197
+ return {
2198
+ fontFamily: cnf.boundaryFontFamily,
2199
+ fontSize: cnf.boundaryFontSize,
2200
+ fontWeight: cnf.boundaryFontWeight
2201
+ };
2202
+ }, "boundaryFont");
2203
+ var messageFont = /* @__PURE__ */ __name((cnf) => {
2204
+ return {
2205
+ fontFamily: cnf.messageFontFamily,
2206
+ fontSize: cnf.messageFontSize,
2207
+ fontWeight: cnf.messageFontWeight
2208
+ };
2209
+ }, "messageFont");
2210
+ function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
2211
+ if (!c4Shape[textType].width) {
2212
+ if (c4ShapeTextWrap) {
2213
+ c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
2214
+ c4Shape[textType].textLines = c4Shape[textType].text.split(common_default.lineBreakRegex).length;
2215
+ c4Shape[textType].width = textLimitWidth;
2216
+ c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
2217
+ } else {
2218
+ let lines = c4Shape[textType].text.split(common_default.lineBreakRegex);
2219
+ c4Shape[textType].textLines = lines.length;
2220
+ let lineHeight = 0;
2221
+ c4Shape[textType].height = 0;
2222
+ c4Shape[textType].width = 0;
2223
+ for (const line of lines) {
2224
+ c4Shape[textType].width = Math.max(
2225
+ calculateTextWidth(line, textConf),
2226
+ c4Shape[textType].width
2227
+ );
2228
+ lineHeight = calculateTextHeight(line, textConf);
2229
+ c4Shape[textType].height = c4Shape[textType].height + lineHeight;
2230
+ }
2231
+ }
2232
+ }
2233
+ }
2234
+ __name(calcC4ShapeTextWH, "calcC4ShapeTextWH");
2235
+ var drawBoundary2 = /* @__PURE__ */ __name(function(diagram2, boundary, bounds) {
2236
+ boundary.x = bounds.data.startx;
2237
+ boundary.y = bounds.data.starty;
2238
+ boundary.width = bounds.data.stopx - bounds.data.startx;
2239
+ boundary.height = bounds.data.stopy - bounds.data.starty;
2240
+ boundary.label.y = conf.c4ShapeMargin - 35;
2241
+ let boundaryTextWrap = boundary.wrap && conf.wrap;
2242
+ let boundaryLabelConf = boundaryFont(conf);
2243
+ boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
2244
+ boundaryLabelConf.fontWeight = "bold";
2245
+ let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
2246
+ calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
2247
+ svgDraw_default.drawBoundary(diagram2, boundary, conf);
2248
+ }, "drawBoundary");
2249
+ var drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) {
2250
+ let Y = 0;
2251
+ for (const c4ShapeKey of c4ShapeKeys) {
2252
+ Y = 0;
2253
+ const c4Shape = c4ShapeArray2[c4ShapeKey];
2254
+ let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2255
+ c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
2256
+ c4Shape.typeC4Shape.width = calculateTextWidth(
2257
+ "\xAB" + c4Shape.typeC4Shape.text + "\xBB",
2258
+ c4ShapeTypeConf
2259
+ );
2260
+ c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
2261
+ c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
2262
+ Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
2263
+ c4Shape.image = { width: 0, height: 0, Y: 0 };
2264
+ switch (c4Shape.typeC4Shape.text) {
2265
+ case "person":
2266
+ case "external_person":
2267
+ c4Shape.image.width = 48;
2268
+ c4Shape.image.height = 48;
2269
+ c4Shape.image.Y = Y;
2270
+ Y = c4Shape.image.Y + c4Shape.image.height;
2271
+ break;
2272
+ }
2273
+ if (c4Shape.sprite) {
2274
+ c4Shape.image.width = 48;
2275
+ c4Shape.image.height = 48;
2276
+ c4Shape.image.Y = Y;
2277
+ Y = c4Shape.image.Y + c4Shape.image.height;
2278
+ }
2279
+ let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
2280
+ let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
2281
+ let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2282
+ c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
2283
+ c4ShapeLabelConf.fontWeight = "bold";
2284
+ calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
2285
+ c4Shape.label.Y = Y + 8;
2286
+ Y = c4Shape.label.Y + c4Shape.label.height;
2287
+ if (c4Shape.type && c4Shape.type.text !== "") {
2288
+ c4Shape.type.text = "[" + c4Shape.type.text + "]";
2289
+ let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2290
+ calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
2291
+ c4Shape.type.Y = Y + 5;
2292
+ Y = c4Shape.type.Y + c4Shape.type.height;
2293
+ } else if (c4Shape.techn && c4Shape.techn.text !== "") {
2294
+ c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
2295
+ let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
2296
+ calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
2297
+ c4Shape.techn.Y = Y + 5;
2298
+ Y = c4Shape.techn.Y + c4Shape.techn.height;
2299
+ }
2300
+ let rectHeight = Y;
2301
+ let rectWidth = c4Shape.label.width;
2302
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
2303
+ let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2304
+ calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
2305
+ c4Shape.descr.Y = Y + 20;
2306
+ Y = c4Shape.descr.Y + c4Shape.descr.height;
2307
+ rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
2308
+ rectHeight = Y - c4Shape.descr.textLines * 5;
2309
+ }
2310
+ rectWidth = rectWidth + conf.c4ShapePadding;
2311
+ c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
2312
+ c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
2313
+ c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
2314
+ currentBounds.insert(c4Shape);
2315
+ svgDraw_default.drawC4Shape(diagram2, c4Shape, conf);
2316
+ }
2317
+ currentBounds.bumpLastMargin(conf.c4ShapeMargin);
2318
+ }, "drawC4ShapeArray");
2319
+ var Point = class {
2320
+ static {
2321
+ __name(this, "Point");
2322
+ }
2323
+ constructor(x, y) {
2324
+ this.x = x;
2325
+ this.y = y;
2326
+ }
2327
+ };
2328
+ var getIntersectPoint = /* @__PURE__ */ __name(function(fromNode, endPoint) {
2329
+ let x1 = fromNode.x;
2330
+ let y1 = fromNode.y;
2331
+ let x2 = endPoint.x;
2332
+ let y2 = endPoint.y;
2333
+ let fromCenterX = x1 + fromNode.width / 2;
2334
+ let fromCenterY = y1 + fromNode.height / 2;
2335
+ let dx = Math.abs(x1 - x2);
2336
+ let dy = Math.abs(y1 - y2);
2337
+ let tanDYX = dy / dx;
2338
+ let fromDYX = fromNode.height / fromNode.width;
2339
+ let returnPoint = null;
2340
+ if (y1 == y2 && x1 < x2) {
2341
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY);
2342
+ } else if (y1 == y2 && x1 > x2) {
2343
+ returnPoint = new Point(x1, fromCenterY);
2344
+ } else if (x1 == x2 && y1 < y2) {
2345
+ returnPoint = new Point(fromCenterX, y1 + fromNode.height);
2346
+ } else if (x1 == x2 && y1 > y2) {
2347
+ returnPoint = new Point(fromCenterX, y1);
2348
+ }
2349
+ if (x1 > x2 && y1 < y2) {
2350
+ if (fromDYX >= tanDYX) {
2351
+ returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2);
2352
+ } else {
2353
+ returnPoint = new Point(
2354
+ fromCenterX - dx / dy * fromNode.height / 2,
2355
+ y1 + fromNode.height
2356
+ );
2357
+ }
2358
+ } else if (x1 < x2 && y1 < y2) {
2359
+ if (fromDYX >= tanDYX) {
2360
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
2361
+ } else {
2362
+ returnPoint = new Point(
2363
+ fromCenterX + dx / dy * fromNode.height / 2,
2364
+ y1 + fromNode.height
2365
+ );
2366
+ }
2367
+ } else if (x1 < x2 && y1 > y2) {
2368
+ if (fromDYX >= tanDYX) {
2369
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
2370
+ } else {
2371
+ returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1);
2372
+ }
2373
+ } else if (x1 > x2 && y1 > y2) {
2374
+ if (fromDYX >= tanDYX) {
2375
+ returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX);
2376
+ } else {
2377
+ returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1);
2378
+ }
2379
+ }
2380
+ return returnPoint;
2381
+ }, "getIntersectPoint");
2382
+ var getIntersectPoints = /* @__PURE__ */ __name(function(fromNode, endNode) {
2383
+ let endIntersectPoint = { x: 0, y: 0 };
2384
+ endIntersectPoint.x = endNode.x + endNode.width / 2;
2385
+ endIntersectPoint.y = endNode.y + endNode.height / 2;
2386
+ let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
2387
+ endIntersectPoint.x = fromNode.x + fromNode.width / 2;
2388
+ endIntersectPoint.y = fromNode.y + fromNode.height / 2;
2389
+ let endPoint = getIntersectPoint(endNode, endIntersectPoint);
2390
+ return { startPoint, endPoint };
2391
+ }, "getIntersectPoints");
2392
+ var drawRels2 = /* @__PURE__ */ __name(function(diagram2, rels2, getC4ShapeObj, diagObj, diagramId) {
2393
+ let i = 0;
2394
+ for (let rel of rels2) {
2395
+ i = i + 1;
2396
+ let relTextWrap = rel.wrap && conf.wrap;
2397
+ let relConf = messageFont(conf);
2398
+ let diagramType = diagObj.db.getC4Type();
2399
+ if (diagramType === "C4Dynamic") {
2400
+ rel.label.text = i + ": " + rel.label.text;
2401
+ }
2402
+ let textLimitWidth = calculateTextWidth(rel.label.text, relConf);
2403
+ calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth);
2404
+ if (rel.techn && rel.techn.text !== "") {
2405
+ textLimitWidth = calculateTextWidth(rel.techn.text, relConf);
2406
+ calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth);
2407
+ }
2408
+ if (rel.descr && rel.descr.text !== "") {
2409
+ textLimitWidth = calculateTextWidth(rel.descr.text, relConf);
2410
+ calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth);
2411
+ }
2412
+ let fromNode = getC4ShapeObj(rel.from);
2413
+ let endNode = getC4ShapeObj(rel.to);
2414
+ let points = getIntersectPoints(fromNode, endNode);
2415
+ rel.startPoint = points.startPoint;
2416
+ rel.endPoint = points.endPoint;
2417
+ }
2418
+ svgDraw_default.drawRels(diagram2, rels2, conf, diagramId);
2419
+ }, "drawRels");
2420
+ function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
2421
+ let currentBounds = new Bounds(diagObj);
2422
+ currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow2, currentBoundaries.length);
2423
+ for (let [i, currentBoundary] of currentBoundaries.entries()) {
2424
+ let Y = 0;
2425
+ currentBoundary.image = { width: 0, height: 0, Y: 0 };
2426
+ if (currentBoundary.sprite) {
2427
+ currentBoundary.image.width = 48;
2428
+ currentBoundary.image.height = 48;
2429
+ currentBoundary.image.Y = Y;
2430
+ Y = currentBoundary.image.Y + currentBoundary.image.height;
2431
+ }
2432
+ let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
2433
+ let currentBoundaryLabelConf = boundaryFont(conf);
2434
+ currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
2435
+ currentBoundaryLabelConf.fontWeight = "bold";
2436
+ calcC4ShapeTextWH(
2437
+ "label",
2438
+ currentBoundary,
2439
+ currentBoundaryTextWrap,
2440
+ currentBoundaryLabelConf,
2441
+ currentBounds.data.widthLimit
2442
+ );
2443
+ currentBoundary.label.Y = Y + 8;
2444
+ Y = currentBoundary.label.Y + currentBoundary.label.height;
2445
+ if (currentBoundary.type && currentBoundary.type.text !== "") {
2446
+ currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
2447
+ let currentBoundaryTypeConf = boundaryFont(conf);
2448
+ calcC4ShapeTextWH(
2449
+ "type",
2450
+ currentBoundary,
2451
+ currentBoundaryTextWrap,
2452
+ currentBoundaryTypeConf,
2453
+ currentBounds.data.widthLimit
2454
+ );
2455
+ currentBoundary.type.Y = Y + 5;
2456
+ Y = currentBoundary.type.Y + currentBoundary.type.height;
2457
+ }
2458
+ if (currentBoundary.descr && currentBoundary.descr.text !== "") {
2459
+ let currentBoundaryDescrConf = boundaryFont(conf);
2460
+ currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
2461
+ calcC4ShapeTextWH(
2462
+ "descr",
2463
+ currentBoundary,
2464
+ currentBoundaryTextWrap,
2465
+ currentBoundaryDescrConf,
2466
+ currentBounds.data.widthLimit
2467
+ );
2468
+ currentBoundary.descr.Y = Y + 20;
2469
+ Y = currentBoundary.descr.Y + currentBoundary.descr.height;
2470
+ }
2471
+ if (i == 0 || i % c4BoundaryInRow2 === 0) {
2472
+ let _x = parentBounds.data.startx + conf.diagramMarginX;
2473
+ let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;
2474
+ currentBounds.setData(_x, _x, _y, _y);
2475
+ } else {
2476
+ let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
2477
+ let _y = currentBounds.data.starty;
2478
+ currentBounds.setData(_x, _x, _y, _y);
2479
+ }
2480
+ currentBounds.name = currentBoundary.alias;
2481
+ let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
2482
+ let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
2483
+ if (currentPersonOrSystemKeys.length > 0) {
2484
+ drawC4ShapeArray(
2485
+ currentBounds,
2486
+ diagram2,
2487
+ currentPersonOrSystemArray,
2488
+ currentPersonOrSystemKeys
2489
+ );
2490
+ }
2491
+ parentBoundaryAlias = currentBoundary.alias;
2492
+ let nextCurrentBoundaries = diagObj.db.getBoundaries(parentBoundaryAlias);
2493
+ if (nextCurrentBoundaries.length > 0) {
2494
+ drawInsideBoundary(
2495
+ diagram2,
2496
+ parentBoundaryAlias,
2497
+ currentBounds,
2498
+ nextCurrentBoundaries,
2499
+ diagObj
2500
+ );
2501
+ }
2502
+ if (currentBoundary.alias !== "global") {
2503
+ drawBoundary2(diagram2, currentBoundary, currentBounds);
2504
+ }
2505
+ parentBounds.data.stopy = Math.max(
2506
+ currentBounds.data.stopy + conf.c4ShapeMargin,
2507
+ parentBounds.data.stopy
2508
+ );
2509
+ parentBounds.data.stopx = Math.max(
2510
+ currentBounds.data.stopx + conf.c4ShapeMargin,
2511
+ parentBounds.data.stopx
2512
+ );
2513
+ globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
2514
+ globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
2515
+ }
2516
+ }
2517
+ __name(drawInsideBoundary, "drawInsideBoundary");
2518
+ var draw = /* @__PURE__ */ __name(function(_text, id, _version, diagObj) {
2519
+ conf = getConfig2().c4;
2520
+ const securityLevel = getConfig2().securityLevel;
2521
+ let sandboxElement;
2522
+ if (securityLevel === "sandbox") {
2523
+ sandboxElement = select_default("#i" + id);
2524
+ }
2525
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
2526
+ let db = diagObj.db;
2527
+ diagObj.db.setWrap(conf.wrap);
2528
+ c4ShapeInRow2 = db.getC4ShapeInRow();
2529
+ c4BoundaryInRow2 = db.getC4BoundaryInRow();
2530
+ log.debug(`C:${JSON.stringify(conf, null, 2)}`);
2531
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select_default(`[id="${id}"]`);
2532
+ svgDraw_default.insertComputerIcon(diagram2, id);
2533
+ svgDraw_default.insertDatabaseIcon(diagram2, id);
2534
+ svgDraw_default.insertClockIcon(diagram2, id);
2535
+ let screenBounds = new Bounds(diagObj);
2536
+ screenBounds.setData(
2537
+ conf.diagramMarginX,
2538
+ conf.diagramMarginX,
2539
+ conf.diagramMarginY,
2540
+ conf.diagramMarginY
2541
+ );
2542
+ screenBounds.data.widthLimit = screen.availWidth;
2543
+ globalBoundaryMaxX = conf.diagramMarginX;
2544
+ globalBoundaryMaxY = conf.diagramMarginY;
2545
+ const title2 = diagObj.db.getTitle();
2546
+ let currentBoundaries = diagObj.db.getBoundaries("");
2547
+ drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj);
2548
+ svgDraw_default.insertArrowHead(diagram2, id);
2549
+ svgDraw_default.insertArrowEnd(diagram2, id);
2550
+ svgDraw_default.insertArrowCrossHead(diagram2, id);
2551
+ svgDraw_default.insertArrowFilledHead(diagram2, id);
2552
+ drawRels2(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj, id);
2553
+ screenBounds.data.stopx = globalBoundaryMaxX;
2554
+ screenBounds.data.stopy = globalBoundaryMaxY;
2555
+ const box = screenBounds.data;
2556
+ let boxHeight = box.stopy - box.starty;
2557
+ let height = boxHeight + 2 * conf.diagramMarginY;
2558
+ let boxWidth = box.stopx - box.startx;
2559
+ const width = boxWidth + 2 * conf.diagramMarginX;
2560
+ if (title2) {
2561
+ diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
2562
+ }
2563
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
2564
+ const extraVertForTitle = title2 ? 60 : 0;
2565
+ diagram2.attr(
2566
+ "viewBox",
2567
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
2568
+ );
2569
+ log.debug(`models:`, box);
2570
+ }, "draw");
2571
+ var c4Renderer_default = {
2572
+ drawPersonOrSystemArray: drawC4ShapeArray,
2573
+ drawBoundary: drawBoundary2,
2574
+ setConf,
2575
+ draw
2576
+ };
2577
+ var getStyles = /* @__PURE__ */ __name((options) => `.person {
2578
+ stroke: ${options.personBorder};
2579
+ fill: ${options.personBkg};
2580
+ }
2581
+ `, "getStyles");
2582
+ var styles_default = getStyles;
2583
+ var diagram = {
2584
+ parser: c4Diagram_default,
2585
+ db: c4Db_default,
2586
+ renderer: c4Renderer_default,
2587
+ styles: styles_default,
2588
+ init: /* @__PURE__ */ __name(({ c4, wrap }) => {
2589
+ c4Renderer_default.setConf(c4);
2590
+ c4Db_default.setWrap(wrap);
2591
+ }, "init")
2592
+ };
2593
+ export {
2594
+ diagram
2595
+ };
2596
+ //# sourceMappingURL=c4Diagram-AHTNJAMY-C3FIQYXA.js.map