@ashwin_droid/notion-stream 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/{_baseUniq-DSwfPiGC.js → _baseUniq-D32sgNIc.js} +1 -1
  2. package/dist/{_baseUniq-CT-tc-CG.mjs → _baseUniq-DCnQIx8G.mjs} +51 -51
  3. package/dist/{arc-BBnIBs2j.js → arc-B0uBm0sN.js} +1 -1
  4. package/dist/{arc-DmoYXidQ.mjs → arc-OrNNmmBm.mjs} +1 -1
  5. package/dist/{architecture-U656AL7Q-C0ZB2O9M.js → architecture-U656AL7Q-CLYqYgyv.js} +1 -1
  6. package/dist/{architecture-U656AL7Q-CMPtJMZ-.mjs → architecture-U656AL7Q-seCMyeyz.mjs} +1 -1
  7. package/dist/architectureDiagram-VXUJARFQ-BGsDPmi_.js +36 -0
  8. package/dist/{architectureDiagram-VXUJARFQ-BYzpbF40.mjs → architectureDiagram-VXUJARFQ-BmPLNLcs.mjs} +1846 -1850
  9. package/dist/{blockDiagram-VD42YOAC-DPVTCHn5.mjs → blockDiagram-VD42YOAC-CXKvT-9-.mjs} +913 -922
  10. package/dist/blockDiagram-VD42YOAC-NQhzFvsO.js +122 -0
  11. package/dist/c4Diagram-YG6GDRKO-CMXx6pyB.js +10 -0
  12. package/dist/{c4Diagram-YG6GDRKO-C2Y4q08p.mjs → c4Diagram-YG6GDRKO-DAGMHESb.mjs} +169 -170
  13. package/dist/{channel-DVpqhnow.mjs → channel-BXGyzQA6.mjs} +1 -1
  14. package/dist/channel-Dw8BXC8D.js +1 -0
  15. package/dist/chunk-4BX2VUAB-MnK73C0-.js +1 -0
  16. package/dist/chunk-4BX2VUAB-ZaWvd3Xe.mjs +8 -0
  17. package/dist/{chunk-55IACEB6-P_FVKIbW.js → chunk-55IACEB6-B1EpdpVW.js} +1 -1
  18. package/dist/{chunk-55IACEB6-Du1Simcj.mjs → chunk-55IACEB6-iKbZBHA5.mjs} +1 -1
  19. package/dist/chunk-B4BG7PRW-Bo_sfBKL.js +165 -0
  20. package/dist/{chunk-B4BG7PRW-BUKsa2yH.mjs → chunk-B4BG7PRW-DgqSow4f.mjs} +251 -252
  21. package/dist/{chunk-DI55MBZ5-C9h0qLVI.mjs → chunk-DI55MBZ5-BAHL-2VJ.mjs} +444 -456
  22. package/dist/chunk-DI55MBZ5-BuuMLI1S.js +220 -0
  23. package/dist/{chunk-FMBD7UC4-C08-zA06.mjs → chunk-FMBD7UC4-BE8MbNLe.mjs} +1 -1
  24. package/dist/{chunk-FMBD7UC4-48-zdz-1.js → chunk-FMBD7UC4-Cs1BNv23.js} +1 -1
  25. package/dist/chunk-QN33PNHL-MX1ZMWu-.js +1 -0
  26. package/dist/chunk-QN33PNHL-ZaWv5vaA.mjs +19 -0
  27. package/dist/{chunk-QZHKN3VN-DbO6TJSK.mjs → chunk-QZHKN3VN-D2X7PBDi.mjs} +1 -1
  28. package/dist/{chunk-QZHKN3VN-Dy2264ui.js → chunk-QZHKN3VN-Db6mVb9M.js} +1 -1
  29. package/dist/{chunk-TZMSLE5B-BPmI9i6R.mjs → chunk-TZMSLE5B-AMFXF6mq.mjs} +20 -20
  30. package/dist/{chunk-TZMSLE5B-COENnLAZ.js → chunk-TZMSLE5B-CzjtACDr.js} +1 -1
  31. package/dist/{classDiagram-v2-WZHVMYZB-mzvV1Ifg.mjs → classDiagram-2ON5EDUG-CPwvtUDj.mjs} +2 -2
  32. package/dist/{classDiagram-2ON5EDUG-CFFwYK87.js → classDiagram-2ON5EDUG-UNrH9bQo.js} +1 -1
  33. package/dist/{classDiagram-2ON5EDUG-mzvV1Ifg.mjs → classDiagram-v2-WZHVMYZB-CPwvtUDj.mjs} +2 -2
  34. package/dist/{classDiagram-v2-WZHVMYZB-CFFwYK87.js → classDiagram-v2-WZHVMYZB-UNrH9bQo.js} +1 -1
  35. package/dist/{clone-KtLCwiKH.mjs → clone-CV4F8CSW.mjs} +1 -1
  36. package/dist/clone-HVsPHeK3.js +1 -0
  37. package/dist/{code-block-37QAKDTI-sxlq94xm.js → code-block-37QAKDTI-38K5Mxo2.js} +1 -1
  38. package/dist/{code-block-37QAKDTI-CmykMxjQ.mjs → code-block-37QAKDTI-Q-OOsw6q.mjs} +1 -1
  39. package/dist/cose-bilkent-S5V4N54A-1B77PywG.js +1 -0
  40. package/dist/{cose-bilkent-S5V4N54A-BXcldnso.mjs → cose-bilkent-S5V4N54A-greBbyuM.mjs} +592 -589
  41. package/dist/cytoscape.esm-CNUX3VTg.js +321 -0
  42. package/dist/{cytoscape.esm-ZmItrg9y.mjs → cytoscape.esm-Cvf3sx9F.mjs} +56 -83
  43. package/dist/dagre-6UL2VRFP-DEQXyXKh.js +4 -0
  44. package/dist/dagre-6UL2VRFP-DN5Inkgr.mjs +443 -0
  45. package/dist/diagram-PSM6KHXK-C7tjFZpr.js +24 -0
  46. package/dist/{diagram-PSM6KHXK-DIV3jw9d.mjs → diagram-PSM6KHXK-D-GS1fTc.mjs} +45 -48
  47. package/dist/{diagram-QEK2KX5R-Q0M2_YtR.mjs → diagram-QEK2KX5R-DJXBxeH4.mjs} +10 -14
  48. package/dist/diagram-QEK2KX5R-Doa8ooC_.js +43 -0
  49. package/dist/diagram-S2PKOQOG-BN04h93a.js +24 -0
  50. package/dist/{diagram-S2PKOQOG-_WGA6s2-.mjs → diagram-S2PKOQOG-BuPevKqw.mjs} +22 -23
  51. package/dist/erDiagram-Q2GNP2WA-AS2vnQKc.js +60 -0
  52. package/dist/{erDiagram-Q2GNP2WA-CW0D_QGb.mjs → erDiagram-Q2GNP2WA-DxOmvmqL.mjs} +77 -78
  53. package/dist/flowDiagram-NV44I4VS-BChiRwcp.js +162 -0
  54. package/dist/{flowDiagram-NV44I4VS-DVQ8Ntc4.mjs → flowDiagram-NV44I4VS-Cs_jC87H.mjs} +442 -449
  55. package/dist/{ganttDiagram-JELNMOA3-Bk-dX6qT.mjs → ganttDiagram-JELNMOA3-02b_-xyZ.mjs} +1049 -1041
  56. package/dist/ganttDiagram-JELNMOA3-BGy1b6TD.js +267 -0
  57. package/dist/{gitGraph-F6HP7TQM-CsdwxYUE.mjs → gitGraph-F6HP7TQM-BWm0SBV4.mjs} +1 -1
  58. package/dist/{gitGraph-F6HP7TQM-DvIgo2TM.js → gitGraph-F6HP7TQM-DVfckSNX.js} +1 -1
  59. package/dist/gitGraphDiagram-NY62KEGX-CfzoE07P.mjs +699 -0
  60. package/dist/gitGraphDiagram-NY62KEGX-Cm9ywQoW.js +65 -0
  61. package/dist/{graph-C_T4ZBuC.mjs → graph-DEu7-ZhH.mjs} +8 -8
  62. package/dist/{graph-BNpx6ebg.js → graph-Dw_87ii6.js} +1 -1
  63. package/dist/index-BwYOYPeK.js +670 -0
  64. package/dist/{index-oe4HpmeG.mjs → index-DH3CVXwD.mjs} +22541 -22646
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.js +1 -1
  67. package/dist/index.mjs +3 -3
  68. package/dist/{info-NVLQJR56-BwFQRguW.js → info-NVLQJR56-BpKxONZx.js} +1 -1
  69. package/dist/info-NVLQJR56-MmJP3L6S.mjs +5 -0
  70. package/dist/{infoDiagram-WHAUD3N6-C-gzsm95.mjs → infoDiagram-WHAUD3N6-Bfsucvti.mjs} +2 -2
  71. package/dist/{infoDiagram-WHAUD3N6-CCb5k_S7.js → infoDiagram-WHAUD3N6-q-yX3_By.js} +1 -1
  72. package/dist/journeyDiagram-XKPGCS4Q-BqtyHvQF.js +139 -0
  73. package/dist/{journeyDiagram-XKPGCS4Q-DzkUL_YG.mjs → journeyDiagram-XKPGCS4Q-dFRLmnr-.mjs} +24 -26
  74. package/dist/kanban-definition-3W4ZIXB7-DeOl9Eme.mjs +719 -0
  75. package/dist/kanban-definition-3W4ZIXB7-DraMxv75.js +89 -0
  76. package/dist/{layout-CuWQnP5Y.js → layout-BKTUO8WZ.js} +1 -1
  77. package/dist/{layout-Cd98WJ7r.mjs → layout-CpL-hYTa.mjs} +22 -22
  78. package/dist/{linear-SU4e8MRt.mjs → linear-CLwIU3di.mjs} +20 -20
  79. package/dist/{linear-DFDw13y6.js → linear-DvM229Di.js} +1 -1
  80. package/dist/mermaid-4DMBBIKO-BpqXz0_U.mjs +4 -0
  81. package/dist/{mermaid-4DMBBIKO-BihEtyib.js → mermaid-4DMBBIKO-Cd15t2pT.js} +1 -1
  82. package/dist/mermaid-parser.core-BVlc9Lqd.js +128 -0
  83. package/dist/{mermaid-parser.core-C8Sxzqul.mjs → mermaid-parser.core-CLAapB2-.mjs} +3404 -3369
  84. package/dist/{min-C2k771MZ.mjs → min--ML-ONY_.mjs} +2 -2
  85. package/dist/{min-CppMRDFn.js → min-BQ4NUvNf.js} +1 -1
  86. package/dist/{mindmap-definition-VGOIOE7T-BUd354uH.mjs → mindmap-definition-VGOIOE7T-78K_EDCb.mjs} +170 -172
  87. package/dist/mindmap-definition-VGOIOE7T-ZHY70ZzV.js +68 -0
  88. package/dist/notion-stream.css +1 -0
  89. package/dist/{ordinal-C0oynhte.mjs → ordinal-B-KqvkJf.mjs} +1 -1
  90. package/dist/{packet-BFZMPI3H-Cz_A86d3.mjs → packet-BFZMPI3H-B34lFb6T.mjs} +1 -1
  91. package/dist/{packet-BFZMPI3H-CFx3kSkL.js → packet-BFZMPI3H-C9xcJQVN.js} +1 -1
  92. package/dist/{pie-7BOR55EZ-_1MqisBd.js → pie-7BOR55EZ-Bz_jfTd_.js} +1 -1
  93. package/dist/pie-7BOR55EZ-DW2Zgje5.mjs +5 -0
  94. package/dist/{pieDiagram-ADFJNKIX-Bg0_gu43.js → pieDiagram-ADFJNKIX-CKzchAXU.js} +2 -2
  95. package/dist/{pieDiagram-ADFJNKIX-lRs_rpwI.mjs → pieDiagram-ADFJNKIX-Ctp6QR7f.mjs} +21 -21
  96. package/dist/quadrantDiagram-AYHSOK5B-D2Rt32D2.js +7 -0
  97. package/dist/{quadrantDiagram-AYHSOK5B-D9kypJt6.mjs → quadrantDiagram-AYHSOK5B-D3U_Qicu.mjs} +230 -232
  98. package/dist/{radar-NHE76QYJ-B-PvZD0K.mjs → radar-NHE76QYJ-CO5ECFHq.mjs} +1 -1
  99. package/dist/{radar-NHE76QYJ-CdtC4C8F.js → radar-NHE76QYJ-DI4PJJjm.js} +1 -1
  100. package/dist/requirementDiagram-UZGBJVZJ-CSgb6U9N.js +64 -0
  101. package/dist/{requirementDiagram-UZGBJVZJ-B5ulaHjE.mjs → requirementDiagram-UZGBJVZJ-Da_yWSD1.mjs} +190 -192
  102. package/dist/sankeyDiagram-TZEHDZUN-C8jpBnM0.js +10 -0
  103. package/dist/{sankeyDiagram-TZEHDZUN-DprIPFbe.mjs → sankeyDiagram-TZEHDZUN-Dp3Eyl8Q.mjs} +189 -189
  104. package/dist/sequenceDiagram-WL72ISMW-BZJ7d_X4.js +145 -0
  105. package/dist/{sequenceDiagram-WL72ISMW-B4m4oag0.mjs → sequenceDiagram-WL72ISMW-yJKe02sV.mjs} +222 -229
  106. package/dist/{stateDiagram-FKZM4ZOC-BD4tnS-V.js → stateDiagram-FKZM4ZOC-Cfuygt_P.js} +1 -1
  107. package/dist/{stateDiagram-FKZM4ZOC-DjkdDbQ2.mjs → stateDiagram-FKZM4ZOC-z0IX85WL.mjs} +4 -4
  108. package/dist/{stateDiagram-v2-4FDKWEC3-AK86F3i6.mjs → stateDiagram-v2-4FDKWEC3-BDMFqSat.mjs} +2 -2
  109. package/dist/{stateDiagram-v2-4FDKWEC3-sybMoxOk.js → stateDiagram-v2-4FDKWEC3-BiriAQkj.js} +1 -1
  110. package/dist/{timeline-definition-IT6M3QCI-BFuQEeZP.mjs → timeline-definition-IT6M3QCI-BmEq-RM3.mjs} +217 -223
  111. package/dist/timeline-definition-IT6M3QCI-CBmpRgUM.js +61 -0
  112. package/dist/{treemap-KMMF4GRG-gtrnY16v.mjs → treemap-KMMF4GRG-IaHP18r_.mjs} +1 -1
  113. package/dist/{treemap-KMMF4GRG-DTnRa789.js → treemap-KMMF4GRG-qP0VzKwW.js} +1 -1
  114. package/dist/{xychartDiagram-PRI3JC2R-CjXiy6m0.mjs → xychartDiagram-PRI3JC2R-BSaI76KX.mjs} +7 -7
  115. package/dist/xychartDiagram-PRI3JC2R-CQgij0Fy.js +7 -0
  116. package/package.json +5 -5
  117. package/dist/architectureDiagram-VXUJARFQ-BPQoZmaM.js +0 -36
  118. package/dist/blockDiagram-VD42YOAC-Z3Fc3Bew.js +0 -122
  119. package/dist/c4Diagram-YG6GDRKO-LzDuCZ2V.js +0 -10
  120. package/dist/channel-6dUO0MQi.js +0 -1
  121. package/dist/chunk-4BX2VUAB-BwubFldI.js +0 -1
  122. package/dist/chunk-4BX2VUAB-DldMXCTt.mjs +0 -9
  123. package/dist/chunk-B4BG7PRW-CKX0VJ-S.js +0 -165
  124. package/dist/chunk-DI55MBZ5-CMq-O8k2.js +0 -220
  125. package/dist/chunk-QN33PNHL-B0sO38bZ.js +0 -1
  126. package/dist/chunk-QN33PNHL-B_PGnTkk.mjs +0 -20
  127. package/dist/clone-B0UaPT2Z.js +0 -1
  128. package/dist/cose-bilkent-S5V4N54A-BCaAPmuF.js +0 -1
  129. package/dist/cytoscape.esm-DkGgpG6d.js +0 -331
  130. package/dist/dagre-6UL2VRFP-By42zbLA.mjs +0 -446
  131. package/dist/dagre-6UL2VRFP-DCwfkcWi.js +0 -4
  132. package/dist/diagram-PSM6KHXK-hjXN9n1N.js +0 -24
  133. package/dist/diagram-QEK2KX5R-B04ODMim.js +0 -43
  134. package/dist/diagram-S2PKOQOG-BmCs4MZE.js +0 -24
  135. package/dist/erDiagram-Q2GNP2WA-4KtQUUuI.js +0 -60
  136. package/dist/flowDiagram-NV44I4VS-BwpfJE0U.js +0 -162
  137. package/dist/ganttDiagram-JELNMOA3-D7rI7u8B.js +0 -267
  138. package/dist/gitGraphDiagram-NY62KEGX-BDTsbSkO.mjs +0 -712
  139. package/dist/gitGraphDiagram-NY62KEGX-IQ8KriUw.js +0 -65
  140. package/dist/index-CkYZRBYn.js +0 -676
  141. package/dist/info-NVLQJR56-B5gDnSIT.mjs +0 -5
  142. package/dist/journeyDiagram-XKPGCS4Q-POnSekz9.js +0 -139
  143. package/dist/kanban-definition-3W4ZIXB7-BPr0_7wG.mjs +0 -720
  144. package/dist/kanban-definition-3W4ZIXB7-Bm064qrf.js +0 -89
  145. package/dist/mermaid-4DMBBIKO-DDxvQcE9.mjs +0 -4
  146. package/dist/mermaid-parser.core-BHAgLMGa.js +0 -128
  147. package/dist/mindmap-definition-VGOIOE7T-CV7bD4HY.js +0 -68
  148. package/dist/pie-7BOR55EZ-B0-atE_o.mjs +0 -5
  149. package/dist/quadrantDiagram-AYHSOK5B-B4gVakRV.js +0 -7
  150. package/dist/requirementDiagram-UZGBJVZJ-0zMPj-SD.js +0 -64
  151. package/dist/sankeyDiagram-TZEHDZUN-Cl8-L83T.js +0 -10
  152. package/dist/sequenceDiagram-WL72ISMW-DRQn7Fe4.js +0 -145
  153. package/dist/timeline-definition-IT6M3QCI-2X4dfyLj.js +0 -61
  154. package/dist/xychartDiagram-PRI3JC2R-BaFd1In8.js +0 -7
