bg-editor 0.0.1

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 (67) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +51 -0
  3. package/README.zh-CN.md +51 -0
  4. package/dist/_basePickBy-4kmg42pS.js +158 -0
  5. package/dist/_baseUniq-WOvvCHTI.js +621 -0
  6. package/dist/arc-wItjmL5I.js +90 -0
  7. package/dist/architecture-U656AL7Q-FYDwFSxk.js +12 -0
  8. package/dist/architectureDiagram-VXUJARFQ-iG5MkBjx.js +4666 -0
  9. package/dist/blockDiagram-VD42YOAC-i2GlXmWy.js +2268 -0
  10. package/dist/c4Diagram-YG6GDRKO-IufO7T1R.js +1587 -0
  11. package/dist/channel-Dah4F59k.js +12 -0
  12. package/dist/chunk-4BX2VUAB-5_v9rnje.js +15 -0
  13. package/dist/chunk-55IACEB6-BDNtSypP.js +15 -0
  14. package/dist/chunk-B4BG7PRW-DzaYPsfW.js +1382 -0
  15. package/dist/chunk-DI55MBZ5-Buwrprkw.js +1377 -0
  16. package/dist/chunk-FMBD7UC4-BaEPEIWb.js +26 -0
  17. package/dist/chunk-QN33PNHL-DhbA7i5G.js +26 -0
  18. package/dist/chunk-QZHKN3VN-BAb_D1oz.js +22 -0
  19. package/dist/chunk-TZMSLE5B-OU1MJ2do.js +71 -0
  20. package/dist/classDiagram-2ON5EDUG-KStC8v09.js +23 -0
  21. package/dist/classDiagram-v2-WZHVMYZB-KStC8v09.js +23 -0
  22. package/dist/clone-C74UiRbr.js +15 -0
  23. package/dist/cose-bilkent-S5V4N54A-eRXCoix2.js +2612 -0
  24. package/dist/cytoscape.esm-BG3R4uVs.js +18738 -0
  25. package/dist/dagre-6UL2VRFP-Bi83jPQf.js +451 -0
  26. package/dist/defaultLocale-DgmhL6Re.js +178 -0
  27. package/dist/diagram-PSM6KHXK-aW98k2-4.js +539 -0
  28. package/dist/diagram-QEK2KX5R-BR--iNM5.js +224 -0
  29. package/dist/diagram-S2PKOQOG-NTnEy5_O.js +149 -0
  30. package/dist/erDiagram-Q2GNP2WA-C8oZ5c-S.js +848 -0
  31. package/dist/flowDiagram-NV44I4VS-DiKad3Bb.js +1627 -0
  32. package/dist/ganttDiagram-LVOFAZNH-CthzjjJq.js +2506 -0
  33. package/dist/gitGraph-F6HP7TQM-CuXAC0XT.js +12 -0
  34. package/dist/gitGraphDiagram-NY62KEGX-d4KszKqi.js +706 -0
  35. package/dist/graph-CnOTx4E0.js +254 -0
  36. package/dist/index-D6-Wf75-.js +122127 -0
  37. package/dist/info-NVLQJR56-Dhmtdc7O.js +12 -0
  38. package/dist/infoDiagram-ER5ION4S-DedidjTu.js +31 -0
  39. package/dist/init-d639unba.js +23 -0
  40. package/dist/journeyDiagram-XKPGCS4Q-BylvmUWL.js +843 -0
  41. package/dist/kanban-definition-3W4ZIXB7-DGV_aVgU.js +725 -0
  42. package/dist/layout-OXk4OSoz.js +1342 -0
  43. package/dist/linear-CO_vz87n.js +266 -0
  44. package/dist/mermaid-parser.core-CYtF6phW.js +12928 -0
  45. package/dist/mindmap-definition-VGOIOE7T-BU05Y6Vz.js +790 -0
  46. package/dist/ordinal-CofNqUw2.js +68 -0
  47. package/dist/packet-BFZMPI3H-D7H_8Q-U.js +12 -0
  48. package/dist/pie-7BOR55EZ-BNWNcO5Z.js +12 -0
  49. package/dist/pieDiagram-ADFJNKIX-reGTUsiW.js +168 -0
  50. package/dist/quadrantDiagram-AYHSOK5B-NeHOJ0lX.js +1029 -0
  51. package/dist/radar-NHE76QYJ-DrVEcvh1.js +12 -0
  52. package/dist/requirementDiagram-UZGBJVZJ-BE76XNaT.js +857 -0
  53. package/dist/sankeyDiagram-TZEHDZUN-UHfMLEKl.js +817 -0
  54. package/dist/sequenceDiagram-WL72ISMW-62KWnVbh.js +2518 -0
  55. package/dist/stateDiagram-FKZM4ZOC--_CkWvu6.js +270 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-Dj7ZjAmI.js +23 -0
  57. package/dist/style.css +1 -0
  58. package/dist/timeline-definition-IT6M3QCI-C3Wb0xMN.js +804 -0
  59. package/dist/treemap-KMMF4GRG-Bc8F2dFd.js +12 -0
  60. package/dist/umo-editor.js +16 -0
  61. package/dist/xychartDiagram-PRI3JC2R-D2J307cO.js +1347 -0
  62. package/package.json +200 -0
  63. package/types/index.d.ts +277 -0
  64. package/types/src/components/index.d.ts +9 -0
  65. package/types/src/components/menus/button.vue.d.ts +583 -0
  66. package/types/src/components/modal.vue.d.ts +2 -0
  67. package/types/src/components/tooltip.vue.d.ts +27 -0
