vue-data-ui 3.10.4 → 3.11.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 (154) hide show
  1. package/README.md +41 -3
  2. package/dist/{BaseDraggableDialog-yydbrMGo.js → BaseDraggableDialog-Ca6iTqi8.js} +1 -1
  3. package/dist/{BaseIcon-Dkev7LF3.js → BaseIcon-DlnfQOPC.js} +30 -22
  4. package/dist/{BaseZoomControls-DiZb75GR.js → BaseZoomControls-Cap5wn8s.js} +1 -1
  5. package/dist/{ColorPicker-B2-PUcpZ.js → ColorPicker-DI0ilgcp.js} +1 -1
  6. package/dist/{DataTable-KnMZnrDl.js → DataTable-KIMqDIJv.js} +1 -1
  7. package/dist/{NonSvgPenAndPaper-CvboTw8J.js → NonSvgPenAndPaper-C1xyAC8W.js} +2 -2
  8. package/dist/{PackageVersion-B-d6mVAh.js → PackageVersion-CeU7wfkb.js} +1 -1
  9. package/dist/{PenAndPaper-XGy5hh2M.js → PenAndPaper-BrX5Qp19.js} +2 -2
  10. package/dist/{Slicer-B3sIrIT7.js → Slicer-BGnCg0Vk.js} +1 -1
  11. package/dist/{SlicerPreview-DGYouyqS.js → SlicerPreview-BPmM6icl.js} +1 -1
  12. package/dist/{Title-NgeRXqRA.js → Title-ByPv-v1s.js} +1 -1
  13. package/dist/{UserOptions-D-fbp44C.js → UserOptions-DToFtFUD.js} +1 -1
  14. package/dist/components/vue-ui-3d-bar.js +1 -1
  15. package/dist/components/vue-ui-accordion.js +1 -1
  16. package/dist/components/vue-ui-age-pyramid.js +1 -1
  17. package/dist/components/vue-ui-annotator.js +1 -1
  18. package/dist/components/vue-ui-bullet.js +1 -1
  19. package/dist/components/vue-ui-bump.js +1 -1
  20. package/dist/components/vue-ui-candlestick.js +1 -1
  21. package/dist/components/vue-ui-carousel-table.js +1 -1
  22. package/dist/components/vue-ui-chestnut.js +1 -1
  23. package/dist/components/vue-ui-chord.js +1 -1
  24. package/dist/components/vue-ui-circle-pack.js +1 -1
  25. package/dist/components/vue-ui-cursor.js +1 -1
  26. package/dist/components/vue-ui-dag.js +1 -1
  27. package/dist/components/vue-ui-dashboard.js +1 -1
  28. package/dist/components/vue-ui-digits.js +1 -1
  29. package/dist/components/vue-ui-donut-evolution.js +1 -1
  30. package/dist/components/vue-ui-donut.js +1 -1
  31. package/dist/components/vue-ui-dumbbell.js +1 -1
  32. package/dist/components/vue-ui-flow.js +1 -1
  33. package/dist/components/vue-ui-funnel.js +1 -1
  34. package/dist/components/vue-ui-galaxy.js +1 -1
  35. package/dist/components/vue-ui-gauge.js +1 -1
  36. package/dist/components/vue-ui-geo.js +1 -1
  37. package/dist/components/vue-ui-gizmo.js +1 -1
  38. package/dist/components/vue-ui-heatmap.js +1 -1
  39. package/dist/components/vue-ui-history-plot.js +1 -1
  40. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  41. package/dist/components/vue-ui-icon.js +1 -1
  42. package/dist/components/vue-ui-kpi.js +1 -1
  43. package/dist/components/vue-ui-mini-loader.js +1 -1
  44. package/dist/components/vue-ui-molecule.js +1 -1
  45. package/dist/components/vue-ui-mood-radar.js +1 -1
  46. package/dist/components/vue-ui-nested-donuts.js +1 -1
  47. package/dist/components/vue-ui-onion.js +1 -1
  48. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  49. package/dist/components/vue-ui-quadrant.js +1 -1
  50. package/dist/components/vue-ui-quick-chart.js +1 -1
  51. package/dist/components/vue-ui-radar.js +1 -1
  52. package/dist/components/vue-ui-rating.js +1 -1
  53. package/dist/components/vue-ui-relation-circle.js +1 -1
  54. package/dist/components/vue-ui-ridgeline.js +1 -1
  55. package/dist/components/vue-ui-rings.js +1 -1
  56. package/dist/components/vue-ui-scatter.js +1 -1
  57. package/dist/components/vue-ui-skeleton.js +1 -1
  58. package/dist/components/vue-ui-smiley.js +1 -1
  59. package/dist/components/vue-ui-spark-trend.js +1 -1
  60. package/dist/components/vue-ui-sparkbar.js +1 -1
  61. package/dist/components/vue-ui-sparkgauge.js +1 -1
  62. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  63. package/dist/components/vue-ui-sparkline.js +1 -1
  64. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  65. package/dist/components/vue-ui-stackbar.js +1 -1
  66. package/dist/components/vue-ui-stackline.js +1 -1
  67. package/dist/components/vue-ui-strip-plot.js +1 -1
  68. package/dist/components/vue-ui-table-heatmap.js +1 -1
  69. package/dist/components/vue-ui-table-sparkline.js +1 -1
  70. package/dist/components/vue-ui-table.js +1 -1
  71. package/dist/components/vue-ui-thermometer.js +1 -1
  72. package/dist/components/vue-ui-timer.js +1 -1
  73. package/dist/components/vue-ui-tiremarks.js +1 -1
  74. package/dist/components/vue-ui-treemap.js +1 -1
  75. package/dist/components/vue-ui-vertical-bar.js +1 -1
  76. package/dist/components/vue-ui-waffle.js +1 -1
  77. package/dist/components/vue-ui-wheel.js +1 -1
  78. package/dist/components/vue-ui-word-cloud.js +1 -1
  79. package/dist/components/vue-ui-world.js +1 -1
  80. package/dist/components/vue-ui-xy-canvas.js +1 -1
  81. package/dist/components/vue-ui-xy.js +1 -1
  82. package/dist/style.css +1 -1
  83. package/dist/types/vue-data-ui.d.ts +35 -1
  84. package/dist/{useNestedProp-Ckf_2P_V.js → useNestedProp-xXVO6hRJ.js} +1044 -1039
  85. package/dist/{vue-data-ui-C0aLv5Q4.js → vue-data-ui-BGVCuqpQ.js} +68 -68
  86. package/dist/vue-data-ui.js +275 -205
  87. package/dist/{vue-ui-3d-bar-B7BAQ1Ht.js → vue-ui-3d-bar-D5V7OTy6.js} +3 -3
  88. package/dist/{vue-ui-accordion-YWjqDGPM.js → vue-ui-accordion-bYZsb7Wp.js} +2 -2
  89. package/dist/{vue-ui-age-pyramid-wl6PBobo.js → vue-ui-age-pyramid-DU6S6j3t.js} +3 -3
  90. package/dist/{vue-ui-annotator-VtMsL8_a.js → vue-ui-annotator-Rg1nfT2x.js} +4 -4
  91. package/dist/{vue-ui-bullet-DbxGLo-x.js → vue-ui-bullet-53zY2KH_.js} +3 -3
  92. package/dist/{vue-ui-bump-DxIgr2HP.js → vue-ui-bump-WL7u9LH8.js} +4 -4
  93. package/dist/{vue-ui-candlestick-C4E2f9Yx.js → vue-ui-candlestick-axcfwfzv.js} +4 -4
  94. package/dist/{vue-ui-carousel-table-CW50IQBB.js → vue-ui-carousel-table-BwVI9q5l.js} +2 -2
  95. package/dist/{vue-ui-chestnut-B8D-E_OT.js → vue-ui-chestnut-BWc1L3Zp.js} +2 -2
  96. package/dist/{vue-ui-chord-Cr7XtjeH.js → vue-ui-chord-C__n2WRw.js} +3 -3
  97. package/dist/{vue-ui-circle-pack-G61lXn-A.js → vue-ui-circle-pack-EFD74yni.js} +3 -3
  98. package/dist/{vue-ui-cursor-DBiPQOJt.js → vue-ui-cursor-Bo2mzfdU.js} +2 -2
  99. package/dist/vue-ui-dag-BOH1qkhM.js +2861 -0
  100. package/dist/{vue-ui-dashboard-DP91aVu4.js → vue-ui-dashboard-Devvdb8N.js} +66 -66
  101. package/dist/{vue-ui-digits-DnsDASGD.js → vue-ui-digits-C_VT43rS.js} +1 -1
  102. package/dist/{vue-ui-donut-CmR1VtDq.js → vue-ui-donut-D4dQZZnH.js} +3 -3
  103. package/dist/{vue-ui-donut-evolution-CRw22F_H.js → vue-ui-donut-evolution-Bb6pNSl2.js} +4 -4
  104. package/dist/{vue-ui-dumbbell-DfKWaod1.js → vue-ui-dumbbell-BSLXEtpa.js} +3 -3
  105. package/dist/{vue-ui-flow-keUxLfvc.js → vue-ui-flow-C_K8v9-T.js} +3 -3
  106. package/dist/{vue-ui-funnel-C68oqiIK.js → vue-ui-funnel-BlJX4I86.js} +3 -3
  107. package/dist/{vue-ui-galaxy-C-6Ygooc.js → vue-ui-galaxy-Dnt7eTvj.js} +3 -3
  108. package/dist/{vue-ui-gauge-BEqGBoZP.js → vue-ui-gauge-DU3L-c2d.js} +3 -3
  109. package/dist/{vue-ui-geo-BSCp207O.js → vue-ui-geo-Cb3OcIOH.js} +4 -4
  110. package/dist/{vue-ui-gizmo-DDdt4YYe.js → vue-ui-gizmo-Bd4TUwgC.js} +2 -2
  111. package/dist/{vue-ui-heatmap-DoptdeuZ.js → vue-ui-heatmap-C3sJRXrr.js} +4 -4
  112. package/dist/{vue-ui-history-plot-D3VqVH6G.js → vue-ui-history-plot-C0mRo1Xh.js} +3 -3
  113. package/dist/{vue-ui-horizontal-bar-DVT2uDtq.js → vue-ui-horizontal-bar-Bezsc-fA.js} +8 -8
  114. package/dist/{vue-ui-kpi-DgSmfw2q.js → vue-ui-kpi-ukaoY0am.js} +2 -2
  115. package/dist/{vue-ui-mini-loader-D8z1PwRZ.js → vue-ui-mini-loader-CEfxU4dT.js} +1 -1
  116. package/dist/{vue-ui-molecule-DzHtkXhX.js → vue-ui-molecule-CNTjty7x.js} +2 -2
  117. package/dist/{vue-ui-mood-radar-BbX7w_ad.js → vue-ui-mood-radar-CUZNpZVO.js} +3 -3
  118. package/dist/{vue-ui-nested-donuts-CAaU0Rrm.js → vue-ui-nested-donuts-B2efHRHL.js} +3 -3
  119. package/dist/{vue-ui-onion-DREO2Z6U.js → vue-ui-onion-DftdWrmN.js} +3 -3
  120. package/dist/{vue-ui-parallel-coordinate-plot-BKBBdpY1.js → vue-ui-parallel-coordinate-plot-avk0nC2O.js} +3 -3
  121. package/dist/{vue-ui-quadrant-_vUwHJzv.js → vue-ui-quadrant-CcES0yJX.js} +3 -3
  122. package/dist/{vue-ui-quick-chart-24K2Bysn.js → vue-ui-quick-chart-Lhko6jZO.js} +3 -3
  123. package/dist/{vue-ui-radar-N_6WRMyx.js → vue-ui-radar-CZzLTV82.js} +3 -3
  124. package/dist/{vue-ui-rating-W6I6pacT.js → vue-ui-rating-A8MUSqQc.js} +1 -1
  125. package/dist/{vue-ui-relation-circle-YYjxSGqL.js → vue-ui-relation-circle-DKsYPxga.js} +3 -3
  126. package/dist/{vue-ui-ridgeline-IdmUzGSH.js → vue-ui-ridgeline-CG4vAPEc.js} +3 -3
  127. package/dist/{vue-ui-rings-DbmA_Vyh.js → vue-ui-rings-Bib2u3Iy.js} +3 -3
  128. package/dist/{vue-ui-scatter-DcDSsAkr.js → vue-ui-scatter-Ck1GlFtJ.js} +3 -3
  129. package/dist/{vue-ui-skeleton-tH6Uo_Bi.js → vue-ui-skeleton-DoVdtkN0.js} +2 -2
  130. package/dist/{vue-ui-smiley-B23r7AWp.js → vue-ui-smiley-BH40_Lrp.js} +1 -1
  131. package/dist/{vue-ui-spark-trend-Bd6UJIRg.js → vue-ui-spark-trend-BugjXnUh.js} +2 -2
  132. package/dist/{vue-ui-sparkbar-tUo47wwo.js → vue-ui-sparkbar-D3VgwOnn.js} +2 -2
  133. package/dist/{vue-ui-sparkgauge-CiaiO1JX.js → vue-ui-sparkgauge-CLJ-JREV.js} +2 -2
  134. package/dist/{vue-ui-sparkhistogram-C8DMnroR.js → vue-ui-sparkhistogram-D_P8dpNb.js} +2 -2
  135. package/dist/{vue-ui-sparkline-B4bEsyxd.js → vue-ui-sparkline-Cq90PKWK.js} +2 -2
  136. package/dist/{vue-ui-sparkstackbar-8cw7h_7Y.js → vue-ui-sparkstackbar-CxtZQvtK.js} +2 -2
  137. package/dist/{vue-ui-stackbar-BUEWFVL4.js → vue-ui-stackbar-D-iHtRc0.js} +4 -4
  138. package/dist/{vue-ui-stackline-17Qdgzy7.js → vue-ui-stackline-DvgRG0E5.js} +4 -4
  139. package/dist/{vue-ui-strip-plot-DkMWYwjY.js → vue-ui-strip-plot-Bk78cTIb.js} +3 -3
  140. package/dist/{vue-ui-table-BppRxxpv.js → vue-ui-table-CjOh09D-.js} +4 -4
  141. package/dist/{vue-ui-table-heatmap-DPJNR6Yb.js → vue-ui-table-heatmap-_SbbUYwq.js} +2 -2
  142. package/dist/{vue-ui-table-sparkline-Dl-PZ_T_.js → vue-ui-table-sparkline-DnNcAKYJ.js} +2 -2
  143. package/dist/{vue-ui-thermometer-BQAVSTWa.js → vue-ui-thermometer-CdEv5Xfv.js} +3 -3
  144. package/dist/{vue-ui-timer-uuP6d-hn.js → vue-ui-timer-CyD-GmM7.js} +4 -4
  145. package/dist/{vue-ui-tiremarks-DUeJB0Bu.js → vue-ui-tiremarks-BRI09NAS.js} +3 -3
  146. package/dist/{vue-ui-treemap-TbqIxXuK.js → vue-ui-treemap-BfgB8BTQ.js} +4 -4
  147. package/dist/{vue-ui-waffle-1C6BaA9F.js → vue-ui-waffle-Ba0-xqsn.js} +3 -3
  148. package/dist/{vue-ui-wheel-7fwzBckw.js → vue-ui-wheel-BDCbjnoD.js} +3 -3
  149. package/dist/{vue-ui-word-cloud-CsyVGD7H.js → vue-ui-word-cloud-CsCvZYqx.js} +4 -4
  150. package/dist/{vue-ui-world-Chue2G32.js → vue-ui-world-CfwVv-9P.js} +2 -2
  151. package/dist/{vue-ui-xy-BEoDq04z.js → vue-ui-xy-C9qRqR1C.js} +5 -5
  152. package/dist/{vue-ui-xy-canvas-BG4nyCGs.js → vue-ui-xy-canvas-B0ua74yH.js} +6 -6
  153. package/package.json +1 -1
  154. package/dist/vue-ui-dag-BBREGeuq.js +0 -2810
