@billtaofbj/mindmap 1.1.0 → 1.2.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.
package/dist/index.es.js CHANGED
@@ -3,7 +3,7 @@ import { BrandWatermark as O } from "@billtaofbj/core";
3
3
  import { useRoute as k, useRouter as A } from "vue-router";
4
4
  import { ElMessage as j, ElMessageBox as M } from "element-plus";
5
5
  import N from "axios";
6
- import { Aim as P, ArrowLeft as F, Bell as I, Brush as L, Check as R, Clock as z, Close as B, CopyDocument as V, Delete as H, Document as U, DocumentCopy as W, Download as G, Edit as K, FullScreen as q, Grid as ee, InfoFilled as J, Link as Y, Loading as te, Monitor as X, Picture as Z, Plus as ne, Promotion as re, Refresh as ie, RefreshLeft as ae, RefreshRight as oe, Scissor as se, Share as ce, Switch as le, ZoomIn as ue, ZoomOut as de } from "@element-plus/icons-vue";
6
+ import { Aim as P, ArrowLeft as F, Bell as I, Brush as L, Check as R, Clock as z, Close as B, CopyDocument as V, Delete as H, Document as U, DocumentCopy as W, Download as G, Edit as K, FullScreen as q, Grid as ee, InfoFilled as te, Link as J, Loading as Y, Monitor as X, Picture as ne, Plus as Z, Promotion as re, Refresh as ie, RefreshLeft as ae, RefreshRight as oe, Scissor as se, Share as ce, Switch as le, ZoomIn as ue, ZoomOut as de } from "@element-plus/icons-vue";
7
7
  import * as fe from "yjs";
8
8
  import { HocuspocusProvider as pe } from "@hocuspocus/provider";
9
9
  N.create({
@@ -41,7 +41,7 @@ var ge = me("/api"), Q = (e, t) => {
41
41
  let n = e.__vccOpts || e;
42
42
  for (let [e, r] of t) n[e] = r;
43
43
  return n;
44
- }, _e = { class: "chat-header" }, ve = { class: "chat-header-left" }, ye = { class: "chat-title" }, $ = { class: "online-users-list" }, be = { class: "online-user-item" }, xe = { class: "online-user-name" }, Se = { key: 1 }, Ce = { class: "online-user-name" }, we = { class: "chat-header-right" }, Te = {
44
+ }, _e = { class: "chat-header" }, ve = { class: "chat-header-left" }, ye = { class: "chat-title" }, be = { class: "online-users-list" }, $ = { class: "online-user-item" }, xe = { class: "online-user-name" }, Se = { key: 1 }, Ce = { class: "online-user-name" }, we = { class: "chat-header-right" }, Te = {
45
45
  key: 0,
46
46
  class: "chat-empty"
47
47
  }, Ee = { class: "chat-empty-hint" }, De = { key: 1 }, Oe = { class: "message-content" }, ke = {
@@ -194,7 +194,7 @@ var ge = me("/api"), Q = (e, t) => {
194
194
  default: w(() => [o(b(F.value) + "人在线 ", 1)]),
195
195
  _: 1
196
196
  })]),
