mind-elixir 5.8.3-beta.1 → 5.8.3

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.
@@ -77,12 +77,12 @@ const tt = function(t, e) {
77
77
  });
78
78
  };
79
79
  function et(t, e, n, o) {
80
- const s = n - t, i = o - e, l = Math.atan2(i, s) * 180 / Math.PI, d = 12, c = 30, h = (l + 180 - c) * Math.PI / 180, f = (l + 180 + c) * Math.PI / 180;
80
+ const s = n - t, i = o - e, l = Math.atan2(i, s) * 180 / Math.PI, a = 12, c = 30, h = (l + 180 - c) * Math.PI / 180, f = (l + 180 + c) * Math.PI / 180;
81
81
  return {
82
- x1: n + Math.cos(h) * d,
83
- y1: o + Math.sin(h) * d,
84
- x2: n + Math.cos(f) * d,
85
- y2: o + Math.sin(f) * d
82
+ x1: n + Math.cos(h) * a,
83
+ y1: o + Math.sin(h) * a,
84
+ x2: n + Math.cos(f) * a,
85
+ y2: o + Math.sin(f) * a
86
86
  };
87
87
  }
88
88
  function _() {
@@ -153,7 +153,7 @@ const Wt = function() {
153
153
  n.appendChild(i);
154
154
  }
155
155
  return n;
156
- }, P = document, Mt = function(t, e) {
156
+ }, A = document, Mt = function(t, e) {
157
157
  const o = (this?.el ? this.el : e || document).querySelector(`[data-nodeid="me${t}"]`);
158
158
  if (!o) throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);
159
159
  return o;