@@ -0,0 +1,2861 @@
1
+ import { ref as C, watchEffect as pn, unref as p, defineAsyncComponent as rt, toRefs as bn, computed as Z, onMounted as Xt, nextTick as Me, watch as Oe, onBeforeUnmount as qt, createElementBlock as _, openBlock as E, normalizeStyle as pe, normalizeClass as Kt, createCommentVNode as L, createBlock as ne, createVNode as it, toDisplayString as De, withCtx as z, renderSlot as O, normalizeProps as I, guardReactiveProps as H, createSlots as yn, createElementVNode as J, Fragment as ue, renderList as Te, mergeProps as be, withModifiers as Jt, createTextVNode as wn, Transition as Qt, Teleport as eo } from "vue";
2
+ import { c as mt, aB as kn, t as En, o as Cn, g as to, m as oo, X as _n, as as xn } from "./lib-CVHM9FhP.js";
3
+ import { t as An, u as Nn } from "./useResponsive-DfdjqQps.js";
4
+ import { u as Sn } from "./usePanZoom-CDF7rb3o.js";
5
+ import { u as Ln, a as at } from "./useNestedProp-xXVO6hRJ.js";
6
+ import { u as Mn, B as On } from "./BaseScanner-BMpwQAfz.js";
7
+ import { u as Dn } from "./usePrinter-1NmjuP-i.js";
8
+ import { u as Tn } from "./useSvgExport-ByUukOZt.js";
9
+ import { u as Rn } from "./useThemeCheck-D1ZYXUwG.js";
10
+ import { u as Pn } from "./useUserOptionState-BIvW1Kz7.js";
11
+ import { u as $n } from "./useChartAccessibility-9icAAmYg.js";
12
+ import Fn from "./Title-ByPv-v1s.js";
13
+ import { B as no } from "./BaseZoomControls-Cap5wn8s.js";
14
+ import Bn from "./img-6fNF_rG0.js";
15
+ import { _ as zn } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
+ const Vn = "\0", de = "\0", so = "";
17
+ class se {
18
+ _isDirected = !0;
19
+ _isMultigraph = !1;
20
+ _isCompound = !1;
21
+ // Label for the graph itself
22
+ _label;
23
+ // Defaults to be set when creating a new node
24
+ _defaultNodeLabelFn = () => {
25
+ };
26
+ // Defaults to be set when creating a new edge
27
+ _defaultEdgeLabelFn = () => {
28
+ };
29
+ // v -> label
30
+ _nodes = {};
31
+ // v -> edgeObj
32
+ _in = {};
33
+ // u -> v -> Number
34
+ _preds = {};
35
+ // v -> edgeObj
36
+ _out = {};
37
+ // v -> w -> Number
38
+ _sucs = {};
39
+ // e -> edgeObj
40
+ _edgeObjs = {};
41
+ // e -> label
42
+ _edgeLabels = {};
43
+ /* Number of nodes in the graph. Should only be changed by the implementation. */
44
+ _nodeCount = 0;
45
+ /* Number of edges in the graph. Should only be changed by the implementation. */
46
+ _edgeCount = 0;
47
+ _parent;
48
+ _children;
49
+ constructor(t) {
50
+ t && (this._isDirected = Object.hasOwn(t, "directed") ? t.directed : !0, this._isMultigraph = Object.hasOwn(t, "multigraph") ? t.multigraph : !1, this._isCompound = Object.hasOwn(t, "compound") ? t.compound : !1), this._isCompound && (this._parent = {}, this._children = {}, this._children[de] = {});
51
+ }
52
+ /* === Graph functions ========= */
53
+ /**
54
+ * Whether graph was created with 'directed' flag set to true or not.
55
+ */
56
+ isDirected() {
57
+ return this._isDirected;
58
+ }
59
+ /**
60
+ * Whether graph was created with 'multigraph' flag set to true or not.
61
+ */
62
+ isMultigraph() {
63
+ return this._isMultigraph;
64
+ }
65
+ /**
66
+ * Whether graph was created with 'compound' flag set to true or not.
67
+ */
68
+ isCompound() {
69
+ return this._isCompound;
70
+ }
71
+ /**
72
+ * Sets the label of the graph.
73
+ */
74
+ setGraph(t) {
75
+ return this._label = t, this;
76
+ }
77
+ /**
78
+ * Gets the graph label.
79
+ */
80
+ graph() {
81
+ return this._label;
82
+ }
83
+ /* === Node functions ========== */
84
+ /**
85
+ * Sets the default node label. If newDefault is a function, it will be
86
+ * invoked each time when setting a label for a node. Otherwise, this label
87
+ * will be assigned as default label in case if no label was specified while
88
+ * setting a node.
89
+ * Complexity: O(1).
90
+ */
91
+ setDefaultNodeLabel(t) {
92
+ return this._defaultNodeLabelFn = t, typeof t != "function" && (this._defaultNodeLabelFn = () => t), this;
93
+ }
94
+ /**
95
+ * Gets the number of nodes in the graph.
96
+ * Complexity: O(1).
97
+ */
98
+ nodeCount() {
99
+ return this._nodeCount;
100
+ }
101
+ /**
102
+ * Gets all nodes of the graph. Note, the in case of compound graph subnodes are
103
+ * not included in list.
104
+ * Complexity: O(1).
105
+ */
106
+ nodes() {
107
+ return Object.keys(this._nodes);
108
+ }
109
+ /**
110
+ * Gets list of nodes without in-edges.
111
+ * Complexity: O(|V|).
112
+ */
113
+ sources() {
114
+ const t = this;
115
+ return this.nodes().filter((o) => Object.keys(t._in[o]).length === 0);
116
+ }
117
+ /**
118
+ * Gets list of nodes without out-edges.
119
+ * Complexity: O(|V|).
120
+ */
121
+ sinks() {
122
+ const t = this;
123
+ return this.nodes().filter((o) => Object.keys(t._out[o]).length === 0);
124
+ }
125
+ /**
126
+ * Invokes setNode method for each node in names list.
127
+ * Complexity: O(|names|).
128
+ */
129
+ setNodes(t, o) {
130
+ const n = arguments, s = this;
131
+ return t.forEach((i) => {
132
+ n.length > 1 ? s.setNode(i, o) : s.setNode(i);
133
+ }), this;
134
+ }
135
+ /**
136
+ * Creates or updates the value for the node v in the graph. If value is supplied
137
+ * it is set as the value for the node. If value is not supplied and the node was
138
+ * created by this call then the default node label will be assigned.
139
+ * Complexity: O(1).
140
+ */
141
+ setNode(t, o) {
142
+ return Object.hasOwn(this._nodes, t) ? (arguments.length > 1 && (this._nodes[t] = o), this) : (this._nodes[t] = arguments.length > 1 ? o : this._defaultNodeLabelFn(t), this._isCompound && (this._parent[t] = de, this._children[t] = {}, this._children[de][t] = !0), this._in[t] = {}, this._preds[t] = {}, this._out[t] = {}, this._sucs[t] = {}, ++this._nodeCount, this);
143
+ }
144
+ /**
145
+ * Gets the label of node with specified name.
146
+ * Complexity: O(1).
147
+ */
148
+ node(t) {
149
+ return this._nodes[t];
150
+ }
151
+ /**
152
+ * Detects whether graph has a node with specified name or not.
153
+ */
154
+ hasNode(t) {
155
+ return Object.hasOwn(this._nodes, t);
156
+ }
157
+ /**
158
+ * Remove the node with the name from the graph or do nothing if the node is not in
159
+ * the graph. If the node was removed this function also removes any incident
160
+ * edges.
161
+ * Complexity: O(1).
162
+ */
163
+ removeNode(t) {
164
+ const o = this;
165
+ if (Object.hasOwn(this._nodes, t)) {
166
+ const n = (s) => o.removeEdge(o._edgeObjs[s]);
167
+ delete this._nodes[t], this._isCompound && (this._removeFromParentsChildList(t), delete this._parent[t], this.children(t).forEach((s) => {
168
+ o.setParent(s);
169
+ }), delete this._children[t]), Object.keys(this._in[t]).forEach(n), delete this._in[t], delete this._preds[t], Object.keys(this._out[t]).forEach(n), delete this._out[t], delete this._sucs[t], --this._nodeCount;
170
+ }
171
+ return this;
172
+ }
173
+ /**
174
+ * Sets node parentId as a parent for node nodeId if it is defined, or removes the
175
+ * parent for nodeId if parentId is undefined. Method throws an exception in case of
176
+ * invoking it in context of noncompound graph.
177
+ * Average-case complexity: O(1).
178
+ */
179
+ setParent(t, o) {
180
+ if (!this._isCompound)
181
+ throw new Error("Cannot set parent in a non-compound graph");
182
+ if (o === void 0)
183
+ o = de;
184
+ else {
185
+ o += "";
186
+ for (let n = o; n !== void 0; n = this.parent(n))
187
+ if (n === t)
188
+ throw new Error(
189
+ "Setting " + o + " as parent of " + t + " would create a cycle"
190
+ );
191
+ this.setNode(o);
192
+ }
193
+ return this.setNode(t), this._removeFromParentsChildList(t), this._parent[t] = o, this._children[o][t] = !0, this;
194
+ }
195
+ _removeFromParentsChildList(t) {
196
+ delete this._children[this._parent[t]][t];
197
+ }
198
+ /**
199
+ * Gets parent node for node nodeId.
200
+ * Complexity: O(1).
201
+ */
202
+ parent(t) {
203
+ if (this._isCompound) {
204
+ const o = this._parent[t];
205
+ if (o !== de)
206
+ return o;
207
+ }
208
+ }
209
+ /**
210
+ * Gets list of direct children of node nodeId.
211
+ * Complexity: O(1).
212
+ */
213
+ children(t = de) {
214
+ if (this._isCompound) {
215
+ const o = this._children[t];
216
+ if (o)
217
+ return Object.keys(o);
218
+ } else {
219
+ if (t === de)
220
+ return this.nodes();
221
+ if (this.hasNode(t))
222
+ return [];
223
+ }
224
+ }
225
+ /**
226
+ * Return all nodes that are predecessors of the specified node or undefined if nodeId is not in
227
+ * the graph. Behavior is undefined for undirected graphs - use neighbors instead.
228
+ * Complexity: O(|V|).
229
+ */
230
+ predecessors(t) {
231
+ const o = this._preds[t];
232
+ if (o)
233
+ return Object.keys(o);
234
+ }
235
+ /**
236
+ * Return all nodes that are successors of the specified node or undefined if nodeId is not in
237
+ * the graph. Behavior is undefined for undirected graphs - use neighbors instead.
238
+ * Complexity: O(|V|).
239
+ */
240
+ successors(t) {
241
+ const o = this._sucs[t];
242
+ if (o)
243
+ return Object.keys(o);
244
+ }
245
+ /**
246
+ * Return all nodes that are predecessors or successors of the specified node or undefined if
247
+ * nodeId is not in the graph.
248
+ * Complexity: O(|V|).
249
+ */
250
+ neighbors(t) {
251
+ const o = this.predecessors(t);
252
+ if (o) {
253
+ const n = new Set(o);
254
+ for (const s of this.successors(t))
255
+ n.add(s);
256
+ return Array.from(n.values());
257
+ }
258
+ }
259
+ isLeaf(t) {
260
+ let o;
261
+ return this.isDirected() ? o = this.successors(t) : o = this.neighbors(t), o.length === 0;
262
+ }
263
+ /**
264
+ * Creates new graph with nodes filtered via filter. Edges incident to rejected node
265
+ * are also removed. In case of compound graph, if parent is rejected by filter,
266
+ * then all its children are rejected too.
267
+ * Average-case complexity: O(|E|+|V|).
268
+ */
269
+ filterNodes(t) {
270
+ const o = new this.constructor({
271
+ directed: this._isDirected,
272
+ multigraph: this._isMultigraph,
273
+ compound: this._isCompound
274
+ });
275
+ o.setGraph(this.graph());
276
+ const n = this;
277
+ Object.entries(this._nodes).forEach(([r, a]) => {
278
+ t(r) && o.setNode(r, a);
279
+ }), Object.values(this._edgeObjs).forEach((r) => {
280
+ o.hasNode(r.v) && o.hasNode(r.w) && o.setEdge(r, n.edge(r));
281
+ });
282
+ const s = {};
283
+ function i(r) {
284
+ const a = n.parent(r);
285
+ return a === void 0 || o.hasNode(a) ? (s[r] = a, a) : a in s ? s[a] : i(a);
286
+ }
287
+ return this._isCompound && o.nodes().forEach((r) => o.setParent(r, i(r))), o;
288
+ }
289
+ /* === Edge functions ========== */
290
+ /**
291
+ * Sets the default edge label or factory function. This label will be
292
+ * assigned as default label in case if no label was specified while setting
293
+ * an edge or this function will be invoked each time when setting an edge
294
+ * with no label specified and returned value will be used as a label for edge.
295
+ * Complexity: O(1).
296
+ */
297
+ setDefaultEdgeLabel(t) {
298
+ return this._defaultEdgeLabelFn = t, typeof t != "function" && (this._defaultEdgeLabelFn = () => t), this;
299
+ }
300
+ /**
301
+ * Gets the number of edges in the graph.
302
+ * Complexity: O(1).
303
+ */
304
+ edgeCount() {
305
+ return this._edgeCount;
306
+ }
307
+ /**
308
+ * Gets edges of the graph. In case of compound graph subgraphs are not considered.
309
+ * Complexity: O(|E|).
310
+ */
311
+ edges() {
312
+ return Object.values(this._edgeObjs);
313
+ }
314
+ /**
315
+ * Establish an edges path over the nodes in nodeIds list. If some edge already
316
+ * exists, it will update its label, otherwise it will create an edge between pair
317
+ * of nodes with label provided or default label if no label provided.
318
+ * Complexity: O(|nodeIds|).
319
+ */
320
+ setPath(t, o) {
321
+ const n = this, s = arguments;
322
+ return t.reduce((i, r) => (s.length > 1 ? n.setEdge(i, r, o) : n.setEdge(i, r), r)), this;
323
+ }
324
+ /**
325
+ * Creates or updates the label for the edge (v, w) with the optionally supplied
326
+ * name. If value is supplied it is set as the value for the edge. If value is not
327
+ * supplied and the edge was created by this call then the default edge label will
328
+ * be assigned. The name parameter is only useful with multigraphs.
329
+ */
330
+ setEdge() {
331
+ let t, o, n, s, i = !1;
332
+ const r = arguments[0];
333
+ typeof r == "object" && r !== null && "v" in r ? (t = r.v, o = r.w, n = r.name, arguments.length === 2 && (s = arguments[1], i = !0)) : (t = r, o = arguments[1], n = arguments[3], arguments.length > 2 && (s = arguments[2], i = !0)), t = "" + t, o = "" + o, n !== void 0 && (n = "" + n);
334
+ let a = Re(this._isDirected, t, o, n);
335
+ if (Object.hasOwn(this._edgeLabels, a))
336
+ return i && (this._edgeLabels[a] = s), this;
337
+ if (n !== void 0 && !this._isMultigraph)
338
+ throw new Error("Cannot set a named edge when isMultigraph = false");
339
+ this.setNode(t), this.setNode(o), this._edgeLabels[a] = i ? s : this._defaultEdgeLabelFn(t, o, n);
340
+ const c = In(this._isDirected, t, o, n);
341
+ return t = c.v, o = c.w, Object.freeze(c), this._edgeObjs[a] = c, ro(this._preds[o], t), ro(this._sucs[t], o), this._in[o][a] = c, this._out[t][a] = c, this._edgeCount++, this;
342
+ }
343
+ /**
344
+ * Gets the label for the specified edge.
345
+ * Complexity: O(1).
346
+ */
347
+ edge(t, o, n) {
348
+ const s = arguments.length === 1 ? lt(this._isDirected, arguments[0]) : Re(this._isDirected, t, o, n);
349
+ return this._edgeLabels[s];
350
+ }
351
+ /**
352
+ * Gets the label for the specified edge and converts it to an object.
353
+ * Complexity: O(1)
354
+ */
355
+ edgeAsObj() {
356
+ const t = this.edge(...arguments);
357
+ return typeof t != "object" ? { label: t } : t;
358
+ }
359
+ /**
360
+ * Detects whether the graph contains specified edge or not. No subgraphs are considered.
361
+ * Complexity: O(1).
362
+ */
363
+ hasEdge(t, o, n) {
364
+ const s = arguments.length === 1 ? lt(this._isDirected, arguments[0]) : Re(this._isDirected, t, o, n);
365
+ return Object.hasOwn(this._edgeLabels, s);
366
+ }
367
+ /**
368
+ * Removes the specified edge from the graph. No subgraphs are considered.
369
+ * Complexity: O(1).
370
+ */
371
+ removeEdge(t, o, n) {
372
+ const s = arguments.length === 1 ? lt(this._isDirected, arguments[0]) : Re(this._isDirected, t, o, n), i = this._edgeObjs[s];
373
+ return i && (t = i.v, o = i.w, delete this._edgeLabels[s], delete this._edgeObjs[s], io(this._preds[o], t), io(this._sucs[t], o), delete this._in[o][s], delete this._out[t][s], this._edgeCount--), this;
374
+ }
375
+ /**
376
+ * Return all edges that point to the node v. Optionally filters those edges down to just those
377
+ * coming from node u. Behavior is undefined for undirected graphs - use nodeEdges instead.
378
+ * Complexity: O(|E|).
379
+ */
380
+ inEdges(t, o) {
381
+ const n = this._in[t];
382
+ if (n) {
383
+ const s = Object.values(n);
384
+ return o ? s.filter((i) => i.v === o) : s;
385
+ }
386
+ }
387
+ /**
388
+ * Return all edges that are pointed at by node v. Optionally filters those edges down to just
389
+ * those pointing to w. Behavior is undefined for undirected graphs - use nodeEdges instead.
390
+ * Complexity: O(|E|).
391
+ */
392
+ outEdges(t, o) {
393
+ const n = this._out[t];
394
+ if (n) {
395
+ const s = Object.values(n);
396
+ return o ? s.filter((i) => i.w === o) : s;
397
+ }
398
+ }
399
+ /**
400
+ * Returns all edges to or from node v regardless of direction. Optionally filters those edges
401
+ * down to just those between nodes v and w regardless of direction.
402
+ * Complexity: O(|E|).
403
+ */
404
+ nodeEdges(t, o) {
405
+ const n = this.inEdges(t, o);
406
+ if (n)
407
+ return n.concat(this.outEdges(t, o));
408
+ }
409
+ }
410
+ function ro(e, t) {
411
+ e[t] ? e[t]++ : e[t] = 1;
412
+ }
413
+ function io(e, t) {
414
+ --e[t] || delete e[t];
415
+ }
416
+ function Re(e, t, o, n) {
417
+ let s = "" + t, i = "" + o;
418
+ if (!e && s > i) {
419
+ const r = s;
420
+ s = i, i = r;
421
+ }
422
+ return s + so + i + so + (n === void 0 ? Vn : n);
423
+ }
424
+ function In(e, t, o, n) {
425
+ let s = "" + t, i = "" + o;
426
+ if (!e && s > i) {
427
+ const a = s;
428
+ s = i, i = a;
429
+ }
430
+ const r = { v: s, w: i };
431
+ return n && (r.name = n), r;
432
+ }
433
+ function lt(e, t) {
434
+ return Re(e, t.v, t.w, t.name);
435
+ }
436
+ class Hn {
437
+ constructor() {
438
+ const t = {};
439
+ t._next = t._prev = t, this._sentinel = t;
440
+ }
441
+ dequeue() {
442
+ const t = this._sentinel, o = t._prev;
443
+ if (o !== t)
444
+ return ao(o), o;
445
+ }
446
+ enqueue(t) {
447
+ const o = this._sentinel;
448
+ t._prev && t._next && ao(t), t._next = o._next, o._next._prev = t, o._next = t, t._prev = o;
449
+ }
450
+ toString() {
451
+ const t = [], o = this._sentinel;
452
+ let n = o._prev;
453
+ for (; n !== o; )
454
+ t.push(JSON.stringify(n, Gn)), n = n._prev;
455
+ return "[" + t.join(", ") + "]";
456
+ }
457
+ }
458
+ function ao(e) {
459
+ e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
460
+ }
461
+ function Gn(e, t) {
462
+ if (e !== "_next" && e !== "_prev")
463
+ return t;
464
+ }
465
+ const Wn = () => 1;
466
+ function jn(e, t) {
467
+ if (e.nodeCount() <= 1)
468
+ return [];
469
+ const o = Un(e, t || Wn);
470
+ return Yn(o.graph, o.buckets, o.zeroIndex).flatMap((s) => e.outEdges(s.v, s.w));
471
+ }
472
+ function Yn(e, t, o) {
473
+ let n = [];
474
+ const s = t[t.length - 1], i = t[0];
475
+ let r;
476
+ for (; e.nodeCount(); ) {
477
+ for (; r = i.dequeue(); )
478
+ ct(e, t, o, r);
479
+ for (; r = s.dequeue(); )
480
+ ct(e, t, o, r);
481
+ if (e.nodeCount()) {
482
+ for (let a = t.length - 2; a > 0; --a)
483
+ if (r = t[a].dequeue(), r) {
484
+ n = n.concat(ct(e, t, o, r, !0));
485
+ break;
486
+ }
487
+ }
488
+ }
489
+ return n;
490
+ }
491
+ function ct(e, t, o, n, s) {
492
+ const i = s ? [] : void 0;
493
+ return e.inEdges(n.v).forEach((r) => {
494
+ const a = e.edge(r), c = e.node(r.v);
495
+ s && i.push({ v: r.v, w: r.w }), c.out -= a, gt(t, o, c);
496
+ }), e.outEdges(n.v).forEach((r) => {
497
+ const a = e.edge(r), c = e.node(r.w);
498
+ c.in -= a, gt(t, o, c);
499
+ }), e.removeNode(n.v), i;
500
+ }
501
+ function Un(e, t) {
502
+ const o = new se();
503
+ let n = 0, s = 0;
504
+ e.nodes().forEach((a) => {
505
+ o.setNode(a, { v: a, in: 0, out: 0 });
506
+ }), e.edges().forEach((a) => {
507
+ const c = o.edge(a.v, a.w) || 0, d = t(a), h = c + d;
508
+ o.setEdge(a.v, a.w, h), s = Math.max(s, o.node(a.v).out += d), n = Math.max(n, o.node(a.w).in += d);
509
+ });
510
+ const i = Zn(s + n + 3).map(() => new Hn()), r = n + 1;
511
+ return o.nodes().forEach((a) => {
512
+ gt(i, r, o.node(a));
513
+ }), {
514
+ graph: o,
515
+ buckets: i,
516
+ zeroIndex: r
517
+ };
518
+ }
519
+ function gt(e, t, o) {
520
+ o.out ? o.in ? e[o.out - o.in + t].enqueue(o) : e[e.length - 1].enqueue(o) : e[0].enqueue(o);
521
+ }
522
+ function Zn(e) {
523
+ const t = [];
524
+ for (let o = 0; o < e; o++)
525
+ t.push(o);
526
+ return t;
527
+ }
528
+ function we(e, t, o, n) {
529
+ let s = n;
530
+ for (; e.hasNode(s); )
531
+ s = je(n);
532
+ return o.dummy = t, e.setNode(s, o), s;
533
+ }
534
+ function yo(e) {
535
+ const t = new se().setGraph(e.graph());
536
+ return e.nodes().forEach((o) => {
537
+ t.setNode(o, e.node(o));
538
+ }), e.edges().forEach((o) => {
539
+ const n = t.edge(o.v, o.w) || { weight: 0, minlen: 1 }, s = e.edge(o);
540
+ t.setEdge(o.v, o.w, {
541
+ weight: n.weight + s.weight,
542
+ minlen: Math.max(n.minlen, s.minlen)
543
+ });
544
+ }), t;
545
+ }
546
+ function pt(e) {
547
+ const t = new se({ multigraph: e.isMultigraph() }).setGraph(e.graph());
548
+ return e.nodes().forEach((o) => {
549
+ e.children(o).length || t.setNode(o, e.node(o));
550
+ }), e.edges().forEach((o) => {
551
+ t.setEdge(o, e.edge(o));
552
+ }), t;
553
+ }
554
+ function Xn(e) {
555
+ const t = e.nodes().map((o) => {
556
+ const n = {};
557
+ return e.outEdges(o).forEach((s) => {
558
+ n[s.w] = (n[s.w] || 0) + e.edge(s).weight;
559
+ }), n;
560
+ });
561
+ return Ye(e.nodes(), t);
562
+ }
563
+ function qn(e) {
564
+ const t = e.nodes().map((o) => {
565
+ const n = {};
566
+ return e.inEdges(o).forEach((s) => {
567
+ n[s.v] = (n[s.v] || 0) + e.edge(s).weight;
568
+ }), n;
569
+ });
570
+ return Ye(e.nodes(), t);
571
+ }
572
+ function vt(e, t) {
573
+ let o = e.x, n = e.y;
574
+ const s = t.x - o, i = t.y - n;
575
+ let r = e.width / 2, a = e.height / 2;
576
+ if (!s && !i)
577
+ throw new Error("Not possible to find intersection inside of the rectangle");
578
+ let c, d;
579
+ return Math.abs(i) * r > Math.abs(s) * a ? (i < 0 && (a = -a), c = a * s / i, d = a) : (s < 0 && (r = -r), c = r, d = r * i / s), { x: o + c, y: n + d };
580
+ }
581
+ function $e(e) {
582
+ const t = ye(bt(e) + 1).map(() => []);
583
+ return e.nodes().forEach((o) => {
584
+ const n = e.node(o), s = n.rank;
585
+ s !== void 0 && (t[s][n.order] = o);
586
+ }), t;
587
+ }
588
+ function wo(e) {
589
+ const t = e.nodes().map((n) => {
590
+ const s = e.node(n).rank;
591
+ return s === void 0 ? Number.MAX_VALUE : s;
592
+ }), o = X(Math.min, t);
593
+ e.nodes().forEach((n) => {
594
+ const s = e.node(n);
595
+ Object.hasOwn(s, "rank") && (s.rank -= o);
596
+ });
597
+ }
598
+ function ko(e) {
599
+ const t = e.nodes().map((r) => e.node(r).rank).filter((r) => r !== void 0), o = X(Math.min, t), n = [];
600
+ e.nodes().forEach((r) => {
601
+ const a = e.node(r).rank - o;
602
+ n[a] || (n[a] = []), n[a].push(r);
603
+ });
604
+ let s = 0;
605
+ const i = e.graph().nodeRankFactor;
606
+ Array.from(n).forEach((r, a) => {
607
+ r === void 0 && a % i !== 0 ? --s : r !== void 0 && s && r.forEach((c) => {
608
+ e.node(c).rank += s;
609
+ });
610
+ });
611
+ }
612
+ function Kn(e, t, o, n) {
613
+ const s = {
614
+ width: 0,
615
+ height: 0
616
+ };
617
+ return arguments.length >= 4 && (s.rank = o, s.order = n), we(e, "border", s, t);
618
+ }
619
+ const Eo = 65535;
620
+ function Jn(e, t = Eo) {
621
+ const o = [];
622
+ for (let n = 0; n < e.length; n += t) {
623
+ const s = e.slice(n, n + t);
624
+ o.push(s);
625
+ }
626
+ return o;
627
+ }
628
+ function X(e, t) {
629
+ if (t.length > Eo) {
630
+ const o = Jn(t);
631
+ return e.apply(
632
+ null,
633
+ o.map((n) => e.apply(null, n))
634
+ );
635
+ } else
636
+ return e.apply(null, t);
637
+ }
638
+ function bt(e) {
639
+ const o = e.nodes().map((n) => {
640
+ const s = e.node(n).rank;
641
+ return s === void 0 ? Number.MIN_VALUE : s;
642
+ });
643
+ return X(Math.max, o);
644
+ }
645
+ function Co(e, t) {
646
+ const o = { lhs: [], rhs: [] };
647
+ return e.forEach((n) => {
648
+ t(n) ? o.lhs.push(n) : o.rhs.push(n);
649
+ }), o;
650
+ }
651
+ function _o(e, t) {
652
+ const o = Date.now();
653
+ try {
654
+ return t();
655
+ } finally {
656
+ console.log(e + " time: " + (Date.now() - o) + "ms");
657
+ }
658
+ }
659
+ function xo(e, t) {
660
+ return t();
661
+ }
662
+ let Qn = 0;
663
+ function je(e) {
664
+ const t = ++Qn;
665
+ return e + String(t);
666
+ }
667
+ function ye(e, t, o = 1) {
668
+ t == null && (t = e, e = 0);
669
+ let n = (i) => i < t;
670
+ o < 0 && (n = (i) => t < i);
671
+ const s = [];
672
+ for (let i = e; n(i); i += o)
673
+ s.push(i);
674
+ return s;
675
+ }
676
+ function Pe(e, t) {
677
+ const o = {};
678
+ for (const n of t)
679
+ e[n] !== void 0 && (o[n] = e[n]);
680
+ return o;
681
+ }
682
+ function Fe(e, t) {
683
+ let o = t;
684
+ if (typeof t == "string") {
685
+ const n = t;
686
+ o = (s) => s[n];
687
+ }
688
+ return Object.entries(e).reduce((n, [s, i]) => (n[s] = o(i, s), n), {});
689
+ }
690
+ function Ye(e, t) {
691
+ return e.reduce((o, n, s) => (o[n] = t[s], o), {});
692
+ }
693
+ const We = {
694
+ addBorderNode: Kn,
695
+ addDummyNode: we,
696
+ applyWithChunking: X,
697
+ asNonCompoundGraph: pt,
698
+ buildLayerMatrix: $e,
699
+ intersectRect: vt,
700
+ mapValues: Fe,
701
+ maxRank: bt,
702
+ normalizeRanks: wo,
703
+ notime: xo,
704
+ partition: Co,
705
+ pick: Pe,
706
+ predecessorWeights: qn,
707
+ range: ye,
708
+ removeEmptyRanks: ko,
709
+ simplify: yo,
710
+ successorWeights: Xn,
711
+ time: _o,
712
+ uniqueId: je,
713
+ zipObject: Ye
714
+ };
715
+ function es(e) {
716
+ (e.graph().acyclicer === "greedy" ? jn(e, o(e)) : os(e)).forEach((n) => {
717
+ const s = e.edge(n);
718
+ e.removeEdge(n), s.forwardName = n.name, s.reversed = !0, e.setEdge(n.w, n.v, s, je("rev"));
719
+ });
720
+ function o(n) {
721
+ return (s) => n.edge(s).weight;
722
+ }
723
+ }
724
+ function ts(e) {
725
+ e.edges().forEach((t) => {
726
+ const o = e.edge(t);
727
+ if (o.reversed) {
728
+ e.removeEdge(t);
729
+ const n = o.forwardName;
730
+ delete o.reversed, delete o.forwardName, e.setEdge(t.w, t.v, o, n);
731
+ }
732
+ });
733
+ }
734
+ function os(e) {
735
+ const t = [], o = {}, n = {};
736
+ function s(i) {
737
+ Object.hasOwn(n, i) || (n[i] = !0, o[i] = !0, e.outEdges(i).forEach((r) => {
738
+ Object.hasOwn(o, r.w) ? t.push(r) : s(r.w);
739
+ }), delete o[i]);
740
+ }
741
+ return e.nodes().forEach(s), t;
742
+ }
743
+ function ns(e) {
744
+ e.graph().dummyChains = [], e.edges().forEach((t) => ss(e, t));
745
+ }
746
+ function ss(e, t) {
747
+ let o = t.v, n = e.node(o).rank;
748
+ const s = t.w, i = e.node(s).rank, r = t.name, a = e.edge(t), c = a.labelRank;
749
+ if (i === n + 1)
750
+ return;
751
+ e.removeEdge(t);
752
+ let d, h, m;
753
+ for (m = 0, ++n; n < i; ++m, ++n)
754
+ a.points = [], h = {
755
+ width: 0,
756
+ height: 0,
757
+ edgeLabel: a,
758
+ edgeObj: t,
759
+ rank: n
760
+ }, d = we(e, "edge", h, "_d"), n === c && (h.width = a.width, h.height = a.height, h.dummy = "edge-label", h.labelpos = a.labelpos), e.setEdge(o, d, { weight: a.weight }, r), m === 0 && e.graph().dummyChains.push(d), o = d;
761
+ e.setEdge(o, s, { weight: a.weight }, r);
762
+ }
763
+ function rs(e) {
764
+ e.graph().dummyChains.forEach((t) => {
765
+ let o = e.node(t);
766
+ const n = o.edgeLabel;
767
+ e.setEdge(o.edgeObj, n);
768
+ let s;
769
+ for (; o.dummy; )
770
+ s = e.successors(t)[0], e.removeNode(t), n.points.push({ x: o.x, y: o.y }), o.dummy === "edge-label" && (n.x = o.x, n.y = o.y, n.width = o.width, n.height = o.height), t = s, o = e.node(t);
771
+ });
772
+ }
773
+ function Ao(e) {
774
+ function t(o) {
775
+ const n = e.node(o);
776
+ if (n && Object.prototype.hasOwnProperty.call(n, "rank"))
777
+ return n.rank;
778
+ const s = e.outEdges(o) || [];
779
+ if (!s.length)
780
+ return n && (n.rank = 0), 0;
781
+ const i = s.map((a) => {
782
+ if (!e.node(a.w))
783
+ return Number.POSITIVE_INFINITY;
784
+ const d = t(a.w), h = e.edge(a).minlen;
785
+ return d - h;
786
+ });
787
+ let r = X(Math.min, i);
788
+ return r === Number.POSITIVE_INFINITY && (r = 0), n && (n.rank = r), r;
789
+ }
790
+ (e.sources() || []).forEach(t);
791
+ }
792
+ function is(e, t) {
793
+ return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
794
+ }
795
+ function as(e) {
796
+ ls(e);
797
+ const t = new se();
798
+ e.nodes().forEach((i) => {
799
+ t.setNode(i, {});
800
+ });
801
+ const o = e.nodes();
802
+ if (!o.length)
803
+ return t;
804
+ const n = o[0], s = /* @__PURE__ */ new Set([n]);
805
+ for (; s.size < o.length; ) {
806
+ const i = cs(e, s);
807
+ if (!i) {
808
+ const h = o.find((m) => !s.has(m));
809
+ s.add(h), t.setNode(h, {});
810
+ continue;
811
+ }
812
+ const { edgeObject: r, delta: a, attachFrom: c, attachTo: d } = i;
813
+ us(e, s, c, a), t.setEdge(r.v, r.w, {}), s.add(d);
814
+ }
815
+ return t;
816
+ }
817
+ function ls(e) {
818
+ e.nodes().forEach((t) => {
819
+ const o = e.node(t) || {};
820
+ Object.prototype.hasOwnProperty.call(o, "rank") || (o.rank = 0, e.setNode(t, o));
821
+ });
822
+ }
823
+ function cs(e, t) {
824
+ let o = null;
825
+ return e.edges().forEach((n) => {
826
+ const s = t.has(n.v), i = t.has(n.w);
827
+ if (s === i)
828
+ return;
829
+ const r = is(e, n), a = Math.abs(r);
830
+ if (!o || a < o.absoluteSlack) {
831
+ const c = s ? n.v : n.w, d = s ? n.w : n.v, h = s ? r : -r;
832
+ o = {
833
+ edgeObject: n,
834
+ delta: h,
835
+ attachFrom: c,
836
+ attachTo: d,
837
+ absoluteSlack: a
838
+ };
839
+ }
840
+ }), o;
841
+ }
842
+ function us(e, t, o, n) {
843
+ n && e.nodes().forEach((s) => {
844
+ if (!t.has(s)) {
845
+ const i = e.node(s);
846
+ i.rank += n;
847
+ }
848
+ });
849
+ }
850
+ function ke(e) {
851
+ const t = yo(e);
852
+ return Ao(t), t.nodes().forEach((o) => {
853
+ const n = t.node(o), s = e.node(o) || {};
854
+ s.rank = n.rank, e.setNode(o, s);
855
+ }), e;
856
+ }
857
+ function ds(e, t) {
858
+ }
859
+ function fs(e, t) {
860
+ }
861
+ function hs(e, t, o) {
862
+ return 0;
863
+ }
864
+ function ms(e) {
865
+ return null;
866
+ }
867
+ function gs(e, t) {
868
+ return null;
869
+ }
870
+ ke.initLowLimValues = ds;
871
+ ke.initCutValues = fs;
872
+ ke.calcCutValue = hs;
873
+ ke.leaveEdge = ms;
874
+ ke.enterEdge = gs;
875
+ const No = Ao;
876
+ function vs(e) {
877
+ const t = e.graph().ranker;
878
+ if (t instanceof Function)
879
+ return t(e);
880
+ switch (e.graph().ranker) {
881
+ case "network-simplex":
882
+ lo(e);
883
+ break;
884
+ case "tight-tree":
885
+ bs(e);
886
+ break;
887
+ case "longest-path":
888
+ ps(e);
889
+ break;
890
+ case "none":
891
+ break;
892
+ default:
893
+ lo(e);
894
+ }
895
+ }
896
+ const ps = No;
897
+ function bs(e) {
898
+ No(e), as(e);
899
+ }
900
+ function lo(e) {
901
+ ke(e);
902
+ }
903
+ function ys(e) {
904
+ const t = ks(e);
905
+ e.graph().dummyChains.forEach((o) => {
906
+ let n = e.node(o);
907
+ const s = n.edgeObj, i = ws(e, t, s.v, s.w), r = i.path, a = i.lca;
908
+ let c = 0, d = r[c], h = !0, m = o;
909
+ for (; m !== s.w; ) {
910
+ if (n = e.node(m), h) {
911
+ for (; (d = r[c]) !== a && e.node(d).maxRank < n.rank; )
912
+ c++;
913
+ d === a && (h = !1);
914
+ }
915
+ if (!h) {
916
+ for (; c < r.length - 1 && e.node(d = r[c + 1]).minRank <= n.rank; )
917
+ c++;
918
+ d = r[c];
919
+ }
920
+ e.setParent(m, d), m = e.successors(m)[0];
921
+ }
922
+ });
923
+ }
924
+ function ws(e, t, o, n) {
925
+ const s = [], i = [], r = Math.min(t[o].low, t[n].low), a = Math.max(t[o].lim, t[n].lim);
926
+ let c, d;
927
+ c = o;
928
+ do
929
+ c = e.parent(c), s.push(c);
930
+ while (c && (t[c].low > r || a > t[c].lim));
931
+ for (d = c, c = n; (c = e.parent(c)) !== d; )
932
+ i.push(c);
933
+ return {
934
+ path: s.concat(i.reverse()),
935
+ lca: d
936
+ };
937
+ }
938
+ function ks(e) {
939
+ const t = {};
940
+ let o = 0;
941
+ function n(s) {
942
+ const i = o;
943
+ e.children(s).forEach(n), t[s] = { low: i, lim: o++ };
944
+ }
945
+ return e.children().forEach(n), t;
946
+ }
947
+ function Es(e) {
948
+ const t = We.addDummyNode(e, "root", {}, "_root"), o = Cs(e), n = Object.values(o), s = We.applyWithChunking(Math.max, n) - 1, i = 2 * s + 1;
949
+ e.graph().nestingRoot = t, e.edges().forEach((a) => {
950
+ e.edge(a).minlen *= i;
951
+ });
952
+ const r = _s(e) + 1;
953
+ e.children().forEach((a) => {
954
+ So(e, t, i, r, s, o, a);
955
+ }), e.graph().nodeRankFactor = i;
956
+ }
957
+ function So(e, t, o, n, s, i, r) {
958
+ const a = e.children(r);
959
+ if (!a.length) {
960
+ r !== t && e.setEdge(t, r, { weight: 0, minlen: o });
961
+ return;
962
+ }
963
+ const c = We.addBorderNode(e, "_bt"), d = We.addBorderNode(e, "_bb"), h = e.node(r);
964
+ e.setParent(c, r), h.borderTop = c, e.setParent(d, r), h.borderBottom = d, a.forEach((m) => {
965
+ So(e, t, o, n, s, i, m);
966
+ const g = e.node(m), y = g.borderTop ? g.borderTop : m, N = g.borderBottom ? g.borderBottom : m, x = g.borderTop ? n : 2 * n, $ = y !== N ? 1 : s - i[r] + 1;
967
+ e.setEdge(c, y, {
968
+ weight: x,
969
+ minlen: $,
970
+ nestingEdge: !0
971
+ }), e.setEdge(N, d, {
972
+ weight: x,
973
+ minlen: $,
974
+ nestingEdge: !0
975
+ });
976
+ }), e.parent(r) || e.setEdge(t, c, {
977
+ weight: 0,
978
+ minlen: s + i[r]
979
+ });
980
+ }
981
+ function Cs(e) {
982
+ const t = {};
983
+ function o(n, s) {
984
+ const i = e.children(n);
985
+ i && i.length && i.forEach((r) => o(r, s + 1)), t[n] = s;
986
+ }
987
+ return e.children().forEach((n) => o(n, 1)), t;
988
+ }
989
+ function _s(e) {
990
+ return e.edges().reduce((t, o) => t + e.edge(o).weight, 0);
991
+ }
992
+ function xs(e) {
993
+ const t = e.graph();
994
+ e.removeNode(t.nestingRoot), delete t.nestingRoot, e.edges().forEach((o) => {
995
+ e.edge(o).nestingEdge && e.removeEdge(o);
996
+ });
997
+ }
998
+ function As(e) {
999
+ function t(o) {
1000
+ const n = e.children(o), s = e.node(o);
1001
+ if (n.length && n.forEach(t), Object.hasOwn(s, "minRank")) {
1002
+ s.borderLeft = [], s.borderRight = [];
1003
+ for (let i = s.minRank, r = s.maxRank + 1; i < r; ++i)
1004
+ co(e, "borderLeft", "_bl", o, s, i), co(e, "borderRight", "_br", o, s, i);
1005
+ }
1006
+ }
1007
+ e.children().forEach(t);
1008
+ }
1009
+ function co(e, t, o, n, s, i) {
1010
+ const r = {
1011
+ width: 0,
1012
+ height: 0,
1013
+ rank: i,
1014
+ borderType: t
1015
+ }, a = s[t][i - 1], c = we(e, "border", r, o);
1016
+ s[t][i] = c, e.setParent(c, n), a && e.setEdge(a, c, { weight: 1 });
1017
+ }
1018
+ function Ns(e) {
1019
+ const t = e.graph().rankdir.toLowerCase();
1020
+ (t === "lr" || t === "rl") && Lo(e);
1021
+ }
1022
+ function Ss(e) {
1023
+ const t = e.graph().rankdir.toLowerCase();
1024
+ (t === "bt" || t === "rl") && Ls(e), (t === "lr" || t === "rl") && (Ms(e), Lo(e));
1025
+ }
1026
+ function Lo(e) {
1027
+ e.nodes().forEach((t) => {
1028
+ uo(e.node(t));
1029
+ }), e.edges().forEach((t) => {
1030
+ uo(e.edge(t));
1031
+ });
1032
+ }
1033
+ function uo(e) {
1034
+ const t = e.width;
1035
+ e.width = e.height, e.height = t;
1036
+ }
1037
+ function Ls(e) {
1038
+ e.nodes().forEach((t) => {
1039
+ ut(e.node(t));
1040
+ }), e.edges().forEach((t) => {
1041
+ const o = e.edge(t);
1042
+ o.points.forEach(ut), Object.hasOwn(o, "y") && ut(o);
1043
+ });
1044
+ }
1045
+ function ut(e) {
1046
+ e.y = -e.y;
1047
+ }
1048
+ function Ms(e) {
1049
+ e.nodes().forEach((t) => {
1050
+ dt(e.node(t));
1051
+ }), e.edges().forEach((t) => {
1052
+ const o = e.edge(t);
1053
+ o.points.forEach(dt), Object.hasOwn(o, "x") && dt(o);
1054
+ });
1055
+ }
1056
+ function dt(e) {
1057
+ const t = e.x;
1058
+ e.x = e.y, e.y = t;
1059
+ }
1060
+ const fo = {
1061
+ adjust: Ns,
1062
+ undo: Ss
1063
+ };
1064
+ function Os(e) {
1065
+ const t = {}, o = e.nodes().filter((c) => e.children(c).length === 0), n = o.map((c) => e.node(c).rank), s = X(Math.max, n), i = ye(s + 1).map(() => []);
1066
+ function r(c) {
1067
+ if (t[c]) return;
1068
+ t[c] = !0;
1069
+ const d = e.node(c);
1070
+ i[d.rank].push(c), e.successors(c).forEach(r);
1071
+ }
1072
+ return o.sort(
1073
+ (c, d) => e.node(c).rank - e.node(d).rank
1074
+ ).forEach(r), i;
1075
+ }
1076
+ function Ds(e, t) {
1077
+ let o = 0;
1078
+ for (let n = 1; n < t.length; ++n)
1079
+ o += Ts(e, t[n - 1], t[n]);
1080
+ return o;
1081
+ }
1082
+ function Ts(e, t, o) {
1083
+ const n = Ye(
1084
+ o,
1085
+ o.map((d, h) => h)
1086
+ ), s = t.flatMap((d) => e.outEdges(d).map((h) => ({
1087
+ pos: n[h.w],
1088
+ weight: e.edge(h).weight
1089
+ })).sort((h, m) => h.pos - m.pos));
1090
+ let i = 1;
1091
+ for (; i < o.length; ) i <<= 1;
1092
+ const r = 2 * i - 1;
1093
+ i -= 1;
1094
+ const a = new Array(r).fill(0);
1095
+ let c = 0;
1096
+ return s.forEach((d) => {
1097
+ let h = d.pos + i;
1098
+ a[h] += d.weight;
1099
+ let m = 0;
1100
+ for (; h > 0; )
1101
+ h % 2 && (m += a[h + 1]), h = h - 1 >> 1, a[h] += d.weight;
1102
+ c += d.weight * m;
1103
+ }), c;
1104
+ }
1105
+ function Rs(e, t = []) {
1106
+ return t.map((o) => {
1107
+ const n = e.inEdges(o);
1108
+ if (!n.length)
1109
+ return { v: o };
1110
+ const s = n.reduce(
1111
+ (i, r) => {
1112
+ const a = e.edge(r), c = e.node(r.v);
1113
+ return {
1114
+ sum: i.sum + a.weight * c.order,
1115
+ weight: i.weight + a.weight
1116
+ };
1117
+ },
1118
+ { sum: 0, weight: 0 }
1119
+ );
1120
+ return {
1121
+ v: o,
1122
+ barycenter: s.sum / s.weight,
1123
+ weight: s.weight
1124
+ };
1125
+ });
1126
+ }
1127
+ function Ps(e, t) {
1128
+ const o = {};
1129
+ e.forEach((s, i) => {
1130
+ const r = o[s.v] = {
1131
+ indegree: 0,
1132
+ in: [],
1133
+ out: [],
1134
+ vs: [s.v],
1135
+ i
1136
+ };
1137
+ s.barycenter !== void 0 && (r.barycenter = s.barycenter, r.weight = s.weight);
1138
+ }), t.edges().forEach((s) => {
1139
+ const i = o[s.v], r = o[s.w];
1140
+ i !== void 0 && r !== void 0 && (r.indegree++, i.out.push(r));
1141
+ });
1142
+ const n = Object.values(o).filter((s) => !s.indegree);
1143
+ return $s(n);
1144
+ }
1145
+ function $s(e) {
1146
+ const t = [];
1147
+ function o(s) {
1148
+ return (i) => {
1149
+ i.merged || (i.barycenter === void 0 || s.barycenter === void 0 || i.barycenter >= s.barycenter) && Fs(s, i);
1150
+ };
1151
+ }
1152
+ function n(s) {
1153
+ return (i) => {
1154
+ i.in.push(s), --i.indegree === 0 && e.push(i);
1155
+ };
1156
+ }
1157
+ for (; e.length; ) {
1158
+ const s = e.pop();
1159
+ t.push(s), s.in.reverse().forEach(o(s)), s.out.forEach(n(s));
1160
+ }
1161
+ return t.filter((s) => !s.merged).map((s) => Pe(s, ["vs", "i", "barycenter", "weight"]));
1162
+ }
1163
+ function Fs(e, t) {
1164
+ let o = 0, n = 0;
1165
+ e.weight && (o += e.barycenter * e.weight, n += e.weight), t.weight && (o += t.barycenter * t.weight, n += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = o / n, e.weight = n, e.i = Math.min(t.i, e.i), t.merged = !0;
1166
+ }
1167
+ function Bs(e, t) {
1168
+ const o = Co(e, (h) => Object.hasOwn(h, "barycenter")), n = o.lhs, s = o.rhs.sort((h, m) => m.i - h.i), i = [];
1169
+ let r = 0, a = 0, c = 0;
1170
+ n.sort(zs(!!t)), c = ho(i, s, c), n.forEach((h) => {
1171
+ c += h.vs.length, i.push(h.vs), r += h.barycenter * h.weight, a += h.weight, c = ho(i, s, c);
1172
+ });
1173
+ const d = { vs: i.flat(!0) };
1174
+ return a && (d.barycenter = r / a, d.weight = a), d;
1175
+ }
1176
+ function ho(e, t, o) {
1177
+ let n;
1178
+ for (; t.length && (n = t[t.length - 1]).i <= o; )
1179
+ t.pop(), e.push(n.vs), o++;
1180
+ return o;
1181
+ }
1182
+ function zs(e) {
1183
+ return (t, o) => t.barycenter < o.barycenter ? -1 : t.barycenter > o.barycenter ? 1 : e ? o.i - t.i : t.i - o.i;
1184
+ }
1185
+ function Mo(e, t, o, n) {
1186
+ let s = e.children(t);
1187
+ const i = e.node(t), r = i ? i.borderLeft : void 0, a = i ? i.borderRight : void 0, c = {};
1188
+ r && (s = s.filter((g) => g !== r && g !== a));
1189
+ const d = Rs(e, s);
1190
+ d.forEach((g) => {
1191
+ if (e.children(g.v).length) {
1192
+ const y = Mo(e, g.v, o, n);
1193
+ c[g.v] = y, Object.hasOwn(y, "barycenter") && Is(g, y);
1194
+ }
1195
+ });
1196
+ let h = Ps(d, o);
1197
+ Vs(h, c);
1198
+ const m = Bs(h, n);
1199
+ if (r && (m.vs = [r, m.vs, a].flat(!0), e.predecessors(r).length)) {
1200
+ const g = e.node(e.predecessors(r)[0]), y = e.node(e.predecessors(a)[0]);
1201
+ Object.hasOwn(m, "barycenter") || (m.barycenter = 0, m.weight = 0), m.barycenter = (m.barycenter * m.weight + g.order + y.order) / (m.weight + 2), m.weight += 2;
1202
+ }
1203
+ return m;
1204
+ }
1205
+ function Vs(e, t) {
1206
+ e.forEach((o) => {
1207
+ o.vs = o.vs.flatMap((n) => t[n] ? t[n].vs : n);
1208
+ });
1209
+ }
1210
+ function Is(e, t) {
1211
+ e.barycenter !== void 0 ? (e.barycenter = (e.barycenter * e.weight + t.barycenter * t.weight) / (e.weight + t.weight), e.weight += t.weight) : (e.barycenter = t.barycenter, e.weight = t.weight);
1212
+ }
1213
+ function Hs(e, t, o, n) {
1214
+ n || (n = e.nodes());
1215
+ const s = Gs(e), i = new se({ compound: !0 }).setGraph({ root: s }).setDefaultNodeLabel((r) => e.node(r));
1216
+ return n.forEach((r) => {
1217
+ const a = e.node(r), c = e.parent(r);
1218
+ (a.rank === t || a.minRank <= t && t <= a.maxRank) && (i.setNode(r), i.setParent(r, c || s), e[o](r).forEach((h) => {
1219
+ const m = h.v === r ? h.w : h.v, g = i.edge(m, r), y = g ? g.weight : 0;
1220
+ i.setEdge(m, r, {
1221
+ weight: e.edge(h).weight + y
1222
+ });
1223
+ }), Object.hasOwn(a, "minRank") && i.setNode(r, {
1224
+ borderLeft: a.borderLeft[t],
1225
+ borderRight: a.borderRight[t]
1226
+ }));
1227
+ }), i;
1228
+ }
1229
+ function Gs(e) {
1230
+ let t;
1231
+ for (; e.hasNode(t = je("_root")); ) ;
1232
+ return t;
1233
+ }
1234
+ function Ws(e, t, o) {
1235
+ let n = {}, s;
1236
+ o.forEach((i) => {
1237
+ let r = e.parent(i), a, c;
1238
+ for (; r; ) {
1239
+ if (a = e.parent(r), a ? (c = n[a], n[a] = r) : (c = s, s = r), c && c !== r) {
1240
+ t.setEdge(c, r);
1241
+ return;
1242
+ }
1243
+ r = a;
1244
+ }
1245
+ });
1246
+ }
1247
+ function Oo(e, t = {}) {
1248
+ if (typeof t.customOrder == "function") {
1249
+ t.customOrder(e, Oo);
1250
+ return;
1251
+ }
1252
+ const o = bt(e), n = mo(
1253
+ e,
1254
+ ye(1, o + 1),
1255
+ "inEdges"
1256
+ ), s = mo(
1257
+ e,
1258
+ ye(o - 1, -1, -1),
1259
+ "outEdges"
1260
+ );
1261
+ let i = Os(e);
1262
+ if (go(e, i), t.disableOptimalOrderHeuristic)
1263
+ return;
1264
+ let r = Number.POSITIVE_INFINITY, a;
1265
+ const c = t.constraints || [];
1266
+ for (let d = 0, h = 0; h < 4; ++d, ++h) {
1267
+ const m = d % 2 === 0 ? n : s, g = d % 4 >= 2;
1268
+ js(m, g, c), i = $e(e);
1269
+ const y = Ds(e, i);
1270
+ y < r ? (r = y, h = 0, a = structuredClone(i)) : y === r && (a = structuredClone(i));
1271
+ }
1272
+ go(e, a);
1273
+ }
1274
+ function mo(e, t, o) {
1275
+ const n = /* @__PURE__ */ new Map();
1276
+ function s(i, r) {
1277
+ n.has(i) || n.set(i, []), n.get(i).push(r);
1278
+ }
1279
+ for (const i of e.nodes()) {
1280
+ const r = e.node(i);
1281
+ if (typeof r.rank == "number" && s(r.rank, i), typeof r.minRank == "number" && typeof r.maxRank == "number")
1282
+ for (let a = r.minRank; a <= r.maxRank; a++)
1283
+ a !== r.rank && s(a, i);
1284
+ }
1285
+ return t.map(
1286
+ (i) => Hs(
1287
+ e,
1288
+ i,
1289
+ o,
1290
+ n.get(i) || []
1291
+ )
1292
+ );
1293
+ }
1294
+ function js(e, t, o) {
1295
+ const n = new se();
1296
+ e.forEach((s) => {
1297
+ o.forEach((a) => n.setEdge(a.left, a.right));
1298
+ const i = s.graph().root, r = Mo(s, i, n, t);
1299
+ r.vs.forEach((a, c) => {
1300
+ s.node(a).order = c;
1301
+ }), Ws(s, n, r.vs);
1302
+ });
1303
+ }
1304
+ function go(e, t) {
1305
+ Object.values(t).forEach((o) => {
1306
+ o.forEach((n, s) => {
1307
+ e.node(n).order = s;
1308
+ });
1309
+ });
1310
+ }
1311
+ function Ys(e, t) {
1312
+ const o = {};
1313
+ function n(s, i) {
1314
+ let r = 0, a = 0;
1315
+ const c = s.length, d = i[i.length - 1];
1316
+ return i.forEach((h, m) => {
1317
+ const g = Zs(e, h), y = g ? e.node(g).order : c;
1318
+ (g || h === d) && (i.slice(a, m + 1).forEach((N) => {
1319
+ e.predecessors(N).forEach((x) => {
1320
+ const $ = e.node(x), Q = $.order;
1321
+ (Q < r || y < Q) && !($.dummy && e.node(N).dummy) && Do(o, x, N);
1322
+ });
1323
+ }), a = m + 1, r = y);
1324
+ }), i;
1325
+ }
1326
+ return t.length && t.reduce(n), o;
1327
+ }
1328
+ function Us(e, t) {
1329
+ const o = {};
1330
+ function n(i, r, a, c, d) {
1331
+ let h;
1332
+ ye(r, a).forEach((m) => {
1333
+ h = i[m], e.node(h).dummy && e.predecessors(h).forEach((g) => {
1334
+ const y = e.node(g);
1335
+ y.dummy && (y.order < c || y.order > d) && Do(o, g, h);
1336
+ });
1337
+ });
1338
+ }
1339
+ function s(i, r) {
1340
+ let a = -1, c, d = 0;
1341
+ return r.forEach((h, m) => {
1342
+ if (e.node(h).dummy === "border") {
1343
+ const g = e.predecessors(h);
1344
+ g.length && (c = e.node(g[0]).order, n(r, d, m, a, c), d = m, a = c);
1345
+ }
1346
+ n(r, d, r.length, c, i.length);
1347
+ }), r;
1348
+ }
1349
+ return t.length && t.reduce(s), o;
1350
+ }
1351
+ function Zs(e, t) {
1352
+ if (e.node(t).dummy)
1353
+ return e.predecessors(t).find((o) => e.node(o).dummy);
1354
+ }
1355
+ function Do(e, t, o) {
1356
+ if (t > o) {
1357
+ const s = t;
1358
+ t = o, o = s;
1359
+ }
1360
+ let n = e[t];
1361
+ n || (e[t] = n = {}), n[o] = !0;
1362
+ }
1363
+ function Xs(e, t, o) {
1364
+ if (t > o) {
1365
+ const n = t;
1366
+ t = o, o = n;
1367
+ }
1368
+ return !!e[t] && Object.hasOwn(e[t], o);
1369
+ }
1370
+ function qs(e, t, o, n) {
1371
+ const s = {}, i = {}, r = {};
1372
+ return t.forEach((a) => {
1373
+ a.forEach((c, d) => {
1374
+ s[c] = c, i[c] = c, r[c] = d;
1375
+ });
1376
+ }), t.forEach((a) => {
1377
+ let c = -1;
1378
+ a.forEach((d) => {
1379
+ let h = n(d);
1380
+ if (h.length) {
1381
+ h = h.sort((g, y) => r[g] - r[y]);
1382
+ const m = (h.length - 1) / 2;
1383
+ for (let g = Math.floor(m), y = Math.ceil(m); g <= y; ++g) {
1384
+ const N = h[g];
1385
+ i[d] === d && c < r[N] && !Xs(o, d, N) && (i[N] = d, i[d] = s[d] = s[N], c = r[N]);
1386
+ }
1387
+ }
1388
+ });
1389
+ }), { root: s, align: i };
1390
+ }
1391
+ function Ks(e, t, o, n, s) {
1392
+ const i = {}, r = Js(e, t, o, s), a = s ? "borderLeft" : "borderRight";
1393
+ function c(m, g) {
1394
+ const y = r.nodes().slice(), N = {};
1395
+ let x = y.pop();
1396
+ for (; x; ) {
1397
+ if (N[x])
1398
+ m(x);
1399
+ else {
1400
+ N[x] = !0, y.push(x);
1401
+ for (const $ of g(x))
1402
+ y.push($);
1403
+ }
1404
+ x = y.pop();
1405
+ }
1406
+ }
1407
+ function d(m) {
1408
+ i[m] = r.inEdges(m).reduce((g, y) => Math.max(g, i[y.v] + r.edge(y)), 0);
1409
+ }
1410
+ function h(m) {
1411
+ const g = r.outEdges(m).reduce((N, x) => Math.min(N, i[x.w] - r.edge(x)), Number.POSITIVE_INFINITY), y = e.node(m);
1412
+ g !== Number.POSITIVE_INFINITY && y.borderType !== a && (i[m] = Math.max(i[m], g));
1413
+ }
1414
+ return c(d, r.predecessors.bind(r)), c(h, r.successors.bind(r)), Object.keys(n).forEach((m) => {
1415
+ i[m] = i[o[m]];
1416
+ }), i;
1417
+ }
1418
+ function Js(e, t, o, n) {
1419
+ const s = new e.constructor(), i = e.graph(), r = nr(i.nodesep, i.edgesep, n);
1420
+ return t.forEach((a) => {
1421
+ let c;
1422
+ a.forEach((d) => {
1423
+ const h = o[d];
1424
+ if (s.setNode(h), c) {
1425
+ const m = o[c], g = s.edge(m, h);
1426
+ s.setEdge(
1427
+ m,
1428
+ h,
1429
+ Math.max(r(e, d, c), g || 0)
1430
+ );
1431
+ }
1432
+ c = d;
1433
+ });
1434
+ }), s;
1435
+ }
1436
+ function Qs(e, t) {
1437
+ return Object.values(t).reduce(
1438
+ (o, n) => {
1439
+ let s = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY;
1440
+ Object.entries(n).forEach(([a, c]) => {
1441
+ const d = sr(e, a) / 2;
1442
+ s = Math.max(c + d, s), i = Math.min(c - d, i);
1443
+ });
1444
+ const r = s - i;
1445
+ return r < o[0] && (o = [r, n]), o;
1446
+ },
1447
+ [Number.POSITIVE_INFINITY, null]
1448
+ )[1];
1449
+ }
1450
+ function er(e, t) {
1451
+ const o = Object.values(t), n = X(Math.min, o), s = X(Math.max, o);
1452
+ ["u", "d"].forEach((i) => {
1453
+ ["l", "r"].forEach((r) => {
1454
+ const a = i + r;
1455
+ let c = e[a];
1456
+ if (c === t) return;
1457
+ const d = Object.values(c);
1458
+ let h = n - X(Math.min, d);
1459
+ r !== "l" && (h = s - X(Math.max, d)), h && (c = Fe(c, (m) => m + h), e[a] = c);
1460
+ });
1461
+ });
1462
+ }
1463
+ function tr(e, t) {
1464
+ return Fe(e.ul, (o, n) => {
1465
+ if (t)
1466
+ return e[t.toLowerCase()][n];
1467
+ const s = Object.values(e).map((i) => i[n]).sort((i, r) => i - r);
1468
+ return (s[1] + s[2]) / 2;
1469
+ });
1470
+ }
1471
+ function or(e) {
1472
+ const t = $e(e), o = Object.assign(
1473
+ Ys(e, t),
1474
+ Us(e, t)
1475
+ ), n = {};
1476
+ let s;
1477
+ ["u", "d"].forEach((r) => {
1478
+ s = r === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((a) => {
1479
+ let c = s;
1480
+ a === "r" && (c = c.map(
1481
+ (g) => Object.values(g).reverse()
1482
+ ));
1483
+ const d = (r === "u" ? e.predecessors : e.successors).bind(e), h = qs(
1484
+ e,
1485
+ c,
1486
+ o,
1487
+ d
1488
+ );
1489
+ let m = Ks(
1490
+ e,
1491
+ c,
1492
+ h.root,
1493
+ h.align,
1494
+ a === "r"
1495
+ );
1496
+ a === "r" && (m = Fe(m, (g) => -g)), n[r + a] = m;
1497
+ });
1498
+ });
1499
+ const i = Qs(e, n);
1500
+ return er(n, i), tr(n, e.graph().align);
1501
+ }
1502
+ function nr(e, t, o) {
1503
+ return (n, s, i) => {
1504
+ const r = n.node(s), a = n.node(i);
1505
+ let c = 0, d;
1506
+ if (c += r.width / 2, Object.hasOwn(r, "labelpos"))
1507
+ switch (r.labelpos.toLowerCase()) {
1508
+ case "l":
1509
+ d = -r.width / 2;
1510
+ break;
1511
+ case "r":
1512
+ d = r.width / 2;
1513
+ break;
1514
+ }
1515
+ if (d && (c += o ? d : -d), d = 0, c += (r.dummy ? t : e) / 2, c += (a.dummy ? t : e) / 2, c += a.width / 2, Object.hasOwn(a, "labelpos"))
1516
+ switch (a.labelpos.toLowerCase()) {
1517
+ case "l":
1518
+ d = a.width / 2;
1519
+ break;
1520
+ case "r":
1521
+ d = -a.width / 2;
1522
+ break;
1523
+ }
1524
+ return d && (c += o ? d : -d), d = 0, c;
1525
+ };
1526
+ }
1527
+ function sr(e, t) {
1528
+ return e.node(t).width;
1529
+ }
1530
+ function rr(e) {
1531
+ const t = pt(e);
1532
+ ir(t);
1533
+ const o = or(t);
1534
+ Object.entries(o).forEach(([n, s]) => {
1535
+ e.node(n).x = s;
1536
+ });
1537
+ }
1538
+ function ir(e) {
1539
+ const t = $e(e), o = e.graph().ranksep;
1540
+ let n = 0;
1541
+ t.forEach((s) => {
1542
+ const i = s.reduce((r, a) => {
1543
+ const c = e.node(a).height;
1544
+ return r > c ? r : c;
1545
+ }, 0);
1546
+ s.forEach((r) => {
1547
+ e.node(r).y = n + i / 2;
1548
+ }), n += i + o;
1549
+ });
1550
+ }
1551
+ function ar(e, t = {}) {
1552
+ const o = t.debugTiming ? _o : xo;
1553
+ return o("layout", () => {
1554
+ const n = o(" buildLayoutGraph", () => pr(e));
1555
+ return o(" runLayout", () => lr(n, o, t)), o(" updateInputGraph", () => cr(e, n)), n;
1556
+ });
1557
+ }
1558
+ function lr(e, t, o) {
1559
+ t(" makeSpaceForEdgeLabels", () => br(e)), t(" removeSelfEdges", () => Nr(e)), t(" acyclic", () => es(e)), t(" nestingGraph.run", () => Es(e)), t(" rank", () => vs(pt(e))), t(" injectEdgeLabelProxies", () => yr(e)), t(" removeEmptyRanks", () => ko(e)), t(" nestingGraph.cleanup", () => xs(e)), t(" normalizeRanks", () => wo(e)), t(" assignRankMinMax", () => wr(e)), t(" removeEdgeLabelProxies", () => kr(e)), t(" normalize.run", () => ns(e)), t(" parentDummyChains", () => ys(e)), t(" addBorderSegments", () => As(e)), t(" order", () => Oo(e, o)), t(" insertSelfEdges", () => Sr(e)), t(" adjustCoordinateSystem", () => fo.adjust(e)), t(" position", () => rr(e)), t(" positionSelfEdges", () => Lr(e)), t(" removeBorderNodes", () => Ar(e)), t(" normalize.undo", () => rs(e)), t(" fixupEdgeLabelCoords", () => _r(e)), t(" undoCoordinateSystem", () => fo.undo(e)), t(" translateGraph", () => Er(e)), t(" assignNodeIntersects", () => Cr(e)), t(" reversePoints", () => xr(e)), t(" acyclic.undo", () => ts(e));
1560
+ }
1561
+ function cr(e, t) {
1562
+ e.nodes().forEach((s) => {
1563
+ const i = e.node(s), r = t.node(s);
1564
+ i && (i.x = r.x, i.y = r.y, i.order = r.order, i.rank = r.rank, t.children(s).length && (i.width = r.width, i.height = r.height));
1565
+ }), e.edges().forEach((s) => {
1566
+ const i = e.edge(s), r = t.edge(s);
1567
+ i.points = r.points, Object.hasOwn(r, "x") && (i.x = r.x, i.y = r.y);
1568
+ });
1569
+ const o = t.graph(), n = e.graph();
1570
+ n.width = o.width, n.height = o.height;
1571
+ }
1572
+ const ur = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], dr = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, fr = ["acyclicer", "ranker", "rankdir", "align"], hr = ["width", "height", "rank"], vo = { width: 0, height: 0 }, mr = ["minlen", "weight", "width", "height", "labeloffset"], gr = {
1573
+ minlen: 1,
1574
+ weight: 1,
1575
+ width: 0,
1576
+ height: 0,
1577
+ labeloffset: 10,
1578
+ labelpos: "r"
1579
+ }, vr = ["labelpos", "arrowshape"];
1580
+ function pr(e) {
1581
+ const t = ht(e.graph()), o = {
1582
+ ...dr,
1583
+ ...ft(t, ur),
1584
+ ...Pe(t, fr)
1585
+ }, n = new se({ multigraph: !0, compound: !0 });
1586
+ return n.setGraph(o), e.nodes().forEach((s) => {
1587
+ const i = ht(e.node(s)), r = ft(i, hr);
1588
+ Object.keys(vo).forEach((a) => {
1589
+ r[a] === void 0 && (r[a] = vo[a]);
1590
+ }), n.setNode(s, r), n.setParent(s, e.parent(s));
1591
+ }), e.edges().forEach((s) => {
1592
+ const i = ht(e.edge(s));
1593
+ n.setEdge(
1594
+ s,
1595
+ {
1596
+ ...gr,
1597
+ ...ft(i, mr),
1598
+ ...Pe(i, vr)
1599
+ }
1600
+ );
1601
+ }), n;
1602
+ }
1603
+ function br(e) {
1604
+ const t = e.graph();
1605
+ t.ranksep /= 2, e.edges().forEach((o) => {
1606
+ const n = e.edge(o);
1607
+ n.minlen *= 2, n.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? n.width += n.labeloffset : n.height += n.labeloffset);
1608
+ });
1609
+ }
1610
+ function yr(e) {
1611
+ e.edges().forEach((t) => {
1612
+ const o = e.edge(t);
1613
+ if (o.width && o.height) {
1614
+ const n = e.node(t.v), i = { rank: (e.node(t.w).rank - n.rank) / 2 + n.rank, e: t };
1615
+ we(e, "edge-proxy", i, "_ep");
1616
+ }
1617
+ });
1618
+ }
1619
+ function wr(e) {
1620
+ let t = 0;
1621
+ e.nodes().forEach((o) => {
1622
+ const n = e.node(o);
1623
+ n.borderTop && (n.minRank = e.node(n.borderTop).rank, n.maxRank = e.node(n.borderBottom).rank, t = Math.max(t, n.maxRank));
1624
+ }), e.graph().maxRank = t;
1625
+ }
1626
+ function kr(e) {
1627
+ e.nodes().forEach((t) => {
1628
+ const o = e.node(t);
1629
+ o.dummy === "edge-proxy" && (e.edge(o.e).labelRank = o.rank, e.removeNode(t));
1630
+ });
1631
+ }
1632
+ function Er(e) {
1633
+ let t = Number.POSITIVE_INFINITY, o = 0, n = Number.POSITIVE_INFINITY, s = 0;
1634
+ const i = e.graph(), r = i.marginx || 0, a = i.marginy || 0;
1635
+ function c(d) {
1636
+ const h = d.x, m = d.y, g = d.width, y = d.height;
1637
+ t = Math.min(t, h - g / 2), o = Math.max(o, h + g / 2), n = Math.min(n, m - y / 2), s = Math.max(s, m + y / 2);
1638
+ }
1639
+ e.nodes().forEach((d) => c(e.node(d))), e.edges().forEach((d) => {
1640
+ const h = e.edge(d);
1641
+ Object.hasOwn(h, "x") && c(h);
1642
+ }), t -= r, n -= a, e.nodes().forEach((d) => {
1643
+ const h = e.node(d);
1644
+ h.x -= t, h.y -= n;
1645
+ }), e.edges().forEach((d) => {
1646
+ const h = e.edge(d);
1647
+ h.points.forEach((m) => {
1648
+ m.x -= t, m.y -= n;
1649
+ }), Object.hasOwn(h, "x") && (h.x -= t), Object.hasOwn(h, "y") && (h.y -= n);
1650
+ }), i.width = o - t + r, i.height = s - n + a;
1651
+ }
1652
+ function po(e, t, o) {
1653
+ if (!t)
1654
+ return e;
1655
+ const n = t.x - e.x, s = t.y - e.y, i = Math.sqrt(n * n + s * s);
1656
+ if (!i || i <= o)
1657
+ return e;
1658
+ const r = o / i;
1659
+ return {
1660
+ x: e.x + n * r,
1661
+ y: e.y + s * r
1662
+ };
1663
+ }
1664
+ function Cr(e) {
1665
+ e.edges().forEach((o) => {
1666
+ const n = e.edge(o), s = e.node(o.v), i = e.node(o.w);
1667
+ let r, a;
1668
+ !n.points || !n.points.length ? (n.points = [], r = i, a = s) : (r = n.points[0], a = n.points[n.points.length - 1]);
1669
+ const c = vt(s, r), d = vt(i, a), h = n.points.length ? n.points[0] : r, m = n.points.length ? n.points[n.points.length - 1] : a, g = n.arrowshape, y = g === "normal" || g === "vee", N = !!n.reversed;
1670
+ let x = c, $ = d;
1671
+ y && (N ? x = po(c, h, 4) : $ = po(d, m, 4)), n.points.unshift(x), n.points.push($);
1672
+ });
1673
+ }
1674
+ function _r(e) {
1675
+ e.edges().forEach((t) => {
1676
+ const o = e.edge(t);
1677
+ if (Object.hasOwn(o, "x"))
1678
+ switch ((o.labelpos === "l" || o.labelpos === "r") && (o.width -= o.labeloffset), o.labelpos) {
1679
+ case "l":
1680
+ o.x -= o.width / 2 + o.labeloffset;
1681
+ break;
1682
+ case "r":
1683
+ o.x += o.width / 2 + o.labeloffset;
1684
+ break;
1685
+ }
1686
+ });
1687
+ }
1688
+ function xr(e) {
1689
+ e.edges().forEach((t) => {
1690
+ const o = e.edge(t);
1691
+ o.reversed && o.points.reverse();
1692
+ });
1693
+ }
1694
+ function Ar(e) {
1695
+ e.nodes().forEach((t) => {
1696
+ if (e.children(t).length) {
1697
+ const o = e.node(t), n = e.node(o.borderTop), s = e.node(o.borderBottom), i = e.node(o.borderLeft[o.borderLeft.length - 1]), r = e.node(o.borderRight[o.borderRight.length - 1]);
1698
+ o.width = Math.abs(r.x - i.x), o.height = Math.abs(s.y - n.y), o.x = i.x + o.width / 2, o.y = n.y + o.height / 2;
1699
+ }
1700
+ }), e.nodes().forEach((t) => {
1701
+ e.node(t).dummy === "border" && e.removeNode(t);
1702
+ });
1703
+ }
1704
+ function Nr(e) {
1705
+ e.edges().forEach((t) => {
1706
+ if (t.v === t.w) {
1707
+ const o = e.node(t.v);
1708
+ o.selfEdges || (o.selfEdges = []), o.selfEdges.push({ e: t, label: e.edge(t) }), e.removeEdge(t);
1709
+ }
1710
+ });
1711
+ }
1712
+ function Sr(e) {
1713
+ $e(e).forEach((o) => {
1714
+ let n = 0;
1715
+ o.forEach((s, i) => {
1716
+ const r = e.node(s);
1717
+ r.order = i + n, (r.selfEdges || []).forEach((a) => {
1718
+ we(e, "selfedge", {
1719
+ width: a.label.width,
1720
+ height: a.label.height,
1721
+ rank: r.rank,
1722
+ order: i + ++n,
1723
+ e: a.e,
1724
+ label: a.label
1725
+ }, "_se");
1726
+ }), delete r.selfEdges;
1727
+ });
1728
+ });
1729
+ }
1730
+ function Lr(e) {
1731
+ e.nodes().forEach((t) => {
1732
+ const o = e.node(t);
1733
+ if (o.dummy === "selfedge") {
1734
+ const n = e.node(o.e.v), s = n.x + n.width / 2, i = n.y, r = o.x - s, a = n.height / 2;
1735
+ e.setEdge(o.e, o.label), e.removeNode(t), o.label.points = [
1736
+ { x: s + 2 * r / 3, y: i - a },
1737
+ { x: s + 5 * r / 6, y: i - a },
1738
+ { x: s + r, y: i },
1739
+ { x: s + 5 * r / 6, y: i + a },
1740
+ { x: s + 2 * r / 3, y: i + a }
1741
+ ], o.label.x = o.x, o.label.y = o.y;
1742
+ }
1743
+ });
1744
+ }
1745
+ function ft(e, t) {
1746
+ return Fe(Pe(e, t), Number);
1747
+ }
1748
+ function ht(e) {
1749
+ const t = {};
1750
+ return e && Object.entries(e).forEach(([o, n]) => {
1751
+ let s = o;
1752
+ typeof s == "string" && (s = s.toLowerCase()), t[s] = n;
1753
+ }), t;
1754
+ }
1755
+ const Mr = {
1756
+ rankDirection: "TB",
1757
+ // "TB", "BT", "LR", "RL"
1758
+ nodeSeparation: 50,
1759
+ rankSeparation: 50,
1760
+ edgeSeparation: 10,
1761
+ // "UL", "UR", "DL", "DR" or undefined force one of four extreme alignment strategies (Up/Down × Left/Right).
1762
+ align: void 0,
1763
+ nodeWidth: 100,
1764
+ nodeHeight: 40,
1765
+ curvedEdges: !1,
1766
+ padding: 20,
1767
+ // "undirected" | "normal" | "vee"
1768
+ arrowShape: "normal",
1769
+ arrowSize: 10
1770
+ };
1771
+ function Or(e) {
1772
+ return e.length ? e.map(
1773
+ (t, o) => `${o === 0 ? "M" : "L"} ${t.x} ${t.y}`
1774
+ ).join(" ") : "";
1775
+ }
1776
+ function Dr(e) {
1777
+ if (!e.length) return "";
1778
+ if (e.length === 1) {
1779
+ const s = e[0];
1780
+ return `M ${s.x} ${s.y}`;
1781
+ }
1782
+ if (e.length === 2)
1783
+ return `M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;
1784
+ const [t] = e;
1785
+ let o = `M ${t.x} ${t.y}`;
1786
+ for (let s = 1; s < e.length - 1; s += 1) {
1787
+ e[s - 1];
1788
+ const i = e[s], r = e[s + 1], a = i.x, c = i.y, d = (i.x + r.x) / 2, h = (i.y + r.y) / 2;
1789
+ o += ` Q ${a} ${c} ${d} ${h}`;
1790
+ }
1791
+ const n = e[e.length - 1];
1792
+ return o += ` L ${n.x} ${n.y}`, o;
1793
+ }
1794
+ function Tr(e) {
1795
+ const { nodes: t, edges: o, configuration: n } = e, s = C(null), i = C(null), r = `dag-arrow-${mt()}`;
1796
+ function a(c, d, h) {
1797
+ i.value = null, s.value = null;
1798
+ const m = {
1799
+ ...Mr,
1800
+ ...h
1801
+ }, g = new se({ multigraph: !0, compound: !0 });
1802
+ g.setGraph({
1803
+ rankdir: m.rankDirection,
1804
+ nodesep: m.nodeSeparation,
1805
+ ranksep: m.rankSeparation,
1806
+ edgesep: m.edgeSeparation,
1807
+ align: m.align
1808
+ }), c.forEach((l) => {
1809
+ g.setNode(l.id, {
1810
+ label: l.label,
1811
+ width: l.width ?? m.nodeWidth,
1812
+ height: l.height ?? m.nodeHeight
1813
+ });
1814
+ }), d.forEach((l) => {
1815
+ g.setEdge(l.from, l.to, {
1816
+ weight: l.weight ?? 1,
1817
+ minlen: l.minLength ?? 1,
1818
+ arrowShape: m.arrowShape ?? "normal"
1819
+ });
1820
+ }), ar(g);
1821
+ const y = c.map((l) => {
1822
+ const Y = g.node(l.id);
1823
+ return {
1824
+ id: l.id,
1825
+ label: l.label,
1826
+ x: Y.x,
1827
+ y: Y.y,
1828
+ width: Y.width,
1829
+ height: Y.height,
1830
+ original: l
1831
+ };
1832
+ }), N = g.edges().map((l) => {
1833
+ const Y = g.edge(l), ee = Y.points || [];
1834
+ if (!ee.length)
1835
+ return null;
1836
+ const Be = m.curvedEdges ? Dr(ee) : Or(ee), ze = m.arrowShape !== "undirected" ? `url(#${r})` : null, Ve = d.find((Ce) => Ce?.from === l.v && Ce?.to === l.w);
1837
+ return {
1838
+ id: `${l.v}->${l.w}->${mt()}`,
1839
+ from: l.v,
1840
+ to: l.w,
1841
+ points: ee,
1842
+ pathData: Be,
1843
+ markerEnd: ze,
1844
+ original: {
1845
+ ...Ve,
1846
+ ...Y
1847
+ }
1848
+ };
1849
+ }).filter(Boolean), x = m.padding;
1850
+ if (!y.length) {
1851
+ s.value = {
1852
+ nodes: [],
1853
+ edges: N,
1854
+ viewBox: "0 0 0 0",
1855
+ arrowShape: m.arrowShape,
1856
+ arrowSize: m.arrowSize
1857
+ };
1858
+ return;
1859
+ }
1860
+ const $ = y.flatMap((l) => [
1861
+ l.x - l.width / 2,
1862
+ l.x + l.width / 2
1863
+ ]), Q = y.flatMap((l) => [
1864
+ l.y - l.height / 2,
1865
+ l.y + l.height / 2
1866
+ ]), Ee = Math.min(...$) - x, fe = Math.max(...$) + x, F = Math.min(...Q) - x, G = Math.max(...Q) + x;
1867
+ s.value = {
1868
+ nodes: y,
1869
+ edges: N.map((l) => ({
1870
+ ...l,
1871
+ midpoint: l.pathData ? kn(l.pathData) : { x: 0, y: 0 }
1872
+ })),
1873
+ viewBox: `${Ee} ${F} ${fe - Ee} ${G - F}`,
1874
+ arrowShape: m.arrowShape,
1875
+ arrowSize: m.arrowSize
1876
+ };
1877
+ }
1878
+ return pn(() => {
1879
+ try {
1880
+ const c = p(t) || [], d = p(o) || [], h = p(n) || {};
1881
+ a(c, d, h);
1882
+ } catch (c) {
1883
+ console.error("[useDag] layout error:", c), i.value = c, s.value = null;
1884
+ }
1885
+ }), {
1886
+ layoutData: s,
1887
+ lastError: i,
1888
+ arrowMarkerIdentifier: r,
1889
+ recomputeLayout: () => {
1890
+ const c = p(t) || [], d = p(o) || [], h = p(n) || {};
1891
+ a(c, d, h);
1892
+ }
1893
+ };
1894
+ }
1895
+ const To = { userOptions: { show: !1 } }, Ro = { userOptions: { show: !1 }, style: { chart: { backgroundColor: "#1A1A1A", color: "#CCCCCC", backgroundPattern: { dotColor: "#3A3A3A" }, nodes: { stroke: "#6A6A6A", backgroundColor: "#2A2A2A", labels: { color: "#CCCCCC" }, tooltip: { backgroundColor: "#3A3A3A", color: "#CCCCCC" } }, edges: { stroke: "#6A6A6A" }, midpoints: { stroke: "#6A6A6A", fill: "#1A1A1A", tooltip: { backgroundColor: "#3A3A3A", color: "#CCCCCC" } }, controls: { backgroundColor: "#2A2A2A", buttonColor: "#2A2A2A", color: "#CCCCCC", border: "1px solid #4A4A4A" }, title: { color: "#CCCCCC", subtitle: { color: "#757575" } } } } }, Po = { style: { chart: { backgroundColor: "#1A1A1A", color: "#CCCCCC", backgroundPattern: { dotColor: "#3A3A3A" }, nodes: { stroke: "#6A6A6A", backgroundColor: "#2A2A2A", labels: { color: "#CCCCCC" }, tooltip: { backgroundColor: "#3A3A3A", color: "#CCCCCC" } }, edges: { stroke: "#6A6A6A" }, midpoints: { stroke: "#6A6A6A", fill: "#1A1A1A", tooltip: { backgroundColor: "#3A3A3A", color: "#CCCCCC" } }, controls: { backgroundColor: "#2A2A2A", buttonColor: "#2A2A2A", color: "#CCCCCC", border: "1px solid #4A4A4A" }, title: { color: "#CCCCCC", subtitle: { color: "#757575" } } } } }, $o = { style: { chart: { backgroundColor: "#FFF8E1", color: "#424242", backgroundPattern: { dotColor: "#edc7bb" }, nodes: { stroke: "#5D4037", backgroundColor: "#fcf9f0", labels: { color: "#424242" }, tooltip: { backgroundColor: "#5D4037", color: "#FFF8E1" } }, edges: { stroke: "#5D4037" }, midpoints: { stroke: "#5D4037", fill: "#FFF8E1", tooltip: { backgroundColor: "#5D4037", color: "#FFF8E1" } }, controls: { backgroundColor: "#FFF8E1", buttonColor: "#FFF8E1", color: "#424242", border: "1px solid #d9bbb2" }, title: { color: "#424242", subtitle: { color: "#757575" } } } } }, Fo = { style: { chart: { backgroundColor: "#1E1E1E", color: "#BDBDBD", backgroundPattern: { dotColor: "#3E3E3E" }, nodes: { stroke: "#965039", backgroundColor: "#2A2A2A", labels: { color: "#BDBDBD" }, tooltip: { backgroundColor: "#3A3A3A", color: "#FFF8E1" } }, edges: { stroke: "#965039" }, midpoints: { stroke: "#965039", fill: "#1E1E1E", tooltip: { backgroundColor: "#3A3A3A", color: "#FFF8E1" } }, controls: { backgroundColor: "#1E1E1E", buttonColor: "#1E1E1E", color: "#BDBDBD", border: "1px solid #3A3A3A" }, title: { color: "#FFF8E1", subtitle: { color: "#BDBDBD" } } } } }, Bo = { style: { chart: { backgroundColor: "#1A1A1A", color: "#99AA99", backgroundPattern: { dotColor: "#2f3d2f" }, nodes: { stroke: "#66CC66", backgroundColor: "#2A2A2A", labels: { color: "#99AA99" }, tooltip: { backgroundColor: "#3A3A3A", color: "#99AA99" } }, edges: { stroke: "#66CC66" }, midpoints: { stroke: "#66CC66", fill: "#1A1A1A", tooltip: { backgroundColor: "#3A3A3A", color: "#99AA99" } }, controls: { backgroundColor: "#1A1A1A", buttonColor: "#1A1A1A", color: "#99AA99", border: "1px solid #1e361e" }, title: { color: "#66CC66", subtitle: { color: "#99AA99" } } } } }, zo = { style: { chart: { backgroundColor: "#fbfafa", color: "#8A9892", backgroundPattern: { dotColor: "#dbcfc5" }, nodes: { stroke: "#8F837A", backgroundColor: "#ffffff", labels: { color: "#8A9892" }, tooltip: { backgroundColor: "#8F837A", color: "#fbfafa" } }, edges: { stroke: "#8F837A" }, midpoints: { stroke: "#8F837A", fill: "#fbfafa", tooltip: { backgroundColor: "#8F837A", color: "#fbfafa" } }, controls: { backgroundColor: "#fbfafa", buttonColor: "#fbfafa", color: "#99AA99", border: "1px solid #ebded3" }, title: { color: "#8A9892", subtitle: { color: "#99AA99" } } } } }, Vo = { style: { chart: { backgroundColor: "#f6f6fb", color: "#50606C", backgroundPattern: { dotColor: "#c3cfd9" }, layout: { arrowShape: "normal", curvedEdges: !1 }, nodes: { stroke: "#50606C", backgroundColor: "#ffffff", borderRadius: 0, labels: { color: "#50606C" }, tooltip: { backgroundColor: "#50606C", color: "#f6f6fb" } }, edges: { stroke: "#50606C" }, midpoints: { stroke: "#50606C", fill: "#fbfafa", tooltip: { backgroundColor: "#50606C", color: "#f6f6fb" } }, controls: { backgroundColor: "#f6f6fb", buttonColor: "#f6f6fb", color: "#50606C", border: "1px solid #98aab8", borderRadius: "0" }, title: { color: "#50606C", subtitle: { color: "#718890" } } } } }, Io = {
1896
+ default: {},
1897
+ minimal: To,
1898
+ minimalDark: Ro,
1899
+ dark: Po,
1900
+ celebration: $o,
1901
+ celebrationNight: Fo,
1902
+ hack: Bo,
1903
+ zen: zo,
1904
+ concrete: Vo
1905
+ }, Ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1906
+ __proto__: null,
1907
+ celebration: $o,
1908
+ celebrationNight: Fo,
1909
+ concrete: Vo,
1910
+ dark: Po,
1911
+ default: Io,
1912
+ hack: Bo,
1913
+ minimal: To,
1914
+ minimalDark: Ro,
1915
+ zen: zo
1916
+ }, Symbol.toStringTag, { value: "Module" })), Rr = ["id"], Pr = {
1917
+ key: 0,
1918
+ class: "dag-chart-error"
1919
+ }, $r = ["viewBox", "xmlns"], Fr = { key: 0 }, Br = ["id", "width", "height"], zr = ["cx", "cy", "r", "fill"], Vr = ["x", "y", "width", "height", "fill"], Ir = { key: 2 }, Hr = ["id", "markerWidth", "markerHeight", "refX", "refY"], Gr = ["d", "fill", "stroke"], Wr = ["d", "fill", "stroke"], jr = { class: "vue-ui-dag-edges" }, Yr = ["onMouseenter"], Ur = { class: "vue-ui-dag-nodes" }, Zr = ["onClick", "onMouseenter", "onMouseleave"], Xr = ["x", "y", "width", "height"], qr = { class: "vue-ui-dag-edges" }, Kr = ["d", "stroke-width", "marker-end"], Jr = { class: "vue-ui-dag-node-labels" }, Qr = ["onClick", "onMouseenter", "onMouseleave"], ei = ["x", "y", "font-size", "fill", "font-weight"], ti = ["x", "y", "font-size", "fill", "font-weight", "innerHTML"], oi = { key: 1 }, ni = {
1920
+ key: 6,
1921
+ class: "vue-data-ui-watermark"
1922
+ }, si = ["data-position"], ri = { key: 0 }, ii = ["data-position"], ai = { key: 0 }, bo = 1.5, li = {
1923
+ __name: "vue-ui-dag",
1924
+ props: {
1925
+ dataset: {
1926
+ type: Object,
1927
+ default() {
1928
+ return {
1929
+ nodes: [],
1930
+ edges: []
1931
+ };
1932
+ }
1933
+ },
1934
+ config: {
1935
+ type: Object,
1936
+ default() {
1937
+ return {};
1938
+ }
1939
+ }
1940
+ },
1941
+ emits: ["onNodeClick", "onMidpointEnter", "onMidpointLeave"],
1942
+ setup(e, { expose: t, emit: o }) {
1943
+ const n = rt(() => import("./PenAndPaper-BrX5Qp19.js")), s = rt(() => import("./UserOptions-DToFtFUD.js")), i = rt(() => import("./PackageVersion-CeU7wfkb.js")), { vue_ui_dag: r } = Ln(), { isThemeValid: a, warnInvalidTheme: c } = Rn(), d = e, h = o, m = C(null), g = C(mt()), y = C(null), N = C(null), x = C(null), $ = C(0), Q = C(0), Ee = C(!1), fe = C(!1), F = C(null), G = C(null), l = C(qe()), Y = C(l.value.style.chart.width), ee = C(l.value.style.chart.height), Be = C({ x: 0, y: 0 }), B = C(null), ze = C(null), Ve = C({ left: "0px", top: "0px" }), Ce = C("top"), re = C(!1), yt = C({ x: 0, y: 0 }), wt = C({ x: 0, y: 0 }), _e = C(null), Ue = C(null), Ze = C({ left: "0px", top: "0px" }), kt = C("top"), Ie = C(!1), xe = C(!1), { svgRef: ie } = $n({ config: l.value.style.chart.title }), { userOptionsVisible: Xe, setUserOptionsVisibility: Et, keepUserOptionState: Ct } = Pn({ config: l.value }), te = C(l.value.style.chart.layout.rankDirection), { loading: Ae, FINAL_DATASET: _t, manualLoading: xt } = Mn({
1944
+ ...bn(d),
1945
+ FINAL_CONFIG: l,
1946
+ prepareConfig: qe,
1947
+ skeletonDataset: {
1948
+ nodes: [
1949
+ { id: "A", label: "" },
1950
+ { id: "B", label: "" },
1951
+ { id: "C", label: "" }
1952
+ ],
1953
+ edges: [
1954
+ { from: "A", to: "B" },
1955
+ { from: "A", to: "C" }
1956
+ ]
1957
+ },
1958
+ skeletonConfig: En({
1959
+ defaultConfig: l.value,
1960
+ userConfig: {
1961
+ userOptions: { show: !1 },
1962
+ style: {
1963
+ chart: {
1964
+ backgroundColor: "#99999930",
1965
+ nodes: {
1966
+ stroke: "#CCCCCC",
1967
+ backgroundColor: "#DDDDDD50"
1968
+ },
1969
+ edges: {
1970
+ stroke: "#CCCCCC"
1971
+ },
1972
+ midpoints: {
1973
+ stroke: "#CCCCCC",
1974
+ fill: "#CCCCCC"
1975
+ }
1976
+ }
1977
+ }
1978
+ }
1979
+ })
1980
+ });
1981
+ function qe() {
1982
+ const u = at({
1983
+ userConfig: d.config,
1984
+ defaultConfig: r
1985
+ }), b = u.theme;
1986
+ if (!b) return u;
1987
+ if (!a.value(u))
1988
+ return c(u), u;
1989
+ const f = at({
1990
+ userConfig: Io[b] || d.config,
1991
+ defaultConfig: u
1992
+ });
1993
+ return at({
1994
+ userConfig: d.config,
1995
+ defaultConfig: f
1996
+ });
1997
+ }
1998
+ const Ke = Z(() => !!l.value.debug);
1999
+ Xt(async () => {
2000
+ Cn(d.dataset) && (to({
2001
+ componentName: "VueUiDag",
2002
+ type: "dataset",
2003
+ debug: Ke.value
2004
+ }), fe.value = !1, xt.value = !0), d.dataset.nodes || (to({
2005
+ componentName: "VueUiDag",
2006
+ type: "datasetAttributeEmpty",
2007
+ property: "nodes",
2008
+ index: 0,
2009
+ debug: Ke.value
2010
+ }), fe.value = !1, xt.value = !0), fe.value = !0, await Me(), Gt();
2011
+ }), Oe(() => d.config, async (u) => {
2012
+ Ae.value || (l.value = qe()), Xe.value = !l.value.userOptions.showOnChartHover, $.value += 1, te.value = l.value.style.chart.layout.rankDirection, Y.value = l.value.style.chart.width, ee.value = l.value.style.chart.height, he.value = l.value.style.chart.zoom.active, await Me(), Gt();
2013
+ }, { deep: !0 });
2014
+ const { isPrinting: At, isImaging: Nt, generatePdf: St, generateImage: Lt } = Dn({
2015
+ elementId: `dag_${g.value}`,
2016
+ fileName: l.value.style.chart.title.text || "vue-ui-dag",
2017
+ options: l.value.userOptions.print
2018
+ }), Ho = Z(() => l.value.style.chart.backgroundColor), Go = Z(() => l.value.style.chart.title), { exportSvg: Wo, getSvg: jo } = Tn({
2019
+ svg: ie,
2020
+ title: Go,
2021
+ legend: void 0,
2022
+ legendItems: void 0,
2023
+ backgroundColor: Ho
2024
+ });
2025
+ async function Mt({ isCb: u }) {
2026
+ if (u) {
2027
+ const { blob: b, url: f, text: v, dataUrl: A } = await jo();
2028
+ l.value.userOptions.callbacks.svg({ blob: b, url: f, text: v, dataUrl: A });
2029
+ } else
2030
+ Wo();
2031
+ }
2032
+ function Yo() {
2033
+ Ee.value = !0, Et(!0);
2034
+ }
2035
+ function Uo() {
2036
+ Et(!1), Ee.value = !1;
2037
+ }
2038
+ function Ot({
2039
+ tooltipRef: u,
2040
+ isVisibleRef: b,
2041
+ anchorRef: f,
2042
+ styleRef: v,
2043
+ placementRef: A,
2044
+ offsetRef: M,
2045
+ margin: w = 24
2046
+ }) {
2047
+ return function() {
2048
+ const U = u.value;
2049
+ if (!U || !b.value) return;
2050
+ const S = U.getBoundingClientRect(), P = window.innerWidth, V = window.innerHeight, q = f.value.x, W = f.value.y, K = M?.value?.x ?? 0, ce = M?.value?.y ?? 0;
2051
+ let D = W - ce - S.height - w, j = q - S.width / 2, Se = "top";
2052
+ if (D < w) {
2053
+ const ve = W + ce + w;
2054
+ ve + S.height <= V - w ? (D = ve, Se = "bottom") : (D = W - S.height / 2, D < w && (D = w), D + S.height > V - w && (D = V - S.height - w), Se = "center");
2055
+ }
2056
+ j < w && (j = w), j + S.width > P - w && (j = P - S.width - w);
2057
+ const mn = j <= w, gn = j + S.width >= P - w;
2058
+ if ((mn || gn) && Se !== "center") {
2059
+ let ve, Le;
2060
+ const vn = q - K - w;
2061
+ P - (q + K) - w >= vn ? (ve = "right", Le = q + K + w) : (ve = "left", Le = q - K - w - S.width), Le >= w && Le + S.width <= P - w && (j = Le, D = W - S.height / 2, D < w && (D = w), D + S.height > V - w && (D = V - S.height - w), Se = ve);
2062
+ }
2063
+ A.value = Se, v.value = {
2064
+ left: `${j}px`,
2065
+ top: `${D}px`
2066
+ };
2067
+ };
2068
+ }
2069
+ const Zo = Z(() => _t.value.nodes.map((u) => ({
2070
+ ...u,
2071
+ backgroundColor: u.backgroundColor ? oo(u.backgroundColor) : l.value.style.chart.nodes.backgroundColor,
2072
+ color: u.color ? oo(u.color) : l.value.style.chart.nodes.labels.color
2073
+ }))), Xo = Z(() => _t.value.edges), qo = Z(() => ({
2074
+ ...l.value.style.chart.layout,
2075
+ rankDirection: te.value
2076
+ })), { layoutData: k, lastError: Dt, arrowMarkerIdentifier: Ko } = Tr({
2077
+ nodes: Zo,
2078
+ edges: Xo,
2079
+ configuration: qo
2080
+ });
2081
+ function Tt(u) {
2082
+ return k.value ? k.value.nodes.find((b) => b.id === u) : null;
2083
+ }
2084
+ Z(() => {
2085
+ if (!k.value) return [];
2086
+ const u = l.value.style.chart.edges.stroke, b = /* @__PURE__ */ new Set();
2087
+ return k.value.edges.forEach((f) => {
2088
+ b.add({
2089
+ id: f.id,
2090
+ from: f.from,
2091
+ to: f.to,
2092
+ color: f.original?.color || u
2093
+ });
2094
+ }), Array.from(b);
2095
+ });
2096
+ const Rt = Z(() => {
2097
+ const u = Y.value, b = ee.value, f = Number(u), v = Number(b), A = Number.isFinite(f) && f > 0, M = Number.isFinite(v) && v > 0;
2098
+ return !A && !M ? null : {
2099
+ width: A ? f : null,
2100
+ height: M ? v : null
2101
+ };
2102
+ }), he = C(l.value.style.chart.zoom.active), {
2103
+ viewBox: me,
2104
+ resetZoom: He,
2105
+ setInitialViewBox: Jo,
2106
+ scale: Pt,
2107
+ zoomByFactor: $t
2108
+ } = Sn(
2109
+ ie,
2110
+ { x: 0, y: 0, width: 100, height: 100 },
2111
+ 1,
2112
+ he,
2113
+ () => {
2114
+ re.value = !1;
2115
+ }
2116
+ );
2117
+ function Qo() {
2118
+ he.value = !he.value;
2119
+ }
2120
+ function Ft() {
2121
+ const u = k.value && k.value.viewBox;
2122
+ if (!u) return;
2123
+ const b = String(u).split(" ").map(Number);
2124
+ if (b.length !== 4) return;
2125
+ const [f, v, A, M] = b;
2126
+ if (!Number.isFinite(f) || !Number.isFinite(v) || !Number.isFinite(A) || !Number.isFinite(M))
2127
+ return;
2128
+ let w = A, T = M, U = f, S = v;
2129
+ const P = Rt.value;
2130
+ P && (P.width !== null && (w = P.width), P.height !== null && (T = P.height), U = f - (w - A) / 2, S = v - (T - M) / 2), Jo(
2131
+ { x: U, y: S, width: w, height: T },
2132
+ { overwriteCurrentIfNotZoomed: !0 }
2133
+ );
2134
+ }
2135
+ Oe(
2136
+ () => k.value && k.value.viewBox,
2137
+ () => {
2138
+ Ft();
2139
+ },
2140
+ { immediate: !0 }
2141
+ ), Oe(
2142
+ () => Rt.value,
2143
+ () => {
2144
+ Ft();
2145
+ }
2146
+ ), Oe(() => xe.value, (u) => {
2147
+ he.value = !u;
2148
+ });
2149
+ const en = Z(() => {
2150
+ const u = me.value;
2151
+ return u ? `${u.x} ${u.y} ${u.width} ${u.height}` : "0 0 0 0";
2152
+ }), ae = C(!1);
2153
+ function Bt(u) {
2154
+ ae.value = u, Q.value += 1;
2155
+ }
2156
+ function Je() {
2157
+ xe.value = !xe.value;
2158
+ }
2159
+ function Qe() {
2160
+ $t(bo, !0);
2161
+ }
2162
+ function et() {
2163
+ $t(1 / bo, !0);
2164
+ }
2165
+ const tt = ["TB", "RL", "BT", "LR"];
2166
+ function ot() {
2167
+ te.value = tt[(tt.indexOf(te.value) + 1) % tt.length], He();
2168
+ }
2169
+ const tn = Ot({
2170
+ tooltipRef: ze,
2171
+ isVisibleRef: Ie,
2172
+ anchorRef: Be,
2173
+ styleRef: Ve,
2174
+ placementRef: Ce
2175
+ }), on = Ot({
2176
+ tooltipRef: Ue,
2177
+ isVisibleRef: re,
2178
+ anchorRef: yt,
2179
+ styleRef: Ze,
2180
+ placementRef: kt,
2181
+ offsetRef: wt
2182
+ }), oe = C(null);
2183
+ async function nn(u) {
2184
+ h("onMidpointEnter", u);
2185
+ const b = ie.value;
2186
+ if (!b || !u?.midpoint) return;
2187
+ const f = b.createSVGPoint();
2188
+ f.x = u.midpoint.x, f.y = u.midpoint.y;
2189
+ const v = b.getScreenCTM();
2190
+ if (!v) return;
2191
+ const A = f.matrixTransform(v);
2192
+ Be.value = {
2193
+ x: A.x,
2194
+ y: A.y
2195
+ }, B.value = u, Ie.value = !0, l.value.style.chart.midpoints.selectedEdge.animated === !0 && (oe.value = u.id, Ne()), await Me(), tn();
2196
+ }
2197
+ function sn() {
2198
+ Ie.value = !1, B.value = null, h("onMidpointLeave"), l.value.style.chart.midpoints.selectedEdge.animated === !0 && (oe.value = null, Ne());
2199
+ }
2200
+ async function zt(u) {
2201
+ if (h("onNodeClick", u), !l.value.style.chart.nodes.tooltip.showOnClick) return;
2202
+ const b = ie.value;
2203
+ if (!b) return;
2204
+ const f = b.createSVGPoint();
2205
+ f.x = u.x, f.y = u.y;
2206
+ const v = b.getScreenCTM();
2207
+ if (!v) return;
2208
+ const A = f.matrixTransform(v), M = l.value.style.chart.layout.nodeWidth, w = l.value.style.chart.layout.nodeHeight, T = v.a, U = v.d, S = M * T, P = w * U;
2209
+ wt.value = {
2210
+ x: S / 2,
2211
+ y: P / 2
2212
+ }, yt.value = {
2213
+ x: A.x,
2214
+ y: A.y
2215
+ }, _e.value = u, re.value = !0, await Me(), on();
2216
+ }
2217
+ function Vt() {
2218
+ re.value = !1, _e.value = null;
2219
+ }
2220
+ function It(u) {
2221
+ if (!re.value) return;
2222
+ const b = Ue.value;
2223
+ if (b && b.contains(u.target))
2224
+ return;
2225
+ const f = ie.value;
2226
+ f && f.contains(u.target) && u.target.closest(".vue-ui-dag-node") || Vt();
2227
+ }
2228
+ function Ht(u) {
2229
+ u.key === "Escape" && re.value && Vt();
2230
+ }
2231
+ Xt(() => {
2232
+ document.addEventListener("mousedown", It), document.addEventListener("keydown", Ht);
2233
+ }), qt(() => {
2234
+ document.removeEventListener("mousedown", It), document.removeEventListener("keydown", Ht), F.value && (G.value && F.value.unobserve(G.value), F.value.disconnect());
2235
+ });
2236
+ function Gt() {
2237
+ if (!l.value.responsive) {
2238
+ F.value && (G.value && F.value.unobserve(G.value), F.value.disconnect(), F.value = null, G.value = null);
2239
+ return;
2240
+ }
2241
+ const u = An(() => {
2242
+ if (!m.value) return;
2243
+ const { width: b, height: f } = Nn({
2244
+ chart: m.value,
2245
+ title: l.value.style.chart.title.text ? y.value : null,
2246
+ legend: l.value.style.chart.controls.show ? x.value?.$el : null,
2247
+ source: N.value
2248
+ });
2249
+ requestAnimationFrame(() => {
2250
+ Y.value = Math.max(0.1, b), ee.value = Math.max(0.1, f - 12);
2251
+ });
2252
+ });
2253
+ F.value && (G.value && F.value.unobserve(G.value), F.value.disconnect()), F.value = new ResizeObserver(u), G.value = m.value ? m.value.parentNode : null, G.value && F.value.observe(G.value), u();
2254
+ }
2255
+ function rn(u, b = {}) {
2256
+ const {
2257
+ direction: f = -1,
2258
+ mode: v = "oneLapNearest",
2259
+ dasharray: A = null
2260
+ } = b;
2261
+ if (!u || typeof u.getTotalLength != "function")
2262
+ return Ke.value && console.warn(
2263
+ "VueUiDag @getIdealDashoffsetDelta: invalid path element",
2264
+ u
2265
+ ), 0;
2266
+ const M = u.getTotalLength(), w = A ?? u.getAttribute("stroke-dasharray") ?? (typeof getComputedStyle == "function" ? getComputedStyle(u).strokeDasharray : ""), T = q(w);
2267
+ if (!Number.isFinite(T) || T <= 0)
2268
+ return f * M;
2269
+ const U = Math.max(1, Math.round(M / T)), S = Math.max(1, Math.ceil(M / T)), P = Math.max(1, Math.floor(M / T));
2270
+ let V;
2271
+ return v === "pattern" ? V = T : v === "oneLapCeil" ? V = S * T : v === "oneLapFloor" ? V = P * T : V = U * T, f * V;
2272
+ function q(W) {
2273
+ if (!W || W === "none") return NaN;
2274
+ const K = String(W).replace(/,/g, " ").trim().split(/\s+/).map((D) => Number.parseFloat(D)).filter((D) => Number.isFinite(D));
2275
+ if (!K.length) return NaN;
2276
+ const ce = K.reduce((D, j) => D + j, 0);
2277
+ return K.length % 2 === 1 ? ce * 2 : ce;
2278
+ }
2279
+ }
2280
+ const nt = C(/* @__PURE__ */ new Map()), st = C(/* @__PURE__ */ new Map());
2281
+ function an(u) {
2282
+ return function(f) {
2283
+ f ? nt.value.set(u, f) : nt.value.delete(u);
2284
+ };
2285
+ }
2286
+ function Wt() {
2287
+ st.value.forEach((u) => {
2288
+ try {
2289
+ u.cancel();
2290
+ } catch {
2291
+ }
2292
+ }), st.value.clear();
2293
+ }
2294
+ function Ne() {
2295
+ Wt();
2296
+ const u = k.value?.edges ?? [];
2297
+ if (!u.length) return;
2298
+ const b = l.value.style.chart.edges.animations, f = Number(b.referenceDistance) > 0 ? Number(b.referenceDistance) : 24;
2299
+ u.forEach((v) => {
2300
+ const A = l.value.style.chart.midpoints.selectedEdge.animated === !0 && oe.value != null && v.id === oe.value, M = !!v?.original?.animated || !!v?.animated || A, w = nt.value.get(v.id);
2301
+ if (!w) return;
2302
+ if (!M) {
2303
+ w.style.strokeDasharray = "0", w.style.strokeDashoffset = "0";
2304
+ return;
2305
+ }
2306
+ const T = v?.original?.dasharray ?? b.dasharray;
2307
+ w.style.strokeDasharray = String(T), w.style.strokeDashoffset = "0";
2308
+ const U = ![void 0, null].includes(v?.original?.animationDirection), S = ![void 0, null].includes(b.animationDirection), P = U ? Number(v.original.animationDirection) : S ? Number(b.animationDirection) : -1, V = rn(w, {
2309
+ direction: P,
2310
+ mode: "oneLapNearest",
2311
+ dasharray: String(T)
2312
+ }), q = v?.original?.animationDurationMs ?? b.animationDurationMs ?? 1e3, W = Number(q), ce = Number.isFinite(W) && W > 0 ? f / W : f / 1e3, D = Math.max(1, Math.round(Math.abs(V) / Math.max(1e-9, ce))), j = w.animate([{ strokeDashoffset: 0 }, { strokeDashoffset: V }], { duration: D, iterations: 1 / 0, easing: "linear" });
2313
+ st.value.set(v.id, j);
2314
+ });
2315
+ }
2316
+ Oe(
2317
+ () => k.value && k.value.edges,
2318
+ async () => {
2319
+ await Me(), Ne();
2320
+ },
2321
+ { deep: !0, immediate: !0 }
2322
+ ), qt(() => {
2323
+ Wt();
2324
+ });
2325
+ async function ln({ scale: u = 2 } = {}) {
2326
+ if (!m.value) return;
2327
+ const { width: b, height: f } = m.value.getBoundingClientRect(), v = b / f, { imageUri: A, base64: M } = await Bn({ domElement: m.value, base64: !0, img: !0, scale: u });
2328
+ return {
2329
+ imageUri: A,
2330
+ base64: M,
2331
+ title: l.value.style.chart.title.text ?? "vue-ui-dag",
2332
+ width: b,
2333
+ height: f,
2334
+ aspectRatio: v
2335
+ };
2336
+ }
2337
+ const le = Z(() => {
2338
+ const u = Number(l.value.style.chart.layout.nodeHeight);
2339
+ return Number.isFinite(u) && u > 0 ? u / l.value.style.chart.backgroundPattern.spacingRatio : 12;
2340
+ }), cn = Z(() => le.value * (l.value.style.chart.backgroundPattern.dotRadiusRatio / 100)), R = C(null);
2341
+ let ge = null, jt = 0;
2342
+ function Yt(u) {
2343
+ ge && (clearTimeout(ge), ge = null), R.value !== u && (R.value = u, (l.value.style.chart.nodes.selected.downstreamEdges.animated === !0 || l.value.style.chart.nodes.selected.upstreamEdges.animated === !0) && Ne());
2344
+ }
2345
+ function Ut(u) {
2346
+ const b = ++jt;
2347
+ ge && clearTimeout(ge), ge = setTimeout(() => {
2348
+ b === jt && R.value === u && (R.value = null, (l.value.style.chart.nodes.selected.downstreamEdges.animated === !0 || l.value.style.chart.nodes.selected.upstreamEdges.animated === !0) && Ne());
2349
+ }, 20);
2350
+ }
2351
+ function un(u) {
2352
+ const b = u.from === R.value, f = u.to === R.value;
2353
+ let v = u.original.color ?? l.value.style.chart.edges.stroke;
2354
+ if ((oe.value === u.id || B.value?.id === u.id) && l.value.style.chart.midpoints.selectedEdge.stroke != null ? v = l.value.style.chart.midpoints.selectedEdge.stroke : b && l.value.style.chart.nodes.selected.downstreamEdges.stroke != null ? v = l.value.style.chart.nodes.selected.downstreamEdges.stroke : f && l.value.style.chart.nodes.selected.upstreamEdges.stroke != null && (v = l.value.style.chart.nodes.selected.upstreamEdges.stroke), b && l.value.style.chart.nodes.selected.downstreamEdges.animated === !0)
2355
+ u.animated = !0;
2356
+ else if (f && l.value.style.chart.nodes.selected.upstreamEdges.animated === !0)
2357
+ u.animated = !0;
2358
+ else {
2359
+ const A = k.value?.edges.find((M) => M.id === u.id);
2360
+ u.animated = A?.original?.animated ?? !1;
2361
+ }
2362
+ return {
2363
+ d: u.pathData,
2364
+ fill: "none",
2365
+ stroke: v,
2366
+ "stroke-width": l.value.style.chart.edges.strokeWidth * (oe.value === u.id || u.from === R.value || u.id === B.value?.id ? 2 : 1),
2367
+ "stroke-linecap": "round",
2368
+ "stroke-linejoin": "round"
2369
+ };
2370
+ }
2371
+ function dn(u) {
2372
+ const b = R.value === u.id, f = b && l.value.style.chart.nodes.selected.backgroundColor != null ? l.value.style.chart.nodes.selected.backgroundColor : u.original.backgroundColor, v = b && l.value.style.chart.nodes.selected.stroke != null ? l.value.style.chart.nodes.selected.stroke : l.value.style.chart.nodes.stroke, A = b && l.value.style.chart.nodes.selected.strokeWidth != null ? l.value.style.chart.nodes.selected.strokeWidth : l.value.style.chart.nodes.strokeWidth;
2373
+ return {
2374
+ x: u.x - u.width / 2,
2375
+ y: u.y - u.height / 2,
2376
+ width: u.width,
2377
+ height: u.height,
2378
+ rx: l.value.style.chart.nodes.borderRadius,
2379
+ fill: f,
2380
+ stroke: v,
2381
+ "stroke-width": A
2382
+ };
2383
+ }
2384
+ function fn(u) {
2385
+ const b = u.from === R.value, f = u.to === R.value;
2386
+ let v = u.original.color ?? l.value.style.chart.edges.stroke;
2387
+ return (oe.value === u.id || B.value?.id === u.id) && l.value.style.chart.midpoints.selectedEdge.stroke != null ? v = l.value.style.chart.midpoints.selectedEdge.stroke : b && l.value.style.chart.nodes.selected.downstreamEdges.stroke != null ? v = l.value.style.chart.nodes.selected.downstreamEdges.stroke : f && l.value.style.chart.nodes.selected.upstreamEdges.stroke != null && (v = l.value.style.chart.nodes.selected.upstreamEdges.stroke), {
2388
+ cx: u.midpoint.x,
2389
+ cy: u.midpoint.y,
2390
+ r: l.value.style.chart.midpoints.radius,
2391
+ fill: l.value.style.chart.midpoints.fill,
2392
+ stroke: v,
2393
+ "stroke-width": l.value.style.chart.edges.strokeWidth * (u.from === R.value || u.id === B.value?.id ? 2 : 1)
2394
+ };
2395
+ }
2396
+ function Ge(u) {
2397
+ const b = u.from === R.value, f = u.to === R.value;
2398
+ let v = u.color ?? u.original?.color ?? l.value.style.chart.edges.stroke;
2399
+ return (oe.value === u.id || B.value?.id === u.id) && l.value.style.chart.midpoints.selectedEdge.stroke != null ? v = l.value.style.chart.midpoints.selectedEdge.stroke : b && l.value.style.chart.nodes.selected.downstreamEdges.stroke != null ? v = l.value.style.chart.nodes.selected.downstreamEdges.stroke : f && l.value.style.chart.nodes.selected.upstreamEdges.stroke != null && (v = l.value.style.chart.nodes.selected.upstreamEdges.stroke), v;
2400
+ }
2401
+ function Zt(u) {
2402
+ return `${Ko}-${String(u).replace(/[^a-zA-Z0-9_-]/g, "_")}`;
2403
+ }
2404
+ function hn() {
2405
+ return k.value;
2406
+ }
2407
+ return t({
2408
+ getData: hn,
2409
+ getImage: ln,
2410
+ generatePdf: St,
2411
+ generateSvg: Mt,
2412
+ generateImage: Lt,
2413
+ toggleAnnotator: Je,
2414
+ toggleFullscreen: Bt,
2415
+ zoomIn: Qe,
2416
+ zoomOut: et,
2417
+ resetZoom: He,
2418
+ switchDirection: ot
2419
+ }), (u, b) => (E(), _("div", {
2420
+ class: Kt(`vue-data-ui-component vue-ui-dag ${ae.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${l.value.responsive ? "vue-ui-dag-responsive" : ""}`),
2421
+ id: `dag_${g.value}`,
2422
+ ref_key: "dagChart",
2423
+ ref: m,
2424
+ style: pe({
2425
+ fontFamily: l.value.style.fontFamily,
2426
+ backgroundColor: l.value.style.chart.backgroundColor,
2427
+ padding: "0.5rem"
2428
+ }),
2429
+ onMouseenter: Yo,
2430
+ onMouseleave: Uo
2431
+ }, [
2432
+ p(Dt) ? (E(), _("div", Pr, De(String(p(Dt))), 1)) : L("", !0),
2433
+ l.value.userOptions.buttons.annotator ? (E(), ne(p(n), {
2434
+ key: 1,
2435
+ svgRef: p(ie),
2436
+ backgroundColor: l.value.style.chart.backgroundColor,
2437
+ color: l.value.style.chart.color,
2438
+ active: xe.value,
2439
+ onClose: Je
2440
+ }, {
2441
+ "annotator-action-close": z(() => [
2442
+ O(u.$slots, "annotator-action-close", {}, void 0, !0)
2443
+ ]),
2444
+ "annotator-action-color": z(({ color: f }) => [
2445
+ O(u.$slots, "annotator-action-color", I(H({ color: f })), void 0, !0)
2446
+ ]),
2447
+ "annotator-action-draw": z(({ mode: f }) => [
2448
+ O(u.$slots, "annotator-action-draw", I(H({ mode: f })), void 0, !0)
2449
+ ]),
2450
+ "annotator-action-undo": z(({ disabled: f }) => [
2451
+ O(u.$slots, "annotator-action-undo", I(H({ disabled: f })), void 0, !0)
2452
+ ]),
2453
+ "annotator-action-redo": z(({ disabled: f }) => [
2454
+ O(u.$slots, "annotator-action-redo", I(H({ disabled: f })), void 0, !0)
2455
+ ]),
2456
+ "annotator-action-delete": z(({ disabled: f }) => [
2457
+ O(u.$slots, "annotator-action-delete", I(H({ disabled: f })), void 0, !0)
2458
+ ]),
2459
+ _: 3
2460
+ }, 8, ["svgRef", "backgroundColor", "color", "active"])) : L("", !0),
2461
+ l.value.userOptions.show && fe.value && (p(Ct) || p(Xe)) ? (E(), ne(p(s), {
2462
+ ref: "userOptionsRef",
2463
+ key: `user_option_${Q.value}`,
2464
+ backgroundColor: l.value.style.chart.backgroundColor,
2465
+ color: l.value.style.chart.color,
2466
+ isPrinting: p(At),
2467
+ isImaging: p(Nt),
2468
+ uid: g.value,
2469
+ hasTooltip: !1,
2470
+ hasTable: !1,
2471
+ hasXls: !1,
2472
+ hasLabel: !1,
2473
+ hasPdf: l.value.userOptions.buttons.pdf,
2474
+ hasImg: l.value.userOptions.buttons.img,
2475
+ hasSvg: l.value.userOptions.buttons.svg,
2476
+ hasFullscreen: l.value.userOptions.buttons.fullscreen,
2477
+ isFullscreen: ae.value,
2478
+ chartElement: m.value,
2479
+ position: l.value.userOptions.position,
2480
+ titles: { ...l.value.userOptions.buttonTitles },
2481
+ hasAnnotator: l.value.userOptions.buttons.annotator,
2482
+ isAnnotation: xe.value,
2483
+ callbacks: l.value.userOptions.callbacks,
2484
+ printScale: l.value.userOptions.print.scale,
2485
+ hasZoom: l.value.userOptions.buttons.zoom,
2486
+ isZoom: he.value,
2487
+ onToggleFullscreen: Bt,
2488
+ onGeneratePdf: p(St),
2489
+ onGenerateImage: p(Lt),
2490
+ onGenerateSvg: Mt,
2491
+ onToggleAnnotator: Je,
2492
+ onToggleZoom: Qo,
2493
+ style: pe({
2494
+ visibility: p(Ct) ? p(Xe) ? "visible" : "hidden" : "visible"
2495
+ })
2496
+ }, yn({ _: 2 }, [
2497
+ u.$slots.menuIcon ? {
2498
+ name: "menuIcon",
2499
+ fn: z(({ isOpen: f, color: v }) => [
2500
+ O(u.$slots, "menuIcon", I(H({ isOpen: f, color: v })), void 0, !0)
2501
+ ]),
2502
+ key: "0"
2503
+ } : void 0,
2504
+ u.$slots.optionPdf ? {
2505
+ name: "optionPdf",
2506
+ fn: z(() => [
2507
+ O(u.$slots, "optionPdf", {}, void 0, !0)
2508
+ ]),
2509
+ key: "1"
2510
+ } : void 0,
2511
+ u.$slots.optionImg ? {
2512
+ name: "optionImg",
2513
+ fn: z(() => [
2514
+ O(u.$slots, "optionImg", {}, void 0, !0)
2515
+ ]),
2516
+ key: "2"
2517
+ } : void 0,
2518
+ u.$slots.optionSvg ? {
2519
+ name: "optionSvg",
2520
+ fn: z(() => [
2521
+ O(u.$slots, "optionSvg", {}, void 0, !0)
2522
+ ]),
2523
+ key: "3"
2524
+ } : void 0,
2525
+ u.$slots.optionFullscreen ? {
2526
+ name: "optionFullscreen",
2527
+ fn: z(({ toggleFullscreen: f, isFullscreen: v }) => [
2528
+ O(u.$slots, "optionFullscreen", I(H({ toggleFullscreen: f, isFullscreen: v })), void 0, !0)
2529
+ ]),
2530
+ key: "4"
2531
+ } : void 0,
2532
+ u.$slots.optionAnnotator ? {
2533
+ name: "optionAnnotator",
2534
+ fn: z(({ toggleAnnotator: f, isAnnotator: v }) => [
2535
+ O(u.$slots, "optionAnnotator", I(H({ toggleAnnotator: f, isAnnotator: v })), void 0, !0)
2536
+ ]),
2537
+ key: "5"
2538
+ } : void 0,
2539
+ u.$slots.optionZoom ? {
2540
+ name: "optionZoom",
2541
+ fn: z(({ toggleZoom: f, isZoomLocked: v }) => [
2542
+ O(u.$slots, "optionZoom", I(H({ toggleZoom: f, isZoomLocked: v })), void 0, !0)
2543
+ ]),
2544
+ key: "6"
2545
+ } : void 0
2546
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasSvg", "hasFullscreen", "isFullscreen", "chartElement", "position", "titles", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "hasZoom", "isZoom", "onGeneratePdf", "onGenerateImage", "style"])) : L("", !0),
2547
+ l.value.style.chart.title.text ? (E(), _("div", {
2548
+ key: 3,
2549
+ ref_key: "chartTitle",
2550
+ ref: y,
2551
+ style: "width:100%;background:transparent;"
2552
+ }, [
2553
+ (E(), ne(Fn, {
2554
+ key: `title_${$.value}`,
2555
+ config: {
2556
+ title: {
2557
+ cy: "dag-title",
2558
+ ...l.value.style.chart.title
2559
+ },
2560
+ subtitle: {
2561
+ cy: "dag-subtitle",
2562
+ ...l.value.style.chart.title.subtitle
2563
+ }
2564
+ }
2565
+ }, null, 8, ["config"]))
2566
+ ], 512)) : L("", !0),
2567
+ l.value.style.chart.controls.position === "top" && !p(Ae) && l.value.style.chart.controls.show ? (E(), ne(no, {
2568
+ key: 4,
2569
+ ref_key: "zoomControls",
2570
+ ref: x,
2571
+ config: l.value,
2572
+ scale: p(Pt),
2573
+ isFullscreen: ae.value,
2574
+ withDirection: "",
2575
+ onZoomIn: Qe,
2576
+ onZoomOut: et,
2577
+ onResetZoom: b[0] || (b[0] = () => p(He)(!0)),
2578
+ onSwitchDirection: ot
2579
+ }, null, 8, ["config", "scale", "isFullscreen"])) : L("", !0),
2580
+ p(k) ? (E(), _("svg", {
2581
+ key: 5,
2582
+ ref_key: "svgRef",
2583
+ ref: ie,
2584
+ class: Kt({ "vue-ui-dag-svg": !0, "vue-data-ui-loading": p(Ae) }),
2585
+ viewBox: en.value,
2586
+ xmlns: p(_n),
2587
+ style: pe({
2588
+ backgroundColor: l.value.style.chart.backgroundColor,
2589
+ height: "100%",
2590
+ width: "100%"
2591
+ })
2592
+ }, [
2593
+ it(p(i)),
2594
+ l.value.style.chart.backgroundPattern.show ? (E(), _("defs", Fr, [
2595
+ J("pattern", {
2596
+ id: `dag_bg_pattern_${g.value}`,
2597
+ patternUnits: "userSpaceOnUse",
2598
+ width: le.value,
2599
+ height: le.value
2600
+ }, [
2601
+ O(u.$slots, "background-pattern", I(H({
2602
+ x: le.value / 2,
2603
+ y: le.value / 2,
2604
+ color: l.value.style.chart.backgroundPattern.dotColor
2605
+ })), () => [
2606
+ J("circle", {
2607
+ cx: le.value / 2,
2608
+ cy: le.value / 2,
2609
+ r: cn.value,
2610
+ fill: l.value.style.chart.backgroundPattern.dotColor
2611
+ }, null, 8, zr)
2612
+ ], !0)
2613
+ ], 8, Br)
2614
+ ])) : L("", !0),
2615
+ l.value.style.chart.backgroundPattern.show ? (E(), _("rect", {
2616
+ key: 1,
2617
+ x: p(me)?.x ?? 0,
2618
+ y: p(me)?.y ?? 0,
2619
+ width: p(me)?.width ?? 0,
2620
+ height: p(me)?.height ?? 0,
2621
+ fill: `url(#dag_bg_pattern_${g.value})`,
2622
+ style: pe({
2623
+ pointerEvents: "none",
2624
+ opacity: l.value.style.chart.backgroundPattern.opacity
2625
+ })
2626
+ }, null, 12, Vr)) : L("", !0),
2627
+ p(k).arrowShape !== "undirected" ? (E(), _("defs", Ir, [
2628
+ (E(!0), _(ue, null, Te(p(k).edges, (f) => (E(), _("marker", {
2629
+ key: `marker_${f.id}`,
2630
+ id: Zt(f.id),
2631
+ markerWidth: p(k).arrowSize,
2632
+ markerHeight: p(k).arrowSize,
2633
+ refX: p(k).arrowSize - 3,
2634
+ refY: p(k).arrowSize / 2,
2635
+ orient: "auto",
2636
+ markerUnits: "strokeWidth"
2637
+ }, [
2638
+ p(k).arrowShape === "normal" ? (E(), _("path", {
2639
+ key: 0,
2640
+ d: `M 0 0 L ${p(k).arrowSize} ${p(k).arrowSize / 2} L 0 ${p(k).arrowSize} Z`,
2641
+ fill: Ge(f),
2642
+ stroke: Ge(f),
2643
+ "stroke-width": "0",
2644
+ style: { transition: "stroke 0.2s ease-in-out, fill 0.2s ease-in-out, stroke-width 0.2s ease-in-out" }
2645
+ }, null, 8, Gr)) : (E(), _("path", {
2646
+ key: 1,
2647
+ d: `M 0 0 L ${p(k).arrowSize} ${p(k).arrowSize / 2} L 0 ${p(k).arrowSize} L ${p(k).arrowSize / 3} ${p(k).arrowSize / 2} Z`,
2648
+ fill: Ge(f),
2649
+ stroke: Ge(f),
2650
+ "stroke-width": "0",
2651
+ style: { transition: "stroke 0.2s ease-in-out, fill 0.2s ease-in-out, stroke-width 0.2s ease-in-out" }
2652
+ }, null, 8, Wr))
2653
+ ], 8, Hr))), 128))
2654
+ ])) : L("", !0),
2655
+ J("g", jr, [
2656
+ (E(!0), _(ue, null, Te(p(k).edges, (f) => (E(), _(ue, {
2657
+ key: f.id
2658
+ }, [
2659
+ J("path", be({
2660
+ "data-cy-edge": "",
2661
+ ref_for: !0,
2662
+ ref: an(f.id)
2663
+ }, { ref_for: !0 }, un(f), { style: { "pointer-events": "none", transition: "stroke-width 0.2s ease-in-out, stroke 0.2s ease-in-out" } }), null, 16),
2664
+ l.value.style.chart.midpoints.show ? (E(), _("circle", be({
2665
+ key: 0,
2666
+ "data-cy-midpoint": "",
2667
+ class: "vue-ui-dag-edge-midpoint"
2668
+ }, { ref_for: !0 }, fn(f), {
2669
+ style: { transition: "stroke-width 0.2s ease-in-out, stroke 0.2s ease-in-out" },
2670
+ onMouseenter: (v) => nn(f),
2671
+ onMouseleave: sn
2672
+ }), null, 16, Yr)) : L("", !0)
2673
+ ], 64))), 128))
2674
+ ]),
2675
+ J("g", Ur, [
2676
+ (E(!0), _(ue, null, Te(p(k).nodes, (f) => (E(), _("g", {
2677
+ key: f.id,
2678
+ class: "vue-ui-dag-node",
2679
+ onClick: Jt((v) => l.value.style.chart.nodes.tooltip.showOnClick && zt(f), ["stop"]),
2680
+ onMouseenter: (v) => Yt(f.id),
2681
+ onMouseleave: (v) => Ut(f.id)
2682
+ }, [
2683
+ u.$slots.node ? L("", !0) : (E(), _("rect", be({
2684
+ key: 0,
2685
+ "data-cy-node": ""
2686
+ }, { ref_for: !0 }, dn(f), {
2687
+ style: {
2688
+ cursor: l.value.style.chart.nodes.tooltip.showOnClick ? "pointer" : "default",
2689
+ transition: "stroke 0.2s ease-in-out, stroke-width 0.2s ease-in-out, fill 0.2s ease-in-out"
2690
+ }
2691
+ }), null, 16)),
2692
+ u.$slots.node ? (E(), _("foreignObject", {
2693
+ key: 1,
2694
+ x: f.x - f.width / 2,
2695
+ y: f.y - f.height / 2,
2696
+ width: f.width,
2697
+ height: f.height
2698
+ }, [
2699
+ O(u.$slots, "node", be({ ref_for: !0 }, { node: f, orientation: te.value }), void 0, !0)
2700
+ ], 8, Xr)) : L("", !0)
2701
+ ], 40, Zr))), 128))
2702
+ ]),
2703
+ J("g", qr, [
2704
+ (E(!0), _(ue, null, Te(p(k).edges, (f) => (E(), _("path", {
2705
+ key: f.id,
2706
+ d: f.pathData,
2707
+ fill: "none",
2708
+ stroke: "transparent",
2709
+ "stroke-width": l.value.style.chart.edges.strokeWidth * (f.from === R.value || f.id === B.value?.id ? 1.3 : 1),
2710
+ "stroke-linecap": "round",
2711
+ "stroke-linejoin": "round",
2712
+ "marker-end": p(k).arrowShape === "undirected" ? null : `url(#${Zt(f.id)})`,
2713
+ style: { "pointer-events": "none", transition: "stroke-width 0.2s ease-in-out, stroke 0.2s ease-in-out" }
2714
+ }, null, 8, Kr))), 128))
2715
+ ]),
2716
+ J("g", Jr, [
2717
+ (E(!0), _(ue, null, Te(p(k).nodes, (f) => (E(), _("g", {
2718
+ key: f.id,
2719
+ onClick: Jt((v) => l.value.style.chart.nodes.tooltip.showOnClick && zt(f), ["stop"]),
2720
+ onMouseenter: (v) => Yt(f.id),
2721
+ onMouseleave: (v) => Ut(f.id)
2722
+ }, [
2723
+ u.$slots["free-node-label"] ? L("", !0) : (E(), _(ue, { key: 0 }, [
2724
+ u.$slots["node-label"] ? (E(), _("text", {
2725
+ key: 0,
2726
+ x: f.x,
2727
+ y: f.y + l.value.style.chart.nodes.labels.fontSize / 3,
2728
+ "text-anchor": "middle",
2729
+ "font-size": l.value.style.chart.nodes.labels.fontSize,
2730
+ fill: R.value === f.id && l.value.style.chart.nodes.selected.labelColor != null ? l.value.style.chart.nodes.selected.labelColor : f.original.color,
2731
+ "font-weight": l.value.style.chart.nodes.labels.bold ? "bold" : "normal",
2732
+ style: { transition: "fill 0.2s ease-in-out" }
2733
+ }, [
2734
+ O(u.$slots, "node-label", be({ ref_for: !0 }, { node: f, orientation: te.value }), () => [
2735
+ wn(De(f.label), 1)
2736
+ ], !0)
2737
+ ], 8, ei)) : !u.$slots["free-node-label"] && !u.$slots.node ? (E(), _("text", {
2738
+ key: 1,
2739
+ "data-cy-node-label": "",
2740
+ x: f.x,
2741
+ y: f.y + l.value.style.chart.nodes.labels.fontSize / 3,
2742
+ "text-anchor": "middle",
2743
+ "font-size": l.value.style.chart.nodes.labels.fontSize,
2744
+ fill: R.value === f.id && l.value.style.chart.nodes.selected.labelColor != null ? l.value.style.chart.nodes.selected.labelColor : f.original.color,
2745
+ "font-weight": l.value.style.chart.nodes.labels.bold ? "bold" : "normal",
2746
+ style: { transition: "fill 0.2s ease-in-out" },
2747
+ innerHTML: p(xn)({
2748
+ content: f.label,
2749
+ fontSize: l.value.style.chart.nodes.labels.fontSize,
2750
+ fontWeight: l.value.style.chart.nodes.labels.bold ? "bold" : "normal",
2751
+ fill: R.value === f.id && l.value.style.chart.nodes.selected.labelColor != null ? l.value.style.chart.nodes.selected.labelColor : f.original.color,
2752
+ x: f.x,
2753
+ y: f.y,
2754
+ autoOffset: !0
2755
+ })
2756
+ }, null, 8, ti)) : L("", !0)
2757
+ ], 64)),
2758
+ u.$slots["free-node-label"] ? (E(), _("g", oi, [
2759
+ O(u.$slots, "free-node-label", be({ ref_for: !0 }, { node: f, layoutData: p(k), orientation: te.value }), void 0, !0)
2760
+ ])) : L("", !0)
2761
+ ], 40, Qr))), 128))
2762
+ ]),
2763
+ O(u.$slots, "svg", {
2764
+ svg: {
2765
+ drawingArea: p(me),
2766
+ data: p(k),
2767
+ orientation: te.value
2768
+ }
2769
+ }, void 0, !0)
2770
+ ], 14, $r)) : L("", !0),
2771
+ u.$slots.watermark ? (E(), _("div", ni, [
2772
+ O(u.$slots, "watermark", I(H({ isPrinting: p(At) || p(Nt) })), void 0, !0)
2773
+ ])) : L("", !0),
2774
+ it(Qt, { name: "fade" }, {
2775
+ default: z(() => [
2776
+ Ie.value ? (E(), ne(eo, {
2777
+ key: 0,
2778
+ to: ae.value ? m.value : "body"
2779
+ }, [
2780
+ J("div", {
2781
+ "data-cy-tooltip-midpoint": "",
2782
+ ref_key: "tooltipRef",
2783
+ ref: ze,
2784
+ class: "vue-ui-dag-tooltip",
2785
+ style: pe({
2786
+ ...Ve.value,
2787
+ maxWidth: l.value.style.chart.midpoints.tooltip.maxWidth,
2788
+ "--vue-data-ui-dag-tooltip-background": l.value.style.chart.midpoints.tooltip.backgroundColor,
2789
+ "--vue-data-ui-dag-tooltip-color": l.value.style.chart.midpoints.tooltip.color
2790
+ }),
2791
+ "data-position": Ce.value
2792
+ }, [
2793
+ O(u.$slots, "tooltip-midpoint", I(H({ edge: B.value, layoutData: p(k) })), () => [
2794
+ B.value ? (E(), _("div", ri, De(Tt(B.value.from)?.label ?? B.value.from) + " → " + De(Tt(B.value.to)?.label ?? B.value.to), 1)) : L("", !0)
2795
+ ], !0)
2796
+ ], 12, si)
2797
+ ], 8, ["to"])) : L("", !0)
2798
+ ]),
2799
+ _: 3
2800
+ }),
2801
+ it(Qt, { name: "fade" }, {
2802
+ default: z(() => [
2803
+ re.value ? (E(), ne(eo, {
2804
+ key: 0,
2805
+ to: ae.value ? m.value : "body"
2806
+ }, [
2807
+ J("div", {
2808
+ "data-cy-tooltip-node": "",
2809
+ ref_key: "nodeTooltipRef",
2810
+ ref: Ue,
2811
+ class: "vue-ui-dag-node-tooltip",
2812
+ style: pe({
2813
+ maxWidth: l.value.style.chart.nodes.tooltip.maxWidth,
2814
+ left: Ze.value.left,
2815
+ top: Ze.value.top,
2816
+ "--vue-data-ui-dag-node-tooltip-background": l.value.style.chart.nodes.tooltip.backgroundColor,
2817
+ "--vue-data-ui-dag-node-tooltip-color": l.value.style.chart.nodes.tooltip.color
2818
+ }),
2819
+ "data-position": kt.value
2820
+ }, [
2821
+ O(u.$slots, "tooltip-node", I(H({ node: _e.value, layoutData: p(k) })), () => [
2822
+ _e.value ? (E(), _("div", ai, De(_e.value.label), 1)) : L("", !0)
2823
+ ], !0)
2824
+ ], 12, ii)
2825
+ ], 8, ["to"])) : L("", !0)
2826
+ ]),
2827
+ _: 3
2828
+ }),
2829
+ l.value.style.chart.controls.position === "bottom" && !p(Ae) && l.value.style.chart.controls.show ? (E(), ne(no, {
2830
+ key: 7,
2831
+ ref_key: "zoomControls",
2832
+ ref: x,
2833
+ config: l.value,
2834
+ scale: p(Pt),
2835
+ isFullscreen: ae.value,
2836
+ withDirection: "",
2837
+ onZoomIn: Qe,
2838
+ onZoomOut: et,
2839
+ onResetZoom: b[1] || (b[1] = () => p(He)(!0)),
2840
+ onSwitchDirection: ot
2841
+ }, null, 8, ["config", "scale", "isFullscreen"])) : L("", !0),
2842
+ u.$slots.source ? (E(), _("div", {
2843
+ key: 8,
2844
+ ref_key: "source",
2845
+ ref: N,
2846
+ dir: "auto"
2847
+ }, [
2848
+ O(u.$slots, "source", {}, void 0, !0)
2849
+ ], 512)) : L("", !0),
2850
+ p(Ae) ? (E(), ne(On, { key: 9 })) : L("", !0)
2851
+ ], 46, Rr));
2852
+ }
2853
+ }, ci = /* @__PURE__ */ zn(li, [["__scopeId", "data-v-c4f4d8bb"]]), Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2854
+ __proto__: null,
2855
+ default: ci
2856
+ }, Symbol.toStringTag, { value: "Module" }));
2857
+ export {
2858
+ Ai as a,
2859
+ Ni as b,
2860
+ ci as v
2861
+ };