@zjlab-frontier/markdown 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/_basePickBy-BKSBQzQ_.mjs +151 -0
  2. package/dist/_baseUniq-C5o5iO5w.mjs +614 -0
  3. package/dist/arc-CBfSUzPA.mjs +83 -0
  4. package/dist/architecture-U656AL7Q-BnMV_JKl.mjs +5 -0
  5. package/dist/architectureDiagram-VXUJARFQ-D2XPETMC.mjs +4661 -0
  6. package/dist/blockDiagram-VD42YOAC-DUECz_lY.mjs +2261 -0
  7. package/dist/{c4Diagram-c83219d4-DPiPzMng.mjs → c4Diagram-YG6GDRKO-CFmlTOHZ.mjs} +795 -794
  8. package/dist/{channel-DLtPd-ti.mjs → channel-Cn_QU-_B.mjs} +1 -1
  9. package/dist/chunk-4BX2VUAB-Ddlc-PTG.mjs +8 -0
  10. package/dist/chunk-55IACEB6-3bItwaWC.mjs +8 -0
  11. package/dist/chunk-B4BG7PRW-fzrbCD9m.mjs +1375 -0
  12. package/dist/chunk-DI55MBZ5-BsM6MitH.mjs +1370 -0
  13. package/dist/chunk-FMBD7UC4-D0L58RDY.mjs +19 -0
  14. package/dist/chunk-QN33PNHL-BRwIp2MO.mjs +19 -0
  15. package/dist/chunk-QZHKN3VN-3WK04u4j.mjs +15 -0
  16. package/dist/chunk-TZMSLE5B-QppC8KMb.mjs +64 -0
  17. package/dist/classDiagram-2ON5EDUG-DV1NEn5N.mjs +16 -0
  18. package/dist/classDiagram-v2-WZHVMYZB-DV1NEn5N.mjs +16 -0
  19. package/dist/{clone-Bekeo3TW.mjs → clone-BqweF2qi.mjs} +1 -1
  20. package/dist/cose-bilkent-S5V4N54A-v0swiza8.mjs +2608 -0
  21. package/dist/cytoscape.esm-MSgpKP8s.mjs +18721 -0
  22. package/dist/dagre-6UL2VRFP-BAviPdlZ.mjs +444 -0
  23. package/dist/defaultLocale-D7EN2tov.mjs +171 -0
  24. package/dist/diagram-PSM6KHXK-CfFtF0lE.mjs +531 -0
  25. package/dist/diagram-QEK2KX5R-CTU-B7VS.mjs +217 -0
  26. package/dist/diagram-S2PKOQOG-jCY9Tumq.mjs +142 -0
  27. package/dist/erDiagram-Q2GNP2WA-BcKQMz3F.mjs +841 -0
  28. package/dist/flowDiagram-NV44I4VS-udQXA0_8.mjs +1620 -0
  29. package/dist/ganttDiagram-JELNMOA3-Dk5PKr9Z.mjs +2670 -0
  30. package/dist/gitGraph-F6HP7TQM-DkwcvDhk.mjs +5 -0
  31. package/dist/gitGraphDiagram-NY62KEGX-DjJof2Hb.mjs +699 -0
  32. package/dist/graph-D-Tmz5vo.mjs +247 -0
  33. package/dist/{index-C3zgkbpi.mjs → index-CWsdn0Oh.mjs} +35928 -28717
  34. package/dist/index.es.js +4 -4
  35. package/dist/index.umd.js +1884 -1442
  36. package/dist/info-NVLQJR56-TpH_gM4H.mjs +5 -0
  37. package/dist/infoDiagram-WHAUD3N6-DrsD1lMt.mjs +24 -0
  38. package/dist/journeyDiagram-XKPGCS4Q-Cq5Y94aQ.mjs +834 -0
  39. package/dist/kanban-definition-3W4ZIXB7-BEiPA-13.mjs +719 -0
  40. package/dist/layout-QOTssOZa.mjs +1335 -0
  41. package/dist/linear-CCFzTlKw.mjs +259 -0
  42. package/dist/mermaid-parser.core-CSzOHvro.mjs +12966 -0
  43. package/dist/mindmap-definition-VGOIOE7T-ChH1RCzL.mjs +784 -0
  44. package/dist/packet-BFZMPI3H-RY9z3tXt.mjs +5 -0
  45. package/dist/pie-7BOR55EZ-DWSbWhsM.mjs +5 -0
  46. package/dist/pieDiagram-ADFJNKIX-CjvCGMnv.mjs +161 -0
  47. package/dist/quadrantDiagram-AYHSOK5B-yLMChKK1.mjs +1022 -0
  48. package/dist/radar-NHE76QYJ-DxZgeX1m.mjs +5 -0
  49. package/dist/requirementDiagram-UZGBJVZJ-D_Kv5PcV.mjs +850 -0
  50. package/dist/sankeyDiagram-TZEHDZUN-BT4gTtRH.mjs +810 -0
  51. package/dist/sequenceDiagram-WL72ISMW-CcZ0NGLk.mjs +2511 -0
  52. package/dist/stateDiagram-FKZM4ZOC-BpQhvfG2.mjs +263 -0
  53. package/dist/stateDiagram-v2-4FDKWEC3-X4ju2xD3.mjs +16 -0
  54. package/dist/timeline-definition-IT6M3QCI-mIpcHDXS.mjs +795 -0
  55. package/dist/treemap-KMMF4GRG-CTNebVlI.mjs +5 -0
  56. package/dist/{xychartDiagram-f5964ef8-fDv4mp1P.mjs → xychartDiagram-PRI3JC2R-DooouUUZ.mjs} +503 -445
  57. package/package.json +3 -3
  58. package/dist/Tableau10-D7jGxypv.mjs +0 -8
  59. package/dist/arc-DqrMsJeG.mjs +0 -84
  60. package/dist/array-CqVTtuYm.mjs +0 -6
  61. package/dist/blockDiagram-c4efeb88-B7Mcu3H_.mjs +0 -1221
  62. package/dist/classDiagram-beda092f-CRNvkLYf.mjs +0 -218
  63. package/dist/classDiagram-v2-2358418a-CUFy5DGQ.mjs +0 -200
  64. package/dist/createText-1719965b-BEXd6yNU.mjs +0 -2955
  65. package/dist/edges-96097737-CTds2HS2.mjs +0 -1088
  66. package/dist/erDiagram-0228fc6a-DdOqXYmJ.mjs +0 -929
  67. package/dist/flowDb-c6c81e3f-LkwBoeG_.mjs +0 -1126
  68. package/dist/flowDiagram-50d868cf-BlsvSXSO.mjs +0 -788
  69. package/dist/flowDiagram-v2-4f6560a1-KScjGHBx.mjs +0 -17
  70. package/dist/flowchart-elk-definition-6af322e1-mTna7kqR.mjs +0 -48146
  71. package/dist/ganttDiagram-a2739b55-B2o_UW9_.mjs +0 -2477
  72. package/dist/gitGraphDiagram-82fe8481-B6-VRPS0.mjs +0 -1264
  73. package/dist/graph-CSVeLFCJ.mjs +0 -847
  74. package/dist/index-5325376f-DsGv8AO4.mjs +0 -373
  75. package/dist/infoDiagram-8eee0895-Cx7V52QV.mjs +0 -319
  76. package/dist/journeyDiagram-c64418c1-C03IeVHa.mjs +0 -801
  77. package/dist/layout-DfnPfvJm.mjs +0 -1472
  78. package/dist/line-BwAWhs05.mjs +0 -33
  79. package/dist/linear-Ck_Qt8nI.mjs +0 -423
  80. package/dist/mindmap-definition-8da855dc-DdMLbjBy.mjs +0 -21922
  81. package/dist/path-DLwuMfdd.mjs +0 -84
  82. package/dist/pieDiagram-a8764435-BymSofHf.mjs +0 -500
  83. package/dist/quadrantDiagram-1e28029f-BXtW3eHp.mjs +0 -903
  84. package/dist/requirementDiagram-08caed73-DGBKyhE-.mjs +0 -767
  85. package/dist/sankeyDiagram-a04cb91d-BfUYRgG3.mjs +0 -802
  86. package/dist/sequenceDiagram-c5b8d532-Jj_1ttvV.mjs +0 -2234
  87. package/dist/stateDiagram-1ecb1508-CbSM9l6I.mjs +0 -266
  88. package/dist/stateDiagram-v2-c2b004d7-dS2KbqNc.mjs +0 -184
  89. package/dist/styles-b4e223ce-D01XEgS6.mjs +0 -1089
  90. package/dist/styles-ca3715f6-amZyw1GB.mjs +0 -960
  91. package/dist/styles-d45a18b0-GN33fYGn.mjs +0 -436
  92. package/dist/svgDrawCommon-b86b1483-BQvqkIEE.mjs +0 -64
  93. package/dist/timeline-definition-faaaa080-BjbyYT4p.mjs +0 -792
