@marimo-team/islands 0.13.16-dev3 → 0.13.16-dev4

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 (85) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DaX7qzkh.js → ConnectedDataExplorerComponent-W-BOfG8M.js} +1495 -1496
  2. package/dist/{VegaLite-DqttTZoC.js → VegaLite-C9hsmU75.js} +12483 -12485
  3. package/dist/{_baseUniq-C7BPwQHe.js → _baseUniq-JsDeIdvj.js} +13 -13
  4. package/dist/{any-language-editor-DUew9Rp9.js → any-language-editor-BzZqDQm_.js} +2 -2
  5. package/dist/{architectureDiagram-IEHRJDOE-a3lDrXQx.js → architectureDiagram-IEHRJDOE-DnNsdc8e.js} +1800 -1800
  6. package/dist/asn1-jKiBa2Ya.js +10 -10
  7. package/dist/assets/{save-worker-9HEtFDM0.js → save-worker-DwN_qfSx.js} +695 -702
  8. package/dist/assets/{worker-BGGm0KYZ.js → worker-BzMPE1Lq.js} +732 -739
  9. package/dist/assets/{worker-BNsqBj5w.js → worker-ISYYr8IB.js} +726 -732
  10. package/dist/blockDiagram-JOT3LUYC-C_KEbscf.js +2249 -0
  11. package/dist/{c4Diagram-VJAJSXHY-iO9Wy6JM.js → c4Diagram-VJAJSXHY-B7trZ6_H.js} +401 -400
  12. package/dist/{channel-DcjC1CFM.js → channel-CwUzkjN9.js} +1 -1
  13. package/dist/chunk-4BMEZGHF-C4_0qa8X.js +9 -0
  14. package/dist/chunk-A2AXSNBT-DApfdN4z.js +1373 -0
  15. package/dist/chunk-AEK57VVT-D_rUaIu3.js +1416 -0
  16. package/dist/{chunk-D6G4REZN-Dlv_YHcf.js → chunk-D6G4REZN-BJurAONC.js} +2 -2
  17. package/dist/{chunk-RZ5BOZE2-D8w7Mlj9.js → chunk-RZ5BOZE2-ChOs68Hz.js} +8 -8
  18. package/dist/chunk-XZIHB7SX-CGbScEEe.js +16 -0
  19. package/dist/{classDiagram-GIVACNV2-B9RHXsFh.js → classDiagram-GIVACNV2-CqVjeibK.js} +2 -2
  20. package/dist/{classDiagram-v2-COTLJTTW-B9RHXsFh.js → classDiagram-v2-COTLJTTW-CqVjeibK.js} +2 -2
  21. package/dist/clojure-CCKyeQKf.js +2 -2
  22. package/dist/{clone-D3N_odGc.js → clone-BPHB9gtw.js} +1 -1
  23. package/dist/css-bIlmDBTK.js +19 -19
  24. package/dist/{cytoscape.esm-DAyNQ0qu.js → cytoscape.esm-CCQ3SVU1.js} +2301 -2301
  25. package/dist/dagre-OKDRZEBW-EJUR9APO.js +447 -0
  26. package/dist/{data-editor-DYnEMVel.js → data-editor-CvujN_l-.js} +5785 -5795
  27. package/dist/{diagram-SSKATNLV-B7sCpaam.js → diagram-SSKATNLV-Bs-Zy3OO.js} +13 -13
  28. package/dist/{diagram-VNBRO52H-D5XB9Rqn.js → diagram-VNBRO52H-rhV7IJ0T.js} +3 -3
  29. package/dist/{erDiagram-Q7BY3M3F-Bc4bVsl5.js → erDiagram-Q7BY3M3F-DwuCpdOL.js} +263 -262
  30. package/dist/flowDiagram-4HSFHLVR-CpbGvx3R.js +1623 -0
  31. package/dist/{ganttDiagram-APWFNJXF-DX7O4yzu.js → ganttDiagram-APWFNJXF-B9ih7Ggj.js} +45 -45
  32. package/dist/gitGraphDiagram-7IBYFJ6S-tTFS2NlF.js +712 -0
  33. package/dist/{graph-3qoxqlMi.js → graph-DiSBbvS5.js} +9 -9
  34. package/dist/{index-ClcExt8M.js → index-BZo5-DOE.js} +99 -98
  35. package/dist/{index-DSv7cBZ6.js → index-CmU7bpCv.js} +4 -4
  36. package/dist/{index-DMwlOrYW.js → index-KrnLhU30.js} +9 -9
  37. package/dist/{index-DarPCnb9.js → index-TeAlNqJE.js} +28 -28
  38. package/dist/{infoDiagram-PH2N3AL5-Hpz-dZTP.js → infoDiagram-PH2N3AL5-COt3b362.js} +3 -3
  39. package/dist/javascript-WMWNx-Vj.js +47 -47
  40. package/dist/{journeyDiagram-U35MCT3I-D8lBbVPX.js → journeyDiagram-U35MCT3I-Civ2cUVg.js} +18 -18
  41. package/dist/kanban-definition-NDS4AKOZ-QxhTc8lo.js +719 -0
  42. package/dist/{katex-9tX9hjoM.js → katex-CUSbq6rG.js} +2180 -2180
  43. package/dist/{layout-BQ5ygFMS.js → layout-B0SQ1LdD.js} +27 -27
  44. package/dist/{linear-DEKTCzK7.js → linear-Bn_UtFyT.js} +2 -2
  45. package/dist/main-ClxYr2BI.js +169878 -0
  46. package/dist/main.js +1 -1
  47. package/dist/mermaid-M3c3q4Qd.js +14517 -0
  48. package/dist/{mhchem-L5-rce7L.js → mhchem-Db_f2n8C.js} +30 -30
  49. package/dist/{min-BVLo0atX.js → min-C0Jzc_ko.js} +2 -2
  50. package/dist/{mindmap-definition-ALO5MXBD-CJrYaVvo.js → mindmap-definition-ALO5MXBD-BW8IbhiG.js} +359 -359
  51. package/dist/mllike-BSnXJBGA.js +7 -7
  52. package/dist/{pieDiagram-IB7DONF6-Dctceo_p.js → pieDiagram-IB7DONF6-DIa7m5Au.js} +34 -34
  53. package/dist/pug-BqUR2bBq.js +35 -35
  54. package/dist/python-B5QdSKoL.js +18 -18
  55. package/dist/quadrantDiagram-7GDLP6J5-D1HtkiJK.js +1025 -0
  56. package/dist/{radar-MK3ICKWK-C1HW1I3s.js → radar-MK3ICKWK-Dm3jRuoE.js} +2555 -2554
  57. package/dist/{react-plotly-Cb9GFlJK.js → react-plotly-CJ3A7ju0.js} +6595 -6597
  58. package/dist/{requirementDiagram-KVF5MWMF-B1hXsRKm.js → requirementDiagram-KVF5MWMF-b-q1aUEu.js} +251 -250
  59. package/dist/rpm-IznJm2Xc.js +9 -9
  60. package/dist/{sankeyDiagram-QLVOVGJD-C4Wft0rG.js → sankeyDiagram-QLVOVGJD-Bo4y0LBQ.js} +339 -338
  61. package/dist/{sequenceDiagram-X6HHIX6F-DuI3MtaO.js → sequenceDiagram-X6HHIX6F-DMq4wla5.js} +822 -821
  62. package/dist/{slides-component-CtHXOtAT.js → slides-component-Cyh202Vq.js} +280 -280
  63. package/dist/sql-mMre1Bo3.js +9 -9
  64. package/dist/{stateDiagram-DGXRK772-BA90keZx.js → stateDiagram-DGXRK772-D_y0WAcv.js} +17 -17
  65. package/dist/{stateDiagram-v2-YXO3MK2T-BAYgRopg.js → stateDiagram-v2-YXO3MK2T-CHK5LNw7.js} +2 -2
  66. package/dist/style.css +1 -1
  67. package/dist/{time-CSFHw3Jv.js → time-YVQKuiUR.js} +2 -2
  68. package/dist/{timeline-definition-BDJGKUSR-Blc0sOvC.js → timeline-definition-BDJGKUSR-DH63_P4w.js} +261 -261
  69. package/dist/timer-BYwnU4DF.js +378 -378
  70. package/dist/ttcn-cfg-Bac_acMi.js +9 -9
  71. package/dist/{vega-component-BhqCtGzK.js → vega-component-CUFBFMjm.js} +82 -82
  72. package/dist/{xychartDiagram-VJFVF3MP-zwhLbXXB.js → xychartDiagram-VJFVF3MP-3NU7tduZ.js} +472 -471
  73. package/package.json +1 -1
  74. package/dist/blockDiagram-JOT3LUYC-CKFyxt0d.js +0 -2248
  75. package/dist/chunk-4BMEZGHF-lIaJqjDq.js +0 -9
  76. package/dist/chunk-A2AXSNBT-Cvv8kb-T.js +0 -1372
  77. package/dist/chunk-AEK57VVT-B-uzYNYV.js +0 -1415
  78. package/dist/chunk-XZIHB7SX-eF6XymTt.js +0 -15
  79. package/dist/dagre-OKDRZEBW-9GOkw9EI.js +0 -447
  80. package/dist/flowDiagram-4HSFHLVR-O0PMfC8B.js +0 -1622
  81. package/dist/gitGraphDiagram-7IBYFJ6S-Bq1HYszu.js +0 -712
  82. package/dist/kanban-definition-NDS4AKOZ-BjHkwf3p.js +0 -719
  83. package/dist/main-CtGDFKVm.js +0 -156521
  84. package/dist/mermaid-dkwEEzHU.js +0 -11991
  85. package/dist/quadrantDiagram-7GDLP6J5-BCGXIJXJ.js +0 -1024
