@kong-ui-public/documentation 1.5.78 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{arc-DZdQjcG8-C_2Dx6GQ.js → arc-DZdQjcG8-CduayE88.js} +2 -2
  2. package/dist/{architectureDiagram-3BPJPVTR-By_DXDyu-DTj86bUZ.js → architectureDiagram-3BPJPVTR-By_DXDyu-U3MSLbOU.js} +1506 -1513
  3. package/dist/blockDiagram-GPEHLZMM-9Cp9Hbl7-CKP-SiVG.js +3268 -0
  4. package/dist/{c4Diagram-AAUBKEIU-ftdwlfdB-CYiERTWJ.js → c4Diagram-AAUBKEIU-ftdwlfdB-D3A61SdV.js} +11 -12
  5. package/dist/{channel-DM9j7IFL-CjNPz4Hd.js → channel-DM9j7IFL-DxqBUxfY.js} +1 -1
  6. package/dist/{chunk-2J33WTMH-CBbjVzWb-BAAd-TK5.js → chunk-2J33WTMH-CBbjVzWb-0og4LHQ-.js} +7 -8
  7. package/dist/chunk-4BX2VUAB-C_NnimAy--QQ0Db2V.js +8 -0
  8. package/dist/{chunk-55IACEB6-DZn1aNO0-_bs5ibIB.js → chunk-55IACEB6-DZn1aNO0-A3zOZ7dT.js} +1 -1
  9. package/dist/{chunk-727SXJPM-B2_6_WLv-CzbzsbtK.js → chunk-727SXJPM-B2_6_WLv-Bs3CxHaX.js} +548 -549
  10. package/dist/{chunk-AQP2D5EJ-DEAEiJjW-BPr5JvkB.js → chunk-AQP2D5EJ-DEAEiJjW-DTbwZT8N.js} +446 -458
  11. package/dist/{chunk-FMBD7UC4-D_tZ4Dxg-BUygZnCT.js → chunk-FMBD7UC4-D_tZ4Dxg-DwjoPGUH.js} +1 -1
  12. package/dist/{chunk-ND2GUHAM-Duw3k8MU-Dr8SD23L.js → chunk-ND2GUHAM-Duw3k8MU-HmrdHLJ9.js} +1 -1
  13. package/dist/{chunk-QZHKN3VN-DN6nBdn0-DxWE5zsM.js → chunk-QZHKN3VN-DN6nBdn0-BvQOETVz.js} +1 -1
  14. package/dist/classDiagram-4FO5ZUOK-Du5qFrfN-BqXc0etQ.js +17 -0
  15. package/dist/classDiagram-v2-Q7XG4LA2-DM6zutfc-BqXc0etQ.js +17 -0
  16. package/dist/{cose-bilkent-S5V4N54A-0ZumbVgj-BKcFQWbE.js → cose-bilkent-S5V4N54A-0ZumbVgj-0z7CQbIH.js} +465 -465
  17. package/dist/{cytoscape.esm-BDIiOYYO-BbddfVIJ.js → cytoscape.esm-BDIiOYYO-C1jMBhD8.js} +356 -371
  18. package/dist/dagre-BM42HDAG-qMWMsyLb-DGMrq3i3.js +288 -0
  19. package/dist/{dagre-DJxg_nfI-BzVw7cNP.js → dagre-DJxg_nfI-hVOVexz-.js} +9 -9
  20. package/dist/{diagram-2AECGRRQ-B2gF_dHe-DCRSlKG-.js → diagram-2AECGRRQ-B2gF_dHe-Bv_EpxRz.js} +10 -14
  21. package/dist/{diagram-5GNKFQAL-DJ9WwRrD-DtSWJY6-.js → diagram-5GNKFQAL-DJ9WwRrD-WVvm0Icu.js} +4 -4
  22. package/dist/{diagram-KO2AKTUF-RfkqD-VW-ZR9mxccc.js → diagram-KO2AKTUF-RfkqD-VW-yyAds1Qq.js} +153 -156
  23. package/dist/{diagram-LMA3HP47-Ct7s9hIt-DXtPBRn4.js → diagram-LMA3HP47-Ct7s9hIt-Dy6f9BAO.js} +21 -22
  24. package/dist/{diagram-OG6HWLK6-BSYJ2CoI-DX1BfXw6.js → diagram-OG6HWLK6-BSYJ2CoI-ckmfat-L.js} +79 -81
  25. package/dist/documentation.es.js +1 -1
  26. package/dist/documentation.umd.js +374 -374
  27. package/dist/{erDiagram-TEJ5UH35-BudwiSYX-BPA5-1u6.js → erDiagram-TEJ5UH35-BudwiSYX-bVzp1Kjr.js} +134 -135
  28. package/dist/{flowDiagram-I6XJVG4X-B23Smlxp-Cb24VZnb.js → flowDiagram-I6XJVG4X-B23Smlxp-ClHvdCdJ.js} +842 -849
  29. package/dist/{ganttDiagram-6RSMTGT7-C-i89z_P-DEdTFlTH.js → ganttDiagram-6RSMTGT7-C-i89z_P-t5UAyRM5.js} +46 -46
  30. package/dist/gitGraphDiagram-PVQCEYII-DpVfXnUD-Cg3smOdz.js +734 -0
  31. package/dist/{graphlib-D2YdGpuK-CM8PX5pf.js → graphlib-D2YdGpuK-CnQPmzkS.js} +17 -17
  32. package/dist/{index-Dpyqhws4.js → index-DfVKdDwj.js} +16258 -16515
  33. package/dist/{infoDiagram-5YYISTIA-CDUwzFql-BsbTK2Me.js → infoDiagram-5YYISTIA-CDUwzFql-Bmthmcp4.js} +2 -2
  34. package/dist/{ishikawaDiagram-YF4QCWOH-MfYdx0rK-DsWP0O6d.js → ishikawaDiagram-YF4QCWOH-MfYdx0rK-cbltssua.js} +137 -138
  35. package/dist/{journeyDiagram-JHISSGLW-C_udOPtJ-BkIf9B4Q.js → journeyDiagram-JHISSGLW-C_udOPtJ-BjAvgSAR.js} +13 -13
  36. package/dist/{kanban-definition-UN3LZRKU-C1Su-UOY-6sw-wDwK.js → kanban-definition-UN3LZRKU-C1Su-UOY-DZ93dsWZ.js} +334 -336
  37. package/dist/{katex-D7tFlpqA-B7yKriH4.js → katex-D7tFlpqA-BOSQxXe1.js} +254 -256
  38. package/dist/{linear-1MXhYum8-CfR5ywK4.js → linear-1MXhYum8-9C1jno9G.js} +5 -5
  39. package/dist/{mindmap-definition-RKZ34NQL-MuSV765K-Cv2rDIFS.js → mindmap-definition-RKZ34NQL-MuSV765K-Kub1iXFv.js} +94 -97
  40. package/dist/{ordinal-D9ksOc8y-CrGveXkB.js → ordinal-D9ksOc8y-2hZwLyEk.js} +1 -1
  41. package/dist/{pieDiagram-4H26LBE5-TgFp7J6_-C8m2xJbj.js → pieDiagram-4H26LBE5-TgFp7J6_-i6NxP3Xz.js} +43 -44
  42. package/dist/{quadrantDiagram-W4KKPZXB-DKPne3o_-D0Tfl8NQ.js → quadrantDiagram-W4KKPZXB-DKPne3o_-DXLHqRuR.js} +351 -353
  43. package/dist/{requirementDiagram-4Y6WPE33-vh8uUAp_-C5zLx-_o.js → requirementDiagram-4Y6WPE33-vh8uUAp_-CHtsISxP.js} +384 -386
  44. package/dist/{sankeyDiagram-5OEKKPKP-Cgs6W_El-DBrv4QL_.js → sankeyDiagram-5OEKKPKP-Cgs6W_El-D7GZyd8n.js} +178 -178
  45. package/dist/{sequenceDiagram-3UESZ5HK-C5F57Dkt-D6DqZiJP.js → sequenceDiagram-3UESZ5HK-C5F57Dkt-BW1Hb7UW.js} +643 -653
  46. package/dist/{stateDiagram-AJRCARHV-09dUKG6Y-9QhAIhCk.js → stateDiagram-AJRCARHV-09dUKG6Y-Dm2a1vNu.js} +5 -5
  47. package/dist/stateDiagram-v2-BHNVJYJU-CWqmRt12-DbWzZ-j-.js +16 -0
  48. package/dist/style.css +1 -1
  49. package/dist/timeline-definition-PNZ67QCA-CCndyx0V-B5CT96H-.js +1095 -0
  50. package/dist/{vennDiagram-CIIHVFJN-DQfKxM3L-086u82L3.js → vennDiagram-CIIHVFJN-DQfKxM3L-qUaKEl7l.js} +596 -603
  51. package/dist/{wardley-L42UT6IY-BjAkE_cs-li1xYed9.js → wardley-L42UT6IY-BjAkE_cs-C-giFqos.js} +5760 -5809
  52. package/dist/wardleyDiagram-YWT4CUSO-Bf9L2NsL-DXPF2Ee9.js +639 -0
  53. package/dist/{xychartDiagram-2RQKCTM6-ChNH3q1U--vbcTXH5.js → xychartDiagram-2RQKCTM6-ChNH3q1U-a59DsJDA.js} +10 -10
  54. package/package.json +4 -4
  55. package/dist/blockDiagram-GPEHLZMM-9Cp9Hbl7-CSQRWfog.js +0 -3278
  56. package/dist/chunk-4BX2VUAB-C_NnimAy-B-8x_g6K.js +0 -9
  57. package/dist/classDiagram-4FO5ZUOK-Du5qFrfN-DLmqgbj1.js +0 -17
  58. package/dist/classDiagram-v2-Q7XG4LA2-DM6zutfc-DLmqgbj1.js +0 -17
  59. package/dist/dagre-BM42HDAG-qMWMsyLb-BzK2-5zM.js +0 -291
  60. package/dist/gitGraphDiagram-PVQCEYII-DpVfXnUD-BtfdBLxW.js +0 -747
  61. package/dist/stateDiagram-v2-BHNVJYJU-CWqmRt12-Br5eF-5b.js +0 -16
  62. package/dist/timeline-definition-PNZ67QCA-CCndyx0V-CkhwKYjQ.js +0 -1106
  63. package/dist/wardleyDiagram-YWT4CUSO-Bf9L2NsL-CCMCDU5F.js +0 -647
