mind-elixir 5.0.4 → 5.0.6

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.
@@ -1,4 +1,4 @@
1
- const J = {
1
+ const Q = {
2
2
  name: "Latte",
3
3
  type: "light",
4
4
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -23,7 +23,7 @@ const J = {
23
23
  "--panel-border-color": "#eaeaea",
24
24
  "--map-padding": "50px"
25
25
  }
26
- }, Q = {
26
+ }, Z = {
27
27
  name: "Dark",
28
28
  type: "dark",
29
29
  palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
@@ -49,25 +49,25 @@ const J = {
49
49
  "--map-padding": "50px 80px"
50
50
  }
51
51
  };
52
- function st(t) {
52
+ function rt(t) {
53
53
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
54
54
  }
55
- const Y = function(t, e) {
55
+ const j = function(t, e) {
56
56
  if (e.id === t)
57
57
  return e;
58
58
  if (e.children && e.children.length) {
59
59
  for (let n = 0; n < e.children.length; n++) {
60
- const o = Y(t, e.children[n]);
60
+ const o = j(t, e.children[n]);
61
61
  if (o)
62
62
  return o;
63
63
  }
64
64
  return null;
65
65
  } else
66
66
  return null;
67
- }, Z = (t, e) => {
67
+ }, tt = (t, e) => {
68
68
  if (t.parent = e, t.children)
69
69
  for (let n = 0; n < t.children.length; n++)
70
- Z(t.children[n], t);
70
+ tt(t.children[n], t);
71
71
  }, K = (t, e, n) => {
72
72
  if (t.expanded = e, t.children)
73
73
  if (n === void 0 || n > 0) {
@@ -80,25 +80,25 @@ const Y = function(t, e) {
80
80
  K(o, !1);
81
81
  });
82
82
  };
83
- function R(t, e, n, o) {
83
+ function z(t, e, n, o) {
84
84
  const i = o - e, s = t - n;
85
85
  let r = Math.atan(Math.abs(i) / Math.abs(s)) / 3.14 * 180;
86
86
  if (isNaN(r))
87
87
  return;
88
88
  s < 0 && i > 0 && (r = 180 - r), s < 0 && i < 0 && (r = 180 + r), s > 0 && i < 0 && (r = 360 - r);
89
- const a = 12, f = 30, d = r + f, p = r - f;
89
+ const l = 12, h = 30, f = r + h, p = r - h;
90
90
  return {
91
- x1: n + Math.cos(Math.PI * d / 180) * a,
92
- y1: o - Math.sin(Math.PI * d / 180) * a,
93
- x2: n + Math.cos(Math.PI * p / 180) * a,
94
- y2: o - Math.sin(Math.PI * p / 180) * a
91
+ x1: n + Math.cos(Math.PI * f / 180) * l,
92
+ y1: o - Math.sin(Math.PI * f / 180) * l,
93
+ x2: n + Math.cos(Math.PI * p / 180) * l,
94
+ y2: o - Math.sin(Math.PI * p / 180) * l
95
95
  };
96
96
  }
97
- function V() {
97
+ function G() {
98
98
  return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
99
99
  }
100
100
  const Et = function() {
101
- const t = V();
101
+ const t = G();
102
102
  return {
103
103
  topic: this.newTopicName,
104
104
  id: t
@@ -108,10 +108,10 @@ const Et = function() {
108
108
  for (; e && e !== t; )
109
109
  n += e.offsetLeft, o += e.offsetTop, e = e.offsetParent;
110
110
  return { offsetLeft: n, offsetTop: o };
111
- }, y = (t, e) => {
111
+ }, v = (t, e) => {
112
112
  for (const n in e)
113
113
  t.setAttribute(n, e[n]);
114
- }, rt = (t) => t ? t.tagName === "ME-TPC" : !1, pt = (t) => {
114
+ }, ct = (t) => t ? t.tagName === "ME-TPC" : !1, pt = (t) => {
115
115
  const e = /translate\(([^,]+),\s*([^)]+)\)/, n = t.match(e);
116
116
  return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
117
117
  }, ut = function(t) {
@@ -127,7 +127,7 @@ const Et = function() {
127
127
  };
128
128
  };
129
129
  var H = /* @__PURE__ */ ((t) => (t.LHS = "lhs", t.RHS = "rhs", t))(H || {});
130
- const ct = function(t, e, n) {
130
+ const lt = function(t, e, n) {
131
131
  const { scaleVal: o, scaleSensitivity: i } = t;
132
132
  switch (e) {
133
133
  case "in":
@@ -138,15 +138,15 @@ const ct = function(t, e, n) {
138
138
  }
139
139
  };
140
140
  function Tt(t) {
141
- const { dragMoveHelper: e } = t, n = (l) => {
142
- var m, w, x;
143
- if (l.button !== 0)
141
+ const { dragMoveHelper: e } = t, n = (a) => {
142
+ var m, x, w;
143
+ if (a.button !== 0)
144
144
  return;
145
145
  if ((m = t.helper1) != null && m.moved) {
146
146
  t.helper1.clear();
147
147
  return;
148
148
  }
149
- if ((w = t.helper2) != null && w.moved) {
149
+ if ((x = t.helper2) != null && x.moved) {
150
150
  t.helper2.clear();
151
151
  return;
152
152
  }
@@ -154,68 +154,68 @@ function Tt(t) {
154
154
  e.clear();
155
155
  return;
156
156
  }
157
- const c = l.target;
157
+ const c = a.target;
158
158
  if (c.tagName === "ME-EPD")
159
- l.ctrlKey || l.metaKey ? t.expandNodeAll(c.previousSibling) : t.expandNode(c.previousSibling);
159
+ a.ctrlKey || a.metaKey ? t.expandNodeAll(c.previousSibling) : t.expandNode(c.previousSibling);
160
160
  else if (c.tagName === "ME-TPC" && t.currentNodes.length > 1)
161
161
  t.selectNode(c);
162
162
  else if (!t.editable)
163
163
  return;
164
- const h = (x = c.parentElement) == null ? void 0 : x.parentElement;
165
- h.getAttribute("class") === "topiclinks" ? t.selectArrow(c.parentElement) : h.getAttribute("class") === "summary" && t.selectSummary(c.parentElement);
166
- }, o = (l) => {
164
+ const d = (w = c.parentElement) == null ? void 0 : w.parentElement;
165
+ d.getAttribute("class") === "topiclinks" ? t.selectArrow(c.parentElement) : d.getAttribute("class") === "summary" && t.selectSummary(c.parentElement);
166
+ }, o = (a) => {
167
167
  var m;
168
168
  if (!t.editable)
169
169
  return;
170
- const c = l.target;
171
- rt(c) && t.beginEdit(c);
172
- const h = (m = c.parentElement) == null ? void 0 : m.parentElement;
173
- h.getAttribute("class") === "topiclinks" ? t.editArrowLabel(c.parentElement) : h.getAttribute("class") === "summary" && t.editSummary(c.parentElement);
170
+ const c = a.target;
171
+ ct(c) && t.beginEdit(c);
172
+ const d = (m = c.parentElement) == null ? void 0 : m.parentElement;
173
+ d.getAttribute("class") === "topiclinks" ? t.editArrowLabel(c.parentElement) : d.getAttribute("class") === "summary" && t.editSummary(c.parentElement);
174
174
  };
175
175
  let i = 0;
176
- const s = (l) => {
177
- if (l.pointerType === "mouse")
176
+ const s = (a) => {
177
+ if (a.pointerType === "mouse")
178
178
  return;
179
- const c = (/* @__PURE__ */ new Date()).getTime(), h = c - i;
180
- h < 300 && h > 0 && o(l), i = c;
181
- }, r = (l) => {
179
+ const c = (/* @__PURE__ */ new Date()).getTime(), d = c - i;
180
+ d < 300 && d > 0 && o(a), i = c;
181
+ }, r = (a) => {
182
182
  e.moved = !1;
183
183
  const c = t.mouseSelectionButton === 0 ? 2 : 0;
184
- if (l.button !== c && l.pointerType === "mouse")
184
+ if (a.button !== c && a.pointerType === "mouse")
185
185
  return;
186
- e.x = l.clientX, e.y = l.clientY;
187
- const h = l.target;
188
- h.className !== "circle" && h.contentEditable !== "plaintext-only" && (e.mousedown = !0, t.map.style.transition = "none", h.setPointerCapture(l.pointerId));
189
- }, a = (l) => {
190
- if (l.target.contentEditable !== "plaintext-only") {
191
- const c = l.clientX - e.x, h = l.clientY - e.y;
192
- e.onMove(c, h);
186
+ e.x = a.clientX, e.y = a.clientY;
187
+ const d = a.target;
188
+ d.className !== "circle" && d.contentEditable !== "plaintext-only" && (e.mousedown = !0, d.setPointerCapture(a.pointerId));
189
+ }, l = (a) => {
190
+ if (a.target.contentEditable !== "plaintext-only") {
191
+ const c = a.clientX - e.x, d = a.clientY - e.y;
192
+ e.onMove(c, d);
193
193
  }
194
- e.x = l.clientX, e.y = l.clientY;
195
- }, f = (l) => {
194
+ e.x = a.clientX, e.y = a.clientY;
195
+ }, h = (a) => {
196
196
  const c = t.mouseSelectionButton === 0 ? 2 : 0;
197
- if (l.button !== c && l.pointerType === "mouse")
197
+ if (a.button !== c && a.pointerType === "mouse")
198
198
  return;
199
- const h = l.target;
200
- h.hasPointerCapture && h.hasPointerCapture(l.pointerId) && h.releasePointerCapture(l.pointerId), e.clear();
201
- }, d = (l) => {
202
- if (l.preventDefault(), l.button !== 2 || !t.editable)
199
+ const d = a.target;
200
+ d.hasPointerCapture && d.hasPointerCapture(a.pointerId) && d.releasePointerCapture(a.pointerId), e.clear();
201
+ }, f = (a) => {
202
+ if (a.preventDefault(), a.button !== 2 || !t.editable)
203
203
  return;
204
- const c = l.target;
205
- rt(c) && !c.classList.contains("selected") && t.selectNode(c), setTimeout(() => {
206
- t.dragMoveHelper.moved || t.bus.fire("showContextMenu", l);
204
+ const c = a.target;
205
+ ct(c) && !c.classList.contains("selected") && t.selectNode(c), setTimeout(() => {
206
+ t.dragMoveHelper.moved || t.bus.fire("showContextMenu", a);
207
207
  }, 200);
208
- }, p = (l) => {
209
- l.stopPropagation(), l.preventDefault(), l.ctrlKey || l.metaKey ? l.deltaY < 0 ? ct(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && ct(t, "out", t.dragMoveHelper) : l.shiftKey ? t.move(-l.deltaY, 0) : (t.map.style.transition = "none", t.move(-l.deltaX, -l.deltaY), t.map.style.transition = "transform 0.3s");
208
+ }, p = (a) => {
209
+ a.stopPropagation(), a.preventDefault(), a.ctrlKey || a.metaKey ? a.deltaY < 0 ? lt(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && lt(t, "out", t.dragMoveHelper) : a.shiftKey ? t.move(-a.deltaY, 0) : t.move(-a.deltaX, -a.deltaY);
210
210
  }, { container: u } = t;
211
211
  return ut([
212
212
  { dom: u, evt: "pointerdown", func: r },
213
- { dom: u, evt: "pointermove", func: a },
214
- { dom: u, evt: "pointerup", func: f },
213
+ { dom: u, evt: "pointermove", func: l },
214
+ { dom: u, evt: "pointerup", func: h },
215
215
  { dom: u, evt: "pointerup", func: s },
216
216
  { dom: u, evt: "click", func: n },
217
217
  { dom: u, evt: "dblclick", func: o },
218
- { dom: u, evt: "contextmenu", func: d },
218
+ { dom: u, evt: "contextmenu", func: f },
219
219
  { dom: u, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : p }
220
220
  ]);
221
221
  }
@@ -264,18 +264,18 @@ const X = document, kt = function() {
264
264
  const i = X.createElement("me-main");
265
265
  i.className = H.RHS;
266
266
  for (let s = 0; s < e.length; s++) {
267
- const r = e[s], { grp: a } = t.createWrapper(r);
268
- t.direction === 2 ? r.direction === 0 ? o.appendChild(a) : i.appendChild(a) : t.direction === 0 ? o.appendChild(a) : i.appendChild(a);
267
+ const r = e[s], { grp: l } = t.createWrapper(r);
268
+ t.direction === 2 ? r.direction === 0 ? o.appendChild(l) : i.appendChild(l) : t.direction === 0 ? o.appendChild(l) : i.appendChild(l);
269
269
  }
270
270
  t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(i), t.nodes.appendChild(t.lines);
271
- }, Mt = function(t, e) {
271
+ }, At = function(t, e) {
272
272
  const n = X.createElement("me-children");
273
273
  for (let o = 0; o < e.length; o++) {
274
274
  const i = e[o], { grp: s } = t.createWrapper(i);
275
275
  n.appendChild(s);
276
276
  }
277
277
  return n;
278
- }, k = document, gt = function(t, e) {
278
+ }, L = document, gt = function(t, e) {
279
279
  const o = (this != null && this.el ? this.el : e || document).querySelector(`[data-nodeid="me${t}"]`);
280
280
  if (!o)
281
281
  throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);
@@ -293,52 +293,52 @@ const X = document, kt = function() {
293
293
  if (e.image) {
294
294
  const n = e.image;
295
295
  if (n.url && n.width && n.height) {
296
- const o = k.createElement("img");
296
+ const o = L.createElement("img");
297
297
  o.src = n.url, o.style.width = n.width + "px", o.style.height = n.height + "px", n.fit && (o.style.objectFit = n.fit), t.appendChild(o), t.image = o;
298
298
  }
299
299
  } else
300
300
  t.image && (t.image = void 0);
301
301
  {
302
- const n = k.createElement("span");
302
+ const n = L.createElement("span");
303
303
  n.className = "text", n.textContent = e.topic, t.appendChild(n), t.text = n;
304
304
  }
305
305
  if (e.hyperLink) {
306
- const n = k.createElement("a");
306
+ const n = L.createElement("a");
307
307
  n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = e.hyperLink, t.appendChild(n), t.link = n;
308
308
  } else
309
309
  t.link && (t.link = void 0);
310
310
  if (e.icons && e.icons.length) {
311
- const n = k.createElement("span");
312
- n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${st(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
311
+ const n = L.createElement("span");
312
+ n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${rt(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
313
313
  } else
314
314
  t.icons && (t.icons = void 0);
315
315
  if (e.tags && e.tags.length) {
316
- const n = k.createElement("div");
317
- n.className = "tags", n.innerHTML = e.tags.map((o) => `<span>${st(o)}</span>`).join(""), t.appendChild(n), t.tags = n;
316
+ const n = L.createElement("div");
317
+ n.className = "tags", n.innerHTML = e.tags.map((o) => `<span>${rt(o)}</span>`).join(""), t.appendChild(n), t.tags = n;
318
318
  } else
319
319
  t.tags && (t.tags = void 0);
320
- }, At = function(t, e) {
321
- const n = k.createElement("me-wrapper"), { p: o, tpc: i } = this.createParent(t);
320
+ }, Mt = function(t, e) {
321
+ const n = L.createElement("me-wrapper"), { p: o, tpc: i } = this.createParent(t);
322
322
  if (n.appendChild(o), !e && t.children && t.children.length > 0) {
323
323
  const s = Bt(t.expanded);
324
324
  if (o.appendChild(s), t.expanded !== !1) {
325
- const r = Mt(this, t.children);
325
+ const r = At(this, t.children);
326
326
  n.appendChild(r);
327
327
  }
328
328
  }
329
329
  return { grp: n, top: o, tpc: i };
330
330
  }, Dt = function(t) {
331
- const e = k.createElement("me-parent"), n = this.createTopic(t);
331
+ const e = L.createElement("me-parent"), n = this.createTopic(t);
332
332
  return mt(n, t), e.appendChild(n), { p: e, tpc: n };
333
333
  }, Nt = function(t) {
334
- const e = k.createElement("me-children");
334
+ const e = L.createElement("me-children");
335
335
  return e.append(...t), e;
336
336
  }, Pt = function(t) {
337
- const e = k.createElement("me-tpc");
337
+ const e = L.createElement("me-tpc");
338
338
  return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e.draggable = this.draggable, e;
339
339
  };
340
- function wt(t) {
341
- const e = k.createRange();
340
+ function xt(t) {
341
+ const e = L.createRange();
342
342
  e.selectNodeContents(t);
343
343
  const n = window.getSelection();
344
344
  n && (n.removeAllRanges(), n.addRange(e));
@@ -346,7 +346,7 @@ function wt(t) {
346
346
  const Ht = function(t) {
347
347
  if (!t)
348
348
  return;
349
- const e = k.createElement("div"), n = t.text.textContent;
349
+ const e = L.createElement("div"), n = t.text.textContent;
350
350
  t.appendChild(e), e.id = "input-box", e.textContent = n, e.contentEditable = "plaintext-only", e.spellcheck = !1;
351
351
  const o = getComputedStyle(t);
352
352
  e.style.cssText = `min-width:${t.offsetWidth - 8}px;
@@ -355,7 +355,7 @@ const Ht = function(t) {
355
355
  margin:${o.margin};
356
356
  font:${o.font};
357
357
  background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
358
- border-radius:${o.borderRadius};`, this.direction === 0 && (e.style.right = "0"), wt(e), this.bus.fire("operation", {
358
+ border-radius:${o.borderRadius};`, this.direction === 0 && (e.style.right = "0"), xt(e), this.bus.fire("operation", {
359
359
  name: "beginEdit",
360
360
  obj: t.nodeObj
361
361
  }), e.addEventListener("keydown", (i) => {
@@ -378,24 +378,32 @@ const Ht = function(t) {
378
378
  }));
379
379
  });
380
380
  }, Bt = function(t) {
381
- const e = k.createElement("me-epd");
381
+ const e = L.createElement("me-epd");
382
382
  return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
383
- }, P = document, T = "http://www.w3.org/2000/svg", xt = function(t, e, n) {
384
- const o = P.createElementNS(T, "path");
385
- return y(o, {
383
+ }, P = document, k = "http://www.w3.org/2000/svg", J = function(t, e, n, o = {}) {
384
+ const { anchor: i = "middle", color: s, dataType: r } = o, l = document.createElementNS(k, "text");
385
+ return v(l, {
386
+ "text-anchor": i,
387
+ x: e + "",
388
+ y: n + "",
389
+ fill: s || (i === "middle" ? "rgb(235, 95, 82)" : "#666")
390
+ }), r && (l.dataset.type = r), l.innerHTML = t, l;
391
+ }, wt = function(t, e, n) {
392
+ const o = P.createElementNS(k, "path");
393
+ return v(o, {
386
394
  d: t,
387
395
  stroke: e || "#666",
388
396
  fill: "none",
389
397
  "stroke-width": n
390
398
  }), o;
391
399
  }, W = function(t) {
392
- const e = P.createElementNS(T, "svg");
400
+ const e = P.createElementNS(k, "svg");
393
401
  return e.setAttribute("class", t), e.setAttribute("overflow", "visible"), e;
394
- }, lt = function() {
395
- const t = P.createElementNS(T, "line");
402
+ }, at = function() {
403
+ const t = P.createElementNS(k, "line");
396
404
  return t.setAttribute("stroke", "#4dc4ff"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t.setAttribute("opacity", "0.45"), t;
397
405
  }, Ot = function(t, e, n, o) {
398
- const i = P.createElementNS(T, "g");
406
+ const i = P.createElementNS(k, "g");
399
407
  return [
400
408
  {
401
409
  name: "line",
@@ -409,22 +417,22 @@ const Ht = function(t) {
409
417
  name: "arrow2",
410
418
  d: n
411
419
  }
412
- ].forEach((r, a) => {
413
- const f = r.d, d = P.createElementNS(T, "path"), p = {
414
- d: f,
420
+ ].forEach((r, l) => {
421
+ const h = r.d, f = P.createElementNS(k, "path"), p = {
422
+ d: h,
415
423
  stroke: (o == null ? void 0 : o.stroke) || "rgb(235, 95, 82)",
416
424
  fill: "none",
417
425
  "stroke-linecap": (o == null ? void 0 : o.strokeLinecap) || "cap",
418
426
  "stroke-width": String((o == null ? void 0 : o.strokeWidth) || "2")
419
427
  };
420
- (o == null ? void 0 : o.opacity) !== void 0 && (p.opacity = String(o.opacity)), y(d, p), a === 0 && d.setAttribute("stroke-dasharray", (o == null ? void 0 : o.strokeDasharray) || "8,2");
421
- const u = P.createElementNS(T, "path");
422
- y(u, {
423
- d: f,
428
+ (o == null ? void 0 : o.opacity) !== void 0 && (p.opacity = String(o.opacity)), v(f, p), l === 0 && f.setAttribute("stroke-dasharray", (o == null ? void 0 : o.strokeDasharray) || "8,2");
429
+ const u = P.createElementNS(k, "path");
430
+ v(u, {
431
+ d: h,
424
432
  stroke: "transparent",
425
433
  fill: "none",
426
434
  "stroke-width": "15"
427
- }), i.appendChild(u), i.appendChild(d), i[r.name] = d;
435
+ }), i.appendChild(u), i.appendChild(f), i[r.name] = f;
428
436
  }), i;
429
437
  }, yt = function(t, e, n) {
430
438
  if (!e)
@@ -441,19 +449,19 @@ const Ht = function(t) {
441
449
  top:${s.y}px;
442
450
  padding: 2px 4px;
443
451
  margin: -2px -4px;
444
- `, wt(o), t.scrollIntoView(o), o.addEventListener("keydown", (r) => {
452
+ `, xt(o), t.scrollIntoView(o), o.addEventListener("keydown", (r) => {
445
453
  r.stopPropagation();
446
- const a = r.key;
447
- if (a === "Enter" || a === "Tab") {
454
+ const l = r.key;
455
+ if (l === "Enter" || l === "Tab") {
448
456
  if (r.shiftKey)
449
457
  return;
450
458
  r.preventDefault(), o.blur(), t.container.focus();
451
459
  }
452
460
  }), o.addEventListener("blur", () => {
453
- var a;
461
+ var l;
454
462
  if (!o)
455
463
  return;
456
- const r = ((a = o.textContent) == null ? void 0 : a.trim()) || "";
464
+ const r = ((l = o.textContent) == null ? void 0 : l.trim()) || "";
457
465
  r === "" ? n.label = i : n.label = r, o.remove(), r !== i && (e.innerHTML = n.label, t.linkDiv(), "parent" in n ? t.bus.fire("operation", {
458
466
  name: "finishEditSummary",
459
467
  obj: n
@@ -465,43 +473,43 @@ const Ht = function(t) {
465
473
  }, Wt = function(t) {
466
474
  const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, i = e.offsetWidth, s = e.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
467
475
  this.lines.innerHTML = "";
468
- for (let a = 0; a < r.length; a++) {
469
- const f = r[a], d = f.querySelector("me-tpc"), { offsetLeft: p, offsetTop: u } = D(this.nodes, d), g = d.offsetWidth, l = d.offsetHeight, c = f.parentNode.className, h = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: u, cL: p, cW: g, cH: l, direction: c, containerHeight: this.nodes.offsetHeight }), m = this.theme.palette, w = d.nodeObj.branchColor || m[a % m.length];
470
- if (d.style.borderColor = w, this.lines.appendChild(xt(h, w, "3")), t && t !== f)
476
+ for (let l = 0; l < r.length; l++) {
477
+ const h = r[l], f = h.querySelector("me-tpc"), { offsetLeft: p, offsetTop: u } = D(this.nodes, f), g = f.offsetWidth, a = f.offsetHeight, c = h.parentNode.className, d = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: u, cL: p, cW: g, cH: a, direction: c, containerHeight: this.nodes.offsetHeight }), m = this.theme.palette, x = f.nodeObj.branchColor || m[l % m.length];
478
+ if (f.style.borderColor = x, this.lines.appendChild(wt(d, x, "3")), t && t !== h)
471
479
  continue;
472
- const x = W("subLines"), v = f.lastChild;
473
- v.tagName === "svg" && v.remove(), f.appendChild(x), vt(this, x, w, f, c, !0);
480
+ const w = W("subLines"), y = h.lastChild;
481
+ y.tagName === "svg" && y.remove(), h.appendChild(w), vt(this, w, x, h, c, !0);
474
482
  }
475
483
  this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
476
484
  }, vt = function(t, e, n, o, i, s) {
477
- const r = o.firstChild, a = o.children[1].children;
478
- if (a.length === 0)
485
+ const r = o.firstChild, l = o.children[1].children;
486
+ if (l.length === 0)
479
487
  return;
480
- const f = r.offsetTop, d = r.offsetLeft, p = r.offsetWidth, u = r.offsetHeight;
481
- for (let g = 0; g < a.length; g++) {
482
- const l = a[g], c = l.firstChild, h = c.offsetTop, m = c.offsetLeft, w = c.offsetWidth, x = c.offsetHeight, v = c.firstChild.nodeObj.branchColor || n, S = t.generateSubBranch({ pT: f, pL: d, pW: p, pH: u, cT: h, cL: m, cW: w, cH: x, direction: i, isFirst: s });
483
- e.appendChild(xt(S, v, "2"));
488
+ const h = r.offsetTop, f = r.offsetLeft, p = r.offsetWidth, u = r.offsetHeight;
489
+ for (let g = 0; g < l.length; g++) {
490
+ const a = l[g], c = a.firstChild, d = c.offsetTop, m = c.offsetLeft, x = c.offsetWidth, w = c.offsetHeight, y = c.firstChild.nodeObj.branchColor || n, S = t.generateSubBranch({ pT: h, pL: f, pW: p, pH: u, cT: d, cL: m, cW: x, cH: w, direction: i, isFirst: s });
491
+ e.appendChild(wt(S, y, "2"));
484
492
  const E = c.children[1];
485
493
  if (E) {
486
494
  if (!E.expanded)
487
495
  continue;
488
496
  } else
489
497
  continue;
490
- vt(t, e, v, l, i);
498
+ vt(t, e, y, a, i);
491
499
  }
492
500
  };
493
- const Vt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>', Gt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>', It = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>', Ft = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>', jt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>', zt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>', Yt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>';
494
- const Rt = {
495
- side: Vt,
496
- left: Gt,
497
- right: It,
501
+ const Gt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>', It = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>', Vt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>', Ft = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>', Rt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>', Yt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>', jt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>';
502
+ const zt = {
503
+ side: Gt,
504
+ left: It,
505
+ right: Vt,
498
506
  full: Ft,
499
- living: jt,
500
- zoomin: zt,
501
- zoomout: Yt
507
+ living: Rt,
508
+ zoomin: Yt,
509
+ zoomout: jt
502
510
  }, N = (t, e) => {
503
511
  const n = document.createElement("span");
504
- return n.id = t, n.innerHTML = Rt[e], n;
512
+ return n.id = t, n.innerHTML = zt[e], n;
505
513
  };
506
514
  function Xt(t) {
507
515
  const e = document.createElement("div"), n = N("fullscreen", "full"), o = N("toCenter", "living"), i = N("zoomout", "zoomout"), s = N("zoomin", "zoomin"), r = document.createElement("span");
@@ -531,7 +539,7 @@ function _t(t) {
531
539
  const Ut = function(t, e = !0) {
532
540
  this.theme = t;
533
541
  const o = {
534
- ...(t.type === "dark" ? Q : J).cssVar,
542
+ ...(t.type === "dark" ? Z : Q).cssVar,
535
543
  ...t.cssVar
536
544
  }, i = Object.keys(o);
537
545
  for (let s = 0; s < i.length; s++) {
@@ -555,8 +563,8 @@ function Jt(t) {
555
563
  const Qt = function(t) {
556
564
  const e = this.container, n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
557
565
  if (n.top > o.bottom || n.bottom < o.top || n.left > o.right || n.right < o.left) {
558
- const s = n.left + n.width / 2, r = n.top + n.height / 2, a = o.left + o.width / 2, f = o.top + o.height / 2, d = s - a, p = r - f;
559
- this.move(-d, -p);
566
+ const s = n.left + n.width / 2, r = n.top + n.height / 2, l = o.left + o.width / 2, h = o.top + o.height / 2, f = s - l, p = r - h;
567
+ this.move(-f, -p, !0);
560
568
  }
561
569
  }, Zt = function(t, e, n) {
562
570
  this.clearSelection(), this.scrollIntoView(t), this.selection.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
@@ -581,19 +589,21 @@ const Qt = function(t) {
581
589
  }, ce = function(t, e = { x: 0, y: 0 }) {
582
590
  if (t < this.scaleMin || t > this.scaleMax)
583
591
  return;
584
- const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, i = e.y ? e.y - n.top - n.height / 2 : 0, { dx: s, dy: r } = bt(this), a = this.map.style.transform, { x: f, y: d } = pt(a), p = f - s, u = d - r, g = this.scaleVal, l = (-o + p) * (1 - t / g), c = (-i + u) * (1 - t / g);
585
- this.map.style.transform = `translate(${f - l}px, ${d - c}px) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
592
+ const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, i = e.y ? e.y - n.top - n.height / 2 : 0, { dx: s, dy: r } = bt(this), l = this.map.style.transform, { x: h, y: f } = pt(l), p = h - s, u = f - r, g = this.scaleVal, a = (-o + p) * (1 - t / g), c = (-i + u) * (1 - t / g);
593
+ this.map.style.transform = `translate(${h - a}px, ${f - c}px) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
586
594
  }, le = function() {
587
595
  const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
588
596
  this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
589
- }, ae = function(t, e) {
590
- const { map: n, scaleVal: o, bus: i } = this, s = n.style.transform;
591
- let { x: r, y: a } = pt(s);
592
- r += t, a += e, n.style.transform = `translate(${r}px, ${a}px) scale(${o})`, i.fire("move", { dx: t, dy: e });
597
+ }, ae = function(t, e, n = !1) {
598
+ const { map: o, scaleVal: i, bus: s } = this, r = o.style.transform;
599
+ let { x: l, y: h } = pt(r);
600
+ l += t, h += e, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
601
+ o.style.transition = "none";
602
+ }, 300)), o.style.transform = `translate(${l}px, ${h}px) scale(${i})`, s.fire("move", { dx: t, dy: e });
593
603
  }, bt = (t) => {
594
- const { container: e, map: n, nodes: o } = t, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft, a = i.offsetWidth, f = i.offsetHeight;
595
- let d, p;
596
- return t.alignment === "root" ? (d = e.offsetWidth / 2 - r - a / 2, p = e.offsetHeight / 2 - s - f / 2, n.style.transformOrigin = `${r + a / 2}px 50%`) : (d = (e.offsetWidth - o.offsetWidth) / 2, p = (e.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: d, dy: p };
604
+ const { container: e, map: n, nodes: o } = t, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft, l = i.offsetWidth, h = i.offsetHeight;
605
+ let f, p;
606
+ return t.alignment === "root" ? (f = e.offsetWidth / 2 - r - l / 2, p = e.offsetHeight / 2 - s - h / 2, n.style.transformOrigin = `${r + l / 2}px 50%`) : (f = (e.offsetWidth - o.offsetWidth) / 2, p = (e.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: f, dy: p };
597
607
  }, he = function() {
598
608
  const { map: t } = this, { dx: e, dy: n } = bt(this);
599
609
  t.style.transform = `translate(${e}px, ${n}px) scale(${this.scaleVal})`;
@@ -609,34 +619,48 @@ const Qt = function(t) {
609
619
  this.direction = 1, this.refresh(), this.toCenter();
610
620
  }, me = function() {
611
621
  this.direction = 2, this.refresh(), this.toCenter();
612
- }, we = function(t) {
622
+ }, xe = function(t) {
613
623
  this.locale = t, this.refresh();
614
- }, xe = function(t, e) {
624
+ }, we = function(t, e) {
615
625
  const n = t.nodeObj;
616
626
  typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
617
- const o = t.parentNode, i = o.children[1];
618
- if (i.expanded = n.expanded, i.className = n.expanded ? "minus" : "", Kt(t), n.expanded) {
619
- const f = this.createChildren(
620
- n.children.map((d) => this.createWrapper(d).grp)
627
+ const o = t.getBoundingClientRect(), i = {
628
+ x: o.left,
629
+ y: o.top
630
+ }, s = t.parentNode, r = s.children[1];
631
+ if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", Kt(t), n.expanded) {
632
+ const u = this.createChildren(
633
+ n.children.map((g) => this.createWrapper(g).grp)
621
634
  );
622
- o.parentNode.appendChild(f);
635
+ s.parentNode.appendChild(u);
623
636
  } else
624
- o.parentNode.children[1].remove();
637
+ s.parentNode.children[1].remove();
625
638
  this.linkDiv(t.closest("me-main > me-wrapper"));
626
- const s = t.getBoundingClientRect(), r = this.container.getBoundingClientRect();
627
- (s.bottom > r.bottom || s.top < r.top || s.right > r.right || s.left < r.left) && this.scrollIntoView(t), this.bus.fire("expandNode", n);
639
+ const l = t.getBoundingClientRect(), h = {
640
+ x: l.left,
641
+ y: l.top
642
+ }, f = i.x - h.x, p = i.y - h.y;
643
+ this.move(f, p), this.bus.fire("expandNode", n);
628
644
  }, ye = function(t, e) {
629
- const n = t.nodeObj;
645
+ const n = t.nodeObj, o = t.getBoundingClientRect(), i = {
646
+ x: o.left,
647
+ y: o.top
648
+ };
630
649
  K(n, e ?? !n.expanded), this.refresh();
650
+ const s = this.findEle(n.id).getBoundingClientRect(), r = {
651
+ x: s.left,
652
+ y: s.top
653
+ }, l = i.x - r.x, h = i.y - r.y;
654
+ this.move(l, h);
631
655
  }, ve = function(t) {
632
- t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || [], t.theme && this.changeTheme(t.theme)), Z(this.nodeData), this.layout(), this.linkDiv();
656
+ this.clearSelection(), t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || [], t.theme && this.changeTheme(t.theme)), tt(this.nodeData), this.layout(), this.linkDiv();
633
657
  }, be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
634
658
  __proto__: null,
635
659
  cancelFocus: pe,
636
660
  clearSelection: ne,
637
661
  disableEdit: re,
638
662
  enableEdit: se,
639
- expandNode: xe,
663
+ expandNode: we,
640
664
  expandNodeAll: ye,
641
665
  focusNode: fe,
642
666
  getData: ie,
@@ -652,7 +676,7 @@ const Qt = function(t) {
652
676
  scrollIntoView: Qt,
653
677
  selectNode: Zt,
654
678
  selectNodes: te,
655
- setLocale: we,
679
+ setLocale: xe,
656
680
  toCenter: he,
657
681
  unselectNodes: ee
658
682
  }, Symbol.toStringTag, { value: "Module" })), Ce = function(t) {
@@ -690,58 +714,58 @@ const Qt = function(t) {
690
714
  this.moved = !1, this.pointerdown = !1;
691
715
  }
692
716
  };
693
- }, at = {
717
+ }, ht = {
694
718
  create: Ce
695
719
  }, Se = "#4dc4ff";
696
- function Ct(t, e, n, o, i, s, r, a) {
720
+ function Ct(t, e, n, o, i, s, r, l) {
697
721
  return {
698
722
  x: t / 8 + n * 3 / 8 + i * 3 / 8 + r / 8,
699
- y: e / 8 + o * 3 / 8 + s * 3 / 8 + a / 8
723
+ y: e / 8 + o * 3 / 8 + s * 3 / 8 + l / 8
700
724
  };
701
725
  }
702
726
  function Ee(t, e, n) {
703
- y(t, {
727
+ v(t, {
704
728
  x: e + "",
705
729
  y: n + ""
706
730
  });
707
731
  }
708
732
  function F(t, e, n, o, i) {
709
- y(t, {
733
+ v(t, {
710
734
  x1: e + "",
711
735
  y1: n + "",
712
736
  x2: o + "",
713
737
  y2: i + ""
714
738
  });
715
739
  }
716
- function ht(t, e, n, o, i, s, r, a, f, d) {
717
- var l;
718
- if (t.line.setAttribute("d", `M ${e} ${n} C ${o} ${i} ${s} ${r} ${a} ${f}`), d.style) {
719
- const c = d.style;
740
+ function dt(t, e, n, o, i, s, r, l, h, f) {
741
+ var a;
742
+ if (t.line.setAttribute("d", `M ${e} ${n} C ${o} ${i} ${s} ${r} ${l} ${h}`), f.style) {
743
+ const c = f.style;
720
744
  c.stroke && t.line.setAttribute("stroke", c.stroke), c.strokeWidth && t.line.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeDasharray && t.line.setAttribute("stroke-dasharray", c.strokeDasharray), c.strokeLinecap && t.line.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && t.line.setAttribute("opacity", String(c.opacity));
721
745
  }
722
- const p = R(s, r, a, f);
723
- if (p && (t.arrow1.setAttribute("d", `M ${p.x1} ${p.y1} L ${a} ${f} L ${p.x2} ${p.y2}`), d.style)) {
724
- const c = d.style;
746
+ const p = z(s, r, l, h);
747
+ if (p && (t.arrow1.setAttribute("d", `M ${p.x1} ${p.y1} L ${l} ${h} L ${p.x2} ${p.y2}`), f.style)) {
748
+ const c = f.style;
725
749
  c.stroke && t.arrow1.setAttribute("stroke", c.stroke), c.strokeWidth && t.arrow1.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeLinecap && t.arrow1.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && t.arrow1.setAttribute("opacity", String(c.opacity));
726
750
  }
727
- if (d.bidirectional) {
728
- const c = R(o, i, e, n);
729
- if (c && (t.arrow2.setAttribute("d", `M ${c.x1} ${c.y1} L ${e} ${n} L ${c.x2} ${c.y2}`), d.style)) {
730
- const h = d.style;
731
- h.stroke && t.arrow2.setAttribute("stroke", h.stroke), h.strokeWidth && t.arrow2.setAttribute("stroke-width", String(h.strokeWidth)), h.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", h.strokeLinecap), h.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(h.opacity));
751
+ if (f.bidirectional) {
752
+ const c = z(o, i, e, n);
753
+ if (c && (t.arrow2.setAttribute("d", `M ${c.x1} ${c.y1} L ${e} ${n} L ${c.x2} ${c.y2}`), f.style)) {
754
+ const d = f.style;
755
+ d.stroke && t.arrow2.setAttribute("stroke", d.stroke), d.strokeWidth && t.arrow2.setAttribute("stroke-width", String(d.strokeWidth)), d.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", d.strokeLinecap), d.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(d.opacity));
732
756
  }
733
757
  }
734
- const { x: u, y: g } = Ct(e, n, o, i, s, r, a, f);
735
- Ee(t.label, u, g), (l = d.style) != null && l.labelColor && t.label.setAttribute("fill", d.style.labelColor), Pe(t);
758
+ const { x: u, y: g } = Ct(e, n, o, i, s, r, l, h);
759
+ Ee(t.label, u, g), (a = f.style) != null && a.labelColor && t.label.setAttribute("fill", f.style.labelColor), Ne(t);
736
760
  }
737
761
  function q(t, e, n) {
738
- const { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = e.offsetWidth, r = e.offsetHeight, a = o + s / 2, f = i + r / 2, d = a + n.x, p = f + n.y;
762
+ const { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = e.offsetWidth, r = e.offsetHeight, l = o + s / 2, h = i + r / 2, f = l + n.x, p = h + n.y;
739
763
  return {
740
764
  w: s,
741
765
  h: r,
742
- cx: a,
743
- cy: f,
744
- ctrlX: d,
766
+ cx: l,
767
+ cy: h,
768
+ ctrlX: f,
745
769
  ctrlY: p
746
770
  };
747
771
  }
@@ -753,34 +777,30 @@ function B(t) {
753
777
  y: n
754
778
  };
755
779
  }
756
- const Te = function(t, e, n, o) {
757
- const i = document.createElementNS(T, "text");
758
- return y(i, {
759
- "text-anchor": "middle",
760
- x: e + "",
761
- y: n + "",
762
- fill: o || "rgb(235, 95, 82)"
763
- }), i.dataset.type = "custom-link", i.innerHTML = t, i;
764
- }, tt = function(t, e, n, o, i) {
780
+ const et = function(t, e, n, o, i) {
765
781
  var C;
766
782
  if (!e || !n)
767
783
  return;
768
- const s = q(t, e, o.delta1), r = q(t, n, o.delta2), { x: a, y: f } = B(s), { ctrlX: d, ctrlY: p } = s, { ctrlX: u, ctrlY: g } = r, { x: l, y: c } = B(r), h = R(u, g, l, c);
769
- if (!h)
784
+ const s = q(t, e, o.delta1), r = q(t, n, o.delta2), { x: l, y: h } = B(s), { ctrlX: f, ctrlY: p } = s, { ctrlX: u, ctrlY: g } = r, { x: a, y: c } = B(r), d = z(u, g, a, c);
785
+ if (!d)
770
786
  return;
771
- const m = `M ${h.x1} ${h.y1} L ${l} ${c} L ${h.x2} ${h.y2}`;
772
- let w = "";
787
+ const m = `M ${d.x1} ${d.y1} L ${a} ${c} L ${d.x2} ${d.y2}`;
788
+ let x = "";
773
789
  if (o.bidirectional) {
774
- const $ = R(d, p, a, f);
790
+ const $ = z(f, p, l, h);
775
791
  if (!$)
776
792
  return;
777
- w = `M ${$.x1} ${$.y1} L ${a} ${f} L ${$.x2} ${$.y2}`;
793
+ x = `M ${$.x1} ${$.y1} L ${l} ${h} L ${$.x2} ${$.y2}`;
778
794
  }
779
- const x = Ot(`M ${a} ${f} C ${d} ${p} ${u} ${g} ${l} ${c}`, m, w, o.style), { x: v, y: S } = Ct(a, f, d, p, u, g, l, c), E = (C = o.style) == null ? void 0 : C.labelColor, b = Te(o.label, v, S, E);
780
- x.appendChild(b), x.label = b, x.arrowObj = o, x.dataset.linkid = o.id, t.linkSvgGroup.appendChild(x), i || (t.arrows.push(o), t.currentArrow = x, St(t, o, s, r));
781
- }, Le = function(t, e, n = {}) {
795
+ const w = Ot(`M ${l} ${h} C ${f} ${p} ${u} ${g} ${a} ${c}`, m, x, o.style), { x: y, y: S } = Ct(l, h, f, p, u, g, a, c), E = (C = o.style) == null ? void 0 : C.labelColor, b = J(o.label, y, S, {
796
+ anchor: "middle",
797
+ color: E,
798
+ dataType: "custom-link"
799
+ });
800
+ w.appendChild(b), w.label = b, w.arrowObj = o, w.dataset.linkid = o.id, t.linkSvgGroup.appendChild(w), i || (t.arrows.push(o), t.currentArrow = w, St(t, o, s, r));
801
+ }, Te = function(t, e, n = {}) {
782
802
  const o = {
783
- id: V(),
803
+ id: G(),
784
804
  label: "Custom Link",
785
805
  from: t.nodeObj.id,
786
806
  to: e.nodeObj.id,
@@ -794,18 +814,18 @@ const Te = function(t, e, n, o) {
794
814
  },
795
815
  ...n
796
816
  };
797
- tt(this, t, e, o), this.bus.fire("operation", {
817
+ et(this, t, e, o), this.bus.fire("operation", {
798
818
  name: "createArrow",
799
819
  obj: o
800
820
  });
801
- }, ke = function(t) {
821
+ }, Le = function(t) {
802
822
  _(this);
803
- const e = { ...t, id: V() };
804
- tt(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
823
+ const e = { ...t, id: G() };
824
+ et(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
805
825
  name: "createArrow",
806
826
  obj: e
807
827
  });
808
- }, $e = function(t) {
828
+ }, ke = function(t) {
809
829
  let e;
810
830
  if (t ? e = t : e = this.currentArrow, !e)
811
831
  return;
@@ -817,15 +837,15 @@ const Te = function(t, e, n, o) {
817
837
  id: n
818
838
  }
819
839
  });
820
- }, Me = function(t) {
840
+ }, $e = function(t) {
821
841
  this.currentArrow = t;
822
842
  const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), i = q(this, n, e.delta1), s = q(this, o, e.delta2);
823
843
  St(this, e, i, s);
824
844
  }, Ae = function() {
825
845
  _(this), this.currentArrow = null;
826
846
  }, U = function(t, e) {
827
- const n = document.createElementNS(T, "path");
828
- return y(n, {
847
+ const n = document.createElementNS(k, "path");
848
+ return v(n, {
829
849
  d: t,
830
850
  stroke: e,
831
851
  fill: "none",
@@ -833,8 +853,8 @@ const Te = function(t, e, n, o) {
833
853
  "stroke-linecap": "round",
834
854
  "stroke-linejoin": "round"
835
855
  }), n;
836
- }, De = function(t, e) {
837
- const n = document.createElementNS(T, "g");
856
+ }, Me = function(t, e) {
857
+ const n = document.createElementNS(k, "g");
838
858
  n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
839
859
  const o = U(t.line.getAttribute("d"), e);
840
860
  n.appendChild(o);
@@ -844,10 +864,10 @@ const Te = function(t, e, n, o) {
844
864
  n.appendChild(s);
845
865
  }
846
866
  t.insertBefore(n, t.firstChild);
847
- }, Ne = function(t) {
867
+ }, De = function(t) {
848
868
  const e = t.querySelector(".arrow-highlight");
849
869
  e && e.remove();
850
- }, Pe = function(t) {
870
+ }, Ne = function(t) {
851
871
  const e = t.querySelector(".arrow-highlight");
852
872
  if (!e)
853
873
  return;
@@ -855,62 +875,62 @@ const Te = function(t, e, n, o) {
855
875
  n.length >= 1 && n[0].setAttribute("d", t.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", t.arrow1.getAttribute("d")), n.length >= 3 && t.arrow2.getAttribute("d") && n[2].setAttribute("d", t.arrow2.getAttribute("d"));
856
876
  }, _ = function(t) {
857
877
  var e, n;
858
- (e = t.helper1) == null || e.destroy(), (n = t.helper2) == null || n.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && Ne(t.currentArrow);
878
+ (e = t.helper1) == null || e.destroy(), (n = t.helper2) == null || n.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && De(t.currentArrow);
859
879
  }, St = function(t, e, n, o) {
860
- const { linkController: i, P2: s, P3: r, line1: a, line2: f, nodes: d, map: p, currentArrow: u, bus: g } = t;
880
+ const { linkController: i, P2: s, P3: r, line1: l, line2: h, nodes: f, map: p, currentArrow: u, bus: g } = t;
861
881
  if (!u)
862
882
  return;
863
- i.style.display = "initial", s.style.display = "initial", r.style.display = "initial", d.appendChild(i), d.appendChild(s), d.appendChild(r), De(u, Se);
864
- let { x: l, y: c } = B(n), { ctrlX: h, ctrlY: m } = n, { ctrlX: w, ctrlY: x } = o, { x: v, y: S } = B(o);
865
- s.style.cssText = `top:${m}px;left:${h}px;`, r.style.cssText = `top:${x}px;left:${w}px;`, F(a, l, c, h, m), F(f, w, x, v, S), t.helper1 = at.create(s), t.helper2 = at.create(r), t.helper1.init(p, (E, b) => {
866
- h = h + E / t.scaleVal, m = m + b / t.scaleVal;
867
- const C = B({ ...n, ctrlX: h, ctrlY: m });
868
- l = C.x, c = C.y, s.style.top = m + "px", s.style.left = h + "px", ht(u, l, c, h, m, w, x, v, S, e), F(a, l, c, h, m), e.delta1.x = h - n.cx, e.delta1.y = m - n.cy, g.fire("updateArrowDelta", e);
883
+ i.style.display = "initial", s.style.display = "initial", r.style.display = "initial", f.appendChild(i), f.appendChild(s), f.appendChild(r), Me(u, Se);
884
+ let { x: a, y: c } = B(n), { ctrlX: d, ctrlY: m } = n, { ctrlX: x, ctrlY: w } = o, { x: y, y: S } = B(o);
885
+ s.style.cssText = `top:${m}px;left:${d}px;`, r.style.cssText = `top:${w}px;left:${x}px;`, F(l, a, c, d, m), F(h, x, w, y, S), t.helper1 = ht.create(s), t.helper2 = ht.create(r), t.helper1.init(p, (E, b) => {
886
+ d = d + E / t.scaleVal, m = m + b / t.scaleVal;
887
+ const C = B({ ...n, ctrlX: d, ctrlY: m });
888
+ a = C.x, c = C.y, s.style.top = m + "px", s.style.left = d + "px", dt(u, a, c, d, m, x, w, y, S, e), F(l, a, c, d, m), e.delta1.x = d - n.cx, e.delta1.y = m - n.cy, g.fire("updateArrowDelta", e);
869
889
  }), t.helper2.init(p, (E, b) => {
870
- w = w + E / t.scaleVal, x = x + b / t.scaleVal;
871
- const C = B({ ...o, ctrlX: w, ctrlY: x });
872
- v = C.x, S = C.y, r.style.top = x + "px", r.style.left = w + "px", ht(u, l, c, h, m, w, x, v, S, e), F(f, w, x, v, S), e.delta2.x = w - o.cx, e.delta2.y = x - o.cy, g.fire("updateArrowDelta", e);
890
+ x = x + E / t.scaleVal, w = w + b / t.scaleVal;
891
+ const C = B({ ...o, ctrlX: x, ctrlY: w });
892
+ y = C.x, S = C.y, r.style.top = w + "px", r.style.left = x + "px", dt(u, a, c, d, m, x, w, y, S, e), F(h, x, w, y, S), e.delta2.x = x - o.cx, e.delta2.y = w - o.cy, g.fire("updateArrowDelta", e);
873
893
  });
874
894
  };
875
- function He() {
895
+ function Pe() {
876
896
  this.linkSvgGroup.innerHTML = "";
877
897
  for (let t = 0; t < this.arrows.length; t++) {
878
898
  const e = this.arrows[t];
879
899
  try {
880
- tt(this, this.findEle(e.from), this.findEle(e.to), e, !0);
900
+ et(this, this.findEle(e.from), this.findEle(e.to), e, !0);
881
901
  } catch {
882
902
  }
883
903
  }
884
904
  this.nodes.appendChild(this.linkSvgGroup);
885
905
  }
886
- function Be(t) {
906
+ function He(t) {
887
907
  if (_(this), !t)
888
908
  return;
889
909
  const e = t.label;
890
910
  yt(this, e, t.arrowObj);
891
911
  }
892
- function Oe() {
893
- this.arrows = this.arrows.filter((t) => Y(t.from, this.nodeData) && Y(t.to, this.nodeData));
912
+ function Be() {
913
+ this.arrows = this.arrows.filter((t) => j(t.from, this.nodeData) && j(t.to, this.nodeData));
894
914
  }
895
- const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
915
+ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
896
916
  __proto__: null,
897
- createArrow: Le,
898
- createArrowFrom: ke,
899
- editArrowLabel: Be,
900
- removeArrow: $e,
901
- renderArrow: He,
902
- selectArrow: Me,
903
- tidyArrow: Oe,
917
+ createArrow: Te,
918
+ createArrowFrom: Le,
919
+ editArrowLabel: He,
920
+ removeArrow: ke,
921
+ renderArrow: Pe,
922
+ selectArrow: $e,
923
+ tidyArrow: Be,
904
924
  unselectArrow: Ae
905
- }, Symbol.toStringTag, { value: "Module" })), Ve = function(t) {
906
- var f, d;
925
+ }, Symbol.toStringTag, { value: "Module" })), We = function(t) {
926
+ var h, f;
907
927
  if (t.length === 0)
908
928
  throw new Error("No selected node.");
909
929
  if (t.length === 1) {
910
930
  const p = t[0].nodeObj, u = t[0].nodeObj.parent;
911
931
  if (!u)
912
932
  throw new Error("Can not select root node.");
913
- const g = u.children.findIndex((l) => p === l);
933
+ const g = u.children.findIndex((a) => p === a);
914
934
  return {
915
935
  parent: u.id,
916
936
  start: g,
@@ -922,80 +942,72 @@ const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
922
942
  let u = p.nodeObj;
923
943
  const g = [];
924
944
  for (; u.parent; ) {
925
- const l = u.parent, c = l.children, h = c == null ? void 0 : c.indexOf(u);
926
- u = l, g.unshift({ node: u, index: h });
945
+ const a = u.parent, c = a.children, d = c == null ? void 0 : c.indexOf(u);
946
+ u = a, g.unshift({ node: u, index: d });
927
947
  }
928
948
  return g.length > e && (e = g.length), g;
929
949
  });
930
950
  let o = 0;
931
951
  t:
932
952
  for (; o < e; o++) {
933
- const p = (f = n[0][o]) == null ? void 0 : f.node;
953
+ const p = (h = n[0][o]) == null ? void 0 : h.node;
934
954
  for (let u = 1; u < n.length; u++)
935
- if (((d = n[u][o]) == null ? void 0 : d.node) !== p)
955
+ if (((f = n[u][o]) == null ? void 0 : f.node) !== p)
936
956
  break t;
937
957
  }
938
958
  if (!o)
939
959
  throw new Error("Can not select root node.");
940
- const i = n.map((p) => p[o - 1].index).sort(), s = i[0] || 0, r = i[i.length - 1] || 0, a = n[0][o - 1].node;
941
- if (!a.parent)
960
+ const i = n.map((p) => p[o - 1].index).sort(), s = i[0] || 0, r = i[i.length - 1] || 0, l = n[0][o - 1].node;
961
+ if (!l.parent)
942
962
  throw new Error("Please select nodes in the same main topic.");
943
963
  return {
944
- parent: a.id,
964
+ parent: l.id,
945
965
  start: s,
946
966
  end: r
947
967
  };
948
968
  }, Ge = function(t) {
949
- const e = document.createElementNS(T, "g");
969
+ const e = document.createElementNS(k, "g");
950
970
  return e.setAttribute("id", t), e;
951
- }, dt = function(t, e) {
952
- const n = document.createElementNS(T, "path");
953
- return y(n, {
971
+ }, ft = function(t, e) {
972
+ const n = document.createElementNS(k, "path");
973
+ return v(n, {
954
974
  d: t,
955
975
  stroke: e || "#666",
956
976
  fill: "none",
957
977
  "stroke-linecap": "round",
958
978
  "stroke-width": "2"
959
979
  }), n;
960
- }, ft = function(t, e, n, o, i) {
961
- const s = document.createElementNS(T, "text");
962
- return y(s, {
963
- "text-anchor": o,
964
- x: e + "",
965
- y: n + "",
966
- fill: i || "#666"
967
- }), s.innerHTML = t, s;
968
- }, Ie = (t) => t.parentElement.parentElement, Fe = function(t, { parent: e, start: n }) {
980
+ }, Ie = (t) => t.parentElement.parentElement, Ve = function(t, { parent: e, start: n }) {
969
981
  const o = t.findEle(e), i = o.nodeObj;
970
982
  let s;
971
983
  return i.parent ? s = o.closest("me-main").className : s = t.findEle(i.children[n].id).closest("me-main").className, s;
972
- }, et = function(t, e) {
984
+ }, nt = function(t, e) {
973
985
  var $;
974
- const { id: n, label: o, parent: i, start: s, end: r } = e, { nodes: a, theme: f, summarySvg: d } = t, u = t.findEle(i).nodeObj, g = Fe(t, e);
975
- let l = 1 / 0, c = 0, h = 0, m = 0;
986
+ const { id: n, label: o, parent: i, start: s, end: r } = e, { nodes: l, theme: h, summarySvg: f } = t, u = t.findEle(i).nodeObj, g = Ve(t, e);
987
+ let a = 1 / 0, c = 0, d = 0, m = 0;
976
988
  for (let M = s; M <= r; M++) {
977
- const nt = ($ = u.children) == null ? void 0 : $[M];
978
- if (!nt)
989
+ const ot = ($ = u.children) == null ? void 0 : $[M];
990
+ if (!ot)
979
991
  return t.removeSummary(n), null;
980
- const G = Ie(t.findEle(nt.id)), { offsetLeft: I, offsetTop: ot } = D(a, G), it = s === r ? 10 : 20;
981
- M === s && (h = ot + it), M === r && (m = ot + G.offsetHeight - it), I < l && (l = I), G.offsetWidth + I > c && (c = G.offsetWidth + I);
992
+ const I = Ie(t.findEle(ot.id)), { offsetLeft: V, offsetTop: it } = D(l, I), st = s === r ? 10 : 20;
993
+ M === s && (d = it + st), M === r && (m = it + I.offsetHeight - st), V < a && (a = V), I.offsetWidth + V > c && (c = I.offsetWidth + V);
982
994
  }
983
- let w, x;
984
- const v = h + 10, S = m + 10, E = (v + S) / 2, b = f.cssVar["--color"];
985
- g === H.LHS ? (w = dt(`M ${l + 10} ${v} c -5 0 -10 5 -10 10 L ${l} ${S - 10} c 0 5 5 10 10 10 M ${l} ${E} h -10`, b), x = ft(o, l - 20, E + 6, "end", b)) : (w = dt(`M ${c - 10} ${v} c 5 0 10 5 10 10 L ${c} ${S - 10} c 0 5 -5 10 -10 10 M ${c} ${E} h 10`, b), x = ft(o, c + 20, E + 6, "start", b));
995
+ let x, w;
996
+ const y = d + 10, S = m + 10, E = (y + S) / 2, b = h.cssVar["--color"];
997
+ g === H.LHS ? (x = ft(`M ${a + 10} ${y} c -5 0 -10 5 -10 10 L ${a} ${S - 10} c 0 5 5 10 10 10 M ${a} ${E} h -10`, b), w = J(o, a - 20, E + 6, { anchor: "end", color: b })) : (x = ft(`M ${c - 10} ${y} c 5 0 10 5 10 10 L ${c} ${S - 10} c 0 5 -5 10 -10 10 M ${c} ${E} h 10`, b), w = J(o, c + 20, E + 6, { anchor: "start", color: b }));
986
998
  const C = Ge("s-" + n);
987
- return C.appendChild(w), C.appendChild(x), C.summaryObj = e, d.appendChild(C), C;
988
- }, je = function() {
999
+ return C.appendChild(x), C.appendChild(w), C.summaryObj = e, f.appendChild(C), C;
1000
+ }, Fe = function() {
989
1001
  if (!this.currentNodes)
990
1002
  return;
991
- const { currentNodes: t, summaries: e, bus: n } = this, { parent: o, start: i, end: s } = Ve(t), r = { id: V(), parent: o, start: i, end: s, label: "summary" }, a = et(this, r);
992
- e.push(r), this.editSummary(a), n.fire("operation", {
1003
+ const { currentNodes: t, summaries: e, bus: n } = this, { parent: o, start: i, end: s } = We(t), r = { id: G(), parent: o, start: i, end: s, label: "summary" }, l = nt(this, r);
1004
+ e.push(r), this.editSummary(l), n.fire("operation", {
993
1005
  name: "createSummary",
994
1006
  obj: r
995
1007
  });
996
- }, ze = function(t) {
997
- const e = V(), n = { ...t, id: e };
998
- et(this, n), this.summaries.push(n), this.bus.fire("operation", {
1008
+ }, Re = function(t) {
1009
+ const e = G(), n = { ...t, id: e };
1010
+ nt(this, n), this.summaries.push(n), this.bus.fire("operation", {
999
1011
  name: "createSummary",
1000
1012
  obj: n
1001
1013
  });
@@ -1006,9 +1018,9 @@ const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1006
1018
  name: "removeSummary",
1007
1019
  obj: { id: t }
1008
1020
  });
1009
- }, Re = function(t) {
1010
- const e = t.children[1].getBBox(), n = 6, o = 3, i = document.createElementNS(T, "rect");
1011
- y(i, {
1021
+ }, je = function(t) {
1022
+ const e = t.children[1].getBBox(), n = 6, o = 3, i = document.createElementNS(k, "rect");
1023
+ v(i, {
1012
1024
  x: e.x - n + "",
1013
1025
  y: e.y - n + "",
1014
1026
  width: e.width + n * 2 + "",
@@ -1018,80 +1030,80 @@ const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1018
1030
  "stroke-width": "2",
1019
1031
  fill: "none"
1020
1032
  }), t.appendChild(i), this.currentSummary = t;
1021
- }, Xe = function() {
1033
+ }, ze = function() {
1022
1034
  var t, e;
1023
1035
  (e = (t = this.currentSummary) == null ? void 0 : t.querySelector("rect")) == null || e.remove(), this.currentSummary = null;
1024
- }, qe = function() {
1036
+ }, Xe = function() {
1025
1037
  this.summarySvg.innerHTML = "", this.summaries.forEach((t) => {
1026
1038
  try {
1027
- et(this, t);
1039
+ nt(this, t);
1028
1040
  } catch {
1029
1041
  }
1030
1042
  }), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
1031
- }, _e = function(t) {
1043
+ }, qe = function(t) {
1032
1044
  if (!t)
1033
1045
  return;
1034
1046
  const e = t.childNodes[1];
1035
1047
  yt(this, e, t.summaryObj);
1036
- }, Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1048
+ }, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1037
1049
  __proto__: null,
1038
- createSummary: je,
1039
- createSummaryFrom: ze,
1040
- editSummary: _e,
1050
+ createSummary: Fe,
1051
+ createSummaryFrom: Re,
1052
+ editSummary: qe,
1041
1053
  removeSummary: Ye,
1042
- renderSummary: qe,
1043
- selectSummary: Re,
1044
- unselectSummary: Xe
1045
- }, Symbol.toStringTag, { value: "Module" })), L = "http://www.w3.org/2000/svg";
1046
- function Ke(t, e) {
1047
- const n = document.createElementNS(L, "svg");
1048
- return y(n, {
1054
+ renderSummary: Xe,
1055
+ selectSummary: je,
1056
+ unselectSummary: ze
1057
+ }, Symbol.toStringTag, { value: "Module" })), T = "http://www.w3.org/2000/svg";
1058
+ function Ue(t, e) {
1059
+ const n = document.createElementNS(T, "svg");
1060
+ return v(n, {
1049
1061
  version: "1.1",
1050
- xmlns: L,
1062
+ xmlns: T,
1051
1063
  height: t,
1052
1064
  width: e
1053
1065
  }), n;
1054
1066
  }
1055
- function Je(t, e) {
1067
+ function Ke(t, e) {
1056
1068
  return (parseInt(t) - parseInt(e)) / 2;
1057
1069
  }
1058
- function Qe(t, e, n, o) {
1059
- const i = document.createElementNS(L, "g");
1070
+ function Je(t, e, n, o) {
1071
+ const i = document.createElementNS(T, "g");
1060
1072
  let s = "";
1061
1073
  return t.text ? s = t.text.textContent : s = t.childNodes[0].textContent, s.split(`
1062
- `).forEach((a, f) => {
1063
- const d = document.createElementNS(L, "text");
1064
- y(d, {
1074
+ `).forEach((l, h) => {
1075
+ const f = document.createElementNS(T, "text");
1076
+ v(f, {
1065
1077
  x: n + parseInt(e.paddingLeft) + "",
1066
- y: o + parseInt(e.paddingTop) + Je(e.lineHeight, e.fontSize) * (f + 1) + parseFloat(e.fontSize) * (f + 1) + "",
1078
+ y: o + parseInt(e.paddingTop) + Ke(e.lineHeight, e.fontSize) * (h + 1) + parseFloat(e.fontSize) * (h + 1) + "",
1067
1079
  "text-anchor": "start",
1068
1080
  "font-family": e.fontFamily,
1069
1081
  "font-size": `${e.fontSize}`,
1070
1082
  "font-weight": `${e.fontWeight}`,
1071
1083
  fill: `${e.color}`
1072
- }), d.innerHTML = a, i.appendChild(d);
1084
+ }), f.innerHTML = l, i.appendChild(f);
1073
1085
  }), i;
1074
1086
  }
1075
- function Ze(t, e, n, o) {
1076
- var a;
1087
+ function Qe(t, e, n, o) {
1088
+ var l;
1077
1089
  let i = "";
1078
- (a = t.nodeObj) != null && a.dangerouslySetInnerHTML ? i = t.nodeObj.dangerouslySetInnerHTML : t.text ? i = t.text.textContent : i = t.childNodes[0].textContent;
1079
- const s = document.createElementNS(L, "foreignObject");
1080
- y(s, {
1090
+ (l = t.nodeObj) != null && l.dangerouslySetInnerHTML ? i = t.nodeObj.dangerouslySetInnerHTML : t.text ? i = t.text.textContent : i = t.childNodes[0].textContent;
1091
+ const s = document.createElementNS(T, "foreignObject");
1092
+ v(s, {
1081
1093
  x: n + parseInt(e.paddingLeft) + "",
1082
1094
  y: o + parseInt(e.paddingTop) + "",
1083
1095
  width: e.width,
1084
1096
  height: e.height
1085
1097
  });
1086
1098
  const r = document.createElement("div");
1087
- return y(r, {
1099
+ return v(r, {
1088
1100
  xmlns: "http://www.w3.org/1999/xhtml",
1089
1101
  style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
1090
1102
  }), r.innerHTML = i, s.appendChild(r), s;
1091
1103
  }
1092
- function tn(t, e) {
1093
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(L, "rect");
1094
- return y(s, {
1104
+ function Ze(t, e) {
1105
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(T, "rect");
1106
+ return v(s, {
1095
1107
  x: o + "",
1096
1108
  y: i + "",
1097
1109
  rx: n.borderRadius,
@@ -1103,9 +1115,9 @@ function tn(t, e) {
1103
1115
  "stroke-width": n.borderWidth
1104
1116
  }), s;
1105
1117
  }
1106
- function j(t, e, n = !1) {
1107
- const o = getComputedStyle(e), { offsetLeft: i, offsetTop: s } = D(t.nodes, e), r = document.createElementNS(L, "rect");
1108
- y(r, {
1118
+ function R(t, e, n = !1) {
1119
+ const o = getComputedStyle(e), { offsetLeft: i, offsetTop: s } = D(t.nodes, e), r = document.createElementNS(T, "rect");
1120
+ v(r, {
1109
1121
  x: i + "",
1110
1122
  y: s + "",
1111
1123
  rx: o.borderRadius,
@@ -1116,14 +1128,14 @@ function j(t, e, n = !1) {
1116
1128
  stroke: o.borderColor,
1117
1129
  "stroke-width": o.borderWidth
1118
1130
  });
1119
- const a = document.createElementNS(L, "g");
1120
- a.appendChild(r);
1121
- let f;
1122
- return n ? f = Ze(e, o, i, s) : f = Qe(e, o, i, s), a.appendChild(f), a;
1131
+ const l = document.createElementNS(T, "g");
1132
+ l.appendChild(r);
1133
+ let h;
1134
+ return n ? h = Qe(e, o, i, s) : h = Je(e, o, i, s), l.appendChild(h), l;
1123
1135
  }
1124
- function en(t, e) {
1125
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(L, "a"), r = document.createElementNS(L, "text");
1126
- return y(r, {
1136
+ function tn(t, e) {
1137
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(T, "a"), r = document.createElementNS(T, "text");
1138
+ return v(r, {
1127
1139
  x: o + "",
1128
1140
  y: i + parseInt(n.fontSize) + "",
1129
1141
  "text-anchor": "start",
@@ -1133,9 +1145,9 @@ function en(t, e) {
1133
1145
  fill: `${n.color}`
1134
1146
  }), r.innerHTML = e.textContent, s.appendChild(r), s.setAttribute("href", e.href), s;
1135
1147
  }
1136
- function nn(t, e) {
1137
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(L, "image");
1138
- return y(s, {
1148
+ function en(t, e) {
1149
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(T, "image");
1150
+ return v(s, {
1139
1151
  x: o + "",
1140
1152
  y: i + "",
1141
1153
  width: n.width + "",
@@ -1143,41 +1155,41 @@ function nn(t, e) {
1143
1155
  href: e.src
1144
1156
  }), s;
1145
1157
  }
1146
- const z = 100, on = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', sn = (t, e = !1) => {
1147
- var u, g, l;
1148
- const n = t.nodes, o = n.offsetHeight + z * 2, i = n.offsetWidth + z * 2, s = Ke(o + "px", i + "px"), r = document.createElementNS(L, "svg"), a = document.createElementNS(L, "rect");
1149
- y(a, {
1158
+ const Y = 100, nn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', on = (t, e = !1) => {
1159
+ var u, g, a;
1160
+ const n = t.nodes, o = n.offsetHeight + Y * 2, i = n.offsetWidth + Y * 2, s = Ue(o + "px", i + "px"), r = document.createElementNS(T, "svg"), l = document.createElementNS(T, "rect");
1161
+ v(l, {
1150
1162
  x: "0",
1151
1163
  y: "0",
1152
1164
  width: `${i}`,
1153
1165
  height: `${o}`,
1154
1166
  fill: t.theme.cssVar["--bgcolor"]
1155
- }), s.appendChild(a), n.querySelectorAll(".subLines").forEach((c) => {
1156
- const h = c.cloneNode(!0), { offsetLeft: m, offsetTop: w } = D(n, c.parentElement);
1157
- h.setAttribute("x", `${m}`), h.setAttribute("y", `${w}`), r.appendChild(h);
1167
+ }), s.appendChild(l), n.querySelectorAll(".subLines").forEach((c) => {
1168
+ const d = c.cloneNode(!0), { offsetLeft: m, offsetTop: x } = D(n, c.parentElement);
1169
+ d.setAttribute("x", `${m}`), d.setAttribute("y", `${x}`), r.appendChild(d);
1158
1170
  });
1159
- const f = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
1171
+ const h = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
1172
+ h && r.appendChild(h);
1173
+ const f = (g = n.querySelector(".topiclinks")) == null ? void 0 : g.cloneNode(!0);
1160
1174
  f && r.appendChild(f);
1161
- const d = (g = n.querySelector(".topiclinks")) == null ? void 0 : g.cloneNode(!0);
1162
- d && r.appendChild(d);
1163
- const p = (l = n.querySelector(".summary")) == null ? void 0 : l.cloneNode(!0);
1175
+ const p = (a = n.querySelector(".summary")) == null ? void 0 : a.cloneNode(!0);
1164
1176
  return p && r.appendChild(p), n.querySelectorAll("me-tpc").forEach((c) => {
1165
- c.nodeObj.dangerouslySetInnerHTML ? r.appendChild(j(t, c, !e)) : (r.appendChild(tn(t, c)), r.appendChild(j(t, c.text, !e)));
1177
+ c.nodeObj.dangerouslySetInnerHTML ? r.appendChild(R(t, c, !e)) : (r.appendChild(Ze(t, c)), r.appendChild(R(t, c.text, !e)));
1166
1178
  }), n.querySelectorAll(".tags > span").forEach((c) => {
1167
- r.appendChild(j(t, c));
1179
+ r.appendChild(R(t, c));
1168
1180
  }), n.querySelectorAll(".icons > span").forEach((c) => {
1169
- r.appendChild(j(t, c));
1181
+ r.appendChild(R(t, c));
1170
1182
  }), n.querySelectorAll(".hyper-link").forEach((c) => {
1171
- r.appendChild(en(t, c));
1183
+ r.appendChild(tn(t, c));
1172
1184
  }), n.querySelectorAll("img").forEach((c) => {
1173
- r.appendChild(nn(t, c));
1174
- }), y(r, {
1175
- x: z + "",
1176
- y: z + "",
1185
+ r.appendChild(en(t, c));
1186
+ }), v(r, {
1187
+ x: Y + "",
1188
+ y: Y + "",
1177
1189
  overflow: "visible"
1178
1190
  }), s.appendChild(r), s;
1179
- }, rn = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), on + t.outerHTML);
1180
- function cn(t) {
1191
+ }, sn = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), nn + t.outerHTML);
1192
+ function rn(t) {
1181
1193
  return new Promise((e, n) => {
1182
1194
  const o = new FileReader();
1183
1195
  o.onload = (i) => {
@@ -1187,68 +1199,68 @@ function cn(t) {
1187
1199
  }, o.readAsDataURL(t);
1188
1200
  });
1189
1201
  }
1190
- const ln = function(t = !1, e) {
1191
- const n = sn(this, t), o = rn(n, e);
1202
+ const cn = function(t = !1, e) {
1203
+ const n = on(this, t), o = sn(n, e);
1192
1204
  return new Blob([o], { type: "image/svg+xml" });
1193
- }, an = async function(t = !1, e) {
1194
- const n = this.exportSvg(t, e), o = await cn(n);
1205
+ }, ln = async function(t = !1, e) {
1206
+ const n = this.exportSvg(t, e), o = await rn(n);
1195
1207
  return new Promise((i, s) => {
1196
1208
  const r = new Image();
1197
1209
  r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
1198
- const a = document.createElement("canvas");
1199
- a.width = r.width, a.height = r.height, a.getContext("2d").drawImage(r, 0, 0), a.toBlob(i, "image/png", 1);
1210
+ const l = document.createElement("canvas");
1211
+ l.width = r.width, l.height = r.height, l.getContext("2d").drawImage(r, 0, 0), l.toBlob(i, "image/png", 1);
1200
1212
  }, r.src = o, r.onerror = s;
1201
1213
  });
1202
- }, hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1214
+ }, an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1203
1215
  __proto__: null,
1204
- exportPng: an,
1205
- exportSvg: ln
1206
- }, Symbol.toStringTag, { value: "Module" })), dn = {}, fn = {
1207
- getObjById: Y,
1216
+ exportPng: ln,
1217
+ exportSvg: cn
1218
+ }, Symbol.toStringTag, { value: "Module" })), hn = {}, dn = {
1219
+ getObjById: j,
1208
1220
  generateNewObj: Et,
1209
1221
  layout: kt,
1210
1222
  linkDiv: Wt,
1211
1223
  editTopic: Ht,
1212
- createWrapper: At,
1224
+ createWrapper: Mt,
1213
1225
  createParent: Dt,
1214
1226
  createChildren: Nt,
1215
1227
  createTopic: Pt,
1216
1228
  findEle: gt,
1217
1229
  changeTheme: Ut,
1218
1230
  ...be,
1219
- ...dn,
1220
- ...We,
1221
- ...Ue,
1222
1231
  ...hn,
1232
+ ...Oe,
1233
+ ..._e,
1234
+ ...an,
1223
1235
  init(t) {
1224
1236
  if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData)
1225
1237
  return new Error("MindElixir: `data` is required");
1226
- t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, Z(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && _t(this), this.layout(), this.linkDiv(), this.toCenter();
1238
+ t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, tt(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && _t(this), this.layout(), this.linkDiv(), this.toCenter();
1227
1239
  },
1228
1240
  destroy() {
1229
1241
  var t;
1230
1242
  this.disposable.forEach((e) => e()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, (t = this.selection) == null || t.destroy(), this.selection = void 0;
1231
1243
  }
1232
1244
  };
1233
- function pn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: a, direction: f, containerHeight: d }) {
1245
+ function fn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: h, containerHeight: f }) {
1234
1246
  let p = e + n / 2;
1235
1247
  const u = t + o / 2;
1236
1248
  let g;
1237
- f === H.LHS ? g = s + r : g = s;
1238
- const l = i + a / 2, h = (1 - Math.abs(l - u) / d) * 0.25 * (n / 2);
1239
- return f === H.LHS ? p = p - n / 10 - h : p = p + n / 10 + h, `M ${p} ${u} Q ${p} ${l} ${g} ${l}`;
1249
+ h === H.LHS ? g = s + r : g = s;
1250
+ const a = i + l / 2, d = (1 - Math.abs(a - u) / f) * 0.25 * (n / 2);
1251
+ return h === H.LHS ? p = p - n / 10 - d : p = p + n / 10 + d, `M ${p} ${u} Q ${p} ${a} ${g} ${a}`;
1240
1252
  }
1241
- function un({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: a, direction: f, isFirst: d }) {
1253
+ function pn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: h, isFirst: f }) {
1242
1254
  const p = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
1243
1255
  let u = 0, g = 0;
1244
- d ? u = t + o / 2 : u = t + o;
1245
- const l = i + a;
1246
- let c = 0, h = 0, m = 0;
1247
- const w = Math.abs(u - l) / 300 * p;
1248
- return f === H.LHS ? (m = e, c = m + p, h = m - p, g = s + p, `M ${c} ${u} C ${m} ${u} ${m + w} ${l} ${h} ${l} H ${g}`) : (m = e + n, c = m - p, h = m + p, g = s + r - p, `M ${c} ${u} C ${m} ${u} ${m - w} ${l} ${h} ${l} H ${g}`);
1256
+ f ? u = t + o / 2 : u = t + o;
1257
+ const a = i + l;
1258
+ let c = 0, d = 0, m = 0;
1259
+ const x = Math.abs(u - a) / 300 * p;
1260
+ return h === H.LHS ? (m = e, c = m + p, d = m - p, g = s + p, `M ${c} ${u} C ${m} ${u} ${m + x} ${a} ${d} ${a} H ${g}`) : (m = e + n, c = m - p, d = m + p, g = s + r - p, `M ${c} ${u} C ${m} ${u} ${m - x} ${a} ${d} ${a} H ${g}`);
1249
1261
  }
1250
- const gn = "5.0.4";
1251
- function mn(t) {
1262
+ const un = "5.0.6";
1263
+ function gn(t) {
1252
1264
  return {
1253
1265
  x: 0,
1254
1266
  y: 0,
@@ -1259,7 +1271,7 @@ function mn(t) {
1259
1271
  this.mousedown && (this.moved = !0, t.move(e, n));
1260
1272
  },
1261
1273
  clear() {
1262
- this.mousedown = !1, t.map.style.transition = "transform 0.3s";
1274
+ this.mousedown = !1;
1263
1275
  }
1264
1276
  };
1265
1277
  }
@@ -1272,19 +1284,19 @@ function A({
1272
1284
  editable: i,
1273
1285
  contextMenu: s,
1274
1286
  toolBar: r,
1275
- keypress: a,
1276
- mouseSelectionButton: f,
1277
- selectionContainer: d,
1287
+ keypress: l,
1288
+ mouseSelectionButton: h,
1289
+ selectionContainer: f,
1278
1290
  before: p,
1279
1291
  newTopicName: u,
1280
1292
  allowUndo: g,
1281
- generateMainBranch: l,
1293
+ generateMainBranch: a,
1282
1294
  generateSubBranch: c,
1283
- overflowHidden: h,
1295
+ overflowHidden: d,
1284
1296
  theme: m,
1285
- alignment: w,
1286
- scaleSensitivity: x,
1287
- scaleMax: v,
1297
+ alignment: x,
1298
+ scaleSensitivity: w,
1299
+ scaleMax: y,
1288
1300
  scaleMin: S,
1289
1301
  handleWheel: E
1290
1302
  }) {
@@ -1292,15 +1304,13 @@ function A({
1292
1304
  const C = Object.prototype.toString.call(t);
1293
1305
  if (C === "[object HTMLDivElement]" ? b = t : C === "[object String]" && (b = document.querySelector(t)), !b)
1294
1306
  throw new Error("MindElixir: el is not a valid element");
1295
- b.style.position = "relative", b.innerHTML = "", this.el = b, this.disposable = [], this.before = p || {}, this.locale = n || "en", this.newTopicName = u || "new node", this.contextMenu = s ?? !0, this.toolBar = r ?? !0, this.keypress = a ?? !0, this.mouseSelectionButton = f ?? 0, this.direction = e ?? 1, this.draggable = o ?? !0, this.editable = i ?? !0, this.allowUndo = g ?? !1, this.scaleSensitivity = x ?? 0.1, this.scaleMax = v ?? 1.4, this.scaleMin = S ?? 0.2, this.generateMainBranch = l || pn, this.generateSubBranch = c || un, this.overflowHidden = h ?? !1, this.alignment = w ?? "root", this.handleWheel = E ?? !0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = mn(this), this.bus = Lt(), this.container = O.createElement("div"), this.selectionContainer = d || this.container, this.container.className = "map-container";
1307
+ b.style.position = "relative", b.innerHTML = "", this.el = b, this.disposable = [], this.before = p || {}, this.locale = n || "en", this.newTopicName = u || "New Node", this.contextMenu = s ?? !0, this.toolBar = r ?? !0, this.keypress = l ?? !0, this.mouseSelectionButton = h ?? 0, this.direction = e ?? 1, this.draggable = o ?? !0, this.editable = i ?? !0, this.allowUndo = g ?? !0, this.scaleSensitivity = w ?? 0.1, this.scaleMax = y ?? 1.4, this.scaleMin = S ?? 0.2, this.generateMainBranch = a || fn, this.generateSubBranch = c || pn, this.overflowHidden = d ?? !1, this.alignment = x ?? "root", this.handleWheel = E ?? !0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = gn(this), this.bus = Lt(), this.container = O.createElement("div"), this.selectionContainer = f || this.container, this.container.className = "map-container";
1296
1308
  const $ = window.matchMedia("(prefers-color-scheme: dark)");
1297
- this.theme = m || ($.matches ? Q : J);
1309
+ this.theme = m || ($.matches ? Z : Q);
1298
1310
  const M = O.createElement("div");
1299
- M.className = "map-canvas", setTimeout(() => {
1300
- M.style.transition = "all 0.3s";
1301
- }, 300), this.map = M, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = O.createElement("me-nodes"), this.lines = W("lines"), this.summarySvg = W("summary"), this.linkController = W("linkcontroller"), this.P2 = O.createElement("div"), this.P3 = O.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = lt(), this.line2 = lt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = W("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Tt(this));
1311
+ M.className = "map-canvas", this.map = M, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = O.createElement("me-nodes"), this.lines = W("lines"), this.summarySvg = W("summary"), this.linkController = W("linkcontroller"), this.P2 = O.createElement("div"), this.P3 = O.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = at(), this.line2 = at(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = W("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Tt(this));
1302
1312
  }
1303
- A.prototype = fn;
1313
+ A.prototype = dn;
1304
1314
  Object.defineProperty(A.prototype, "currentNode", {
1305
1315
  get() {
1306
1316
  return this.currentNodes[this.currentNodes.length - 1];
@@ -1310,9 +1320,9 @@ Object.defineProperty(A.prototype, "currentNode", {
1310
1320
  A.LEFT = 0;
1311
1321
  A.RIGHT = 1;
1312
1322
  A.SIDE = 2;
1313
- A.THEME = J;
1314
- A.DARK_THEME = Q;
1315
- A.version = gn;
1323
+ A.THEME = Q;
1324
+ A.DARK_THEME = Z;
1325
+ A.version = un;
1316
1326
  A.E = gt;
1317
1327
  export {
1318
1328
  A as default