@@ -170,31 +170,31 @@ const Wt = function() {
170
170
  if (e.image) {
171
171
  const n = e.image;
172
172
  if (n.url && n.width && n.height) {
173
- const o = P.createElement("img");
173
+ const o = A.createElement("img");
174
174
  o.src = this.imageProxy ? this.imageProxy(n.url) : 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;
175
175
  }
176
176
  } else t.image && (t.image = void 0);
177
177
  {
178
- const n = P.createElement("span");
178
+ const n = A.createElement("span");
179
179
  n.className = "text", this.markdown ? n.innerHTML = this.markdown(e.topic, e) : n.textContent = e.topic, t.appendChild(n), t.text = n;
180
180
  }
181
181
  if (e.hyperLink) {
182
- const n = P.createElement("a");
182
+ const n = A.createElement("a");
183
183
  n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = e.hyperLink, t.appendChild(n), t.link = n;
184
184
  } else t.link && (t.link = void 0);
185
185
  if (e.icons && e.icons.length) {
186
- const n = P.createElement("span");
186
+ const n = A.createElement("span");
187
187
  n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${Rt(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
188
188
  } else t.icons && (t.icons = void 0);
189
189
  if (e.tags && e.tags.length) {
190
- const n = P.createElement("div");
190
+ const n = A.createElement("div");
191
191
  n.className = "tags", e.tags.forEach((o) => {
192
- const s = P.createElement("span");
192
+ const s = A.createElement("span");
193
193
  typeof o == "string" ? s.textContent = o : (s.textContent = o.text, o.className && (s.className = o.className), o.style && Object.assign(s.style, o.style)), n.appendChild(s);
194
194
  }), t.appendChild(n), t.tags = n;
195
195
  } else t.tags && (t.tags = void 0);
196
196
  }, zt = function(t, e) {
197
- const n = P.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(t);
197
+ const n = A.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(t);
198
198
  if (n.appendChild(o), !e && t.children && t.children.length > 0) {
199
199
  const i = Ut(t.expanded);
200
200
  if (o.appendChild(i), t.expanded !== !1) {
@@ -204,24 +204,24 @@ const Wt = function() {
204
204
  }
205
205
  return { grp: n, top: o, tpc: s };
206
206
  }, Ft = function(t) {
207
- const e = P.createElement("me-parent"), n = this.createTopic(t);
207
+ const e = A.createElement("me-parent"), n = this.createTopic(t);
208
208
  return kt.call(this, n, t), e.appendChild(n), { p: e, tpc: n };
209
209
  }, qt = function(t) {
210
- const e = P.createElement("me-children");
210
+ const e = A.createElement("me-children");
211
211
  return e.append(...t), e;
212
212
  }, jt = function(t) {
213
- const e = P.createElement("me-tpc");
213
+ const e = A.createElement("me-tpc");
214
214
  return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e;
215
215
  };
216
216
  function $t(t) {
217
- const e = P.createRange();
217
+ const e = A.createRange();
218
218
  e.selectNodeContents(t);
219
219
  const n = window.getSelection();
220
220
  n && (n.removeAllRanges(), n.addRange(e));
221
221
  }
222
222
  const _t = function(t) {
223
223
  if (!t) return;
224
- const e = P.createElement("div"), n = t.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = I(this.nodes, t);
224
+ const e = A.createElement("div"), n = t.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = I(this.nodes, t);
225
225
  this.nodes.appendChild(e), e.id = "input-box", e.textContent = o, e.contentEditable = "plaintext-only", e.spellcheck = !1;
226
226
  const r = getComputedStyle(t);
227
227
  e.style.cssText = `
@@ -239,8 +239,8 @@ const _t = function(t) {
239
239
  obj: t.nodeObj
240
240
  }), e.addEventListener("keydown", (l) => {
241
241
  l.stopPropagation();
242
- const d = l.key;
243
- if (d === "Enter" || d === "Tab") {
242
+ const a = l.key;
243
+ if (a === "Enter" || a === "Tab") {
244
244
  if (l.shiftKey) return;
245
245
  l.preventDefault(), e.blur(), this.container.focus();
246
246
  }
@@ -255,7 +255,7 @@ const _t = function(t) {
255
255
  }));
256
256
  });
257
257
  }, Ut = function(t) {
258
- const e = P.createElement("me-epd");
258
+ const e = A.createElement("me-epd");
259
259
  return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
260
260
  }, Kt = function(t) {
261
261
  const n = t.parentElement.parentElement.lastElementChild;
@@ -273,7 +273,7 @@ function Jt(t) {
273
273
  const Qt = function(t) {
274
274
  const e = this.container, n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
275
275
  if (n.top > o.bottom - 50 || n.bottom < o.top + 50 || n.left > o.right - 50 || n.right < o.left + 50) {
276
- const i = n.left + n.width / 2, r = n.top + n.height / 2, l = o.left + o.width / 2, d = o.top + o.height / 2, c = i - l, h = r - d;
276
+ const i = n.left + n.width / 2, r = n.top + n.height / 2, l = o.left + o.width / 2, a = o.top + o.height / 2, c = i - l, h = r - a;
277
277
  this.move(-c, -h, !0);
278
278
  }
279
279
  }, Zt = function(t, e, n) {
@@ -300,8 +300,8 @@ const Qt = function(t) {
300
300
  this.editable = !1;
301
301
  }, le = function(t, e = { x: 0, y: 0 }) {
302
302
  if (t < this.scaleMin && t < this.scaleVal || t > this.scaleMax && t > this.scaleVal) return;
303
- const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, s = e.y ? e.y - n.top - n.height / 2 : 0, { dx: i, dy: r } = mt(this), l = this.map.style.transform, { x: d, y: c } = gt(l), h = d - i, f = c - r, u = this.scaleVal, y = (-o + h) * (1 - t / u), m = (-s + f) * (1 - t / u);
304
- this.map.style.transform = `translate3d(${d - y}px, ${c - m}px, 0) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
303
+ const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, s = e.y ? e.y - n.top - n.height / 2 : 0, { dx: i, dy: r } = mt(this), l = this.map.style.transform, { x: a, y: c } = gt(l), h = a - i, f = c - r, u = this.scaleVal, y = (-o + h) * (1 - t / u), m = (-s + f) * (1 - t / u);
304
+ this.map.style.transform = `translate3d(${a - y}px, ${c - m}px, 0) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
305
305
  }, ce = function() {
306
306
  const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
307
307
  this.scaleVal = n;
@@ -311,8 +311,8 @@ const Qt = function(t) {
311
311
  const { map: o, scaleVal: s, bus: i, container: r, nodes: l } = this;
312
312
  if (n && o.style.transition === "transform 0.3s")
313
313
  return;
314
- const d = o.style.transform;
315
- let { x: c, y: h } = gt(d);
314
+ const a = o.style.transform;
315
+ let { x: c, y: h } = gt(a);
316
316
  const f = r.getBoundingClientRect(), u = l.getBoundingClientRect(), y = u.left < f.right && u.right > f.left, m = u.top < f.bottom && u.bottom > f.top;
317
317
  if (y) {
318
318
  const p = u.left + t, g = u.right + t;
@@ -331,8 +331,8 @@ const Qt = function(t) {
331
331
  if (t.alignment === "nodes" || e)
332
332
  i = (n.offsetWidth - s.offsetWidth) / 2, r = (n.offsetHeight - s.offsetHeight) / 2, o.style.transformOrigin = "50% 50%";
333
333
  else {
334
- const l = o.querySelector("me-root"), d = l.offsetTop, c = l.offsetLeft, h = l.offsetWidth, f = l.offsetHeight;
335
- i = n.offsetWidth / 2 - c - h / 2, r = n.offsetHeight / 2 - d - f / 2, o.style.transformOrigin = `${c + h / 2}px 50%`;
334
+ const l = o.querySelector("me-root"), a = l.offsetTop, c = l.offsetLeft, h = l.offsetWidth, f = l.offsetHeight;
335
+ i = n.offsetWidth / 2 - c - h / 2, r = n.offsetHeight / 2 - a - f / 2, o.style.transformOrigin = `${c + h / 2}px 50%`;
336
336
  }
337
337
  return { dx: i, dy: r };
338
338
  }, de = function() {
@@ -367,10 +367,10 @@ const Qt = function(t) {
367
367
  } else
368
368
  i.parentNode.children[1].remove();
369
369
  this.linkDiv(t.closest("me-main > me-wrapper"));
370
- const l = t.getBoundingClientRect(), d = {
370
+ const l = t.getBoundingClientRect(), a = {
371
371
  x: l.left,
372
372
  y: l.top
373
- }, c = s.x - d.x, h = s.y - d.y;
373
+ }, c = s.x - a.x, h = s.y - a.y;
374
374
  this.move(c, h), this.bus.fire("expandNode", n);
375
375
  }, we = function(t, e) {
376
376
  const n = t.nodeObj, o = t.getBoundingClientRect(), s = {
@@ -381,8 +381,8 @@ const Qt = function(t) {
381
381
  const i = this.findEle(n.id).getBoundingClientRect(), r = {
382
382
  x: i.left,
383
383
  y: i.top
384
- }, l = s.x - r.x, d = s.y - r.y;
385
- this.move(l, d);
384
+ }, l = s.x - r.x, a = s.y - r.y;
385
+ this.move(l, a);
386
386
  }, be = function(t) {
387
387
  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)), pt(this.nodeData), this.layout(), this.linkDiv();
388
388
  }, xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -477,12 +477,12 @@ function xt(t, e, n, o = !1) {
477
477
  if (s?.tagName !== "ME-TPC" || !s.nodeObj.parent) return !1;
478
478
  e.startX = n.clientX, e.startY = n.clientY, e.pointerId = n.pointerId, t.selection?.cancel();
479
479
  let i = t.currentNodes;
480
- return i?.includes(s) || (t.selectNode(s), i = t.currentNodes), t.dragged = i, o && At(t, e), !0;
480
+ return i?.includes(s) || (t.selectNode(s), i = t.currentNodes), t.dragged = i, o && Pt(t, e), !0;
481
481
  }
482
- function Pt(t, e, n) {
482
+ function At(t, e, n) {
483
483
  t.style.transform = `translate(${e - 10}px, ${n - 10}px)`, t.style.display = "block";
484
484
  }
485
- function At(t, e) {
485
+ function Pt(t, e) {
486
486
  const { dragged: n } = t;
487
487
  if (!n) return;
488
488
  const o = document.activeElement;
@@ -495,16 +495,16 @@ function De(t, e, n) {
495
495
  const { dragged: o } = t;
496
496
  if (!o || e.pointerId !== n.pointerId) return;
497
497
  const s = n.clientX - e.startX, i = n.clientY - e.startY, r = Math.sqrt(s * s + i * i);
498
- if (!e.isDragging && r > Le && At(t, e), !e.isDragging) return;
498
+ if (!e.isDragging && r > Le && Pt(t, e), !e.isDragging) return;
499
499
  const l = t.container.getBoundingClientRect();
500
- Pt(e.ghost, n.clientX - l.x, n.clientY - l.y), n.clientX < l.x + 50 ? e.edgeMoveController.move(1, 0) : n.clientX > l.x + l.width - 50 ? e.edgeMoveController.move(-1, 0) : n.clientY < l.y + 50 ? e.edgeMoveController.move(0, 1) : n.clientY > l.y + l.height - 50 ? e.edgeMoveController.move(0, -1) : e.edgeMoveController.stop(), st(e.meet);
501
- const d = 12 * t.scaleVal, c = dt.elementFromPoint(n.clientX, n.clientY - d);
500
+ At(e.ghost, n.clientX - l.x, n.clientY - l.y), n.clientX < l.x + 50 ? e.edgeMoveController.move(1, 0) : n.clientX > l.x + l.width - 50 ? e.edgeMoveController.move(-1, 0) : n.clientY < l.y + 50 ? e.edgeMoveController.move(0, 1) : n.clientY > l.y + l.height - 50 ? e.edgeMoveController.move(0, -1) : e.edgeMoveController.stop(), st(e.meet);
501
+ const a = 12 * t.scaleVal, c = dt.elementFromPoint(n.clientX, n.clientY - a);
502
502
  if (bt(c, o)) {
503
503
  e.meet = c;
504
504
  const h = c.getBoundingClientRect(), f = h.y;
505
505
  n.clientY > f + h.height ? e.insertType = "after" : e.insertType = "in";
506
506
  } else {
507
- const h = dt.elementFromPoint(n.clientX, n.clientY + d);
507
+ const h = dt.elementFromPoint(n.clientX, n.clientY + a);
508
508
  if (bt(h, o)) {
509
509
  e.meet = h;
510
510
  const u = h.getBoundingClientRect().y;
@@ -538,13 +538,13 @@ function ke(t) {
538
538
  t.spacePressed = !1;
539
539
  let o = null;
540
540
  const s = /* @__PURE__ */ new Map(), i = t.editable ? Te(t) : null;
541
- let r = null, l = null, d = null, c = null;
541
+ let r = null, l = null, a = null, c = null;
542
542
  const h = 500, f = 10, u = () => {
543
- r !== null && (clearTimeout(r), r = null, l = null, d = null, c = null);
544
- }, y = (a, v) => {
545
- a.hasPointerCapture && a.hasPointerCapture(v) && a.releasePointerCapture(v);
546
- }, m = (a, v) => {
547
- const C = a.closest(".svg-label");
543
+ r !== null && (clearTimeout(r), r = null, l = null, a = null, c = null);
544
+ }, y = (d, v) => {
545
+ d.hasPointerCapture && d.hasPointerCapture(v) && d.releasePointerCapture(v);
546
+ }, m = (d, v) => {
547
+ const C = d.closest(".svg-label");
548
548
  if (C) {
549
549
  const N = C.dataset.svgId, U = C.dataset.type, q = document.getElementById(N);
550
550
  if (q) {
@@ -554,19 +554,19 @@ function ke(t) {
554
554
  return v ? t.editSummary(q) : t.selectSummary(q), !0;
555
555
  }
556
556
  }
557
- if (a.closest(".topiclinks")) {
558
- const N = a.closest("g");
557
+ if (d.closest(".topiclinks")) {
558
+ const N = d.closest("g");
559
559
  if (N)
560
560
  return v ? t.editArrowLabel(N) : t.selectArrow(N), !0;
561
561
  }
562
- if (a.closest(".summary")) {
563
- const N = a.closest("g");
562
+ if (d.closest(".summary")) {
563
+ const N = d.closest("g");
564
564
  if (N)
565
565
  return v ? t.editSummary(N) : t.selectSummary(N), !0;
566
566
  }
567
567
  return !1;
568
- }, p = (a) => {
569
- if (a.button !== 0) return;
568
+ }, p = (d) => {
569
+ if (d.button !== 0) return;
570
570
  if (t.helper1?.moved) {
571
571
  t.helper1.clear();
572
572
  return;
@@ -581,51 +581,51 @@ function ke(t) {
581
581
  }
582
582
  if (i?.isDragging)
583
583
  return;
584
- const v = a.target;
584
+ const v = d.target;
585
585
  if (v.tagName === "ME-EPD")
586
- a.ctrlKey || a.metaKey ? t.expandNodeAll(v.previousSibling) : t.expandNode(v.previousSibling);
586
+ d.ctrlKey || d.metaKey ? t.expandNodeAll(v.previousSibling) : t.expandNode(v.previousSibling);
587
587
  else if (v.tagName === "ME-TPC" && t.currentNodes.length > 1)
588
588
  t.selectNode(v);
589
589
  else if (!t.editable)
590
590
  return;
591
591
  m(v, !1);
592
- }, g = (a) => {
592
+ }, g = (d) => {
593
593
  if (!t.editable) return;
594
- const v = a.target;
594
+ const v = d.target;
595
595
  lt(v) && t.beginEdit(v), m(v, !0);
596
- }, b = (a) => {
597
- if (a.pointerType === "mouse" || s.size > 1) return;
596
+ }, b = (d) => {
597
+ if (d.pointerType === "mouse" || s.size > 1) return;
598
598
  const v = (/* @__PURE__ */ new Date()).getTime(), C = v - n;
599
- C < 300 && C > 0 && g(a), n = v;
600
- }, w = (a) => {
601
- a.code === "Space" && (t.spacePressed = !0, t.container.classList.add("space-pressed"));
602
- }, x = (a) => {
603
- a.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
604
- }, S = (a) => {
605
- if (a.stopPropagation(), a.pointerType === "touch" && (s.set(a.pointerId, { x: a.clientX, y: a.clientY }), s.size === 2)) {
599
+ C < 300 && C > 0 && g(d), n = v;
600
+ }, w = (d) => {
601
+ d.code === "Space" && (t.spacePressed = !0, t.container.classList.add("space-pressed"));
602
+ }, x = (d) => {
603
+ d.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
604
+ }, S = (d) => {
605
+ if (d.pointerType === "touch" && (s.set(d.pointerId, { x: d.clientX, y: d.clientY }), s.size === 2)) {
606
606
  const [N, U] = Array.from(s.values());
607
607
  o = wt(N, U), u();
608
608
  }
609
609
  e.moved = !1;
610
- const v = a.target, C = t.mouseSelectionButton === 0 ? 2 : 0;
611
- if (i && (a.button === 0 || a.pointerType === "touch")) {
612
- if (a.pointerType === "touch" && s.size > 1)
610
+ const v = d.target, C = t.mouseSelectionButton === 0 ? 2 : 0;
611
+ if (i && (d.button === 0 || d.pointerType === "touch")) {
612
+ if (d.pointerType === "touch" && s.size > 1)
613
613
  (i.isDragging || i.pointerId !== null) && ct(t, i);
614
- else if (a.pointerType === "touch" && s.size === 1)
615
- (lt(v) || v.closest("me-tpc")) && (l = { x: a.clientX, y: a.clientY }, d = v, c = a.pointerId, r = window.setTimeout(() => {
616
- xt(t, i, a, !0) && (d && d.setPointerCapture(a.pointerId), Pt(i.ghost, a.clientX, a.clientY)), r = null, l = null, d = null, c = null;
614
+ else if (d.pointerType === "touch" && s.size === 1)
615
+ (lt(v) || v.closest("me-tpc")) && (l = { x: d.clientX, y: d.clientY }, a = v, c = d.pointerId, r = window.setTimeout(() => {
616
+ xt(t, i, d, !0) && (a && a.setPointerCapture(d.pointerId), At(i.ghost, d.clientX, d.clientY)), r = null, l = null, a = null, c = null;
617
617
  }, h));
618
- else if (a.pointerType === "mouse" && xt(t, i, a, !1)) {
619
- v.setPointerCapture(a.pointerId);
618
+ else if (d.pointerType === "mouse" && xt(t, i, d, !1)) {
619
+ v.setPointerCapture(d.pointerId);
620
620
  return;
621
621
  }
622
622
  }
623
- const H = t.spacePressed && a.button === 0 && a.pointerType === "mouse", B = !t.editable || a.button === C && a.pointerType === "mouse" || a.pointerType === "touch";
624
- !H && !B || (e.x = a.clientX, e.y = a.clientY, v.className !== "circle" && v.contentEditable !== "plaintext-only" && (e.mousedown = !0, v.setPointerCapture(a.pointerId)));
625
- }, T = (a) => {
626
- if (a.stopPropagation(), a.pointerType === "touch" && s.has(a.pointerId)) {
627
- if (s.set(a.pointerId, { x: a.clientX, y: a.clientY }), r !== null && l !== null && a.pointerId === c) {
628
- const v = a.clientX - l.x, C = a.clientY - l.y;
623
+ const H = t.spacePressed && d.button === 0 && d.pointerType === "mouse", B = !t.editable || d.button === C && d.pointerType === "mouse" || d.pointerType === "touch";
624
+ !H && !B || (e.x = d.clientX, e.y = d.clientY, v.className !== "circle" && v.contentEditable !== "plaintext-only" && (e.mousedown = !0, v.setPointerCapture(d.pointerId)));
625
+ }, T = (d) => {
626
+ if (d.pointerType === "touch" && s.has(d.pointerId)) {
627
+ if (s.set(d.pointerId, { x: d.clientX, y: d.clientY }), r !== null && l !== null && d.pointerId === c) {
628
+ const v = d.clientX - l.x, C = d.clientY - l.y;
629
629
  Math.sqrt(v * v + C * C) > f && u();
630
630
  }
631
631
  if (s.size >= 2) {
@@ -645,32 +645,32 @@ function ke(t) {
645
645
  return;
646
646
  }
647
647
  }
648
- if (!(i && i.pointerId !== null && (De(t, i, a), i.isDragging))) {
649
- if (a.target.contentEditable !== "plaintext-only" || t.spacePressed && e.mousedown) {
650
- const v = a.clientX - e.x, C = a.clientY - e.y;
648
+ if (!(i && i.pointerId !== null && (De(t, i, d), i.isDragging))) {
649
+ if (d.target.contentEditable !== "plaintext-only" || t.spacePressed && e.mousedown) {
650
+ const v = d.clientX - e.x, C = d.clientY - e.y;
651
651
  e.onMove(v, C);
652
652
  }
653
- e.x = a.clientX, e.y = a.clientY;
653
+ e.x = d.clientX, e.y = d.clientY;
654
654
  }
655
- }, M = (a) => {
656
- if (a.stopPropagation(), a.pointerType === "touch" && (s.delete(a.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId !== null) {
655
+ }, M = (d) => {
656
+ if (d.pointerType === "touch" && (s.delete(d.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId !== null) {
657
657
  const v = i.isDragging;
658
- if (Me(t, i, a), y(a.target, a.pointerId), v)
658
+ if (Me(t, i, d), y(d.target, d.pointerId), v)
659
659
  return;
660
660
  }
661
- e.mousedown && (y(a.target, a.pointerId), e.clear());
661
+ e.mousedown && (y(d.target, d.pointerId), e.clear());
662
662
  }, E = () => {
663
663
  u(), e.mousedown && e.clear(), i && (i.isDragging || i.pointerId !== null) && ct(t, i);
664
- }, L = (a) => {
665
- a.stopPropagation(), a.pointerType === "touch" && (s.delete(a.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId === a.pointerId && ct(t, i), M(a);
666
- }, k = (a) => {
667
- if (a.preventDefault(), a.button !== 2 || !t.editable) return;
668
- const v = a.target;
664
+ }, L = (d) => {
665
+ d.pointerType === "touch" && (s.delete(d.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId === d.pointerId && ct(t, i), M(d);
666
+ }, k = (d) => {
667
+ if (d.preventDefault(), d.button !== 2 || !t.editable) return;
668
+ const v = d.target;
669
669
  lt(v) && !v.classList.contains("selected") && t.selectNode(v), setTimeout(() => {
670
- t.dragMoveHelper.moved || t.bus.fire("showContextMenu", a);
670
+ t.dragMoveHelper.moved || t.bus.fire("showContextMenu", d);
671
671
  }, 200);
672
- }, R = (a) => {
673
- a.stopPropagation(), a.preventDefault(), a.ctrlKey || a.metaKey ? a.deltaY < 0 ? K(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && K(t, "out", t.dragMoveHelper) : a.shiftKey ? t.move(-a.deltaY, 0) : t.move(-a.deltaX, -a.deltaY);
672
+ }, R = (d) => {
673
+ d.stopPropagation(), d.preventDefault(), d.ctrlKey || d.metaKey ? d.deltaY < 0 ? K(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && K(t, "out", t.dragMoveHelper) : d.shiftKey ? t.move(-d.deltaY, 0) : t.move(-d.deltaX, -d.deltaY);
674
674
  }, { container: D } = t;
675
675
  return Dt([
676
676
  { dom: D, evt: "pointerdown", func: S },
@@ -716,10 +716,10 @@ const z = document, O = "http://www.w3.org/2000/svg", it = function(t) {
716
716
  let l = s;
717
717
  r === "middle" ? l = s - e / 2 : r === "end" && (l = s - e), t.style.left = `${l}px`, t.style.top = `${i - n / 2}px`, t.style.visibility = "visible";
718
718
  }, ht = function(t, e, n, o) {
719
- const { anchor: s = "middle", color: i, dataType: r, svgId: l } = o, d = document.createElement("div");
720
- d.className = "svg-label", d.style.color = i || "#666";
719
+ const { anchor: s = "middle", color: i, dataType: r, svgId: l } = o, a = document.createElement("div");
720
+ a.className = "svg-label", a.style.color = i || "#666";
721
721
  const c = "label-" + l;
722
- return d.id = c, d.innerHTML = t, d.dataset.type = r, d.dataset.svgId = l, d.dataset.x = e.toString(), d.dataset.y = n.toString(), d.dataset.anchor = s, d;
722
+ return a.id = c, a.innerHTML = t, a.dataset.type = r, a.dataset.svgId = l, a.dataset.x = e.toString(), a.dataset.y = n.toString(), a.dataset.anchor = s, a;
723
723
  }, Ht = function(t, e, n) {
724
724
  const o = z.createElementNS(O, "path");
725
725
  return $(o, {
@@ -750,8 +750,8 @@ const z = document, O = "http://www.w3.org/2000/svg", it = function(t) {
750
750
  d: n
751
751
  }
752
752
  ].forEach((r, l) => {
753
- const d = r.d, c = z.createElementNS(O, "path"), h = {
754
- d,
753
+ const a = r.d, c = z.createElementNS(O, "path"), h = {
754
+ d: a,
755
755
  stroke: o?.stroke || "rgb(227, 125, 116)",
756
756
  fill: "none",
757
757
  "stroke-linecap": o?.strokeLinecap || "cap",
@@ -760,7 +760,7 @@ const z = document, O = "http://www.w3.org/2000/svg", it = function(t) {
760
760
  o?.opacity !== void 0 && (h.opacity = String(o.opacity)), $(c, h), l === 0 && c.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
761
761
  const f = z.createElementNS(O, "path");
762
762
  $(f, {
763
- d,
763
+ d: a,
764
764
  stroke: "transparent",
765
765
  fill: "none",
766
766
  "stroke-width": "15"
@@ -791,23 +791,23 @@ const z = document, O = "http://www.w3.org/2000/svg", it = function(t) {
791
791
  obj: n
792
792
  }));
793
793
  });
794
- }, Pe = function(t) {
794
+ }, Ae = function(t) {
795
795
  const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, s = e.offsetWidth, i = e.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
796
796
  this.lines.innerHTML = "";
797
797
  for (let l = 0; l < r.length; l++) {
798
- const d = r[l], c = d.querySelector("me-tpc"), { offsetLeft: h, offsetTop: f } = I(this.nodes, c), u = c.offsetWidth, y = c.offsetHeight, m = d.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: f, cL: h, cW: u, cH: y, direction: m, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, b = c.nodeObj.branchColor || g[l % g.length];
799
- if (c.style.borderColor = b, this.lines.appendChild(Ht(p, b, "3")), t && t !== d)
798
+ const a = r[l], c = a.querySelector("me-tpc"), { offsetLeft: h, offsetTop: f } = I(this.nodes, c), u = c.offsetWidth, y = c.offsetHeight, m = a.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: f, cL: h, cW: u, cH: y, direction: m, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, b = c.nodeObj.branchColor || g[l % g.length];
799
+ if (c.style.borderColor = b, this.lines.appendChild(Ht(p, b, "3")), t && t !== a)
800
800
  continue;
801
- const w = j("subLines"), x = d.lastChild;
802
- x.tagName === "svg" && x.remove(), d.appendChild(w), Ot(this, w, b, d, m, !0);
801
+ const w = j("subLines"), x = a.lastChild;
802
+ x.tagName === "svg" && x.remove(), a.appendChild(w), Ot(this, w, b, a, m, !0);
803
803
  }
804
804
  this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
805
805
  }, Ot = function(t, e, n, o, s, i) {
806
806
  const r = o.firstChild, l = o.children[1].children;
807
807
  if (l.length === 0) return;
808
- const d = r.offsetTop, c = r.offsetLeft, h = r.offsetWidth, f = r.offsetHeight;
808
+ const a = r.offsetTop, c = r.offsetLeft, h = r.offsetWidth, f = r.offsetHeight;
809
809
  for (let u = 0; u < l.length; u++) {
810
- const y = l[u], m = y.firstChild, p = m.offsetTop, g = m.offsetLeft, b = m.offsetWidth, w = m.offsetHeight, x = m.firstChild.nodeObj.branchColor || n, S = t.generateSubBranch({ pT: d, pL: c, pW: h, pH: f, cT: p, cL: g, cW: b, cH: w, direction: s, isFirst: i });
810
+ const y = l[u], m = y.firstChild, p = m.offsetTop, g = m.offsetLeft, b = m.offsetWidth, w = m.offsetHeight, x = m.firstChild.nodeObj.branchColor || n, S = t.generateSubBranch({ pT: a, pL: c, pW: h, pH: f, cT: p, cL: g, cW: b, cH: w, direction: s, isFirst: i });
811
811
  e.appendChild(Ht(S, x, "2"));
812
812
  const T = m.children[1];
813
813
  if (T) {
@@ -816,8 +816,8 @@ const z = document, O = "http://www.w3.org/2000/svg", it = function(t) {
816
816
  continue;
817
817
  Ot(t, e, x, y, s);
818
818
  }
819
- }, Ae = '<?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>', He = '<?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>', Ie = '<?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>', Oe = '<?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>', Ye = '<?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>', Be = '<?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>', Re = '<?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>', We = {
820
- side: Ae,
819
+ }, Pe = '<?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>', He = '<?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>', Ie = '<?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>', Oe = '<?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>', Ye = '<?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>', Be = '<?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>', Re = '<?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>', We = {
820
+ side: Pe,
821
821
  left: He,
822
822
  right: Ie,
823
823
  full: Oe,
@@ -840,13 +840,13 @@ function Xe(t) {
840
840
  mapCenterX: y,
841
841
  mapCenterY: m
842
842
  };
843
- }, d = () => {
843
+ }, a = () => {
844
844
  if (r) {
845
845
  const c = t.container.getBoundingClientRect(), h = c.width / 2, f = c.height / 2, u = h - r.mapCenterX * t.scaleVal, y = f - r.mapCenterY * t.scaleVal, m = u - r.currentTransform.x, p = y - r.currentTransform.y;
846
846
  t.move(m, p);
847
847
  }
848
848
  };
849
- return t.el.addEventListener("fullscreenchange", d), n.onclick = () => {
849
+ return t.el.addEventListener("fullscreenchange", a), n.onclick = () => {
850
850
  l(), document.fullscreenElement !== t.el ? t.el.requestFullscreen() : document.exitFullscreen();
851
851
  }, o.onclick = () => {
852
852
  t.toCenter();
@@ -935,17 +935,17 @@ function J(t, e, n, o, s) {
935
935
  y2: s + ""
936
936
  });
937
937
  }
938
- function St(t, e, n, o, s, i, r, l, d, c) {
939
- const h = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${l} ${d}`;
938
+ function St(t, e, n, o, s, i, r, l, a, c) {
939
+ const h = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${l} ${a}`;
940
940
  if (t.line.setAttribute("d", h), c.style) {
941
941
  const p = c.style;
942
942
  p.stroke && t.line.setAttribute("stroke", p.stroke), p.strokeWidth && t.line.setAttribute("stroke-width", String(p.strokeWidth)), p.strokeDasharray && t.line.setAttribute("stroke-dasharray", p.strokeDasharray), p.strokeLinecap && t.line.setAttribute("stroke-linecap", p.strokeLinecap), p.opacity !== void 0 && t.line.setAttribute("opacity", String(p.opacity));
943
943
  }
944
944
  const f = t.querySelectorAll('path[stroke="transparent"]');
945
945
  f.length > 0 && f[0].setAttribute("d", h);
946
- const u = et(i, r, l, d);
946
+ const u = et(i, r, l, a);
947
947
  if (u) {
948
- const p = `M ${u.x1} ${u.y1} L ${l} ${d} L ${u.x2} ${u.y2}`;
948
+ const p = `M ${u.x1} ${u.y1} L ${l} ${a} L ${u.x2} ${u.y2}`;
949
949
  if (t.arrow1.setAttribute("d", p), f.length > 1 && f[1].setAttribute("d", p), c.style) {
950
950
  const g = c.style;
951
951
  g.stroke && t.arrow1.setAttribute("stroke", g.stroke), g.strokeWidth && t.arrow1.setAttribute("stroke-width", String(g.strokeWidth)), g.strokeLinecap && t.arrow1.setAttribute("stroke-linecap", g.strokeLinecap), g.opacity !== void 0 && t.arrow1.setAttribute("opacity", String(g.opacity));
@@ -961,7 +961,7 @@ function St(t, e, n, o, s, i, r, l, d, c) {
961
961
  }
962
962
  }
963
963
  }
964
- const { x: y, y: m } = Yt(e, n, o, s, i, r, l, d);
964
+ const { x: y, y: m } = Yt(e, n, o, s, i, r, l, a);
965
965
  if (t.labelEl && je(t.labelEl, y, m), c.style?.labelColor) {
966
966
  const p = t.labelEl;
967
967
  p && (p.style.color = c.style.labelColor);
@@ -969,12 +969,12 @@ function St(t, e, n, o, s, i, r, l, d, c) {
969
969
  nn(t);
970
970
  }
971
971
  function ot(t, e, n) {
972
- const { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, l = o + i / 2, d = s + r / 2, c = l + n.x, h = d + n.y;
972
+ const { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, l = o + i / 2, a = s + r / 2, c = l + n.x, h = a + n.y;
973
973
  return {
974
974
  w: i,
975
975
  h: r,
976
976
  cx: l,
977
- cy: d,
977
+ cy: a,
978
978
  ctrlX: c,
979
979
  ctrlY: h
980
980
  };
@@ -988,7 +988,7 @@ function V(t) {
988
988
  };
989
989
  }
990
990
  const _e = function(t, e, n) {
991
- const o = I(t.nodes, e), s = I(t.nodes, n), i = o.offsetLeft + e.offsetWidth / 2, r = o.offsetTop + e.offsetHeight / 2, l = s.offsetLeft + n.offsetWidth / 2, d = s.offsetTop + n.offsetHeight / 2, c = l - i, h = d - r, f = Math.sqrt(c * c + h * h), u = Math.max(50, Math.min(200, f * 0.3)), y = Math.abs(c), m = Math.abs(h);
991
+ const o = I(t.nodes, e), s = I(t.nodes, n), i = o.offsetLeft + e.offsetWidth / 2, r = o.offsetTop + e.offsetHeight / 2, l = s.offsetLeft + n.offsetWidth / 2, a = s.offsetTop + n.offsetHeight / 2, c = l - i, h = a - r, f = Math.sqrt(c * c + h * h), u = Math.max(50, Math.min(200, f * 0.3)), y = Math.abs(c), m = Math.abs(h);
992
992
  let p, g;
993
993
  if (f < 150) {
994
994
  const w = e.closest("me-main").className === "lhs" ? -1 : 1;
@@ -1011,16 +1011,16 @@ const _e = function(t, e, n) {
1011
1011
  const k = _e(t, e, n);
1012
1012
  o.delta1 = k.delta1, o.delta2 = k.delta2;
1013
1013
  }
1014
- const i = ot(t, e, o.delta1), r = ot(t, n, o.delta2), { x: l, y: d } = V(i), { ctrlX: c, ctrlY: h } = i, { ctrlX: f, ctrlY: u } = r, { x: y, y: m } = V(r), p = et(f, u, y, m);
1014
+ const i = ot(t, e, o.delta1), r = ot(t, n, o.delta2), { x: l, y: a } = V(i), { ctrlX: c, ctrlY: h } = i, { ctrlX: f, ctrlY: u } = r, { x: y, y: m } = V(r), p = et(f, u, y, m);
1015
1015
  if (!p) return;
1016
1016
  const g = `M ${p.x1} ${p.y1} L ${y} ${m} L ${p.x2} ${p.y2}`;
1017
1017
  let b = "";
1018
1018
  if (o.bidirectional) {
1019
- const k = et(c, h, l, d);
1019
+ const k = et(c, h, l, a);
1020
1020
  if (!k) return;
1021
- b = `M ${k.x1} ${k.y1} L ${l} ${d} L ${k.x2} ${k.y2}`;
1021
+ b = `M ${k.x1} ${k.y1} L ${l} ${a} L ${k.x2} ${k.y2}`;
1022
1022
  }
1023
- const w = Ne(`M ${l} ${d} C ${c} ${h} ${f} ${u} ${y} ${m}`, g, b, o.style), { x, y: S } = Yt(l, d, c, h, f, u, y, m), T = o.style?.labelColor || "rgb(235, 95, 82)", M = "arrow-" + o.id;
1023
+ const w = Ne(`M ${l} ${a} C ${c} ${h} ${f} ${u} ${y} ${m}`, g, b, o.style), { x, y: S } = Yt(l, a, c, h, f, u, y, m), T = o.style?.labelColor || "rgb(235, 95, 82)", M = "arrow-" + o.id;
1024
1024
  w.id = M;
1025
1025
  const E = t.markdown ? t.markdown(o.label, o) : o.label, L = ht(E, x, S, {
1026
1026
  anchor: "middle",
@@ -1097,18 +1097,18 @@ const _e = function(t, e, n) {
1097
1097
  }, rt = function(t) {
1098
1098
  t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && en(t.currentArrow);
1099
1099
  }, Bt = function(t, e, n, o) {
1100
- const { linkController: s, P2: i, P3: r, line1: l, line2: d, nodes: c, map: h, currentArrow: f, bus: u } = t;
1100
+ const { linkController: s, P2: i, P3: r, line1: l, line2: a, nodes: c, map: h, currentArrow: f, bus: u } = t;
1101
1101
  if (!f) return;
1102
1102
  s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", c.appendChild(s), c.appendChild(i), c.appendChild(r), tn(f, qe);
1103
1103
  let { x: y, y: m } = V(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: b, ctrlY: w } = o, { x, y: S } = V(o);
1104
- i.style.cssText = `top:${g}px;left:${p}px;`, r.style.cssText = `top:${w}px;left:${b}px;`, J(l, y, m, p, g), J(d, b, w, x, S), t.helper1 = Et.create(i), t.helper2 = Et.create(r), t.helper1.init(h, (T, M) => {
1104
+ i.style.cssText = `top:${g}px;left:${p}px;`, r.style.cssText = `top:${w}px;left:${b}px;`, J(l, y, m, p, g), J(a, b, w, x, S), t.helper1 = Et.create(i), t.helper2 = Et.create(r), t.helper1.init(h, (T, M) => {
1105
1105
  p = p + T / t.scaleVal, g = g + M / t.scaleVal;
1106
1106
  const E = V({ ...n, ctrlX: p, ctrlY: g });
1107
1107
  y = E.x, m = E.y, i.style.top = g + "px", i.style.left = p + "px", St(f, y, m, p, g, b, w, x, S, e), J(l, y, m, p, g), e.delta1.x = p - n.cx, e.delta1.y = g - n.cy, u.fire("updateArrowDelta", e);
1108
1108
  }), t.helper2.init(h, (T, M) => {
1109
1109
  b = b + T / t.scaleVal, w = w + M / t.scaleVal;
1110
1110
  const E = V({ ...o, ctrlX: b, ctrlY: w });
1111
- x = E.x, S = E.y, r.style.top = w + "px", r.style.left = b + "px", St(f, y, m, p, g, b, w, x, S, e), J(d, b, w, x, S), e.delta2.x = b - o.cx, e.delta2.y = w - o.cy, u.fire("updateArrowDelta", e);
1111
+ x = E.x, S = E.y, r.style.top = w + "px", r.style.left = b + "px", St(f, y, m, p, g, b, w, x, S, e), J(a, b, w, x, S), e.delta2.x = b - o.cx, e.delta2.y = w - o.cy, u.fire("updateArrowDelta", e);
1112
1112
  });
1113
1113
  };
1114
1114
  function on() {
@@ -1141,9 +1141,9 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1141
1141
  }, Symbol.toStringTag, { value: "Module" })), cn = function(t) {
1142
1142
  if (t.length === 0) throw new Error("No selected node.");
1143
1143
  if (t.length === 1) {
1144
- const d = t[0].nodeObj, c = t[0].nodeObj.parent;
1144
+ const a = t[0].nodeObj, c = t[0].nodeObj.parent;
1145
1145
  if (!c) throw new Error("Can not select root node.");
1146
- const h = c.children.findIndex((f) => d === f);
1146
+ const h = c.children.findIndex((f) => a === f);
1147
1147
  return {
1148
1148
  parent: c.id,
1149
1149
  start: h,
@@ -1151,8 +1151,8 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1151
1151
  };
1152
1152
  }
1153
1153
  let e = 0;
1154
- const n = t.map((d) => {
1155
- let c = d.nodeObj;
1154
+ const n = t.map((a) => {
1155
+ let c = a.nodeObj;
1156
1156
  const h = [];
1157
1157
  for (; c.parent; ) {
1158
1158
  const f = c.parent, y = f.children?.indexOf(c);
@@ -1162,13 +1162,13 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1162
1162
  });
1163
1163
  let o = 0;
1164
1164
  t: for (; o < e; o++) {
1165
- const d = n[0][o]?.node;
1165
+ const a = n[0][o]?.node;
1166
1166
  for (let c = 1; c < n.length; c++)
1167
- if (n[c][o]?.node !== d)
1167
+ if (n[c][o]?.node !== a)
1168
1168
  break t;
1169
1169
  }
1170
1170
  if (!o) throw new Error("Can not select root node.");
1171
- const s = n.map((d) => d[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, l = n[0][o - 1].node;
1171
+ const s = n.map((a) => a[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, l = n[0][o - 1].node;
1172
1172
  if (!l.parent) throw new Error("Please select nodes in the same main topic.");
1173
1173
  return {
1174
1174
  parent: l.id,
@@ -1192,14 +1192,14 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1192
1192
  let i;
1193
1193
  return s.parent ? i = o.closest("me-main").className : i = t.findEle(s.children[n].id).closest("me-main").className, i;
1194
1194
  }, vt = function(t, e) {
1195
- const { id: n, label: o, parent: s, start: i, end: r, style: l } = e, { nodes: d, theme: c, summarySvg: h } = t, u = t.findEle(s).nodeObj, y = hn(t, e);
1195
+ const { id: n, label: o, parent: s, start: i, end: r, style: l } = e, { nodes: a, theme: c, summarySvg: h } = t, u = t.findEle(s).nodeObj, y = hn(t, e);
1196
1196
  let m = 1 / 0, p = 0, g = 0, b = 0;
1197
- for (let a = i; a <= r; a++) {
1198
- const v = u.children?.[a];
1197
+ for (let d = i; d <= r; d++) {
1198
+ const v = u.children?.[d];
1199
1199
  if (!v)
1200
1200
  return t.removeSummary(n), null;
1201
- const C = dn(t.findEle(v.id)), { offsetLeft: H, offsetTop: B } = I(d, C), N = i === r ? 10 : 20;
1202
- a === i && (g = B + N), a === r && (b = B + C.offsetHeight - N), H < m && (m = H), C.offsetWidth + H > p && (p = C.offsetWidth + H);
1201
+ const C = dn(t.findEle(v.id)), { offsetLeft: H, offsetTop: B } = I(a, C), N = i === r ? 10 : 20;
1202
+ d === i && (g = B + N), d === r && (b = B + C.offsetHeight - N), H < m && (m = H), C.offsetWidth + H > p && (p = C.offsetWidth + H);
1203
1203
  }
1204
1204
  let w, x;
1205
1205
  const S = u.parent ? 10 : 0, T = g + S, M = b + S, E = (T + M) / 2, L = l?.stroke || c.cssVar["--color"], k = l?.labelColor || c.cssVar["--color"], R = "s-" + n, D = t.markdown ? t.markdown(o, e) : o;
@@ -1208,8 +1208,8 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1208
1208
  return X.appendChild(w), t.labelContainer.appendChild(x), it(x), X.summaryObj = e, X.labelEl = x, h.appendChild(X), X;
1209
1209
  }, fn = function(t = {}) {
1210
1210
  if (!this.currentNodes) return;
1211
- const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = cn(e), l = { id: _(), parent: s, start: i, end: r, label: "summary", style: t.style }, d = vt(this, l);
1212
- n.push(l), this.editSummary(d), o.fire("operation", {
1211
+ const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = cn(e), l = { id: _(), parent: s, start: i, end: r, label: "summary", style: t.style }, a = vt(this, l);
1212
+ n.push(l), this.editSummary(a), o.fire("operation", {
1213
1213
  name: "createSummary",
1214
1214
  obj: l
1215
1215
  });
@@ -1248,12 +1248,12 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1248
1248
  renderSummary: yn,
1249
1249
  selectSummary: gn,
1250
1250
  unselectSummary: mn
1251
- }, Symbol.toStringTag, { value: "Module" })), A = "http://www.w3.org/2000/svg";
1251
+ }, Symbol.toStringTag, { value: "Module" })), P = "http://www.w3.org/2000/svg";
1252
1252
  function bn(t, e) {
1253
- const n = document.createElementNS(A, "svg");
1253
+ const n = document.createElementNS(P, "svg");
1254
1254
  return $(n, {
1255
1255
  version: "1.1",
1256
- xmlns: A,
1256
+ xmlns: P,
1257
1257
  height: t,
1258
1258
  width: e
1259
1259
  }), n;
@@ -1262,14 +1262,14 @@ function xn(t, e) {
1262
1262
  return (parseInt(t) - parseInt(e)) / 2;
1263
1263
  }
1264
1264
  function Cn(t, e, n, o) {
1265
- const s = document.createElementNS(A, "g");
1265
+ const s = document.createElementNS(P, "g");
1266
1266
  let i = "";
1267
1267
  return t.text ? i = t.text.textContent : i = t.childNodes[0].textContent, i.split(`
1268
- `).forEach((l, d) => {
1269
- const c = document.createElementNS(A, "text");
1268
+ `).forEach((l, a) => {
1269
+ const c = document.createElementNS(P, "text");
1270
1270
  $(c, {
1271
1271
  x: n + parseInt(e.paddingLeft) + "",
1272
- y: o + parseInt(e.paddingTop) + xn(e.lineHeight, e.fontSize) * (d + 1) + parseFloat(e.fontSize) * (d + 1) + "",
1272
+ y: o + parseInt(e.paddingTop) + xn(e.lineHeight, e.fontSize) * (a + 1) + parseFloat(e.fontSize) * (a + 1) + "",
1273
1273
  "text-anchor": "start",
1274
1274
  "font-family": e.fontFamily,
1275
1275
  "font-size": `${e.fontSize}`,
@@ -1281,7 +1281,7 @@ function Cn(t, e, n, o) {
1281
1281
  function En(t, e, n, o) {
1282
1282
  let s = "";
1283
1283
  t.nodeObj?.dangerouslySetInnerHTML ? s = t.nodeObj.dangerouslySetInnerHTML : t.text ? s = t.text.textContent : s = t.childNodes[0].textContent;
1284
- const i = document.createElementNS(A, "foreignObject");
1284
+ const i = document.createElementNS(P, "foreignObject");
1285
1285
  $(i, {
1286
1286
  x: n + parseInt(e.paddingLeft) + "",
1287
1287
  y: o + parseInt(e.paddingTop) + "",
@@ -1295,7 +1295,7 @@ function En(t, e, n, o) {
1295
1295
  }), r.innerHTML = s, i.appendChild(r), i;
1296
1296
  }
1297
1297
  function Sn(t, e) {
1298
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = document.createElementNS(A, "rect");
1298
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = document.createElementNS(P, "rect");
1299
1299
  return $(i, {
1300
1300
  x: o + "",
1301
1301
  y: s + "",
@@ -1309,7 +1309,7 @@ function Sn(t, e) {
1309
1309
  }), i;
1310
1310
  }
1311
1311
  function Q(t, e, n = !1) {
1312
- const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } = I(t.nodes, e), r = document.createElementNS(A, "rect");
1312
+ const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } = I(t.nodes, e), r = document.createElementNS(P, "rect");
1313
1313
  $(r, {
1314
1314
  x: s + "",
1315
1315
  y: i + "",
@@ -1321,13 +1321,13 @@ function Q(t, e, n = !1) {
1321
1321
  stroke: o.borderColor,
1322
1322
  "stroke-width": o.borderWidth
1323
1323
  });
1324
- const l = document.createElementNS(A, "g");
1324
+ const l = document.createElementNS(P, "g");
1325
1325
  l.appendChild(r);
1326
- let d;
1327
- return n ? d = En(e, o, s, i) : d = Cn(e, o, s, i), l.appendChild(d), l;
1326
+ let a;
1327
+ return n ? a = En(e, o, s, i) : a = Cn(e, o, s, i), l.appendChild(a), l;
1328
1328
  }
1329
1329
  function Tn(t, e) {
1330
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = document.createElementNS(A, "a"), r = document.createElementNS(A, "text");
1330
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = document.createElementNS(P, "a"), r = document.createElementNS(P, "text");
1331
1331
  return $(r, {
1332
1332
  x: o + "",
1333
1333
  y: s + parseInt(n.fontSize) + "",
@@ -1339,7 +1339,7 @@ function Tn(t, e) {
1339
1339
  }), r.innerHTML = e.textContent, i.appendChild(r), i.setAttribute("href", e.href), i;
1340
1340
  }
1341
1341
  function Ln(t, e) {
1342
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = document.createElementNS(A, "image");
1342
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = I(t.nodes, e), i = document.createElementNS(P, "image");
1343
1343
  return $(i, {
1344
1344
  x: o + "",
1345
1345
  y: s + "",
@@ -1349,7 +1349,7 @@ function Ln(t, e) {
1349
1349
  }), i;
1350
1350
  }
1351
1351
  const Z = 100, Dn = '<?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">', Mn = (t, e = !1) => {
1352
- const n = t.nodes, o = n.offsetHeight + Z * 2, s = n.offsetWidth + Z * 2, i = bn(o + "px", s + "px"), r = document.createElementNS(A, "svg"), l = document.createElementNS(A, "rect");
1352
+ const n = t.nodes, o = n.offsetHeight + Z * 2, s = n.offsetWidth + Z * 2, i = bn(o + "px", s + "px"), r = document.createElementNS(P, "svg"), l = document.createElementNS(P, "rect");
1353
1353
  $(l, {
1354
1354
  x: "0",
1355
1355
  y: "0",
@@ -1360,8 +1360,8 @@ const Z = 100, Dn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "
1360
1360
  const u = f.cloneNode(!0), { offsetLeft: y, offsetTop: m } = I(n, f.parentElement);
1361
1361
  u.setAttribute("x", `${y}`), u.setAttribute("y", `${m}`), r.appendChild(u);
1362
1362
  });
1363
- const d = n.querySelector(".lines")?.cloneNode(!0);
1364
- d && r.appendChild(d);
1363
+ const a = n.querySelector(".lines")?.cloneNode(!0);
1364
+ a && r.appendChild(a);
1365
1365
  const c = n.querySelector(".topiclinks")?.cloneNode(!0);
1366
1366
  c && r.appendChild(c);
1367
1367
  const h = n.querySelector(".summary")?.cloneNode(!0);
@@ -1394,7 +1394,7 @@ function $n(t) {
1394
1394
  const Nn = function(t = !1, e) {
1395
1395
  const n = Mn(this, t), o = kn(n, e);
1396
1396
  return new Blob([o], { type: "image/svg+xml" });
1397
- }, Pn = async function(t = !1, e) {
1397
+ }, An = async function(t = !1, e) {
1398
1398
  const n = this.exportSvg(t, e), o = await $n(n);
1399
1399
  return new Promise((s, i) => {
1400
1400
  const r = new Image();
@@ -1403,15 +1403,15 @@ const Nn = function(t = !1, e) {
1403
1403
  l.width = r.width, l.height = r.height, l.getContext("2d").drawImage(r, 0, 0), l.toBlob(s, "image/png", 1);
1404
1404
  }, r.src = o, r.onerror = i;
1405
1405
  });
1406
- }, An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1406
+ }, Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1407
1407
  __proto__: null,
1408
- exportPng: Pn,
1408
+ exportPng: An,
1409
1409
  exportSvg: Nn
1410
1410
  }, Symbol.toStringTag, { value: "Module" })), Hn = {}, In = {
1411
1411
  getObjById: tt,
1412
1412
  generateNewObj: Wt,
1413
1413
  layout: Xt,
1414
- linkDiv: Pe,
1414
+ linkDiv: Ae,
1415
1415
  editTopic: _t,
1416
1416
  createWrapper: zt,
1417
1417
  createParent: Ft,
@@ -1423,7 +1423,7 @@ const Nn = function(t = !1, e) {
1423
1423
  ...Hn,
1424
1424
  ...ln,
1425
1425
  ...wn,
1426
- ...An,
1426
+ ...Pn,
1427
1427
  init(t) {
1428
1428
  if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData) return new Error("MindElixir: `data` is required");
1429
1429
  t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, pt(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && Ve(this), this.layout(), this.linkDiv(), this.toCenter();
@@ -1432,24 +1432,24 @@ const Nn = function(t = !1, e) {
1432
1432
  this.disposable.forEach((t) => t()), 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.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, this.selection?.destroy(), this.selection = void 0;
1433
1433
  }
1434
1434
  };
1435
- function On({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: d, containerHeight: c }) {
1435
+ function On({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: a, containerHeight: c }) {
1436
1436
  let h = e + n / 2;
1437
1437
  const f = t + o / 2;
1438
1438
  let u;
1439
- d === F.LHS ? u = i + r : u = i;
1439
+ a === F.LHS ? u = i + r : u = i;
1440
1440
  const y = s + l / 2, p = (1 - Math.abs(y - f) / c) * 0.25 * (n / 2);
1441
- return d === F.LHS ? h = h - n / 10 - p : h = h + n / 10 + p, `M ${h} ${f} Q ${h} ${y} ${u} ${y}`;
1441
+ return a === F.LHS ? h = h - n / 10 - p : h = h + n / 10 + p, `M ${h} ${f} Q ${h} ${y} ${u} ${y}`;
1442
1442
  }
1443
- function Yn({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: d, isFirst: c }) {
1443
+ function Yn({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: a, isFirst: c }) {
1444
1444
  const h = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
1445
1445
  let f = 0, u = 0;
1446
1446
  c ? f = t + o / 2 : f = t + o;
1447
1447
  const y = s + l;
1448
1448
  let m = 0, p = 0, g = 0;
1449
1449
  const b = Math.abs(f - y) / 300 * h;
1450
- return d === F.LHS ? (g = e, m = g + h, p = g - h, u = i + h, `M ${m} ${f} C ${g} ${f} ${g + b} ${y} ${p} ${y} H ${u}`) : (g = e + n, m = g - h, p = g + h, u = i + r - h, `M ${m} ${f} C ${g} ${f} ${g - b} ${y} ${p} ${y} H ${u}`);
1450
+ return a === F.LHS ? (g = e, m = g + h, p = g - h, u = i + h, `M ${m} ${f} C ${g} ${f} ${g + b} ${y} ${p} ${y} H ${u}`) : (g = e + n, m = g - h, p = g + h, u = i + r - h, `M ${m} ${f} C ${g} ${f} ${g - b} ${y} ${p} ${y} H ${u}`);
1451
1451
  }
1452
- const Bn = "5.8.3-beta.1";
1452
+ const Bn = "5.8.3";
1453
1453
  function Rn(t) {
1454
1454
  return {
1455
1455
  x: 0,
@@ -1475,7 +1475,7 @@ function Y({
1475
1475
  toolBar: i,
1476
1476
  keypress: r,
1477
1477
  mouseSelectionButton: l,
1478
- selectionContainer: d,
1478
+ selectionContainer: a,
1479
1479
  before: c,
1480
1480
  newTopicName: h,
1481
1481
  allowUndo: f,
@@ -1495,7 +1495,7 @@ function Y({
1495
1495
  let L = null;
1496
1496
  const k = Object.prototype.toString.call(t);
1497
1497
  if (k === "[object HTMLDivElement]" ? L = t : k === "[object String]" && (L = document.querySelector(t)), !L) throw new Error("MindElixir: el is not a valid element");
1498
- L.style.position = "relative", L.innerHTML = "", this.el = L, this.disposable = [], this.before = c || {}, this.locale = n || "en", this.newTopicName = h || "New Node", this.contextMenu = s ?? !0, this.toolBar = i ?? !0, this.keypress = r ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = e ?? 1, this.editable = o ?? !0, this.allowUndo = f ?? !0, this.scaleSensitivity = b ?? 0.1, this.scaleMax = w ?? 1.4, this.scaleMin = x ?? 0.2, this.generateMainBranch = u || On, this.generateSubBranch = y || Yn, this.overflowHidden = m ?? !1, this.alignment = g ?? "root", this.handleWheel = S ?? !0, this.markdown = T || void 0, this.imageProxy = M || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Rn(this), this.bus = $e(), this.container = G.createElement("div"), this.selectionContainer = d || this.container, this.container.className = "map-container";
1498
+ L.style.position = "relative", L.innerHTML = "", this.el = L, this.disposable = [], this.before = c || {}, this.locale = n || "en", this.newTopicName = h || "New Node", this.contextMenu = s ?? !0, this.toolBar = i ?? !0, this.keypress = r ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = e ?? 1, this.editable = o ?? !0, this.allowUndo = f ?? !0, this.scaleSensitivity = b ?? 0.1, this.scaleMax = w ?? 1.4, this.scaleMin = x ?? 0.2, this.generateMainBranch = u || On, this.generateSubBranch = y || Yn, this.overflowHidden = m ?? !1, this.alignment = g ?? "root", this.handleWheel = S ?? !0, this.markdown = T || void 0, this.imageProxy = M || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Rn(this), this.bus = $e(), this.container = G.createElement("div"), this.selectionContainer = a || this.container, this.container.className = "map-container";
1499
1499
  const R = window.matchMedia("(prefers-color-scheme: dark)");
1500
1500
  this.theme = p || (R.matches ? ut : ft);
1501
1501
  const D = G.createElement("div");