@kong-ui-public/documentation 1.8.13 → 1.8.14-pr.4048.7a10d83bb.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 (168) hide show
  1. package/package.json +2 -2
  2. package/dist/abnfDiagram-VCTEODGH-Bzbg7AHk-DFERbIEu.js +0 -92
  3. package/dist/arc-CKhg5DVn-BIpMje7c.js +0 -80
  4. package/dist/architectureDiagram-5GKGNRK7-CqHVyBRI-CLWcRmoG.js +0 -4149
  5. package/dist/astro-DdQ3Kp7Q-BDE5qFXd.js +0 -18
  6. package/dist/blockDiagram-I7D4REHJ-DWFqHR0L-D8v5LhXM.js +0 -2029
  7. package/dist/c-lfOsiBpu-DMPKLUI8.js +0 -4
  8. package/dist/c4Diagram-7LVT6UL2-DXHigzTJ-BR9440iK.js +0 -3067
  9. package/dist/catppuccin-latte-D9NPLB7Y-sAlQrrP2.js +0 -4
  10. package/dist/channel-DUDXYB-g-BsX3Acdu.js +0 -5
  11. package/dist/chunk-2Q5K7J3B-CQFXhYzi-C3CTUgHo.js +0 -12
  12. package/dist/chunk-5VM5RSS4-DF_fkndM-uFSHkP_V.js +0 -19
  13. package/dist/chunk-F27PBJKO-Bf2CKIqN-CUI4z39H.js +0 -65
  14. package/dist/chunk-IMKFNOWR-DIsz_YLV-B6u2fLNJ.js +0 -2116
  15. package/dist/chunk-JWPE2WC7-DI69CthA-D_FsPQj-.js +0 -8
  16. package/dist/chunk-POPQ4Y6H-DycI9Jzm-BWixWzlU.js +0 -24
  17. package/dist/chunk-SHT3W25Y-CKxDgOBI-OOdqZuVE.js +0 -4307
  18. package/dist/chunk-SVP7TREG-tW_qYlvV-vP5bsK2H.js +0 -500
  19. package/dist/chunk-TICWLB2K-CuiDrX3P-WR-FPNea.js +0 -3451
  20. package/dist/chunk-XXDRQBXY-CSrEKR2C-C6SaSSCC.js +0 -8
  21. package/dist/classDiagram-ZZMXUADV-WzcguFxl-CKKn1Tfx.js +0 -17
  22. package/dist/classDiagram-v2-VYDZK3BY-jdAXYY7W-CKKn1Tfx.js +0 -17
  23. package/dist/cose-bilkent-JH36ORCC-DbS7GVMv-bbQOsy5Y.js +0 -2256
  24. package/dist/csharp-RRkgh3c4-lim_vKPd.js +0 -4
  25. package/dist/css-BbwcBM_4-B_2PRTA_.js +0 -4
  26. package/dist/csv-DFU5sVkH-BPWcOTV4.js +0 -4
  27. package/dist/cynefin-OW5HDTMX-CmxQwqmf-D_GdoNIu.js +0 -21781
  28. package/dist/cynefinDiagram-5FMLGOSQ-BNb88xpJ-DfS9O7P4.js +0 -351
  29. package/dist/cytoscape.esm-YSf_2rtb-CoO8mT3p.js +0 -18279
  30. package/dist/dagre-C9xJrfGe-Di-1Ikh0.js +0 -1667
  31. package/dist/dagre-GXQ25YYZ-uiXfyLw2-PU-qeT6_.js +0 -429
  32. package/dist/defaultLocale-TbxLDlcU-BrdwcF9K.js +0 -180
  33. package/dist/diagram-S7CK7UJ4-g67BXvGR-Cp9bzjGj.js +0 -303
  34. package/dist/diagram-UQ7AKVKN-DfJJIsVs-CC7ekguS.js +0 -210
  35. package/dist/diagram-VSXAHHWV-DmtFfqWN-C9ZLHKzj.js +0 -439
  36. package/dist/diagram-VX7I27RA--gfQ90BY-QNtwG6Ck.js +0 -477
  37. package/dist/diagram-Z3DM3KII-Cu_rSHu0-CCCsIuz4.js +0 -127
  38. package/dist/diff-D_LJiFgV-DenOJuyV.js +0 -4
  39. package/dist/docker-DMpUQ2UE-xX8PDoIv.js +0 -4
  40. package/dist/documentation.es.js +0 -7
  41. package/dist/documentation.umd.js +0 -3715
  42. package/dist/ebnfDiagram-PWID7BFC-B_qfACMJ-D_Xjruh2.js +0 -109
  43. package/dist/erDiagram-RLTQ6QDP-Dt9efGmz-BPS1Iwl5.js +0 -2042
  44. package/dist/flowDiagram-HODETNUW-sAcaB3rt-Ci8x-zG0.js +0 -6
  45. package/dist/ganttDiagram-EL5Y4UJY-CtWGP-hX-qar4oLEq.js +0 -3098
  46. package/dist/git-commit--2NDNcyW-Dw9_h8sQ.js +0 -5
  47. package/dist/git-rebase-CbNvxADk-DAgBrkyL.js +0 -5
  48. package/dist/gitGraphDiagram-WWUBYQGX-B7B7IG_5-x8UcOce8.js +0 -737
  49. package/dist/go-BEdBk4fh-DqSXHrGo.js +0 -4
  50. package/dist/graphql-BMuT9GwB-BP9pcQru.js +0 -14
  51. package/dist/haml-D3QmTYiV-BTaBXoPr.js +0 -10
  52. package/dist/handlebars-C_aYHp26-CWcrQHYv.js +0 -14
  53. package/dist/haskell-DSSJ-2AO-BlmVjKNy.js +0 -4
  54. package/dist/html-derivative-DgZQ_xNe-BAs__2u-.js +0 -5
  55. package/dist/html-zcQqUZxh-Dg8OkMBp.js +0 -10
  56. package/dist/http-BGkfDG8i-lqXytFlH.js +0 -14
  57. package/dist/index-BaAWoj3P.js +0 -43522
  58. package/dist/infoDiagram-27XIBGKW-DAx9hub5-CDUrF89O.js +0 -18
  59. package/dist/ini-CmgEGOBJ-70PBzbbb.js +0 -4
  60. package/dist/init-Cgg2UTSf-BsHkAom2.js +0 -15
  61. package/dist/ishikawaDiagram-5VMMS53U-CnBB9iXH-2YyZ3Nxy.js +0 -729
  62. package/dist/java-CaG1IqbK-D6YBp1XX.js +0 -4
  63. package/dist/javascript--0qAxhnA-BRPKgr3C.js +0 -4
  64. package/dist/journeyDiagram-3NMN7TZE-B0a4pOJX-CgtsuE-Y.js +0 -909
  65. package/dist/json-DVwBUiza-D8uacQj0.js +0 -4
  66. package/dist/json5-D2Eltym1-Biib5ALh.js +0 -4
  67. package/dist/jsonc-BPIJyZ7u-BZEKkMok.js +0 -4
  68. package/dist/jsonl-BGkjXns2-BG2V-IA2.js +0 -4
  69. package/dist/jsx-cVAJ0Z2c-Cl0AMtmu.js +0 -4
  70. package/dist/kanban-definition-UXKFOSKX-BGnOZMUl-CHT2EG_7.js +0 -1029
  71. package/dist/katex-Be3DWdAP-BWcdC2Xb.js +0 -22287
  72. package/dist/kotlin-CQsNEM2o-Dy_91eL4.js +0 -4
  73. package/dist/latex-g3NZbvcl-tKQf8TuW.js +0 -5
  74. package/dist/less-9LYkHheD-tcNg8M2_.js +0 -4
  75. package/dist/linear-Cf872ac2-BjGvLlX5.js +0 -254
  76. package/dist/liquid-CG3ph2-5-wZo8nDay.js +0 -14
  77. package/dist/lua-BdA7_iyX-Fg4s9W4F.js +0 -5
  78. package/dist/make-CE9Hryyp-CrUl7LOH.js +0 -4
  79. package/dist/markdown-Gqx6-FHJ-Bcqt-5kX.js +0 -4
  80. package/dist/material-theme-darker-DL4lHZSa-DMHCIvq5.js +0 -4
  81. package/dist/mdc-C-RLGlI2-DzcUIqJQ.js +0 -12
  82. package/dist/mdx-DswfiFg4-CK6jOqmu.js +0 -4
  83. package/dist/mermaid-CAl3BhSL-CpQh0Vft.js +0 -4
  84. package/dist/mindmap-definition-YA3MSWOX-D0iYuN9C-B3uI77eT.js +0 -1026
  85. package/dist/nginx-CokYOiS8-DjML3dpY.js +0 -5
  86. package/dist/objective-c-DK-EKgyd-C809HPrX.js +0 -4
  87. package/dist/ordinal-CNzaYghg-B_JXdapq.js +0 -63
  88. package/dist/pascal-CRtegPzh-a8whuidZ.js +0 -4
  89. package/dist/pegDiagram-XKGWAZYB-6oG4KeYC-CG27veJ_.js +0 -104
  90. package/dist/perl-C45KUBhP-Q6opd9qO.js +0 -16
  91. package/dist/php-COzTb61D-DW91EkjY.js +0 -18
  92. package/dist/pieDiagram-E7YTZNPT-DsNO0m7t-CMKObJlC.js +0 -191
  93. package/dist/plsql-Bx7tup_v-BJoF2Vrf.js +0 -4
  94. package/dist/postcss-DjDdOEzv-DaHMm3XW.js +0 -4
  95. package/dist/powershell-BeUvHe6o-BC3uPZPS.js +0 -4
  96. package/dist/proto-DGLklcji-w0B_itsp.js +0 -4
  97. package/dist/pug-BQ5MM2xz-DMZvJUHt.js +0 -12
  98. package/dist/python-C_6ySqsv-D_5pfY__.js +0 -4
  99. package/dist/quadrantDiagram-AXDQQJYC-B6Dc7fje-C23uvcHP.js +0 -2046
  100. package/dist/r-CNL4a0Qi-pixge7f9.js +0 -4
  101. package/dist/railroadDiagram-O6MQD6OU-D8qLcD4O-B_Hr3s-n.js +0 -80
  102. package/dist/reg-D6txjqBF-bHAwx9Pm.js +0 -4
  103. package/dist/requirementDiagram-BXWQKSXE-Cx28BZaS-Bu-h1fa9.js +0 -2283
  104. package/dist/rst-xmthoFSf-BdN-iqJu.js +0 -20
  105. package/dist/ruby-CmwqiOyg-B5qGUHPy.js +0 -44
  106. package/dist/rust-BrRMzTsN-CaZtBt24.js +0 -4
  107. package/dist/sankeyDiagram-P5KCCOFB-CqEXebJJ-BrChTi-e.js +0 -948
  108. package/dist/sass-CL6GLiPQ-pslLeRRb.js +0 -4
  109. package/dist/scss-CiLZCexj-CladYQkr.js +0 -5
  110. package/dist/sequenceDiagram-WJ2MYXX4-Bs_1V5D1-Da6JW3KG.js +0 -4263
  111. package/dist/shellscript-Dfpezy65-BtH46UX7.js +0 -4
  112. package/dist/shellsession-CRcAC04a-BFLTslz7.js +0 -5
  113. package/dist/sizeCapture-INFHLROL-Bc4fS2u3-DMniWWy4.js +0 -46
  114. package/dist/splunk-MGILMmew-BP8P7eWt.js +0 -4
  115. package/dist/sql-D_W5grEC-Dcn2WLbD.js +0 -4
  116. package/dist/ssh-config-CFmUyPR7-BB1rrGb9.js +0 -4
  117. package/dist/stateDiagram-D77RDMKH-oTiwIYVV-BphZk0uR.js +0 -210
  118. package/dist/stateDiagram-v2-MP3YSRHH-gbAY2cmo-D78HyGx1.js +0 -17
  119. package/dist/style.css +0 -1
  120. package/dist/stylus-Kh83dApl-DAu5PNZ9.js +0 -4
  121. package/dist/svelte-HVIHTyhe-BdPJXyv7.js +0 -14
  122. package/dist/swift-B7Z-rXzN-CQtmhAMw.js +0 -4
  123. package/dist/swimlanes-42K2YHIH-BSXAPn2j-C7pTnVuk.js +0 -4983
  124. package/dist/swimlanesDiagram-VR7AAH4N-Ror_0lre-Di8OVgei.js +0 -17
  125. package/dist/timeline-definition-24CTP7MA-gOHmAY1H-aIgAzo7s.js +0 -1096
  126. package/dist/toml-CIQJnU5u-DjT9Bjqu.js +0 -4
  127. package/dist/tsx-DiMnnori-B-5hSr15.js +0 -4
  128. package/dist/twig-BXXOiPVV-CmgmU-L-.js +0 -18
  129. package/dist/types/components/DiscardChangesPrompt.vue.d.ts +0 -35
  130. package/dist/types/components/DiscardChangesPrompt.vue.d.ts.map +0 -1
  131. package/dist/types/components/DocumentationContent.vue.d.ts +0 -186
  132. package/dist/types/components/DocumentationContent.vue.d.ts.map +0 -1
  133. package/dist/types/components/DocumentationDisplay.vue.d.ts +0 -105
  134. package/dist/types/components/DocumentationDisplay.vue.d.ts.map +0 -1
  135. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts +0 -31
  136. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts.map +0 -1
  137. package/dist/types/components/ProductDocumentModal.vue.d.ts +0 -72
  138. package/dist/types/components/ProductDocumentModal.vue.d.ts.map +0 -1
  139. package/dist/types/composables/index.d.ts +0 -6
  140. package/dist/types/composables/index.d.ts.map +0 -1
  141. package/dist/types/composables/useI18n.d.ts +0 -9
  142. package/dist/types/composables/useI18n.d.ts.map +0 -1
  143. package/dist/types/external-links.d.ts +0 -5
  144. package/dist/types/external-links.d.ts.map +0 -1
  145. package/dist/types/helpers.d.ts +0 -8
  146. package/dist/types/helpers.d.ts.map +0 -1
  147. package/dist/types/index.d.ts +0 -7
  148. package/dist/types/index.d.ts.map +0 -1
  149. package/dist/types/types/document-list.d.ts +0 -28
  150. package/dist/types/types/document-list.d.ts.map +0 -1
  151. package/dist/types/types/document-modal.d.ts +0 -8
  152. package/dist/types/types/document-modal.d.ts.map +0 -1
  153. package/dist/types/types/index.d.ts +0 -3
  154. package/dist/types/types/index.d.ts.map +0 -1
  155. package/dist/typescript-DFf19o_s-B0ag8pir.js +0 -4
  156. package/dist/v-DbYZLS97-CAPuTPjr.js +0 -4
  157. package/dist/vb-DRaXf86R-Bx9Rwnco.js +0 -4
  158. package/dist/vennDiagram-4TSXK5OY-Cr4BWMuk-BjBvyxCC.js +0 -1911
  159. package/dist/viml-DgaHry3T-BeYQ8dZh.js +0 -4
  160. package/dist/vue-DPI5F0qT-D-Ahkoja.js +0 -22
  161. package/dist/vue-html-D7FCsiW2-DLSUNIPr.js +0 -5
  162. package/dist/wardleyDiagram-VM6X3IG4-a6H91k9Q-CsH4gQQ0.js +0 -639
  163. package/dist/wasm-DXa1gtBd-CfuK9YWP.js +0 -4
  164. package/dist/wgsl-Vcm3Lg52-C2IZ7ENh.js +0 -4
  165. package/dist/xml-DnOpIvRK-C-akVYiK.js +0 -5
  166. package/dist/xsl-K_2BlT3G-D3eRZGNO.js +0 -5
  167. package/dist/xychartDiagram-S5SC5T6Z-7mX_nPmO-CoM4SG9q.js +0 -2218
  168. package/dist/yaml-BswqmnDe-X78l_Ibz.js +0 -4