@@ -0,0 +1,712 @@
1
+ import { p as Y } from "./chunk-4BMEZGHF-C4_0qa8X.js";
2
+ import { I as K } from "./chunk-XZIHB7SX-CGbScEEe.js";
3
+ import { _ as l, t as U, q as V, s as X, g as J, a as Q, b as Z, l as b, c as rr, d as er, u as tr, E as ar, z as sr, k as C, F as nr, G as or, H as cr, I as ir } from "./mermaid-M3c3q4Qd.js";
4
+ import { p as dr } from "./radar-MK3ICKWK-Dm3jRuoE.js";
5
+ var p = {
6
+ NORMAL: 0,
7
+ REVERSE: 1,
8
+ HIGHLIGHT: 2,
9
+ MERGE: 3,
10
+ CHERRY_PICK: 4
11
+ }, hr = cr.gitGraph, I = /* @__PURE__ */ l(() => nr({
12
+ ...hr,
13
+ ...or().gitGraph
14
+ }), "getConfig"), c = new K(() => {
15
+ const t = I(), r = t.mainBranchName, s = t.mainBranchOrder;
16
+ return {
17
+ mainBranchName: r,
18
+ commits: /* @__PURE__ */ new Map(),
19
+ head: null,
20
+ branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: s }]]),
21
+ branches: /* @__PURE__ */ new Map([[r, null]]),
22
+ currBranch: r,
23
+ direction: "LR",
24
+ seq: 0,
25
+ options: {}
26
+ };
27
+ });
28
+ function A() {
29
+ return ir({ length: 7 });
30
+ }
31
+ l(A, "getID");
32
+ function F(t, r) {
33
+ const s = /* @__PURE__ */ Object.create(null);
34
+ return t.reduce((n, e) => {
35
+ const a = r(e);
36
+ return s[a] || (s[a] = true, n.push(e)), n;
37
+ }, []);
38
+ }
39
+ l(F, "uniqBy");
40
+ var lr = /* @__PURE__ */ l(function(t) {
41
+ c.records.direction = t;
42
+ }, "setDirection"), $r = /* @__PURE__ */ l(function(t) {
43
+ b.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}";
44
+ try {
45
+ c.records.options = JSON.parse(t);
46
+ } catch (r) {
47
+ b.error("error while parsing gitGraph options", r.message);
48
+ }
49
+ }, "setOptions"), fr = /* @__PURE__ */ l(function() {
50
+ return c.records.options;
51
+ }, "getOptions"), gr = /* @__PURE__ */ l(function(t) {
52
+ let r = t.msg, s = t.id;
53
+ const n = t.type;
54
+ let e = t.tags;
55
+ b.info("commit", r, s, n, e), b.debug("Entering commit:", r, s, n, e);
56
+ const a = I();
57
+ s = C.sanitizeText(s, a), r = C.sanitizeText(r, a), e = e == null ? void 0 : e.map((o) => C.sanitizeText(o, a));
58
+ const d = {
59
+ id: s || c.records.seq + "-" + A(),
60
+ message: r,
61
+ seq: c.records.seq++,
62
+ type: n ?? p.NORMAL,
63
+ tags: e ?? [],
64
+ parents: c.records.head == null ? [] : [c.records.head.id],
65
+ branch: c.records.currBranch
66
+ };
67
+ c.records.head = d, b.info("main branch", a.mainBranchName), c.records.commits.set(d.id, d), c.records.branches.set(c.records.currBranch, d.id), b.debug("in pushCommit " + d.id);
68
+ }, "commit"), yr = /* @__PURE__ */ l(function(t) {
69
+ let r = t.name;
70
+ const s = t.order;
71
+ if (r = C.sanitizeText(r, I()), c.records.branches.has(r))
72
+ throw new Error(
73
+ `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
74
+ );
75
+ c.records.branches.set(r, c.records.head != null ? c.records.head.id : null), c.records.branchConfig.set(r, { name: r, order: s }), D(r), b.debug("in createBranch");
76
+ }, "branch"), ur = /* @__PURE__ */ l((t) => {
77
+ let r = t.branch, s = t.id;
78
+ const n = t.type, e = t.tags, a = I();
79
+ r = C.sanitizeText(r, a), s && (s = C.sanitizeText(s, a));
80
+ const d = c.records.branches.get(c.records.currBranch), o = c.records.branches.get(r), f = d ? c.records.commits.get(d) : void 0, h = o ? c.records.commits.get(o) : void 0;
81
+ if (f && h && f.branch === r)
82
+ throw new Error(`Cannot merge branch '${r}' into itself.`);
83
+ if (c.records.currBranch === r) {
84
+ const i = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
85
+ throw i.hash = {
86
+ text: `merge ${r}`,
87
+ token: `merge ${r}`,
88
+ expected: ["branch abc"]
89
+ }, i;
90
+ }
91
+ if (f === void 0 || !f) {
92
+ const i = new Error(
93
+ `Incorrect usage of "merge". Current branch (${c.records.currBranch})has no commits`
94
+ );
95
+ throw i.hash = {
96
+ text: `merge ${r}`,
97
+ token: `merge ${r}`,
98
+ expected: ["commit"]
99
+ }, i;
100
+ }
101
+ if (!c.records.branches.has(r)) {
102
+ const i = new Error(
103
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
104
+ );
105
+ throw i.hash = {
106
+ text: `merge ${r}`,
107
+ token: `merge ${r}`,
108
+ expected: [`branch ${r}`]
109
+ }, i;
110
+ }
111
+ if (h === void 0 || !h) {
112
+ const i = new Error(
113
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
114
+ );
115
+ throw i.hash = {
116
+ text: `merge ${r}`,
117
+ token: `merge ${r}`,
118
+ expected: ['"commit"']
119
+ }, i;
120
+ }
121
+ if (f === h) {
122
+ const i = new Error('Incorrect usage of "merge". Both branches have same head');
123
+ throw i.hash = {
124
+ text: `merge ${r}`,
125
+ token: `merge ${r}`,
126
+ expected: ["branch abc"]
127
+ }, i;
128
+ }
129
+ if (s && c.records.commits.has(s)) {
130
+ const i = new Error(
131
+ 'Incorrect usage of "merge". Commit with id:' + s + " already exists, use different custom Id"
132
+ );
133
+ throw i.hash = {
134
+ text: `merge ${r} ${s} ${n} ${e == null ? void 0 : e.join(" ")}`,
135
+ token: `merge ${r} ${s} ${n} ${e == null ? void 0 : e.join(" ")}`,
136
+ expected: [
137
+ `merge ${r} ${s}_UNIQUE ${n} ${e == null ? void 0 : e.join(" ")}`
138
+ ]
139
+ }, i;
140
+ }
141
+ const $ = o || "", g = {
142
+ id: s || `${c.records.seq}-${A()}`,
143
+ message: `merged branch ${r} into ${c.records.currBranch}`,
144
+ seq: c.records.seq++,
145
+ parents: c.records.head == null ? [] : [c.records.head.id, $],
146
+ branch: c.records.currBranch,
147
+ type: p.MERGE,
148
+ customType: n,
149
+ customId: !!s,
150
+ tags: e ?? []
151
+ };
152
+ c.records.head = g, c.records.commits.set(g.id, g), c.records.branches.set(c.records.currBranch, g.id), b.debug(c.records.branches), b.debug("in mergeBranch");
153
+ }, "merge"), xr = /* @__PURE__ */ l(function(t) {
154
+ let r = t.id, s = t.targetId, n = t.tags, e = t.parent;
155
+ b.debug("Entering cherryPick:", r, s, n);
156
+ const a = I();
157
+ if (r = C.sanitizeText(r, a), s = C.sanitizeText(s, a), n = n == null ? void 0 : n.map((f) => C.sanitizeText(f, a)), e = C.sanitizeText(e, a), !r || !c.records.commits.has(r)) {
158
+ const f = new Error(
159
+ 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
160
+ );
161
+ throw f.hash = {
162
+ text: `cherryPick ${r} ${s}`,
163
+ token: `cherryPick ${r} ${s}`,
164
+ expected: ["cherry-pick abc"]
165
+ }, f;
166
+ }
167
+ const d = c.records.commits.get(r);
168
+ if (d === void 0 || !d)
169
+ throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
170
+ if (e && !(Array.isArray(d.parents) && d.parents.includes(e)))
171
+ throw new Error(
172
+ "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
173
+ );
174
+ const o = d.branch;
175
+ if (d.type === p.MERGE && !e)
176
+ throw new Error(
177
+ "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
178
+ );
179
+ if (!s || !c.records.commits.has(s)) {
180
+ if (o === c.records.currBranch) {
181
+ const g = new Error(
182
+ 'Incorrect usage of "cherryPick". Source commit is already on current branch'
183
+ );
184
+ throw g.hash = {
185
+ text: `cherryPick ${r} ${s}`,
186
+ token: `cherryPick ${r} ${s}`,
187
+ expected: ["cherry-pick abc"]
188
+ }, g;
189
+ }
190
+ const f = c.records.branches.get(c.records.currBranch);
191
+ if (f === void 0 || !f) {
192
+ const g = new Error(
193
+ `Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`
194
+ );
195
+ throw g.hash = {
196
+ text: `cherryPick ${r} ${s}`,
197
+ token: `cherryPick ${r} ${s}`,
198
+ expected: ["cherry-pick abc"]
199
+ }, g;
200
+ }
201
+ const h = c.records.commits.get(f);
202
+ if (h === void 0 || !h) {
203
+ const g = new Error(
204
+ `Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`
205
+ );
206
+ throw g.hash = {
207
+ text: `cherryPick ${r} ${s}`,
208
+ token: `cherryPick ${r} ${s}`,
209
+ expected: ["cherry-pick abc"]
210
+ }, g;
211
+ }
212
+ const $ = {
213
+ id: c.records.seq + "-" + A(),
214
+ message: `cherry-picked ${d == null ? void 0 : d.message} into ${c.records.currBranch}`,
215
+ seq: c.records.seq++,
216
+ parents: c.records.head == null ? [] : [c.records.head.id, d.id],
217
+ branch: c.records.currBranch,
218
+ type: p.CHERRY_PICK,
219
+ tags: n ? n.filter(Boolean) : [
220
+ `cherry-pick:${d.id}${d.type === p.MERGE ? `|parent:${e}` : ""}`
221
+ ]
222
+ };
223
+ c.records.head = $, c.records.commits.set($.id, $), c.records.branches.set(c.records.currBranch, $.id), b.debug(c.records.branches), b.debug("in cherryPick");
224
+ }
225
+ }, "cherryPick"), D = /* @__PURE__ */ l(function(t) {
226
+ if (t = C.sanitizeText(t, I()), c.records.branches.has(t)) {
227
+ c.records.currBranch = t;
228
+ const r = c.records.branches.get(c.records.currBranch);
229
+ r === void 0 || !r ? c.records.head = null : c.records.head = c.records.commits.get(r) ?? null;
230
+ } else {
231
+ const r = new Error(
232
+ `Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`
233
+ );
234
+ throw r.hash = {
235
+ text: `checkout ${t}`,
236
+ token: `checkout ${t}`,
237
+ expected: [`branch ${t}`]
238
+ }, r;
239
+ }
240
+ }, "checkout");
241
+ function _(t, r, s) {
242
+ const n = t.indexOf(r);
243
+ n === -1 ? t.push(s) : t.splice(n, 1, s);
244
+ }
245
+ l(_, "upsert");
246
+ function P(t) {
247
+ const r = t.reduce((e, a) => e.seq > a.seq ? e : a, t[0]);
248
+ let s = "";
249
+ t.forEach(function(e) {
250
+ e === r ? s += " *" : s += " |";
251
+ });
252
+ const n = [s, r.id, r.seq];
253
+ for (const e in c.records.branches)
254
+ c.records.branches.get(e) === r.id && n.push(e);
255
+ if (b.debug(n.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
256
+ const e = c.records.commits.get(r.parents[0]);
257
+ _(t, r, e), r.parents[1] && t.push(c.records.commits.get(r.parents[1]));
258
+ } else {
259
+ if (r.parents.length == 0)
260
+ return;
261
+ if (r.parents[0]) {
262
+ const e = c.records.commits.get(r.parents[0]);
263
+ _(t, r, e);
264
+ }
265
+ }
266
+ t = F(t, (e) => e.id), P(t);
267
+ }
268
+ l(P, "prettyPrintCommitHistory");
269
+ var pr = /* @__PURE__ */ l(function() {
270
+ b.debug(c.records.commits);
271
+ const t = N()[0];
272
+ P([t]);
273
+ }, "prettyPrint"), br = /* @__PURE__ */ l(function() {
274
+ c.reset(), sr();
275
+ }, "clear"), mr = /* @__PURE__ */ l(function() {
276
+ return [...c.records.branchConfig.values()].map((r, s) => r.order !== null && r.order !== void 0 ? r : {
277
+ ...r,
278
+ order: parseFloat(`0.${s}`)
279
+ }).sort((r, s) => (r.order ?? 0) - (s.order ?? 0)).map(({ name: r }) => ({ name: r }));
280
+ }, "getBranchesAsObjArray"), wr = /* @__PURE__ */ l(function() {
281
+ return c.records.branches;
282
+ }, "getBranches"), vr = /* @__PURE__ */ l(function() {
283
+ return c.records.commits;
284
+ }, "getCommits"), N = /* @__PURE__ */ l(function() {
285
+ const t = [...c.records.commits.values()];
286
+ return t.forEach(function(r) {
287
+ b.debug(r.id);
288
+ }), t.sort((r, s) => r.seq - s.seq), t;
289
+ }, "getCommitsArray"), Cr = /* @__PURE__ */ l(function() {
290
+ return c.records.currBranch;
291
+ }, "getCurrentBranch"), Er = /* @__PURE__ */ l(function() {
292
+ return c.records.direction;
293
+ }, "getDirection"), Tr = /* @__PURE__ */ l(function() {
294
+ return c.records.head;
295
+ }, "getHead"), S = {
296
+ commitType: p,
297
+ getConfig: I,
298
+ setDirection: lr,
299
+ setOptions: $r,
300
+ getOptions: fr,
301
+ commit: gr,
302
+ branch: yr,
303
+ merge: ur,
304
+ cherryPick: xr,
305
+ checkout: D,
306
+ //reset,
307
+ prettyPrint: pr,
308
+ clear: br,
309
+ getBranchesAsObjArray: mr,
310
+ getBranches: wr,
311
+ getCommits: vr,
312
+ getCommitsArray: N,
313
+ getCurrentBranch: Cr,
314
+ getDirection: Er,
315
+ getHead: Tr,
316
+ setAccTitle: Z,
317
+ getAccTitle: Q,
318
+ getAccDescription: J,
319
+ setAccDescription: X,
320
+ setDiagramTitle: V,
321
+ getDiagramTitle: U
322
+ }, Br = /* @__PURE__ */ l((t, r) => {
323
+ Y(t, r), t.dir && r.setDirection(t.dir);
324
+ for (const s of t.statements)
325
+ Lr(s, r);
326
+ }, "populate"), Lr = /* @__PURE__ */ l((t, r) => {
327
+ const n = {
328
+ Commit: /* @__PURE__ */ l((e) => r.commit(kr(e)), "Commit"),
329
+ Branch: /* @__PURE__ */ l((e) => r.branch(Mr(e)), "Branch"),
330
+ Merge: /* @__PURE__ */ l((e) => r.merge(Ir(e)), "Merge"),
331
+ Checkout: /* @__PURE__ */ l((e) => r.checkout(Rr(e)), "Checkout"),
332
+ CherryPicking: /* @__PURE__ */ l((e) => r.cherryPick(Gr(e)), "CherryPicking")
333
+ }[t.$type];
334
+ n ? n(t) : b.error(`Unknown statement type: ${t.$type}`);
335
+ }, "parseStatement"), kr = /* @__PURE__ */ l((t) => ({
336
+ id: t.id,
337
+ msg: t.message ?? "",
338
+ type: t.type !== void 0 ? p[t.type] : p.NORMAL,
339
+ tags: t.tags ?? void 0
340
+ }), "parseCommit"), Mr = /* @__PURE__ */ l((t) => ({
341
+ name: t.name,
342
+ order: t.order ?? 0
343
+ }), "parseBranch"), Ir = /* @__PURE__ */ l((t) => ({
344
+ branch: t.branch,
345
+ id: t.id ?? "",
346
+ type: t.type !== void 0 ? p[t.type] : void 0,
347
+ tags: t.tags ?? void 0
348
+ }), "parseMerge"), Rr = /* @__PURE__ */ l((t) => t.branch, "parseCheckout"), Gr = /* @__PURE__ */ l((t) => {
349
+ var _a;
350
+ return {
351
+ id: t.id,
352
+ targetId: "",
353
+ tags: ((_a = t.tags) == null ? void 0 : _a.length) === 0 ? void 0 : t.tags,
354
+ parent: t.parent
355
+ };
356
+ }, "parseCherryPicking"), Or = {
357
+ parse: /* @__PURE__ */ l(async (t) => {
358
+ const r = await dr("gitGraph", t);
359
+ b.debug(r), Br(r, S);
360
+ }, "parse")
361
+ }, qr = rr(), v = qr == null ? void 0 : qr.gitGraph, L = 10, k = 40, E = 4, T = 2, M = 8, m = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), O = 30, R = /* @__PURE__ */ new Map(), q = [], B = 0, u = "LR", Ar = /* @__PURE__ */ l(() => {
362
+ m.clear(), w.clear(), R.clear(), B = 0, q = [], u = "LR";
363
+ }, "clear"), W = /* @__PURE__ */ l((t) => {
364
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
365
+ return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((n) => {
366
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
367
+ e.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), e.setAttribute("dy", "1em"), e.setAttribute("x", "0"), e.setAttribute("class", "row"), e.textContent = n.trim(), r.appendChild(e);
368
+ }), r;
369
+ }, "drawText"), j = /* @__PURE__ */ l((t) => {
370
+ let r, s, n;
371
+ return u === "BT" ? (s = /* @__PURE__ */ l((e, a) => e <= a, "comparisonFunc"), n = 1 / 0) : (s = /* @__PURE__ */ l((e, a) => e >= a, "comparisonFunc"), n = 0), t.forEach((e) => {
372
+ var _a, _b;
373
+ const a = u === "TB" || u == "BT" ? (_a = w.get(e)) == null ? void 0 : _a.y : (_b = w.get(e)) == null ? void 0 : _b.x;
374
+ a !== void 0 && s(a, n) && (r = e, n = a);
375
+ }), r;
376
+ }, "findClosestParent"), Hr = /* @__PURE__ */ l((t) => {
377
+ let r = "", s = 1 / 0;
378
+ return t.forEach((n) => {
379
+ const e = w.get(n).y;
380
+ e <= s && (r = n, s = e);
381
+ }), r || void 0;
382
+ }, "findClosestParentBT"), _r = /* @__PURE__ */ l((t, r, s) => {
383
+ let n = s, e = s;
384
+ const a = [];
385
+ t.forEach((d) => {
386
+ const o = r.get(d);
387
+ if (!o)
388
+ throw new Error(`Commit not found for key ${d}`);
389
+ o.parents.length ? (n = zr(o), e = Math.max(n, e)) : a.push(o), Fr(o, n);
390
+ }), n = e, a.forEach((d) => {
391
+ Dr(d, n, s);
392
+ }), t.forEach((d) => {
393
+ const o = r.get(d);
394
+ if (o == null ? void 0 : o.parents.length) {
395
+ const f = Hr(o.parents);
396
+ n = w.get(f).y - k, n <= e && (e = n);
397
+ const h = m.get(o.branch).pos, $ = n - L;
398
+ w.set(o.id, { x: h, y: $ });
399
+ }
400
+ });
401
+ }, "setParallelBTPos"), Pr = /* @__PURE__ */ l((t) => {
402
+ var _a;
403
+ const r = j(t.parents.filter((n) => n !== null));
404
+ if (!r)
405
+ throw new Error(`Closest parent not found for commit ${t.id}`);
406
+ const s = (_a = w.get(r)) == null ? void 0 : _a.y;
407
+ if (s === void 0)
408
+ throw new Error(`Closest parent position not found for commit ${t.id}`);
409
+ return s;
410
+ }, "findClosestParentPos"), zr = /* @__PURE__ */ l((t) => Pr(t) + k, "calculateCommitPosition"), Fr = /* @__PURE__ */ l((t, r) => {
411
+ const s = m.get(t.branch);
412
+ if (!s)
413
+ throw new Error(`Branch not found for commit ${t.id}`);
414
+ const n = s.pos, e = r + L;
415
+ return w.set(t.id, { x: n, y: e }), { x: n, y: e };
416
+ }, "setCommitPosition"), Dr = /* @__PURE__ */ l((t, r, s) => {
417
+ const n = m.get(t.branch);
418
+ if (!n)
419
+ throw new Error(`Branch not found for commit ${t.id}`);
420
+ const e = r + s, a = n.pos;
421
+ w.set(t.id, { x: a, y: e });
422
+ }, "setRootPosition"), Nr = /* @__PURE__ */ l((t, r, s, n, e, a) => {
423
+ if (a === p.HIGHLIGHT)
424
+ t.append("rect").attr("x", s.x - 10).attr("y", s.y - 10).attr("width", 20).attr("height", 20).attr(
425
+ "class",
426
+ `commit ${r.id} commit-highlight${e % M} ${n}-outer`
427
+ ), t.append("rect").attr("x", s.x - 6).attr("y", s.y - 6).attr("width", 12).attr("height", 12).attr(
428
+ "class",
429
+ `commit ${r.id} commit${e % M} ${n}-inner`
430
+ );
431
+ else if (a === p.CHERRY_PICK)
432
+ t.append("circle").attr("cx", s.x).attr("cy", s.y).attr("r", 10).attr("class", `commit ${r.id} ${n}`), t.append("circle").attr("cx", s.x - 3).attr("cy", s.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${n}`), t.append("circle").attr("cx", s.x + 3).attr("cy", s.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${n}`), t.append("line").attr("x1", s.x + 3).attr("y1", s.y + 1).attr("x2", s.x).attr("y2", s.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${n}`), t.append("line").attr("x1", s.x - 3).attr("y1", s.y + 1).attr("x2", s.x).attr("y2", s.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${n}`);
433
+ else {
434
+ const d = t.append("circle");
435
+ if (d.attr("cx", s.x), d.attr("cy", s.y), d.attr("r", r.type === p.MERGE ? 9 : 10), d.attr("class", `commit ${r.id} commit${e % M}`), a === p.MERGE) {
436
+ const o = t.append("circle");
437
+ o.attr("cx", s.x), o.attr("cy", s.y), o.attr("r", 6), o.attr(
438
+ "class",
439
+ `commit ${n} ${r.id} commit${e % M}`
440
+ );
441
+ }
442
+ a === p.REVERSE && t.append("path").attr(
443
+ "d",
444
+ `M ${s.x - 5},${s.y - 5}L${s.x + 5},${s.y + 5}M${s.x - 5},${s.y + 5}L${s.x + 5},${s.y - 5}`
445
+ ).attr("class", `commit ${n} ${r.id} commit${e % M}`);
446
+ }
447
+ }, "drawCommitBullet"), Sr = /* @__PURE__ */ l((t, r, s, n) => {
448
+ var _a;
449
+ if (r.type !== p.CHERRY_PICK && (r.customId && r.type === p.MERGE || r.type !== p.MERGE) && (v == null ? void 0 : v.showCommitLabel)) {
450
+ const e = t.append("g"), a = e.insert("rect").attr("class", "commit-label-bkg"), d = e.append("text").attr("x", n).attr("y", s.y + 25).attr("class", "commit-label").text(r.id), o = (_a = d.node()) == null ? void 0 : _a.getBBox();
451
+ if (o && (a.attr("x", s.posWithOffset - o.width / 2 - T).attr("y", s.y + 13.5).attr("width", o.width + 2 * T).attr("height", o.height + 2 * T), u === "TB" || u === "BT" ? (a.attr("x", s.x - (o.width + 4 * E + 5)).attr("y", s.y - 12), d.attr("x", s.x - (o.width + 4 * E)).attr("y", s.y + o.height - 12)) : d.attr("x", s.posWithOffset - o.width / 2), v.rotateCommitLabel))
452
+ if (u === "TB" || u === "BT")
453
+ d.attr(
454
+ "transform",
455
+ "rotate(-45, " + s.x + ", " + s.y + ")"
456
+ ), a.attr(
457
+ "transform",
458
+ "rotate(-45, " + s.x + ", " + s.y + ")"
459
+ );
460
+ else {
461
+ const f = -7.5 - (o.width + 10) / 25 * 9.5, h = 10 + o.width / 25 * 8.5;
462
+ e.attr(
463
+ "transform",
464
+ "translate(" + f + ", " + h + ") rotate(-45, " + n + ", " + s.y + ")"
465
+ );
466
+ }
467
+ }
468
+ }, "drawCommitLabel"), Wr = /* @__PURE__ */ l((t, r, s, n) => {
469
+ var _a;
470
+ if (r.tags.length > 0) {
471
+ let e = 0, a = 0, d = 0;
472
+ const o = [];
473
+ for (const f of r.tags.reverse()) {
474
+ const h = t.insert("polygon"), $ = t.append("circle"), g = t.append("text").attr("y", s.y - 16 - e).attr("class", "tag-label").text(f), i = (_a = g.node()) == null ? void 0 : _a.getBBox();
475
+ if (!i)
476
+ throw new Error("Tag bbox not found");
477
+ a = Math.max(a, i.width), d = Math.max(d, i.height), g.attr("x", s.posWithOffset - i.width / 2), o.push({
478
+ tag: g,
479
+ hole: $,
480
+ rect: h,
481
+ yOffset: e
482
+ }), e += 20;
483
+ }
484
+ for (const { tag: f, hole: h, rect: $, yOffset: g } of o) {
485
+ const i = d / 2, y = s.y - 19.2 - g;
486
+ if ($.attr("class", "tag-label-bkg").attr(
487
+ "points",
488
+ `
489
+ ${n - a / 2 - E / 2},${y + T}
490
+ ${n - a / 2 - E / 2},${y - T}
491
+ ${s.posWithOffset - a / 2 - E},${y - i - T}
492
+ ${s.posWithOffset + a / 2 + E},${y - i - T}
493
+ ${s.posWithOffset + a / 2 + E},${y + i + T}
494
+ ${s.posWithOffset - a / 2 - E},${y + i + T}`
495
+ ), h.attr("cy", y).attr("cx", n - a / 2 + E / 2).attr("r", 1.5).attr("class", "tag-hole"), u === "TB" || u === "BT") {
496
+ const x = n + g;
497
+ $.attr("class", "tag-label-bkg").attr(
498
+ "points",
499
+ `
500
+ ${s.x},${x + 2}
501
+ ${s.x},${x - 2}
502
+ ${s.x + L},${x - i - 2}
503
+ ${s.x + L + a + 4},${x - i - 2}
504
+ ${s.x + L + a + 4},${x + i + 2}
505
+ ${s.x + L},${x + i + 2}`
506
+ ).attr("transform", "translate(12,12) rotate(45, " + s.x + "," + n + ")"), h.attr("cx", s.x + E / 2).attr("cy", x).attr("transform", "translate(12,12) rotate(45, " + s.x + "," + n + ")"), f.attr("x", s.x + 5).attr("y", x + 3).attr("transform", "translate(14,14) rotate(45, " + s.x + "," + n + ")");
507
+ }
508
+ }
509
+ }
510
+ }, "drawCommitTags"), jr = /* @__PURE__ */ l((t) => {
511
+ switch (t.customType ?? t.type) {
512
+ case p.NORMAL:
513
+ return "commit-normal";
514
+ case p.REVERSE:
515
+ return "commit-reverse";
516
+ case p.HIGHLIGHT:
517
+ return "commit-highlight";
518
+ case p.MERGE:
519
+ return "commit-merge";
520
+ case p.CHERRY_PICK:
521
+ return "commit-cherry-pick";
522
+ default:
523
+ return "commit-normal";
524
+ }
525
+ }, "getCommitClassType"), Yr = /* @__PURE__ */ l((t, r, s, n) => {
526
+ const e = { x: 0, y: 0 };
527
+ if (t.parents.length > 0) {
528
+ const a = j(t.parents);
529
+ if (a) {
530
+ const d = n.get(a) ?? e;
531
+ return r === "TB" ? d.y + k : r === "BT" ? (n.get(t.id) ?? e).y - k : d.x + k;
532
+ }
533
+ } else
534
+ return r === "TB" ? O : r === "BT" ? (n.get(t.id) ?? e).y - k : 0;
535
+ return 0;
536
+ }, "calculatePosition"), Kr = /* @__PURE__ */ l((t, r, s) => {
537
+ var _a, _b;
538
+ const n = u === "BT" && s ? r : r + L, e = u === "TB" || u === "BT" ? n : (_a = m.get(t.branch)) == null ? void 0 : _a.pos, a = u === "TB" || u === "BT" ? (_b = m.get(t.branch)) == null ? void 0 : _b.pos : n;
539
+ if (a === void 0 || e === void 0)
540
+ throw new Error(`Position were undefined for commit ${t.id}`);
541
+ return { x: a, y: e, posWithOffset: n };
542
+ }, "getCommitPosition"), z = /* @__PURE__ */ l((t, r, s) => {
543
+ if (!v)
544
+ throw new Error("GitGraph config not found");
545
+ const n = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels");
546
+ let a = u === "TB" || u === "BT" ? O : 0;
547
+ const d = [...r.keys()], o = (v == null ? void 0 : v.parallelCommits) ?? false, f = /* @__PURE__ */ l(($, g) => {
548
+ var _a, _b;
549
+ const i = (_a = r.get($)) == null ? void 0 : _a.seq, y = (_b = r.get(g)) == null ? void 0 : _b.seq;
550
+ return i !== void 0 && y !== void 0 ? i - y : 0;
551
+ }, "sortKeys");
552
+ let h = d.sort(f);
553
+ u === "BT" && (o && _r(h, r, a), h = h.reverse()), h.forEach(($) => {
554
+ var _a;
555
+ const g = r.get($);
556
+ if (!g)
557
+ throw new Error(`Commit not found for key ${$}`);
558
+ o && (a = Yr(g, u, a, w));
559
+ const i = Kr(g, a, o);
560
+ if (s) {
561
+ const y = jr(g), x = g.customType ?? g.type, H = ((_a = m.get(g.branch)) == null ? void 0 : _a.index) ?? 0;
562
+ Nr(n, g, i, y, H, x), Sr(e, g, i, a), Wr(e, g, i, a);
563
+ }
564
+ u === "TB" || u === "BT" ? w.set(g.id, { x: i.x, y: i.posWithOffset }) : w.set(g.id, { x: i.posWithOffset, y: i.y }), a = u === "BT" && o ? a + k : a + k + L, a > B && (B = a);
565
+ });
566
+ }, "drawCommits"), Ur = /* @__PURE__ */ l((t, r, s, n, e) => {
567
+ const d = (u === "TB" || u === "BT" ? s.x < n.x : s.y < n.y) ? r.branch : t.branch, o = /* @__PURE__ */ l((h) => h.branch === d, "isOnBranchToGetCurve"), f = /* @__PURE__ */ l((h) => h.seq > t.seq && h.seq < r.seq, "isBetweenCommits");
568
+ return [...e.values()].some((h) => f(h) && o(h));
569
+ }, "shouldRerouteArrow"), G = /* @__PURE__ */ l((t, r, s = 0) => {
570
+ const n = t + Math.abs(t - r) / 2;
571
+ if (s > 5)
572
+ return n;
573
+ if (q.every((d) => Math.abs(d - n) >= 10))
574
+ return q.push(n), n;
575
+ const a = Math.abs(t - r);
576
+ return G(t, r - a / 5, s + 1);
577
+ }, "findLane"), Vr = /* @__PURE__ */ l((t, r, s, n) => {
578
+ var _a, _b, _c, _d, _e;
579
+ const e = w.get(r.id), a = w.get(s.id);
580
+ if (e === void 0 || a === void 0)
581
+ throw new Error(`Commit positions not found for commits ${r.id} and ${s.id}`);
582
+ const d = Ur(r, s, e, a, n);
583
+ let o = "", f = "", h = 0, $ = 0, g = (_a = m.get(s.branch)) == null ? void 0 : _a.index;
584
+ s.type === p.MERGE && r.id !== s.parents[0] && (g = (_b = m.get(r.branch)) == null ? void 0 : _b.index);
585
+ let i;
586
+ if (d) {
587
+ o = "A 10 10, 0, 0, 0,", f = "A 10 10, 0, 0, 1,", h = 10, $ = 10;
588
+ const y = e.y < a.y ? G(e.y, a.y) : G(a.y, e.y), x = e.x < a.x ? G(e.x, a.x) : G(a.x, e.x);
589
+ u === "TB" ? e.x < a.x ? i = `M ${e.x} ${e.y} L ${x - h} ${e.y} ${f} ${x} ${e.y + $} L ${x} ${a.y - h} ${o} ${x + $} ${a.y} L ${a.x} ${a.y}` : (g = (_c = m.get(r.branch)) == null ? void 0 : _c.index, i = `M ${e.x} ${e.y} L ${x + h} ${e.y} ${o} ${x} ${e.y + $} L ${x} ${a.y - h} ${f} ${x - $} ${a.y} L ${a.x} ${a.y}`) : u === "BT" ? e.x < a.x ? i = `M ${e.x} ${e.y} L ${x - h} ${e.y} ${o} ${x} ${e.y - $} L ${x} ${a.y + h} ${f} ${x + $} ${a.y} L ${a.x} ${a.y}` : (g = (_d = m.get(r.branch)) == null ? void 0 : _d.index, i = `M ${e.x} ${e.y} L ${x + h} ${e.y} ${f} ${x} ${e.y - $} L ${x} ${a.y + h} ${o} ${x - $} ${a.y} L ${a.x} ${a.y}`) : e.y < a.y ? i = `M ${e.x} ${e.y} L ${e.x} ${y - h} ${o} ${e.x + $} ${y} L ${a.x - h} ${y} ${f} ${a.x} ${y + $} L ${a.x} ${a.y}` : (g = (_e = m.get(r.branch)) == null ? void 0 : _e.index, i = `M ${e.x} ${e.y} L ${e.x} ${y + h} ${f} ${e.x + $} ${y} L ${a.x - h} ${y} ${o} ${a.x} ${y - $} L ${a.x} ${a.y}`);
590
+ } else
591
+ o = "A 20 20, 0, 0, 0,", f = "A 20 20, 0, 0, 1,", h = 20, $ = 20, u === "TB" ? (e.x < a.x && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${o} ${e.x + $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${f} ${a.x} ${e.y + $} L ${a.x} ${a.y}`), e.x > a.x && (o = "A 20 20, 0, 0, 0,", f = "A 20 20, 0, 0, 1,", h = 20, $ = 20, s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${f} ${e.x - $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x + h} ${e.y} ${o} ${a.x} ${e.y + $} L ${a.x} ${a.y}`), e.x === a.x && (i = `M ${e.x} ${e.y} L ${a.x} ${a.y}`)) : u === "BT" ? (e.x < a.x && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${f} ${e.x + $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${o} ${a.x} ${e.y - $} L ${a.x} ${a.y}`), e.x > a.x && (o = "A 20 20, 0, 0, 0,", f = "A 20 20, 0, 0, 1,", h = 20, $ = 20, s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${o} ${e.x - $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${o} ${a.x} ${e.y - $} L ${a.x} ${a.y}`), e.x === a.x && (i = `M ${e.x} ${e.y} L ${a.x} ${a.y}`)) : (e.y < a.y && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${f} ${a.x} ${e.y + $} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${o} ${e.x + $} ${a.y} L ${a.x} ${a.y}`), e.y > a.y && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${o} ${a.x} ${e.y - $} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${f} ${e.x + $} ${a.y} L ${a.x} ${a.y}`), e.y === a.y && (i = `M ${e.x} ${e.y} L ${a.x} ${a.y}`));
592
+ if (i === void 0)
593
+ throw new Error("Line definition not found");
594
+ t.append("path").attr("d", i).attr("class", "arrow arrow" + g % M);
595
+ }, "drawArrow"), Xr = /* @__PURE__ */ l((t, r) => {
596
+ const s = t.append("g").attr("class", "commit-arrows");
597
+ [...r.keys()].forEach((n) => {
598
+ const e = r.get(n);
599
+ e.parents && e.parents.length > 0 && e.parents.forEach((a) => {
600
+ Vr(s, r.get(a), e, r);
601
+ });
602
+ });
603
+ }, "drawArrows"), Jr = /* @__PURE__ */ l((t, r) => {
604
+ const s = t.append("g");
605
+ r.forEach((n, e) => {
606
+ var _a;
607
+ const a = e % M, d = (_a = m.get(n.name)) == null ? void 0 : _a.pos;
608
+ if (d === void 0)
609
+ throw new Error(`Position not found for branch ${n.name}`);
610
+ const o = s.append("line");
611
+ o.attr("x1", 0), o.attr("y1", d), o.attr("x2", B), o.attr("y2", d), o.attr("class", "branch branch" + a), u === "TB" ? (o.attr("y1", O), o.attr("x1", d), o.attr("y2", B), o.attr("x2", d)) : u === "BT" && (o.attr("y1", B), o.attr("x1", d), o.attr("y2", O), o.attr("x2", d)), q.push(d);
612
+ const f = n.name, h = W(f), $ = s.insert("rect"), i = s.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + a);
613
+ i.node().appendChild(h);
614
+ const y = h.getBBox();
615
+ $.attr("class", "branchLabelBkg label" + a).attr("rx", 4).attr("ry", 4).attr("x", -y.width - 4 - ((v == null ? void 0 : v.rotateCommitLabel) === true ? 30 : 0)).attr("y", -y.height / 2 + 8).attr("width", y.width + 18).attr("height", y.height + 4), i.attr(
616
+ "transform",
617
+ "translate(" + (-y.width - 14 - ((v == null ? void 0 : v.rotateCommitLabel) === true ? 30 : 0)) + ", " + (d - y.height / 2 - 1) + ")"
618
+ ), u === "TB" ? ($.attr("x", d - y.width / 2 - 10).attr("y", 0), i.attr("transform", "translate(" + (d - y.width / 2 - 5) + ", 0)")) : u === "BT" ? ($.attr("x", d - y.width / 2 - 10).attr("y", B), i.attr("transform", "translate(" + (d - y.width / 2 - 5) + ", " + B + ")")) : $.attr("transform", "translate(-19, " + (d - y.height / 2) + ")");
619
+ });
620
+ }, "drawBranches"), Qr = /* @__PURE__ */ l(function(t, r, s, n, e) {
621
+ return m.set(t, { pos: r, index: s }), r += 50 + (e ? 40 : 0) + (u === "TB" || u === "BT" ? n.width / 2 : 0), r;
622
+ }, "setBranchPosition"), Zr = /* @__PURE__ */ l(function(t, r, s, n) {
623
+ if (Ar(), b.debug("in gitgraph renderer", t + `
624
+ `, "id:", r, s), !v)
625
+ throw new Error("GitGraph config not found");
626
+ const e = v.rotateCommitLabel ?? false, a = n.db;
627
+ R = a.getCommits();
628
+ const d = a.getBranchesAsObjArray();
629
+ u = a.getDirection();
630
+ const o = er(`[id="${r}"]`);
631
+ let f = 0;
632
+ d.forEach((h, $) => {
633
+ var _a;
634
+ const g = W(h.name), i = o.append("g"), y = i.insert("g").attr("class", "branchLabel"), x = y.insert("g").attr("class", "label branch-label");
635
+ (_a = x.node()) == null ? void 0 : _a.appendChild(g);
636
+ const H = g.getBBox();
637
+ f = Qr(h.name, f, $, H, e), x.remove(), y.remove(), i.remove();
638
+ }), z(o, R, false), v.showBranches && Jr(o, d), Xr(o, R), z(o, R, true), tr.insertTitle(
639
+ o,
640
+ "gitTitleText",
641
+ v.titleTopMargin ?? 0,
642
+ a.getDiagramTitle()
643
+ ), ar(
644
+ void 0,
645
+ o,
646
+ v.diagramPadding,
647
+ v.useMaxWidth
648
+ );
649
+ }, "draw"), re = {
650
+ draw: Zr
651
+ }, ee = /* @__PURE__ */ l((t) => `
652
+ .commit-id,
653
+ .commit-msg,
654
+ .branch-label {
655
+ fill: lightgrey;
656
+ color: lightgrey;
657
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
658
+ font-family: var(--mermaid-font-family);
659
+ }
660
+ ${[0, 1, 2, 3, 4, 5, 6, 7].map(
661
+ (r) => `
662
+ .branch-label${r} { fill: ${t["gitBranchLabel" + r]}; }
663
+ .commit${r} { stroke: ${t["git" + r]}; fill: ${t["git" + r]}; }
664
+ .commit-highlight${r} { stroke: ${t["gitInv" + r]}; fill: ${t["gitInv" + r]}; }
665
+ .label${r} { fill: ${t["git" + r]}; }
666
+ .arrow${r} { stroke: ${t["git" + r]}; }
667
+ `
668
+ ).join(`
669
+ `)}
670
+
671
+ .branch {
672
+ stroke-width: 1;
673
+ stroke: ${t.lineColor};
674
+ stroke-dasharray: 2;
675
+ }
676
+ .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
677
+ .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
678
+ .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
679
+ .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
680
+ .tag-hole { fill: ${t.textColor}; }
681
+
682
+ .commit-merge {
683
+ stroke: ${t.primaryColor};
684
+ fill: ${t.primaryColor};
685
+ }
686
+ .commit-reverse {
687
+ stroke: ${t.primaryColor};
688
+ fill: ${t.primaryColor};
689
+ stroke-width: 3;
690
+ }
691
+ .commit-highlight-outer {
692
+ }
693
+ .commit-highlight-inner {
694
+ stroke: ${t.primaryColor};
695
+ fill: ${t.primaryColor};
696
+ }
697
+
698
+ .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
699
+ .gitTitleText {
700
+ text-anchor: middle;
701
+ font-size: 18px;
702
+ fill: ${t.textColor};
703
+ }
704
+ `, "getStyles"), te = ee, ce = {
705
+ parser: Or,
706
+ db: S,
707
+ renderer: re,
708
+ styles: te
709
+ };
710
+ export {
711
+ ce as diagram
712
+ };