@umami/shiso 1.12.0 → 1.13.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 (121) hide show
  1. package/dist/chunks/App.js +76 -49
  2. package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
  3. package/dist/chunks/arc.js +130 -0
  4. package/dist/chunks/architecture-7GRP2DOG.js +4 -0
  5. package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
  6. package/dist/chunks/array.js +8 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
  9. package/dist/chunks/channel.js +9 -0
  10. package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
  11. package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
  12. package/dist/chunks/chunk-5VM5RSS4.js +21 -0
  13. package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
  14. package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
  15. package/dist/chunks/chunk-F27PBJKO.js +95 -0
  16. package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
  17. package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
  18. package/dist/chunks/chunk-GVQU2GXP.js +58 -0
  19. package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
  20. package/dist/chunks/chunk-JWPE2WC7.js +12 -0
  21. package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
  22. package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
  23. package/dist/chunks/chunk-P2QGCYS3.js +95 -0
  24. package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
  25. package/dist/chunks/chunk-PWAF6VOD.js +467 -0
  26. package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
  27. package/dist/chunks/chunk-SVP7TREG.js +686 -0
  28. package/dist/chunks/chunk-TICWLB2K.js +3800 -0
  29. package/dist/chunks/chunk-XXDRQBXY.js +12 -0
  30. package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
  31. package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
  32. package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
  33. package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
  34. package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
  35. package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
  36. package/dist/chunks/cytoscape.esm.js +28282 -0
  37. package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
  38. package/dist/chunks/dagre.js +4235 -0
  39. package/dist/chunks/defaultLocale.js +246 -0
  40. package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
  41. package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
  42. package/dist/chunks/diagram-VSXAHHWV.js +553 -0
  43. package/dist/chunks/diagram-VX7I27RA.js +798 -0
  44. package/dist/chunks/diagram-Z3DM3KII.js +186 -0
  45. package/dist/chunks/dist.js +92 -0
  46. package/dist/chunks/docs.js +987 -91
  47. package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
  48. package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
  49. package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
  50. package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
  51. package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
  52. package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
  53. package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
  54. package/dist/chunks/graphlib.js +4194 -0
  55. package/dist/chunks/info-A6RAGUB7.js +4 -0
  56. package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
  57. package/dist/chunks/init.js +14 -0
  58. package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
  59. package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
  60. package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
  61. package/dist/chunks/katex.js +26463 -0
  62. package/dist/chunks/line.js +48 -0
  63. package/dist/chunks/linear.js +391 -0
  64. package/dist/chunks/mermaid-parser.core.js +754 -0
  65. package/dist/chunks/mermaid.core.js +4898 -0
  66. package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
  67. package/dist/chunks/ordinal.js +84 -0
  68. package/dist/chunks/packet-AYTQ26CC.js +4 -0
  69. package/dist/chunks/path.js +106 -0
  70. package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
  71. package/dist/chunks/pie-WAS4IAKB.js +4 -0
  72. package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
  73. package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
  74. package/dist/chunks/radar-RG4KPBEZ.js +4 -0
  75. package/dist/chunks/railroad-74A4TZTK.js +4 -0
  76. package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
  77. package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
  78. package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
  79. package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
  80. package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
  81. package/dist/chunks/rough.esm.js +1396 -0
  82. package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
  83. package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
  84. package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
  85. package/dist/chunks/src.js +2653 -0
  86. package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
  87. package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
  88. package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
  89. package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
  90. package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
  91. package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
  92. package/dist/chunks/treemap-WGGIJYW6.js +4 -0
  93. package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
  94. package/dist/chunks/wardley-WFR3VGLG.js +4 -0
  95. package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
  96. package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
  97. package/dist/components.js +2 -2
  98. package/dist/entry-client.js +1 -1
  99. package/dist/entry-server.js +1 -1
  100. package/docs.schema.json +1 -1
  101. package/package.json +2 -1
  102. package/scripts/expand-navigation-globs.mjs +77 -8
  103. package/src/components/CodeBlock.tsx +36 -0
  104. package/src/components/Docs.tsx +44 -21
  105. package/src/components/OpenApiOperation.tsx +28 -20
  106. package/src/components/SideNav.tsx +8 -3
  107. package/src/components/docs/Changelog.tsx +163 -0
  108. package/src/components/docs/Mermaid.tsx +164 -0
  109. package/src/components/docs/Panel.tsx +23 -0
  110. package/src/components/docs/ParamField.tsx +17 -5
  111. package/src/components/docs/PropertiesTable.tsx +2 -2
  112. package/src/components/docs/ResponseField.tsx +17 -5
  113. package/src/components/docs/Tiles.tsx +59 -0
  114. package/src/components/docs/Tree.tsx +359 -0
  115. package/src/components/docs/Update.tsx +72 -0
  116. package/src/components/docs/index.ts +7 -0
  117. package/src/components/docs/panel-context.tsx +25 -0
  118. package/src/components/docs/styles.ts +49 -0
  119. package/src/components/icons/index.ts +4 -0
  120. package/src/lib/rehype-shiki.ts +18 -1
  121. package/types/components.d.ts +79 -0