197
- default: w(() => [a("div", $, [a("div", be, [
197
+ default: w(() => [a("div", be, [a("div", $, [
198
198
  a("div", {
199
199
  class: "online-user-avatar",
200
200
  style: f({ background: c.currentUser.color || "#409EFF" })
@@ -543,8 +543,119 @@ function Be() {
543
543
  };
544
544
  }
545
545
  //#endregion
546
+ //#region ../../src/composables/useAiApi.js
547
+ var Ve = [
548
+ "我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
549
+ "这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
550
+ "根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
551
+ "流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
552
+ "我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
553
+ "建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
554
+ "这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
555
+ "我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
556
+ ];
557
+ function He() {
558
+ return Ve[Math.floor(Math.random() * Ve.length)];
559
+ }
560
+ async function Ue(e, t, n) {
561
+ let r = { "Content-Type": "application/json" };
562
+ e.apiKey && (r.Authorization = `Bearer ${e.apiKey}`);
563
+ let i = await fetch(e.url, {
564
+ method: "POST",
565
+ headers: r,
566
+ body: JSON.stringify({
567
+ model: e.model || "gpt-4o-mini",
568
+ messages: t,
569
+ temperature: e.temperature ?? .7,
570
+ max_tokens: e.maxTokens ?? 4096
571
+ }),
572
+ signal: n
573
+ });
574
+ if (!i.ok) {
575
+ let e = await i.text().catch(() => "");
576
+ throw Error(`AI API error ${i.status}: ${e}`);
577
+ }
578
+ return (await i.json()).choices?.[0]?.message?.content || "";
579
+ }
580
+ function We(e) {
581
+ let t = _(!1), n = null, r = () => {
582
+ let t = typeof e == "function" ? e() : e;
583
+ return !!(t && t.url);
584
+ }, i = () => typeof e == "function" ? e() : e || {};
585
+ return {
586
+ loading: t,
587
+ isAvailable: r,
588
+ chat: async (e, r = []) => {
589
+ let a = i();
590
+ if (!a.url) return He();
591
+ t.value = !0, n && n.abort(), n = new AbortController();
592
+ try {
593
+ return await Ue(a, [
594
+ {
595
+ role: "system",
596
+ content: a.chatPrompt || "你是一个有帮助的AI助手,擅长文档编辑和流程设计。请简洁回答用户问题。"
597
+ },
598
+ ...r.map((e) => ({
599
+ role: e.role === "ai" ? "assistant" : "user",
600
+ content: e.content
601
+ })),
602
+ {
603
+ role: "user",
604
+ content: e
605
+ }
606
+ ], n.signal);
607
+ } catch (e) {
608
+ return e.name === "AbortError" ? "" : (console.warn("[useAiApi] Chat error, falling back to mock:", e), He());
609
+ } finally {
610
+ t.value = !1;
611
+ }
612
+ },
613
+ generate: async (e, r) => {
614
+ let a = i();
615
+ if (!a.url) return {
616
+ success: !1,
617
+ message: "AI生成功能开发中,敬请期待..."
618
+ };
619
+ t.value = !0, n && n.abort(), n = new AbortController();
620
+ try {
621
+ let t = await Ue(a, [{
622
+ role: "system",
623
+ content: a.generatePrompt || `你是一个专业的${r || "流程图"}生成助手。根据用户的描述,生成对应的JSON数据结构。只返回JSON,不要包含其他文字或markdown代码块标记。`
624
+ }, {
625
+ role: "user",
626
+ content: e
627
+ }], n.signal), i = null;
628
+ try {
629
+ let e = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```$/i, "").trim();
630
+ i = JSON.parse(e);
631
+ } catch {
632
+ i = null;
633
+ }
634
+ return {
635
+ success: !0,
636
+ content: t,
637
+ parsed: i
638
+ };
639
+ } catch (e) {
640
+ return e.name === "AbortError" ? {
641
+ success: !1,
642
+ message: "已取消"
643
+ } : (console.warn("[useAiApi] Generate error:", e), {
644
+ success: !1,
645
+ message: `AI生成失败: ${e.message}`
646
+ });
647
+ } finally {
648
+ t.value = !1;
649
+ }
650
+ },
651
+ abort: () => {
652
+ n &&= (n.abort(), null);
653
+ }
654
+ };
655
+ }
656
+ //#endregion
546
657
  //#region ../../src/composables/useVersionHistory.js
547
- var Ve = "/api/document-versions", He = 5e3, Ue = () => {
658
+ var Ge = "/api/document-versions", Ke = 5e3, qe = () => {
548
659
  let e = _([]), t = _(!1);
549
660
  return {
550
661
  versions: e,
@@ -552,13 +663,13 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
552
663
  saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
553
664
  if (!e || !t || !n) return null;
554
665
  try {
555
- let { data: a } = await N.post(Ve, {
666
+ let { data: a } = await N.post(Ge, {
556
667
  document_id: e,
557
668
  doc_type: t,
558
669
  content: typeof n == "string" ? n : JSON.stringify(n),
559
670
  user_id: r || null,
560
671
  user_name: i || null
561
- }, { timeout: He });
672
+ }, { timeout: Ke });
562
673
  return a;
563
674
  } catch (e) {
564
675
  return console.warn("[useVersionHistory] Failed to save version:", e), null;
@@ -568,9 +679,9 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
568
679
  if (!n) return [];
569
680
  t.value = !0;
570
681
  try {
571
- let { data: t } = await N.get(Ve, {
682
+ let { data: t } = await N.get(Ge, {
572
683
  params: { document_id: n },
573
- timeout: He
684
+ timeout: Ke
574
685
  });
575
686
  return e.value = t, t;
576
687
  } catch (t) {
@@ -581,26 +692,26 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
581
692
  },
582
693
  getVersionContent: async (e) => {
583
694
  try {
584
- let { data: t } = await N.get(`${Ve}/${e}`, { timeout: He });
695
+ let { data: t } = await N.get(`${Ge}/${e}`, { timeout: Ke });
585
696
  return t;
586
697
  } catch (e) {
587
698
  return console.warn("[useVersionHistory] Failed to get version content:", e), null;
588
699
  }
589
700
  }
590
701
  };
591
- }, We = { class: "version-history-panel" }, Ge = {
702
+ }, Je = { class: "version-history-panel" }, Ye = {
592
703
  key: 0,
593
704
  class: "loading-state"
594
- }, Ke = {
705
+ }, Xe = {
595
706
  key: 1,
596
707
  class: "empty-state"
597
- }, qe = {
708
+ }, Ze = {
598
709
  key: 2,
599
710
  class: "version-list"
600
- }, Je = {
711
+ }, Qe = {
601
712
  key: 0,
602
713
  class: "current-version"
603
- }, Ye = { class: "current-version-header" }, Xe = { class: "version-number" }, Ze = ["onClick"], Qe = { class: "version-number" }, $e = { class: "version-user" }, et = { class: "panel-footer" }, tt = /*#__PURE__*/ Q({
714
+ }, $e = { class: "current-version-header" }, et = { class: "version-number" }, tt = ["onClick"], nt = { class: "version-number" }, rt = { class: "version-user" }, it = { class: "panel-footer" }, at = /*#__PURE__*/ Q({
604
715
  __name: "VersionHistoryPanel",
605
716
  props: {
606
717
  modelValue: {
@@ -614,7 +725,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
614
725
  },
615
726
  emits: ["update:modelValue", "apply"],
616
727
  setup(t, { expose: c, emit: l }) {
617
- let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: S } = Ue(), T = _(!1), E = _(null), D = _(!1), O = _(null);
728
+ let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: S } = qe(), T = _(!1), E = _(null), D = _(!1), O = _(null);
618
729
  C(() => u.modelValue, (e) => {
619
730
  T.value = e, e && u.documentId && (E.value = null, h(u.documentId).then((e) => {
620
731
  e && e.length > 0 && (O.value = e[0]);
@@ -651,7 +762,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
651
762
  size: "420px",
652
763
  "before-close": M
653
764
  }, {
654
- footer: w(() => [a("div", et, [s(_, {
765
+ footer: w(() => [a("div", it, [s(_, {
655
766
  type: "primary",
656
767
  disabled: !E.value,
657
768
  loading: D.value,
@@ -660,22 +771,22 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
660
771
  default: w(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
661
772
  _: 1
662
773
  }, 8, ["disabled", "loading"])])]),
663
- default: w(() => [a("div", We, [x(m) ? (g(), i("div", Ge, [s(l, { class: "is-loading" }, {
664
- default: w(() => [s(x(te))]),
774
+ default: w(() => [a("div", Je, [x(m) ? (g(), i("div", Ye, [s(l, { class: "is-loading" }, {
775
+ default: w(() => [s(x(Y))]),
665
776
  _: 1
666
- }), c[1] ||= a("span", null, "加载中...", -1)])) : x(p).length === 0 ? (g(), i("div", Ke, [s(l, {
777
+ }), c[1] ||= a("span", null, "加载中...", -1)])) : x(p).length === 0 ? (g(), i("div", Xe, [s(l, {
667
778
  size: 48,
668
779
  color: "#c0c4cc"
669
780
  }, {
670
781
  default: w(() => [s(x(z))]),
671
782
  _: 1
672
- }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", qe, [O.value ? (g(), i("div", Je, [a("div", Ye, [s(u, {
783
+ }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Ze, [O.value ? (g(), i("div", Qe, [a("div", $e, [s(u, {
673
784
  type: "success",
674
785
  size: "small"
675
786
  }, {
676
787
  default: w(() => [...c[3] ||= [o("当前版本", -1)]]),
677
788
  _: 1
678
- }), a("span", Xe, "v" + b(O.value.version_number), 1)])])) : r("", !0), s(h, null, {
789
+ }), a("span", et, "v" + b(O.value.version_number), 1)])])) : r("", !0), s(h, null, {
679
790
  default: w(() => [(g(!0), i(e, null, v(x(p), (e) => (g(), n(f, {
680
791
  key: e.id,
681
792
  timestamp: N(e.created_at),
@@ -686,7 +797,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
686
797
  default: w(() => [a("div", {
687
798
  class: d(["version-item", { active: E.value?.id === e.id }]),
688
799
  onClick: (t) => k(e)
689
- }, [a("span", Qe, "版本号:v" + b(e.version_number), 1), a("span", $e, "提交人:" + b(e.user_name || "未知用户"), 1)], 10, Ze)]),
800
+ }, [a("span", nt, "版本号:v" + b(e.version_number), 1), a("span", rt, "提交人:" + b(e.user_name || "未知用户"), 1)], 10, tt)]),
690
801
  _: 2
691
802
  }, 1032, [
692
803
  "timestamp",
@@ -699,7 +810,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
699
810
  }, 8, ["modelValue"]);
700
811
  };
701
812
  }
702
- }, [["__scopeId", "data-v-87924b7c"]]), nt = [
813
+ }, [["__scopeId", "data-v-87924b7c"]]), ot = [
703
814
  {
704
815
  label: "默认",
705
816
  value: "default",
@@ -1237,13 +1348,13 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1237
1348
  node: { color: "#333" }
1238
1349
  }
1239
1350
  }
1240
- ], rt = { class: "toolbar-left" }, it = { class: "toolbar-center" }, at = { class: "option-list" }, ot = ["onClick"], st = { class: "theme-picker" }, ct = { class: "theme-header" }, lt = { class: "theme-count" }, ut = { class: "theme-grid" }, dt = ["onClick", "title"], ft = { class: "theme-name" }, pt = { class: "zoom-value" }, mt = { class: "toolbar-right" }, ht = {
1351
+ ], st = { class: "toolbar-left" }, ct = { class: "toolbar-center" }, lt = { class: "option-list" }, ut = ["onClick"], dt = { class: "theme-picker" }, ft = { class: "theme-header" }, pt = { class: "theme-count" }, mt = { class: "theme-grid" }, ht = ["onClick", "title"], gt = { class: "theme-name" }, _t = { class: "zoom-value" }, vt = { class: "toolbar-right" }, yt = {
1241
1352
  key: 0,
1242
1353
  class: "collab-users"
1243
- }, gt = ["title"], _t = {
1354
+ }, bt = ["title"], xt = {
1244
1355
  key: 0,
1245
1356
  class: "collab-more"
1246
- }, vt = /*#__PURE__*/ Q({
1357
+ }, St = /*#__PURE__*/ Q({
1247
1358
  __name: "MindMapToolbar",
1248
1359
  props: {
1249
1360
  undoCount: {
@@ -1395,14 +1506,14 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1395
1506
  label: "鱼骨图2",
1396
1507
  value: "fishbone2"
1397
1508
  }
1398
- ], k = nt;
1509
+ ], k = ot;
1399
1510
  return (c, u) => {
1400
1511
  let p = y("el-icon"), _ = y("el-button"), C = y("el-input"), A = y("el-divider"), j = y("el-popover"), M = y("el-dropdown-item"), N = y("el-dropdown-menu"), I = y("el-dropdown"), z = y("Clock"), B = y("el-dialog");
1401
1512
  return g(), i(e, null, [a("div", {
1402
1513
  class: "mindmap-toolbar",
1403
1514
  onMousedown: l
1404
1515
  }, [
1405
- a("div", rt, [
1516
+ a("div", st, [
1406
1517
  t.backButton === "hide" ? r("", !0) : (g(), n(_, {
1407
1518
  key: 0,
1408
1519
  size: "small",
@@ -1438,7 +1549,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1438
1549
  required: ""
1439
1550
  }, null, 8, ["modelValue", "disabled"])
1440
1551
  ]),
1441
- a("div", it, [
1552
+ a("div", ct, [
1442
1553
  s(_, {
1443
1554
  size: "small",
1444
1555
  circle: "",
@@ -1489,7 +1600,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1489
1600
  title: "插入子节点"
1490
1601
  }, {
1491
1602
  default: w(() => [s(p, null, {
1492
- default: w(() => [s(x(ne))]),
1603
+ default: w(() => [s(x(Z))]),
1493
1604
  _: 1
1494
1605
  })]),
1495
1606
  _: 1
@@ -1550,11 +1661,11 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1550
1661
  })]),
1551
1662
  _: 1
1552
1663
  }, 8, ["disabled"])]),
1553
- default: w(() => [a("div", at, [(g(), i(e, null, v(O, (e) => a("div", {
1664
+ default: w(() => [a("div", lt, [(g(), i(e, null, v(O, (e) => a("div", {
1554
1665
  key: e.value,
1555
1666
  class: d(["option-item", { active: t.currentLayout === e.value }]),
1556
1667
  onClick: (t) => c.$emit("change-layout", e.value)
1557
- }, b(e.label), 11, ot)), 64))])]),
1668
+ }, b(e.label), 11, ut)), 64))])]),
1558
1669
  _: 1
1559
1670
  }),
1560
1671
  s(j, {
@@ -1574,7 +1685,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1574
1685
  })]),
1575
1686
  _: 1
1576
1687
  }, 8, ["disabled"])]),
1577
- default: w(() => [a("div", st, [a("div", ct, [u[25] ||= a("h4", null, "选择主题", -1), a("span", lt, b(x(k).length) + " 种配色", 1)]), a("div", ut, [(g(!0), i(e, null, v(x(k), (e) => (g(), i("div", {
1688
+ default: w(() => [a("div", dt, [a("div", ft, [u[25] ||= a("h4", null, "选择主题", -1), a("span", pt, b(x(k).length) + " 种配色", 1)]), a("div", mt, [(g(!0), i(e, null, v(x(k), (e) => (g(), i("div", {
1578
1689
  key: e.value,
1579
1690
  class: d(["theme-item", { active: t.currentTheme === e.value }]),
1580
1691
  onClick: (t) => c.$emit("change-theme", e.value),
@@ -1586,7 +1697,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1586
1697
  }, [a("div", {
1587
1698
  class: "theme-line",
1588
1699
  style: f({ background: e.config?.root?.fillColor || "#549688" })
1589
- }, null, 4)], 4), a("span", ft, b(e.label), 1)], 42, dt))), 128))])])]),
1700
+ }, null, 4)], 4), a("span", gt, b(e.label), 1)], 42, ht))), 128))])])]),
1590
1701
  _: 1
1591
1702
  }),
1592
1703
  s(A, { direction: "vertical" }),
@@ -1602,7 +1713,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1602
1713
  })]),
1603
1714
  _: 1
1604
1715
  }),
1605
- a("span", pt, b(t.zoomPercent) + "%", 1),
1716
+ a("span", _t, b(t.zoomPercent) + "%", 1),
1606
1717
  s(_, {
1607
1718
  size: "small",
1608
1719
  circle: "",
@@ -1654,13 +1765,13 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1654
1765
  _: 1
1655
1766
  }, 8, ["disabled"])
1656
1767
  ]),
1657
- a("div", mt, [
1658
- t.collabUsers.length > 0 ? (g(), i("div", ht, [(g(!0), i(e, null, v(t.collabUsers.slice(0, 5), (e) => (g(), i("div", {
1768
+ a("div", vt, [
1769
+ t.collabUsers.length > 0 ? (g(), i("div", yt, [(g(!0), i(e, null, v(t.collabUsers.slice(0, 5), (e) => (g(), i("div", {
1659
1770
  key: e.clientId,
1660
1771
  class: "collab-avatar",
1661
1772
  style: f({ background: e.color }),
1662
1773
  title: e.name
1663
- }, b(e.name?.charAt(0)), 13, gt))), 128)), t.collabUsers.length > 5 ? (g(), i("span", _t, "+" + b(t.collabUsers.length - 5), 1)) : r("", !0)])) : r("", !0),
1774
+ }, b(e.name?.charAt(0)), 13, bt))), 128)), t.collabUsers.length > 5 ? (g(), i("span", xt, "+" + b(t.collabUsers.length - 5), 1)) : r("", !0)])) : r("", !0),
1664
1775
  !t.isCollaborating || t.isCollabOwner ? (g(), n(_, {
1665
1776
  key: 1,
1666
1777
  size: "small",
@@ -1682,7 +1793,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1682
1793
  title: "分享链接"
1683
1794
  }, {
1684
1795
  default: w(() => [s(p, null, {
1685
- default: w(() => [s(x(Y))]),
1796
+ default: w(() => [s(x(J))]),
1686
1797
  _: 1
1687
1798
  })]),
1688
1799
  _: 1
@@ -1695,7 +1806,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1695
1806
  default: w(() => [
1696
1807
  s(M, { command: "png" }, {
1697
1808
  default: w(() => [s(p, null, {
1698
- default: w(() => [s(x(Z))]),
1809
+ default: w(() => [s(x(ne))]),
1699
1810
  _: 1
1700
1811
  }), u[27] ||= o("导出 PNG ", -1)]),
1701
1812
  _: 1
@@ -1788,13 +1899,13 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1788
1899
  }, 8, ["modelValue"])], 64);
1789
1900
  };
1790
1901
  }
1791
- }, [["__scopeId", "data-v-695aef34"]]), yt = { class: "mindmap-property-panel" }, bt = { class: "panel-header" }, xt = {
1902
+ }, [["__scopeId", "data-v-695aef34"]]), Ct = { class: "mindmap-property-panel" }, wt = { class: "panel-header" }, Tt = {
1792
1903
  key: 0,
1793
1904
  class: "panel-content"
1794
- }, St = { class: "section" }, Ct = { class: "section" }, wt = { class: "setting-row" }, Tt = { class: "setting-row" }, Et = { class: "setting-row" }, Dt = { class: "setting-row" }, Ot = { class: "setting-row" }, kt = { class: "section" }, At = { class: "section" }, jt = { class: "tags-list" }, Mt = { class: "tag-input-row" }, Nt = { class: "section" }, Pt = {
1905
+ }, Et = { class: "section" }, Dt = { class: "section" }, Ot = { class: "setting-row" }, kt = { class: "setting-row" }, At = { class: "setting-row" }, jt = { class: "setting-row" }, Mt = { class: "setting-row" }, Nt = { class: "section" }, Pt = { class: "section" }, Ft = { class: "tags-list" }, It = { class: "tag-input-row" }, Lt = { class: "section" }, Rt = {
1795
1906
  key: 1,
1796
1907
  class: "panel-empty"
1797
- }, Ft = /*#__PURE__*/ Q({
1908
+ }, zt = /*#__PURE__*/ Q({
1798
1909
  __name: "MindMapPropertyPanel",
1799
1910
  props: {
1800
1911
  visible: {
@@ -1841,7 +1952,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1841
1952
  };
1842
1953
  return (r, c) => {
1843
1954
  let l = y("el-icon"), _ = y("el-button"), C = y("el-input"), R = y("el-slider"), z = y("el-color-picker"), V = y("el-option"), H = y("el-select"), U = y("el-tag");
1844
- return T((g(), i("div", yt, [a("div", bt, [c[16] ||= a("span", { class: "header-label" }, "属性", -1), s(_, {
1955
+ return T((g(), i("div", Ct, [a("div", wt, [c[16] ||= a("span", { class: "header-label" }, "属性", -1), s(_, {
1845
1956
  size: "small",
1846
1957
  circle: "",
1847
1958
  onClick: c[0] ||= (e) => r.$emit("close")
@@ -1851,17 +1962,17 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1851
1962
  _: 1
1852
1963
  })]),
1853
1964
  _: 1
1854
- })]), t.node ? (g(), i("div", xt, [
1855
- a("div", St, [c[17] ||= a("div", { class: "section-title" }, "节点文本", -1), s(C, {
1965
+ })]), t.node ? (g(), i("div", Tt, [
1966
+ a("div", Et, [c[17] ||= a("div", { class: "section-title" }, "节点文本", -1), s(C, {
1856
1967
  modelValue: u.value,
1857
1968
  "onUpdate:modelValue": c[1] ||= (e) => u.value = e,
1858
1969
  size: "small",
1859
1970
  onChange: M,
1860
1971
  placeholder: "输入节点文本"
1861
1972
  }, null, 8, ["modelValue"])]),
1862
- a("div", Ct, [
1973
+ a("div", Dt, [
1863
1974
  c[23] ||= a("div", { class: "section-title" }, "样式", -1),
1864
- a("div", wt, [c[18] ||= a("label", null, "字体大小", -1), s(R, {
1975
+ a("div", Ot, [c[18] ||= a("label", null, "字体大小", -1), s(R, {
1865
1976
  modelValue: d.value,
1866
1977
  "onUpdate:modelValue": c[2] ||= (e) => d.value = e,
1867
1978
  min: 12,
@@ -1870,25 +1981,25 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1870
1981
  onChange: c[3] ||= (e) => N("fontSize", e + "px"),
1871
1982
  style: { width: "140px" }
1872
1983
  }, null, 8, ["modelValue"])]),
1873
- a("div", Tt, [c[19] ||= a("label", null, "字体颜色", -1), s(z, {
1984
+ a("div", kt, [c[19] ||= a("label", null, "字体颜色", -1), s(z, {
1874
1985
  modelValue: f.value,
1875
1986
  "onUpdate:modelValue": c[4] ||= (e) => f.value = e,
1876
1987
  onChange: c[5] ||= (e) => N("color", e),
1877
1988
  size: "small"
1878
1989
  }, null, 8, ["modelValue"])]),
1879
- a("div", Et, [c[20] ||= a("label", null, "背景色", -1), s(z, {
1990
+ a("div", At, [c[20] ||= a("label", null, "背景色", -1), s(z, {
1880
1991
  modelValue: p.value,
1881
1992
  "onUpdate:modelValue": c[6] ||= (e) => p.value = e,
1882
1993
  onChange: c[7] ||= (e) => N("background", e),
1883
1994
  size: "small"
1884
1995
  }, null, 8, ["modelValue"])]),
1885
- a("div", Dt, [c[21] ||= a("label", null, "边框色", -1), s(z, {
1996
+ a("div", jt, [c[21] ||= a("label", null, "边框色", -1), s(z, {
1886
1997
  modelValue: m.value,
1887
1998
  "onUpdate:modelValue": c[8] ||= (e) => m.value = e,
1888
1999
  onChange: c[9] ||= (e) => N("borderColor", e),
1889
2000
  size: "small"
1890
2001
  }, null, 8, ["modelValue"])]),
1891
- a("div", Ot, [c[22] ||= a("label", null, "形状", -1), s(H, {
2002
+ a("div", Mt, [c[22] ||= a("label", null, "形状", -1), s(H, {
1892
2003
  modelValue: h.value,
1893
2004
  "onUpdate:modelValue": c[10] ||= (e) => h.value = e,
1894
2005
  size: "small",
@@ -1911,7 +2022,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1911
2022
  _: 1
1912
2023
  }, 8, ["modelValue"])])
1913
2024
  ]),
1914
- a("div", kt, [c[24] ||= a("div", { class: "section-title" }, "备注", -1), s(C, {
2025
+ a("div", Nt, [c[24] ||= a("div", { class: "section-title" }, "备注", -1), s(C, {
1915
2026
  modelValue: D.value,
1916
2027
  "onUpdate:modelValue": c[12] ||= (e) => D.value = e,
1917
2028
  type: "textarea",
@@ -1920,9 +2031,9 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1920
2031
  onChange: P,
1921
2032
  placeholder: "添加备注..."
1922
2033
  }, null, 8, ["modelValue"])]),
1923
- a("div", At, [
2034
+ a("div", Pt, [
1924
2035
  c[26] ||= a("div", { class: "section-title" }, "标签", -1),
1925
- a("div", jt, [(g(!0), i(e, null, v(O.value, (e, t) => (g(), n(U, {
2036
+ a("div", Ft, [(g(!0), i(e, null, v(O.value, (e, t) => (g(), n(U, {
1926
2037
  key: t,
1927
2038
  closable: "",
1928
2039
  size: "small",
@@ -1931,7 +2042,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1931
2042
  default: w(() => [o(b(e.text || e), 1)]),
1932
2043
  _: 2
1933
2044
  }, 1032, ["onClose"]))), 128))]),
1934
- a("div", Mt, [s(C, {
2045
+ a("div", It, [s(C, {
1935
2046
  modelValue: k.value,
1936
2047
  "onUpdate:modelValue": c[13] ||= (e) => k.value = e,
1937
2048
  size: "small",
@@ -1947,7 +2058,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1947
2058
  _: 1
1948
2059
  }, 8, ["disabled"])])
1949
2060
  ]),
1950
- a("div", Nt, [
2061
+ a("div", Lt, [
1951
2062
  c[27] ||= a("div", { class: "section-title" }, "超链接", -1),
1952
2063
  s(C, {
1953
2064
  modelValue: A.value,
@@ -1965,16 +2076,16 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
1965
2076
  style: { "margin-top": "6px" }
1966
2077
  }, null, 8, ["modelValue"])
1967
2078
  ])
1968
- ])) : (g(), i("div", Pt, [s(l, {
2079
+ ])) : (g(), i("div", Rt, [s(l, {
1969
2080
  size: 32,
1970
2081
  color: "#c0c4cc"
1971
2082
  }, {
1972
- default: w(() => [s(x(J))]),
2083
+ default: w(() => [s(x(te))]),
1973
2084
  _: 1
1974
2085
  }), c[28] ||= a("p", null, "点击节点编辑属性", -1)]))], 512)), [[S, t.visible]]);
1975
2086
  };
1976
2087
  }
1977
- }, [["__scopeId", "data-v-c06f1443"]]), It = /*#__PURE__*/ Q({
2088
+ }, [["__scopeId", "data-v-c06f1443"]]), Bt = /*#__PURE__*/ Q({
1978
2089
  __name: "MindMapContextMenu",
1979
2090
  props: {
1980
2091
  visible: {
@@ -2008,7 +2119,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2008
2119
  class: "menu-item",
2009
2120
  onClick: n[0] ||= (e) => r("insertChild")
2010
2121
  }, [s(c, null, {
2011
- default: w(() => [s(x(ne))]),
2122
+ default: w(() => [s(x(Z))]),
2012
2123
  _: 1
2013
2124
  }), n[7] ||= o("插入子节点 ", -1)]),
2014
2125
  a("div", {
@@ -2058,7 +2169,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2058
2169
  ], 4)), [[S, e.visible]]);
2059
2170
  };
2060
2171
  }
2061
- }, [["__scopeId", "data-v-0ca9bee8"]]), Lt = { class: "export-options" }, Rt = /*#__PURE__*/ Q({
2172
+ }, [["__scopeId", "data-v-0ca9bee8"]]), Vt = { class: "export-options" }, Ht = /*#__PURE__*/ Q({
2062
2173
  __name: "MindMapExportDialog",
2063
2174
  props: { visible: {
2064
2175
  type: Boolean,
@@ -2082,7 +2193,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2082
2193
  default: w(() => [...r[9] ||= [o("取消", -1)]]),
2083
2194
  _: 1
2084
2195
  })]),
2085
- default: w(() => [a("div", Lt, [
2196
+ default: w(() => [a("div", Vt, [
2086
2197
  a("div", {
2087
2198
  class: "export-item",
2088
2199
  onClick: r[0] ||= (e) => i("png")
@@ -2090,7 +2201,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2090
2201
  size: 32,
2091
2202
  color: "#409eff"
2092
2203
  }, {
2093
- default: w(() => [s(x(Z))]),
2204
+ default: w(() => [s(x(ne))]),
2094
2205
  _: 1
2095
2206
  }), r[6] ||= a("div", { class: "export-info" }, [a("div", { class: "export-name" }, "PNG 图片"), a("div", { class: "export-desc" }, "高清位图,适合分享和预览")], -1)]),
2096
2207
  a("div", {
@@ -2118,7 +2229,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2118
2229
  }, 8, ["model-value"]);
2119
2230
  };
2120
2231
  }
2121
- }, [["__scopeId", "data-v-c9798127"]]), zt = (e, t = {}) => {
2232
+ }, [["__scopeId", "data-v-c9798127"]]), Ut = (e, t = {}) => {
2122
2233
  let n = new fe.Doc(), r = _(!1), i = _([]), a = _(""), o = _(!1), s = !1, c = null;
2123
2234
  n.getXmlFragment("default");
2124
2235
  let l = window.location.hostname || "localhost", u = t.wsUrl || `ws://${l}:1234`, d = null, f = new pe({
@@ -2229,7 +2340,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2229
2340
  m(), c && clearTimeout(c), f.awareness.setLocalState(null), f.disconnect(), n.destroy();
2230
2341
  }
2231
2342
  };
2232
- }, Bt = { class: "mindmap-editor" }, Vt = { class: "editor-main" }, Ht = "mindmap", Ut = /*#__PURE__*/ Q({
2343
+ }, Wt = { class: "mindmap-editor" }, Gt = { class: "editor-main" }, Kt = "mindmap", qt = /*#__PURE__*/ Q({
2233
2344
  __name: "MindMapEditor",
2234
2345
  props: {
2235
2346
  docId: {
@@ -2259,6 +2370,10 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2259
2370
  uiConfig: {
2260
2371
  type: Object,
2261
2372
  default: () => ({})
2373
+ },
2374
+ aiApi: {
2375
+ type: [String, Object],
2376
+ default: null
2262
2377
  }
2263
2378
  },
2264
2379
  setup(e) {
@@ -2267,17 +2382,17 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2267
2382
  titleEditable: !0,
2268
2383
  authorEditable: !0,
2269
2384
  ...n.uiConfig
2270
- })), l = t(() => n.docId ?? r.params.id), d = t(() => n.apiBase && n.apiBase !== "/api" ? me(n.apiBase) : ge), f = _(null), h = _(null), v = _(!1), b = _(!1), S = _(!1), { saveVersion: T } = Ue(), E = Be(), O = _({
2385
+ })), l = t(() => n.docId ?? r.params.id), d = t(() => n.apiBase && n.apiBase !== "/api" ? me(n.apiBase) : ge), f = _(null), h = _(null), v = _(!1), b = _(!1), S = _(!1), { saveVersion: T } = qe(), E = Be(), O = We(() => n.aiApi), P = _({
2271
2386
  visible: !1,
2272
2387
  x: 0,
2273
2388
  y: 0
2274
- }), P = null, F = !1, I = null, L = _(!1), R = _(!1), z = _(!1), B = _([]), V = _(""), H = _(""), U = _(l.value || null), W = _(null), G = t(() => !!W.value), K = _(!1);
2275
- C(G, () => {
2389
+ }), F = null, I = !1, L = null, R = _(!1), z = _(!1), B = _(!1), V = _([]), H = _(""), U = _(""), W = _(l.value || null), G = _(null), K = t(() => !!G.value), q = _(!1);
2390
+ C(K, () => {
2276
2391
  u(() => {
2277
- P && (P.getElRectInfo(), P.resize(), Z.value && P.view.fit(void 0, !0));
2392
+ F && (F.getElRectInfo(), F.resize(), Z.value && F.view.fit(void 0, !0));
2278
2393
  });
2279
2394
  });
2280
- let q = _("mindMap"), ee = _("default"), J = _(0), Y = _(0), te = _(100), Z = _(!0), ne = {
2395
+ let ee = _("mindMap"), te = _("default"), J = _(0), Y = _(0), ne = _(100), Z = _(!0), re = {
2281
2396
  data: {
2282
2397
  text: "中心主题",
2283
2398
  expand: !0
@@ -2307,7 +2422,7 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2307
2422
  children: []
2308
2423
  }]
2309
2424
  }]
2310
- }, re = JSON.parse(JSON.stringify(ne)), ie = async () => {
2425
+ }, ie = JSON.parse(JSON.stringify(re)), ae = async () => {
2311
2426
  if (!f.value) return;
2312
2427
  let e = await import("./simple-mind-map-DFGmd5vc.mjs"), t = e.default || e, [r, i, a, o, s, c, p, m, h, g, _, v, y] = await Promise.all([
2313
2428
  import("./Export-C11gtER2.mjs"),
@@ -2323,22 +2438,22 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2323
2438
  import("./NodeImgAdjust-CU_ka96q.mjs"),
2324
2439
  import("./Watermark-B-zBgHXG.mjs"),
2325
2440
  import("./Formula-rim6V3Ro.mjs")
2326
- ]), b = r.default, x = i.default, S = a.default, C = o.default, w = s.default, T = c.default, E = p.default, D = m.default, O = h.default, k = g.default, A = _.default, j = v.default, M = y.default, I = ne, L = l.value;
2441
+ ]), b = r.default, x = i.default, S = a.default, C = o.default, w = s.default, T = c.default, E = p.default, D = m.default, O = h.default, k = g.default, A = _.default, j = v.default, M = y.default, P = re, L = l.value;
2327
2442
  if (L) try {
2328
2443
  let e;
2329
2444
  if (e = typeof n.loadApi == "function" ? await n.loadApi(L) : n.loadApi ? await N.get(`${n.loadApi}/${L}`) : await d.value.get(L), e.data?.content) {
2330
2445
  let t = JSON.parse(e.data.content);
2331
- t && t.data && (I = t, re = JSON.parse(JSON.stringify(t)));
2446
+ t && t.data && (P = t, ie = JSON.parse(JSON.stringify(t)));
2332
2447
  }
2333
- e.data?.title && (V.value = e.data.title), e.data?.author && (H.value = e.data.author);
2448
+ e.data?.title && (H.value = e.data.title), e.data?.author && (U.value = e.data.author);
2334
2449
  } catch (e) {
2335
2450
  console.warn("Failed to load document:", e);
2336
2451
  }
2337
- P = new t({
2452
+ F = new t({
2338
2453
  el: f.value,
2339
- data: I,
2340
- layout: q.value,
2341
- theme: ee.value,
2454
+ data: P,
2455
+ layout: ee.value,
2456
+ theme: te.value,
2342
2457
  scaleRatio: .1,
2343
2458
  mousewheelAction: "move",
2344
2459
  mousewheelMoveStep: 100,
@@ -2350,136 +2465,136 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2350
2465
  fit: !0,
2351
2466
  enableAutoEnterTextEditWhenKeydown: !1,
2352
2467
  enableShortcutOnlyWhenMouseInSvg: !0
2353
- }), P.addPlugin(b), P.addPlugin(x), P.addPlugin(S), P.addPlugin(C), P.addPlugin(w), P.addPlugin(T), P.addPlugin(E), P.addPlugin(D), P.addPlugin(O), P.addPlugin(k), P.addPlugin(A), P.addPlugin(j), P.addPlugin(M), P.on("node_click", (e) => {
2354
- W.value = e, K.value = !e.parent;
2355
- }), P.on("draw_click", () => {
2356
- W.value = null, K.value = !1;
2357
- }), P.on("history_change", () => {
2358
- ae();
2359
- }), P.on("back_forward", (e, t) => {
2468
+ }), F.addPlugin(b), F.addPlugin(x), F.addPlugin(S), F.addPlugin(C), F.addPlugin(w), F.addPlugin(T), F.addPlugin(E), F.addPlugin(D), F.addPlugin(O), F.addPlugin(k), F.addPlugin(A), F.addPlugin(j), F.addPlugin(M), F.on("node_click", (e) => {
2469
+ G.value = e, q.value = !e.parent;
2470
+ }), F.on("draw_click", () => {
2471
+ G.value = null, q.value = !1;
2472
+ }), F.on("history_change", () => {
2473
+ oe();
2474
+ }), F.on("back_forward", (e, t) => {
2360
2475
  J.value = e || 0, Y.value = (t || 1) - 1 - (e || 0);
2361
- }), P.on("data_change", () => {
2362
- xe();
2363
- }), P.on("before_show_text_edit", () => {
2364
- be = !0, $ && clearTimeout($);
2365
- }), P.on("hide_text_edit", () => {
2366
- be = !1, Z.value && u(() => Se());
2367
- }), P.on("scale", (e) => {
2368
- te.value = Math.round(e * 100);
2369
- }), P.on("node_tree_render_end", () => {
2370
- ae(), F || (F = !0, u(() => {
2371
- P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0), Te();
2476
+ }), F.on("data_change", () => {
2477
+ Se();
2478
+ }), F.on("before_show_text_edit", () => {
2479
+ xe = !0, $ && clearTimeout($);
2480
+ }), F.on("hide_text_edit", () => {
2481
+ xe = !1, Z.value && u(() => Ce());
2482
+ }), F.on("scale", (e) => {
2483
+ ne.value = Math.round(e * 100);
2484
+ }), F.on("node_tree_render_end", () => {
2485
+ oe(), I || (I = !0, u(() => {
2486
+ F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0), Ee();
2372
2487
  }));
2373
2488
  });
2374
- }, ae = () => {
2375
- if (P) try {
2376
- let e = P.command;
2489
+ }, oe = () => {
2490
+ if (F) try {
2491
+ let e = F.command;
2377
2492
  J.value = e.activeHistoryIndex || 0, Y.value = (e.history?.length || 1) - 1 - (e.activeHistoryIndex || 0);
2378
2493
  } catch {
2379
2494
  J.value = 0, Y.value = 0;
2380
2495
  }
2381
- }, oe = async () => {
2382
- if (!P) return;
2383
- I = zt(l.value || `mindmap-${Date.now()}`, { wsUrl: n.wsUrl || void 0 }), I.connect(n.wsUrl || void 0);
2496
+ }, se = async () => {
2497
+ if (!F) return;
2498
+ L = Ut(l.value || `mindmap-${Date.now()}`, { wsUrl: n.wsUrl || void 0 }), L.connect(n.wsUrl || void 0);
2384
2499
  let e = n.user?.name || `用户${Math.floor(Math.random() * 1e3)}`;
2385
- I.setUserInfo({ name: e }), E.setCollabContext({
2386
- ydoc: I.ydoc,
2387
- provider: I.provider,
2388
- onlineUsers: B
2500
+ L.setUserInfo({ name: e }), E.setCollabContext({
2501
+ ydoc: L.ydoc,
2502
+ provider: L.provider,
2503
+ onlineUsers: V
2389
2504
  }), E.setCurrentUser({
2390
- id: I.provider.awareness.clientID,
2505
+ id: L.provider.awareness.clientID,
2391
2506
  name: e,
2392
2507
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
2393
- }), I.syncToYjs(P.getData()), I.onRemoteChange((e) => {
2394
- P && P.setData(e);
2395
- }), P.on("data_change", () => {
2396
- I && I.syncToYjs(P.getData());
2397
- }), z.value = !0, L.value = !0, R.value = !0;
2508
+ }), L.syncToYjs(F.getData()), L.onRemoteChange((e) => {
2509
+ F && F.setData(e);
2510
+ }), F.on("data_change", () => {
2511
+ L && L.syncToYjs(F.getData());
2512
+ }), B.value = !0, R.value = !0, z.value = !0;
2398
2513
  let t = setInterval(() => {
2399
- I && (B.value = [...I.onlineUsers.value]);
2514
+ L && (V.value = [...L.onlineUsers.value]);
2400
2515
  }, 1e3);
2401
- I._userSyncTimer = t, l.value || await Ie();
2402
- let r = I.generateShareUrl();
2516
+ L._userSyncTimer = t, l.value || await Le();
2517
+ let r = L.generateShareUrl();
2403
2518
  j.success("协作已开启,分享链接已复制");
2404
2519
  try {
2405
2520
  await navigator.clipboard.writeText(r);
2406
2521
  } catch {}
2407
- }, se = () => {
2408
- I &&= (I._userSyncTimer && clearInterval(I._userSyncTimer), I.closeCollaboration(), null), z.value = !1, L.value = !1, R.value = !1, B.value = [], j.info("协作已关闭");
2409
- }, ce = async () => {
2410
- if (!P) return;
2522
+ }, ce = () => {
2523
+ L &&= (L._userSyncTimer && clearInterval(L._userSyncTimer), L.closeCollaboration(), null), B.value = !1, R.value = !1, z.value = !1, V.value = [], j.info("协作已关闭");
2524
+ }, le = async () => {
2525
+ if (!F) return;
2411
2526
  let e = l.value;
2412
2527
  if (!e) return;
2413
- I = zt(e, { wsUrl: n.wsUrl || void 0 }), I.connect();
2528
+ L = Ut(e, { wsUrl: n.wsUrl || void 0 }), L.connect();
2414
2529
  let t = n.user?.name || `协作人${Math.floor(Math.random() * 1e3)}`;
2415
- if (I.setUserInfo({ name: t }), E.setCollabContext({
2416
- ydoc: I.ydoc,
2417
- provider: I.provider,
2418
- onlineUsers: B
2530
+ if (L.setUserInfo({ name: t }), E.setCollabContext({
2531
+ ydoc: L.ydoc,
2532
+ provider: L.provider,
2533
+ onlineUsers: V
2419
2534
  }), E.setCurrentUser({
2420
- id: I.provider.awareness.clientID,
2535
+ id: L.provider.awareness.clientID,
2421
2536
  name: t,
2422
2537
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
2423
- }), I.onRemoteChange((e) => {
2424
- P && P.setData(e);
2425
- }), P.on("data_change", () => {
2426
- I && I.syncToYjs(P.getData());
2538
+ }), L.onRemoteChange((e) => {
2539
+ F && F.setData(e);
2540
+ }), F.on("data_change", () => {
2541
+ L && L.syncToYjs(F.getData());
2427
2542
  }), await new Promise((e) => {
2428
2543
  let t = () => {
2429
- let t = I.getYData().get("root");
2544
+ let t = L.getYData().get("root");
2430
2545
  if (t) try {
2431
2546
  let e = JSON.parse(t);
2432
- P.setData(e);
2547
+ F.setData(e);
2433
2548
  } catch {}
2434
2549
  e();
2435
2550
  };
2436
- if (I.isConnected.value) t();
2551
+ if (L.isConnected.value) t();
2437
2552
  else {
2438
- let e = C(() => I.isConnected.value, (n) => {
2553
+ let e = C(() => L.isConnected.value, (n) => {
2439
2554
  n && (e(), t());
2440
2555
  });
2441
2556
  }
2442
- }), I.checkCollaborationClosed()) {
2443
- j.warning("该协作已关闭,无法加入"), I.disconnect(), I = null;
2557
+ }), L.checkCollaborationClosed()) {
2558
+ j.warning("该协作已关闭,无法加入"), L.disconnect(), L = null;
2444
2559
  return;
2445
2560
  }
2446
- z.value = !0, L.value = !0, R.value = !1;
2561
+ B.value = !0, R.value = !0, z.value = !1;
2447
2562
  let r = setInterval(() => {
2448
- I && (B.value = [...I.onlineUsers.value]);
2563
+ L && (V.value = [...L.onlineUsers.value]);
2449
2564
  }, 1e3);
2450
- I._userSyncTimer = r, j.success("已加入协作");
2451
- }, le = async () => {
2452
- if (!I) await oe();
2565
+ L._userSyncTimer = r, j.success("已加入协作");
2566
+ }, ue = async () => {
2567
+ if (!L) await se();
2453
2568
  else {
2454
- let e = I.generateShareUrl();
2569
+ let e = L.generateShareUrl();
2455
2570
  try {
2456
2571
  await navigator.clipboard.writeText(e), j.success("分享链接已复制到剪贴板");
2457
2572
  } catch {
2458
2573
  j.info("分享链接: " + e);
2459
2574
  }
2460
2575
  }
2461
- }, ue = () => o.push("/"), de = (e) => {
2462
- P && (e === "child" ? P.execCommand("INSERT_CHILD_NODE") : P.execCommand("INSERT_NODE"));
2463
- }, fe = () => {
2464
- P && P.execCommand("REMOVE_NODE");
2576
+ }, de = () => o.push("/"), fe = (e) => {
2577
+ F && (e === "child" ? F.execCommand("INSERT_CHILD_NODE") : F.execCommand("INSERT_NODE"));
2465
2578
  }, pe = () => {
2466
- if (!P) return;
2467
- let e = P.getData(), t = (e) => {
2579
+ F && F.execCommand("REMOVE_NODE");
2580
+ }, he = () => {
2581
+ if (!F) return;
2582
+ let e = F.getData(), t = (e) => {
2468
2583
  e.children && e.children.length > 0 && (e.children.reverse(), e.children.forEach(t));
2469
2584
  };
2470
- t(e), P.setData(e), u(() => {
2471
- P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2585
+ t(e), F.setData(e), u(() => {
2586
+ F && (F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0));
2472
2587
  });
2473
- }, he = () => P?.execCommand("BACK"), Q = () => P?.execCommand("FORWARD"), _e = () => P?.view.enlarge(), ve = () => P?.view.narrow(), ye = () => {
2474
- P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2475
- }, $ = null, be = !1, xe = () => {
2476
- !Z.value || !P || be || ($ && clearTimeout($), $ = setTimeout(() => {
2477
- be || (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2588
+ }, Q = () => F?.execCommand("BACK"), _e = () => F?.execCommand("FORWARD"), ve = () => F?.view.enlarge(), ye = () => F?.view.narrow(), be = () => {
2589
+ F && (F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0));
2590
+ }, $ = null, xe = !1, Se = () => {
2591
+ !Z.value || !F || xe || ($ && clearTimeout($), $ = setTimeout(() => {
2592
+ xe || (F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0));
2478
2593
  }, 200));
2479
- }, Se = () => {
2480
- P && ($ && clearTimeout($), P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2481
- }, Ce = async () => {
2482
- if (P) {
2594
+ }, Ce = () => {
2595
+ F && ($ && clearTimeout($), F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0));
2596
+ }, we = async () => {
2597
+ if (F) {
2483
2598
  try {
2484
2599
  await M.confirm("确定要复位思维导图吗?将恢复到最近一次保存的状态。", "复位确认", {
2485
2600
  confirmButtonText: "确定",
@@ -2489,144 +2604,143 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2489
2604
  } catch {
2490
2605
  return;
2491
2606
  }
2492
- P.setData(re), u(() => {
2493
- P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2607
+ F.setData(ie), u(() => {
2608
+ F && (F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0));
2494
2609
  });
2495
2610
  }
2496
- }, we = null, Te = () => {
2497
- !f.value || !P || (we = new ResizeObserver(() => {
2498
- P && (P.getElRectInfo(), P.resize());
2499
- }), we.observe(f.value));
2500
- }, Ee = (e) => {
2501
- q.value = e, P && P.svg?.attr({ opacity: 0 }), P?.setLayout(e);
2611
+ }, Te = null, Ee = () => {
2612
+ !f.value || !F || (Te = new ResizeObserver(() => {
2613
+ F && (F.getElRectInfo(), F.resize());
2614
+ }), Te.observe(f.value));
2615
+ }, De = (e) => {
2616
+ ee.value = e, F && F.svg?.attr({ opacity: 0 }), F?.setLayout(e);
2502
2617
  let t = () => {
2503
- P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0), P.svg?.attr({ opacity: 1 }), P.off("node_tree_render_end", t));
2618
+ F && (F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0), F.svg?.attr({ opacity: 1 }), F.off("node_tree_render_end", t));
2504
2619
  };
2505
- P?.on("node_tree_render_end", t), setTimeout(() => {
2506
- P && (P.svg?.attr({ opacity: 1 }), P.off("node_tree_render_end", t));
2620
+ F?.on("node_tree_render_end", t), setTimeout(() => {
2621
+ F && (F.svg?.attr({ opacity: 1 }), F.off("node_tree_render_end", t));
2507
2622
  }, 3e3);
2508
- }, De = (e) => {
2509
- ee.value = e;
2510
- let t = nt.find((t) => t.value === e);
2511
- t && t.config && Object.keys(t.config).length > 0 ? P?.setThemeConfig(t.config) : P?.setTheme("default");
2512
2623
  }, Oe = (e) => {
2513
- !P || !W.value || (W.value.setData({ text: e }), P.render());
2624
+ te.value = e;
2625
+ let t = ot.find((t) => t.value === e);
2626
+ t && t.config && Object.keys(t.config).length > 0 ? F?.setThemeConfig(t.config) : F?.setTheme("default");
2514
2627
  }, ke = (e) => {
2515
- if (!P || !W.value) return;
2516
- let t = W.value.getData("style") || {};
2517
- W.value.setData("style", {
2628
+ !F || !G.value || (G.value.setData({ text: e }), F.render());
2629
+ }, Ae = (e) => {
2630
+ if (!F || !G.value) return;
2631
+ let t = G.value.getData("style") || {};
2632
+ G.value.setData("style", {
2518
2633
  ...t,
2519
2634
  ...e
2520
- }), P.render();
2521
- }, Ae = (e) => {
2522
- !P || !W.value || W.value.setData({ note: e });
2635
+ }), F.render();
2523
2636
  }, je = (e) => {
2524
- !P || !W.value || W.value.setData({ tag: e });
2525
- }, Me = ({ hyperlink: e, hyperlinkTitle: t }) => {
2526
- !P || !W.value || W.value.setData({
2637
+ !F || !G.value || G.value.setData({ note: e });
2638
+ }, Me = (e) => {
2639
+ !F || !G.value || G.value.setData({ tag: e });
2640
+ }, Ne = ({ hyperlink: e, hyperlinkTitle: t }) => {
2641
+ !F || !G.value || G.value.setData({
2527
2642
  hyperlink: e,
2528
2643
  hyperlinkTitle: t
2529
2644
  });
2530
- }, Ne = (e) => {
2531
- e === "png" || e === "svg" ? v.value = !0 : Fe(e);
2532
- }, Pe = async (e) => {
2533
- j.info("AI生成功能开发中,敬请期待...");
2645
+ }, Pe = (e) => {
2646
+ e === "png" || e === "svg" ? v.value = !0 : Ie(e);
2534
2647
  }, Fe = async (e) => {
2535
- if (P) try {
2536
- e === "png" ? await P.export.exportImg() : e === "svg" ? await P.export.exportSvg() : e === "pdf" && await P.export.exportPdf(), j.success("导出成功");
2648
+ let t = await O.generate(e, "思维导图");
2649
+ if (t.success && t.parsed) try {
2650
+ F.setData(t.parsed), j.success("AI生成成功");
2651
+ } catch {
2652
+ j.warning("AI返回的数据格式无法解析,请调整提示词后重试");
2653
+ }
2654
+ else j.info(t.message || "AI生成功能开发中,敬请期待...");
2655
+ }, Ie = async (e) => {
2656
+ if (F) try {
2657
+ e === "png" ? await F.export.exportImg() : e === "svg" ? await F.export.exportSvg() : e === "pdf" && await F.export.exportPdf(), j.success("导出成功");
2537
2658
  } catch (e) {
2538
2659
  j.error("导出失败: " + e.message);
2539
2660
  }
2540
- }, Ie = async () => {
2541
- if (P) {
2542
- if (L.value && !R.value && (!I || !I.isConnected.value || I.collaborationClosed.value)) {
2661
+ }, Le = async () => {
2662
+ if (F) {
2663
+ if (R.value && !z.value && (!L || !L.isConnected.value || L.collaborationClosed.value)) {
2543
2664
  j.error("协作已关闭,无法提交保存");
2544
2665
  return;
2545
2666
  }
2546
- if (!V.value?.trim()) {
2667
+ if (!H.value?.trim()) {
2547
2668
  j.warning("请输入思维导图标题");
2548
2669
  return;
2549
2670
  }
2550
- if (!H.value?.trim()) {
2671
+ if (!U.value?.trim()) {
2551
2672
  j.warning("请输入作者");
2552
2673
  return;
2553
2674
  }
2554
2675
  try {
2555
- let e = P.getData(), t = JSON.stringify(e), r = l.value, i = {
2556
- title: V.value.trim(),
2676
+ let e = F.getData(), t = JSON.stringify(e), r = l.value, i = {
2677
+ title: H.value.trim(),
2557
2678
  content: t,
2558
2679
  doc_type: "mindmap"
2559
2680
  }, a = typeof n.saveApi == "function" ? n.saveApi : n.saveApi ? (e) => r ? N.put(`${n.saveApi}/${r}`, e) : N.post(n.saveApi, e) : null;
2560
- if (a) U.value = (await a(i, r)).data?.id || r;
2561
- else if (r) await d.value.update(r, i), U.value = r;
2681
+ if (a) W.value = (await a(i, r)).data?.id || r;
2682
+ else if (r) await d.value.update(r, i), W.value = r;
2562
2683
  else {
2563
2684
  let e = await d.value.create(i);
2564
- U.value = e.data.id, n.docId || o.replace(`/mindmap-editor/${e.data.id}`);
2685
+ W.value = e.data.id, n.docId || o.replace(`/mindmap-editor/${e.data.id}`);
2565
2686
  }
2566
- re = JSON.parse(JSON.stringify(e)), j.success("保存成功"), T({
2567
- documentId: String(U.value || ""),
2687
+ ie = JSON.parse(JSON.stringify(e)), j.success("保存成功"), T({
2688
+ documentId: String(W.value || ""),
2568
2689
  docType: "mindmap",
2569
2690
  content: JSON.stringify(e),
2570
2691
  userId: String(E.currentUser.value?.id || ""),
2571
- userName: E.currentUser.value?.name || H.value || "未知"
2692
+ userName: E.currentUser.value?.name || U.value || "未知"
2572
2693
  });
2573
2694
  } catch (e) {
2574
2695
  j.error("保存失败: " + e.message);
2575
2696
  }
2576
2697
  }
2577
- }, Le = (e) => {
2578
- O.value = {
2698
+ }, Re = (e) => {
2699
+ P.value = {
2579
2700
  visible: !0,
2580
2701
  x: e.clientX,
2581
2702
  y: e.clientY
2582
2703
  };
2583
- }, Re = (e) => {
2704
+ }, Ve = (e) => {
2584
2705
  switch (e) {
2585
2706
  case "insertChild":
2586
- de("child");
2707
+ fe("child");
2587
2708
  break;
2588
2709
  case "insertSibling":
2589
- de("sibling");
2710
+ fe("sibling");
2590
2711
  break;
2591
2712
  case "edit":
2592
- W.value && (P?.execCommand("ACTIVE_NODE", W.value), P?.textEdit.enterTextEdit());
2713
+ G.value && (F?.execCommand("ACTIVE_NODE", G.value), F?.textEdit.enterTextEdit());
2593
2714
  break;
2594
2715
  case "delete":
2595
- fe();
2716
+ pe();
2596
2717
  break;
2597
2718
  case "copy":
2598
- P?.execCommand("COPY");
2719
+ F?.execCommand("COPY");
2599
2720
  break;
2600
2721
  case "cut":
2601
- P?.execCommand("CUT");
2722
+ F?.execCommand("CUT");
2602
2723
  break;
2603
2724
  case "paste":
2604
- P?.execCommand("PASTE");
2725
+ F?.execCommand("PASTE");
2605
2726
  break;
2606
2727
  }
2607
- }, Ve = () => {
2608
- O.value.visible = !1;
2609
- }, He = [
2610
- "我可以帮您梳理思维导图结构、扩展节点内容,或者提供思路启发。请问有什么需要帮助的?",
2611
- "这个思维导图的层级结构很清晰。建议在二级节点下添加更多细节,让内容更加丰富。",
2612
- "根据当前的主题,我建议您尝试从不同维度展开思考,比如时间、空间、因果、对比等角度。",
2613
- "思维导图中的关键词提炼得很好。如果需要,我可以帮您将某些节点展开为更详细的描述。",
2614
- "我可以帮您检查思维导图中是否存在重复或遗漏的分支。需要我逐个节点分析吗?",
2615
- "建议使用不同的颜色和图标来区分不同分支的重要性,这样可以让思维导图更加直观。",
2616
- "这个思维导图的逻辑框架不错。建议在关键节点添加备注,方便后续回顾和补充。",
2617
- "我可以帮您将思维导图转换为大纲文本,或者根据现有内容生成新的分支建议。"
2618
- ], We = async (e, t = {}) => {
2619
- let n = l.value ? `${Ht}-${l.value}` : null;
2728
+ }, He = () => {
2729
+ P.value.visible = !1;
2730
+ }, Ue = async (e, t = {}) => {
2731
+ let n = l.value ? `${Kt}-${l.value}` : null;
2620
2732
  await E.sendMessage(e, {
2621
2733
  ...t,
2622
2734
  roomId: n
2623
2735
  });
2624
2736
  let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = E.collabUsers.value.filter((e) => e.name !== E.currentUser.value.name);
2625
- (!r || i || a.length === 0) && (E.loading.value = !0, setTimeout(() => {
2626
- E.sendAiMessage(He[Math.floor(Math.random() * He.length)], n), E.loading.value = !1;
2627
- }, 800 + Math.random() * 1200));
2737
+ if (!r || i || a.length === 0) {
2738
+ E.loading.value = !0;
2739
+ let t = await O.chat(e, E.messages.value);
2740
+ E.sendAiMessage(t, n), E.loading.value = !1;
2741
+ }
2628
2742
  }, Ge = () => {
2629
- let e = l.value ? `${Ht}-${l.value}` : null;
2743
+ let e = l.value ? `${Kt}-${l.value}` : null;
2630
2744
  E.clearMessages(e);
2631
2745
  }, Ke = () => {
2632
2746
  if (!l.value) {
@@ -2634,61 +2748,61 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2634
2748
  return;
2635
2749
  }
2636
2750
  S.value = !0;
2637
- }, qe = (e) => {
2751
+ }, Je = (e) => {
2638
2752
  try {
2639
2753
  let t = typeof e == "string" ? JSON.parse(e) : e;
2640
- t && P && (P.setData(t), u(() => {
2641
- P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0);
2754
+ t && F && (F.setData(t), u(() => {
2755
+ F.getElRectInfo(), F.resize(), F.view.fit(void 0, !0);
2642
2756
  }));
2643
2757
  } catch (e) {
2644
2758
  console.error("Version apply error:", e);
2645
2759
  }
2646
2760
  };
2647
2761
  return m(async () => {
2648
- await u(), await ie(), document.addEventListener("click", Ve), r.query.collab === "1" && l.value && await ce();
2762
+ await u(), await ae(), document.addEventListener("click", He), r.query.collab === "1" && l.value && await le();
2649
2763
  }), p(() => {
2650
- document.removeEventListener("click", Ve), $ && clearTimeout($), I &&= (I.destroy(), null), we &&= (we.disconnect(), null), P &&= (P.destroy(), null);
2764
+ document.removeEventListener("click", He), $ && clearTimeout($), L &&= (L.destroy(), null), Te &&= (Te.disconnect(), null), F &&= (F.destroy(), null);
2651
2765
  }), (e, t) => {
2652
2766
  let n = y("el-icon"), r = y("el-button");
2653
- return g(), i("div", Bt, [
2654
- s(vt, {
2767
+ return g(), i("div", Wt, [
2768
+ s(St, {
2655
2769
  "undo-count": J.value,
2656
2770
  "redo-count": Y.value,
2657
- "current-layout": q.value,
2658
- "current-theme": ee.value,
2659
- "zoom-percent": te.value,
2771
+ "current-layout": ee.value,
2772
+ "current-theme": te.value,
2773
+ "zoom-percent": ne.value,
2660
2774
  "auto-fit": Z.value,
2661
- "is-collaborating": L.value,
2662
- "is-collab-owner": R.value,
2663
- "collab-users": B.value,
2664
- "model-title": V.value,
2665
- "model-author": H.value,
2666
- "is-root-node": K.value,
2775
+ "is-collaborating": R.value,
2776
+ "is-collab-owner": z.value,
2777
+ "collab-users": V.value,
2778
+ "model-title": H.value,
2779
+ "model-author": U.value,
2780
+ "is-root-node": q.value,
2667
2781
  "back-button": c.value.backButton,
2668
2782
  "title-editable": c.value.titleEditable,
2669
2783
  "author-editable": c.value.authorEditable,
2670
- onBack: ue,
2671
- onUndo: he,
2672
- onRedo: Q,
2673
- onInsertChild: t[0] ||= (e) => de("child"),
2674
- onInsertSibling: t[1] ||= (e) => de("sibling"),
2675
- onReverseLayout: pe,
2676
- onDeleteNode: fe,
2677
- onChangeLayout: Ee,
2678
- onChangeTheme: De,
2679
- onZoomIn: _e,
2680
- onZoomOut: ve,
2681
- onFitView: ye,
2784
+ onBack: de,
2785
+ onUndo: Q,
2786
+ onRedo: _e,
2787
+ onInsertChild: t[0] ||= (e) => fe("child"),
2788
+ onInsertSibling: t[1] ||= (e) => fe("sibling"),
2789
+ onReverseLayout: he,
2790
+ onDeleteNode: pe,
2791
+ onChangeLayout: De,
2792
+ onChangeTheme: Oe,
2793
+ onZoomIn: ve,
2794
+ onZoomOut: ye,
2795
+ onFitView: be,
2682
2796
  onToggleAutoFit: t[2] ||= (e) => Z.value = !Z.value,
2683
- onResetView: Ce,
2684
- onExport: Ne,
2685
- onSave: Ie,
2686
- onToggleCollab: t[3] ||= (e) => L.value ? se() : oe(),
2687
- onShareCollab: le,
2688
- "onUpdate:title": t[4] ||= (e) => V.value = e,
2689
- "onUpdate:author": t[5] ||= (e) => H.value = e,
2690
- onAiGenerate: Pe,
2691
- "show-history": !!U.value,
2797
+ onResetView: we,
2798
+ onExport: Pe,
2799
+ onSave: Le,
2800
+ onToggleCollab: t[3] ||= (e) => R.value ? ce() : se(),
2801
+ onShareCollab: ue,
2802
+ "onUpdate:title": t[4] ||= (e) => H.value = e,
2803
+ "onUpdate:author": t[5] ||= (e) => U.value = e,
2804
+ onAiGenerate: Fe,
2805
+ "show-history": !!W.value,
2692
2806
  onHistory: Ke
2693
2807
  }, null, 8, [
2694
2808
  "undo-count",
@@ -2708,40 +2822,40 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2708
2822
  "author-editable",
2709
2823
  "show-history"
2710
2824
  ]),
2711
- a("div", Vt, [a("div", {
2825
+ a("div", Gt, [a("div", {
2712
2826
  class: "canvas-area",
2713
2827
  ref_key: "canvasRef",
2714
2828
  ref: h,
2715
- onContextmenu: D(Le, ["prevent"])
2829
+ onContextmenu: D(Re, ["prevent"])
2716
2830
  }, [a("div", {
2717
2831
  class: "mindmap-container",
2718
2832
  ref_key: "containerRef",
2719
2833
  ref: f
2720
- }, null, 512)], 544), s(Ft, {
2721
- visible: G.value,
2722
- node: W.value,
2723
- onClose: t[6] ||= (e) => W.value = null,
2724
- onUpdateText: Oe,
2725
- onUpdateStyle: ke,
2726
- onUpdateNote: Ae,
2727
- onUpdateTags: je,
2728
- onUpdateHyperlink: Me
2834
+ }, null, 512)], 544), s(zt, {
2835
+ visible: K.value,
2836
+ node: G.value,
2837
+ onClose: t[6] ||= (e) => G.value = null,
2838
+ onUpdateText: ke,
2839
+ onUpdateStyle: Ae,
2840
+ onUpdateNote: je,
2841
+ onUpdateTags: Me,
2842
+ onUpdateHyperlink: Ne
2729
2843
  }, null, 8, ["visible", "node"])]),
2730
- s(It, {
2731
- visible: O.value.visible,
2732
- x: O.value.x,
2733
- y: O.value.y,
2734
- onCommand: Re,
2735
- onClose: t[7] ||= (e) => O.value.visible = !1
2844
+ s(Bt, {
2845
+ visible: P.value.visible,
2846
+ x: P.value.x,
2847
+ y: P.value.y,
2848
+ onCommand: Ve,
2849
+ onClose: t[7] ||= (e) => P.value.visible = !1
2736
2850
  }, null, 8, [
2737
2851
  "visible",
2738
2852
  "x",
2739
2853
  "y"
2740
2854
  ]),
2741
- s(Rt, {
2855
+ s(Ht, {
2742
2856
  visible: v.value,
2743
2857
  "onUpdate:visible": t[8] ||= (e) => v.value = e,
2744
- onExport: Fe
2858
+ onExport: Ie
2745
2859
  }, null, 8, ["visible"]),
2746
2860
  s(r, {
2747
2861
  class: "ai-chat-fab",
@@ -2764,8 +2878,8 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2764
2878
  "is-collab": x(E).isCollabMode.value,
2765
2879
  "collab-users": x(E).collabUsers.value,
2766
2880
  "current-user": x(E).currentUser.value,
2767
- "is-owner": R.value,
2768
- onSend: We,
2881
+ "is-owner": z.value,
2882
+ onSend: Ue,
2769
2883
  onClose: t[10] ||= (e) => b.value = !1,
2770
2884
  "unread-mention": x(E).unreadMention.value,
2771
2885
  onClearUnread: t[11] ||= (e) => x(E).clearUnreadMention(),
@@ -2780,16 +2894,16 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2780
2894
  "is-owner",
2781
2895
  "unread-mention"
2782
2896
  ]),
2783
- s(tt, {
2897
+ s(at, {
2784
2898
  modelValue: S.value,
2785
2899
  "onUpdate:modelValue": t[12] ||= (e) => S.value = e,
2786
- "document-id": U.value,
2787
- onApply: qe
2900
+ "document-id": W.value,
2901
+ onApply: Je
2788
2902
  }, null, 8, ["modelValue", "document-id"])
2789
2903
  ]);
2790
2904
  };
2791
2905
  }
2792
- }, [["__scopeId", "data-v-b7ebbdb3"]]), Wt = c({
2906
+ }, [["__scopeId", "data-v-29f796f9"]]), Jt = c({
2793
2907
  name: "YourCompanyMindmap",
2794
2908
  props: {
2795
2909
  docId: {
@@ -2827,14 +2941,18 @@ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
2827
2941
  uiConfig: {
2828
2942
  type: Object,
2829
2943
  default: () => ({})
2944
+ },
2945
+ aiApi: {
2946
+ type: [String, Object],
2947
+ default: null
2830
2948
  }
2831
2949
  },
2832
2950
  setup(e, { slots: t }) {
2833
2951
  return () => l("div", {
2834
2952
  class: "yourcompany-mindmap-wrapper",
2835
2953
  style: "position:relative"
2836
- }, [l(Ut, { ...e }), l(O)]);
2954
+ }, [l(qt, { ...e }), l(O)]);
2837
2955
  }
2838
2956
  });
2839
2957
  //#endregion
2840
- export { Wt as default };
2958
+ export { Jt as default };