@digipair/skill-web-chatbot 0.91.0-0 → 0.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/SAP-icons.cjs.js +2489 -0
  2. package/SAP-icons.cjs2.js +2489 -0
  3. package/SAP-icons.esm.js +2482 -0
  4. package/SAP-icons.esm2.js +2482 -0
  5. package/Tableau10-558cc280.cjs.js +9 -0
  6. package/Tableau10-558cc280.esm.js +7 -0
  7. package/arc-d1f6357e.cjs.js +88 -0
  8. package/arc-d1f6357e.esm.js +86 -0
  9. package/array-2ff2c7a6.cjs.js +7 -0
  10. package/array-2ff2c7a6.esm.js +5 -0
  11. package/blockDiagram-5dc23a45.cjs.js +2921 -0
  12. package/blockDiagram-5dc23a45.esm.js +2919 -0
  13. package/c4Diagram-1e775db3.cjs.js +4387 -0
  14. package/c4Diagram-1e775db3.esm.js +4385 -0
  15. package/channel-ebbc4130.cjs.js +9 -0
  16. package/channel-ebbc4130.esm.js +7 -0
  17. package/classDiagram-f52caa06.cjs.js +209 -0
  18. package/classDiagram-f52caa06.esm.js +207 -0
  19. package/classDiagram-v2-640c694e.cjs.js +401 -0
  20. package/classDiagram-v2-640c694e.esm.js +399 -0
  21. package/clone-afc2f047.cjs.js +10 -0
  22. package/clone-afc2f047.esm.js +8 -0
  23. package/createText-03b82060.cjs.js +2936 -0
  24. package/createText-03b82060.esm.js +2933 -0
  25. package/edges-16357fde.cjs.js +1998 -0
  26. package/edges-16357fde.esm.js +1981 -0
  27. package/erDiagram-c7ff1bec.cjs.js +1807 -0
  28. package/erDiagram-c7ff1bec.esm.js +1805 -0
  29. package/flowDb-9a89ea33.cjs.js +5542 -0
  30. package/flowDb-9a89ea33.esm.js +5538 -0
  31. package/flowDiagram-aadb13b0.cjs.js +1351 -0
  32. package/flowDiagram-aadb13b0.esm.js +1349 -0
  33. package/flowDiagram-v2-f2119625.cjs.js +31 -0
  34. package/flowDiagram-v2-f2119625.esm.js +29 -0
  35. package/flowchart-elk-definition-cf813a97.cjs.js +50257 -0
  36. package/flowchart-elk-definition-cf813a97.esm.js +50255 -0
  37. package/ganttDiagram-3c2fde2b.cjs.js +3710 -0
  38. package/ganttDiagram-3c2fde2b.esm.js +3708 -0
  39. package/gitGraphDiagram-c3a0619c.cjs.js +3820 -0
  40. package/gitGraphDiagram-c3a0619c.esm.js +3818 -0
  41. package/graph-0ee63739.cjs.js +961 -0
  42. package/graph-0ee63739.esm.js +938 -0
  43. package/index-bb6d8841.cjs.js +648 -0
  44. package/index-bb6d8841.esm.js +646 -0
  45. package/index.cjs.d.ts +1 -0
  46. package/index.cjs.js +17 -0
  47. package/index.cjs2.js +60723 -0
  48. package/index.esm.js +1 -0
  49. package/index.esm2.js +60574 -0
  50. package/infoDiagram-2f5c50c0.cjs.js +460 -0
  51. package/infoDiagram-2f5c50c0.esm.js +458 -0
  52. package/init-f9637058.cjs.js +17 -0
  53. package/init-f9637058.esm.js +15 -0
  54. package/journeyDiagram-14fe341a.cjs.js +1061 -0
  55. package/journeyDiagram-14fe341a.esm.js +1059 -0
  56. package/katex-d90b6d29.cjs.js +25690 -0
  57. package/katex-d90b6d29.esm.js +25688 -0
  58. package/layout-fd473db2.cjs.js +1626 -0
  59. package/layout-fd473db2.esm.js +1619 -0
  60. package/libs/engine/src/index.d.ts +2 -0
  61. package/libs/engine/src/lib/alias.interface.d.ts +9 -0
  62. package/libs/engine/src/lib/engine.d.ts +13 -0
  63. package/libs/engine/src/lib/pins-settings.interface.d.ts +15 -0
  64. package/libs/skill-web-chatbot/src/lib/chat.element.d.ts +28 -0
  65. package/libs/skill-web-chatbot/src/lib/common.data.d.ts +1 -0
  66. package/libs/skill-web-chatbot/src/lib/config.d.ts +9 -0
  67. package/libs/skill-web-chatbot/src/lib/digipair-full.data.d.ts +1 -0
  68. package/libs/skill-web-chatbot/src/lib/digipair-full.element.d.ts +36 -0
  69. package/libs/skill-web-chatbot/src/lib/digipair.data.d.ts +1 -0
  70. package/libs/skill-web-chatbot/src/lib/digipair.element.d.ts +44 -0
  71. package/libs/skill-web-chatbot/src/lib/inputs.element.d.ts +10 -0
  72. package/libs/skill-web-chatbot/src/lib/message.interface.d.ts +10 -0
  73. package/libs/skill-web-chatbot/src/lib/pins/chatbot.actions.d.ts +1 -0
  74. package/libs/skill-web-chatbot/src/lib/tools/css-selector.d.ts +1 -0
  75. package/line-24d93f1b.cjs.js +34 -0
  76. package/line-24d93f1b.esm.js +32 -0
  77. package/linear-9bcf74c4.cjs.js +537 -0
  78. package/linear-9bcf74c4.esm.js +531 -0
  79. package/mindmap-definition-9399c7e6.cjs.js +20489 -0
  80. package/mindmap-definition-9399c7e6.esm.js +20487 -0
  81. package/ordinal-5695958c.cjs.js +331 -0
  82. package/ordinal-5695958c.esm.js +329 -0
  83. package/package.json +7 -22
  84. package/path-428ebac9.cjs.js +317 -0
  85. package/path-428ebac9.esm.js +314 -0
  86. package/pieDiagram-828dae43.cjs.js +951 -0
  87. package/pieDiagram-828dae43.esm.js +949 -0
  88. package/quadrantDiagram-5fa00455.cjs.js +2410 -0
  89. package/quadrantDiagram-5fa00455.esm.js +2408 -0
  90. package/requirementDiagram-03163dc4.cjs.js +2267 -0
  91. package/requirementDiagram-03163dc4.esm.js +2265 -0
  92. package/sankeyDiagram-52ec8976.cjs.js +1848 -0
  93. package/sankeyDiagram-52ec8976.esm.js +1846 -0
  94. package/sequenceDiagram-b517d154.cjs.js +5949 -0
  95. package/sequenceDiagram-b517d154.esm.js +5947 -0
  96. package/stateDiagram-fca82b5b.cjs.js +283 -0
  97. package/stateDiagram-fca82b5b.esm.js +281 -0
  98. package/stateDiagram-v2-ed04200a.cjs.js +373 -0
  99. package/stateDiagram-v2-ed04200a.esm.js +371 -0
  100. package/styles-11e81fdd.cjs.js +3944 -0
  101. package/styles-11e81fdd.esm.js +3940 -0
  102. package/styles-cacbff60.cjs.js +2120 -0
  103. package/styles-cacbff60.esm.js +2111 -0
  104. package/styles-e75131e4.cjs.js +671 -0
  105. package/styles-e75131e4.esm.js +661 -0
  106. package/svgDrawCommon-ecc5f780.cjs.js +68 -0
  107. package/svgDrawCommon-ecc5f780.esm.js +60 -0
  108. package/timeline-definition-4ee9bff4.cjs.js +1161 -0
  109. package/timeline-definition-4ee9bff4.esm.js +1159 -0
  110. package/xychartDiagram-e5e6b652.cjs.js +3150 -0
  111. package/xychartDiagram-e5e6b652.esm.js +3148 -0
  112. package/.swcrc +0 -28
  113. package/README.md +0 -7
  114. package/eslint.config.mjs +0 -22
  115. package/rollup.config.cjs +0 -28
  116. package/src/digipair__engine.d.ts +0 -2
  117. package/src/handlebars.d.ts +0 -1
  118. package/src/index.html +0 -18
  119. package/src/lib/chat.element.ts +0 -603
  120. package/src/lib/common.data.ts +0 -1
  121. package/src/lib/config.ts +0 -30
  122. package/src/lib/digipair-full.data.ts +0 -101
  123. package/src/lib/digipair-full.element.ts +0 -358
  124. package/src/lib/digipair.data.ts +0 -103
  125. package/src/lib/digipair.element.ts +0 -446
  126. package/src/lib/inputs.element.ts +0 -46
  127. package/src/lib/mermaid.d.ts +0 -1
  128. package/src/lib/message.interface.ts +0 -10
  129. package/src/lib/pins/chatbot.actions.ts +0 -32
  130. package/src/lib/tools/css-selector.ts +0 -12
  131. package/tsconfig.json +0 -13
  132. package/tsconfig.lib.json +0 -19
  133. /package/{src/index.d.ts → index.d.ts} +0 -0
  134. /package/{src/index.ts → libs/skill-web-chatbot/src/index.d.ts} +0 -0
  135. /package/{src/schema.fr.json → schema.fr.json} +0 -0
  136. /package/{src/schema.json → schema.json} +0 -0
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index.cjs2.js');
4
+
5
+ var s = function(a, n) {
6
+ return index.$.lang.round(index.Ot.parse(a)[n]);
7
+ }, e = s;
8
+
9
+ exports.e = e;
@@ -0,0 +1,7 @@
1
+ import { am as $, an as Ot } from './index.esm2.js';
2
+
3
+ var s = function(a, n) {
4
+ return $.lang.round(Ot.parse(a)[n]);
5
+ }, e = s;
6
+
7
+ export { e };
@@ -0,0 +1,209 @@
1
+ 'use strict';
2
+
3
+ var styles11e81fdd = require('./styles-11e81fdd.cjs.js');
4
+ var index = require('./index.cjs2.js');
5
+ var graph0ee63739 = require('./graph-0ee63739.cjs.js');
6
+ var layoutFd473db2 = require('./layout-fd473db2.cjs.js');
7
+ var line24d93f1b = require('./line-24d93f1b.cjs.js');
8
+ require('./array-2ff2c7a6.cjs.js');
9
+ require('./path-428ebac9.cjs.js');
10
+
11
+ var _ = 0;
12
+ var $ = function $(i, a, t, o, p) {
13
+ var g = function g(e) {
14
+ switch(e){
15
+ case p.db.relationType.AGGREGATION:
16
+ return "aggregation";
17
+ case p.db.relationType.EXTENSION:
18
+ return "extension";
19
+ case p.db.relationType.COMPOSITION:
20
+ return "composition";
21
+ case p.db.relationType.DEPENDENCY:
22
+ return "dependency";
23
+ case p.db.relationType.LOLLIPOP:
24
+ return "lollipop";
25
+ }
26
+ };
27
+ a.points = a.points.filter(function(e) {
28
+ return !Number.isNaN(e.y);
29
+ });
30
+ var s = a.points, c = line24d93f1b.P().x(function(e) {
31
+ return e.x;
32
+ }).y(function(e) {
33
+ return e.y;
34
+ }).curve(index.Pf), n = i.append("path").attr("d", c(s)).attr("id", "edge" + _).attr("class", "relation");
35
+ var r = "";
36
+ o.arrowMarkerAbsolute && (r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, r = r.replace(/\(/g, "\\("), r = r.replace(/\)/g, "\\)")), t.relation.lineType == 1 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr("marker-start", "url(" + r + "#" + g(t.relation.type1) + "Start)"), t.relation.type2 !== "none" && n.attr("marker-end", "url(" + r + "#" + g(t.relation.type2) + "End)");
37
+ var f, h;
38
+ var x = a.points.length;
39
+ var k = index.ei.calcLabelPosition(a.points);
40
+ f = k.x, h = k.y;
41
+ var y, m, w, b;
42
+ if (x % 2 !== 0 && x > 1) {
43
+ var e = index.ei.calcCardinalityPosition(t.relation.type1 !== "none", a.points, a.points[0]), d = index.ei.calcCardinalityPosition(t.relation.type2 !== "none", a.points, a.points[x - 1]);
44
+ index.L.debug("cardinality_1_point " + JSON.stringify(e)), index.L.debug("cardinality_2_point " + JSON.stringify(d)), y = e.x, m = e.y, w = d.x, b = d.y;
45
+ }
46
+ if (t.title !== void 0) {
47
+ var e1 = i.append("g").attr("class", "classLabel"), d1 = e1.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
48
+ window.label = d1;
49
+ var l = d1.node().getBBox();
50
+ e1.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
51
+ }
52
+ index.L.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", y).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", w).attr("y", b).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), _++;
53
+ }, J = function J(i, a, t, o) {
54
+ index.L.debug("Rendering class ", a, t);
55
+ var p = a.id, g = {
56
+ id: p,
57
+ label: a.id,
58
+ width: 0,
59
+ height: 0
60
+ }, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
61
+ var c;
62
+ a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
63
+ var n = !0;
64
+ a.annotations.forEach(function(d) {
65
+ var l = c.append("tspan").text("\xab" + d + "\xbb");
66
+ n || l.attr("dy", t.textHeight), n = !1;
67
+ });
68
+ var r = C(a);
69
+ var f = c.append("tspan").text(r).attr("class", "title");
70
+ n || f.attr("dy", t.textHeight);
71
+ var h = c.node().getBBox().height;
72
+ var x, k, y;
73
+ if (a.members.length > 0) {
74
+ x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
75
+ var d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
76
+ n = !0, a.members.forEach(function(l) {
77
+ v(d, l, n, t), n = !1;
78
+ }), k = d.node().getBBox();
79
+ }
80
+ if (a.methods.length > 0) {
81
+ y = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + k.height).attr("y2", t.padding + h + t.dividerMargin + k.height);
82
+ var d1 = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + k.height + t.textHeight).attr("fill", "white").attr("class", "classText");
83
+ n = !0, a.methods.forEach(function(l) {
84
+ v(d1, l, n, t), n = !1;
85
+ });
86
+ }
87
+ var m = s.node().getBBox();
88
+ var w = " ";
89
+ a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
90
+ var e = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", w).node().getBBox().width;
91
+ return c.node().childNodes.forEach(function(d) {
92
+ d.setAttribute("x", (e - d.getBBox().width) / 2);
93
+ }), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), y && y.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
94
+ }, C = function C(i) {
95
+ var a = i.id;
96
+ return i.type && (a += "<" + index.C1(i.type) + ">"), a;
97
+ }, Z = function Z(i, a, t, o) {
98
+ index.L.debug("Rendering note ", a, t);
99
+ var p = a.id, g = {
100
+ id: p,
101
+ text: a.text,
102
+ width: 0,
103
+ height: 0
104
+ }, s = i.append("g").attr("id", p).attr("class", "classGroup");
105
+ var c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
106
+ var n = JSON.parse('"'.concat(a.text, '"')).split("\n");
107
+ n.forEach(function(x) {
108
+ index.L.debug("Adding line: ".concat(x)), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
109
+ });
110
+ var r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr("height", r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin).node().getBBox().width;
111
+ return c.node().childNodes.forEach(function(x) {
112
+ x.setAttribute("x", (h - x.getBBox().width) / 2);
113
+ }), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
114
+ }, v = function v(i, a, t, o) {
115
+ var _a_getDisplayDetails = a.getDisplayDetails(), p = _a_getDisplayDetails.displayText, g = _a_getDisplayDetails.cssStyle, s = i.append("tspan").attr("x", o.padding).text(p);
116
+ g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
117
+ }, N = {
118
+ getClassTitleString: C,
119
+ drawClass: J,
120
+ drawEdge: $,
121
+ drawNote: Z
122
+ };
123
+ var T = {};
124
+ var E = 20, L = function L(i) {
125
+ var a = Object.entries(T).find(function(t) {
126
+ return t[1].label === i;
127
+ });
128
+ if (a) return a[0];
129
+ }, R = function R(i) {
130
+ i.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), i.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), i.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").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"), i.append("defs").append("marker").attr("id", "compositionEnd").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"), i.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").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"), i.append("defs").append("marker").attr("id", "aggregationEnd").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"), i.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
131
+ }, F = function F(i, a, t, o) {
132
+ var p = index.Vn().class;
133
+ T = {}, index.L.info("Rendering diagram " + i);
134
+ var g = index.Vn().securityLevel;
135
+ var s;
136
+ g === "sandbox" && (s = index.bt("#i" + a));
137
+ var c = g === "sandbox" ? index.bt(s.nodes()[0].contentDocument.body) : index.bt("body"), n = c.select("[id='".concat(a, "']"));
138
+ R(n);
139
+ var r = new graph0ee63739.Ze({
140
+ multigraph: !0
141
+ });
142
+ r.setGraph({
143
+ isMultiGraph: !0
144
+ }), r.setDefaultEdgeLabel(function() {
145
+ return {};
146
+ });
147
+ var f = o.db.getClasses(), h = Object.keys(f);
148
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
149
+ try {
150
+ for(var _iterator = h[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
151
+ var e = _step.value;
152
+ var d = f[e], l = N.drawClass(n, d, p, o);
153
+ T[l.id] = l, r.setNode(l.id, l), index.L.info("Org height: " + l.height);
154
+ }
155
+ } catch (err) {
156
+ _didIteratorError = true;
157
+ _iteratorError = err;
158
+ } finally{
159
+ try {
160
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
161
+ _iterator.return();
162
+ }
163
+ } finally{
164
+ if (_didIteratorError) {
165
+ throw _iteratorError;
166
+ }
167
+ }
168
+ }
169
+ o.db.getRelations().forEach(function(e) {
170
+ index.L.info(// cspell:ignore tjoho
171
+ "tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)), r.setEdge(L(e.id1), L(e.id2), {
172
+ relation: e
173
+ }, e.title || "DEFAULT");
174
+ }), o.db.getNotes().forEach(function(e) {
175
+ index.L.debug("Adding note: ".concat(JSON.stringify(e)));
176
+ var d = N.drawNote(n, e, p, o);
177
+ T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(e.id, L(e.class), {
178
+ relation: {
179
+ id1: e.id,
180
+ id2: e.class,
181
+ relation: {
182
+ type1: "none",
183
+ type2: "none",
184
+ lineType: 10
185
+ }
186
+ }
187
+ }, "DEFAULT");
188
+ }), layoutFd473db2.Yt(r), r.nodes().forEach(function(e) {
189
+ e !== void 0 && r.node(e) !== void 0 && (index.L.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr("transform", "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"));
190
+ }), r.edges().forEach(function(e) {
191
+ e !== void 0 && r.edge(e) !== void 0 && (index.L.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
192
+ });
193
+ var y = n.node().getBBox(), m = y.width + E * 2, w = y.height + E * 2;
194
+ index.Ol(n, w, m, p.useMaxWidth);
195
+ var b = "".concat(y.x - E, " ").concat(y.y - E, " ").concat(m, " ").concat(w);
196
+ index.L.debug("viewBox ".concat(b)), n.attr("viewBox", b);
197
+ }, U = {
198
+ draw: F
199
+ }, tt = {
200
+ parser: styles11e81fdd.zt,
201
+ db: styles11e81fdd.Kt,
202
+ renderer: U,
203
+ styles: styles11e81fdd.Yt,
204
+ init: function(i) {
205
+ i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, styles11e81fdd.Kt.clear();
206
+ }
207
+ };
208
+
209
+ exports.diagram = tt;
@@ -0,0 +1,207 @@
1
+ import { z as zt, K as Kt, Y as Yt } from './styles-11e81fdd.esm.js';
2
+ import { V as Vn, c as L$1, b as bt, O as Ol, ao as Pf, i as ei, as as C1 } from './index.esm2.js';
3
+ import { Z as Ze } from './graph-0ee63739.esm.js';
4
+ import { Y as Yt$1 } from './layout-fd473db2.esm.js';
5
+ import { P } from './line-24d93f1b.esm.js';
6
+ import './array-2ff2c7a6.esm.js';
7
+ import './path-428ebac9.esm.js';
8
+
9
+ var _ = 0;
10
+ var $ = function $(i, a, t, o, p) {
11
+ var g = function g(e) {
12
+ switch(e){
13
+ case p.db.relationType.AGGREGATION:
14
+ return "aggregation";
15
+ case p.db.relationType.EXTENSION:
16
+ return "extension";
17
+ case p.db.relationType.COMPOSITION:
18
+ return "composition";
19
+ case p.db.relationType.DEPENDENCY:
20
+ return "dependency";
21
+ case p.db.relationType.LOLLIPOP:
22
+ return "lollipop";
23
+ }
24
+ };
25
+ a.points = a.points.filter(function(e) {
26
+ return !Number.isNaN(e.y);
27
+ });
28
+ var s = a.points, c = P().x(function(e) {
29
+ return e.x;
30
+ }).y(function(e) {
31
+ return e.y;
32
+ }).curve(Pf), n = i.append("path").attr("d", c(s)).attr("id", "edge" + _).attr("class", "relation");
33
+ var r = "";
34
+ o.arrowMarkerAbsolute && (r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, r = r.replace(/\(/g, "\\("), r = r.replace(/\)/g, "\\)")), t.relation.lineType == 1 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr("marker-start", "url(" + r + "#" + g(t.relation.type1) + "Start)"), t.relation.type2 !== "none" && n.attr("marker-end", "url(" + r + "#" + g(t.relation.type2) + "End)");
35
+ var f, h;
36
+ var x = a.points.length;
37
+ var k = ei.calcLabelPosition(a.points);
38
+ f = k.x, h = k.y;
39
+ var y, m, w, b;
40
+ if (x % 2 !== 0 && x > 1) {
41
+ var e = ei.calcCardinalityPosition(t.relation.type1 !== "none", a.points, a.points[0]), d = ei.calcCardinalityPosition(t.relation.type2 !== "none", a.points, a.points[x - 1]);
42
+ L$1.debug("cardinality_1_point " + JSON.stringify(e)), L$1.debug("cardinality_2_point " + JSON.stringify(d)), y = e.x, m = e.y, w = d.x, b = d.y;
43
+ }
44
+ if (t.title !== void 0) {
45
+ var e1 = i.append("g").attr("class", "classLabel"), d1 = e1.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
46
+ window.label = d1;
47
+ var l = d1.node().getBBox();
48
+ e1.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
49
+ }
50
+ L$1.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", y).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", w).attr("y", b).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), _++;
51
+ }, J = function J(i, a, t, o) {
52
+ L$1.debug("Rendering class ", a, t);
53
+ var p = a.id, g = {
54
+ id: p,
55
+ label: a.id,
56
+ width: 0,
57
+ height: 0
58
+ }, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
59
+ var c;
60
+ a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
61
+ var n = !0;
62
+ a.annotations.forEach(function(d) {
63
+ var l = c.append("tspan").text("\xab" + d + "\xbb");
64
+ n || l.attr("dy", t.textHeight), n = !1;
65
+ });
66
+ var r = C(a);
67
+ var f = c.append("tspan").text(r).attr("class", "title");
68
+ n || f.attr("dy", t.textHeight);
69
+ var h = c.node().getBBox().height;
70
+ var x, k, y;
71
+ if (a.members.length > 0) {
72
+ x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
73
+ var d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
74
+ n = !0, a.members.forEach(function(l) {
75
+ v(d, l, n, t), n = !1;
76
+ }), k = d.node().getBBox();
77
+ }
78
+ if (a.methods.length > 0) {
79
+ y = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + k.height).attr("y2", t.padding + h + t.dividerMargin + k.height);
80
+ var d1 = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + k.height + t.textHeight).attr("fill", "white").attr("class", "classText");
81
+ n = !0, a.methods.forEach(function(l) {
82
+ v(d1, l, n, t), n = !1;
83
+ });
84
+ }
85
+ var m = s.node().getBBox();
86
+ var w = " ";
87
+ a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
88
+ var e = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", w).node().getBBox().width;
89
+ return c.node().childNodes.forEach(function(d) {
90
+ d.setAttribute("x", (e - d.getBBox().width) / 2);
91
+ }), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), y && y.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
92
+ }, C = function C(i) {
93
+ var a = i.id;
94
+ return i.type && (a += "<" + C1(i.type) + ">"), a;
95
+ }, Z = function Z(i, a, t, o) {
96
+ L$1.debug("Rendering note ", a, t);
97
+ var p = a.id, g = {
98
+ id: p,
99
+ text: a.text,
100
+ width: 0,
101
+ height: 0
102
+ }, s = i.append("g").attr("id", p).attr("class", "classGroup");
103
+ var c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
104
+ var n = JSON.parse('"'.concat(a.text, '"')).split("\n");
105
+ n.forEach(function(x) {
106
+ L$1.debug("Adding line: ".concat(x)), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
107
+ });
108
+ var r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr("height", r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin).node().getBBox().width;
109
+ return c.node().childNodes.forEach(function(x) {
110
+ x.setAttribute("x", (h - x.getBBox().width) / 2);
111
+ }), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
112
+ }, v = function v(i, a, t, o) {
113
+ var _a_getDisplayDetails = a.getDisplayDetails(), p = _a_getDisplayDetails.displayText, g = _a_getDisplayDetails.cssStyle, s = i.append("tspan").attr("x", o.padding).text(p);
114
+ g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
115
+ }, N = {
116
+ getClassTitleString: C,
117
+ drawClass: J,
118
+ drawEdge: $,
119
+ drawNote: Z
120
+ };
121
+ var T = {};
122
+ var E = 20, L = function L(i) {
123
+ var a = Object.entries(T).find(function(t) {
124
+ return t[1].label === i;
125
+ });
126
+ if (a) return a[0];
127
+ }, R = function R(i) {
128
+ i.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), i.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), i.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").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"), i.append("defs").append("marker").attr("id", "compositionEnd").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"), i.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").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"), i.append("defs").append("marker").attr("id", "aggregationEnd").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"), i.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
129
+ }, F = function F(i, a, t, o) {
130
+ var p = Vn().class;
131
+ T = {}, L$1.info("Rendering diagram " + i);
132
+ var g = Vn().securityLevel;
133
+ var s;
134
+ g === "sandbox" && (s = bt("#i" + a));
135
+ var c = g === "sandbox" ? bt(s.nodes()[0].contentDocument.body) : bt("body"), n = c.select("[id='".concat(a, "']"));
136
+ R(n);
137
+ var r = new Ze({
138
+ multigraph: !0
139
+ });
140
+ r.setGraph({
141
+ isMultiGraph: !0
142
+ }), r.setDefaultEdgeLabel(function() {
143
+ return {};
144
+ });
145
+ var f = o.db.getClasses(), h = Object.keys(f);
146
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
147
+ try {
148
+ for(var _iterator = h[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
149
+ var e = _step.value;
150
+ var d = f[e], l = N.drawClass(n, d, p, o);
151
+ T[l.id] = l, r.setNode(l.id, l), L$1.info("Org height: " + l.height);
152
+ }
153
+ } catch (err) {
154
+ _didIteratorError = true;
155
+ _iteratorError = err;
156
+ } finally{
157
+ try {
158
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
159
+ _iterator.return();
160
+ }
161
+ } finally{
162
+ if (_didIteratorError) {
163
+ throw _iteratorError;
164
+ }
165
+ }
166
+ }
167
+ o.db.getRelations().forEach(function(e) {
168
+ L$1.info(// cspell:ignore tjoho
169
+ "tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)), r.setEdge(L(e.id1), L(e.id2), {
170
+ relation: e
171
+ }, e.title || "DEFAULT");
172
+ }), o.db.getNotes().forEach(function(e) {
173
+ L$1.debug("Adding note: ".concat(JSON.stringify(e)));
174
+ var d = N.drawNote(n, e, p, o);
175
+ T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(e.id, L(e.class), {
176
+ relation: {
177
+ id1: e.id,
178
+ id2: e.class,
179
+ relation: {
180
+ type1: "none",
181
+ type2: "none",
182
+ lineType: 10
183
+ }
184
+ }
185
+ }, "DEFAULT");
186
+ }), Yt$1(r), r.nodes().forEach(function(e) {
187
+ e !== void 0 && r.node(e) !== void 0 && (L$1.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr("transform", "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"));
188
+ }), r.edges().forEach(function(e) {
189
+ e !== void 0 && r.edge(e) !== void 0 && (L$1.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
190
+ });
191
+ var y = n.node().getBBox(), m = y.width + E * 2, w = y.height + E * 2;
192
+ Ol(n, w, m, p.useMaxWidth);
193
+ var b = "".concat(y.x - E, " ").concat(y.y - E, " ").concat(m, " ").concat(w);
194
+ L$1.debug("viewBox ".concat(b)), n.attr("viewBox", b);
195
+ }, U = {
196
+ draw: F
197
+ }, tt = {
198
+ parser: zt,
199
+ db: Kt,
200
+ renderer: U,
201
+ styles: Yt,
202
+ init: function(i) {
203
+ i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, Kt.clear();
204
+ }
205
+ };
206
+
207
+ export { tt as diagram };