@@ -0,0 +1,790 @@
1
+ import "./style.css";
2
+ import { g as le } from "./chunk-55IACEB6-BDNtSypP.js";
3
+ import { s as he } from "./chunk-QN33PNHL-DhbA7i5G.js";
4
+ import { _ as l, l as I, o as de, r as ge, F, c as W, i as V, aH as ue, W as pe, X as fe, Y as ye } from "./index-D6-Wf75-.js";
5
+ /**
6
+ * @umoteam/editor 9.0.1
7
+ * @license MIT
8
+ * @author umodoc https://www.umodoc.com
9
+ * @see https://www.umodoc.com
10
+ **/
11
+ const E = [];
12
+ for (let t = 0; t < 256; ++t)
13
+ E.push((t + 256).toString(16).slice(1));
14
+ function me(t, e = 0) {
15
+ return (E[t[e + 0]] + E[t[e + 1]] + E[t[e + 2]] + E[t[e + 3]] + "-" + E[t[e + 4]] + E[t[e + 5]] + "-" + E[t[e + 6]] + E[t[e + 7]] + "-" + E[t[e + 8]] + E[t[e + 9]] + "-" + E[t[e + 10]] + E[t[e + 11]] + E[t[e + 12]] + E[t[e + 13]] + E[t[e + 14]] + E[t[e + 15]]).toLowerCase();
16
+ }
17
+ let z;
18
+ const Ee = new Uint8Array(16);
19
+ function _e() {
20
+ if (!z) {
21
+ if (typeof crypto > "u" || !crypto.getRandomValues)
22
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
23
+ z = crypto.getRandomValues.bind(crypto);
24
+ }
25
+ return z(Ee);
26
+ }
27
+ const be = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ne = { randomUUID: be };
28
+ function Se(t, e, n) {
29
+ if (ne.randomUUID && !t)
30
+ return ne.randomUUID();
31
+ t = t || {};
32
+ const c = t.random ?? t.rng?.() ?? _e();
33
+ if (c.length < 16)
34
+ throw new Error("Random bytes length must be >= 16");
35
+ return c[6] = c[6] & 15 | 64, c[8] = c[8] & 63 | 128, me(c);
36
+ }
37
+ var X = function() {
38
+ var t = /* @__PURE__ */ l(function(x, s, i, o) {
39
+ for (i = i || {}, o = x.length; o--; i[x[o]] = s) ;
40
+ return i;
41
+ }, "o"), e = [1, 4], n = [1, 13], c = [1, 12], f = [1, 15], h = [1, 16], p = [1, 20], m = [1, 19], u = [6, 7, 8], N = [1, 26], Y = [1, 24], q = [1, 25], b = [6, 7, 11], J = [1, 6, 13, 15, 16, 19, 22], K = [1, 33], Q = [1, 34], R = [1, 6, 7, 11, 13, 15, 16, 19, 22], B = {
42
+ trace: /* @__PURE__ */ l(function() {
43
+ }, "trace"),
44
+ yy: {},
45
+ symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, MINDMAP: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, ICON: 15, CLASS: 16, nodeWithId: 17, nodeWithoutId: 18, NODE_DSTART: 19, NODE_DESCR: 20, NODE_DEND: 21, NODE_ID: 22, $accept: 0, $end: 1 },
46
+ terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" },
47
+ productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]],
48
+ performAction: /* @__PURE__ */ l(function(s, i, o, a, g, r, w) {
49
+ var d = r.length - 1;
50
+ switch (g) {
51
+ case 6:
52
+ case 7:
53
+ return a;
54
+ case 8:
55
+ a.getLogger().trace("Stop NL ");
56
+ break;
57
+ case 9:
58
+ a.getLogger().trace("Stop EOF ");
59
+ break;
60
+ case 11:
61
+ a.getLogger().trace("Stop NL2 ");
62
+ break;
63
+ case 12:
64
+ a.getLogger().trace("Stop EOF2 ");
65
+ break;
66
+ case 15:
67
+ a.getLogger().info("Node: ", r[d].id), a.addNode(r[d - 1].length, r[d].id, r[d].descr, r[d].type);
68
+ break;
69
+ case 16:
70
+ a.getLogger().trace("Icon: ", r[d]), a.decorateNode({ icon: r[d] });
71
+ break;
72
+ case 17:
73
+ case 21:
74
+ a.decorateNode({ class: r[d] });
75
+ break;
76
+ case 18:
77
+ a.getLogger().trace("SPACELIST");
78
+ break;
79
+ case 19:
80
+ a.getLogger().trace("Node: ", r[d].id), a.addNode(0, r[d].id, r[d].descr, r[d].type);
81
+ break;
82
+ case 20:
83
+ a.decorateNode({ icon: r[d] });
84
+ break;
85
+ case 25:
86
+ a.getLogger().trace("node found ..", r[d - 2]), this.$ = { id: r[d - 1], descr: r[d - 1], type: a.getType(r[d - 2], r[d]) };
87
+ break;
88
+ case 26:
89
+ this.$ = { id: r[d], descr: r[d], type: a.nodeType.DEFAULT };
90
+ break;
91
+ case 27:
92
+ a.getLogger().trace("node found ..", r[d - 3]), this.$ = { id: r[d - 3], descr: r[d - 1], type: a.getType(r[d - 2], r[d]) };
93
+ break;
94
+ }
95
+ }, "anonymous"),
96
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: e }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: e }, { 6: n, 7: [1, 10], 9: 9, 12: 11, 13: c, 14: 14, 15: f, 16: h, 17: 17, 18: 18, 19: p, 22: m }, t(u, [2, 3]), { 1: [2, 2] }, t(u, [2, 4]), t(u, [2, 5]), { 1: [2, 6], 6: n, 12: 21, 13: c, 14: 14, 15: f, 16: h, 17: 17, 18: 18, 19: p, 22: m }, { 6: n, 9: 22, 12: 11, 13: c, 14: 14, 15: f, 16: h, 17: 17, 18: 18, 19: p, 22: m }, { 6: N, 7: Y, 10: 23, 11: q }, t(b, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: p, 22: m }), t(b, [2, 18]), t(b, [2, 19]), t(b, [2, 20]), t(b, [2, 21]), t(b, [2, 23]), t(b, [2, 24]), t(b, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: N, 7: Y, 10: 32, 11: q }, { 1: [2, 7], 6: n, 12: 21, 13: c, 14: 14, 15: f, 16: h, 17: 17, 18: 18, 19: p, 22: m }, t(J, [2, 14], { 7: K, 11: Q }), t(R, [2, 8]), t(R, [2, 9]), t(R, [2, 10]), t(b, [2, 15]), t(b, [2, 16]), t(b, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, t(J, [2, 13], { 7: K, 11: Q }), t(R, [2, 11]), t(R, [2, 12]), { 21: [1, 37] }, t(b, [2, 25]), t(b, [2, 27])],
97
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
98
+ parseError: /* @__PURE__ */ l(function(s, i) {
99
+ if (i.recoverable)
100
+ this.trace(s);
101
+ else {
102
+ var o = new Error(s);
103
+ throw o.hash = i, o;
104
+ }
105
+ }, "parseError"),
106
+ parse: /* @__PURE__ */ l(function(s) {
107
+ var i = this, o = [0], a = [], g = [null], r = [], w = this.table, d = "", U = 0, Z = 0, re = 2, ee = 1, oe = r.slice.call(arguments, 1), y = Object.create(this.lexer), v = { yy: {} };
108
+ for (var j in this.yy)
109
+ Object.prototype.hasOwnProperty.call(this.yy, j) && (v.yy[j] = this.yy[j]);
110
+ y.setInput(s, v.yy), v.yy.lexer = y, v.yy.parser = this, typeof y.yylloc > "u" && (y.yylloc = {});
111
+ var G = y.yylloc;
112
+ r.push(G);
113
+ var ae = y.options && y.options.ranges;
114
+ typeof v.yy.parseError == "function" ? this.parseError = v.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
115
+ function ce(S) {
116
+ o.length = o.length - 2 * S, g.length = g.length - S, r.length = r.length - S;
117
+ }
118
+ l(ce, "popStack");
119
+ function te() {
120
+ var S;
121
+ return S = a.pop() || y.lex() || ee, typeof S != "number" && (S instanceof Array && (a = S, S = a.pop()), S = i.symbols_[S] || S), S;
122
+ }
123
+ l(te, "lex");
124
+ for (var _, T, D, H, O = {}, P, k, ie, M; ; ) {
125
+ if (T = o[o.length - 1], this.defaultActions[T] ? D = this.defaultActions[T] : ((_ === null || typeof _ > "u") && (_ = te()), D = w[T] && w[T][_]), typeof D > "u" || !D.length || !D[0]) {
126
+ var $ = "";
127
+ M = [];
128
+ for (P in w[T])
129
+ this.terminals_[P] && P > re && M.push("'" + this.terminals_[P] + "'");
130
+ y.showPosition ? $ = "Parse error on line " + (U + 1) + `:
131
+ ` + y.showPosition() + `
132
+ Expecting ` + M.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : $ = "Parse error on line " + (U + 1) + ": Unexpected " + (_ == ee ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError($, {
133
+ text: y.match,
134
+ token: this.terminals_[_] || _,
135
+ line: y.yylineno,
136
+ loc: G,
137
+ expected: M
138
+ });
139
+ }
140
+ if (D[0] instanceof Array && D.length > 1)
141
+ throw new Error("Parse Error: multiple actions possible at state: " + T + ", token: " + _);
142
+ switch (D[0]) {
143
+ case 1:
144
+ o.push(_), g.push(y.yytext), r.push(y.yylloc), o.push(D[1]), _ = null, Z = y.yyleng, d = y.yytext, U = y.yylineno, G = y.yylloc;
145
+ break;
146
+ case 2:
147
+ if (k = this.productions_[D[1]][1], O.$ = g[g.length - k], O._$ = {
148
+ first_line: r[r.length - (k || 1)].first_line,
149
+ last_line: r[r.length - 1].last_line,
150
+ first_column: r[r.length - (k || 1)].first_column,
151
+ last_column: r[r.length - 1].last_column
152
+ }, ae && (O._$.range = [
153
+ r[r.length - (k || 1)].range[0],
154
+ r[r.length - 1].range[1]
155
+ ]), H = this.performAction.apply(O, [
156
+ d,
157
+ Z,
158
+ U,
159
+ v.yy,
160
+ D[1],
161
+ g,
162
+ r
163
+ ].concat(oe)), typeof H < "u")
164
+ return H;
165
+ k && (o = o.slice(0, -1 * k * 2), g = g.slice(0, -1 * k), r = r.slice(0, -1 * k)), o.push(this.productions_[D[1]][0]), g.push(O.$), r.push(O._$), ie = w[o[o.length - 2]][o[o.length - 1]], o.push(ie);
166
+ break;
167
+ case 3:
168
+ return !0;
169
+ }
170
+ }
171
+ return !0;
172
+ }, "parse")
173
+ }, se = /* @__PURE__ */ function() {
174
+ var x = {
175
+ EOF: 1,
176
+ parseError: /* @__PURE__ */ l(function(i, o) {
177
+ if (this.yy.parser)
178
+ this.yy.parser.parseError(i, o);
179
+ else
180
+ throw new Error(i);
181
+ }, "parseError"),
182
+ // resets the lexer, sets new input
183
+ setInput: /* @__PURE__ */ l(function(s, i) {
184
+ return this.yy = i || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
185
+ first_line: 1,
186
+ first_column: 0,
187
+ last_line: 1,
188
+ last_column: 0
189
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
190
+ }, "setInput"),
191
+ // consumes and returns one char from the input
192
+ input: /* @__PURE__ */ l(function() {
193
+ var s = this._input[0];
194
+ this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
195
+ var i = s.match(/(?:\r\n?|\n).*/g);
196
+ return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
197
+ }, "input"),
198
+ // unshifts one char (or a string) into the input
199
+ unput: /* @__PURE__ */ l(function(s) {
200
+ var i = s.length, o = s.split(/(?:\r\n?|\n)/g);
201
+ this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
202
+ var a = this.match.split(/(?:\r\n?|\n)/g);
203
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), o.length - 1 && (this.yylineno -= o.length - 1);
204
+ var g = this.yylloc.range;
205
+ return this.yylloc = {
206
+ first_line: this.yylloc.first_line,
207
+ last_line: this.yylineno + 1,
208
+ first_column: this.yylloc.first_column,
209
+ last_column: o ? (o.length === a.length ? this.yylloc.first_column : 0) + a[a.length - o.length].length - o[0].length : this.yylloc.first_column - i
210
+ }, this.options.ranges && (this.yylloc.range = [g[0], g[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
211
+ }, "unput"),
212
+ // When called from action, caches matched text and appends it on next action
213
+ more: /* @__PURE__ */ l(function() {
214
+ return this._more = !0, this;
215
+ }, "more"),
216
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
217
+ reject: /* @__PURE__ */ l(function() {
218
+ if (this.options.backtrack_lexer)
219
+ this._backtrack = !0;
220
+ else
221
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
222
+ ` + this.showPosition(), {
223
+ text: "",
224
+ token: null,
225
+ line: this.yylineno
226
+ });
227
+ return this;
228
+ }, "reject"),
229
+ // retain first n characters of the match
230
+ less: /* @__PURE__ */ l(function(s) {
231
+ this.unput(this.match.slice(s));
232
+ }, "less"),
233
+ // displays already matched input, i.e. for error messages
234
+ pastInput: /* @__PURE__ */ l(function() {
235
+ var s = this.matched.substr(0, this.matched.length - this.match.length);
236
+ return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
237
+ }, "pastInput"),
238
+ // displays upcoming input, i.e. for error messages
239
+ upcomingInput: /* @__PURE__ */ l(function() {
240
+ var s = this.match;
241
+ return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
242
+ }, "upcomingInput"),
243
+ // displays the character position where the lexing error occurred, i.e. for error messages
244
+ showPosition: /* @__PURE__ */ l(function() {
245
+ var s = this.pastInput(), i = new Array(s.length + 1).join("-");
246
+ return s + this.upcomingInput() + `
247
+ ` + i + "^";
248
+ }, "showPosition"),
249
+ // test the lexed token: return FALSE when not a match, otherwise return token
250
+ test_match: /* @__PURE__ */ l(function(s, i) {
251
+ var o, a, g;
252
+ if (this.options.backtrack_lexer && (g = {
253
+ yylineno: this.yylineno,
254
+ yylloc: {
255
+ first_line: this.yylloc.first_line,
256
+ last_line: this.last_line,
257
+ first_column: this.yylloc.first_column,
258
+ last_column: this.yylloc.last_column
259
+ },
260
+ yytext: this.yytext,
261
+ match: this.match,
262
+ matches: this.matches,
263
+ matched: this.matched,
264
+ yyleng: this.yyleng,
265
+ offset: this.offset,
266
+ _more: this._more,
267
+ _input: this._input,
268
+ yy: this.yy,
269
+ conditionStack: this.conditionStack.slice(0),
270
+ done: this.done
271
+ }, this.options.ranges && (g.yylloc.range = this.yylloc.range.slice(0))), a = s[0].match(/(?:\r\n?|\n).*/g), a && (this.yylineno += a.length), this.yylloc = {
272
+ first_line: this.yylloc.last_line,
273
+ last_line: this.yylineno + 1,
274
+ first_column: this.yylloc.last_column,
275
+ last_column: a ? a[a.length - 1].length - a[a.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
276
+ }, this.yytext += s[0], this.match += s[0], this.matches = s, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(s[0].length), this.matched += s[0], o = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), o)
277
+ return o;
278
+ if (this._backtrack) {
279
+ for (var r in g)
280
+ this[r] = g[r];
281
+ return !1;
282
+ }
283
+ return !1;
284
+ }, "test_match"),
285
+ // return next match in input
286
+ next: /* @__PURE__ */ l(function() {
287
+ if (this.done)
288
+ return this.EOF;
289
+ this._input || (this.done = !0);
290
+ var s, i, o, a;
291
+ this._more || (this.yytext = "", this.match = "");
292
+ for (var g = this._currentRules(), r = 0; r < g.length; r++)
293
+ if (o = this._input.match(this.rules[g[r]]), o && (!i || o[0].length > i[0].length)) {
294
+ if (i = o, a = r, this.options.backtrack_lexer) {
295
+ if (s = this.test_match(o, g[r]), s !== !1)
296
+ return s;
297
+ if (this._backtrack) {
298
+ i = !1;
299
+ continue;
300
+ } else
301
+ return !1;
302
+ } else if (!this.options.flex)
303
+ break;
304
+ }
305
+ return i ? (s = this.test_match(i, g[a]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
306
+ ` + this.showPosition(), {
307
+ text: "",
308
+ token: null,
309
+ line: this.yylineno
310
+ });
311
+ }, "next"),
312
+ // return next match that has a token
313
+ lex: /* @__PURE__ */ l(function() {
314
+ var i = this.next();
315
+ return i || this.lex();
316
+ }, "lex"),
317
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
318
+ begin: /* @__PURE__ */ l(function(i) {
319
+ this.conditionStack.push(i);
320
+ }, "begin"),
321
+ // pop the previously active lexer condition state off the condition stack
322
+ popState: /* @__PURE__ */ l(function() {
323
+ var i = this.conditionStack.length - 1;
324
+ return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
325
+ }, "popState"),
326
+ // produce the lexer rule set which is active for the currently active lexer condition state
327
+ _currentRules: /* @__PURE__ */ l(function() {
328
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
329
+ }, "_currentRules"),
330
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
331
+ topState: /* @__PURE__ */ l(function(i) {
332
+ return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
333
+ }, "topState"),
334
+ // alias for begin(condition)
335
+ pushState: /* @__PURE__ */ l(function(i) {
336
+ this.begin(i);
337
+ }, "pushState"),
338
+ // return the number of states currently on the stack
339
+ stateStackSize: /* @__PURE__ */ l(function() {
340
+ return this.conditionStack.length;
341
+ }, "stateStackSize"),
342
+ options: { "case-insensitive": !0 },
343
+ performAction: /* @__PURE__ */ l(function(i, o, a, g) {
344
+ switch (a) {
345
+ case 0:
346
+ return i.getLogger().trace("Found comment", o.yytext), 6;
347
+ case 1:
348
+ return 8;
349
+ case 2:
350
+ this.begin("CLASS");
351
+ break;
352
+ case 3:
353
+ return this.popState(), 16;
354
+ case 4:
355
+ this.popState();
356
+ break;
357
+ case 5:
358
+ i.getLogger().trace("Begin icon"), this.begin("ICON");
359
+ break;
360
+ case 6:
361
+ return i.getLogger().trace("SPACELINE"), 6;
362
+ case 7:
363
+ return 7;
364
+ case 8:
365
+ return 15;
366
+ case 9:
367
+ i.getLogger().trace("end icon"), this.popState();
368
+ break;
369
+ case 10:
370
+ return i.getLogger().trace("Exploding node"), this.begin("NODE"), 19;
371
+ case 11:
372
+ return i.getLogger().trace("Cloud"), this.begin("NODE"), 19;
373
+ case 12:
374
+ return i.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19;
375
+ case 13:
376
+ return i.getLogger().trace("Cloud Bang"), this.begin("NODE"), 19;
377
+ case 14:
378
+ return this.begin("NODE"), 19;
379
+ case 15:
380
+ return this.begin("NODE"), 19;
381
+ case 16:
382
+ return this.begin("NODE"), 19;
383
+ case 17:
384
+ return this.begin("NODE"), 19;
385
+ case 18:
386
+ return 13;
387
+ case 19:
388
+ return 22;
389
+ case 20:
390
+ return 11;
391
+ case 21:
392
+ this.begin("NSTR2");
393
+ break;
394
+ case 22:
395
+ return "NODE_DESCR";
396
+ case 23:
397
+ this.popState();
398
+ break;
399
+ case 24:
400
+ i.getLogger().trace("Starting NSTR"), this.begin("NSTR");
401
+ break;
402
+ case 25:
403
+ return i.getLogger().trace("description:", o.yytext), "NODE_DESCR";
404
+ case 26:
405
+ this.popState();
406
+ break;
407
+ case 27:
408
+ return this.popState(), i.getLogger().trace("node end ))"), "NODE_DEND";
409
+ case 28:
410
+ return this.popState(), i.getLogger().trace("node end )"), "NODE_DEND";
411
+ case 29:
412
+ return this.popState(), i.getLogger().trace("node end ...", o.yytext), "NODE_DEND";
413
+ case 30:
414
+ return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
415
+ case 31:
416
+ return this.popState(), i.getLogger().trace("node end (-"), "NODE_DEND";
417
+ case 32:
418
+ return this.popState(), i.getLogger().trace("node end (-"), "NODE_DEND";
419
+ case 33:
420
+ return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
421
+ case 34:
422
+ return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
423
+ case 35:
424
+ return i.getLogger().trace("Long description:", o.yytext), 20;
425
+ case 36:
426
+ return i.getLogger().trace("Long description:", o.yytext), 20;
427
+ }
428
+ }, "anonymous"),
429
+ rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
430
+ conditions: { CLASS: { rules: [3, 4], inclusive: !1 }, ICON: { rules: [8, 9], inclusive: !1 }, NSTR2: { rules: [22, 23], inclusive: !1 }, NSTR: { rules: [25, 26], inclusive: !1 }, NODE: { rules: [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], inclusive: !0 } }
431
+ };
432
+ return x;
433
+ }();
434
+ B.lexer = se;
435
+ function A() {
436
+ this.yy = {};
437
+ }
438
+ return l(A, "Parser"), A.prototype = B, B.Parser = A, new A();
439
+ }();
440
+ X.parser = X;
441
+ var De = X, L = {
442
+ DEFAULT: 0,
443
+ NO_BORDER: 0,
444
+ ROUNDED_RECT: 1,
445
+ RECT: 2,
446
+ CIRCLE: 3,
447
+ CLOUD: 4,
448
+ BANG: 5,
449
+ HEXAGON: 6
450
+ }, C, Ne = (C = class {
451
+ constructor() {
452
+ this.nodes = [], this.count = 0, this.elements = {}, this.getLogger = this.getLogger.bind(this), this.nodeType = L, this.clear(), this.getType = this.getType.bind(this), this.getElementById = this.getElementById.bind(this), this.getParent = this.getParent.bind(this), this.getMindmap = this.getMindmap.bind(this), this.addNode = this.addNode.bind(this), this.decorateNode = this.decorateNode.bind(this);
453
+ }
454
+ clear() {
455
+ this.nodes = [], this.count = 0, this.elements = {}, this.baseLevel = void 0;
456
+ }
457
+ getParent(e) {
458
+ for (let n = this.nodes.length - 1; n >= 0; n--)
459
+ if (this.nodes[n].level < e)
460
+ return this.nodes[n];
461
+ return null;
462
+ }
463
+ getMindmap() {
464
+ return this.nodes.length > 0 ? this.nodes[0] : null;
465
+ }
466
+ addNode(e, n, c, f) {
467
+ I.info("addNode", e, n, c, f);
468
+ let h = !1;
469
+ this.nodes.length === 0 ? (this.baseLevel = e, e = 0, h = !0) : this.baseLevel !== void 0 && (e = e - this.baseLevel, h = !1);
470
+ const p = W();
471
+ let m = p.mindmap?.padding ?? F.mindmap.padding;
472
+ switch (f) {
473
+ case this.nodeType.ROUNDED_RECT:
474
+ case this.nodeType.RECT:
475
+ case this.nodeType.HEXAGON:
476
+ m *= 2;
477
+ break;
478
+ }
479
+ const u = {
480
+ id: this.count++,
481
+ nodeId: V(n, p),
482
+ level: e,
483
+ descr: V(c, p),
484
+ type: f,
485
+ children: [],
486
+ width: p.mindmap?.maxNodeWidth ?? F.mindmap.maxNodeWidth,
487
+ padding: m,
488
+ isRoot: h
489
+ }, N = this.getParent(e);
490
+ if (N)
491
+ N.children.push(u), this.nodes.push(u);
492
+ else if (h)
493
+ this.nodes.push(u);
494
+ else
495
+ throw new Error(
496
+ `There can be only one root. No parent could be found for ("${u.descr}")`
497
+ );
498
+ }
499
+ getType(e, n) {
500
+ switch (I.debug("In get type", e, n), e) {
501
+ case "[":
502
+ return this.nodeType.RECT;
503
+ case "(":
504
+ return n === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
505
+ case "((":
506
+ return this.nodeType.CIRCLE;
507
+ case ")":
508
+ return this.nodeType.CLOUD;
509
+ case "))":
510
+ return this.nodeType.BANG;
511
+ case "{{":
512
+ return this.nodeType.HEXAGON;
513
+ default:
514
+ return this.nodeType.DEFAULT;
515
+ }
516
+ }
517
+ setElementForId(e, n) {
518
+ this.elements[e] = n;
519
+ }
520
+ getElementById(e) {
521
+ return this.elements[e];
522
+ }
523
+ decorateNode(e) {
524
+ if (!e)
525
+ return;
526
+ const n = W(), c = this.nodes[this.nodes.length - 1];
527
+ e.icon && (c.icon = V(e.icon, n)), e.class && (c.class = V(e.class, n));
528
+ }
529
+ type2Str(e) {
530
+ switch (e) {
531
+ case this.nodeType.DEFAULT:
532
+ return "no-border";
533
+ case this.nodeType.RECT:
534
+ return "rect";
535
+ case this.nodeType.ROUNDED_RECT:
536
+ return "rounded-rect";
537
+ case this.nodeType.CIRCLE:
538
+ return "circle";
539
+ case this.nodeType.CLOUD:
540
+ return "cloud";
541
+ case this.nodeType.BANG:
542
+ return "bang";
543
+ case this.nodeType.HEXAGON:
544
+ return "hexgon";
545
+ default:
546
+ return "no-border";
547
+ }
548
+ }
549
+ /**
550
+ * Assign section numbers to nodes based on their position relative to root
551
+ * @param node - The mindmap node to process
552
+ * @param sectionNumber - The section number to assign (undefined for root)
553
+ */
554
+ assignSections(e, n) {
555
+ if (e.level === 0 ? e.section = void 0 : e.section = n, e.children)
556
+ for (const [c, f] of e.children.entries()) {
557
+ const h = e.level === 0 ? c : n;
558
+ this.assignSections(f, h);
559
+ }
560
+ }
561
+ /**
562
+ * Convert mindmap tree structure to flat array of nodes
563
+ * @param node - The mindmap node to process
564
+ * @param processedNodes - Array to collect processed nodes
565
+ */
566
+ flattenNodes(e, n) {
567
+ const c = ["mindmap-node"];
568
+ e.isRoot === !0 ? c.push("section-root", "section--1") : e.section !== void 0 && c.push(`section-${e.section}`), e.class && c.push(e.class);
569
+ const f = c.join(" "), h = /* @__PURE__ */ l((m) => {
570
+ switch (m) {
571
+ case L.CIRCLE:
572
+ return "mindmapCircle";
573
+ case L.RECT:
574
+ return "rect";
575
+ case L.ROUNDED_RECT:
576
+ return "rounded";
577
+ case L.CLOUD:
578
+ return "cloud";
579
+ case L.BANG:
580
+ return "bang";
581
+ case L.HEXAGON:
582
+ return "hexagon";
583
+ case L.DEFAULT:
584
+ return "defaultMindmapNode";
585
+ case L.NO_BORDER:
586
+ default:
587
+ return "rect";
588
+ }
589
+ }, "getShapeFromType"), p = {
590
+ id: e.id.toString(),
591
+ domId: "node_" + e.id.toString(),
592
+ label: e.descr,
593
+ isGroup: !1,
594
+ shape: h(e.type),
595
+ width: e.width,
596
+ height: e.height ?? 0,
597
+ padding: e.padding,
598
+ cssClasses: f,
599
+ cssStyles: [],
600
+ look: "default",
601
+ icon: e.icon,
602
+ x: e.x,
603
+ y: e.y,
604
+ // Mindmap-specific properties
605
+ level: e.level,
606
+ nodeId: e.nodeId,
607
+ type: e.type,
608
+ section: e.section
609
+ };
610
+ if (n.push(p), e.children)
611
+ for (const m of e.children)
612
+ this.flattenNodes(m, n);
613
+ }
614
+ /**
615
+ * Generate edges from parent-child relationships in mindmap tree
616
+ * @param node - The mindmap node to process
617
+ * @param edges - Array to collect edges
618
+ */
619
+ generateEdges(e, n) {
620
+ if (e.children)
621
+ for (const c of e.children) {
622
+ let f = "edge";
623
+ c.section !== void 0 && (f += ` section-edge-${c.section}`);
624
+ const h = e.level + 1;
625
+ f += ` edge-depth-${h}`;
626
+ const p = {
627
+ id: `edge_${e.id}_${c.id}`,
628
+ start: e.id.toString(),
629
+ end: c.id.toString(),
630
+ type: "normal",
631
+ curve: "basis",
632
+ thickness: "normal",
633
+ look: "default",
634
+ classes: f,
635
+ // Store mindmap-specific data
636
+ depth: e.level,
637
+ section: c.section
638
+ };
639
+ n.push(p), this.generateEdges(c, n);
640
+ }
641
+ }
642
+ /**
643
+ * Get structured data for layout algorithms
644
+ * Following the pattern established by ER diagrams
645
+ * @returns Structured data containing nodes, edges, and config
646
+ */
647
+ getData() {
648
+ const e = this.getMindmap(), n = W(), f = ue().layout !== void 0, h = n;
649
+ if (f || (h.layout = "cose-bilkent"), !e)
650
+ return {
651
+ nodes: [],
652
+ edges: [],
653
+ config: h
654
+ };
655
+ I.debug("getData: mindmapRoot", e, n), this.assignSections(e);
656
+ const p = [], m = [];
657
+ this.flattenNodes(e, p), this.generateEdges(e, m), I.debug(
658
+ `getData: processed ${p.length} nodes and ${m.length} edges`
659
+ );
660
+ const u = /* @__PURE__ */ new Map();
661
+ for (const N of p)
662
+ u.set(N.id, {
663
+ shape: N.shape,
664
+ width: N.width,
665
+ height: N.height,
666
+ padding: N.padding
667
+ });
668
+ return {
669
+ nodes: p,
670
+ edges: m,
671
+ config: h,
672
+ // Store the root node for mindmap-specific layout algorithms
673
+ rootNode: e,
674
+ // Properties required by dagre layout algorithm
675
+ markers: ["point"],
676
+ // Mindmaps don't use markers
677
+ direction: "TB",
678
+ // Top-to-bottom direction for mindmaps
679
+ nodeSpacing: 50,
680
+ // Default spacing between nodes
681
+ rankSpacing: 50,
682
+ // Default spacing between ranks
683
+ // Add shapes for ELK compatibility
684
+ shapes: Object.fromEntries(u),
685
+ // Additional properties that layout algorithms might expect
686
+ type: "mindmap",
687
+ diagramId: "mindmap-" + Se()
688
+ };
689
+ }
690
+ // Expose logger to grammar
691
+ getLogger() {
692
+ return I;
693
+ }
694
+ }, l(C, "MindmapDB"), C), ke = /* @__PURE__ */ l(async (t, e, n, c) => {
695
+ I.debug(`Rendering mindmap diagram
696
+ ` + t);
697
+ const f = c.db, h = f.getData(), p = le(e, h.config.securityLevel);
698
+ h.type = c.type, h.layoutAlgorithm = de(h.config.layout, {
699
+ fallback: "cose-bilkent"
700
+ }), h.diagramId = e, f.getMindmap() && (h.nodes.forEach((u) => {
701
+ u.shape === "rounded" ? (u.radius = 15, u.taper = 15, u.stroke = "none", u.width = 0, u.padding = 15) : u.shape === "circle" ? u.padding = 10 : u.shape === "rect" && (u.width = 0, u.padding = 10);
702
+ }), await ge(h, p), he(
703
+ p,
704
+ h.config.mindmap?.padding ?? F.mindmap.padding,
705
+ "mindmapDiagram",
706
+ h.config.mindmap?.useMaxWidth ?? F.mindmap.useMaxWidth
707
+ ));
708
+ }, "draw"), Le = {
709
+ draw: ke
710
+ }, xe = /* @__PURE__ */ l((t) => {
711
+ let e = "";
712
+ for (let n = 0; n < t.THEME_COLOR_LIMIT; n++)
713
+ t["lineColor" + n] = t["lineColor" + n] || t["cScaleInv" + n], pe(t["lineColor" + n]) ? t["lineColor" + n] = fe(t["lineColor" + n], 20) : t["lineColor" + n] = ye(t["lineColor" + n], 20);
714
+ for (let n = 0; n < t.THEME_COLOR_LIMIT; n++) {
715
+ const c = "" + (17 - 3 * n);
716
+ e += `
717
+ .section-${n - 1} rect, .section-${n - 1} path, .section-${n - 1} circle, .section-${n - 1} polygon, .section-${n - 1} path {
718
+ fill: ${t["cScale" + n]};
719
+ }
720
+ .section-${n - 1} text {
721
+ fill: ${t["cScaleLabel" + n]};
722
+ }
723
+ .node-icon-${n - 1} {
724
+ font-size: 40px;
725
+ color: ${t["cScaleLabel" + n]};
726
+ }
727
+ .section-edge-${n - 1}{
728
+ stroke: ${t["cScale" + n]};
729
+ }
730
+ .edge-depth-${n - 1}{
731
+ stroke-width: ${c};
732
+ }
733
+ .section-${n - 1} line {
734
+ stroke: ${t["cScaleInv" + n]} ;
735
+ stroke-width: 3;
736
+ }
737
+
738
+ .disabled, .disabled circle, .disabled text {
739
+ fill: lightgray;
740
+ }
741
+ .disabled text {
742
+ fill: #efefef;
743
+ }
744
+ `;
745
+ }
746
+ return e;
747
+ }, "genSections"), ve = /* @__PURE__ */ l((t) => `
748
+ .edge {
749
+ stroke-width: 3;
750
+ }
751
+ ${xe(t)}
752
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
753
+ fill: ${t.git0};
754
+ }
755
+ .section-root text {
756
+ fill: ${t.gitBranchLabel0};
757
+ }
758
+ .section-root span {
759
+ color: ${t.gitBranchLabel0};
760
+ }
761
+ .section-2 span {
762
+ color: ${t.gitBranchLabel0};
763
+ }
764
+ .icon-container {
765
+ height:100%;
766
+ display: flex;
767
+ justify-content: center;
768
+ align-items: center;
769
+ }
770
+ .edge {
771
+ fill: none;
772
+ }
773
+ .mindmap-node-label {
774
+ dy: 1em;
775
+ alignment-baseline: middle;
776
+ text-anchor: middle;
777
+ dominant-baseline: middle;
778
+ text-align: center;
779
+ }
780
+ `, "getStyles"), Te = ve, we = {
781
+ get db() {
782
+ return new Ne();
783
+ },
784
+ renderer: Le,
785
+ parser: De,
786
+ styles: Te
787
+ };
788
+ export {
789
+ we as diagram
790
+ };