@kong-ui-public/documentation 1.4.17-pr.2665.525593492.0 → 1.4.17
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.
- package/dist/_basePickBy-BCsiP0lE-DJBdvZNn.js +151 -0
- package/dist/{_baseUniq-SAfYgIkf-buEvGj9H.js → _baseUniq-CsvgMmt0-CCBG5z_B.js} +165 -165
- package/dist/arc-DYb5Ak6k-js8YHzj6.js +83 -0
- package/dist/architecture-U656AL7Q-LZu-yAfZ-CQD6AyxA.js +5 -0
- package/dist/architectureDiagram-KFL7JDKH-BK_an8l5-D20M_MXF.js +4665 -0
- package/dist/blockDiagram-ZYB65J3Q-C0KtqCEe-pwEm3-ie.js +2265 -0
- package/dist/{c4Diagram-6F5ED5ID-D5yqWyf0-DzlUmurv.js → c4Diagram-AAMF2YG6-DYHWlrmc-C6NWDsTV.js} +4 -4
- package/dist/{channel-bVcNKbrJ-NqcPkfCx.js → channel-3QVQMCTA-BwyrTaJi.js} +1 -1
- package/dist/{chunk-TMUBEWPD-BRIzn5gH-alZ9Sg3f.js → chunk-ANTBXLJU-BhR1MDfy-Bec7kb00.js} +1 -1
- package/dist/{chunk-KFBOBJHC-nixdujtH-CrTZo7r-.js → chunk-FHKO5MBM-z_nuC8Da-Dge2Nbr5.js} +1 -1
- package/dist/chunk-GLLZNHP4-DgwBbAOT-BUrsAxH8.js +19 -0
- package/dist/chunk-JBRWN2VN-CHua2TSC-BYWS19Oz.js +1374 -0
- package/dist/chunk-LXBSTHXV-CoED0jHL-Cc8w4JL1.js +1382 -0
- package/dist/chunk-NRVI72HA-DxsqT4Dt-Bo_vu9qn.js +20 -0
- package/dist/{chunk-ASOPGD6M-B5bA_saK-BiT875Ve.js → chunk-OMD6QJNC-_VI6zVGr-Bb4P7zNG.js} +1 -1
- package/dist/chunk-WVR4S24B-C4HIWky3-CkJ0DHSJ.js +8 -0
- package/dist/classDiagram-3BZAVTQC-DrmNjTt_-CS9fxl_R.js +16 -0
- package/dist/classDiagram-v2-QTMF73CY-DrmNjTt_-CS9fxl_R.js +16 -0
- package/dist/{clone-_5SW34SG-DOuhA6mG.js → clone-C0dvnYv6-BozdSvey.js} +1 -1
- package/dist/cytoscape.esm-CjI2IsL8-DYIumutE.js +18721 -0
- package/dist/{dagre-4EVJKHTY-CcAruc30-B3UMlKNl.js → dagre-2BBEFEWP-Bh_bYuL8-Cej31YXN.js} +53 -53
- package/dist/defaultLocale-D7EN2tov-CK6dgF7Y.js +171 -0
- package/dist/diagram-4IRLE6MV-34TaesxP-XfF-gcP2.js +533 -0
- package/dist/diagram-GUPCWM2R-Cr4-5_uX-B8mxM1Uc.js +143 -0
- package/dist/diagram-RP2FKANI-COpvHjzI-C-_mZxuk.js +221 -0
- package/dist/documentation.es.js +1 -1
- package/dist/documentation.umd.js +860 -399
- package/dist/erDiagram-HZWUO2LU-Cu2MerRS-KziSgDQg.js +840 -0
- package/dist/flowDiagram-THRYKUMA-CfrQTB8C-BYn8LF24.js +1627 -0
- package/dist/ganttDiagram-WV7ZQ7D5-gkieebY_-C7YOriZ4.js +2504 -0
- package/dist/gitGraph-F6HP7TQM-suE5ufvy-CQDQV2yP.js +5 -0
- package/dist/{gitGraphDiagram-NRZ2UAAF-B-t90-9e-BkGPAEnk.js → gitGraphDiagram-OJR772UL-CYA7EIoU-Bqc1qZk4.js} +103 -103
- package/dist/{graph-BYZMvqpu-BXRs5843.js → graph-B_1gOUDz-Dm6REFzZ.js} +2 -2
- package/dist/{index-CMZig9xg.js → index-BDD0CD9m.js} +9834 -9540
- package/dist/info-NVLQJR56-CdsHk-Jf-tf8zb8tD.js +5 -0
- package/dist/infoDiagram-6WOFNB3A-ajp3t5Lm-D80dGo5F.js +24 -0
- package/dist/{journeyDiagram-G5WM74LC-BE7U42Ad-y6YegUqL.js → journeyDiagram-FFXJYRFH-kgCEEPLo-CakI8CyJ.js} +357 -333
- package/dist/{kanban-definition-QRCXZQQD-C-5-UNRm-BOYYKTAB.js → kanban-definition-KOZQBZVT-CmM4CHe6-rjuufCiO.js} +75 -73
- package/dist/{katex-Qk2jHgyB-_qyJ_37x.js → katex-C0Lgw_Sx-CbX2I1cQ.js} +1864 -1814
- package/dist/{layout-BHI4imdk-CESYC-il.js → layout-9vIfpCf3-FfABA43y.js} +81 -81
- package/dist/linear-C-k9vokG-Md9dfBfB.js +259 -0
- package/dist/{mermaid-parser.core-Ce96PX3Q-CV9ue_xr.js → mermaid-parser.core-DHL9WXVx-DeKF3RZx.js} +4080 -3590
- package/dist/{mindmap-definition-GWI6TPTV-C98Syvj2-DUWC1UH5.js → mindmap-definition-LNHGMQRG-BsypuFYj-DSVrvuog.js} +1112 -1100
- package/dist/packet-BFZMPI3H-BcK9kJ-B-BxxCPBGn.js +5 -0
- package/dist/pie-7BOR55EZ-Vt5px0F3-BM7egbMh.js +5 -0
- package/dist/pieDiagram-DBDJKBY4-Bam6gKTi-BOqYeC6c.js +161 -0
- package/dist/{quadrantDiagram-OS5C2QUG-M57vVPSx-BRx-dMGe.js → quadrantDiagram-YPSRARAO-CJwMw09m-CN2OO-Le.js} +2 -2
- package/dist/radar-NHE76QYJ-Br11XWE4-4RP4MPFA.js +5 -0
- package/dist/requirementDiagram-EGVEC5DT-DkRytT0X-C2zigskn.js +850 -0
- package/dist/{sankeyDiagram-Y46BX6SQ-D6EdYPdp-D2Qzxmhx.js → sankeyDiagram-HRAUVNP4-08s1UHMk-2j8idkNs.js} +198 -193
- package/dist/{sequenceDiagram-G6AWOVSC-B171TAb1-KCpoI-Ck.js → sequenceDiagram-WFGC7UMF-6_s7-CN7-D-oTpLFJ.js} +1001 -992
- package/dist/stateDiagram-UUKSUZ4H-eWajY90l-BlM614AN.js +263 -0
- package/dist/stateDiagram-v2-EYPG3UTE-Dh7Ngu1O-YVMiocHE.js +16 -0
- package/dist/style.css +1 -1
- package/dist/timeline-definition-3HZDQTIS-4TPEOhE8-fDDLVlO8.js +799 -0
- package/dist/treemap-KMMF4GRG-nu7WEuPi-C1YG24W8.js +5 -0
- package/dist/{xychartDiagram-6QU3TZC5-CqbTSF5W-CUbJ50KT.js → xychartDiagram-FDP5SA34-BbtKlU7T-D1BI5nWs.js} +459 -423
- package/package.json +4 -4
- package/dist/_basePickBy-zlkqRmFy-D6w9JBLu.js +0 -151
- package/dist/arc-CK9P6CkJ-DVgfRhzX.js +0 -83
- package/dist/architecture-I3QFYML2-DJzmbE4M-C3v7Cpg0.js +0 -5
- package/dist/architectureDiagram-UYN6MBPD-DkZdgpXi-BTThTJ0F.js +0 -4592
- package/dist/blockDiagram-ZHA2E4KO-DnCMGCMN-DBXa-baO.js +0 -2247
- package/dist/chunk-5HRBRIJM-BjQ8go1b-CJmT3AYe.js +0 -24
- package/dist/chunk-7U56Z5CX-awhAxjZ0-Cs_UWlwk.js +0 -1213
- package/dist/chunk-T2TOU4HS-DqOVhIzl-O3PUl7Qp.js +0 -1301
- package/dist/classDiagram-LNE6IOMH-fQzyXfo--DYLd8UQH.js +0 -14
- package/dist/classDiagram-v2-MQ7JQ4JX-fQzyXfo--DYLd8UQH.js +0 -14
- package/dist/cytoscape.esm-DAyNQ0qu-i5PnoWfE.js +0 -16110
- package/dist/diagram-QW4FP2JN-DZT_0aFO-SYzM51ke.js +0 -126
- package/dist/erDiagram-6RL3IURR-BfgUC5jv-BrebVho-.js +0 -937
- package/dist/flowDiagram-7ASYPVHJ-Bo9CnsE7-Ds2vln_y.js +0 -1484
- package/dist/ganttDiagram-NTVNEXSI-8E9hjd6N-fR_cmeDc.js +0 -2491
- package/dist/gitGraph-YCYPL57B-BnErPIwo-DXUTceC1.js +0 -5
- package/dist/info-46DW6VJ7-DPpbx_vA-omPXKuBd.js +0 -5
- package/dist/infoDiagram-A4XQUW5V-Bo9uoOcA-CnlgI27B.js +0 -22
- package/dist/linear-C2PheBya-BHVXLcru.js +0 -423
- package/dist/packet-W2GHVCYJ-BLiQbm7T-BD1xX8XM.js +0 -5
- package/dist/pie-BEWT4RHE-D3Mbo3mT-B4n38n6N.js +0 -5
- package/dist/pieDiagram-YF2LJOPJ-BJV27s9B-DA7hy5wG.js +0 -161
- package/dist/requirementDiagram-MIRIMTAZ-D0KDg7rf-CRMUyo68.js +0 -768
- package/dist/stateDiagram-MAYHULR4-D7FUnT9_-aCApnrI4.js +0 -268
- package/dist/stateDiagram-v2-4JROLMXI-Cyc74STT-D-7hwTRo.js +0 -14
- package/dist/timeline-definition-U7ZMHBDA-Bw-dp1yf-C01CsNUU.js +0 -804
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
import { d as ie } from "./chunk-NRVI72HA-DxsqT4Dt-Bo_vu9qn.js";
|
|
2
|
+
import { _ as b, aA as ee, aB as te, aU as ce, aa as de, l as J, bA as P, a9 as U, a8 as he, a7 as pe, an as ue, ao as fe, a6 as me, a5 as ge, aC as ye, bB as Se, at as xe } from "./index-BDD0CD9m.js";
|
|
3
|
+
import { m as ve } from "./chunk-ANTBXLJU-BhR1MDfy-Bec7kb00.js";
|
|
4
|
+
import { N as Ce } from "./mermaid-parser.core-DHL9WXVx-DeKF3RZx.js";
|
|
5
|
+
import { n as R } from "./defaultLocale-D7EN2tov-CK6dgF7Y.js";
|
|
6
|
+
import { h as X } from "./ordinal-DfAQgscy-BEJTu10r.js";
|
|
7
|
+
function be(t) {
|
|
8
|
+
var a = 0, n = t.children, r = n && n.length;
|
|
9
|
+
if (!r) a = 1;
|
|
10
|
+
else for (; --r >= 0; ) a += n[r].value;
|
|
11
|
+
t.value = a;
|
|
12
|
+
}
|
|
13
|
+
function $e() {
|
|
14
|
+
return this.eachAfter(be);
|
|
15
|
+
}
|
|
16
|
+
function we(t, a) {
|
|
17
|
+
let n = -1;
|
|
18
|
+
for (const r of this)
|
|
19
|
+
t.call(a, r, ++n, this);
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
function Le(t, a) {
|
|
23
|
+
for (var n = this, r = [n], o, s, d = -1; n = r.pop(); )
|
|
24
|
+
if (t.call(a, n, ++d, this), o = n.children)
|
|
25
|
+
for (s = o.length - 1; s >= 0; --s)
|
|
26
|
+
r.push(o[s]);
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
function Te(t, a) {
|
|
30
|
+
for (var n = this, r = [n], o = [], s, d, h, f = -1; n = r.pop(); )
|
|
31
|
+
if (o.push(n), s = n.children)
|
|
32
|
+
for (d = 0, h = s.length; d < h; ++d)
|
|
33
|
+
r.push(s[d]);
|
|
34
|
+
for (; n = o.pop(); )
|
|
35
|
+
t.call(a, n, ++f, this);
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
function ke(t, a) {
|
|
39
|
+
let n = -1;
|
|
40
|
+
for (const r of this)
|
|
41
|
+
if (t.call(a, r, ++n, this))
|
|
42
|
+
return r;
|
|
43
|
+
}
|
|
44
|
+
function Me(t) {
|
|
45
|
+
return this.eachAfter(function(a) {
|
|
46
|
+
for (var n = +t(a.data) || 0, r = a.children, o = r && r.length; --o >= 0; ) n += r[o].value;
|
|
47
|
+
a.value = n;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function ze(t) {
|
|
51
|
+
return this.eachBefore(function(a) {
|
|
52
|
+
a.children && a.children.sort(t);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function Ae(t) {
|
|
56
|
+
for (var a = this, n = Fe(a, t), r = [a]; a !== n; )
|
|
57
|
+
a = a.parent, r.push(a);
|
|
58
|
+
for (var o = r.length; t !== n; )
|
|
59
|
+
r.splice(o, 0, t), t = t.parent;
|
|
60
|
+
return r;
|
|
61
|
+
}
|
|
62
|
+
function Fe(t, a) {
|
|
63
|
+
if (t === a) return t;
|
|
64
|
+
var n = t.ancestors(), r = a.ancestors(), o = null;
|
|
65
|
+
for (t = n.pop(), a = r.pop(); t === a; )
|
|
66
|
+
o = t, t = n.pop(), a = r.pop();
|
|
67
|
+
return o;
|
|
68
|
+
}
|
|
69
|
+
function Be() {
|
|
70
|
+
for (var t = this, a = [t]; t = t.parent; )
|
|
71
|
+
a.push(t);
|
|
72
|
+
return a;
|
|
73
|
+
}
|
|
74
|
+
function Pe() {
|
|
75
|
+
return Array.from(this);
|
|
76
|
+
}
|
|
77
|
+
function De() {
|
|
78
|
+
var t = [];
|
|
79
|
+
return this.eachBefore(function(a) {
|
|
80
|
+
a.children || t.push(a);
|
|
81
|
+
}), t;
|
|
82
|
+
}
|
|
83
|
+
function Ne() {
|
|
84
|
+
var t = this, a = [];
|
|
85
|
+
return t.each(function(n) {
|
|
86
|
+
n !== t && a.push({ source: n.parent, target: n });
|
|
87
|
+
}), a;
|
|
88
|
+
}
|
|
89
|
+
function* We() {
|
|
90
|
+
var t = this, a, n = [t], r, o, s;
|
|
91
|
+
do
|
|
92
|
+
for (a = n.reverse(), n = []; t = a.pop(); )
|
|
93
|
+
if (yield t, r = t.children)
|
|
94
|
+
for (o = 0, s = r.length; o < s; ++o)
|
|
95
|
+
n.push(r[o]);
|
|
96
|
+
while (n.length);
|
|
97
|
+
}
|
|
98
|
+
function K(t, a) {
|
|
99
|
+
t instanceof Map ? (t = [void 0, t], a === void 0 && (a = Re)) : a === void 0 && (a = Ie);
|
|
100
|
+
for (var n = new Q(t), r, o = [n], s, d, h, f; r = o.pop(); )
|
|
101
|
+
if ((d = a(r.data)) && (f = (d = Array.from(d)).length))
|
|
102
|
+
for (r.children = d, h = f - 1; h >= 0; --h)
|
|
103
|
+
o.push(s = d[h] = new Q(d[h])), s.parent = r, s.depth = r.depth + 1;
|
|
104
|
+
return n.eachBefore(Ve);
|
|
105
|
+
}
|
|
106
|
+
function Ee() {
|
|
107
|
+
return K(this).eachBefore(He);
|
|
108
|
+
}
|
|
109
|
+
function Ie(t) {
|
|
110
|
+
return t.children;
|
|
111
|
+
}
|
|
112
|
+
function Re(t) {
|
|
113
|
+
return Array.isArray(t) ? t[1] : null;
|
|
114
|
+
}
|
|
115
|
+
function He(t) {
|
|
116
|
+
t.data.value !== void 0 && (t.value = t.data.value), t.data = t.data.data;
|
|
117
|
+
}
|
|
118
|
+
function Ve(t) {
|
|
119
|
+
var a = 0;
|
|
120
|
+
do
|
|
121
|
+
t.height = a;
|
|
122
|
+
while ((t = t.parent) && t.height < ++a);
|
|
123
|
+
}
|
|
124
|
+
function Q(t) {
|
|
125
|
+
this.data = t, this.depth = this.height = 0, this.parent = null;
|
|
126
|
+
}
|
|
127
|
+
Q.prototype = K.prototype = {
|
|
128
|
+
constructor: Q,
|
|
129
|
+
count: $e,
|
|
130
|
+
each: we,
|
|
131
|
+
eachAfter: Te,
|
|
132
|
+
eachBefore: Le,
|
|
133
|
+
find: ke,
|
|
134
|
+
sum: Me,
|
|
135
|
+
sort: ze,
|
|
136
|
+
path: Ae,
|
|
137
|
+
ancestors: Be,
|
|
138
|
+
descendants: Pe,
|
|
139
|
+
leaves: De,
|
|
140
|
+
links: Ne,
|
|
141
|
+
copy: Ee,
|
|
142
|
+
[Symbol.iterator]: We
|
|
143
|
+
};
|
|
144
|
+
function _e(t) {
|
|
145
|
+
if (typeof t != "function") throw new Error();
|
|
146
|
+
return t;
|
|
147
|
+
}
|
|
148
|
+
function H() {
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
151
|
+
function V(t) {
|
|
152
|
+
return function() {
|
|
153
|
+
return t;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function je(t) {
|
|
157
|
+
t.x0 = Math.round(t.x0), t.y0 = Math.round(t.y0), t.x1 = Math.round(t.x1), t.y1 = Math.round(t.y1);
|
|
158
|
+
}
|
|
159
|
+
function Ge(t, a, n, r, o) {
|
|
160
|
+
for (var s = t.children, d, h = -1, f = s.length, i = t.value && (r - a) / t.value; ++h < f; )
|
|
161
|
+
d = s[h], d.y0 = n, d.y1 = o, d.x0 = a, d.x1 = a += d.value * i;
|
|
162
|
+
}
|
|
163
|
+
function qe(t, a, n, r, o) {
|
|
164
|
+
for (var s = t.children, d, h = -1, f = s.length, i = t.value && (o - n) / t.value; ++h < f; )
|
|
165
|
+
d = s[h], d.x0 = a, d.x1 = r, d.y0 = n, d.y1 = n += d.value * i;
|
|
166
|
+
}
|
|
167
|
+
var Oe = (1 + Math.sqrt(5)) / 2;
|
|
168
|
+
function Ue(t, a, n, r, o, s) {
|
|
169
|
+
for (var d = [], h = a.children, f, i, p = 0, C = 0, l = h.length, v, S, x = a.value, u, g, F, k, B, N, L; p < l; ) {
|
|
170
|
+
v = o - n, S = s - r;
|
|
171
|
+
do
|
|
172
|
+
u = h[C++].value;
|
|
173
|
+
while (!u && C < l);
|
|
174
|
+
for (g = F = u, N = Math.max(S / v, v / S) / (x * t), L = u * u * N, B = Math.max(F / L, L / g); C < l; ++C) {
|
|
175
|
+
if (u += i = h[C].value, i < g && (g = i), i > F && (F = i), L = u * u * N, k = Math.max(F / L, L / g), k > B) {
|
|
176
|
+
u -= i;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
B = k;
|
|
180
|
+
}
|
|
181
|
+
d.push(f = { value: u, dice: v < S, children: h.slice(p, C) }), f.dice ? Ge(f, n, r, o, x ? r += S * u / x : s) : qe(f, n, r, x ? n += v * u / x : o, s), x -= u, p = C;
|
|
182
|
+
}
|
|
183
|
+
return d;
|
|
184
|
+
}
|
|
185
|
+
const Qe = function t(a) {
|
|
186
|
+
function n(r, o, s, d, h) {
|
|
187
|
+
Ue(a, r, o, s, d, h);
|
|
188
|
+
}
|
|
189
|
+
return n.ratio = function(r) {
|
|
190
|
+
return t((r = +r) > 1 ? r : 1);
|
|
191
|
+
}, n;
|
|
192
|
+
}(Oe);
|
|
193
|
+
function Xe() {
|
|
194
|
+
var t = Qe, a = !1, n = 1, r = 1, o = [0], s = H, d = H, h = H, f = H, i = H;
|
|
195
|
+
function p(l) {
|
|
196
|
+
return l.x0 = l.y0 = 0, l.x1 = n, l.y1 = r, l.eachBefore(C), o = [0], a && l.eachBefore(je), l;
|
|
197
|
+
}
|
|
198
|
+
function C(l) {
|
|
199
|
+
var v = o[l.depth], S = l.x0 + v, x = l.y0 + v, u = l.x1 - v, g = l.y1 - v;
|
|
200
|
+
u < S && (S = u = (S + u) / 2), g < x && (x = g = (x + g) / 2), l.x0 = S, l.y0 = x, l.x1 = u, l.y1 = g, l.children && (v = o[l.depth + 1] = s(l) / 2, S += i(l) - v, x += d(l) - v, u -= h(l) - v, g -= f(l) - v, u < S && (S = u = (S + u) / 2), g < x && (x = g = (x + g) / 2), t(l, S, x, u, g));
|
|
201
|
+
}
|
|
202
|
+
return p.round = function(l) {
|
|
203
|
+
return arguments.length ? (a = !!l, p) : a;
|
|
204
|
+
}, p.size = function(l) {
|
|
205
|
+
return arguments.length ? (n = +l[0], r = +l[1], p) : [n, r];
|
|
206
|
+
}, p.tile = function(l) {
|
|
207
|
+
return arguments.length ? (t = _e(l), p) : t;
|
|
208
|
+
}, p.padding = function(l) {
|
|
209
|
+
return arguments.length ? p.paddingInner(l).paddingOuter(l) : p.paddingInner();
|
|
210
|
+
}, p.paddingInner = function(l) {
|
|
211
|
+
return arguments.length ? (s = typeof l == "function" ? l : V(+l), p) : s;
|
|
212
|
+
}, p.paddingOuter = function(l) {
|
|
213
|
+
return arguments.length ? p.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l) : p.paddingTop();
|
|
214
|
+
}, p.paddingTop = function(l) {
|
|
215
|
+
return arguments.length ? (d = typeof l == "function" ? l : V(+l), p) : d;
|
|
216
|
+
}, p.paddingRight = function(l) {
|
|
217
|
+
return arguments.length ? (h = typeof l == "function" ? l : V(+l), p) : h;
|
|
218
|
+
}, p.paddingBottom = function(l) {
|
|
219
|
+
return arguments.length ? (f = typeof l == "function" ? l : V(+l), p) : f;
|
|
220
|
+
}, p.paddingLeft = function(l) {
|
|
221
|
+
return arguments.length ? (i = typeof l == "function" ? l : V(+l), p) : i;
|
|
222
|
+
}, p;
|
|
223
|
+
}
|
|
224
|
+
var Z, ae = (Z = class {
|
|
225
|
+
constructor() {
|
|
226
|
+
this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.setAccTitle = he, this.getAccTitle = pe, this.setDiagramTitle = ue, this.getDiagramTitle = fe, this.getAccDescription = me, this.setAccDescription = ge;
|
|
227
|
+
}
|
|
228
|
+
getNodes() {
|
|
229
|
+
return this.nodes;
|
|
230
|
+
}
|
|
231
|
+
getConfig() {
|
|
232
|
+
const t = ye, a = te();
|
|
233
|
+
return ee({
|
|
234
|
+
...t.treemap,
|
|
235
|
+
...a.treemap ?? {}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
addNode(t, a) {
|
|
239
|
+
this.nodes.push(t), this.levels.set(t, a), a === 0 && (this.outerNodes.push(t), this.root ?? (this.root = t));
|
|
240
|
+
}
|
|
241
|
+
getRoot() {
|
|
242
|
+
return { name: "", children: this.outerNodes };
|
|
243
|
+
}
|
|
244
|
+
addClass(t, a) {
|
|
245
|
+
const n = this.classes.get(t) ?? { id: t, styles: [], textStyles: [] }, r = a.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
|
|
246
|
+
r && r.forEach((o) => {
|
|
247
|
+
Se(o) && (n != null && n.textStyles ? n.textStyles.push(o) : n.textStyles = [o]), n != null && n.styles ? n.styles.push(o) : n.styles = [o];
|
|
248
|
+
}), this.classes.set(t, n);
|
|
249
|
+
}
|
|
250
|
+
getClasses() {
|
|
251
|
+
return this.classes;
|
|
252
|
+
}
|
|
253
|
+
getStylesForClass(t) {
|
|
254
|
+
var a;
|
|
255
|
+
return ((a = this.classes.get(t)) == null ? void 0 : a.styles) ?? [];
|
|
256
|
+
}
|
|
257
|
+
clear() {
|
|
258
|
+
xe(), this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.root = void 0;
|
|
259
|
+
}
|
|
260
|
+
}, b(Z, "TreeMapDB"), Z);
|
|
261
|
+
function ne(t) {
|
|
262
|
+
if (!t.length)
|
|
263
|
+
return [];
|
|
264
|
+
const a = [], n = [];
|
|
265
|
+
return t.forEach((r) => {
|
|
266
|
+
const o = {
|
|
267
|
+
name: r.name,
|
|
268
|
+
children: r.type === "Leaf" ? void 0 : []
|
|
269
|
+
};
|
|
270
|
+
for (o.classSelector = r == null ? void 0 : r.classSelector, r != null && r.cssCompiledStyles && (o.cssCompiledStyles = [r.cssCompiledStyles]), r.type === "Leaf" && r.value !== void 0 && (o.value = r.value); n.length > 0 && n[n.length - 1].level >= r.level; )
|
|
271
|
+
n.pop();
|
|
272
|
+
if (n.length === 0)
|
|
273
|
+
a.push(o);
|
|
274
|
+
else {
|
|
275
|
+
const s = n[n.length - 1].node;
|
|
276
|
+
s.children ? s.children.push(o) : s.children = [o];
|
|
277
|
+
}
|
|
278
|
+
r.type !== "Leaf" && n.push({ node: o, level: r.level });
|
|
279
|
+
}), a;
|
|
280
|
+
}
|
|
281
|
+
b(ne, "buildHierarchy");
|
|
282
|
+
var Ze = /* @__PURE__ */ b((t, a) => {
|
|
283
|
+
ve(t, a);
|
|
284
|
+
const n = [];
|
|
285
|
+
for (const s of t.TreemapRows ?? [])
|
|
286
|
+
s.$type === "ClassDefStatement" && a.addClass(s.className ?? "", s.styleText ?? "");
|
|
287
|
+
for (const s of t.TreemapRows ?? []) {
|
|
288
|
+
const d = s.item;
|
|
289
|
+
if (!d)
|
|
290
|
+
continue;
|
|
291
|
+
const h = s.indent ? parseInt(s.indent) : 0, f = Je(d), i = d.classSelector ? a.getStylesForClass(d.classSelector) : [], p = i.length > 0 ? i.join(";") : void 0, C = {
|
|
292
|
+
level: h,
|
|
293
|
+
name: f,
|
|
294
|
+
type: d.$type,
|
|
295
|
+
value: d.value,
|
|
296
|
+
classSelector: d.classSelector,
|
|
297
|
+
cssCompiledStyles: p
|
|
298
|
+
};
|
|
299
|
+
n.push(C);
|
|
300
|
+
}
|
|
301
|
+
const r = ne(n), o = /* @__PURE__ */ b((s, d) => {
|
|
302
|
+
for (const h of s)
|
|
303
|
+
a.addNode(h, d), h.children && h.children.length > 0 && o(h.children, d + 1);
|
|
304
|
+
}, "addNodesRecursively");
|
|
305
|
+
o(r, 0);
|
|
306
|
+
}, "populate"), Je = /* @__PURE__ */ b((t) => t.name ? String(t.name) : "", "getItemName"), re = {
|
|
307
|
+
// @ts-expect-error - TreeMapDB is not assignable to DiagramDB
|
|
308
|
+
parser: { yy: void 0 },
|
|
309
|
+
parse: /* @__PURE__ */ b(async (t) => {
|
|
310
|
+
var a;
|
|
311
|
+
try {
|
|
312
|
+
const n = await Ce("treemap", t);
|
|
313
|
+
J.debug("Treemap AST:", n);
|
|
314
|
+
const r = (a = re.parser) == null ? void 0 : a.yy;
|
|
315
|
+
if (!(r instanceof ae))
|
|
316
|
+
throw new Error(
|
|
317
|
+
"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
|
+
);
|
|
319
|
+
Ze(n, r);
|
|
320
|
+
} catch (n) {
|
|
321
|
+
throw J.error("Error parsing treemap:", n), n;
|
|
322
|
+
}
|
|
323
|
+
}, "parse")
|
|
324
|
+
}, Ke = 10, D = 10, _ = 25, Ye = /* @__PURE__ */ b((t, a, n, r) => {
|
|
325
|
+
const o = r.db, s = o.getConfig(), d = s.padding ?? Ke, h = o.getDiagramTitle(), f = o.getRoot(), { themeVariables: i } = te();
|
|
326
|
+
if (!f)
|
|
327
|
+
return;
|
|
328
|
+
const p = h ? 30 : 0, C = ce(a), l = s.nodeWidth ? s.nodeWidth * D : 960, v = s.nodeHeight ? s.nodeHeight * D : 500, S = l, x = v + p;
|
|
329
|
+
C.attr("viewBox", `0 0 ${S} ${x}`), de(C, x, S, s.useMaxWidth);
|
|
330
|
+
let u;
|
|
331
|
+
try {
|
|
332
|
+
const e = s.valueFormat || ",";
|
|
333
|
+
if (e === "$0,0")
|
|
334
|
+
u = /* @__PURE__ */ b((c) => "$" + R(",")(c), "valueFormat");
|
|
335
|
+
else if (e.startsWith("$") && e.includes(",")) {
|
|
336
|
+
const c = /\.\d+/.exec(e), y = c ? c[0] : "";
|
|
337
|
+
u = /* @__PURE__ */ b(($) => "$" + R("," + y)($), "valueFormat");
|
|
338
|
+
} else if (e.startsWith("$")) {
|
|
339
|
+
const c = e.substring(1);
|
|
340
|
+
u = /* @__PURE__ */ b((y) => "$" + R(c || "")(y), "valueFormat");
|
|
341
|
+
} else
|
|
342
|
+
u = R(e);
|
|
343
|
+
} catch (e) {
|
|
344
|
+
J.error("Error creating format function:", e), u = R(",");
|
|
345
|
+
}
|
|
346
|
+
const g = X().range([
|
|
347
|
+
"transparent",
|
|
348
|
+
i.cScale0,
|
|
349
|
+
i.cScale1,
|
|
350
|
+
i.cScale2,
|
|
351
|
+
i.cScale3,
|
|
352
|
+
i.cScale4,
|
|
353
|
+
i.cScale5,
|
|
354
|
+
i.cScale6,
|
|
355
|
+
i.cScale7,
|
|
356
|
+
i.cScale8,
|
|
357
|
+
i.cScale9,
|
|
358
|
+
i.cScale10,
|
|
359
|
+
i.cScale11
|
|
360
|
+
]), F = X().range([
|
|
361
|
+
"transparent",
|
|
362
|
+
i.cScalePeer0,
|
|
363
|
+
i.cScalePeer1,
|
|
364
|
+
i.cScalePeer2,
|
|
365
|
+
i.cScalePeer3,
|
|
366
|
+
i.cScalePeer4,
|
|
367
|
+
i.cScalePeer5,
|
|
368
|
+
i.cScalePeer6,
|
|
369
|
+
i.cScalePeer7,
|
|
370
|
+
i.cScalePeer8,
|
|
371
|
+
i.cScalePeer9,
|
|
372
|
+
i.cScalePeer10,
|
|
373
|
+
i.cScalePeer11
|
|
374
|
+
]), k = X().range([
|
|
375
|
+
i.cScaleLabel0,
|
|
376
|
+
i.cScaleLabel1,
|
|
377
|
+
i.cScaleLabel2,
|
|
378
|
+
i.cScaleLabel3,
|
|
379
|
+
i.cScaleLabel4,
|
|
380
|
+
i.cScaleLabel5,
|
|
381
|
+
i.cScaleLabel6,
|
|
382
|
+
i.cScaleLabel7,
|
|
383
|
+
i.cScaleLabel8,
|
|
384
|
+
i.cScaleLabel9,
|
|
385
|
+
i.cScaleLabel10,
|
|
386
|
+
i.cScaleLabel11
|
|
387
|
+
]);
|
|
388
|
+
h && C.append("text").attr("x", S / 2).attr("y", p / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(h);
|
|
389
|
+
const B = C.append("g").attr("transform", `translate(0, ${p})`).attr("class", "treemapContainer"), N = K(f).sum((e) => e.value ?? 0).sort((e, c) => (c.value ?? 0) - (e.value ?? 0)), L = Xe().size([l, v]).paddingTop(
|
|
390
|
+
(e) => e.children && e.children.length > 0 ? _ + D : 0
|
|
391
|
+
).paddingInner(d).paddingLeft((e) => e.children && e.children.length > 0 ? D : 0).paddingRight((e) => e.children && e.children.length > 0 ? D : 0).paddingBottom((e) => e.children && e.children.length > 0 ? D : 0).round(!0)(N), le = L.descendants().filter((e) => e.children && e.children.length > 0), W = B.selectAll(".treemapSection").data(le).enter().append("g").attr("class", "treemapSection").attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
392
|
+
W.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", _).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (e) => e.depth === 0 ? "display: none;" : ""), W.append("clipPath").attr("id", (e, c) => `clip-section-${a}-${c}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 12)).attr("height", _), W.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", (e, c) => `treemapSection section${c}`).attr("fill", (e) => g(e.data.name)).attr("fill-opacity", 0.6).attr("stroke", (e) => F(e.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (e) => {
|
|
393
|
+
if (e.depth === 0)
|
|
394
|
+
return "display: none;";
|
|
395
|
+
const c = P({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
396
|
+
return c.nodeStyles + ";" + c.borderStyles.join(";");
|
|
397
|
+
}), W.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", _ / 2).attr("dominant-baseline", "middle").text((e) => e.depth === 0 ? "" : e.data.name).attr("font-weight", "bold").attr("style", (e) => {
|
|
398
|
+
if (e.depth === 0)
|
|
399
|
+
return "display: none;";
|
|
400
|
+
const c = "dominant-baseline: middle; font-size: 12px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", y = P({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
401
|
+
return c + y.labelStyles.replace("color:", "fill:");
|
|
402
|
+
}).each(function(e) {
|
|
403
|
+
if (e.depth === 0)
|
|
404
|
+
return;
|
|
405
|
+
const c = U(this), y = e.data.name;
|
|
406
|
+
c.text(y);
|
|
407
|
+
const $ = e.x1 - e.x0, M = 6;
|
|
408
|
+
let z;
|
|
409
|
+
s.showValues !== !1 && e.value ? z = $ - 10 - 30 - 10 - M : z = $ - M - 6;
|
|
410
|
+
const T = Math.max(15, z), w = c.node();
|
|
411
|
+
if (w.getComputedTextLength() > T) {
|
|
412
|
+
let m = y;
|
|
413
|
+
for (; m.length > 0; ) {
|
|
414
|
+
if (m = y.substring(0, m.length - 1), m.length === 0) {
|
|
415
|
+
c.text("..."), w.getComputedTextLength() > T && c.text("");
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
if (c.text(m + "..."), w.getComputedTextLength() <= T)
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}), s.showValues !== !1 && W.append("text").attr("class", "treemapSectionValue").attr("x", (e) => e.x1 - e.x0 - 10).attr("y", _ / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((e) => e.value ? u(e.value) : "").attr("font-style", "italic").attr("style", (e) => {
|
|
423
|
+
if (e.depth === 0)
|
|
424
|
+
return "display: none;";
|
|
425
|
+
const c = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", y = P({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
426
|
+
return c + y.labelStyles.replace("color:", "fill:");
|
|
427
|
+
});
|
|
428
|
+
const se = L.leaves(), j = B.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class", (e, c) => `treemapNode treemapLeafGroup leaf${c}${e.data.classSelector ? ` ${e.data.classSelector}` : ""}x`).attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
429
|
+
j.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", "treemapLeaf").attr("fill", (e) => e.parent ? g(e.parent.data.name) : g(e.data.name)).attr("style", (e) => P({ cssCompiledStyles: e.data.cssCompiledStyles }).nodeStyles).attr("fill-opacity", 0.3).attr("stroke", (e) => e.parent ? g(e.parent.data.name) : g(e.data.name)).attr("stroke-width", 3), j.append("clipPath").attr("id", (e, c) => `clip-${a}-${c}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 4)).attr("height", (e) => Math.max(0, e.y1 - e.y0 - 4)), j.append("text").attr("class", "treemapLabel").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", (e) => (e.y1 - e.y0) / 2).attr("style", (e) => {
|
|
430
|
+
const c = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + k(e.data.name) + ";", y = P({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
431
|
+
return c + y.labelStyles.replace("color:", "fill:");
|
|
432
|
+
}).attr("clip-path", (e, c) => `url(#clip-${a}-${c})`).text((e) => e.data.name).each(function(e) {
|
|
433
|
+
const c = U(this), y = e.x1 - e.x0, $ = e.y1 - e.y0, M = c.node(), z = 4, T = y - 2 * z, w = $ - 2 * z;
|
|
434
|
+
if (T < 10 || w < 10) {
|
|
435
|
+
c.style("display", "none");
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
let m = parseInt(c.style("font-size"), 10);
|
|
439
|
+
const A = 8, E = 28, G = 0.6, I = 6, q = 2;
|
|
440
|
+
for (; M.getComputedTextLength() > T && m > A; )
|
|
441
|
+
m--, c.style("font-size", `${m}px`);
|
|
442
|
+
let O = Math.max(
|
|
443
|
+
I,
|
|
444
|
+
Math.min(E, Math.round(m * G))
|
|
445
|
+
), Y = m + q + O;
|
|
446
|
+
for (; Y > w && m > A && (m--, O = Math.max(
|
|
447
|
+
I,
|
|
448
|
+
Math.min(E, Math.round(m * G))
|
|
449
|
+
), !(O < I && m === A)); )
|
|
450
|
+
c.style("font-size", `${m}px`), Y = m + q + O;
|
|
451
|
+
c.style("font-size", `${m}px`), (M.getComputedTextLength() > T || m < A || w < m) && c.style("display", "none");
|
|
452
|
+
}), s.showValues !== !1 && j.append("text").attr("class", "treemapValue").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", function(e) {
|
|
453
|
+
return (e.y1 - e.y0) / 2;
|
|
454
|
+
}).attr("style", (e) => {
|
|
455
|
+
const c = "text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:" + k(e.data.name) + ";", y = P({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
456
|
+
return c + y.labelStyles.replace("color:", "fill:");
|
|
457
|
+
}).attr("clip-path", (e, c) => `url(#clip-${a}-${c})`).text((e) => e.value ? u(e.value) : "").each(function(e) {
|
|
458
|
+
const c = U(this), y = this.parentNode;
|
|
459
|
+
if (!y) {
|
|
460
|
+
c.style("display", "none");
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
const $ = U(y).select(".treemapLabel");
|
|
464
|
+
if ($.empty() || $.style("display") === "none") {
|
|
465
|
+
c.style("display", "none");
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
const M = parseFloat($.style("font-size")), z = 28, T = 0.6, w = 6, m = 2, A = Math.max(
|
|
469
|
+
w,
|
|
470
|
+
Math.min(z, Math.round(M * T))
|
|
471
|
+
);
|
|
472
|
+
c.style("font-size", `${A}px`);
|
|
473
|
+
const E = (e.y1 - e.y0) / 2 + M / 2 + m;
|
|
474
|
+
c.attr("y", E);
|
|
475
|
+
const G = e.x1 - e.x0, I = e.y1 - e.y0 - 4, q = G - 8;
|
|
476
|
+
c.node().getComputedTextLength() > q || E + A > I || A < w ? c.style("display", "none") : c.style("display", null);
|
|
477
|
+
});
|
|
478
|
+
const oe = s.diagramPadding ?? 8;
|
|
479
|
+
ie(C, oe, "flowchart", (s == null ? void 0 : s.useMaxWidth) || !1);
|
|
480
|
+
}, "draw"), et = /* @__PURE__ */ b(function(t, a) {
|
|
481
|
+
return a.db.getClasses();
|
|
482
|
+
}, "getClasses"), tt = { draw: Ye, getClasses: et }, at = {
|
|
483
|
+
sectionStrokeColor: "black",
|
|
484
|
+
sectionStrokeWidth: "1",
|
|
485
|
+
sectionFillColor: "#efefef",
|
|
486
|
+
leafStrokeColor: "black",
|
|
487
|
+
leafStrokeWidth: "1",
|
|
488
|
+
leafFillColor: "#efefef",
|
|
489
|
+
labelColor: "black",
|
|
490
|
+
labelFontSize: "12px",
|
|
491
|
+
valueFontSize: "10px",
|
|
492
|
+
valueColor: "black",
|
|
493
|
+
titleColor: "black",
|
|
494
|
+
titleFontSize: "14px"
|
|
495
|
+
}, nt = /* @__PURE__ */ b(({
|
|
496
|
+
treemap: t
|
|
497
|
+
} = {}) => {
|
|
498
|
+
const a = ee(at, t);
|
|
499
|
+
return `
|
|
500
|
+
.treemapNode.section {
|
|
501
|
+
stroke: ${a.sectionStrokeColor};
|
|
502
|
+
stroke-width: ${a.sectionStrokeWidth};
|
|
503
|
+
fill: ${a.sectionFillColor};
|
|
504
|
+
}
|
|
505
|
+
.treemapNode.leaf {
|
|
506
|
+
stroke: ${a.leafStrokeColor};
|
|
507
|
+
stroke-width: ${a.leafStrokeWidth};
|
|
508
|
+
fill: ${a.leafFillColor};
|
|
509
|
+
}
|
|
510
|
+
.treemapLabel {
|
|
511
|
+
fill: ${a.labelColor};
|
|
512
|
+
font-size: ${a.labelFontSize};
|
|
513
|
+
}
|
|
514
|
+
.treemapValue {
|
|
515
|
+
fill: ${a.valueColor};
|
|
516
|
+
font-size: ${a.valueFontSize};
|
|
517
|
+
}
|
|
518
|
+
.treemapTitle {
|
|
519
|
+
fill: ${a.titleColor};
|
|
520
|
+
font-size: ${a.titleFontSize};
|
|
521
|
+
}
|
|
522
|
+
`;
|
|
523
|
+
}, "getStyles"), rt = nt, ht = {
|
|
524
|
+
parser: re,
|
|
525
|
+
get db() {
|
|
526
|
+
return new ae();
|
|
527
|
+
},
|
|
528
|
+
renderer: tt,
|
|
529
|
+
styles: rt
|
|
530
|
+
};
|
|
531
|
+
export {
|
|
532
|
+
ht as diagram
|
|
533
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { m as v } from "./chunk-ANTBXLJU-BhR1MDfy-Bec7kb00.js";
|
|
2
|
+
import { _ as f, aA as m, aU as B, aa as S, l as w, a8 as P, a7 as T, an as z, ao as D, a6 as A, a5 as E, aB as F, aC as W, at as M } from "./index-BDD0CD9m.js";
|
|
3
|
+
import { N as Y } from "./mermaid-parser.core-DHL9WXVx-DeKF3RZx.js";
|
|
4
|
+
var _ = W.packet, u, y = (u = class {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.packet = [], this.setAccTitle = P, this.getAccTitle = T, this.setDiagramTitle = z, this.getDiagramTitle = D, this.getAccDescription = A, this.setAccDescription = E;
|
|
7
|
+
}
|
|
8
|
+
getConfig() {
|
|
9
|
+
const t = m({
|
|
10
|
+
..._,
|
|
11
|
+
...F().packet
|
|
12
|
+
});
|
|
13
|
+
return t.showBits && (t.paddingY += 10), t;
|
|
14
|
+
}
|
|
15
|
+
getPacket() {
|
|
16
|
+
return this.packet;
|
|
17
|
+
}
|
|
18
|
+
pushWord(t) {
|
|
19
|
+
t.length > 0 && this.packet.push(t);
|
|
20
|
+
}
|
|
21
|
+
clear() {
|
|
22
|
+
M(), this.packet = [];
|
|
23
|
+
}
|
|
24
|
+
}, f(u, "PacketDB"), u), H = 1e4, L = /* @__PURE__ */ f((t, e) => {
|
|
25
|
+
v(t, e);
|
|
26
|
+
let i = -1, r = [], l = 1;
|
|
27
|
+
const { bitsPerRow: n } = e.getConfig();
|
|
28
|
+
for (let { start: a, end: o, bits: c, label: d } of t.blocks) {
|
|
29
|
+
if (a !== void 0 && o !== void 0 && o < a)
|
|
30
|
+
throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);
|
|
31
|
+
if (a ?? (a = i + 1), a !== i + 1)
|
|
32
|
+
throw new Error(
|
|
33
|
+
`Packet block ${a} - ${o ?? a} is not contiguous. It should start from ${i + 1}.`
|
|
34
|
+
);
|
|
35
|
+
if (c === 0)
|
|
36
|
+
throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
|
|
37
|
+
for (o ?? (o = a + (c ?? 1) - 1), c ?? (c = o - a + 1), i = o, w.debug(`Packet block ${a} - ${i} with label ${d}`); r.length <= n + 1 && e.getPacket().length < H; ) {
|
|
38
|
+
const [p, s] = N({ start: a, end: o, bits: c, label: d }, l, n);
|
|
39
|
+
if (r.push(p), p.end + 1 === l * n && (e.pushWord(r), r = [], l++), !s)
|
|
40
|
+
break;
|
|
41
|
+
({ start: a, end: o, bits: c, label: d } = s);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
e.pushWord(r);
|
|
45
|
+
}, "populate"), N = /* @__PURE__ */ f((t, e, i) => {
|
|
46
|
+
if (t.start === void 0)
|
|
47
|
+
throw new Error("start should have been set during first phase");
|
|
48
|
+
if (t.end === void 0)
|
|
49
|
+
throw new Error("end should have been set during first phase");
|
|
50
|
+
if (t.start > t.end)
|
|
51
|
+
throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);
|
|
52
|
+
if (t.end + 1 <= e * i)
|
|
53
|
+
return [t, void 0];
|
|
54
|
+
const r = e * i - 1, l = e * i;
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
start: t.start,
|
|
58
|
+
end: r,
|
|
59
|
+
label: t.label,
|
|
60
|
+
bits: r - t.start
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
start: l,
|
|
64
|
+
end: t.end,
|
|
65
|
+
label: t.label,
|
|
66
|
+
bits: t.end - l
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
}, "getNextFittingBlock"), x = {
|
|
70
|
+
// @ts-expect-error - PacketDB is not assignable to DiagramDB
|
|
71
|
+
parser: { yy: void 0 },
|
|
72
|
+
parse: /* @__PURE__ */ f(async (t) => {
|
|
73
|
+
var e;
|
|
74
|
+
const i = await Y("packet", t), r = (e = x.parser) == null ? void 0 : e.yy;
|
|
75
|
+
if (!(r instanceof y))
|
|
76
|
+
throw new Error(
|
|
77
|
+
"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
|
+
);
|
|
79
|
+
w.debug(i), L(i, r);
|
|
80
|
+
}, "parse")
|
|
81
|
+
}, R = /* @__PURE__ */ f((t, e, i, r) => {
|
|
82
|
+
const l = r.db, n = l.getConfig(), { rowHeight: a, paddingY: o, bitWidth: c, bitsPerRow: d } = n, p = l.getPacket(), s = l.getDiagramTitle(), b = a + o, h = b * (p.length + 1) - (s ? 0 : a), k = c * d + 2, g = B(e);
|
|
83
|
+
g.attr("viewbox", `0 0 ${k} ${h}`), S(g, h, k, n.useMaxWidth);
|
|
84
|
+
for (const [$, C] of p.entries())
|
|
85
|
+
j(g, C, $, n);
|
|
86
|
+
g.append("text").text(s).attr("x", k / 2).attr("y", h - b / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
87
|
+
}, "draw"), j = /* @__PURE__ */ f((t, e, i, { rowHeight: r, paddingX: l, paddingY: n, bitWidth: a, bitsPerRow: o, showBits: c }) => {
|
|
88
|
+
const d = t.append("g"), p = i * (r + n) + n;
|
|
89
|
+
for (const s of e) {
|
|
90
|
+
const b = s.start % o * a + 1, h = (s.end - s.start + 1) * a - l;
|
|
91
|
+
if (d.append("rect").attr("x", b).attr("y", p).attr("width", h).attr("height", r).attr("class", "packetBlock"), d.append("text").attr("x", b + h / 2).attr("y", p + r / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(s.label), !c)
|
|
92
|
+
continue;
|
|
93
|
+
const k = s.end === s.start, g = p - 2;
|
|
94
|
+
d.append("text").attr("x", b + (k ? h / 2 : 0)).attr("y", g).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", k ? "middle" : "start").text(s.start), k || d.append("text").attr("x", b + h).attr("y", g).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(s.end);
|
|
95
|
+
}
|
|
96
|
+
}, "drawWord"), I = { draw: R }, X = {
|
|
97
|
+
byteFontSize: "10px",
|
|
98
|
+
startByteColor: "black",
|
|
99
|
+
endByteColor: "black",
|
|
100
|
+
labelColor: "black",
|
|
101
|
+
labelFontSize: "12px",
|
|
102
|
+
titleColor: "black",
|
|
103
|
+
titleFontSize: "14px",
|
|
104
|
+
blockStrokeColor: "black",
|
|
105
|
+
blockStrokeWidth: "1",
|
|
106
|
+
blockFillColor: "#efefef"
|
|
107
|
+
}, q = /* @__PURE__ */ f(({ packet: t } = {}) => {
|
|
108
|
+
const e = m(X, t);
|
|
109
|
+
return `
|
|
110
|
+
.packetByte {
|
|
111
|
+
font-size: ${e.byteFontSize};
|
|
112
|
+
}
|
|
113
|
+
.packetByte.start {
|
|
114
|
+
fill: ${e.startByteColor};
|
|
115
|
+
}
|
|
116
|
+
.packetByte.end {
|
|
117
|
+
fill: ${e.endByteColor};
|
|
118
|
+
}
|
|
119
|
+
.packetLabel {
|
|
120
|
+
fill: ${e.labelColor};
|
|
121
|
+
font-size: ${e.labelFontSize};
|
|
122
|
+
}
|
|
123
|
+
.packetTitle {
|
|
124
|
+
fill: ${e.titleColor};
|
|
125
|
+
font-size: ${e.titleFontSize};
|
|
126
|
+
}
|
|
127
|
+
.packetBlock {
|
|
128
|
+
stroke: ${e.blockStrokeColor};
|
|
129
|
+
stroke-width: ${e.blockStrokeWidth};
|
|
130
|
+
fill: ${e.blockFillColor};
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
}, "styles"), J = {
|
|
134
|
+
parser: x,
|
|
135
|
+
get db() {
|
|
136
|
+
return new y();
|
|
137
|
+
},
|
|
138
|
+
renderer: I,
|
|
139
|
+
styles: q
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
J as diagram
|
|
143
|
+
};
|