bg-editor 0.0.7 → 0.0.9

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 (59) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/umo-editor.js +90031 -7
  3. package/package.json +21 -1
  4. package/dist/_baseUniq-CK68Es8H.js +0 -473
  5. package/dist/arc-cD-4ba7d.js +0 -84
  6. package/dist/architecture-U656AL7Q-jxTBuJdN.js +0 -6
  7. package/dist/architectureDiagram-VXUJARFQ-D3XlpFhb.js +0 -4660
  8. package/dist/blockDiagram-VD42YOAC-BslbvMOG.js +0 -2262
  9. package/dist/c4Diagram-YG6GDRKO-DD3uWYPM.js +0 -1581
  10. package/dist/channel-DjTSKqWx.js +0 -6
  11. package/dist/chunk-4BX2VUAB-lfhsh4gk.js +0 -9
  12. package/dist/chunk-55IACEB6-O42zw0MT.js +0 -9
  13. package/dist/chunk-B4BG7PRW-CAose2Ox.js +0 -1376
  14. package/dist/chunk-DI55MBZ5-DkOlwdzs.js +0 -1371
  15. package/dist/chunk-FMBD7UC4-XviEvZms.js +0 -20
  16. package/dist/chunk-QN33PNHL-CNGSzgpw.js +0 -20
  17. package/dist/chunk-QZHKN3VN-CRgLUJXR.js +0 -16
  18. package/dist/chunk-TZMSLE5B-BkHNUxTN.js +0 -65
  19. package/dist/classDiagram-2ON5EDUG-Cakz_SCw.js +0 -17
  20. package/dist/classDiagram-v2-WZHVMYZB-Cakz_SCw.js +0 -17
  21. package/dist/clone-CIrbb4_D.js +0 -9
  22. package/dist/cose-bilkent-S5V4N54A-EoSlB5N_.js +0 -2606
  23. package/dist/cytoscape.esm-DoU_GB5M.js +0 -18732
  24. package/dist/dagre-6UL2VRFP-BPH1NIvl.js +0 -444
  25. package/dist/defaultLocale-DEnRyJdC.js +0 -172
  26. package/dist/diagram-PSM6KHXK-DCRoLhFv.js +0 -396
  27. package/dist/diagram-QEK2KX5R-2gxFpsCA.js +0 -218
  28. package/dist/diagram-S2PKOQOG-BIPpN2G8.js +0 -143
  29. package/dist/erDiagram-Q2GNP2WA-pfb2dpnp.js +0 -842
  30. package/dist/flowDiagram-NV44I4VS-Dv631-Fh.js +0 -1621
  31. package/dist/ganttDiagram-LVOFAZNH-BOKYXijK.js +0 -2500
  32. package/dist/gitGraph-F6HP7TQM-CRerkbyh.js +0 -6
  33. package/dist/gitGraphDiagram-NY62KEGX-CgO9x7O1.js +0 -700
  34. package/dist/graph-CG-rVaun.js +0 -382
  35. package/dist/index-LPeu-5gp.js +0 -164788
  36. package/dist/info-NVLQJR56-CZcMDuD4.js +0 -6
  37. package/dist/infoDiagram-ER5ION4S-CpfjxDXT.js +0 -25
  38. package/dist/init-Dbt-6wo9.js +0 -17
  39. package/dist/journeyDiagram-XKPGCS4Q-D4m1xk_j.js +0 -837
  40. package/dist/kanban-definition-3W4ZIXB7-GUMW-GDO.js +0 -719
  41. package/dist/layout-C7pGfQvF.js +0 -1416
  42. package/dist/linear-CQdBpz9H.js +0 -260
  43. package/dist/mermaid-parser.core-C3Lk4un7.js +0 -14143
  44. package/dist/min-D7xNMq31.js +0 -39
  45. package/dist/mindmap-definition-VGOIOE7T-GfQh2q9s.js +0 -784
  46. package/dist/ordinal-mgyNSFm_.js +0 -62
  47. package/dist/packet-BFZMPI3H-DughJE3g.js +0 -6
  48. package/dist/pie-7BOR55EZ-B1py7mee.js +0 -6
  49. package/dist/pieDiagram-ADFJNKIX-DENmX4xL.js +0 -162
  50. package/dist/quadrantDiagram-AYHSOK5B-BFVycH-W.js +0 -1023
  51. package/dist/radar-NHE76QYJ-DuTW4rXt.js +0 -6
  52. package/dist/requirementDiagram-UZGBJVZJ-f8rb43Mp.js +0 -851
  53. package/dist/sankeyDiagram-TZEHDZUN-CUN0tZ5p.js +0 -811
  54. package/dist/sequenceDiagram-WL72ISMW-7X4nul9T.js +0 -2512
  55. package/dist/stateDiagram-FKZM4ZOC-CypL793K.js +0 -264
  56. package/dist/stateDiagram-v2-4FDKWEC3-D5vS5FM5.js +0 -17
  57. package/dist/timeline-definition-IT6M3QCI-B_WOoOGO.js +0 -798
  58. package/dist/treemap-KMMF4GRG-BzINyJBJ.js +0 -6
  59. package/dist/xychartDiagram-PRI3JC2R-Llw16NDY.js +0 -1341