@@ -1,747 +0,0 @@
1
- import { i as lt, f as ht, G as $t, K as mt, W as gt, U as yt, p as l, o as Q, g as B, q as ft, Z as F, N as pt, r as xt, H as ut, a as M, s as bt, F as kt, w as Bt } from "./index-Dpyqhws4.js";
2
- import { t as wt } from "./chunk-4BX2VUAB-C_NnimAy-B-8x_g6K.js";
3
- import { r as Et } from "./wardley-L42UT6IY-BjAkE_cs-li1xYed9.js";
4
- import { t as Ct } from "./chunk-QZHKN3VN-DN6nBdn0-DxWE5zsM.js";
5
- var u = {
6
- NORMAL: 0,
7
- REVERSE: 1,
8
- HIGHLIGHT: 2,
9
- MERGE: 3,
10
- CHERRY_PICK: 4
11
- }, Lt = kt.gitGraph, W = /* @__PURE__ */ l(() => bt({
12
- ...Lt,
13
- ...Q().gitGraph
14
- }), "getConfig"), d = new Ct(() => {
15
- let t = W(), r = t.mainBranchName, o = t.mainBranchOrder;
16
- return {
17
- mainBranchName: r,
18
- commits: /* @__PURE__ */ new Map(),
19
- head: null,
20
- branchConfig: /* @__PURE__ */ new Map([[r, {
21
- name: r,
22
- order: o
23
- }]]),
24
- branches: /* @__PURE__ */ new Map([[r, null]]),
25
- currBranch: r,
26
- direction: "LR",
27
- seq: 0,
28
- options: {}
29
- };
30
- });
31
- function U() {
32
- return Bt({ length: 7 });
33
- }
34
- l(U, "getID");
35
- function et(t, r) {
36
- let o = /* @__PURE__ */ Object.create(null);
37
- return t.reduce((i, s) => {
38
- let c = r(s);
39
- return o[c] || (o[c] = !0, i.push(s)), i;
40
- }, []);
41
- }
42
- l(et, "uniqBy");
43
- var Tt = /* @__PURE__ */ l(function(t) {
44
- d.records.direction = t;
45
- }, "setDirection"), Mt = /* @__PURE__ */ l(function(t) {
46
- B.debug("options str", t), t = t == null ? void 0 : t.trim(), t || (t = "{}");
47
- try {
48
- d.records.options = JSON.parse(t);
49
- } catch (r) {
50
- B.error("error while parsing gitGraph options", r.message);
51
- }
52
- }, "setOptions"), vt = /* @__PURE__ */ l(function() {
53
- return d.records.options;
54
- }, "getOptions"), It = /* @__PURE__ */ l(function(t) {
55
- let r = t.msg, o = t.id, i = t.type, s = t.tags;
56
- B.info("commit", r, o, i, s), B.debug("Entering commit:", r, o, i, s);
57
- let c = W();
58
- o = M.sanitizeText(o, c), r = M.sanitizeText(r, c), s = s == null ? void 0 : s.map((a) => M.sanitizeText(a, c));
59
- let e = {
60
- id: o || d.records.seq + "-" + U(),
61
- message: r,
62
- seq: d.records.seq++,
63
- type: i ?? u.NORMAL,
64
- tags: s ?? [],
65
- parents: d.records.head == null ? [] : [d.records.head.id],
66
- branch: d.records.currBranch
67
- };
68
- d.records.head = e, B.info("main branch", c.mainBranchName), d.records.commits.has(e.id) && B.warn(`Commit ID ${e.id} already exists`), d.records.commits.set(e.id, e), d.records.branches.set(d.records.currBranch, e.id), B.debug("in pushCommit " + e.id);
69
- }, "commit"), Rt = /* @__PURE__ */ l(function(t) {
70
- let r = t.name, o = t.order;
71
- if (r = M.sanitizeText(r, W()), d.records.branches.has(r)) throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);
72
- d.records.branches.set(r, d.records.head == null ? null : d.records.head.id), d.records.branchConfig.set(r, {
73
- name: r,
74
- order: o
75
- }), ot(r), B.debug("in createBranch");
76
- }, "branch"), Pt = /* @__PURE__ */ l((t) => {
77
- let r = t.branch, o = t.id, i = t.type, s = t.tags, c = W();
78
- r = M.sanitizeText(r, c), o && (o = M.sanitizeText(o, c));
79
- let e = d.records.branches.get(d.records.currBranch), a = d.records.branches.get(r), $ = e ? d.records.commits.get(e) : void 0, m = a ? d.records.commits.get(a) : void 0;
80
- if ($ && m && $.branch === r) throw Error(`Cannot merge branch '${r}' into itself.`);
81
- if (d.records.currBranch === r) {
82
- let n = /* @__PURE__ */ Error('Incorrect usage of "merge". Cannot merge a branch to itself');
83
- throw n.hash = {
84
- text: `merge ${r}`,
85
- token: `merge ${r}`,
86
- expected: ["branch abc"]
87
- }, n;
88
- }
89
- if ($ === void 0 || !$) {
90
- let n = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);
91
- throw n.hash = {
92
- text: `merge ${r}`,
93
- token: `merge ${r}`,
94
- expected: ["commit"]
95
- }, n;
96
- }
97
- if (!d.records.branches.has(r)) {
98
- let n = /* @__PURE__ */ Error('Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist");
99
- throw n.hash = {
100
- text: `merge ${r}`,
101
- token: `merge ${r}`,
102
- expected: [`branch ${r}`]
103
- }, n;
104
- }
105
- if (m === void 0 || !m) {
106
- let n = /* @__PURE__ */ Error('Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits");
107
- throw n.hash = {
108
- text: `merge ${r}`,
109
- token: `merge ${r}`,
110
- expected: ['"commit"']
111
- }, n;
112
- }
113
- if ($ === m) {
114
- let n = /* @__PURE__ */ Error('Incorrect usage of "merge". Both branches have same head');
115
- throw n.hash = {
116
- text: `merge ${r}`,
117
- token: `merge ${r}`,
118
- expected: ["branch abc"]
119
- }, n;
120
- }
121
- if (o && d.records.commits.has(o)) {
122
- let n = /* @__PURE__ */ Error('Incorrect usage of "merge". Commit with id:' + o + " already exists, use different custom id");
123
- throw n.hash = {
124
- text: `merge ${r} ${o} ${i} ${s == null ? void 0 : s.join(" ")}`,
125
- token: `merge ${r} ${o} ${i} ${s == null ? void 0 : s.join(" ")}`,
126
- expected: [`merge ${r} ${o}_UNIQUE ${i} ${s == null ? void 0 : s.join(" ")}`]
127
- }, n;
128
- }
129
- let g = a || "", h = {
130
- id: o || `${d.records.seq}-${U()}`,
131
- message: `merged branch ${r} into ${d.records.currBranch}`,
132
- seq: d.records.seq++,
133
- parents: d.records.head == null ? [] : [d.records.head.id, g],
134
- branch: d.records.currBranch,
135
- type: u.MERGE,
136
- customType: i,
137
- customId: !!o,
138
- tags: s ?? []
139
- };
140
- d.records.head = h, d.records.commits.set(h.id, h), d.records.branches.set(d.records.currBranch, h.id), B.debug(d.records.branches), B.debug("in mergeBranch");
141
- }, "merge"), Ot = /* @__PURE__ */ l(function(t) {
142
- let r = t.id, o = t.targetId, i = t.tags, s = t.parent;
143
- B.debug("Entering cherryPick:", r, o, i);
144
- let c = W();
145
- if (r = M.sanitizeText(r, c), o = M.sanitizeText(o, c), i = i == null ? void 0 : i.map(($) => M.sanitizeText($, c)), s = M.sanitizeText(s, c), !r || !d.records.commits.has(r)) {
146
- let $ = /* @__PURE__ */ Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
147
- throw $.hash = {
148
- text: `cherryPick ${r} ${o}`,
149
- token: `cherryPick ${r} ${o}`,
150
- expected: ["cherry-pick abc"]
151
- }, $;
152
- }
153
- let e = d.records.commits.get(r);
154
- if (e === void 0 || !e) throw Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
155
- if (s && !(Array.isArray(e.parents) && e.parents.includes(s))) throw /* @__PURE__ */ Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");
156
- let a = e.branch;
157
- if (e.type === u.MERGE && !s) throw /* @__PURE__ */ Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");
158
- if (!o || !d.records.commits.has(o)) {
159
- if (a === d.records.currBranch) {
160
- let h = /* @__PURE__ */ Error('Incorrect usage of "cherryPick". Source commit is already on current branch');
161
- throw h.hash = {
162
- text: `cherryPick ${r} ${o}`,
163
- token: `cherryPick ${r} ${o}`,
164
- expected: ["cherry-pick abc"]
165
- }, h;
166
- }
167
- let $ = d.records.branches.get(d.records.currBranch);
168
- if ($ === void 0 || !$) {
169
- let h = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);
170
- throw h.hash = {
171
- text: `cherryPick ${r} ${o}`,
172
- token: `cherryPick ${r} ${o}`,
173
- expected: ["cherry-pick abc"]
174
- }, h;
175
- }
176
- let m = d.records.commits.get($);
177
- if (m === void 0 || !m) {
178
- let h = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);
179
- throw h.hash = {
180
- text: `cherryPick ${r} ${o}`,
181
- token: `cherryPick ${r} ${o}`,
182
- expected: ["cherry-pick abc"]
183
- }, h;
184
- }
185
- let g = {
186
- id: d.records.seq + "-" + U(),
187
- message: `cherry-picked ${e == null ? void 0 : e.message} into ${d.records.currBranch}`,
188
- seq: d.records.seq++,
189
- parents: d.records.head == null ? [] : [d.records.head.id, e.id],
190
- branch: d.records.currBranch,
191
- type: u.CHERRY_PICK,
192
- tags: i ? i.filter(Boolean) : [`cherry-pick:${e.id}${e.type === u.MERGE ? `|parent:${s}` : ""}`]
193
- };
194
- d.records.head = g, d.records.commits.set(g.id, g), d.records.branches.set(d.records.currBranch, g.id), B.debug(d.records.branches), B.debug("in cherryPick");
195
- }
196
- }, "cherryPick"), ot = /* @__PURE__ */ l(function(t) {
197
- if (t = M.sanitizeText(t, W()), d.records.branches.has(t)) {
198
- d.records.currBranch = t;
199
- let r = d.records.branches.get(d.records.currBranch);
200
- r === void 0 || !r ? d.records.head = null : d.records.head = d.records.commits.get(r) ?? null;
201
- } else {
202
- let r = /* @__PURE__ */ Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);
203
- throw r.hash = {
204
- text: `checkout ${t}`,
205
- token: `checkout ${t}`,
206
- expected: [`branch ${t}`]
207
- }, r;
208
- }
209
- }, "checkout");
210
- function Y(t, r, o) {
211
- let i = t.indexOf(r);
212
- i === -1 ? t.push(o) : t.splice(i, 1, o);
213
- }
214
- l(Y, "upsert");
215
- function Z(t) {
216
- let r = t.reduce((s, c) => s.seq > c.seq ? s : c, t[0]), o = "";
217
- t.forEach(function(s) {
218
- s === r ? o += " *" : o += " |";
219
- });
220
- let i = [
221
- o,
222
- r.id,
223
- r.seq
224
- ];
225
- for (let s in d.records.branches) d.records.branches.get(s) === r.id && i.push(s);
226
- if (B.debug(i.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
227
- let s = d.records.commits.get(r.parents[0]);
228
- Y(t, r, s), r.parents[1] && t.push(d.records.commits.get(r.parents[1]));
229
- } else {
230
- if (r.parents.length == 0) return;
231
- if (r.parents[0]) {
232
- let s = d.records.commits.get(r.parents[0]);
233
- Y(t, r, s);
234
- }
235
- }
236
- t = et(t, (s) => s.id), Z(t);
237
- }
238
- l(Z, "prettyPrintCommitHistory");
239
- var At = /* @__PURE__ */ l(function() {
240
- B.debug(d.records.commits);
241
- let t = at()[0];
242
- Z([t]);
243
- }, "prettyPrint"), Gt = /* @__PURE__ */ l(function() {
244
- d.reset(), ut();
245
- }, "clear"), St = /* @__PURE__ */ l(function() {
246
- return [...d.records.branchConfig.values()].map((t, r) => t.order !== null && t.order !== void 0 ? t : {
247
- ...t,
248
- order: parseFloat(`0.${r}`)
249
- }).sort((t, r) => (t.order ?? 0) - (r.order ?? 0)).map(({ name: t }) => ({ name: t }));
250
- }, "getBranchesAsObjArray"), Ht = /* @__PURE__ */ l(function() {
251
- return d.records.branches;
252
- }, "getBranches"), Wt = /* @__PURE__ */ l(function() {
253
- return d.records.commits;
254
- }, "getCommits"), at = /* @__PURE__ */ l(function() {
255
- let t = [...d.records.commits.values()];
256
- return t.forEach(function(r) {
257
- B.debug(r.id);
258
- }), t.sort((r, o) => r.seq - o.seq), t;
259
- }, "getCommitsArray"), it = {
260
- commitType: u,
261
- getConfig: W,
262
- setDirection: Tt,
263
- setOptions: Mt,
264
- getOptions: vt,
265
- commit: It,
266
- branch: Rt,
267
- merge: Pt,
268
- cherryPick: Ot,
269
- checkout: ot,
270
- prettyPrint: At,
271
- clear: Gt,
272
- getBranchesAsObjArray: St,
273
- getBranches: Ht,
274
- getCommits: Wt,
275
- getCommitsArray: at,
276
- getCurrentBranch: /* @__PURE__ */ l(function() {
277
- return d.records.currBranch;
278
- }, "getCurrentBranch"),
279
- getDirection: /* @__PURE__ */ l(function() {
280
- return d.records.direction;
281
- }, "getDirection"),
282
- getHead: /* @__PURE__ */ l(function() {
283
- return d.records.head;
284
- }, "getHead"),
285
- setAccTitle: yt,
286
- getAccTitle: gt,
287
- getAccDescription: mt,
288
- setAccDescription: $t,
289
- setDiagramTitle: ht,
290
- getDiagramTitle: lt
291
- }, qt = /* @__PURE__ */ l((t, r) => {
292
- wt(t, r), t.dir && r.setDirection(t.dir);
293
- for (let o of t.statements) _t(o, r);
294
- }, "populate"), _t = /* @__PURE__ */ l((t, r) => {
295
- let o = {
296
- Commit: /* @__PURE__ */ l((i) => r.commit(zt(i)), "Commit"),
297
- Branch: /* @__PURE__ */ l((i) => r.branch(Dt(i)), "Branch"),
298
- Merge: /* @__PURE__ */ l((i) => r.merge(Ft(i)), "Merge"),
299
- Checkout: /* @__PURE__ */ l((i) => r.checkout(Nt(i)), "Checkout"),
300
- CherryPicking: /* @__PURE__ */ l((i) => r.cherryPick(jt(i)), "CherryPicking")
301
- }[t.$type];
302
- o ? o(t) : B.error(`Unknown statement type: ${t.$type}`);
303
- }, "parseStatement"), zt = /* @__PURE__ */ l((t) => ({
304
- id: t.id,
305
- msg: t.message ?? "",
306
- type: t.type === void 0 ? u.NORMAL : u[t.type],
307
- tags: t.tags ?? void 0
308
- }), "parseCommit"), Dt = /* @__PURE__ */ l((t) => ({
309
- name: t.name,
310
- order: t.order ?? 0
311
- }), "parseBranch"), Ft = /* @__PURE__ */ l((t) => ({
312
- branch: t.branch,
313
- id: t.id ?? "",
314
- type: t.type === void 0 ? void 0 : u[t.type],
315
- tags: t.tags ?? void 0
316
- }), "parseMerge"), Nt = /* @__PURE__ */ l((t) => t.branch, "parseCheckout"), jt = /* @__PURE__ */ l((t) => {
317
- var r;
318
- return {
319
- id: t.id,
320
- targetId: "",
321
- tags: ((r = t.tags) == null ? void 0 : r.length) === 0 ? void 0 : t.tags,
322
- parent: t.parent
323
- };
324
- }, "parseCherryPicking"), Kt = { parse: /* @__PURE__ */ l(async (t) => {
325
- let r = await Et("gitGraph", t);
326
- B.debug(r), qt(r, it);
327
- }, "parse") }, O = 10, A = 40, v = 4, I = 2, S = 8, V = /* @__PURE__ */ new Set([
328
- "redux",
329
- "redux-dark",
330
- "redux-color",
331
- "redux-dark-color"
332
- ]), J = 12, X = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Ut = /* @__PURE__ */ new Set([
333
- "dark",
334
- "redux-dark",
335
- "redux-dark-color",
336
- "neo-dark"
337
- ]), H = /* @__PURE__ */ l((t, r, o = !1) => o && t > 0 ? (t - 1) % (r - 1) + 1 : t % r, "calcColorIndex"), L = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), j = 30, z = /* @__PURE__ */ new Map(), K = [], R = 0, f = "LR", Vt = /* @__PURE__ */ l(() => {
338
- L.clear(), T.clear(), z.clear(), R = 0, K = [], f = "LR";
339
- }, "clear"), st = /* @__PURE__ */ l((t) => {
340
- let r = document.createElementNS("http://www.w3.org/2000/svg", "text");
341
- return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((o) => {
342
- let i = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
343
- i.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), i.setAttribute("dy", "1em"), i.setAttribute("x", "0"), i.setAttribute("class", "row"), i.textContent = o.trim(), r.appendChild(i);
344
- }), r;
345
- }, "drawText"), nt = /* @__PURE__ */ l((t) => {
346
- let r, o, i;
347
- return f === "BT" ? (o = /* @__PURE__ */ l((s, c) => s <= c, "comparisonFunc"), i = 1 / 0) : (o = /* @__PURE__ */ l((s, c) => s >= c, "comparisonFunc"), i = 0), t.forEach((s) => {
348
- var e, a;
349
- let c = f === "TB" || f == "BT" ? (e = T.get(s)) == null ? void 0 : e.y : (a = T.get(s)) == null ? void 0 : a.x;
350
- c !== void 0 && o(c, i) && (r = s, i = c);
351
- }), r;
352
- }, "findClosestParent"), Yt = /* @__PURE__ */ l((t) => {
353
- let r = "", o = 1 / 0;
354
- return t.forEach((i) => {
355
- let s = T.get(i).y;
356
- s <= o && (r = i, o = s);
357
- }), r || void 0;
358
- }, "findClosestParentBT"), Jt = /* @__PURE__ */ l((t, r, o) => {
359
- let i = o, s = o, c = [];
360
- t.forEach((e) => {
361
- let a = r.get(e);
362
- if (!a) throw Error(`Commit not found for key ${e}`);
363
- a.parents.length ? (i = Zt(a), s = Math.max(i, s)) : c.push(a), Xt(a, i);
364
- }), i = s, c.forEach((e) => {
365
- tr(e, i, o);
366
- }), t.forEach((e) => {
367
- let a = r.get(e);
368
- if (a != null && a.parents.length) {
369
- let $ = Yt(a.parents);
370
- i = T.get($).y - A, i <= s && (s = i);
371
- let m = L.get(a.branch).pos, g = i - O;
372
- T.set(a.id, {
373
- x: m,
374
- y: g
375
- });
376
- }
377
- });
378
- }, "setParallelBTPos"), Qt = /* @__PURE__ */ l((t) => {
379
- var i;
380
- let r = nt(t.parents.filter((s) => s !== null));
381
- if (!r) throw Error(`Closest parent not found for commit ${t.id}`);
382
- let o = (i = T.get(r)) == null ? void 0 : i.y;
383
- if (o === void 0) throw Error(`Closest parent position not found for commit ${t.id}`);
384
- return o;
385
- }, "findClosestParentPos"), Zt = /* @__PURE__ */ l((t) => Qt(t) + A, "calculateCommitPosition"), Xt = /* @__PURE__ */ l((t, r) => {
386
- let o = L.get(t.branch);
387
- if (!o) throw Error(`Branch not found for commit ${t.id}`);
388
- let i = o.pos, s = r + O;
389
- return T.set(t.id, {
390
- x: i,
391
- y: s
392
- }), {
393
- x: i,
394
- y: s
395
- };
396
- }, "setCommitPosition"), tr = /* @__PURE__ */ l((t, r, o) => {
397
- let i = L.get(t.branch);
398
- if (!i) throw Error(`Branch not found for commit ${t.id}`);
399
- let s = r + o, c = i.pos;
400
- T.set(t.id, {
401
- x: c,
402
- y: s
403
- });
404
- }, "setRootPosition"), rr = /* @__PURE__ */ l((t, r, o, i, s, c) => {
405
- let { theme: e } = F(), a = V.has(e ?? ""), $ = X.has(e ?? ""), m = Ut.has(e ?? "");
406
- if (c === u.HIGHLIGHT) t.append("rect").attr("x", o.x - 10 + (a ? 3 : 0)).attr("y", o.y - 10 + (a ? 3 : 0)).attr("width", a ? 14 : 20).attr("height", a ? 14 : 20).attr("class", `commit ${r.id} commit-highlight${H(s, S, $)} ${i}-outer`), t.append("rect").attr("x", o.x - 6 + (a ? 2 : 0)).attr("y", o.y - 6 + (a ? 2 : 0)).attr("width", a ? 8 : 12).attr("height", a ? 8 : 12).attr("class", `commit ${r.id} commit${H(s, S, $)} ${i}-inner`);
407
- else if (c === u.CHERRY_PICK) t.append("circle").attr("cx", o.x).attr("cy", o.y).attr("r", a ? 7 : 10).attr("class", `commit ${r.id} ${i}`), t.append("circle").attr("cx", o.x - 3).attr("cy", o.y + 2).attr("r", a ? 2.5 : 2.75).attr("fill", m ? "#000000" : "#fff").attr("class", `commit ${r.id} ${i}`), t.append("circle").attr("cx", o.x + 3).attr("cy", o.y + 2).attr("r", a ? 2.5 : 2.75).attr("fill", m ? "#000000" : "#fff").attr("class", `commit ${r.id} ${i}`), t.append("line").attr("x1", o.x + 3).attr("y1", o.y + 1).attr("x2", o.x).attr("y2", o.y - 5).attr("stroke", m ? "#000000" : "#fff").attr("class", `commit ${r.id} ${i}`), t.append("line").attr("x1", o.x - 3).attr("y1", o.y + 1).attr("x2", o.x).attr("y2", o.y - 5).attr("stroke", m ? "#000000" : "#fff").attr("class", `commit ${r.id} ${i}`);
408
- else {
409
- let g = t.append("circle");
410
- if (g.attr("cx", o.x), g.attr("cy", o.y), g.attr("r", a ? 7 : 10), g.attr("class", `commit ${r.id} commit${H(s, S, $)}`), c === u.MERGE) {
411
- let h = t.append("circle");
412
- h.attr("cx", o.x), h.attr("cy", o.y), h.attr("r", a ? 5 : 6), h.attr("class", `commit ${i} ${r.id} commit${H(s, S, $)}`);
413
- }
414
- if (c === u.REVERSE) {
415
- let h = t.append("path"), n = a ? 4 : 5;
416
- h.attr("d", `M ${o.x - n},${o.y - n}L${o.x + n},${o.y + n}M${o.x - n},${o.y + n}L${o.x + n},${o.y - n}`).attr("class", `commit ${i} ${r.id} commit${H(s, S, $)}`);
417
- }
418
- }
419
- }, "drawCommitBullet"), er = /* @__PURE__ */ l((t, r, o, i, s) => {
420
- var c;
421
- if (r.type !== u.CHERRY_PICK && (r.customId && r.type === u.MERGE || r.type !== u.MERGE) && s.showCommitLabel) {
422
- let e = t.append("g"), a = e.insert("rect").attr("class", "commit-label-bkg"), $ = e.append("text").attr("x", i).attr("y", o.y + 25).attr("class", "commit-label").text(r.id), m = (c = $.node()) == null ? void 0 : c.getBBox();
423
- if (m && (a.attr("x", o.posWithOffset - m.width / 2 - I).attr("y", o.y + 13.5).attr("width", m.width + 2 * I).attr("height", m.height + 2 * I), f === "TB" || f === "BT" ? (a.attr("x", o.x - (m.width + 4 * v + 5)).attr("y", o.y - 12), $.attr("x", o.x - (m.width + 4 * v)).attr("y", o.y + m.height - 12)) : $.attr("x", o.posWithOffset - m.width / 2), s.rotateCommitLabel)) if (f === "TB" || f === "BT") $.attr("transform", "rotate(-45, " + o.x + ", " + o.y + ")"), a.attr("transform", "rotate(-45, " + o.x + ", " + o.y + ")");
424
- else {
425
- let g = -7.5 - (m.width + 10) / 25 * 9.5, h = 10 + m.width / 25 * 8.5;
426
- e.attr("transform", "translate(" + g + ", " + h + ") rotate(-45, " + i + ", " + o.y + ")");
427
- }
428
- }
429
- }, "drawCommitLabel"), or = /* @__PURE__ */ l((t, r, o, i) => {
430
- var s;
431
- if (r.tags.length > 0) {
432
- let c = 0, e = 0, a = 0, $ = [];
433
- for (let m of r.tags.reverse()) {
434
- let g = t.insert("polygon"), h = t.append("circle"), n = t.append("text").attr("y", o.y - 16 - c).attr("class", "tag-label").text(m), p = (s = n.node()) == null ? void 0 : s.getBBox();
435
- if (!p) throw Error("Tag bbox not found");
436
- e = Math.max(e, p.width), a = Math.max(a, p.height), n.attr("x", o.posWithOffset - p.width / 2), $.push({
437
- tag: n,
438
- hole: h,
439
- rect: g,
440
- yOffset: c
441
- }), c += 20;
442
- }
443
- for (let { tag: m, hole: g, rect: h, yOffset: n } of $) {
444
- let p = a / 2, y = o.y - 19.2 - n;
445
- if (h.attr("class", "tag-label-bkg").attr("points", `
446
- ${i - e / 2 - v / 2},${y + I}
447
- ${i - e / 2 - v / 2},${y - I}
448
- ${o.posWithOffset - e / 2 - v},${y - p - I}
449
- ${o.posWithOffset + e / 2 + v},${y - p - I}
450
- ${o.posWithOffset + e / 2 + v},${y + p + I}
451
- ${o.posWithOffset - e / 2 - v},${y + p + I}`), g.attr("cy", y).attr("cx", i - e / 2 + v / 2).attr("r", 1.5).attr("class", "tag-hole"), f === "TB" || f === "BT") {
452
- let x = i + n;
453
- h.attr("class", "tag-label-bkg").attr("points", `
454
- ${o.x},${x + 2}
455
- ${o.x},${x - 2}
456
- ${o.x + O},${x - p - 2}
457
- ${o.x + O + e + 4},${x - p - 2}
458
- ${o.x + O + e + 4},${x + p + 2}
459
- ${o.x + O},${x + p + 2}`).attr("transform", "translate(12,12) rotate(45, " + o.x + "," + i + ")"), g.attr("cx", o.x + v / 2).attr("cy", x).attr("transform", "translate(12,12) rotate(45, " + o.x + "," + i + ")"), m.attr("x", o.x + 5).attr("y", x + 3).attr("transform", "translate(14,14) rotate(45, " + o.x + "," + i + ")");
460
- }
461
- }
462
- }
463
- }, "drawCommitTags"), ar = /* @__PURE__ */ l((t) => {
464
- switch (t.customType ?? t.type) {
465
- case u.NORMAL:
466
- return "commit-normal";
467
- case u.REVERSE:
468
- return "commit-reverse";
469
- case u.HIGHLIGHT:
470
- return "commit-highlight";
471
- case u.MERGE:
472
- return "commit-merge";
473
- case u.CHERRY_PICK:
474
- return "commit-cherry-pick";
475
- default:
476
- return "commit-normal";
477
- }
478
- }, "getCommitClassType"), ir = /* @__PURE__ */ l((t, r, o, i) => {
479
- let s = {
480
- x: 0,
481
- y: 0
482
- };
483
- if (t.parents.length > 0) {
484
- let c = nt(t.parents);
485
- if (c) {
486
- let e = i.get(c) ?? s;
487
- return r === "TB" ? e.y + A : r === "BT" ? (i.get(t.id) ?? s).y - A : e.x + A;
488
- }
489
- } else return r === "TB" ? j : r === "BT" ? (i.get(t.id) ?? s).y - A : 0;
490
- return 0;
491
- }, "calculatePosition"), sr = /* @__PURE__ */ l((t, r, o) => {
492
- var a, $;
493
- let i = f === "BT" && o ? r : r + O, s = (a = L.get(t.branch)) == null ? void 0 : a.pos, c = f === "TB" || f === "BT" ? ($ = L.get(t.branch)) == null ? void 0 : $.pos : i;
494
- if (c === void 0 || s === void 0) throw Error(`Position were undefined for commit ${t.id}`);
495
- let e = V.has(F().theme ?? "");
496
- return {
497
- x: c,
498
- y: f === "TB" || f === "BT" ? i : s + (e ? J / 2 + 1 : -2),
499
- posWithOffset: i
500
- };
501
- }, "getCommitPosition"), rt = /* @__PURE__ */ l((t, r, o, i) => {
502
- let s = t.append("g").attr("class", "commit-bullets"), c = t.append("g").attr("class", "commit-labels"), e = f === "TB" || f === "BT" ? j : 0, a = [...r.keys()], $ = i.parallelCommits ?? !1, m = /* @__PURE__ */ l((h, n) => {
503
- var x, E;
504
- let p = (x = r.get(h)) == null ? void 0 : x.seq, y = (E = r.get(n)) == null ? void 0 : E.seq;
505
- return p !== void 0 && y !== void 0 ? p - y : 0;
506
- }, "sortKeys"), g = a.sort(m);
507
- f === "BT" && ($ && Jt(g, r, e), g = g.reverse()), g.forEach((h) => {
508
- var y;
509
- let n = r.get(h);
510
- if (!n) throw Error(`Commit not found for key ${h}`);
511
- $ && (e = ir(n, f, e, T));
512
- let p = sr(n, e, $);
513
- if (o) {
514
- let x = ar(n), E = n.customType ?? n.type;
515
- rr(s, n, p, x, ((y = L.get(n.branch)) == null ? void 0 : y.index) ?? 0, E), er(c, n, p, e, i), or(c, n, p, e);
516
- }
517
- f === "TB" || f === "BT" ? T.set(n.id, {
518
- x: p.x,
519
- y: p.posWithOffset
520
- }) : T.set(n.id, {
521
- x: p.posWithOffset,
522
- y: p.y
523
- }), e = f === "BT" && $ ? e + A : e + A + O, e > R && (R = e);
524
- });
525
- }, "drawCommits"), nr = /* @__PURE__ */ l((t, r, o, i, s) => {
526
- let c = (f === "TB" || f === "BT" ? o.x < i.x : o.y < i.y) ? r.branch : t.branch, e = /* @__PURE__ */ l(($) => $.branch === c, "isOnBranchToGetCurve"), a = /* @__PURE__ */ l(($) => $.seq > t.seq && $.seq < r.seq, "isBetweenCommits");
527
- return [...s.values()].some(($) => a($) && e($));
528
- }, "shouldRerouteArrow"), D = /* @__PURE__ */ l((t, r, o = 0) => {
529
- let i = t + Math.abs(t - r) / 2;
530
- return o > 5 ? i : K.every((s) => Math.abs(s - i) >= 10) ? (K.push(i), i) : D(t, r - Math.abs(t - r) / 5, o + 1);
531
- }, "findLane"), cr = /* @__PURE__ */ l((t, r, o, i) => {
532
- var x, E, k, q, P;
533
- let { theme: s } = F(), c = X.has(s ?? ""), e = T.get(r.id), a = T.get(o.id);
534
- if (e === void 0 || a === void 0) throw Error(`Commit positions not found for commits ${r.id} and ${o.id}`);
535
- let $ = nr(r, o, e, a, i), m = "", g = "", h = 0, n = 0, p = (x = L.get(o.branch)) == null ? void 0 : x.index;
536
- o.type === u.MERGE && r.id !== o.parents[0] && (p = (E = L.get(r.branch)) == null ? void 0 : E.index);
537
- let y;
538
- if ($) {
539
- m = "A 10 10, 0, 0, 0,", g = "A 10 10, 0, 0, 1,", h = 10, n = 10;
540
- let w = e.y < a.y ? D(e.y, a.y) : D(a.y, e.y), b = e.x < a.x ? D(e.x, a.x) : D(a.x, e.x);
541
- f === "TB" ? e.x < a.x ? y = `M ${e.x} ${e.y} L ${b - h} ${e.y} ${g} ${b} ${e.y + n} L ${b} ${a.y - h} ${m} ${b + n} ${a.y} L ${a.x} ${a.y}` : (p = (k = L.get(r.branch)) == null ? void 0 : k.index, y = `M ${e.x} ${e.y} L ${b + h} ${e.y} ${m} ${b} ${e.y + n} L ${b} ${a.y - h} ${g} ${b - n} ${a.y} L ${a.x} ${a.y}`) : f === "BT" ? e.x < a.x ? y = `M ${e.x} ${e.y} L ${b - h} ${e.y} ${m} ${b} ${e.y - n} L ${b} ${a.y + h} ${g} ${b + n} ${a.y} L ${a.x} ${a.y}` : (p = (q = L.get(r.branch)) == null ? void 0 : q.index, y = `M ${e.x} ${e.y} L ${b + h} ${e.y} ${g} ${b} ${e.y - n} L ${b} ${a.y + h} ${m} ${b - n} ${a.y} L ${a.x} ${a.y}`) : e.y < a.y ? y = `M ${e.x} ${e.y} L ${e.x} ${w - h} ${m} ${e.x + n} ${w} L ${a.x - h} ${w} ${g} ${a.x} ${w + n} L ${a.x} ${a.y}` : (p = (P = L.get(r.branch)) == null ? void 0 : P.index, y = `M ${e.x} ${e.y} L ${e.x} ${w + h} ${g} ${e.x + n} ${w} L ${a.x - h} ${w} ${m} ${a.x} ${w - n} L ${a.x} ${a.y}`);
542
- } else m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", h = 20, n = 20, f === "TB" ? (e.x < a.x && (y = o.type === u.MERGE && r.id !== o.parents[0] ? `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${m} ${e.x + n} ${a.y} L ${a.x} ${a.y}` : `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${g} ${a.x} ${e.y + n} L ${a.x} ${a.y}`), e.x > a.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", h = 20, n = 20, y = o.type === u.MERGE && r.id !== o.parents[0] ? `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${g} ${e.x - n} ${a.y} L ${a.x} ${a.y}` : `M ${e.x} ${e.y} L ${a.x + h} ${e.y} ${m} ${a.x} ${e.y + n} L ${a.x} ${a.y}`), e.x === a.x && (y = `M ${e.x} ${e.y} L ${a.x} ${a.y}`)) : f === "BT" ? (e.x < a.x && (y = o.type === u.MERGE && r.id !== o.parents[0] ? `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${g} ${e.x + n} ${a.y} L ${a.x} ${a.y}` : `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${m} ${a.x} ${e.y - n} L ${a.x} ${a.y}`), e.x > a.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", h = 20, n = 20, y = o.type === u.MERGE && r.id !== o.parents[0] ? `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${m} ${e.x - n} ${a.y} L ${a.x} ${a.y}` : `M ${e.x} ${e.y} L ${a.x + h} ${e.y} ${g} ${a.x} ${e.y - n} L ${a.x} ${a.y}`), e.x === a.x && (y = `M ${e.x} ${e.y} L ${a.x} ${a.y}`)) : (e.y < a.y && (y = o.type === u.MERGE && r.id !== o.parents[0] ? `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${g} ${a.x} ${e.y + n} L ${a.x} ${a.y}` : `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${m} ${e.x + n} ${a.y} L ${a.x} ${a.y}`), e.y > a.y && (y = o.type === u.MERGE && r.id !== o.parents[0] ? `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${m} ${a.x} ${e.y - n} L ${a.x} ${a.y}` : `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${g} ${e.x + n} ${a.y} L ${a.x} ${a.y}`), e.y === a.y && (y = `M ${e.x} ${e.y} L ${a.x} ${a.y}`));
543
- if (y === void 0) throw Error("Line definition not found");
544
- t.append("path").attr("d", y).attr("class", "arrow arrow" + H(p, S, c));
545
- }, "drawArrow"), dr = /* @__PURE__ */ l((t, r) => {
546
- let o = t.append("g").attr("class", "commit-arrows");
547
- [...r.keys()].forEach((i) => {
548
- let s = r.get(i);
549
- s.parents && s.parents.length > 0 && s.parents.forEach((c) => {
550
- cr(o, r.get(c), s, r);
551
- });
552
- });
553
- }, "drawArrows"), lr = /* @__PURE__ */ l((t, r, o, i) => {
554
- let { look: s, theme: c, themeVariables: e } = F(), { dropShadow: a, THEME_COLOR_LIMIT: $ } = e, m = V.has(c ?? ""), g = X.has(c ?? ""), h = t.append("g");
555
- r.forEach((n, p) => {
556
- var tt;
557
- let y = H(p, m ? $ : S, g), x = (tt = L.get(n.name)) == null ? void 0 : tt.pos;
558
- if (x === void 0) throw Error(`Position not found for branch ${n.name}`);
559
- let E = f === "TB" || f === "BT" ? x : m ? x + J / 2 + 1 : x - 2, k = h.append("line");
560
- k.attr("x1", 0), k.attr("y1", E), k.attr("x2", R), k.attr("y2", E), k.attr("class", "branch branch" + y), f === "TB" ? (k.attr("y1", j), k.attr("x1", x), k.attr("y2", R), k.attr("x2", x)) : f === "BT" && (k.attr("y1", R), k.attr("x1", x), k.attr("y2", j), k.attr("x2", x)), K.push(E);
561
- let q = n.name, P = st(q), w = h.insert("rect"), b = h.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + y);
562
- b.node().appendChild(P);
563
- let C = P.getBBox(), N = m ? 0 : 4, G = m ? 16 : 0, _ = m ? J : 0;
564
- s === "neo" && w.attr("data-look", "neo"), w.attr("class", "branchLabelBkg label" + y).attr("style", s === "neo" ? `filter:${m ? `url(#${i}-drop-shadow)` : a}` : "").attr("rx", N).attr("ry", N).attr("x", -C.width - 4 - (o.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -C.height / 2 + 10).attr("width", C.width + 18 + G).attr("height", C.height + 4 + _), b.attr("transform", "translate(" + (-C.width - 14 - (o.rotateCommitLabel === !0 ? 30 : 0) + G / 2) + ", " + (E - C.height / 2 - 2) + ")"), f === "TB" ? (w.attr("x", x - C.width / 2 - 10).attr("y", 0), b.attr("transform", "translate(" + (x - C.width / 2 - 5) + ", 0)"), m && (w.attr("transform", `translate(${-G / 2 - 3}, ${-_ - 10})`), b.attr("transform", "translate(" + (x - C.width / 2 - 5) + ", " + (-_ * 2 + 7) + ")"))) : f === "BT" ? (w.attr("x", x - C.width / 2 - 10).attr("y", R), b.attr("transform", "translate(" + (x - C.width / 2 - 5) + ", " + R + ")"), m && (w.attr("transform", `translate(${-G / 2 - 3}, ${_ + 10})`), b.attr("transform", "translate(" + (x - C.width / 2 - 5) + ", " + (R + _ * 2 + 4) + ")"))) : w.attr("transform", "translate(-19, " + (E - 12 - _ / 2) + ")");
565
- });
566
- }, "drawBranches"), hr = /* @__PURE__ */ l(function(t, r, o, i, s) {
567
- return L.set(t, {
568
- pos: r,
569
- index: o
570
- }), r += 50 + (s ? 40 : 0) + (f === "TB" || f === "BT" ? i.width / 2 : 0), r;
571
- }, "setBranchPosition"), $r = { draw: /* @__PURE__ */ l(function(t, r, o, i) {
572
- Vt(), B.debug("in gitgraph renderer", t + `
573
- `, "id:", r, o);
574
- let s = i.db;
575
- if (!s.getConfig) {
576
- B.error("getConfig method is not available on db");
577
- return;
578
- }
579
- let c = s.getConfig(), e = c.rotateCommitLabel ?? !1;
580
- z = s.getCommits();
581
- let a = s.getBranchesAsObjArray();
582
- f = s.getDirection();
583
- let $ = ft(`[id="${r}"]`), { look: m, theme: g, themeVariables: h } = F(), { useGradient: n, gradientStart: p, gradientStop: y, filterColor: x } = h;
584
- if (n) {
585
- let k = $.append("defs").append("linearGradient").attr("id", r + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
586
- k.append("stop").attr("offset", "0%").attr("stop-color", p).attr("stop-opacity", 1), k.append("stop").attr("offset", "100%").attr("stop-color", y).attr("stop-opacity", 1);
587
- }
588
- m === "neo" && V.has(g ?? "") && $.append("defs").append("filter").attr("id", r + "-drop-shadow").attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", x);
589
- let E = 0;
590
- a.forEach((k, q) => {
591
- var G;
592
- let P = st(k.name), w = $.append("g"), b = w.insert("g").attr("class", "branchLabel"), C = b.insert("g").attr("class", "label branch-label");
593
- (G = C.node()) == null || G.appendChild(P);
594
- let N = P.getBBox();
595
- E = hr(k.name, E, q, N, e), C.remove(), b.remove(), w.remove();
596
- }), rt($, z, !1, c), c.showBranches && lr($, a, c, r), dr($, z), rt($, z, !0, c), pt.insertTitle($, "gitTitleText", c.titleTopMargin ?? 0, s.getDiagramTitle()), xt(void 0, $, c.diagramPadding, c.useMaxWidth);
597
- }, "draw") }, ct = 8, dt = /* @__PURE__ */ new Set([
598
- "redux",
599
- "redux-dark",
600
- "redux-color",
601
- "redux-dark-color"
602
- ]), mr = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), gr = /* @__PURE__ */ new Set(["neo", "neo-dark"]), yr = /* @__PURE__ */ new Set([
603
- "dark",
604
- "redux-dark",
605
- "redux-dark-color",
606
- "neo-dark"
607
- ]), fr = /* @__PURE__ */ new Set([
608
- "redux",
609
- "redux-dark",
610
- "redux-color",
611
- "redux-dark-color",
612
- "neo",
613
- "neo-dark"
614
- ]), pr = /* @__PURE__ */ l((t) => {
615
- let { svgId: r } = t, o = "";
616
- if (t.useGradient && r) for (let i = 0; i < t.THEME_COLOR_LIMIT; i++) o += `
617
- .label${i} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}
618
- `;
619
- return o;
620
- }, "genGitGraphGradient"), xr = /* @__PURE__ */ l((t) => {
621
- let { theme: r, themeVariables: o } = Q(), { borderColorArray: i } = o, s = dt.has(r);
622
- if (gr.has(r)) {
623
- let c = "";
624
- for (let e = 0; e < t.THEME_COLOR_LIMIT; e++) if (e === 0) c += `
625
- .branch-label${e} { fill: ${t.nodeBorder};}
626
- .commit${e} { stroke: ${t.nodeBorder}; }
627
- .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
628
- .arrow${e} { stroke: ${t.nodeBorder}; }
629
- .commit-bullets { fill: ${t.nodeBorder}; }
630
- .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }
631
- ${pr(t)}`;
632
- else {
633
- let a = e % ct;
634
- c += `
635
- .branch-label${e} { fill: ${t["gitBranchLabel" + a]}; }
636
- .commit${e} { stroke: ${t["git" + a]}; fill: ${t["git" + a]}; }
637
- .commit-highlight${e} { stroke: ${t["gitInv" + a]}; fill: ${t["gitInv" + a]}; }
638
- .arrow${e} { stroke: ${t["git" + a]}; }
639
- `;
640
- }
641
- return c;
642
- } else if (mr.has(r)) {
643
- let c = "";
644
- for (let e = 0; e < t.THEME_COLOR_LIMIT; e++) if (e === 0) c += `
645
- .branch-label${e} { fill: ${t.nodeBorder}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
646
- .commit${e} { stroke: ${t.nodeBorder}; }
647
- .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }
648
- .label${e} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
649
- .arrow${e} { stroke: ${t.nodeBorder}; }
650
- .commit-bullets { fill: ${t.nodeBorder}; }
651
- `;
652
- else {
653
- let a = e % i.length;
654
- c += `
655
- .branch-label${e} { fill: ${t.nodeBorder}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
656
- .commit${e} { stroke: ${i[a]}; fill: ${i[a]}; }
657
- .commit-highlight${e} { stroke: ${i[a]}; fill: ${i[a]}; }
658
- .label${e} { fill: ${yr.has(r) ? t.mainBkg : i[a]}; stroke: ${i[a]}; stroke-width: ${t.strokeWidth}; }
659
- .arrow${e} { stroke: ${i[a]}; }
660
- `;
661
- }
662
- return c;
663
- } else {
664
- let c = "";
665
- for (let e = 0; e < t.THEME_COLOR_LIMIT; e++) c += `
666
- .branch-label${e} { fill: ${t.nodeBorder}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
667
- .commit${e} { stroke: ${t.nodeBorder}; }
668
- .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
669
- .label${e} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${s ? `font-weight:${t.noteFontWeight}` : ""}}
670
- .arrow${e} { stroke: ${t.nodeBorder}; }
671
- .commit-bullets { fill: ${t.nodeBorder}; }
672
- .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }
673
- `;
674
- return c;
675
- }
676
- }, "genColor"), ur = /* @__PURE__ */ l((t) => `${Array.from({ length: t.THEME_COLOR_LIMIT }, (r, o) => o).map((r) => {
677
- let o = r % ct;
678
- return `
679
- .branch-label${r} { fill: ${t["gitBranchLabel" + o]}; }
680
- .commit${r} { stroke: ${t["git" + o]}; fill: ${t["git" + o]}; }
681
- .commit-highlight${r} { stroke: ${t["gitInv" + o]}; fill: ${t["gitInv" + o]}; }
682
- .label${r} { fill: ${t["git" + o]}; }
683
- .arrow${r} { stroke: ${t["git" + o]}; }
684
- `;
685
- }).join(`
686
- `)}`, "normalTheme"), Er = {
687
- parser: Kt,
688
- db: it,
689
- renderer: $r,
690
- styles: /* @__PURE__ */ l((t) => {
691
- let { theme: r } = Q(), o = fr.has(r);
692
- return `
693
- .commit-id,
694
- .commit-msg,
695
- .branch-label {
696
- fill: lightgrey;
697
- color: lightgrey;
698
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
699
- font-family: var(--mermaid-font-family);
700
- }
701
-
702
- ${o ? xr(t) : ur(t)}
703
-
704
- .branch {
705
- stroke-width: ${t.strokeWidth};
706
- stroke: ${t.commitLineColor ?? t.lineColor};
707
- stroke-dasharray: ${o ? "4 2" : "2"};
708
- }
709
- .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${o ? t.nodeBorder : t.commitLabelColor}; ${o ? `font-weight:${t.noteFontWeight};` : ""}}
710
- .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${o ? "transparent" : t.commitLabelBackground}; opacity: ${o ? "" : 0.5}; }
711
- .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
712
- .tag-label-bkg { fill: ${o ? t.mainBkg : t.tagLabelBackground}; stroke: ${o ? t.nodeBorder : t.tagLabelBorder}; ${o ? `filter:${t.dropShadow}` : ""} }
713
- .tag-hole { fill: ${t.textColor}; }
714
-
715
- .commit-merge {
716
- stroke: ${o ? t.mainBkg : t.primaryColor};
717
- fill: ${o ? t.mainBkg : t.primaryColor};
718
- }
719
- .commit-reverse {
720
- stroke: ${o ? t.mainBkg : t.primaryColor};
721
- fill: ${o ? t.mainBkg : t.primaryColor};
722
- stroke-width: ${o ? t.strokeWidth : 3};
723
- }
724
- .commit-highlight-outer {
725
- }
726
- .commit-highlight-inner {
727
- stroke: ${o ? t.mainBkg : t.primaryColor};
728
- fill: ${o ? t.mainBkg : t.primaryColor};
729
- }
730
-
731
- .arrow {
732
- /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
733
- stroke-width: ${dt.has(r) ? t.strokeWidth : 8};
734
- stroke-linecap: round;
735
- fill: none
736
- }
737
- .gitTitleText {
738
- text-anchor: middle;
739
- font-size: 18px;
740
- fill: ${t.textColor};
741
- }
742
- `;
743
- }, "getStyles")
744
- };
745
- export {
746
- Er as diagram
747
- };