@@ -1,9 +1,9 @@
1
- import { _ as w, K as te, L as ae, P as he, i as ue, l as J, bf as P, h as Y, e as pe, d as fe, y as ge, z as me, g as ye, s as Se, M as ve, bg as xe, D as be } from "./index-oe4HpmeG.mjs";
2
- import { s as we } from "./chunk-QN33PNHL-B_PGnTkk.mjs";
3
- import { p as Ce } from "./chunk-4BX2VUAB-DldMXCTt.mjs";
4
- import { p as Te } from "./mermaid-parser.core-C8Sxzqul.mjs";
1
+ import { _ as w, K as te, L as ae, P as he, i as ue, l as J, be as P, h as Y, e as pe, d as fe, y as ge, z as me, g as ye, s as Se, M as ve, bf as xe, D as be } from "./index-DH3CVXwD.mjs";
2
+ import { s as we } from "./chunk-QN33PNHL-ZaWv5vaA.mjs";
3
+ import { p as Ce } from "./chunk-4BX2VUAB-ZaWvd3Xe.mjs";
4
+ import { p as Te } from "./mermaid-parser.core-CLAapB2-.mjs";
5
5
  import { b as O } from "./defaultLocale-BgPVtth8.mjs";
6
- import { o as Z } from "./ordinal-C0oynhte.mjs";
6
+ import { o as Z } from "./ordinal-B-KqvkJf.mjs";
7
7
  function Le(t) {
8
8
  var a = 0, l = t.children, n = l && l.length;
9
9
  if (!n) a = 1;
@@ -182,14 +182,14 @@ function Ue(t, a, l, n, o, s) {
182
182
  }
183
183
  return d;
184
184
  }
