mind-elixir 5.11.3 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const Qo = 0, es = 1, ts = 2, fe = {
1
+ const es = 0, ts = 1, ns = 2, fe = {
2
2
  name: "Latte",
3
3
  type: "light",
4
4
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -115,7 +115,7 @@ function ge(e) {
115
115
  })
116
116
  );
117
117
  }
118
- const L = (e, t) => {
118
+ const M = (e, t) => {
119
119
  let n = 0, o = 0;
120
120
  for (; t && t !== e; )
121
121
  n += t.offsetLeft, o += t.offsetTop, t = t.offsetParent;
@@ -267,7 +267,7 @@ function Et(e) {
267
267
  return () => {
268
268
  };
269
269
  }
270
- const O = {
270
+ const H = {
271
271
  LHS: "lhs",
272
272
  RHS: "rhs"
273
273
  }, Ct = function() {
@@ -286,9 +286,9 @@ const O = {
286
286
  St(this, n, t);
287
287
  }, St = function(e, t, n) {
288
288
  const o = document.createElement("me-main");
289
- o.className = O.LHS;
289
+ o.className = H.LHS;
290
290
  const s = document.createElement("me-main");
291
- s.className = O.RHS;
291
+ s.className = H.RHS;
292
292
  for (let i = 0; i < t.length; i++) {
293
293
  const l = t[i], { grp: c } = e.createWrapper(l);
294
294
  e.direction === 2 ? l.direction === 0 ? o.appendChild(c) : s.appendChild(c) : e.direction === 0 ? o.appendChild(c) : s.appendChild(c);
@@ -369,7 +369,7 @@ function Qe(e) {
369
369
  }
370
370
  const Lt = function(e) {
371
371
  if (!e) return;
372
- const t = document.createElement("div"), n = e.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = L(this.nodes, e);
372
+ const t = document.createElement("div"), n = e.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = M(this.nodes, e);
373
373
  this.nodes.appendChild(t), t.id = "input-box", t.textContent = o, t.contentEditable = "plaintext-only", t.spellcheck = !1;
374
374
  const l = getComputedStyle(e);
375
375
  t.style.cssText = `
@@ -511,7 +511,7 @@ const $t = function({ map: e, direction: t }, n) {
511
511
  }
512
512
  const i = n || this.generateNewObj();
513
513
  if (!s.parent?.parent) {
514
- const a = o.closest("me-main").className === O.LHS ? 0 : 1;
514
+ const a = o.closest("me-main").className === H.LHS ? 0 : 1;
515
515
  i.direction = a;
516
516
  }
517
517
  Pt(i, e, s), R(this.nodeData);
@@ -893,12 +893,12 @@ function An(e, t) {
893
893
  ArrowLeft: (r) => {
894
894
  if (r.metaKey || r.ctrlKey)
895
895
  return e.initLeft();
896
- Oe(e, O.LHS);
896
+ Oe(e, H.LHS);
897
897
  },
898
898
  ArrowRight: (r) => {
899
899
  if (r.metaKey || r.ctrlKey)
900
900
  return e.initRight();
901
- Oe(e, O.RHS);
901
+ Oe(e, H.RHS);
902
902
  },
903
903
  PageUp: () => e.moveUpNode(),
904
904
  PageDown: () => {
@@ -972,8 +972,8 @@ function Pn(e) {
972
972
  this.clear();
973
973
  return;
974
974
  }
975
- const x = (/* @__PURE__ */ new Date()).getTime(), E = x - this.lastTap, S = E < this.DOUBLE_CLICK_THRESHOLD && E > 0 && this.lastTapTarget === f.target;
976
- this.lastTap = x, this.lastTapTarget = f.target, S && y(f);
975
+ const x = (/* @__PURE__ */ new Date()).getTime(), S = x - this.lastTap, C = S < this.DOUBLE_CLICK_THRESHOLD && S > 0 && this.lastTapTarget === f.target;
976
+ this.lastTap = x, this.lastTapTarget = f.target, C && y(f);
977
977
  },
978
978
  clear() {
979
979
  this.lastTap = 0, this.lastTapTarget = null;
@@ -1001,15 +1001,15 @@ function Pn(e) {
1001
1001
  handlePointerMove(f) {
1002
1002
  if (f.pointerType !== "touch" || !this.activePointers.has(f.pointerId)) return !1;
1003
1003
  if (this.activePointers.set(f.pointerId, { x: f.clientX, y: f.clientY }), this.activePointers.size >= 2) {
1004
- const [y, x] = Array.from(this.activePointers.values()), E = De(y, x);
1004
+ const [y, x] = Array.from(this.activePointers.values()), S = De(y, x);
1005
1005
  if (this.lastDistance !== null && this.lastDistance > 0) {
1006
- const S = E / this.lastDistance;
1007
- e.scale(e.scaleVal * S, {
1006
+ const C = S / this.lastDistance;
1007
+ e.scale(e.scaleVal * C, {
1008
1008
  x: (y.x + x.x) / 2,
1009
1009
  y: (y.y + x.y) / 2
1010
1010
  });
1011
1011
  }
1012
- return this.lastDistance = E, !0;
1012
+ return this.lastDistance = S, !0;
1013
1013
  }
1014
1014
  return !1;
1015
1015
  },
@@ -1041,10 +1041,10 @@ function Pn(e) {
1041
1041
  }
1042
1042
  }, a = (f, y) => {
1043
1043
  if (f.closest("#input-box")) return !1;
1044
- const x = f.closest(".svg-label"), E = f.closest(".topiclinks, .summary"), S = x ? { type: x.dataset.type, element: document.getElementById(x.dataset.svgId) } : E ? { type: E.classList.contains("topiclinks") ? "arrow" : "summary", element: f.closest("g") } : null;
1045
- if (!S?.type || !S?.element) return !1;
1046
- const { type: T, element: _ } = S;
1047
- return e.clearSelection(), T === "arrow" ? y ? e.editArrowLabel(_) : e.selectArrow(_) : y ? e.editSummary(_) : e.selectSummary(_), !0;
1044
+ const x = f.closest(".svg-label"), S = f.closest(".topiclinks, .summary"), C = x ? { type: x.dataset.type, element: document.getElementById(x.dataset.svgId) } : S ? { type: S.classList.contains("topiclinks") ? "arrow" : "summary", element: f.closest("g") } : null;
1045
+ if (!C?.type || !C?.element) return !1;
1046
+ const { type: T, element: D } = C;
1047
+ return e.clearSelection(), T === "arrow" ? y ? e.editArrowLabel(D) : e.selectArrow(D) : y ? e.editSummary(D) : e.selectSummary(D), !0;
1048
1048
  }, d = (f) => {
1049
1049
  if (f.pointerType === "mouse" && f.button !== 0) return;
1050
1050
  if (e.helper1?.moved) {
@@ -1085,8 +1085,8 @@ function Pn(e) {
1085
1085
  if (t.handlePointerDown(f), t.mousedown && (e.ptState = i.Pan), f.button === 0 || f.pointerType === "touch")
1086
1086
  if (te(y)) {
1087
1087
  e.selection?.cancel();
1088
- const E = e.currentNodes || [];
1089
- if (f.ctrlKey || f.metaKey || e.mobileMultiSelect ? E.includes(y) ? o = y : ((e.currentArrow || e.currentSummary) && e.clearSelection(), e.selection?.select(y)) : E.includes(y) || e.selectNode(y), !e.editable) return;
1088
+ const S = e.currentNodes || [];
1089
+ if (f.ctrlKey || f.metaKey || e.mobileMultiSelect ? S.includes(y) ? o = y : ((e.currentArrow || e.currentSummary) && e.clearSelection(), e.selection?.select(y)) : S.includes(y) || e.selectNode(y), !e.editable) return;
1090
1090
  f.pointerType === "touch" ? (e.ptState = i.DragWait, r.start(f, (T) => {
1091
1091
  Me(e, c, T, !0) && (e.ptState = i.Drag, y.setPointerCapture(T.pointerId));
1092
1092
  })) : Me(e, c, f, !1) && (e.ptState = i.Drag, y.setPointerCapture(f.pointerId));
@@ -1136,7 +1136,7 @@ function Pn(e) {
1136
1136
  e.move(-f.deltaX, -f.deltaY);
1137
1137
  }, w = (f) => {
1138
1138
  f.code === "Space" && (e.spacePressed = !0, e.container.classList.add("space-pressed"));
1139
- }, C = (f) => {
1139
+ }, E = (f) => {
1140
1140
  f.code === "Space" && (e.spacePressed = !1, e.container.classList.remove("space-pressed"));
1141
1141
  };
1142
1142
  return qe([
@@ -1149,7 +1149,7 @@ function Pn(e) {
1149
1149
  { dom: n, evt: "wheel", func: typeof e.handleWheel == "function" ? e.handleWheel : m },
1150
1150
  { dom: n, evt: "blur", func: p },
1151
1151
  { dom: n, evt: "keydown", func: w },
1152
- { dom: n, evt: "keyup", func: C }
1152
+ { dom: n, evt: "keyup", func: E }
1153
1153
  ]);
1154
1154
  }
1155
1155
  function On() {
@@ -1176,7 +1176,7 @@ function On() {
1176
1176
  }
1177
1177
  };
1178
1178
  }
1179
- const M = "http://www.w3.org/2000/svg", re = function(e) {
1179
+ const A = "http://www.w3.org/2000/svg", re = function(e) {
1180
1180
  const t = e.clientWidth, n = e.clientHeight, o = e.dataset, s = Number(o.x), i = Number(o.y), l = o.anchor;
1181
1181
  let c = s;
1182
1182
  l === "middle" ? c = s - t / 2 : l === "end" && (c = s - t), e.style.left = `${c}px`, e.style.top = `${i - n / 2}px`, e.style.visibility = "visible";
@@ -1186,7 +1186,7 @@ const M = "http://www.w3.org/2000/svg", re = function(e) {
1186
1186
  const a = "label-" + c;
1187
1187
  return r.id = a, r.innerHTML = e, r.dataset.type = l, r.dataset.svgId = c, r.dataset.x = t.toString(), r.dataset.y = n.toString(), r.dataset.anchor = s, r;
1188
1188
  }, it = function(e, t, n) {
1189
- const o = document.createElementNS(M, "path");
1189
+ const o = document.createElementNS(A, "path");
1190
1190
  return k(o, {
1191
1191
  d: e,
1192
1192
  stroke: t || "#666",
@@ -1194,13 +1194,13 @@ const M = "http://www.w3.org/2000/svg", re = function(e) {
1194
1194
  "stroke-width": n
1195
1195
  }), o;
1196
1196
  }, z = function(e) {
1197
- const t = document.createElementNS(M, "svg");
1197
+ const t = document.createElementNS(A, "svg");
1198
1198
  return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
1199
1199
  }, je = function() {
1200
- const e = document.createElementNS(M, "line");
1200
+ const e = document.createElementNS(A, "line");
1201
1201
  return e.setAttribute("stroke", "#4dc4ff"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e.setAttribute("opacity", "0.45"), e;
1202
1202
  }, Hn = function(e, t, n, o) {
1203
- const s = document.createElementNS(M, "g");
1203
+ const s = document.createElementNS(A, "g");
1204
1204
  return [
1205
1205
  {
1206
1206
  name: "line",
@@ -1215,7 +1215,7 @@ const M = "http://www.w3.org/2000/svg", re = function(e) {
1215
1215
  d: n
1216
1216
  }
1217
1217
  ].forEach((l, c) => {
1218
- const r = l.d, a = document.createElementNS(M, "path"), d = {
1218
+ const r = l.d, a = document.createElementNS(A, "path"), d = {
1219
1219
  d: r,
1220
1220
  stroke: o?.stroke || "rgb(227, 125, 116)",
1221
1221
  fill: "none",
@@ -1223,7 +1223,7 @@ const M = "http://www.w3.org/2000/svg", re = function(e) {
1223
1223
  "stroke-width": String(o?.strokeWidth || "2")
1224
1224
  };
1225
1225
  o?.opacity !== void 0 && (d.opacity = String(o.opacity)), k(a, d), c === 0 && a.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
1226
- const h = document.createElementNS(M, "path");
1226
+ const h = document.createElementNS(A, "path");
1227
1227
  k(h, {
1228
1228
  d: r,
1229
1229
  stroke: "transparent",
@@ -1262,11 +1262,11 @@ const M = "http://www.w3.org/2000/svg", re = function(e) {
1262
1262
  const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight, l = this.map.querySelectorAll("me-main > me-wrapper");
1263
1263
  this.lines.innerHTML = "";
1264
1264
  for (let c = 0; c < l.length; c++) {
1265
- const r = l[c], a = r.querySelector("me-tpc"), { offsetLeft: d, offsetTop: h } = L(this.nodes, a), u = a.offsetWidth, b = a.offsetHeight, v = r.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: h, cL: d, cW: u, cH: b, direction: v, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, m = a.nodeObj.branchColor || g[c % g.length];
1265
+ const r = l[c], a = r.querySelector("me-tpc"), { offsetLeft: d, offsetTop: h } = M(this.nodes, a), u = a.offsetWidth, b = a.offsetHeight, v = r.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: h, cL: d, cW: u, cH: b, direction: v, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, m = a.nodeObj.branchColor || g[c % g.length];
1266
1266
  if (a.style.borderColor = m, this.lines.appendChild(it(p, m, "3")), e && e !== r)
1267
1267
  continue;
1268
- const w = z("subLines"), C = r.lastChild;
1269
- C.tagName === "svg" && C.remove(), r.appendChild(w), lt(this, w, m, r, v, !0);
1268
+ const w = z("subLines"), E = r.lastChild;
1269
+ E.tagName === "svg" && E.remove(), r.appendChild(w), lt(this, w, m, r, v, !0);
1270
1270
  }
1271
1271
  this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
1272
1272
  }, lt = function(e, t, n, o, s, i) {
@@ -1274,14 +1274,14 @@ const M = "http://www.w3.org/2000/svg", re = function(e) {
1274
1274
  if (c.length === 0) return;
1275
1275
  const r = l.offsetTop, a = l.offsetLeft, d = l.offsetWidth, h = l.offsetHeight;
1276
1276
  for (let u = 0; u < c.length; u++) {
1277
- const b = c[u], v = b.firstChild, p = v.offsetTop, g = v.offsetLeft, m = v.offsetWidth, w = v.offsetHeight, C = v.firstChild.nodeObj.branchColor || n, N = e.generateSubBranch({ pT: r, pL: a, pW: d, pH: h, cT: p, cL: g, cW: m, cH: w, direction: s, isFirst: i });
1278
- t.appendChild(it(N, C, "2"));
1277
+ const b = c[u], v = b.firstChild, p = v.offsetTop, g = v.offsetLeft, m = v.offsetWidth, w = v.offsetHeight, E = v.firstChild.nodeObj.branchColor || n, N = e.generateSubBranch({ pT: r, pL: a, pW: d, pH: h, cT: p, cL: g, cW: m, cH: w, direction: s, isFirst: i });
1278
+ t.appendChild(it(N, E, "2"));
1279
1279
  const f = v.children[1];
1280
1280
  if (f) {
1281
1281
  if (!f.expanded) continue;
1282
1282
  } else
1283
1283
  continue;
1284
- lt(e, t, C, b, s);
1284
+ lt(e, t, E, b, s);
1285
1285
  }
1286
1286
  }, jn = {
1287
1287
  addChild: "Add child",
@@ -1307,26 +1307,26 @@ function In(e, t) {
1307
1307
  const o = (y) => {
1308
1308
  const x = document.createElement("div");
1309
1309
  return x.innerText = y, x.className = "tips", x;
1310
- }, s = (y, x, E) => {
1311
- const S = document.createElement("li");
1312
- return S.id = y, S.innerHTML = `<span>${ae(x)}</span><span ${E ? 'class="key"' : ""}>${ae(E)}</span>`, S;
1310
+ }, s = (y, x, S) => {
1311
+ const C = document.createElement("li");
1312
+ return C.id = y, C.innerHTML = `<span>${ae(x)}</span><span ${S ? 'class="key"' : ""}>${ae(S)}</span>`, C;
1313
1313
  }, i = t.locale, l = s("cm-add_child", i.addChild, "Tab"), c = s("cm-add_parent", i.addParent, "Ctrl + Enter"), r = s("cm-add_sibling", i.addSibling, "Enter"), a = s("cm-remove_child", i.removeNode, "Delete"), d = s("cm-fucus", i.focus, ""), h = s("cm-unfucus", i.cancelFocus, ""), u = s("cm-up", i.moveUp, "PgUp"), b = s("cm-down", i.moveDown, "Pgdn"), v = s("cm-link", i.link, ""), p = s("cm-link-bidirectional", i.linkBidirectional, ""), g = s("cm-summary", i.summary, ""), m = document.createElement("ul");
1314
1314
  if (m.className = "menu-list", m.appendChild(l), m.appendChild(c), m.appendChild(r), m.appendChild(a), t.focus && (m.appendChild(d), m.appendChild(h)), m.appendChild(u), m.appendChild(b), m.appendChild(g), t.link && (m.appendChild(v), m.appendChild(p)), t && t.extend)
1315
1315
  for (let y = 0; y < t.extend.length; y++) {
1316
- const x = t.extend[y], E = s(x.name, x.name, x.key || "");
1317
- m.appendChild(E), E.onclick = (S) => {
1318
- x.onclick(S);
1316
+ const x = t.extend[y], S = s(x.name, x.name, x.key || "");
1317
+ m.appendChild(S), S.onclick = (C) => {
1318
+ x.onclick(C);
1319
1319
  };
1320
1320
  }
1321
1321
  const w = document.createElement("div");
1322
1322
  w.className = "context-menu", w.appendChild(m), w.hidden = !0, e.container.append(w);
1323
- let C = !0;
1323
+ let E = !0;
1324
1324
  const N = (y) => {
1325
1325
  const x = y.target;
1326
1326
  if (te(x)) {
1327
- x.parentElement.tagName === "ME-ROOT" ? C = !0 : C = !1, C ? (d.className = "disabled", u.className = "disabled", b.className = "disabled", c.className = "disabled", r.className = "disabled", a.className = "disabled") : (d.className = "", u.className = "", b.className = "", c.className = "", r.className = "", a.className = ""), w.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
1328
- const E = m.offsetHeight, S = m.offsetWidth, T = m.getBoundingClientRect(), _ = y.clientY - T.top, H = y.clientX - T.left;
1329
- E + _ > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = _ + 15 + "px"), S + H > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = H + 10 + "px");
1327
+ x.parentElement.tagName === "ME-ROOT" ? E = !0 : E = !1, E ? (d.className = "disabled", u.className = "disabled", b.className = "disabled", c.className = "disabled", r.className = "disabled", a.className = "disabled") : (d.className = "", u.className = "", b.className = "", c.className = "", r.className = "", a.className = ""), w.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
1328
+ const S = m.offsetHeight, C = m.offsetWidth, T = m.getBoundingClientRect(), D = y.clientY - T.top, L = y.clientX - T.left;
1329
+ S + D > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = D + 15 + "px"), C + L > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = L + 10 + "px");
1330
1330
  }
1331
1331
  };
1332
1332
  e.bus.addListener("showContextMenu", N), w.onclick = (y) => {
@@ -1336,26 +1336,26 @@ function In(e, t) {
1336
1336
  }, c.onclick = () => {
1337
1337
  e.insertParent(), w.hidden = !0;
1338
1338
  }, r.onclick = () => {
1339
- C || (e.insertSibling("after"), w.hidden = !0);
1339
+ E || (e.insertSibling("after"), w.hidden = !0);
1340
1340
  }, a.onclick = () => {
1341
- C || (e.removeNodes(e.currentNodes || []), w.hidden = !0);
1341
+ E || (e.removeNodes(e.currentNodes || []), w.hidden = !0);
1342
1342
  }, d.onclick = () => {
1343
- C || (e.focusNode(e.currentNode), w.hidden = !0);
1343
+ E || (e.focusNode(e.currentNode), w.hidden = !0);
1344
1344
  }, h.onclick = () => {
1345
1345
  e.cancelFocus(), w.hidden = !0;
1346
1346
  }, u.onclick = () => {
1347
- C || (e.moveUpNode(), w.hidden = !0);
1347
+ E || (e.moveUpNode(), w.hidden = !0);
1348
1348
  }, b.onclick = () => {
1349
- C || (e.moveDownNode(), w.hidden = !0);
1349
+ E || (e.moveDownNode(), w.hidden = !0);
1350
1350
  };
1351
1351
  const f = (y) => {
1352
1352
  w.hidden = !0;
1353
- const x = e.currentNode, E = o(i.clickTips);
1354
- e.container.appendChild(E), e.map.addEventListener(
1353
+ const x = e.currentNode, S = o(i.clickTips);
1354
+ e.container.appendChild(S), e.map.addEventListener(
1355
1355
  "click",
1356
- (S) => {
1357
- S.preventDefault(), E.remove();
1358
- const T = S.target;
1356
+ (C) => {
1357
+ C.preventDefault(), S.remove();
1358
+ const T = C.target;
1359
1359
  (T.parentElement.tagName === "ME-PARENT" || T.parentElement.tagName === "ME-ROOT") && e.createArrow(x, T, y);
1360
1360
  },
1361
1361
  {
@@ -1543,7 +1543,7 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
1543
1543
  if (i)
1544
1544
  for (const l of n)
1545
1545
  i[e](l, o, { capture: !1, ...s });
1546
- }, W = ct("addEventListener"), P = ct("removeEventListener"), J = (e) => {
1546
+ }, W = ct("addEventListener"), O = ct("removeEventListener"), J = (e) => {
1547
1547
  const { clientX: t, clientY: n, target: o } = e.touches?.[0] ?? e;
1548
1548
  return { x: t, y: n, target: o };
1549
1549
  }, Y = (e, t = document) => he(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean), no = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
@@ -1649,7 +1649,7 @@ class oo extends Zn {
1649
1649
  }
1650
1650
  _toggleStartEvents(t = !0) {
1651
1651
  const { document: n } = this._options;
1652
- (t ? W : P)(n, "pointerdown", this._onTapStart);
1652
+ (t ? W : O)(n, "pointerdown", this._onTapStart);
1653
1653
  }
1654
1654
  _onTapStart(t, n = !1) {
1655
1655
  const { x: o, y: s, target: i } = J(t), { document: l, startAreas: c, boundaries: r, behaviour: a, features: d } = this._options, h = i.getBoundingClientRect();
@@ -1710,8 +1710,8 @@ class oo extends Zn {
1710
1710
  typeof s == "number" && j(c + r - (i + l)) >= s || // Different x and y threshold
1711
1711
  typeof s == "object" && j(c - i) >= s.x || j(r - l) >= s.y
1712
1712
  ) {
1713
- if (P(o, ["pointermove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
1714
- P(o, ["pointerup", "pointercancel"], this._onTapStop);
1713
+ if (O(o, ["pointermove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
1714
+ O(o, ["pointerup", "pointercancel"], this._onTapStop);
1715
1715
  return;
1716
1716
  }
1717
1717
  W(o, ["pointermove"], this._onTapMove, { passive: !1 }), $(this._area, "display", "block"), Y(n, o)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (this._selectables = this._selectables.filter((a) => this._targetElement.contains(a))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
@@ -1771,7 +1771,7 @@ class oo extends Zn {
1771
1771
  this._areaLocation.x1 += t.x - s, this._areaLocation.y1 += t.y - o, t.x = s, t.y = o, this._setupSelectionArea(), this._frame.next(null);
1772
1772
  }
1773
1773
  _onStartAreaScroll() {
1774
- this._targetBoundaryScrolled = !0, P(this._targetElement, "scroll", this._onStartAreaScroll);
1774
+ this._targetBoundaryScrolled = !0, O(this._targetElement, "scroll", this._onStartAreaScroll);
1775
1775
  }
1776
1776
  _recalculateSelectionAreaRect() {
1777
1777
  const { _scrollSpeed: t, _areaLocation: n, _targetElement: o, _options: s } = this, i = this._targetRect, { x1: l, y1: c } = n;
@@ -1791,7 +1791,7 @@ class oo extends Zn {
1791
1791
  }
1792
1792
  _onTapStop(t, n) {
1793
1793
  const { document: o, features: s } = this._options, { _singleClick: i } = this;
1794
- P(this._targetElement, "scroll", this._onStartAreaScroll), P(o, ["pointermove"], this._delayedTapMove), P(o, ["pointermove"], this._onTapMove), P(o, ["pointerup", "pointercancel"], this._onTapStop), P(o, "scroll", this._onScroll), this._keepSelection(), t && i && s.singleTap.allow ? this._onSingleTap(t) : !i && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, this._clippingElement.remove(), this._frame?.cancel(), $(this._area, "display", "none");
1794
+ O(this._targetElement, "scroll", this._onStartAreaScroll), O(o, ["pointermove"], this._delayedTapMove), O(o, ["pointermove"], this._onTapMove), O(o, ["pointerup", "pointercancel"], this._onTapStop), O(o, "scroll", this._onScroll), this._keepSelection(), t && i && s.singleTap.allow ? this._onSingleTap(t) : !i && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, this._clippingElement.remove(), this._frame?.cancel(), $(this._area, "display", "none");
1795
1795
  }
1796
1796
  _updateElementSelection() {
1797
1797
  const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: l, touched: c } = o, { intersect: r, overlap: a } = n.behaviour, d = a === "invert", h = [], u = [], b = [];
@@ -2018,13 +2018,17 @@ const io = function(e, t = !0) {
2018
2018
  const o = {
2019
2019
  ...(e.type === "dark" ? ue : fe).cssVar,
2020
2020
  ...e.cssVar
2021
- }, s = Object.keys(o);
2021
+ };
2022
+ this.compact && (o["--node-gap-x"] = "15px", o["--node-gap-y"] = "2px", o["--main-gap-x"] = "30px", o["--main-gap-y"] = "6px");
2023
+ const s = Object.keys(o);
2022
2024
  for (let i = 0; i < s.length; i++) {
2023
2025
  const l = s[i];
2024
2026
  this.container.style.setProperty(l, o[l]);
2025
2027
  }
2026
2028
  t && this.refresh();
2027
2029
  }, ro = function(e) {
2030
+ this.compact = e, this.theme && this.changeTheme(this.theme);
2031
+ }, lo = function(e) {
2028
2032
  return {
2029
2033
  dom: e,
2030
2034
  moved: !1,
@@ -2060,7 +2064,7 @@ const io = function(e, t = !0) {
2060
2064
  }
2061
2065
  };
2062
2066
  }, Ke = {
2063
- create: ro
2067
+ create: lo
2064
2068
  }, at = "#4dc4ff";
2065
2069
  function dt(e, t, n, o, s, i, l, c) {
2066
2070
  return {
@@ -2068,7 +2072,7 @@ function dt(e, t, n, o, s, i, l, c) {
2068
2072
  y: t / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
2069
2073
  };
2070
2074
  }
2071
- function lo(e, t, n) {
2075
+ function co(e, t, n) {
2072
2076
  e && (e.dataset.x = t.toString(), e.dataset.y = n.toString(), re(e));
2073
2077
  }
2074
2078
  function Z(e, t, n, o, s) {
@@ -2106,14 +2110,14 @@ function Ve(e, t, n, o, s, i, l, c, r, a) {
2106
2110
  }
2107
2111
  }
2108
2112
  const { x: b, y: v } = dt(t, n, o, s, i, l, c, r);
2109
- if (e.labelEl && lo(e.labelEl, b, v), a.style?.labelColor) {
2113
+ if (e.labelEl && co(e.labelEl, b, v), a.style?.labelColor) {
2110
2114
  const p = e.labelEl;
2111
2115
  p && (p.style.color = a.style.labelColor);
2112
2116
  }
2113
- mo(e);
2117
+ yo(e);
2114
2118
  }
2115
2119
  function se(e, t, n) {
2116
- const { offsetLeft: o, offsetTop: s } = L(e.nodes, t), i = t.offsetWidth, l = t.offsetHeight, c = o + i / 2, r = s + l / 2, a = c + n.x, d = r + n.y;
2120
+ const { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = t.offsetWidth, l = t.offsetHeight, c = o + i / 2, r = s + l / 2, a = c + n.x, d = r + n.y;
2117
2121
  return {
2118
2122
  w: i,
2119
2123
  h: l,
@@ -2131,21 +2135,21 @@ function X(e) {
2131
2135
  y: n
2132
2136
  };
2133
2137
  }
2134
- const co = function(e, t, n) {
2135
- const o = L(e.nodes, t), s = L(e.nodes, n), i = o.offsetLeft + t.offsetWidth / 2, l = o.offsetTop + t.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, r = s.offsetTop + n.offsetHeight / 2, a = c - i, d = r - l, h = Math.sqrt(a * a + d * d), u = Math.max(50, Math.min(200, h * 0.3)), b = Math.abs(a), v = Math.abs(d);
2138
+ const ao = function(e, t, n) {
2139
+ const o = M(e.nodes, t), s = M(e.nodes, n), i = o.offsetLeft + t.offsetWidth / 2, l = o.offsetTop + t.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, r = s.offsetTop + n.offsetHeight / 2, a = c - i, d = r - l, h = Math.sqrt(a * a + d * d), u = Math.max(50, Math.min(200, h * 0.3)), b = Math.abs(a), v = Math.abs(d);
2136
2140
  let p, g;
2137
2141
  if (h < 150) {
2138
2142
  const w = t.closest("me-main").className === "lhs" ? -1 : 1;
2139
2143
  p = { x: 200 * w, y: 0 }, g = { x: 200 * w, y: 0 };
2140
2144
  } else if (b > v * 1.5) {
2141
- const w = a > 0 ? t.offsetWidth / 2 : -t.offsetWidth / 2, C = a > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
2142
- p = { x: w + (a > 0 ? u : -u), y: 0 }, g = { x: C + (a > 0 ? -u : u), y: 0 };
2145
+ const w = a > 0 ? t.offsetWidth / 2 : -t.offsetWidth / 2, E = a > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
2146
+ p = { x: w + (a > 0 ? u : -u), y: 0 }, g = { x: E + (a > 0 ? -u : u), y: 0 };
2143
2147
  } else if (v > b * 1.5) {
2144
- const w = d > 0 ? t.offsetHeight / 2 : -t.offsetHeight / 2, C = d > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
2145
- p = { x: 0, y: w + (d > 0 ? u : -u) }, g = { x: 0, y: C + (d > 0 ? -u : u) };
2148
+ const w = d > 0 ? t.offsetHeight / 2 : -t.offsetHeight / 2, E = d > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
2149
+ p = { x: 0, y: w + (d > 0 ? u : -u) }, g = { x: 0, y: E + (d > 0 ? -u : u) };
2146
2150
  } else {
2147
- const w = Math.atan2(d, a), C = t.offsetWidth / 2 * Math.cos(w), N = t.offsetHeight / 2 * Math.sin(w), f = -(n.offsetWidth / 2) * Math.cos(w), y = -(n.offsetHeight / 2) * Math.sin(w), x = u * 0.7 * (a > 0 ? 1 : -1), E = u * 0.7 * (d > 0 ? 1 : -1);
2148
- p = { x: C + x, y: N + E }, g = { x: f - x, y: y - E };
2151
+ const w = Math.atan2(d, a), E = t.offsetWidth / 2 * Math.cos(w), N = t.offsetHeight / 2 * Math.sin(w), f = -(n.offsetWidth / 2) * Math.cos(w), y = -(n.offsetHeight / 2) * Math.sin(w), x = u * 0.7 * (a > 0 ? 1 : -1), S = u * 0.7 * (d > 0 ? 1 : -1);
2152
+ p = { x: E + x, y: N + S }, g = { x: f - x, y: y - S };
2149
2153
  }
2150
2154
  return {
2151
2155
  delta1: { x: Math.round(p.x), y: Math.round(p.y) },
@@ -2155,28 +2159,28 @@ const co = function(e, t, n) {
2155
2159
  if (!t || !n)
2156
2160
  return;
2157
2161
  if (!o.delta1 || !o.delta2) {
2158
- const S = co(e, t, n);
2159
- o.delta1 = S.delta1, o.delta2 = S.delta2;
2162
+ const C = ao(e, t, n);
2163
+ o.delta1 = C.delta1, o.delta2 = C.delta2;
2160
2164
  }
2161
2165
  const i = se(e, t, o.delta1), l = se(e, n, o.delta2), { x: c, y: r } = X(i), { ctrlX: a, ctrlY: d } = i, { ctrlX: h, ctrlY: u } = l, { x: b, y: v } = X(l), p = oe(h, u, b, v);
2162
2166
  if (!p) return;
2163
2167
  const g = `M ${p.x1} ${p.y1} L ${b} ${v} L ${p.x2} ${p.y2}`;
2164
2168
  let m = "";
2165
2169
  if (o.bidirectional) {
2166
- const S = oe(a, d, c, r);
2167
- if (!S) return;
2168
- m = `M ${S.x1} ${S.y1} L ${c} ${r} L ${S.x2} ${S.y2}`;
2170
+ const C = oe(a, d, c, r);
2171
+ if (!C) return;
2172
+ m = `M ${C.x1} ${C.y1} L ${c} ${r} L ${C.x2} ${C.y2}`;
2169
2173
  }
2170
- const w = Hn(`M ${c} ${r} C ${a} ${d} ${h} ${u} ${b} ${v}`, g, m, o.style), { x: C, y: N } = dt(c, r, a, d, h, u, b, v), f = o.style?.labelColor || "rgb(235, 95, 82)", y = "a-" + o.id;
2174
+ const w = Hn(`M ${c} ${r} C ${a} ${d} ${h} ${u} ${b} ${v}`, g, m, o.style), { x: E, y: N } = dt(c, r, a, d, h, u, b, v), f = o.style?.labelColor || "rgb(235, 95, 82)", y = "a-" + o.id;
2171
2175
  w.id = y;
2172
- const x = e.markdown ? e.markdown(o.label, o) : o.label, E = de(x, C, N, {
2176
+ const x = e.markdown ? e.markdown(o.label, o) : o.label, S = de(x, E, N, {
2173
2177
  anchor: "middle",
2174
2178
  color: f,
2175
2179
  dataType: "arrow",
2176
2180
  svgId: y
2177
2181
  });
2178
- w.labelEl = E, w.arrowObj = o, w.dataset.linkid = o.id, e.labelContainer.appendChild(E), e.arrowSvg.appendChild(w), re(E), s || (e.arrows.push(o), e.currentArrow = w, ft(e, o, i, l));
2179
- }, ao = function(e, t, n = {}) {
2182
+ w.labelEl = S, w.arrowObj = o, w.dataset.linkid = o.id, e.labelContainer.appendChild(S), e.arrowSvg.appendChild(w), re(S), s || (e.arrows.push(o), e.currentArrow = w, ft(e, o, i, l));
2183
+ }, ho = function(e, t, n = {}) {
2180
2184
  const o = {
2181
2185
  id: B(),
2182
2186
  label: "Custom Link",
@@ -2188,14 +2192,14 @@ const co = function(e, t, n) {
2188
2192
  name: "createArrow",
2189
2193
  obj: o
2190
2194
  });
2191
- }, ho = function(e) {
2195
+ }, fo = function(e) {
2192
2196
  le(this);
2193
2197
  const t = { ...e, id: B() };
2194
2198
  Se(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
2195
2199
  name: "createArrow",
2196
2200
  obj: t
2197
2201
  });
2198
- }, fo = function(e) {
2202
+ }, uo = function(e) {
2199
2203
  let t;
2200
2204
  if (e ? t = e : t = this.currentArrow, !t) return;
2201
2205
  le(this);
@@ -2206,14 +2210,14 @@ const co = function(e, t, n) {
2206
2210
  id: n
2207
2211
  }
2208
2212
  });
2209
- }, uo = function(e) {
2213
+ }, po = function(e) {
2210
2214
  this.currentArrow = e;
2211
2215
  const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), s = se(this, n, t.delta1), i = se(this, o, t.delta2);
2212
2216
  this.editable ? ft(this, t, s, i) : ht(e, at), this.bus.fire("selectArrow", t);
2213
- }, po = function() {
2217
+ }, go = function() {
2214
2218
  le(this), this.currentArrow = null, this.bus.fire("unselectArrow");
2215
2219
  }, ce = function(e, t) {
2216
- const n = document.createElementNS(M, "path");
2220
+ const n = document.createElementNS(A, "path");
2217
2221
  return k(n, {
2218
2222
  d: e,
2219
2223
  stroke: t,
@@ -2223,7 +2227,7 @@ const co = function(e, t, n) {
2223
2227
  "stroke-linejoin": "round"
2224
2228
  }), n;
2225
2229
  }, ht = function(e, t) {
2226
- const n = document.createElementNS(M, "g");
2230
+ const n = document.createElementNS(A, "g");
2227
2231
  n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
2228
2232
  const o = ce(e.line.getAttribute("d"), t);
2229
2233
  n.appendChild(o);
@@ -2233,32 +2237,32 @@ const co = function(e, t, n) {
2233
2237
  n.appendChild(i);
2234
2238
  }
2235
2239
  e.insertBefore(n, e.firstChild);
2236
- }, go = function(e) {
2240
+ }, mo = function(e) {
2237
2241
  const t = e.querySelector(".arrow-highlight");
2238
2242
  t && t.remove();
2239
- }, mo = function(e) {
2243
+ }, yo = function(e) {
2240
2244
  const t = e.querySelector(".arrow-highlight");
2241
2245
  if (!t) return;
2242
2246
  const n = t.querySelectorAll("path");
2243
2247
  n.length >= 1 && n[0].setAttribute("d", e.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", e.arrow1.getAttribute("d")), n.length >= 3 && e.arrow2.getAttribute("d") && n[2].setAttribute("d", e.arrow2.getAttribute("d"));
2244
2248
  }, le = function(e) {
2245
- e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && go(e.currentArrow);
2249
+ e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && mo(e.currentArrow);
2246
2250
  }, ft = function(e, t, n, o) {
2247
2251
  const { linkController: s, P2: i, P3: l, line1: c, line2: r, nodes: a, map: d, currentArrow: h, bus: u } = e;
2248
2252
  if (!h) return;
2249
2253
  s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l), ht(h, at);
2250
- let { x: b, y: v } = X(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: w } = o, { x: C, y: N } = X(o);
2251
- i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${w}px;left:${m}px;`, Z(c, b, v, p, g), Z(r, m, w, C, N), e.helper1 = Ke.create(i), e.helper2 = Ke.create(l), e.helper1.init(d, (f, y) => {
2254
+ let { x: b, y: v } = X(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: w } = o, { x: E, y: N } = X(o);
2255
+ i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${w}px;left:${m}px;`, Z(c, b, v, p, g), Z(r, m, w, E, N), e.helper1 = Ke.create(i), e.helper2 = Ke.create(l), e.helper1.init(d, (f, y) => {
2252
2256
  p = p + f / e.scaleVal, g = g + y / e.scaleVal;
2253
2257
  const x = X({ ...n, ctrlX: p, ctrlY: g });
2254
- b = x.x, v = x.y, i.style.top = g + "px", i.style.left = p + "px", Ve(h, b, v, p, g, m, w, C, N, t), Z(c, b, v, p, g), t.delta1.x = Math.round(p - n.cx), t.delta1.y = Math.round(g - n.cy), u.fire("updateArrowDelta", t);
2258
+ b = x.x, v = x.y, i.style.top = g + "px", i.style.left = p + "px", Ve(h, b, v, p, g, m, w, E, N, t), Z(c, b, v, p, g), t.delta1.x = Math.round(p - n.cx), t.delta1.y = Math.round(g - n.cy), u.fire("updateArrowDelta", t);
2255
2259
  }), e.helper2.init(d, (f, y) => {
2256
2260
  m = m + f / e.scaleVal, w = w + y / e.scaleVal;
2257
2261
  const x = X({ ...o, ctrlX: m, ctrlY: w });
2258
- C = x.x, N = x.y, l.style.top = w + "px", l.style.left = m + "px", Ve(h, b, v, p, g, m, w, C, N, t), Z(r, m, w, C, N), t.delta2.x = Math.round(m - o.cx), t.delta2.y = Math.round(w - o.cy), u.fire("updateArrowDelta", t);
2262
+ E = x.x, N = x.y, l.style.top = w + "px", l.style.left = m + "px", Ve(h, b, v, p, g, m, w, E, N, t), Z(r, m, w, E, N), t.delta2.x = Math.round(m - o.cx), t.delta2.y = Math.round(w - o.cy), u.fire("updateArrowDelta", t);
2259
2263
  });
2260
2264
  };
2261
- function yo() {
2265
+ function bo() {
2262
2266
  this.arrowSvg.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((t) => t.remove());
2263
2267
  for (let t = 0; t < this.arrows.length; t++) {
2264
2268
  const n = this.arrows[t];
@@ -2269,23 +2273,23 @@ function yo() {
2269
2273
  }
2270
2274
  this.nodes.appendChild(this.arrowSvg);
2271
2275
  }
2272
- function bo(e) {
2276
+ function vo(e) {
2273
2277
  le(this), e && e.labelEl && rt(this, e.labelEl, e.arrowObj);
2274
2278
  }
2275
- function vo() {
2279
+ function wo() {
2276
2280
  this.arrows = this.arrows.filter((e) => ne(e.from, this.nodeData) && ne(e.to, this.nodeData));
2277
2281
  }
2278
- const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2282
+ const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2279
2283
  __proto__: null,
2280
- createArrow: ao,
2281
- createArrowFrom: ho,
2282
- editArrowLabel: bo,
2283
- removeArrow: fo,
2284
- renderArrow: yo,
2285
- selectArrow: uo,
2286
- tidyArrow: vo,
2287
- unselectArrow: po
2288
- }, Symbol.toStringTag, { value: "Module" })), xo = function(e) {
2284
+ createArrow: ho,
2285
+ createArrowFrom: fo,
2286
+ editArrowLabel: vo,
2287
+ removeArrow: uo,
2288
+ renderArrow: bo,
2289
+ selectArrow: po,
2290
+ tidyArrow: wo,
2291
+ unselectArrow: go
2292
+ }, Symbol.toStringTag, { value: "Module" })), Eo = function(e) {
2289
2293
  if (e.length === 0) throw new Error("No selected node.");
2290
2294
  if (e.length === 1) {
2291
2295
  const r = e[0].nodeObj, a = e[0].nodeObj.parent;
@@ -2322,11 +2326,11 @@ const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2322
2326
  start: i,
2323
2327
  end: l
2324
2328
  };
2325
- }, Eo = function(e) {
2326
- const t = document.createElementNS(M, "g");
2329
+ }, Co = function(e) {
2330
+ const t = document.createElementNS(A, "g");
2327
2331
  return t.setAttribute("id", e), t;
2328
2332
  }, ze = function(e, t) {
2329
- const n = document.createElementNS(M, "path");
2333
+ const n = document.createElementNS(A, "path");
2330
2334
  return k(n, {
2331
2335
  d: e,
2332
2336
  stroke: t || "#666",
@@ -2334,89 +2338,89 @@ const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2334
2338
  "stroke-linecap": "round",
2335
2339
  "stroke-width": "2"
2336
2340
  }), n;
2337
- }, Co = (e) => e.parentElement.parentElement, So = function(e, { parent: t, start: n }) {
2341
+ }, So = (e) => e.parentElement.parentElement, No = function(e, { parent: t, start: n }) {
2338
2342
  const o = e.findEle(t), s = o.nodeObj;
2339
2343
  let i;
2340
2344
  return s.parent ? i = o.closest("me-main").className : i = e.findEle(s.children[n].id).closest("me-main").className, i;
2341
2345
  }, Ne = function(e, t) {
2342
- const { id: n, label: o, parent: s, start: i, end: l, style: c } = t, { nodes: r, theme: a, summarySvg: d } = e, u = e.findEle(s).nodeObj, b = So(e, t);
2346
+ const { id: n, label: o, parent: s, start: i, end: l, style: c } = t, { nodes: r, theme: a, summarySvg: d } = e, u = e.findEle(s).nodeObj, b = No(e, t);
2343
2347
  let v = 1 / 0, p = 0, g = 0, m = 0;
2344
2348
  for (let V = i; V <= l; V++) {
2345
2349
  const Te = u.children?.[V];
2346
2350
  if (!Te)
2347
2351
  return e.removeSummary(n), null;
2348
- const q = Co(e.findEle(Te.id)), { offsetLeft: U, offsetTop: ke } = L(r, q), _e = i === l ? 10 : 20;
2352
+ const q = So(e.findEle(Te.id)), { offsetLeft: U, offsetTop: ke } = M(r, q), _e = i === l ? 10 : 20;
2349
2353
  V === i && (g = ke + _e), V === l && (m = ke + q.offsetHeight - _e), U < v && (v = U), q.offsetWidth + U > p && (p = q.offsetWidth + U);
2350
2354
  }
2351
- let w, C;
2352
- const N = u.parent ? 10 : 0, f = g + N, y = m + N, x = (f + y) / 2, E = c?.stroke || a.cssVar["--color"], S = c?.labelColor || a.cssVar["--color"], T = "s-" + n, _ = e.markdown ? e.markdown(o, t) : o;
2353
- b === O.LHS ? (w = ze(`M ${v + 10} ${f} c -5 0 -10 5 -10 10 L ${v} ${y - 10} c 0 5 5 10 10 10 M ${v} ${x} h -10`, E), C = de(_, v - 20, x, { anchor: "end", color: S, dataType: "summary", svgId: T })) : (w = ze(`M ${p - 10} ${f} c 5 0 10 5 10 10 L ${p} ${y - 10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`, E), C = de(_, p + 20, x, { anchor: "start", color: S, dataType: "summary", svgId: T }));
2354
- const H = Eo(T);
2355
- return H.appendChild(w), e.labelContainer.appendChild(C), re(C), H.summaryObj = t, H.labelEl = C, d.appendChild(H), H;
2356
- }, No = function(e = {}) {
2355
+ let w, E;
2356
+ const N = u.parent ? 10 : 0, f = g + N, y = m + N, x = (f + y) / 2, S = c?.stroke || a.cssVar["--color"], C = c?.labelColor || a.cssVar["--color"], T = "s-" + n, D = e.markdown ? e.markdown(o, t) : o;
2357
+ b === H.LHS ? (w = ze(`M ${v + 10} ${f} c -5 0 -10 5 -10 10 L ${v} ${y - 10} c 0 5 5 10 10 10 M ${v} ${x} h -10`, S), E = de(D, v - 20, x, { anchor: "end", color: C, dataType: "summary", svgId: T })) : (w = ze(`M ${p - 10} ${f} c 5 0 10 5 10 10 L ${p} ${y - 10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`, S), E = de(D, p + 20, x, { anchor: "start", color: C, dataType: "summary", svgId: T }));
2358
+ const L = Co(T);
2359
+ return L.appendChild(w), e.labelContainer.appendChild(E), re(E), L.summaryObj = t, L.labelEl = E, d.appendChild(L), L;
2360
+ }, To = function(e = {}) {
2357
2361
  if (!this.currentNodes) return;
2358
- const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = xo(t), c = { id: B(), parent: s, start: i, end: l, label: "summary", style: e.style }, r = Ne(this, c);
2362
+ const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = Eo(t), c = { id: B(), parent: s, start: i, end: l, label: "summary", style: e.style }, r = Ne(this, c);
2359
2363
  n.push(c), this.editSummary(r), o.fire("operation", {
2360
2364
  name: "createSummary",
2361
2365
  obj: c
2362
2366
  });
2363
- }, To = function(e) {
2367
+ }, ko = function(e) {
2364
2368
  const t = B(), n = { ...e, id: t };
2365
2369
  Ne(this, n), this.summaries.push(n), this.bus.fire("operation", {
2366
2370
  name: "createSummary",
2367
2371
  obj: n
2368
2372
  });
2369
- }, ko = function(e) {
2373
+ }, _o = function(e) {
2370
2374
  const t = this.summaries.findIndex((n) => n.id === e);
2371
2375
  t > -1 && (this.summaries.splice(t, 1), this.nodes.querySelector("#s-" + e)?.remove(), this.nodes.querySelector("#label-s-" + e)?.remove()), this.bus.fire("operation", {
2372
2376
  name: "removeSummary",
2373
2377
  obj: { id: e }
2374
2378
  });
2375
- }, _o = function(e) {
2379
+ }, Do = function(e) {
2376
2380
  const t = e.labelEl;
2377
2381
  t && t.classList.add("selected"), this.currentSummary = e, this.bus.fire("selectSummary", e.summaryObj);
2378
- }, Do = function() {
2379
- this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null, this.bus.fire("unselectSummary");
2380
2382
  }, Lo = function() {
2383
+ this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null, this.bus.fire("unselectSummary");
2384
+ }, Mo = function() {
2381
2385
  this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
2382
2386
  try {
2383
2387
  Ne(this, e);
2384
2388
  } catch {
2385
2389
  }
2386
2390
  }), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
2387
- }, Mo = function(e) {
2391
+ }, Ao = function(e) {
2388
2392
  e && e.labelEl && rt(this, e.labelEl, e.summaryObj);
2389
- }, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2393
+ }, Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2390
2394
  __proto__: null,
2391
- createSummary: No,
2392
- createSummaryFrom: To,
2393
- editSummary: Mo,
2394
- removeSummary: ko,
2395
- renderSummary: Lo,
2396
- selectSummary: _o,
2397
- unselectSummary: Do
2398
- }, Symbol.toStringTag, { value: "Module" })), D = "http://www.w3.org/2000/svg";
2399
- function Po(e, t) {
2400
- const n = document.createElementNS(D, "svg");
2395
+ createSummary: To,
2396
+ createSummaryFrom: ko,
2397
+ editSummary: Ao,
2398
+ removeSummary: _o,
2399
+ renderSummary: Mo,
2400
+ selectSummary: Do,
2401
+ unselectSummary: Lo
2402
+ }, Symbol.toStringTag, { value: "Module" })), _ = "http://www.w3.org/2000/svg";
2403
+ function Oo(e, t) {
2404
+ const n = document.createElementNS(_, "svg");
2401
2405
  return k(n, {
2402
2406
  version: "1.1",
2403
- xmlns: D,
2407
+ xmlns: _,
2404
2408
  height: e,
2405
2409
  width: t
2406
2410
  }), n;
2407
2411
  }
2408
- function Oo(e, t) {
2412
+ function Ho(e, t) {
2409
2413
  return (parseInt(e) - parseInt(t)) / 2;
2410
2414
  }
2411
- function Ho(e, t, n, o) {
2412
- const s = document.createElementNS(D, "g");
2415
+ function $o(e, t, n, o) {
2416
+ const s = document.createElementNS(_, "g");
2413
2417
  let i = "";
2414
2418
  return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
2415
2419
  `).forEach((c, r) => {
2416
- const a = document.createElementNS(D, "text");
2420
+ const a = document.createElementNS(_, "text");
2417
2421
  k(a, {
2418
2422
  x: n + parseInt(t.paddingLeft) + "",
2419
- y: o + parseInt(t.paddingTop) + Oo(t.lineHeight, t.fontSize) * (r + 1) + parseFloat(t.fontSize) * (r + 1) + "",
2423
+ y: o + parseInt(t.paddingTop) + Ho(t.lineHeight, t.fontSize) * (r + 1) + parseFloat(t.fontSize) * (r + 1) + "",
2420
2424
  "text-anchor": "start",
2421
2425
  "font-family": t.fontFamily,
2422
2426
  "font-size": `${t.fontSize}`,
@@ -2425,10 +2429,10 @@ function Ho(e, t, n, o) {
2425
2429
  }), a.innerHTML = c, s.appendChild(a);
2426
2430
  }), s;
2427
2431
  }
2428
- function $o(e, t, n, o) {
2432
+ function jo(e, t, n, o) {
2429
2433
  let s = "";
2430
2434
  e.nodeObj?.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
2431
- const i = document.createElementNS(D, "foreignObject");
2435
+ const i = document.createElementNS(_, "foreignObject");
2432
2436
  k(i, {
2433
2437
  x: n + parseInt(t.paddingLeft) + "",
2434
2438
  y: o + parseInt(t.paddingTop) + "",
@@ -2441,8 +2445,8 @@ function $o(e, t, n, o) {
2441
2445
  style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
2442
2446
  }), l.innerHTML = s, i.appendChild(l), i;
2443
2447
  }
2444
- function jo(e, t) {
2445
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = L(e.nodes, t), i = document.createElementNS(D, "rect");
2448
+ function Io(e, t) {
2449
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "rect");
2446
2450
  return k(i, {
2447
2451
  x: o + "",
2448
2452
  y: s + "",
@@ -2456,7 +2460,7 @@ function jo(e, t) {
2456
2460
  }), i;
2457
2461
  }
2458
2462
  function Q(e, t, n = !1) {
2459
- const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = L(e.nodes, t), l = document.createElementNS(D, "rect");
2463
+ const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = M(e.nodes, t), l = document.createElementNS(_, "rect");
2460
2464
  k(l, {
2461
2465
  x: s + "",
2462
2466
  y: i + "",
@@ -2468,13 +2472,13 @@ function Q(e, t, n = !1) {
2468
2472
  stroke: o.borderColor,
2469
2473
  "stroke-width": o.borderWidth
2470
2474
  });
2471
- const c = document.createElementNS(D, "g");
2475
+ const c = document.createElementNS(_, "g");
2472
2476
  c.appendChild(l);
2473
2477
  let r;
2474
- return n ? r = $o(t, o, s, i) : r = Ho(t, o, s, i), c.appendChild(r), c;
2478
+ return n ? r = jo(t, o, s, i) : r = $o(t, o, s, i), c.appendChild(r), c;
2475
2479
  }
2476
- function Io(e, t) {
2477
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = L(e.nodes, t), i = document.createElementNS(D, "a"), l = document.createElementNS(D, "text");
2480
+ function Ro(e, t) {
2481
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "a"), l = document.createElementNS(_, "text");
2478
2482
  return k(l, {
2479
2483
  x: o + "",
2480
2484
  y: s + parseInt(n.fontSize) + "",
@@ -2485,8 +2489,8 @@ function Io(e, t) {
2485
2489
  fill: `${n.color}`
2486
2490
  }), l.innerHTML = t.textContent, i.appendChild(l), i.setAttribute("href", t.href), i;
2487
2491
  }
2488
- function Ro(e, t) {
2489
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = L(e.nodes, t), i = document.createElementNS(D, "image");
2492
+ function Bo(e, t) {
2493
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "image");
2490
2494
  return k(i, {
2491
2495
  x: o + "",
2492
2496
  y: s + "",
@@ -2495,8 +2499,8 @@ function Ro(e, t) {
2495
2499
  href: t.src
2496
2500
  }), i;
2497
2501
  }
2498
- const ee = 100, Bo = '<?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">', Wo = (e, t = !1) => {
2499
- const n = e.nodes, o = n.offsetHeight + ee * 2, s = n.offsetWidth + ee * 2, i = Po(o + "px", s + "px"), l = document.createElementNS(D, "svg"), c = document.createElementNS(D, "rect");
2502
+ const ee = 100, Wo = '<?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">', Yo = (e, t = !1) => {
2503
+ const n = e.nodes, o = n.offsetHeight + ee * 2, s = n.offsetWidth + ee * 2, i = Oo(o + "px", s + "px"), l = document.createElementNS(_, "svg"), c = document.createElementNS(_, "rect");
2500
2504
  k(c, {
2501
2505
  x: "0",
2502
2506
  y: "0",
@@ -2504,7 +2508,7 @@ const ee = 100, Bo = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC
2504
2508
  height: `${o}`,
2505
2509
  fill: e.theme.cssVar["--bgcolor"]
2506
2510
  }), i.appendChild(c), n.querySelectorAll(".subLines").forEach((h) => {
2507
- const u = h.cloneNode(!0), { offsetLeft: b, offsetTop: v } = L(n, h.parentElement);
2511
+ const u = h.cloneNode(!0), { offsetLeft: b, offsetTop: v } = M(n, h.parentElement);
2508
2512
  u.setAttribute("x", `${b}`), u.setAttribute("y", `${v}`), l.appendChild(u);
2509
2513
  });
2510
2514
  const r = n.querySelector(".lines")?.cloneNode(!0);
@@ -2513,22 +2517,22 @@ const ee = 100, Bo = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC
2513
2517
  a && l.appendChild(a);
2514
2518
  const d = n.querySelector(".summary")?.cloneNode(!0);
2515
2519
  return d && l.appendChild(d), n.querySelectorAll("me-tpc").forEach((h) => {
2516
- h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(Q(e, h, !t)) : (l.appendChild(jo(e, h)), l.appendChild(Q(e, h.text, !t)));
2520
+ h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(Q(e, h, !t)) : (l.appendChild(Io(e, h)), l.appendChild(Q(e, h.text, !t)));
2517
2521
  }), n.querySelectorAll(".tags > span").forEach((h) => {
2518
2522
  l.appendChild(Q(e, h));
2519
2523
  }), n.querySelectorAll(".icons > span").forEach((h) => {
2520
2524
  l.appendChild(Q(e, h));
2521
2525
  }), n.querySelectorAll(".hyper-link").forEach((h) => {
2522
- l.appendChild(Io(e, h));
2523
- }), n.querySelectorAll("img").forEach((h) => {
2524
2526
  l.appendChild(Ro(e, h));
2527
+ }), n.querySelectorAll("img").forEach((h) => {
2528
+ l.appendChild(Bo(e, h));
2525
2529
  }), k(l, {
2526
2530
  x: ee + "",
2527
2531
  y: ee + "",
2528
2532
  overflow: "visible"
2529
2533
  }), i.appendChild(l), i;
2530
- }, Yo = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Bo + e.outerHTML);
2531
- function Xo(e) {
2534
+ }, Xo = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Wo + e.outerHTML);
2535
+ function Fo(e) {
2532
2536
  return new Promise((t, n) => {
2533
2537
  const o = new FileReader();
2534
2538
  o.onload = (s) => {
@@ -2538,11 +2542,11 @@ function Xo(e) {
2538
2542
  }, o.readAsDataURL(e);
2539
2543
  });
2540
2544
  }
2541
- const Fo = function(e = !1, t) {
2542
- const n = Wo(this, e), o = Yo(n, t);
2545
+ const Ko = function(e = !1, t) {
2546
+ const n = Yo(this, e), o = Xo(n, t);
2543
2547
  return new Blob([o], { type: "image/svg+xml" });
2544
- }, Ko = async function(e = !1, t) {
2545
- const n = this.exportSvg(e, t), o = await Xo(n);
2548
+ }, Vo = async function(e = !1, t) {
2549
+ const n = this.exportSvg(e, t), o = await Fo(n);
2546
2550
  return new Promise((s, i) => {
2547
2551
  const l = new Image();
2548
2552
  l.setAttribute("crossOrigin", "anonymous"), l.onload = () => {
@@ -2550,12 +2554,12 @@ const Fo = function(e = !1, t) {
2550
2554
  c.width = l.width, c.height = l.height, c.getContext("2d").drawImage(l, 0, 0), c.toBlob(s, "image/png", 1);
2551
2555
  }, l.src = o, l.onerror = i;
2552
2556
  });
2553
- }, Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2557
+ }, zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2554
2558
  __proto__: null,
2555
- exportPng: Ko,
2556
- exportSvg: Fo
2559
+ exportPng: Vo,
2560
+ exportSvg: Ko
2557
2561
  }, Symbol.toStringTag, { value: "Module" }));
2558
- function zo(e, t) {
2562
+ function Go(e, t) {
2559
2563
  return async function(...n) {
2560
2564
  const o = this.before[t];
2561
2565
  o && !await o.apply(this, n) || e.apply(this, n);
@@ -2564,9 +2568,9 @@ function zo(e, t) {
2564
2568
  const Ge = Object.keys(ot), ut = {};
2565
2569
  for (let e = 0; e < Ge.length; e++) {
2566
2570
  const t = Ge[e];
2567
- ut[t] = zo(ot[t], t);
2571
+ ut[t] = Go(ot[t], t);
2568
2572
  }
2569
- const Go = {
2573
+ const qo = {
2570
2574
  getObjById: ne,
2571
2575
  generateNewObj: pt,
2572
2576
  layout: Ct,
@@ -2578,11 +2582,12 @@ const Go = {
2578
2582
  createTopic: Dt,
2579
2583
  findEle: Ze,
2580
2584
  changeTheme: io,
2585
+ changeCompact: ro,
2581
2586
  ...En,
2582
2587
  ...ut,
2583
- ...wo,
2584
- ...Ao,
2585
- ...Vo,
2588
+ ...xo,
2589
+ ...Po,
2590
+ ...zo,
2586
2591
  init(e) {
2587
2592
  if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData) return new Error("MindElixir: `data` is required");
2588
2593
  e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, R(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Jn(this), this.keypress && An(this, this.keypress), so(this), this.disposable.push(Et()), this.contextMenu && this.disposable.push(In(this, this.contextMenu)), this.allowUndo && this.disposable.push(Bn(this)), this.layout(), this.linkDiv(), this.toCenter();
@@ -2598,25 +2603,25 @@ const Go = {
2598
2603
  this.mobileMultiSelect = e;
2599
2604
  }
2600
2605
  };
2601
- function qo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, containerHeight: a }) {
2606
+ function Uo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, containerHeight: a }) {
2602
2607
  let d = t + n / 2;
2603
2608
  const h = e + o / 2;
2604
2609
  let u;
2605
- r === O.LHS ? u = i + l : u = i;
2610
+ r === H.LHS ? u = i + l : u = i;
2606
2611
  const b = s + c / 2, p = (1 - Math.abs(b - h) / a) * 0.25 * (n / 2);
2607
- return r === O.LHS ? d = d - n / 10 - p : d = d + n / 10 + p, `M ${d} ${h} Q ${d} ${b} ${u} ${b}`;
2612
+ return r === H.LHS ? d = d - n / 10 - p : d = d + n / 10 + p, `M ${d} ${h} Q ${d} ${b} ${u} ${b}`;
2608
2613
  }
2609
- function Uo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, isFirst: a }) {
2614
+ function Jo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, isFirst: a }) {
2610
2615
  const d = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
2611
2616
  let h = 0, u = 0;
2612
2617
  a ? h = e + o / 2 : h = e + o;
2613
2618
  const b = s + c;
2614
2619
  let v = 0, p = 0, g = 0;
2615
2620
  const m = Math.abs(h - b) / 300 * d;
2616
- return r === O.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${b} ${p} ${b} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${b} ${p} ${b} H ${u}`);
2621
+ return r === H.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${b} ${p} ${b} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${b} ${p} ${b} H ${u}`);
2617
2622
  }
2618
- const Jo = "5.11.3";
2619
- function Zo(e) {
2623
+ const Zo = "5.12.0";
2624
+ function Qo(e) {
2620
2625
  return {
2621
2626
  x: 0,
2622
2627
  y: 0,
@@ -2643,7 +2648,7 @@ function Zo(e) {
2643
2648
  }
2644
2649
  };
2645
2650
  }
2646
- function A({
2651
+ function P({
2647
2652
  el: e,
2648
2653
  direction: t,
2649
2654
  editable: n,
@@ -2658,41 +2663,42 @@ function A({
2658
2663
  generateMainBranch: h,
2659
2664
  generateSubBranch: u,
2660
2665
  overflowHidden: b,
2661
- theme: v,
2662
- alignment: p,
2663
- scaleSensitivity: g,
2664
- scaleMax: m,
2665
- scaleMin: w,
2666
- handleWheel: C,
2667
- markdown: N,
2668
- imageProxy: f,
2669
- pasteHandler: y,
2670
- mobileMultiSelect: x
2666
+ compact: v,
2667
+ theme: p,
2668
+ alignment: g,
2669
+ scaleSensitivity: m,
2670
+ scaleMax: w,
2671
+ scaleMin: E,
2672
+ handleWheel: N,
2673
+ markdown: f,
2674
+ imageProxy: y,
2675
+ pasteHandler: x,
2676
+ mobileMultiSelect: S
2671
2677
  }) {
2672
- let E = null;
2673
- const S = Object.prototype.toString.call(e);
2674
- if (S === "[object HTMLDivElement]" ? E = e : S === "[object String]" && (E = document.querySelector(e)), !E) throw new Error("MindElixir: el is not a valid element");
2675
- E.style.position = "relative", E.innerHTML = "", this.el = E, this.disposable = [], this.before = r || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = t ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = g ?? 0.1, this.scaleMax = m ?? 1.4, this.scaleMin = w ?? 0.2, this.generateMainBranch = h || qo, this.generateSubBranch = u || Uo, this.overflowHidden = b ?? !1, this.alignment = p ?? "root", this.handleWheel = C ?? !0, this.markdown = N || void 0, this.imageProxy = f || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = x ?? !1, this.panHelper = Zo(this), this.bus = On(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
2676
- const T = window.matchMedia("(prefers-color-scheme: dark)");
2677
- this.theme = v || (T.matches ? ue : fe);
2678
- const _ = document.createElement("div");
2679
- _.className = "map-canvas", this.map = _, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = z("lines"), this.summarySvg = z("summary"), this.linkController = z("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = je(), this.line2 = je(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = z("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Pn(this)), y && (this.pasteHandler = y);
2678
+ let C = null;
2679
+ const T = Object.prototype.toString.call(e);
2680
+ if (T === "[object HTMLDivElement]" ? C = e : T === "[object String]" && (C = document.querySelector(e)), !C) throw new Error("MindElixir: el is not a valid element");
2681
+ C.style.position = "relative", C.innerHTML = "", this.el = C, this.disposable = [], this.before = r || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = t ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = m ?? 0.1, this.scaleMax = w ?? 1.4, this.scaleMin = E ?? 0.2, this.generateMainBranch = h || Uo, this.generateSubBranch = u || Jo, this.overflowHidden = b ?? !1, this.compact = v ?? !1, this.alignment = g ?? "root", this.handleWheel = N ?? !0, this.markdown = f || void 0, this.imageProxy = y || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = S ?? !1, this.panHelper = Qo(this), this.bus = On(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
2682
+ const D = window.matchMedia("(prefers-color-scheme: dark)");
2683
+ this.theme = p || (D.matches ? ue : fe);
2684
+ const L = document.createElement("div");
2685
+ L.className = "map-canvas", this.map = L, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = z("lines"), this.summarySvg = z("summary"), this.linkController = z("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = je(), this.line2 = je(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = z("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Pn(this)), x && (this.pasteHandler = x);
2680
2686
  }
2681
- A.prototype = Go;
2682
- Object.defineProperty(A.prototype, "currentNode", {
2687
+ P.prototype = qo;
2688
+ Object.defineProperty(P.prototype, "currentNode", {
2683
2689
  get() {
2684
2690
  return this.currentNodes[this.currentNodes.length - 1];
2685
2691
  },
2686
2692
  enumerable: !0
2687
2693
  });
2688
- A.LEFT = 0;
2689
- A.RIGHT = 1;
2690
- A.SIDE = 2;
2691
- A.THEME = fe;
2692
- A.DARK_THEME = ue;
2693
- A.version = Jo;
2694
- A.E = Ze;
2695
- A.new = (e) => ({
2694
+ P.LEFT = 0;
2695
+ P.RIGHT = 1;
2696
+ P.SIDE = 2;
2697
+ P.THEME = fe;
2698
+ P.DARK_THEME = ue;
2699
+ P.version = Zo;
2700
+ P.E = Ze;
2701
+ P.new = (e) => ({
2696
2702
  nodeData: {
2697
2703
  id: B(),
2698
2704
  topic: e || "new topic",
@@ -2701,9 +2707,9 @@ A.new = (e) => ({
2701
2707
  });
2702
2708
  export {
2703
2709
  ue as DARK_THEME,
2704
- Qo as LEFT,
2705
- es as RIGHT,
2706
- ts as SIDE,
2710
+ es as LEFT,
2711
+ ts as RIGHT,
2712
+ ns as SIDE,
2707
2713
  fe as THEME,
2708
- A as default
2714
+ P as default
2709
2715
  };