@@ -1,737 +0,0 @@
1
- import { k as dt, j as lt, n as ht, r as $t, t as mt, e as gt, a as l, X as Q, m as k, G as pt, c as _, N as yt, x as ft, $ as xt, b as L, z as ut, L as bt, B as kt } from "./index-BaAWoj3P.js";
2
- import { R as Bt } from "./cynefin-OW5HDTMX-CmxQwqmf-D_GdoNIu.js";
3
- import { t as wt } from "./chunk-JWPE2WC7-DI69CthA-D_FsPQj-.js";
4
- import { t as Et } from "./chunk-2Q5K7J3B-CQFXhYzi-C3CTUgHo.js";
5
- var x = {
6
- NORMAL: 0,
7
- REVERSE: 1,
8
- HIGHLIGHT: 2,
9
- MERGE: 3,
10
- CHERRY_PICK: 4
11
- }, Ct = bt.gitGraph, S = /* @__PURE__ */ l(() => ut({
12
- ...Ct,
13
- ...Q().gitGraph
14
- }), "getConfig"), d = new Et(() => {
15
- let t = S(), r = t.mainBranchName, e = 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: e
23
- }]]),
24
- branches: /* @__PURE__ */ new Map([[r, null]]),
25
- currBranch: r,
26
- direction: "LR",
27
- seq: 0,
28
- options: {}
29
- };
30
- });
31
- function K() {
32
- return kt({ length: 7 });
33
- }
34
- l(K, "getID");
35
- function rt(t, r) {
36
- let e = /* @__PURE__ */ Object.create(null);
37
- return t.reduce((i, s) => {
38
- let n = r(s);
39
- return e[n] || (e[n] = !0, i.push(s)), i;
40
- }, []);
41
- }
42
- l(rt, "uniqBy");
43
- var Lt = /* @__PURE__ */ l(function(t) {
44
- d.records.direction = t;
45
- }, "setDirection"), Tt = /* @__PURE__ */ l(function(t) {
46
- k.debug("options str", t), t = t?.trim(), t ||= "{}";
47
- try {
48
- d.records.options = JSON.parse(t);
49
- } catch (r) {
50
- k.error("error while parsing gitGraph options", r.message);
51
- }
52
- }, "setOptions"), Mt = /* @__PURE__ */ l(function() {
53
- return d.records.options;
54
- }, "getOptions"), vt = /* @__PURE__ */ l(function(t) {
55
- let r = t.msg, e = t.id, i = t.type, s = t.tags;
56
- k.info("commit", r, e, i, s), k.debug("Entering commit:", r, e, i, s);
57
- let n = S();
58
- e = L.sanitizeText(e, n), r = L.sanitizeText(r, n), s = s?.map((a) => L.sanitizeText(a, n));
59
- let o = {
60
- id: e || d.records.seq + "-" + K(),
61
- message: r,
62
- seq: d.records.seq++,
63
- type: i ?? x.NORMAL,
64
- tags: s ?? [],
65
- parents: d.records.head == null ? [] : [d.records.head.id],
66
- branch: d.records.currBranch
67
- };
68
- d.records.head = o, k.info("main branch", n.mainBranchName), d.records.commits.has(o.id) && k.warn(`Commit ID ${o.id} already exists`), d.records.commits.set(o.id, o), d.records.branches.set(d.records.currBranch, o.id), k.debug("in pushCommit " + o.id);
69
- }, "commit"), It = /* @__PURE__ */ l(function(t) {
70
- let r = t.name, e = t.order;
71
- if (r = L.sanitizeText(r, S()), 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: e
75
- }), et(r), k.debug("in createBranch");
76
- }, "branch"), Rt = /* @__PURE__ */ l((t) => {
77
- let r = t.branch, e = t.id, i = t.type, s = t.tags, n = S();
78
- r = L.sanitizeText(r, n), e &&= L.sanitizeText(e, n);
79
- let o = d.records.branches.get(d.records.currBranch), a = d.records.branches.get(r), $ = o ? d.records.commits.get(o) : 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 c = /* @__PURE__ */ Error('Incorrect usage of "merge". Cannot merge a branch to itself');
83
- throw c.hash = {
84
- text: `merge ${r}`,
85
- token: `merge ${r}`,
86
- expected: ["branch abc"]
87
- }, c;
88
- }
89
- if ($ === void 0 || !$) {
90
- let c = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);
91
- throw c.hash = {
92
- text: `merge ${r}`,
93
- token: `merge ${r}`,
94
- expected: ["commit"]
95
- }, c;
96
- }
97
- if (!d.records.branches.has(r)) {
98
- let c = /* @__PURE__ */ Error('Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist");
99
- throw c.hash = {
100
- text: `merge ${r}`,
101
- token: `merge ${r}`,
102
- expected: [`branch ${r}`]
103
- }, c;
104
- }
105
- if (m === void 0 || !m) {
106
- let c = /* @__PURE__ */ Error('Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits");
107
- throw c.hash = {
108
- text: `merge ${r}`,
109
- token: `merge ${r}`,
110
- expected: ['"commit"']
111
- }, c;
112
- }
113
- if ($ === m) {
114
- let c = /* @__PURE__ */ Error('Incorrect usage of "merge". Both branches have same head');
115
- throw c.hash = {
116
- text: `merge ${r}`,
117
- token: `merge ${r}`,
118
- expected: ["branch abc"]
119
- }, c;
120
- }
121
- if (e && d.records.commits.has(e)) {
122
- let c = /* @__PURE__ */ Error('Incorrect usage of "merge". Commit with id:' + e + " already exists, use different custom id");
123
- throw c.hash = {
124
- text: `merge ${r} ${e} ${i} ${s?.join(" ")}`,
125
- token: `merge ${r} ${e} ${i} ${s?.join(" ")}`,
126
- expected: [`merge ${r} ${e}_UNIQUE ${i} ${s?.join(" ")}`]
127
- }, c;
128
- }
129
- let g = a || "", h = {
130
- id: e || `${d.records.seq}-${K()}`,
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: x.MERGE,
136
- customType: i,
137
- customId: !!e,
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), k.debug(d.records.branches), k.debug("in mergeBranch");
141
- }, "merge"), Pt = /* @__PURE__ */ l(function(t) {
142
- let r = t.id, e = t.targetId, i = t.tags, s = t.parent;
143
- k.debug("Entering cherryPick:", r, e, i);
144
- let n = S();
145
- if (r = L.sanitizeText(r, n), e = L.sanitizeText(e, n), i = i?.map(($) => L.sanitizeText($, n)), s = L.sanitizeText(s, n), !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} ${e}`,
149
- token: `cherryPick ${r} ${e}`,
150
- expected: ["cherry-pick abc"]
151
- }, $;
152
- }
153
- let o = d.records.commits.get(r);
154
- if (o === void 0 || !o) throw Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
155
- if (s && !(Array.isArray(o.parents) && o.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 = o.branch;
157
- if (o.type === x.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 (!e || !d.records.commits.has(e)) {
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} ${e}`,
163
- token: `cherryPick ${r} ${e}`,
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} ${e}`,
172
- token: `cherryPick ${r} ${e}`,
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} ${e}`,
181
- token: `cherryPick ${r} ${e}`,
182
- expected: ["cherry-pick abc"]
183
- }, h;
184
- }
185
- let g = {
186
- id: d.records.seq + "-" + K(),
187
- message: `cherry-picked ${o?.message} into ${d.records.currBranch}`,
188
- seq: d.records.seq++,
189
- parents: d.records.head == null ? [] : [d.records.head.id, o.id],
190
- branch: d.records.currBranch,
191
- type: x.CHERRY_PICK,
192
- tags: i ? i.filter(Boolean) : [`cherry-pick:${o.id}${o.type === x.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), k.debug(d.records.branches), k.debug("in cherryPick");
195
- }
196
- }, "cherryPick"), et = /* @__PURE__ */ l(function(t) {
197
- if (t = L.sanitizeText(t, S()), 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, e) {
211
- let i = t.indexOf(r);
212
- i === -1 ? t.push(e) : t.splice(i, 1, e);
213
- }
214
- l(Y, "upsert");
215
- function J(t) {
216
- let r = t.reduce((s, n) => s.seq > n.seq ? s : n, t[0]), e = "";
217
- t.forEach(function(s) {
218
- e += s === r ? " *" : " |";
219
- });
220
- let i = [
221
- e,
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 (k.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 = rt(t, (s) => s.id), J(t);
237
- }
238
- l(J, "prettyPrintCommitHistory");
239
- var Ot = /* @__PURE__ */ l(function() {
240
- k.debug(d.records.commits);
241
- let t = ot()[0];
242
- J([t]);
243
- }, "prettyPrint"), At = /* @__PURE__ */ l(function() {
244
- d.reset(), xt();
245
- }, "clear"), Gt = /* @__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"), St = /* @__PURE__ */ l(function() {
251
- return d.records.branches;
252
- }, "getBranches"), Ht = /* @__PURE__ */ l(function() {
253
- return d.records.commits;
254
- }, "getCommits"), ot = /* @__PURE__ */ l(function() {
255
- let t = [...d.records.commits.values()];
256
- return t.forEach(function(r) {
257
- k.debug(r.id);
258
- }), t.sort((r, e) => r.seq - e.seq), t;
259
- }, "getCommitsArray"), at = {
260
- commitType: x,
261
- getConfig: S,
262
- setDirection: Lt,
263
- setOptions: Tt,
264
- getOptions: Mt,
265
- commit: vt,
266
- branch: It,
267
- merge: Rt,
268
- cherryPick: Pt,
269
- checkout: et,
270
- prettyPrint: Ot,
271
- clear: At,
272
- getBranchesAsObjArray: Gt,
273
- getBranches: St,
274
- getCommits: Ht,
275
- getCommitsArray: ot,
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: gt,
286
- getAccTitle: mt,
287
- getAccDescription: $t,
288
- setAccDescription: ht,
289
- setDiagramTitle: lt,
290
- getDiagramTitle: dt
291
- }, Wt = /* @__PURE__ */ l((t, r) => {
292
- wt(t, r), t.dir && r.setDirection(t.dir);
293
- for (let e of t.statements) qt(e, r);
294
- }, "populate"), qt = /* @__PURE__ */ l((t, r) => {
295
- let e = {
296
- Commit: /* @__PURE__ */ l((i) => r.commit(zt(i)), "Commit"),
297
- Branch: /* @__PURE__ */ l((i) => r.branch(_t(i)), "Branch"),
298
- Merge: /* @__PURE__ */ l((i) => r.merge(Dt(i)), "Merge"),
299
- Checkout: /* @__PURE__ */ l((i) => r.checkout(Nt(i)), "Checkout"),
300
- CherryPicking: /* @__PURE__ */ l((i) => r.cherryPick(Ft(i)), "CherryPicking")
301
- }[t.$type];
302
- e ? e(t) : k.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 ? x.NORMAL : x[t.type],
307
- tags: t.tags ?? void 0
308
- }), "parseCommit"), _t = /* @__PURE__ */ l((t) => ({
309
- name: t.name,
310
- order: t.order ?? 0
311
- }), "parseBranch"), Dt = /* @__PURE__ */ l((t) => ({
312
- branch: t.branch,
313
- id: t.id ?? "",
314
- type: t.type === void 0 ? void 0 : x[t.type],
315
- tags: t.tags ?? void 0
316
- }), "parseMerge"), Nt = /* @__PURE__ */ l((t) => t.branch, "parseCheckout"), Ft = /* @__PURE__ */ l((t) => ({
317
- id: t.id,
318
- targetId: "",
319
- tags: t.tags?.length === 0 ? void 0 : t.tags,
320
- parent: t.parent
321
- }), "parseCherryPicking"), jt = { parse: /* @__PURE__ */ l(async (t) => {
322
- let r = await Bt("gitGraph", t);
323
- k.debug(r), Wt(r, at);
324
- }, "parse") }, P = 10, O = 40, M = 4, I = 2, A = 8, V = /* @__PURE__ */ new Set([
325
- "redux",
326
- "redux-dark",
327
- "redux-color",
328
- "redux-dark-color"
329
- ]), X = 12, Z = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Kt = /* @__PURE__ */ new Set([
330
- "dark",
331
- "redux-dark",
332
- "redux-dark-color",
333
- "neo-dark"
334
- ]), G = /* @__PURE__ */ l((t, r, e = !1) => e && t > 0 ? (t - 1) % (r - 1) + 1 : t % r, "calcColorIndex"), E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), F = 30, q = /* @__PURE__ */ new Map(), j = [], R = 0, y = "LR", Vt = /* @__PURE__ */ l(() => {
335
- E.clear(), C.clear(), q.clear(), R = 0, j = [], y = "LR";
336
- }, "clear"), it = /* @__PURE__ */ l((t) => {
337
- let r = document.createElementNS("http://www.w3.org/2000/svg", "text");
338
- return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((e) => {
339
- let i = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
340
- 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 = e.trim(), r.appendChild(i);
341
- }), r;
342
- }, "drawText"), st = /* @__PURE__ */ l((t) => {
343
- let r, e, i;
344
- return y === "BT" ? (e = /* @__PURE__ */ l((s, n) => s <= n, "comparisonFunc"), i = 1 / 0) : (e = /* @__PURE__ */ l((s, n) => s >= n, "comparisonFunc"), i = 0), t.forEach((s) => {
345
- let n = y === "TB" || y == "BT" ? C.get(s)?.y : C.get(s)?.x;
346
- n !== void 0 && e(n, i) && (r = s, i = n);
347
- }), r;
348
- }, "findClosestParent"), Ut = /* @__PURE__ */ l((t) => {
349
- let r = "", e = 1 / 0;
350
- return t.forEach((i) => {
351
- let s = C.get(i).y;
352
- s <= e && (r = i, e = s);
353
- }), r || void 0;
354
- }, "findClosestParentBT"), Yt = /* @__PURE__ */ l((t, r, e) => {
355
- let i = e, s = e, n = [];
356
- t.forEach((o) => {
357
- let a = r.get(o);
358
- if (!a) throw Error(`Commit not found for key ${o}`);
359
- a.parents.length ? (i = Qt(a), s = Math.max(i, s)) : n.push(a), Jt(a, i);
360
- }), i = s, n.forEach((o) => {
361
- Zt(o, i, e);
362
- }), t.forEach((o) => {
363
- let a = r.get(o);
364
- if (a?.parents.length) {
365
- let $ = Ut(a.parents);
366
- i = C.get($).y - O, i <= s && (s = i);
367
- let m = E.get(a.branch).pos, g = i - P;
368
- C.set(a.id, {
369
- x: m,
370
- y: g
371
- });
372
- }
373
- });
374
- }, "setParallelBTPos"), Xt = /* @__PURE__ */ l((t) => {
375
- let r = st(t.parents.filter((i) => i !== null));
376
- if (!r) throw Error(`Closest parent not found for commit ${t.id}`);
377
- let e = C.get(r)?.y;
378
- if (e === void 0) throw Error(`Closest parent position not found for commit ${t.id}`);
379
- return e;
380
- }, "findClosestParentPos"), Qt = /* @__PURE__ */ l((t) => Xt(t) + O, "calculateCommitPosition"), Jt = /* @__PURE__ */ l((t, r) => {
381
- let e = E.get(t.branch);
382
- if (!e) throw Error(`Branch not found for commit ${t.id}`);
383
- let i = e.pos, s = r + P;
384
- return C.set(t.id, {
385
- x: i,
386
- y: s
387
- }), {
388
- x: i,
389
- y: s
390
- };
391
- }, "setCommitPosition"), Zt = /* @__PURE__ */ l((t, r, e) => {
392
- let i = E.get(t.branch);
393
- if (!i) throw Error(`Branch not found for commit ${t.id}`);
394
- let s = r + e, n = i.pos;
395
- C.set(t.id, {
396
- x: n,
397
- y: s
398
- });
399
- }, "setRootPosition"), tr = /* @__PURE__ */ l((t, r, e, i, s, n) => {
400
- let { theme: o } = _(), a = V.has(o ?? ""), $ = Z.has(o ?? ""), m = Kt.has(o ?? "");
401
- if (n === x.HIGHLIGHT) t.append("rect").attr("x", e.x - 10 + (a ? 3 : 0)).attr("y", e.y - 10 + (a ? 3 : 0)).attr("width", a ? 14 : 20).attr("height", a ? 14 : 20).attr("class", `commit ${r.id} commit-highlight${G(s, A, $)} ${i}-outer`), t.append("rect").attr("x", e.x - 6 + (a ? 2 : 0)).attr("y", e.y - 6 + (a ? 2 : 0)).attr("width", a ? 8 : 12).attr("height", a ? 8 : 12).attr("class", `commit ${r.id} commit${G(s, A, $)} ${i}-inner`);
402
- else if (n === x.CHERRY_PICK) t.append("circle").attr("cx", e.x).attr("cy", e.y).attr("r", a ? 7 : 10).attr("class", `commit ${r.id} ${i}`), t.append("circle").attr("cx", e.x - 3).attr("cy", e.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", e.x + 3).attr("cy", e.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", e.x + 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", m ? "#000000" : "#fff").attr("class", `commit ${r.id} ${i}`), t.append("line").attr("x1", e.x - 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", m ? "#000000" : "#fff").attr("class", `commit ${r.id} ${i}`);
403
- else {
404
- let g = t.append("circle");
405
- if (g.attr("cx", e.x), g.attr("cy", e.y), g.attr("r", a ? 7 : 10), g.attr("class", `commit ${r.id} commit${G(s, A, $)}`), n === x.MERGE) {
406
- let h = t.append("circle");
407
- h.attr("cx", e.x), h.attr("cy", e.y), h.attr("r", a ? 5 : 6), h.attr("class", `commit ${i} ${r.id} commit${G(s, A, $)}`);
408
- }
409
- if (n === x.REVERSE) {
410
- let h = t.append("path"), c = a ? 4 : 5;
411
- h.attr("d", `M ${e.x - c},${e.y - c}L${e.x + c},${e.y + c}M${e.x - c},${e.y + c}L${e.x + c},${e.y - c}`).attr("class", `commit ${i} ${r.id} commit${G(s, A, $)}`);
412
- }
413
- }
414
- }, "drawCommitBullet"), rr = /* @__PURE__ */ l((t, r, e, i, s) => {
415
- if (r.type !== x.CHERRY_PICK && (r.customId && r.type === x.MERGE || r.type !== x.MERGE) && s.showCommitLabel) {
416
- let n = t.append("g"), o = n.insert("rect").attr("class", "commit-label-bkg"), a = n.append("text").attr("x", i).attr("y", e.y + 25).attr("class", "commit-label").text(r.id), $ = a.node()?.getBBox();
417
- if ($ && (o.attr("x", e.posWithOffset - $.width / 2 - I).attr("y", e.y + 13.5).attr("width", $.width + 2 * I).attr("height", $.height + 2 * I), y === "TB" || y === "BT" ? (o.attr("x", e.x - ($.width + 4 * M + 5)).attr("y", e.y - 12), a.attr("x", e.x - ($.width + 4 * M)).attr("y", e.y + $.height - 12)) : a.attr("x", e.posWithOffset - $.width / 2), s.rotateCommitLabel))
418
- if (y === "TB" || y === "BT") a.attr("transform", "rotate(-45, " + e.x + ", " + e.y + ")"), o.attr("transform", "rotate(-45, " + e.x + ", " + e.y + ")");
419
- else {
420
- let m = -7.5 - ($.width + 10) / 25 * 9.5, g = 10 + $.width / 25 * 8.5;
421
- n.attr("transform", "translate(" + m + ", " + g + ") rotate(-45, " + i + ", " + e.y + ")");
422
- }
423
- }
424
- }, "drawCommitLabel"), er = /* @__PURE__ */ l((t, r, e, i) => {
425
- if (r.tags.length > 0) {
426
- let s = 0, n = 0, o = 0, a = [];
427
- for (let $ of r.tags.reverse()) {
428
- let m = t.insert("polygon"), g = t.append("circle"), h = t.append("text").attr("y", e.y - 16 - s).attr("class", "tag-label").text($), c = h.node()?.getBBox();
429
- if (!c) throw Error("Tag bbox not found");
430
- n = Math.max(n, c.width), o = Math.max(o, c.height), h.attr("x", e.posWithOffset - c.width / 2), a.push({
431
- tag: h,
432
- hole: g,
433
- rect: m,
434
- yOffset: s
435
- }), s += 20;
436
- }
437
- for (let { tag: $, hole: m, rect: g, yOffset: h } of a) {
438
- let c = o / 2, f = e.y - 19.2 - h;
439
- if (g.attr("class", "tag-label-bkg").attr("points", `
440
- ${i - n / 2 - M / 2},${f + I}
441
- ${i - n / 2 - M / 2},${f - I}
442
- ${e.posWithOffset - n / 2 - M},${f - c - I}
443
- ${e.posWithOffset + n / 2 + M},${f - c - I}
444
- ${e.posWithOffset + n / 2 + M},${f + c + I}
445
- ${e.posWithOffset - n / 2 - M},${f + c + I}`), m.attr("cy", f).attr("cx", i - n / 2 + M / 2).attr("r", 1.5).attr("class", "tag-hole"), y === "TB" || y === "BT") {
446
- let p = i + h;
447
- g.attr("class", "tag-label-bkg").attr("points", `
448
- ${e.x},${p + 2}
449
- ${e.x},${p - 2}
450
- ${e.x + P},${p - c - 2}
451
- ${e.x + P + n + 4},${p - c - 2}
452
- ${e.x + P + n + 4},${p + c + 2}
453
- ${e.x + P},${p + c + 2}`).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + i + ")"), m.attr("cx", e.x + M / 2).attr("cy", p).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + i + ")"), $.attr("x", e.x + 5).attr("y", p + 3).attr("transform", "translate(14,14) rotate(45, " + e.x + "," + i + ")");
454
- }
455
- }
456
- }
457
- }, "drawCommitTags"), or = /* @__PURE__ */ l((t) => {
458
- switch (t.customType ?? t.type) {
459
- case x.NORMAL:
460
- return "commit-normal";
461
- case x.REVERSE:
462
- return "commit-reverse";
463
- case x.HIGHLIGHT:
464
- return "commit-highlight";
465
- case x.MERGE:
466
- return "commit-merge";
467
- case x.CHERRY_PICK:
468
- return "commit-cherry-pick";
469
- default:
470
- return "commit-normal";
471
- }
472
- }, "getCommitClassType"), ar = /* @__PURE__ */ l((t, r, e, i) => {
473
- let s = {
474
- x: 0,
475
- y: 0
476
- };
477
- if (t.parents.length > 0) {
478
- let n = st(t.parents);
479
- if (n) {
480
- let o = i.get(n) ?? s;
481
- return r === "TB" ? o.y + O : r === "BT" ? (i.get(t.id) ?? s).y - O : o.x + O;
482
- }
483
- } else return r === "TB" ? F : r === "BT" ? (i.get(t.id) ?? s).y - O : 0;
484
- return 0;
485
- }, "calculatePosition"), ir = /* @__PURE__ */ l((t, r, e) => {
486
- let i = y === "BT" && e ? r : r + P, s = E.get(t.branch)?.pos, n = y === "TB" || y === "BT" ? E.get(t.branch)?.pos : i;
487
- if (n === void 0 || s === void 0) throw Error(`Position were undefined for commit ${t.id}`);
488
- let o = V.has(_().theme ?? "");
489
- return {
490
- x: n,
491
- y: y === "TB" || y === "BT" ? i : s + (o ? X / 2 + 1 : -2),
492
- posWithOffset: i
493
- };
494
- }, "getCommitPosition"), tt = /* @__PURE__ */ l((t, r, e, i) => {
495
- let s = t.append("g").attr("class", "commit-bullets"), n = t.append("g").attr("class", "commit-labels"), o = y === "TB" || y === "BT" ? F : 0, a = [...r.keys()], $ = i.parallelCommits ?? !1, m = /* @__PURE__ */ l((h, c) => {
496
- let f = r.get(h)?.seq, p = r.get(c)?.seq;
497
- return f !== void 0 && p !== void 0 ? f - p : 0;
498
- }, "sortKeys"), g = a.sort(m);
499
- y === "BT" && ($ && Yt(g, r, o), g = g.reverse()), g.forEach((h) => {
500
- let c = r.get(h);
501
- if (!c) throw Error(`Commit not found for key ${h}`);
502
- $ && (o = ar(c, y, o, C));
503
- let f = ir(c, o, $);
504
- if (e) {
505
- let p = or(c), u = c.customType ?? c.type, b = E.get(c.branch)?.index ?? 0;
506
- tr(s, c, f, p, b, u), rr(n, c, f, o, i), er(n, c, f, o);
507
- }
508
- y === "TB" || y === "BT" ? C.set(c.id, {
509
- x: f.x,
510
- y: f.posWithOffset
511
- }) : C.set(c.id, {
512
- x: f.posWithOffset,
513
- y: f.y
514
- }), o = y === "BT" && $ ? o + O : o + O + P, o > R && (R = o);
515
- });
516
- }, "drawCommits"), sr = /* @__PURE__ */ l((t, r, e, i, s) => {
517
- let n = (y === "TB" || y === "BT" ? e.x < i.x : e.y < i.y) ? r.branch : t.branch, o = /* @__PURE__ */ l(($) => $.branch === n, "isOnBranchToGetCurve"), a = /* @__PURE__ */ l(($) => $.seq > t.seq && $.seq < r.seq, "isBetweenCommits");
518
- return [...s.values()].some(($) => a($) && o($));
519
- }, "shouldRerouteArrow"), z = /* @__PURE__ */ l((t, r, e = 0) => {
520
- let i = t + Math.abs(t - r) / 2;
521
- return e > 5 ? i : j.every((s) => Math.abs(s - i) >= 10) ? (j.push(i), i) : z(t, r - Math.abs(t - r) / 5, e + 1);
522
- }, "findLane"), nr = /* @__PURE__ */ l((t, r, e, i) => {
523
- let { theme: s } = _(), n = Z.has(s ?? ""), o = C.get(r.id), a = C.get(e.id);
524
- if (o === void 0 || a === void 0) throw Error(`Commit positions not found for commits ${r.id} and ${e.id}`);
525
- let $ = sr(r, e, o, a, i), m = "", g = "", h = 0, c = 0, f = E.get(e.branch)?.index;
526
- e.type === x.MERGE && r.id !== e.parents[0] && (f = E.get(r.branch)?.index);
527
- let p;
528
- if ($) {
529
- m = "A 10 10, 0, 0, 0,", g = "A 10 10, 0, 0, 1,", h = 10, c = 10;
530
- let u = o.y < a.y ? z(o.y, a.y) : z(a.y, o.y), b = o.x < a.x ? z(o.x, a.x) : z(a.x, o.x);
531
- y === "TB" ? o.x < a.x ? p = `M ${o.x} ${o.y} L ${b - h} ${o.y} ${g} ${b} ${o.y + c} L ${b} ${a.y - h} ${m} ${b + c} ${a.y} L ${a.x} ${a.y}` : (f = E.get(r.branch)?.index, p = `M ${o.x} ${o.y} L ${b + h} ${o.y} ${m} ${b} ${o.y + c} L ${b} ${a.y - h} ${g} ${b - c} ${a.y} L ${a.x} ${a.y}`) : y === "BT" ? o.x < a.x ? p = `M ${o.x} ${o.y} L ${b - h} ${o.y} ${m} ${b} ${o.y - c} L ${b} ${a.y + h} ${g} ${b + c} ${a.y} L ${a.x} ${a.y}` : (f = E.get(r.branch)?.index, p = `M ${o.x} ${o.y} L ${b + h} ${o.y} ${g} ${b} ${o.y - c} L ${b} ${a.y + h} ${m} ${b - c} ${a.y} L ${a.x} ${a.y}`) : o.y < a.y ? p = `M ${o.x} ${o.y} L ${o.x} ${u - h} ${m} ${o.x + c} ${u} L ${a.x - h} ${u} ${g} ${a.x} ${u + c} L ${a.x} ${a.y}` : (f = E.get(r.branch)?.index, p = `M ${o.x} ${o.y} L ${o.x} ${u + h} ${g} ${o.x + c} ${u} L ${a.x - h} ${u} ${m} ${a.x} ${u - c} L ${a.x} ${a.y}`);
532
- } else m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", h = 20, c = 20, y === "TB" ? (o.x < a.x && (p = e.type === x.MERGE && r.id !== e.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${a.y - h} ${m} ${o.x + c} ${a.y} L ${a.x} ${a.y}` : `M ${o.x} ${o.y} L ${a.x - h} ${o.y} ${g} ${a.x} ${o.y + c} L ${a.x} ${a.y}`), o.x > a.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", h = 20, c = 20, p = e.type === x.MERGE && r.id !== e.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${a.y - h} ${g} ${o.x - c} ${a.y} L ${a.x} ${a.y}` : `M ${o.x} ${o.y} L ${a.x + h} ${o.y} ${m} ${a.x} ${o.y + c} L ${a.x} ${a.y}`), o.x === a.x && (p = `M ${o.x} ${o.y} L ${a.x} ${a.y}`)) : y === "BT" ? (o.x < a.x && (p = e.type === x.MERGE && r.id !== e.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${a.y + h} ${g} ${o.x + c} ${a.y} L ${a.x} ${a.y}` : `M ${o.x} ${o.y} L ${a.x - h} ${o.y} ${m} ${a.x} ${o.y - c} L ${a.x} ${a.y}`), o.x > a.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", h = 20, c = 20, p = e.type === x.MERGE && r.id !== e.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${a.y + h} ${m} ${o.x - c} ${a.y} L ${a.x} ${a.y}` : `M ${o.x} ${o.y} L ${a.x + h} ${o.y} ${g} ${a.x} ${o.y - c} L ${a.x} ${a.y}`), o.x === a.x && (p = `M ${o.x} ${o.y} L ${a.x} ${a.y}`)) : (o.y < a.y && (p = e.type === x.MERGE && r.id !== e.parents[0] ? `M ${o.x} ${o.y} L ${a.x - h} ${o.y} ${g} ${a.x} ${o.y + c} L ${a.x} ${a.y}` : `M ${o.x} ${o.y} L ${o.x} ${a.y - h} ${m} ${o.x + c} ${a.y} L ${a.x} ${a.y}`), o.y > a.y && (p = e.type === x.MERGE && r.id !== e.parents[0] ? `M ${o.x} ${o.y} L ${a.x - h} ${o.y} ${m} ${a.x} ${o.y - c} L ${a.x} ${a.y}` : `M ${o.x} ${o.y} L ${o.x} ${a.y + h} ${g} ${o.x + c} ${a.y} L ${a.x} ${a.y}`), o.y === a.y && (p = `M ${o.x} ${o.y} L ${a.x} ${a.y}`));
533
- if (p === void 0) throw Error("Line definition not found");
534
- t.append("path").attr("d", p).attr("class", "arrow arrow" + G(f, A, n));
535
- }, "drawArrow"), cr = /* @__PURE__ */ l((t, r) => {
536
- let e = t.append("g").attr("class", "commit-arrows");
537
- [...r.keys()].forEach((i) => {
538
- let s = r.get(i);
539
- s.parents && s.parents.length > 0 && s.parents.forEach((n) => {
540
- nr(e, r.get(n), s, r);
541
- });
542
- });
543
- }, "drawArrows"), dr = /* @__PURE__ */ l((t, r, e, i) => {
544
- let { look: s, theme: n, themeVariables: o } = _(), { dropShadow: a, THEME_COLOR_LIMIT: $ } = o, m = V.has(n ?? ""), g = Z.has(n ?? ""), h = t.append("g");
545
- r.forEach((c, f) => {
546
- let p = G(f, m ? $ : A, g), u = E.get(c.name)?.pos;
547
- if (u === void 0) throw Error(`Position not found for branch ${c.name}`);
548
- let b = y === "TB" || y === "BT" ? u : m ? u + X / 2 + 1 : u - 2, B = h.append("line");
549
- B.attr("x1", 0), B.attr("y1", b), B.attr("x2", R), B.attr("y2", b), B.attr("class", "branch branch" + p), y === "TB" ? (B.attr("y1", F), B.attr("x1", u), B.attr("y2", R), B.attr("x2", u)) : y === "BT" && (B.attr("y1", R), B.attr("x1", u), B.attr("y2", F), B.attr("x2", u)), j.push(b);
550
- let U = c.name, W = it(U), T = h.insert("rect"), v = h.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + p);
551
- v.node().appendChild(W);
552
- let w = W.getBBox(), D = m ? 0 : 4, N = m ? 16 : 0, H = m ? X : 0;
553
- s === "neo" && T.attr("data-look", "neo"), T.attr("class", "branchLabelBkg label" + p).attr("style", s === "neo" ? `filter:${m ? `url(#${i}-drop-shadow)` : a}` : "").attr("rx", D).attr("ry", D).attr("x", -w.width - 4 - (e.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -w.height / 2 + 10).attr("width", w.width + 18 + N).attr("height", w.height + 4 + H), v.attr("transform", "translate(" + (-w.width - 14 - (e.rotateCommitLabel === !0 ? 30 : 0) + N / 2) + ", " + (b - w.height / 2 - 2) + ")"), y === "TB" ? (T.attr("x", u - w.width / 2 - 10).attr("y", 0), v.attr("transform", "translate(" + (u - w.width / 2 - 5) + ", 0)"), m && (T.attr("transform", `translate(${-N / 2 - 3}, ${-H - 10})`), v.attr("transform", "translate(" + (u - w.width / 2 - 5) + ", " + (-H * 2 + 7) + ")"))) : y === "BT" ? (T.attr("x", u - w.width / 2 - 10).attr("y", R), v.attr("transform", "translate(" + (u - w.width / 2 - 5) + ", " + R + ")"), m && (T.attr("transform", `translate(${-N / 2 - 3}, ${H + 10})`), v.attr("transform", "translate(" + (u - w.width / 2 - 5) + ", " + (R + H * 2 + 4) + ")"))) : T.attr("transform", "translate(-19, " + (b - 12 - H / 2) + ")");
554
- });
555
- }, "drawBranches"), lr = /* @__PURE__ */ l(function(t, r, e, i, s) {
556
- return E.set(t, {
557
- pos: r,
558
- index: e
559
- }), r += 50 + (s ? 40 : 0) + (y === "TB" || y === "BT" ? i.width / 2 : 0), r;
560
- }, "setBranchPosition"), hr = { draw: /* @__PURE__ */ l(function(t, r, e, i) {
561
- Vt(), k.debug("in gitgraph renderer", t + `
562
- `, "id:", r, e);
563
- let s = i.db;
564
- if (!s.getConfig) {
565
- k.error("getConfig method is not available on db");
566
- return;
567
- }
568
- let n = s.getConfig(), o = n.rotateCommitLabel ?? !1;
569
- q = s.getCommits();
570
- let a = s.getBranchesAsObjArray();
571
- y = s.getDirection();
572
- let $ = pt(`[id="${r}"]`), { look: m, theme: g, themeVariables: h } = _(), { useGradient: c, gradientStart: f, gradientStop: p, filterColor: u } = h;
573
- if (c) {
574
- let B = $.append("defs").append("linearGradient").attr("id", r + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
575
- B.append("stop").attr("offset", "0%").attr("stop-color", f).attr("stop-opacity", 1), B.append("stop").attr("offset", "100%").attr("stop-color", p).attr("stop-opacity", 1);
576
- }
577
- 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", u);
578
- let b = 0;
579
- a.forEach((B, U) => {
580
- let W = it(B.name), T = $.append("g"), v = T.insert("g").attr("class", "branchLabel"), w = v.insert("g").attr("class", "label branch-label");
581
- w.node()?.appendChild(W);
582
- let D = W.getBBox();
583
- b = lr(B.name, b, U, D, o), w.remove(), v.remove(), T.remove();
584
- }), tt($, q, !1, n), n.showBranches && dr($, a, n, r), cr($, q), tt($, q, !0, n), yt.insertTitle($, "gitTitleText", n.titleTopMargin ?? 0, s.getDiagramTitle()), ft(void 0, $, n.diagramPadding, n.useMaxWidth);
585
- }, "draw") }, nt = 8, ct = /* @__PURE__ */ new Set([
586
- "redux",
587
- "redux-dark",
588
- "redux-color",
589
- "redux-dark-color"
590
- ]), $r = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), mr = /* @__PURE__ */ new Set(["neo", "neo-dark"]), gr = /* @__PURE__ */ new Set([
591
- "dark",
592
- "redux-dark",
593
- "redux-dark-color",
594
- "neo-dark"
595
- ]), pr = /* @__PURE__ */ new Set([
596
- "redux",
597
- "redux-dark",
598
- "redux-color",
599
- "redux-dark-color",
600
- "neo",
601
- "neo-dark"
602
- ]), yr = /* @__PURE__ */ l((t) => {
603
- let { svgId: r } = t, e = "";
604
- if (t.useGradient && r) for (let i = 0; i < t.THEME_COLOR_LIMIT; i++) e += `
605
- .label${i} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}
606
- `;
607
- return e;
608
- }, "genGitGraphGradient"), fr = /* @__PURE__ */ l((t) => {
609
- let { theme: r, themeVariables: e } = Q(), { borderColorArray: i } = e, s = ct.has(r);
610
- if (mr.has(r)) {
611
- let n = "";
612
- for (let o = 0; o < t.THEME_COLOR_LIMIT; o++) if (o === 0) n += `
613
- .branch-label${o} { fill: ${t.nodeBorder};}
614
- .commit${o} { stroke: ${t.nodeBorder}; }
615
- .commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
616
- .arrow${o} { stroke: ${t.nodeBorder}; }
617
- .commit-bullets { fill: ${t.nodeBorder}; }
618
- .commit-cherry-pick${o} { stroke: ${t.nodeBorder}; }
619
- ${yr(t)}`;
620
- else {
621
- let a = o % nt;
622
- n += `
623
- .branch-label${o} { fill: ${t["gitBranchLabel" + a]}; }
624
- .commit${o} { stroke: ${t["git" + a]}; fill: ${t["git" + a]}; }
625
- .commit-highlight${o} { stroke: ${t["gitInv" + a]}; fill: ${t["gitInv" + a]}; }
626
- .arrow${o} { stroke: ${t["git" + a]}; }
627
- `;
628
- }
629
- return n;
630
- }
631
- if ($r.has(r)) {
632
- let n = "";
633
- for (let o = 0; o < t.THEME_COLOR_LIMIT; o++) if (o === 0) n += `
634
- .branch-label${o} { fill: ${t.nodeBorder}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
635
- .commit${o} { stroke: ${t.nodeBorder}; }
636
- .commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }
637
- .label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
638
- .arrow${o} { stroke: ${t.nodeBorder}; }
639
- .commit-bullets { fill: ${t.nodeBorder}; }
640
- `;
641
- else {
642
- let a = o % i.length;
643
- n += `
644
- .branch-label${o} { fill: ${t.nodeBorder}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
645
- .commit${o} { stroke: ${i[a]}; fill: ${i[a]}; }
646
- .commit-highlight${o} { stroke: ${i[a]}; fill: ${i[a]}; }
647
- .label${o} { fill: ${gr.has(r) ? t.mainBkg : i[a]}; stroke: ${i[a]}; stroke-width: ${t.strokeWidth}; }
648
- .arrow${o} { stroke: ${i[a]}; }
649
- `;
650
- }
651
- return n;
652
- }
653
- {
654
- let n = "";
655
- for (let o = 0; o < t.THEME_COLOR_LIMIT; o++) n += `
656
- .branch-label${o} { fill: ${t.nodeBorder}; ${s ? `font-weight:${t.noteFontWeight}` : ""} }
657
- .commit${o} { stroke: ${t.nodeBorder}; }
658
- .commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
659
- .label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${s ? `font-weight:${t.noteFontWeight}` : ""}}
660
- .arrow${o} { stroke: ${t.nodeBorder}; }
661
- .commit-bullets { fill: ${t.nodeBorder}; }
662
- .commit-cherry-pick${o} { stroke: ${t.nodeBorder}; }
663
- `;
664
- return n;
665
- }
666
- }, "genColor"), xr = /* @__PURE__ */ l((t) => `${Array.from({ length: t.THEME_COLOR_LIMIT }, (r, e) => e).map((r) => {
667
- let e = r % nt;
668
- return `
669
- .branch-label${r} { fill: ${t["gitBranchLabel" + e]}; }
670
- .commit${r} { stroke: ${t["git" + e]}; fill: ${t["git" + e]}; }
671
- .commit-highlight${r} { stroke: ${t["gitInv" + e]}; fill: ${t["gitInv" + e]}; }
672
- .label${r} { fill: ${t["git" + e]}; }
673
- .arrow${r} { stroke: ${t["git" + e]}; }
674
- `;
675
- }).join(`
676
- `)}`, "normalTheme"), wr = {
677
- parser: jt,
678
- db: at,
679
- renderer: hr,
680
- styles: /* @__PURE__ */ l((t) => {
681
- let { theme: r } = Q(), e = pr.has(r);
682
- return `
683
- .commit-id,
684
- .commit-msg,
685
- .branch-label {
686
- fill: lightgrey;
687
- color: lightgrey;
688
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
689
- font-family: var(--mermaid-font-family);
690
- }
691
-
692
- ${e ? fr(t) : xr(t)}
693
-
694
- .branch {
695
- stroke-width: ${t.strokeWidth};
696
- stroke: ${t.commitLineColor ?? t.lineColor};
697
- stroke-dasharray: ${e ? "4 2" : "2"};
698
- }
699
- .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${e ? t.nodeBorder : t.commitLabelColor}; ${e ? `font-weight:${t.noteFontWeight};` : ""}}
700
- .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${e ? "transparent" : t.commitLabelBackground}; opacity: ${e ? "" : 0.5}; }
701
- .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
702
- .tag-label-bkg { fill: ${e ? t.mainBkg : t.tagLabelBackground}; stroke: ${e ? t.nodeBorder : t.tagLabelBorder}; ${e ? `filter:${t.dropShadow}` : ""} }
703
- .tag-hole { fill: ${t.textColor}; }
704
-
705
- .commit-merge {
706
- stroke: ${e ? t.mainBkg : t.primaryColor};
707
- fill: ${e ? t.mainBkg : t.primaryColor};
708
- }
709
- .commit-reverse {
710
- stroke: ${e ? t.mainBkg : t.primaryColor};
711
- fill: ${e ? t.mainBkg : t.primaryColor};
712
- stroke-width: ${e ? t.strokeWidth : 3};
713
- }
714
- .commit-highlight-outer {
715
- }
716
- .commit-highlight-inner {
717
- stroke: ${e ? t.mainBkg : t.primaryColor};
718
- fill: ${e ? t.mainBkg : t.primaryColor};
719
- }
720
-
721
- .arrow {
722
- /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
723
- stroke-width: ${ct.has(r) ? t.strokeWidth : 8};
724
- stroke-linecap: round;
725
- fill: none
726
- }
727
- .gitTitleText {
728
- text-anchor: middle;
729
- font-size: 18px;
730
- fill: ${t.textColor};
731
- }
732
- `;
733
- }, "getStyles")
734
- };
735
- export {
736
- wr as diagram
737
- };