185
- const Ze = function t(a) {
185
+ const Ze = (function t(a) {
186
186
  function l(n, o, s, d, h) {
187
187
  Ue(a, n, o, s, d, h);
188
188
  }
189
189
  return l.ratio = function(n) {
190
190
  return t((n = +n) > 1 ? n : 1);
191
191
  }, l;
192
- }(Ke);
192
+ })(Ke);
193
193
  function Je() {
194
194
  var t = Ze, a = !1, l = 1, n = 1, o = [0], s = G, d = G, h = G, g = G, c = G;
195
195
  function u(r) {
@@ -236,7 +236,7 @@ var R, ne = (R = class {
236
236
  });
237
237
  }
238
238
  addNode(a, l) {
239
- this.nodes.push(a), this.levels.set(a, l), l === 0 && (this.outerNodes.push(a), this.root ?? (this.root = a));
239
+ this.nodes.push(a), this.levels.set(a, l), l === 0 && (this.outerNodes.push(a), this.root ??= a);
240
240
  }
241
241
  getRoot() {
242
242
  return { name: "", children: this.outerNodes };
@@ -244,15 +244,14 @@ var R, ne = (R = class {
244
244
  addClass(a, l) {
245
245
  const n = this.classes.get(a) ?? { id: a, styles: [], textStyles: [] }, o = l.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
246
246
  o && o.forEach((s) => {
247
- xe(s) && (n != null && n.textStyles ? n.textStyles.push(s) : n.textStyles = [s]), n != null && n.styles ? n.styles.push(s) : n.styles = [s];
247
+ xe(s) && (n?.textStyles ? n.textStyles.push(s) : n.textStyles = [s]), n?.styles ? n.styles.push(s) : n.styles = [s];
248
248
  }), this.classes.set(a, n);
249
249
  }
250
250
  getClasses() {
251
251
  return this.classes;
252
252
  }
253
253
  getStylesForClass(a) {
254
- var l;
255
- return ((l = this.classes.get(a)) == null ? void 0 : l.styles) ?? [];
254
+ return this.classes.get(a)?.styles ?? [];
256
255
  }
257
256
  clear() {
258
257
  be(), this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.root = void 0;
@@ -267,7 +266,7 @@ function le(t) {
267
266
  name: n.name,
268
267
  children: n.type === "Leaf" ? void 0 : []
269
268
  };
270
- for (o.classSelector = n == null ? void 0 : n.classSelector, n != null && n.cssCompiledStyles && (o.cssCompiledStyles = [n.cssCompiledStyles]), n.type === "Leaf" && n.value !== void 0 && (o.value = n.value); l.length > 0 && l[l.length - 1].level >= n.level; )
269
+ for (o.classSelector = n?.classSelector, n?.cssCompiledStyles && (o.cssCompiledStyles = [n.cssCompiledStyles]), n.type === "Leaf" && n.value !== void 0 && (o.value = n.value); l.length > 0 && l[l.length - 1].level >= n.level; )
271
270
  l.pop();
272
271
  if (l.length === 0)
273
272
  a.push(o);
@@ -307,18 +306,17 @@ var Qe = /* @__PURE__ */ w((t, a) => {
307
306
  // @ts-expect-error - TreeMapDB is not assignable to DiagramDB
308
307
  parser: { yy: void 0 },
309
308
  parse: /* @__PURE__ */ w(async (t) => {
310
- var a;
311
309
  try {
312
- const n = await Te("treemap", t);
313
- J.debug("Treemap AST:", n);
314
- const o = (a = re.parser) == null ? void 0 : a.yy;
315
- if (!(o instanceof ne))
310
+ const l = await Te("treemap", t);
311
+ J.debug("Treemap AST:", l);
312
+ const n = re.parser?.yy;
313
+ if (!(n instanceof ne))
316
314
  throw new Error(
317
315
  "parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
318
316
  );
319
- Qe(n, o);
320
- } catch (l) {
321
- throw J.error("Error parsing treemap:", l), l;
317
+ Qe(l, n);
318
+ } catch (a) {
319
+ throw J.error("Error parsing treemap:", a), a;
322
320
  }
323
321
  }, "parse")
324
322
  }, tt = 10, B = 10, X = 25, at = /* @__PURE__ */ w((t, a, l, n) => {
@@ -404,19 +402,18 @@ var Qe = /* @__PURE__ */ w((t, a) => {
404
402
  return;
405
403
  const i = Y(this), f = e.data.name;
406
404
  i.text(f);
407
- const C = e.x1 - e.x0, $ = 6;
408
- let A;
409
- s.showValues !== !1 && e.value ? A = C - 10 - 30 - 10 - $ : A = C - $ - 6;
410
- const F = Math.max(15, A), y = i.node();
411
- if (y.getComputedTextLength() > F) {
412
- const T = "...";
413
- let L = f;
414
- for (; L.length > 0; ) {
415
- if (L = f.substring(0, L.length - 1), L.length === 0) {
416
- i.text(T), y.getComputedTextLength() > F && i.text("");
405
+ const C = e.x1 - e.x0, L = 6;
406
+ let $;
407
+ s.showValues !== !1 && e.value ? $ = C - 10 - 30 - 10 - L : $ = C - L - 6;
408
+ const A = Math.max(15, $), y = i.node();
409
+ if (y.getComputedTextLength() > A) {
410
+ let T = f;
411
+ for (; T.length > 0; ) {
412
+ if (T = f.substring(0, T.length - 1), T.length === 0) {
413
+ i.text("..."), y.getComputedTextLength() > A && i.text("");
417
414
  break;
418
415
  }
419
- if (i.text(L + T), y.getComputedTextLength() <= F)
416
+ if (i.text(T + "..."), y.getComputedTextLength() <= A)
420
417
  break;
421
418
  }
422
419
  }
@@ -431,25 +428,25 @@ var Qe = /* @__PURE__ */ w((t, a) => {
431
428
  const i = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + k(e.data.name) + ";", f = P({ cssCompiledStyles: e.data.cssCompiledStyles });
432
429
  return i + f.labelStyles.replace("color:", "fill:");
433
430
  }).attr("clip-path", (e, i) => `url(#clip-${a}-${i})`).text((e) => e.data.name).each(function(e) {
434
- const i = Y(this), f = e.x1 - e.x0, C = e.y1 - e.y0, $ = i.node(), A = 4, D = f - 2 * A, F = C - 2 * A;
435
- if (D < 10 || F < 10) {
431
+ const i = Y(this), f = e.x1 - e.x0, C = e.y1 - e.y0, L = i.node(), $ = 4, D = f - 2 * $, A = C - 2 * $;
432
+ if (D < 10 || A < 10) {
436
433
  i.style("display", "none");
437
434
  return;
438
435
  }
439
436
  let y = parseInt(i.style("font-size"), 10);
440
- const _ = 8, T = 28, L = 0.6, z = 6, H = 2;
441
- for (; $.getComputedTextLength() > D && y > _; )
437
+ const _ = 8, F = 28, T = 0.6, z = 6, H = 2;
438
+ for (; L.getComputedTextLength() > D && y > _; )
442
439
  y--, i.style("font-size", `${y}px`);
443
440
  let I = Math.max(
444
441
  z,
445
- Math.min(T, Math.round(y * L))
442
+ Math.min(F, Math.round(y * T))
446
443
  ), U = y + H + I;
447
- for (; U > F && y > _ && (y--, I = Math.max(
444
+ for (; U > A && y > _ && (y--, I = Math.max(
448
445
  z,
449
- Math.min(T, Math.round(y * L))
446
+ Math.min(F, Math.round(y * T))
450
447
  ), !(I < z && y === _)); )
451
448
  i.style("font-size", `${y}px`), U = y + H + I;
452
- i.style("font-size", `${y}px`), ($.getComputedTextLength() > D || y < _ || F < y) && i.style("display", "none");
449
+ i.style("font-size", `${y}px`), (L.getComputedTextLength() > D || y < _ || A < y) && i.style("display", "none");
453
450
  }), s.showValues !== !1 && j.append("text").attr("class", "treemapValue").attr("x", (i) => (i.x1 - i.x0) / 2).attr("y", function(i) {
454
451
  return (i.y1 - i.y0) / 2;
455
452
  }).attr("style", (i) => {
@@ -461,23 +458,23 @@ var Qe = /* @__PURE__ */ w((t, a) => {
461
458
  f.style("display", "none");
462
459
  return;
463
460
  }
464
- const $ = Y(C).select(".treemapLabel");
465
- if ($.empty() || $.style("display") === "none") {
461
+ const L = Y(C).select(".treemapLabel");
462
+ if (L.empty() || L.style("display") === "none") {
466
463
  f.style("display", "none");
467
464
  return;
468
465
  }
469
- const A = parseFloat($.style("font-size")), D = 28, F = 0.6, y = 6, _ = 2, T = Math.max(
466
+ const $ = parseFloat(L.style("font-size")), D = 28, A = 0.6, y = 6, _ = 2, F = Math.max(
470
467
  y,
471
- Math.min(D, Math.round(A * F))
468
+ Math.min(D, Math.round($ * A))
472
469
  );
473
- f.style("font-size", `${T}px`);
474
- const z = (i.y1 - i.y0) / 2 + A / 2 + _;
470
+ f.style("font-size", `${F}px`);
471
+ const z = (i.y1 - i.y0) / 2 + $ / 2 + _;
475
472
  f.attr("y", z);
476
- const H = i.x1 - i.x0, ce = i.y1 - i.y0 - 4, de = H - 2 * 4;
477
- f.node().getComputedTextLength() > de || z + T > ce || T < y ? f.style("display", "none") : f.style("display", null);
473
+ const H = i.x1 - i.x0, ce = i.y1 - i.y0 - 4, de = H - 8;
474
+ f.node().getComputedTextLength() > de || z + F > ce || F < y ? f.style("display", "none") : f.style("display", null);
478
475
  });
479
476
  const oe = s.diagramPadding ?? 8;
480
- we(b, oe, "flowchart", (s == null ? void 0 : s.useMaxWidth) || !1);
477
+ we(b, oe, "flowchart", s?.useMaxWidth || !1);
481
478
  }, "draw"), nt = /* @__PURE__ */ w(function(t, a) {
482
479
  return a.db.getClasses();
483
480
  }, "getClasses"), lt = { draw: at, getClasses: nt }, rt = {
@@ -1,6 +1,6 @@
1
- import { _ as l, s as k, g as R, z as I, y as _, d as D, e as E, P as F, D as P, K as f, L as C, M as z, l as G, a6 as V } from "./index-oe4HpmeG.mjs";
2
- import { p as W } from "./chunk-4BX2VUAB-DldMXCTt.mjs";
3
- import { p as B } from "./mermaid-parser.core-C8Sxzqul.mjs";
1
+ import { _ as l, s as k, g as R, z as I, y as _, d as D, e as E, P as F, D as P, K as f, L as C, M as z, l as G, a6 as V } from "./index-DH3CVXwD.mjs";
2
+ import { p as W } from "./chunk-4BX2VUAB-ZaWvd3Xe.mjs";
3
+ import { p as B } from "./mermaid-parser.core-CLAapB2-.mjs";
4
4
  var x = {
5
5
  showLegend: !0,
6
6
  ticks: 5,
@@ -32,26 +32,22 @@ var x = {
32
32
  if (t.length === 0)
33
33
  throw new Error("Axes must be populated before curves for reference entries");
34
34
  return t.map((e) => {
35
- const r = a.find((s) => {
36
- var o;
37
- return ((o = s.axis) == null ? void 0 : o.$refText) === e.name;
38
- });
35
+ const r = a.find((s) => s.axis?.$refText === e.name);
39
36
  if (r === void 0)
40
37
  throw new Error("Missing entry for axis " + e.label);
41
38
  return r.value;
42
39
  });
43
40
  }, "computeCurveEntries"), Z = /* @__PURE__ */ l((a) => {
44
- var e, r, s, o, i;
45
41
  const t = a.reduce(
46
- (n, c) => (n[c.name] = c, n),
42
+ (e, r) => (e[r.name] = r, e),
47
43
  {}
48
44
  );
49
45
  h.options = {
50
- showLegend: ((e = t.showLegend) == null ? void 0 : e.value) ?? x.showLegend,
51
- ticks: ((r = t.ticks) == null ? void 0 : r.value) ?? x.ticks,
52
- max: ((s = t.max) == null ? void 0 : s.value) ?? x.max,
53
- min: ((o = t.min) == null ? void 0 : o.value) ?? x.min,
54
- graticule: ((i = t.graticule) == null ? void 0 : i.value) ?? x.graticule
46
+ showLegend: t.showLegend?.value ?? x.showLegend,
47
+ ticks: t.ticks?.value ?? x.ticks,
48
+ max: t.max?.value ?? x.max,
49
+ min: t.min?.value ?? x.min,
50
+ graticule: t.graticule?.value ?? x.graticule
55
51
  };
56
52
  }, "setOptions"), q = /* @__PURE__ */ l(() => {
57
53
  P(), h = structuredClone(w);
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-BwYOYPeK.js"),L=require("./chunk-4BX2VUAB-MnK73C0-.js"),O=require("./mermaid-parser.core-BVlc9Lqd.js");var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y={axes:[],curves:[],options:h},p=structuredClone(y),S=n.defaultConfig_default.radar,k=n.__name(()=>n.cleanAndMerge({...S,...n.getConfig().radar}),"getConfig"),f=n.__name(()=>p.axes,"getAxes"),D=n.__name(()=>p.curves,"getCurves"),R=n.__name(()=>p.options,"getOptions"),I=n.__name(a=>{p.axes=a.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),E=n.__name(a=>{p.curves=a.map(e=>({name:e.name,label:e.label??e.name,entries:F(e.entries)}))},"setCurves"),F=n.__name(a=>{if(a[0].axis==null)return a.map(t=>t.value);const e=f();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(t=>{const r=a.find(s=>s.axis?.$refText===t.name);if(r===void 0)throw new Error("Missing entry for axis "+t.label);return r.value})},"computeCurveEntries"),P=n.__name(a=>{const e=a.reduce((t,r)=>(t[r.name]=r,t),{});p.options={showLegend:e.showLegend?.value??h.showLegend,ticks:e.ticks?.value??h.ticks,max:e.max?.value??h.max,min:e.min?.value??h.min,graticule:e.graticule?.value??h.graticule}},"setOptions"),G=n.__name(()=>{n.clear(),p=structuredClone(y)},"clear"),_={getAxes:f,getCurves:D,getOptions:R,setAxes:I,setCurves:E,setOptions:P,getConfig:k,clear:G,setAccTitle:n.setAccTitle,getAccTitle:n.getAccTitle,setDiagramTitle:n.setDiagramTitle,getDiagramTitle:n.getDiagramTitle,getAccDescription:n.getAccDescription,setAccDescription:n.setAccDescription},z=n.__name(a=>{L.populateCommonDb(a,_);const{axes:e,curves:t,options:r}=a;_.setAxes(e),_.setCurves(t),_.setOptions(r)},"populate"),B={parse:n.__name(async a=>{const e=await O.parse("radar",a);n.log.debug(e),z(e)},"parse")},V=n.__name((a,e,t,r)=>{const s=r.db,o=s.getAxes(),l=s.getCurves(),i=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),m=n.selectSvgElement(e),u=W(m,c),g=i.max??Math.max(...l.map($=>Math.max(...$.entries))),x=i.min,v=Math.min(c.width,c.height)/2;j(u,o,v,i.ticks,i.graticule),q(u,o,v,c),C(u,o,l,x,g,i.graticule,c),A(u,l,i.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),W=n.__name((a,e)=>{const t=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,s={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return a.attr("viewbox",`0 0 ${t} ${r}`).attr("width",t).attr("height",r),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),j=n.__name((a,e,t,r,s)=>{if(s==="circle")for(let o=0;o<r;o++){const l=t*(o+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const o=e.length;for(let l=0;l<r;l++){const i=t*(l+1)/r,c=e.map((d,m)=>{const u=2*m*Math.PI/o-Math.PI/2,g=i*Math.cos(u),x=i*Math.sin(u);return`${g},${x}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),q=n.__name((a,e,t,r)=>{const s=e.length;for(let o=0;o<s;o++){const l=e[o].label,i=2*o*Math.PI/s-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",t*r.axisScaleFactor*Math.cos(i)).attr("y2",t*r.axisScaleFactor*Math.sin(i)).attr("class","radarAxisLine"),a.append("text").text(l).attr("x",t*r.axisLabelFactor*Math.cos(i)).attr("y",t*r.axisLabelFactor*Math.sin(i)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,e,t,r,s,o,l){const i=e.length,c=Math.min(l.width,l.height)/2;t.forEach((d,m)=>{if(d.entries.length!==i)return;const u=d.entries.map((g,x)=>{const v=2*Math.PI*x/i-Math.PI/2,$=w(g,r,s,c),M=$*Math.cos(v),T=$*Math.sin(v);return{x:M,y:T}});o==="circle"?a.append("path").attr("d",b(u,l.curveTension)).attr("class",`radarCurve-${m}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}n.__name(C,"drawCurves");function w(a,e,t,r){const s=Math.min(Math.max(a,e),t);return r*(s-e)/(t-e)}n.__name(w,"relativeRadius");function b(a,e){const t=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<t;s++){const o=a[(s-1+t)%t],l=a[s],i=a[(s+1)%t],c=a[(s+2)%t],d={x:l.x+(i.x-o.x)*e,y:l.y+(i.y-o.y)*e},m={x:i.x-(c.x-l.x)*e,y:i.y-(c.y-l.y)*e};r+=` C${d.x},${d.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${r} Z`}n.__name(b,"closedRoundCurve");function A(a,e,t,r){if(!t)return;const s=(r.width/2+r.marginRight)*3/4,o=-(r.height/2+r.marginTop)*3/4,l=20;e.forEach((i,c)=>{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}n.__name(A,"drawLegend");var H={draw:V},U=n.__name((a,e)=>{let t="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];t+=`
2
+ .radarCurve-${r} {
3
+ color: ${s};
4
+ fill: ${s};
5
+ fill-opacity: ${e.curveOpacity};
6
+ stroke: ${s};
7
+ stroke-width: ${e.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${s};
11
+ fill-opacity: ${e.curveOpacity};
12
+ stroke: ${s};
13
+ }
14
+ `}return t},"genIndexStyles"),X=n.__name(a=>{const e=n.getThemeVariables3(),t=n.getConfig(),r=n.cleanAndMerge(e,t.themeVariables),s=n.cleanAndMerge(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),N=n.__name(({radar:a}={})=>{const{themeVariables:e,radarOptions:t}=X(a);return`
15
+ .radarTitle {
16
+ font-size: ${e.fontSize};
17
+ color: ${e.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${t.axisColor};
23
+ stroke-width: ${t.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ dominant-baseline: middle;
27
+ text-anchor: middle;
28
+ font-size: ${t.axisLabelFontSize}px;
29
+ color: ${t.axisColor};
30
+ }
31
+ .radarGraticule {
32
+ fill: ${t.graticuleColor};
33
+ fill-opacity: ${t.graticuleOpacity};
34
+ stroke: ${t.graticuleColor};
35
+ stroke-width: ${t.graticuleStrokeWidth};
36
+ }
37
+ .radarLegendText {
38
+ text-anchor: start;
39
+ font-size: ${t.legendFontSize}px;
40
+ dominant-baseline: hanging;
41
+ }
42
+ ${U(e,t)}
43
+ `},"styles"),Y={parser:B,db:_,renderer:H,styles:N};exports.diagram=Y;
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-BwYOYPeK.js"),y=require("./chunk-4BX2VUAB-MnK73C0-.js"),B=require("./mermaid-parser.core-BVlc9Lqd.js");var $=a.defaultConfig_default.packet,b,m=(b=class{constructor(){this.packet=[],this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getAccDescription=a.getAccDescription,this.setAccDescription=a.setAccDescription}getConfig(){const t=a.cleanAndMerge({...$,...a.getConfig().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){a.clear(),this.packet=[]}},a.__name(b,"PacketDB"),b),C=1e4,_=a.__name((e,t)=>{y.populateCommonDb(e,t);let o=-1,i=[],l=1;const{bitsPerRow:c}=t.getConfig();for(let{start:r,end:n,bits:p,label:d}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??=o+1,r!==o+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${o+1}.`);if(p===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??=r+(p??1)-1,p??=n-r+1,o=n,a.log.debug(`Packet block ${r} - ${o} with label ${d}`);i.length<=c+1&&t.getPacket().length<C;){const[g,s]=S({start:r,end:n,bits:p,label:d},l,c);if(i.push(g),g.end+1===l*c&&(t.pushWord(i),i=[],l++),!s)break;({start:r,end:n,bits:p,label:d}=s)}}t.pushWord(i)},"populate"),S=a.__name((e,t,o)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*o)return[e,void 0];const i=t*o-1,l=t*o;return[{start:e.start,end:i,label:e.label,bits:i-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),w={parser:{yy:void 0},parse:a.__name(async e=>{const t=await B.parse("packet",e),o=w.parser?.yy;if(!(o instanceof m))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");a.log.debug(t),_(t,o)},"parse")},P=a.__name((e,t,o,i)=>{const l=i.db,c=l.getConfig(),{rowHeight:r,paddingY:n,bitWidth:p,bitsPerRow:d}=c,g=l.getPacket(),s=l.getDiagramTitle(),k=r+n,h=k*(g.length+1)-(s?0:r),f=p*d+2,u=a.selectSvgElement(t);u.attr("viewbox",`0 0 ${f} ${h}`),a.configureSvgSize(u,h,f,c.useMaxWidth);for(const[v,x]of g.entries())T(u,x,v,c);u.append("text").text(s).attr("x",f/2).attr("y",h-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),T=a.__name((e,t,o,{rowHeight:i,paddingX:l,paddingY:c,bitWidth:r,bitsPerRow:n,showBits:p})=>{const d=e.append("g"),g=o*(i+c)+c;for(const s of t){const k=s.start%n*r+1,h=(s.end-s.start+1)*r-l;if(d.append("rect").attr("x",k).attr("y",g).attr("width",h).attr("height",i).attr("class","packetBlock"),d.append("text").attr("x",k+h/2).attr("y",g+i/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!p)continue;const f=s.end===s.start,u=g-2;d.append("text").attr("x",k+(f?h/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",f?"middle":"start").text(s.start),f||d.append("text").attr("x",k+h).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),D={draw:P},A={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=a.__name(({packet:e}={})=>{const t=a.cleanAndMerge(A,e);return`
2
+ .packetByte {
3
+ font-size: ${t.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${t.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${t.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${t.labelColor};
13
+ font-size: ${t.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${t.titleColor};
17
+ font-size: ${t.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${t.blockStrokeColor};
21
+ stroke-width: ${t.blockStrokeWidth};
22
+ fill: ${t.blockFillColor};
23
+ }
24
+ `},"styles"),E={parser:w,get db(){return new m},renderer:D,styles:z};exports.diagram=E;
@@ -1,6 +1,6 @@
1
- import { _ as b, K as m, P as B, i as C, l as w, e as S, d as D, y as P, z as T, g as z, s as E, L as F, M as A, D as W } from "./index-oe4HpmeG.mjs";
2
- import { p as _ } from "./chunk-4BX2VUAB-DldMXCTt.mjs";
3
- import { p as L } from "./mermaid-parser.core-C8Sxzqul.mjs";
1
+ import { _ as b, K as m, P as B, i as C, l as w, e as S, d as D, y as P, z as T, g as z, s as E, L as F, M as A, D as W } from "./index-DH3CVXwD.mjs";
2
+ import { p as _ } from "./chunk-4BX2VUAB-ZaWvd3Xe.mjs";
3
+ import { p as L } from "./mermaid-parser.core-CLAapB2-.mjs";
4
4
  var M = A.packet, u, v = (u = class {
5
5
  constructor() {
6
6
  this.packet = [], this.setAccTitle = S, this.getAccTitle = D, this.setDiagramTitle = P, this.getDiagramTitle = T, this.getAccDescription = z, this.setAccDescription = E;
@@ -23,41 +23,41 @@ var M = A.packet, u, v = (u = class {
23
23
  }
24
24
  }, b(u, "PacketDB"), u), N = 1e4, Y = /* @__PURE__ */ b((e, t) => {
25
25
  _(e, t);
26
- let s = -1, r = [], n = 1;
26
+ let r = -1, s = [], n = 1;
27
27
  const { bitsPerRow: l } = t.getConfig();
28
28
  for (let { start: a, end: i, bits: d, label: c } of e.blocks) {
29
29
  if (a !== void 0 && i !== void 0 && i < a)
30
30
  throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);
31
- if (a ?? (a = s + 1), a !== s + 1)
31
+ if (a ??= r + 1, a !== r + 1)
32
32
  throw new Error(
33
- `Packet block ${a} - ${i ?? a} is not contiguous. It should start from ${s + 1}.`
33
+ `Packet block ${a} - ${i ?? a} is not contiguous. It should start from ${r + 1}.`
34
34
  );
35
35
  if (d === 0)
36
36
  throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
37
- for (i ?? (i = a + (d ?? 1) - 1), d ?? (d = i - a + 1), s = i, w.debug(`Packet block ${a} - ${s} with label ${c}`); r.length <= l + 1 && t.getPacket().length < N; ) {
37
+ for (i ??= a + (d ?? 1) - 1, d ??= i - a + 1, r = i, w.debug(`Packet block ${a} - ${r} with label ${c}`); s.length <= l + 1 && t.getPacket().length < N; ) {
38
38
  const [p, o] = I({ start: a, end: i, bits: d, label: c }, n, l);
39
- if (r.push(p), p.end + 1 === n * l && (t.pushWord(r), r = [], n++), !o)
39
+ if (s.push(p), p.end + 1 === n * l && (t.pushWord(s), s = [], n++), !o)
40
40
  break;
41
41
  ({ start: a, end: i, bits: d, label: c } = o);
42
42
  }
43
43
  }
44
- t.pushWord(r);
45
- }, "populate"), I = /* @__PURE__ */ b((e, t, s) => {
44
+ t.pushWord(s);
45
+ }, "populate"), I = /* @__PURE__ */ b((e, t, r) => {
46
46
  if (e.start === void 0)
47
47
  throw new Error("start should have been set during first phase");
48
48
  if (e.end === void 0)
49
49
  throw new Error("end should have been set during first phase");
50
50
  if (e.start > e.end)
51
51
  throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);
52
- if (e.end + 1 <= t * s)
52
+ if (e.end + 1 <= t * r)
53
53
  return [e, void 0];
54
- const r = t * s - 1, n = t * s;
54
+ const s = t * r - 1, n = t * r;
55
55
  return [
56
56
  {
57
57
  start: e.start,
58
- end: r,
58
+ end: s,
59
59
  label: e.label,
60
- bits: r - e.start
60
+ bits: s - e.start
61
61
  },
62
62
  {
63
63
  start: n,
@@ -70,25 +70,24 @@ var M = A.packet, u, v = (u = class {
70
70
  // @ts-expect-error - PacketDB is not assignable to DiagramDB
71
71
  parser: { yy: void 0 },
72
72
  parse: /* @__PURE__ */ b(async (e) => {
73
- var r;
74
- const t = await L("packet", e), s = (r = x.parser) == null ? void 0 : r.yy;
75
- if (!(s instanceof v))
73
+ const t = await L("packet", e), r = x.parser?.yy;
74
+ if (!(r instanceof v))
76
75
  throw new Error(
77
76
  "parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
78
77
  );
79
- w.debug(t), Y(t, s);
78
+ w.debug(t), Y(t, r);
80
79
  }, "parse")
81
- }, K = /* @__PURE__ */ b((e, t, s, r) => {
82
- const n = r.db, l = n.getConfig(), { rowHeight: a, paddingY: i, bitWidth: d, bitsPerRow: c } = l, p = n.getPacket(), o = n.getDiagramTitle(), h = a + i, g = h * (p.length + 1) - (o ? 0 : a), k = d * c + 2, f = B(t);
80
+ }, K = /* @__PURE__ */ b((e, t, r, s) => {
81
+ const n = s.db, l = n.getConfig(), { rowHeight: a, paddingY: i, bitWidth: d, bitsPerRow: c } = l, p = n.getPacket(), o = n.getDiagramTitle(), h = a + i, g = h * (p.length + 1) - (o ? 0 : a), k = d * c + 2, f = B(t);
83
82
  f.attr("viewbox", `0 0 ${k} ${g}`), C(f, g, k, l.useMaxWidth);
84
83
  for (const [y, $] of p.entries())
85
84
  O(f, $, y, l);
86
85
  f.append("text").text(o).attr("x", k / 2).attr("y", g - h / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
87
- }, "draw"), O = /* @__PURE__ */ b((e, t, s, { rowHeight: r, paddingX: n, paddingY: l, bitWidth: a, bitsPerRow: i, showBits: d }) => {
88
- const c = e.append("g"), p = s * (r + l) + l;
86
+ }, "draw"), O = /* @__PURE__ */ b((e, t, r, { rowHeight: s, paddingX: n, paddingY: l, bitWidth: a, bitsPerRow: i, showBits: d }) => {
87
+ const c = e.append("g"), p = r * (s + l) + l;
89
88
  for (const o of t) {
90
89
  const h = o.start % i * a + 1, g = (o.end - o.start + 1) * a - n;
91
- if (c.append("rect").attr("x", h).attr("y", p).attr("width", g).attr("height", r).attr("class", "packetBlock"), c.append("text").attr("x", h + g / 2).attr("y", p + r / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(o.label), !d)
90
+ if (c.append("rect").attr("x", h).attr("y", p).attr("width", g).attr("height", s).attr("class", "packetBlock"), c.append("text").attr("x", h + g / 2).attr("y", p + s / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(o.label), !d)
92
91
  continue;
93
92
  const k = o.end === o.start, f = p - 2;
94
93
  c.append("text").attr("x", h + (k ? g / 2 : 0)).attr("y", f).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", k ? "middle" : "start").text(o.start), k || c.append("text").attr("x", h + g).attr("y", f).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(o.end);
@@ -0,0 +1,60 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xt=require("./chunk-55IACEB6-B1EpdpVW.js"),vt=require("./chunk-QN33PNHL-MX1ZMWu-.js"),a=require("./index-BwYOYPeK.js"),Dt=require("./channel-Dw8BXC8D.js");var ht=(function(){var s=a.__name(function(R,r,c,l){for(c=c||{},l=R.length;l--;c[R[l]]=r);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],o=[1,10],d=[1,11],h=[1,12],u=[1,13],f=[1,20],y=[1,21],k=[1,22],w=[1,23],K=[1,24],S=[1,19],$=[1,25],Z=[1,26],T=[1,18],L=[1,33],tt=[1,34],et=[1,35],st=[1,36],it=[1,37],ut=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],O=[1,42],N=[1,43],V=[1,52],M=[40,50,68,69],B=[1,63],F=[1,61],A=[1,58],P=[1,62],Y=[1,64],U=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],dt=[63,64,65,66,67],_t=[1,81],pt=[1,80],ft=[1,78],yt=[1,79],gt=[6,10,42,47],x=[6,10,13,41,42,47,48,49],j=[1,89],W=[1,88],q=[1,87],z=[19,56],mt=[1,98],bt=[1,97],nt=[19,56,58,60],rt={trace:a.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:a.__name(function(r,c,l,n,_,t,G){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:n.addEntity(t[e-4]),n.addEntity(t[e-2]),n.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:n.addEntity(t[e-8]),n.addEntity(t[e-4]),n.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),n.setClass([t[e-8]],t[e-6]),n.setClass([t[e-4]],t[e-2]);break;case 10:n.addEntity(t[e-6]),n.addEntity(t[e-2]),n.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),n.setClass([t[e-6]],t[e-4]);break;case 11:n.addEntity(t[e-6]),n.addEntity(t[e-4]),n.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),n.setClass([t[e-4]],t[e-2]);break;case 12:n.addEntity(t[e-3]),n.addAttributes(t[e-3],t[e-1]);break;case 13:n.addEntity(t[e-5]),n.addAttributes(t[e-5],t[e-1]),n.setClass([t[e-5]],t[e-3]);break;case 14:n.addEntity(t[e-2]);break;case 15:n.addEntity(t[e-4]),n.setClass([t[e-4]],t[e-2]);break;case 16:n.addEntity(t[e]);break;case 17:n.addEntity(t[e-2]),n.setClass([t[e-2]],t[e]);break;case 18:n.addEntity(t[e-6],t[e-4]),n.addAttributes(t[e-6],t[e-1]);break;case 19:n.addEntity(t[e-8],t[e-6]),n.addAttributes(t[e-8],t[e-1]),n.setClass([t[e-8]],t[e-3]);break;case 20:n.addEntity(t[e-5],t[e-3]);break;case 21:n.addEntity(t[e-7],t[e-5]),n.setClass([t[e-7]],t[e-2]);break;case 22:n.addEntity(t[e-3],t[e-1]);break;case 23:n.addEntity(t[e-5],t[e-3]),n.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),n.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),n.setAccDescription(this.$);break;case 32:n.setDirection("TB");break;case 33:n.setDirection("BT");break;case 34:n.setDirection("RL");break;case 35:n.setDirection("LR");break;case 36:this.$=t[e-3],n.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 56:case 64:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],n.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],n.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 76:case 77:this.$=t[e].replace(/"/g,"");break;case 55:case 78:this.$=t[e];break;case 57:t[e].push(t[e-1]),this.$=t[e];break;case 58:this.$={type:t[e-1],name:t[e]};break;case 59:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 60:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 61:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 62:case 63:case 66:this.$=t[e];break;case 65:t[e-2].push(t[e]),this.$=t[e-2];break;case 67:this.$=t[e].replace(/"/g,"");break;case 68:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 69:this.$=n.Cardinality.ZERO_OR_ONE;break;case 70:this.$=n.Cardinality.ZERO_OR_MORE;break;case 71:this.$=n.Cardinality.ONE_OR_MORE;break;case 72:this.$=n.Cardinality.ONLY_ONE;break;case 73:this.$=n.Cardinality.MD_PARENT;break;case 74:this.$=n.Identification.NON_IDENTIFYING;break;case 75:this.$=n.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:d,26:h,28:u,29:14,30:15,31:16,32:17,33:f,34:y,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:27,11:9,22:o,24:d,26:h,28:u,29:14,30:15,31:16,32:17,33:f,34:y,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:L,64:tt,65:et,66:st,67:it}),{23:[1,38]},{25:[1,39]},{27:[1,40]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(ut,[2,54]),s(ut,[2,55]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:41,40:O,41:N},{16:44,40:O,41:N},{16:45,40:O,41:N},s(i,[2,4]),{11:46,40:S,50:T},{16:47,40:O,41:N},{18:48,19:[1,49],51:50,52:51,56:V},{11:53,40:S,50:T},{62:54,68:[1,55],69:[1,56]},s(M,[2,69]),s(M,[2,70]),s(M,[2,71]),s(M,[2,72]),s(M,[2,73]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:B,38:57,41:F,42:A,45:59,46:60,48:P,49:Y},s(U,[2,37]),s(U,[2,38]),{16:65,40:O,41:N,42:A},{13:B,38:66,41:F,42:A,45:59,46:60,48:P,49:Y},{13:[1,67],15:[1,68]},s(i,[2,17],{61:32,12:69,17:[1,70],42:A,63:L,64:tt,65:et,66:st,67:it}),{19:[1,71]},s(i,[2,14]),{18:72,19:[2,56],51:50,52:51,56:V},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:L,64:tt,65:et,66:st,67:it},s(dt,[2,74]),s(dt,[2,75]),{6:_t,10:pt,39:77,42:ft,47:yt},{40:[1,82],41:[1,83]},s(gt,[2,43],{46:84,13:B,41:F,48:P,49:Y}),s(x,[2,45]),s(x,[2,50]),s(x,[2,51]),s(x,[2,52]),s(x,[2,53]),s(i,[2,41],{42:A}),{6:_t,10:pt,39:85,42:ft,47:yt},{14:86,40:j,50:W,70:q},{16:90,40:O,41:N},{11:91,40:S,50:T},{18:92,19:[1,93],51:50,52:51,56:V},s(i,[2,12]),{19:[2,57]},s(z,[2,58],{54:94,55:95,57:96,59:mt,60:bt}),s([19,56,59,60],[2,63]),s(i,[2,22],{15:[1,100],17:[1,99]}),s([40,50],[2,68]),s(i,[2,36]),{13:B,41:F,45:101,46:60,48:P,49:Y},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(U,[2,39]),s(U,[2,40]),s(x,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,76]),s(i,[2,77]),s(i,[2,78]),{13:[1,102],42:A},{13:[1,104],15:[1,103]},{19:[1,105]},s(i,[2,15]),s(z,[2,59],{55:106,58:[1,107],60:bt}),s(z,[2,60]),s(nt,[2,64]),s(z,[2,67]),s(nt,[2,66]),{18:108,19:[1,109],51:50,52:51,56:V},{16:110,40:O,41:N},s(gt,[2,44],{46:84,13:B,41:F,48:P,49:Y}),{14:111,40:j,50:W,70:q},{16:112,40:O,41:N},{14:113,40:j,50:W,70:q},s(i,[2,13]),s(z,[2,61]),{57:114,59:mt},{19:[1,115]},s(i,[2,20]),s(i,[2,23],{17:[1,116],42:A}),s(i,[2,11]),{13:[1,117],42:A},s(i,[2,10]),s(nt,[2,65]),s(i,[2,18]),{18:118,19:[1,119],51:50,52:51,56:V},{14:120,40:j,50:W,70:q},{19:[1,121]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:a.__name(function(r,c){if(c.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=c,l}},"parseError"),parse:a.__name(function(r){var c=this,l=[0],n=[],_=[null],t=[],G=this.table,e="",X=0,kt=0,At=2,Et=1,Rt=t.slice.call(arguments,1),p=Object.create(this.lexer),C={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&(C.yy[at]=this.yy[at]);p.setInput(r,C.yy),C.yy.lexer=p,C.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var ct=p.yylloc;t.push(ct);var Ct=p.options&&p.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(m){l.length=l.length-2*m,_.length=_.length-m,t.length=t.length-m}a.__name(It,"popStack");function St(){var m;return m=n.pop()||p.lex()||Et,typeof m!="number"&&(m instanceof Array&&(n=m,m=n.pop()),m=c.symbols_[m]||m),m}a.__name(St,"lex");for(var g,I,b,lt,v={},H,E,Tt,J;;){if(I=l[l.length-1],this.defaultActions[I]?b=this.defaultActions[I]:((g===null||typeof g>"u")&&(g=St()),b=G[I]&&G[I][g]),typeof b>"u"||!b.length||!b[0]){var ot="";J=[];for(H in G[I])this.terminals_[H]&&H>At&&J.push("'"+this.terminals_[H]+"'");p.showPosition?ot="Parse error on line "+(X+1)+`:
2
+ `+p.showPosition()+`
3
+ Expecting `+J.join(", ")+", got '"+(this.terminals_[g]||g)+"'":ot="Parse error on line "+(X+1)+": Unexpected "+(g==Et?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(ot,{text:p.match,token:this.terminals_[g]||g,line:p.yylineno,loc:ct,expected:J})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+g);switch(b[0]){case 1:l.push(g),_.push(p.yytext),t.push(p.yylloc),l.push(b[1]),g=null,kt=p.yyleng,e=p.yytext,X=p.yylineno,ct=p.yylloc;break;case 2:if(E=this.productions_[b[1]][1],v.$=_[_.length-E],v._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Ct&&(v._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),lt=this.performAction.apply(v,[e,kt,X,C.yy,b[1],_,t].concat(Rt)),typeof lt<"u")return lt;E&&(l=l.slice(0,-1*E*2),_=_.slice(0,-1*E),t=t.slice(0,-1*E)),l.push(this.productions_[b[1]][0]),_.push(v.$),t.push(v._$),Tt=G[l[l.length-2]][l[l.length-1]],l.push(Tt);break;case 3:return!0}}return!0},"parse")},Nt=(function(){var R={EOF:1,parseError:a.__name(function(c,l){if(this.yy.parser)this.yy.parser.parseError(c,l);else throw new Error(c)},"parseError"),setInput:a.__name(function(r,c){return this.yy=c||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a.__name(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var c=r.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:a.__name(function(r){var c=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===n.length?this.yylloc.first_column:0)+n[n.length-l.length].length-l[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a.__name(function(){return this._more=!0,this},"more"),reject:a.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a.__name(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a.__name(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a.__name(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a.__name(function(){var r=this.pastInput(),c=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
+ `+c+"^"},"showPosition"),test_match:a.__name(function(r,c){var l,n,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),n=r[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var t in _)this[t]=_[t];return!1}return!1},"test_match"),next:a.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,c,l,n;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),t=0;t<_.length;t++)if(l=this._input.match(this.rules[_[t]]),l&&(!c||l[0].length>c[0].length)){if(c=l,n=t,this.options.backtrack_lexer){if(r=this.test_match(l,_[t]),r!==!1)return r;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(r=this.test_match(c,_[n]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a.__name(function(){var c=this.next();return c||this.lex()},"lex"),begin:a.__name(function(c){this.conditionStack.push(c)},"begin"),popState:a.__name(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a.__name(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:a.__name(function(c){this.begin(c)},"pushState"),stateStackSize:a.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a.__name(function(c,l,n,_){switch(n){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 59;case 25:return 56;case 26:return 56;case 27:return 60;case 28:break;case 29:return this.popState(),19;case 30:return l.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 63;case 42:return 65;case 43:return 65;case 44:return 65;case 45:return 63;case 46:return 63;case 47:return 64;case 48:return 64;case 49:return 64;case 50:return 64;case 51:return 64;case 52:return 65;case 53:return 64;case 54:return 65;case 55:return 66;case 56:return 66;case 57:return 66;case 58:return 66;case 59:return 63;case 60:return 64;case 61:return 65;case 62:return 67;case 63:return 68;case 64:return 69;case 65:return 69;case 66:return 68;case 67:return 68;case 68:return 68;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 73:return l.yytext[0];case 74:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,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,65,66,67,68,71,72,73,74],inclusive:!0}}};return R})();rt.lexer=Nt;function Q(){this.yy={}}return a.__name(Q,"Parser"),Q.prototype=rt,rt.Parser=Q,new Q})();ht.parser=ht;var wt=ht,D,Lt=(D=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setAccDescription=a.setAccDescription,this.getAccDescription=a.getAccDescription,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getConfig=a.__name(()=>a.getConfig2().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(i,o=""){return this.entities.has(i)?!this.entities.get(i)?.alias&&o&&(this.entities.get(i).alias=o,a.log.info(`Add alias '${o}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:o,shape:"erBox",look:a.getConfig2().look??"default",cssClasses:"default",cssStyles:[]}),a.log.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,o){const d=this.addEntity(i);let h;for(h=o.length-1;h>=0;h--)o[h].keys||(o[h].keys=[]),o[h].comment||(o[h].comment=""),d.attributes.push(o[h]),a.log.debug("Added attribute ",o[h].name)}addRelationship(i,o,d,h){const u=this.entities.get(i),f=this.entities.get(d);if(!u||!f)return;const y={entityA:u.id,roleA:o,entityB:f.id,relSpec:h};this.relationships.push(y),a.log.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let o=[];for(const d of i){const h=this.classes.get(d);h?.styles&&(o=[...o,...h.styles??[]].map(u=>u.trim())),h?.textStyles&&(o=[...o,...h.textStyles??[]].map(u=>u.trim()))}return o}addCssStyles(i,o){for(const d of i){const h=this.entities.get(d);if(!o||!h)return;for(const u of o)h.cssStyles.push(u)}}addClass(i,o){i.forEach(d=>{let h=this.classes.get(d);h===void 0&&(h={id:d,styles:[],textStyles:[]},this.classes.set(d,h)),o&&o.forEach(function(u){if(/color/.exec(u)){const f=u.replace("fill","bgFill");h.textStyles.push(f)}h.styles.push(u)})})}setClass(i,o){for(const d of i){const h=this.entities.get(d);if(h)for(const u of o)h.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],a.clear()}getData(){const i=[],o=[],d=a.getConfig2();for(const u of this.entities.keys()){const f=this.entities.get(u);f&&(f.cssCompiledStyles=this.getCompiledStyles(f.cssClasses.split(" ")),i.push(f))}let h=0;for(const u of this.relationships){const f={id:a.getEdgeId(u.entityA,u.entityB,{prefix:"id",counter:h++}),type:"normal",curve:"basis",start:u.entityA,end:u.entityB,label:u.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:u.relSpec.cardB.toLowerCase(),arrowTypeEnd:u.relSpec.cardA.toLowerCase(),pattern:u.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:d.look};o.push(f)}return{nodes:i,edges:o,other:{},config:d,direction:"TB"}}},a.__name(D,"ErDB"),D),Ot={};a.__export(Ot,{draw:()=>Vt});var Vt=a.__name(async function(s,i,o,d){a.log.info("REF0:"),a.log.info("Drawing er diagram (unified)",i);const{securityLevel:h,er:u,layout:f}=a.getConfig2(),y=d.db.getData(),k=xt.getDiagramElement(i,h);y.type=d.type,y.layoutAlgorithm=a.getRegisteredLayoutAlgorithm(f),y.config.flowchart.nodeSpacing=u?.nodeSpacing||140,y.config.flowchart.rankSpacing=u?.rankSpacing||80,y.direction=d.db.getDirection(),y.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],y.diagramId=i,await a.render(y,k),y.layoutAlgorithm==="elk"&&k.select(".edges").lower();const w=k.selectAll('[id*="-background"]');Array.from(w).length>0&&w.each(function(){const S=a.select(this),Z=S.attr("id").replace("-background",""),T=k.select(`#${CSS.escape(Z)}`);if(!T.empty()){const L=T.attr("transform");S.attr("transform",L)}});const K=8;a.utils_default.insertTitle(k,"erDiagramTitleText",u?.titleTopMargin??25,d.db.getDiagramTitle()),vt.setupViewPortForSVG(k,K,"erDiagram",u?.useMaxWidth??!0)},"draw"),Mt=a.__name((s,i)=>{const o=Dt.channel,d=o(s,"r"),h=o(s,"g"),u=o(s,"b");return a.rgba(d,h,u,i)},"fade"),Bt=a.__name(s=>`
7
+ .entityBox {
8
+ fill: ${s.mainBkg};
9
+ stroke: ${s.nodeBorder};
10
+ }
11
+
12
+ .relationshipLabelBox {
13
+ fill: ${s.tertiaryColor};
14
+ opacity: 0.7;
15
+ background-color: ${s.tertiaryColor};
16
+ rect {
17
+ opacity: 0.5;
18
+ }
19
+ }
20
+
21
+ .labelBkg {
22
+ background-color: ${Mt(s.tertiaryColor,.5)};
23
+ }
24
+
25
+ .edgeLabel .label {
26
+ fill: ${s.nodeBorder};
27
+ font-size: 14px;
28
+ }
29
+
30
+ .label {
31
+ font-family: ${s.fontFamily};
32
+ color: ${s.nodeTextColor||s.textColor};
33
+ }
34
+
35
+ .edge-pattern-dashed {
36
+ stroke-dasharray: 8,8;
37
+ }
38
+
39
+ .node rect,
40
+ .node circle,
41
+ .node ellipse,
42
+ .node polygon
43
+ {
44
+ fill: ${s.mainBkg};
45
+ stroke: ${s.nodeBorder};
46
+ stroke-width: 1px;
47
+ }
48
+
49
+ .relationshipLine {
50
+ stroke: ${s.lineColor};
51
+ stroke-width: 1;
52
+ fill: none;
53
+ }
54
+
55
+ .marker {
56
+ fill: none !important;
57
+ stroke: ${s.lineColor} !important;
58
+ stroke-width: 1;
59
+ }
60
+ `,"getStyles"),Ft=Bt,Pt={parser:wt,get db(){return new Lt},renderer:Ot,styles:Ft};exports.diagram=Pt;