@@ -1,837 +0,0 @@
1
- import "./style.css";
2
- import { a as gt, g as lt, f as mt, d as xt } from "./chunk-TZMSLE5B-BkHNUxTN.js";
3
- import { g as kt } from "./chunk-FMBD7UC4-XviEvZms.js";
4
- import { _ as n, g as _t, s as vt, a as bt, b as wt, q as Tt, p as St, c as R, d as G, e as $t, y as Mt } from "./index-LPeu-5gp.js";
5
- import { d as et } from "./arc-cD-4ba7d.js";
6
- var U = function() {
7
- var t = /* @__PURE__ */ n(function(h, i, a, l) {
8
- for (a = a || {}, l = h.length; l--; a[h[l]] = i) ;
9
- return a;
10
- }, "o"), e = [6, 8, 10, 11, 12, 14, 16, 17, 18], s = [1, 9], c = [1, 10], r = [1, 11], f = [1, 12], u = [1, 13], y = [1, 14], g = {
11
- trace: /* @__PURE__ */ n(function() {
12
- }, "trace"),
13
- yy: {},
14
- symbols_: { error: 2, start: 3, journey: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, title: 11, acc_title: 12, acc_title_value: 13, acc_descr: 14, acc_descr_value: 15, acc_descr_multiline_value: 16, section: 17, taskName: 18, taskData: 19, $accept: 0, $end: 1 },
15
- terminals_: { 2: "error", 4: "journey", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 18: "taskName", 19: "taskData" },
16
- productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2]],
17
- performAction: /* @__PURE__ */ n(function(i, a, l, d, p, o, b) {
18
- var k = o.length - 1;
19
- switch (p) {
20
- case 1:
21
- return o[k - 1];
22
- case 2:
23
- this.$ = [];
24
- break;
25
- case 3:
26
- o[k - 1].push(o[k]), this.$ = o[k - 1];
27
- break;
28
- case 4:
29
- case 5:
30
- this.$ = o[k];
31
- break;
32
- case 6:
33
- case 7:
34
- this.$ = [];
35
- break;
36
- case 8:
37
- d.setDiagramTitle(o[k].substr(6)), this.$ = o[k].substr(6);
38
- break;
39
- case 9:
40
- this.$ = o[k].trim(), d.setAccTitle(this.$);
41
- break;
42
- case 10:
43
- case 11:
44
- this.$ = o[k].trim(), d.setAccDescription(this.$);
45
- break;
46
- case 12:
47
- d.addSection(o[k].substr(8)), this.$ = o[k].substr(8);
48
- break;
49
- case 13:
50
- d.addTask(o[k - 1], o[k]), this.$ = "task";
51
- break;
52
- }
53
- }, "anonymous"),
54
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, t(e, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: s, 12: c, 14: r, 16: f, 17: u, 18: y }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 15, 11: s, 12: c, 14: r, 16: f, 17: u, 18: y }, t(e, [2, 5]), t(e, [2, 6]), t(e, [2, 8]), { 13: [1, 16] }, { 15: [1, 17] }, t(e, [2, 11]), t(e, [2, 12]), { 19: [1, 18] }, t(e, [2, 4]), t(e, [2, 9]), t(e, [2, 10]), t(e, [2, 13])],
55
- defaultActions: {},
56
- parseError: /* @__PURE__ */ n(function(i, a) {
57
- if (a.recoverable)
58
- this.trace(i);
59
- else {
60
- var l = new Error(i);
61
- throw l.hash = a, l;
62
- }
63
- }, "parseError"),
64
- parse: /* @__PURE__ */ n(function(i) {
65
- var a = this, l = [0], d = [], p = [null], o = [], b = this.table, k = "", C = 0, K = 0, dt = 2, Q = 1, yt = o.slice.call(arguments, 1), _ = Object.create(this.lexer), I = { yy: {} };
66
- for (var O in this.yy)
67
- Object.prototype.hasOwnProperty.call(this.yy, O) && (I.yy[O] = this.yy[O]);
68
- _.setInput(i, I.yy), I.yy.lexer = _, I.yy.parser = this, typeof _.yylloc > "u" && (_.yylloc = {});
69
- var Y = _.yylloc;
70
- o.push(Y);
71
- var ft = _.options && _.options.ranges;
72
- typeof I.yy.parseError == "function" ? this.parseError = I.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
73
- function pt(w) {
74
- l.length = l.length - 2 * w, p.length = p.length - w, o.length = o.length - w;
75
- }
76
- n(pt, "popStack");
77
- function D() {
78
- var w;
79
- return w = d.pop() || _.lex() || Q, typeof w != "number" && (w instanceof Array && (d = w, w = d.pop()), w = a.symbols_[w] || w), w;
80
- }
81
- n(D, "lex");
82
- for (var v, A, T, q, F = {}, N, M, tt, z; ; ) {
83
- if (A = l[l.length - 1], this.defaultActions[A] ? T = this.defaultActions[A] : ((v === null || typeof v > "u") && (v = D()), T = b[A] && b[A][v]), typeof T > "u" || !T.length || !T[0]) {
84
- var X = "";
85
- z = [];
86
- for (N in b[A])
87
- this.terminals_[N] && N > dt && z.push("'" + this.terminals_[N] + "'");
88
- _.showPosition ? X = "Parse error on line " + (C + 1) + `:
89
- ` + _.showPosition() + `
90
- Expecting ` + z.join(", ") + ", got '" + (this.terminals_[v] || v) + "'" : X = "Parse error on line " + (C + 1) + ": Unexpected " + (v == Q ? "end of input" : "'" + (this.terminals_[v] || v) + "'"), this.parseError(X, {
91
- text: _.match,
92
- token: this.terminals_[v] || v,
93
- line: _.yylineno,
94
- loc: Y,
95
- expected: z
96
- });
97
- }
98
- if (T[0] instanceof Array && T.length > 1)
99
- throw new Error("Parse Error: multiple actions possible at state: " + A + ", token: " + v);
100
- switch (T[0]) {
101
- case 1:
102
- l.push(v), p.push(_.yytext), o.push(_.yylloc), l.push(T[1]), v = null, K = _.yyleng, k = _.yytext, C = _.yylineno, Y = _.yylloc;
103
- break;
104
- case 2:
105
- if (M = this.productions_[T[1]][1], F.$ = p[p.length - M], F._$ = {
106
- first_line: o[o.length - (M || 1)].first_line,
107
- last_line: o[o.length - 1].last_line,
108
- first_column: o[o.length - (M || 1)].first_column,
109
- last_column: o[o.length - 1].last_column
110
- }, ft && (F._$.range = [
111
- o[o.length - (M || 1)].range[0],
112
- o[o.length - 1].range[1]
113
- ]), q = this.performAction.apply(F, [
114
- k,
115
- K,
116
- C,
117
- I.yy,
118
- T[1],
119
- p,
120
- o
121
- ].concat(yt)), typeof q < "u")
122
- return q;
123
- M && (l = l.slice(0, -1 * M * 2), p = p.slice(0, -1 * M), o = o.slice(0, -1 * M)), l.push(this.productions_[T[1]][0]), p.push(F.$), o.push(F._$), tt = b[l[l.length - 2]][l[l.length - 1]], l.push(tt);
124
- break;
125
- case 3:
126
- return !0;
127
- }
128
- }
129
- return !0;
130
- }, "parse")
131
- }, m = /* @__PURE__ */ function() {
132
- var h = {
133
- EOF: 1,
134
- parseError: /* @__PURE__ */ n(function(a, l) {
135
- if (this.yy.parser)
136
- this.yy.parser.parseError(a, l);
137
- else
138
- throw new Error(a);
139
- }, "parseError"),
140
- // resets the lexer, sets new input
141
- setInput: /* @__PURE__ */ n(function(i, a) {
142
- return this.yy = a || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
143
- first_line: 1,
144
- first_column: 0,
145
- last_line: 1,
146
- last_column: 0
147
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
148
- }, "setInput"),
149
- // consumes and returns one char from the input
150
- input: /* @__PURE__ */ n(function() {
151
- var i = this._input[0];
152
- this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
153
- var a = i.match(/(?:\r\n?|\n).*/g);
154
- return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
155
- }, "input"),
156
- // unshifts one char (or a string) into the input
157
- unput: /* @__PURE__ */ n(function(i) {
158
- var a = i.length, l = i.split(/(?:\r\n?|\n)/g);
159
- this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
160
- var d = this.match.split(/(?:\r\n?|\n)/g);
161
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
162
- var p = this.yylloc.range;
163
- return this.yylloc = {
164
- first_line: this.yylloc.first_line,
165
- last_line: this.yylineno + 1,
166
- first_column: this.yylloc.first_column,
167
- last_column: l ? (l.length === d.length ? this.yylloc.first_column : 0) + d[d.length - l.length].length - l[0].length : this.yylloc.first_column - a
168
- }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
169
- }, "unput"),
170
- // When called from action, caches matched text and appends it on next action
171
- more: /* @__PURE__ */ n(function() {
172
- return this._more = !0, this;
173
- }, "more"),
174
- // 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.
175
- reject: /* @__PURE__ */ n(function() {
176
- if (this.options.backtrack_lexer)
177
- this._backtrack = !0;
178
- else
179
- 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).
180
- ` + this.showPosition(), {
181
- text: "",
182
- token: null,
183
- line: this.yylineno
184
- });
185
- return this;
186
- }, "reject"),
187
- // retain first n characters of the match
188
- less: /* @__PURE__ */ n(function(i) {
189
- this.unput(this.match.slice(i));
190
- }, "less"),
191
- // displays already matched input, i.e. for error messages
192
- pastInput: /* @__PURE__ */ n(function() {
193
- var i = this.matched.substr(0, this.matched.length - this.match.length);
194
- return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
195
- }, "pastInput"),
196
- // displays upcoming input, i.e. for error messages
197
- upcomingInput: /* @__PURE__ */ n(function() {
198
- var i = this.match;
199
- return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
200
- }, "upcomingInput"),
201
- // displays the character position where the lexing error occurred, i.e. for error messages
202
- showPosition: /* @__PURE__ */ n(function() {
203
- var i = this.pastInput(), a = new Array(i.length + 1).join("-");
204
- return i + this.upcomingInput() + `
205
- ` + a + "^";
206
- }, "showPosition"),
207
- // test the lexed token: return FALSE when not a match, otherwise return token
208
- test_match: /* @__PURE__ */ n(function(i, a) {
209
- var l, d, p;
210
- if (this.options.backtrack_lexer && (p = {
211
- yylineno: this.yylineno,
212
- yylloc: {
213
- first_line: this.yylloc.first_line,
214
- last_line: this.last_line,
215
- first_column: this.yylloc.first_column,
216
- last_column: this.yylloc.last_column
217
- },
218
- yytext: this.yytext,
219
- match: this.match,
220
- matches: this.matches,
221
- matched: this.matched,
222
- yyleng: this.yyleng,
223
- offset: this.offset,
224
- _more: this._more,
225
- _input: this._input,
226
- yy: this.yy,
227
- conditionStack: this.conditionStack.slice(0),
228
- done: this.done
229
- }, this.options.ranges && (p.yylloc.range = this.yylloc.range.slice(0))), d = i[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = {
230
- first_line: this.yylloc.last_line,
231
- last_line: this.yylineno + 1,
232
- first_column: this.yylloc.last_column,
233
- last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
234
- }, this.yytext += i[0], this.match += i[0], this.matches = i, 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(i[0].length), this.matched += i[0], l = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
235
- return l;
236
- if (this._backtrack) {
237
- for (var o in p)
238
- this[o] = p[o];
239
- return !1;
240
- }
241
- return !1;
242
- }, "test_match"),
243
- // return next match in input
244
- next: /* @__PURE__ */ n(function() {
245
- if (this.done)
246
- return this.EOF;
247
- this._input || (this.done = !0);
248
- var i, a, l, d;
249
- this._more || (this.yytext = "", this.match = "");
250
- for (var p = this._currentRules(), o = 0; o < p.length; o++)
251
- if (l = this._input.match(this.rules[p[o]]), l && (!a || l[0].length > a[0].length)) {
252
- if (a = l, d = o, this.options.backtrack_lexer) {
253
- if (i = this.test_match(l, p[o]), i !== !1)
254
- return i;
255
- if (this._backtrack) {
256
- a = !1;
257
- continue;
258
- } else
259
- return !1;
260
- } else if (!this.options.flex)
261
- break;
262
- }
263
- return a ? (i = this.test_match(a, p[d]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
264
- ` + this.showPosition(), {
265
- text: "",
266
- token: null,
267
- line: this.yylineno
268
- });
269
- }, "next"),
270
- // return next match that has a token
271
- lex: /* @__PURE__ */ n(function() {
272
- var a = this.next();
273
- return a || this.lex();
274
- }, "lex"),
275
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
276
- begin: /* @__PURE__ */ n(function(a) {
277
- this.conditionStack.push(a);
278
- }, "begin"),
279
- // pop the previously active lexer condition state off the condition stack
280
- popState: /* @__PURE__ */ n(function() {
281
- var a = this.conditionStack.length - 1;
282
- return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
283
- }, "popState"),
284
- // produce the lexer rule set which is active for the currently active lexer condition state
285
- _currentRules: /* @__PURE__ */ n(function() {
286
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
287
- }, "_currentRules"),
288
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
289
- topState: /* @__PURE__ */ n(function(a) {
290
- return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
291
- }, "topState"),
292
- // alias for begin(condition)
293
- pushState: /* @__PURE__ */ n(function(a) {
294
- this.begin(a);
295
- }, "pushState"),
296
- // return the number of states currently on the stack
297
- stateStackSize: /* @__PURE__ */ n(function() {
298
- return this.conditionStack.length;
299
- }, "stateStackSize"),
300
- options: { "case-insensitive": !0 },
301
- performAction: /* @__PURE__ */ n(function(a, l, d, p) {
302
- switch (d) {
303
- case 0:
304
- break;
305
- case 1:
306
- break;
307
- case 2:
308
- return 10;
309
- case 3:
310
- break;
311
- case 4:
312
- break;
313
- case 5:
314
- return 4;
315
- case 6:
316
- return 11;
317
- case 7:
318
- return this.begin("acc_title"), 12;
319
- case 8:
320
- return this.popState(), "acc_title_value";
321
- case 9:
322
- return this.begin("acc_descr"), 14;
323
- case 10:
324
- return this.popState(), "acc_descr_value";
325
- case 11:
326
- this.begin("acc_descr_multiline");
327
- break;
328
- case 12:
329
- this.popState();
330
- break;
331
- case 13:
332
- return "acc_descr_multiline_value";
333
- case 14:
334
- return 17;
335
- case 15:
336
- return 18;
337
- case 16:
338
- return 19;
339
- case 17:
340
- return ":";
341
- case 18:
342
- return 6;
343
- case 19:
344
- return "INVALID";
345
- }
346
- }, "anonymous"),
347
- rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
348
- conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19], inclusive: !0 } }
349
- };
350
- return h;
351
- }();
352
- g.lexer = m;
353
- function x() {
354
- this.yy = {};
355
- }
356
- return n(x, "Parser"), x.prototype = g, g.Parser = x, new x();
357
- }();
358
- U.parser = U;
359
- var Et = U, V = "", Z = [], L = [], B = [], Ct = /* @__PURE__ */ n(function() {
360
- Z.length = 0, L.length = 0, V = "", B.length = 0, Mt();
361
- }, "clear"), Pt = /* @__PURE__ */ n(function(t) {
362
- V = t, Z.push(t);
363
- }, "addSection"), It = /* @__PURE__ */ n(function() {
364
- return Z;
365
- }, "getSections"), At = /* @__PURE__ */ n(function() {
366
- let t = it();
367
- const e = 100;
368
- let s = 0;
369
- for (; !t && s < e; )
370
- t = it(), s++;
371
- return L.push(...B), L;
372
- }, "getTasks"), Ft = /* @__PURE__ */ n(function() {
373
- const t = [];
374
- return L.forEach((s) => {
375
- s.people && t.push(...s.people);
376
- }), [...new Set(t)].sort();
377
- }, "updateActors"), Vt = /* @__PURE__ */ n(function(t, e) {
378
- const s = e.substr(1).split(":");
379
- let c = 0, r = [];
380
- s.length === 1 ? (c = Number(s[0]), r = []) : (c = Number(s[0]), r = s[1].split(","));
381
- const f = r.map((y) => y.trim()), u = {
382
- section: V,
383
- type: V,
384
- people: f,
385
- task: t,
386
- score: c
387
- };
388
- B.push(u);
389
- }, "addTask"), Rt = /* @__PURE__ */ n(function(t) {
390
- const e = {
391
- section: V,
392
- type: V,
393
- description: t,
394
- task: t,
395
- classes: []
396
- };
397
- L.push(e);
398
- }, "addTaskOrg"), it = /* @__PURE__ */ n(function() {
399
- const t = /* @__PURE__ */ n(function(s) {
400
- return B[s].processed;
401
- }, "compileTask");
402
- let e = !0;
403
- for (const [s, c] of B.entries())
404
- t(s), e = e && c.processed;
405
- return e;
406
- }, "compileTasks"), Lt = /* @__PURE__ */ n(function() {
407
- return Ft();
408
- }, "getActors"), rt = {
409
- getConfig: /* @__PURE__ */ n(() => R().journey, "getConfig"),
410
- clear: Ct,
411
- setDiagramTitle: St,
412
- getDiagramTitle: Tt,
413
- setAccTitle: wt,
414
- getAccTitle: bt,
415
- setAccDescription: vt,
416
- getAccDescription: _t,
417
- addSection: Pt,
418
- getSections: It,
419
- getTasks: At,
420
- addTask: Vt,
421
- addTaskOrg: Rt,
422
- getActors: Lt
423
- }, Bt = /* @__PURE__ */ n((t) => `.label {
424
- font-family: ${t.fontFamily};
425
- color: ${t.textColor};
426
- }
427
- .mouth {
428
- stroke: #666;
429
- }
430
-
431
- line {
432
- stroke: ${t.textColor}
433
- }
434
-
435
- .legend {
436
- fill: ${t.textColor};
437
- font-family: ${t.fontFamily};
438
- }
439
-
440
- .label text {
441
- fill: #333;
442
- }
443
- .label {
444
- color: ${t.textColor}
445
- }
446
-
447
- .face {
448
- ${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"};
449
- stroke: #999;
450
- }
451
-
452
- .node rect,
453
- .node circle,
454
- .node ellipse,
455
- .node polygon,
456
- .node path {
457
- fill: ${t.mainBkg};
458
- stroke: ${t.nodeBorder};
459
- stroke-width: 1px;
460
- }
461
-
462
- .node .label {
463
- text-align: center;
464
- }
465
- .node.clickable {
466
- cursor: pointer;
467
- }
468
-
469
- .arrowheadPath {
470
- fill: ${t.arrowheadColor};
471
- }
472
-
473
- .edgePath .path {
474
- stroke: ${t.lineColor};
475
- stroke-width: 1.5px;
476
- }
477
-
478
- .flowchart-link {
479
- stroke: ${t.lineColor};
480
- fill: none;
481
- }
482
-
483
- .edgeLabel {
484
- background-color: ${t.edgeLabelBackground};
485
- rect {
486
- opacity: 0.5;
487
- }
488
- text-align: center;
489
- }
490
-
491
- .cluster rect {
492
- }
493
-
494
- .cluster text {
495
- fill: ${t.titleColor};
496
- }
497
-
498
- div.mermaidTooltip {
499
- position: absolute;
500
- text-align: center;
501
- max-width: 200px;
502
- padding: 2px;
503
- font-family: ${t.fontFamily};
504
- font-size: 12px;
505
- background: ${t.tertiaryColor};
506
- border: 1px solid ${t.border2};
507
- border-radius: 2px;
508
- pointer-events: none;
509
- z-index: 100;
510
- }
511
-
512
- .task-type-0, .section-type-0 {
513
- ${t.fillType0 ? `fill: ${t.fillType0}` : ""};
514
- }
515
- .task-type-1, .section-type-1 {
516
- ${t.fillType0 ? `fill: ${t.fillType1}` : ""};
517
- }
518
- .task-type-2, .section-type-2 {
519
- ${t.fillType0 ? `fill: ${t.fillType2}` : ""};
520
- }
521
- .task-type-3, .section-type-3 {
522
- ${t.fillType0 ? `fill: ${t.fillType3}` : ""};
523
- }
524
- .task-type-4, .section-type-4 {
525
- ${t.fillType0 ? `fill: ${t.fillType4}` : ""};
526
- }
527
- .task-type-5, .section-type-5 {
528
- ${t.fillType0 ? `fill: ${t.fillType5}` : ""};
529
- }
530
- .task-type-6, .section-type-6 {
531
- ${t.fillType0 ? `fill: ${t.fillType6}` : ""};
532
- }
533
- .task-type-7, .section-type-7 {
534
- ${t.fillType0 ? `fill: ${t.fillType7}` : ""};
535
- }
536
-
537
- .actor-0 {
538
- ${t.actor0 ? `fill: ${t.actor0}` : ""};
539
- }
540
- .actor-1 {
541
- ${t.actor1 ? `fill: ${t.actor1}` : ""};
542
- }
543
- .actor-2 {
544
- ${t.actor2 ? `fill: ${t.actor2}` : ""};
545
- }
546
- .actor-3 {
547
- ${t.actor3 ? `fill: ${t.actor3}` : ""};
548
- }
549
- .actor-4 {
550
- ${t.actor4 ? `fill: ${t.actor4}` : ""};
551
- }
552
- .actor-5 {
553
- ${t.actor5 ? `fill: ${t.actor5}` : ""};
554
- }
555
- ${kt()}
556
- `, "getStyles"), jt = Bt, J = /* @__PURE__ */ n(function(t, e) {
557
- return xt(t, e);
558
- }, "drawRect"), Nt = /* @__PURE__ */ n(function(t, e) {
559
- const c = t.append("circle").attr("cx", e.cx).attr("cy", e.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), r = t.append("g");
560
- r.append("circle").attr("cx", e.cx - 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), r.append("circle").attr("cx", e.cx + 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
561
- function f(g) {
562
- const m = et().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
563
- g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")");
564
- }
565
- n(f, "smile");
566
- function u(g) {
567
- const m = et().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
568
- g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")");
569
- }
570
- n(u, "sad");
571
- function y(g) {
572
- g.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", e.cx - 5).attr("y1", e.cy + 7).attr("x2", e.cx + 5).attr("y2", e.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
573
- }
574
- return n(y, "ambivalent"), e.score > 3 ? f(r) : e.score < 3 ? u(r) : y(r), c;
575
- }, "drawFace"), ot = /* @__PURE__ */ n(function(t, e) {
576
- const s = t.append("circle");
577
- return s.attr("cx", e.cx), s.attr("cy", e.cy), s.attr("class", "actor-" + e.pos), s.attr("fill", e.fill), s.attr("stroke", e.stroke), s.attr("r", e.r), s.class !== void 0 && s.attr("class", s.class), e.title !== void 0 && s.append("title").text(e.title), s;
578
- }, "drawCircle"), ct = /* @__PURE__ */ n(function(t, e) {
579
- return mt(t, e);
580
- }, "drawText"), zt = /* @__PURE__ */ n(function(t, e) {
581
- function s(r, f, u, y, g) {
582
- return r + "," + f + " " + (r + u) + "," + f + " " + (r + u) + "," + (f + y - g) + " " + (r + u - g * 1.2) + "," + (f + y) + " " + r + "," + (f + y);
583
- }
584
- n(s, "genPoints");
585
- const c = t.append("polygon");
586
- c.attr("points", s(e.x, e.y, 50, 20, 7)), c.attr("class", "labelBox"), e.y = e.y + e.labelMargin, e.x = e.x + 0.5 * e.labelMargin, ct(t, e);
587
- }, "drawLabel"), Wt = /* @__PURE__ */ n(function(t, e, s) {
588
- const c = t.append("g"), r = lt();
589
- r.x = e.x, r.y = e.y, r.fill = e.fill, r.width = s.width * e.taskCount + // width of the tasks
590
- s.diagramMarginX * (e.taskCount - 1), r.height = s.height, r.class = "journey-section section-type-" + e.num, r.rx = 3, r.ry = 3, J(c, r), ht(s)(
591
- e.text,
592
- c,
593
- r.x,
594
- r.y,
595
- r.width,
596
- r.height,
597
- { class: "journey-section section-type-" + e.num },
598
- s,
599
- e.colour
600
- );
601
- }, "drawSection"), nt = -1, Ot = /* @__PURE__ */ n(function(t, e, s) {
602
- const c = e.x + s.width / 2, r = t.append("g");
603
- nt++;
604
- const f = 300 + 5 * 30;
605
- r.append("line").attr("id", "task" + nt).attr("x1", c).attr("y1", e.y).attr("x2", c).attr("y2", f).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Nt(r, {
606
- cx: c,
607
- cy: 300 + (5 - e.score) * 30,
608
- score: e.score
609
- });
610
- const u = lt();
611
- u.x = e.x, u.y = e.y, u.fill = e.fill, u.width = s.width, u.height = s.height, u.class = "task task-type-" + e.num, u.rx = 3, u.ry = 3, J(r, u);
612
- let y = e.x + 14;
613
- e.people.forEach((g) => {
614
- const m = e.actors[g].color, x = {
615
- cx: y,
616
- cy: e.y,
617
- r: 7,
618
- fill: m,
619
- stroke: "#000",
620
- title: g,
621
- pos: e.actors[g].position
622
- };
623
- ot(r, x), y += 10;
624
- }), ht(s)(
625
- e.task,
626
- r,
627
- u.x,
628
- u.y,
629
- u.width,
630
- u.height,
631
- { class: "task" },
632
- s,
633
- e.colour
634
- );
635
- }, "drawTask"), Yt = /* @__PURE__ */ n(function(t, e) {
636
- gt(t, e);
637
- }, "drawBackgroundRect"), ht = /* @__PURE__ */ function() {
638
- function t(r, f, u, y, g, m, x, h) {
639
- const i = f.append("text").attr("x", u + g / 2).attr("y", y + m / 2 + 5).style("font-color", h).style("text-anchor", "middle").text(r);
640
- c(i, x);
641
- }
642
- n(t, "byText");
643
- function e(r, f, u, y, g, m, x, h, i) {
644
- const { taskFontSize: a, taskFontFamily: l } = h, d = r.split(/<br\s*\/?>/gi);
645
- for (let p = 0; p < d.length; p++) {
646
- const o = p * a - a * (d.length - 1) / 2, b = f.append("text").attr("x", u + g / 2).attr("y", y).attr("fill", i).style("text-anchor", "middle").style("font-size", a).style("font-family", l);
647
- b.append("tspan").attr("x", u + g / 2).attr("dy", o).text(d[p]), b.attr("y", y + m / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), c(b, x);
648
- }
649
- }
650
- n(e, "byTspan");
651
- function s(r, f, u, y, g, m, x, h) {
652
- const i = f.append("switch"), l = i.append("foreignObject").attr("x", u).attr("y", y).attr("width", g).attr("height", m).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
653
- l.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), e(r, i, u, y, g, m, x, h), c(l, x);
654
- }
655
- n(s, "byFo");
656
- function c(r, f) {
657
- for (const u in f)
658
- u in f && r.attr(u, f[u]);
659
- }
660
- return n(c, "_setTextAttrs"), function(r) {
661
- return r.textPlacement === "fo" ? s : r.textPlacement === "old" ? t : e;
662
- };
663
- }(), qt = /* @__PURE__ */ n(function(t) {
664
- t.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
665
- }, "initGraphics"), j = {
666
- drawRect: J,
667
- drawCircle: ot,
668
- drawSection: Wt,
669
- drawText: ct,
670
- drawLabel: zt,
671
- drawTask: Ot,
672
- drawBackgroundRect: Yt,
673
- initGraphics: qt
674
- }, Xt = /* @__PURE__ */ n(function(t) {
675
- Object.keys(t).forEach(function(s) {
676
- $[s] = t[s];
677
- });
678
- }, "setConf"), E = {}, W = 0;
679
- function ut(t) {
680
- const e = R().journey, s = e.maxLabelWidth;
681
- W = 0;
682
- let c = 60;
683
- Object.keys(E).forEach((r) => {
684
- const f = E[r].color, u = {
685
- cx: 20,
686
- cy: c,
687
- r: 7,
688
- fill: f,
689
- stroke: "#000",
690
- pos: E[r].position
691
- };
692
- j.drawCircle(t, u);
693
- let y = t.append("text").attr("visibility", "hidden").text(r);
694
- const g = y.node().getBoundingClientRect().width;
695
- y.remove();
696
- let m = [];
697
- if (g <= s)
698
- m = [r];
699
- else {
700
- const x = r.split(" ");
701
- let h = "";
702
- y = t.append("text").attr("visibility", "hidden"), x.forEach((i) => {
703
- const a = h ? `${h} ${i}` : i;
704
- if (y.text(a), y.node().getBoundingClientRect().width > s) {
705
- if (h && m.push(h), h = i, y.text(i), y.node().getBoundingClientRect().width > s) {
706
- let d = "";
707
- for (const p of i)
708
- d += p, y.text(d + "-"), y.node().getBoundingClientRect().width > s && (m.push(d.slice(0, -1) + "-"), d = p);
709
- h = d;
710
- }
711
- } else
712
- h = a;
713
- }), h && m.push(h), y.remove();
714
- }
715
- m.forEach((x, h) => {
716
- const i = {
717
- x: 40,
718
- y: c + 7 + h * 20,
719
- fill: "#666",
720
- text: x,
721
- textMargin: e.boxTextMargin ?? 5
722
- }, l = j.drawText(t, i).node().getBoundingClientRect().width;
723
- l > W && l > e.leftMargin - l && (W = l);
724
- }), c += Math.max(20, m.length * 20);
725
- });
726
- }
727
- n(ut, "drawActorLegend");
728
- var $ = R().journey, P = 0, Gt = /* @__PURE__ */ n(function(t, e, s, c) {
729
- const r = R(), f = r.journey.titleColor, u = r.journey.titleFontSize, y = r.journey.titleFontFamily, g = r.securityLevel;
730
- let m;
731
- g === "sandbox" && (m = G("#i" + e));
732
- const x = g === "sandbox" ? G(m.nodes()[0].contentDocument.body) : G("body");
733
- S.init();
734
- const h = x.select("#" + e);
735
- j.initGraphics(h);
736
- const i = c.db.getTasks(), a = c.db.getDiagramTitle(), l = c.db.getActors();
737
- for (const C in E)
738
- delete E[C];
739
- let d = 0;
740
- l.forEach((C) => {
741
- E[C] = {
742
- color: $.actorColours[d % $.actorColours.length],
743
- position: d
744
- }, d++;
745
- }), ut(h), P = $.leftMargin + W, S.insert(0, 0, P, Object.keys(E).length * 50), Ht(h, i, 0);
746
- const p = S.getBounds();
747
- a && h.append("text").text(a).attr("x", P).attr("font-size", u).attr("font-weight", "bold").attr("y", 25).attr("fill", f).attr("font-family", y);
748
- const o = p.stopy - p.starty + 2 * $.diagramMarginY, b = P + p.stopx + 2 * $.diagramMarginX;
749
- $t(h, o, b, $.useMaxWidth), h.append("line").attr("x1", P).attr("y1", $.height * 4).attr("x2", b - P - 4).attr("y2", $.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
750
- const k = a ? 70 : 0;
751
- h.attr("viewBox", `${p.startx} -25 ${b} ${o + k}`), h.attr("preserveAspectRatio", "xMinYMin meet"), h.attr("height", o + k + 25);
752
- }, "draw"), S = {
753
- data: {
754
- startx: void 0,
755
- stopx: void 0,
756
- starty: void 0,
757
- stopy: void 0
758
- },
759
- verticalPos: 0,
760
- sequenceItems: [],
761
- init: /* @__PURE__ */ n(function() {
762
- this.sequenceItems = [], this.data = {
763
- startx: void 0,
764
- stopx: void 0,
765
- starty: void 0,
766
- stopy: void 0
767
- }, this.verticalPos = 0;
768
- }, "init"),
769
- updateVal: /* @__PURE__ */ n(function(t, e, s, c) {
770
- t[e] === void 0 ? t[e] = s : t[e] = c(s, t[e]);
771
- }, "updateVal"),
772
- updateBounds: /* @__PURE__ */ n(function(t, e, s, c) {
773
- const r = R().journey, f = this;
774
- let u = 0;
775
- function y(g) {
776
- return /* @__PURE__ */ n(function(x) {
777
- u++;
778
- const h = f.sequenceItems.length - u + 1;
779
- f.updateVal(x, "starty", e - h * r.boxMargin, Math.min), f.updateVal(x, "stopy", c + h * r.boxMargin, Math.max), f.updateVal(S.data, "startx", t - h * r.boxMargin, Math.min), f.updateVal(S.data, "stopx", s + h * r.boxMargin, Math.max), g !== "activation" && (f.updateVal(x, "startx", t - h * r.boxMargin, Math.min), f.updateVal(x, "stopx", s + h * r.boxMargin, Math.max), f.updateVal(S.data, "starty", e - h * r.boxMargin, Math.min), f.updateVal(S.data, "stopy", c + h * r.boxMargin, Math.max));
780
- }, "updateItemBounds");
781
- }
782
- n(y, "updateFn"), this.sequenceItems.forEach(y());
783
- }, "updateBounds"),
784
- insert: /* @__PURE__ */ n(function(t, e, s, c) {
785
- const r = Math.min(t, s), f = Math.max(t, s), u = Math.min(e, c), y = Math.max(e, c);
786
- this.updateVal(S.data, "startx", r, Math.min), this.updateVal(S.data, "starty", u, Math.min), this.updateVal(S.data, "stopx", f, Math.max), this.updateVal(S.data, "stopy", y, Math.max), this.updateBounds(r, u, f, y);
787
- }, "insert"),
788
- bumpVerticalPos: /* @__PURE__ */ n(function(t) {
789
- this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos;
790
- }, "bumpVerticalPos"),
791
- getVerticalPos: /* @__PURE__ */ n(function() {
792
- return this.verticalPos;
793
- }, "getVerticalPos"),
794
- getBounds: /* @__PURE__ */ n(function() {
795
- return this.data;
796
- }, "getBounds")
797
- }, H = $.sectionFills, st = $.sectionColours, Ht = /* @__PURE__ */ n(function(t, e, s) {
798
- const c = R().journey;
799
- let r = "";
800
- const f = c.height * 2 + c.diagramMarginY, u = s + f;
801
- let y = 0, g = "#CCC", m = "black", x = 0;
802
- for (const [h, i] of e.entries()) {
803
- if (r !== i.section) {
804
- g = H[y % H.length], x = y % H.length, m = st[y % st.length];
805
- let l = 0;
806
- const d = i.section;
807
- for (let o = h; o < e.length && e[o].section == d; o++)
808
- l = l + 1;
809
- const p = {
810
- x: h * c.taskMargin + h * c.width + P,
811
- y: 50,
812
- text: i.section,
813
- fill: g,
814
- num: x,
815
- colour: m,
816
- taskCount: l
817
- };
818
- j.drawSection(t, p, c), r = i.section, y++;
819
- }
820
- const a = i.people.reduce((l, d) => (E[d] && (l[d] = E[d]), l), {});
821
- i.x = h * c.taskMargin + h * c.width + P, i.y = u, i.width = c.diagramMarginX, i.height = c.diagramMarginY, i.colour = m, i.fill = g, i.num = x, i.actors = a, j.drawTask(t, i, c), S.insert(i.x, i.y, i.x + i.width + c.taskMargin, 300 + 5 * 30);
822
- }
823
- }, "drawTasks"), at = {
824
- setConf: Xt,
825
- draw: Gt
826
- }, Dt = {
827
- parser: Et,
828
- db: rt,
829
- renderer: at,
830
- styles: jt,
831
- init: /* @__PURE__ */ n((t) => {
832
- at.setConf(t.journey), rt.clear();
833
- }, "init")
834
- };
835
- export {
836
- Dt as diagram
837
- };