@billtaofbj/explosion-image 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
@@ -2,7 +2,7 @@ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r
2
2
  import { BrandWatermark as D } from "@billtaofbj/core";
3
3
  import { useRoute as O, useRouter as k } from "vue-router";
4
4
  import { ElMessage as A, ElMessageBox as j } from "element-plus";
5
- import { ArrowDown as M, ArrowLeft as ee, Bell as N, Brush as P, Clock as F, Close as I, Connection as L, Delete as R, Download as z, InfoFilled as B, Link as V, Loading as H, Location as U, Minus as te, Monitor as W, MoreFilled as G, Plus as K, Promotion as ne, Right as re, SemiSelect as q, Share as ie, TrendCharts as ae, Upload as J, UploadFilled as oe } from "@element-plus/icons-vue";
5
+ import { ArrowDown as M, ArrowLeft as ee, Bell as N, Brush as P, Clock as F, Close as I, Connection as L, Delete as te, Download as R, InfoFilled as z, Link as B, Loading as V, Location as H, Minus as U, Monitor as W, MoreFilled as ne, Plus as G, Promotion as K, Right as re, SemiSelect as q, Share as ie, TrendCharts as ae, Upload as oe, UploadFilled as J } from "@element-plus/icons-vue";
6
6
  import Y from "axios";
7
7
  import * as se from "yjs";
8
8
  import { HocuspocusProvider as ce } from "@hocuspocus/provider";
@@ -11,7 +11,7 @@ var X = (e, t) => {
11
11
  let n = e.__vccOpts || e;
12
12
  for (let [e, r] of t) n[e] = r;
13
13
  return n;
14
- }, Z = { class: "chat-header" }, le = { class: "chat-header-left" }, Q = { class: "chat-title" }, ue = { class: "online-users-list" }, de = { class: "online-user-item" }, fe = { class: "online-user-name" }, pe = { key: 1 }, me = { class: "online-user-name" }, he = { class: "chat-header-right" }, ge = {
14
+ }, le = { class: "chat-header" }, Z = { class: "chat-header-left" }, ue = { class: "chat-title" }, Q = { class: "online-users-list" }, de = { class: "online-user-item" }, fe = { class: "online-user-name" }, pe = { key: 1 }, me = { class: "online-user-name" }, he = { class: "chat-header-right" }, ge = {
15
15
  key: 0,
16
16
  class: "chat-empty"
17
17
  }, _e = { class: "chat-empty-hint" }, ve = { key: 1 }, ye = { class: "message-content" }, be = {
@@ -90,7 +90,7 @@ var X = (e, t) => {
90
90
  let i = String(r || n.name || "");
91
91
  return t.has(i) ? !1 : (t.add(i), !0);
92
92
  })];
93
- }), F = t(() => P.value.length + 1), L = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", z = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, B = (e) => (e.user_name || "U").charAt(0), V = (e) => {
93
+ }), F = t(() => P.value.length + 1), L = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", R = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, z = (e) => (e.user_name || "U").charAt(0), B = (e) => {
94
94
  if (!p.isCollab) return;
95
95
  let t = typeof e == "string" ? e : e.target?.value || g.value, n = t.length, r = t.lastIndexOf("@", n);
96
96
  if (r !== -1 && r < n) {
@@ -101,20 +101,20 @@ var X = (e, t) => {
101
101
  }
102
102
  }
103
103
  O.value = !1;