@@ -0,0 +1,444 @@
1
+ import { _ as w, ar as F, as as Y, at as _, au as H, l as r, c as V, av as z, aw as U, ag as $, al as q, ah as P, af as K, ax as Q, ay as W, az as Z } from "./index-CWsdn0Oh.mjs";
2
+ import { G as B } from "./graph-D-Tmz5vo.mjs";
3
+ import { l as I } from "./layout-QOTssOZa.mjs";
4
+ import { i as b } from "./_baseUniq-C5o5iO5w.mjs";
5
+ import { c as L } from "./clone-BqweF2qi.mjs";
6
+ import { m as A } from "./_basePickBy-BKSBQzQ_.mjs";
7
+ function h(e) {
8
+ var t = {
9
+ options: {
10
+ directed: e.isDirected(),
11
+ multigraph: e.isMultigraph(),
12
+ compound: e.isCompound()
13
+ },
14
+ nodes: ee(e),
15
+ edges: ne(e)
16
+ };
17
+ return b(e.graph()) || (t.value = L(e.graph())), t;
18
+ }
19
+ function ee(e) {
20
+ return A(e.nodes(), function(t) {
21
+ var n = e.node(t), a = e.parent(t), i = { v: t };
22
+ return b(n) || (i.value = n), b(a) || (i.parent = a), i;
23
+ });
24
+ }
25
+ function ne(e) {
26
+ return A(e.edges(), function(t) {
27
+ var n = e.edge(t), a = { v: t.v, w: t.w };
28
+ return b(t.name) || (a.name = t.name), b(n) || (a.value = n), a;
29
+ });
30
+ }
31
+ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ w(() => {
32
+ y.clear(), J.clear(), d.clear();
33
+ }, "clear"), D = /* @__PURE__ */ w((e, t) => {
34
+ const n = y.get(t) || [];
35
+ return r.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
36
+ }, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
37
+ const n = y.get(t) || [];
38
+ return r.info("Descendants of ", t, " is ", n), r.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || D(e.v, t) || D(e.w, t) || n.includes(e.w) : (r.debug("Tilt, ", t, ",not in descendants"), !1);
39
+ }, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
40
+ r.warn(
41
+ "Copying children of ",
42
+ e,
43
+ "root",
44
+ a,
45
+ "data",
46
+ t.node(e),
47
+ a
48
+ );
49
+ const i = t.children(e) || [];
50
+ e !== a && i.push(e), r.warn("Copying (nodes) clusterId", e, "nodes", i), i.forEach((o) => {
51
+ if (t.children(o).length > 0)
52
+ G(o, t, n, a);
53
+ else {
54
+ const l = t.node(o);
55
+ r.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (r.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (r.debug("Setting parent", o, e), n.setParent(o, e)) : (r.info("In copy ", e, "root", a, "data", t.node(e), a), r.debug(
56
+ "Not Setting parent for node=",
57
+ o,
58
+ "cluster!==rootId",
59
+ e !== a,
60
+ "node!==clusterId",
61
+ o !== e
62
+ ));
63
+ const u = t.edges(o);
64
+ r.debug("Copying Edges", u), u.forEach((c) => {
65
+ r.info("Edge", c);
66
+ const m = t.edge(c.v, c.w, c.name);
67
+ r.info("Edge data", m, a);
68
+ try {
69
+ se(c, a) ? (r.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), r.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : r.info(
70
+ "Skipping copy of edge ",
71
+ c.v,
72
+ "-->",
73
+ c.w,
74
+ " rootId: ",
75
+ a,
76
+ " clusterId:",
77
+ e
78
+ );
79
+ } catch (v) {
80
+ r.error(v);
81
+ }
82
+ });
83
+ }
84
+ r.debug("Removing node", o), t.removeNode(o);
85
+ });
86
+ }, "copy"), R = /* @__PURE__ */ w((e, t) => {
87
+ const n = t.children(e);
88
+ let a = [...n];
89
+ for (const i of n)
90
+ J.set(i, e), a = [...a, ...R(i, t)];
91
+ return a;
92
+ }, "extractDescendants"), re = /* @__PURE__ */ w((e, t, n) => {
93
+ const a = e.edges().filter((c) => c.v === t || c.w === t), i = e.edges().filter((c) => c.v === n || c.w === n), o = a.map((c) => ({ v: c.v === t ? n : c.v, w: c.w === t ? t : c.w })), l = i.map((c) => ({ v: c.v, w: c.w }));
94
+ return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
95
+ }, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
96
+ const a = t.children(e);
97
+ if (r.trace("Searching children of id ", e, a), a.length < 1)
98
+ return e;
99
+ let i;
100
+ for (const o of a) {
101
+ const l = C(o, t, n), u = re(t, n, l);
102
+ if (l)
103
+ if (u.length > 0)
104
+ i = l;
105
+ else
106
+ return l;
107
+ }
108
+ return i;
109
+ }, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), ie = /* @__PURE__ */ w((e, t) => {
110
+ if (!e || t > 10) {
111
+ r.debug("Opting out, no graph ");
112
+ return;
113
+ } else
114
+ r.debug("Opting in, graph ");
115
+ e.nodes().forEach(function(n) {
116
+ e.children(n).length > 0 && (r.warn(
117
+ "Cluster identified",
118
+ n,
119
+ " Replacement id in edges: ",
120
+ C(n, e, n)
121
+ ), y.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
122
+ }), e.nodes().forEach(function(n) {
123
+ const a = e.children(n), i = e.edges();
124
+ a.length > 0 ? (r.debug("Cluster identified", n, y), i.forEach((o) => {
125
+ const l = D(o.v, n), u = D(o.w, n);
126
+ l ^ u && (r.warn("Edge: ", o, " leaves cluster ", n), r.warn("Descendants of XXX ", n, ": ", y.get(n)), d.get(n).externalConnections = !0);
127
+ })) : r.debug("Not a cluster ", n, y);
128
+ });
129
+ for (let n of d.keys()) {
130
+ const a = d.get(n).id, i = e.parent(a);
131
+ i !== n && d.has(i) && !d.get(i).externalConnections && (d.get(n).id = i);
132
+ }
133
+ e.edges().forEach(function(n) {
134
+ const a = e.edge(n);
135
+ r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
136
+ let i = n.v, o = n.w;
137
+ if (r.warn(
138
+ "Fix XXX",
139
+ d,
140
+ "ids:",
141
+ n.v,
142
+ n.w,
143
+ "Translating: ",
144
+ d.get(n.v),
145
+ " --- ",
146
+ d.get(n.w)
147
+ ), d.get(n.v) || d.get(n.w)) {
148
+ if (r.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), i = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), i !== n.v) {
149
+ const l = e.parent(i);
150
+ d.get(l).externalConnections = !0, a.fromCluster = n.v;
151
+ }
152
+ if (o !== n.w) {
153
+ const l = e.parent(o);
154
+ d.get(l).externalConnections = !0, a.toCluster = n.w;
155
+ }
156
+ r.warn("Fix Replacing with XXX", i, o, n.name), e.setEdge(i, o, a, n.name);
157
+ }
158
+ }), r.warn("Adjusted Graph", h(e)), T(e, 0), r.trace(d);
159
+ }, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
160
+ if (r.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
161
+ r.error("Bailing out");
162
+ return;
163
+ }
164
+ let n = e.nodes(), a = !1;
165
+ for (const i of n) {
166
+ const o = e.children(i);
167
+ a = a || o.length > 0;
168
+ }
169
+ if (!a) {
170
+ r.debug("Done, no node has children", e.nodes());
171
+ return;
172
+ }
173
+ r.debug("Nodes = ", n, t);
174
+ for (const i of n)
175
+ if (r.debug(
176
+ "Extracting node",
177
+ i,
178
+ d,
179
+ d.has(i) && !d.get(i).externalConnections,
180
+ !e.parent(i),
181
+ e.node(i),
182
+ e.children("D"),
183
+ " Depth ",
184
+ t
185
+ ), !d.has(i))
186
+ r.debug("Not a cluster", i, t);
187
+ else if (!d.get(i).externalConnections && e.children(i) && e.children(i).length > 0) {
188
+ r.warn(
189
+ "Cluster without external connections, without a parent and with children",
190
+ i,
191
+ t
192
+ );
193
+ let l = e.graph().rankdir === "TB" ? "LR" : "TB";
194
+ d.get(i)?.clusterData?.dir && (l = d.get(i).clusterData.dir, r.warn("Fixing dir", d.get(i).clusterData.dir, l));
195
+ const u = new B({
196
+ multigraph: !0,
197
+ compound: !0
198
+ }).setGraph({
199
+ rankdir: l,
200
+ nodesep: 50,
201
+ ranksep: 50,
202
+ marginx: 8,
203
+ marginy: 8
204
+ }).setDefaultEdgeLabel(function() {
205
+ return {};
206
+ });
207
+ r.warn("Old graph before copy", h(e)), G(i, e, u, i), e.setNode(i, {
208
+ clusterNode: !0,
209
+ id: i,
210
+ clusterData: d.get(i).clusterData,
211
+ label: d.get(i).label,
212
+ graph: u
213
+ }), r.warn("New graph after copy node: (", i, ")", h(u)), r.debug("Old graph after copy", h(e));
214
+ } else
215
+ r.warn(
216
+ "Cluster ** ",
217
+ i,
218
+ " **not meeting the criteria !externalConnections:",
219
+ !d.get(i).externalConnections,
220
+ " no parent: ",
221
+ !e.parent(i),
222
+ " children ",
223
+ e.children(i) && e.children(i).length > 0,
224
+ e.children("D"),
225
+ t
226
+ ), r.debug(d);
227
+ n = e.nodes(), r.warn("New list of nodes", n);
228
+ for (const i of n) {
229
+ const o = e.node(i);
230
+ r.warn(" Now next level", i, o), o?.clusterNode && T(o.graph, t + 1);
231
+ }
232
+ }, "extractor"), M = /* @__PURE__ */ w((e, t) => {
233
+ if (t.length === 0)
234
+ return [];
235
+ let n = Object.assign([], t);
236
+ return t.forEach((a) => {
237
+ const i = e.children(a), o = M(e, i);
238
+ n = [...n, ...o];
239
+ }), n;
240
+ }, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a, i, o) => {
241
+ r.warn("Graph in recursive render:XAX", h(t), i);
242
+ const l = t.graph().rankdir;
243
+ r.trace("Dir in recursive render - dir:", l);
244
+ const u = e.insert("g").attr("class", "root");
245
+ t.nodes() ? r.info("Recursive render XXX", t.nodes()) : r.info("No nodes found for", t), t.edges().length > 0 && r.info("Recursive edges", t.edge(t.edges()[0]));
246
+ const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"), v = u.insert("g").attr("class", "edgeLabels"), X = u.insert("g").attr("class", "nodes");
247
+ await Promise.all(
248
+ t.nodes().map(async function(f) {
249
+ const s = t.node(f);
250
+ if (i !== void 0) {
251
+ const g = JSON.parse(JSON.stringify(i.clusterData));
252
+ r.trace(
253
+ `Setting data for parent cluster XXX
254
+ Node.id = `,
255
+ f,
256
+ `
257
+ data=`,
258
+ g.height,
259
+ `
260
+ Parent cluster`,
261
+ i.height
262
+ ), t.setNode(i.id, g), t.parent(f) || (r.trace("Setting parent", f, i.id), t.setParent(f, i.id, g));
263
+ }
264
+ if (r.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
265
+ r.info("Cluster identified XBX", f, s.width, t.node(f));
266
+ const { ranksep: g, nodesep: E } = t.graph();
267
+ s.graph.setGraph({
268
+ ...s.graph.graph(),
269
+ ranksep: g + 25,
270
+ nodesep: E
271
+ });
272
+ const N = await j(
273
+ X,
274
+ s.graph,
275
+ n,
276
+ a,
277
+ t.node(f),
278
+ o
279
+ ), x = N.elem;
280
+ z(s, x), s.diff = N.diff || 0, r.info(
281
+ "New compound node after recursive render XAX",
282
+ f,
283
+ "width",
284
+ // node,
285
+ s.width,
286
+ "height",
287
+ s.height
288
+ // node.x,
289
+ // node.y
290
+ ), U(x, s);
291
+ } else
292
+ t.children(f).length > 0 ? (r.trace(
293
+ "Cluster - the non recursive path XBX",
294
+ f,
295
+ s.id,
296
+ s,
297
+ s.width,
298
+ "Graph:",
299
+ t
300
+ ), r.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (r.trace("Node - the non recursive path XAX", f, X, t.node(f), l), await $(X, t.node(f), { config: o, dir: l }));
301
+ })
302
+ ), await (/* @__PURE__ */ w(async () => {
303
+ const f = t.edges().map(async function(s) {
304
+ const g = t.edge(s.v, s.w, s.name);
305
+ r.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), r.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), r.info(
306
+ "Fix",
307
+ d,
308
+ "ids:",
309
+ s.v,
310
+ s.w,
311
+ "Translating: ",
312
+ d.get(s.v),
313
+ d.get(s.w)
314
+ ), await Z(v, g);
315
+ });
316
+ await Promise.all(f);
317
+ }, "processEdges"))(), r.info("Graph before layout:", JSON.stringify(h(t))), r.info("############################################# XXX"), r.info("### Layout ### XXX"), r.info("############################################# XXX"), I(t), r.info("Graph after layout:", JSON.stringify(h(t)));
318
+ let O = 0, { subGraphTitleTotalMargin: S } = q(o);
319
+ return await Promise.all(
320
+ oe(t).map(async function(f) {
321
+ const s = t.node(f);
322
+ if (r.info(
323
+ "Position XBX => " + f + ": (" + s.x,
324
+ "," + s.y,
325
+ ") width: ",
326
+ s.width,
327
+ " height: ",
328
+ s.height
329
+ ), s?.clusterNode)
330
+ s.y += S, r.info(
331
+ "A tainted cluster node XBX1",
332
+ f,
333
+ s.id,
334
+ s.width,
335
+ s.height,
336
+ s.x,
337
+ s.y,
338
+ t.parent(f)
339
+ ), d.get(s.id).node = s, P(s);
340
+ else if (t.children(f).length > 0) {
341
+ r.info(
342
+ "A pure cluster node XBX1",
343
+ f,
344
+ s.id,
345
+ s.x,
346
+ s.y,
347
+ s.width,
348
+ s.height,
349
+ t.parent(f)
350
+ ), s.height += S, t.node(s.parentId);
351
+ const g = s?.padding / 2 || 0, E = s?.labelBBox?.height || 0, N = E - g || 0;
352
+ r.debug("OffsetY", N, "labelHeight", E, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
353
+ } else {
354
+ const g = t.node(s.parentId);
355
+ s.y += S / 2, r.info(
356
+ "A regular node XBX1 - using the padding",
357
+ s.id,
358
+ "parent",
359
+ s.parentId,
360
+ s.width,
361
+ s.height,
362
+ s.x,
363
+ s.y,
364
+ "offsetY",
365
+ s.offsetY,
366
+ "parent",
367
+ g,
368
+ g?.offsetY,
369
+ s
370
+ ), P(s);
371
+ }
372
+ })
373
+ ), t.edges().forEach(function(f) {
374
+ const s = t.edge(f);
375
+ r.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
376
+ const g = t.node(f.v);
377
+ var E = t.node(f.w);
378
+ const N = Q(m, s, d, n, g, E, a);
379
+ W(s, N);
380
+ }), t.nodes().forEach(function(f) {
381
+ const s = t.node(f);
382
+ r.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
383
+ }), r.warn("Returning from recursive render XAX", u, O), { elem: u, diff: O };
384
+ }, "recursiveRender"), ge = /* @__PURE__ */ w(async (e, t) => {
385
+ const n = new B({
386
+ multigraph: !0,
387
+ compound: !0
388
+ }).setGraph({
389
+ rankdir: e.direction,
390
+ nodesep: e.config?.nodeSpacing || e.config?.flowchart?.nodeSpacing || e.nodeSpacing,
391
+ ranksep: e.config?.rankSpacing || e.config?.flowchart?.rankSpacing || e.rankSpacing,
392
+ marginx: 8,
393
+ marginy: 8
394
+ }).setDefaultEdgeLabel(function() {
395
+ return {};
396
+ }), a = t.select("g");
397
+ F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
398
+ n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
399
+ }), r.debug("Edges:", e.edges), e.edges.forEach((o) => {
400
+ if (o.start === o.end) {
401
+ const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
402
+ n.setNode(u, {
403
+ domId: u,
404
+ id: u,
405
+ parentId: m.parentId,
406
+ labelStyle: "",
407
+ label: "",
408
+ padding: 0,
409
+ shape: "labelRect",
410
+ // shape: 'rect',
411
+ style: "",
412
+ width: 10,
413
+ height: 10
414
+ }), n.setParent(u, m.parentId), n.setNode(c, {
415
+ domId: c,
416
+ id: c,
417
+ parentId: m.parentId,
418
+ labelStyle: "",
419
+ padding: 0,
420
+ // shape: 'rect',
421
+ shape: "labelRect",
422
+ label: "",
423
+ style: "",
424
+ width: 10,
425
+ height: 10
426
+ }), n.setParent(c, m.parentId);
427
+ const v = structuredClone(o), X = structuredClone(o), p = structuredClone(o);
428
+ v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid", p.label = "", m.isGroup && (v.fromCluster = l, p.toCluster = l), p.id = l + "-cyclic-special-2", p.arrowTypeStart = "none", n.setEdge(l, u, v, l + "-cyclic-special-0"), n.setEdge(u, c, X, l + "-cyclic-special-1"), n.setEdge(c, l, p, l + "-cyc<lic-special-2");
429
+ } else
430
+ n.setEdge(o.start, o.end, { ...o }, o.id);
431
+ }), r.warn("Graph at first:", JSON.stringify(h(n))), ie(n), r.warn("Graph after XAX:", JSON.stringify(h(n)));
432
+ const i = V();
433
+ await j(
434
+ a,
435
+ n,
436
+ e.type,
437
+ e.diagramId,
438
+ void 0,
439
+ i
440
+ );
441
+ }, "render");
442
+ export {
443
+ ge as render
444
+ };
@@ -0,0 +1,171 @@
1
+ function H(n) {
2
+ return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);
3
+ }
4
+ function j(n, t) {
5
+ if ((e = (n = t ? n.toExponential(t - 1) : n.toExponential()).indexOf("e")) < 0) return null;
6
+ var e, i = n.slice(0, e);
7
+ return [
8
+ i.length > 1 ? i[0] + i.slice(2) : i,
9
+ +n.slice(e + 1)
10
+ ];
11
+ }
12
+ function J(n) {
13
+ return n = j(Math.abs(n)), n ? n[1] : NaN;
14
+ }
15
+ function K(n, t) {
16
+ return function(e, i) {
17
+ for (var o = e.length, f = [], c = 0, u = n[0], p = 0; o > 0 && u > 0 && (p + u + 1 > i && (u = Math.max(1, i - p)), f.push(e.substring(o -= u, o + u)), !((p += u + 1) > i)); )
18
+ u = n[c = (c + 1) % n.length];
19
+ return f.reverse().join(t);
20
+ };
21
+ }
22
+ function Q(n) {
23
+ return function(t) {
24
+ return t.replace(/[0-9]/g, function(e) {
25
+ return n[+e];
26
+ });
27
+ };
28
+ }
29
+ var V = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
30
+ function N(n) {
31
+ if (!(t = V.exec(n))) throw new Error("invalid format: " + n);
32
+ var t;
33
+ return new $({
34
+ fill: t[1],
35
+ align: t[2],
36
+ sign: t[3],
37
+ symbol: t[4],
38
+ zero: t[5],
39
+ width: t[6],
40
+ comma: t[7],
41
+ precision: t[8] && t[8].slice(1),
42
+ trim: t[9],
43
+ type: t[10]
44
+ });
45
+ }
46
+ N.prototype = $.prototype;
47
+ function $(n) {
48
+ this.fill = n.fill === void 0 ? " " : n.fill + "", this.align = n.align === void 0 ? ">" : n.align + "", this.sign = n.sign === void 0 ? "-" : n.sign + "", this.symbol = n.symbol === void 0 ? "" : n.symbol + "", this.zero = !!n.zero, this.width = n.width === void 0 ? void 0 : +n.width, this.comma = !!n.comma, this.precision = n.precision === void 0 ? void 0 : +n.precision, this.trim = !!n.trim, this.type = n.type === void 0 ? "" : n.type + "";
49
+ }
50
+ $.prototype.toString = function() {
51
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
52
+ };
53
+ function W(n) {
54
+ n: for (var t = n.length, e = 1, i = -1, o; e < t; ++e)
55
+ switch (n[e]) {
56
+ case ".":
57
+ i = o = e;
58
+ break;
59
+ case "0":
60
+ i === 0 && (i = e), o = e;
61
+ break;
62
+ default:
63
+ if (!+n[e]) break n;
64
+ i > 0 && (i = 0);
65
+ break;
66
+ }
67
+ return i > 0 ? n.slice(0, i) + n.slice(o + 1) : n;
68
+ }
69
+ var U;
70
+ function _(n, t) {
71
+ var e = j(n, t);
72
+ if (!e) return n + "";
73
+ var i = e[0], o = e[1], f = o - (U = Math.max(-8, Math.min(8, Math.floor(o / 3))) * 3) + 1, c = i.length;
74
+ return f === c ? i : f > c ? i + new Array(f - c + 1).join("0") : f > 0 ? i.slice(0, f) + "." + i.slice(f) : "0." + new Array(1 - f).join("0") + j(n, Math.max(0, t + f - 1))[0];
75
+ }
76
+ function G(n, t) {
77
+ var e = j(n, t);
78
+ if (!e) return n + "";
79
+ var i = e[0], o = e[1];
80
+ return o < 0 ? "0." + new Array(-o).join("0") + i : i.length > o + 1 ? i.slice(0, o + 1) + "." + i.slice(o + 1) : i + new Array(o - i.length + 2).join("0");
81
+ }
82
+ const I = {
83
+ "%": (n, t) => (n * 100).toFixed(t),
84
+ b: (n) => Math.round(n).toString(2),
85
+ c: (n) => n + "",
86
+ d: H,
87
+ e: (n, t) => n.toExponential(t),
88
+ f: (n, t) => n.toFixed(t),
89
+ g: (n, t) => n.toPrecision(t),
90
+ o: (n) => Math.round(n).toString(8),
91
+ p: (n, t) => G(n * 100, t),
92
+ r: G,
93
+ s: _,
94
+ X: (n) => Math.round(n).toString(16).toUpperCase(),
95
+ x: (n) => Math.round(n).toString(16)
96
+ };
97
+ function X(n) {
98
+ return n;
99
+ }
100
+ var O = Array.prototype.map, R = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
101
+ function v(n) {
102
+ var t = n.grouping === void 0 || n.thousands === void 0 ? X : K(O.call(n.grouping, Number), n.thousands + ""), e = n.currency === void 0 ? "" : n.currency[0] + "", i = n.currency === void 0 ? "" : n.currency[1] + "", o = n.decimal === void 0 ? "." : n.decimal + "", f = n.numerals === void 0 ? X : Q(O.call(n.numerals, String)), c = n.percent === void 0 ? "%" : n.percent + "", u = n.minus === void 0 ? "−" : n.minus + "", p = n.nan === void 0 ? "NaN" : n.nan + "";
103
+ function F(a) {
104
+ a = N(a);
105
+ var x = a.fill, M = a.align, m = a.sign, w = a.symbol, l = a.zero, S = a.width, E = a.comma, g = a.precision, L = a.trim, d = a.type;
106
+ d === "n" ? (E = !0, d = "g") : I[d] || (g === void 0 && (g = 12), L = !0, d = "g"), (l || x === "0" && M === "=") && (l = !0, x = "0", M = "=");
107
+ var Z = w === "$" ? e : w === "#" && /[boxX]/.test(d) ? "0" + d.toLowerCase() : "", q = w === "$" ? i : /[%p]/.test(d) ? c : "", T = I[d], B = /[defgprs%]/.test(d);
108
+ g = g === void 0 ? 6 : /[gprs]/.test(d) ? Math.max(1, Math.min(21, g)) : Math.max(0, Math.min(20, g));
109
+ function C(r) {
110
+ var y = Z, h = q, b, D, k;
111
+ if (d === "c")
112
+ h = T(r) + h, r = "";
113
+ else {
114
+ r = +r;
115
+ var P = r < 0 || 1 / r < 0;
116
+ if (r = isNaN(r) ? p : T(Math.abs(r), g), L && (r = W(r)), P && +r == 0 && m !== "+" && (P = !1), y = (P ? m === "(" ? m : u : m === "-" || m === "(" ? "" : m) + y, h = (d === "s" ? R[8 + U / 3] : "") + h + (P && m === "(" ? ")" : ""), B) {
117
+ for (b = -1, D = r.length; ++b < D; )
118
+ if (k = r.charCodeAt(b), 48 > k || k > 57) {
119
+ h = (k === 46 ? o + r.slice(b + 1) : r.slice(b)) + h, r = r.slice(0, b);
120
+ break;
121
+ }
122
+ }
123
+ }
124
+ E && !l && (r = t(r, 1 / 0));
125
+ var z = y.length + r.length + h.length, s = z < S ? new Array(S - z + 1).join(x) : "";
126
+ switch (E && l && (r = t(s + r, s.length ? S - h.length : 1 / 0), s = ""), M) {
127
+ case "<":
128
+ r = y + r + h + s;
129
+ break;
130
+ case "=":
131
+ r = y + s + r + h;
132
+ break;
133
+ case "^":
134
+ r = s.slice(0, z = s.length >> 1) + y + r + h + s.slice(z);
135
+ break;
136
+ default:
137
+ r = s + y + r + h;
138
+ break;
139
+ }
140
+ return f(r);
141
+ }
142
+ return C.toString = function() {
143
+ return a + "";
144
+ }, C;
145
+ }
146
+ function Y(a, x) {
147
+ var M = F((a = N(a), a.type = "f", a)), m = Math.max(-8, Math.min(8, Math.floor(J(x) / 3))) * 3, w = Math.pow(10, -m), l = R[8 + m / 3];
148
+ return function(S) {
149
+ return M(w * S) + l;
150
+ };
151
+ }
152
+ return {
153
+ format: F,
154
+ formatPrefix: Y
155
+ };
156
+ }
157
+ var A, nn, tn;
158
+ rn({
159
+ thousands: ",",
160
+ grouping: [3],
161
+ currency: ["$", ""]
162
+ });
163
+ function rn(n) {
164
+ return A = v(n), nn = A.format, tn = A.formatPrefix, A;
165
+ }
166
+ export {
167
+ tn as a,
168
+ nn as b,
169
+ J as e,
170
+ N as f
171
+ };