lowcoder-comps 0.0.20 → 0.0.22

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 (58) hide show
  1. package/029c585a.js +825 -0
  2. package/0f49842f.js +915 -0
  3. package/14c95def.js +2396 -0
  4. package/{5a7c40d7.js → 14de54b2.js} +7120 -6939
  5. package/17b0984b.js +1116 -0
  6. package/{a1f987b7.js → 1a4b39ab.js} +29 -30
  7. package/1e35aee7.js +932 -0
  8. package/{804e952b.js → 1f97d569.js} +73 -76
  9. package/3120eee5.js +1235 -0
  10. package/313e94fb.js +796 -0
  11. package/{384b70d4.js → 41a4677f.js} +10 -12
  12. package/{e1466a22.js → 48a69d01.js} +89 -97
  13. package/4a8006fe.js +2501 -0
  14. package/{a06ced05.js → 585231df.js} +64 -71
  15. package/5e96f5d8.js +64 -0
  16. package/5f9be850.js +1055 -0
  17. package/{3196b84f.js → 6e0c66a6.js} +97 -109
  18. package/76d315c1.js +2192 -0
  19. package/{31c6e136.js → 867cdd47.js} +1 -1
  20. package/{0d5d7030.js → 8a65542f.js} +58 -64
  21. package/913e1a65.js +804 -0
  22. package/92e85b65.js +65 -0
  23. package/97298a99.js +2966 -0
  24. package/{5fd0f607.js → a396e61e.js} +44 -44
  25. package/a6d42292.js +1284 -0
  26. package/afd2e4d5.js +86 -0
  27. package/be5f3226.js +768 -0
  28. package/{4791bdd6.js → bf75928a.js} +30142 -30663
  29. package/{011ccb4a.js → bfd01456.js} +4257 -4221
  30. package/c239ec69.js +1000 -0
  31. package/e731f493.js +502 -0
  32. package/ef3524ce.js +960 -0
  33. package/f5b4a4bc.js +365 -0
  34. package/{8d714103.js → fa29410e.js} +598 -622
  35. package/fbc7bdd4.js +218 -0
  36. package/index.js +2 -2
  37. package/package.json +2 -2
  38. package/01102044.js +0 -940
  39. package/0e8dfd52.js +0 -793
  40. package/0f25771b.js +0 -1118
  41. package/2470e1d8.js +0 -91
  42. package/32432dc3.js +0 -86
  43. package/36552e14.js +0 -849
  44. package/3ad35722.js +0 -365
  45. package/3f4db197.js +0 -943
  46. package/71827e37.js +0 -1032
  47. package/7a200c6a.js +0 -607
  48. package/872f2918.js +0 -7
  49. package/93b98f3e.js +0 -832
  50. package/a42a2ba9.js +0 -2103
  51. package/af0489f3.js +0 -2456
  52. package/b56f953d.js +0 -985
  53. package/b89c6a6a.js +0 -159
  54. package/bc7030d3.js +0 -70
  55. package/c739ba3e.js +0 -2679
  56. package/d306d59c.js +0 -2827
  57. package/d8adcd1e.js +0 -823
  58. package/ef845d7f.js +0 -1246