104
- }, H = () => {
104
+ }, V = () => {
105
105
  O.value && (A.value = Math.min(A.value + 1, k.value.length - 1));
106
- }, U = () => {
106
+ }, H = () => {
107
107
  O.value && (A.value = Math.max(A.value - 1, 0));
108
- }, te = (e) => {
108
+ }, U = (e) => {
109
109
  let t = g.value.slice(0, M), n = g.value.slice(M + j.length + 1);
110
110
  g.value = `${t}@${e.name} ${n}`, O.value = !1;
111
- }, G = (e) => {
111
+ }, ne = (e) => {
112
112
  if (e) {
113
113
  if (e.shiftKey) return;
114
114
  if (O.value) {
115
115
  let t = k.value[A.value];
116
116
  if (t) {
117
- e.preventDefault(), te(t);
117
+ e.preventDefault(), U(t);
118
118
  return;
119
119
  }
120
120
  }
@@ -128,19 +128,19 @@ var X = (e, t) => {
128
128
  e && (n = e[1]);
129
129
  }
130
130
  m("send", t, { mentionedUser: n }), g.value = "", O.value = !1;
131
- }, K = () => {
131
+ }, G = () => {
132
132
  u(() => {
133
133
  b.value && (b.value.scrollTop = b.value.scrollHeight);
134
134
  });
135
135
  };
136
- return C(() => p.messages.length, K), C(() => p.messages, K, { deep: !0 }), (t, l) => {
136
+ return C(() => p.messages.length, G), C(() => p.messages, G, { deep: !0 }), (t, l) => {
137
137
  let u = y("el-icon"), p = y("el-tag"), _ = y("el-popover"), C = y("el-button"), j = y("el-input");
138
138
  return c.visible ? (h(), i("div", {
139
139
  key: 0,
140
140
  class: "ai-chat-panel",
141
141
  style: f({ width: c.panelWidth + "px" })
142
142
  }, [
143
- a("div", Z, [a("div", le, [
143
+ a("div", le, [a("div", Z, [
144
144
  s(u, {
145
145
  size: 18,
146
146
  color: "#409EFF"
@@ -148,7 +148,7 @@ var X = (e, t) => {
148
148
  default: w(() => [s(S(W))]),
149
149
  _: 1
150
150
  }),
151
- a("span", Q, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
151
+ a("span", ue, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
152
152
  c.isCollab ? (h(), n(_, {
153
153
  key: 0,
154
154
  width: 200,
@@ -164,7 +164,7 @@ var X = (e, t) => {
164
164
  default: w(() => [o(x(F.value) + "人在线 ", 1)]),
165
165
  _: 1
166
166
  })]),
167
- default: w(() => [a("div", ue, [a("div", de, [
167
+ default: w(() => [a("div", Q, [a("div", de, [
168
168
  a("div", {
169
169
  class: "online-user-avatar",
170
170
  style: f({ background: c.currentUser.color || "#409EFF" })
@@ -238,7 +238,7 @@ var X = (e, t) => {
238
238
  title: "清空对话"
239
239
  }, {
240
240
  default: w(() => [s(u, null, {
241
- default: w(() => [s(S(R))]),
241
+ default: w(() => [s(S(te))]),
242
242
  _: 1
243
243
  })]),
244
244
  _: 1
@@ -278,14 +278,14 @@ var X = (e, t) => {
278
278
  class: d(["chat-message", L(e)])
279
279
  }, [a("div", {
280
280
  class: "message-avatar",
281
- style: f(z(e))
281
+ style: f(R(e))
282
282
  }, [e.role === "ai" ? (h(), n(u, {
283
283
  key: 0,
284
284
  size: 16
285
285
  }, {
286
286
  default: w(() => [s(S(W))]),
287
287
  _: 1
288
- })) : (h(), i("span", ve, x(B(e)), 1))], 4), a("div", ye, [
288
+ })) : (h(), i("span", ve, x(z(e)), 1))], 4), a("div", ye, [
289
289
  c.isCollab && e.role === "user" ? (h(), i("div", be, [a("span", {
290
290
  class: "message-sender",
291
291
  style: f({ color: e.user_color || "#67C23A" })
@@ -320,11 +320,11 @@ var X = (e, t) => {
320
320
  },
321
321
  placeholder: c.isCollab ? "输入消息... @提及成员" : "输入消息...",
322
322
  onKeydown: [
323
- T(E(G, ["exact"]), ["enter"]),
324
- T(E(H, ["prevent"]), ["down"]),
325
- T(E(U, ["prevent"]), ["up"])
323
+ T(E(ne, ["exact"]), ["enter"]),
324
+ T(E(V, ["prevent"]), ["down"]),
325
+ T(E(H, ["prevent"]), ["up"])
326
326
  ],
327
- onInput: V,
327
+ onInput: B,
328
328
  resize: "none"
329
329
  }, null, 8, [
330
330
  "modelValue",
@@ -334,7 +334,7 @@ var X = (e, t) => {
334
334
  O.value ? (h(), i("div", Ee, [(h(!0), i(e, null, v(k.value, (e, t) => (h(), i("div", {
335
335
  key: e.id || e.clientId,
336
336
  class: d(["mention-item", { active: t === A.value }]),
337
- onClick: (t) => te(e),
337
+ onClick: (t) => U(e),
338
338
  onMouseenter: (e) => A.value = t
339
339
  }, [a("div", {
340
340
  class: "mention-avatar",
@@ -351,10 +351,10 @@ var X = (e, t) => {
351
351
  type: "primary",
352
352
  circle: "",
353
353
  disabled: !g.value.trim() || c.loading,
354
- onClick: G
354
+ onClick: ne
355
355
  }, {
356
356
  default: w(() => [s(u, null, {
357
- default: w(() => [s(S(ne))]),
357
+ default: w(() => [s(S(K))]),
358
358
  _: 1
359
359
  })]),
360
360
  _: 1
@@ -513,8 +513,119 @@ function Ae() {
513
513
  };
514
514
  }
515
515
  //#endregion
516
+ //#region ../../src/composables/useAiApi.js
517
+ var je = [
518
+ "我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
519
+ "这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
520
+ "根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
521
+ "流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
522
+ "我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
523
+ "建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
524
+ "这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
525
+ "我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
526
+ ];
527
+ function Me() {
528
+ return je[Math.floor(Math.random() * je.length)];
529
+ }
530
+ async function Ne(e, t, n) {
531
+ let r = { "Content-Type": "application/json" };
532
+ e.apiKey && (r.Authorization = `Bearer ${e.apiKey}`);
533
+ let i = await fetch(e.url, {
534
+ method: "POST",
535
+ headers: r,
536
+ body: JSON.stringify({
537
+ model: e.model || "gpt-4o-mini",
538
+ messages: t,
539
+ temperature: e.temperature ?? .7,
540
+ max_tokens: e.maxTokens ?? 4096
541
+ }),
542
+ signal: n
543
+ });
544
+ if (!i.ok) {
545
+ let e = await i.text().catch(() => "");
546
+ throw Error(`AI API error ${i.status}: ${e}`);
547
+ }
548
+ return (await i.json()).choices?.[0]?.message?.content || "";
549
+ }
550
+ function Pe(e) {
551
+ let t = _(!1), n = null, r = () => {
552
+ let t = typeof e == "function" ? e() : e;
553
+ return !!(t && t.url);
554
+ }, i = () => typeof e == "function" ? e() : e || {};
555
+ return {
556
+ loading: t,
557
+ isAvailable: r,
558
+ chat: async (e, r = []) => {
559
+ let a = i();
560
+ if (!a.url) return Me();
561
+ t.value = !0, n && n.abort(), n = new AbortController();
562
+ try {
563
+ return await Ne(a, [
564
+ {
565
+ role: "system",
566
+ content: a.chatPrompt || "你是一个有帮助的AI助手,擅长文档编辑和流程设计。请简洁回答用户问题。"
567
+ },
568
+ ...r.map((e) => ({
569
+ role: e.role === "ai" ? "assistant" : "user",
570
+ content: e.content
571
+ })),
572
+ {
573
+ role: "user",
574
+ content: e
575
+ }
576
+ ], n.signal);
577
+ } catch (e) {
578
+ return e.name === "AbortError" ? "" : (console.warn("[useAiApi] Chat error, falling back to mock:", e), Me());
579
+ } finally {
580
+ t.value = !1;
581
+ }
582
+ },
583
+ generate: async (e, r) => {
584
+ let a = i();
585
+ if (!a.url) return {
586
+ success: !1,
587
+ message: "AI生成功能开发中,敬请期待..."
588
+ };
589
+ t.value = !0, n && n.abort(), n = new AbortController();
590
+ try {
591
+ let t = await Ne(a, [{
592
+ role: "system",
593
+ content: a.generatePrompt || `你是一个专业的${r || "流程图"}生成助手。根据用户的描述,生成对应的JSON数据结构。只返回JSON,不要包含其他文字或markdown代码块标记。`
594
+ }, {
595
+ role: "user",
596
+ content: e
597
+ }], n.signal), i = null;
598
+ try {
599
+ let e = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```$/i, "").trim();
600
+ i = JSON.parse(e);
601
+ } catch {
602
+ i = null;
603
+ }
604
+ return {
605
+ success: !0,
606
+ content: t,
607
+ parsed: i
608
+ };
609
+ } catch (e) {
610
+ return e.name === "AbortError" ? {
611
+ success: !1,
612
+ message: "已取消"
613
+ } : (console.warn("[useAiApi] Generate error:", e), {
614
+ success: !1,
615
+ message: `AI生成失败: ${e.message}`
616
+ });
617
+ } finally {
618
+ t.value = !1;
619
+ }
620
+ },
621
+ abort: () => {
622
+ n &&= (n.abort(), null);
623
+ }
624
+ };
625
+ }
626
+ //#endregion
516
627
  //#region ../../src/composables/useVersionHistory.js
517
- var je = "/api/document-versions", Me = 5e3, Ne = () => {
628
+ var Fe = "/api/document-versions", Ie = 5e3, Le = () => {
518
629
  let e = _([]), t = _(!1);
519
630
  return {
520
631
  versions: e,
@@ -522,13 +633,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
522
633
  saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
523
634
  if (!e || !t || !n) return null;
524
635
  try {
525
- let { data: a } = await Y.post(je, {
636
+ let { data: a } = await Y.post(Fe, {
526
637
  document_id: e,
527
638
  doc_type: t,
528
639
  content: typeof n == "string" ? n : JSON.stringify(n),
529
640
  user_id: r || null,
530
641
  user_name: i || null
531
- }, { timeout: Me });
642
+ }, { timeout: Ie });
532
643
  return a;
533
644
  } catch (e) {
534
645
  return console.warn("[useVersionHistory] Failed to save version:", e), null;
@@ -538,9 +649,9 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
538
649
  if (!n) return [];
539
650
  t.value = !0;
540
651
  try {
541
- let { data: t } = await Y.get(je, {
652
+ let { data: t } = await Y.get(Fe, {
542
653
  params: { document_id: n },
543
- timeout: Me
654
+ timeout: Ie
544
655
  });
545
656
  return e.value = t, t;
546
657
  } catch (t) {
@@ -551,26 +662,26 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
551
662
  },
552
663
  getVersionContent: async (e) => {
553
664
  try {
554
- let { data: t } = await Y.get(`${je}/${e}`, { timeout: Me });
665
+ let { data: t } = await Y.get(`${Fe}/${e}`, { timeout: Ie });
555
666
  return t;
556
667
  } catch (e) {
557
668
  return console.warn("[useVersionHistory] Failed to get version content:", e), null;
558
669
  }
559
670
  }
560
671
  };
561
- }, Pe = { class: "version-history-panel" }, Fe = {
672
+ }, Re = { class: "version-history-panel" }, ze = {
562
673
  key: 0,
563
674
  class: "loading-state"
564
- }, Ie = {
675
+ }, Be = {
565
676
  key: 1,
566
677
  class: "empty-state"
567
- }, Le = {
678
+ }, Ve = {
568
679
  key: 2,
569
680
  class: "version-list"
570
- }, Re = {
681
+ }, He = {
571
682
  key: 0,
572
683
  class: "current-version"
573
- }, ze = { class: "current-version-header" }, Be = { class: "version-number" }, Ve = ["onClick"], He = { class: "version-number" }, Ue = { class: "version-user" }, We = { class: "panel-footer" }, Ge = /*#__PURE__*/ X({
684
+ }, Ue = { class: "current-version-header" }, We = { class: "version-number" }, Ge = ["onClick"], Ke = { class: "version-number" }, qe = { class: "version-user" }, Je = { class: "panel-footer" }, Ye = /*#__PURE__*/ X({
574
685
  __name: "VersionHistoryPanel",
575
686
  props: {
576
687
  modelValue: {
@@ -584,7 +695,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
584
695
  },
585
696
  emits: ["update:modelValue", "apply"],
586
697
  setup(t, { expose: c, emit: l }) {
587
- let u = t, f = l, { versions: p, loading: m, loadVersions: g, getVersionContent: b } = Ne(), T = _(!1), E = _(null), D = _(!1), O = _(null);
698
+ let u = t, f = l, { versions: p, loading: m, loadVersions: g, getVersionContent: b } = Le(), T = _(!1), E = _(null), D = _(!1), O = _(null);
588
699
  C(() => u.modelValue, (e) => {
589
700
  T.value = e, e && u.documentId && (E.value = null, g(u.documentId).then((e) => {
590
701
  e && e.length > 0 && (O.value = e[0]);
@@ -621,7 +732,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
621
732
  size: "420px",
622
733
  "before-close": M
623
734
  }, {
624
- footer: w(() => [a("div", We, [s(_, {
735
+ footer: w(() => [a("div", Je, [s(_, {
625
736
  type: "primary",
626
737
  disabled: !E.value,
627
738
  loading: D.value,
@@ -630,22 +741,22 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
630
741
  default: w(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
631
742
  _: 1
632
743
  }, 8, ["disabled", "loading"])])]),
633
- default: w(() => [a("div", Pe, [S(m) ? (h(), i("div", Fe, [s(l, { class: "is-loading" }, {
634
- default: w(() => [s(S(H))]),
744
+ default: w(() => [a("div", Re, [S(m) ? (h(), i("div", ze, [s(l, { class: "is-loading" }, {
745
+ default: w(() => [s(S(V))]),
635
746
  _: 1
636
- }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (h(), i("div", Ie, [s(l, {
747
+ }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (h(), i("div", Be, [s(l, {
637
748
  size: 48,
638
749
  color: "#c0c4cc"
639
750
  }, {
640
751
  default: w(() => [s(S(F))]),
641
752
  _: 1
642
- }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (h(), i("div", Le, [O.value ? (h(), i("div", Re, [a("div", ze, [s(u, {
753
+ }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (h(), i("div", Ve, [O.value ? (h(), i("div", He, [a("div", Ue, [s(u, {
643
754
  type: "success",
644
755
  size: "small"
645
756
  }, {
646
757
  default: w(() => [...c[3] ||= [o("当前版本", -1)]]),
647
758
  _: 1
648
- }), a("span", Be, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(g, null, {
759
+ }), a("span", We, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(g, null, {
649
760
  default: w(() => [(h(!0), i(e, null, v(S(p), (e) => (h(), n(f, {
650
761
  key: e.id,
651
762
  timestamp: ee(e.created_at),
@@ -656,7 +767,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
656
767
  default: w(() => [a("div", {
657
768
  class: d(["version-item", { active: E.value?.id === e.id }]),
658
769
  onClick: (t) => k(e)
659
- }, [a("span", He, "版本号:v" + x(e.version_number), 1), a("span", Ue, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Ve)]),
770
+ }, [a("span", Ke, "版本号:v" + x(e.version_number), 1), a("span", qe, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Ge)]),
660
771
  _: 2
661
772
  }, 1032, [
662
773
  "timestamp",
@@ -669,13 +780,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
669
780
  }, 8, ["modelValue"]);
670
781
  };
671
782
  }
672
- }, [["__scopeId", "data-v-87924b7c"]]), Ke = { class: "toolbar" }, qe = { class: "toolbar-left" }, Je = { class: "toolbar-center" }, Ye = { class: "group-popover" }, Xe = { class: "group-popover-header" }, Ze = { class: "group-list" }, Qe = ["onClick"], $e = { class: "group-name" }, et = { class: "group-item-actions" }, tt = {
783
+ }, [["__scopeId", "data-v-87924b7c"]]), Xe = { class: "toolbar" }, Ze = { class: "toolbar-left" }, Qe = { class: "toolbar-center" }, $e = { class: "group-popover" }, et = { class: "group-popover-header" }, tt = { class: "group-list" }, nt = ["onClick"], rt = { class: "group-name" }, it = { class: "group-item-actions" }, at = {
673
784
  key: 1,
674
785
  class: "group-empty"
675
- }, nt = { class: "toolbar-right" }, rt = {
786
+ }, ot = { class: "toolbar-right" }, st = {
676
787
  key: 0,
677
788
  class: "collab-users"
678
- }, it = ["title"], at = /*#__PURE__*/ X({
789
+ }, ct = ["title"], lt = /*#__PURE__*/ X({
679
790
  __name: "Toolbar",
680
791
  props: {
681
792
  title: {
@@ -758,11 +869,11 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
758
869
  },
759
870
  dashed: {
760
871
  label: "虚线",
761
- icon: te
872
+ icon: U
762
873
  },
763
874
  dotted: {
764
875
  label: "点线",
765
- icon: G
876
+ icon: ne
766
877
  },
767
878
  dashdot: {
768
879
  label: "点划线",
@@ -770,9 +881,9 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
770
881
  }
771
882
  }, m = t(() => p[l.lineStyle]?.label || "引线"), g = t(() => p[l.lineStyle]?.icon || q);
772
883
  return (t, l) => {
773
- let p = y("el-icon"), _ = y("el-button"), C = y("el-input"), T = y("el-tooltip"), D = y("el-divider"), O = y("el-dropdown-item"), k = y("el-dropdown-menu"), A = y("el-dropdown"), j = y("el-badge"), N = y("el-tag"), B = y("el-popover");
774
- return h(), i("div", Ke, [
775
- a("div", qe, [c.showBackButton ? (h(), n(_, {
884
+ let p = y("el-icon"), _ = y("el-button"), C = y("el-input"), T = y("el-tooltip"), D = y("el-divider"), O = y("el-dropdown-item"), k = y("el-dropdown-menu"), A = y("el-dropdown"), j = y("el-badge"), N = y("el-tag"), z = y("el-popover");
885
+ return h(), i("div", Xe, [
886
+ a("div", Ze, [c.showBackButton ? (h(), n(_, {
776
887
  key: 0,
777
888
  onClick: l[0] ||= (e) => t.$emit("back"),
778
889
  size: "small",
@@ -792,7 +903,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
792
903
  class: "title-input",
793
904
  size: "small"
794
905
  }, null, 8, ["modelValue", "disabled"])]),
795
- a("div", Je, [
906
+ a("div", Qe, [
796
907
  s(T, {
797
908
  content: "添加标注",
798
909
  placement: "bottom"
@@ -803,7 +914,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
803
914
  onClick: l[3] ||= (e) => t.$emit("add-annotation")
804
915
  }, {
805
916
  default: w(() => [s(p, null, {
806
- default: w(() => [s(S(U))]),
917
+ default: w(() => [s(S(H))]),
807
918
  _: 1
808
919
  })]),
809
920
  _: 1
@@ -873,7 +984,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
873
984
  class: d({ "is-active": c.lineStyle === "dashed" })
874
985
  }, {
875
986
  default: w(() => [s(p, null, {
876
- default: w(() => [s(S(te))]),
987
+ default: w(() => [s(S(U))]),
877
988
  _: 1
878
989
  }), l[19] ||= o("虚线 ", -1)]),
879
990
  _: 1
@@ -883,7 +994,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
883
994
  class: d({ "is-active": c.lineStyle === "dotted" })
884
995
  }, {
885
996
  default: w(() => [s(p, null, {
886
- default: w(() => [s(S(G))]),
997
+ default: w(() => [s(S(ne))]),
887
998
  _: 1
888
999
  }), l[20] ||= o("点线 ", -1)]),
889
1000
  _: 1
@@ -918,7 +1029,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
918
1029
  _: 1
919
1030
  }),
920
1031
  s(D, { direction: "vertical" }),
921
- s(B, {
1032
+ s(z, {
922
1033
  placement: "bottom",
923
1034
  width: 280,
924
1035
  trigger: "click"
@@ -939,15 +1050,15 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
939
1050
  ]),
940
1051
  _: 1
941
1052
  })]),
942
- default: w(() => [a("div", Ye, [
943
- a("div", Xe, [s(_, {
1053
+ default: w(() => [a("div", $e, [
1054
+ a("div", et, [s(_, {
944
1055
  size: "small",
945
1056
  onClick: l[5] ||= (e) => t.$emit("add-group", "new"),
946
1057
  type: "primary",
947
1058
  plain: ""
948
1059
  }, {
949
1060
  default: w(() => [s(p, null, {
950
- default: w(() => [s(S(K))]),
1061
+ default: w(() => [s(S(G))]),
951
1062
  _: 1
952
1063
  }), l[23] ||= o("新建分组 ", -1)]),
953
1064
  _: 1
@@ -966,20 +1077,20 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
966
1077
  key: 0,
967
1078
  style: { margin: "8px 0" }
968
1079
  })) : r("", !0),
969
- a("div", Ze, [(h(!0), i(e, null, v(c.groups, (e) => (h(), i("div", {
1080
+ a("div", tt, [(h(!0), i(e, null, v(c.groups, (e) => (h(), i("div", {
970
1081
  key: e.id,
971
1082
  class: d(["group-item", { active: c.activeGroupId === e.id }])
972
1083
  }, [a("div", {
973
1084
  class: "group-item-main",
974
1085
  onClick: (n) => t.$emit("group-action", "filter", e.id)
975
- }, [a("span", $e, x(e.name), 1), c.activeGroupId === e.id ? (h(), n(N, {
1086
+ }, [a("span", rt, x(e.name), 1), c.activeGroupId === e.id ? (h(), n(N, {
976
1087
  key: 0,
977
1088
  size: "small",
978
1089
  type: "primary"
979
1090
  }, {
980
1091
  default: w(() => [...l[25] ||= [o("筛选", -1)]]),
981
1092
  _: 1
982
- })) : r("", !0)], 8, Qe), a("div", et, [
1093
+ })) : r("", !0)], 8, nt), a("div", it, [
983
1094
  s(T, {
984
1095
  content: "展开/折叠",
985
1096
  placement: "top"
@@ -1025,7 +1136,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1025
1136
  onClick: E((n) => t.$emit("group-action", "delete", e.id), ["stop"])
1026
1137
  }, {
1027
1138
  default: w(() => [s(p, null, {
1028
- default: w(() => [s(S(R))]),
1139
+ default: w(() => [s(S(te))]),
1029
1140
  _: 1
1030
1141
  })]),
1031
1142
  _: 1
@@ -1033,18 +1144,18 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1033
1144
  _: 2
1034
1145
  }, 1024)
1035
1146
  ])], 2))), 128))]),
1036
- c.groups.length ? r("", !0) : (h(), i("div", tt, "暂无分组"))
1147
+ c.groups.length ? r("", !0) : (h(), i("div", at, "暂无分组"))
1037
1148
  ])]),
1038
1149
  _: 1
1039
1150
  })
1040
1151
  ]),
1041
- a("div", nt, [
1042
- c.onlineUsers.length > 0 ? (h(), i("div", rt, [(h(!0), i(e, null, v(c.onlineUsers.slice(0, 5), (e) => (h(), i("div", {
1152
+ a("div", ot, [
1153
+ c.onlineUsers.length > 0 ? (h(), i("div", st, [(h(!0), i(e, null, v(c.onlineUsers.slice(0, 5), (e) => (h(), i("div", {
1043
1154
  key: e.clientId,
1044
1155
  class: "collab-avatar",
1045
1156
  style: f({ background: e.color }),
1046
1157
  title: e.name
1047
- }, x(e.name?.charAt(0)), 13, it))), 128))])) : r("", !0),
1158
+ }, x(e.name?.charAt(0)), 13, ct))), 128))])) : r("", !0),
1048
1159
  c.isJoinMode ? r("", !0) : (h(), n(_, {
1049
1160
  key: 1,
1050
1161
  size: "small",
@@ -1065,7 +1176,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1065
1176
  title: "分享链接"
1066
1177
  }, {
1067
1178
  default: w(() => [s(p, null, {
1068
- default: w(() => [s(S(V))]),
1179
+ default: w(() => [s(S(B))]),
1069
1180
  _: 1
1070
1181
  })]),
1071
1182
  _: 1
@@ -1129,7 +1240,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1129
1240
  onClick: l[10] ||= (e) => t.$refs.jsonInput.click()
1130
1241
  }, {
1131
1242
  default: w(() => [s(p, null, {
1132
- default: w(() => [s(S(J))]),
1243
+ default: w(() => [s(S(oe))]),
1133
1244
  _: 1
1134
1245
  })]),
1135
1246
  _: 1
@@ -1148,7 +1259,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1148
1259
  onClick: l[12] ||= (e) => t.$emit("save")
1149
1260
  }, {
1150
1261
  default: w(() => [s(p, null, {
1151
- default: w(() => [s(S(z))]),
1262
+ default: w(() => [s(S(R))]),
1152
1263
  _: 1
1153
1264
  })]),
1154
1265
  _: 1
@@ -1170,7 +1281,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1170
1281
  ]);
1171
1282
  };
1172
1283
  }
1173
- }, [["__scopeId", "data-v-1c493741"]]), ot = ["src"], st = ["onMousedown"], ct = {
1284
+ }, [["__scopeId", "data-v-1c493741"]]), ut = ["src"], dt = ["onMousedown"], ft = {
1174
1285
  class: "leader-line-svg",
1175
1286
  style: {
1176
1287
  left: 0,
@@ -1178,13 +1289,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1178
1289
  width: "100%",
1179
1290
  height: "100%"
1180
1291
  }
1181
- }, lt = ["id", "fill"], ut = [
1292
+ }, pt = ["id", "fill"], mt = [
1182
1293
  "d",
1183
1294
  "stroke",
1184
1295
  "stroke-width",
1185
1296
  "stroke-dasharray",
1186
1297
  "marker-start"
1187
- ], dt = ["onMousedown"], ft = ["onBlur"], pt = ["onMousedown"], mt = ["onMousedown"], ht = ["onMousedown"], gt = /*#__PURE__*/ X({
1298
+ ], ht = ["onMousedown"], gt = ["onBlur"], _t = ["onMousedown"], vt = ["onMousedown"], yt = ["onMousedown"], bt = /*#__PURE__*/ X({
1188
1299
  __name: "AnnotationCanvas",
1189
1300
  props: {
1190
1301
  imageUrl: String,
@@ -1266,23 +1377,23 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1266
1377
  background: e.color || "#e74c3c"
1267
1378
  };
1268
1379
  return e.pointStyle === "square" ? t.borderRadius = "2px" : e.pointStyle === "diamond" ? (t.borderRadius = "2px", t.transform = "translate(-50%, -50%) rotate(45deg)") : e.pointStyle === "arrow" && (t.background = "transparent", t.border = "none", t.width = "0", t.height = "0", t.boxShadow = "none"), t;
1269
- }, I = null, L = null, R = (e, t) => {
1380
+ }, I = null, L = null, te = (e, t) => {
1270
1381
  l("select", e), L = "label", C.value = e.id, b.value = !0, I = {
1271
1382
  ann: e,
1272
1383
  startX: t.clientX,
1273
1384
  startY: t.clientY,
1274
1385
  origLabelX: e.labelX || 0,
1275
1386
  origLabelY: e.labelY || 0
1276
- }, document.addEventListener("mousemove", B), document.addEventListener("mouseup", V);
1277
- }, z = (e, t) => {
1387
+ }, document.addEventListener("mousemove", z), document.addEventListener("mouseup", B);
1388
+ }, R = (e, t) => {
1278
1389
  l("select", e), L = "dot", C.value = e.id, b.value = !0, I = {
1279
1390
  ann: e,
1280
1391
  startX: t.clientX,
1281
1392
  startY: t.clientY,
1282
1393
  origX: e.x,
1283
1394
  origY: e.y
1284
- }, document.addEventListener("mousemove", B), document.addEventListener("mouseup", V);
1285
- }, B = (e) => {
1395
+ }, document.addEventListener("mousemove", z), document.addEventListener("mouseup", B);
1396
+ }, z = (e) => {
1286
1397
  if (!I) return;
1287
1398
  let t = e.clientX - I.startX, n = e.clientY - I.startY;
1288
1399
  if (L === "label") I.ann.labelX = I.origLabelX + t, I.ann.labelY = I.origLabelY + n;
@@ -1292,8 +1403,8 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1292
1403
  let r = e.querySelector(".image-wrapper").getBoundingClientRect(), i = Math.max(0, Math.min(100, I.origX + t / r.width * 100)), a = Math.max(0, Math.min(100, I.origY + n / r.height * 100));
1293
1404
  I.ann.x = Math.round(i * 10) / 10, I.ann.y = Math.round(a * 10) / 10;
1294
1405
  }
1295
- }, V = () => {
1296
- b.value = !1, C.value = null, I = null, L = null, l("change"), document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", V);
1406
+ }, B = () => {
1407
+ b.value = !1, C.value = null, I = null, L = null, l("change"), document.removeEventListener("mousemove", z), document.removeEventListener("mouseup", B);
1297
1408
  };
1298
1409
  return r({ recalculateSize: k }), (t, r) => {
1299
1410
  let o = y("el-icon");
@@ -1315,7 +1426,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1315
1426
  ref: p,
1316
1427
  class: "annotation-image",
1317
1428
  draggable: "false"
1318
- }, null, 40, ot), (h(!0), i(e, null, v(T.value, (e) => (h(), i("div", {
1429
+ }, null, 40, ut), (h(!0), i(e, null, v(T.value, (e) => (h(), i("div", {
1319
1430
  key: e.id,
1320
1431
  class: d(["annotation-group", {
1321
1432
  selected: n.selectedId === e.id,
@@ -1323,7 +1434,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1323
1434
  }]),
1324
1435
  onMousedown: E((n) => t.$emit("select", e), ["stop"])
1325
1436
  }, [
1326
- (h(), i("svg", ct, [a("defs", null, [a("marker", {
1437
+ (h(), i("svg", ft, [a("defs", null, [a("marker", {
1327
1438
  id: "arrow-start-" + e.id,
1328
1439
  markerWidth: "10",
1329
1440
  markerHeight: "7",
@@ -1331,18 +1442,18 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1331
1442
  refY: "3.5",
1332
1443
  orient: "auto",
1333
1444
  fill: e.lineColor || (n.selectedId === e.id ? "#409EFF" : e.color || "#e74c3c")
1334
- }, [...r[2] ||= [a("polygon", { points: "10 0, 0 3.5, 10 7" }, null, -1)]], 8, lt)]), a("path", {
1445
+ }, [...r[2] ||= [a("polygon", { points: "10 0, 0 3.5, 10 7" }, null, -1)]], 8, pt)]), a("path", {
1335
1446
  d: j(e),
1336
1447
  fill: "none",
1337
1448
  stroke: e.lineColor || (n.selectedId === e.id ? "#409EFF" : e.color || "#e74c3c"),
1338
1449
  "stroke-width": e.strokeWidth || 1.5,
1339
1450
  "stroke-dasharray": D.value,
1340
1451
  "marker-start": e.pointStyle === "arrow" ? `url(#arrow-start-${e.id})` : ""
1341
- }, null, 8, ut)])),
1452
+ }, null, 8, mt)])),
1342
1453
  a("div", {
1343
1454
  class: d(["annotation-label", { dragging: b.value && C.value === e.id }]),
1344
1455
  style: f(M(e)),
1345
- onMousedown: E((t) => R(e, t), ["stop"])
1456
+ onMousedown: E((t) => te(e, t), ["stop"])
1346
1457
  }, [a("span", {
1347
1458
  class: "annotation-number",
1348
1459
  style: f(ee(e))
@@ -1354,35 +1465,35 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1354
1465
  e.text = t.target.textContent, l("change");
1355
1466
  },
1356
1467
  onMousedown: r[0] ||= E(() => {}, ["stop"])
1357
- }, x(e.text), 45, ft)], 46, dt),
1468
+ }, x(e.text), 45, gt)], 46, ht),
1358
1469
  e.pointStyle === "flag" ? (h(), i("div", {
1359
1470
  key: 0,
1360
1471
  class: "annotation-flag",
1361
1472
  style: f(P(e)),
1362
- onMousedown: E((t) => z(e, t), ["stop"])
1473
+ onMousedown: E((t) => R(e, t), ["stop"])
1363
1474
  }, [a("div", {
1364
1475
  class: "flag-pole",
1365
1476
  style: f({ background: e.color || "#e74c3c" })
1366
1477
  }, null, 4), a("div", {
1367
1478
  class: "flag-cloth",
1368
1479
  style: f({ background: e.color || "#e74c3c" })
1369
- }, null, 4)], 44, pt)) : e.pointStyle === "arrow" ? (h(), i("div", {
1480
+ }, null, 4)], 44, _t)) : e.pointStyle === "arrow" ? (h(), i("div", {
1370
1481
  key: 2,
1371
1482
  class: d(["annotation-dot arrow-point", { dragging: b.value && C.value === e.id }]),
1372
1483
  style: f(F(e)),
1373
- onMousedown: E((t) => z(e, t), ["stop"])
1374
- }, null, 46, ht)) : (h(), i("div", {
1484
+ onMousedown: E((t) => R(e, t), ["stop"])
1485
+ }, null, 46, yt)) : (h(), i("div", {
1375
1486
  key: 1,
1376
1487
  class: d(["annotation-dot", [e.pointStyle || "circle", { dragging: b.value && C.value === e.id }]]),
1377
1488
  style: f(F(e)),
1378
- onMousedown: E((t) => z(e, t), ["stop"])
1379
- }, null, 46, mt))
1380
- ], 42, st))), 128))], 4)) : (h(), i("div", {
1489
+ onMousedown: E((t) => R(e, t), ["stop"])
1490
+ }, null, 46, vt))
1491
+ ], 42, dt))), 128))], 4)) : (h(), i("div", {
1381
1492
  key: 1,
1382
1493
  class: "upload-placeholder",
1383
1494
  onClick: r[1] ||= (e) => t.$emit("upload-image")
1384
1495
  }, [s(o, { size: "48" }, {
1385
- default: w(() => [s(S(oe))]),
1496
+ default: w(() => [s(S(J))]),
1386
1497
  _: 1
1387
1498
  }), r[3] ||= a("p", null, "点击上传图片", -1)]))], 2);
1388
1499
  };
@@ -1390,7 +1501,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1390
1501
  }, [["__scopeId", "data-v-d9ef76f4"]]);
1391
1502
  //#endregion
1392
1503
  //#region ../../src/composables/useExplosionCollaboration.js
1393
- function _t(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1504
+ function xt(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1394
1505
  let r = new se.Doc(), i = _(!1), a = _(!1), o = _(!1), s = _(!1), c = _([]), l = null, u = null, d = null, f = null, p = !1, h = null, g = `ws://${window.location.hostname || "localhost"}:1234`, v = `${t}-${e}`, y = () => {
1395
1506
  b(), h = setInterval(() => {
1396
1507
  if (l && l.connection && l.connection.ws && l.connection.ws.readyState === WebSocket.CLOSED) try {
@@ -1505,8 +1616,8 @@ function _t(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1505
1616
  }
1506
1617
  //#endregion
1507
1618
  //#region ../../src/composables/useExplosionImageCollaboration.js
1508
- var vt = (e, { onRemoteChange: t } = {}) => {
1509
- let n = _t(e, {
1619
+ var St = (e, { onRemoteChange: t } = {}) => {
1620
+ let n = xt(e, {
1510
1621
  roomPrefix: "explosion-image",
1511
1622
  syncKey: "_data"
1512
1623
  });
@@ -1535,13 +1646,13 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1535
1646
  pushToYjs: r,
1536
1647
  pullFromYjs: i
1537
1648
  };
1538
- }, yt = { class: "explosion-image-editor" }, bt = { class: "editor-body" }, xt = { class: "canvas-area" }, St = { class: "props-panel" }, Ct = { class: "prop-row" }, wt = { class: "prop-row" }, Tt = { class: "prop-row" }, Et = { class: "prop-row" }, Dt = { class: "prop-row" }, Ot = { class: "prop-row" }, kt = { class: "prop-row" }, At = { class: "prop-row" }, jt = { class: "prop-row" }, Mt = { class: "prop-row" }, Nt = { class: "prop-row" }, Pt = { class: "prop-row" }, Ft = { class: "font-style-btns" }, It = { class: "prop-row" }, Lt = { class: "font-style-btns" }, Rt = { class: "prop-row" }, zt = { class: "prop-row" }, Bt = { class: "prop-row" }, Vt = { class: "prop-row" }, Ht = {
1649
+ }, Ct = { class: "explosion-image-editor" }, wt = { class: "editor-body" }, Tt = { class: "canvas-area" }, Et = { class: "props-panel" }, Dt = { class: "prop-row" }, Ot = { class: "prop-row" }, kt = { class: "prop-row" }, At = { class: "prop-row" }, jt = { class: "prop-row" }, Mt = { class: "prop-row" }, Nt = { class: "prop-row" }, Pt = { class: "prop-row" }, Ft = { class: "prop-row" }, It = { class: "prop-row" }, Lt = { class: "prop-row" }, Rt = { class: "prop-row" }, zt = { class: "font-style-btns" }, Bt = { class: "prop-row" }, Vt = { class: "font-style-btns" }, Ht = { class: "prop-row" }, Ut = { class: "prop-row" }, Wt = { class: "prop-row" }, Gt = { class: "prop-row" }, Kt = {
1539
1650
  key: 0,
1540
1651
  class: "prop-row filter-info"
1541
- }, Ut = {
1652
+ }, qt = {
1542
1653
  key: 1,
1543
1654
  class: "no-selection"
1544
- }, Wt = { class: "color-dialog-body" }, Gt = "explosion-image", Kt = /*#__PURE__*/ X({
1655
+ }, Jt = { class: "color-dialog-body" }, Yt = "explosion-image", Xt = /*#__PURE__*/ X({
1545
1656
  __name: "ExplosionImageEditor",
1546
1657
  props: {
1547
1658
  docId: {
@@ -1571,6 +1682,10 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1571
1682
  uiConfig: {
1572
1683
  type: Object,
1573
1684
  default: () => ({})
1685
+ },
1686
+ aiApi: {
1687
+ type: [String, Object],
1688
+ default: null
1574
1689
  }
1575
1690
  },
1576
1691
  setup(c) {
@@ -1579,30 +1694,30 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1579
1694
  titleEditable: !0,
1580
1695
  authorEditable: !0,
1581
1696
  ...l.uiConfig
1582
- })), d = t(() => l.docId ?? f.params.id), f = O(), b = k(), T = _(l.docId ?? null), E = _(null), D = _(!1), M = _(!1), { saveVersion: ee } = Ne(), N = Ae(), P = g({
1697
+ })), d = t(() => l.docId ?? f.params.id), f = O(), b = k(), T = _(l.docId ?? null), E = _(null), D = _(!1), M = _(!1), { saveVersion: ee } = Le(), N = Ae(), P = Pe(() => l.aiApi), F = g({
1583
1698
  title: "图片标注",
1584
1699
  imageUrl: "",
1585
1700
  annotations: [],
1586
1701
  groups: []
1587
- }), F = _(!1), L = _(!1), R = _(!1), z = null, V = _("straight"), H = _(null), U = _(null), te = _(null), W = 0, G = _(null), K = _([]), ne = t(() => G.value ? P.annotations.filter((e) => e.groupId === G.value) : P.annotations), re = () => E.value?.click(), q = async (e) => {
1702
+ }), L = _(!1), te = _(!1), R = _(!1), B = null, V = _("straight"), H = _(null), U = _(null), W = _(null), ne = 0, G = _(null), K = _([]), re = t(() => G.value ? F.annotations.filter((e) => e.groupId === G.value) : F.annotations), q = () => E.value?.click(), ie = async (e) => {
1588
1703
  let t = e.target.files?.[0];
1589
1704
  if (!t) return;
1590
1705
  let n = new FormData();
1591
1706
  n.append("file", t);
1592
1707
  try {
1593
1708
  let e = await Y.post(`${l.apiBase}/files/upload/image`, n);
1594
- P.imageUrl = e.data.url || e.data.file_path, $();
1709
+ F.imageUrl = e.data.url || e.data.file_path, $();
1595
1710
  } catch {
1596
1711
  A.error("上传失败");
1597
1712
  }
1598
- }, ie = () => {
1599
- if (!P.imageUrl) {
1713
+ }, ae = () => {
1714
+ if (!F.imageUrl) {
1600
1715
  A.warning("请先上传图片");
1601
1716
  return;
1602
1717
  }
1603
- let e = P.annotations.reduce((e, t) => Math.max(e, t.number), 0);
1604
- P.annotations.push({
1605
- id: `ann-${++W}-${Date.now()}`,
1718
+ let e = F.annotations.reduce((e, t) => Math.max(e, t.number), 0);
1719
+ F.annotations.push({
1720
+ id: `ann-${++ne}-${Date.now()}`,
1606
1721
  number: e + 1,
1607
1722
  text: "",
1608
1723
  x: 50,
@@ -1624,49 +1739,49 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1624
1739
  textDecoration: "",
1625
1740
  groupId: ""
1626
1741
  }), $();
1627
- }, ae = (e) => {
1742
+ }, oe = (e) => {
1628
1743
  H.value = e.id, U.value = e;
1629
1744
  }, J = (e, t) => {
1630
1745
  U.value && (U.value[e] === t ? U.value[e] = "" : U.value[e] = t);
1631
- }, oe = () => {
1632
- U.value && (U.value.fontFamily = "", U.value.fontSize = 13, U.value.fontWeight = "", U.value.fontStyle = "", U.value.textDecoration = "");
1633
1746
  }, se = () => {
1634
- P.annotations = P.annotations.filter((e) => e.id !== H.value), H.value = null, U.value = null, $();
1635
- }, ce = (e) => {
1747
+ U.value && (U.value.fontFamily = "", U.value.fontSize = 13, U.value.fontWeight = "", U.value.fontStyle = "", U.value.textDecoration = "");
1748
+ }, ce = () => {
1749
+ F.annotations = F.annotations.filter((e) => e.id !== H.value), H.value = null, U.value = null, $();
1750
+ }, X = (e) => {
1636
1751
  e === "new" && j.prompt("分组名称", "新建分组", { inputPlaceholder: "名称" }).then(({ value: e }) => {
1637
- e && (P.groups.push({
1752
+ e && (F.groups.push({
1638
1753
  id: `grp-${Date.now()}`,
1639
1754
  name: e
1640
1755
  }), $());
1641
1756
  }).catch(() => {});
1642
- }, X = (e, t) => {
1643
- e === "filter" ? G.value = G.value === t ? null : t : e === "collapse" ? de(t) : e === "color" ? (le.value = t, Z.value = !0) : e === "delete" && j.confirm("确定删除该分组?分组内的标注将保留,但分组关系将被移除。", "删除分组", { type: "warning" }).then(() => {
1644
- P.annotations.forEach((e) => {
1757
+ }, le = (e, t) => {
1758
+ e === "filter" ? G.value = G.value === t ? null : t : e === "collapse" ? fe(t) : e === "color" ? (ue.value = t, Z.value = !0) : e === "delete" && j.confirm("确定删除该分组?分组内的标注将保留,但分组关系将被移除。", "删除分组", { type: "warning" }).then(() => {
1759
+ F.annotations.forEach((e) => {
1645
1760
  e.groupId === t && (e.groupId = "");
1646
- }), P.groups = P.groups.filter((e) => e.id !== t), G.value === t && (G.value = null), A.success("分组已删除"), $();
1761
+ }), F.groups = F.groups.filter((e) => e.id !== t), G.value === t && (G.value = null), A.success("分组已删除"), $();
1647
1762
  }).catch(() => {});
1648
- }, Z = _(!1), le = _(null), Q = _("#e74c3c"), ue = () => {
1649
- P.annotations.forEach((e) => {
1650
- e.groupId === le.value && (e.color = Q.value, e.numberColor = Q.value, e.lineColor = Q.value, e.textColor = Q.value);
1763
+ }, Z = _(!1), ue = _(null), Q = _("#e74c3c"), de = () => {
1764
+ F.annotations.forEach((e) => {
1765
+ e.groupId === ue.value && (e.color = Q.value, e.numberColor = Q.value, e.lineColor = Q.value, e.textColor = Q.value);
1651
1766
  }), Z.value = !1, A.success("颜色已更新"), $();
1652
- }, de = (e) => {
1767
+ }, fe = (e) => {
1653
1768
  let t = K.value.indexOf(e);
1654
1769
  t === -1 ? K.value.push(e) : K.value.splice(t, 1);
1655
- }, fe = () => {
1770
+ }, pe = () => {
1656
1771
  G.value = null, K.value = [];
1657
- }, pe = async () => {
1658
- if (F.value && z?.collaborationClosed.value && !R.value) {
1772
+ }, me = async () => {
1773
+ if (L.value && B?.collaborationClosed.value && !R.value) {
1659
1774
  A.warning("协作已关闭,无法保存");
1660
1775
  return;
1661
1776
  }
1662
1777
  try {
1663
1778
  let e = {
1664
- title: P.title,
1779
+ title: F.title,
1665
1780
  view_type: "image",
1666
1781
  config: JSON.stringify({
1667
- imageUrl: P.imageUrl,
1668
- annotations: P.annotations,
1669
- groups: P.groups,
1782
+ imageUrl: F.imageUrl,
1783
+ annotations: F.annotations,
1784
+ groups: F.groups,
1670
1785
  lineStyle: V.value
1671
1786
  })
1672
1787
  };
@@ -1682,9 +1797,9 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1682
1797
  documentId: T.value,
1683
1798
  docType: "image",
1684
1799
  content: JSON.stringify({
1685
- imageUrl: P.imageUrl,
1686
- annotations: P.annotations,
1687
- groups: P.groups,
1800
+ imageUrl: F.imageUrl,
1801
+ annotations: F.annotations,
1802
+ groups: F.groups,
1688
1803
  lineStyle: V.value
1689
1804
  }),
1690
1805
  userId: String(N.currentUser.value?.id || ""),
@@ -1693,7 +1808,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1693
1808
  } catch {
1694
1809
  A.error("保存失败");
1695
1810
  }
1696
- }, me = async () => {
1811
+ }, he = async () => {
1697
1812
  if (d.value) try {
1698
1813
  let e;
1699
1814
  if (typeof l.loadApi == "function") e = await l.loadApi(d.value);
@@ -1702,36 +1817,35 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1702
1817
  let t = l.apiBase;
1703
1818
  e = (await Y.get(`${t}/explosion-views/${d.value}`)).data;
1704
1819
  }
1705
- if (T.value = e.id, P.title = e.title, e.config) {
1820
+ if (T.value = e.id, F.title = e.title, e.config) {
1706
1821
  let t = JSON.parse(e.config);
1707
- P.imageUrl = t.imageUrl || "", P.annotations = t.annotations || [], P.groups = t.groups || [], V.value = t.lineStyle || "straight";
1822
+ F.imageUrl = t.imageUrl || "", F.annotations = t.annotations || [], F.groups = t.groups || [], V.value = t.lineStyle || "straight";
1708
1823
  }
1709
1824
  } catch (e) {
1710
1825
  console.error(e);
1711
1826
  }
1712
- }, he = () => {
1827
+ }, ge = () => {
1713
1828
  l.docId ?? b.push("/");
1714
- }, ge = [
1715
- "我可以帮您优化图片标注、检查注释内容,或者提供标注建议。请问有什么需要帮助的?",
1716
- "这张图片的标注很详细。建议检查标注线条是否清晰,避免与其他标注重叠。",
1717
- "根据当前的标注内容,我建议为关键部件添加更详细的文字说明。",
1718
- "我可以帮您检查标注中是否有遗漏的区域或重复的编号。需要我逐个分析吗?",
1719
- "建议使用不同颜色的标注来区分不同类别的部件,提高可读性。",
1720
- "图片标注的分组功能可以帮助您管理复杂的标注。建议按功能模块进行分组。",
1721
- "我可以帮您将标注信息整理成表格,方便后续查阅和修改。",
1722
- "标注的连线样式建议统一,直线适合简单标注,折线适合复杂场景。"
1723
- ], _e = async (e, t = {}) => {
1724
- let n = T.value ? `${Gt}-${T.value}` : null;
1829
+ }, _e = async (e, t = {}) => {
1830
+ let n = T.value ? `${Yt}-${T.value}` : null;
1725
1831
  await N.sendMessage(e, {
1726
1832
  ...t,
1727
1833
  roomId: n
1728
1834
  });
1729
1835
  let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = N.collabUsers.value.filter((e) => e.name !== N.currentUser.value.name);
1730
- (!r || i || a.length === 0) && (N.loading.value = !0, setTimeout(() => {
1731
- N.sendAiMessage(ge[Math.floor(Math.random() * ge.length)], n), N.loading.value = !1;
1732
- }, 800 + Math.random() * 1200));
1836
+ if (!r || i || a.length === 0) {
1837
+ N.loading.value = !0;
1838
+ try {
1839
+ let t = await P.chat(e, N.messages.value);
1840
+ N.sendAiMessage(t, n);
1841
+ } catch (e) {
1842
+ N.sendAiMessage("AI 请求失败: " + (e.message || "未知错误"), n);
1843
+ } finally {
1844
+ N.loading.value = !1;
1845
+ }
1846
+ }
1733
1847
  }, ve = () => {
1734
- let e = T.value ? `${Gt}-${T.value}` : null;
1848
+ let e = T.value ? `${Yt}-${T.value}` : null;
1735
1849
  N.clearMessages(e);
1736
1850
  }, ye = () => {
1737
1851
  if (!T.value) {
@@ -1742,7 +1856,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1742
1856
  }, be = (e) => {
1743
1857
  try {
1744
1858
  let t = typeof e == "string" ? JSON.parse(e) : e;
1745
- t.imageUrl && (P.imageUrl = t.imageUrl), t.annotations && (P.annotations = t.annotations), t.groups && (P.groups = t.groups), t.lineStyle && (V.value = t.lineStyle), H.value = null, U.value = null;
1859
+ t.imageUrl && (F.imageUrl = t.imageUrl), t.annotations && (F.annotations = t.annotations), t.groups && (F.groups = t.groups), t.lineStyle && (V.value = t.lineStyle), H.value = null, U.value = null;
1746
1860
  } catch (e) {
1747
1861
  console.error("Version apply error:", e);
1748
1862
  }
@@ -1754,7 +1868,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1754
1868
  n.width = t.naturalWidth, n.height = t.naturalHeight;
1755
1869
  let r = n.getContext("2d");
1756
1870
  r.drawImage(t, 0, 0);
1757
- let i = n.width / t.clientWidth, a = n.height / t.clientHeight, o = Math.max(i, a), s = e === "png-filtered" ? ne.value : P.annotations, c = [
1871
+ let i = n.width / t.clientWidth, a = n.height / t.clientHeight, o = Math.max(i, a), s = e === "png-filtered" ? re.value : F.annotations, c = [
1758
1872
  "dashed",
1759
1873
  "dotted",
1760
1874
  "dashdot"
@@ -1813,19 +1927,19 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1813
1927
  }
1814
1928
  }), n.toBlob((e) => {
1815
1929
  let t = document.createElement("a");
1816
- t.href = URL.createObjectURL(e), t.download = `${P.title || "图片标注"}.png`, t.click();
1930
+ t.href = URL.createObjectURL(e), t.download = `${F.title || "图片标注"}.png`, t.click();
1817
1931
  });
1818
1932
  } else e === "json" ? Se() : A.info(`导出 ${e} 开发中`);
1819
1933
  }, Se = () => {
1820
1934
  let e = {
1821
- title: P.title,
1822
- imageUrl: P.imageUrl,
1823
- annotations: P.annotations,
1824
- groups: P.groups,
1935
+ title: F.title,
1936
+ imageUrl: F.imageUrl,
1937
+ annotations: F.annotations,
1938
+ groups: F.groups,
1825
1939
  lineStyle: V.value,
1826
1940
  exportTime: (/* @__PURE__ */ new Date()).toISOString()
1827
1941
  }, t = new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), n = document.createElement("a");
1828
- n.href = URL.createObjectURL(t), n.download = `${P.title || "爆炸图"}.json`, n.click(), A.success("JSON已导出");
1942
+ n.href = URL.createObjectURL(t), n.download = `${F.title || "爆炸图"}.json`, n.click(), A.success("JSON已导出");
1829
1943
  }, Ce = (e) => {
1830
1944
  let t = e.target.files[0];
1831
1945
  if (!t) return;
@@ -1837,41 +1951,41 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1837
1951
  A.error("JSON格式无效:缺少图片或标注数据");
1838
1952
  return;
1839
1953
  }
1840
- P.title = t.title || "图片标注", P.imageUrl = t.imageUrl || "", P.annotations = t.annotations || [], P.groups = t.groups || [], V.value = t.lineStyle || "straight", H.value = null, U.value = null, $(), A.success("导入成功");
1954
+ F.title = t.title || "图片标注", F.imageUrl = t.imageUrl || "", F.annotations = t.annotations || [], F.groups = t.groups || [], V.value = t.lineStyle || "straight", H.value = null, U.value = null, $(), A.success("导入成功");
1841
1955
  } catch {
1842
1956
  A.error("JSON解析失败,请检查文件格式");
1843
1957
  }
1844
1958
  }, n.readAsText(t), e.target.value = "";
1845
1959
  }, $ = () => {
1846
- F.value && z && z.pushToYjs(P);
1960
+ L.value && B && B.pushToYjs(F);
1847
1961
  };
1848
1962
  C(U, () => {
1849
1963
  $();
1850
1964
  }, { deep: !0 });
1851
1965
  let we = (e) => {
1852
- z &&= (z.destroy(), null), z = vt(e, { onRemoteChange: (e) => {
1853
- e.title && (P.title = e.title), e.imageUrl && (P.imageUrl = e.imageUrl), e.annotations && (P.annotations = e.annotations), e.groups && (P.groups = e.groups);
1854
- } }), z._setSyncReady(!1);
1966
+ B &&= (B.destroy(), null), B = St(e, { onRemoteChange: (e) => {
1967
+ e.title && (F.title = e.title), e.imageUrl && (F.imageUrl = e.imageUrl), e.annotations && (F.annotations = e.annotations), e.groups && (F.groups = e.groups);
1968
+ } }), B._setSyncReady(!1);
1855
1969
  }, Te = async () => {
1856
- if (F.value) return;
1857
- if (!T.value && (await pe(), !T.value)) {
1970
+ if (L.value) return;
1971
+ if (!T.value && (await me(), !T.value)) {
1858
1972
  A.error("请先保存文档");
1859
1973
  return;
1860
1974
  }
1861
- we(String(T.value)), z.connect();
1975
+ we(String(T.value)), B.connect();
1862
1976
  let e = {
1863
1977
  name: `用户${Math.floor(Math.random() * 1e3)}`,
1864
1978
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
1865
1979
  }, t = () => {
1866
- if (z.provider && z.provider.synced) {
1867
- z._setSyncReady(!0), z.setLocalUser(e);
1868
- let t = z.pullFromYjs();
1869
- t ? (t.title && (P.title = t.title), t.imageUrl && (P.imageUrl = t.imageUrl), t.annotations && (P.annotations = t.annotations), t.groups && (P.groups = t.groups)) : (P.annotations.length > 0 || P.imageUrl) && z.pushToYjs(P), F.value = !0, R.value = !0, L.value = !1, N.setCollabContext({
1870
- ydoc: z.ydoc,
1871
- provider: z.provider,
1872
- onlineUsers: z.onlineUsers
1980
+ if (B.provider && B.provider.synced) {
1981
+ B._setSyncReady(!0), B.setLocalUser(e);
1982
+ let t = B.pullFromYjs();
1983
+ t ? (t.title && (F.title = t.title), t.imageUrl && (F.imageUrl = t.imageUrl), t.annotations && (F.annotations = t.annotations), t.groups && (F.groups = t.groups)) : (F.annotations.length > 0 || F.imageUrl) && B.pushToYjs(F), L.value = !0, R.value = !0, te.value = !1, N.setCollabContext({
1984
+ ydoc: B.ydoc,
1985
+ provider: B.provider,
1986
+ onlineUsers: B.onlineUsers
1873
1987
  }), N.setCurrentUser({
1874
- id: z.provider.awareness.clientID,
1988
+ id: B.provider.awareness.clientID,
1875
1989
  name: e.name,
1876
1990
  color: e.color
1877
1991
  }), A.success("协作已开启");
@@ -1879,28 +1993,28 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1879
1993
  };
1880
1994
  setTimeout(t, 200);
1881
1995
  }, Ee = () => {
1882
- z && (z.closeCollaboration(), F.value = !1, R.value = !1, A.info("协作已关闭"));
1996
+ B && (B.closeCollaboration(), L.value = !1, R.value = !1, A.info("协作已关闭"));
1883
1997
  }, De = () => {
1884
1998
  let e = f.params.id;
1885
1999
  if (!e) return;
1886
- we(e), z.connect();
2000
+ we(e), B.connect();
1887
2001
  let t = {
1888
2002
  name: `协作人${Math.floor(Math.random() * 1e3)}`,
1889
2003
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
1890
2004
  }, n = () => {
1891
- if (z.provider && z.provider.synced) {
1892
- if (z.checkCollaborationClosed()) {
1893
- z.disconnect(), F.value = !1, A.warning("该协作已关闭,无法加入");
2005
+ if (B.provider && B.provider.synced) {
2006
+ if (B.checkCollaborationClosed()) {
2007
+ B.disconnect(), L.value = !1, A.warning("该协作已关闭,无法加入");
1894
2008
  return;
1895
2009
  }
1896
- z._setSyncReady(!0), z.setLocalUser(t);
1897
- let e = z.pullFromYjs();
1898
- e && (e.title && (P.title = e.title), e.imageUrl && (P.imageUrl = e.imageUrl), e.annotations && (P.annotations = e.annotations), e.groups && (P.groups = e.groups)), F.value = !0, R.value = !1, N.setCollabContext({
1899
- ydoc: z.ydoc,
1900
- provider: z.provider,
1901
- onlineUsers: z.onlineUsers
2010
+ B._setSyncReady(!0), B.setLocalUser(t);
2011
+ let e = B.pullFromYjs();
2012
+ e && (e.title && (F.title = e.title), e.imageUrl && (F.imageUrl = e.imageUrl), e.annotations && (F.annotations = e.annotations), e.groups && (F.groups = e.groups)), L.value = !0, R.value = !1, N.setCollabContext({
2013
+ ydoc: B.ydoc,
2014
+ provider: B.provider,
2015
+ onlineUsers: B.onlineUsers
1902
2016
  }), N.setCurrentUser({
1903
- id: z.provider.awareness.clientID,
2017
+ id: B.provider.awareness.clientID,
1904
2018
  name: t.name,
1905
2019
  color: t.color
1906
2020
  }), A.success("已加入协作");
@@ -1908,9 +2022,9 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1908
2022
  };
1909
2023
  setTimeout(n, 200);
1910
2024
  }, Oe = () => {
1911
- F.value ? Ee() : Te();
2025
+ L.value ? Ee() : Te();
1912
2026
  }, je = async () => {
1913
- if (F.value || await Te(), !T.value && (await pe(), !T.value)) {
2027
+ if (L.value || await Te(), !T.value && (await me(), !T.value)) {
1914
2028
  A.warning("请先保存文档后再分享");
1915
2029
  return;
1916
2030
  }
@@ -1927,37 +2041,37 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1927
2041
  id: l.user?.id || Date.now(),
1928
2042
  name: e,
1929
2043
  color: l.user?.color || "#409eff"
1930
- }), await me(), d.value && f.query.collab === "1" && De();
2044
+ }), await he(), d.value && f.query.collab === "1" && De();
1931
2045
  });
1932
2046
  let Me = (e) => {
1933
- e.key === "Delete" && H.value && se();
2047
+ e.key === "Delete" && H.value && ce();
1934
2048
  };
1935
2049
  return p(() => document.addEventListener("keydown", Me)), m(() => {
1936
- document.removeEventListener("keydown", Me), z &&= (z.destroy(), null);
2050
+ document.removeEventListener("keydown", Me), B &&= (B.destroy(), null);
1937
2051
  }), (t, c) => {
1938
2052
  let l = y("el-input-number"), d = y("el-input"), p = y("el-color-picker"), m = y("el-option"), g = y("el-select"), _ = y("el-slider"), b = y("el-button"), C = y("el-icon"), O = y("el-tag"), k = y("el-dialog"), A = y("Monitor");
1939
- return h(), i("div", yt, [
1940
- s(at, {
1941
- title: P.title,
1942
- "onUpdate:title": c[0] ||= (e) => P.title = e,
2053
+ return h(), i("div", Ct, [
2054
+ s(lt, {
2055
+ title: F.title,
2056
+ "onUpdate:title": c[0] ||= (e) => F.title = e,
1943
2057
  "line-style": V.value,
1944
- groups: P.groups,
2058
+ groups: F.groups,
1945
2059
  "active-group-id": G.value,
1946
2060
  "collapsed-groups": K.value,
1947
- "is-connected": F.value,
1948
- "online-users": S(z) ? S(z).onlineUsers.value : [],
2061
+ "is-connected": L.value,
2062
+ "online-users": S(B) ? S(B).onlineUsers.value : [],
1949
2063
  "is-join-mode": S(f).query.collab === "1",
1950
2064
  "show-back-button": u.value.backButton === "show",
1951
2065
  "title-disabled": !u.value.titleEditable,
1952
- onBack: he,
1953
- onAddAnnotation: ie,
2066
+ onBack: ge,
2067
+ onAddAnnotation: ae,
1954
2068
  onSetLineStyle: c[1] ||= (e) => V.value = e,
1955
- onAddGroup: ce,
1956
- onGroupAction: X,
1957
- onClearGroupFilter: fe,
2069
+ onAddGroup: X,
2070
+ onGroupAction: le,
2071
+ onClearGroupFilter: pe,
1958
2072
  onExport: xe,
1959
2073
  onImportJson: Ce,
1960
- onSave: pe,
2074
+ onSave: me,
1961
2075
  onToggleCollab: Oe,
1962
2076
  onShareCollab: je,
1963
2077
  "show-history": !!T.value,
@@ -1975,16 +2089,16 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1975
2089
  "title-disabled",
1976
2090
  "show-history"
1977
2091
  ]),
1978
- a("div", bt, [a("div", xt, [s(gt, {
2092
+ a("div", wt, [a("div", Tt, [s(bt, {
1979
2093
  ref_key: "annotationCanvasRef",
1980
- ref: te,
1981
- "image-url": P.imageUrl,
1982
- annotations: ne.value,
2094
+ ref: W,
2095
+ "image-url": F.imageUrl,
2096
+ annotations: re.value,
1983
2097
  "collapsed-groups": K.value,
1984
2098
  "selected-id": H.value,
1985
2099
  "line-style": V.value,
1986
- onSelect: ae,
1987
- onUploadImage: re,
2100
+ onSelect: oe,
2101
+ onUploadImage: q,
1988
2102
  onChange: $
1989
2103
  }, null, 8, [
1990
2104
  "image-url",
@@ -1998,26 +2112,26 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1998
2112
  type: "file",
1999
2113
  accept: "image/*",
2000
2114
  style: { display: "none" },
2001
- onChange: q
2002
- }, null, 544)]), a("div", St, [c[58] ||= a("h4", null, "标注属性", -1), U.value ? (h(), i(e, { key: 0 }, [
2003
- a("div", Ct, [c[31] ||= a("label", null, "编号", -1), s(l, {
2115
+ onChange: ie
2116
+ }, null, 544)]), a("div", Et, [c[58] ||= a("h4", null, "标注属性", -1), U.value ? (h(), i(e, { key: 0 }, [
2117
+ a("div", Dt, [c[31] ||= a("label", null, "编号", -1), s(l, {
2004
2118
  modelValue: U.value.number,
2005
2119
  "onUpdate:modelValue": c[2] ||= (e) => U.value.number = e,
2006
2120
  min: 1,
2007
2121
  size: "small"
2008
2122
  }, null, 8, ["modelValue"])]),
2009
- a("div", wt, [c[32] ||= a("label", null, "文字", -1), s(d, {
2123
+ a("div", Ot, [c[32] ||= a("label", null, "文字", -1), s(d, {
2010
2124
  modelValue: U.value.text,
2011
2125
  "onUpdate:modelValue": c[3] ||= (e) => U.value.text = e,
2012
2126
  size: "small"
2013
2127
  }, null, 8, ["modelValue"])]),
2014
- a("div", Tt, [c[33] ||= a("label", null, "引线颜色", -1), s(p, {
2128
+ a("div", kt, [c[33] ||= a("label", null, "引线颜色", -1), s(p, {
2015
2129
  modelValue: U.value.lineColor,
2016
2130
  "onUpdate:modelValue": c[4] ||= (e) => U.value.lineColor = e,
2017
2131
  size: "small",
2018
2132
  "show-alpha": ""
2019
2133
  }, null, 8, ["modelValue"])]),
2020
- a("div", Et, [c[34] ||= a("label", null, "标注点样式", -1), s(g, {
2134
+ a("div", At, [c[34] ||= a("label", null, "标注点样式", -1), s(g, {
2021
2135
  modelValue: U.value.pointStyle,
2022
2136
  "onUpdate:modelValue": c[5] ||= (e) => U.value.pointStyle = e,
2023
2137
  size: "small"
@@ -2046,28 +2160,28 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2046
2160
  ]),
2047
2161
  _: 1
2048
2162
  }, 8, ["modelValue"])]),
2049
- a("div", Dt, [c[35] ||= a("label", null, "标注点颜色", -1), s(p, {
2163
+ a("div", jt, [c[35] ||= a("label", null, "标注点颜色", -1), s(p, {
2050
2164
  modelValue: U.value.color,
2051
2165
  "onUpdate:modelValue": c[6] ||= (e) => U.value.color = e,
2052
2166
  size: "small"
2053
2167
  }, null, 8, ["modelValue"])]),
2054
- a("div", Ot, [c[36] ||= a("label", null, "编号颜色", -1), s(p, {
2168
+ a("div", Mt, [c[36] ||= a("label", null, "编号颜色", -1), s(p, {
2055
2169
  modelValue: U.value.numberColor,
2056
2170
  "onUpdate:modelValue": c[7] ||= (e) => U.value.numberColor = e,
2057
2171
  size: "small"
2058
2172
  }, null, 8, ["modelValue"])]),
2059
- a("div", kt, [c[37] ||= a("label", null, "文字颜色", -1), s(p, {
2173
+ a("div", Nt, [c[37] ||= a("label", null, "文字颜色", -1), s(p, {
2060
2174
  modelValue: U.value.textColor,
2061
2175
  "onUpdate:modelValue": c[8] ||= (e) => U.value.textColor = e,
2062
2176
  size: "small"
2063
2177
  }, null, 8, ["modelValue"])]),
2064
- a("div", At, [c[38] ||= a("label", null, "文字背景色", -1), s(p, {
2178
+ a("div", Pt, [c[38] ||= a("label", null, "文字背景色", -1), s(p, {
2065
2179
  modelValue: U.value.labelBgColor,
2066
2180
  "onUpdate:modelValue": c[9] ||= (e) => U.value.labelBgColor = e,
2067
2181
  size: "small",
2068
2182
  "show-alpha": ""
2069
2183
  }, null, 8, ["modelValue"])]),
2070
- a("div", jt, [c[39] ||= a("label", null, "背景透明度", -1), s(_, {
2184
+ a("div", Ft, [c[39] ||= a("label", null, "背景透明度", -1), s(_, {
2071
2185
  modelValue: U.value.labelBgOpacity,
2072
2186
  "onUpdate:modelValue": c[10] ||= (e) => U.value.labelBgOpacity = e,
2073
2187
  min: 0,
@@ -2076,7 +2190,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2076
2190
  "show-input": "",
2077
2191
  "input-size": "small"
2078
2192
  }, null, 8, ["modelValue"])]),
2079
- a("div", Mt, [c[40] ||= a("label", null, "字体", -1), s(g, {
2193
+ a("div", It, [c[40] ||= a("label", null, "字体", -1), s(g, {
2080
2194
  modelValue: U.value.fontFamily,
2081
2195
  "onUpdate:modelValue": c[11] ||= (e) => U.value.fontFamily = e,
2082
2196
  size: "small",
@@ -2114,14 +2228,14 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2114
2228
  ]),
2115
2229
  _: 1
2116
2230
  }, 8, ["modelValue"])]),
2117
- a("div", Nt, [c[41] ||= a("label", null, "字号", -1), s(l, {
2231
+ a("div", Lt, [c[41] ||= a("label", null, "字号", -1), s(l, {
2118
2232
  modelValue: U.value.fontSize,
2119
2233
  "onUpdate:modelValue": c[12] ||= (e) => U.value.fontSize = e,
2120
2234
  min: 10,
2121
2235
  max: 32,
2122
2236
  size: "small"
2123
2237
  }, null, 8, ["modelValue"])]),
2124
- a("div", Pt, [c[46] ||= a("label", null, "字体样式", -1), a("div", Ft, [
2238
+ a("div", Rt, [c[46] ||= a("label", null, "字体样式", -1), a("div", zt, [
2125
2239
  s(b, {
2126
2240
  type: U.value.fontWeight === "bold" ? "primary" : "",
2127
2241
  size: "small",
@@ -2155,7 +2269,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2155
2269
  _: 1
2156
2270
  }, 8, ["type"])
2157
2271
  ])]),
2158
- a("div", It, [c[51] ||= a("label", null, "装饰", -1), a("div", Lt, [
2272
+ a("div", Bt, [c[51] ||= a("label", null, "装饰", -1), a("div", Vt, [
2159
2273
  s(b, {
2160
2274
  type: U.value.textDecoration === "underline" ? "primary" : "",
2161
2275
  size: "small",
@@ -2182,13 +2296,13 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2182
2296
  }, 8, ["type"]),
2183
2297
  s(b, {
2184
2298
  size: "small",
2185
- onClick: oe
2299
+ onClick: se
2186
2300
  }, {
2187
2301
  default: w(() => [...c[50] ||= [o("清除", -1)]]),
2188
2302
  _: 1
2189
2303
  })
2190
2304
  ])]),
2191
- a("div", Rt, [c[52] ||= a("label", null, "X% (点)", -1), s(_, {
2305
+ a("div", Ht, [c[52] ||= a("label", null, "X% (点)", -1), s(_, {
2192
2306
  modelValue: U.value.x,
2193
2307
  "onUpdate:modelValue": c[20] ||= (e) => U.value.x = e,
2194
2308
  min: 0,
@@ -2197,7 +2311,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2197
2311
  "show-input": "",
2198
2312
  "input-size": "small"
2199
2313
  }, null, 8, ["modelValue"])]),
2200
- a("div", zt, [c[53] ||= a("label", null, "Y% (点)", -1), s(_, {
2314
+ a("div", Ut, [c[53] ||= a("label", null, "Y% (点)", -1), s(_, {
2201
2315
  modelValue: U.value.y,
2202
2316
  "onUpdate:modelValue": c[21] ||= (e) => U.value.y = e,
2203
2317
  min: 0,
@@ -2206,33 +2320,33 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2206
2320
  "show-input": "",
2207
2321
  "input-size": "small"
2208
2322
  }, null, 8, ["modelValue"])]),
2209
- a("div", Bt, [c[54] ||= a("label", null, "线宽", -1), s(l, {
2323
+ a("div", Wt, [c[54] ||= a("label", null, "线宽", -1), s(l, {
2210
2324
  modelValue: U.value.strokeWidth,
2211
2325
  "onUpdate:modelValue": c[22] ||= (e) => U.value.strokeWidth = e,
2212
2326
  min: 1,
2213
2327
  max: 5,
2214
2328
  size: "small"
2215
2329
  }, null, 8, ["modelValue"])]),
2216
- a("div", Vt, [c[55] ||= a("label", null, "分组", -1), s(g, {
2330
+ a("div", Gt, [c[55] ||= a("label", null, "分组", -1), s(g, {
2217
2331
  modelValue: U.value.groupId,
2218
2332
  "onUpdate:modelValue": c[23] ||= (e) => U.value.groupId = e,
2219
2333
  size: "small",
2220
2334
  clearable: ""
2221
2335
  }, {
2222
- default: w(() => [(h(!0), i(e, null, v(P.groups, (e) => (h(), n(m, {
2336
+ default: w(() => [(h(!0), i(e, null, v(F.groups, (e) => (h(), n(m, {
2223
2337
  key: e.id,
2224
2338
  label: e.name,
2225
2339
  value: e.id
2226
2340
  }, null, 8, ["label", "value"]))), 128))]),
2227
2341
  _: 1
2228
2342
  }, 8, ["modelValue"])]),
2229
- G.value ? (h(), i("div", Ht, [s(O, {
2343
+ G.value ? (h(), i("div", Kt, [s(O, {
2230
2344
  size: "small",
2231
2345
  type: "info"
2232
2346
  }, {
2233
- default: w(() => [o(" 当前筛选: " + x(P.groups.find((e) => e.id === G.value)?.name || "未知分组") + " ", 1), s(C, {
2347
+ default: w(() => [o(" 当前筛选: " + x(F.groups.find((e) => e.id === G.value)?.name || "未知分组") + " ", 1), s(C, {
2234
2348
  class: "el-tag__close",
2235
- onClick: fe
2349
+ onClick: pe
2236
2350
  }, {
2237
2351
  default: w(() => [s(S(I))]),
2238
2352
  _: 1
@@ -2242,16 +2356,16 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2242
2356
  s(b, {
2243
2357
  size: "small",
2244
2358
  type: "danger",
2245
- onClick: se
2359
+ onClick: ce
2246
2360
  }, {
2247
2361
  default: w(() => [...c[56] ||= [o("删除", -1)]]),
2248
2362
  _: 1
2249
2363
  })
2250
- ], 64)) : (h(), i("div", Ut, [s(C, {
2364
+ ], 64)) : (h(), i("div", qt, [s(C, {
2251
2365
  size: "48",
2252
2366
  color: "#ccc"
2253
2367
  }, {
2254
- default: w(() => [s(S(B))]),
2368
+ default: w(() => [s(S(z))]),
2255
2369
  _: 1
2256
2370
  }), c[57] ||= a("p", null, "点击标注进行编辑", -1)]))])]),
2257
2371
  s(k, {
@@ -2266,12 +2380,12 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2266
2380
  _: 1
2267
2381
  }), s(b, {
2268
2382
  type: "primary",
2269
- onClick: ue
2383
+ onClick: de
2270
2384
  }, {
2271
2385
  default: w(() => [...c[61] ||= [o("确定", -1)]]),
2272
2386
  _: 1
2273
2387
  })]),
2274
- default: w(() => [a("div", Wt, [c[59] ||= a("span", null, "选择颜色:", -1), s(p, {
2388
+ default: w(() => [a("div", Jt, [c[59] ||= a("span", null, "选择颜色:", -1), s(p, {
2275
2389
  modelValue: Q.value,
2276
2390
  "onUpdate:modelValue": c[24] ||= (e) => Q.value = e,
2277
2391
  "show-alpha": ""
@@ -2315,7 +2429,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2315
2429
  "is-owner",
2316
2430
  "unread-mention"
2317
2431
  ]),
2318
- s(Ge, {
2432
+ s(Ye, {
2319
2433
  modelValue: M.value,
2320
2434
  "onUpdate:modelValue": c[30] ||= (e) => M.value = e,
2321
2435
  "document-id": T.value,
@@ -2324,7 +2438,7 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2324
2438
  ]);
2325
2439
  };
2326
2440
  }
2327
- }, [["__scopeId", "data-v-b215517d"]]), qt = c({
2441
+ }, [["__scopeId", "data-v-e25c1b61"]]), Zt = c({
2328
2442
  name: "YourCompanyExplosionImage",
2329
2443
  props: {
2330
2444
  docId: {
@@ -2362,14 +2476,18 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2362
2476
  uiConfig: {
2363
2477
  type: Object,
2364
2478
  default: () => ({})
2479
+ },
2480
+ aiApi: {
2481
+ type: [String, Object],
2482
+ default: null
2365
2483
  }
2366
2484
  },
2367
2485
  setup(e, { slots: t }) {
2368
2486
  return () => l("div", {
2369
2487
  class: "yourcompany-explosion-image-wrapper",
2370
2488
  style: "position:relative"
2371
- }, [l(Kt, { ...e }), l(D)]);
2489
+ }, [l(Xt, { ...e }), l(D)]);
2372
2490
  }
2373
2491
  });
2374
2492
  //#endregion
2375
- export { qt as default };
2493
+ export { Zt as default };