@aiquants/markdown 12.2.3 → 12.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -16
- package/dist/{abnfDiagram-VRR7QNED-DQ52KUbH.js → abnfDiagram-VRR7QNED-B_QmXzWv.js} +3 -3
- package/dist/{abnfDiagram-VRR7QNED-1fn6qV_P.cjs → abnfDiagram-VRR7QNED-Crz-ChMJ.cjs} +1 -1
- package/dist/{arc-D9kg3f8-.js → arc-BKGy6Me1.js} +32 -32
- package/dist/{arc-D8xGHwLe.cjs → arc-CYJCyviq.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-Cc9gQRX2.js → architectureDiagram-ZJ3FMSHR-CEb923Bc.js} +123 -123
- package/dist/{architectureDiagram-ZJ3FMSHR-C4QxQA-o.cjs → architectureDiagram-ZJ3FMSHR-gTB8pttO.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-DIpIE77y.js → blockDiagram-677ZJIJ3-CmKMdhaS.js} +166 -166
- package/dist/{blockDiagram-677ZJIJ3-BCgCtZXM.cjs → blockDiagram-677ZJIJ3-D7RRzjUx.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-jgR25uUP.js → c4Diagram-LMCZKHZV-CG6fvZQo.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-q0iHoZqg.cjs → c4Diagram-LMCZKHZV-W7Qa-ecL.cjs} +1 -1
- package/dist/{channel-DuWQwUVP.cjs → channel-BKoPLS2j.cjs} +1 -1
- package/dist/{channel-Bw3o-12p.js → channel-TsF8sms_.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-0amJDSXB.js → chunk-2Q5K7J3B-CopwR1m3.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-gCP3NILS.cjs → chunk-2Q5K7J3B-DgtYKcDs.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-BMqTi8UH.js → chunk-32BRIVSS-BnNlhc1M.js} +1 -1
- package/dist/{chunk-32BRIVSS-PidRQo43.cjs → chunk-32BRIVSS-D-6GBFtx.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-EGE3VaH8.js → chunk-5VM5RSS4-O28FGAOF.js} +1 -1
- package/dist/{chunk-5VM5RSS4-C0OtlojA.cjs → chunk-5VM5RSS4-lKwSmIqG.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-wasnZ2h7.js → chunk-EX3LRPZG-C36gZH3_.js} +26 -26
- package/dist/{chunk-EX3LRPZG-4qSuVZkz.cjs → chunk-EX3LRPZG-CtFe4olX.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-CHK_g5p5.cjs → chunk-JWPE2WC7-5sd39cpa.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-O891tu2Q.js → chunk-JWPE2WC7-DG0ebjV4.js} +1 -1
- package/dist/{chunk-MOJQB5TN-BSfpWEVd.cjs → chunk-MOJQB5TN-DADVbG98.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-BzuZr6pz.js → chunk-MOJQB5TN-nqR_swpx.js} +15 -15
- package/dist/{chunk-PUDLZKDR-DNbm7Xzd.cjs → chunk-PUDLZKDR-BUSFO-Gx.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-BRL3efwE.js → chunk-PUDLZKDR-CD96jce3.js} +13 -13
- package/dist/{chunk-RYQCIY6F-B_33Thwg.cjs → chunk-RYQCIY6F-BBTBydZd.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-DwmsCCiA.js → chunk-RYQCIY6F-DJkrr1sD.js} +5 -5
- package/dist/{chunk-V7JOEXUC-BowEdIo-.cjs → chunk-V7JOEXUC-BzCaDGop.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-D0oynREN.js → chunk-V7JOEXUC-eBy2sAXD.js} +15 -15
- package/dist/{chunk-VR4S4FIN-Dg_3SNs1.js → chunk-VR4S4FIN-C-qPzUSR.js} +3 -3
- package/dist/{chunk-VR4S4FIN-Ca3mlCgX.cjs → chunk-VR4S4FIN-CHKLwvYh.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-Byo5u3b_.js → chunk-XXDRQBXY-BK6HOWf6.js} +1 -1
- package/dist/{chunk-XXDRQBXY-CeZMmeIi.cjs → chunk-XXDRQBXY-DttkP7wv.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-DPzttpgE.cjs → classDiagram-OUVF2IWQ-BKruajP_.cjs} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-CVu4_B8x.js → classDiagram-OUVF2IWQ-CPDmG5kI.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-DPzttpgE.cjs → classDiagram-v2-EOCWNBFH-BKruajP_.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-CVu4_B8x.js → classDiagram-v2-EOCWNBFH-CPDmG5kI.js} +2 -2
- package/dist/components/CopyButton.d.ts +9 -0
- package/dist/components/HostedScrollArea.d.ts +2 -1
- package/dist/components/MarkdownRenderer.d.ts +7 -2
- package/dist/components/MarkdownViewer.d.ts +5 -3
- package/dist/components/SpreadsheetBlock.d.ts +3 -2
- package/dist/components/codeBlockLabels.d.ts +9 -0
- package/dist/components/cssLength.d.ts +1 -0
- package/dist/components/displayMathLabels.d.ts +11 -0
- package/dist/components/mathRendering.d.ts +3 -1
- package/dist/components/mdastNodes/CodeNode.d.ts +3 -1
- package/dist/components/mdastNodes/MathNode.d.ts +6 -5
- package/dist/components/ownPixels.d.ts +3 -0
- package/dist/components/toolbarOverlap.d.ts +4 -1
- package/dist/components/viewerLabels.d.ts +11 -1
- package/dist/components/viewerToolbarStyles.d.ts +2 -0
- package/dist/converter.wasm +0 -0
- package/dist/{cose-bilkent-JH36ORCC-BmM-AQ-j.js → cose-bilkent-JH36ORCC-BxO1rjEU.js} +24 -24
- package/dist/{cose-bilkent-JH36ORCC-C3UAMvQQ.cjs → cose-bilkent-JH36ORCC-Cjfa6NyL.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-DStGofoE.cjs → cynefinDiagram-TSTJHNR4-B3boTACW.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-iS4n-7T_.js → cynefinDiagram-TSTJHNR4-DBD-B_Un.js} +60 -60
- package/dist/{dagre-VKFMJZFB-C1Y6S6Dm.js → dagre-VKFMJZFB-B8vZCPJg.js} +17 -17
- package/dist/{dagre-VKFMJZFB-BXsQ5-Ek.cjs → dagre-VKFMJZFB-DF3Mvuas.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-CRXs7mU1.cjs → diagram-FQU43EPY-DwhEcKWF.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-CFG9AlAq.js → diagram-FQU43EPY-YrRTNuX-.js} +36 -36
- package/dist/{diagram-G47NLZAW-BaX-jrfs.cjs → diagram-G47NLZAW-CKIEbGLS.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-Bqr76Qn5.js → diagram-G47NLZAW-D4vmirJw.js} +51 -51
- package/dist/{diagram-NH7WQ7WH-Cczq2y99.cjs → diagram-NH7WQ7WH-D6wMwkLQ.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-BDWfQ8xs.js → diagram-NH7WQ7WH-Drekwiur.js} +10 -10
- package/dist/{diagram-OA4YK3LP-DuW90Uhk.js → diagram-OA4YK3LP-DZsM4Fpo.js} +21 -21
- package/dist/{diagram-OA4YK3LP-uBVV8yBB.cjs → diagram-OA4YK3LP-DeJ7pMIO.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-Cd3qe8Wi.js → diagram-WEI45ONY-CjRbsbkF.js} +32 -32
- package/dist/{diagram-WEI45ONY-C_L-4kui.cjs → diagram-WEI45ONY-SYHw7k8b.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-Cg7DTSlM.cjs → ebnfDiagram-CCIWWBDH-23bjk9FU.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-CMmTdVTT.js → ebnfDiagram-CCIWWBDH-D0kt5Zdu.js} +3 -3
- package/dist/{erDiagram-Q63AITRT-tOZoI25O.js → erDiagram-Q63AITRT-Ce4GpK2Z.js} +7 -7
- package/dist/{erDiagram-Q63AITRT-ONnVKrzr.cjs → erDiagram-Q63AITRT-DqFANbZx.cjs} +1 -1
- package/dist/{extractHeadings-3qWVTkb9.js → extractHeadings-DlQcPv5N.js} +8033 -7962
- package/dist/extractHeadings-wWAipplS.cjs +315 -0
- package/dist/flowDiagram-23GEKE2U-CRC9U6qD.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-CRo7TM3K.js +7 -0
- package/dist/{ganttDiagram-NO4QXBWP-CHP_muri.cjs → ganttDiagram-NO4QXBWP-CR55KG5d.cjs} +1 -1
- package/dist/{ganttDiagram-NO4QXBWP-C23vm5cK.js → ganttDiagram-NO4QXBWP-DjpANtqX.js} +2 -2
- package/dist/{gitGraphDiagram-IHSO6WYX-DOH3WBNZ.cjs → gitGraphDiagram-IHSO6WYX-BWYUn1Bi.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-BXWses91.js → gitGraphDiagram-IHSO6WYX-DzhnsGXo.js} +24 -24
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +3 -1
- package/dist/index.client.js +50 -48
- package/dist/index.js +50 -48
- package/dist/{infoDiagram-FWYZ7A6U-Bj2fnr5Y.cjs → infoDiagram-FWYZ7A6U-CsUGc58_.cjs} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-C4NsbHAN.js → infoDiagram-FWYZ7A6U-hraoyboI.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-Cjqwv-T2.cjs → ishikawaDiagram-FXEZZL3T-D5b25aDN.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-B2bMsFnl.js → ishikawaDiagram-FXEZZL3T-cBJei3wJ.js} +32 -32
- package/dist/{journeyDiagram-5HDEW3XC-DfRiiYRf.cjs → journeyDiagram-5HDEW3XC-DrNyUSsx.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-DO1Xx-OE.js → journeyDiagram-5HDEW3XC-IkQqMl8f.js} +28 -28
- package/dist/{kanban-definition-HUTT4EX6-Cu_E-BJj.cjs → kanban-definition-HUTT4EX6-CvBgN3eX.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-RfpoaM17.js → kanban-definition-HUTT4EX6-D2UL88Cz.js} +46 -46
- package/dist/{linear-BbWOUIQi.js → linear-BiJV9gYf.js} +10 -10
- package/dist/{linear-Cz3x9Lkl.cjs → linear-DwqXGYLc.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-CB606E3L.cjs → mindmap-definition-LN4V7U3C-CBrUse7P.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-B5LpvJ9m.js → mindmap-definition-LN4V7U3C-CK67hf6V.js} +11 -11
- package/dist/{pegDiagram-2B236MQR-BCqBc3Re.cjs → pegDiagram-2B236MQR-C5pLIpKI.cjs} +1 -1
- package/dist/{pegDiagram-2B236MQR-DaosueJV.js → pegDiagram-2B236MQR-CwWX4Irn.js} +3 -3
- package/dist/{pieDiagram-ENE6RG2P-BUY2Dvjo.cjs → pieDiagram-ENE6RG2P-BKvggS7k.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-wfsOfWyT.js → pieDiagram-ENE6RG2P-MO42pSl8.js} +68 -68
- package/dist/{quadrantDiagram-ABIIQ3AL-BSvHqsTp.cjs → quadrantDiagram-ABIIQ3AL-BHhoAvLS.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-Bgc3vspL.js → quadrantDiagram-ABIIQ3AL-CzHgLdS3.js} +7 -7
- package/dist/{railroadDiagram-RFXS5EU6-Du2CFU9M.js → railroadDiagram-RFXS5EU6-Bu_Fhi5x.js} +3 -3
- package/dist/{railroadDiagram-RFXS5EU6-DdF2c_n3.cjs → railroadDiagram-RFXS5EU6-CwGmOFD_.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-WM3sItRw.cjs → requirementDiagram-TGXJPOKE-BhdvQnjG.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-CnafqSUP.js → requirementDiagram-TGXJPOKE-CY-JYM-P.js} +18 -18
- package/dist/{sankeyDiagram-HTMAVEWB-D4Qv4d98.js → sankeyDiagram-HTMAVEWB-BmHtjxlW.js} +10 -10
- package/dist/{sankeyDiagram-HTMAVEWB-DaZN3ZDb.cjs → sankeyDiagram-HTMAVEWB-CUeYKZeQ.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-CmP6XGGE.js → sequenceDiagram-DBY2YBRQ-Cn2CC9BC.js} +47 -47
- package/dist/{sequenceDiagram-DBY2YBRQ-C6fa7Axs.cjs → sequenceDiagram-DBY2YBRQ-GepntdDB.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-mWZkTwA5.js → sizeCapture-X5ZJPWSS-CZF99dy_.js} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-B6sRQba9.cjs → sizeCapture-X5ZJPWSS-Cd-k8xwk.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-ClDZKhLD.js → stateDiagram-2N3HPSRC-CCbBvBua.js} +18 -18
- package/dist/{stateDiagram-2N3HPSRC-B__29zPZ.cjs → stateDiagram-2N3HPSRC-D2cvrAtN.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-BA-_ovVY.cjs → stateDiagram-v2-6OUMAXLB-BaktPIVY.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-K7slPgH_.js → stateDiagram-v2-6OUMAXLB-_A1QESxx.js} +2 -2
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/markdown.standalone.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-Cpowlk7O.js → swimlanes-5IMT3BWC-B-BDM_Ae.js} +3 -3
- package/dist/{swimlanes-5IMT3BWC-BhxZhB7M.cjs → swimlanes-5IMT3BWC-DtdLK5z3.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-36K4ynZn.js → swimlanesDiagram-G3AALYLV-BysT2rWl.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-BZ0eguZa.cjs → swimlanesDiagram-G3AALYLV-DZuQxKuB.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-C2xHtlkw.js → timeline-definition-FHXFAJF6-DVzdzbl1.js} +58 -58
- package/dist/{timeline-definition-FHXFAJF6-BJN69nkZ.cjs → timeline-definition-FHXFAJF6-oFf_sUOI.cjs} +1 -1
- package/dist/utils/promiseTry.d.ts +1 -0
- package/dist/{vennDiagram-L72KCM5P-3R1vuMWd.cjs → vennDiagram-L72KCM5P-Ba2FGeN1.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-DbqRaWm5.js → vennDiagram-L72KCM5P-Bm1TGZux.js} +146 -146
- package/dist/{wardleyDiagram-EHGQE667-CF5I0pM9.js → wardleyDiagram-EHGQE667-BC_1RAbp.js} +32 -32
- package/dist/{wardleyDiagram-EHGQE667-CyU76ilz.cjs → wardleyDiagram-EHGQE667-CqB3gLCH.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-spkx-w6w.js → xychartDiagram-FW5EYKEG-ClITdEhV.js} +47 -47
- package/dist/{xychartDiagram-FW5EYKEG-DaKE_uIg.cjs → xychartDiagram-FW5EYKEG-a1vb5UxD.cjs} +1 -1
- package/package.json +10 -11
- package/dist/extractHeadings-DpvwXCio.cjs +0 -315
- package/dist/flowDiagram-23GEKE2U-DfDAl_qd.cjs +0 -1
- package/dist/flowDiagram-23GEKE2U-p6ccACf3.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as re } from "./chunk-JWPE2WC7-
|
|
2
|
-
import {
|
|
1
|
+
import { p as re } from "./chunk-JWPE2WC7-DG0ebjV4.js";
|
|
2
|
+
import { ab as oe, aa as se, K as de, O as le, Q as ce, R as me, _ as o, W as g, U as T, V as ue, al as xe, ag as fe, am as ge, ak as M, an as he, a0 as y, a2 as P, b1 as pe } from "./extractHeadings-DlQcPv5N.js";
|
|
3
3
|
import { p as be, i as ve } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
|
|
4
|
-
var
|
|
4
|
+
var $ = "position frame", D = "frame positioned", S = "position relation", N = "relation positioned", we = /* @__PURE__ */ o(function(e) {
|
|
5
5
|
g.debug("options str", e);
|
|
6
6
|
}, "setOptions"), ye = /* @__PURE__ */ o(function() {
|
|
7
7
|
return {};
|
|
@@ -22,9 +22,9 @@ function O() {
|
|
|
22
22
|
if (!n)
|
|
23
23
|
throw new Error("No data for EventModel");
|
|
24
24
|
return n.frames.forEach((i, a) => {
|
|
25
|
-
const r =
|
|
25
|
+
const r = V(i, n.dataEntities, t);
|
|
26
26
|
e = v(e, {
|
|
27
|
-
$kind:
|
|
27
|
+
$kind: $,
|
|
28
28
|
index: a,
|
|
29
29
|
frame: i,
|
|
30
30
|
textProps: r
|
|
@@ -48,10 +48,10 @@ function O() {
|
|
|
48
48
|
}, e;
|
|
49
49
|
}
|
|
50
50
|
o(O, "getState");
|
|
51
|
-
function
|
|
51
|
+
function W(e) {
|
|
52
52
|
B.ast = e;
|
|
53
53
|
}
|
|
54
|
-
o(
|
|
54
|
+
o(W, "setAst");
|
|
55
55
|
var s = {
|
|
56
56
|
swimlaneMinHeight: 70,
|
|
57
57
|
swimlanePadding: 15,
|
|
@@ -86,12 +86,12 @@ var Fe = {
|
|
|
86
86
|
maxR: 0,
|
|
87
87
|
sortedSwimlanesArray: []
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function I(e) {
|
|
90
90
|
const n = e.split(".");
|
|
91
91
|
if (n.length === 2)
|
|
92
92
|
return n[0];
|
|
93
93
|
}
|
|
94
|
-
o(
|
|
94
|
+
o(I, "extractNamespace");
|
|
95
95
|
function H(e) {
|
|
96
96
|
const n = e.split(".");
|
|
97
97
|
return n.length === 2 ? n[1] : e;
|
|
@@ -113,7 +113,7 @@ function b(e, n, t) {
|
|
|
113
113
|
}
|
|
114
114
|
o(b, "findNextAvailableIndex");
|
|
115
115
|
function _(e, n) {
|
|
116
|
-
const t =
|
|
116
|
+
const t = I(e.entityIdentifier), i = U(n, t);
|
|
117
117
|
switch (e.modelEntityType) {
|
|
118
118
|
case "ui":
|
|
119
119
|
case "pcr":
|
|
@@ -147,7 +147,7 @@ function _(e, n) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
o(_, "calculateSwimlaneProps");
|
|
150
|
-
function
|
|
150
|
+
function L(e) {
|
|
151
151
|
const { themeVariables: n } = M();
|
|
152
152
|
switch (e.modelEntityType) {
|
|
153
153
|
case "ui":
|
|
@@ -186,8 +186,8 @@ function G(e) {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
o(
|
|
190
|
-
function
|
|
189
|
+
o(L, "calculateEntityVisualProps");
|
|
190
|
+
function V(e, n, t) {
|
|
191
191
|
const i = M(), a = y(H(e.entityIdentifier) ?? "", i);
|
|
192
192
|
let r;
|
|
193
193
|
const d = {
|
|
@@ -217,9 +217,9 @@ function L(e, n, t) {
|
|
|
217
217
|
};
|
|
218
218
|
return g.debug(`[${e.name}] ${e.entityIdentifier} text`, f), f;
|
|
219
219
|
}
|
|
220
|
-
o(
|
|
221
|
-
function
|
|
222
|
-
const t = n, i =
|
|
220
|
+
o(V, "calculateTextProps");
|
|
221
|
+
function G(e, n) {
|
|
222
|
+
const t = n, i = L(t.frame), a = {
|
|
223
223
|
width: t.textProps.width + 2 * s.boxTextPadding,
|
|
224
224
|
height: t.textProps.height + 2 * s.boxTextPadding
|
|
225
225
|
};
|
|
@@ -232,7 +232,7 @@ function V(e, n) {
|
|
|
232
232
|
textProps: t.textProps
|
|
233
233
|
}];
|
|
234
234
|
}
|
|
235
|
-
o(
|
|
235
|
+
o(G, "decidePositionFrame");
|
|
236
236
|
function X(e, n, t) {
|
|
237
237
|
return n === void 0 ? s.contentStartX : n.index === e.index && e.r ? e.r + s.boxPadding : t === void 0 ? s.contentStartX : t.r - s.boxOverlap + s.boxPadding;
|
|
238
238
|
}
|
|
@@ -312,7 +312,7 @@ function k(e, n) {
|
|
|
312
312
|
return e.find((t) => t.frame.name === n.name);
|
|
313
313
|
}
|
|
314
314
|
o(k, "findBoxByFrame");
|
|
315
|
-
function
|
|
315
|
+
function Q(e, n, t) {
|
|
316
316
|
if (!(t < 0))
|
|
317
317
|
for (let i = t; i >= 0; i--) {
|
|
318
318
|
const a = e[i];
|
|
@@ -320,8 +320,8 @@ function J(e, n, t) {
|
|
|
320
320
|
return a;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
o(
|
|
324
|
-
function
|
|
323
|
+
o(Q, "findBoxByLineIndex");
|
|
324
|
+
function q(e, n) {
|
|
325
325
|
const t = n;
|
|
326
326
|
if (ve(t.frame) || K(t.index, t.frame))
|
|
327
327
|
return [];
|
|
@@ -329,7 +329,7 @@ function Q(e, n) {
|
|
|
329
329
|
if (i === void 0)
|
|
330
330
|
throw new Error(`Target box not found for frame ${t.frame.name}`);
|
|
331
331
|
let a;
|
|
332
|
-
return t.sourceFrame ? a = k(e.boxes, t.sourceFrame) : a =
|
|
332
|
+
return t.sourceFrame ? a = k(e.boxes, t.sourceFrame) : a = Q(e.boxes, i.swimlane.index, t.index - 1), a === void 0 ? [] : [{
|
|
333
333
|
$kind: N,
|
|
334
334
|
frame: t.frame,
|
|
335
335
|
index: t.index,
|
|
@@ -337,8 +337,8 @@ function Q(e, n) {
|
|
|
337
337
|
targetBox: i
|
|
338
338
|
}];
|
|
339
339
|
}
|
|
340
|
-
o(
|
|
341
|
-
function
|
|
340
|
+
o(q, "decidePositionRelation");
|
|
341
|
+
function J(e, n) {
|
|
342
342
|
const t = n, i = {
|
|
343
343
|
visual: {
|
|
344
344
|
fill: "none",
|
|
@@ -360,13 +360,13 @@ function q(e, n) {
|
|
|
360
360
|
relations: [...e.relations, i]
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
o(
|
|
363
|
+
o(J, "evolveRelationPositioned");
|
|
364
364
|
var Me = {
|
|
365
|
-
[
|
|
366
|
-
[S]:
|
|
365
|
+
[$]: G,
|
|
366
|
+
[S]: q
|
|
367
367
|
}, Be = {
|
|
368
368
|
[D]: Y,
|
|
369
|
-
[N]:
|
|
369
|
+
[N]: J
|
|
370
370
|
};
|
|
371
371
|
function Z(e, n) {
|
|
372
372
|
const t = Me[n.$kind];
|
|
@@ -400,7 +400,7 @@ var F = {
|
|
|
400
400
|
setAccDescription: de,
|
|
401
401
|
setDiagramTitle: se,
|
|
402
402
|
getDiagramTitle: oe,
|
|
403
|
-
setAst:
|
|
403
|
+
setAst: W,
|
|
404
404
|
getDiagramProps: E,
|
|
405
405
|
getState: O
|
|
406
406
|
}, Ee = {
|
|
@@ -408,7 +408,7 @@ var F = {
|
|
|
408
408
|
const n = await be("eventmodeling", e);
|
|
409
409
|
g.debug(n), F.setAst(n), re(n, F);
|
|
410
410
|
}, "parse")
|
|
411
|
-
}, Ae =
|
|
411
|
+
}, Ae = T(), Re = Ae?.eventmodeling;
|
|
412
412
|
function te(e, n) {
|
|
413
413
|
return (t) => {
|
|
414
414
|
const i = t.swimlane.y + n.swimlanePadding, a = e.append("g").attr("class", "em-box");
|
|
@@ -440,22 +440,22 @@ function ae(e, n, t, i) {
|
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
442
|
o(ae, "renderD3Swimlane");
|
|
443
|
-
var
|
|
443
|
+
var Te = /* @__PURE__ */ o(function(e, n, t, i) {
|
|
444
444
|
if (g.debug("in eventmodeling renderer", e + `
|
|
445
445
|
`, "id:", n, t), !Re)
|
|
446
446
|
throw new Error("EventModeling config not found");
|
|
447
|
-
const a = i.db, { themeVariables: r, eventmodeling: d } =
|
|
447
|
+
const a = i.db, { themeVariables: r, eventmodeling: d } = T(), l = ue(`[id="${n}"]`), c = a.getDiagramProps(), m = a.getState(), x = `em-arrowhead-${n}`, u = r.emArrowhead ?? "#000000";
|
|
448
448
|
m.sortedSwimlanesArray.forEach(
|
|
449
449
|
ae(l, m.maxR, c, r)
|
|
450
450
|
), m.boxes.forEach(te(l, c)), m.relations.forEach(ie(l, c, x, r)), l.append("defs").append("marker").attr("id", x).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", u), xe(void 0, l, d?.padding ?? 30, d?.useMaxWidth);
|
|
451
|
-
}, "draw"),
|
|
452
|
-
draw:
|
|
453
|
-
}, De = /* @__PURE__ */ o((e) => "", "getStyles"), Ne = De,
|
|
451
|
+
}, "draw"), $e = {
|
|
452
|
+
draw: Te
|
|
453
|
+
}, De = /* @__PURE__ */ o((e) => "", "getStyles"), Ne = De, Ie = {
|
|
454
454
|
parser: Ee,
|
|
455
455
|
db: F,
|
|
456
|
-
renderer:
|
|
456
|
+
renderer: $e,
|
|
457
457
|
styles: Ne
|
|
458
458
|
};
|
|
459
459
|
export {
|
|
460
|
-
|
|
460
|
+
Ie as diagram
|
|
461
461
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("./chunk-JWPE2WC7-CHK_g5p5.cjs"),h=require("./extractHeadings-DpvwXCio.cjs"),ue=require("./chunk-VR4S4FIN-Ca3mlCgX.cjs"),pe=require("./cynefin-VYW2F7L2-MpAliYy9.cjs"),I=require("./defaultLocale-C4wbwF1n.cjs"),Z=require("./ordinal-CagbB1m8.cjs");function fe(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ge(){return this.eachAfter(fe)}function me(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ye(t,a){for(var l=this,n=[l],r,i,d=-1;l=n.pop();)if(t.call(a,l,++d,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function Se(t,a){for(var l=this,n=[l],r=[],i,d,u,y=-1;l=n.pop();)if(r.push(l),i=l.children)for(d=0,u=i.length;d<u;++d)n.push(i[d]);for(;l=r.pop();)t.call(a,l,++y,this);return this}function ve(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function xe(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function be(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function we(t){for(var a=this,l=Ce(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ce(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function Te(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function _e(){return Array.from(this)}function Le(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function $e(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ae(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)l.push(n[r]);while(l.length)}function K(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ne)):a===void 0&&(a=Me);for(var l=new j(t),n,r=[l],i,d,u,y;n=r.pop();)if((d=a(n.data))&&(y=(d=Array.from(d)).length))for(n.children=d,u=y-1;u>=0;--u)r.push(i=d[u]=new j(d[u])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ve)}function Fe(){return K(this).eachBefore(ke)}function Me(t){return t.children}function Ne(t){return Array.isArray(t)?t[1]:null}function ke(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ve(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function j(t){this.data=t,this.depth=this.height=0,this.parent=null}j.prototype=K.prototype={constructor:j,count:ge,each:me,eachAfter:Se,eachBefore:ye,find:ve,sum:xe,sort:be,path:we,ancestors:Te,descendants:_e,leaves:Le,links:$e,copy:Fe,[Symbol.iterator]:Ae};function ze(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function O(t){return function(){return t}}function Pe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function De(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(n-a)/t.value;++u<y;)d=i[u],d.y0=l,d.y1=r,d.x0=a,d.x1=a+=d.value*c}function Be(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(r-l)/t.value;++u<y;)d=i[u],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var We=(1+Math.sqrt(5))/2;function Ee(t,a,l,n,r,i){for(var d=[],u=a.children,y,c,p=0,w=0,s=u.length,b,v,x=a.value,f,S,F,L,z,E,M;p<s;){b=r-l,v=i-n;do f=u[w++].value;while(!f&&w<s);for(S=F=f,E=Math.max(v/b,b/v)/(x*t),M=f*f*E,z=Math.max(F/M,M/S);w<s;++w){if(f+=c=u[w].value,c<S&&(S=c),c>F&&(F=c),M=f*f*E,L=Math.max(F/M,M/S),L>z){f-=c;break}z=L}d.push(y={value:f,dice:b<v,children:u.slice(p,w)}),y.dice?De(y,l,n,r,x?n+=v*f/x:i):Be(y,l,n,x?l+=b*f/x:r,i),x-=f,p=w}return d}const Re=(function t(a){function l(n,r,i,d,u){Ee(a,n,r,i,d,u)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(We);function He(){var t=Re,a=!1,l=1,n=1,r=[0],i=q,d=q,u=q,y=q,c=q;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(w),r=[0],a&&s.eachBefore(Pe),s}function w(s){var b=r[s.depth],v=s.x0+b,x=s.y0+b,f=s.x1-b,S=s.y1-b;f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),s.x0=v,s.y0=x,s.x1=f,s.y1=S,s.children&&(b=r[s.depth+1]=i(s)/2,v+=c(s)-b,x+=d(s)-b,f-=u(s)-b,S-=y(s)-b,f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),t(s,v,x,f,S))}return p.round=function(s){return arguments.length?(a=!!s,p):a},p.size=function(s){return arguments.length?(l=+s[0],n=+s[1],p):[l,n]},p.tile=function(s){return arguments.length?(t=ze(s),p):t},p.padding=function(s){return arguments.length?p.paddingInner(s).paddingOuter(s):p.paddingInner()},p.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:O(+s),p):i},p.paddingOuter=function(s){return arguments.length?p.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):p.paddingTop()},p.paddingTop=function(s){return arguments.length?(d=typeof s=="function"?s:O(+s),p):d},p.paddingRight=function(s){return arguments.length?(u=typeof s=="function"?s:O(+s),p):u},p.paddingBottom=function(s){return arguments.length?(y=typeof s=="function"?s:O(+s),p):y},p.paddingLeft=function(s){return arguments.length?(c=typeof s=="function"?s:O(+s),p):c},p}var W,ne=(W=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=h.setAccTitle,this.getAccTitle=h.getAccTitle,this.setDiagramTitle=h.setDiagramTitle,this.getDiagramTitle=h.getDiagramTitle,this.getAccDescription=h.getAccDescription,this.setAccDescription=h.setAccDescription}getNodes(){return this.nodes}getConfig(){const a=h.defaultConfig_default,l=h.getConfig();return h.cleanAndMerge({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(i=>{h.isLabelStyle(i)&&(n?.textStyles?n.textStyles.push(i):n.textStyles=[i]),n?.styles?n.styles.push(i):n.styles=[i]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){h.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},h.__name(W,"TreeMapDB"),W);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n?.classSelector,n?.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const i=l[l.length-1].node;i.children?i.children.push(r):i.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}h.__name(le,"buildHierarchy");var Ie=h.__name((t,a)=>{he.populateCommonDb(t,a);const l=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const d=i.item;if(!d)continue;const u=i.indent?parseInt(i.indent):0,y=qe(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c:void 0,w={level:u,name:y,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=le(l),r=h.__name((i,d)=>{for(const u of i)a.addNode(u,d),u.children&&u.children.length>0&&r(u.children,d+1)},"addNodesRecursively");r(n,0)},"populate"),qe=h.__name(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:h.__name(async t=>{try{const a=pe.parse,l=await a("treemap",t);h.log.debug("Treemap AST:",l);const n=re.parser?.yy;if(!(n instanceof ne))throw new Error("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.");Ie(l,n)}catch(a){throw h.log.error("Error parsing treemap:",a),a}},"parse")},Oe=10,B=10,G=25,Ge=h.__name((t,a,l,n)=>{const r=n.db,i=r.getConfig(),d=i.padding??Oe,u=r.getDiagramTitle(),y=r.getRoot(),{themeVariables:c}=h.getConfig();if(!y)return;const p=u?30:0,w=h.selectSvgElement(a),s=i.nodeWidth?i.nodeWidth*B:960,b=i.nodeHeight?i.nodeHeight*B:500,v=s,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),h.configureSvgSize(w,x,v,i.useMaxWidth);let f;try{const e=i.valueFormat||",";if(e==="$0,0")f=h.__name(o=>"$"+I.format(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),g=o?o[0]:"";f=h.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);f=h.__name(g=>"$"+I.format(o||"")(g),"valueFormat")}else f=I.format(e)}catch(e){h.log.error("Error creating format function:",e),f=I.format(",")}const S=Z.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),F=Z.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),L=Z.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);u&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const z=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),E=K(y).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),Q=He().size([s,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),se=Q.descendants().filter(e=>e.children&&e.children.length>0),R=z.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),R.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>S(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>F(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=h.select(this),g=e.data.name;o.text(g);const C=e.x1-e.x0,_=6;let T;i.showValues!==!1&&e.value?T=C-10-30-10-_:T=C-_-6;const m=Math.max(15,T),N=o.node();if(N.getComputedTextLength()>m){let V=g;for(;V.length>0;){if(V=g.substring(0,V.length-1),V.length===0){o.text("..."),N.getComputedTextLength()>m&&o.text("");break}if(o.text(V+"..."),N.getComputedTextLength()<=m)break}}}),i.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")});const ee=Q.leaves(),$=ee.length>20,ie=$?16:38,X=$?14:28,P=$?4:8,H=$?4:6,J=$?2:4,te=$?8:10,U=$?1:2,Y=z.selectAll(".treemapLeafGroup").data(ee).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("style",e=>h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ie}px;fill:`+L(e.data.name)+";",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=h.select(this),g=e.x1-e.x0,C=e.y1-e.y0,_=o.node(),T=g-2*J,D=C-2*J;if(T<te||D<te){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const N=.6;for(;_.getComputedTextLength()>T&&m>P;)m--,o.style("font-size",`${m}px`);let A=Math.max(H,Math.min(X,Math.round(m*N))),k=m+U+A;for(;k>D&&m>P&&(m--,A=Math.max(H,Math.min(X,Math.round(m*N))),!(A<H&&m===P));)o.style("font-size",`${m}px`),k=m+U+A;o.style("font-size",`${m}px`),$?(m<P||D<P)&&o.style("display","none"):(_.getComputedTextLength()>T||m<P||D<m)&&o.style("display","none")}),i.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const g=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+L(o.data.name)+";",C=h.styles2String({cssCompiledStyles:o.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,g)=>`url(#clip-${a}-${g})`).text(o=>o.value?f(o.value):"").each(function(o){const g=h.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const _=h.select(C).select(".treemapLabel");if(_.empty()||_.style("display")==="none"){g.style("display","none");return}const T=parseFloat(_.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));g.style("font-size",`${m}px`);const A=(o.y1-o.y0)/2+T/2+U;g.attr("y",A);const k=o.x1-o.x0,ae=o.y1-o.y0-4,de=k-2*J;g.node().getComputedTextLength()>de||A+m>ae||m<H?g.style("display","none"):g.style("display",null)});const oe=i.diagramPadding??8;ue.setupViewPortForSVG(w,oe,"flowchart",i?.useMaxWidth||!1)},"draw"),Xe=h.__name(function(t,a){return a.db.getClasses()},"getClasses"),Ye={draw:Ge,getClasses:Xe},je={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},Je=h.__name(({treemap:t}={})=>{const a=h.getThemeVariables3(),l=h.getConfig(),n=h.cleanAndMerge(a,l.themeVariables),r=h.cleanAndMerge(je,t),i=r.titleColor??n.titleColor,d=r.labelColor??n.textColor,u=r.valueColor??n.textColor;return`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("./chunk-JWPE2WC7-5sd39cpa.cjs"),h=require("./extractHeadings-wWAipplS.cjs"),ue=require("./chunk-VR4S4FIN-CHKLwvYh.cjs"),pe=require("./cynefin-VYW2F7L2-MpAliYy9.cjs"),I=require("./defaultLocale-C4wbwF1n.cjs"),Z=require("./ordinal-CagbB1m8.cjs");function fe(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ge(){return this.eachAfter(fe)}function me(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ye(t,a){for(var l=this,n=[l],r,i,d=-1;l=n.pop();)if(t.call(a,l,++d,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function Se(t,a){for(var l=this,n=[l],r=[],i,d,u,y=-1;l=n.pop();)if(r.push(l),i=l.children)for(d=0,u=i.length;d<u;++d)n.push(i[d]);for(;l=r.pop();)t.call(a,l,++y,this);return this}function ve(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function xe(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function be(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function we(t){for(var a=this,l=Ce(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ce(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function Te(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function _e(){return Array.from(this)}function Le(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function $e(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ae(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)l.push(n[r]);while(l.length)}function K(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ne)):a===void 0&&(a=Me);for(var l=new j(t),n,r=[l],i,d,u,y;n=r.pop();)if((d=a(n.data))&&(y=(d=Array.from(d)).length))for(n.children=d,u=y-1;u>=0;--u)r.push(i=d[u]=new j(d[u])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ve)}function Fe(){return K(this).eachBefore(ke)}function Me(t){return t.children}function Ne(t){return Array.isArray(t)?t[1]:null}function ke(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ve(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function j(t){this.data=t,this.depth=this.height=0,this.parent=null}j.prototype=K.prototype={constructor:j,count:ge,each:me,eachAfter:Se,eachBefore:ye,find:ve,sum:xe,sort:be,path:we,ancestors:Te,descendants:_e,leaves:Le,links:$e,copy:Fe,[Symbol.iterator]:Ae};function ze(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function O(t){return function(){return t}}function Pe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function De(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(n-a)/t.value;++u<y;)d=i[u],d.y0=l,d.y1=r,d.x0=a,d.x1=a+=d.value*c}function Be(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(r-l)/t.value;++u<y;)d=i[u],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var We=(1+Math.sqrt(5))/2;function Ee(t,a,l,n,r,i){for(var d=[],u=a.children,y,c,p=0,w=0,s=u.length,b,v,x=a.value,f,S,F,L,z,E,M;p<s;){b=r-l,v=i-n;do f=u[w++].value;while(!f&&w<s);for(S=F=f,E=Math.max(v/b,b/v)/(x*t),M=f*f*E,z=Math.max(F/M,M/S);w<s;++w){if(f+=c=u[w].value,c<S&&(S=c),c>F&&(F=c),M=f*f*E,L=Math.max(F/M,M/S),L>z){f-=c;break}z=L}d.push(y={value:f,dice:b<v,children:u.slice(p,w)}),y.dice?De(y,l,n,r,x?n+=v*f/x:i):Be(y,l,n,x?l+=b*f/x:r,i),x-=f,p=w}return d}const Re=(function t(a){function l(n,r,i,d,u){Ee(a,n,r,i,d,u)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(We);function He(){var t=Re,a=!1,l=1,n=1,r=[0],i=q,d=q,u=q,y=q,c=q;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(w),r=[0],a&&s.eachBefore(Pe),s}function w(s){var b=r[s.depth],v=s.x0+b,x=s.y0+b,f=s.x1-b,S=s.y1-b;f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),s.x0=v,s.y0=x,s.x1=f,s.y1=S,s.children&&(b=r[s.depth+1]=i(s)/2,v+=c(s)-b,x+=d(s)-b,f-=u(s)-b,S-=y(s)-b,f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),t(s,v,x,f,S))}return p.round=function(s){return arguments.length?(a=!!s,p):a},p.size=function(s){return arguments.length?(l=+s[0],n=+s[1],p):[l,n]},p.tile=function(s){return arguments.length?(t=ze(s),p):t},p.padding=function(s){return arguments.length?p.paddingInner(s).paddingOuter(s):p.paddingInner()},p.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:O(+s),p):i},p.paddingOuter=function(s){return arguments.length?p.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):p.paddingTop()},p.paddingTop=function(s){return arguments.length?(d=typeof s=="function"?s:O(+s),p):d},p.paddingRight=function(s){return arguments.length?(u=typeof s=="function"?s:O(+s),p):u},p.paddingBottom=function(s){return arguments.length?(y=typeof s=="function"?s:O(+s),p):y},p.paddingLeft=function(s){return arguments.length?(c=typeof s=="function"?s:O(+s),p):c},p}var W,ne=(W=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=h.setAccTitle,this.getAccTitle=h.getAccTitle,this.setDiagramTitle=h.setDiagramTitle,this.getDiagramTitle=h.getDiagramTitle,this.getAccDescription=h.getAccDescription,this.setAccDescription=h.setAccDescription}getNodes(){return this.nodes}getConfig(){const a=h.defaultConfig_default,l=h.getConfig();return h.cleanAndMerge({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(i=>{h.isLabelStyle(i)&&(n?.textStyles?n.textStyles.push(i):n.textStyles=[i]),n?.styles?n.styles.push(i):n.styles=[i]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){h.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},h.__name(W,"TreeMapDB"),W);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n?.classSelector,n?.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const i=l[l.length-1].node;i.children?i.children.push(r):i.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}h.__name(le,"buildHierarchy");var Ie=h.__name((t,a)=>{he.populateCommonDb(t,a);const l=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const d=i.item;if(!d)continue;const u=i.indent?parseInt(i.indent):0,y=qe(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c:void 0,w={level:u,name:y,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=le(l),r=h.__name((i,d)=>{for(const u of i)a.addNode(u,d),u.children&&u.children.length>0&&r(u.children,d+1)},"addNodesRecursively");r(n,0)},"populate"),qe=h.__name(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:h.__name(async t=>{try{const a=pe.parse,l=await a("treemap",t);h.log.debug("Treemap AST:",l);const n=re.parser?.yy;if(!(n instanceof ne))throw new Error("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.");Ie(l,n)}catch(a){throw h.log.error("Error parsing treemap:",a),a}},"parse")},Oe=10,B=10,G=25,Ge=h.__name((t,a,l,n)=>{const r=n.db,i=r.getConfig(),d=i.padding??Oe,u=r.getDiagramTitle(),y=r.getRoot(),{themeVariables:c}=h.getConfig();if(!y)return;const p=u?30:0,w=h.selectSvgElement(a),s=i.nodeWidth?i.nodeWidth*B:960,b=i.nodeHeight?i.nodeHeight*B:500,v=s,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),h.configureSvgSize(w,x,v,i.useMaxWidth);let f;try{const e=i.valueFormat||",";if(e==="$0,0")f=h.__name(o=>"$"+I.format(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),g=o?o[0]:"";f=h.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);f=h.__name(g=>"$"+I.format(o||"")(g),"valueFormat")}else f=I.format(e)}catch(e){h.log.error("Error creating format function:",e),f=I.format(",")}const S=Z.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),F=Z.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),L=Z.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);u&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const z=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),E=K(y).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),Q=He().size([s,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),se=Q.descendants().filter(e=>e.children&&e.children.length>0),R=z.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),R.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>S(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>F(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=h.select(this),g=e.data.name;o.text(g);const C=e.x1-e.x0,_=6;let T;i.showValues!==!1&&e.value?T=C-10-30-10-_:T=C-_-6;const m=Math.max(15,T),N=o.node();if(N.getComputedTextLength()>m){let V=g;for(;V.length>0;){if(V=g.substring(0,V.length-1),V.length===0){o.text("..."),N.getComputedTextLength()>m&&o.text("");break}if(o.text(V+"..."),N.getComputedTextLength()<=m)break}}}),i.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")});const ee=Q.leaves(),$=ee.length>20,ie=$?16:38,X=$?14:28,P=$?4:8,H=$?4:6,J=$?2:4,te=$?8:10,U=$?1:2,Y=z.selectAll(".treemapLeafGroup").data(ee).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("style",e=>h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ie}px;fill:`+L(e.data.name)+";",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=h.select(this),g=e.x1-e.x0,C=e.y1-e.y0,_=o.node(),T=g-2*J,D=C-2*J;if(T<te||D<te){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const N=.6;for(;_.getComputedTextLength()>T&&m>P;)m--,o.style("font-size",`${m}px`);let A=Math.max(H,Math.min(X,Math.round(m*N))),k=m+U+A;for(;k>D&&m>P&&(m--,A=Math.max(H,Math.min(X,Math.round(m*N))),!(A<H&&m===P));)o.style("font-size",`${m}px`),k=m+U+A;o.style("font-size",`${m}px`),$?(m<P||D<P)&&o.style("display","none"):(_.getComputedTextLength()>T||m<P||D<m)&&o.style("display","none")}),i.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const g=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+L(o.data.name)+";",C=h.styles2String({cssCompiledStyles:o.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,g)=>`url(#clip-${a}-${g})`).text(o=>o.value?f(o.value):"").each(function(o){const g=h.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const _=h.select(C).select(".treemapLabel");if(_.empty()||_.style("display")==="none"){g.style("display","none");return}const T=parseFloat(_.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));g.style("font-size",`${m}px`);const A=(o.y1-o.y0)/2+T/2+U;g.attr("y",A);const k=o.x1-o.x0,ae=o.y1-o.y0-4,de=k-2*J;g.node().getComputedTextLength()>de||A+m>ae||m<H?g.style("display","none"):g.style("display",null)});const oe=i.diagramPadding??8;ue.setupViewPortForSVG(w,oe,"flowchart",i?.useMaxWidth||!1)},"draw"),Xe=h.__name(function(t,a){return a.db.getClasses()},"getClasses"),Ye={draw:Ge,getClasses:Xe},je={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},Je=h.__name(({treemap:t}={})=>{const a=h.getThemeVariables3(),l=h.getConfig(),n=h.cleanAndMerge(a,l.themeVariables),r=h.cleanAndMerge(je,t),i=r.titleColor??n.titleColor,d=r.labelColor??n.textColor,u=r.valueColor??n.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${r.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${r.sectionStrokeWidth};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as ge } from "./chunk-JWPE2WC7-
|
|
2
|
-
import { _ as w,
|
|
3
|
-
import { s as Ne } from "./chunk-VR4S4FIN-
|
|
1
|
+
import { p as ge } from "./chunk-JWPE2WC7-DG0ebjV4.js";
|
|
2
|
+
import { _ as w, aq as ye, ak as ae, am as ee, ap as Se, X as ve, W as te, bW as B, V as K, R as xe, Q as be, aa as we, ab as Ce, O as Te, K as Le, an as $e, bX as Ae, ag as Fe } from "./extractHeadings-DlQcPv5N.js";
|
|
3
|
+
import { s as Ne } from "./chunk-VR4S4FIN-C-qPzUSR.js";
|
|
4
4
|
import { p as Me } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
|
|
5
5
|
import { b as O } from "./defaultLocale-BgPVtth8.js";
|
|
6
|
-
import { o as
|
|
6
|
+
import { o as J } from "./ordinal-B6-f3MAq.js";
|
|
7
7
|
function _e(t) {
|
|
8
8
|
var a = 0, l = t.children, n = l && l.length;
|
|
9
9
|
if (!n) a = 1;
|
|
@@ -47,19 +47,19 @@ function Be(t) {
|
|
|
47
47
|
a.value = l;
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function We(t) {
|
|
51
51
|
return this.eachBefore(function(a) {
|
|
52
52
|
a.children && a.children.sort(t);
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
for (var a = this, l =
|
|
55
|
+
function Re(t) {
|
|
56
|
+
for (var a = this, l = Ee(a, t), n = [a]; a !== l; )
|
|
57
57
|
a = a.parent, n.push(a);
|
|
58
58
|
for (var s = n.length; t !== l; )
|
|
59
59
|
n.splice(s, 0, t), t = t.parent;
|
|
60
60
|
return n;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Ee(t, a) {
|
|
63
63
|
if (t === a) return t;
|
|
64
64
|
var l = t.ancestors(), n = a.ancestors(), s = null;
|
|
65
65
|
for (t = l.pop(), a = n.pop(); t === a; )
|
|
@@ -80,7 +80,7 @@ function Oe() {
|
|
|
80
80
|
a.children || t.push(a);
|
|
81
81
|
}), t;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Xe() {
|
|
84
84
|
var t = this, a = [];
|
|
85
85
|
return t.each(function(l) {
|
|
86
86
|
l !== t && a.push({ source: l.parent, target: l });
|
|
@@ -97,14 +97,14 @@ function* qe() {
|
|
|
97
97
|
}
|
|
98
98
|
function ne(t, a) {
|
|
99
99
|
t instanceof Map ? (t = [void 0, t], a === void 0 && (a = je)) : a === void 0 && (a = Ye);
|
|
100
|
-
for (var l = new
|
|
100
|
+
for (var l = new Q(t), n, s = [l], i, h, d, g; n = s.pop(); )
|
|
101
101
|
if ((h = a(n.data)) && (g = (h = Array.from(h)).length))
|
|
102
102
|
for (n.children = h, d = g - 1; d >= 0; --d)
|
|
103
|
-
s.push(i = h[d] = new
|
|
104
|
-
return l.eachBefore(
|
|
103
|
+
s.push(i = h[d] = new Q(h[d])), i.parent = n, i.depth = n.depth + 1;
|
|
104
|
+
return l.eachBefore(Qe);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return ne(this).eachBefore(
|
|
106
|
+
function Ge() {
|
|
107
|
+
return ne(this).eachBefore(Ke);
|
|
108
108
|
}
|
|
109
109
|
function Ye(t) {
|
|
110
110
|
return t.children;
|
|
@@ -112,40 +112,40 @@ function Ye(t) {
|
|
|
112
112
|
function je(t) {
|
|
113
113
|
return Array.isArray(t) ? t[1] : null;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Ke(t) {
|
|
116
116
|
t.data.value !== void 0 && (t.value = t.data.value), t.data = t.data.data;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Qe(t) {
|
|
119
119
|
var a = 0;
|
|
120
120
|
do
|
|
121
121
|
t.height = a;
|
|
122
122
|
while ((t = t.parent) && t.height < ++a);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Q(t) {
|
|
125
125
|
this.data = t, this.depth = this.height = 0, this.parent = null;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
constructor:
|
|
127
|
+
Q.prototype = ne.prototype = {
|
|
128
|
+
constructor: Q,
|
|
129
129
|
count: ke,
|
|
130
130
|
each: Ve,
|
|
131
131
|
eachAfter: De,
|
|
132
132
|
eachBefore: ze,
|
|
133
133
|
find: Pe,
|
|
134
134
|
sum: Be,
|
|
135
|
-
sort:
|
|
136
|
-
path:
|
|
135
|
+
sort: We,
|
|
136
|
+
path: Re,
|
|
137
137
|
ancestors: He,
|
|
138
138
|
descendants: Ie,
|
|
139
139
|
leaves: Oe,
|
|
140
|
-
links:
|
|
141
|
-
copy:
|
|
140
|
+
links: Xe,
|
|
141
|
+
copy: Ge,
|
|
142
142
|
[Symbol.iterator]: qe
|
|
143
143
|
};
|
|
144
|
-
function
|
|
144
|
+
function Ue(t) {
|
|
145
145
|
if (typeof t != "function") throw new Error();
|
|
146
146
|
return t;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function X() {
|
|
149
149
|
return 0;
|
|
150
150
|
}
|
|
151
151
|
function q(t) {
|
|
@@ -156,7 +156,7 @@ function q(t) {
|
|
|
156
156
|
function Ze(t) {
|
|
157
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
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Je(t, a, l, n, s) {
|
|
160
160
|
for (var i = t.children, h, d = -1, g = i.length, c = t.value && (n - a) / t.value; ++d < g; )
|
|
161
161
|
h = i[d], h.y0 = l, h.y1 = s, h.x0 = a, h.x1 = a += h.value * c;
|
|
162
162
|
}
|
|
@@ -166,19 +166,19 @@ function et(t, a, l, n, s) {
|
|
|
166
166
|
}
|
|
167
167
|
var tt = (1 + Math.sqrt(5)) / 2;
|
|
168
168
|
function at(t, a, l, n, s, i) {
|
|
169
|
-
for (var h = [], d = a.children, g, c, u = 0, b = 0, r = d.length, x, S, v = a.value, p, y, N, $, z,
|
|
169
|
+
for (var h = [], d = a.children, g, c, u = 0, b = 0, r = d.length, x, S, v = a.value, p, y, N, $, z, E, M; u < r; ) {
|
|
170
170
|
x = s - l, S = i - n;
|
|
171
171
|
do
|
|
172
172
|
p = d[b++].value;
|
|
173
173
|
while (!p && b < r);
|
|
174
|
-
for (y = N = p,
|
|
175
|
-
if (p += c = d[b].value, c < y && (y = c), c > N && (N = c), M = p * p *
|
|
174
|
+
for (y = N = p, E = Math.max(S / x, x / S) / (v * t), M = p * p * E, z = Math.max(N / M, M / y); b < r; ++b) {
|
|
175
|
+
if (p += c = d[b].value, c < y && (y = c), c > N && (N = c), M = p * p * E, $ = Math.max(N / M, M / y), $ > z) {
|
|
176
176
|
p -= c;
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
z = $;
|
|
180
180
|
}
|
|
181
|
-
h.push(g = { value: p, dice: x < S, children: d.slice(u, b) }), g.dice ?
|
|
181
|
+
h.push(g = { value: p, dice: x < S, children: d.slice(u, b) }), g.dice ? Je(g, l, n, s, v ? n += S * p / v : i) : et(g, l, n, v ? l += x * p / v : s, i), v -= p, u = b;
|
|
182
182
|
}
|
|
183
183
|
return h;
|
|
184
184
|
}
|
|
@@ -191,7 +191,7 @@ const nt = (function t(a) {
|
|
|
191
191
|
}, l;
|
|
192
192
|
})(tt);
|
|
193
193
|
function lt() {
|
|
194
|
-
var t = nt, a = !1, l = 1, n = 1, s = [0], i =
|
|
194
|
+
var t = nt, a = !1, l = 1, n = 1, s = [0], i = X, h = X, d = X, g = X, c = X;
|
|
195
195
|
function u(r) {
|
|
196
196
|
return r.x0 = r.y0 = 0, r.x1 = l, r.y1 = n, r.eachBefore(b), s = [0], a && r.eachBefore(Ze), r;
|
|
197
197
|
}
|
|
@@ -204,7 +204,7 @@ function lt() {
|
|
|
204
204
|
}, u.size = function(r) {
|
|
205
205
|
return arguments.length ? (l = +r[0], n = +r[1], u) : [l, n];
|
|
206
206
|
}, u.tile = function(r) {
|
|
207
|
-
return arguments.length ? (t =
|
|
207
|
+
return arguments.length ? (t = Ue(r), u) : t;
|
|
208
208
|
}, u.padding = function(r) {
|
|
209
209
|
return arguments.length ? u.paddingInner(r).paddingOuter(r) : u.paddingInner();
|
|
210
210
|
}, u.paddingInner = function(r) {
|
|
@@ -221,7 +221,7 @@ function lt() {
|
|
|
221
221
|
return arguments.length ? (c = typeof r == "function" ? r : q(+r), u) : c;
|
|
222
222
|
}, u;
|
|
223
223
|
}
|
|
224
|
-
var
|
|
224
|
+
var R, oe = (R = class {
|
|
225
225
|
constructor() {
|
|
226
226
|
this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.setAccTitle = xe, this.getAccTitle = be, this.setDiagramTitle = we, this.getDiagramTitle = Ce, this.getAccDescription = Te, this.setAccDescription = Le;
|
|
227
227
|
}
|
|
@@ -256,7 +256,7 @@ var E, oe = (E = class {
|
|
|
256
256
|
clear() {
|
|
257
257
|
Fe(), this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.root = void 0;
|
|
258
258
|
}
|
|
259
|
-
}, w(
|
|
259
|
+
}, w(R, "TreeMapDB"), R);
|
|
260
260
|
function ce(t) {
|
|
261
261
|
if (!t.length)
|
|
262
262
|
return [];
|
|
@@ -319,11 +319,11 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
319
319
|
throw te.error("Error parsing treemap:", a), a;
|
|
320
320
|
}
|
|
321
321
|
}, "parse")
|
|
322
|
-
}, it = 10,
|
|
322
|
+
}, it = 10, W = 10, G = 25, ot = /* @__PURE__ */ w((t, a, l, n) => {
|
|
323
323
|
const s = n.db, i = s.getConfig(), h = i.padding ?? it, d = s.getDiagramTitle(), g = s.getRoot(), { themeVariables: c } = ae();
|
|
324
324
|
if (!g)
|
|
325
325
|
return;
|
|
326
|
-
const u = d ? 30 : 0, b = Se(a), r = i.nodeWidth ? i.nodeWidth *
|
|
326
|
+
const u = d ? 30 : 0, b = Se(a), r = i.nodeWidth ? i.nodeWidth * W : 960, x = i.nodeHeight ? i.nodeHeight * W : 500, S = r, v = x + u;
|
|
327
327
|
b.attr("viewBox", `0 0 ${S} ${v}`), ve(b, v, S, i.useMaxWidth);
|
|
328
328
|
let p;
|
|
329
329
|
try {
|
|
@@ -341,7 +341,7 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
341
341
|
} catch (e) {
|
|
342
342
|
te.error("Error creating format function:", e), p = O(",");
|
|
343
343
|
}
|
|
344
|
-
const y =
|
|
344
|
+
const y = J().range([
|
|
345
345
|
"transparent",
|
|
346
346
|
c.cScale0,
|
|
347
347
|
c.cScale1,
|
|
@@ -355,7 +355,7 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
355
355
|
c.cScale9,
|
|
356
356
|
c.cScale10,
|
|
357
357
|
c.cScale11
|
|
358
|
-
]), N =
|
|
358
|
+
]), N = J().range([
|
|
359
359
|
"transparent",
|
|
360
360
|
c.cScalePeer0,
|
|
361
361
|
c.cScalePeer1,
|
|
@@ -369,7 +369,7 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
369
369
|
c.cScalePeer9,
|
|
370
370
|
c.cScalePeer10,
|
|
371
371
|
c.cScalePeer11
|
|
372
|
-
]), $ =
|
|
372
|
+
]), $ = J().range([
|
|
373
373
|
c.cScaleLabel0,
|
|
374
374
|
c.cScaleLabel1,
|
|
375
375
|
c.cScaleLabel2,
|
|
@@ -384,15 +384,15 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
384
384
|
c.cScaleLabel11
|
|
385
385
|
]);
|
|
386
386
|
d && b.append("text").attr("x", S / 2).attr("y", u / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(d);
|
|
387
|
-
const z = b.append("g").attr("transform", `translate(0, ${u})`).attr("class", "treemapContainer"),
|
|
388
|
-
(e) => e.children && e.children.length > 0 ?
|
|
389
|
-
).paddingInner(h).paddingLeft((e) => e.children && e.children.length > 0 ?
|
|
390
|
-
H.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height",
|
|
387
|
+
const z = b.append("g").attr("transform", `translate(0, ${u})`).attr("class", "treemapContainer"), E = ne(g).sum((e) => e.value ?? 0).sort((e, o) => (o.value ?? 0) - (e.value ?? 0)), le = lt().size([r, x]).paddingTop(
|
|
388
|
+
(e) => e.children && e.children.length > 0 ? G + W : 0
|
|
389
|
+
).paddingInner(h).paddingLeft((e) => e.children && e.children.length > 0 ? W : 0).paddingRight((e) => e.children && e.children.length > 0 ? W : 0).paddingBottom((e) => e.children && e.children.length > 0 ? W : 0).round(!0)(E), de = le.descendants().filter((e) => e.children && e.children.length > 0), H = z.selectAll(".treemapSection").data(de).enter().append("g").attr("class", "treemapSection").attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
390
|
+
H.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", G).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (e) => e.depth === 0 ? "display: none;" : ""), H.append("clipPath").attr("id", (e, o) => `clip-section-${a}-${o}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 12)).attr("height", G), H.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", (e, o) => `treemapSection section${o}`).attr("fill", (e) => y(e.data.name)).attr("fill-opacity", 0.6).attr("stroke", (e) => N(e.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (e) => {
|
|
391
391
|
if (e.depth === 0)
|
|
392
392
|
return "display: none;";
|
|
393
393
|
const o = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
394
394
|
return o.nodeStyles + ";" + o.borderStyles.join(";");
|
|
395
|
-
}), H.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y",
|
|
395
|
+
}), H.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", G / 2).attr("dominant-baseline", "middle").text((e) => e.depth === 0 ? "" : e.data.name).attr("font-weight", "bold").attr("clip-path", (e, o) => `url(#clip-section-${a}-${o})`).attr("style", (e) => {
|
|
396
396
|
if (e.depth === 0)
|
|
397
397
|
return "display: none;";
|
|
398
398
|
const o = "dominant-baseline: middle; font-size: 12px; fill:" + $(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
@@ -400,7 +400,7 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
400
400
|
}).each(function(e) {
|
|
401
401
|
if (e.depth === 0)
|
|
402
402
|
return;
|
|
403
|
-
const o =
|
|
403
|
+
const o = K(this), f = e.data.name;
|
|
404
404
|
o.text(f);
|
|
405
405
|
const C = e.x1 - e.x0, L = 6;
|
|
406
406
|
let T;
|
|
@@ -417,18 +417,18 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
417
417
|
break;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
}), i.showValues !== !1 && H.append("text").attr("class", "treemapSectionValue").attr("x", (e) => e.x1 - e.x0 - 10).attr("y",
|
|
420
|
+
}), i.showValues !== !1 && H.append("text").attr("class", "treemapSectionValue").attr("x", (e) => e.x1 - e.x0 - 10).attr("y", G / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((e) => e.value ? p(e.value) : "").attr("font-style", "italic").attr("style", (e) => {
|
|
421
421
|
if (e.depth === 0)
|
|
422
422
|
return "display: none;";
|
|
423
423
|
const o = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + $(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
424
424
|
return o + f.labelStyles.replace("color:", "fill:");
|
|
425
425
|
});
|
|
426
|
-
const se = le.leaves(), A = se.length > 20, ue = A ? 16 : 38, Y = A ? 14 : 28, D = A ? 4 : 8, I = A ? 4 : 6,
|
|
426
|
+
const se = le.leaves(), A = se.length > 20, ue = A ? 16 : 38, Y = A ? 14 : 28, D = A ? 4 : 8, I = A ? 4 : 6, U = A ? 2 : 4, re = A ? 8 : 10, Z = A ? 1 : 2, j = z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class", (e, o) => `treemapNode treemapLeafGroup leaf${o}${e.data.classSelector ? ` ${e.data.classSelector}` : ""}x`).attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
427
427
|
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 ? y(e.parent.data.name) : y(e.data.name)).attr("style", (e) => B({ cssCompiledStyles: e.data.cssCompiledStyles }).nodeStyles).attr("fill-opacity", 0.3).attr("stroke", (e) => e.parent ? y(e.parent.data.name) : y(e.data.name)).attr("stroke-width", 3), j.append("clipPath").attr("id", (e, o) => `clip-${a}-${o}`).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) => {
|
|
428
428
|
const o = `text-anchor: middle; dominant-baseline: middle; font-size: ${ue}px;fill:` + $(e.data.name) + ";", f = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
429
429
|
return o + f.labelStyles.replace("color:", "fill:");
|
|
430
430
|
}).attr("clip-path", (e, o) => `url(#clip-${a}-${o})`).text((e) => e.data.name).each(function(e) {
|
|
431
|
-
const o =
|
|
431
|
+
const o = K(this), f = e.x1 - e.x0, C = e.y1 - e.y0, L = o.node(), T = f - 2 * U, P = C - 2 * U;
|
|
432
432
|
if (T < re || P < re) {
|
|
433
433
|
o.style("display", "none");
|
|
434
434
|
return;
|
|
@@ -453,12 +453,12 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
453
453
|
const f = `text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:` + $(o.data.name) + ";", C = B({ cssCompiledStyles: o.data.cssCompiledStyles });
|
|
454
454
|
return f + C.labelStyles.replace("color:", "fill:");
|
|
455
455
|
}).attr("clip-path", (o, f) => `url(#clip-${a}-${f})`).text((o) => o.value ? p(o.value) : "").each(function(o) {
|
|
456
|
-
const f =
|
|
456
|
+
const f = K(this), C = this.parentNode;
|
|
457
457
|
if (!C) {
|
|
458
458
|
f.style("display", "none");
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
|
-
const L =
|
|
461
|
+
const L = K(C).select(".treemapLabel");
|
|
462
462
|
if (L.empty() || L.style("display") === "none") {
|
|
463
463
|
f.style("display", "none");
|
|
464
464
|
return;
|
|
@@ -470,7 +470,7 @@ var st = /* @__PURE__ */ w((t, a) => {
|
|
|
470
470
|
f.style("font-size", `${m}px`);
|
|
471
471
|
const F = (o.y1 - o.y0) / 2 + T / 2 + Z;
|
|
472
472
|
f.attr("y", F);
|
|
473
|
-
const k = o.x1 - o.x0, ie = o.y1 - o.y0 - 4, me = k - 2 *
|
|
473
|
+
const k = o.x1 - o.x0, ie = o.y1 - o.y0 - 4, me = k - 2 * U;
|
|
474
474
|
f.node().getComputedTextLength() > me || F + m > ie || m < I ? f.style("display", "none") : f.style("display", null);
|
|
475
475
|
});
|
|
476
476
|
const pe = i.diagramPadding ?? 8;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./chunk-JWPE2WC7-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./chunk-JWPE2WC7-5sd39cpa.cjs"),a=require("./extractHeadings-wWAipplS.cjs"),$=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var B=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({...B,...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,S=a.__name((e,t)=>{x.populateCommonDb(e,t);let o=-1,i=[],l=1;const{bitsPerRow:c}=t.getConfig();for(let{start:r,end:s,bits:p,label:d}of e.blocks){if(r!==void 0&&s!==void 0&&s<r)throw new Error(`Packet block ${r} - ${s} is invalid. End must be greater than start.`);if(r??=o+1,r!==o+1)throw new Error(`Packet block ${r} - ${s??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(s??=r+(p??1)-1,p??=s-r+1,o=s,a.log.debug(`Packet block ${r} - ${o} with label ${d}`);i.length<=c+1&&t.getPacket().length<C;){const[g,n]=_({start:r,end:s,bits:p,label:d},l,c);if(i.push(g),g.end+1===l*c&&(t.pushWord(i),i=[],l++),!n)break;({start:r,end:s,bits:p,label:d}=n)}}t.pushWord(i)},"populate"),_=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 $.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),S(t,o)},"parse")},P=a.__name((e,t,o,i)=>{const l=i.db,c=l.getConfig(),{rowHeight:r,paddingY:s,bitWidth:p,bitsPerRow:d}=c,g=l.getPacket(),n=l.getDiagramTitle(),k=r+s,h=k*(g.length+1)-(n?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,y]of g.entries())T(u,y,v,c);u.append("text").text(n).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:s,showBits:p})=>{const d=e.append("g"),g=o*(i+c)+c;for(const n of t){const k=n.start%s*r+1,h=(n.end-n.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(n.label),!p)continue;const f=n.end===n.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(n.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(n.end)}},"drawWord"),D={draw:P},E={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},F=a.__name(({packet:e}={})=>{const t=a.cleanAndMerge(E,e);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${t.byteFontSize};
|
|
4
4
|
}
|