@wandox/sdk 0.1.43 → 0.1.45
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/{V1Workbench-DtwjchsP.js → V1Workbench-BhVaVtUk.js} +3 -3
- package/dist/{V1Workbench-B9o_U8aO.cjs → V1Workbench-DGRxwIMF.cjs} +1 -1
- package/dist/{V2Workbench-etU2xPzD.js → V2Workbench-CVg6veIh.js} +1089 -1065
- package/dist/V2Workbench-mVCBFQCm.cjs +2 -0
- package/dist/{WorkbenchRuntime-CVhbTmsn.cjs → WorkbenchRuntime-IbMyR4-6.cjs} +1 -1
- package/dist/{WorkbenchRuntime-CypElf5G.js → WorkbenchRuntime-UqECVr8F.js} +14 -14
- package/dist/{arc-KzT0EnTt.js → arc-BtJ9ScW3.js} +1 -1
- package/dist/{arc-DZC23cud.cjs → arc-odRSb8Hk.cjs} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-RLP6nQvV.js → architectureDiagram-3BPJPVTR-eLD7kLk6.js} +3 -3
- package/dist/{architectureDiagram-3BPJPVTR-5k0jfbGR.cjs → architectureDiagram-3BPJPVTR-tPn0DsgW.cjs} +1 -1
- package/dist/{blockDiagram-GPEHLZMM-DceAnJoY.cjs → blockDiagram-GPEHLZMM-BLJo61me.cjs} +1 -1
- package/dist/{blockDiagram-GPEHLZMM-CoJLVb02.js → blockDiagram-GPEHLZMM-D-QYX9hi.js} +3 -3
- package/dist/{c4Diagram-AAUBKEIU-MzLmGCqL.cjs → c4Diagram-AAUBKEIU-B1dgO_85.cjs} +1 -1
- package/dist/{c4Diagram-AAUBKEIU-T-T4e0mB.js → c4Diagram-AAUBKEIU-SHzfWzY6.js} +2 -2
- package/dist/{channel-BiS2QhjX.js → channel-CD_1Fmi1.js} +1 -1
- package/dist/{channel-Cm9GGpp6.cjs → channel-CPeQOtCF.cjs} +1 -1
- package/dist/{chunk-2J33WTMH-Cz22cuO_.js → chunk-2J33WTMH-BLOEVPom.js} +1 -1
- package/dist/{chunk-2J33WTMH-DIajlLPT.cjs → chunk-2J33WTMH-DTjtD66_.cjs} +1 -1
- package/dist/{chunk-4BX2VUAB-DzYu-_uE.cjs → chunk-4BX2VUAB-Cj4NNWoG.cjs} +1 -1
- package/dist/{chunk-4BX2VUAB-BKscTaJM.js → chunk-4BX2VUAB-Ck5FHAUg.js} +1 -1
- package/dist/{chunk-55IACEB6-TLFlN5WW.cjs → chunk-55IACEB6-CB4aJuuP.cjs} +1 -1
- package/dist/{chunk-55IACEB6-DV_bsX8C.js → chunk-55IACEB6-Dgd81UWX.js} +1 -1
- package/dist/{chunk-727SXJPM-DAmczDb4.cjs → chunk-727SXJPM-BAGQPN8h.cjs} +1 -1
- package/dist/{chunk-727SXJPM-kB3sPt2T.js → chunk-727SXJPM-Cx_9J2if.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-j8WzCnfH.js → chunk-AQP2D5EJ-B5CqplDa.js} +3 -3
- package/dist/{chunk-AQP2D5EJ-DBd5RxkC.cjs → chunk-AQP2D5EJ-Dj7Mp8dH.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-Bo9GmTwy.js → chunk-FMBD7UC4-C3twYHux.js} +1 -1
- package/dist/{chunk-FMBD7UC4-Bk8fGNrN.cjs → chunk-FMBD7UC4-CVybjVmU.cjs} +1 -1
- package/dist/{chunk-ND2GUHAM-_2cK9e6-.js → chunk-ND2GUHAM-BGh7WuzQ.js} +1 -1
- package/dist/{chunk-ND2GUHAM-BlaLxZl9.cjs → chunk-ND2GUHAM-uHuZ0oV0.cjs} +1 -1
- package/dist/{chunk-QZHKN3VN-Cz700WiE.js → chunk-QZHKN3VN-CCGGX0cZ.js} +1 -1
- package/dist/{chunk-QZHKN3VN-BVopp-sz.cjs → chunk-QZHKN3VN-D-yKh7Qz.cjs} +1 -1
- package/dist/{classDiagram-4FO5ZUOK-C1_LKqgm.cjs → classDiagram-4FO5ZUOK-CXlMOxxW.cjs} +1 -1
- package/dist/{classDiagram-4FO5ZUOK-Duc1S1C3.js → classDiagram-4FO5ZUOK-TY1t93jX.js} +2 -2
- package/dist/{classDiagram-v2-Q7XG4LA2-C1_LKqgm.cjs → classDiagram-v2-Q7XG4LA2-CXlMOxxW.cjs} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-Cw_N2MCX.js → classDiagram-v2-Q7XG4LA2-Dlchb4l5.js} +2 -2
- package/dist/{cose-bilkent-S5V4N54A-BjpfMxaU.js → cose-bilkent-S5V4N54A-CaKZAb1c.js} +2 -2
- package/dist/{cose-bilkent-S5V4N54A-BKZqIzYg.cjs → cose-bilkent-S5V4N54A-DocPXnjr.cjs} +1 -1
- package/dist/{dagre-BM42HDAG-Fld12_1l.cjs → dagre-BM42HDAG-Cu1Cgzcq.cjs} +1 -1
- package/dist/{dagre-BM42HDAG-CQThzdC_.js → dagre-BM42HDAG-D18edB7Q.js} +1 -1
- package/dist/{diagram-2AECGRRQ-CIBRIVNG.js → diagram-2AECGRRQ-Bz_-HalL.js} +2 -2
- package/dist/{diagram-2AECGRRQ-BcTGhMXd.cjs → diagram-2AECGRRQ-DxxdxFz2.cjs} +1 -1
- package/dist/{diagram-5GNKFQAL-BkLpALBg.cjs → diagram-5GNKFQAL-BGzNkw4r.cjs} +1 -1
- package/dist/{diagram-5GNKFQAL-Zaw82XJh.js → diagram-5GNKFQAL-BrU2oLh4.js} +3 -3
- package/dist/{diagram-KO2AKTUF-D0_eoN0U.cjs → diagram-KO2AKTUF-DC4diwQl.cjs} +1 -1
- package/dist/{diagram-KO2AKTUF-B7xrMmCV.js → diagram-KO2AKTUF-DcL-IJzs.js} +2 -2
- package/dist/{diagram-LMA3HP47-DUjmGtpP.js → diagram-LMA3HP47-BfgHkni9.js} +2 -2
- package/dist/{diagram-LMA3HP47-DrKGcq4W.cjs → diagram-LMA3HP47-ChtDZ8K9.cjs} +1 -1
- package/dist/{diagram-OG6HWLK6-DMninHP8.js → diagram-OG6HWLK6-DXk824R6.js} +3 -3
- package/dist/{diagram-OG6HWLK6-pShu3fOg.cjs → diagram-OG6HWLK6-ji2nFOrw.cjs} +1 -1
- package/dist/{erDiagram-TEJ5UH35-DTfbMMC9.js → erDiagram-TEJ5UH35-B_7dUXYz.js} +4 -4
- package/dist/{erDiagram-TEJ5UH35-Dk-sYhep.cjs → erDiagram-TEJ5UH35-D-77VI32.cjs} +1 -1
- package/dist/{flowDiagram-I6XJVG4X-CLwM_Eg0.js → flowDiagram-I6XJVG4X-CPsnhZbH.js} +6 -6
- package/dist/{flowDiagram-I6XJVG4X-DppBTRsZ.cjs → flowDiagram-I6XJVG4X-DBqRWAyC.cjs} +1 -1
- package/dist/{ganttDiagram-6RSMTGT7-DIa85OV9.js → ganttDiagram-6RSMTGT7-3rGC8Uo1.js} +3 -3
- package/dist/{ganttDiagram-6RSMTGT7-EpoZQLvi.cjs → ganttDiagram-6RSMTGT7-Ccnxiw-b.cjs} +1 -1
- package/dist/{gitGraphDiagram-PVQCEYII-CsFY181r.cjs → gitGraphDiagram-PVQCEYII-DbdcW4vN.cjs} +1 -1
- package/dist/{gitGraphDiagram-PVQCEYII-BRLUWeD3.js → gitGraphDiagram-PVQCEYII-EYokPAn3.js} +3 -3
- package/dist/{index-DiKNNTFn.js → index-Cbs5yJpf.js} +6512 -6509
- package/dist/{index-BGQhNpL1.js → index-DXzf-tf2.js} +2 -2
- package/dist/{index-Cpei3C6T.cjs → index-QoK9i5Rz.cjs} +88 -88
- package/dist/{index-B5J1m72V.cjs → index-wB9JSlu7.cjs} +1 -1
- package/dist/{infoDiagram-5YYISTIA-BE2ny8B4.cjs → infoDiagram-5YYISTIA-_cWrjCOw.cjs} +1 -1
- package/dist/{infoDiagram-5YYISTIA-Cj29jNVn.js → infoDiagram-5YYISTIA-qicpay7S.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-DyRH5JNV.cjs → ishikawaDiagram-YF4QCWOH-B4G-RohY.cjs} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-CTLGQ4PN.js → ishikawaDiagram-YF4QCWOH-Bm5Aw14o.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-BR4Ab1xq.js → journeyDiagram-JHISSGLW-C0RdOpl5.js} +4 -4
- package/dist/{journeyDiagram-JHISSGLW-Byy1iuRk.cjs → journeyDiagram-JHISSGLW-kNcLtkXV.cjs} +1 -1
- package/dist/{kanban-definition-UN3LZRKU-Cstu6gJZ.js → kanban-definition-UN3LZRKU-Bv_s85ww.js} +2 -2
- package/dist/{kanban-definition-UN3LZRKU-z4mwtimn.cjs → kanban-definition-UN3LZRKU-DqAYIK3n.cjs} +1 -1
- package/dist/{linear-DHz5lgrw.js → linear-Bengdko_.js} +1 -1
- package/dist/{linear-CgTdlbkV.cjs → linear-CXFqoIa7.cjs} +1 -1
- package/dist/{mermaid.core-6Rboof0_.cjs → mermaid.core-CG2y5wCU.cjs} +3 -3
- package/dist/{mermaid.core-CS-i9hKc.js → mermaid.core-CnOPAFfg.js} +35 -35
- package/dist/{mindmap-definition-RKZ34NQL-DBvY1gCG.js → mindmap-definition-RKZ34NQL-BJLPAZuX.js} +3 -3
- package/dist/{mindmap-definition-RKZ34NQL-CQxvbyEf.cjs → mindmap-definition-RKZ34NQL-BvY9qHcE.cjs} +1 -1
- package/dist/{pieDiagram-4H26LBE5-BJTvIeTN.cjs → pieDiagram-4H26LBE5-CSbN_wjE.cjs} +1 -1
- package/dist/{pieDiagram-4H26LBE5-BbulgKyH.js → pieDiagram-4H26LBE5-CcJEvZZt.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BGu3SyWz.cjs → quadrantDiagram-W4KKPZXB-BBdLM54v.cjs} +1 -1
- package/dist/{quadrantDiagram-W4KKPZXB-_rv2Qg71.js → quadrantDiagram-W4KKPZXB-BIyNbY4N.js} +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-CpZeNXB3.js → requirementDiagram-4Y6WPE33-BYsQttZb.js} +3 -3
- package/dist/{requirementDiagram-4Y6WPE33-Bm4ViepU.cjs → requirementDiagram-4Y6WPE33-mXNAovxI.cjs} +1 -1
- package/dist/{sankeyDiagram-5OEKKPKP-CZvgmmBP.js → sankeyDiagram-5OEKKPKP-CMRY8wMz.js} +1 -1
- package/dist/{sankeyDiagram-5OEKKPKP-BLxCUGiP.cjs → sankeyDiagram-5OEKKPKP-DP3g_6ld.cjs} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-DwgEjoON.js → sequenceDiagram-3UESZ5HK-Bwe1SboF.js} +3 -3
- package/dist/{sequenceDiagram-3UESZ5HK-BBDEZFwB.cjs → sequenceDiagram-3UESZ5HK-CAAgp5_i.cjs} +1 -1
- package/dist/{stateDiagram-AJRCARHV-BqcG_ChJ.cjs → stateDiagram-AJRCARHV-COAKXOCW.cjs} +1 -1
- package/dist/{stateDiagram-AJRCARHV-D3CASY0s.js → stateDiagram-AJRCARHV-CUq5pvvV.js} +2 -2
- package/dist/{stateDiagram-v2-BHNVJYJU-CC1TA5cE.cjs → stateDiagram-v2-BHNVJYJU-Cs_7k3Sj.cjs} +1 -1
- package/dist/{stateDiagram-v2-BHNVJYJU-vbr36pvU.js → stateDiagram-v2-BHNVJYJU-kAoUKFd8.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-Bm1d-AzB.js → timeline-definition-PNZ67QCA-BUrLHMuo.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-BVkKzUPo.cjs → timeline-definition-PNZ67QCA-BgfG-_Il.cjs} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-yGUCdugP.js → vennDiagram-CIIHVFJN-BziPziSM.js} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-4OYsnAtq.cjs → vennDiagram-CIIHVFJN-DmbabiTq.cjs} +1 -1
- package/dist/wandox.cjs +1 -1
- package/dist/wandox.css +1 -1
- package/dist/wandox.js +1 -1
- package/dist/wandox.umd.js +623 -623
- package/dist/{wardleyDiagram-YWT4CUSO-DmASfXP7.js → wardleyDiagram-YWT4CUSO-DI0XC7om.js} +2 -2
- package/dist/{wardleyDiagram-YWT4CUSO-DAJJWPai.cjs → wardleyDiagram-YWT4CUSO-DyCdvt8e.cjs} +1 -1
- package/dist/{xychartDiagram-2RQKCTM6-C8BTMQrb.js → xychartDiagram-2RQKCTM6-Bit1w0tP.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-BKdlhCMk.cjs → xychartDiagram-2RQKCTM6-C4NzM3aO.cjs} +1 -1
- package/package.json +1 -1
- package/dist/V2Workbench-Bh5bDBlV.cjs +0 -2
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
import { dt as s, af as
|
|
2
|
-
import { o as
|
|
3
|
-
import { Drawer as
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
import { dt as s, af as Ge, d0 as e, a_ as ps, ai as La, a$ as ga, aR as xs, bL as _s, b0 as ln, d_ as bs, K as os, aa as rn, a9 as ja, d6 as cs, Q as dn, P as un, a6 as mn, a4 as hn, T as pn, da as fs, aE as va, dG as k, ci as xn, S as _n, J as ka, c_ as bn, cO as fn, dO as wn, cd as yn, cH as gn, cG as jn, as as vn, ap as kn, o as Nn, m as Cn, v as Sn, b1 as ws, b2 as Rn, bC as Na, aO as $n, b3 as Ca, n as An, ar as In, A as En, aq as Pn, bz as Ln, bB as Mn, i as ia, aA as Tn, y as Fn, cI as On, cJ as Dn, b4 as Vn, aZ as Bn, b5 as ls, b6 as zn, b7 as qn, b8 as Wn, b9 as Hn, ek as Un } from "./index-Cbs5yJpf.js";
|
|
2
|
+
import { o as Kn, l as Gn, A as Qn, m as ra, n as Sa, q as Yn, h as ys, R as Ra, c as gs, a as js, d as vs, e as is, Q as Zn, i as Jn, f as Xn, u as et, j as at, p as rs, b as st, S as nt } from "./WorkbenchRuntime-UqECVr8F.js";
|
|
3
|
+
import { Drawer as tt, Divider as ot } from "./index-DXzf-tf2.js";
|
|
4
|
+
var ct = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm0 400H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zM464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm0 400H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z" } }] }, name: "appstore", theme: "filled" };
|
|
5
|
+
function $a() {
|
|
6
|
+
return $a = Object.assign ? Object.assign.bind() : function(t) {
|
|
7
7
|
for (var l = 1; l < arguments.length; l++) {
|
|
8
8
|
var r = arguments[l];
|
|
9
|
-
for (var
|
|
10
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
9
|
+
for (var u in r)
|
|
10
|
+
Object.prototype.hasOwnProperty.call(r, u) && (t[u] = r[u]);
|
|
11
11
|
}
|
|
12
|
-
return
|
|
13
|
-
},
|
|
12
|
+
return t;
|
|
13
|
+
}, $a.apply(this, arguments);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const lt = (t, l) => /* @__PURE__ */ s.createElement(Ge, $a({}, t, {
|
|
16
16
|
ref: l,
|
|
17
|
-
icon:
|
|
18
|
-
})),
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
return
|
|
17
|
+
icon: ct
|
|
18
|
+
})), it = /* @__PURE__ */ s.forwardRef(lt);
|
|
19
|
+
var rt = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z" } }] }, name: "caret-left", theme: "filled" };
|
|
20
|
+
function Aa() {
|
|
21
|
+
return Aa = Object.assign ? Object.assign.bind() : function(t) {
|
|
22
22
|
for (var l = 1; l < arguments.length; l++) {
|
|
23
23
|
var r = arguments[l];
|
|
24
|
-
for (var
|
|
25
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
24
|
+
for (var u in r)
|
|
25
|
+
Object.prototype.hasOwnProperty.call(r, u) && (t[u] = r[u]);
|
|
26
26
|
}
|
|
27
|
-
return
|
|
28
|
-
},
|
|
27
|
+
return t;
|
|
28
|
+
}, Aa.apply(this, arguments);
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const dt = (t, l) => /* @__PURE__ */ s.createElement(Ge, Aa({}, t, {
|
|
31
31
|
ref: l,
|
|
32
|
-
icon:
|
|
33
|
-
})),
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
return
|
|
32
|
+
icon: rt
|
|
33
|
+
})), ut = /* @__PURE__ */ s.forwardRef(dt);
|
|
34
|
+
var mt = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z" } }] }, name: "caret-right", theme: "filled" };
|
|
35
|
+
function Ia() {
|
|
36
|
+
return Ia = Object.assign ? Object.assign.bind() : function(t) {
|
|
37
37
|
for (var l = 1; l < arguments.length; l++) {
|
|
38
38
|
var r = arguments[l];
|
|
39
|
-
for (var
|
|
40
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
39
|
+
for (var u in r)
|
|
40
|
+
Object.prototype.hasOwnProperty.call(r, u) && (t[u] = r[u]);
|
|
41
41
|
}
|
|
42
|
-
return
|
|
43
|
-
},
|
|
42
|
+
return t;
|
|
43
|
+
}, Ia.apply(this, arguments);
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const ht = (t, l) => /* @__PURE__ */ s.createElement(Ge, Ia({}, t, {
|
|
46
46
|
ref: l,
|
|
47
|
-
icon:
|
|
48
|
-
})),
|
|
49
|
-
var
|
|
50
|
-
function
|
|
51
|
-
return
|
|
47
|
+
icon: mt
|
|
48
|
+
})), pt = /* @__PURE__ */ s.forwardRef(ht);
|
|
49
|
+
var xt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z" } }] }, name: "sliders", theme: "outlined" };
|
|
50
|
+
function Ea() {
|
|
51
|
+
return Ea = Object.assign ? Object.assign.bind() : function(t) {
|
|
52
52
|
for (var l = 1; l < arguments.length; l++) {
|
|
53
53
|
var r = arguments[l];
|
|
54
|
-
for (var
|
|
55
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
54
|
+
for (var u in r)
|
|
55
|
+
Object.prototype.hasOwnProperty.call(r, u) && (t[u] = r[u]);
|
|
56
56
|
}
|
|
57
|
-
return
|
|
58
|
-
},
|
|
57
|
+
return t;
|
|
58
|
+
}, Ea.apply(this, arguments);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const _t = (t, l) => /* @__PURE__ */ s.createElement(Ge, Ea({}, t, {
|
|
61
61
|
ref: l,
|
|
62
|
-
icon:
|
|
63
|
-
})),
|
|
64
|
-
var
|
|
65
|
-
function
|
|
66
|
-
return
|
|
62
|
+
icon: xt
|
|
63
|
+
})), ks = /* @__PURE__ */ s.forwardRef(_t);
|
|
64
|
+
var bt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "unordered-list", theme: "outlined" };
|
|
65
|
+
function Pa() {
|
|
66
|
+
return Pa = Object.assign ? Object.assign.bind() : function(t) {
|
|
67
67
|
for (var l = 1; l < arguments.length; l++) {
|
|
68
68
|
var r = arguments[l];
|
|
69
|
-
for (var
|
|
70
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
69
|
+
for (var u in r)
|
|
70
|
+
Object.prototype.hasOwnProperty.call(r, u) && (t[u] = r[u]);
|
|
71
71
|
}
|
|
72
|
-
return
|
|
73
|
-
},
|
|
72
|
+
return t;
|
|
73
|
+
}, Pa.apply(this, arguments);
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const ft = (t, l) => /* @__PURE__ */ s.createElement(Ge, Pa({}, t, {
|
|
76
76
|
ref: l,
|
|
77
|
-
icon:
|
|
78
|
-
})),
|
|
79
|
-
function
|
|
77
|
+
icon: bt
|
|
78
|
+
})), wt = /* @__PURE__ */ s.forwardRef(ft);
|
|
79
|
+
function Ns(t) {
|
|
80
80
|
return {
|
|
81
81
|
category: null,
|
|
82
|
-
description:
|
|
82
|
+
description: t.desc,
|
|
83
83
|
domain: "",
|
|
84
84
|
id: 0,
|
|
85
|
-
name:
|
|
86
|
-
playbook_id:
|
|
85
|
+
name: t.title,
|
|
86
|
+
playbook_id: t.playbook_id,
|
|
87
87
|
scope: "",
|
|
88
88
|
status: "",
|
|
89
89
|
sub_category: null,
|
|
90
90
|
tags: null,
|
|
91
91
|
type: "",
|
|
92
92
|
version: "",
|
|
93
|
-
video_url:
|
|
94
|
-
video_duration:
|
|
95
|
-
view_count:
|
|
93
|
+
video_url: t.video_url,
|
|
94
|
+
video_duration: t.video_duration,
|
|
95
|
+
view_count: t.view_count
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (!
|
|
100
|
-
const l = Math.floor(
|
|
98
|
+
function Cs(t) {
|
|
99
|
+
if (!t || t <= 0) return "0:00";
|
|
100
|
+
const l = Math.floor(t / 60), r = String(Math.floor(t % 60)).padStart(2, "0");
|
|
101
101
|
return `${l}:${r}`;
|
|
102
102
|
}
|
|
103
|
-
const
|
|
103
|
+
const wa = "__all__", ds = "__my__", ya = "__library_all__", yt = "__library__:", gt = [
|
|
104
104
|
{ key: "all", label: "全部场景" },
|
|
105
105
|
{ key: "my", label: "我的场景" },
|
|
106
106
|
{ key: "map", label: "使用地图" }
|
|
107
107
|
];
|
|
108
|
-
function
|
|
109
|
-
return
|
|
108
|
+
function jt(t) {
|
|
109
|
+
return t === "map" ? "搜索当前地图下的场景" : t === "my" ? "搜索我的场景" : "搜索全部场景";
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
open:
|
|
111
|
+
function vt({
|
|
112
|
+
open: t,
|
|
113
113
|
source: l,
|
|
114
114
|
categories: r,
|
|
115
|
-
categoryKey:
|
|
115
|
+
categoryKey: u,
|
|
116
116
|
search: _,
|
|
117
|
-
cards:
|
|
117
|
+
cards: j,
|
|
118
118
|
executing: p,
|
|
119
|
-
loadingPlaybookId:
|
|
120
|
-
onClose:
|
|
119
|
+
loadingPlaybookId: f,
|
|
120
|
+
onClose: R,
|
|
121
121
|
onSourceChange: F,
|
|
122
122
|
onCategoryChange: Y,
|
|
123
|
-
onSearchChange:
|
|
124
|
-
onSelectScene:
|
|
123
|
+
onSearchChange: z,
|
|
124
|
+
onSelectScene: me
|
|
125
125
|
}) {
|
|
126
|
-
const [
|
|
127
|
-
() =>
|
|
128
|
-
[
|
|
129
|
-
),
|
|
130
|
-
h.stopPropagation(),
|
|
126
|
+
const [$, q] = s.useState(null), L = s.useMemo(
|
|
127
|
+
() => $ ? Ns($) : null,
|
|
128
|
+
[$]
|
|
129
|
+
), S = s.useCallback((h, O) => {
|
|
130
|
+
h.stopPropagation(), q(O);
|
|
131
131
|
}, []);
|
|
132
132
|
return /* @__PURE__ */ e.jsxs(
|
|
133
|
-
|
|
133
|
+
tt,
|
|
134
134
|
{
|
|
135
|
-
open:
|
|
136
|
-
onClose:
|
|
135
|
+
open: t,
|
|
136
|
+
onClose: R,
|
|
137
137
|
placement: "bottom",
|
|
138
138
|
height: "min(82vh, 780px)",
|
|
139
139
|
destroyOnClose: !1,
|
|
@@ -153,7 +153,7 @@ function fo({
|
|
|
153
153
|
{
|
|
154
154
|
className: "wandox-console-chat__drawer-tabs",
|
|
155
155
|
"aria-label": "场景来源",
|
|
156
|
-
children:
|
|
156
|
+
children: gt.map((h) => /* @__PURE__ */ e.jsx(
|
|
157
157
|
"button",
|
|
158
158
|
{
|
|
159
159
|
type: "button",
|
|
@@ -170,9 +170,9 @@ function fo({
|
|
|
170
170
|
{
|
|
171
171
|
type: "button",
|
|
172
172
|
className: "wandox-console-chat__drawer-close",
|
|
173
|
-
onClick:
|
|
173
|
+
onClick: R,
|
|
174
174
|
"aria-label": "关闭",
|
|
175
|
-
children: /* @__PURE__ */ e.jsx(
|
|
175
|
+
children: /* @__PURE__ */ e.jsx(ps, {})
|
|
176
176
|
}
|
|
177
177
|
)
|
|
178
178
|
] }),
|
|
@@ -180,7 +180,7 @@ function fo({
|
|
|
180
180
|
l !== "my" && /* @__PURE__ */ e.jsxs("aside", { className: "wandox-console-chat__drawer-cats", children: [
|
|
181
181
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-catslabel", children: "场景分类" }),
|
|
182
182
|
r.map((h) => {
|
|
183
|
-
const O = h.key ===
|
|
183
|
+
const O = h.key === u;
|
|
184
184
|
return /* @__PURE__ */ e.jsxs(
|
|
185
185
|
"button",
|
|
186
186
|
{
|
|
@@ -198,26 +198,26 @@ function fo({
|
|
|
198
198
|
] }),
|
|
199
199
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__drawer-body", children: [
|
|
200
200
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-toolbar", children: /* @__PURE__ */ e.jsx(
|
|
201
|
-
|
|
201
|
+
La,
|
|
202
202
|
{
|
|
203
203
|
allowClear: !0,
|
|
204
|
-
prefix: /* @__PURE__ */ e.jsx(
|
|
205
|
-
placeholder:
|
|
204
|
+
prefix: /* @__PURE__ */ e.jsx(ga, {}),
|
|
205
|
+
placeholder: jt(l),
|
|
206
206
|
value: _,
|
|
207
|
-
onChange: (h) =>
|
|
207
|
+
onChange: (h) => z(h.target.value)
|
|
208
208
|
}
|
|
209
209
|
) }),
|
|
210
|
-
|
|
211
|
-
const O =
|
|
210
|
+
j.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-empty", children: _ ? "没有匹配的场景" : "暂无可用场景" }) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes", children: j.map((h) => {
|
|
211
|
+
const O = f === h.playbook_id;
|
|
212
212
|
return /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene-wrap", children: [
|
|
213
213
|
/* @__PURE__ */ e.jsx(
|
|
214
214
|
"button",
|
|
215
215
|
{
|
|
216
216
|
type: "button",
|
|
217
217
|
className: "wandox-console-scene",
|
|
218
|
-
disabled: p || !!
|
|
218
|
+
disabled: p || !!f,
|
|
219
219
|
"aria-busy": O,
|
|
220
|
-
onClick: () => void
|
|
220
|
+
onClick: () => void me(h),
|
|
221
221
|
children: /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene__body", children: [
|
|
222
222
|
/* @__PURE__ */ e.jsx("strong", { title: h.title, children: h.title }),
|
|
223
223
|
h.desc && /* @__PURE__ */ e.jsx(
|
|
@@ -238,10 +238,10 @@ function fo({
|
|
|
238
238
|
type: "button",
|
|
239
239
|
className: "wandox-console-scene__video",
|
|
240
240
|
"aria-label": `播放${h.title}演示视频`,
|
|
241
|
-
onClick: (
|
|
241
|
+
onClick: (he) => S(he, h),
|
|
242
242
|
children: [
|
|
243
243
|
"▶ ",
|
|
244
|
-
|
|
244
|
+
Cs(h.video_duration),
|
|
245
245
|
" 演示"
|
|
246
246
|
]
|
|
247
247
|
}
|
|
@@ -252,55 +252,55 @@ function fo({
|
|
|
252
252
|
] })
|
|
253
253
|
] }),
|
|
254
254
|
/* @__PURE__ */ e.jsx(
|
|
255
|
-
|
|
255
|
+
xs,
|
|
256
256
|
{
|
|
257
257
|
playbook: L,
|
|
258
|
-
onClose: () =>
|
|
258
|
+
onClose: () => q(null)
|
|
259
259
|
}
|
|
260
260
|
)
|
|
261
261
|
]
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
|
-
const
|
|
266
|
-
const { onError: l } =
|
|
265
|
+
const kt = (t) => {
|
|
266
|
+
const { onError: l } = t;
|
|
267
267
|
l == null || l(new Error("该场景暂不支持文件上传"));
|
|
268
268
|
};
|
|
269
|
-
function
|
|
270
|
-
field:
|
|
269
|
+
function Ss({
|
|
270
|
+
field: t,
|
|
271
271
|
value: l,
|
|
272
272
|
uploading: r,
|
|
273
|
-
fileNameMap:
|
|
273
|
+
fileNameMap: u,
|
|
274
274
|
getOptionState: _,
|
|
275
|
-
onChange:
|
|
275
|
+
onChange: j,
|
|
276
276
|
onUpload: p
|
|
277
277
|
}) {
|
|
278
|
-
const
|
|
278
|
+
const f = Kn(t.type), R = Gn(t) === "file", F = p ?? ((Y, z) => kt);
|
|
279
279
|
return /* @__PURE__ */ e.jsxs(
|
|
280
280
|
"div",
|
|
281
281
|
{
|
|
282
|
-
className: `wandox-console-field${
|
|
282
|
+
className: `wandox-console-field${R ? " wandox-console-field--file" : ""}`,
|
|
283
283
|
children: [
|
|
284
|
-
/* @__PURE__ */ e.jsxs("label", { htmlFor: `wc-param-${
|
|
285
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-field__label-text", children:
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
/* @__PURE__ */ e.jsxs("label", { htmlFor: `wc-param-${t.name}`, children: [
|
|
285
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-field__label-text", children: t.label || t.name }),
|
|
286
|
+
t.description || t.hint ? /* @__PURE__ */ e.jsx(_s, { title: t.description || t.hint, children: /* @__PURE__ */ e.jsx(
|
|
287
|
+
ln,
|
|
288
288
|
{
|
|
289
|
-
"aria-label": `${
|
|
289
|
+
"aria-label": `${t.label || t.name}说明`
|
|
290
290
|
}
|
|
291
291
|
) }) : null,
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
t.required && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-field__required", children: "必填" }),
|
|
293
|
+
f && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-field__required", children: "多值" })
|
|
294
294
|
] }),
|
|
295
295
|
/* @__PURE__ */ e.jsx(
|
|
296
|
-
|
|
296
|
+
Qn,
|
|
297
297
|
{
|
|
298
|
-
field:
|
|
298
|
+
field: t,
|
|
299
299
|
value: l,
|
|
300
300
|
uploading: r,
|
|
301
|
-
fileNameMap:
|
|
301
|
+
fileNameMap: u,
|
|
302
302
|
getOptionState: _,
|
|
303
|
-
onChange:
|
|
303
|
+
onChange: j,
|
|
304
304
|
onUpload: F,
|
|
305
305
|
onDownloadTemplate: (Y) => window.open(Y.path, "_blank", "noopener,noreferrer")
|
|
306
306
|
}
|
|
@@ -309,10 +309,10 @@ function js({
|
|
|
309
309
|
}
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
const l = Array.isArray(
|
|
314
|
-
return [...l, ...
|
|
315
|
-
const p =
|
|
312
|
+
function Nt(t) {
|
|
313
|
+
const l = Array.isArray(t.actions) ? t.actions : [], r = t.ui_payload, u = Array.isArray(r == null ? void 0 : r.actions) ? r.actions : [];
|
|
314
|
+
return [...l, ...u].map((j) => {
|
|
315
|
+
const p = j ?? {};
|
|
316
316
|
return {
|
|
317
317
|
label: p.display_name || p.label || "执行",
|
|
318
318
|
action_id: p.action_id,
|
|
@@ -334,70 +334,70 @@ function yo(o) {
|
|
|
334
334
|
};
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
if (Array.isArray(
|
|
339
|
-
const l =
|
|
337
|
+
function Ct(t) {
|
|
338
|
+
if (Array.isArray(t)) return t;
|
|
339
|
+
const l = t;
|
|
340
340
|
return Array.isArray(l == null ? void 0 : l.user_playbooks) ? l.user_playbooks : [];
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
agentId:
|
|
342
|
+
function St({
|
|
343
|
+
agentId: t,
|
|
344
344
|
agentName: l,
|
|
345
345
|
playbookId: r,
|
|
346
|
-
playbookParams:
|
|
346
|
+
playbookParams: u,
|
|
347
347
|
initialMessage: _,
|
|
348
|
-
initialAttachments:
|
|
348
|
+
initialAttachments: j,
|
|
349
349
|
useMapCards: p = [],
|
|
350
|
-
useMapCategories:
|
|
351
|
-
playbooks:
|
|
350
|
+
useMapCategories: f = [],
|
|
351
|
+
playbooks: R = [],
|
|
352
352
|
userPlaybooks: F = [],
|
|
353
353
|
agents: Y = [],
|
|
354
|
-
onChangeAgent:
|
|
355
|
-
onBack:
|
|
356
|
-
onSelectScene:
|
|
357
|
-
onReady:
|
|
354
|
+
onChangeAgent: z,
|
|
355
|
+
onBack: me,
|
|
356
|
+
onSelectScene: $,
|
|
357
|
+
onReady: q
|
|
358
358
|
}) {
|
|
359
|
-
const L = localStorage.getItem("sso_token") || "",
|
|
359
|
+
const L = localStorage.getItem("sso_token") || "", S = localStorage.getItem("sso_domain") || "maiduo", h = localStorage.getItem("sso_company") || "", O = s.useRef(null), he = s.useRef(!1), [D, E] = s.useState(!1), [W, le] = s.useState(""), [ie, H] = s.useState(""), [V, U] = s.useState("map"), [Z, pe] = s.useState(wa), [A, B] = s.useState(null), Ne = s.useRef(null), fe = s.useRef(null), [xe, ve] = s.useState(!1), [we, Ae] = s.useState([]), [Ie, Ce] = s.useState("");
|
|
360
360
|
s.useEffect(() => {
|
|
361
361
|
if (!A || D) return;
|
|
362
362
|
const a = setTimeout(() => {
|
|
363
363
|
var n;
|
|
364
|
-
(n =
|
|
364
|
+
(n = Ne.current) == null || n.focus();
|
|
365
365
|
}, 120);
|
|
366
366
|
return () => clearTimeout(a);
|
|
367
367
|
}, [A, D]), s.useEffect(() => {
|
|
368
368
|
if (!A || D) return;
|
|
369
369
|
const a = (n) => {
|
|
370
|
-
const c =
|
|
370
|
+
const c = fe.current, i = n.target;
|
|
371
371
|
!c || !(i instanceof Node) || c.contains(i) || i instanceof Element && i.closest(
|
|
372
372
|
".ant-select-dropdown, .ant-picker-dropdown, .ant-tooltip, .ant-dropdown, .ant-popover, .ant-modal-wrap, .ant-drawer-content-wrapper, .ant-message, .ant-notification"
|
|
373
|
-
) || (B(null),
|
|
373
|
+
) || (B(null), K([]), X({}));
|
|
374
374
|
};
|
|
375
375
|
return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
|
|
376
376
|
}, [A, D]);
|
|
377
|
-
const [J, G] = s.useState([]), [
|
|
377
|
+
const [J, K] = s.useState([]), [G, X] = s.useState({}), [se, ye] = s.useState({}), [Ee, b] = s.useState({}), I = bs(
|
|
378
378
|
J,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
),
|
|
382
|
-
() =>
|
|
383
|
-
(a) => a.required &&
|
|
379
|
+
G,
|
|
380
|
+
X
|
|
381
|
+
), oe = s.useMemo(
|
|
382
|
+
() => ra(J, G).filter(
|
|
383
|
+
(a) => a.required && Sa(G[a.name])
|
|
384
384
|
),
|
|
385
|
-
[J,
|
|
386
|
-
), [
|
|
385
|
+
[J, G]
|
|
386
|
+
), [v, Te] = s.useState("chat"), [re, Fe] = s.useState([]), [ee, Se] = s.useState(null), [ne, Oe] = s.useState("results"), [da, Qe] = s.useState(!1), [Pe, Re] = s.useState([]), [de, o] = s.useState(!1), [w, N] = s.useState([]), [g, C] = s.useState([]), [ue, Le] = s.useState({}), [ae, M] = s.useState(!1), [Q, De] = s.useState(null), [te, ke] = s.useState(void 0), [Ye, Ze] = s.useState(!1), [Rs, Ma] = s.useState(!1);
|
|
387
387
|
s.useEffect(() => {
|
|
388
|
-
|
|
388
|
+
q == null || q({
|
|
389
389
|
showInspectionResults: (a) => {
|
|
390
|
-
|
|
390
|
+
Te("robot"), Oe("results"), Se(a || null);
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
|
-
}, [
|
|
394
|
-
const [
|
|
393
|
+
}, [q]);
|
|
394
|
+
const [Ve, $s] = s.useState([]), [Be, $e] = s.useState(!1), [Je, As] = s.useState(void 0), [Ta, Fa] = s.useState([]), [ua, Oa] = s.useState(""), [ma, Is] = s.useState(
|
|
395
395
|
"map"
|
|
396
|
-
), [
|
|
397
|
-
|
|
398
|
-
), [
|
|
396
|
+
), [Es, ze] = s.useState(void 0), Xe = s.useRef(0), qe = s.useRef(0), [ea, Da] = s.useState(
|
|
397
|
+
os
|
|
398
|
+
), [ha, Va] = s.useState({}), [aa, Ba] = s.useState(
|
|
399
399
|
() => /* @__PURE__ */ new Set()
|
|
400
|
-
),
|
|
400
|
+
), pa = s.useCallback(
|
|
401
401
|
(a, n, c) => ({
|
|
402
402
|
key: `${n}-${a.playbook_id}`,
|
|
403
403
|
title: a.name || "未命名场景",
|
|
@@ -412,53 +412,53 @@ function jo({
|
|
|
412
412
|
view_count: a.view_count
|
|
413
413
|
}),
|
|
414
414
|
[]
|
|
415
|
-
),
|
|
415
|
+
), We = s.useMemo(() => {
|
|
416
416
|
const a = F.map(
|
|
417
|
-
(m) =>
|
|
417
|
+
(m) => pa(m, ds, "我的场景")
|
|
418
418
|
), n = /* @__PURE__ */ new Map();
|
|
419
|
-
for (const m of
|
|
420
|
-
const
|
|
421
|
-
|
|
419
|
+
for (const m of R) {
|
|
420
|
+
const y = m.category_name || m.category || m.type || "默认场景", x = `${yt}${y}`, P = n.get(x) || [];
|
|
421
|
+
P.push(pa(m, x, y)), n.set(x, P);
|
|
422
422
|
}
|
|
423
423
|
const c = Array.from(n.values()).flat(), i = [
|
|
424
424
|
{
|
|
425
|
-
key:
|
|
425
|
+
key: ya,
|
|
426
426
|
name: "全部场景",
|
|
427
427
|
count: c.length,
|
|
428
428
|
cards: c
|
|
429
429
|
},
|
|
430
|
-
...Array.from(n, ([m,
|
|
431
|
-
var
|
|
430
|
+
...Array.from(n, ([m, y]) => {
|
|
431
|
+
var x;
|
|
432
432
|
return {
|
|
433
433
|
key: m,
|
|
434
|
-
name: ((
|
|
435
|
-
count:
|
|
436
|
-
cards:
|
|
434
|
+
name: ((x = y[0]) == null ? void 0 : x.reason) || "默认场景",
|
|
435
|
+
count: y.length,
|
|
436
|
+
cards: y
|
|
437
437
|
};
|
|
438
438
|
})
|
|
439
|
-
],
|
|
439
|
+
], d = [
|
|
440
440
|
{
|
|
441
|
-
key:
|
|
441
|
+
key: wa,
|
|
442
442
|
name: "全部场景",
|
|
443
443
|
count: p.length,
|
|
444
444
|
cards: p
|
|
445
445
|
},
|
|
446
|
-
...
|
|
446
|
+
...f.map((m) => ({
|
|
447
447
|
key: m.key,
|
|
448
448
|
name: m.name,
|
|
449
449
|
count: m.count,
|
|
450
|
-
cards: p.filter((
|
|
450
|
+
cards: p.filter((y) => y.categoryKey === m.key)
|
|
451
451
|
}))
|
|
452
452
|
];
|
|
453
|
-
return { allCategories: i, mapCategories:
|
|
453
|
+
return { allCategories: i, mapCategories: d, myCards: a };
|
|
454
454
|
}, [
|
|
455
455
|
l,
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
R,
|
|
457
|
+
pa,
|
|
458
458
|
p,
|
|
459
|
-
|
|
459
|
+
f,
|
|
460
460
|
F
|
|
461
|
-
]),
|
|
461
|
+
]), xa = s.useMemo(() => V === "all" ? We.allCategories : V === "map" ? We.mapCategories : [], [We, V]), sa = s.useMemo(
|
|
462
462
|
() => p.map(
|
|
463
463
|
(a) => ({
|
|
464
464
|
category: null,
|
|
@@ -481,18 +481,18 @@ function jo({
|
|
|
481
481
|
})
|
|
482
482
|
),
|
|
483
483
|
[p]
|
|
484
|
-
),
|
|
484
|
+
), Ps = s.useMemo(() => {
|
|
485
485
|
const a = /* @__PURE__ */ new Map();
|
|
486
486
|
for (const n of [
|
|
487
|
-
|
|
487
|
+
...R,
|
|
488
488
|
...F,
|
|
489
|
-
...
|
|
489
|
+
...sa
|
|
490
490
|
])
|
|
491
491
|
n.playbook_id && a.set(n.playbook_id, n);
|
|
492
492
|
return Array.from(a.values());
|
|
493
|
-
}, [
|
|
493
|
+
}, [R, F, sa]), Ls = s.useMemo(() => {
|
|
494
494
|
const a = /* @__PURE__ */ new Map();
|
|
495
|
-
for (const n of
|
|
495
|
+
for (const n of R) {
|
|
496
496
|
const c = n.category_name || n.category || n.type || "默认场景", i = a.get(c) || [];
|
|
497
497
|
i.push(n), a.set(c, i);
|
|
498
498
|
}
|
|
@@ -504,141 +504,141 @@ function jo({
|
|
|
504
504
|
playbooks: c
|
|
505
505
|
}))
|
|
506
506
|
];
|
|
507
|
-
}, [
|
|
507
|
+
}, [R]), Ms = s.useMemo(() => {
|
|
508
508
|
const a = new Map(
|
|
509
|
-
|
|
509
|
+
sa.map((n) => [
|
|
510
510
|
n.playbook_id,
|
|
511
511
|
n
|
|
512
512
|
])
|
|
513
513
|
);
|
|
514
|
-
return
|
|
514
|
+
return f.map((n) => ({
|
|
515
515
|
key: `map:${n.key}`,
|
|
516
516
|
label: n.name,
|
|
517
517
|
playbooks: p.filter((c) => c.categoryKey === n.key).map((c) => a.get(c.playbook_id)).filter((c) => !!c)
|
|
518
518
|
}));
|
|
519
|
-
}, [p,
|
|
519
|
+
}, [p, f, sa]), Ts = ma === "map" ? Ms : Ls, Fs = s.useMemo(() => {
|
|
520
520
|
var c;
|
|
521
|
-
const a =
|
|
521
|
+
const a = ie.trim().toLowerCase(), n = V === "my" ? We.myCards : ((c = xa.find((i) => i.key === Z)) == null ? void 0 : c.cards) || [];
|
|
522
522
|
return a ? n.filter(
|
|
523
523
|
(i) => i.title.toLowerCase().includes(a) || i.desc.toLowerCase().includes(a)
|
|
524
524
|
) : n;
|
|
525
525
|
}, [
|
|
526
|
-
|
|
526
|
+
xa,
|
|
527
527
|
Z,
|
|
528
|
-
|
|
528
|
+
We.myCards,
|
|
529
529
|
V,
|
|
530
|
-
|
|
531
|
-
]),
|
|
530
|
+
ie
|
|
531
|
+
]), Os = s.useCallback((a) => {
|
|
532
532
|
const n = Array.isArray(a) ? a : [];
|
|
533
|
-
|
|
534
|
-
}, []),
|
|
535
|
-
() => Y.find((a) => a.id ===
|
|
536
|
-
[Y,
|
|
537
|
-
), { messageData:
|
|
538
|
-
activeAgent:
|
|
533
|
+
$s(n), $e(n.length > 0);
|
|
534
|
+
}, []), _e = s.useMemo(
|
|
535
|
+
() => Y.find((a) => a.id === t),
|
|
536
|
+
[Y, t]
|
|
537
|
+
), { messageData: Ds, executing: T, stopping: Vs, actions: Bs } = Yn({
|
|
538
|
+
activeAgent: t,
|
|
539
539
|
ssoToken: L,
|
|
540
|
-
ssoDomain:
|
|
540
|
+
ssoDomain: S,
|
|
541
541
|
ssoCompany: h,
|
|
542
|
-
onRecommendationsUpdate:
|
|
542
|
+
onRecommendationsUpdate: Os
|
|
543
543
|
}), {
|
|
544
|
-
sendMessage:
|
|
545
|
-
executePlaybook:
|
|
546
|
-
respondToProposal:
|
|
547
|
-
stopCurrent:
|
|
548
|
-
retrigger:
|
|
549
|
-
} =
|
|
550
|
-
messages:
|
|
551
|
-
messagesTotal:
|
|
552
|
-
loading:
|
|
553
|
-
loadMessages:
|
|
554
|
-
loadMoreMessages:
|
|
555
|
-
} =
|
|
556
|
-
for (let a =
|
|
557
|
-
if (
|
|
558
|
-
}, [
|
|
559
|
-
if (!
|
|
560
|
-
|
|
544
|
+
sendMessage: na,
|
|
545
|
+
executePlaybook: za,
|
|
546
|
+
respondToProposal: qa,
|
|
547
|
+
stopCurrent: zs,
|
|
548
|
+
retrigger: Wa
|
|
549
|
+
} = Bs, {
|
|
550
|
+
messages: ge,
|
|
551
|
+
messagesTotal: Ha,
|
|
552
|
+
loading: Ua,
|
|
553
|
+
loadMessages: Ka,
|
|
554
|
+
loadMoreMessages: Ga
|
|
555
|
+
} = Ds, ta = s.useMemo(() => {
|
|
556
|
+
for (let a = ge.length - 1; a >= 0; a--)
|
|
557
|
+
if (ge[a].role === "assistant") return ge[a].id;
|
|
558
|
+
}, [ge]), oa = s.useCallback(async () => {
|
|
559
|
+
if (!t || !L) {
|
|
560
|
+
Fa([]);
|
|
561
561
|
return;
|
|
562
562
|
}
|
|
563
563
|
try {
|
|
564
|
-
const a = await
|
|
565
|
-
agent_id:
|
|
564
|
+
const a = await rn({
|
|
565
|
+
agent_id: t,
|
|
566
566
|
limit: 8
|
|
567
567
|
});
|
|
568
|
-
|
|
568
|
+
Fa(Array.isArray(a.data) ? a.data : []);
|
|
569
569
|
} catch {
|
|
570
570
|
}
|
|
571
|
-
}, [
|
|
571
|
+
}, [t, L]);
|
|
572
572
|
s.useEffect(() => {
|
|
573
|
-
|
|
574
|
-
}, [
|
|
575
|
-
const
|
|
573
|
+
oa();
|
|
574
|
+
}, [oa]);
|
|
575
|
+
const ce = s.useCallback(
|
|
576
576
|
async (a) => {
|
|
577
|
-
await
|
|
577
|
+
await za(a), oa();
|
|
578
578
|
},
|
|
579
|
-
[
|
|
580
|
-
),
|
|
579
|
+
[za, oa]
|
|
580
|
+
), Qa = s.useCallback(async (a) => {
|
|
581
581
|
const n = String(a.playbook_id || "").trim();
|
|
582
582
|
if (!n) throw new Error("场景缺少 playbook_id");
|
|
583
|
-
const { data: c } = await
|
|
583
|
+
const { data: c } = await ja({
|
|
584
584
|
playbook_id: n
|
|
585
585
|
});
|
|
586
|
-
return
|
|
586
|
+
return cs(a, c);
|
|
587
587
|
}, []);
|
|
588
588
|
s.useEffect(() => {
|
|
589
|
-
|
|
590
|
-
if (await
|
|
589
|
+
he.current || (he.current = !0, (async () => {
|
|
590
|
+
if (await Ka(), r) {
|
|
591
591
|
const a = (_ == null ? void 0 : _.trim()) || "执行场景";
|
|
592
|
-
|
|
592
|
+
ce({
|
|
593
593
|
message: a,
|
|
594
594
|
playbook_id: r,
|
|
595
|
-
playbook_params:
|
|
595
|
+
playbook_params: u || {}
|
|
596
596
|
});
|
|
597
|
-
} else _ != null && _.trim() &&
|
|
597
|
+
} else _ != null && _.trim() && na(_.trim(), void 0, j);
|
|
598
598
|
})());
|
|
599
599
|
}, [
|
|
600
600
|
r,
|
|
601
601
|
_,
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
602
|
+
j,
|
|
603
|
+
u,
|
|
604
|
+
ce,
|
|
605
|
+
Ka,
|
|
606
|
+
na
|
|
607
607
|
]), s.useEffect(() => {
|
|
608
|
-
if (!
|
|
608
|
+
if (!t) return;
|
|
609
609
|
let a = !1;
|
|
610
610
|
return (async () => {
|
|
611
611
|
try {
|
|
612
|
-
const { data: n } = await
|
|
612
|
+
const { data: n } = await dn({ agent_id: t });
|
|
613
613
|
if (a) return;
|
|
614
614
|
const c = (n == null ? void 0 : n.children) || [];
|
|
615
|
-
|
|
615
|
+
Fe(c), Se(null);
|
|
616
616
|
} catch {
|
|
617
|
-
|
|
617
|
+
Fe([]);
|
|
618
618
|
}
|
|
619
619
|
})(), () => {
|
|
620
620
|
a = !0;
|
|
621
621
|
};
|
|
622
|
-
}, [
|
|
623
|
-
|
|
624
|
-
}, [
|
|
625
|
-
if (
|
|
626
|
-
|
|
622
|
+
}, [t]), s.useEffect(() => {
|
|
623
|
+
ta && ta !== Je && As(ta);
|
|
624
|
+
}, [ta, Je]), s.useEffect(() => {
|
|
625
|
+
if (v !== "robot" || ne !== "history" || !ee) {
|
|
626
|
+
Re([]);
|
|
627
627
|
return;
|
|
628
628
|
}
|
|
629
|
-
const a =
|
|
629
|
+
const a = re.find((c) => c.name === ee);
|
|
630
630
|
if (!a) return;
|
|
631
631
|
let n = !1;
|
|
632
|
-
return
|
|
632
|
+
return Qe(!0), (async () => {
|
|
633
633
|
try {
|
|
634
|
-
const c = await
|
|
634
|
+
const c = await un({
|
|
635
635
|
agent_id: a.agent_id,
|
|
636
636
|
limit: 50
|
|
637
637
|
});
|
|
638
638
|
if (n) return;
|
|
639
|
-
const
|
|
640
|
-
(m,
|
|
641
|
-
id: m.id || m.execute_id || `record_${
|
|
639
|
+
const d = (Array.isArray(c == null ? void 0 : c.data) ? c.data : []).map(
|
|
640
|
+
(m, y) => ({
|
|
641
|
+
id: m.id || m.execute_id || `record_${y}`,
|
|
642
642
|
action_name: m.action_name || m.display_name || "未知动作",
|
|
643
643
|
status: m.status || "pending",
|
|
644
644
|
created_at: m.created_at || "",
|
|
@@ -647,20 +647,20 @@ function jo({
|
|
|
647
647
|
error: m.error
|
|
648
648
|
})
|
|
649
649
|
);
|
|
650
|
-
|
|
650
|
+
Re(d);
|
|
651
651
|
} catch {
|
|
652
|
-
|
|
652
|
+
Re([]);
|
|
653
653
|
} finally {
|
|
654
|
-
n ||
|
|
654
|
+
n || Qe(!1);
|
|
655
655
|
}
|
|
656
656
|
})(), () => {
|
|
657
657
|
n = !0;
|
|
658
658
|
};
|
|
659
|
-
}, [
|
|
660
|
-
const
|
|
659
|
+
}, [v, ne, ee, re]);
|
|
660
|
+
const Ya = s.useCallback(async () => {
|
|
661
661
|
try {
|
|
662
|
-
const a = await
|
|
663
|
-
Array.isArray(a == null ? void 0 : a.data) &&
|
|
662
|
+
const a = await mn({});
|
|
663
|
+
Array.isArray(a == null ? void 0 : a.data) && C(
|
|
664
664
|
a.data.map((n) => ({
|
|
665
665
|
webhook_id: n.webhook_id || "",
|
|
666
666
|
name: n.name || "未命名渠道",
|
|
@@ -669,97 +669,97 @@ function jo({
|
|
|
669
669
|
);
|
|
670
670
|
} catch {
|
|
671
671
|
}
|
|
672
|
-
}, []),
|
|
672
|
+
}, []), ca = s.useCallback(async () => {
|
|
673
673
|
try {
|
|
674
674
|
const a = {};
|
|
675
675
|
await Promise.all(
|
|
676
|
-
|
|
676
|
+
re.map(async (n) => {
|
|
677
677
|
var c;
|
|
678
678
|
try {
|
|
679
|
-
const i = await
|
|
679
|
+
const i = await hn(
|
|
680
680
|
n.agent_id,
|
|
681
681
|
{}
|
|
682
|
-
),
|
|
683
|
-
|
|
682
|
+
), d = (c = i == null ? void 0 : i.data) == null ? void 0 : c.webhook_id;
|
|
683
|
+
d && (a[n.agent_id] = d);
|
|
684
684
|
} catch {
|
|
685
685
|
}
|
|
686
686
|
})
|
|
687
|
-
),
|
|
687
|
+
), Le(a);
|
|
688
688
|
} catch {
|
|
689
689
|
}
|
|
690
|
-
}, [
|
|
691
|
-
if (
|
|
692
|
-
|
|
690
|
+
}, [re]), Za = s.useCallback(async () => {
|
|
691
|
+
if (t) {
|
|
692
|
+
o(!0);
|
|
693
693
|
try {
|
|
694
|
-
const a = await
|
|
695
|
-
agent_id:
|
|
694
|
+
const a = await pn({
|
|
695
|
+
agent_id: t,
|
|
696
696
|
limit: 20,
|
|
697
697
|
use_cache: !1
|
|
698
698
|
}), c = (Array.isArray(a == null ? void 0 : a.data) ? a.data : []).map((i) => {
|
|
699
|
-
const
|
|
699
|
+
const d = i.ui_payload || i.outputs || void 0;
|
|
700
700
|
return {
|
|
701
701
|
id: i.inbox_id || i.id || "",
|
|
702
702
|
title: i.title || "巡检结果",
|
|
703
703
|
summary: i.summary || "",
|
|
704
704
|
priority: i.priority || "medium",
|
|
705
705
|
timestamp: i.created_at || "",
|
|
706
|
-
ui_payload:
|
|
706
|
+
ui_payload: d,
|
|
707
707
|
agent_name: i.agent_name || i.agent_id || "",
|
|
708
|
-
actions:
|
|
708
|
+
actions: Nt(i)
|
|
709
709
|
};
|
|
710
710
|
}).sort(
|
|
711
|
-
(i,
|
|
711
|
+
(i, d) => new Date(d.timestamp || 0).getTime() - new Date(i.timestamp || 0).getTime()
|
|
712
712
|
);
|
|
713
|
-
|
|
713
|
+
N(c);
|
|
714
714
|
} catch {
|
|
715
|
-
|
|
715
|
+
N([]);
|
|
716
716
|
} finally {
|
|
717
|
-
|
|
717
|
+
o(!1);
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
}, [
|
|
720
|
+
}, [t]);
|
|
721
721
|
s.useEffect(() => {
|
|
722
|
-
|
|
723
|
-
}, [
|
|
724
|
-
|
|
725
|
-
}, [
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
},
|
|
729
|
-
if (!
|
|
730
|
-
|
|
722
|
+
Ya(), re.length > 0 && ca();
|
|
723
|
+
}, [re, Ya, ca]), s.useEffect(() => {
|
|
724
|
+
v === "robot" && ne === "results" && Za();
|
|
725
|
+
}, [v, ne, Za]);
|
|
726
|
+
const qs = (a) => {
|
|
727
|
+
De(a), ke(ue[a.agent_id]), M(!0);
|
|
728
|
+
}, Ws = async () => {
|
|
729
|
+
if (!Q || !te) {
|
|
730
|
+
k.warning("请选择通知渠道");
|
|
731
731
|
return;
|
|
732
732
|
}
|
|
733
733
|
try {
|
|
734
|
-
|
|
734
|
+
Ze(!0), await Tn(
|
|
735
735
|
{},
|
|
736
736
|
{
|
|
737
|
-
agent_id:
|
|
738
|
-
webhook_id:
|
|
737
|
+
agent_id: Q.agent_id,
|
|
738
|
+
webhook_id: te
|
|
739
739
|
}
|
|
740
|
-
),
|
|
740
|
+
), k.success("绑定成功"), M(!1), await ca();
|
|
741
741
|
} catch (a) {
|
|
742
|
-
|
|
742
|
+
k.error((a == null ? void 0 : a.message) || "绑定失败");
|
|
743
743
|
} finally {
|
|
744
|
-
|
|
744
|
+
Ze(!1);
|
|
745
745
|
}
|
|
746
|
-
},
|
|
747
|
-
if (
|
|
746
|
+
}, Hs = async () => {
|
|
747
|
+
if (Q)
|
|
748
748
|
try {
|
|
749
|
-
|
|
750
|
-
|
|
749
|
+
Ze(!0), await Fn(
|
|
750
|
+
Q.agent_id,
|
|
751
751
|
{}
|
|
752
|
-
),
|
|
752
|
+
), k.success("解绑成功"), M(!1), ke(void 0), await ca();
|
|
753
753
|
} catch (a) {
|
|
754
|
-
|
|
754
|
+
k.error((a == null ? void 0 : a.message) || "解绑失败");
|
|
755
755
|
} finally {
|
|
756
|
-
|
|
756
|
+
Ze(!1);
|
|
757
757
|
}
|
|
758
|
-
},
|
|
758
|
+
}, _a = s.useMemo(() => ee ? w.filter((a) => {
|
|
759
759
|
var i;
|
|
760
760
|
const n = (i = a.title) == null ? void 0 : i.match(/^(.+?)\s*巡检结果$/);
|
|
761
|
-
return (n ? n[1] : a.agent_name) ===
|
|
762
|
-
}) :
|
|
761
|
+
return (n ? n[1] : a.agent_name) === ee;
|
|
762
|
+
}) : w, [w, ee]), Us = (a) => {
|
|
763
763
|
if (!a) return "";
|
|
764
764
|
try {
|
|
765
765
|
return new Date(a).toLocaleString("zh-CN", {
|
|
@@ -771,27 +771,27 @@ function jo({
|
|
|
771
771
|
} catch {
|
|
772
772
|
return a;
|
|
773
773
|
}
|
|
774
|
-
},
|
|
774
|
+
}, ba = s.useCallback(
|
|
775
775
|
(a, n, c) => {
|
|
776
|
-
if (
|
|
777
|
-
|
|
776
|
+
if ($e(!1), n) {
|
|
777
|
+
ce({
|
|
778
778
|
message: a,
|
|
779
779
|
playbook_id: n
|
|
780
780
|
});
|
|
781
781
|
return;
|
|
782
782
|
}
|
|
783
|
-
|
|
783
|
+
na(a, void 0, c);
|
|
784
784
|
},
|
|
785
|
-
[
|
|
786
|
-
),
|
|
787
|
-
|
|
788
|
-
a === "all" ?
|
|
789
|
-
),
|
|
790
|
-
}, []),
|
|
791
|
-
|
|
792
|
-
}, []),
|
|
793
|
-
E(!1), B(null),
|
|
794
|
-
}, []),
|
|
785
|
+
[ce, na]
|
|
786
|
+
), Ks = s.useCallback((a) => {
|
|
787
|
+
U(a), pe(
|
|
788
|
+
a === "all" ? ya : a === "map" ? wa : ds
|
|
789
|
+
), H(""), B(null), K([]), X({});
|
|
790
|
+
}, []), Gs = s.useCallback(() => {
|
|
791
|
+
U("all"), pe(ya), H(""), B(null), K([]), X({}), E(!0);
|
|
792
|
+
}, []), Qs = s.useCallback(() => {
|
|
793
|
+
E(!1), B(null), K([]), X({});
|
|
794
|
+
}, []), je = s.useCallback(
|
|
795
795
|
(a, n = {}) => {
|
|
796
796
|
B({
|
|
797
797
|
key: a.playbook_id,
|
|
@@ -803,20 +803,43 @@ function jo({
|
|
|
803
803
|
categoryKey: "",
|
|
804
804
|
input_fields: a.input_fields || []
|
|
805
805
|
});
|
|
806
|
-
const c =
|
|
807
|
-
|
|
806
|
+
const c = fs(a.input_fields || []);
|
|
807
|
+
K(c), X(ys(c, n)), ye({}), b({});
|
|
808
808
|
},
|
|
809
809
|
[]
|
|
810
|
-
),
|
|
810
|
+
), Ys = s.useCallback(
|
|
811
|
+
(a, n) => async ({ file: c, onSuccess: i, onError: d }) => {
|
|
812
|
+
var m, y;
|
|
813
|
+
ye((x) => ({ ...x, [a]: !0 }));
|
|
814
|
+
try {
|
|
815
|
+
const x = c, P = await va(x), Me = (m = P == null ? void 0 : P.data) == null ? void 0 : m.url, He = ((y = P == null ? void 0 : P.data) == null ? void 0 : y.name) || x.name;
|
|
816
|
+
if (!Me) throw new Error("上传结果缺少文件地址");
|
|
817
|
+
b((be) => ({ ...be, [Me]: He })), X((be) => {
|
|
818
|
+
if (n <= 1) return { ...be, [a]: Me };
|
|
819
|
+
const cn = Array.isArray(be[a]) ? be[a] : be[a] ? [be[a]] : [];
|
|
820
|
+
return { ...be, [a]: [...cn, Me] };
|
|
821
|
+
}), i == null || i(P), k.success("上传成功");
|
|
822
|
+
} catch (x) {
|
|
823
|
+
const P = x instanceof Error ? x : new Error("上传失败");
|
|
824
|
+
d == null || d(P), k.error(P.message);
|
|
825
|
+
} finally {
|
|
826
|
+
ye((x) => ({
|
|
827
|
+
...x,
|
|
828
|
+
[a]: !1
|
|
829
|
+
}));
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
[]
|
|
833
|
+
), Zs = s.useCallback(
|
|
811
834
|
async (a) => {
|
|
812
835
|
var c;
|
|
813
|
-
if (
|
|
836
|
+
if (T || W) return;
|
|
814
837
|
const n = String(a.playbook_id || "").trim();
|
|
815
838
|
if (!n) {
|
|
816
|
-
|
|
839
|
+
k.error("场景缺少 playbook_id");
|
|
817
840
|
return;
|
|
818
841
|
}
|
|
819
|
-
|
|
842
|
+
le(n);
|
|
820
843
|
try {
|
|
821
844
|
const i = {
|
|
822
845
|
category: null,
|
|
@@ -829,129 +852,129 @@ function jo({
|
|
|
829
852
|
scope: "",
|
|
830
853
|
status: "available",
|
|
831
854
|
sub_category: null,
|
|
832
|
-
tags: a.tags.map((
|
|
855
|
+
tags: a.tags.map((y) => y.name),
|
|
833
856
|
type: "",
|
|
834
857
|
version: "",
|
|
835
858
|
input_fields: a.input_fields,
|
|
836
859
|
video_url: a.video_url,
|
|
837
860
|
video_duration: a.video_duration,
|
|
838
861
|
view_count: a.view_count
|
|
839
|
-
}, { data:
|
|
862
|
+
}, { data: d } = await ja({
|
|
840
863
|
playbook_id: n
|
|
841
864
|
});
|
|
842
|
-
if (!
|
|
865
|
+
if (!d || typeof d != "object" || Array.isArray(d))
|
|
843
866
|
throw new Error("场景详情为空");
|
|
844
|
-
const m =
|
|
867
|
+
const m = cs(i, d);
|
|
845
868
|
if (E(!1), (c = m.input_fields) != null && c.length) {
|
|
846
|
-
|
|
869
|
+
je(m);
|
|
847
870
|
return;
|
|
848
871
|
}
|
|
849
|
-
|
|
872
|
+
ba(m.name, m.playbook_id), $ == null || $(a);
|
|
850
873
|
} catch (i) {
|
|
851
|
-
const
|
|
852
|
-
|
|
874
|
+
const d = i instanceof Error ? i.message : "场景加载失败";
|
|
875
|
+
k.error(d);
|
|
853
876
|
} finally {
|
|
854
|
-
|
|
877
|
+
le("");
|
|
855
878
|
}
|
|
856
879
|
},
|
|
857
880
|
[
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
881
|
+
T,
|
|
882
|
+
je,
|
|
883
|
+
ba,
|
|
884
|
+
$,
|
|
885
|
+
W
|
|
863
886
|
]
|
|
864
|
-
),
|
|
887
|
+
), Ja = s.useCallback(
|
|
865
888
|
async (a) => {
|
|
866
|
-
if (!
|
|
867
|
-
if (
|
|
868
|
-
|
|
889
|
+
if (!T) {
|
|
890
|
+
if ($e(!1), a.input_fields && a.input_fields.length > 0) {
|
|
891
|
+
je(a);
|
|
869
892
|
return;
|
|
870
893
|
}
|
|
871
894
|
try {
|
|
872
|
-
await
|
|
895
|
+
await ce({
|
|
873
896
|
message: a.name,
|
|
874
897
|
playbook_id: a.playbook_id
|
|
875
898
|
});
|
|
876
899
|
} catch (n) {
|
|
877
900
|
const c = n instanceof Error ? n.message : "执行失败";
|
|
878
|
-
|
|
901
|
+
k.error(c);
|
|
879
902
|
}
|
|
880
903
|
}
|
|
881
904
|
},
|
|
882
|
-
[
|
|
883
|
-
),
|
|
905
|
+
[T, ce, je]
|
|
906
|
+
), Js = s.useCallback(
|
|
884
907
|
async (a) => {
|
|
885
908
|
var c;
|
|
886
|
-
if (
|
|
909
|
+
if (T || ua) return;
|
|
887
910
|
const n = String(a.playbook_id || "").trim();
|
|
888
911
|
if (n) {
|
|
889
|
-
|
|
912
|
+
Oa(n), $e(!1);
|
|
890
913
|
try {
|
|
891
|
-
const i =
|
|
892
|
-
if ((c =
|
|
893
|
-
|
|
914
|
+
const i = xn(a), d = await Qa(a);
|
|
915
|
+
if ((c = d.input_fields) != null && c.length) {
|
|
916
|
+
je(d, i);
|
|
894
917
|
return;
|
|
895
918
|
}
|
|
896
|
-
await
|
|
897
|
-
message:
|
|
898
|
-
playbook_id:
|
|
919
|
+
await ce({
|
|
920
|
+
message: d.name,
|
|
921
|
+
playbook_id: d.playbook_id
|
|
899
922
|
});
|
|
900
923
|
} catch (i) {
|
|
901
|
-
const
|
|
902
|
-
|
|
924
|
+
const d = i instanceof Error ? i.message : "场景参数加载失败";
|
|
925
|
+
k.error(d);
|
|
903
926
|
} finally {
|
|
904
|
-
|
|
927
|
+
Oa("");
|
|
905
928
|
}
|
|
906
929
|
}
|
|
907
930
|
},
|
|
908
931
|
[
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
932
|
+
T,
|
|
933
|
+
ce,
|
|
934
|
+
je,
|
|
935
|
+
Qa,
|
|
936
|
+
ua
|
|
914
937
|
]
|
|
915
|
-
),
|
|
916
|
-
if (!A ||
|
|
917
|
-
const n =
|
|
918
|
-
(
|
|
938
|
+
), Xs = s.useCallback(async () => {
|
|
939
|
+
if (!A || T) return;
|
|
940
|
+
const n = ra(J, G).filter(
|
|
941
|
+
(d) => d.required && Sa(G[d.name])
|
|
919
942
|
);
|
|
920
943
|
if (n.length > 0) {
|
|
921
|
-
|
|
944
|
+
k.warning(`请先填写 ${n.length} 项必填参数`);
|
|
922
945
|
return;
|
|
923
946
|
}
|
|
924
|
-
E(!1),
|
|
925
|
-
const c = A, i =
|
|
926
|
-
B(null),
|
|
947
|
+
E(!1), $e(!1);
|
|
948
|
+
const c = A, i = G;
|
|
949
|
+
B(null), K([]), X({});
|
|
927
950
|
try {
|
|
928
|
-
const
|
|
929
|
-
await
|
|
930
|
-
message:
|
|
951
|
+
const d = c.title || (_ == null ? void 0 : _.trim()) || "执行场景";
|
|
952
|
+
await ce({
|
|
953
|
+
message: d,
|
|
931
954
|
playbook_id: c.playbook_id,
|
|
932
955
|
playbook_params: i
|
|
933
|
-
}),
|
|
934
|
-
} catch (
|
|
935
|
-
const m =
|
|
936
|
-
|
|
956
|
+
}), $ == null || $(c);
|
|
957
|
+
} catch (d) {
|
|
958
|
+
const m = d instanceof Error ? d.message : "执行失败";
|
|
959
|
+
k.error(m);
|
|
937
960
|
}
|
|
938
961
|
}, [
|
|
939
962
|
A,
|
|
940
963
|
J,
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
964
|
+
G,
|
|
965
|
+
T,
|
|
966
|
+
ce,
|
|
944
967
|
_,
|
|
945
|
-
|
|
946
|
-
]),
|
|
947
|
-
|
|
948
|
-
requestId: ++
|
|
968
|
+
$
|
|
969
|
+
]), en = s.useCallback((a) => {
|
|
970
|
+
qe.current += 1, ze({
|
|
971
|
+
requestId: ++Xe.current,
|
|
949
972
|
playbooks: a
|
|
950
973
|
});
|
|
951
|
-
}, []),
|
|
952
|
-
const a = ++
|
|
953
|
-
|
|
954
|
-
requestId: ++
|
|
974
|
+
}, []), an = s.useCallback(() => {
|
|
975
|
+
const a = ++qe.current;
|
|
976
|
+
ze({
|
|
977
|
+
requestId: ++Xe.current,
|
|
955
978
|
playbooks: [],
|
|
956
979
|
loading: !0
|
|
957
980
|
}), (async () => {
|
|
@@ -959,38 +982,38 @@ function jo({
|
|
|
959
982
|
window.requestAnimationFrame(() => n());
|
|
960
983
|
});
|
|
961
984
|
try {
|
|
962
|
-
const { data: n } = await
|
|
963
|
-
agent_id:
|
|
985
|
+
const { data: n } = await _n({
|
|
986
|
+
agent_id: t
|
|
964
987
|
});
|
|
965
|
-
if (a !==
|
|
966
|
-
|
|
967
|
-
requestId: ++
|
|
968
|
-
playbooks:
|
|
988
|
+
if (a !== qe.current) return;
|
|
989
|
+
ze({
|
|
990
|
+
requestId: ++Xe.current,
|
|
991
|
+
playbooks: Ct(n)
|
|
969
992
|
});
|
|
970
993
|
} catch {
|
|
971
|
-
if (a !==
|
|
972
|
-
|
|
973
|
-
requestId: ++
|
|
994
|
+
if (a !== qe.current) return;
|
|
995
|
+
k.error("我的场景加载失败"), ze({
|
|
996
|
+
requestId: ++Xe.current,
|
|
974
997
|
playbooks: []
|
|
975
998
|
});
|
|
976
999
|
}
|
|
977
1000
|
})();
|
|
978
|
-
}, [
|
|
979
|
-
|
|
1001
|
+
}, [t]), sn = s.useCallback((a) => {
|
|
1002
|
+
ze(
|
|
980
1003
|
(n) => (n == null ? void 0 : n.requestId) === a ? void 0 : n
|
|
981
1004
|
);
|
|
982
|
-
}, []),
|
|
1005
|
+
}, []), nn = /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__scene-quick", children: [
|
|
983
1006
|
/* @__PURE__ */ e.jsx(
|
|
984
|
-
|
|
1007
|
+
ka,
|
|
985
1008
|
{
|
|
986
1009
|
menu: {
|
|
987
|
-
selectedKeys: [
|
|
1010
|
+
selectedKeys: [ma],
|
|
988
1011
|
items: [
|
|
989
1012
|
{ key: "all", label: "全部场景" },
|
|
990
1013
|
{ key: "map", label: "使用地图" }
|
|
991
1014
|
],
|
|
992
1015
|
onClick: ({ key: a }) => {
|
|
993
|
-
|
|
1016
|
+
qe.current += 1, Is(a);
|
|
994
1017
|
}
|
|
995
1018
|
},
|
|
996
1019
|
trigger: ["click"],
|
|
@@ -1000,9 +1023,9 @@ function jo({
|
|
|
1000
1023
|
{
|
|
1001
1024
|
type: "button",
|
|
1002
1025
|
className: "wandox-console-chat__scene-source",
|
|
1003
|
-
disabled:
|
|
1026
|
+
disabled: T,
|
|
1004
1027
|
children: [
|
|
1005
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1028
|
+
/* @__PURE__ */ e.jsx("span", { children: ma === "map" ? "使用地图" : "全部场景" }),
|
|
1006
1029
|
/* @__PURE__ */ e.jsx(
|
|
1007
1030
|
"svg",
|
|
1008
1031
|
{
|
|
@@ -1022,32 +1045,32 @@ function jo({
|
|
|
1022
1045
|
}
|
|
1023
1046
|
),
|
|
1024
1047
|
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__scene-separator", "aria-hidden": !0, children: "|" }),
|
|
1025
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__scene-categories", children:
|
|
1048
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__scene-categories", children: Ts.map((a) => /* @__PURE__ */ e.jsx(
|
|
1026
1049
|
"button",
|
|
1027
1050
|
{
|
|
1028
1051
|
type: "button",
|
|
1029
1052
|
className: "wandox-console-chat__choose-scene",
|
|
1030
|
-
disabled:
|
|
1031
|
-
onClick: () => a.key === "__my__" ?
|
|
1053
|
+
disabled: T,
|
|
1054
|
+
onClick: () => a.key === "__my__" ? an() : en(a.playbooks),
|
|
1032
1055
|
children: a.label
|
|
1033
1056
|
},
|
|
1034
1057
|
a.key
|
|
1035
1058
|
)) })
|
|
1036
|
-
] }),
|
|
1059
|
+
] }), Xa = s.useCallback(async (a) => {
|
|
1037
1060
|
var m;
|
|
1038
1061
|
const n = (m = a.meta_content) != null && m.playbook_id ? "数据报表" : "对话内容", c = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
1039
|
-
if (
|
|
1040
|
-
const
|
|
1041
|
-
if (!
|
|
1042
|
-
|
|
1062
|
+
if (bn(a)) {
|
|
1063
|
+
const y = fn(a);
|
|
1064
|
+
if (!y) {
|
|
1065
|
+
k.warning("没有可导出的表格数据");
|
|
1043
1066
|
return;
|
|
1044
1067
|
}
|
|
1045
|
-
const
|
|
1046
|
-
(
|
|
1047
|
-
),
|
|
1068
|
+
const x = y.fields.map((He) => He.label).join(","), P = y.rows.map(
|
|
1069
|
+
(He) => y.fields.map((be) => wn(He[be.name])).join(",")
|
|
1070
|
+
), Me = `\uFEFF${[x, ...P].join(`
|
|
1048
1071
|
`)}`;
|
|
1049
|
-
|
|
1050
|
-
new Blob([
|
|
1072
|
+
yn(
|
|
1073
|
+
new Blob([Me], { type: "text/csv;charset=utf-8;" }),
|
|
1051
1074
|
`${n}_${c}.csv`
|
|
1052
1075
|
);
|
|
1053
1076
|
return;
|
|
@@ -1056,141 +1079,141 @@ function jo({
|
|
|
1056
1079
|
`[data-message-id="${a.message_id || a.id}"] .wandox-message-content`
|
|
1057
1080
|
);
|
|
1058
1081
|
if (!i) {
|
|
1059
|
-
|
|
1082
|
+
k.warning("无法定位消息内容");
|
|
1060
1083
|
return;
|
|
1061
1084
|
}
|
|
1062
|
-
const
|
|
1063
|
-
if (!
|
|
1064
|
-
|
|
1085
|
+
const d = window.open("", "_blank");
|
|
1086
|
+
if (!d) {
|
|
1087
|
+
k.warning("请允许弹出窗口");
|
|
1065
1088
|
return;
|
|
1066
1089
|
}
|
|
1067
|
-
|
|
1090
|
+
d.document.write(
|
|
1068
1091
|
`<!DOCTYPE html><html><head><meta charset="utf-8"><title>${n}_${c}</title><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:20px;color:#333}table{border-collapse:collapse;width:100%}th,td{border:1px solid #d9d9d9;padding:6px 8px;font-size:13px;text-align:left}th{background:#fafafa}img{max-width:100%}pre{white-space:pre-wrap;word-break:break-all;font-size:12px;background:#f5f5f5;padding:12px;border-radius:4px}button,.ant-btn,.ant-tooltip-open{display:none!important}</style></head><body>${i.innerHTML}</body></html>`
|
|
1069
|
-
),
|
|
1070
|
-
|
|
1092
|
+
), d.document.close(), d.onload = () => {
|
|
1093
|
+
d.print(), d.close();
|
|
1071
1094
|
};
|
|
1072
|
-
}, []),
|
|
1095
|
+
}, []), es = s.useCallback(
|
|
1073
1096
|
(a) => {
|
|
1074
|
-
var
|
|
1075
|
-
const n =
|
|
1076
|
-
(
|
|
1077
|
-
), c =
|
|
1097
|
+
var d, m, y;
|
|
1098
|
+
const n = ge.find(
|
|
1099
|
+
(x) => x.message_id === a || x.id === a
|
|
1100
|
+
), c = gn(n);
|
|
1078
1101
|
if (!c) {
|
|
1079
|
-
|
|
1102
|
+
k.warning("缺少场景 ID,无法配置定时触发");
|
|
1080
1103
|
return;
|
|
1081
1104
|
}
|
|
1082
|
-
const i = ((m = (
|
|
1083
|
-
|
|
1105
|
+
const i = ((m = (d = n == null ? void 0 : n.actions) == null ? void 0 : d.find((x) => x.playbook_id === c)) == null ? void 0 : m.display_name) || ((y = n == null ? void 0 : n.meta_content) == null ? void 0 : y.playbook_name) || c;
|
|
1106
|
+
Da({
|
|
1084
1107
|
visible: !0,
|
|
1085
1108
|
messageId: a,
|
|
1086
|
-
agentId:
|
|
1109
|
+
agentId: t,
|
|
1087
1110
|
playbookId: c,
|
|
1088
1111
|
playbookName: i
|
|
1089
1112
|
});
|
|
1090
1113
|
},
|
|
1091
|
-
[
|
|
1092
|
-
),
|
|
1093
|
-
|
|
1094
|
-
}, []),
|
|
1114
|
+
[t, ge]
|
|
1115
|
+
), tn = s.useCallback(() => {
|
|
1116
|
+
Da(os);
|
|
1117
|
+
}, []), la = s.useCallback(
|
|
1095
1118
|
(a) => {
|
|
1096
1119
|
const n = a.message_id;
|
|
1097
|
-
return n && Object.prototype.hasOwnProperty.call(
|
|
1120
|
+
return n && Object.prototype.hasOwnProperty.call(ha, n) ? ha[n] : jn(a);
|
|
1098
1121
|
},
|
|
1099
|
-
[
|
|
1100
|
-
),
|
|
1122
|
+
[ha]
|
|
1123
|
+
), as = s.useCallback(
|
|
1101
1124
|
async (a, n, c) => {
|
|
1102
|
-
var
|
|
1125
|
+
var y;
|
|
1103
1126
|
const i = a.message_id;
|
|
1104
|
-
if (!i ||
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1127
|
+
if (!i || aa.has(i)) return !1;
|
|
1128
|
+
const d = la(a), m = On(
|
|
1129
|
+
d,
|
|
1107
1130
|
n
|
|
1108
1131
|
);
|
|
1109
|
-
|
|
1110
|
-
...
|
|
1132
|
+
Va((x) => ({
|
|
1133
|
+
...x,
|
|
1111
1134
|
[i]: m
|
|
1112
|
-
})),
|
|
1135
|
+
})), Ba((x) => new Set(x).add(i));
|
|
1113
1136
|
try {
|
|
1114
|
-
const
|
|
1115
|
-
{ domain:
|
|
1137
|
+
const x = await vn(
|
|
1138
|
+
{ domain: S },
|
|
1116
1139
|
{
|
|
1117
1140
|
message_id: i,
|
|
1118
1141
|
rating: m,
|
|
1119
|
-
tags: (
|
|
1142
|
+
tags: (y = c == null ? void 0 : c.tags) != null && y.length ? c.tags : void 0,
|
|
1120
1143
|
text: (c == null ? void 0 : c.text) || void 0
|
|
1121
1144
|
}
|
|
1122
1145
|
);
|
|
1123
|
-
if ((
|
|
1124
|
-
throw new Error(
|
|
1146
|
+
if ((x == null ? void 0 : x.success) === !1)
|
|
1147
|
+
throw new Error(x.message || "反馈提交失败");
|
|
1125
1148
|
return !0;
|
|
1126
|
-
} catch (
|
|
1127
|
-
return
|
|
1128
|
-
...
|
|
1129
|
-
[i]:
|
|
1130
|
-
})),
|
|
1131
|
-
|
|
1149
|
+
} catch (x) {
|
|
1150
|
+
return Va((P) => ({
|
|
1151
|
+
...P,
|
|
1152
|
+
[i]: d
|
|
1153
|
+
})), k.error(
|
|
1154
|
+
x instanceof Error ? x.message : "反馈提交失败,请稍后重试"
|
|
1132
1155
|
), !1;
|
|
1133
1156
|
} finally {
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1136
|
-
return
|
|
1157
|
+
Ba((x) => {
|
|
1158
|
+
const P = new Set(x);
|
|
1159
|
+
return P.delete(i), P;
|
|
1137
1160
|
});
|
|
1138
1161
|
}
|
|
1139
1162
|
},
|
|
1140
|
-
[
|
|
1141
|
-
),
|
|
1163
|
+
[aa, la, S]
|
|
1164
|
+
), ss = s.useCallback(
|
|
1142
1165
|
async (a) => {
|
|
1143
|
-
|
|
1166
|
+
$e(!1);
|
|
1144
1167
|
try {
|
|
1145
|
-
await
|
|
1168
|
+
await Wa(a);
|
|
1146
1169
|
} catch (n) {
|
|
1147
1170
|
const c = n instanceof Error ? n.message : "重新生成失败";
|
|
1148
|
-
|
|
1171
|
+
k.error(c);
|
|
1149
1172
|
}
|
|
1150
1173
|
},
|
|
1151
|
-
[
|
|
1152
|
-
),
|
|
1153
|
-
|
|
1154
|
-
}, []),
|
|
1174
|
+
[Wa]
|
|
1175
|
+
), ns = s.useCallback(() => {
|
|
1176
|
+
$e((a) => !a);
|
|
1177
|
+
}, []), ts = s.useCallback(
|
|
1155
1178
|
(a, n) => {
|
|
1156
1179
|
if (a.role !== "assistant" || a.execution_status === "executing") return null;
|
|
1157
|
-
const i = n && a.id ===
|
|
1180
|
+
const i = n && a.id === Je && Ve.length > 0, d = Be ? "隐藏推荐" : i ? `显示推荐(${Ve.length})` : "推荐";
|
|
1158
1181
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1159
1182
|
/* @__PURE__ */ e.jsx(
|
|
1160
|
-
|
|
1183
|
+
kn,
|
|
1161
1184
|
{
|
|
1162
1185
|
msg: a,
|
|
1163
|
-
domain:
|
|
1164
|
-
onExportMessage:
|
|
1186
|
+
domain: S,
|
|
1187
|
+
onExportMessage: Xa,
|
|
1165
1188
|
exportIcon: "copy",
|
|
1166
1189
|
showSolidify: !1,
|
|
1167
|
-
onOpenScheduleDialog:
|
|
1168
|
-
onRetrigger:
|
|
1169
|
-
feedbackRating:
|
|
1170
|
-
feedbackPending: !!a.message_id &&
|
|
1171
|
-
onFeedback:
|
|
1172
|
-
extraActions: i ? /* @__PURE__ */ e.jsx(
|
|
1190
|
+
onOpenScheduleDialog: es,
|
|
1191
|
+
onRetrigger: ss,
|
|
1192
|
+
feedbackRating: la(a),
|
|
1193
|
+
feedbackPending: !!a.message_id && aa.has(a.message_id),
|
|
1194
|
+
onFeedback: as,
|
|
1195
|
+
extraActions: i ? /* @__PURE__ */ e.jsx(_s, { title: d, children: /* @__PURE__ */ e.jsxs(
|
|
1173
1196
|
"button",
|
|
1174
1197
|
{
|
|
1175
1198
|
type: "button",
|
|
1176
|
-
className: `wandox-console-chat__toolbar-toggle${
|
|
1177
|
-
"aria-label":
|
|
1178
|
-
"aria-expanded":
|
|
1179
|
-
onClick:
|
|
1199
|
+
className: `wandox-console-chat__toolbar-toggle${Be ? " is-active" : ""}`,
|
|
1200
|
+
"aria-label": d,
|
|
1201
|
+
"aria-expanded": Be,
|
|
1202
|
+
onClick: ns,
|
|
1180
1203
|
children: [
|
|
1181
|
-
/* @__PURE__ */ e.jsx(
|
|
1182
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__toolbar-toggle-count", children:
|
|
1204
|
+
/* @__PURE__ */ e.jsx(wt, {}),
|
|
1205
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__toolbar-toggle-count", children: Ve.length })
|
|
1183
1206
|
]
|
|
1184
1207
|
}
|
|
1185
1208
|
) }) : null
|
|
1186
1209
|
}
|
|
1187
1210
|
),
|
|
1188
|
-
i &&
|
|
1211
|
+
i && Be && /* @__PURE__ */ e.jsx(
|
|
1189
1212
|
"ul",
|
|
1190
1213
|
{
|
|
1191
1214
|
className: "wandox-console-chat__recommendations",
|
|
1192
1215
|
"aria-label": "推荐场景",
|
|
1193
|
-
children:
|
|
1216
|
+
children: Ve.map((m, y) => /* @__PURE__ */ e.jsx(
|
|
1194
1217
|
"li",
|
|
1195
1218
|
{
|
|
1196
1219
|
className: "wandox-console-chat__recommendations-item",
|
|
@@ -1199,56 +1222,56 @@ function jo({
|
|
|
1199
1222
|
{
|
|
1200
1223
|
type: "button",
|
|
1201
1224
|
className: "wandox-console-chat__recommendations-pill",
|
|
1202
|
-
disabled:
|
|
1225
|
+
disabled: T,
|
|
1203
1226
|
onClick: () => {
|
|
1204
|
-
|
|
1227
|
+
Ja(m);
|
|
1205
1228
|
},
|
|
1206
1229
|
title: m.description || m.name,
|
|
1207
1230
|
children: [
|
|
1208
1231
|
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__recommendations-pill-label", children: m.name }),
|
|
1209
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__recommendations-pill-arrow", children: /* @__PURE__ */ e.jsx(
|
|
1232
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__recommendations-pill-arrow", children: /* @__PURE__ */ e.jsx(Ra, {}) })
|
|
1210
1233
|
]
|
|
1211
1234
|
}
|
|
1212
1235
|
)
|
|
1213
1236
|
},
|
|
1214
|
-
`${m.playbook_id || m.name}-${
|
|
1237
|
+
`${m.playbook_id || m.name}-${y}`
|
|
1215
1238
|
))
|
|
1216
1239
|
}
|
|
1217
1240
|
)
|
|
1218
1241
|
] });
|
|
1219
1242
|
},
|
|
1220
1243
|
[
|
|
1221
|
-
|
|
1222
|
-
Qe,
|
|
1244
|
+
T,
|
|
1223
1245
|
aa,
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1246
|
+
la,
|
|
1247
|
+
Ja,
|
|
1248
|
+
Xa,
|
|
1249
|
+
as,
|
|
1250
|
+
es,
|
|
1251
|
+
ss,
|
|
1252
|
+
Ve,
|
|
1253
|
+
Je,
|
|
1254
|
+
Be,
|
|
1255
|
+
S,
|
|
1256
|
+
ns
|
|
1234
1257
|
]
|
|
1235
|
-
),
|
|
1258
|
+
), fa = s.useCallback(
|
|
1236
1259
|
(a, n) => {
|
|
1237
|
-
|
|
1260
|
+
Ce(a), Ae(n), ve(!0);
|
|
1238
1261
|
},
|
|
1239
1262
|
[]
|
|
1240
|
-
),
|
|
1263
|
+
), on = s.useMemo(
|
|
1241
1264
|
() => /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__body", children: [
|
|
1242
1265
|
/* @__PURE__ */ e.jsx(
|
|
1243
|
-
|
|
1266
|
+
Nn,
|
|
1244
1267
|
{
|
|
1245
|
-
messages:
|
|
1246
|
-
executing:
|
|
1268
|
+
messages: ge,
|
|
1269
|
+
executing: T,
|
|
1247
1270
|
ssoToken: L,
|
|
1248
|
-
ssoDomain:
|
|
1271
|
+
ssoDomain: S,
|
|
1249
1272
|
ssoCompany: h,
|
|
1250
|
-
onExecutePlaybook:
|
|
1251
|
-
onFillPlaybookParams: (a) =>
|
|
1273
|
+
onExecutePlaybook: ce,
|
|
1274
|
+
onFillPlaybookParams: (a) => je(
|
|
1252
1275
|
{
|
|
1253
1276
|
category: null,
|
|
1254
1277
|
domain: "",
|
|
@@ -1266,40 +1289,40 @@ function jo({
|
|
|
1266
1289
|
},
|
|
1267
1290
|
a.initialParams ?? {}
|
|
1268
1291
|
),
|
|
1269
|
-
onRespondToProposal:
|
|
1292
|
+
onRespondToProposal: qa,
|
|
1270
1293
|
containerRef: O,
|
|
1271
|
-
messagesTotal:
|
|
1272
|
-
loadMoreMessages:
|
|
1273
|
-
loading:
|
|
1274
|
-
initialLoadingContent: /* @__PURE__ */ e.jsx(
|
|
1275
|
-
conversationKey:
|
|
1276
|
-
messageToolbar:
|
|
1277
|
-
onOpenActionDrawer:
|
|
1294
|
+
messagesTotal: Ha,
|
|
1295
|
+
loadMoreMessages: Ga,
|
|
1296
|
+
loading: Ua,
|
|
1297
|
+
initialLoadingContent: /* @__PURE__ */ e.jsx(Cn, {}),
|
|
1298
|
+
conversationKey: t,
|
|
1299
|
+
messageToolbar: ts,
|
|
1300
|
+
onOpenActionDrawer: fa
|
|
1278
1301
|
}
|
|
1279
1302
|
),
|
|
1280
1303
|
/* @__PURE__ */ e.jsx(
|
|
1281
|
-
|
|
1304
|
+
Sn,
|
|
1282
1305
|
{
|
|
1283
|
-
messages:
|
|
1306
|
+
messages: ge,
|
|
1284
1307
|
scrollContainerRef: O,
|
|
1285
1308
|
mode: "deepseek"
|
|
1286
1309
|
}
|
|
1287
1310
|
)
|
|
1288
1311
|
] }),
|
|
1289
1312
|
[
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1313
|
+
t,
|
|
1314
|
+
ce,
|
|
1315
|
+
T,
|
|
1316
|
+
je,
|
|
1317
|
+
Ga,
|
|
1318
|
+
ge,
|
|
1319
|
+
Ua,
|
|
1320
|
+
Ha,
|
|
1321
|
+
fa,
|
|
1322
|
+
ts,
|
|
1323
|
+
qa,
|
|
1301
1324
|
h,
|
|
1302
|
-
|
|
1325
|
+
S,
|
|
1303
1326
|
L
|
|
1304
1327
|
]
|
|
1305
1328
|
);
|
|
@@ -1312,27 +1335,27 @@ function jo({
|
|
|
1312
1335
|
{
|
|
1313
1336
|
type: "button",
|
|
1314
1337
|
className: "wandox-console-chat__back",
|
|
1315
|
-
onClick:
|
|
1338
|
+
onClick: me,
|
|
1316
1339
|
children: [
|
|
1317
|
-
/* @__PURE__ */ e.jsx(
|
|
1340
|
+
/* @__PURE__ */ e.jsx(gs, {}),
|
|
1318
1341
|
/* @__PURE__ */ e.jsx("span", { children: "返回" })
|
|
1319
1342
|
]
|
|
1320
1343
|
}
|
|
1321
1344
|
),
|
|
1322
1345
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__agent-selector", children: /* @__PURE__ */ e.jsx(
|
|
1323
|
-
|
|
1346
|
+
ka,
|
|
1324
1347
|
{
|
|
1325
1348
|
menu: {
|
|
1326
1349
|
items: Y.map((a) => ({
|
|
1327
1350
|
key: a.id,
|
|
1328
|
-
disabled: a.id ===
|
|
1351
|
+
disabled: a.id === t,
|
|
1329
1352
|
label: /* @__PURE__ */ e.jsxs("span", { className: "wandox-console-agent-menu-item", children: [
|
|
1330
1353
|
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__icon", children: a.icon }),
|
|
1331
1354
|
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__name", children: a.name }),
|
|
1332
|
-
a.id ===
|
|
1355
|
+
a.id === t && /* @__PURE__ */ e.jsx(Rn, { className: "wandox-console-agent-menu-item__check" })
|
|
1333
1356
|
] })
|
|
1334
1357
|
})),
|
|
1335
|
-
onClick: ({ key: a }) =>
|
|
1358
|
+
onClick: ({ key: a }) => z == null ? void 0 : z(a)
|
|
1336
1359
|
},
|
|
1337
1360
|
trigger: ["click"],
|
|
1338
1361
|
placement: "bottomLeft",
|
|
@@ -1344,9 +1367,9 @@ function jo({
|
|
|
1344
1367
|
"aria-label": "切换智能体",
|
|
1345
1368
|
title: "切换智能体",
|
|
1346
1369
|
children: [
|
|
1347
|
-
(
|
|
1348
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__title-name", children: l || (
|
|
1349
|
-
/* @__PURE__ */ e.jsx(
|
|
1370
|
+
(_e == null ? void 0 : _e.icon) && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__title-icon", children: _e.icon }),
|
|
1371
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__title-name", children: l || (_e == null ? void 0 : _e.name) || "智能体" }),
|
|
1372
|
+
/* @__PURE__ */ e.jsx(ws, { className: "wandox-console-chat__title-arrow" })
|
|
1350
1373
|
]
|
|
1351
1374
|
}
|
|
1352
1375
|
)
|
|
@@ -1357,23 +1380,23 @@ function jo({
|
|
|
1357
1380
|
{
|
|
1358
1381
|
type: "button",
|
|
1359
1382
|
className: "wandox-console-chat__all-scenes",
|
|
1360
|
-
disabled:
|
|
1361
|
-
onClick:
|
|
1383
|
+
disabled: T,
|
|
1384
|
+
onClick: Gs,
|
|
1362
1385
|
children: [
|
|
1363
|
-
/* @__PURE__ */ e.jsx(
|
|
1386
|
+
/* @__PURE__ */ e.jsx(it, {}),
|
|
1364
1387
|
/* @__PURE__ */ e.jsx("span", { children: "全部场景" })
|
|
1365
1388
|
]
|
|
1366
1389
|
}
|
|
1367
1390
|
),
|
|
1368
|
-
/* @__PURE__ */ e.jsx(
|
|
1391
|
+
/* @__PURE__ */ e.jsx(js, { benefit: _e == null ? void 0 : _e.packageBenefit })
|
|
1369
1392
|
] }),
|
|
1370
1393
|
/* @__PURE__ */ e.jsxs("nav", { className: "wandox-console-chat__topbar", children: [
|
|
1371
1394
|
/* @__PURE__ */ e.jsx(
|
|
1372
1395
|
"button",
|
|
1373
1396
|
{
|
|
1374
1397
|
type: "button",
|
|
1375
|
-
className: `wandox-console-chat__topbar-tab ${
|
|
1376
|
-
onClick: () =>
|
|
1398
|
+
className: `wandox-console-chat__topbar-tab ${v === "chat" ? "active" : ""}`,
|
|
1399
|
+
onClick: () => Te("chat"),
|
|
1377
1400
|
children: "智能体会话"
|
|
1378
1401
|
}
|
|
1379
1402
|
),
|
|
@@ -1381,38 +1404,38 @@ function jo({
|
|
|
1381
1404
|
"button",
|
|
1382
1405
|
{
|
|
1383
1406
|
type: "button",
|
|
1384
|
-
className: `wandox-console-chat__topbar-tab ${
|
|
1407
|
+
className: `wandox-console-chat__topbar-tab ${v === "robot" ? "active" : ""}`,
|
|
1385
1408
|
onClick: () => {
|
|
1386
|
-
|
|
1409
|
+
Te("robot"), Se(null);
|
|
1387
1410
|
},
|
|
1388
1411
|
children: /* @__PURE__ */ e.jsx("span", { children: "巡检机器人" })
|
|
1389
1412
|
}
|
|
1390
1413
|
)
|
|
1391
1414
|
] }),
|
|
1392
|
-
|
|
1393
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-chips", children:
|
|
1394
|
-
|
|
1415
|
+
v === "chat" ? on : /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot", children: [
|
|
1416
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-chips", children: re.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty", children: "该智能体暂无巡检机器人" }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1417
|
+
re.length > 0 && /* @__PURE__ */ e.jsx(
|
|
1395
1418
|
"button",
|
|
1396
1419
|
{
|
|
1397
1420
|
type: "button",
|
|
1398
|
-
className: `wandox-console-chat__robot-chip ${
|
|
1399
|
-
onClick: () =>
|
|
1421
|
+
className: `wandox-console-chat__robot-chip ${ee === null ? "active" : ""}`,
|
|
1422
|
+
onClick: () => Se(null),
|
|
1400
1423
|
children: "全部"
|
|
1401
1424
|
}
|
|
1402
1425
|
),
|
|
1403
|
-
|
|
1404
|
-
const n = !!
|
|
1426
|
+
re.map((a) => {
|
|
1427
|
+
const n = !!ue[a.agent_id];
|
|
1405
1428
|
return /* @__PURE__ */ e.jsxs(
|
|
1406
1429
|
"div",
|
|
1407
1430
|
{
|
|
1408
|
-
className: `wandox-console-chat__robot-chip-compound ${
|
|
1431
|
+
className: `wandox-console-chat__robot-chip-compound ${ee === a.name ? "active" : ""}`,
|
|
1409
1432
|
children: [
|
|
1410
1433
|
/* @__PURE__ */ e.jsx(
|
|
1411
1434
|
"button",
|
|
1412
1435
|
{
|
|
1413
1436
|
type: "button",
|
|
1414
1437
|
className: "wandox-console-chat__robot-chip-name",
|
|
1415
|
-
onClick: () =>
|
|
1438
|
+
onClick: () => Se(a.name),
|
|
1416
1439
|
children: a.name
|
|
1417
1440
|
}
|
|
1418
1441
|
),
|
|
@@ -1421,7 +1444,7 @@ function jo({
|
|
|
1421
1444
|
{
|
|
1422
1445
|
type: "button",
|
|
1423
1446
|
className: `wandox-console-chat__robot-chip-bind ${n ? "bound" : ""}`,
|
|
1424
|
-
onClick: () =>
|
|
1447
|
+
onClick: () => qs(a),
|
|
1425
1448
|
title: n ? "已绑定通知渠道,点击修改" : "绑定通知渠道",
|
|
1426
1449
|
children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1427
1450
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1433,7 +1456,7 @@ function jo({
|
|
|
1433
1456
|
),
|
|
1434
1457
|
/* @__PURE__ */ e.jsx("span", { children: "已通知" })
|
|
1435
1458
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1436
|
-
/* @__PURE__ */ e.jsx(
|
|
1459
|
+
/* @__PURE__ */ e.jsx(vs, {}),
|
|
1437
1460
|
/* @__PURE__ */ e.jsx("span", { children: "通知" })
|
|
1438
1461
|
] })
|
|
1439
1462
|
}
|
|
@@ -1449,8 +1472,8 @@ function jo({
|
|
|
1449
1472
|
"button",
|
|
1450
1473
|
{
|
|
1451
1474
|
type: "button",
|
|
1452
|
-
className: `wandox-console-chat__robot-tab ${
|
|
1453
|
-
onClick: () =>
|
|
1475
|
+
className: `wandox-console-chat__robot-tab ${ne === "results" ? "active" : ""}`,
|
|
1476
|
+
onClick: () => Oe("results"),
|
|
1454
1477
|
children: "巡检结果"
|
|
1455
1478
|
}
|
|
1456
1479
|
),
|
|
@@ -1458,35 +1481,35 @@ function jo({
|
|
|
1458
1481
|
"button",
|
|
1459
1482
|
{
|
|
1460
1483
|
type: "button",
|
|
1461
|
-
className: `wandox-console-chat__robot-tab ${
|
|
1462
|
-
onClick: () =>
|
|
1484
|
+
className: `wandox-console-chat__robot-tab ${ne === "history" ? "active" : ""}`,
|
|
1485
|
+
onClick: () => Oe("history"),
|
|
1463
1486
|
children: [
|
|
1464
1487
|
"执行记录",
|
|
1465
|
-
|
|
1488
|
+
ne === "history" && ee && Pe.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__robot-tab-badge", children: Pe.length })
|
|
1466
1489
|
]
|
|
1467
1490
|
}
|
|
1468
1491
|
)
|
|
1469
1492
|
] }),
|
|
1470
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-content", children:
|
|
1471
|
-
/* @__PURE__ */ e.jsx(
|
|
1493
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-content", children: ne === "results" ? de ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-loading", children: [
|
|
1494
|
+
/* @__PURE__ */ e.jsx(Na, { size: "small" }),
|
|
1472
1495
|
/* @__PURE__ */ e.jsx("span", { children: "加载中..." })
|
|
1473
|
-
] }) :
|
|
1474
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-icon", children: /* @__PURE__ */ e.jsx(
|
|
1475
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-title", children:
|
|
1496
|
+
] }) : _a.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-empty", children: [
|
|
1497
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-icon", children: /* @__PURE__ */ e.jsx(is, {}) }),
|
|
1498
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-title", children: ee ? `${ee} 暂无巡检结果` : "暂无巡检结果" }),
|
|
1476
1499
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-desc", children: "巡检结果会在机器人执行后展示在这里" })
|
|
1477
|
-
] }) : /* @__PURE__ */ e.jsx("ul", { className: "wandox-console-chat__robot-timeline", children:
|
|
1500
|
+
] }) : /* @__PURE__ */ e.jsx("ul", { className: "wandox-console-chat__robot-timeline", children: _a.map((a, n) => {
|
|
1478
1501
|
const c = {
|
|
1479
1502
|
high: "#ff4d4f",
|
|
1480
1503
|
medium: "#faad14",
|
|
1481
1504
|
low: "#52c41a"
|
|
1482
|
-
}, i = n ===
|
|
1505
|
+
}, i = n === _a.length - 1;
|
|
1483
1506
|
return /* @__PURE__ */ e.jsxs(
|
|
1484
1507
|
"li",
|
|
1485
1508
|
{
|
|
1486
1509
|
className: "wandox-console-chat__robot-timeline-item",
|
|
1487
1510
|
children: [
|
|
1488
1511
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-timeline-axis", children: [
|
|
1489
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__robot-timeline-time", children:
|
|
1512
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__robot-timeline-time", children: Us(a.timestamp) }),
|
|
1490
1513
|
/* @__PURE__ */ e.jsx(
|
|
1491
1514
|
"span",
|
|
1492
1515
|
{
|
|
@@ -1501,13 +1524,13 @@ function jo({
|
|
|
1501
1524
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-timeline-card", children: [
|
|
1502
1525
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-timeline-title", children: a.title }),
|
|
1503
1526
|
a.summary && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-timeline-summary", children: a.summary }),
|
|
1504
|
-
a.ui_payload && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-timeline-content wandox-markdown-content", children: /* @__PURE__ */ e.jsx(
|
|
1527
|
+
a.ui_payload && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-timeline-content wandox-markdown-content", children: /* @__PURE__ */ e.jsx($n, { payload: a.ui_payload }) }),
|
|
1505
1528
|
a.actions && a.actions.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-timeline-actions", children: /* @__PURE__ */ e.jsxs(
|
|
1506
1529
|
"button",
|
|
1507
1530
|
{
|
|
1508
1531
|
type: "button",
|
|
1509
1532
|
className: "wandox-console-chat__robot-timeline-action-btn",
|
|
1510
|
-
onClick: () =>
|
|
1533
|
+
onClick: () => fa(
|
|
1511
1534
|
a.title,
|
|
1512
1535
|
a.actions ?? []
|
|
1513
1536
|
),
|
|
@@ -1546,10 +1569,10 @@ function jo({
|
|
|
1546
1569
|
},
|
|
1547
1570
|
a.id || `result_${n}`
|
|
1548
1571
|
);
|
|
1549
|
-
}) }) :
|
|
1550
|
-
/* @__PURE__ */ e.jsx(
|
|
1572
|
+
}) }) : ee ? da ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-loading", children: [
|
|
1573
|
+
/* @__PURE__ */ e.jsx(Na, { size: "small" }),
|
|
1551
1574
|
/* @__PURE__ */ e.jsx("span", { children: "加载中..." })
|
|
1552
|
-
] }) :
|
|
1575
|
+
] }) : Pe.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-title", children: "暂无执行记录" }) }) : /* @__PURE__ */ e.jsx("ul", { className: "wandox-console-chat__robot-history", children: Pe.map((a) => /* @__PURE__ */ e.jsxs(
|
|
1553
1576
|
"li",
|
|
1554
1577
|
{
|
|
1555
1578
|
className: `wandox-console-chat__robot-history-item wandox-console-chat__robot-history-item--${a.status}`,
|
|
@@ -1582,29 +1605,29 @@ function jo({
|
|
|
1582
1605
|
},
|
|
1583
1606
|
a.id
|
|
1584
1607
|
)) }) : /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-empty", children: [
|
|
1585
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-icon", children: /* @__PURE__ */ e.jsx(
|
|
1608
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-icon", children: /* @__PURE__ */ e.jsx(is, {}) }),
|
|
1586
1609
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-title", children: "请先选择机器人" }),
|
|
1587
1610
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-desc", children: "在上方选择机器人以查看其执行记录" })
|
|
1588
1611
|
] }) })
|
|
1589
1612
|
] }),
|
|
1590
|
-
|
|
1613
|
+
v === "chat" && Ta.length > 0 && !(A && !D) && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__recent", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__recent-bar", children: Ta.map((a, n) => /* @__PURE__ */ e.jsx(
|
|
1591
1614
|
"button",
|
|
1592
1615
|
{
|
|
1593
1616
|
type: "button",
|
|
1594
1617
|
className: "wandox-console-chat__recent-chip",
|
|
1595
|
-
disabled:
|
|
1618
|
+
disabled: T || !!ua,
|
|
1596
1619
|
title: a.description || a.name,
|
|
1597
1620
|
onClick: () => {
|
|
1598
|
-
|
|
1621
|
+
Js(a);
|
|
1599
1622
|
},
|
|
1600
1623
|
children: a.name
|
|
1601
1624
|
},
|
|
1602
1625
|
`${a.playbook_id || a.name}-${n}`
|
|
1603
1626
|
)) }) }),
|
|
1604
|
-
|
|
1627
|
+
v === "chat" && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__input", children: A && !D ? /* @__PURE__ */ e.jsxs(
|
|
1605
1628
|
"div",
|
|
1606
1629
|
{
|
|
1607
|
-
ref:
|
|
1630
|
+
ref: fe,
|
|
1608
1631
|
className: "wandox-console-input-playbook wandox-console-prompt",
|
|
1609
1632
|
children: [
|
|
1610
1633
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt__head", children: [
|
|
@@ -1618,7 +1641,7 @@ function jo({
|
|
|
1618
1641
|
type: "button",
|
|
1619
1642
|
className: "wandox-console-changescene",
|
|
1620
1643
|
onClick: () => {
|
|
1621
|
-
B(null),
|
|
1644
|
+
B(null), K([]), X({});
|
|
1622
1645
|
},
|
|
1623
1646
|
children: "重新选择"
|
|
1624
1647
|
}
|
|
@@ -1627,7 +1650,7 @@ function jo({
|
|
|
1627
1650
|
/* @__PURE__ */ e.jsx(
|
|
1628
1651
|
"div",
|
|
1629
1652
|
{
|
|
1630
|
-
ref:
|
|
1653
|
+
ref: Ne,
|
|
1631
1654
|
tabIndex: -1,
|
|
1632
1655
|
className: "wandox-console-taskarea wandox-console-taskarea--static",
|
|
1633
1656
|
children: A.desc || A.title
|
|
@@ -1635,29 +1658,30 @@ function jo({
|
|
|
1635
1658
|
),
|
|
1636
1659
|
J.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea", children: [
|
|
1637
1660
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramhead", children: [
|
|
1638
|
-
/* @__PURE__ */ e.jsx(
|
|
1661
|
+
/* @__PURE__ */ e.jsx(ks, {}),
|
|
1639
1662
|
/* @__PURE__ */ e.jsx("strong", { children: "确认分析范围" }),
|
|
1640
1663
|
/* @__PURE__ */ e.jsxs("span", { className: "wandox-console-paramhead__status", children: [
|
|
1641
|
-
/* @__PURE__ */ e.jsx(
|
|
1664
|
+
/* @__PURE__ */ e.jsx(Ca, {}),
|
|
1642
1665
|
" ",
|
|
1643
|
-
|
|
1666
|
+
oe.length > 0 ? `待填 ${oe.length} 项必填参数` : "参数已就绪"
|
|
1644
1667
|
] })
|
|
1645
1668
|
] }),
|
|
1646
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-params", children:
|
|
1669
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-params", children: ra(
|
|
1647
1670
|
J,
|
|
1648
|
-
|
|
1671
|
+
G
|
|
1649
1672
|
).map((a) => /* @__PURE__ */ e.jsx(
|
|
1650
|
-
|
|
1673
|
+
Ss,
|
|
1651
1674
|
{
|
|
1652
1675
|
field: a,
|
|
1653
|
-
value:
|
|
1654
|
-
uploading:
|
|
1655
|
-
fileNameMap:
|
|
1656
|
-
getOptionState:
|
|
1657
|
-
onChange: (n, c) =>
|
|
1676
|
+
value: G[a.name],
|
|
1677
|
+
uploading: !!se[a.name],
|
|
1678
|
+
fileNameMap: Ee,
|
|
1679
|
+
getOptionState: I.getFieldState,
|
|
1680
|
+
onChange: (n, c) => X((i) => ({
|
|
1658
1681
|
...i,
|
|
1659
1682
|
[n]: c
|
|
1660
|
-
}))
|
|
1683
|
+
})),
|
|
1684
|
+
onUpload: Ys
|
|
1661
1685
|
},
|
|
1662
1686
|
a.name
|
|
1663
1687
|
)) })
|
|
@@ -1669,11 +1693,11 @@ function jo({
|
|
|
1669
1693
|
{
|
|
1670
1694
|
type: "button",
|
|
1671
1695
|
className: "wandox-console-start",
|
|
1672
|
-
disabled: !A ||
|
|
1673
|
-
onClick:
|
|
1696
|
+
disabled: !A || T || oe.length > 0,
|
|
1697
|
+
onClick: Xs,
|
|
1674
1698
|
children: [
|
|
1675
1699
|
"开始执行",
|
|
1676
|
-
/* @__PURE__ */ e.jsx(
|
|
1700
|
+
/* @__PURE__ */ e.jsx(Ra, {})
|
|
1677
1701
|
]
|
|
1678
1702
|
}
|
|
1679
1703
|
)
|
|
@@ -1681,107 +1705,107 @@ function jo({
|
|
|
1681
1705
|
]
|
|
1682
1706
|
}
|
|
1683
1707
|
) : /* @__PURE__ */ e.jsx(
|
|
1684
|
-
|
|
1708
|
+
An,
|
|
1685
1709
|
{
|
|
1686
|
-
onSend:
|
|
1687
|
-
executing:
|
|
1688
|
-
stopping:
|
|
1689
|
-
onStop:
|
|
1710
|
+
onSend: ba,
|
|
1711
|
+
executing: T,
|
|
1712
|
+
stopping: Vs,
|
|
1713
|
+
onStop: zs,
|
|
1690
1714
|
placeholder: " / 快速搜索场景",
|
|
1691
1715
|
ssoToken: L,
|
|
1692
|
-
ssoDomain:
|
|
1716
|
+
ssoDomain: S,
|
|
1693
1717
|
ssoCompany: h,
|
|
1694
|
-
leadingActions:
|
|
1718
|
+
leadingActions: nn,
|
|
1695
1719
|
uploadButtonAsLeading: !0,
|
|
1696
1720
|
uploadButtonLabel: "添加文件",
|
|
1697
1721
|
mentionTriggerChar: "/",
|
|
1698
|
-
mentionListRequest:
|
|
1699
|
-
onMentionListRequestHandled:
|
|
1722
|
+
mentionListRequest: Es,
|
|
1723
|
+
onMentionListRequestHandled: sn,
|
|
1700
1724
|
autoFocusInput: !A,
|
|
1701
|
-
playbooks:
|
|
1702
|
-
onRequestPlaybookParams:
|
|
1725
|
+
playbooks: Ps,
|
|
1726
|
+
onRequestPlaybookParams: je
|
|
1703
1727
|
}
|
|
1704
1728
|
) }),
|
|
1705
1729
|
/* @__PURE__ */ e.jsx(
|
|
1706
|
-
|
|
1730
|
+
vt,
|
|
1707
1731
|
{
|
|
1708
1732
|
open: D,
|
|
1709
1733
|
source: V,
|
|
1710
|
-
categories:
|
|
1734
|
+
categories: xa,
|
|
1711
1735
|
categoryKey: Z,
|
|
1712
|
-
search:
|
|
1713
|
-
cards:
|
|
1714
|
-
executing:
|
|
1715
|
-
loadingPlaybookId:
|
|
1716
|
-
onClose:
|
|
1717
|
-
onSourceChange:
|
|
1718
|
-
onCategoryChange:
|
|
1719
|
-
onSearchChange:
|
|
1720
|
-
onSelectScene:
|
|
1736
|
+
search: ie,
|
|
1737
|
+
cards: Fs,
|
|
1738
|
+
executing: T,
|
|
1739
|
+
loadingPlaybookId: W,
|
|
1740
|
+
onClose: Qs,
|
|
1741
|
+
onSourceChange: Ks,
|
|
1742
|
+
onCategoryChange: pe,
|
|
1743
|
+
onSearchChange: H,
|
|
1744
|
+
onSelectScene: Zs
|
|
1721
1745
|
}
|
|
1722
1746
|
),
|
|
1723
1747
|
/* @__PURE__ */ e.jsx(
|
|
1724
|
-
|
|
1748
|
+
In,
|
|
1725
1749
|
{
|
|
1726
|
-
open:
|
|
1727
|
-
agentId:
|
|
1728
|
-
playbookId:
|
|
1729
|
-
playbookName:
|
|
1730
|
-
onClose:
|
|
1750
|
+
open: ea.visible,
|
|
1751
|
+
agentId: ea.agentId,
|
|
1752
|
+
playbookId: ea.playbookId,
|
|
1753
|
+
playbookName: ea.playbookName,
|
|
1754
|
+
onClose: tn
|
|
1731
1755
|
}
|
|
1732
1756
|
),
|
|
1733
|
-
L &&
|
|
1734
|
-
|
|
1757
|
+
L && S && h && /* @__PURE__ */ e.jsx(
|
|
1758
|
+
En,
|
|
1735
1759
|
{
|
|
1736
|
-
open:
|
|
1737
|
-
title:
|
|
1738
|
-
actions:
|
|
1760
|
+
open: xe,
|
|
1761
|
+
title: Ie,
|
|
1762
|
+
actions: we,
|
|
1739
1763
|
ssoToken: L,
|
|
1740
|
-
ssoDomain:
|
|
1764
|
+
ssoDomain: S,
|
|
1741
1765
|
ssoCompany: h,
|
|
1742
|
-
onClose: () =>
|
|
1766
|
+
onClose: () => ve(!1)
|
|
1743
1767
|
}
|
|
1744
1768
|
),
|
|
1745
1769
|
/* @__PURE__ */ e.jsx(
|
|
1746
|
-
|
|
1770
|
+
Pn,
|
|
1747
1771
|
{
|
|
1748
1772
|
title: "配置通知渠道",
|
|
1749
|
-
open:
|
|
1773
|
+
open: ae,
|
|
1750
1774
|
onCancel: () => {
|
|
1751
|
-
|
|
1775
|
+
M(!1), De(null), ke(void 0);
|
|
1752
1776
|
},
|
|
1753
1777
|
width: 520,
|
|
1754
1778
|
centered: !0,
|
|
1755
1779
|
footer: [
|
|
1756
|
-
|
|
1757
|
-
|
|
1780
|
+
ue[(Q == null ? void 0 : Q.agent_id) || ""] ? /* @__PURE__ */ e.jsx(
|
|
1781
|
+
ia,
|
|
1758
1782
|
{
|
|
1759
1783
|
danger: !0,
|
|
1760
|
-
loading:
|
|
1784
|
+
loading: Ye,
|
|
1761
1785
|
style: { marginRight: "auto" },
|
|
1762
|
-
onClick:
|
|
1786
|
+
onClick: Hs,
|
|
1763
1787
|
children: "解除绑定"
|
|
1764
1788
|
},
|
|
1765
1789
|
"unbind"
|
|
1766
1790
|
) : null,
|
|
1767
1791
|
/* @__PURE__ */ e.jsx(
|
|
1768
|
-
|
|
1792
|
+
ia,
|
|
1769
1793
|
{
|
|
1770
|
-
disabled:
|
|
1794
|
+
disabled: Ye,
|
|
1771
1795
|
onClick: () => {
|
|
1772
|
-
|
|
1796
|
+
M(!1), De(null), ke(void 0);
|
|
1773
1797
|
},
|
|
1774
1798
|
children: "取消"
|
|
1775
1799
|
},
|
|
1776
1800
|
"cancel"
|
|
1777
1801
|
),
|
|
1778
1802
|
/* @__PURE__ */ e.jsx(
|
|
1779
|
-
|
|
1803
|
+
ia,
|
|
1780
1804
|
{
|
|
1781
1805
|
type: "primary",
|
|
1782
|
-
loading:
|
|
1783
|
-
disabled: !
|
|
1784
|
-
onClick:
|
|
1806
|
+
loading: Ye,
|
|
1807
|
+
disabled: !te,
|
|
1808
|
+
onClick: Ws,
|
|
1785
1809
|
children: "保存"
|
|
1786
1810
|
},
|
|
1787
1811
|
"ok"
|
|
@@ -1810,7 +1834,7 @@ function jo({
|
|
|
1810
1834
|
color: "#1a1a1a",
|
|
1811
1835
|
fontWeight: 500
|
|
1812
1836
|
},
|
|
1813
|
-
children:
|
|
1837
|
+
children: Q == null ? void 0 : Q.name
|
|
1814
1838
|
}
|
|
1815
1839
|
)
|
|
1816
1840
|
]
|
|
@@ -1829,33 +1853,33 @@ function jo({
|
|
|
1829
1853
|
}
|
|
1830
1854
|
),
|
|
1831
1855
|
/* @__PURE__ */ e.jsx(
|
|
1832
|
-
|
|
1856
|
+
Ln,
|
|
1833
1857
|
{
|
|
1834
1858
|
style: { width: "100%" },
|
|
1835
1859
|
placeholder: "请选择通知渠道",
|
|
1836
|
-
value:
|
|
1837
|
-
onChange:
|
|
1838
|
-
disabled:
|
|
1839
|
-
options:
|
|
1860
|
+
value: te,
|
|
1861
|
+
onChange: ke,
|
|
1862
|
+
disabled: Ye,
|
|
1863
|
+
options: g.map((a) => ({
|
|
1840
1864
|
label: `${a.name}(${a.platform === "dingtalk" ? "钉钉" : a.platform === "feishu" ? "飞书" : "企业微信"})`,
|
|
1841
1865
|
value: a.webhook_id
|
|
1842
1866
|
})),
|
|
1843
1867
|
popupRender: (a) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1844
1868
|
a,
|
|
1845
|
-
/* @__PURE__ */ e.jsx(
|
|
1846
|
-
/* @__PURE__ */ e.jsx(
|
|
1847
|
-
|
|
1869
|
+
/* @__PURE__ */ e.jsx(ot, { style: { margin: "8px 0" } }),
|
|
1870
|
+
/* @__PURE__ */ e.jsx(Mn, { style: { padding: "0 8px 4px" }, children: /* @__PURE__ */ e.jsx(
|
|
1871
|
+
ia,
|
|
1848
1872
|
{
|
|
1849
1873
|
type: "text",
|
|
1850
1874
|
icon: /* @__PURE__ */ e.jsx("span", { children: "+" }),
|
|
1851
|
-
onClick: () =>
|
|
1875
|
+
onClick: () => Ma(!0),
|
|
1852
1876
|
children: "添加新的通知渠道"
|
|
1853
1877
|
}
|
|
1854
1878
|
) })
|
|
1855
1879
|
] })
|
|
1856
1880
|
}
|
|
1857
1881
|
),
|
|
1858
|
-
|
|
1882
|
+
g.length === 0 && /* @__PURE__ */ e.jsx(
|
|
1859
1883
|
"div",
|
|
1860
1884
|
{
|
|
1861
1885
|
style: {
|
|
@@ -1874,193 +1898,193 @@ function jo({
|
|
|
1874
1898
|
}
|
|
1875
1899
|
),
|
|
1876
1900
|
/* @__PURE__ */ e.jsx(
|
|
1877
|
-
|
|
1901
|
+
Zn,
|
|
1878
1902
|
{
|
|
1879
|
-
open:
|
|
1880
|
-
onClose: () =>
|
|
1903
|
+
open: Rs,
|
|
1904
|
+
onClose: () => Ma(!1),
|
|
1881
1905
|
onSuccess: (a) => {
|
|
1882
|
-
|
|
1906
|
+
C((n) => [...n, a]), ke(a.webhook_id);
|
|
1883
1907
|
}
|
|
1884
1908
|
}
|
|
1885
1909
|
)
|
|
1886
1910
|
] })
|
|
1887
1911
|
);
|
|
1888
1912
|
}
|
|
1889
|
-
const { TextArea:
|
|
1890
|
-
function
|
|
1891
|
-
useMapCards:
|
|
1913
|
+
const { TextArea: Rt } = La, Ue = 5;
|
|
1914
|
+
function $t({
|
|
1915
|
+
useMapCards: t,
|
|
1892
1916
|
useMapCategories: l,
|
|
1893
1917
|
playbooks: r = [],
|
|
1894
|
-
selectedCategoryKey:
|
|
1918
|
+
selectedCategoryKey: u,
|
|
1895
1919
|
onCategorySelect: _,
|
|
1896
|
-
loading:
|
|
1920
|
+
loading: j,
|
|
1897
1921
|
useMapError: p,
|
|
1898
|
-
onRetry:
|
|
1899
|
-
onStartAnalysis:
|
|
1922
|
+
onRetry: f,
|
|
1923
|
+
onStartAnalysis: R,
|
|
1900
1924
|
agents: F,
|
|
1901
1925
|
selectedAgentId: Y,
|
|
1902
|
-
onAgentSelect:
|
|
1903
|
-
onOpenAgentChat:
|
|
1926
|
+
onAgentSelect: z,
|
|
1927
|
+
onOpenAgentChat: me
|
|
1904
1928
|
}) {
|
|
1905
|
-
const [
|
|
1929
|
+
const [$, q] = s.useState(""), [L, S] = s.useState(""), [h, O] = s.useState(null), he = s.useRef(null), [D, E] = s.useState([]), [W, le] = s.useState(!1), [ie, H] = s.useState(""), V = s.useRef(0), [U, Z] = s.useState({}), [pe, A] = s.useState({}), [B, Ne] = s.useState({}), [fe, xe] = s.useState([]), [ve, we] = s.useState(!1), Ae = s.useRef(null), [Ie, Ce] = s.useState(0), J = Math.max(
|
|
1906
1930
|
1,
|
|
1907
|
-
Math.ceil(l.length /
|
|
1908
|
-
),
|
|
1931
|
+
Math.ceil(l.length / Ue)
|
|
1932
|
+
), K = Math.min(Ie, J - 1), G = l.length > Ue, X = s.useMemo(
|
|
1909
1933
|
() => l.slice(
|
|
1910
|
-
|
|
1911
|
-
|
|
1934
|
+
K * Ue,
|
|
1935
|
+
K * Ue + Ue
|
|
1912
1936
|
),
|
|
1913
|
-
[l,
|
|
1937
|
+
[l, K]
|
|
1914
1938
|
);
|
|
1915
1939
|
s.useEffect(() => {
|
|
1916
|
-
|
|
1940
|
+
Ce(0);
|
|
1917
1941
|
}, [Y]);
|
|
1918
|
-
const
|
|
1919
|
-
() =>
|
|
1920
|
-
[
|
|
1921
|
-
),
|
|
1922
|
-
const
|
|
1923
|
-
return
|
|
1924
|
-
(
|
|
1925
|
-
) :
|
|
1926
|
-
}, [
|
|
1942
|
+
const se = s.useMemo(
|
|
1943
|
+
() => t.length > 0 ? t : Jn(r),
|
|
1944
|
+
[t, r]
|
|
1945
|
+
), ye = s.useMemo(() => u ? se.filter((o) => o.categoryKey === u) : se, [se, u]), Ee = s.useMemo(() => {
|
|
1946
|
+
const o = L.trim().toLowerCase();
|
|
1947
|
+
return o ? ye.filter(
|
|
1948
|
+
(w) => w.title.toLowerCase().includes(o) || w.desc.toLowerCase().includes(o)
|
|
1949
|
+
) : ye;
|
|
1950
|
+
}, [ye, L]), b = j || p && se.length === 0 || Ee.length > 0, [I, oe] = s.useState("");
|
|
1927
1951
|
s.useEffect(() => {
|
|
1928
|
-
V.current += 1,
|
|
1929
|
-
}, [
|
|
1930
|
-
|
|
1931
|
-
}, [
|
|
1932
|
-
const
|
|
1933
|
-
() =>
|
|
1934
|
-
[
|
|
1935
|
-
),
|
|
1936
|
-
() => h ?
|
|
1952
|
+
V.current += 1, oe(""), q(""), E([]), Z({}), le(!1), H("");
|
|
1953
|
+
}, [u]), s.useEffect(() => {
|
|
1954
|
+
I && !se.some((o) => o.playbook_id === I) && (V.current += 1, oe(""), q(""), E([]), Z({}), le(!1), H(""));
|
|
1955
|
+
}, [I, se]);
|
|
1956
|
+
const v = s.useMemo(
|
|
1957
|
+
() => se.find((o) => o.playbook_id === I) ?? null,
|
|
1958
|
+
[se, I]
|
|
1959
|
+
), Te = s.useMemo(
|
|
1960
|
+
() => h ? Ns(h) : null,
|
|
1937
1961
|
[h]
|
|
1938
|
-
),
|
|
1939
|
-
|
|
1962
|
+
), re = s.useCallback((o, w) => {
|
|
1963
|
+
o.stopPropagation(), O(w);
|
|
1940
1964
|
}, []);
|
|
1941
1965
|
s.useEffect(() => {
|
|
1942
|
-
if (
|
|
1943
|
-
const
|
|
1944
|
-
var
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1966
|
+
if (j || v) return;
|
|
1967
|
+
const o = window.setTimeout(() => {
|
|
1968
|
+
var N, g;
|
|
1969
|
+
const w = (g = (N = he.current) == null ? void 0 : N.resizableTextArea) == null ? void 0 : g.textArea;
|
|
1970
|
+
w == null || w.focus();
|
|
1947
1971
|
}, 0);
|
|
1948
|
-
return () => window.clearTimeout(
|
|
1949
|
-
}, [
|
|
1950
|
-
const
|
|
1951
|
-
const
|
|
1952
|
-
if (!
|
|
1953
|
-
|
|
1972
|
+
return () => window.clearTimeout(o);
|
|
1973
|
+
}, [j, v]);
|
|
1974
|
+
const Fe = s.useCallback(async (o) => {
|
|
1975
|
+
const w = String(o.playbook_id || "").trim();
|
|
1976
|
+
if (!w) {
|
|
1977
|
+
k.error("场景缺少 playbook_id");
|
|
1954
1978
|
return;
|
|
1955
1979
|
}
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1980
|
+
const N = ++V.current;
|
|
1981
|
+
oe(w), E([]), Z({}), A({}), Ne({}), le(!0), H("");
|
|
1958
1982
|
try {
|
|
1959
|
-
const { data:
|
|
1960
|
-
playbook_id:
|
|
1983
|
+
const { data: g } = await ja({
|
|
1984
|
+
playbook_id: w
|
|
1961
1985
|
});
|
|
1962
|
-
if (
|
|
1963
|
-
if (!
|
|
1986
|
+
if (N !== V.current) return;
|
|
1987
|
+
if (!g || typeof g != "object" || Array.isArray(g))
|
|
1964
1988
|
throw new Error("场景详情为空");
|
|
1965
|
-
const
|
|
1966
|
-
|
|
1989
|
+
const C = fs(
|
|
1990
|
+
Dn(g)
|
|
1967
1991
|
);
|
|
1968
|
-
E(
|
|
1969
|
-
} catch (
|
|
1970
|
-
if (
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1992
|
+
E(C), Z(ys(C));
|
|
1993
|
+
} catch (g) {
|
|
1994
|
+
if (N !== V.current) return;
|
|
1995
|
+
const C = g instanceof Error ? g.message : "场景参数加载失败";
|
|
1996
|
+
H(C), k.error("场景参数加载失败,请稍后重试");
|
|
1973
1997
|
} finally {
|
|
1974
|
-
|
|
1998
|
+
N === V.current && le(!1);
|
|
1975
1999
|
}
|
|
1976
|
-
}, []),
|
|
1977
|
-
V.current += 1,
|
|
1978
|
-
},
|
|
1979
|
-
() =>
|
|
1980
|
-
[D,
|
|
1981
|
-
),
|
|
1982
|
-
Z((
|
|
1983
|
-
}, []),
|
|
1984
|
-
(
|
|
1985
|
-
var
|
|
1986
|
-
A((
|
|
2000
|
+
}, []), ee = () => {
|
|
2001
|
+
V.current += 1, oe(""), q(""), E([]), Z({}), le(!1), H("");
|
|
2002
|
+
}, Se = bs(D, U, Z), ne = s.useMemo(
|
|
2003
|
+
() => ra(D, U),
|
|
2004
|
+
[D, U]
|
|
2005
|
+
), Oe = s.useCallback((o, w) => {
|
|
2006
|
+
Z((N) => ({ ...N, [o]: w }));
|
|
2007
|
+
}, []), da = s.useCallback(
|
|
2008
|
+
(o, w) => async ({ file: N, onSuccess: g, onError: C }) => {
|
|
2009
|
+
var ue, Le;
|
|
2010
|
+
A((ae) => ({ ...ae, [o]: !0 }));
|
|
1987
2011
|
try {
|
|
1988
|
-
const
|
|
1989
|
-
if (!
|
|
1990
|
-
|
|
1991
|
-
if (
|
|
1992
|
-
const
|
|
1993
|
-
return { ...
|
|
1994
|
-
}),
|
|
1995
|
-
} catch (
|
|
1996
|
-
const
|
|
1997
|
-
|
|
2012
|
+
const ae = N, M = await va(ae), Q = (ue = M == null ? void 0 : M.data) == null ? void 0 : ue.url, De = ((Le = M == null ? void 0 : M.data) == null ? void 0 : Le.name) || ae.name;
|
|
2013
|
+
if (!Q) throw new Error("上传结果缺少文件地址");
|
|
2014
|
+
Ne((te) => ({ ...te, [Q]: De })), Z((te) => {
|
|
2015
|
+
if (w <= 1) return { ...te, [o]: Q };
|
|
2016
|
+
const ke = Array.isArray(te[o]) ? te[o] : te[o] ? [te[o]] : [];
|
|
2017
|
+
return { ...te, [o]: [...ke, Q] };
|
|
2018
|
+
}), g == null || g(M), k.success("上传成功");
|
|
2019
|
+
} catch (ae) {
|
|
2020
|
+
const M = ae instanceof Error ? ae : new Error("上传失败");
|
|
2021
|
+
C == null || C(M), k.error(M.message);
|
|
1998
2022
|
} finally {
|
|
1999
|
-
A((
|
|
2023
|
+
A((ae) => ({ ...ae, [o]: !1 }));
|
|
2000
2024
|
}
|
|
2001
2025
|
},
|
|
2002
2026
|
[]
|
|
2003
|
-
),
|
|
2004
|
-
async (
|
|
2005
|
-
const
|
|
2006
|
-
if (
|
|
2007
|
-
|
|
2027
|
+
), Qe = s.useCallback(
|
|
2028
|
+
async (o) => {
|
|
2029
|
+
const w = Array.from(o.target.files ?? []);
|
|
2030
|
+
if (o.target.value = "", w.length !== 0) {
|
|
2031
|
+
we(!0);
|
|
2008
2032
|
try {
|
|
2009
|
-
const
|
|
2010
|
-
|
|
2011
|
-
var
|
|
2012
|
-
const
|
|
2013
|
-
if (!
|
|
2033
|
+
const N = await Promise.all(
|
|
2034
|
+
w.map(async (g) => {
|
|
2035
|
+
var ae, M;
|
|
2036
|
+
const C = await va(g), ue = (ae = C == null ? void 0 : C.data) == null ? void 0 : ae.url, Le = ((M = C == null ? void 0 : C.data) == null ? void 0 : M.name) || g.name;
|
|
2037
|
+
if (!ue) throw new Error("上传结果缺少文件地址");
|
|
2014
2038
|
return {
|
|
2015
|
-
type:
|
|
2016
|
-
url:
|
|
2017
|
-
name:
|
|
2018
|
-
mime_type:
|
|
2039
|
+
type: g.type.startsWith("image/") ? "image" : "file",
|
|
2040
|
+
url: ue,
|
|
2041
|
+
name: Le,
|
|
2042
|
+
mime_type: g.type
|
|
2019
2043
|
};
|
|
2020
2044
|
})
|
|
2021
2045
|
);
|
|
2022
|
-
|
|
2023
|
-
} catch (
|
|
2024
|
-
|
|
2046
|
+
xe((g) => [...g, ...N]), k.success(`已添加 ${N.length} 个附件`);
|
|
2047
|
+
} catch (N) {
|
|
2048
|
+
k.error(N instanceof Error ? N.message : "上传失败");
|
|
2025
2049
|
} finally {
|
|
2026
|
-
|
|
2050
|
+
we(!1);
|
|
2027
2051
|
}
|
|
2028
2052
|
}
|
|
2029
2053
|
},
|
|
2030
2054
|
[]
|
|
2031
|
-
),
|
|
2032
|
-
|
|
2033
|
-
}, []),
|
|
2034
|
-
() =>
|
|
2035
|
-
(
|
|
2055
|
+
), Pe = s.useCallback((o) => {
|
|
2056
|
+
xe((w) => w.filter((N) => N.url !== o));
|
|
2057
|
+
}, []), Re = s.useMemo(
|
|
2058
|
+
() => ne.filter(
|
|
2059
|
+
(o) => o.required && Sa(U[o.name])
|
|
2036
2060
|
),
|
|
2037
|
-
[
|
|
2038
|
-
),
|
|
2039
|
-
() => F.find((
|
|
2061
|
+
[ne, U]
|
|
2062
|
+
), de = s.useMemo(
|
|
2063
|
+
() => F.find((o) => o.id === Y) ?? F.find((o) => o.current) ?? F[0],
|
|
2040
2064
|
[F, Y]
|
|
2041
2065
|
);
|
|
2042
2066
|
return /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-view", children: [
|
|
2043
2067
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-homecenter", children: [
|
|
2044
2068
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-homecenter-hero", children: [
|
|
2045
|
-
|
|
2069
|
+
de && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-home-header", children: [
|
|
2046
2070
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-home-header__agent", children: [
|
|
2047
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-home-header__avatar", children:
|
|
2071
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-home-header__avatar", children: de.icon }),
|
|
2048
2072
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-home-header__identity", children: [
|
|
2049
2073
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-home-header__selector-row", children: [
|
|
2050
2074
|
/* @__PURE__ */ e.jsx(
|
|
2051
|
-
|
|
2075
|
+
ka,
|
|
2052
2076
|
{
|
|
2053
2077
|
menu: {
|
|
2054
|
-
items: F.map((
|
|
2055
|
-
key:
|
|
2056
|
-
disabled:
|
|
2078
|
+
items: F.map((o) => ({
|
|
2079
|
+
key: o.id,
|
|
2080
|
+
disabled: o.id === de.id,
|
|
2057
2081
|
label: /* @__PURE__ */ e.jsxs("span", { className: "wandox-console-agent-menu-item", children: [
|
|
2058
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__icon", children:
|
|
2059
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__name", children:
|
|
2060
|
-
|
|
2082
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__icon", children: o.icon }),
|
|
2083
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__name", children: o.name }),
|
|
2084
|
+
o.id === de.id && /* @__PURE__ */ e.jsx(Ca, { className: "wandox-console-agent-menu-item__check" })
|
|
2061
2085
|
] })
|
|
2062
2086
|
})),
|
|
2063
|
-
onClick: ({ key:
|
|
2087
|
+
onClick: ({ key: o }) => z == null ? void 0 : z(o)
|
|
2064
2088
|
},
|
|
2065
2089
|
trigger: ["click"],
|
|
2066
2090
|
placement: "bottomLeft",
|
|
@@ -2071,21 +2095,21 @@ function ko({
|
|
|
2071
2095
|
className: "wandox-console-home-header__selector",
|
|
2072
2096
|
"aria-label": "切换智能体",
|
|
2073
2097
|
children: [
|
|
2074
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-home-header__name", children:
|
|
2075
|
-
/* @__PURE__ */ e.jsx(
|
|
2098
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-home-header__name", children: de.name }),
|
|
2099
|
+
/* @__PURE__ */ e.jsx(ws, { className: "wandox-console-home-header__arrow" })
|
|
2076
2100
|
]
|
|
2077
2101
|
}
|
|
2078
2102
|
)
|
|
2079
2103
|
}
|
|
2080
2104
|
),
|
|
2081
|
-
/* @__PURE__ */ e.jsx(
|
|
2105
|
+
/* @__PURE__ */ e.jsx(js, { benefit: de.packageBenefit })
|
|
2082
2106
|
] }),
|
|
2083
|
-
|
|
2107
|
+
de.desc && /* @__PURE__ */ e.jsx(
|
|
2084
2108
|
"p",
|
|
2085
2109
|
{
|
|
2086
2110
|
className: "wandox-console-home-header__description",
|
|
2087
|
-
title:
|
|
2088
|
-
children:
|
|
2111
|
+
title: de.desc,
|
|
2112
|
+
children: de.desc
|
|
2089
2113
|
}
|
|
2090
2114
|
)
|
|
2091
2115
|
] })
|
|
@@ -2095,131 +2119,131 @@ function ko({
|
|
|
2095
2119
|
{
|
|
2096
2120
|
type: "button",
|
|
2097
2121
|
className: "wandox-console-home-header__history",
|
|
2098
|
-
onClick: () =>
|
|
2122
|
+
onClick: () => me == null ? void 0 : me(),
|
|
2099
2123
|
children: [
|
|
2100
2124
|
/* @__PURE__ */ e.jsx("span", { children: "会话记录" }),
|
|
2101
|
-
/* @__PURE__ */ e.jsx(
|
|
2125
|
+
/* @__PURE__ */ e.jsx(Vn, { className: "wandox-console-home-header__history-arrow" })
|
|
2102
2126
|
]
|
|
2103
2127
|
}
|
|
2104
2128
|
)
|
|
2105
2129
|
] }),
|
|
2106
2130
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt", children: [
|
|
2107
|
-
|
|
2131
|
+
v && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt__head", children: [
|
|
2108
2132
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scenechoice", children: [
|
|
2109
2133
|
/* @__PURE__ */ e.jsx("span", { children: "已选择场景" }),
|
|
2110
|
-
/* @__PURE__ */ e.jsx("strong", { children:
|
|
2134
|
+
/* @__PURE__ */ e.jsx("strong", { children: v.title })
|
|
2111
2135
|
] }),
|
|
2112
2136
|
/* @__PURE__ */ e.jsx(
|
|
2113
2137
|
"button",
|
|
2114
2138
|
{
|
|
2115
2139
|
type: "button",
|
|
2116
2140
|
className: "wandox-console-changescene",
|
|
2117
|
-
onClick:
|
|
2141
|
+
onClick: ee,
|
|
2118
2142
|
children: "重新选择"
|
|
2119
2143
|
}
|
|
2120
2144
|
)
|
|
2121
2145
|
] }),
|
|
2122
|
-
|
|
2123
|
-
|
|
2146
|
+
v ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-taskarea wandox-console-taskarea--static", children: v.desc || v.title }) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-taskarea", children: /* @__PURE__ */ e.jsx(
|
|
2147
|
+
Rt,
|
|
2124
2148
|
{
|
|
2125
|
-
ref:
|
|
2126
|
-
value:
|
|
2127
|
-
onChange: (
|
|
2149
|
+
ref: he,
|
|
2150
|
+
value: $,
|
|
2151
|
+
onChange: (o) => q(o.target.value),
|
|
2128
2152
|
autoSize: { minRows: 2 },
|
|
2129
2153
|
variant: "borderless",
|
|
2130
2154
|
placeholder: "直接描述你的问题,或选择一个场景开始"
|
|
2131
2155
|
}
|
|
2132
2156
|
) }),
|
|
2133
|
-
|
|
2134
|
-
/* @__PURE__ */ e.jsx(
|
|
2157
|
+
v && W && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea wandox-console-paramarea--state", children: [
|
|
2158
|
+
/* @__PURE__ */ e.jsx(Bn, {}),
|
|
2135
2159
|
/* @__PURE__ */ e.jsx("span", { children: "正在读取场景参数..." })
|
|
2136
2160
|
] }),
|
|
2137
|
-
|
|
2161
|
+
v && !W && ie && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea wandox-console-paramarea--state", children: [
|
|
2138
2162
|
/* @__PURE__ */ e.jsx("span", { children: "场景参数加载失败" }),
|
|
2139
2163
|
/* @__PURE__ */ e.jsxs(
|
|
2140
2164
|
"button",
|
|
2141
2165
|
{
|
|
2142
2166
|
type: "button",
|
|
2143
2167
|
className: "wandox-console-paramarea__retry",
|
|
2144
|
-
onClick: () => void
|
|
2168
|
+
onClick: () => void Fe(v),
|
|
2145
2169
|
children: [
|
|
2146
|
-
/* @__PURE__ */ e.jsx(
|
|
2170
|
+
/* @__PURE__ */ e.jsx(ls, {}),
|
|
2147
2171
|
"重试"
|
|
2148
2172
|
]
|
|
2149
2173
|
}
|
|
2150
2174
|
)
|
|
2151
2175
|
] }),
|
|
2152
|
-
|
|
2176
|
+
v && !W && !ie && ne.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea", children: [
|
|
2153
2177
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramhead", children: [
|
|
2154
|
-
/* @__PURE__ */ e.jsx(
|
|
2178
|
+
/* @__PURE__ */ e.jsx(ks, {}),
|
|
2155
2179
|
/* @__PURE__ */ e.jsx("strong", { children: "确认分析范围" }),
|
|
2156
2180
|
/* @__PURE__ */ e.jsxs("span", { className: "wandox-console-paramhead__status", children: [
|
|
2157
|
-
/* @__PURE__ */ e.jsx(
|
|
2181
|
+
/* @__PURE__ */ e.jsx(Ca, {}),
|
|
2158
2182
|
" ",
|
|
2159
|
-
|
|
2183
|
+
Re.length > 0 ? `待填 ${Re.length} 项必填参数` : "参数已就绪"
|
|
2160
2184
|
] })
|
|
2161
2185
|
] }),
|
|
2162
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-params", children:
|
|
2163
|
-
|
|
2186
|
+
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-params", children: ne.map((o) => /* @__PURE__ */ e.jsx(
|
|
2187
|
+
Ss,
|
|
2164
2188
|
{
|
|
2165
|
-
field:
|
|
2166
|
-
value:
|
|
2167
|
-
uploading: !!
|
|
2189
|
+
field: o,
|
|
2190
|
+
value: U[o.name],
|
|
2191
|
+
uploading: !!pe[o.name],
|
|
2168
2192
|
fileNameMap: B,
|
|
2169
|
-
getOptionState:
|
|
2170
|
-
onChange:
|
|
2171
|
-
onUpload:
|
|
2193
|
+
getOptionState: Se.getFieldState,
|
|
2194
|
+
onChange: Oe,
|
|
2195
|
+
onUpload: da
|
|
2172
2196
|
},
|
|
2173
|
-
|
|
2197
|
+
o.name
|
|
2174
2198
|
)) })
|
|
2175
2199
|
] }),
|
|
2176
2200
|
/* @__PURE__ */ e.jsxs(
|
|
2177
2201
|
"div",
|
|
2178
2202
|
{
|
|
2179
|
-
className: `wandox-console-prompt__foot${
|
|
2203
|
+
className: `wandox-console-prompt__foot${v ? " wandox-console-prompt__foot--scene" : ""}`,
|
|
2180
2204
|
children: [
|
|
2181
|
-
!
|
|
2205
|
+
!v && /* @__PURE__ */ e.jsx(
|
|
2182
2206
|
"button",
|
|
2183
2207
|
{
|
|
2184
2208
|
type: "button",
|
|
2185
2209
|
className: "wandox-console-attach",
|
|
2186
2210
|
onClick: () => {
|
|
2187
|
-
var
|
|
2188
|
-
return (
|
|
2211
|
+
var o;
|
|
2212
|
+
return (o = Ae.current) == null ? void 0 : o.click();
|
|
2189
2213
|
},
|
|
2190
|
-
disabled:
|
|
2191
|
-
title:
|
|
2192
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2214
|
+
disabled: ve,
|
|
2215
|
+
title: ve ? "上传中…" : "附件",
|
|
2216
|
+
children: /* @__PURE__ */ e.jsx(zn, {})
|
|
2193
2217
|
}
|
|
2194
2218
|
),
|
|
2195
2219
|
/* @__PURE__ */ e.jsx(
|
|
2196
2220
|
"input",
|
|
2197
2221
|
{
|
|
2198
|
-
ref:
|
|
2222
|
+
ref: Ae,
|
|
2199
2223
|
type: "file",
|
|
2200
2224
|
multiple: !0,
|
|
2201
2225
|
accept: "image/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip",
|
|
2202
2226
|
hidden: !0,
|
|
2203
|
-
onChange:
|
|
2227
|
+
onChange: Qe
|
|
2204
2228
|
}
|
|
2205
2229
|
),
|
|
2206
|
-
|
|
2230
|
+
v ? /* @__PURE__ */ e.jsxs(
|
|
2207
2231
|
"button",
|
|
2208
2232
|
{
|
|
2209
2233
|
type: "button",
|
|
2210
2234
|
className: "wandox-console-start",
|
|
2211
|
-
disabled:
|
|
2235
|
+
disabled: W || !!ie || Re.length > 0,
|
|
2212
2236
|
onClick: () => {
|
|
2213
|
-
|
|
2214
|
-
playbookId:
|
|
2215
|
-
playbookParams:
|
|
2216
|
-
message:
|
|
2217
|
-
attachments:
|
|
2237
|
+
R == null || R({
|
|
2238
|
+
playbookId: v.playbook_id,
|
|
2239
|
+
playbookParams: U,
|
|
2240
|
+
message: v.title,
|
|
2241
|
+
attachments: fe
|
|
2218
2242
|
});
|
|
2219
2243
|
},
|
|
2220
2244
|
children: [
|
|
2221
2245
|
"开始执行",
|
|
2222
|
-
/* @__PURE__ */ e.jsx(
|
|
2246
|
+
/* @__PURE__ */ e.jsx(Ra, {})
|
|
2223
2247
|
]
|
|
2224
2248
|
}
|
|
2225
2249
|
) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-prompt__foot-right", children: /* @__PURE__ */ e.jsx(
|
|
@@ -2227,37 +2251,37 @@ function ko({
|
|
|
2227
2251
|
{
|
|
2228
2252
|
type: "button",
|
|
2229
2253
|
className: "wandox-console-prompt__send",
|
|
2230
|
-
disabled:
|
|
2254
|
+
disabled: !$.trim(),
|
|
2231
2255
|
onClick: () => {
|
|
2232
|
-
|
|
2256
|
+
R == null || R({
|
|
2233
2257
|
playbookParams: {},
|
|
2234
|
-
message:
|
|
2235
|
-
attachments:
|
|
2258
|
+
message: $.trim(),
|
|
2259
|
+
attachments: fe
|
|
2236
2260
|
});
|
|
2237
2261
|
},
|
|
2238
2262
|
"aria-label": "发送",
|
|
2239
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2263
|
+
children: /* @__PURE__ */ e.jsx(qn, {})
|
|
2240
2264
|
}
|
|
2241
2265
|
) })
|
|
2242
2266
|
]
|
|
2243
2267
|
}
|
|
2244
2268
|
)
|
|
2245
2269
|
] }),
|
|
2246
|
-
|
|
2247
|
-
|
|
2270
|
+
fe.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-attachments", children: fe.map((o) => /* @__PURE__ */ e.jsxs("span", { className: "wandox-console-attach-item", children: [
|
|
2271
|
+
o.type === "image" ? /* @__PURE__ */ e.jsx(
|
|
2248
2272
|
"img",
|
|
2249
2273
|
{
|
|
2250
|
-
src:
|
|
2251
|
-
alt:
|
|
2274
|
+
src: o.url,
|
|
2275
|
+
alt: o.name,
|
|
2252
2276
|
className: "wandox-console-attach-item__thumb"
|
|
2253
2277
|
}
|
|
2254
|
-
) : /* @__PURE__ */ e.jsx(
|
|
2278
|
+
) : /* @__PURE__ */ e.jsx(Wn, { className: "wandox-console-attach-item__icon" }),
|
|
2255
2279
|
/* @__PURE__ */ e.jsx(
|
|
2256
2280
|
"span",
|
|
2257
2281
|
{
|
|
2258
2282
|
className: "wandox-console-attach-item__name",
|
|
2259
|
-
title:
|
|
2260
|
-
children:
|
|
2283
|
+
title: o.name,
|
|
2284
|
+
children: o.name
|
|
2261
2285
|
}
|
|
2262
2286
|
),
|
|
2263
2287
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2266,21 +2290,21 @@ function ko({
|
|
|
2266
2290
|
type: "button",
|
|
2267
2291
|
className: "wandox-console-attach-item__remove",
|
|
2268
2292
|
"aria-label": "移除附件",
|
|
2269
|
-
onClick: () =>
|
|
2270
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2293
|
+
onClick: () => Pe(o.url),
|
|
2294
|
+
children: /* @__PURE__ */ e.jsx(ps, {})
|
|
2271
2295
|
}
|
|
2272
2296
|
)
|
|
2273
|
-
] },
|
|
2297
|
+
] }, o.url)) }),
|
|
2274
2298
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scenehead", children: [
|
|
2275
|
-
|
|
2299
|
+
G && /* @__PURE__ */ e.jsx(
|
|
2276
2300
|
"button",
|
|
2277
2301
|
{
|
|
2278
2302
|
type: "button",
|
|
2279
2303
|
className: "wandox-console-chipnav",
|
|
2280
2304
|
"aria-label": "上一页分类",
|
|
2281
|
-
disabled:
|
|
2282
|
-
onClick: () =>
|
|
2283
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2305
|
+
disabled: K === 0,
|
|
2306
|
+
onClick: () => Ce((o) => Math.max(0, o - 1)),
|
|
2307
|
+
children: /* @__PURE__ */ e.jsx(ut, {})
|
|
2284
2308
|
}
|
|
2285
2309
|
),
|
|
2286
2310
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2289,217 +2313,217 @@ function ko({
|
|
|
2289
2313
|
className: "wandox-console-chips",
|
|
2290
2314
|
role: "tablist",
|
|
2291
2315
|
"aria-label": "场景分类",
|
|
2292
|
-
children:
|
|
2316
|
+
children: X.map((o) => /* @__PURE__ */ e.jsx(
|
|
2293
2317
|
"button",
|
|
2294
2318
|
{
|
|
2295
2319
|
type: "button",
|
|
2296
2320
|
role: "tab",
|
|
2297
|
-
"aria-selected":
|
|
2298
|
-
className: `wandox-console-chip${
|
|
2299
|
-
onClick: () => _ == null ? void 0 : _(
|
|
2300
|
-
children: /* @__PURE__ */ e.jsx("span", { children:
|
|
2321
|
+
"aria-selected": u === o.key,
|
|
2322
|
+
className: `wandox-console-chip${u === o.key ? " wandox-console-chip--active" : ""}`,
|
|
2323
|
+
onClick: () => _ == null ? void 0 : _(o.key),
|
|
2324
|
+
children: /* @__PURE__ */ e.jsx("span", { children: o.name })
|
|
2301
2325
|
},
|
|
2302
|
-
|
|
2326
|
+
o.key
|
|
2303
2327
|
))
|
|
2304
2328
|
}
|
|
2305
2329
|
),
|
|
2306
|
-
|
|
2330
|
+
G && /* @__PURE__ */ e.jsx(
|
|
2307
2331
|
"button",
|
|
2308
2332
|
{
|
|
2309
2333
|
type: "button",
|
|
2310
2334
|
className: "wandox-console-chipnav",
|
|
2311
2335
|
"aria-label": "下一页分类",
|
|
2312
|
-
disabled:
|
|
2313
|
-
onClick: () =>
|
|
2314
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2336
|
+
disabled: K === J - 1,
|
|
2337
|
+
onClick: () => Ce((o) => Math.min(J - 1, o + 1)),
|
|
2338
|
+
children: /* @__PURE__ */ e.jsx(pt, {})
|
|
2315
2339
|
}
|
|
2316
2340
|
),
|
|
2317
2341
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenesearch", children: /* @__PURE__ */ e.jsx(
|
|
2318
|
-
|
|
2342
|
+
La,
|
|
2319
2343
|
{
|
|
2320
2344
|
allowClear: !0,
|
|
2321
|
-
prefix: /* @__PURE__ */ e.jsx(
|
|
2345
|
+
prefix: /* @__PURE__ */ e.jsx(ga, {}),
|
|
2322
2346
|
placeholder: "搜索当前地图下的场景",
|
|
2323
2347
|
value: L,
|
|
2324
|
-
onChange: (
|
|
2348
|
+
onChange: (o) => S(o.target.value)
|
|
2325
2349
|
}
|
|
2326
2350
|
) })
|
|
2327
2351
|
] })
|
|
2328
2352
|
] }),
|
|
2329
|
-
|
|
2353
|
+
b && /* @__PURE__ */ e.jsxs(
|
|
2330
2354
|
"section",
|
|
2331
2355
|
{
|
|
2332
2356
|
className: "wandox-console-scene-section",
|
|
2333
2357
|
"aria-label": "个性化场景",
|
|
2334
2358
|
children: [
|
|
2335
2359
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-scene-section__header", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("h2", { children: "为你推荐" }) }) }),
|
|
2336
|
-
|
|
2360
|
+
j ? /* @__PURE__ */ e.jsxs(
|
|
2337
2361
|
"div",
|
|
2338
2362
|
{
|
|
2339
2363
|
className: "wandox-console-agents__loading",
|
|
2340
2364
|
style: { justifyContent: "center", padding: "40px 0" },
|
|
2341
2365
|
children: [
|
|
2342
|
-
/* @__PURE__ */ e.jsx(
|
|
2366
|
+
/* @__PURE__ */ e.jsx(Na, { size: "small" }),
|
|
2343
2367
|
/* @__PURE__ */ e.jsx("span", { children: "正在加载场景..." })
|
|
2344
2368
|
]
|
|
2345
2369
|
}
|
|
2346
|
-
) : p &&
|
|
2370
|
+
) : p && se.length === 0 ? /* @__PURE__ */ e.jsxs(
|
|
2347
2371
|
"div",
|
|
2348
2372
|
{
|
|
2349
2373
|
className: "wandox-console-agents__error",
|
|
2350
2374
|
style: { alignItems: "center", padding: "32px 0" },
|
|
2351
2375
|
children: [
|
|
2352
2376
|
/* @__PURE__ */ e.jsx("span", { children: p }),
|
|
2353
|
-
/* @__PURE__ */ e.jsxs("button", { type: "button", onClick:
|
|
2354
|
-
/* @__PURE__ */ e.jsx(
|
|
2377
|
+
/* @__PURE__ */ e.jsxs("button", { type: "button", onClick: f, children: [
|
|
2378
|
+
/* @__PURE__ */ e.jsx(ls, {}),
|
|
2355
2379
|
"重试"
|
|
2356
2380
|
] })
|
|
2357
2381
|
]
|
|
2358
2382
|
}
|
|
2359
|
-
) :
|
|
2360
|
-
/* @__PURE__ */ e.jsx(
|
|
2383
|
+
) : Ee.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene-section__empty", children: [
|
|
2384
|
+
/* @__PURE__ */ e.jsx(ga, {}),
|
|
2361
2385
|
/* @__PURE__ */ e.jsx("span", { children: L ? "没有匹配的场景" : "当前分类暂无场景" })
|
|
2362
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes", children:
|
|
2363
|
-
const
|
|
2386
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes", children: Ee.map((o) => {
|
|
2387
|
+
const w = It(o), N = At(o), g = Et(o.tags);
|
|
2364
2388
|
return /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene-wrap", children: [
|
|
2365
2389
|
/* @__PURE__ */ e.jsx(
|
|
2366
2390
|
"button",
|
|
2367
2391
|
{
|
|
2368
2392
|
type: "button",
|
|
2369
|
-
className: `wandox-console-scene${
|
|
2370
|
-
onClick: () =>
|
|
2393
|
+
className: `wandox-console-scene${N ? " wandox-console-scene--featured" : ""}${I === o.playbook_id ? " wandox-console-scene--selected" : ""}`,
|
|
2394
|
+
onClick: () => Fe(o),
|
|
2371
2395
|
children: /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene__body", children: [
|
|
2372
2396
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene__head", children: [
|
|
2373
|
-
/* @__PURE__ */ e.jsx("strong", { title:
|
|
2374
|
-
|
|
2397
|
+
/* @__PURE__ */ e.jsx("strong", { title: o.title, children: o.title }),
|
|
2398
|
+
w && /* @__PURE__ */ e.jsx(
|
|
2375
2399
|
"span",
|
|
2376
2400
|
{
|
|
2377
|
-
className: `wandox-console-scene__badge wandox-console-scene__badge--${
|
|
2378
|
-
children:
|
|
2401
|
+
className: `wandox-console-scene__badge wandox-console-scene__badge--${w.kind}`,
|
|
2402
|
+
children: w.text
|
|
2379
2403
|
}
|
|
2380
2404
|
)
|
|
2381
2405
|
] }),
|
|
2382
|
-
|
|
2406
|
+
o.desc && /* @__PURE__ */ e.jsx(
|
|
2383
2407
|
"span",
|
|
2384
2408
|
{
|
|
2385
2409
|
className: "wandox-console-scene__desc",
|
|
2386
|
-
title:
|
|
2387
|
-
children:
|
|
2410
|
+
title: o.desc,
|
|
2411
|
+
children: o.desc
|
|
2388
2412
|
}
|
|
2389
2413
|
),
|
|
2390
|
-
(
|
|
2391
|
-
|
|
2392
|
-
|
|
2414
|
+
(N || g.length > 0) && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene__tags", children: [
|
|
2415
|
+
N && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-scene__tag wandox-console-scene__tag--featured", children: "精品" }),
|
|
2416
|
+
g.map((C, ue) => /* @__PURE__ */ e.jsx(
|
|
2393
2417
|
"span",
|
|
2394
2418
|
{
|
|
2395
2419
|
className: "wandox-console-scene__tag",
|
|
2396
|
-
style:
|
|
2397
|
-
children:
|
|
2420
|
+
style: Pt(C),
|
|
2421
|
+
children: C.name
|
|
2398
2422
|
},
|
|
2399
|
-
`${
|
|
2423
|
+
`${C.name}-${ue}`
|
|
2400
2424
|
))
|
|
2401
2425
|
] })
|
|
2402
2426
|
] })
|
|
2403
2427
|
}
|
|
2404
2428
|
),
|
|
2405
|
-
|
|
2429
|
+
o.video_url && /* @__PURE__ */ e.jsxs(
|
|
2406
2430
|
"button",
|
|
2407
2431
|
{
|
|
2408
2432
|
type: "button",
|
|
2409
2433
|
className: "wandox-console-scene__video",
|
|
2410
|
-
"aria-label": `播放${
|
|
2411
|
-
onClick: (
|
|
2434
|
+
"aria-label": `播放${o.title}演示视频`,
|
|
2435
|
+
onClick: (C) => re(C, o),
|
|
2412
2436
|
children: [
|
|
2413
2437
|
"▶ ",
|
|
2414
|
-
|
|
2438
|
+
Cs(o.video_duration),
|
|
2415
2439
|
" 演示"
|
|
2416
2440
|
]
|
|
2417
2441
|
}
|
|
2418
2442
|
)
|
|
2419
|
-
] },
|
|
2443
|
+
] }, o.key);
|
|
2420
2444
|
}) }) })
|
|
2421
2445
|
]
|
|
2422
2446
|
}
|
|
2423
2447
|
)
|
|
2424
2448
|
] }),
|
|
2425
2449
|
/* @__PURE__ */ e.jsx(
|
|
2426
|
-
|
|
2450
|
+
xs,
|
|
2427
2451
|
{
|
|
2428
|
-
playbook:
|
|
2452
|
+
playbook: Te,
|
|
2429
2453
|
onClose: () => O(null)
|
|
2430
2454
|
}
|
|
2431
2455
|
)
|
|
2432
2456
|
] });
|
|
2433
2457
|
}
|
|
2434
|
-
function
|
|
2435
|
-
return
|
|
2458
|
+
function At(t) {
|
|
2459
|
+
return t.is_featured === !0 || t.badge === "featured";
|
|
2436
2460
|
}
|
|
2437
|
-
function
|
|
2438
|
-
return
|
|
2461
|
+
function It(t) {
|
|
2462
|
+
return t.badge === "recommend" ? { text: "推荐", kind: "recommend" } : t.badge === "new" ? { text: "New", kind: "new" } : null;
|
|
2439
2463
|
}
|
|
2440
|
-
function
|
|
2441
|
-
return Array.isArray(
|
|
2464
|
+
function Et(t) {
|
|
2465
|
+
return Array.isArray(t) ? t.filter(
|
|
2442
2466
|
(l) => typeof (l == null ? void 0 : l.name) == "string" && l.name.trim() !== ""
|
|
2443
2467
|
) : [];
|
|
2444
2468
|
}
|
|
2445
|
-
function
|
|
2446
|
-
if (!(
|
|
2469
|
+
function Pt(t) {
|
|
2470
|
+
if (!(t.variant !== "soft" || !t.color))
|
|
2447
2471
|
return {
|
|
2448
|
-
color:
|
|
2449
|
-
borderColor:
|
|
2450
|
-
backgroundColor:
|
|
2472
|
+
color: t.color,
|
|
2473
|
+
borderColor: us(t.color, 0.28),
|
|
2474
|
+
backgroundColor: us(t.color, 0.08)
|
|
2451
2475
|
};
|
|
2452
2476
|
}
|
|
2453
|
-
function
|
|
2454
|
-
const r =
|
|
2455
|
-
if (!/^[0-9a-fA-F]{6}$/.test(r)) return
|
|
2456
|
-
const
|
|
2457
|
-
return `rgba(${
|
|
2477
|
+
function us(t, l) {
|
|
2478
|
+
const r = t.trim().replace("#", "");
|
|
2479
|
+
if (!/^[0-9a-fA-F]{6}$/.test(r)) return t;
|
|
2480
|
+
const u = Number.parseInt(r.slice(0, 2), 16), _ = Number.parseInt(r.slice(2, 4), 16), j = Number.parseInt(r.slice(4, 6), 16);
|
|
2481
|
+
return `rgba(${u}, ${_}, ${j}, ${l})`;
|
|
2458
2482
|
}
|
|
2459
|
-
const
|
|
2483
|
+
const Lt = [
|
|
2460
2484
|
{
|
|
2461
2485
|
id: "conversation",
|
|
2462
2486
|
title: "智能体",
|
|
2463
2487
|
desc: "与智能体自由对话或选择场景执行任务",
|
|
2464
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2488
|
+
icon: /* @__PURE__ */ e.jsx(Xn, {}),
|
|
2465
2489
|
accent: "#4f46e5"
|
|
2466
2490
|
},
|
|
2467
2491
|
{
|
|
2468
2492
|
id: "automation",
|
|
2469
2493
|
title: "自动化",
|
|
2470
2494
|
desc: "管理与执行自动化流程、定时任务与驾驶舱",
|
|
2471
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2495
|
+
icon: /* @__PURE__ */ e.jsx(Hn, {}),
|
|
2472
2496
|
accent: "#4f46e5"
|
|
2473
2497
|
}
|
|
2474
|
-
],
|
|
2498
|
+
], Ke = {
|
|
2475
2499
|
id: "notification",
|
|
2476
2500
|
title: "通知配置",
|
|
2477
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2501
|
+
icon: /* @__PURE__ */ e.jsx(vs, {}),
|
|
2478
2502
|
accent: "#e0730c"
|
|
2479
2503
|
};
|
|
2480
|
-
function
|
|
2481
|
-
features:
|
|
2504
|
+
function Mt({
|
|
2505
|
+
features: t,
|
|
2482
2506
|
onOpenFeature: l,
|
|
2483
2507
|
activeId: r
|
|
2484
2508
|
}) {
|
|
2485
2509
|
return /* @__PURE__ */ e.jsxs("header", { className: "wandox-console-topnav", "aria-label": "控制台顶部导航", children: [
|
|
2486
|
-
/* @__PURE__ */ e.jsx("nav", { className: "wandox-console-topnav__pill", "aria-label": "工作台", children:
|
|
2487
|
-
const _ = r ===
|
|
2510
|
+
/* @__PURE__ */ e.jsx("nav", { className: "wandox-console-topnav__pill", "aria-label": "工作台", children: t.map((u) => {
|
|
2511
|
+
const _ = r === u.id;
|
|
2488
2512
|
return /* @__PURE__ */ e.jsxs(
|
|
2489
2513
|
"button",
|
|
2490
2514
|
{
|
|
2491
2515
|
type: "button",
|
|
2492
2516
|
className: `wandox-console-topnav__pill-btn${_ ? " wandox-console-topnav__pill-btn--active" : ""}`,
|
|
2493
|
-
title:
|
|
2494
|
-
"aria-label":
|
|
2517
|
+
title: u.title,
|
|
2518
|
+
"aria-label": u.title,
|
|
2495
2519
|
"aria-current": _ ? "page" : void 0,
|
|
2496
|
-
onClick: () => l(
|
|
2520
|
+
onClick: () => l(u.id),
|
|
2497
2521
|
children: [
|
|
2498
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__pill-icon", children:
|
|
2499
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__pill-text", children:
|
|
2522
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__pill-icon", children: u.icon }),
|
|
2523
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__pill-text", children: u.title })
|
|
2500
2524
|
]
|
|
2501
2525
|
},
|
|
2502
|
-
|
|
2526
|
+
u.id
|
|
2503
2527
|
);
|
|
2504
2528
|
}) }),
|
|
2505
2529
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2508,43 +2532,43 @@ function Io({
|
|
|
2508
2532
|
type: "button",
|
|
2509
2533
|
className: "wandox-console-topnav__notify",
|
|
2510
2534
|
style: {
|
|
2511
|
-
"--notify-accent":
|
|
2535
|
+
"--notify-accent": Ke.accent
|
|
2512
2536
|
},
|
|
2513
|
-
title:
|
|
2514
|
-
"aria-label":
|
|
2515
|
-
onClick: () => l(
|
|
2516
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__notify-icon", children:
|
|
2537
|
+
title: Ke.title,
|
|
2538
|
+
"aria-label": Ke.title,
|
|
2539
|
+
onClick: () => l(Ke.id),
|
|
2540
|
+
children: /* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__notify-icon", children: Ke.icon })
|
|
2517
2541
|
}
|
|
2518
2542
|
)
|
|
2519
2543
|
] });
|
|
2520
2544
|
}
|
|
2521
|
-
function
|
|
2522
|
-
className:
|
|
2545
|
+
function Tt({
|
|
2546
|
+
className: t = "",
|
|
2523
2547
|
state: l = "idle"
|
|
2524
2548
|
}) {
|
|
2525
2549
|
return /* @__PURE__ */ e.jsx(
|
|
2526
2550
|
"img",
|
|
2527
2551
|
{
|
|
2528
|
-
className: `wandox-console-companion${
|
|
2552
|
+
className: `wandox-console-companion${t ? ` ${t}` : ""}`,
|
|
2529
2553
|
"data-state": l,
|
|
2530
|
-
src:
|
|
2554
|
+
src: Un,
|
|
2531
2555
|
alt: "",
|
|
2532
2556
|
"aria-hidden": "true"
|
|
2533
2557
|
}
|
|
2534
2558
|
);
|
|
2535
2559
|
}
|
|
2536
|
-
function
|
|
2560
|
+
function ms({ fading: t }) {
|
|
2537
2561
|
return /* @__PURE__ */ e.jsxs(
|
|
2538
2562
|
"div",
|
|
2539
2563
|
{
|
|
2540
|
-
className: `wandox-console-init${
|
|
2564
|
+
className: `wandox-console-init${t ? " wandox-console-init--fading" : ""}`,
|
|
2541
2565
|
"aria-hidden": !0,
|
|
2542
2566
|
children: [
|
|
2543
2567
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-init__halo wandox-console-init__halo--a" }),
|
|
2544
2568
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-init__halo wandox-console-init__halo--b" }),
|
|
2545
2569
|
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-init__inner", children: [
|
|
2546
2570
|
/* @__PURE__ */ e.jsx(
|
|
2547
|
-
|
|
2571
|
+
Tt,
|
|
2548
2572
|
{
|
|
2549
2573
|
className: "wandox-console-init__companion",
|
|
2550
2574
|
state: "thinking"
|
|
@@ -2567,17 +2591,17 @@ function ls({ fading: o }) {
|
|
|
2567
2591
|
}
|
|
2568
2592
|
);
|
|
2569
2593
|
}
|
|
2570
|
-
function
|
|
2571
|
-
title:
|
|
2594
|
+
function hs({
|
|
2595
|
+
title: t,
|
|
2572
2596
|
onBack: l,
|
|
2573
2597
|
hideHeader: r = !1,
|
|
2574
|
-
className:
|
|
2598
|
+
className: u,
|
|
2575
2599
|
children: _
|
|
2576
2600
|
}) {
|
|
2577
2601
|
return /* @__PURE__ */ e.jsxs(
|
|
2578
2602
|
"div",
|
|
2579
2603
|
{
|
|
2580
|
-
className: `wandox-console-featureview${
|
|
2604
|
+
className: `wandox-console-featureview${u ? ` ${u}` : ""}`,
|
|
2581
2605
|
children: [
|
|
2582
2606
|
!r && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-featureview__bar", children: [
|
|
2583
2607
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2587,155 +2611,155 @@ function is({
|
|
|
2587
2611
|
className: "wandox-console-featureview__back",
|
|
2588
2612
|
onClick: l,
|
|
2589
2613
|
children: [
|
|
2590
|
-
/* @__PURE__ */ e.jsx(
|
|
2614
|
+
/* @__PURE__ */ e.jsx(gs, {}),
|
|
2591
2615
|
"返回控制台"
|
|
2592
2616
|
]
|
|
2593
2617
|
}
|
|
2594
2618
|
),
|
|
2595
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-featureview__title", children:
|
|
2619
|
+
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-featureview__title", children: t })
|
|
2596
2620
|
] }),
|
|
2597
2621
|
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-featureview__body", children: _ })
|
|
2598
2622
|
]
|
|
2599
2623
|
}
|
|
2600
2624
|
);
|
|
2601
2625
|
}
|
|
2602
|
-
function
|
|
2603
|
-
agents:
|
|
2626
|
+
function Vt({
|
|
2627
|
+
agents: t,
|
|
2604
2628
|
initialAgentId: l,
|
|
2605
2629
|
initialPlaybookId: r,
|
|
2606
|
-
initialPlaybookParams:
|
|
2630
|
+
initialPlaybookParams: u,
|
|
2607
2631
|
onReady: _
|
|
2608
2632
|
} = {}) {
|
|
2609
2633
|
const {
|
|
2610
|
-
agents:
|
|
2634
|
+
agents: j,
|
|
2611
2635
|
agentLoading: p,
|
|
2612
|
-
selectedAgentId:
|
|
2613
|
-
selectedAgent:
|
|
2636
|
+
selectedAgentId: f,
|
|
2637
|
+
selectedAgent: R,
|
|
2614
2638
|
selectAgent: F,
|
|
2615
2639
|
...Y
|
|
2616
|
-
} =
|
|
2640
|
+
} = et({ presetAgents: t, initialAgentId: l }), [z, me] = s.useState(null), $ = s.useRef(null), q = s.useRef(!1), [L, S] = s.useState("home"), [h, O] = s.useState(
|
|
2617
2641
|
null
|
|
2618
|
-
), [
|
|
2619
|
-
if (
|
|
2620
|
-
|
|
2642
|
+
), [he, D] = s.useState(!1), [E, W] = s.useState(null), [le, ie] = s.useState(""), H = R == null ? void 0 : R.name, V = s.useCallback((b) => {
|
|
2643
|
+
if ($.current) {
|
|
2644
|
+
$.current.showInspectionResults(b);
|
|
2621
2645
|
return;
|
|
2622
2646
|
}
|
|
2623
|
-
|
|
2647
|
+
me({ robotName: b });
|
|
2624
2648
|
}, []);
|
|
2625
2649
|
s.useEffect(() => {
|
|
2626
2650
|
_ == null || _({ showInspectionResults: V });
|
|
2627
2651
|
}, [V, _]), s.useEffect(() => {
|
|
2628
|
-
!
|
|
2629
|
-
agentId:
|
|
2630
|
-
agentName:
|
|
2652
|
+
!z || $.current || !f || L === "chat" || (W({
|
|
2653
|
+
agentId: f,
|
|
2654
|
+
agentName: H,
|
|
2631
2655
|
playbookParams: {},
|
|
2632
2656
|
message: ""
|
|
2633
|
-
}),
|
|
2634
|
-
}, [L,
|
|
2635
|
-
|
|
2636
|
-
}, [
|
|
2657
|
+
}), S("chat"));
|
|
2658
|
+
}, [L, z, f, H]), s.useEffect(() => {
|
|
2659
|
+
ie("");
|
|
2660
|
+
}, [f]);
|
|
2637
2661
|
const {
|
|
2638
|
-
playbooks:
|
|
2662
|
+
playbooks: U,
|
|
2639
2663
|
userPlaybooks: Z,
|
|
2640
|
-
useMapCategories:
|
|
2664
|
+
useMapCategories: pe,
|
|
2641
2665
|
useMapCards: A,
|
|
2642
2666
|
sceneLoading: B,
|
|
2643
|
-
useMapError:
|
|
2644
|
-
reload:
|
|
2645
|
-
} = Y,
|
|
2646
|
-
() =>
|
|
2647
|
-
[
|
|
2667
|
+
useMapError: Ne,
|
|
2668
|
+
reload: fe
|
|
2669
|
+
} = Y, xe = s.useMemo(
|
|
2670
|
+
() => pe.length > 0 ? pe : at(U),
|
|
2671
|
+
[pe, U]
|
|
2648
2672
|
);
|
|
2649
2673
|
s.useEffect(() => {
|
|
2650
|
-
if (
|
|
2651
|
-
|
|
2652
|
-
(
|
|
2653
|
-
) ||
|
|
2654
|
-
}, [
|
|
2655
|
-
const
|
|
2674
|
+
if (xe.length === 0) return;
|
|
2675
|
+
xe.some(
|
|
2676
|
+
(I) => I.key === le
|
|
2677
|
+
) || ie(xe[0].key);
|
|
2678
|
+
}, [xe]);
|
|
2679
|
+
const ve = s.useRef(!1);
|
|
2656
2680
|
s.useEffect(() => {
|
|
2657
|
-
if (
|
|
2681
|
+
if (ve.current || !r || !f || B)
|
|
2658
2682
|
return;
|
|
2659
|
-
const
|
|
2660
|
-
(
|
|
2683
|
+
const b = j.find(
|
|
2684
|
+
(I) => I.id === f && rs(I, l)
|
|
2661
2685
|
);
|
|
2662
|
-
|
|
2663
|
-
agentId:
|
|
2664
|
-
agentName:
|
|
2686
|
+
b && (ve.current = !0, W({
|
|
2687
|
+
agentId: f,
|
|
2688
|
+
agentName: b.name,
|
|
2665
2689
|
playbookId: r,
|
|
2666
|
-
playbookParams:
|
|
2690
|
+
playbookParams: u || {},
|
|
2667
2691
|
message: ""
|
|
2668
|
-
}),
|
|
2692
|
+
}), S("chat"));
|
|
2669
2693
|
}, [
|
|
2670
2694
|
B,
|
|
2671
|
-
|
|
2695
|
+
j,
|
|
2672
2696
|
l,
|
|
2673
2697
|
r,
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2698
|
+
u,
|
|
2699
|
+
f,
|
|
2700
|
+
H
|
|
2677
2701
|
]), s.useEffect(() => {
|
|
2678
|
-
if (
|
|
2702
|
+
if (q.current || !l || r || !f || B)
|
|
2679
2703
|
return;
|
|
2680
|
-
const
|
|
2681
|
-
(
|
|
2704
|
+
const b = j.find(
|
|
2705
|
+
(I) => I.id === f && rs(I, l)
|
|
2682
2706
|
);
|
|
2683
|
-
|
|
2684
|
-
agentId:
|
|
2685
|
-
agentName:
|
|
2707
|
+
b && (q.current = !0, W({
|
|
2708
|
+
agentId: b.id,
|
|
2709
|
+
agentName: b.name,
|
|
2686
2710
|
playbookParams: {},
|
|
2687
2711
|
message: ""
|
|
2688
|
-
}),
|
|
2689
|
-
}, [
|
|
2690
|
-
const [
|
|
2712
|
+
}), S("chat"));
|
|
2713
|
+
}, [j, B, l, r, f]);
|
|
2714
|
+
const [we, Ae] = s.useState(!0), [Ie, Ce] = s.useState(!1);
|
|
2691
2715
|
s.useEffect(() => {
|
|
2692
|
-
if (!
|
|
2693
|
-
|
|
2694
|
-
const
|
|
2695
|
-
return () => clearTimeout(
|
|
2696
|
-
}, [p,
|
|
2716
|
+
if (!we || !(!p && j.length > 0 && !!f && !B)) return;
|
|
2717
|
+
Ce(!0);
|
|
2718
|
+
const oe = setTimeout(() => Ae(!1), 280);
|
|
2719
|
+
return () => clearTimeout(oe);
|
|
2720
|
+
}, [p, j.length, f, B, we]);
|
|
2697
2721
|
const J = s.useCallback(() => {
|
|
2698
|
-
|
|
2699
|
-
}, []),
|
|
2700
|
-
(
|
|
2701
|
-
if (
|
|
2722
|
+
S("home"), O(null), D(!1);
|
|
2723
|
+
}, []), K = s.useCallback(
|
|
2724
|
+
(b) => {
|
|
2725
|
+
if (b === "conversation") {
|
|
2702
2726
|
J();
|
|
2703
2727
|
return;
|
|
2704
2728
|
}
|
|
2705
|
-
D(!1), O(
|
|
2729
|
+
D(!1), O(b);
|
|
2706
2730
|
},
|
|
2707
2731
|
[J]
|
|
2708
|
-
),
|
|
2709
|
-
F(
|
|
2710
|
-
},
|
|
2711
|
-
if (
|
|
2712
|
-
const
|
|
2713
|
-
F(
|
|
2714
|
-
agentId:
|
|
2715
|
-
agentName:
|
|
2732
|
+
), G = (b) => {
|
|
2733
|
+
F(b), S("home");
|
|
2734
|
+
}, X = (b) => {
|
|
2735
|
+
if (b === f) return;
|
|
2736
|
+
const I = j.find((oe) => oe.id === b);
|
|
2737
|
+
F(b), W({
|
|
2738
|
+
agentId: b,
|
|
2739
|
+
agentName: I == null ? void 0 : I.name,
|
|
2716
2740
|
playbookParams: {},
|
|
2717
2741
|
message: ""
|
|
2718
2742
|
});
|
|
2719
|
-
},
|
|
2720
|
-
|
|
2721
|
-
agentId:
|
|
2722
|
-
agentName:
|
|
2743
|
+
}, se = () => {
|
|
2744
|
+
f && (W({
|
|
2745
|
+
agentId: f,
|
|
2746
|
+
agentName: H,
|
|
2723
2747
|
playbookParams: {},
|
|
2724
2748
|
message: ""
|
|
2725
|
-
}),
|
|
2726
|
-
},
|
|
2727
|
-
|
|
2728
|
-
agentId:
|
|
2729
|
-
agentName:
|
|
2730
|
-
playbookId:
|
|
2731
|
-
playbookParams:
|
|
2732
|
-
message:
|
|
2733
|
-
attachments:
|
|
2734
|
-
}),
|
|
2749
|
+
}), S("chat"));
|
|
2750
|
+
}, ye = (b) => {
|
|
2751
|
+
W({
|
|
2752
|
+
agentId: f,
|
|
2753
|
+
agentName: H,
|
|
2754
|
+
playbookId: b.playbookId,
|
|
2755
|
+
playbookParams: b.playbookParams,
|
|
2756
|
+
message: b.message,
|
|
2757
|
+
attachments: b.attachments
|
|
2758
|
+
}), S("chat");
|
|
2735
2759
|
};
|
|
2736
2760
|
return L === "chat" && E ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat-shell", children: [
|
|
2737
2761
|
/* @__PURE__ */ e.jsx(
|
|
2738
|
-
|
|
2762
|
+
St,
|
|
2739
2763
|
{
|
|
2740
2764
|
agentId: E.agentId,
|
|
2741
2765
|
agentName: E.agentName,
|
|
@@ -2744,47 +2768,47 @@ function Mo({
|
|
|
2744
2768
|
initialMessage: E.message,
|
|
2745
2769
|
initialAttachments: E.attachments,
|
|
2746
2770
|
useMapCards: A,
|
|
2747
|
-
useMapCategories:
|
|
2748
|
-
playbooks:
|
|
2771
|
+
useMapCategories: pe,
|
|
2772
|
+
playbooks: U,
|
|
2749
2773
|
userPlaybooks: Z,
|
|
2750
|
-
agents:
|
|
2751
|
-
onReady: (
|
|
2752
|
-
|
|
2774
|
+
agents: j,
|
|
2775
|
+
onReady: (b) => {
|
|
2776
|
+
$.current = b, z && (b.showInspectionResults(z.robotName), me(null));
|
|
2753
2777
|
},
|
|
2754
|
-
onChangeAgent:
|
|
2778
|
+
onChangeAgent: X,
|
|
2755
2779
|
onBack: () => {
|
|
2756
|
-
|
|
2780
|
+
$.current = null, S("home");
|
|
2757
2781
|
},
|
|
2758
2782
|
onSelectScene: () => {
|
|
2759
2783
|
}
|
|
2760
2784
|
},
|
|
2761
2785
|
`${E.agentId}:${E.playbookId || "free-chat"}`
|
|
2762
2786
|
),
|
|
2763
|
-
|
|
2787
|
+
we && /* @__PURE__ */ e.jsx(ms, { fading: Ie })
|
|
2764
2788
|
] }) : /* @__PURE__ */ e.jsxs(
|
|
2765
2789
|
"div",
|
|
2766
2790
|
{
|
|
2767
|
-
className: `wandox-console${
|
|
2791
|
+
className: `wandox-console${he ? " wandox-console--secondary" : ""}`,
|
|
2768
2792
|
children: [
|
|
2769
|
-
|
|
2770
|
-
!
|
|
2771
|
-
|
|
2793
|
+
we && /* @__PURE__ */ e.jsx(ms, { fading: Ie }),
|
|
2794
|
+
!he && /* @__PURE__ */ e.jsx(
|
|
2795
|
+
Mt,
|
|
2772
2796
|
{
|
|
2773
|
-
features:
|
|
2797
|
+
features: Lt,
|
|
2774
2798
|
activeId: h ?? "conversation",
|
|
2775
|
-
onOpenFeature:
|
|
2799
|
+
onOpenFeature: K
|
|
2776
2800
|
}
|
|
2777
2801
|
),
|
|
2778
2802
|
/* @__PURE__ */ e.jsxs("main", { className: "wandox-console-main", children: [
|
|
2779
2803
|
h === "automation" && /* @__PURE__ */ e.jsx(
|
|
2780
|
-
|
|
2804
|
+
hs,
|
|
2781
2805
|
{
|
|
2782
2806
|
title: "自动化",
|
|
2783
2807
|
onBack: () => O(null),
|
|
2784
2808
|
hideHeader: !0,
|
|
2785
2809
|
className: "wandox-console-featureview--automation",
|
|
2786
2810
|
children: /* @__PURE__ */ e.jsx(
|
|
2787
|
-
|
|
2811
|
+
st,
|
|
2788
2812
|
{
|
|
2789
2813
|
onCockpitEnter: () => D(!0),
|
|
2790
2814
|
onCockpitExit: () => D(!1),
|
|
@@ -2794,30 +2818,30 @@ function Mo({
|
|
|
2794
2818
|
}
|
|
2795
2819
|
),
|
|
2796
2820
|
h === "notification" && /* @__PURE__ */ e.jsx(
|
|
2797
|
-
|
|
2821
|
+
hs,
|
|
2798
2822
|
{
|
|
2799
2823
|
title: "通知配置",
|
|
2800
2824
|
onBack: () => O(null),
|
|
2801
2825
|
hideHeader: !0,
|
|
2802
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2826
|
+
children: /* @__PURE__ */ e.jsx(nt, {})
|
|
2803
2827
|
}
|
|
2804
2828
|
),
|
|
2805
2829
|
!h && /* @__PURE__ */ e.jsx(
|
|
2806
|
-
|
|
2830
|
+
$t,
|
|
2807
2831
|
{
|
|
2808
2832
|
useMapCards: A,
|
|
2809
|
-
useMapCategories:
|
|
2810
|
-
playbooks:
|
|
2811
|
-
selectedCategoryKey:
|
|
2812
|
-
onCategorySelect:
|
|
2833
|
+
useMapCategories: xe,
|
|
2834
|
+
playbooks: U,
|
|
2835
|
+
selectedCategoryKey: le,
|
|
2836
|
+
onCategorySelect: ie,
|
|
2813
2837
|
loading: B,
|
|
2814
|
-
useMapError:
|
|
2815
|
-
onRetry:
|
|
2816
|
-
onStartAnalysis:
|
|
2817
|
-
agents:
|
|
2818
|
-
selectedAgentId:
|
|
2819
|
-
onAgentSelect:
|
|
2820
|
-
onOpenAgentChat:
|
|
2838
|
+
useMapError: Ne,
|
|
2839
|
+
onRetry: fe,
|
|
2840
|
+
onStartAnalysis: ye,
|
|
2841
|
+
agents: j,
|
|
2842
|
+
selectedAgentId: f,
|
|
2843
|
+
onAgentSelect: G,
|
|
2844
|
+
onOpenAgentChat: se
|
|
2821
2845
|
}
|
|
2822
2846
|
)
|
|
2823
2847
|
] })
|
|
@@ -2826,5 +2850,5 @@ function Mo({
|
|
|
2826
2850
|
);
|
|
2827
2851
|
}
|
|
2828
2852
|
export {
|
|
2829
|
-
|
|
2853
|
+
Vt as default
|
|
2830
2854
|
};
|