@@ -0,0 +1,1226 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY.js";
2
+ import { p as select_default } from "./src.js";
3
+ import { H as setAccDescription, K as setDiagramTitle, U as setAccTitle, a as clear, c as configureSvgSize, v as getAccDescription, w as getDiagramTitle, x as getConfig2, y as getAccTitle } from "./chunk-DU6HZSFF.js";
4
+ import { t as arc_default } from "./arc.js";
5
+ import { t as getIconStyles } from "./chunk-5VM5RSS4.js";
6
+ import { a as drawRect, n as drawBackgroundRect, o as drawText, s as getNoteRect } from "./chunk-F27PBJKO.js";
7
+
8
+ //#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-3NMN7TZE.mjs
9
+ var parser = (function() {
10
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
11
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
12
+ return o2;
13
+ }, "o"), $V0 = [
14
+ 6,
15
+ 8,
16
+ 10,
17
+ 11,
18
+ 12,
19
+ 14,
20
+ 16,
21
+ 17,
22
+ 18
23
+ ], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 14];
24
+ var parser2 = {
25
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
26
+ yy: {},
27
+ symbols_: {
28
+ "error": 2,
29
+ "start": 3,
30
+ "journey": 4,
31
+ "document": 5,
32
+ "EOF": 6,
33
+ "line": 7,
34
+ "SPACE": 8,
35
+ "statement": 9,
36
+ "NEWLINE": 10,
37
+ "title": 11,
38
+ "acc_title": 12,
39
+ "acc_title_value": 13,
40
+ "acc_descr": 14,
41
+ "acc_descr_value": 15,
42
+ "acc_descr_multiline_value": 16,
43
+ "section": 17,
44
+ "taskName": 18,
45
+ "taskData": 19,
46
+ "$accept": 0,
47
+ "$end": 1
48
+ },
49
+ terminals_: {
50
+ 2: "error",
51
+ 4: "journey",
52
+ 6: "EOF",
53
+ 8: "SPACE",
54
+ 10: "NEWLINE",
55
+ 11: "title",
56
+ 12: "acc_title",
57
+ 13: "acc_title_value",
58
+ 14: "acc_descr",
59
+ 15: "acc_descr_value",
60
+ 16: "acc_descr_multiline_value",
61
+ 17: "section",
62
+ 18: "taskName",
63
+ 19: "taskData"
64
+ },
65
+ productions_: [
66
+ 0,
67
+ [3, 3],
68
+ [5, 0],
69
+ [5, 2],
70
+ [7, 2],
71
+ [7, 1],
72
+ [7, 1],
73
+ [7, 1],
74
+ [9, 1],
75
+ [9, 2],
76
+ [9, 2],
77
+ [9, 1],
78
+ [9, 1],
79
+ [9, 2]
80
+ ],
81
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
82
+ var $0 = $$.length - 1;
83
+ switch (yystate) {
84
+ case 1: return $$[$0 - 1];
85
+ case 2:
86
+ this.$ = [];
87
+ break;
88
+ case 3:
89
+ $$[$0 - 1].push($$[$0]);
90
+ this.$ = $$[$0 - 1];
91
+ break;
92
+ case 4:
93
+ case 5:
94
+ this.$ = $$[$0];
95
+ break;
96
+ case 6:
97
+ case 7:
98
+ this.$ = [];
99
+ break;
100
+ case 8:
101
+ yy.setDiagramTitle($$[$0].substr(6));
102
+ this.$ = $$[$0].substr(6);
103
+ break;
104
+ case 9:
105
+ this.$ = $$[$0].trim();
106
+ yy.setAccTitle(this.$);
107
+ break;
108
+ case 10:
109
+ case 11:
110
+ this.$ = $$[$0].trim();
111
+ yy.setAccDescription(this.$);
112
+ break;
113
+ case 12:
114
+ yy.addSection($$[$0].substr(8));
115
+ this.$ = $$[$0].substr(8);
116
+ break;
117
+ case 13:
118
+ yy.addTask($$[$0 - 1], $$[$0]);
119
+ this.$ = "task";
120
+ }
121
+ }, "anonymous"),
122
+ table: [
123
+ {
124
+ 3: 1,
125
+ 4: [1, 2]
126
+ },
127
+ { 1: [3] },
128
+ o($V0, [2, 2], { 5: 3 }),
129
+ {
130
+ 6: [1, 4],
131
+ 7: 5,
132
+ 8: [1, 6],
133
+ 9: 7,
134
+ 10: [1, 8],
135
+ 11: $V1,
136
+ 12: $V2,
137
+ 14: $V3,
138
+ 16: $V4,
139
+ 17: $V5,
140
+ 18: $V6
141
+ },
142
+ o($V0, [2, 7], { 1: [2, 1] }),
143
+ o($V0, [2, 3]),
144
+ {
145
+ 9: 15,
146
+ 11: $V1,
147
+ 12: $V2,
148
+ 14: $V3,
149
+ 16: $V4,
150
+ 17: $V5,
151
+ 18: $V6
152
+ },
153
+ o($V0, [2, 5]),
154
+ o($V0, [2, 6]),
155
+ o($V0, [2, 8]),
156
+ { 13: [1, 16] },
157
+ { 15: [1, 17] },
158
+ o($V0, [2, 11]),
159
+ o($V0, [2, 12]),
160
+ { 19: [1, 18] },
161
+ o($V0, [2, 4]),
162
+ o($V0, [2, 9]),
163
+ o($V0, [2, 10]),
164
+ o($V0, [2, 13])
165
+ ],
166
+ defaultActions: {},
167
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
168
+ if (hash.recoverable) this.trace(str);
169
+ else {
170
+ var error = new Error(str);
171
+ error.hash = hash;
172
+ throw error;
173
+ }
174
+ }, "parseError"),
175
+ parse: /* @__PURE__ */ __name(function parse(input) {
176
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
177
+ var args = lstack.slice.call(arguments, 1);
178
+ var lexer2 = Object.create(this.lexer);
179
+ var sharedState = { yy: {} };
180
+ for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
181
+ lexer2.setInput(input, sharedState.yy);
182
+ sharedState.yy.lexer = lexer2;
183
+ sharedState.yy.parser = this;
184
+ if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
185
+ var yyloc = lexer2.yylloc;
186
+ lstack.push(yyloc);
187
+ var ranges = lexer2.options && lexer2.options.ranges;
188
+ if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
189
+ else this.parseError = Object.getPrototypeOf(this).parseError;
190
+ function popStack(n) {
191
+ stack.length = stack.length - 2 * n;
192
+ vstack.length = vstack.length - n;
193
+ lstack.length = lstack.length - n;
194
+ }
195
+ __name(popStack, "popStack");
196
+ function lex() {
197
+ var token = tstack.pop() || lexer2.lex() || EOF;
198
+ if (typeof token !== "number") {
199
+ if (token instanceof Array) {
200
+ tstack = token;
201
+ token = tstack.pop();
202
+ }
203
+ token = self.symbols_[token] || token;
204
+ }
205
+ return token;
206
+ }
207
+ __name(lex, "lex");
208
+ var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
209
+ while (true) {
210
+ state = stack[stack.length - 1];
211
+ if (this.defaultActions[state]) action = this.defaultActions[state];
212
+ else {
213
+ if (symbol === null || typeof symbol == "undefined") symbol = lex();
214
+ action = table[state] && table[state][symbol];
215
+ }
216
+ if (typeof action === "undefined" || !action.length || !action[0]) {
217
+ var errStr = "";
218
+ expected = [];
219
+ for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
220
+ if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
221
+ else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
222
+ this.parseError(errStr, {
223
+ text: lexer2.match,
224
+ token: this.terminals_[symbol] || symbol,
225
+ line: lexer2.yylineno,
226
+ loc: yyloc,
227
+ expected
228
+ });
229
+ }
230
+ if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
231
+ switch (action[0]) {
232
+ case 1:
233
+ stack.push(symbol);
234
+ vstack.push(lexer2.yytext);
235
+ lstack.push(lexer2.yylloc);
236
+ stack.push(action[1]);
237
+ symbol = null;
238
+ if (!preErrorSymbol) {
239
+ yyleng = lexer2.yyleng;
240
+ yytext = lexer2.yytext;
241
+ yylineno = lexer2.yylineno;
242
+ yyloc = lexer2.yylloc;
243
+ if (recovering > 0) recovering--;
244
+ } else {
245
+ symbol = preErrorSymbol;
246
+ preErrorSymbol = null;
247
+ }
248
+ break;
249
+ case 2:
250
+ len = this.productions_[action[1]][1];
251
+ yyval.$ = vstack[vstack.length - len];
252
+ yyval._$ = {
253
+ first_line: lstack[lstack.length - (len || 1)].first_line,
254
+ last_line: lstack[lstack.length - 1].last_line,
255
+ first_column: lstack[lstack.length - (len || 1)].first_column,
256
+ last_column: lstack[lstack.length - 1].last_column
257
+ };
258
+ if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
259
+ r = this.performAction.apply(yyval, [
260
+ yytext,
261
+ yyleng,
262
+ yylineno,
263
+ sharedState.yy,
264
+ action[1],
265
+ vstack,
266
+ lstack
267
+ ].concat(args));
268
+ if (typeof r !== "undefined") return r;
269
+ if (len) {
270
+ stack = stack.slice(0, -1 * len * 2);
271
+ vstack = vstack.slice(0, -1 * len);
272
+ lstack = lstack.slice(0, -1 * len);
273
+ }
274
+ stack.push(this.productions_[action[1]][0]);
275
+ vstack.push(yyval.$);
276
+ lstack.push(yyval._$);
277
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
278
+ stack.push(newState);
279
+ break;
280
+ case 3: return true;
281
+ }
282
+ }
283
+ return true;
284
+ }, "parse")
285
+ };
286
+ parser2.lexer = /* @__PURE__ */ (function() {
287
+ return {
288
+ EOF: 1,
289
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
290
+ if (this.yy.parser) this.yy.parser.parseError(str, hash);
291
+ else throw new Error(str);
292
+ }, "parseError"),
293
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
294
+ this.yy = yy || this.yy || {};
295
+ this._input = input;
296
+ this._more = this._backtrack = this.done = false;
297
+ this.yylineno = this.yyleng = 0;
298
+ this.yytext = this.matched = this.match = "";
299
+ this.conditionStack = ["INITIAL"];
300
+ this.yylloc = {
301
+ first_line: 1,
302
+ first_column: 0,
303
+ last_line: 1,
304
+ last_column: 0
305
+ };
306
+ if (this.options.ranges) this.yylloc.range = [0, 0];
307
+ this.offset = 0;
308
+ return this;
309
+ }, "setInput"),
310
+ input: /* @__PURE__ */ __name(function() {
311
+ var ch = this._input[0];
312
+ this.yytext += ch;
313
+ this.yyleng++;
314
+ this.offset++;
315
+ this.match += ch;
316
+ this.matched += ch;
317
+ if (ch.match(/(?:\r\n?|\n).*/g)) {
318
+ this.yylineno++;
319
+ this.yylloc.last_line++;
320
+ } else this.yylloc.last_column++;
321
+ if (this.options.ranges) this.yylloc.range[1]++;
322
+ this._input = this._input.slice(1);
323
+ return ch;
324
+ }, "input"),
325
+ unput: /* @__PURE__ */ __name(function(ch) {
326
+ var len = ch.length;
327
+ var lines = ch.split(/(?:\r\n?|\n)/g);
328
+ this._input = ch + this._input;
329
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
330
+ this.offset -= len;
331
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
332
+ this.match = this.match.substr(0, this.match.length - 1);
333
+ this.matched = this.matched.substr(0, this.matched.length - 1);
334
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
335
+ var r = this.yylloc.range;
336
+ this.yylloc = {
337
+ first_line: this.yylloc.first_line,
338
+ last_line: this.yylineno + 1,
339
+ first_column: this.yylloc.first_column,
340
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
341
+ };
342
+ if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
343
+ this.yyleng = this.yytext.length;
344
+ return this;
345
+ }, "unput"),
346
+ more: /* @__PURE__ */ __name(function() {
347
+ this._more = true;
348
+ return this;
349
+ }, "more"),
350
+ reject: /* @__PURE__ */ __name(function() {
351
+ if (this.options.backtrack_lexer) this._backtrack = true;
352
+ else 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).\n" + this.showPosition(), {
353
+ text: "",
354
+ token: null,
355
+ line: this.yylineno
356
+ });
357
+ return this;
358
+ }, "reject"),
359
+ less: /* @__PURE__ */ __name(function(n) {
360
+ this.unput(this.match.slice(n));
361
+ }, "less"),
362
+ pastInput: /* @__PURE__ */ __name(function() {
363
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
364
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
365
+ }, "pastInput"),
366
+ upcomingInput: /* @__PURE__ */ __name(function() {
367
+ var next = this.match;
368
+ if (next.length < 20) next += this._input.substr(0, 20 - next.length);
369
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
370
+ }, "upcomingInput"),
371
+ showPosition: /* @__PURE__ */ __name(function() {
372
+ var pre = this.pastInput();
373
+ var c = new Array(pre.length + 1).join("-");
374
+ return pre + this.upcomingInput() + "\n" + c + "^";
375
+ }, "showPosition"),
376
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
377
+ var token, lines, backup;
378
+ if (this.options.backtrack_lexer) {
379
+ backup = {
380
+ yylineno: this.yylineno,
381
+ yylloc: {
382
+ first_line: this.yylloc.first_line,
383
+ last_line: this.last_line,
384
+ first_column: this.yylloc.first_column,
385
+ last_column: this.yylloc.last_column
386
+ },
387
+ yytext: this.yytext,
388
+ match: this.match,
389
+ matches: this.matches,
390
+ matched: this.matched,
391
+ yyleng: this.yyleng,
392
+ offset: this.offset,
393
+ _more: this._more,
394
+ _input: this._input,
395
+ yy: this.yy,
396
+ conditionStack: this.conditionStack.slice(0),
397
+ done: this.done
398
+ };
399
+ if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
400
+ }
401
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
402
+ if (lines) this.yylineno += lines.length;
403
+ this.yylloc = {
404
+ first_line: this.yylloc.last_line,
405
+ last_line: this.yylineno + 1,
406
+ first_column: this.yylloc.last_column,
407
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
408
+ };
409
+ this.yytext += match[0];
410
+ this.match += match[0];
411
+ this.matches = match;
412
+ this.yyleng = this.yytext.length;
413
+ if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
414
+ this._more = false;
415
+ this._backtrack = false;
416
+ this._input = this._input.slice(match[0].length);
417
+ this.matched += match[0];
418
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
419
+ if (this.done && this._input) this.done = false;
420
+ if (token) return token;
421
+ else if (this._backtrack) {
422
+ for (var k in backup) this[k] = backup[k];
423
+ return false;
424
+ }
425
+ return false;
426
+ }, "test_match"),
427
+ next: /* @__PURE__ */ __name(function() {
428
+ if (this.done) return this.EOF;
429
+ if (!this._input) this.done = true;
430
+ var token, match, tempMatch, index;
431
+ if (!this._more) {
432
+ this.yytext = "";
433
+ this.match = "";
434
+ }
435
+ var rules = this._currentRules();
436
+ for (var i = 0; i < rules.length; i++) {
437
+ tempMatch = this._input.match(this.rules[rules[i]]);
438
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
439
+ match = tempMatch;
440
+ index = i;
441
+ if (this.options.backtrack_lexer) {
442
+ token = this.test_match(tempMatch, rules[i]);
443
+ if (token !== false) return token;
444
+ else if (this._backtrack) {
445
+ match = false;
446
+ continue;
447
+ } else return false;
448
+ } else if (!this.options.flex) break;
449
+ }
450
+ }
451
+ if (match) {
452
+ token = this.test_match(match, rules[index]);
453
+ if (token !== false) return token;
454
+ return false;
455
+ }
456
+ if (this._input === "") return this.EOF;
457
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
458
+ text: "",
459
+ token: null,
460
+ line: this.yylineno
461
+ });
462
+ }, "next"),
463
+ lex: /* @__PURE__ */ __name(function lex() {
464
+ var r = this.next();
465
+ if (r) return r;
466
+ else return this.lex();
467
+ }, "lex"),
468
+ begin: /* @__PURE__ */ __name(function begin(condition) {
469
+ this.conditionStack.push(condition);
470
+ }, "begin"),
471
+ popState: /* @__PURE__ */ __name(function popState() {
472
+ if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
473
+ else return this.conditionStack[0];
474
+ }, "popState"),
475
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
476
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
477
+ else return this.conditions["INITIAL"].rules;
478
+ }, "_currentRules"),
479
+ topState: /* @__PURE__ */ __name(function topState(n) {
480
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
481
+ if (n >= 0) return this.conditionStack[n];
482
+ else return "INITIAL";
483
+ }, "topState"),
484
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
485
+ this.begin(condition);
486
+ }, "pushState"),
487
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
488
+ return this.conditionStack.length;
489
+ }, "stateStackSize"),
490
+ options: { "case-insensitive": true },
491
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
492
+ switch ($avoiding_name_collisions) {
493
+ case 0: break;
494
+ case 1: break;
495
+ case 2: return 10;
496
+ case 3: break;
497
+ case 4: break;
498
+ case 5: return 4;
499
+ case 6: return 11;
500
+ case 7:
501
+ this.begin("acc_title");
502
+ return 12;
503
+ case 8:
504
+ this.popState();
505
+ return "acc_title_value";
506
+ case 9:
507
+ this.begin("acc_descr");
508
+ return 14;
509
+ case 10:
510
+ this.popState();
511
+ return "acc_descr_value";
512
+ case 11:
513
+ this.begin("acc_descr_multiline");
514
+ break;
515
+ case 12:
516
+ this.popState();
517
+ break;
518
+ case 13: return "acc_descr_multiline_value";
519
+ case 14: return 17;
520
+ case 15: return 18;
521
+ case 16: return 19;
522
+ case 17: return ":";
523
+ case 18: return 6;
524
+ case 19: return "INVALID";
525
+ }
526
+ }, "anonymous"),
527
+ rules: [
528
+ /^(?:%(?!\{)[^\n]*)/i,
529
+ /^(?:[^\}]%%[^\n]*)/i,
530
+ /^(?:[\n]+)/i,
531
+ /^(?:\s+)/i,
532
+ /^(?:#[^\n]*)/i,
533
+ /^(?:journey\b)/i,
534
+ /^(?:title\s[^#\n;]+)/i,
535
+ /^(?:accTitle\s*:\s*)/i,
536
+ /^(?:(?!\n||)*[^\n]*)/i,
537
+ /^(?:accDescr\s*:\s*)/i,
538
+ /^(?:(?!\n||)*[^\n]*)/i,
539
+ /^(?:accDescr\s*\{\s*)/i,
540
+ /^(?:[\}])/i,
541
+ /^(?:[^\}]*)/i,
542
+ /^(?:section\s[^#:\n;]+)/i,
543
+ /^(?:[^#:\n;]+)/i,
544
+ /^(?::[^#\n;]+)/i,
545
+ /^(?::)/i,
546
+ /^(?:$)/i,
547
+ /^(?:.)/i
548
+ ],
549
+ conditions: {
550
+ "acc_descr_multiline": {
551
+ "rules": [12, 13],
552
+ "inclusive": false
553
+ },
554
+ "acc_descr": {
555
+ "rules": [10],
556
+ "inclusive": false
557
+ },
558
+ "acc_title": {
559
+ "rules": [8],
560
+ "inclusive": false
561
+ },
562
+ "INITIAL": {
563
+ "rules": [
564
+ 0,
565
+ 1,
566
+ 2,
567
+ 3,
568
+ 4,
569
+ 5,
570
+ 6,
571
+ 7,
572
+ 9,
573
+ 11,
574
+ 14,
575
+ 15,
576
+ 16,
577
+ 17,
578
+ 18,
579
+ 19
580
+ ],
581
+ "inclusive": true
582
+ }
583
+ }
584
+ };
585
+ })();
586
+ function Parser() {
587
+ this.yy = {};
588
+ }
589
+ __name(Parser, "Parser");
590
+ Parser.prototype = parser2;
591
+ parser2.Parser = Parser;
592
+ return new Parser();
593
+ })();
594
+ parser.parser = parser;
595
+ var journey_default = parser;
596
+ var currentSection = "";
597
+ var sections = [];
598
+ var tasks = [];
599
+ var rawTasks = [];
600
+ var clear2 = /* @__PURE__ */ __name(function() {
601
+ sections.length = 0;
602
+ tasks.length = 0;
603
+ currentSection = "";
604
+ rawTasks.length = 0;
605
+ clear();
606
+ }, "clear");
607
+ var addSection = /* @__PURE__ */ __name(function(txt) {
608
+ currentSection = txt;
609
+ sections.push(txt);
610
+ }, "addSection");
611
+ var getSections = /* @__PURE__ */ __name(function() {
612
+ return sections;
613
+ }, "getSections");
614
+ var getTasks = /* @__PURE__ */ __name(function() {
615
+ let allItemsProcessed = compileTasks();
616
+ const maxDepth = 100;
617
+ let iterationCount = 0;
618
+ while (!allItemsProcessed && iterationCount < maxDepth) {
619
+ allItemsProcessed = compileTasks();
620
+ iterationCount++;
621
+ }
622
+ tasks.push(...rawTasks);
623
+ return tasks;
624
+ }, "getTasks");
625
+ var updateActors = /* @__PURE__ */ __name(function() {
626
+ const tempActors = [];
627
+ tasks.forEach((task) => {
628
+ if (task.people) tempActors.push(...task.people);
629
+ });
630
+ return [...new Set(tempActors)].sort();
631
+ }, "updateActors");
632
+ var addTask = /* @__PURE__ */ __name(function(descr, taskData) {
633
+ const pieces = taskData.substr(1).split(":");
634
+ let score = 0;
635
+ let peeps = [];
636
+ if (pieces.length === 1) {
637
+ score = Number(pieces[0]);
638
+ peeps = [];
639
+ } else {
640
+ score = Number(pieces[0]);
641
+ peeps = pieces[1].split(",");
642
+ }
643
+ const peopleList = peeps.map((s) => s.trim());
644
+ const rawTask = {
645
+ section: currentSection,
646
+ type: currentSection,
647
+ people: peopleList,
648
+ task: descr,
649
+ score
650
+ };
651
+ rawTasks.push(rawTask);
652
+ }, "addTask");
653
+ var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
654
+ const newTask = {
655
+ section: currentSection,
656
+ type: currentSection,
657
+ description: descr,
658
+ task: descr,
659
+ classes: []
660
+ };
661
+ tasks.push(newTask);
662
+ }, "addTaskOrg");
663
+ var compileTasks = /* @__PURE__ */ __name(function() {
664
+ const compileTask = /* @__PURE__ */ __name(function(pos) {
665
+ return rawTasks[pos].processed;
666
+ }, "compileTask");
667
+ let allProcessed = true;
668
+ for (const [i, rawTask] of rawTasks.entries()) {
669
+ compileTask(i);
670
+ allProcessed = allProcessed && rawTask.processed;
671
+ }
672
+ return allProcessed;
673
+ }, "compileTasks");
674
+ var journeyDb_default = {
675
+ getConfig: /* @__PURE__ */ __name(() => getConfig2().journey, "getConfig"),
676
+ clear: clear2,
677
+ setDiagramTitle,
678
+ getDiagramTitle,
679
+ setAccTitle,
680
+ getAccTitle,
681
+ setAccDescription,
682
+ getAccDescription,
683
+ addSection,
684
+ getSections,
685
+ getTasks,
686
+ addTask,
687
+ addTaskOrg,
688
+ getActors: /* @__PURE__ */ __name(function() {
689
+ return updateActors();
690
+ }, "getActors")
691
+ };
692
+ var styles_default = /* @__PURE__ */ __name((options) => `.label {
693
+ font-family: ${options.fontFamily};
694
+ color: ${options.textColor};
695
+ }
696
+ .mouth {
697
+ stroke: #666;
698
+ }
699
+
700
+ line {
701
+ stroke: ${options.textColor}
702
+ }
703
+
704
+ .legend {
705
+ fill: ${options.textColor};
706
+ font-family: ${options.fontFamily};
707
+ }
708
+
709
+ .label text {
710
+ fill: #333;
711
+ }
712
+ .label {
713
+ color: ${options.textColor}
714
+ }
715
+
716
+ .face {
717
+ ${options.faceColor ? `fill: ${options.faceColor}` : "fill: #FFF8DC"};
718
+ stroke: #999;
719
+ }
720
+
721
+ .node rect,
722
+ .node circle,
723
+ .node ellipse,
724
+ .node polygon,
725
+ .node path {
726
+ fill: ${options.mainBkg};
727
+ stroke: ${options.nodeBorder};
728
+ stroke-width: 1px;
729
+ }
730
+
731
+ .node .label {
732
+ text-align: center;
733
+ }
734
+ .node.clickable {
735
+ cursor: pointer;
736
+ }
737
+
738
+ .arrowheadPath {
739
+ fill: ${options.arrowheadColor};
740
+ }
741
+
742
+ .edgePaths .path {
743
+ stroke: ${options.lineColor};
744
+ stroke-width: 1.5px;
745
+ }
746
+
747
+ .flowchart-link {
748
+ stroke: ${options.lineColor};
749
+ fill: none;
750
+ }
751
+
752
+ .edgeLabel {
753
+ background-color: ${options.edgeLabelBackground};
754
+ rect {
755
+ opacity: 0.5;
756
+ }
757
+ text-align: center;
758
+ }
759
+
760
+ .cluster rect {
761
+ }
762
+
763
+ .cluster text {
764
+ fill: ${options.titleColor};
765
+ }
766
+
767
+ div.mermaidTooltip {
768
+ position: absolute;
769
+ text-align: center;
770
+ max-width: 200px;
771
+ padding: 2px;
772
+ font-family: ${options.fontFamily};
773
+ font-size: 12px;
774
+ background: ${options.tertiaryColor};
775
+ border: 1px solid ${options.border2};
776
+ border-radius: 2px;
777
+ pointer-events: none;
778
+ z-index: 100;
779
+ }
780
+
781
+ .task-type-0, .section-type-0 {
782
+ ${options.fillType0 ? `fill: ${options.fillType0}` : ""};
783
+ }
784
+ .task-type-1, .section-type-1 {
785
+ ${options.fillType0 ? `fill: ${options.fillType1}` : ""};
786
+ }
787
+ .task-type-2, .section-type-2 {
788
+ ${options.fillType0 ? `fill: ${options.fillType2}` : ""};
789
+ }
790
+ .task-type-3, .section-type-3 {
791
+ ${options.fillType0 ? `fill: ${options.fillType3}` : ""};
792
+ }
793
+ .task-type-4, .section-type-4 {
794
+ ${options.fillType0 ? `fill: ${options.fillType4}` : ""};
795
+ }
796
+ .task-type-5, .section-type-5 {
797
+ ${options.fillType0 ? `fill: ${options.fillType5}` : ""};
798
+ }
799
+ .task-type-6, .section-type-6 {
800
+ ${options.fillType0 ? `fill: ${options.fillType6}` : ""};
801
+ }
802
+ .task-type-7, .section-type-7 {
803
+ ${options.fillType0 ? `fill: ${options.fillType7}` : ""};
804
+ }
805
+
806
+ .actor-0 {
807
+ ${options.actor0 ? `fill: ${options.actor0}` : ""};
808
+ }
809
+ .actor-1 {
810
+ ${options.actor1 ? `fill: ${options.actor1}` : ""};
811
+ }
812
+ .actor-2 {
813
+ ${options.actor2 ? `fill: ${options.actor2}` : ""};
814
+ }
815
+ .actor-3 {
816
+ ${options.actor3 ? `fill: ${options.actor3}` : ""};
817
+ }
818
+ .actor-4 {
819
+ ${options.actor4 ? `fill: ${options.actor4}` : ""};
820
+ }
821
+ .actor-5 {
822
+ ${options.actor5 ? `fill: ${options.actor5}` : ""};
823
+ }
824
+ ${getIconStyles()}
825
+ `, "getStyles");
826
+ var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
827
+ return drawRect(elem, rectData);
828
+ }, "drawRect");
829
+ var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
830
+ const radius = 15;
831
+ const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
832
+ const face = element.append("g");
833
+ face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
834
+ face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
835
+ function smile(face2) {
836
+ const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
837
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
838
+ }
839
+ __name(smile, "smile");
840
+ function sad(face2) {
841
+ const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
842
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
843
+ }
844
+ __name(sad, "sad");
845
+ function ambivalent(face2) {
846
+ face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
847
+ }
848
+ __name(ambivalent, "ambivalent");
849
+ if (faceData.score > 3) smile(face);
850
+ else if (faceData.score < 3) sad(face);
851
+ else ambivalent(face);
852
+ return circleElement;
853
+ }, "drawFace");
854
+ var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
855
+ const circleElement = element.append("circle");
856
+ circleElement.attr("cx", circleData.cx);
857
+ circleElement.attr("cy", circleData.cy);
858
+ circleElement.attr("class", "actor-" + circleData.pos);
859
+ circleElement.attr("fill", circleData.fill);
860
+ circleElement.attr("stroke", circleData.stroke);
861
+ circleElement.attr("r", circleData.r);
862
+ if (circleElement.class !== void 0) circleElement.attr("class", circleElement.class);
863
+ if (circleData.title !== void 0) circleElement.append("title").text(circleData.title);
864
+ return circleElement;
865
+ }, "drawCircle");
866
+ var drawText2 = /* @__PURE__ */ __name(function(elem, textData) {
867
+ return drawText(elem, textData);
868
+ }, "drawText");
869
+ var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
870
+ function genPoints(x, y, width, height, cut) {
871
+ return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
872
+ }
873
+ __name(genPoints, "genPoints");
874
+ const polygon = elem.append("polygon");
875
+ polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
876
+ polygon.attr("class", "labelBox");
877
+ txtObject.y = txtObject.y + txtObject.labelMargin;
878
+ txtObject.x = txtObject.x + .5 * txtObject.labelMargin;
879
+ drawText2(elem, txtObject);
880
+ }, "drawLabel");
881
+ var drawSection = /* @__PURE__ */ __name(function(elem, section, conf2) {
882
+ const g = elem.append("g");
883
+ const rect = getNoteRect();
884
+ rect.x = section.x;
885
+ rect.y = section.y;
886
+ rect.fill = section.fill;
887
+ rect.width = conf2.width * section.taskCount + conf2.diagramMarginX * (section.taskCount - 1);
888
+ rect.height = conf2.height;
889
+ rect.class = "journey-section section-type-" + section.num;
890
+ rect.rx = 3;
891
+ rect.ry = 3;
892
+ drawRect2(g, rect);
893
+ _drawTextCandidateFunc(conf2)(section.text, g, rect.x, rect.y, rect.width, rect.height, { class: "journey-section section-type-" + section.num }, conf2, section.colour);
894
+ }, "drawSection");
895
+ var taskCount = -1;
896
+ var drawTask = /* @__PURE__ */ __name(function(elem, task, conf2, diagramId) {
897
+ const center = task.x + conf2.width / 2;
898
+ const g = elem.append("g");
899
+ taskCount++;
900
+ g.append("line").attr("id", diagramId + "-task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
901
+ drawFace(g, {
902
+ cx: center,
903
+ cy: 300 + (5 - task.score) * 30,
904
+ score: task.score
905
+ });
906
+ const rect = getNoteRect();
907
+ rect.x = task.x;
908
+ rect.y = task.y;
909
+ rect.fill = task.fill;
910
+ rect.width = conf2.width;
911
+ rect.height = conf2.height;
912
+ rect.class = "task task-type-" + task.num;
913
+ rect.rx = 3;
914
+ rect.ry = 3;
915
+ drawRect2(g, rect);
916
+ let xPos = task.x + 14;
917
+ task.people.forEach((person) => {
918
+ const colour = task.actors[person].color;
919
+ const circle = {
920
+ cx: xPos,
921
+ cy: task.y,
922
+ r: 7,
923
+ fill: colour,
924
+ stroke: "#000",
925
+ title: person,
926
+ pos: task.actors[person].position
927
+ };
928
+ drawCircle(g, circle);
929
+ xPos += 10;
930
+ });
931
+ _drawTextCandidateFunc(conf2)(task.task, g, rect.x, rect.y, rect.width, rect.height, { class: "task" }, conf2, task.colour);
932
+ }, "drawTask");
933
+ var drawBackgroundRect2 = /* @__PURE__ */ __name(function(elem, bounds2) {
934
+ drawBackgroundRect(elem, bounds2);
935
+ }, "drawBackgroundRect");
936
+ var _drawTextCandidateFunc = /* @__PURE__ */ (function() {
937
+ function byText(content, g, x, y, width, height, textAttrs, colour) {
938
+ _setTextAttrs(g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content), textAttrs);
939
+ }
940
+ __name(byText, "byText");
941
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2, colour) {
942
+ const { taskFontSize, taskFontFamily } = conf2;
943
+ const lines = content.split(/<br\s*\/?>/gi);
944
+ for (let i = 0; i < lines.length; i++) {
945
+ const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
946
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
947
+ text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
948
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
949
+ _setTextAttrs(text, textAttrs);
950
+ }
951
+ }
952
+ __name(byTspan, "byTspan");
953
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
954
+ const body = g.append("switch");
955
+ const text = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
956
+ text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
957
+ byTspan(content, body, x, y, width, height, textAttrs, conf2);
958
+ _setTextAttrs(text, textAttrs);
959
+ }
960
+ __name(byFo, "byFo");
961
+ function _setTextAttrs(toText, fromTextAttrsDict) {
962
+ for (const key in fromTextAttrsDict) if (key in fromTextAttrsDict) toText.attr(key, fromTextAttrsDict[key]);
963
+ }
964
+ __name(_setTextAttrs, "_setTextAttrs");
965
+ return function(conf2) {
966
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
967
+ };
968
+ })();
969
+ var svgDraw_default = {
970
+ drawRect: drawRect2,
971
+ drawCircle,
972
+ drawSection,
973
+ drawText: drawText2,
974
+ drawLabel,
975
+ drawTask,
976
+ drawBackgroundRect: drawBackgroundRect2,
977
+ initGraphics: /* @__PURE__ */ __name(function(graphics, id) {
978
+ taskCount = -1;
979
+ graphics.append("defs").append("marker").attr("id", 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");
980
+ }, "initGraphics")
981
+ };
982
+ var setConf = /* @__PURE__ */ __name(function(cnf) {
983
+ Object.keys(cnf).forEach(function(key) {
984
+ conf[key] = cnf[key];
985
+ });
986
+ }, "setConf");
987
+ var actors = {};
988
+ var maxWidth = 0;
989
+ function drawActorLegend(diagram2) {
990
+ const conf2 = getConfig2().journey;
991
+ const maxLabelWidth = conf2.maxLabelWidth;
992
+ maxWidth = 0;
993
+ let yPos = 60;
994
+ Object.keys(actors).forEach((person) => {
995
+ const colour = actors[person].color;
996
+ const circleData = {
997
+ cx: 20,
998
+ cy: yPos,
999
+ r: 7,
1000
+ fill: colour,
1001
+ stroke: "#000",
1002
+ pos: actors[person].position
1003
+ };
1004
+ svgDraw_default.drawCircle(diagram2, circleData);
1005
+ let measureText = diagram2.append("text").attr("visibility", "hidden").text(person);
1006
+ const fullTextWidth = measureText.node().getBoundingClientRect().width;
1007
+ measureText.remove();
1008
+ let lines = [];
1009
+ if (fullTextWidth <= maxLabelWidth) lines = [person];
1010
+ else {
1011
+ const words = person.split(" ");
1012
+ let currentLine = "";
1013
+ measureText = diagram2.append("text").attr("visibility", "hidden");
1014
+ words.forEach((word) => {
1015
+ const testLine = currentLine ? `${currentLine} ${word}` : word;
1016
+ measureText.text(testLine);
1017
+ if (measureText.node().getBoundingClientRect().width > maxLabelWidth) {
1018
+ if (currentLine) lines.push(currentLine);
1019
+ currentLine = word;
1020
+ measureText.text(word);
1021
+ if (measureText.node().getBoundingClientRect().width > maxLabelWidth) {
1022
+ let brokenWord = "";
1023
+ for (const char of word) {
1024
+ brokenWord += char;
1025
+ measureText.text(brokenWord + "-");
1026
+ if (measureText.node().getBoundingClientRect().width > maxLabelWidth) {
1027
+ lines.push(brokenWord.slice(0, -1) + "-");
1028
+ brokenWord = char;
1029
+ }
1030
+ }
1031
+ currentLine = brokenWord;
1032
+ }
1033
+ } else currentLine = testLine;
1034
+ });
1035
+ if (currentLine) lines.push(currentLine);
1036
+ measureText.remove();
1037
+ }
1038
+ lines.forEach((line, index) => {
1039
+ const labelData = {
1040
+ x: 40,
1041
+ y: yPos + 7 + index * 20,
1042
+ fill: "#666",
1043
+ text: line,
1044
+ textMargin: conf2.boxTextMargin ?? 5
1045
+ };
1046
+ const lineWidth = svgDraw_default.drawText(diagram2, labelData).node().getBoundingClientRect().width;
1047
+ if (lineWidth > maxWidth && lineWidth > conf2.leftMargin - lineWidth) maxWidth = lineWidth;
1048
+ });
1049
+ yPos += Math.max(20, lines.length * 20);
1050
+ });
1051
+ }
1052
+ __name(drawActorLegend, "drawActorLegend");
1053
+ var conf = getConfig2().journey;
1054
+ var leftMargin = 0;
1055
+ var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1056
+ const configObject = getConfig2();
1057
+ const titleColor = configObject.journey.titleColor;
1058
+ const titleFontSize = configObject.journey.titleFontSize;
1059
+ const titleFontFamily = configObject.journey.titleFontFamily;
1060
+ const securityLevel = configObject.securityLevel;
1061
+ let sandboxElement;
1062
+ if (securityLevel === "sandbox") sandboxElement = select_default("#i" + id);
1063
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
1064
+ bounds.init();
1065
+ const diagram2 = root.select("#" + id);
1066
+ svgDraw_default.initGraphics(diagram2, id);
1067
+ const tasks2 = diagObj.db.getTasks();
1068
+ const title = diagObj.db.getDiagramTitle();
1069
+ const actorNames = diagObj.db.getActors();
1070
+ for (const member in actors) delete actors[member];
1071
+ let actorPos = 0;
1072
+ actorNames.forEach((actorName) => {
1073
+ actors[actorName] = {
1074
+ color: conf.actorColours[actorPos % conf.actorColours.length],
1075
+ position: actorPos
1076
+ };
1077
+ actorPos++;
1078
+ });
1079
+ drawActorLegend(diagram2);
1080
+ leftMargin = conf.leftMargin + maxWidth;
1081
+ bounds.insert(0, 0, leftMargin, Object.keys(actors).length * 50);
1082
+ drawTasks(diagram2, tasks2, 0, id);
1083
+ const box = bounds.getBounds();
1084
+ if (title) diagram2.append("text").text(title).attr("x", leftMargin).attr("font-size", titleFontSize).attr("font-weight", "bold").attr("y", 25).attr("fill", titleColor).attr("font-family", titleFontFamily);
1085
+ const height = box.stopy - box.starty + 2 * conf.diagramMarginY;
1086
+ const width = leftMargin + box.stopx + 2 * conf.diagramMarginX;
1087
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
1088
+ diagram2.append("line").attr("x1", leftMargin).attr("y1", conf.height * 4).attr("x2", width - leftMargin - 4).attr("y2", conf.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#" + id + "-arrowhead)");
1089
+ const extraVertForTitle = title ? 70 : 0;
1090
+ diagram2.attr("viewBox", `${box.startx} -25 ${width} ${height + extraVertForTitle}`);
1091
+ diagram2.attr("preserveAspectRatio", "xMinYMin meet");
1092
+ diagram2.attr("height", height + extraVertForTitle + 25);
1093
+ }, "draw");
1094
+ var bounds = {
1095
+ data: {
1096
+ startx: void 0,
1097
+ stopx: void 0,
1098
+ starty: void 0,
1099
+ stopy: void 0
1100
+ },
1101
+ verticalPos: 0,
1102
+ sequenceItems: [],
1103
+ init: /* @__PURE__ */ __name(function() {
1104
+ this.sequenceItems = [];
1105
+ this.data = {
1106
+ startx: void 0,
1107
+ stopx: void 0,
1108
+ starty: void 0,
1109
+ stopy: void 0
1110
+ };
1111
+ this.verticalPos = 0;
1112
+ }, "init"),
1113
+ updateVal: /* @__PURE__ */ __name(function(obj, key, val, fun) {
1114
+ if (obj[key] === void 0) obj[key] = val;
1115
+ else obj[key] = fun(val, obj[key]);
1116
+ }, "updateVal"),
1117
+ updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
1118
+ const conf2 = getConfig2().journey;
1119
+ const _self = this;
1120
+ let cnt = 0;
1121
+ function updateFn(type) {
1122
+ return /* @__PURE__ */ __name(function updateItemBounds(item) {
1123
+ cnt++;
1124
+ const n = _self.sequenceItems.length - cnt + 1;
1125
+ _self.updateVal(item, "starty", starty - n * conf2.boxMargin, Math.min);
1126
+ _self.updateVal(item, "stopy", stopy + n * conf2.boxMargin, Math.max);
1127
+ _self.updateVal(bounds.data, "startx", startx - n * conf2.boxMargin, Math.min);
1128
+ _self.updateVal(bounds.data, "stopx", stopx + n * conf2.boxMargin, Math.max);
1129
+ if (!(type === "activation")) {
1130
+ _self.updateVal(item, "startx", startx - n * conf2.boxMargin, Math.min);
1131
+ _self.updateVal(item, "stopx", stopx + n * conf2.boxMargin, Math.max);
1132
+ _self.updateVal(bounds.data, "starty", starty - n * conf2.boxMargin, Math.min);
1133
+ _self.updateVal(bounds.data, "stopy", stopy + n * conf2.boxMargin, Math.max);
1134
+ }
1135
+ }, "updateItemBounds");
1136
+ }
1137
+ __name(updateFn, "updateFn");
1138
+ this.sequenceItems.forEach(updateFn());
1139
+ }, "updateBounds"),
1140
+ insert: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
1141
+ const _startx = Math.min(startx, stopx);
1142
+ const _stopx = Math.max(startx, stopx);
1143
+ const _starty = Math.min(starty, stopy);
1144
+ const _stopy = Math.max(starty, stopy);
1145
+ this.updateVal(bounds.data, "startx", _startx, Math.min);
1146
+ this.updateVal(bounds.data, "starty", _starty, Math.min);
1147
+ this.updateVal(bounds.data, "stopx", _stopx, Math.max);
1148
+ this.updateVal(bounds.data, "stopy", _stopy, Math.max);
1149
+ this.updateBounds(_startx, _starty, _stopx, _stopy);
1150
+ }, "insert"),
1151
+ bumpVerticalPos: /* @__PURE__ */ __name(function(bump) {
1152
+ this.verticalPos = this.verticalPos + bump;
1153
+ this.data.stopy = this.verticalPos;
1154
+ }, "bumpVerticalPos"),
1155
+ getVerticalPos: /* @__PURE__ */ __name(function() {
1156
+ return this.verticalPos;
1157
+ }, "getVerticalPos"),
1158
+ getBounds: /* @__PURE__ */ __name(function() {
1159
+ return this.data;
1160
+ }, "getBounds")
1161
+ };
1162
+ var fills = conf.sectionFills;
1163
+ var textColours = conf.sectionColours;
1164
+ var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, verticalPos, diagramId) {
1165
+ const conf2 = getConfig2().journey;
1166
+ let lastSection = "";
1167
+ const taskPos = verticalPos + (conf2.height * 2 + conf2.diagramMarginY);
1168
+ let sectionNumber = 0;
1169
+ let fill = "#CCC";
1170
+ let colour = "black";
1171
+ let num = 0;
1172
+ for (const [i, task] of tasks2.entries()) {
1173
+ if (lastSection !== task.section) {
1174
+ fill = fills[sectionNumber % fills.length];
1175
+ num = sectionNumber % fills.length;
1176
+ colour = textColours[sectionNumber % textColours.length];
1177
+ let taskInSectionCount = 0;
1178
+ const currentSection2 = task.section;
1179
+ for (let taskIndex = i; taskIndex < tasks2.length; taskIndex++) if (tasks2[taskIndex].section == currentSection2) taskInSectionCount = taskInSectionCount + 1;
1180
+ else break;
1181
+ const section = {
1182
+ x: i * conf2.taskMargin + i * conf2.width + leftMargin,
1183
+ y: 50,
1184
+ text: task.section,
1185
+ fill,
1186
+ num,
1187
+ colour,
1188
+ taskCount: taskInSectionCount
1189
+ };
1190
+ svgDraw_default.drawSection(diagram2, section, conf2);
1191
+ lastSection = task.section;
1192
+ sectionNumber++;
1193
+ }
1194
+ const taskActors = task.people.reduce((acc, actorName) => {
1195
+ if (actors[actorName]) acc[actorName] = actors[actorName];
1196
+ return acc;
1197
+ }, {});
1198
+ task.x = i * conf2.taskMargin + i * conf2.width + leftMargin;
1199
+ task.y = taskPos;
1200
+ task.width = conf2.diagramMarginX;
1201
+ task.height = conf2.diagramMarginY;
1202
+ task.colour = colour;
1203
+ task.fill = fill;
1204
+ task.num = num;
1205
+ task.actors = taskActors;
1206
+ svgDraw_default.drawTask(diagram2, task, conf2, diagramId);
1207
+ bounds.insert(task.x, task.y, task.x + task.width + conf2.taskMargin, 450);
1208
+ }
1209
+ }, "drawTasks");
1210
+ var journeyRenderer_default = {
1211
+ setConf,
1212
+ draw
1213
+ };
1214
+ var diagram = {
1215
+ parser: journey_default,
1216
+ db: journeyDb_default,
1217
+ renderer: journeyRenderer_default,
1218
+ styles: styles_default,
1219
+ init: /* @__PURE__ */ __name((cnf) => {
1220
+ journeyRenderer_default.setConf(cnf.journey);
1221
+ journeyDb_default.clear();
1222
+ }, "init")
1223
+ };
1224
+
1225
+ //#endregion
1226
+ export { diagram };