package/3f4db197.js DELETED
@@ -1,943 +0,0 @@
1
- import { c as V, s as xt, g as Rt, b as Ot, a as bt, z as Nt, A as Tt, m as At, l as et, B as Mt, h as st, x as vt, i as Dt, D as wt, E as It } from "./4791bdd6.js";
2
- import { G as St, l as Lt } from "./c739ba3e.js";
3
- import { l as Bt } from "./31c6e136.js";
4
- import "./2ff2c7a6.js";
5
- import "./256b619e.js";
6
- const Ct = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
7
- function Pt(t) {
8
- return typeof t == "string" && Ct.test(t);
9
- }
10
- const T = [];
11
- for (let t = 0; t < 256; ++t)
12
- T.push((t + 256).toString(16).slice(1));
13
- function Yt(t, r = 0) {
14
- return (T[t[r + 0]] + T[t[r + 1]] + T[t[r + 2]] + T[t[r + 3]] + "-" + T[t[r + 4]] + T[t[r + 5]] + "-" + T[t[r + 6]] + T[t[r + 7]] + "-" + T[t[r + 8]] + T[t[r + 9]] + "-" + T[t[r + 10]] + T[t[r + 11]] + T[t[r + 12]] + T[t[r + 13]] + T[t[r + 14]] + T[t[r + 15]]).toLowerCase();
15
- }
16
- function Zt(t) {
17
- if (!Pt(t))
18
- throw TypeError("Invalid UUID");
19
- let r;
20
- const e = new Uint8Array(16);
21
- return e[0] = (r = parseInt(t.slice(0, 8), 16)) >>> 24, e[1] = r >>> 16 & 255, e[2] = r >>> 8 & 255, e[3] = r & 255, e[4] = (r = parseInt(t.slice(9, 13), 16)) >>> 8, e[5] = r & 255, e[6] = (r = parseInt(t.slice(14, 18), 16)) >>> 8, e[7] = r & 255, e[8] = (r = parseInt(t.slice(19, 23), 16)) >>> 8, e[9] = r & 255, e[10] = (r = parseInt(t.slice(24, 36), 16)) / 1099511627776 & 255, e[11] = r / 4294967296 & 255, e[12] = r >>> 24 & 255, e[13] = r >>> 16 & 255, e[14] = r >>> 8 & 255, e[15] = r & 255, e;
22
- }
23
- function Ft(t) {
24
- t = unescape(encodeURIComponent(t));
25
- const r = [];
26
- for (let e = 0; e < t.length; ++e)
27
- r.push(t.charCodeAt(e));
28
- return r;
29
- }
30
- const Wt = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", Vt = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
31
- function Ut(t, r, e) {
32
- function n(s, p, f, o) {
33
- var c;
34
- if (typeof s == "string" && (s = Ft(s)), typeof p == "string" && (p = Zt(p)), ((c = p) === null || c === void 0 ? void 0 : c.length) !== 16)
35
- throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
36
- let _ = new Uint8Array(16 + s.length);
37
- if (_.set(p), _.set(s, p.length), _ = e(_), _[6] = _[6] & 15 | r, _[8] = _[8] & 63 | 128, f) {
38
- o = o || 0;
39
- for (let E = 0; E < 16; ++E)
40
- f[o + E] = _[E];
41
- return f;
42
- }
43
- return Yt(_);
44
- }
45
- try {
46
- n.name = t;
47
- } catch (s) {
48
- }
49
- return n.DNS = Wt, n.URL = Vt, n;
50
- }
51
- function zt(t, r, e, n) {
52
- switch (t) {
53
- case 0:
54
- return r & e ^ ~r & n;
55
- case 1:
56
- return r ^ e ^ n;
57
- case 2:
58
- return r & e ^ r & n ^ e & n;
59
- case 3:
60
- return r ^ e ^ n;
61
- }
62
- }
63
- function ot(t, r) {
64
- return t << r | t >>> 32 - r;
65
- }
66
- function Ht(t) {
67
- const r = [1518500249, 1859775393, 2400959708, 3395469782], e = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
68
- if (typeof t == "string") {
69
- const f = unescape(encodeURIComponent(t));
70
- t = [];
71
- for (let o = 0; o < f.length; ++o)
72
- t.push(f.charCodeAt(o));
73
- } else
74
- Array.isArray(t) || (t = Array.prototype.slice.call(t));
75
- t.push(128);
76
- const n = t.length / 4 + 2, s = Math.ceil(n / 16), p = new Array(s);
77
- for (let f = 0; f < s; ++f) {
78
- const o = new Uint32Array(16);
79
- for (let c = 0; c < 16; ++c)
80
- o[c] = t[f * 64 + c * 4] << 24 | t[f * 64 + c * 4 + 1] << 16 | t[f * 64 + c * 4 + 2] << 8 | t[f * 64 + c * 4 + 3];
81
- p[f] = o;
82
- }
83
- p[s - 1][14] = (t.length - 1) * 8 / Math.pow(2, 32), p[s - 1][14] = Math.floor(p[s - 1][14]), p[s - 1][15] = (t.length - 1) * 8 & 4294967295;
84
- for (let f = 0; f < s; ++f) {
85
- const o = new Uint32Array(80);
86
- for (let y = 0; y < 16; ++y)
87
- o[y] = p[f][y];
88
- for (let y = 16; y < 80; ++y)
89
- o[y] = ot(o[y - 3] ^ o[y - 8] ^ o[y - 14] ^ o[y - 16], 1);
90
- let c = e[0], _ = e[1], E = e[2], g = e[3], O = e[4];
91
- for (let y = 0; y < 80; ++y) {
92
- const A = Math.floor(y / 20), Y = ot(c, 5) + zt(A, _, E, g) + O + r[A] + o[y] >>> 0;
93
- O = g, g = E, E = ot(_, 30) >>> 0, _ = c, c = Y;
94
- }
95
- e[0] = e[0] + c >>> 0, e[1] = e[1] + _ >>> 0, e[2] = e[2] + E >>> 0, e[3] = e[3] + g >>> 0, e[4] = e[4] + O >>> 0;
96
- }
97
- return [e[0] >> 24 & 255, e[0] >> 16 & 255, e[0] >> 8 & 255, e[0] & 255, e[1] >> 24 & 255, e[1] >> 16 & 255, e[1] >> 8 & 255, e[1] & 255, e[2] >> 24 & 255, e[2] >> 16 & 255, e[2] >> 8 & 255, e[2] & 255, e[3] >> 24 & 255, e[3] >> 16 & 255, e[3] >> 8 & 255, e[3] & 255, e[4] >> 24 & 255, e[4] >> 16 & 255, e[4] >> 8 & 255, e[4] & 255];
98
- }
99
- const Gt = Ut("v5", 80, Ht), Kt = Gt;
100
- var ct = function() {
101
- var t = function(M, a, l, d) {
102
- for (l = l || {}, d = M.length; d--; l[M[d]] = a)
103
- ;
104
- return l;
105
- }, r = [1, 2], e = [1, 5], n = [6, 9, 11, 23, 25, 27, 29, 30, 31, 52], s = [1, 17], p = [1, 18], f = [1, 19], o = [1, 20], c = [1, 21], _ = [1, 22], E = [1, 25], g = [1, 30], O = [1, 31], y = [1, 32], A = [1, 33], Y = [1, 34], U = [6, 9, 11, 15, 20, 23, 25, 27, 29, 30, 31, 44, 45, 46, 47, 48, 52], X = [1, 46], I = [30, 31, 49, 50], N = [4, 6, 9, 11, 23, 25, 27, 29, 30, 31, 52], v = [44, 45, 46, 47, 48], k = [22, 37], x = [1, 66], P = [1, 65], Z = [22, 37, 39, 41], w = {
106
- trace: function() {
107
- },
108
- yy: {},
109
- symbols_: { error: 2, start: 3, ER_DIAGRAM: 4, document: 5, EOF: 6, directive: 7, line: 8, SPACE: 9, statement: 10, NEWLINE: 11, openDirective: 12, typeDirective: 13, closeDirective: 14, ":": 15, argDirective: 16, entityName: 17, relSpec: 18, role: 19, BLOCK_START: 20, attributes: 21, BLOCK_STOP: 22, title: 23, title_value: 24, acc_title: 25, acc_title_value: 26, acc_descr: 27, acc_descr_value: 28, acc_descr_multiline_value: 29, ALPHANUM: 30, ENTITY_NAME: 31, attribute: 32, attributeType: 33, attributeName: 34, attributeKeyTypeList: 35, attributeComment: 36, ATTRIBUTE_WORD: 37, attributeKeyType: 38, COMMA: 39, ATTRIBUTE_KEY: 40, COMMENT: 41, cardinality: 42, relType: 43, ZERO_OR_ONE: 44, ZERO_OR_MORE: 45, ONE_OR_MORE: 46, ONLY_ONE: 47, MD_PARENT: 48, NON_IDENTIFYING: 49, IDENTIFYING: 50, WORD: 51, open_directive: 52, type_directive: 53, arg_directive: 54, close_directive: 55, $accept: 0, $end: 1 },
110
- terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 9: "SPACE", 11: "NEWLINE", 15: ":", 20: "BLOCK_START", 22: "BLOCK_STOP", 23: "title", 24: "title_value", 25: "acc_title", 26: "acc_title_value", 27: "acc_descr", 28: "acc_descr_value", 29: "acc_descr_multiline_value", 30: "ALPHANUM", 31: "ENTITY_NAME", 37: "ATTRIBUTE_WORD", 39: "COMMA", 40: "ATTRIBUTE_KEY", 41: "COMMENT", 44: "ZERO_OR_ONE", 45: "ZERO_OR_MORE", 46: "ONE_OR_MORE", 47: "ONLY_ONE", 48: "MD_PARENT", 49: "NON_IDENTIFYING", 50: "IDENTIFYING", 51: "WORD", 52: "open_directive", 53: "type_directive", 54: "arg_directive", 55: "close_directive" },
111
- productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 5], [10, 4], [10, 3], [10, 1], [10, 2], [10, 2], [10, 2], [10, 1], [17, 1], [17, 1], [21, 1], [21, 2], [32, 2], [32, 3], [32, 3], [32, 4], [33, 1], [34, 1], [35, 1], [35, 3], [38, 1], [36, 1], [18, 3], [42, 1], [42, 1], [42, 1], [42, 1], [42, 1], [43, 1], [43, 1], [19, 1], [19, 1], [19, 1], [12, 1], [13, 1], [16, 1], [14, 1]],
112
- performAction: function(a, l, d, u, m, i, Q) {
113
- var h = i.length - 1;
114
- switch (m) {
115
- case 1:
116
- break;
117
- case 3:
118
- this.$ = [];
119
- break;
120
- case 4:
121
- i[h - 1].push(i[h]), this.$ = i[h - 1];
122
- break;
123
- case 5:
124
- case 6:
125
- this.$ = i[h];
126
- break;
127
- case 7:
128
- case 8:
129
- this.$ = [];
130
- break;
131
- case 12:
132
- u.addEntity(i[h - 4]), u.addEntity(i[h - 2]), u.addRelationship(i[h - 4], i[h], i[h - 2], i[h - 3]);
133
- break;
134
- case 13:
135
- u.addEntity(i[h - 3]), u.addAttributes(i[h - 3], i[h - 1]);
136
- break;
137
- case 14:
138
- u.addEntity(i[h - 2]);
139
- break;
140
- case 15:
141
- u.addEntity(i[h]);
142
- break;
143
- case 16:
144
- case 17:
145
- this.$ = i[h].trim(), u.setAccTitle(this.$);
146
- break;
147
- case 18:
148
- case 19:
149
- this.$ = i[h].trim(), u.setAccDescription(this.$);
150
- break;
151
- case 20:
152
- case 44:
153
- this.$ = i[h];
154
- break;
155
- case 21:
156
- case 42:
157
- case 43:
158
- this.$ = i[h].replace(/"/g, "");
159
- break;
160
- case 22:
161
- case 30:
162
- this.$ = [i[h]];
163
- break;
164
- case 23:
165
- i[h].push(i[h - 1]), this.$ = i[h];
166
- break;
167
- case 24:
168
- this.$ = { attributeType: i[h - 1], attributeName: i[h] };
169
- break;
170
- case 25:
171
- this.$ = { attributeType: i[h - 2], attributeName: i[h - 1], attributeKeyTypeList: i[h] };
172
- break;
173
- case 26:
174
- this.$ = { attributeType: i[h - 2], attributeName: i[h - 1], attributeComment: i[h] };
175
- break;
176
- case 27:
177
- this.$ = { attributeType: i[h - 3], attributeName: i[h - 2], attributeKeyTypeList: i[h - 1], attributeComment: i[h] };
178
- break;
179
- case 28:
180
- case 29:
181
- case 32:
182
- this.$ = i[h];
183
- break;
184
- case 31:
185
- i[h - 2].push(i[h]), this.$ = i[h - 2];
186
- break;
187
- case 33:
188
- this.$ = i[h].replace(/"/g, "");
189
- break;
190
- case 34:
191
- this.$ = { cardA: i[h], relType: i[h - 1], cardB: i[h - 2] };
192
- break;
193
- case 35:
194
- this.$ = u.Cardinality.ZERO_OR_ONE;
195
- break;
196
- case 36:
197
- this.$ = u.Cardinality.ZERO_OR_MORE;
198
- break;
199
- case 37:
200
- this.$ = u.Cardinality.ONE_OR_MORE;
201
- break;
202
- case 38:
203
- this.$ = u.Cardinality.ONLY_ONE;
204
- break;
205
- case 39:
206
- this.$ = u.Cardinality.MD_PARENT;
207
- break;
208
- case 40:
209
- this.$ = u.Identification.NON_IDENTIFYING;
210
- break;
211
- case 41:
212
- this.$ = u.Identification.IDENTIFYING;
213
- break;
214
- case 45:
215
- u.parseDirective("%%{", "open_directive");
216
- break;
217
- case 46:
218
- u.parseDirective(i[h], "type_directive");
219
- break;
220
- case 47:
221
- i[h] = i[h].trim().replace(/'/g, '"'), u.parseDirective(i[h], "arg_directive");
222
- break;
223
- case 48:
224
- u.parseDirective("}%%", "close_directive", "er");
225
- break;
226
- }
227
- },
228
- table: [{ 3: 1, 4: r, 7: 3, 12: 4, 52: e }, { 1: [3] }, t(n, [2, 3], { 5: 6 }), { 3: 7, 4: r, 7: 3, 12: 4, 52: e }, { 13: 8, 53: [1, 9] }, { 53: [2, 45] }, { 6: [1, 10], 7: 15, 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: 4, 17: 16, 23: s, 25: p, 27: f, 29: o, 30: c, 31: _, 52: e }, { 1: [2, 2] }, { 14: 23, 15: [1, 24], 55: E }, t([15, 55], [2, 46]), t(n, [2, 8], { 1: [2, 1] }), t(n, [2, 4]), { 7: 15, 10: 26, 12: 4, 17: 16, 23: s, 25: p, 27: f, 29: o, 30: c, 31: _, 52: e }, t(n, [2, 6]), t(n, [2, 7]), t(n, [2, 11]), t(n, [2, 15], { 18: 27, 42: 29, 20: [1, 28], 44: g, 45: O, 46: y, 47: A, 48: Y }), { 24: [1, 35] }, { 26: [1, 36] }, { 28: [1, 37] }, t(n, [2, 19]), t(U, [2, 20]), t(U, [2, 21]), { 11: [1, 38] }, { 16: 39, 54: [1, 40] }, { 11: [2, 48] }, t(n, [2, 5]), { 17: 41, 30: c, 31: _ }, { 21: 42, 22: [1, 43], 32: 44, 33: 45, 37: X }, { 43: 47, 49: [1, 48], 50: [1, 49] }, t(I, [2, 35]), t(I, [2, 36]), t(I, [2, 37]), t(I, [2, 38]), t(I, [2, 39]), t(n, [2, 16]), t(n, [2, 17]), t(n, [2, 18]), t(N, [2, 9]), { 14: 50, 55: E }, { 55: [2, 47] }, { 15: [1, 51] }, { 22: [1, 52] }, t(n, [2, 14]), { 21: 53, 22: [2, 22], 32: 44, 33: 45, 37: X }, { 34: 54, 37: [1, 55] }, { 37: [2, 28] }, { 42: 56, 44: g, 45: O, 46: y, 47: A, 48: Y }, t(v, [2, 40]), t(v, [2, 41]), { 11: [1, 57] }, { 19: 58, 30: [1, 61], 31: [1, 60], 51: [1, 59] }, t(n, [2, 13]), { 22: [2, 23] }, t(k, [2, 24], { 35: 62, 36: 63, 38: 64, 40: x, 41: P }), t([22, 37, 40, 41], [2, 29]), t([30, 31], [2, 34]), t(N, [2, 10]), t(n, [2, 12]), t(n, [2, 42]), t(n, [2, 43]), t(n, [2, 44]), t(k, [2, 25], { 36: 67, 39: [1, 68], 41: P }), t(k, [2, 26]), t(Z, [2, 30]), t(k, [2, 33]), t(Z, [2, 32]), t(k, [2, 27]), { 38: 69, 40: x }, t(Z, [2, 31])],
229
- defaultActions: { 5: [2, 45], 7: [2, 2], 25: [2, 48], 40: [2, 47], 46: [2, 28], 53: [2, 23] },
230
- parseError: function(a, l) {
231
- if (l.recoverable)
232
- this.trace(a);
233
- else {
234
- var d = new Error(a);
235
- throw d.hash = l, d;
236
- }
237
- },
238
- parse: function(a) {
239
- var l = this, d = [0], u = [], m = [null], i = [], Q = this.table, h = "", q = 0, ht = 0, Et = 2, dt = 1, mt = i.slice.call(arguments, 1), b = Object.create(this.lexer), H = { yy: {} };
240
- for (var rt in this.yy)
241
- Object.prototype.hasOwnProperty.call(this.yy, rt) && (H.yy[rt] = this.yy[rt]);
242
- b.setInput(a, H.yy), H.yy.lexer = b, H.yy.parser = this, typeof b.yylloc == "undefined" && (b.yylloc = {});
243
- var it = b.yylloc;
244
- i.push(it);
245
- var gt = b.options && b.options.ranges;
246
- typeof H.yy.parseError == "function" ? this.parseError = H.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
247
- function kt() {
248
- var W;
249
- return W = u.pop() || b.lex() || dt, typeof W != "number" && (W instanceof Array && (u = W, W = u.pop()), W = l.symbols_[W] || W), W;
250
- }
251
- for (var D, G, L, at, K = {}, J, F, ut, tt; ; ) {
252
- if (G = d[d.length - 1], this.defaultActions[G] ? L = this.defaultActions[G] : ((D === null || typeof D == "undefined") && (D = kt()), L = Q[G] && Q[G][D]), typeof L == "undefined" || !L.length || !L[0]) {
253
- var nt = "";
254
- tt = [];
255
- for (J in Q[G])
256
- this.terminals_[J] && J > Et && tt.push("'" + this.terminals_[J] + "'");
257
- b.showPosition ? nt = "Parse error on line " + (q + 1) + `:
258
- ` + b.showPosition() + `
259
- Expecting ` + tt.join(", ") + ", got '" + (this.terminals_[D] || D) + "'" : nt = "Parse error on line " + (q + 1) + ": Unexpected " + (D == dt ? "end of input" : "'" + (this.terminals_[D] || D) + "'"), this.parseError(nt, {
260
- text: b.match,
261
- token: this.terminals_[D] || D,
262
- line: b.yylineno,
263
- loc: it,
264
- expected: tt
265
- });
266
- }
267
- if (L[0] instanceof Array && L.length > 1)
268
- throw new Error("Parse Error: multiple actions possible at state: " + G + ", token: " + D);
269
- switch (L[0]) {
270
- case 1:
271
- d.push(D), m.push(b.yytext), i.push(b.yylloc), d.push(L[1]), D = null, ht = b.yyleng, h = b.yytext, q = b.yylineno, it = b.yylloc;
272
- break;
273
- case 2:
274
- if (F = this.productions_[L[1]][1], K.$ = m[m.length - F], K._$ = {
275
- first_line: i[i.length - (F || 1)].first_line,
276
- last_line: i[i.length - 1].last_line,
277
- first_column: i[i.length - (F || 1)].first_column,
278
- last_column: i[i.length - 1].last_column
279
- }, gt && (K._$.range = [
280
- i[i.length - (F || 1)].range[0],
281
- i[i.length - 1].range[1]
282
- ]), at = this.performAction.apply(K, [
283
- h,
284
- ht,
285
- q,
286
- H.yy,
287
- L[1],
288
- m,
289
- i
290
- ].concat(mt)), typeof at != "undefined")
291
- return at;
292
- F && (d = d.slice(0, -1 * F * 2), m = m.slice(0, -1 * F), i = i.slice(0, -1 * F)), d.push(this.productions_[L[1]][0]), m.push(K.$), i.push(K._$), ut = Q[d[d.length - 2]][d[d.length - 1]], d.push(ut);
293
- break;
294
- case 3:
295
- return !0;
296
- }
297
- }
298
- return !0;
299
- }
300
- }, z = function() {
301
- var M = {
302
- EOF: 1,
303
- parseError: function(l, d) {
304
- if (this.yy.parser)
305
- this.yy.parser.parseError(l, d);
306
- else
307
- throw new Error(l);
308
- },
309
- // resets the lexer, sets new input
310
- setInput: function(a, l) {
311
- return this.yy = l || this.yy || {}, this._input = a, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
312
- first_line: 1,
313
- first_column: 0,
314
- last_line: 1,
315
- last_column: 0
316
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
317
- },
318
- // consumes and returns one char from the input
319
- input: function() {
320
- var a = this._input[0];
321
- this.yytext += a, this.yyleng++, this.offset++, this.match += a, this.matched += a;
322
- var l = a.match(/(?:\r\n?|\n).*/g);
323
- return l ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), a;
324
- },
325
- // unshifts one char (or a string) into the input
326
- unput: function(a) {
327
- var l = a.length, d = a.split(/(?:\r\n?|\n)/g);
328
- this._input = a + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
329
- var u = this.match.split(/(?:\r\n?|\n)/g);
330
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), d.length - 1 && (this.yylineno -= d.length - 1);
331
- var m = this.yylloc.range;
332
- return this.yylloc = {
333
- first_line: this.yylloc.first_line,
334
- last_line: this.yylineno + 1,
335
- first_column: this.yylloc.first_column,
336
- last_column: d ? (d.length === u.length ? this.yylloc.first_column : 0) + u[u.length - d.length].length - d[0].length : this.yylloc.first_column - l
337
- }, this.options.ranges && (this.yylloc.range = [m[0], m[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
338
- },
339
- // When called from action, caches matched text and appends it on next action
340
- more: function() {
341
- return this._more = !0, this;
342
- },
343
- // 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.
344
- reject: function() {
345
- if (this.options.backtrack_lexer)
346
- this._backtrack = !0;
347
- else
348
- 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).
349
- ` + this.showPosition(), {
350
- text: "",
351
- token: null,
352
- line: this.yylineno
353
- });
354
- return this;
355
- },
356
- // retain first n characters of the match
357
- less: function(a) {
358
- this.unput(this.match.slice(a));
359
- },
360
- // displays already matched input, i.e. for error messages
361
- pastInput: function() {
362
- var a = this.matched.substr(0, this.matched.length - this.match.length);
363
- return (a.length > 20 ? "..." : "") + a.substr(-20).replace(/\n/g, "");
364
- },
365
- // displays upcoming input, i.e. for error messages
366
- upcomingInput: function() {
367
- var a = this.match;
368
- return a.length < 20 && (a += this._input.substr(0, 20 - a.length)), (a.substr(0, 20) + (a.length > 20 ? "..." : "")).replace(/\n/g, "");
369
- },
370
- // displays the character position where the lexing error occurred, i.e. for error messages
371
- showPosition: function() {
372
- var a = this.pastInput(), l = new Array(a.length + 1).join("-");
373
- return a + this.upcomingInput() + `
374
- ` + l + "^";
375
- },
376
- // test the lexed token: return FALSE when not a match, otherwise return token
377
- test_match: function(a, l) {
378
- var d, u, m;
379
- if (this.options.backtrack_lexer && (m = {
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
- }, this.options.ranges && (m.yylloc.range = this.yylloc.range.slice(0))), u = a[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = {
399
- first_line: this.yylloc.last_line,
400
- last_line: this.yylineno + 1,
401
- first_column: this.yylloc.last_column,
402
- last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + a[0].length
403
- }, this.yytext += a[0], this.match += a[0], this.matches = a, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(a[0].length), this.matched += a[0], d = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), d)
404
- return d;
405
- if (this._backtrack) {
406
- for (var i in m)
407
- this[i] = m[i];
408
- return !1;
409
- }
410
- return !1;
411
- },
412
- // return next match in input
413
- next: function() {
414
- if (this.done)
415
- return this.EOF;
416
- this._input || (this.done = !0);
417
- var a, l, d, u;
418
- this._more || (this.yytext = "", this.match = "");
419
- for (var m = this._currentRules(), i = 0; i < m.length; i++)
420
- if (d = this._input.match(this.rules[m[i]]), d && (!l || d[0].length > l[0].length)) {
421
- if (l = d, u = i, this.options.backtrack_lexer) {
422
- if (a = this.test_match(d, m[i]), a !== !1)
423
- return a;
424
- if (this._backtrack) {
425
- l = !1;
426
- continue;
427
- } else
428
- return !1;
429
- } else if (!this.options.flex)
430
- break;
431
- }
432
- return l ? (a = this.test_match(l, m[u]), a !== !1 ? a : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
433
- ` + this.showPosition(), {
434
- text: "",
435
- token: null,
436
- line: this.yylineno
437
- });
438
- },
439
- // return next match that has a token
440
- lex: function() {
441
- var l = this.next();
442
- return l || this.lex();
443
- },
444
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
445
- begin: function(l) {
446
- this.conditionStack.push(l);
447
- },
448
- // pop the previously active lexer condition state off the condition stack
449
- popState: function() {
450
- var l = this.conditionStack.length - 1;
451
- return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
452
- },
453
- // produce the lexer rule set which is active for the currently active lexer condition state
454
- _currentRules: function() {
455
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
456
- },
457
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
458
- topState: function(l) {
459
- return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
460
- },
461
- // alias for begin(condition)
462
- pushState: function(l) {
463
- this.begin(l);
464
- },
465
- // return the number of states currently on the stack
466
- stateStackSize: function() {
467
- return this.conditionStack.length;
468
- },
469
- options: { "case-insensitive": !0 },
470
- performAction: function(l, d, u, m) {
471
- switch (u) {
472
- case 0:
473
- return this.begin("acc_title"), 25;
474
- case 1:
475
- return this.popState(), "acc_title_value";
476
- case 2:
477
- return this.begin("acc_descr"), 27;
478
- case 3:
479
- return this.popState(), "acc_descr_value";
480
- case 4:
481
- this.begin("acc_descr_multiline");
482
- break;
483
- case 5:
484
- this.popState();
485
- break;
486
- case 6:
487
- return "acc_descr_multiline_value";
488
- case 7:
489
- return this.begin("open_directive"), 52;
490
- case 8:
491
- return this.begin("type_directive"), 53;
492
- case 9:
493
- return this.popState(), this.begin("arg_directive"), 15;
494
- case 10:
495
- return this.popState(), this.popState(), 55;
496
- case 11:
497
- return 54;
498
- case 12:
499
- return 11;
500
- case 13:
501
- break;
502
- case 14:
503
- return 9;
504
- case 15:
505
- return 31;
506
- case 16:
507
- return 51;
508
- case 17:
509
- return 4;
510
- case 18:
511
- return this.begin("block"), 20;
512
- case 19:
513
- return 39;
514
- case 20:
515
- break;
516
- case 21:
517
- return 40;
518
- case 22:
519
- return 37;
520
- case 23:
521
- return 37;
522
- case 24:
523
- return 41;
524
- case 25:
525
- break;
526
- case 26:
527
- return this.popState(), 22;
528
- case 27:
529
- return d.yytext[0];
530
- case 28:
531
- return 44;
532
- case 29:
533
- return 46;
534
- case 30:
535
- return 46;
536
- case 31:
537
- return 46;
538
- case 32:
539
- return 44;
540
- case 33:
541
- return 44;
542
- case 34:
543
- return 45;
544
- case 35:
545
- return 45;
546
- case 36:
547
- return 45;
548
- case 37:
549
- return 45;
550
- case 38:
551
- return 45;
552
- case 39:
553
- return 46;
554
- case 40:
555
- return 45;
556
- case 41:
557
- return 46;
558
- case 42:
559
- return 47;
560
- case 43:
561
- return 47;
562
- case 44:
563
- return 47;
564
- case 45:
565
- return 47;
566
- case 46:
567
- return 44;
568
- case 47:
569
- return 45;
570
- case 48:
571
- return 46;
572
- case 49:
573
- return 48;
574
- case 50:
575
- return 49;
576
- case 51:
577
- return 50;
578
- case 52:
579
- return 50;
580
- case 53:
581
- return 49;
582
- case 54:
583
- return 49;
584
- case 55:
585
- return 49;
586
- case 56:
587
- return 30;
588
- case 57:
589
- return d.yytext[0];
590
- case 58:
591
- return 6;
592
- }
593
- },
594
- rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:,)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:[A-Za-z][A-Za-z0-9\-_]*)/i, /^(?:.)/i, /^(?:$)/i],
595
- conditions: { acc_descr_multiline: { rules: [5, 6], inclusive: !1 }, acc_descr: { rules: [3], inclusive: !1 }, acc_title: { rules: [1], inclusive: !1 }, open_directive: { rules: [8], inclusive: !1 }, type_directive: { rules: [9, 10], inclusive: !1 }, arg_directive: { rules: [10, 11], inclusive: !1 }, block: { rules: [19, 20, 21, 22, 23, 24, 25, 26, 27], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 12, 13, 14, 15, 16, 17, 18, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58], inclusive: !0 } }
596
- };
597
- return M;
598
- }();
599
- w.lexer = z;
600
- function S() {
601
- this.yy = {};
602
- }
603
- return S.prototype = w, w.Parser = S, new S();
604
- }();
605
- ct.parser = ct;
606
- const Xt = ct;
607
- let $ = {}, lt = [];
608
- const Qt = {
609
- ZERO_OR_ONE: "ZERO_OR_ONE",
610
- ZERO_OR_MORE: "ZERO_OR_MORE",
611
- ONE_OR_MORE: "ONE_OR_MORE",
612
- ONLY_ONE: "ONLY_ONE",
613
- MD_PARENT: "MD_PARENT"
614
- }, $t = {
615
- NON_IDENTIFYING: "NON_IDENTIFYING",
616
- IDENTIFYING: "IDENTIFYING"
617
- }, jt = function(t, r, e) {
618
- At.parseDirective(this, t, r, e);
619
- }, pt = function(t) {
620
- return $[t] === void 0 && ($[t] = { attributes: [] }, et.info("Added new entity :", t)), $[t];
621
- }, qt = () => $, Jt = function(t, r) {
622
- let e = pt(t), n;
623
- for (n = r.length - 1; n >= 0; n--)
624
- e.attributes.push(r[n]), et.debug("Added attribute ", r[n].attributeName);
625
- }, te = function(t, r, e, n) {
626
- let s = {
627
- entityA: t,
628
- roleA: r,
629
- entityB: e,
630
- relSpec: n
631
- };
632
- lt.push(s), et.debug("Added new relationship :", s);
633
- }, ee = () => lt, re = function() {
634
- $ = {}, lt = [], Mt();
635
- }, ie = {
636
- Cardinality: Qt,
637
- Identification: $t,
638
- parseDirective: jt,
639
- getConfig: () => V().er,
640
- addEntity: pt,
641
- addAttributes: Jt,
642
- getEntities: qt,
643
- addRelationship: te,
644
- getRelationships: ee,
645
- clear: re,
646
- setAccTitle: xt,
647
- getAccTitle: Rt,
648
- setAccDescription: Ot,
649
- getAccDescription: bt,
650
- setDiagramTitle: Nt,
651
- getDiagramTitle: Tt
652
- }, B = {
653
- ONLY_ONE_START: "ONLY_ONE_START",
654
- ONLY_ONE_END: "ONLY_ONE_END",
655
- ZERO_OR_ONE_START: "ZERO_OR_ONE_START",
656
- ZERO_OR_ONE_END: "ZERO_OR_ONE_END",
657
- ONE_OR_MORE_START: "ONE_OR_MORE_START",
658
- ONE_OR_MORE_END: "ONE_OR_MORE_END",
659
- ZERO_OR_MORE_START: "ZERO_OR_MORE_START",
660
- ZERO_OR_MORE_END: "ZERO_OR_MORE_END",
661
- MD_PARENT_END: "MD_PARENT_END",
662
- MD_PARENT_START: "MD_PARENT_START"
663
- }, ae = function(t, r) {
664
- let e;
665
- t.append("defs").append("marker").attr("id", B.MD_PARENT_START).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), t.append("defs").append("marker").attr("id", B.MD_PARENT_END).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), t.append("defs").append("marker").attr("id", B.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18"), t.append("defs").append("marker").attr("id", B.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18"), e = t.append("defs").append("marker").attr("id", B.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M9,0 L9,18"), e = t.append("defs").append("marker").attr("id", B.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M21,0 L21,18"), t.append("defs").append("marker").attr("id", B.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"), t.append("defs").append("marker").attr("id", B.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"), e = t.append("defs").append("marker").attr("id", B.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18"), e = t.append("defs").append("marker").attr("id", B.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
666
- }, C = {
667
- ERMarkers: B,
668
- insertMarkers: ae
669
- }, ne = /[^\dA-Za-z](\W)*/g;
670
- let R = {}, j = /* @__PURE__ */ new Map();
671
- const se = function(t) {
672
- const r = Object.keys(t);
673
- for (const e of r)
674
- R[e] = t[e];
675
- }, oe = (t, r, e) => {
676
- const n = R.entityPadding / 3, s = R.entityPadding / 3, p = R.fontSize * 0.85, f = r.node().getBBox(), o = [];
677
- let c = !1, _ = !1, E = 0, g = 0, O = 0, y = 0, A = f.height + n * 2, Y = 1;
678
- e.forEach((N) => {
679
- N.attributeKeyTypeList !== void 0 && N.attributeKeyTypeList.length > 0 && (c = !0), N.attributeComment !== void 0 && (_ = !0);
680
- }), e.forEach((N) => {
681
- const v = `${r.node().id}-attr-${Y}`;
682
- let k = 0;
683
- const x = It(N.attributeType), P = t.append("text").classed("er entityLabel", !0).attr("id", `${v}-type`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", V().fontFamily).style("font-size", p + "px").text(x), Z = t.append("text").classed("er entityLabel", !0).attr("id", `${v}-name`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", V().fontFamily).style("font-size", p + "px").text(N.attributeName), w = {};
684
- w.tn = P, w.nn = Z;
685
- const z = P.node().getBBox(), S = Z.node().getBBox();
686
- if (E = Math.max(E, z.width), g = Math.max(g, S.width), k = Math.max(z.height, S.height), c) {
687
- const M = N.attributeKeyTypeList !== void 0 ? N.attributeKeyTypeList.join(",") : "", a = t.append("text").classed("er entityLabel", !0).attr("id", `${v}-key`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", V().fontFamily).style("font-size", p + "px").text(M);
688
- w.kn = a;
689
- const l = a.node().getBBox();
690
- O = Math.max(O, l.width), k = Math.max(k, l.height);
691
- }
692
- if (_) {
693
- const M = t.append("text").classed("er entityLabel", !0).attr("id", `${v}-comment`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", V().fontFamily).style("font-size", p + "px").text(N.attributeComment || "");
694
- w.cn = M;
695
- const a = M.node().getBBox();
696
- y = Math.max(y, a.width), k = Math.max(k, a.height);
697
- }
698
- w.height = k, o.push(w), A += k + n * 2, Y += 1;
699
- });
700
- let U = 4;
701
- c && (U += 2), _ && (U += 2);
702
- const X = E + g + O + y, I = {
703
- width: Math.max(
704
- R.minEntityWidth,
705
- Math.max(
706
- f.width + R.entityPadding * 2,
707
- X + s * U
708
- )
709
- ),
710
- height: e.length > 0 ? A : Math.max(R.minEntityHeight, f.height + R.entityPadding * 2)
711
- };
712
- if (e.length > 0) {
713
- const N = Math.max(
714
- 0,
715
- (I.width - X - s * U) / (U / 2)
716
- );
717
- r.attr(
718
- "transform",
719
- "translate(" + I.width / 2 + "," + (n + f.height / 2) + ")"
720
- );
721
- let v = f.height + n * 2, k = "attributeBoxOdd";
722
- o.forEach((x) => {
723
- const P = v + n + x.height / 2;
724
- x.tn.attr("transform", "translate(" + s + "," + P + ")");
725
- const Z = t.insert("rect", "#" + x.tn.node().id).classed(`er ${k}`, !0).attr("x", 0).attr("y", v).attr("width", E + s * 2 + N).attr("height", x.height + n * 2), w = parseFloat(Z.attr("x")) + parseFloat(Z.attr("width"));
726
- x.nn.attr(
727
- "transform",
728
- "translate(" + (w + s) + "," + P + ")"
729
- );
730
- const z = t.insert("rect", "#" + x.nn.node().id).classed(`er ${k}`, !0).attr("x", w).attr("y", v).attr("width", g + s * 2 + N).attr("height", x.height + n * 2);
731
- let S = parseFloat(z.attr("x")) + parseFloat(z.attr("width"));
732
- if (c) {
733
- x.kn.attr(
734
- "transform",
735
- "translate(" + (S + s) + "," + P + ")"
736
- );
737
- const M = t.insert("rect", "#" + x.kn.node().id).classed(`er ${k}`, !0).attr("x", S).attr("y", v).attr("width", O + s * 2 + N).attr("height", x.height + n * 2);
738
- S = parseFloat(M.attr("x")) + parseFloat(M.attr("width"));
739
- }
740
- _ && (x.cn.attr(
741
- "transform",
742
- "translate(" + (S + s) + "," + P + ")"
743
- ), t.insert("rect", "#" + x.cn.node().id).classed(`er ${k}`, "true").attr("x", S).attr("y", v).attr("width", y + s * 2 + N).attr("height", x.height + n * 2)), v += x.height + n * 2, k = k === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd";
744
- });
745
- } else
746
- I.height = Math.max(R.minEntityHeight, A), r.attr("transform", "translate(" + I.width / 2 + "," + I.height / 2 + ")");
747
- return I;
748
- }, ce = function(t, r, e) {
749
- const n = Object.keys(r);
750
- let s;
751
- return n.forEach(function(p) {
752
- const f = ye(p, "entity");
753
- j.set(p, f);
754
- const o = t.append("g").attr("id", f);
755
- s = s === void 0 ? f : s;
756
- const c = "text-" + f, _ = o.append("text").classed("er entityLabel", !0).attr("id", c).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "middle").style("font-family", V().fontFamily).style("font-size", R.fontSize + "px").text(p), { width: E, height: g } = oe(
757
- o,
758
- _,
759
- r[p].attributes
760
- ), y = o.insert("rect", "#" + c).classed("er entityBox", !0).attr("x", 0).attr("y", 0).attr("width", E).attr("height", g).node().getBBox();
761
- e.setNode(f, {
762
- width: y.width,
763
- height: y.height,
764
- shape: "rect",
765
- id: f
766
- });
767
- }), s;
768
- }, le = function(t, r) {
769
- r.nodes().forEach(function(e) {
770
- e !== void 0 && r.node(e) !== void 0 && t.select("#" + e).attr(
771
- "transform",
772
- "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"
773
- );
774
- });
775
- }, _t = function(t) {
776
- return (t.entityA + t.roleA + t.entityB).replace(/\s/g, "");
777
- }, he = function(t, r) {
778
- return t.forEach(function(e) {
779
- r.setEdge(
780
- j.get(e.entityA),
781
- j.get(e.entityB),
782
- { relationship: e },
783
- _t(e)
784
- );
785
- }), t;
786
- };
787
- let ft = 0;
788
- const de = function(t, r, e, n, s) {
789
- ft++;
790
- const p = e.edge(
791
- j.get(r.entityA),
792
- j.get(r.entityB),
793
- _t(r)
794
- ), f = Bt().x(function(A) {
795
- return A.x;
796
- }).y(function(A) {
797
- return A.y;
798
- }).curve(wt), o = t.insert("path", "#" + n).classed("er relationshipLine", !0).attr("d", f(p.points)).style("stroke", R.stroke).style("fill", "none");
799
- r.relSpec.relType === s.db.Identification.NON_IDENTIFYING && o.attr("stroke-dasharray", "8,8");
800
- let c = "";
801
- switch (R.arrowMarkerAbsolute && (c = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, c = c.replace(/\(/g, "\\("), c = c.replace(/\)/g, "\\)")), r.relSpec.cardA) {
802
- case s.db.Cardinality.ZERO_OR_ONE:
803
- o.attr("marker-end", "url(" + c + "#" + C.ERMarkers.ZERO_OR_ONE_END + ")");
804
- break;
805
- case s.db.Cardinality.ZERO_OR_MORE:
806
- o.attr("marker-end", "url(" + c + "#" + C.ERMarkers.ZERO_OR_MORE_END + ")");
807
- break;
808
- case s.db.Cardinality.ONE_OR_MORE:
809
- o.attr("marker-end", "url(" + c + "#" + C.ERMarkers.ONE_OR_MORE_END + ")");
810
- break;
811
- case s.db.Cardinality.ONLY_ONE:
812
- o.attr("marker-end", "url(" + c + "#" + C.ERMarkers.ONLY_ONE_END + ")");
813
- break;
814
- case s.db.Cardinality.MD_PARENT:
815
- o.attr("marker-end", "url(" + c + "#" + C.ERMarkers.MD_PARENT_END + ")");
816
- break;
817
- }
818
- switch (r.relSpec.cardB) {
819
- case s.db.Cardinality.ZERO_OR_ONE:
820
- o.attr(
821
- "marker-start",
822
- "url(" + c + "#" + C.ERMarkers.ZERO_OR_ONE_START + ")"
823
- );
824
- break;
825
- case s.db.Cardinality.ZERO_OR_MORE:
826
- o.attr(
827
- "marker-start",
828
- "url(" + c + "#" + C.ERMarkers.ZERO_OR_MORE_START + ")"
829
- );
830
- break;
831
- case s.db.Cardinality.ONE_OR_MORE:
832
- o.attr(
833
- "marker-start",
834
- "url(" + c + "#" + C.ERMarkers.ONE_OR_MORE_START + ")"
835
- );
836
- break;
837
- case s.db.Cardinality.ONLY_ONE:
838
- o.attr("marker-start", "url(" + c + "#" + C.ERMarkers.ONLY_ONE_START + ")");
839
- break;
840
- case s.db.Cardinality.MD_PARENT:
841
- o.attr("marker-start", "url(" + c + "#" + C.ERMarkers.MD_PARENT_START + ")");
842
- break;
843
- }
844
- const _ = o.node().getTotalLength(), E = o.node().getPointAtLength(_ * 0.5), g = "rel" + ft, y = t.append("text").classed("er relationshipLabel", !0).attr("id", g).attr("x", E.x).attr("y", E.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", V().fontFamily).style("font-size", R.fontSize + "px").text(r.roleA).node().getBBox();
845
- t.insert("rect", "#" + g).classed("er relationshipLabelBox", !0).attr("x", E.x - y.width / 2).attr("y", E.y - y.height / 2).attr("width", y.width).attr("height", y.height);
846
- }, ue = function(t, r, e, n) {
847
- R = V().er, et.info("Drawing ER diagram");
848
- const s = V().securityLevel;
849
- let p;
850
- s === "sandbox" && (p = st("#i" + r));
851
- const o = (s === "sandbox" ? st(p.nodes()[0].contentDocument.body) : st("body")).select(`[id='${r}']`);
852
- C.insertMarkers(o, R);
853
- let c;
854
- c = new St({
855
- multigraph: !0,
856
- directed: !0,
857
- compound: !1
858
- }).setGraph({
859
- rankdir: R.layoutDirection,
860
- marginx: 20,
861
- marginy: 20,
862
- nodesep: 100,
863
- edgesep: 100,
864
- ranksep: 100
865
- }).setDefaultEdgeLabel(function() {
866
- return {};
867
- });
868
- const _ = ce(o, n.db.getEntities(), c), E = he(n.db.getRelationships(), c);
869
- Lt(c), le(o, c), E.forEach(function(Y) {
870
- de(o, Y, c, _, n);
871
- });
872
- const g = R.diagramPadding;
873
- vt.insertTitle(o, "entityTitleText", R.titleTopMargin, n.db.getDiagramTitle());
874
- const O = o.node().getBBox(), y = O.width + g * 2, A = O.height + g * 2;
875
- Dt(o, A, y, R.useMaxWidth), o.attr("viewBox", `${O.x - g} ${O.y - g} ${y} ${A}`);
876
- }, fe = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c";
877
- function ye(t = "", r = "") {
878
- const e = t.replace(ne, "");
879
- return `${yt(r)}${yt(e)}${Kt(
880
- t,
881
- fe
882
- )}`;
883
- }
884
- function yt(t = "") {
885
- return t.length > 0 ? `${t}-` : "";
886
- }
887
- const pe = {
888
- setConf: se,
889
- draw: ue
890
- }, _e = (t) => `
891
- .entityBox {
892
- fill: ${t.mainBkg};
893
- stroke: ${t.nodeBorder};
894
- }
895
-
896
- .attributeBoxOdd {
897
- fill: ${t.attributeBackgroundColorOdd};
898
- stroke: ${t.nodeBorder};
899
- }
900
-
901
- .attributeBoxEven {
902
- fill: ${t.attributeBackgroundColorEven};
903
- stroke: ${t.nodeBorder};
904
- }
905
-
906
- .relationshipLabelBox {
907
- fill: ${t.tertiaryColor};
908
- opacity: 0.7;
909
- background-color: ${t.tertiaryColor};
910
- rect {
911
- opacity: 0.5;
912
- }
913
- }
914
-
915
- .relationshipLine {
916
- stroke: ${t.lineColor};
917
- }
918
-
919
- .entityTitleText {
920
- text-anchor: middle;
921
- font-size: 18px;
922
- fill: ${t.textColor};
923
- }
924
- #MD_PARENT_START {
925
- fill: #f5f5f5 !important;
926
- stroke: ${t.lineColor} !important;
927
- stroke-width: 1;
928
- }
929
- #MD_PARENT_END {
930
- fill: #f5f5f5 !important;
931
- stroke: ${t.lineColor} !important;
932
- stroke-width: 1;
933
- }
934
-
935
- `, Ee = _e, Oe = {
936
- parser: Xt,
937
- db: ie,
938
- renderer: pe,
939
- styles: Ee
940
- };
941
- export {
942
- Oe as diagram
943
- };