@8btc/xcanvas 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.
- package/README.md +70 -0
- package/dist/Tableau10-BqnYsPR6.js +9 -0
- package/dist/XCanvas-BxdLBkBz.js +27732 -0
- package/dist/_commonjs-dynamic-modules-TGKdzP3c.js +6 -0
- package/dist/ar-SA-G6X2FPQ2-DjqDLLYL.js +41 -0
- package/dist/arc-D1qX5GFf.js +132 -0
- package/dist/array-DgktLKBx.js +6 -0
- package/dist/az-AZ-76LH7QW2-D7LOsF3_.js +32 -0
- package/dist/bg-BG-XCXSNQG7-WI4tFn23.js +36 -0
- package/dist/blockDiagram-38ab4fdb-DtemKfEh.js +1811 -0
- package/dist/bn-BD-2XOGV67Q-Bugx_8fy.js +36 -0
- package/dist/c4Diagram-3d4e48cf-Byd2vU9K.js +2463 -0
- package/dist/ca-ES-6MX7JW3Y-6rFwKGsQ.js +39 -0
- package/dist/channel-BT_3Ze-Y.js +7 -0
- package/dist/chunk-EIO257PC-C7qD7hGu.js +1641 -0
- package/dist/classDiagram-70f12bd4-CwfYadk-.js +354 -0
- package/dist/classDiagram-v2-f2320105-B28MuM8f.js +284 -0
- package/dist/clone-D2FUK8WY.js +8 -0
- package/dist/createText-2e5e7dd3-Ca1JfQaJ.js +4914 -0
- package/dist/cs-CZ-2BRQDIVT-Dhd8XszK.js +42 -0
- package/dist/da-DK-5WZEPLOC-BhL87sSs.js +36 -0
- package/dist/de-DE-XR44H4JA-xSrZSV0J.js +39 -0
- package/dist/directory-open-01563666-XowynPwH.js +14 -0
- package/dist/directory-open-4ed118d0-BwYbu9dw.js +55 -0
- package/dist/edges-e0da2a9e-9VbVapWU.js +1840 -0
- package/dist/el-GR-BZB4AONW-DQORZ_pY.js +41 -0
- package/dist/en-B4ZKOASM-D2BVbEdz.js +39 -0
- package/dist/erDiagram-9861fffd-D4S9QDes.js +1318 -0
- package/dist/es-ES-U4NZUMDT-C0Q89-0V.js +40 -0
- package/dist/eu-ES-A7QVB2H4-BwBW3cEw.js +42 -0
- package/dist/fa-IR-HGAKTJCU-DtZ74rm4.js +39 -0
- package/dist/fi-FI-Z5N7JZ37-QvQan48z.js +37 -0
- package/dist/file-open-002ab408-BNIYSKAV.js +18 -0
- package/dist/file-open-7c801643-B_l1UXdI.js +15 -0
- package/dist/file-save-3189631c-vzijizFw.js +23 -0
- package/dist/file-save-745eba88-B5-wM56X.js +25 -0
- package/dist/flowDb-956e92f1-S6T8ppJw.js +1713 -0
- package/dist/flowDiagram-66a62f08-C6TTwS5_.js +1264 -0
- package/dist/flowDiagram-v2-96b9c2cf-CzfeUNGP.js +24 -0
- package/dist/flowchart-elk-definition-4a651766-CRv1kWtk.js +92922 -0
- package/dist/fr-FR-RHASNOE6-CZFiweNU.js +40 -0
- package/dist/ganttDiagram-c361ad54-CAnfd8Sw.js +3420 -0
- package/dist/gitGraphDiagram-72cf32ee-CSGI-xRI.js +1790 -0
- package/dist/gl-ES-HMX3MZ6V-Bqv2xL-V.js +41 -0
- package/dist/graph-Ct2tKpKj.js +1253 -0
- package/dist/he-IL-6SHJWFNN-kso30jhn.js +41 -0
- package/dist/hi-IN-IWLTKZ5I-Busk5oaa.js +35 -0
- package/dist/hu-HU-A5ZG7DT2-xSR2C2H0.js +38 -0
- package/dist/id-ID-SAP4L64H-BQQZYm1L.js +41 -0
- package/dist/image-EDRW2JGV-Cx7o2kxD.js +6 -0
- package/dist/image-blob-reduce.esm-BKPqMdie.js +2396 -0
- package/dist/index-3862675e-B3j3w-v_.js +663 -0
- package/dist/index-CLOU2Ikr.js +14364 -0
- package/dist/index.css +450 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +7 -0
- package/dist/index.umd.cjs +235477 -0
- package/dist/infoDiagram-f8f76790-NqA75uBo.js +510 -0
- package/dist/init-ZxktEp_H.js +16 -0
- package/dist/it-IT-JPQ66NNP-CAMVZrYt.js +42 -0
- package/dist/ja-JP-DBVTYXUO-CAX8A_Uj.js +39 -0
- package/dist/journeyDiagram-49397b02-By5oBzsZ.js +1182 -0
- package/dist/kaa-6HZHGXH3-4-o94cPY.js +32 -0
- package/dist/kab-KAB-ZGHBKWFO-CgyjjBvZ.js +39 -0
- package/dist/katex-C-jAQc2m.js +14516 -0
- package/dist/kk-KZ-P5N5QNE5-BEqZcwLA.js +32 -0
- package/dist/km-KH-HSX4SM5Z-DvKDbeH4.js +42 -0
- package/dist/ko-KR-MTYHY66A-DKCuAbKE.js +40 -0
- package/dist/ku-TR-6OUDTVRD-CNUs4cCe.js +40 -0
- package/dist/layout-AJxYKqQV.js +2292 -0
- package/dist/line-DJIf5OM8.js +45 -0
- package/dist/linear-Cfj4s4vI.js +539 -0
- package/dist/lt-LT-XHIRWOB4-gouzGdoW.js +34 -0
- package/dist/lv-LV-5QDEKY6T-CTvg1XFv.js +38 -0
- package/dist/mindmap-definition-fc14e90a-CBlwH_UF.js +35283 -0
- package/dist/mr-IN-CRQNXWMA-QeYm06Kq.js +44 -0
- package/dist/my-MM-5M5IBNSE-DG3k9ORf.js +32 -0
- package/dist/nb-NO-T6EIAALU-Cj995Nmg.js +41 -0
- package/dist/nl-NL-IS3SIHDZ-B-2H7xey.js +39 -0
- package/dist/nn-NO-6E72VCQL-DrAwKKTN.js +39 -0
- package/dist/oc-FR-POXYY2M6-CeyJD7tq.js +39 -0
- package/dist/ordinal-DSZU4PqD.js +76 -0
- package/dist/pa-IN-N4M65BXN-DHzi6mjo.js +35 -0
- package/dist/path-Cp2qmpkd.js +109 -0
- package/dist/percentages-BXMCSKIN-CDYsTuua.js +6 -0
- package/dist/pica-CzzcRNRD.js +1702 -0
- package/dist/pieDiagram-8a3498a8-DueGoZOh.js +768 -0
- package/dist/pl-PL-T2D74RX3-BBNEV2c6.js +40 -0
- package/dist/pt-BR-5N22H2LF-D2cTx_F0.js +40 -0
- package/dist/pt-PT-UZXXM6DQ-BddvLLsF.js +40 -0
- package/dist/quadrantDiagram-120e2f19-Tb6_oGIn.js +1198 -0
- package/dist/requirementDiagram-deff3bca-CEeg0ep-.js +1089 -0
- package/dist/ro-RO-JPDTUUEW-DynuW50i.js +42 -0
- package/dist/roundRect-CjfubgrN.js +152 -0
- package/dist/ru-RU-B4JR7IUQ-B5Hecrew.js +40 -0
- package/dist/sankeyDiagram-04a897e0-CGTLQ8Gm.js +1172 -0
- package/dist/sequenceDiagram-704730f1-CZ72D-Nd.js +3336 -0
- package/dist/si-LK-N5RQ5JYF-BGMa93tc.js +32 -0
- package/dist/sk-SK-C5VTKIMK-BttCAlBm.js +37 -0
- package/dist/sl-SI-NN7IZMDC-DTC59nzG.js +37 -0
- package/dist/stateDiagram-587899a1-XISZzz_f.js +451 -0
- package/dist/stateDiagram-v2-d93cdb3a-DbCcmzTc.js +319 -0
- package/dist/styles-6aaf32cf-CyfdkEib.js +1363 -0
- package/dist/styles-9a916d00-zQ92RrTB.js +1483 -0
- package/dist/styles-c10674c1-BWmkigmR.js +571 -0
- package/dist/subset-shared.chunk-BuFt2PpZ.js +8 -0
- package/dist/subset-worker.chunk-CgaFXU4O.js +14 -0
- package/dist/sv-SE-XGPEYMSR-BPDlPxC1.js +41 -0
- package/dist/svgDrawCommon-08f97a94-CJ0lufOi.js +100 -0
- package/dist/ta-IN-2NMHFXQM-CI1ZsNk9.js +40 -0
- package/dist/th-TH-HPSO5L25-CUM-w2Qt.js +33 -0
- package/dist/timeline-definition-85554ec2-DV6084Gl.js +1210 -0
- package/dist/tr-TR-DEFEU3FU-CGpyf_vD.js +38 -0
- package/dist/uk-UA-QMV73CPH-Bg15Mv3J.js +37 -0
- package/dist/vi-VN-M7AON7JQ-AYmca9so.js +36 -0
- package/dist/vite.svg +1 -0
- package/dist/xychartDiagram-e933f94c-P1e6EEaH.js +1796 -0
- package/dist/zh-CN-LNUGB5OW-Dem2Cc-c.js +41 -0
- package/dist/zh-HK-E62DVLB3-BjsDyiLI.js +32 -0
- package/dist/zh-TW-RAJ6MFWO-IDAsc9Pz.js +40 -0
- package/package.json +52 -0
|
@@ -0,0 +1,1811 @@
|
|
|
1
|
+
import { X as getConfig$1, a7 as rgba, d as select, e as configureSvgSize, l as log$1, r as clear$1, k as common$1, g as getConfig, $ as getStylesFromArray } from "./index-CLOU2Ikr.js";
|
|
2
|
+
import { c as clone } from "./clone-D2FUK8WY.js";
|
|
3
|
+
import { i as insertMarkers$1, a as insertEdge, b as insertEdgeLabel, p as positionEdgeLabel, c as insertNode, d as positionNode } from "./edges-e0da2a9e-9VbVapWU.js";
|
|
4
|
+
import { G as Graph } from "./graph-Ct2tKpKj.js";
|
|
5
|
+
import { c as channel } from "./channel-BT_3Ze-Y.js";
|
|
6
|
+
import { o as ordinal } from "./ordinal-DSZU4PqD.js";
|
|
7
|
+
import { s as schemeTableau10 } from "./Tableau10-BqnYsPR6.js";
|
|
8
|
+
var _a, _b;
|
|
9
|
+
var parser = (function() {
|
|
10
|
+
var o = function(k, v, o2, l) {
|
|
11
|
+
for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
|
|
12
|
+
;
|
|
13
|
+
return o2;
|
|
14
|
+
}, $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49];
|
|
15
|
+
var parser2 = {
|
|
16
|
+
trace: function trace() {
|
|
17
|
+
},
|
|
18
|
+
yy: {},
|
|
19
|
+
symbols_: { "error": 2, "spaceLines": 3, "SPACELINE": 4, "NL": 5, "separator": 6, "SPACE": 7, "EOF": 8, "start": 9, "BLOCK_DIAGRAM_KEY": 10, "document": 11, "stop": 12, "statement": 13, "link": 14, "LINK": 15, "START_LINK": 16, "LINK_LABEL": 17, "STR": 18, "nodeStatement": 19, "columnsStatement": 20, "SPACE_BLOCK": 21, "blockStatement": 22, "classDefStatement": 23, "cssClassStatement": 24, "styleStatement": 25, "node": 26, "SIZE": 27, "COLUMNS": 28, "id-block": 29, "end": 30, "block": 31, "NODE_ID": 32, "nodeShapeNLabel": 33, "dirList": 34, "DIR": 35, "NODE_DSTART": 36, "NODE_DEND": 37, "BLOCK_ARROW_START": 38, "BLOCK_ARROW_END": 39, "classDef": 40, "CLASSDEF_ID": 41, "CLASSDEF_STYLEOPTS": 42, "DEFAULT": 43, "class": 44, "CLASSENTITY_IDS": 45, "STYLECLASS": 46, "style": 47, "STYLE_ENTITY_IDS": 48, "STYLE_DEFINITION_DATA": 49, "$accept": 0, "$end": 1 },
|
|
20
|
+
terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
|
|
21
|
+
productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
|
|
22
|
+
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
|
|
23
|
+
var $0 = $$.length - 1;
|
|
24
|
+
switch (yystate) {
|
|
25
|
+
case 4:
|
|
26
|
+
yy.getLogger().debug("Rule: separator (NL) ");
|
|
27
|
+
break;
|
|
28
|
+
case 5:
|
|
29
|
+
yy.getLogger().debug("Rule: separator (Space) ");
|
|
30
|
+
break;
|
|
31
|
+
case 6:
|
|
32
|
+
yy.getLogger().debug("Rule: separator (EOF) ");
|
|
33
|
+
break;
|
|
34
|
+
case 7:
|
|
35
|
+
yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]);
|
|
36
|
+
yy.setHierarchy($$[$0 - 1]);
|
|
37
|
+
break;
|
|
38
|
+
case 8:
|
|
39
|
+
yy.getLogger().debug("Stop NL ");
|
|
40
|
+
break;
|
|
41
|
+
case 9:
|
|
42
|
+
yy.getLogger().debug("Stop EOF ");
|
|
43
|
+
break;
|
|
44
|
+
case 10:
|
|
45
|
+
yy.getLogger().debug("Stop NL2 ");
|
|
46
|
+
break;
|
|
47
|
+
case 11:
|
|
48
|
+
yy.getLogger().debug("Stop EOF2 ");
|
|
49
|
+
break;
|
|
50
|
+
case 12:
|
|
51
|
+
yy.getLogger().debug("Rule: statement: ", $$[$0]);
|
|
52
|
+
typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]];
|
|
53
|
+
break;
|
|
54
|
+
case 13:
|
|
55
|
+
yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]);
|
|
56
|
+
this.$ = [$$[$0 - 1]].concat($$[$0]);
|
|
57
|
+
break;
|
|
58
|
+
case 14:
|
|
59
|
+
yy.getLogger().debug("Rule: link: ", $$[$0], yytext);
|
|
60
|
+
this.$ = { edgeTypeStr: $$[$0], label: "" };
|
|
61
|
+
break;
|
|
62
|
+
case 15:
|
|
63
|
+
yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]);
|
|
64
|
+
this.$ = { edgeTypeStr: $$[$0], label: $$[$0 - 1] };
|
|
65
|
+
break;
|
|
66
|
+
case 18:
|
|
67
|
+
const num = parseInt($$[$0]);
|
|
68
|
+
const spaceId = yy.generateId();
|
|
69
|
+
this.$ = { id: spaceId, type: "space", label: "", width: num, children: [] };
|
|
70
|
+
break;
|
|
71
|
+
case 23:
|
|
72
|
+
yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr);
|
|
73
|
+
const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr);
|
|
74
|
+
this.$ = [
|
|
75
|
+
{ id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions },
|
|
76
|
+
{ id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" },
|
|
77
|
+
{ id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions }
|
|
78
|
+
];
|
|
79
|
+
break;
|
|
80
|
+
case 24:
|
|
81
|
+
yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]);
|
|
82
|
+
this.$ = { id: $$[$0 - 1].id, label: $$[$0 - 1].label, type: yy.typeStr2Type($$[$0 - 1].typeStr), directions: $$[$0 - 1].directions, widthInColumns: parseInt($$[$0], 10) };
|
|
83
|
+
break;
|
|
84
|
+
case 25:
|
|
85
|
+
yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]);
|
|
86
|
+
this.$ = { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions, widthInColumns: 1 };
|
|
87
|
+
break;
|
|
88
|
+
case 26:
|
|
89
|
+
yy.getLogger().debug("APA123", this ? this : "na");
|
|
90
|
+
yy.getLogger().debug("COLUMNS: ", $$[$0]);
|
|
91
|
+
this.$ = { type: "column-setting", columns: $$[$0] === "auto" ? -1 : parseInt($$[$0]) };
|
|
92
|
+
break;
|
|
93
|
+
case 27:
|
|
94
|
+
yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]);
|
|
95
|
+
yy.generateId();
|
|
96
|
+
this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] };
|
|
97
|
+
break;
|
|
98
|
+
case 28:
|
|
99
|
+
yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
|
|
100
|
+
const id = yy.generateId();
|
|
101
|
+
this.$ = { id, type: "composite", label: "", children: $$[$0 - 1] };
|
|
102
|
+
break;
|
|
103
|
+
case 29:
|
|
104
|
+
yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]);
|
|
105
|
+
this.$ = { id: $$[$0] };
|
|
106
|
+
break;
|
|
107
|
+
case 30:
|
|
108
|
+
yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]);
|
|
109
|
+
this.$ = { id: $$[$0 - 1], label: $$[$0].label, typeStr: $$[$0].typeStr, directions: $$[$0].directions };
|
|
110
|
+
break;
|
|
111
|
+
case 31:
|
|
112
|
+
yy.getLogger().debug("Rule: dirList: ", $$[$0]);
|
|
113
|
+
this.$ = [$$[$0]];
|
|
114
|
+
break;
|
|
115
|
+
case 32:
|
|
116
|
+
yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]);
|
|
117
|
+
this.$ = [$$[$0 - 1]].concat($$[$0]);
|
|
118
|
+
break;
|
|
119
|
+
case 33:
|
|
120
|
+
yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
|
|
121
|
+
this.$ = { typeStr: $$[$0 - 2] + $$[$0], label: $$[$0 - 1] };
|
|
122
|
+
break;
|
|
123
|
+
case 34:
|
|
124
|
+
yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]);
|
|
125
|
+
this.$ = { typeStr: $$[$0 - 3] + $$[$0], label: $$[$0 - 2], directions: $$[$0 - 1] };
|
|
126
|
+
break;
|
|
127
|
+
case 35:
|
|
128
|
+
case 36:
|
|
129
|
+
this.$ = { type: "classDef", id: $$[$0 - 1].trim(), css: $$[$0].trim() };
|
|
130
|
+
break;
|
|
131
|
+
case 37:
|
|
132
|
+
this.$ = { type: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
|
|
133
|
+
break;
|
|
134
|
+
case 38:
|
|
135
|
+
this.$ = { type: "applyStyles", id: $$[$0 - 1].trim(), stylesStr: $$[$0].trim() };
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 8: [1, 20] }, o($V8, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: $V0, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }), o($V9, [2, 16], { 14: 22, 15: $Va, 16: $Vb }), o($V9, [2, 17]), o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), o($V9, [2, 21]), o($V9, [2, 22]), o($Vc, [2, 25], { 27: [1, 25] }), o($V9, [2, 26]), { 19: 26, 26: 12, 32: $V4 }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, o($Vd, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, o($V8, [2, 13]), { 26: 35, 32: $V4 }, { 32: [2, 14] }, { 17: [1, 36] }, o($Vc, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: $Va, 16: $Vb, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, o($Vd, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, o($Vc, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, o($V9, [2, 28]), o($V9, [2, 35]), o($V9, [2, 36]), o($V9, [2, 37]), o($V9, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: $Ve }, { 15: [1, 50] }, o($V9, [2, 27]), o($Vd, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: $Ve, 39: [2, 31] }, { 32: [2, 15] }, o($Vd, [2, 34]), { 39: [2, 32] }],
|
|
140
|
+
defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
|
|
141
|
+
parseError: function parseError(str, hash) {
|
|
142
|
+
if (hash.recoverable) {
|
|
143
|
+
this.trace(str);
|
|
144
|
+
} else {
|
|
145
|
+
var error = new Error(str);
|
|
146
|
+
error.hash = hash;
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
parse: function parse(input) {
|
|
151
|
+
var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
|
|
152
|
+
var args = lstack.slice.call(arguments, 1);
|
|
153
|
+
var lexer2 = Object.create(this.lexer);
|
|
154
|
+
var sharedState = { yy: {} };
|
|
155
|
+
for (var k in this.yy) {
|
|
156
|
+
if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
|
157
|
+
sharedState.yy[k] = this.yy[k];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
lexer2.setInput(input, sharedState.yy);
|
|
161
|
+
sharedState.yy.lexer = lexer2;
|
|
162
|
+
sharedState.yy.parser = this;
|
|
163
|
+
if (typeof lexer2.yylloc == "undefined") {
|
|
164
|
+
lexer2.yylloc = {};
|
|
165
|
+
}
|
|
166
|
+
var yyloc = lexer2.yylloc;
|
|
167
|
+
lstack.push(yyloc);
|
|
168
|
+
var ranges = lexer2.options && lexer2.options.ranges;
|
|
169
|
+
if (typeof sharedState.yy.parseError === "function") {
|
|
170
|
+
this.parseError = sharedState.yy.parseError;
|
|
171
|
+
} else {
|
|
172
|
+
this.parseError = Object.getPrototypeOf(this).parseError;
|
|
173
|
+
}
|
|
174
|
+
function lex() {
|
|
175
|
+
var token;
|
|
176
|
+
token = tstack.pop() || lexer2.lex() || EOF;
|
|
177
|
+
if (typeof token !== "number") {
|
|
178
|
+
if (token instanceof Array) {
|
|
179
|
+
tstack = token;
|
|
180
|
+
token = tstack.pop();
|
|
181
|
+
}
|
|
182
|
+
token = self.symbols_[token] || token;
|
|
183
|
+
}
|
|
184
|
+
return token;
|
|
185
|
+
}
|
|
186
|
+
var symbol, state, action, r, yyval = {}, p, len, newState, expected;
|
|
187
|
+
while (true) {
|
|
188
|
+
state = stack[stack.length - 1];
|
|
189
|
+
if (this.defaultActions[state]) {
|
|
190
|
+
action = this.defaultActions[state];
|
|
191
|
+
} else {
|
|
192
|
+
if (symbol === null || typeof symbol == "undefined") {
|
|
193
|
+
symbol = lex();
|
|
194
|
+
}
|
|
195
|
+
action = table[state] && table[state][symbol];
|
|
196
|
+
}
|
|
197
|
+
if (typeof action === "undefined" || !action.length || !action[0]) {
|
|
198
|
+
var errStr = "";
|
|
199
|
+
expected = [];
|
|
200
|
+
for (p in table[state]) {
|
|
201
|
+
if (this.terminals_[p] && p > TERROR) {
|
|
202
|
+
expected.push("'" + this.terminals_[p] + "'");
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (lexer2.showPosition) {
|
|
206
|
+
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
|
|
207
|
+
} else {
|
|
208
|
+
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
|
|
209
|
+
}
|
|
210
|
+
this.parseError(errStr, {
|
|
211
|
+
text: lexer2.match,
|
|
212
|
+
token: this.terminals_[symbol] || symbol,
|
|
213
|
+
line: lexer2.yylineno,
|
|
214
|
+
loc: yyloc,
|
|
215
|
+
expected
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
if (action[0] instanceof Array && action.length > 1) {
|
|
219
|
+
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
|
|
220
|
+
}
|
|
221
|
+
switch (action[0]) {
|
|
222
|
+
case 1:
|
|
223
|
+
stack.push(symbol);
|
|
224
|
+
vstack.push(lexer2.yytext);
|
|
225
|
+
lstack.push(lexer2.yylloc);
|
|
226
|
+
stack.push(action[1]);
|
|
227
|
+
symbol = null;
|
|
228
|
+
{
|
|
229
|
+
yyleng = lexer2.yyleng;
|
|
230
|
+
yytext = lexer2.yytext;
|
|
231
|
+
yylineno = lexer2.yylineno;
|
|
232
|
+
yyloc = lexer2.yylloc;
|
|
233
|
+
}
|
|
234
|
+
break;
|
|
235
|
+
case 2:
|
|
236
|
+
len = this.productions_[action[1]][1];
|
|
237
|
+
yyval.$ = vstack[vstack.length - len];
|
|
238
|
+
yyval._$ = {
|
|
239
|
+
first_line: lstack[lstack.length - (len || 1)].first_line,
|
|
240
|
+
last_line: lstack[lstack.length - 1].last_line,
|
|
241
|
+
first_column: lstack[lstack.length - (len || 1)].first_column,
|
|
242
|
+
last_column: lstack[lstack.length - 1].last_column
|
|
243
|
+
};
|
|
244
|
+
if (ranges) {
|
|
245
|
+
yyval._$.range = [
|
|
246
|
+
lstack[lstack.length - (len || 1)].range[0],
|
|
247
|
+
lstack[lstack.length - 1].range[1]
|
|
248
|
+
];
|
|
249
|
+
}
|
|
250
|
+
r = this.performAction.apply(yyval, [
|
|
251
|
+
yytext,
|
|
252
|
+
yyleng,
|
|
253
|
+
yylineno,
|
|
254
|
+
sharedState.yy,
|
|
255
|
+
action[1],
|
|
256
|
+
vstack,
|
|
257
|
+
lstack
|
|
258
|
+
].concat(args));
|
|
259
|
+
if (typeof r !== "undefined") {
|
|
260
|
+
return r;
|
|
261
|
+
}
|
|
262
|
+
if (len) {
|
|
263
|
+
stack = stack.slice(0, -1 * len * 2);
|
|
264
|
+
vstack = vstack.slice(0, -1 * len);
|
|
265
|
+
lstack = lstack.slice(0, -1 * len);
|
|
266
|
+
}
|
|
267
|
+
stack.push(this.productions_[action[1]][0]);
|
|
268
|
+
vstack.push(yyval.$);
|
|
269
|
+
lstack.push(yyval._$);
|
|
270
|
+
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
|
271
|
+
stack.push(newState);
|
|
272
|
+
break;
|
|
273
|
+
case 3:
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
var lexer = /* @__PURE__ */ (function() {
|
|
281
|
+
var lexer2 = {
|
|
282
|
+
EOF: 1,
|
|
283
|
+
parseError: function parseError(str, hash) {
|
|
284
|
+
if (this.yy.parser) {
|
|
285
|
+
this.yy.parser.parseError(str, hash);
|
|
286
|
+
} else {
|
|
287
|
+
throw new Error(str);
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
// resets the lexer, sets new input
|
|
291
|
+
setInput: function(input, yy) {
|
|
292
|
+
this.yy = yy || this.yy || {};
|
|
293
|
+
this._input = input;
|
|
294
|
+
this._more = this._backtrack = this.done = false;
|
|
295
|
+
this.yylineno = this.yyleng = 0;
|
|
296
|
+
this.yytext = this.matched = this.match = "";
|
|
297
|
+
this.conditionStack = ["INITIAL"];
|
|
298
|
+
this.yylloc = {
|
|
299
|
+
first_line: 1,
|
|
300
|
+
first_column: 0,
|
|
301
|
+
last_line: 1,
|
|
302
|
+
last_column: 0
|
|
303
|
+
};
|
|
304
|
+
if (this.options.ranges) {
|
|
305
|
+
this.yylloc.range = [0, 0];
|
|
306
|
+
}
|
|
307
|
+
this.offset = 0;
|
|
308
|
+
return this;
|
|
309
|
+
},
|
|
310
|
+
// consumes and returns one char from the input
|
|
311
|
+
input: function() {
|
|
312
|
+
var ch = this._input[0];
|
|
313
|
+
this.yytext += ch;
|
|
314
|
+
this.yyleng++;
|
|
315
|
+
this.offset++;
|
|
316
|
+
this.match += ch;
|
|
317
|
+
this.matched += ch;
|
|
318
|
+
var lines = ch.match(/(?:\r\n?|\n).*/g);
|
|
319
|
+
if (lines) {
|
|
320
|
+
this.yylineno++;
|
|
321
|
+
this.yylloc.last_line++;
|
|
322
|
+
} else {
|
|
323
|
+
this.yylloc.last_column++;
|
|
324
|
+
}
|
|
325
|
+
if (this.options.ranges) {
|
|
326
|
+
this.yylloc.range[1]++;
|
|
327
|
+
}
|
|
328
|
+
this._input = this._input.slice(1);
|
|
329
|
+
return ch;
|
|
330
|
+
},
|
|
331
|
+
// unshifts one char (or a string) into the input
|
|
332
|
+
unput: function(ch) {
|
|
333
|
+
var len = ch.length;
|
|
334
|
+
var lines = ch.split(/(?:\r\n?|\n)/g);
|
|
335
|
+
this._input = ch + this._input;
|
|
336
|
+
this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
|
337
|
+
this.offset -= len;
|
|
338
|
+
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
|
339
|
+
this.match = this.match.substr(0, this.match.length - 1);
|
|
340
|
+
this.matched = this.matched.substr(0, this.matched.length - 1);
|
|
341
|
+
if (lines.length - 1) {
|
|
342
|
+
this.yylineno -= lines.length - 1;
|
|
343
|
+
}
|
|
344
|
+
var r = this.yylloc.range;
|
|
345
|
+
this.yylloc = {
|
|
346
|
+
first_line: this.yylloc.first_line,
|
|
347
|
+
last_line: this.yylineno + 1,
|
|
348
|
+
first_column: this.yylloc.first_column,
|
|
349
|
+
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
|
|
350
|
+
};
|
|
351
|
+
if (this.options.ranges) {
|
|
352
|
+
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
|
353
|
+
}
|
|
354
|
+
this.yyleng = this.yytext.length;
|
|
355
|
+
return this;
|
|
356
|
+
},
|
|
357
|
+
// When called from action, caches matched text and appends it on next action
|
|
358
|
+
more: function() {
|
|
359
|
+
this._more = true;
|
|
360
|
+
return this;
|
|
361
|
+
},
|
|
362
|
+
// 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.
|
|
363
|
+
reject: function() {
|
|
364
|
+
if (this.options.backtrack_lexer) {
|
|
365
|
+
this._backtrack = true;
|
|
366
|
+
} else {
|
|
367
|
+
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(), {
|
|
368
|
+
text: "",
|
|
369
|
+
token: null,
|
|
370
|
+
line: this.yylineno
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
return this;
|
|
374
|
+
},
|
|
375
|
+
// retain first n characters of the match
|
|
376
|
+
less: function(n) {
|
|
377
|
+
this.unput(this.match.slice(n));
|
|
378
|
+
},
|
|
379
|
+
// displays already matched input, i.e. for error messages
|
|
380
|
+
pastInput: function() {
|
|
381
|
+
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
|
382
|
+
return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
|
|
383
|
+
},
|
|
384
|
+
// displays upcoming input, i.e. for error messages
|
|
385
|
+
upcomingInput: function() {
|
|
386
|
+
var next = this.match;
|
|
387
|
+
if (next.length < 20) {
|
|
388
|
+
next += this._input.substr(0, 20 - next.length);
|
|
389
|
+
}
|
|
390
|
+
return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
391
|
+
},
|
|
392
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
393
|
+
showPosition: function() {
|
|
394
|
+
var pre = this.pastInput();
|
|
395
|
+
var c = new Array(pre.length + 1).join("-");
|
|
396
|
+
return pre + this.upcomingInput() + "\n" + c + "^";
|
|
397
|
+
},
|
|
398
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
399
|
+
test_match: function(match, indexed_rule) {
|
|
400
|
+
var token, lines, backup;
|
|
401
|
+
if (this.options.backtrack_lexer) {
|
|
402
|
+
backup = {
|
|
403
|
+
yylineno: this.yylineno,
|
|
404
|
+
yylloc: {
|
|
405
|
+
first_line: this.yylloc.first_line,
|
|
406
|
+
last_line: this.last_line,
|
|
407
|
+
first_column: this.yylloc.first_column,
|
|
408
|
+
last_column: this.yylloc.last_column
|
|
409
|
+
},
|
|
410
|
+
yytext: this.yytext,
|
|
411
|
+
match: this.match,
|
|
412
|
+
matches: this.matches,
|
|
413
|
+
matched: this.matched,
|
|
414
|
+
yyleng: this.yyleng,
|
|
415
|
+
offset: this.offset,
|
|
416
|
+
_more: this._more,
|
|
417
|
+
_input: this._input,
|
|
418
|
+
yy: this.yy,
|
|
419
|
+
conditionStack: this.conditionStack.slice(0),
|
|
420
|
+
done: this.done
|
|
421
|
+
};
|
|
422
|
+
if (this.options.ranges) {
|
|
423
|
+
backup.yylloc.range = this.yylloc.range.slice(0);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
|
427
|
+
if (lines) {
|
|
428
|
+
this.yylineno += lines.length;
|
|
429
|
+
}
|
|
430
|
+
this.yylloc = {
|
|
431
|
+
first_line: this.yylloc.last_line,
|
|
432
|
+
last_line: this.yylineno + 1,
|
|
433
|
+
first_column: this.yylloc.last_column,
|
|
434
|
+
last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
|
435
|
+
};
|
|
436
|
+
this.yytext += match[0];
|
|
437
|
+
this.match += match[0];
|
|
438
|
+
this.matches = match;
|
|
439
|
+
this.yyleng = this.yytext.length;
|
|
440
|
+
if (this.options.ranges) {
|
|
441
|
+
this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
|
442
|
+
}
|
|
443
|
+
this._more = false;
|
|
444
|
+
this._backtrack = false;
|
|
445
|
+
this._input = this._input.slice(match[0].length);
|
|
446
|
+
this.matched += match[0];
|
|
447
|
+
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
|
448
|
+
if (this.done && this._input) {
|
|
449
|
+
this.done = false;
|
|
450
|
+
}
|
|
451
|
+
if (token) {
|
|
452
|
+
return token;
|
|
453
|
+
} else if (this._backtrack) {
|
|
454
|
+
for (var k in backup) {
|
|
455
|
+
this[k] = backup[k];
|
|
456
|
+
}
|
|
457
|
+
return false;
|
|
458
|
+
}
|
|
459
|
+
return false;
|
|
460
|
+
},
|
|
461
|
+
// return next match in input
|
|
462
|
+
next: function() {
|
|
463
|
+
if (this.done) {
|
|
464
|
+
return this.EOF;
|
|
465
|
+
}
|
|
466
|
+
if (!this._input) {
|
|
467
|
+
this.done = true;
|
|
468
|
+
}
|
|
469
|
+
var token, match, tempMatch, index;
|
|
470
|
+
if (!this._more) {
|
|
471
|
+
this.yytext = "";
|
|
472
|
+
this.match = "";
|
|
473
|
+
}
|
|
474
|
+
var rules = this._currentRules();
|
|
475
|
+
for (var i = 0; i < rules.length; i++) {
|
|
476
|
+
tempMatch = this._input.match(this.rules[rules[i]]);
|
|
477
|
+
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
|
478
|
+
match = tempMatch;
|
|
479
|
+
index = i;
|
|
480
|
+
if (this.options.backtrack_lexer) {
|
|
481
|
+
token = this.test_match(tempMatch, rules[i]);
|
|
482
|
+
if (token !== false) {
|
|
483
|
+
return token;
|
|
484
|
+
} else if (this._backtrack) {
|
|
485
|
+
match = false;
|
|
486
|
+
continue;
|
|
487
|
+
} else {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
} else if (!this.options.flex) {
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (match) {
|
|
496
|
+
token = this.test_match(match, rules[index]);
|
|
497
|
+
if (token !== false) {
|
|
498
|
+
return token;
|
|
499
|
+
}
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
if (this._input === "") {
|
|
503
|
+
return this.EOF;
|
|
504
|
+
} else {
|
|
505
|
+
return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
|
|
506
|
+
text: "",
|
|
507
|
+
token: null,
|
|
508
|
+
line: this.yylineno
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
// return next match that has a token
|
|
513
|
+
lex: function lex() {
|
|
514
|
+
var r = this.next();
|
|
515
|
+
if (r) {
|
|
516
|
+
return r;
|
|
517
|
+
} else {
|
|
518
|
+
return this.lex();
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
522
|
+
begin: function begin(condition) {
|
|
523
|
+
this.conditionStack.push(condition);
|
|
524
|
+
},
|
|
525
|
+
// pop the previously active lexer condition state off the condition stack
|
|
526
|
+
popState: function popState() {
|
|
527
|
+
var n = this.conditionStack.length - 1;
|
|
528
|
+
if (n > 0) {
|
|
529
|
+
return this.conditionStack.pop();
|
|
530
|
+
} else {
|
|
531
|
+
return this.conditionStack[0];
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
535
|
+
_currentRules: function _currentRules() {
|
|
536
|
+
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
|
537
|
+
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
|
538
|
+
} else {
|
|
539
|
+
return this.conditions["INITIAL"].rules;
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
543
|
+
topState: function topState(n) {
|
|
544
|
+
n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
|
545
|
+
if (n >= 0) {
|
|
546
|
+
return this.conditionStack[n];
|
|
547
|
+
} else {
|
|
548
|
+
return "INITIAL";
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
// alias for begin(condition)
|
|
552
|
+
pushState: function pushState(condition) {
|
|
553
|
+
this.begin(condition);
|
|
554
|
+
},
|
|
555
|
+
// return the number of states currently on the stack
|
|
556
|
+
stateStackSize: function stateStackSize() {
|
|
557
|
+
return this.conditionStack.length;
|
|
558
|
+
},
|
|
559
|
+
options: {},
|
|
560
|
+
performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
|
561
|
+
switch ($avoiding_name_collisions) {
|
|
562
|
+
case 0:
|
|
563
|
+
return 10;
|
|
564
|
+
case 1:
|
|
565
|
+
yy.getLogger().debug("Found space-block");
|
|
566
|
+
return 31;
|
|
567
|
+
case 2:
|
|
568
|
+
yy.getLogger().debug("Found nl-block");
|
|
569
|
+
return 31;
|
|
570
|
+
case 3:
|
|
571
|
+
yy.getLogger().debug("Found space-block");
|
|
572
|
+
return 29;
|
|
573
|
+
case 4:
|
|
574
|
+
yy.getLogger().debug(".", yy_.yytext);
|
|
575
|
+
break;
|
|
576
|
+
case 5:
|
|
577
|
+
yy.getLogger().debug("_", yy_.yytext);
|
|
578
|
+
break;
|
|
579
|
+
case 6:
|
|
580
|
+
return 5;
|
|
581
|
+
case 7:
|
|
582
|
+
yy_.yytext = -1;
|
|
583
|
+
return 28;
|
|
584
|
+
case 8:
|
|
585
|
+
yy_.yytext = yy_.yytext.replace(/columns\s+/, "");
|
|
586
|
+
yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
|
|
587
|
+
return 28;
|
|
588
|
+
case 9:
|
|
589
|
+
this.pushState("md_string");
|
|
590
|
+
break;
|
|
591
|
+
case 10:
|
|
592
|
+
return "MD_STR";
|
|
593
|
+
case 11:
|
|
594
|
+
this.popState();
|
|
595
|
+
break;
|
|
596
|
+
case 12:
|
|
597
|
+
this.pushState("string");
|
|
598
|
+
break;
|
|
599
|
+
case 13:
|
|
600
|
+
yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext);
|
|
601
|
+
this.popState();
|
|
602
|
+
break;
|
|
603
|
+
case 14:
|
|
604
|
+
yy.getLogger().debug("LEX: STR end:", yy_.yytext);
|
|
605
|
+
return "STR";
|
|
606
|
+
case 15:
|
|
607
|
+
yy_.yytext = yy_.yytext.replace(/space\:/, "");
|
|
608
|
+
yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext);
|
|
609
|
+
return 21;
|
|
610
|
+
case 16:
|
|
611
|
+
yy_.yytext = "1";
|
|
612
|
+
yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
|
|
613
|
+
return 21;
|
|
614
|
+
case 17:
|
|
615
|
+
return 43;
|
|
616
|
+
case 18:
|
|
617
|
+
return "LINKSTYLE";
|
|
618
|
+
case 19:
|
|
619
|
+
return "INTERPOLATE";
|
|
620
|
+
case 20:
|
|
621
|
+
this.pushState("CLASSDEF");
|
|
622
|
+
return 40;
|
|
623
|
+
case 21:
|
|
624
|
+
this.popState();
|
|
625
|
+
this.pushState("CLASSDEFID");
|
|
626
|
+
return "DEFAULT_CLASSDEF_ID";
|
|
627
|
+
case 22:
|
|
628
|
+
this.popState();
|
|
629
|
+
this.pushState("CLASSDEFID");
|
|
630
|
+
return 41;
|
|
631
|
+
case 23:
|
|
632
|
+
this.popState();
|
|
633
|
+
return 42;
|
|
634
|
+
case 24:
|
|
635
|
+
this.pushState("CLASS");
|
|
636
|
+
return 44;
|
|
637
|
+
case 25:
|
|
638
|
+
this.popState();
|
|
639
|
+
this.pushState("CLASS_STYLE");
|
|
640
|
+
return 45;
|
|
641
|
+
case 26:
|
|
642
|
+
this.popState();
|
|
643
|
+
return 46;
|
|
644
|
+
case 27:
|
|
645
|
+
this.pushState("STYLE_STMNT");
|
|
646
|
+
return 47;
|
|
647
|
+
case 28:
|
|
648
|
+
this.popState();
|
|
649
|
+
this.pushState("STYLE_DEFINITION");
|
|
650
|
+
return 48;
|
|
651
|
+
case 29:
|
|
652
|
+
this.popState();
|
|
653
|
+
return 49;
|
|
654
|
+
case 30:
|
|
655
|
+
this.pushState("acc_title");
|
|
656
|
+
return "acc_title";
|
|
657
|
+
case 31:
|
|
658
|
+
this.popState();
|
|
659
|
+
return "acc_title_value";
|
|
660
|
+
case 32:
|
|
661
|
+
this.pushState("acc_descr");
|
|
662
|
+
return "acc_descr";
|
|
663
|
+
case 33:
|
|
664
|
+
this.popState();
|
|
665
|
+
return "acc_descr_value";
|
|
666
|
+
case 34:
|
|
667
|
+
this.pushState("acc_descr_multiline");
|
|
668
|
+
break;
|
|
669
|
+
case 35:
|
|
670
|
+
this.popState();
|
|
671
|
+
break;
|
|
672
|
+
case 36:
|
|
673
|
+
return "acc_descr_multiline_value";
|
|
674
|
+
case 37:
|
|
675
|
+
return 30;
|
|
676
|
+
case 38:
|
|
677
|
+
this.popState();
|
|
678
|
+
yy.getLogger().debug("Lex: ((");
|
|
679
|
+
return "NODE_DEND";
|
|
680
|
+
case 39:
|
|
681
|
+
this.popState();
|
|
682
|
+
yy.getLogger().debug("Lex: ((");
|
|
683
|
+
return "NODE_DEND";
|
|
684
|
+
case 40:
|
|
685
|
+
this.popState();
|
|
686
|
+
yy.getLogger().debug("Lex: ))");
|
|
687
|
+
return "NODE_DEND";
|
|
688
|
+
case 41:
|
|
689
|
+
this.popState();
|
|
690
|
+
yy.getLogger().debug("Lex: ((");
|
|
691
|
+
return "NODE_DEND";
|
|
692
|
+
case 42:
|
|
693
|
+
this.popState();
|
|
694
|
+
yy.getLogger().debug("Lex: ((");
|
|
695
|
+
return "NODE_DEND";
|
|
696
|
+
case 43:
|
|
697
|
+
this.popState();
|
|
698
|
+
yy.getLogger().debug("Lex: (-");
|
|
699
|
+
return "NODE_DEND";
|
|
700
|
+
case 44:
|
|
701
|
+
this.popState();
|
|
702
|
+
yy.getLogger().debug("Lex: -)");
|
|
703
|
+
return "NODE_DEND";
|
|
704
|
+
case 45:
|
|
705
|
+
this.popState();
|
|
706
|
+
yy.getLogger().debug("Lex: ((");
|
|
707
|
+
return "NODE_DEND";
|
|
708
|
+
case 46:
|
|
709
|
+
this.popState();
|
|
710
|
+
yy.getLogger().debug("Lex: ]]");
|
|
711
|
+
return "NODE_DEND";
|
|
712
|
+
case 47:
|
|
713
|
+
this.popState();
|
|
714
|
+
yy.getLogger().debug("Lex: (");
|
|
715
|
+
return "NODE_DEND";
|
|
716
|
+
case 48:
|
|
717
|
+
this.popState();
|
|
718
|
+
yy.getLogger().debug("Lex: ])");
|
|
719
|
+
return "NODE_DEND";
|
|
720
|
+
case 49:
|
|
721
|
+
this.popState();
|
|
722
|
+
yy.getLogger().debug("Lex: /]");
|
|
723
|
+
return "NODE_DEND";
|
|
724
|
+
case 50:
|
|
725
|
+
this.popState();
|
|
726
|
+
yy.getLogger().debug("Lex: /]");
|
|
727
|
+
return "NODE_DEND";
|
|
728
|
+
case 51:
|
|
729
|
+
this.popState();
|
|
730
|
+
yy.getLogger().debug("Lex: )]");
|
|
731
|
+
return "NODE_DEND";
|
|
732
|
+
case 52:
|
|
733
|
+
this.popState();
|
|
734
|
+
yy.getLogger().debug("Lex: )");
|
|
735
|
+
return "NODE_DEND";
|
|
736
|
+
case 53:
|
|
737
|
+
this.popState();
|
|
738
|
+
yy.getLogger().debug("Lex: ]>");
|
|
739
|
+
return "NODE_DEND";
|
|
740
|
+
case 54:
|
|
741
|
+
this.popState();
|
|
742
|
+
yy.getLogger().debug("Lex: ]");
|
|
743
|
+
return "NODE_DEND";
|
|
744
|
+
case 55:
|
|
745
|
+
yy.getLogger().debug("Lexa: -)");
|
|
746
|
+
this.pushState("NODE");
|
|
747
|
+
return 36;
|
|
748
|
+
case 56:
|
|
749
|
+
yy.getLogger().debug("Lexa: (-");
|
|
750
|
+
this.pushState("NODE");
|
|
751
|
+
return 36;
|
|
752
|
+
case 57:
|
|
753
|
+
yy.getLogger().debug("Lexa: ))");
|
|
754
|
+
this.pushState("NODE");
|
|
755
|
+
return 36;
|
|
756
|
+
case 58:
|
|
757
|
+
yy.getLogger().debug("Lexa: )");
|
|
758
|
+
this.pushState("NODE");
|
|
759
|
+
return 36;
|
|
760
|
+
case 59:
|
|
761
|
+
yy.getLogger().debug("Lex: (((");
|
|
762
|
+
this.pushState("NODE");
|
|
763
|
+
return 36;
|
|
764
|
+
case 60:
|
|
765
|
+
yy.getLogger().debug("Lexa: )");
|
|
766
|
+
this.pushState("NODE");
|
|
767
|
+
return 36;
|
|
768
|
+
case 61:
|
|
769
|
+
yy.getLogger().debug("Lexa: )");
|
|
770
|
+
this.pushState("NODE");
|
|
771
|
+
return 36;
|
|
772
|
+
case 62:
|
|
773
|
+
yy.getLogger().debug("Lexa: )");
|
|
774
|
+
this.pushState("NODE");
|
|
775
|
+
return 36;
|
|
776
|
+
case 63:
|
|
777
|
+
yy.getLogger().debug("Lexc: >");
|
|
778
|
+
this.pushState("NODE");
|
|
779
|
+
return 36;
|
|
780
|
+
case 64:
|
|
781
|
+
yy.getLogger().debug("Lexa: ([");
|
|
782
|
+
this.pushState("NODE");
|
|
783
|
+
return 36;
|
|
784
|
+
case 65:
|
|
785
|
+
yy.getLogger().debug("Lexa: )");
|
|
786
|
+
this.pushState("NODE");
|
|
787
|
+
return 36;
|
|
788
|
+
case 66:
|
|
789
|
+
this.pushState("NODE");
|
|
790
|
+
return 36;
|
|
791
|
+
case 67:
|
|
792
|
+
this.pushState("NODE");
|
|
793
|
+
return 36;
|
|
794
|
+
case 68:
|
|
795
|
+
this.pushState("NODE");
|
|
796
|
+
return 36;
|
|
797
|
+
case 69:
|
|
798
|
+
this.pushState("NODE");
|
|
799
|
+
return 36;
|
|
800
|
+
case 70:
|
|
801
|
+
this.pushState("NODE");
|
|
802
|
+
return 36;
|
|
803
|
+
case 71:
|
|
804
|
+
this.pushState("NODE");
|
|
805
|
+
return 36;
|
|
806
|
+
case 72:
|
|
807
|
+
this.pushState("NODE");
|
|
808
|
+
return 36;
|
|
809
|
+
case 73:
|
|
810
|
+
yy.getLogger().debug("Lexa: [");
|
|
811
|
+
this.pushState("NODE");
|
|
812
|
+
return 36;
|
|
813
|
+
case 74:
|
|
814
|
+
this.pushState("BLOCK_ARROW");
|
|
815
|
+
yy.getLogger().debug("LEX ARR START");
|
|
816
|
+
return 38;
|
|
817
|
+
case 75:
|
|
818
|
+
yy.getLogger().debug("Lex: NODE_ID", yy_.yytext);
|
|
819
|
+
return 32;
|
|
820
|
+
case 76:
|
|
821
|
+
yy.getLogger().debug("Lex: EOF", yy_.yytext);
|
|
822
|
+
return 8;
|
|
823
|
+
case 77:
|
|
824
|
+
this.pushState("md_string");
|
|
825
|
+
break;
|
|
826
|
+
case 78:
|
|
827
|
+
this.pushState("md_string");
|
|
828
|
+
break;
|
|
829
|
+
case 79:
|
|
830
|
+
return "NODE_DESCR";
|
|
831
|
+
case 80:
|
|
832
|
+
this.popState();
|
|
833
|
+
break;
|
|
834
|
+
case 81:
|
|
835
|
+
yy.getLogger().debug("Lex: Starting string");
|
|
836
|
+
this.pushState("string");
|
|
837
|
+
break;
|
|
838
|
+
case 82:
|
|
839
|
+
yy.getLogger().debug("LEX ARR: Starting string");
|
|
840
|
+
this.pushState("string");
|
|
841
|
+
break;
|
|
842
|
+
case 83:
|
|
843
|
+
yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext);
|
|
844
|
+
return "NODE_DESCR";
|
|
845
|
+
case 84:
|
|
846
|
+
yy.getLogger().debug("LEX POPPING");
|
|
847
|
+
this.popState();
|
|
848
|
+
break;
|
|
849
|
+
case 85:
|
|
850
|
+
yy.getLogger().debug("Lex: =>BAE");
|
|
851
|
+
this.pushState("ARROW_DIR");
|
|
852
|
+
break;
|
|
853
|
+
case 86:
|
|
854
|
+
yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
|
|
855
|
+
yy.getLogger().debug("Lex (right): dir:", yy_.yytext);
|
|
856
|
+
return "DIR";
|
|
857
|
+
case 87:
|
|
858
|
+
yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
|
|
859
|
+
yy.getLogger().debug("Lex (left):", yy_.yytext);
|
|
860
|
+
return "DIR";
|
|
861
|
+
case 88:
|
|
862
|
+
yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
|
|
863
|
+
yy.getLogger().debug("Lex (x):", yy_.yytext);
|
|
864
|
+
return "DIR";
|
|
865
|
+
case 89:
|
|
866
|
+
yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
|
|
867
|
+
yy.getLogger().debug("Lex (y):", yy_.yytext);
|
|
868
|
+
return "DIR";
|
|
869
|
+
case 90:
|
|
870
|
+
yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
|
|
871
|
+
yy.getLogger().debug("Lex (up):", yy_.yytext);
|
|
872
|
+
return "DIR";
|
|
873
|
+
case 91:
|
|
874
|
+
yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
|
|
875
|
+
yy.getLogger().debug("Lex (down):", yy_.yytext);
|
|
876
|
+
return "DIR";
|
|
877
|
+
case 92:
|
|
878
|
+
yy_.yytext = "]>";
|
|
879
|
+
yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext);
|
|
880
|
+
this.popState();
|
|
881
|
+
this.popState();
|
|
882
|
+
return "BLOCK_ARROW_END";
|
|
883
|
+
case 93:
|
|
884
|
+
yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
|
|
885
|
+
return 15;
|
|
886
|
+
case 94:
|
|
887
|
+
yy.getLogger().debug("Lex: LINK", yy_.yytext);
|
|
888
|
+
return 15;
|
|
889
|
+
case 95:
|
|
890
|
+
yy.getLogger().debug("Lex: LINK", yy_.yytext);
|
|
891
|
+
return 15;
|
|
892
|
+
case 96:
|
|
893
|
+
yy.getLogger().debug("Lex: LINK", yy_.yytext);
|
|
894
|
+
return 15;
|
|
895
|
+
case 97:
|
|
896
|
+
yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
|
|
897
|
+
this.pushState("LLABEL");
|
|
898
|
+
return 16;
|
|
899
|
+
case 98:
|
|
900
|
+
yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
|
|
901
|
+
this.pushState("LLABEL");
|
|
902
|
+
return 16;
|
|
903
|
+
case 99:
|
|
904
|
+
yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
|
|
905
|
+
this.pushState("LLABEL");
|
|
906
|
+
return 16;
|
|
907
|
+
case 100:
|
|
908
|
+
this.pushState("md_string");
|
|
909
|
+
break;
|
|
910
|
+
case 101:
|
|
911
|
+
yy.getLogger().debug("Lex: Starting string");
|
|
912
|
+
this.pushState("string");
|
|
913
|
+
return "LINK_LABEL";
|
|
914
|
+
case 102:
|
|
915
|
+
this.popState();
|
|
916
|
+
yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
|
|
917
|
+
return 15;
|
|
918
|
+
case 103:
|
|
919
|
+
this.popState();
|
|
920
|
+
yy.getLogger().debug("Lex: LINK", yy_.yytext);
|
|
921
|
+
return 15;
|
|
922
|
+
case 104:
|
|
923
|
+
this.popState();
|
|
924
|
+
yy.getLogger().debug("Lex: LINK", yy_.yytext);
|
|
925
|
+
return 15;
|
|
926
|
+
case 105:
|
|
927
|
+
yy.getLogger().debug("Lex: COLON", yy_.yytext);
|
|
928
|
+
yy_.yytext = yy_.yytext.slice(1);
|
|
929
|
+
return 27;
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
|
|
933
|
+
conditions: { "STYLE_DEFINITION": { "rules": [29], "inclusive": false }, "STYLE_STMNT": { "rules": [28], "inclusive": false }, "CLASSDEFID": { "rules": [23], "inclusive": false }, "CLASSDEF": { "rules": [21, 22], "inclusive": false }, "CLASS_STYLE": { "rules": [26], "inclusive": false }, "CLASS": { "rules": [25], "inclusive": false }, "LLABEL": { "rules": [100, 101, 102, 103, 104], "inclusive": false }, "ARROW_DIR": { "rules": [86, 87, 88, 89, 90, 91, 92], "inclusive": false }, "BLOCK_ARROW": { "rules": [77, 82, 85], "inclusive": false }, "NODE": { "rules": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], "inclusive": false }, "md_string": { "rules": [10, 11, 79, 80], "inclusive": false }, "space": { "rules": [], "inclusive": false }, "string": { "rules": [13, 14, 83, 84], "inclusive": false }, "acc_descr_multiline": { "rules": [35, 36], "inclusive": false }, "acc_descr": { "rules": [33], "inclusive": false }, "acc_title": { "rules": [31], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], "inclusive": true } }
|
|
934
|
+
};
|
|
935
|
+
return lexer2;
|
|
936
|
+
})();
|
|
937
|
+
parser2.lexer = lexer;
|
|
938
|
+
function Parser() {
|
|
939
|
+
this.yy = {};
|
|
940
|
+
}
|
|
941
|
+
Parser.prototype = parser2;
|
|
942
|
+
parser2.Parser = Parser;
|
|
943
|
+
return new Parser();
|
|
944
|
+
})();
|
|
945
|
+
parser.parser = parser;
|
|
946
|
+
const parser$1 = parser;
|
|
947
|
+
let blockDatabase = {};
|
|
948
|
+
let edgeList = [];
|
|
949
|
+
let edgeCount = {};
|
|
950
|
+
const COLOR_KEYWORD = "color";
|
|
951
|
+
const FILL_KEYWORD = "fill";
|
|
952
|
+
const BG_FILL = "bgFill";
|
|
953
|
+
const STYLECLASS_SEP = ",";
|
|
954
|
+
const config = getConfig();
|
|
955
|
+
let classes = {};
|
|
956
|
+
const sanitizeText = (txt) => common$1.sanitizeText(txt, config);
|
|
957
|
+
const addStyleClass = function(id, styleAttributes = "") {
|
|
958
|
+
if (classes[id] === void 0) {
|
|
959
|
+
classes[id] = { id, styles: [], textStyles: [] };
|
|
960
|
+
}
|
|
961
|
+
const foundClass = classes[id];
|
|
962
|
+
if (styleAttributes !== void 0 && styleAttributes !== null) {
|
|
963
|
+
styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
|
|
964
|
+
const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
|
|
965
|
+
if (attrib.match(COLOR_KEYWORD)) {
|
|
966
|
+
const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
|
|
967
|
+
const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
|
|
968
|
+
foundClass.textStyles.push(newStyle2);
|
|
969
|
+
}
|
|
970
|
+
foundClass.styles.push(fixedAttrib);
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
const addStyle2Node = function(id, styles = "") {
|
|
975
|
+
const foundBlock = blockDatabase[id];
|
|
976
|
+
if (styles !== void 0 && styles !== null) {
|
|
977
|
+
foundBlock.styles = styles.split(STYLECLASS_SEP);
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
const setCssClass = function(itemIds, cssClassName) {
|
|
981
|
+
itemIds.split(",").forEach(function(id) {
|
|
982
|
+
let foundBlock = blockDatabase[id];
|
|
983
|
+
if (foundBlock === void 0) {
|
|
984
|
+
const trimmedId = id.trim();
|
|
985
|
+
blockDatabase[trimmedId] = { id: trimmedId, type: "na", children: [] };
|
|
986
|
+
foundBlock = blockDatabase[trimmedId];
|
|
987
|
+
}
|
|
988
|
+
if (!foundBlock.classes) {
|
|
989
|
+
foundBlock.classes = [];
|
|
990
|
+
}
|
|
991
|
+
foundBlock.classes.push(cssClassName);
|
|
992
|
+
});
|
|
993
|
+
};
|
|
994
|
+
const populateBlockDatabase = (_blockList, parent) => {
|
|
995
|
+
const blockList = _blockList.flat();
|
|
996
|
+
const children = [];
|
|
997
|
+
for (const block of blockList) {
|
|
998
|
+
if (block.label) {
|
|
999
|
+
block.label = sanitizeText(block.label);
|
|
1000
|
+
}
|
|
1001
|
+
if (block.type === "classDef") {
|
|
1002
|
+
addStyleClass(block.id, block.css);
|
|
1003
|
+
continue;
|
|
1004
|
+
}
|
|
1005
|
+
if (block.type === "applyClass") {
|
|
1006
|
+
setCssClass(block.id, (block == null ? void 0 : block.styleClass) || "");
|
|
1007
|
+
continue;
|
|
1008
|
+
}
|
|
1009
|
+
if (block.type === "applyStyles") {
|
|
1010
|
+
if (block == null ? void 0 : block.stylesStr) {
|
|
1011
|
+
addStyle2Node(block.id, block == null ? void 0 : block.stylesStr);
|
|
1012
|
+
}
|
|
1013
|
+
continue;
|
|
1014
|
+
}
|
|
1015
|
+
if (block.type === "column-setting") {
|
|
1016
|
+
parent.columns = block.columns || -1;
|
|
1017
|
+
} else if (block.type === "edge") {
|
|
1018
|
+
if (edgeCount[block.id]) {
|
|
1019
|
+
edgeCount[block.id]++;
|
|
1020
|
+
} else {
|
|
1021
|
+
edgeCount[block.id] = 1;
|
|
1022
|
+
}
|
|
1023
|
+
block.id = edgeCount[block.id] + "-" + block.id;
|
|
1024
|
+
edgeList.push(block);
|
|
1025
|
+
} else {
|
|
1026
|
+
if (!block.label) {
|
|
1027
|
+
if (block.type === "composite") {
|
|
1028
|
+
block.label = "";
|
|
1029
|
+
} else {
|
|
1030
|
+
block.label = block.id;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
const newBlock = !blockDatabase[block.id];
|
|
1034
|
+
if (newBlock) {
|
|
1035
|
+
blockDatabase[block.id] = block;
|
|
1036
|
+
} else {
|
|
1037
|
+
if (block.type !== "na") {
|
|
1038
|
+
blockDatabase[block.id].type = block.type;
|
|
1039
|
+
}
|
|
1040
|
+
if (block.label !== block.id) {
|
|
1041
|
+
blockDatabase[block.id].label = block.label;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
if (block.children) {
|
|
1045
|
+
populateBlockDatabase(block.children, block);
|
|
1046
|
+
}
|
|
1047
|
+
if (block.type === "space") {
|
|
1048
|
+
const w = block.width || 1;
|
|
1049
|
+
for (let j = 0; j < w; j++) {
|
|
1050
|
+
const newBlock2 = clone(block);
|
|
1051
|
+
newBlock2.id = newBlock2.id + "-" + j;
|
|
1052
|
+
blockDatabase[newBlock2.id] = newBlock2;
|
|
1053
|
+
children.push(newBlock2);
|
|
1054
|
+
}
|
|
1055
|
+
} else if (newBlock) {
|
|
1056
|
+
children.push(block);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
parent.children = children;
|
|
1061
|
+
};
|
|
1062
|
+
let blocks = [];
|
|
1063
|
+
let rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
|
|
1064
|
+
const clear = () => {
|
|
1065
|
+
log$1.debug("Clear called");
|
|
1066
|
+
clear$1();
|
|
1067
|
+
rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
|
|
1068
|
+
blockDatabase = { root: rootBlock };
|
|
1069
|
+
blocks = [];
|
|
1070
|
+
classes = {};
|
|
1071
|
+
edgeList = [];
|
|
1072
|
+
edgeCount = {};
|
|
1073
|
+
};
|
|
1074
|
+
function typeStr2Type(typeStr) {
|
|
1075
|
+
log$1.debug("typeStr2Type", typeStr);
|
|
1076
|
+
switch (typeStr) {
|
|
1077
|
+
case "[]":
|
|
1078
|
+
return "square";
|
|
1079
|
+
case "()":
|
|
1080
|
+
log$1.debug("we have a round");
|
|
1081
|
+
return "round";
|
|
1082
|
+
case "(())":
|
|
1083
|
+
return "circle";
|
|
1084
|
+
case ">]":
|
|
1085
|
+
return "rect_left_inv_arrow";
|
|
1086
|
+
case "{}":
|
|
1087
|
+
return "diamond";
|
|
1088
|
+
case "{{}}":
|
|
1089
|
+
return "hexagon";
|
|
1090
|
+
case "([])":
|
|
1091
|
+
return "stadium";
|
|
1092
|
+
case "[[]]":
|
|
1093
|
+
return "subroutine";
|
|
1094
|
+
case "[()]":
|
|
1095
|
+
return "cylinder";
|
|
1096
|
+
case "((()))":
|
|
1097
|
+
return "doublecircle";
|
|
1098
|
+
case "[//]":
|
|
1099
|
+
return "lean_right";
|
|
1100
|
+
case "[\\\\]":
|
|
1101
|
+
return "lean_left";
|
|
1102
|
+
case "[/\\]":
|
|
1103
|
+
return "trapezoid";
|
|
1104
|
+
case "[\\/]":
|
|
1105
|
+
return "inv_trapezoid";
|
|
1106
|
+
case "<[]>":
|
|
1107
|
+
return "block_arrow";
|
|
1108
|
+
default:
|
|
1109
|
+
return "na";
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
function edgeTypeStr2Type(typeStr) {
|
|
1113
|
+
log$1.debug("typeStr2Type", typeStr);
|
|
1114
|
+
switch (typeStr) {
|
|
1115
|
+
case "==":
|
|
1116
|
+
return "thick";
|
|
1117
|
+
default:
|
|
1118
|
+
return "normal";
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
function edgeStrToEdgeData(typeStr) {
|
|
1122
|
+
switch (typeStr.trim()) {
|
|
1123
|
+
case "--x":
|
|
1124
|
+
return "arrow_cross";
|
|
1125
|
+
case "--o":
|
|
1126
|
+
return "arrow_circle";
|
|
1127
|
+
default:
|
|
1128
|
+
return "arrow_point";
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
let cnt = 0;
|
|
1132
|
+
const generateId = () => {
|
|
1133
|
+
cnt++;
|
|
1134
|
+
return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
|
|
1135
|
+
};
|
|
1136
|
+
const setHierarchy = (block) => {
|
|
1137
|
+
rootBlock.children = block;
|
|
1138
|
+
populateBlockDatabase(block, rootBlock);
|
|
1139
|
+
blocks = rootBlock.children;
|
|
1140
|
+
};
|
|
1141
|
+
const getColumns = (blockId) => {
|
|
1142
|
+
const block = blockDatabase[blockId];
|
|
1143
|
+
if (!block) {
|
|
1144
|
+
return -1;
|
|
1145
|
+
}
|
|
1146
|
+
if (block.columns) {
|
|
1147
|
+
return block.columns;
|
|
1148
|
+
}
|
|
1149
|
+
if (!block.children) {
|
|
1150
|
+
return -1;
|
|
1151
|
+
}
|
|
1152
|
+
return block.children.length;
|
|
1153
|
+
};
|
|
1154
|
+
const getBlocksFlat = () => {
|
|
1155
|
+
return [...Object.values(blockDatabase)];
|
|
1156
|
+
};
|
|
1157
|
+
const getBlocks = () => {
|
|
1158
|
+
return blocks || [];
|
|
1159
|
+
};
|
|
1160
|
+
const getEdges = () => {
|
|
1161
|
+
return edgeList;
|
|
1162
|
+
};
|
|
1163
|
+
const getBlock = (id) => {
|
|
1164
|
+
return blockDatabase[id];
|
|
1165
|
+
};
|
|
1166
|
+
const setBlock = (block) => {
|
|
1167
|
+
blockDatabase[block.id] = block;
|
|
1168
|
+
};
|
|
1169
|
+
const getLogger = () => console;
|
|
1170
|
+
const getClasses$1 = function() {
|
|
1171
|
+
return classes;
|
|
1172
|
+
};
|
|
1173
|
+
const db = {
|
|
1174
|
+
getConfig: () => getConfig$1().block,
|
|
1175
|
+
typeStr2Type,
|
|
1176
|
+
edgeTypeStr2Type,
|
|
1177
|
+
edgeStrToEdgeData,
|
|
1178
|
+
getLogger,
|
|
1179
|
+
getBlocksFlat,
|
|
1180
|
+
getBlocks,
|
|
1181
|
+
getEdges,
|
|
1182
|
+
setHierarchy,
|
|
1183
|
+
getBlock,
|
|
1184
|
+
setBlock,
|
|
1185
|
+
getColumns,
|
|
1186
|
+
getClasses: getClasses$1,
|
|
1187
|
+
clear,
|
|
1188
|
+
generateId
|
|
1189
|
+
};
|
|
1190
|
+
const db$1 = db;
|
|
1191
|
+
const fade = (color, opacity) => {
|
|
1192
|
+
const channel$1 = channel;
|
|
1193
|
+
const r = channel$1(color, "r");
|
|
1194
|
+
const g = channel$1(color, "g");
|
|
1195
|
+
const b = channel$1(color, "b");
|
|
1196
|
+
return rgba(r, g, b, opacity);
|
|
1197
|
+
};
|
|
1198
|
+
const getStyles = (options) => `.label {
|
|
1199
|
+
font-family: ${options.fontFamily};
|
|
1200
|
+
color: ${options.nodeTextColor || options.textColor};
|
|
1201
|
+
}
|
|
1202
|
+
.cluster-label text {
|
|
1203
|
+
fill: ${options.titleColor};
|
|
1204
|
+
}
|
|
1205
|
+
.cluster-label span,p {
|
|
1206
|
+
color: ${options.titleColor};
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
.label text,span,p {
|
|
1212
|
+
fill: ${options.nodeTextColor || options.textColor};
|
|
1213
|
+
color: ${options.nodeTextColor || options.textColor};
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
.node rect,
|
|
1217
|
+
.node circle,
|
|
1218
|
+
.node ellipse,
|
|
1219
|
+
.node polygon,
|
|
1220
|
+
.node path {
|
|
1221
|
+
fill: ${options.mainBkg};
|
|
1222
|
+
stroke: ${options.nodeBorder};
|
|
1223
|
+
stroke-width: 1px;
|
|
1224
|
+
}
|
|
1225
|
+
.flowchart-label text {
|
|
1226
|
+
text-anchor: middle;
|
|
1227
|
+
}
|
|
1228
|
+
// .flowchart-label .text-outer-tspan {
|
|
1229
|
+
// text-anchor: middle;
|
|
1230
|
+
// }
|
|
1231
|
+
// .flowchart-label .text-inner-tspan {
|
|
1232
|
+
// text-anchor: start;
|
|
1233
|
+
// }
|
|
1234
|
+
|
|
1235
|
+
.node .label {
|
|
1236
|
+
text-align: center;
|
|
1237
|
+
}
|
|
1238
|
+
.node.clickable {
|
|
1239
|
+
cursor: pointer;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.arrowheadPath {
|
|
1243
|
+
fill: ${options.arrowheadColor};
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
.edgePath .path {
|
|
1247
|
+
stroke: ${options.lineColor};
|
|
1248
|
+
stroke-width: 2.0px;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
.flowchart-link {
|
|
1252
|
+
stroke: ${options.lineColor};
|
|
1253
|
+
fill: none;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
.edgeLabel {
|
|
1257
|
+
background-color: ${options.edgeLabelBackground};
|
|
1258
|
+
rect {
|
|
1259
|
+
opacity: 0.5;
|
|
1260
|
+
background-color: ${options.edgeLabelBackground};
|
|
1261
|
+
fill: ${options.edgeLabelBackground};
|
|
1262
|
+
}
|
|
1263
|
+
text-align: center;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/* For html labels only */
|
|
1267
|
+
.labelBkg {
|
|
1268
|
+
background-color: ${fade(options.edgeLabelBackground, 0.5)};
|
|
1269
|
+
// background-color:
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
.node .cluster {
|
|
1273
|
+
// fill: ${fade(options.mainBkg, 0.5)};
|
|
1274
|
+
fill: ${fade(options.clusterBkg, 0.5)};
|
|
1275
|
+
stroke: ${fade(options.clusterBorder, 0.2)};
|
|
1276
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
1277
|
+
stroke-width: 1px;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
.cluster text {
|
|
1281
|
+
fill: ${options.titleColor};
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
.cluster span,p {
|
|
1285
|
+
color: ${options.titleColor};
|
|
1286
|
+
}
|
|
1287
|
+
/* .cluster div {
|
|
1288
|
+
color: ${options.titleColor};
|
|
1289
|
+
} */
|
|
1290
|
+
|
|
1291
|
+
div.mermaidTooltip {
|
|
1292
|
+
position: absolute;
|
|
1293
|
+
text-align: center;
|
|
1294
|
+
max-width: 200px;
|
|
1295
|
+
padding: 2px;
|
|
1296
|
+
font-family: ${options.fontFamily};
|
|
1297
|
+
font-size: 12px;
|
|
1298
|
+
background: ${options.tertiaryColor};
|
|
1299
|
+
border: 1px solid ${options.border2};
|
|
1300
|
+
border-radius: 2px;
|
|
1301
|
+
pointer-events: none;
|
|
1302
|
+
z-index: 100;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
.flowchartTitleText {
|
|
1306
|
+
text-anchor: middle;
|
|
1307
|
+
font-size: 18px;
|
|
1308
|
+
fill: ${options.textColor};
|
|
1309
|
+
}
|
|
1310
|
+
`;
|
|
1311
|
+
const flowStyles = getStyles;
|
|
1312
|
+
function getNodeFromBlock(block, db2, positioned = false) {
|
|
1313
|
+
var _a2, _b2, _c;
|
|
1314
|
+
const vertex = block;
|
|
1315
|
+
let classStr = "default";
|
|
1316
|
+
if ((((_a2 = vertex == null ? void 0 : vertex.classes) == null ? void 0 : _a2.length) || 0) > 0) {
|
|
1317
|
+
classStr = ((vertex == null ? void 0 : vertex.classes) || []).join(" ");
|
|
1318
|
+
}
|
|
1319
|
+
classStr = classStr + " flowchart-label";
|
|
1320
|
+
let radius = 0;
|
|
1321
|
+
let shape = "";
|
|
1322
|
+
let padding2;
|
|
1323
|
+
switch (vertex.type) {
|
|
1324
|
+
case "round":
|
|
1325
|
+
radius = 5;
|
|
1326
|
+
shape = "rect";
|
|
1327
|
+
break;
|
|
1328
|
+
case "composite":
|
|
1329
|
+
radius = 0;
|
|
1330
|
+
shape = "composite";
|
|
1331
|
+
padding2 = 0;
|
|
1332
|
+
break;
|
|
1333
|
+
case "square":
|
|
1334
|
+
shape = "rect";
|
|
1335
|
+
break;
|
|
1336
|
+
case "diamond":
|
|
1337
|
+
shape = "question";
|
|
1338
|
+
break;
|
|
1339
|
+
case "hexagon":
|
|
1340
|
+
shape = "hexagon";
|
|
1341
|
+
break;
|
|
1342
|
+
case "block_arrow":
|
|
1343
|
+
shape = "block_arrow";
|
|
1344
|
+
break;
|
|
1345
|
+
case "odd":
|
|
1346
|
+
shape = "rect_left_inv_arrow";
|
|
1347
|
+
break;
|
|
1348
|
+
case "lean_right":
|
|
1349
|
+
shape = "lean_right";
|
|
1350
|
+
break;
|
|
1351
|
+
case "lean_left":
|
|
1352
|
+
shape = "lean_left";
|
|
1353
|
+
break;
|
|
1354
|
+
case "trapezoid":
|
|
1355
|
+
shape = "trapezoid";
|
|
1356
|
+
break;
|
|
1357
|
+
case "inv_trapezoid":
|
|
1358
|
+
shape = "inv_trapezoid";
|
|
1359
|
+
break;
|
|
1360
|
+
case "rect_left_inv_arrow":
|
|
1361
|
+
shape = "rect_left_inv_arrow";
|
|
1362
|
+
break;
|
|
1363
|
+
case "circle":
|
|
1364
|
+
shape = "circle";
|
|
1365
|
+
break;
|
|
1366
|
+
case "ellipse":
|
|
1367
|
+
shape = "ellipse";
|
|
1368
|
+
break;
|
|
1369
|
+
case "stadium":
|
|
1370
|
+
shape = "stadium";
|
|
1371
|
+
break;
|
|
1372
|
+
case "subroutine":
|
|
1373
|
+
shape = "subroutine";
|
|
1374
|
+
break;
|
|
1375
|
+
case "cylinder":
|
|
1376
|
+
shape = "cylinder";
|
|
1377
|
+
break;
|
|
1378
|
+
case "group":
|
|
1379
|
+
shape = "rect";
|
|
1380
|
+
break;
|
|
1381
|
+
case "doublecircle":
|
|
1382
|
+
shape = "doublecircle";
|
|
1383
|
+
break;
|
|
1384
|
+
default:
|
|
1385
|
+
shape = "rect";
|
|
1386
|
+
}
|
|
1387
|
+
const styles = getStylesFromArray((vertex == null ? void 0 : vertex.styles) || []);
|
|
1388
|
+
const vertexText = vertex.label;
|
|
1389
|
+
const bounds = vertex.size || { width: 0, height: 0, x: 0, y: 0 };
|
|
1390
|
+
const node = {
|
|
1391
|
+
labelStyle: styles.labelStyle,
|
|
1392
|
+
shape,
|
|
1393
|
+
labelText: vertexText,
|
|
1394
|
+
rx: radius,
|
|
1395
|
+
ry: radius,
|
|
1396
|
+
class: classStr,
|
|
1397
|
+
style: styles.style,
|
|
1398
|
+
id: vertex.id,
|
|
1399
|
+
directions: vertex.directions,
|
|
1400
|
+
width: bounds.width,
|
|
1401
|
+
height: bounds.height,
|
|
1402
|
+
x: bounds.x,
|
|
1403
|
+
y: bounds.y,
|
|
1404
|
+
positioned,
|
|
1405
|
+
intersect: void 0,
|
|
1406
|
+
type: vertex.type,
|
|
1407
|
+
padding: padding2 ?? (((_c = (_b2 = getConfig$1()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) || 0)
|
|
1408
|
+
};
|
|
1409
|
+
return node;
|
|
1410
|
+
}
|
|
1411
|
+
async function calculateBlockSize(elem, block, db2) {
|
|
1412
|
+
const node = getNodeFromBlock(block, db2, false);
|
|
1413
|
+
if (node.type === "group") {
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
const nodeEl = await insertNode(elem, node);
|
|
1417
|
+
const boundingBox = nodeEl.node().getBBox();
|
|
1418
|
+
const obj = db2.getBlock(node.id);
|
|
1419
|
+
obj.size = { width: boundingBox.width, height: boundingBox.height, x: 0, y: 0, node: nodeEl };
|
|
1420
|
+
db2.setBlock(obj);
|
|
1421
|
+
nodeEl.remove();
|
|
1422
|
+
}
|
|
1423
|
+
async function insertBlockPositioned(elem, block, db2) {
|
|
1424
|
+
const node = getNodeFromBlock(block, db2, true);
|
|
1425
|
+
const obj = db2.getBlock(node.id);
|
|
1426
|
+
if (obj.type !== "space") {
|
|
1427
|
+
await insertNode(elem, node);
|
|
1428
|
+
block.intersect = node == null ? void 0 : node.intersect;
|
|
1429
|
+
positionNode(node);
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
async function performOperations(elem, blocks2, db2, operation) {
|
|
1433
|
+
for (const block of blocks2) {
|
|
1434
|
+
await operation(elem, block, db2);
|
|
1435
|
+
if (block.children) {
|
|
1436
|
+
await performOperations(elem, block.children, db2, operation);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
async function calculateBlockSizes(elem, blocks2, db2) {
|
|
1441
|
+
await performOperations(elem, blocks2, db2, calculateBlockSize);
|
|
1442
|
+
}
|
|
1443
|
+
async function insertBlocks(elem, blocks2, db2) {
|
|
1444
|
+
await performOperations(elem, blocks2, db2, insertBlockPositioned);
|
|
1445
|
+
}
|
|
1446
|
+
async function insertEdges(elem, edges, blocks2, db2, id) {
|
|
1447
|
+
const g = new Graph({
|
|
1448
|
+
multigraph: true,
|
|
1449
|
+
compound: true
|
|
1450
|
+
});
|
|
1451
|
+
g.setGraph({
|
|
1452
|
+
rankdir: "TB",
|
|
1453
|
+
nodesep: 10,
|
|
1454
|
+
ranksep: 10,
|
|
1455
|
+
marginx: 8,
|
|
1456
|
+
marginy: 8
|
|
1457
|
+
});
|
|
1458
|
+
for (const block of blocks2) {
|
|
1459
|
+
if (block.size) {
|
|
1460
|
+
g.setNode(block.id, {
|
|
1461
|
+
width: block.size.width,
|
|
1462
|
+
height: block.size.height,
|
|
1463
|
+
intersect: block.intersect
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
for (const edge of edges) {
|
|
1468
|
+
if (edge.start && edge.end) {
|
|
1469
|
+
const startBlock = db2.getBlock(edge.start);
|
|
1470
|
+
const endBlock = db2.getBlock(edge.end);
|
|
1471
|
+
if ((startBlock == null ? void 0 : startBlock.size) && (endBlock == null ? void 0 : endBlock.size)) {
|
|
1472
|
+
const start = startBlock.size;
|
|
1473
|
+
const end = endBlock.size;
|
|
1474
|
+
const points = [
|
|
1475
|
+
{ x: start.x, y: start.y },
|
|
1476
|
+
{ x: start.x + (end.x - start.x) / 2, y: start.y + (end.y - start.y) / 2 },
|
|
1477
|
+
{ x: end.x, y: end.y }
|
|
1478
|
+
];
|
|
1479
|
+
await insertEdge(
|
|
1480
|
+
elem,
|
|
1481
|
+
{ v: edge.start, w: edge.end, name: edge.id },
|
|
1482
|
+
{
|
|
1483
|
+
...edge,
|
|
1484
|
+
arrowTypeEnd: edge.arrowTypeEnd,
|
|
1485
|
+
arrowTypeStart: edge.arrowTypeStart,
|
|
1486
|
+
points,
|
|
1487
|
+
classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
|
|
1488
|
+
},
|
|
1489
|
+
void 0,
|
|
1490
|
+
"block",
|
|
1491
|
+
g,
|
|
1492
|
+
id
|
|
1493
|
+
);
|
|
1494
|
+
if (edge.label) {
|
|
1495
|
+
await insertEdgeLabel(elem, {
|
|
1496
|
+
...edge,
|
|
1497
|
+
label: edge.label,
|
|
1498
|
+
labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
|
|
1499
|
+
arrowTypeEnd: edge.arrowTypeEnd,
|
|
1500
|
+
arrowTypeStart: edge.arrowTypeStart
|
|
1501
|
+
});
|
|
1502
|
+
await positionEdgeLabel(
|
|
1503
|
+
{ ...edge, x: points[1].x, y: points[1].y },
|
|
1504
|
+
{
|
|
1505
|
+
originalPath: points
|
|
1506
|
+
}
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
const padding = ((_b = (_a = getConfig()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) || 8;
|
|
1514
|
+
function calculateBlockPosition(columns, position) {
|
|
1515
|
+
if (columns === 0 || !Number.isInteger(columns)) {
|
|
1516
|
+
throw new Error("Columns must be an integer !== 0.");
|
|
1517
|
+
}
|
|
1518
|
+
if (position < 0 || !Number.isInteger(position)) {
|
|
1519
|
+
throw new Error("Position must be a non-negative integer." + position);
|
|
1520
|
+
}
|
|
1521
|
+
if (columns < 0) {
|
|
1522
|
+
return { px: position, py: 0 };
|
|
1523
|
+
}
|
|
1524
|
+
if (columns === 1) {
|
|
1525
|
+
return { px: 0, py: position };
|
|
1526
|
+
}
|
|
1527
|
+
const px = position % columns;
|
|
1528
|
+
const py = Math.floor(position / columns);
|
|
1529
|
+
return { px, py };
|
|
1530
|
+
}
|
|
1531
|
+
const getMaxChildSize = (block) => {
|
|
1532
|
+
let maxWidth = 0;
|
|
1533
|
+
let maxHeight = 0;
|
|
1534
|
+
for (const child of block.children) {
|
|
1535
|
+
const { width, height, x, y } = child.size || { width: 0, height: 0, x: 0, y: 0 };
|
|
1536
|
+
log$1.debug(
|
|
1537
|
+
"getMaxChildSize abc95 child:",
|
|
1538
|
+
child.id,
|
|
1539
|
+
"width:",
|
|
1540
|
+
width,
|
|
1541
|
+
"height:",
|
|
1542
|
+
height,
|
|
1543
|
+
"x:",
|
|
1544
|
+
x,
|
|
1545
|
+
"y:",
|
|
1546
|
+
y,
|
|
1547
|
+
child.type
|
|
1548
|
+
);
|
|
1549
|
+
if (child.type === "space") {
|
|
1550
|
+
continue;
|
|
1551
|
+
}
|
|
1552
|
+
if (width > maxWidth) {
|
|
1553
|
+
maxWidth = width / (block.widthInColumns || 1);
|
|
1554
|
+
}
|
|
1555
|
+
if (height > maxHeight) {
|
|
1556
|
+
maxHeight = height;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
return { width: maxWidth, height: maxHeight };
|
|
1560
|
+
};
|
|
1561
|
+
function setBlockSizes(block, db2, siblingWidth = 0, siblingHeight = 0) {
|
|
1562
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
1563
|
+
log$1.debug(
|
|
1564
|
+
"setBlockSizes abc95 (start)",
|
|
1565
|
+
block.id,
|
|
1566
|
+
(_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x,
|
|
1567
|
+
"block width =",
|
|
1568
|
+
block == null ? void 0 : block.size,
|
|
1569
|
+
"sieblingWidth",
|
|
1570
|
+
siblingWidth
|
|
1571
|
+
);
|
|
1572
|
+
if (!((_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.width)) {
|
|
1573
|
+
block.size = {
|
|
1574
|
+
width: siblingWidth,
|
|
1575
|
+
height: siblingHeight,
|
|
1576
|
+
x: 0,
|
|
1577
|
+
y: 0
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
let maxWidth = 0;
|
|
1581
|
+
let maxHeight = 0;
|
|
1582
|
+
if (((_c = block.children) == null ? void 0 : _c.length) > 0) {
|
|
1583
|
+
for (const child of block.children) {
|
|
1584
|
+
setBlockSizes(child, db2);
|
|
1585
|
+
}
|
|
1586
|
+
const childSize = getMaxChildSize(block);
|
|
1587
|
+
maxWidth = childSize.width;
|
|
1588
|
+
maxHeight = childSize.height;
|
|
1589
|
+
log$1.debug("setBlockSizes abc95 maxWidth of", block.id, ":s children is ", maxWidth, maxHeight);
|
|
1590
|
+
for (const child of block.children) {
|
|
1591
|
+
if (child.size) {
|
|
1592
|
+
log$1.debug(
|
|
1593
|
+
`abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${child.size}`
|
|
1594
|
+
);
|
|
1595
|
+
child.size.width = maxWidth * (child.widthInColumns || 1) + padding * ((child.widthInColumns || 1) - 1);
|
|
1596
|
+
child.size.height = maxHeight;
|
|
1597
|
+
child.size.x = 0;
|
|
1598
|
+
child.size.y = 0;
|
|
1599
|
+
log$1.debug(
|
|
1600
|
+
`abc95 updating size of ${block.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}`
|
|
1601
|
+
);
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
for (const child of block.children) {
|
|
1605
|
+
setBlockSizes(child, db2, maxWidth, maxHeight);
|
|
1606
|
+
}
|
|
1607
|
+
const columns = block.columns || -1;
|
|
1608
|
+
let numItems = 0;
|
|
1609
|
+
for (const child of block.children) {
|
|
1610
|
+
numItems += child.widthInColumns || 1;
|
|
1611
|
+
}
|
|
1612
|
+
let xSize = block.children.length;
|
|
1613
|
+
if (columns > 0 && columns < numItems) {
|
|
1614
|
+
xSize = columns;
|
|
1615
|
+
}
|
|
1616
|
+
block.widthInColumns || 1;
|
|
1617
|
+
const ySize = Math.ceil(numItems / xSize);
|
|
1618
|
+
let width = xSize * (maxWidth + padding) + padding;
|
|
1619
|
+
let height = ySize * (maxHeight + padding) + padding;
|
|
1620
|
+
if (width < siblingWidth) {
|
|
1621
|
+
log$1.debug(
|
|
1622
|
+
`Detected to small siebling: abc95 ${block.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width}`
|
|
1623
|
+
);
|
|
1624
|
+
width = siblingWidth;
|
|
1625
|
+
height = siblingHeight;
|
|
1626
|
+
const childWidth = (siblingWidth - xSize * padding - padding) / xSize;
|
|
1627
|
+
const childHeight = (siblingHeight - ySize * padding - padding) / ySize;
|
|
1628
|
+
log$1.debug("Size indata abc88", block.id, "childWidth", childWidth, "maxWidth", maxWidth);
|
|
1629
|
+
log$1.debug("Size indata abc88", block.id, "childHeight", childHeight, "maxHeight", maxHeight);
|
|
1630
|
+
log$1.debug("Size indata abc88 xSize", xSize, "padding", padding);
|
|
1631
|
+
for (const child of block.children) {
|
|
1632
|
+
if (child.size) {
|
|
1633
|
+
child.size.width = childWidth;
|
|
1634
|
+
child.size.height = childHeight;
|
|
1635
|
+
child.size.x = 0;
|
|
1636
|
+
child.size.y = 0;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
log$1.debug(
|
|
1641
|
+
`abc95 (finale calc) ${block.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block.children.length} width=${Math.max(width, ((_d = block.size) == null ? void 0 : _d.width) || 0)}`
|
|
1642
|
+
);
|
|
1643
|
+
if (width < (((_e = block == null ? void 0 : block.size) == null ? void 0 : _e.width) || 0)) {
|
|
1644
|
+
width = ((_f = block == null ? void 0 : block.size) == null ? void 0 : _f.width) || 0;
|
|
1645
|
+
const num = columns > 0 ? Math.min(block.children.length, columns) : block.children.length;
|
|
1646
|
+
if (num > 0) {
|
|
1647
|
+
const childWidth = (width - num * padding - padding) / num;
|
|
1648
|
+
log$1.debug("abc95 (growing to fit) width", block.id, width, (_g = block.size) == null ? void 0 : _g.width, childWidth);
|
|
1649
|
+
for (const child of block.children) {
|
|
1650
|
+
if (child.size) {
|
|
1651
|
+
child.size.width = childWidth;
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
block.size = {
|
|
1657
|
+
width,
|
|
1658
|
+
height,
|
|
1659
|
+
x: 0,
|
|
1660
|
+
y: 0
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
log$1.debug(
|
|
1664
|
+
"setBlockSizes abc94 (done)",
|
|
1665
|
+
block.id,
|
|
1666
|
+
(_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x,
|
|
1667
|
+
(_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width,
|
|
1668
|
+
(_j = block == null ? void 0 : block.size) == null ? void 0 : _j.y,
|
|
1669
|
+
(_k = block == null ? void 0 : block.size) == null ? void 0 : _k.height
|
|
1670
|
+
);
|
|
1671
|
+
}
|
|
1672
|
+
function layoutBlocks(block, db2) {
|
|
1673
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
1674
|
+
log$1.debug(
|
|
1675
|
+
`abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${(_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x} y: ${(_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.y} width: ${(_c = block == null ? void 0 : block.size) == null ? void 0 : _c.width}`
|
|
1676
|
+
);
|
|
1677
|
+
const columns = block.columns || -1;
|
|
1678
|
+
log$1.debug("layoutBlocks columns abc95", block.id, "=>", columns, block);
|
|
1679
|
+
if (block.children && // find max width of children
|
|
1680
|
+
block.children.length > 0) {
|
|
1681
|
+
const width = ((_e = (_d = block == null ? void 0 : block.children[0]) == null ? void 0 : _d.size) == null ? void 0 : _e.width) || 0;
|
|
1682
|
+
const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
|
|
1683
|
+
log$1.debug("widthOfChildren 88", widthOfChildren, "posX");
|
|
1684
|
+
let columnPos = 0;
|
|
1685
|
+
log$1.debug("abc91 block?.size?.x", block.id, (_f = block == null ? void 0 : block.size) == null ? void 0 : _f.x);
|
|
1686
|
+
let startingPosX = ((_g = block == null ? void 0 : block.size) == null ? void 0 : _g.x) ? ((_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x) + (-((_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width) / 2 || 0) : -padding;
|
|
1687
|
+
let rowPos = 0;
|
|
1688
|
+
for (const child of block.children) {
|
|
1689
|
+
const parent = block;
|
|
1690
|
+
if (!child.size) {
|
|
1691
|
+
continue;
|
|
1692
|
+
}
|
|
1693
|
+
const { width: width2, height } = child.size;
|
|
1694
|
+
const { px, py } = calculateBlockPosition(columns, columnPos);
|
|
1695
|
+
if (py != rowPos) {
|
|
1696
|
+
rowPos = py;
|
|
1697
|
+
startingPosX = ((_j = block == null ? void 0 : block.size) == null ? void 0 : _j.x) ? ((_k = block == null ? void 0 : block.size) == null ? void 0 : _k.x) + (-((_l = block == null ? void 0 : block.size) == null ? void 0 : _l.width) / 2 || 0) : -padding;
|
|
1698
|
+
log$1.debug("New row in layout for block", block.id, " and child ", child.id, rowPos);
|
|
1699
|
+
}
|
|
1700
|
+
log$1.debug(
|
|
1701
|
+
`abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${(_m = parent == null ? void 0 : parent.size) == null ? void 0 : _m.x},${(_n = parent == null ? void 0 : parent.size) == null ? void 0 : _n.y}) parent: ${parent.id} width: ${width2}${padding}`
|
|
1702
|
+
);
|
|
1703
|
+
if (parent.size) {
|
|
1704
|
+
const halfWidth = width2 / 2;
|
|
1705
|
+
child.size.x = startingPosX + padding + halfWidth;
|
|
1706
|
+
log$1.debug(
|
|
1707
|
+
`abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width2} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
|
|
1708
|
+
);
|
|
1709
|
+
startingPosX = child.size.x + halfWidth;
|
|
1710
|
+
child.size.y = parent.size.y - parent.size.height / 2 + py * (height + padding) + height / 2 + padding;
|
|
1711
|
+
log$1.debug(
|
|
1712
|
+
`abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
|
|
1713
|
+
);
|
|
1714
|
+
}
|
|
1715
|
+
if (child.children) {
|
|
1716
|
+
layoutBlocks(child);
|
|
1717
|
+
}
|
|
1718
|
+
columnPos += (child == null ? void 0 : child.widthInColumns) || 1;
|
|
1719
|
+
log$1.debug("abc88 columnsPos", child, columnPos);
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
log$1.debug(
|
|
1723
|
+
`layout blocks (<==layoutBlocks) ${block.id} x: ${(_o = block == null ? void 0 : block.size) == null ? void 0 : _o.x} y: ${(_p = block == null ? void 0 : block.size) == null ? void 0 : _p.y} width: ${(_q = block == null ? void 0 : block.size) == null ? void 0 : _q.width}`
|
|
1724
|
+
);
|
|
1725
|
+
}
|
|
1726
|
+
function findBounds(block, { minX, minY, maxX, maxY } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
|
|
1727
|
+
if (block.size && block.id !== "root") {
|
|
1728
|
+
const { x, y, width, height } = block.size;
|
|
1729
|
+
if (x - width / 2 < minX) {
|
|
1730
|
+
minX = x - width / 2;
|
|
1731
|
+
}
|
|
1732
|
+
if (y - height / 2 < minY) {
|
|
1733
|
+
minY = y - height / 2;
|
|
1734
|
+
}
|
|
1735
|
+
if (x + width / 2 > maxX) {
|
|
1736
|
+
maxX = x + width / 2;
|
|
1737
|
+
}
|
|
1738
|
+
if (y + height / 2 > maxY) {
|
|
1739
|
+
maxY = y + height / 2;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
if (block.children) {
|
|
1743
|
+
for (const child of block.children) {
|
|
1744
|
+
({ minX, minY, maxX, maxY } = findBounds(child, { minX, minY, maxX, maxY }));
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
return { minX, minY, maxX, maxY };
|
|
1748
|
+
}
|
|
1749
|
+
function layout(db2) {
|
|
1750
|
+
const root = db2.getBlock("root");
|
|
1751
|
+
if (!root) {
|
|
1752
|
+
return;
|
|
1753
|
+
}
|
|
1754
|
+
setBlockSizes(root, db2, 0, 0);
|
|
1755
|
+
layoutBlocks(root);
|
|
1756
|
+
log$1.debug("getBlocks", JSON.stringify(root, null, 2));
|
|
1757
|
+
const { minX, minY, maxX, maxY } = findBounds(root);
|
|
1758
|
+
const height = maxY - minY;
|
|
1759
|
+
const width = maxX - minX;
|
|
1760
|
+
return { x: minX, y: minY, width, height };
|
|
1761
|
+
}
|
|
1762
|
+
const getClasses = function(text, diagObj) {
|
|
1763
|
+
return diagObj.db.getClasses();
|
|
1764
|
+
};
|
|
1765
|
+
const draw = async function(text, id, _version, diagObj) {
|
|
1766
|
+
const { securityLevel, block: conf } = getConfig$1();
|
|
1767
|
+
const db2 = diagObj.db;
|
|
1768
|
+
let sandboxElement;
|
|
1769
|
+
if (securityLevel === "sandbox") {
|
|
1770
|
+
sandboxElement = select("#i" + id);
|
|
1771
|
+
}
|
|
1772
|
+
const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
|
|
1773
|
+
const svg = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
|
|
1774
|
+
const markers = ["point", "circle", "cross"];
|
|
1775
|
+
insertMarkers$1(svg, markers, diagObj.type, id);
|
|
1776
|
+
const bl = db2.getBlocks();
|
|
1777
|
+
const blArr = db2.getBlocksFlat();
|
|
1778
|
+
const edges = db2.getEdges();
|
|
1779
|
+
const nodes = svg.insert("g").attr("class", "block");
|
|
1780
|
+
await calculateBlockSizes(nodes, bl, db2);
|
|
1781
|
+
const bounds = layout(db2);
|
|
1782
|
+
await insertBlocks(nodes, bl, db2);
|
|
1783
|
+
await insertEdges(nodes, edges, blArr, db2, id);
|
|
1784
|
+
if (bounds) {
|
|
1785
|
+
const bounds2 = bounds;
|
|
1786
|
+
const magicFactor = Math.max(1, Math.round(0.125 * (bounds2.width / bounds2.height)));
|
|
1787
|
+
const height = bounds2.height + magicFactor + 10;
|
|
1788
|
+
const width = bounds2.width + 10;
|
|
1789
|
+
const { useMaxWidth } = conf;
|
|
1790
|
+
configureSvgSize(svg, height, width, !!useMaxWidth);
|
|
1791
|
+
log$1.debug("Here Bounds", bounds, bounds2);
|
|
1792
|
+
svg.attr(
|
|
1793
|
+
"viewBox",
|
|
1794
|
+
`${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`
|
|
1795
|
+
);
|
|
1796
|
+
}
|
|
1797
|
+
ordinal(schemeTableau10);
|
|
1798
|
+
};
|
|
1799
|
+
const renderer = {
|
|
1800
|
+
draw,
|
|
1801
|
+
getClasses
|
|
1802
|
+
};
|
|
1803
|
+
const diagram = {
|
|
1804
|
+
parser: parser$1,
|
|
1805
|
+
db: db$1,
|
|
1806
|
+
renderer,
|
|
1807
|
+
styles: flowStyles
|
|
1808
|
+
};
|
|
1809
|
+
export {
|
|
1810
|
+
diagram
|
|
1811
|
+
};
|