@wandox/sdk 0.1.37 → 0.1.38
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-CqWNz8eg.js → V1Workbench-CX2TY1nY.js} +5 -6
- package/dist/{V1Workbench-UL6m_GSU.cjs → V1Workbench-D4MDOCK8.cjs} +3 -3
- package/dist/V2Workbench-3OIxKrwT.cjs +2 -0
- package/dist/V2Workbench-B9hpG29_.js +2674 -0
- package/dist/{WorkbenchRuntime-BPjLWyHy.cjs → WorkbenchRuntime-CcgVGiw7.cjs} +2 -2
- package/dist/{WorkbenchRuntime-kI4h_Boi.js → WorkbenchRuntime-DFoqujXl.js} +4 -4
- package/dist/{arc-B5N4v9Jv.cjs → arc-BoXgqEyE.cjs} +1 -1
- package/dist/{arc-BRgfV2vT.js → arc-DRkZQWMH.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-DUgD63Rt.js → architectureDiagram-3BPJPVTR-Cvjm2RUg.js} +3 -3
- package/dist/{architectureDiagram-3BPJPVTR-DjM6oFEx.cjs → architectureDiagram-3BPJPVTR-JB1cjWXS.cjs} +1 -1
- package/dist/{blockDiagram-GPEHLZMM-Bbk0DebD.cjs → blockDiagram-GPEHLZMM-BMrbXpB3.cjs} +1 -1
- package/dist/{blockDiagram-GPEHLZMM-6EI7pONG.js → blockDiagram-GPEHLZMM-LAE7xfhz.js} +3 -3
- package/dist/{c4Diagram-AAUBKEIU-CPATCWpo.js → c4Diagram-AAUBKEIU-CZcPU-n2.js} +2 -2
- package/dist/{c4Diagram-AAUBKEIU-UW4tUuYO.cjs → c4Diagram-AAUBKEIU-T_tWuHKf.cjs} +1 -1
- package/dist/{channel-BOuHczM9.js → channel-B8LPCyPH.js} +1 -1
- package/dist/{channel-BPVKsQR4.cjs → channel-BaiWA2t8.cjs} +1 -1
- package/dist/{chunk-2J33WTMH-JkZNZ2FQ.cjs → chunk-2J33WTMH-BibdqHFp.cjs} +1 -1
- package/dist/{chunk-2J33WTMH-BMA-WoY7.js → chunk-2J33WTMH-C5be9lBd.js} +1 -1
- package/dist/{chunk-4BX2VUAB-DJjQ2iym.cjs → chunk-4BX2VUAB-D0KvmKPe.cjs} +1 -1
- package/dist/{chunk-4BX2VUAB-CoubCo12.js → chunk-4BX2VUAB-DMFsq4KZ.js} +1 -1
- package/dist/{chunk-55IACEB6-k8m2Tb0O.cjs → chunk-55IACEB6-CqaRoYMg.cjs} +1 -1
- package/dist/{chunk-55IACEB6-B8_bbLHJ.js → chunk-55IACEB6-DmSQDD1d.js} +1 -1
- package/dist/{chunk-727SXJPM-Dk4Qx6Cj.cjs → chunk-727SXJPM-slxRZHEn.cjs} +1 -1
- package/dist/{chunk-727SXJPM-w5uqNLUJ.js → chunk-727SXJPM-zPDeBLwO.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-BC_iX9X6.js → chunk-AQP2D5EJ-CAbt8thT.js} +3 -3
- package/dist/{chunk-AQP2D5EJ-rJ3mY-t4.cjs → chunk-AQP2D5EJ-DInpQ3Bk.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-C_CgBQVs.cjs → chunk-FMBD7UC4-7r_t9A1F.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-DZlFTSR3.js → chunk-FMBD7UC4-IX1Bs9Jl.js} +1 -1
- package/dist/{chunk-ND2GUHAM-SOVIggp_.js → chunk-ND2GUHAM-BDBw_eej.js} +1 -1
- package/dist/{chunk-ND2GUHAM-rYKw1ewI.cjs → chunk-ND2GUHAM-BKWetS2i.cjs} +1 -1
- package/dist/{chunk-QZHKN3VN-D_n03X4c.cjs → chunk-QZHKN3VN-CaXwA0Ch.cjs} +1 -1
- package/dist/{chunk-QZHKN3VN-BzYA6_MS.js → chunk-QZHKN3VN-DYLGrKqP.js} +1 -1
- package/dist/{classDiagram-4FO5ZUOK-yY-LWEE5.js → classDiagram-4FO5ZUOK-BfPbGLow.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-Cus7V0-B.cjs → classDiagram-4FO5ZUOK-C8Col58-.cjs} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-D_2oVIAG.js → classDiagram-v2-Q7XG4LA2-BBAMvpEX.js} +2 -2
- package/dist/{classDiagram-v2-Q7XG4LA2-Cus7V0-B.cjs → classDiagram-v2-Q7XG4LA2-C8Col58-.cjs} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-C8A50UJc.cjs → cose-bilkent-S5V4N54A-BAGhd7Pv.cjs} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-DtK_d2nt.js → cose-bilkent-S5V4N54A-BWdSLpNe.js} +2 -2
- package/dist/{dagre-BM42HDAG-B9o52kSq.js → dagre-BM42HDAG-BeqXhsH3.js} +1 -1
- package/dist/{dagre-BM42HDAG-CctSzO0L.cjs → dagre-BM42HDAG-Bx9eEuWz.cjs} +1 -1
- package/dist/{diagram-2AECGRRQ-DeefcALf.cjs → diagram-2AECGRRQ-C1_rnEMZ.cjs} +1 -1
- package/dist/{diagram-2AECGRRQ-DEOJdLIi.js → diagram-2AECGRRQ-CD5HRvtt.js} +2 -2
- package/dist/{diagram-5GNKFQAL-C9cD2jn6.cjs → diagram-5GNKFQAL-BGP7CKfK.cjs} +1 -1
- package/dist/{diagram-5GNKFQAL-DyxjjnMI.js → diagram-5GNKFQAL-hnwUnNop.js} +3 -3
- package/dist/{diagram-KO2AKTUF-4juRrpvB.js → diagram-KO2AKTUF-C-lTMkbh.js} +2 -2
- package/dist/{diagram-KO2AKTUF-Mo7XhFrv.cjs → diagram-KO2AKTUF-Cj5RbuFk.cjs} +1 -1
- package/dist/{diagram-LMA3HP47-CxL8EBEI.js → diagram-LMA3HP47-DNNxuzUF.js} +2 -2
- package/dist/{diagram-LMA3HP47-BFs_xRRv.cjs → diagram-LMA3HP47-qynJFlE9.cjs} +1 -1
- package/dist/{diagram-OG6HWLK6-CB1fsChK.cjs → diagram-OG6HWLK6-BEw06BpQ.cjs} +1 -1
- package/dist/{diagram-OG6HWLK6-BX-585Ye.js → diagram-OG6HWLK6-D-mFnPam.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-DC0Ho0nI.js → erDiagram-TEJ5UH35-DlHPKqjs.js} +4 -4
- package/dist/{erDiagram-TEJ5UH35-vPdDZRYq.cjs → erDiagram-TEJ5UH35-ihaFG4EG.cjs} +1 -1
- package/dist/{flowDiagram-I6XJVG4X-7BW5uO8c.js → flowDiagram-I6XJVG4X-D7D28W3h.js} +6 -6
- package/dist/{flowDiagram-I6XJVG4X-BiRLUlz2.cjs → flowDiagram-I6XJVG4X-Rn9cXbM4.cjs} +1 -1
- package/dist/{ganttDiagram-6RSMTGT7-BMrijLIp.cjs → ganttDiagram-6RSMTGT7-BpYlzTOm.cjs} +1 -1
- package/dist/{ganttDiagram-6RSMTGT7-Bhohg83R.js → ganttDiagram-6RSMTGT7-C3CGnJzh.js} +3 -3
- package/dist/{gitGraphDiagram-PVQCEYII-CwSJFsFx.js → gitGraphDiagram-PVQCEYII-CM_EMfS6.js} +3 -3
- package/dist/{gitGraphDiagram-PVQCEYII-Bq_8mOSi.cjs → gitGraphDiagram-PVQCEYII-DR7ogqPB.cjs} +1 -1
- package/dist/index-B86Di0kD.js +2820 -0
- package/dist/index-Mn9BkUmO.cjs +1 -0
- package/dist/{index-dISfYziG.cjs → index-OiJ3pN8N.cjs} +6 -6
- package/dist/{index-Dhd78ysx.js → index-RR6eNszd.js} +8 -8
- package/dist/{infoDiagram-5YYISTIA-B-PYR74F.cjs → infoDiagram-5YYISTIA-CIxPF8Ny.cjs} +1 -1
- package/dist/{infoDiagram-5YYISTIA-BNytnCXI.js → infoDiagram-5YYISTIA-DeiTjOtd.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-4OKBUv_s.cjs → ishikawaDiagram-YF4QCWOH-1xm7obKK.cjs} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-BG80wXBr.js → ishikawaDiagram-YF4QCWOH-D5sHNiN0.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-g82mk2Fe.js → journeyDiagram-JHISSGLW-B7vkaR-O.js} +4 -4
- package/dist/{journeyDiagram-JHISSGLW-yt60VGMo.cjs → journeyDiagram-JHISSGLW-Bj3pR1r8.cjs} +1 -1
- package/dist/{kanban-definition-UN3LZRKU-BFH_hAyY.cjs → kanban-definition-UN3LZRKU-C2BvNLvg.cjs} +1 -1
- package/dist/{kanban-definition-UN3LZRKU-BmK56MSs.js → kanban-definition-UN3LZRKU-SSN_awCf.js} +2 -2
- package/dist/{linear-zILWiTVq.cjs → linear-BPGTGVZF.cjs} +1 -1
- package/dist/{linear-BpsU0HcQ.js → linear-CrtlOpJC.js} +1 -1
- package/dist/{mermaid.core-NivSZeQG.js → mermaid.core-BMFdNVmT.js} +35 -35
- package/dist/{mermaid.core-BvN-J_AM.cjs → mermaid.core-CzUM8ZFm.cjs} +3 -3
- package/dist/{mindmap-definition-RKZ34NQL-C3LWrNPx.cjs → mindmap-definition-RKZ34NQL-BzoMooEA.cjs} +1 -1
- package/dist/{mindmap-definition-RKZ34NQL-BXoEIZmG.js → mindmap-definition-RKZ34NQL-CQ_AvUYl.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-CN01uXEU.cjs → pieDiagram-4H26LBE5--B008aOr.cjs} +1 -1
- package/dist/{pieDiagram-4H26LBE5-y5XnB67r.js → pieDiagram-4H26LBE5-DZA6EYmY.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BdWRtxg8.cjs → quadrantDiagram-W4KKPZXB-CUgU7n5W.cjs} +1 -1
- package/dist/{quadrantDiagram-W4KKPZXB-DoHOsDDM.js → quadrantDiagram-W4KKPZXB-DkJ_1r5Q.js} +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-B6ltwG99.cjs → requirementDiagram-4Y6WPE33-C9c_OdBu.cjs} +1 -1
- package/dist/{requirementDiagram-4Y6WPE33-BUqcv09v.js → requirementDiagram-4Y6WPE33-D-Rhgay0.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-Dw_I3L5w.cjs → sankeyDiagram-5OEKKPKP-CjqPY4DA.cjs} +1 -1
- package/dist/{sankeyDiagram-5OEKKPKP-D3yaTkog.js → sankeyDiagram-5OEKKPKP-D4c7ZW3L.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-Dlw7AYVR.js → sequenceDiagram-3UESZ5HK-BFZ_dS_o.js} +3 -3
- package/dist/{sequenceDiagram-3UESZ5HK-Dw-Oo3gQ.cjs → sequenceDiagram-3UESZ5HK-CvSm5Cdr.cjs} +1 -1
- package/dist/{stateDiagram-AJRCARHV-G5aGpm4h.js → stateDiagram-AJRCARHV-_zVtg-ny.js} +2 -2
- package/dist/{stateDiagram-AJRCARHV-RlkILcfR.cjs → stateDiagram-AJRCARHV-l6UNFX0d.cjs} +1 -1
- package/dist/{stateDiagram-v2-BHNVJYJU-B5MqneJj.cjs → stateDiagram-v2-BHNVJYJU-RSGFy9G6.cjs} +1 -1
- package/dist/{stateDiagram-v2-BHNVJYJU-U7btkN-c.js → stateDiagram-v2-BHNVJYJU-eyWoWwdr.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-I1bAZF32.js → timeline-definition-PNZ67QCA-B9ePHeNX.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-DZWO25QG.cjs → timeline-definition-PNZ67QCA-Dz0DlRBT.cjs} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-OMVDPAYS.cjs → vennDiagram-CIIHVFJN-DB7dFqUU.cjs} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-GqC6bKPW.js → vennDiagram-CIIHVFJN-DTMVqRLj.js} +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 +627 -627
- package/dist/{wardleyDiagram-YWT4CUSO-B_ri0S8_.js → wardleyDiagram-YWT4CUSO-CLgLoevL.js} +2 -2
- package/dist/{wardleyDiagram-YWT4CUSO-BS6EQ76K.cjs → wardleyDiagram-YWT4CUSO-llCStOjH.cjs} +1 -1
- package/dist/{xychartDiagram-2RQKCTM6-VaspgPkc.js → xychartDiagram-2RQKCTM6-B9AnuRIT.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-BIi1O5Px.cjs → xychartDiagram-2RQKCTM6-Co8C1pBL.cjs} +1 -1
- package/package.json +1 -1
- package/dist/V2Workbench-a7fIKHSI.js +0 -2352
- package/dist/V2Workbench-tUL0KmKo.cjs +0 -2
- package/dist/index-Bl0cgfIz.cjs +0 -1
- package/dist/index-BygO8jcH.cjs +0 -1
- package/dist/index-CQYJcpLn.js +0 -2520
- package/dist/index-RmIugmM4.js +0 -307
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { dt as s, af as Qe, da as Xs, d_ as Js, aE as et, dG as he, d0 as e, N as ze, bL as ss, b0 as st, bC as tt, bB as _s, i as ve, e2 as ks, ai as qe, L as fs, aq as ls, F as at, bN as nt, ct as Ns, a6 as it, a4 as ot, P as lt, aO as Xe, A as dt, bz as Ss, y as rt, aA as ct, ba as ut, bb as Cs, bc as ht, cv as Is, eb as xt, J as mt, b1 as pt, aW as ft, bd as gt, o as bt, v as wt, n as Ps, b5 as yt, bA as xe, b4 as jt, T as vt, ab as _t, aG as gs, ec as kt, a9 as Nt, aH as St, aF as Ct, cl as It, d3 as Pe, d4 as Pt, cZ as At, am as Et, a as Rt, ah as Lt, G as $t, l as Mt, aQ as Tt, cu as Dt, ad as Ot, aP as Bt } from "./index-
|
|
2
|
-
import { l as zt, h as Wt, A as Vt, m as qt, a as Qt, Q as Ut, k as Ae, f as Ft,
|
|
3
|
-
import {
|
|
4
|
-
import { Divider as Jt } from "./index-RmIugmM4.js";
|
|
1
|
+
import { dt as s, af as Qe, da as Xs, d_ as Js, aE as et, dG as he, d0 as e, N as ze, bL as ss, b0 as st, bC as tt, bB as _s, i as ve, e2 as ks, ai as qe, L as fs, aq as ls, F as at, bN as nt, ct as Ns, a6 as it, a4 as ot, P as lt, aO as Xe, A as dt, bz as Ss, y as rt, aA as ct, ba as ut, bb as Cs, bc as ht, cv as Is, eb as xt, J as mt, b1 as pt, aW as ft, bd as gt, o as bt, v as wt, n as Ps, b5 as yt, bA as xe, b4 as jt, T as vt, ab as _t, aG as gs, ec as kt, a9 as Nt, aH as St, aF as Ct, cl as It, d3 as Pe, d4 as Pt, cZ as At, am as Et, a as Rt, ah as Lt, G as $t, l as Mt, aQ as Tt, cu as Dt, ad as Ot, aP as Bt } from "./index-RR6eNszd.js";
|
|
2
|
+
import { l as zt, h as Wt, A as Vt, m as qt, a as Qt, Q as Ut, k as Ae, f as Ft, d as Gt, g as Kt, u as Zt, p as Ht, b as Yt, S as Xt } from "./WorkbenchRuntime-DFoqujXl.js";
|
|
3
|
+
import { Drawer as As, Divider as Jt } from "./index-B86Di0kD.js";
|
|
5
4
|
var ea = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "defs", attrs: {}, children: [{ tag: "style", attrs: {} }] }, { tag: "path", attrs: { d: "M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z" } }, { tag: "path", attrs: { d: "M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z" } }] }, name: "aim", theme: "outlined" };
|
|
6
5
|
function ts() {
|
|
7
6
|
return ts = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -2797,7 +2796,7 @@ const vs = {
|
|
|
2797
2796
|
goals: { title: "目标追踪", subtitle: "跟踪关键业务指标和目标进展" },
|
|
2798
2797
|
settings: { title: "通知配置", subtitle: "配置 Webhook 通知,实时接收系统重要事件" }
|
|
2799
2798
|
}, Oa = 5 * 60 * 1e3, Ba = 3;
|
|
2800
|
-
function
|
|
2799
|
+
function qa(n = {}) {
|
|
2801
2800
|
const {
|
|
2802
2801
|
showAside: a = !0,
|
|
2803
2802
|
showLogout: o = !1,
|
|
@@ -3358,5 +3357,5 @@ function Qa(n = {}) {
|
|
|
3358
3357
|
] }) });
|
|
3359
3358
|
}
|
|
3360
3359
|
export {
|
|
3361
|
-
|
|
3360
|
+
qa as default
|
|
3362
3361
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-dISfYziG.cjs"),q=require("./WorkbenchRuntime-BPjLWyHy.cjs"),xt=require("./index-Bl0cgfIz.cjs"),At=require("./index-BygO8jcH.cjs");var Mt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}},{tag:"path",attrs:{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"}}]},name:"aim",theme:"outlined"};function Fe(){return Fe=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Fe.apply(this,arguments)}const $t=(n,s)=>e.reactExports.createElement(e.Icon,Fe({},n,{ref:s,icon:Mt})),Tt=e.reactExports.forwardRef($t);var Lt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 01-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0165.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"}}]},name:"deployment-unit",theme:"outlined"};function Ge(){return Ge=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ge.apply(this,arguments)}const Bt=(n,s)=>e.reactExports.createElement(e.Icon,Ge({},n,{ref:s,icon:Lt})),Dt=e.reactExports.forwardRef(Bt);var Ot={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"};function Ke(){return Ke=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ke.apply(this,arguments)}const zt=(n,s)=>e.reactExports.createElement(e.Icon,Ke({},n,{ref:s,icon:Ot})),it=e.reactExports.forwardRef(zt);var Wt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"}}]},name:"poweroff",theme:"outlined"};function Ze(){return Ze=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ze.apply(this,arguments)}const Vt=(n,s)=>e.reactExports.createElement(e.Icon,Ze({},n,{ref:s,icon:Wt})),qt=e.reactExports.forwardRef(Vt);var Qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};function He(){return He=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},He.apply(this,arguments)}const Ut=(n,s)=>e.reactExports.createElement(e.Icon,He({},n,{ref:s,icon:Qt})),Ft=e.reactExports.forwardRef(Ut);function Gt(n){return n instanceof Error?n.message:"上传失败"}function Kt({open:n,playbook:s,onClose:i,onSubmit:o}){const h=e.reactExports.useMemo(()=>e.normalizeAgentInputFields(s==null?void 0:s.input_fields),[s]),[j,l]=e.reactExports.useState({}),[u,v]=e.reactExports.useState({}),[w,g]=e.reactExports.useState({}),p=e.useDynamicFieldOptions(h,j,l),R=e.reactExports.useMemo(()=>q.getVisibleInputFields(h,j),[h,j]);e.reactExports.useEffect(()=>{n&&(l(q.buildDefaultInputValues(h,(s==null?void 0:s.initial_params)??{})),v({}),g({}))},[h,n,s==null?void 0:s.initial_params]);const E=e.reactExports.useCallback((f,r)=>{l(c=>({...c,[f]:r}))},[]),B=e.reactExports.useCallback((f,r)=>async({file:c,onSuccess:N,onError:b})=>{var M,S;v(Q=>({...Q,[f]:!0}));try{const Q=c,$=await e.POST_Api_V1_Oss_Upload2(Q),D=(M=$==null?void 0:$.data)==null?void 0:M.url,C=((S=$==null?void 0:$.data)==null?void 0:S.name)||Q.name;if(!D)throw new Error("上传结果缺少文件地址");g(I=>({...I,[D]:C})),l(I=>{if(r<=1)return{...I,[f]:D};const U=Array.isArray(I[f])?I[f]:I[f]?[I[f]]:[];return{...I,[f]:[...U,D]}}),N==null||N($),e.staticMethods.success("上传成功")}catch(Q){const $=Q instanceof Error?Q:new Error(Gt(Q));b==null||b($),e.staticMethods.error($.message)}finally{v(Q=>({...Q,[f]:!1}))}},[]),z=()=>{if(!s)return;const f=R.filter(r=>r.required&&q.isMissingFieldValue(j[r.name]));if(f.length>0){e.staticMethods.warning(`请填写必填参数:${f.map(r=>r.label).join("、")}`);return}o(s,j)};return e.jsxRuntimeExports.jsxs(xt.Drawer,{className:"wandox-playbook-params-drawer",title:e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__title",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-main",children:"填写执行参数"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-sub",children:s==null?void 0:s.name})]}),open:n,size:640,destroyOnHidden:!0,maskClosable:!1,onClose:i,footer:e.jsxRuntimeExports.jsx("div",{className:"wandox-playbook-params-drawer__footer",children:e.jsxRuntimeExports.jsxs(e.Space,{children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:i,children:"取消"}),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",onClick:z,children:"开始执行"})]})}),children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__intro",children:[e.jsxRuntimeExports.jsx("span",{children:"填写本次运行需要的参数"}),e.jsxRuntimeExports.jsxs("span",{children:[R.length," 项"]})]}),e.jsxRuntimeExports.jsxs(e.Form,{layout:"vertical",className:"wandox-playbook-params-drawer__form",children:[R.map(f=>e.jsxRuntimeExports.jsx(e.Form.Item,{required:f.required,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-playbook-params-drawer__label",children:[f.label,f.description||f.hint?e.jsxRuntimeExports.jsx(e.Tooltip,{title:f.description||f.hint,children:e.jsxRuntimeExports.jsx(e.RefIcon$2,{"aria-label":`${f.label}说明`})}):null]}),children:e.jsxRuntimeExports.jsx(q.AgentInputFieldControl,{field:f,value:j[f.name],uploading:!!u[f.name],fileNameMap:w,getOptionState:p.getFieldState,onChange:E,onUpload:B,onDownloadTemplate:r=>window.open(r.path,"_blank","noopener,noreferrer")})},f.name)),R.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__empty",children:[e.jsxRuntimeExports.jsx(e.Spin,{size:"small"})," 正在读取参数配置"]}):null]})]})}function Zt({playbooks:n,onPlaybookClick:s,onPlaybookDelete:i,activePlaybookId:o}){const{t:h}=e.useLanguage(),[j,l]=e.reactExports.useState(""),[u,v]=e.reactExports.useState(!1),[w,g]=e.reactExports.useState(null),[p,R]=e.reactExports.useState(!1),E=n.filter(r=>{var c;return r.name.toLowerCase().includes(j.toLowerCase())||((c=r.description)==null?void 0:c.toLowerCase().includes(j.toLowerCase()))}),B=(r,c)=>{c.stopPropagation(),g(r),v(!0)},z=async()=>{if(w){R(!0);try{await e.DELETE_Api_V1_Playbooks_SolidifyView_ByPlaybookId(w.playbook_id),i==null||i(w.playbook_id),v(!1),g(null)}catch{}finally{R(!1)}}},f=()=>{v(!1),g(null)};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-list",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-search",children:e.jsxRuntimeExports.jsx(e.Input.Search,{placeholder:"搜索",value:j,onChange:r=>l(r.target.value),allowClear:!0,enterButton:!1})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-content",children:E.length===0?e.jsxRuntimeExports.jsx(e.Empty,{description:h(j?"noData":"solidified.empty"),image:e.Empty.PRESENTED_IMAGE_SIMPLE}):e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-grid",children:E.map(r=>e.jsxRuntimeExports.jsxs("div",{className:`wandox-solidified-card ${o===r.playbook_id?"active":""}`,onClick:()=>s==null?void 0:s(r.playbook_id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(s==null||s(r.playbook_id))},role:"button",tabIndex:0,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-icon",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"2",fill:"none"}),e.jsxRuntimeExports.jsx("path",{d:"M9 3v18M15 3v18M3 9h18M3 15h18",stroke:"currentColor",strokeWidth:"1.5"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-name",children:r.name}),r.description&&e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-desc",children:r.description})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-solidified-card-delete",onClick:c=>B(r,c),title:h("solidified.delete"),children:e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsxRuntimeExports.jsx("path",{d:"M6 7v12a2 2 0 002 2h8a2 2 0 002-2V7M4 7h16M10 11v6M14 11v6M9 7V4a1 1 0 011-1h4a1 1 0 011 1v3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},r.playbook_id))})}),e.jsxRuntimeExports.jsx(e.Modal,{title:h("solidified.deleteConfirm"),open:u,onOk:z,onCancel:f,okText:h("confirm"),cancelText:h("cancel"),okButtonProps:{danger:!0,loading:p},children:e.jsxRuntimeExports.jsxs("p",{children:[h("solidified.deleteConfirm")," 「",w==null?void 0:w.name,"」?"]})})]})}function Ht({inputParams:n,onSearch:s,loading:i=!1}){const[o]=e.Form.useForm();e.reactExports.useEffect(()=>{const l={};for(const u of n)u.default!==void 0&&u.default!==null&&u.default!==""&&(l[u.name]=u.default);o.setFieldsValue(l)},[n,o]);const h=()=>{o.validateFields().then(l=>{const u={};for(const v of Object.keys(l)){const w=l[v];w!=null&&w!==""&&(u[v]=w)}s(u)})},j=l=>{const{name:u,type:v,description:w}=l,g={placeholder:w||`请输入${u}`};switch(v){case"integer":return e.jsxRuntimeExports.jsx(e.TypedInputNumber,{...g,style:{width:"100%"}});case"array":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"boolean":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"string":default:return e.jsxRuntimeExports.jsx(e.Input,{...g})}};return e.jsxRuntimeExports.jsx("div",{className:"wandox-solidify-params-form",children:e.jsxRuntimeExports.jsxs(e.Form,{form:o,layout:"inline",onFinish:h,style:{marginBottom:16},children:[n.map(l=>e.jsxRuntimeExports.jsx(e.Form.Item,{name:l.name,label:l.description||l.name,rules:[{required:l.required,message:`请输入${l.description||l.name}`}],style:{marginBottom:8},children:j(l)},l.name)),e.jsxRuntimeExports.jsx(e.Form.Item,{style:{marginBottom:8},children:e.jsxRuntimeExports.jsx(e.Button,{type:"primary",htmlType:"submit",loading:i,children:"查询"})})]})})}function Yt({open:n,loading:s,playbooks:i,activePlaybookId:o,onClose:h,onPlaybookClick:j,onPlaybookDelete:l}){return e.jsxRuntimeExports.jsx(xt.Drawer,{title:"工具箱",placement:"right",size:"min(440px, 100vw)",open:n,loading:s,onClose:h,getContainer:!1,rootClassName:"wandox-toolbox-drawer",styles:{body:{padding:0,overflow:"hidden"}},children:e.jsxRuntimeExports.jsx(Zt,{playbooks:i,onPlaybookClick:j,onPlaybookDelete:l,activePlaybookId:o})})}const Xt="https://ai.maiduox.com/#/aitools/operation/product";function Jt(n){const{title:s,widgets:i,ssoDomain:o,ssoToken:h,ssoCompany:j,onExecuteComplete:l,activeAgent:u,agents:v,childAgents:w,externalRobotName:g,externalShowPanel:p,agentSwitcher:R}=n;n.onWidgetsUpdate,n.count,e.useLanguage();const[E,B]=e.reactExports.useState(!1),[z,f]=e.reactExports.useState(!1),[r,c]=e.reactExports.useState(null),[N,b]=e.reactExports.useState(null),[M,S]=e.reactExports.useState("results"),[Q,$]=e.reactExports.useState(!1),[D,C]=e.reactExports.useState([]),[I,U]=e.reactExports.useState(null),[F,Re]=e.reactExports.useState({}),[te,se]=e.reactExports.useState([]),[Ee,J]=e.reactExports.useState(!1),[Z,ue]=e.reactExports.useState(null),[X,ae]=e.reactExports.useState(void 0),[W,le]=e.reactExports.useState(!1),[ce,we]=e.reactExports.useState(!1),G=e.reactExports.useMemo(()=>(w||[]).map(t=>t.name),[w]),xe=e.reactExports.useMemo(()=>!u||u==="default"?null:(v==null?void 0:v.find(x=>x.agent_id===u||x.agent_code===u))||null,[u,v]),ne=e.reactExports.useMemo(()=>e.getAgentPackageBenefit(xe),[xe]);e.reactExports.useEffect(()=>{b(null)},[u]),e.reactExports.useEffect(()=>{ke(),w&&w.length>0&&_()},[w]),e.reactExports.useEffect(()=>{if(p&&(B(!0),g)){const t=G.find(x=>x===g);t?b(t):G.length>0}},[p,g,G]);const ke=async()=>{try{const t=await e.GET_Api_V1_Notification_Webhooks({});t!=null&&t.data&&se(t.data.map(x=>({webhook_id:x.webhook_id,name:x.name,platform:x.platform})))}catch{}},_=async()=>{try{const t={};await Promise.all(w.map(async x=>{var L;try{const k=await e.GET_Api_V1_Notification_Agents_Webhook_ByAgentId(x.agent_id,{});(L=k==null?void 0:k.data)!=null&&L.webhook_id&&(t[x.agent_id]=k.data.webhook_id)}catch{}})),Re(t)}catch{}},O=e.reactExports.useMemo(()=>N?i.filter(t=>{var k;const x=(k=t.title)==null?void 0:k.match(/^(.+?)\s*巡检结果$/);return(x?x[1]:t.agent_name)===N}):i,[i,N]),pe=e.reactExports.useMemo(()=>{if(!N)return"";const t=(w||[]).find(x=>x.name===N);return(t==null?void 0:t.agent_id)||""},[N,w]),Ne=o==="maiduo"&&N==="差评监控",Te=t=>{const x=N===t?null:t;b(x),x&&B(!0)},me=t=>{ue(t),ae(F[t.agent_id]),J(!0)},ee=e.reactExports.useCallback(async t=>{if(t){$(!0);try{const x=await e.GET_Api_V1_Agents_ActionExecutes({agent_id:t,limit:50});if(x!=null&&x.data&&Array.isArray(x.data)){const L=x.data.map((k,fe)=>({id:k.id||k.execute_id||`record_${fe}`,action_name:k.action_name||k.display_name||"未知动作",action_id:k.action_id||"",status:k.status||"pending",created_at:k.created_at||"",completed_at:k.completed_at,action_params:k.action_params,output_type:k.output_type,output_data:k.output_data,outputs:k.outputs,error:k.error})).sort((k,fe)=>new Date(fe.created_at).getTime()-new Date(k.created_at).getTime());C(L)}else C([])}catch{C([])}finally{$(!1)}}},[]),ie=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L} ${k}`}catch{return t}},V=t=>({pending:"等待中",running:"执行中",success:"成功",failed:"失败"})[t]||t,K=t=>({pending:"wandox-exec-status--pending",running:"wandox-exec-status--running",success:"wandox-exec-status--success",failed:"wandox-exec-status--failed"})[t]||"";e.reactExports.useEffect(()=>{M==="history"&&pe&&ee(pe)},[M,pe,ee]);const P=async()=>{if(!Z||!X){e.staticMethods.warning("请选择 Webhook");return}try{le(!0),await e.POST_Api_V1_Notification_Agents_Webhook({},{agent_id:Z.agent_id,webhook_id:X}),e.staticMethods.success("绑定成功"),J(!1),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"绑定失败")}finally{le(!1)}},Se=async()=>{if(Z)try{le(!0),await e.DELETE_Api_V1_Notification_Agents_Webhook_Delete_ByAgentId(Z.agent_id,{}),e.staticMethods.success("解绑成功"),J(!1),ae(void 0),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"解绑失败")}finally{le(!1)}},Ce=t=>{c(t),f(!0)},Ie=()=>{f(!1),c(null)},Pe=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L}
|
|
2
|
-
${k}`}catch{return t}},he=(t,x)=>{const L={high:"#ff4d4f",medium:"#faad14",low:"#52c41a"};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-dot-wrapper",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-timeline-time",style:{whiteSpace:"pre-line"},children:Pe(t.timestamp||"")}),e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-dot",style:{background:L[t.priority]}}),!x&&e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-line"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-widget-card",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-title",children:t.title}),t.ui_payload&&e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-content wandox-markdown-content",children:e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:t.ui_payload})}),t.actions&&t.actions.length>0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-actions",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-widget-view-detail-btn",onClick:()=>Ce(t),children:[e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",children:[e.jsxRuntimeExports.jsx("title",{children:"快速执行"}),e.jsxRuntimeExports.jsx("path",{d:"M13 2L3 14H12L11 22L21 10H12L13 2Z",fill:"currentColor"})]}),"快速执行 (",t.actions.length,")"]})})]})]},t.id||`${t.type}_${t.title}_${t.timestamp}`)};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-widget-section",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-section-header",children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[R??e.jsxRuntimeExports.jsx("span",{className:"wandox-widget-section-title",children:s}),e.jsxRuntimeExports.jsx(q.AgentPackageTag,{benefit:ne})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-inspection-controls",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-inspection-agent-btn ${E?"wandox-inspection-agent-btn--expanded":""}`,onClick:()=>{E?(B(!1),b(null)):B(!0)},children:[e.jsxRuntimeExports.jsxs("span",{className:"wandox-inspection-agent-icon",children:[e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"1.5"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-1"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-2"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-3"})]}),e.jsxRuntimeExports.jsxs("span",{className:"wandox-inspection-agent-text",children:["巡检机器人(",G.length,")"]})]})})]}),E&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-list",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-filter-row wandox-agent-filter-row--with-close",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-filter-chips",children:[w.length>0&&e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-agent-filter-chip ${N===null?"active":""}`,onClick:()=>b(null),children:"全部"}),w.map(t=>{const x=!!F[t.agent_id];return e.jsxRuntimeExports.jsxs("div",{className:`wandox-agent-filter-chip-compound ${N===t.name?"active":""}`,children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-agent-filter-chip-name",onClick:()=>Te(t.name),children:t.name}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-agent-filter-chip-webhook ${x?"bound":""}`,onClick:()=>me(t),title:x?"已绑定 Webhook,点击修改":"绑定 Webhook 通知",children:x?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-dot","aria-hidden":"true"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-label",children:"已通知"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-plus","aria-hidden":"true",children:"+"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-label",children:"通知"})]})})]},t.agent_id)})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-timeline-list-close",onClick:()=>{B(!1),b(null),S("results")},title:"关闭",children:"✕"})]}),Ne&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-negative-review-notice",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-negative-review-notice-icon","aria-hidden":"true",children:"ℹ️"}),e.jsxRuntimeExports.jsxs("span",{children:["差评监控需要先设置需要监控的ASIN,请前往AI工具》",e.jsxRuntimeExports.jsx("a",{href:Xt,target:"_blank",rel:"noreferrer",className:"wandox-negative-review-notice-link",children:"新老诊断"}),"进行设置。每个asin每一次都需要0.01算力。"]})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-tabs-header",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-tabs-nav",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-timeline-tab-btn ${M==="results"?"active":""}`,onClick:()=>S("results"),children:["巡检结果",O.length>0&&e.jsxRuntimeExports.jsx("span",{className:"wandox-timeline-tab-badge",children:O.length})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-timeline-tab-btn ${M==="history"?"active":""}`,onClick:()=>S("history"),children:"执行记录"})]})}),M==="results"?e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-list-content",children:O.length>0?O.sort((t,x)=>{const L=t.timestamp?new Date(t.timestamp).getTime():0;return(x.timestamp?new Date(x.timestamp).getTime():0)-L}).map((t,x,L)=>he(t,x===L.length-1)):e.jsxRuntimeExports.jsxs("div",{className:"wandox-empty-state",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-icon",children:"�"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:N?"没有符合筛选条件的数据":"暂无工作区数据"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-desc",children:N?"请调整筛选条件":"工作区数据将在这里显示"})]})}):e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-list-content wandox-history-panel",children:N?Q?e.jsxRuntimeExports.jsxs("div",{className:"wandox-loading-state",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-spinner wandox-spinner--small"}),e.jsxRuntimeExports.jsx("span",{children:"加载中..."})]}):D.length===0?e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-state",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:"暂无执行记录"})}):e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-history-list",children:D.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-header",onClick:()=>U(I===t.id?null:t.id),onKeyDown:x=>x.key==="Enter"&&U(I===t.id?null:t.id),role:"button",tabIndex:0,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-info",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-name",children:t.action_name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-time",children:ie(t.created_at)})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-status-wrapper",children:[e.jsxRuntimeExports.jsx("span",{className:`wandox-exec-status ${K(t.status)}`,children:V(t.status)}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-arrow","aria-hidden":"true",children:I===t.id?"▼":"▶"})]})]}),I===t.id&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-detail",children:[t.action_params&&Object.keys(t.action_params).length>0&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-params",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行参数"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-params-list",children:Object.entries(t.action_params).map(([x,L])=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-param-item",children:[e.jsxRuntimeExports.jsxs("span",{className:"wandox-exec-param-key",children:[x,":"]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-param-value",children:typeof L=="object"?JSON.stringify(L):String(L)})]},x))})]}),t.error?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-error",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-error-label",children:"错误信息:"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-error-msg",children:t.error})]}):t.output_type&&t.output_data?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-outputs",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行结果"}),e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:{type:t.output_type,...t.output_data}})]}):t.outputs?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-outputs",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行结果"}),e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:t.outputs})]}):e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-no-output",children:"暂无输出结果"})]})]},t.id))}):e.jsxRuntimeExports.jsxs("div",{className:"wandox-empty-state",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-icon",children:"🤖"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:"请先选择机器人"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-desc",children:"在上方选择一个机器人查看执行记录"})]})})]}),e.jsxRuntimeExports.jsx(e.ActionDetailDrawer,{open:z,title:(r==null?void 0:r.title)||"动作详情",actions:(r==null?void 0:r.actions)||[],widgetId:r==null?void 0:r.id,ssoToken:h,ssoDomain:o,ssoCompany:j,onClose:Ie,onExecuteComplete:l}),e.jsxRuntimeExports.jsx(e.Modal,{title:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12 22C10.8954 22 10 21.1046 10 20V14C10 12.8954 10.8954 12 12 12C13.1046 12 14 12.8954 14 14V20C14 21.1046 13.1046 22 12 22Z"}),e.jsxRuntimeExports.jsx("path",{d:"M18 16C16.8954 16 16 15.1046 16 14V10C16 8.89543 16.8954 8 18 8C19.1046 8 20 8.89543 20 10V14C20 15.1046 19.1046 16 18 16Z"}),e.jsxRuntimeExports.jsx("path",{d:"M6 16C4.89543 16 4 15.1046 4 14V10C4 8.89543 4.89543 8 6 8C7.10457 8 8 8.89543 8 10V14C8 15.1046 7.10457 16 6 16Z"}),e.jsxRuntimeExports.jsx("path",{d:"M10.5 4C10.5 2.61929 11.6193 1.5 13 1.5H13.5C14.8807 1.5 16 2.61929 16 4V6H10.5V4Z"})]}),e.jsxRuntimeExports.jsx("span",{children:"配置 Webhook 通知"})]}),open:Ee,onCancel:()=>{J(!1),ue(null),ae(void 0)},width:520,footer:null,centered:!0,children:e.jsxRuntimeExports.jsxs("div",{style:{padding:"8px 0"},children:[e.jsxRuntimeExports.jsxs("div",{style:{marginBottom:"20px",padding:"12px 16px",background:"#f5f7fa",borderRadius:"8px",border:"1px solid #e8eaed"},children:[e.jsxRuntimeExports.jsx("div",{style:{fontSize:"13px",color:"#666",marginBottom:"4px"},children:"智能体"}),e.jsxRuntimeExports.jsx("div",{style:{fontSize:"15px",color:"#1a1a1a",fontWeight:500},children:Z==null?void 0:Z.name})]}),e.jsxRuntimeExports.jsxs("div",{style:{marginBottom:"20px"},children:[e.jsxRuntimeExports.jsx("div",{style:{marginBottom:"8px",fontSize:"14px",color:"#333",fontWeight:500},children:"选择 通知地址"}),e.jsxRuntimeExports.jsx(e.Select,{style:{width:"100%"},size:"large",placeholder:"请选择 通知地址",value:X,onChange:ae,options:te.map(t=>({label:`${t.name} (${t.platform==="dingtalk"?"钉钉":t.platform==="feishu"?"飞书":"企业微信"})`,value:t.webhook_id})),disabled:W,popupRender:t=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[t,e.jsxRuntimeExports.jsx(At.Divider,{style:{margin:"8px 0"}}),e.jsxRuntimeExports.jsx(e.Space,{style:{padding:"0 8px 4px"},children:e.jsxRuntimeExports.jsx(e.Button,{type:"text",icon:e.jsxRuntimeExports.jsx("span",{children:"+"}),onClick:()=>we(!0),children:"添加新的通知地址"})})]})}),te.length===0&&e.jsxRuntimeExports.jsxs("div",{style:{marginTop:"8px",padding:"8px 12px",background:"#fff7e6",border:"1px solid #ffd591",borderRadius:"4px",fontSize:"13px",color:"#d46b08",display:"flex",alignItems:"center",gap:"6px"},children:[e.jsxRuntimeExports.jsx("span",{children:"⚠️"}),e.jsxRuntimeExports.jsx("span",{children:'暂无可用的 通知地址,请先在"通知配置"中创建'})]})]}),e.jsxRuntimeExports.jsxs("div",{style:{padding:"12px 16px",background:"#f0f9ff",borderRadius:"8px",border:"1px solid #bae7ff",marginBottom:"20px"},children:[e.jsxRuntimeExports.jsx("div",{style:{fontSize:"13px",color:"#0958d9",fontWeight:500,marginBottom:"8px"},children:"💡 功能说明"}),e.jsxRuntimeExports.jsxs("div",{style:{fontSize:"13px",color:"#096dd9",lineHeight:"1.8"},children:[e.jsxRuntimeExports.jsx("div",{children:"• 绑定后,该智能体执行完成时会自动发送通知"}),e.jsxRuntimeExports.jsx("div",{children:"• 通知内容包含执行结果和相关信息"}),e.jsxRuntimeExports.jsx("div",{children:"• 可随时修改或解除绑定"})]})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[F[(Z==null?void 0:Z.agent_id)||""]&&e.jsxRuntimeExports.jsx("button",{type:"button",onClick:Se,disabled:W,style:{marginRight:"auto",padding:"8px 20px",border:"1px solid #ff4d4f",borderRadius:"6px",background:"#fff",color:"#ff4d4f",cursor:W?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s",opacity:W?.6:1},onMouseEnter:t=>{W||(t.currentTarget.style.background="#fff1f0")},onMouseLeave:t=>{t.currentTarget.style.background="#fff"},children:"解除绑定"}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{J(!1),ue(null),ae(void 0)},disabled:W,style:{padding:"8px 24px",border:"1px solid #d9d9d9",borderRadius:"6px",background:"#fff",color:"#333",cursor:W?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s",opacity:W?.6:1},onMouseEnter:t=>{W||(t.currentTarget.style.background="#fafafa")},onMouseLeave:t=>{t.currentTarget.style.background="#fff"},children:"取消"}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:P,disabled:W||!X,style:{padding:"8px 24px",border:"none",borderRadius:"6px",background:W||!X?"#d9d9d9":"#1890ff",color:"#fff",cursor:W||!X?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s"},onMouseEnter:t=>{!W&&X&&(t.currentTarget.style.background="#40a9ff")},onMouseLeave:t=>{!W&&X&&(t.currentTarget.style.background="#1890ff")},children:W?"保存中...":"保存"})]})]})}),e.jsxRuntimeExports.jsx(q.QuickAddWebhook,{open:ce,onClose:()=>we(!1),onSuccess:t=>{se(x=>[...x,t]),ae(t.webhook_id)}})]})}function es({active:n,agents:s,collapsed:i,onToggle:o,className:h,activeView:j="chat",onViewChange:l,onToolboxOpen:u,showLogout:v,onLogout:w,sidebarAgentMode:g=!1,onToggleSidebarMode:p,onAgentSelect:R}){const E=localStorage.getItem("sso_domain")||"",B=[{key:"chat",icon:e.jsxRuntimeExports.jsx(q.RefIcon$4,{}),title:"对话"},...["maiduo","eccang"].includes(E)?[{key:"plan",icon:e.jsxRuntimeExports.jsx(Dt,{}),title:"自动化Beta"}]:[],{key:"professional",icon:e.jsxRuntimeExports.jsx(e.RefIcon$14,{}),title:"专业智能体"}],f=[...E==="yunduo"?[]:[{key:"toolbox",icon:e.jsxRuntimeExports.jsx(Ft,{}),label:"工具箱"},{key:"goals",icon:e.jsxRuntimeExports.jsx(Tt,{}),label:"目标追踪"}],{key:"settings",icon:e.jsxRuntimeExports.jsx(q.RefIcon$3,{}),label:"通知配置"}];return e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-wrap",children:e.jsxRuntimeExports.jsxs("div",{className:`wandox-aside ${i?"wandox-aside--collapsed":""} ${h||""}`,"aria-hidden":i,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-header",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-header__title",children:"AI 智能体"}),o&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-aside-header-toggle",onClick:o,"aria-label":i?"展开侧边栏":"收起侧边栏",title:i?"展开侧边栏":"收起侧边栏",children:e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",children:[e.jsxRuntimeExports.jsx("title",{children:i?"展开侧边栏":"收起侧边栏"}),e.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M21 5H11v14h10zM3 5h6v14H3zm0-2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm2 4.25a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5zm-.75 3.5A.75.75 0 0 1 5 10h2a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75m.75 2a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5z"})]})})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-main-nav",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-nav-list",children:B.map(r=>{const c=j===r.key,N=r.key==="professional";return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:`wandox-aside-nav-item-wrap${c?" wandox-aside-nav-item-wrap--active":""}`,children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>l==null?void 0:l(r.key),className:`wandox-aside-nav-item${c?" wandox-aside-nav-item--active":""}`,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:r.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:r.title})]}),N&&!i&&p&&e.jsxRuntimeExports.jsx(e.Tooltip,{title:g?"收起列表":"展开列表",placement:"right",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-aside-mode-toggle${g?" wandox-aside-mode-toggle--active":""}`,onClick:b=>{b.stopPropagation(),p()},children:g?e.jsxRuntimeExports.jsx(e.RefIcon$12,{style:{fontSize:11}}):e.jsxRuntimeExports.jsx(e.RefIcon$13,{style:{fontSize:11}})})})]}),N&&(g||i)&&e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-agent-list",children:s.map(b=>{const M=b.agent_id;if(!M)return null;const S=n===M&&j==="professional";return e.jsxRuntimeExports.jsx(e.Tooltip,{title:b.name,placement:"right",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-aside-agent-item${S?" wandox-aside-agent-item--active":""}`,onClick:()=>{R==null||R(M),j!=="professional"&&(l==null||l("professional"))},children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-agent-icon",children:q.getAgentIconById(b.icon)}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-agent-name",children:b.name})]})},M)})})]},r.key)})})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-bottom",children:[e.jsxRuntimeExports.jsx("p",{className:"wandox-aside-group-label",children:"系统功能"}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-nav-list wandox-aside-nav-list--bottom",children:[f.map(r=>{const c=r.key!=="toolbox"&&j===r.key;return e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{if(r.key==="toolbox"){u==null||u();return}l==null||l(r.key)},className:`wandox-aside-nav-item${c?" wandox-aside-nav-item--active":""}`,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:r.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:r.label})]},r.key)}),v&&e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:w,className:"wandox-aside-nav-item wandox-aside-nav-item--logout",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:e.jsxRuntimeExports.jsx(qt,{})}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:"退出登录"})]})]}),e.jsxRuntimeExports.jsx("div",{style:{height:8}})]})]})})}function ts(n){const{children:s}=n;return e.jsxRuntimeExports.jsx("div",{className:"wandox-layout wandox-root",children:e.jsxRuntimeExports.jsx("main",{className:"wandox-layout-content",style:{padding:0},children:s})})}function ss({queueStatus:n}){if(!n)return null;const s=n.status==="waiting";return e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-overlay",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-modal",children:s?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-icon wandox-queue-icon--waiting",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:"#E5E7EB",strokeWidth:"4"}),e.jsxRuntimeExports.jsx("path",{d:"M32 16V32L44 38",stroke:"#8B5CF6",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-title",children:"当前使用人数较多,正在排队中..."}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stats",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-value",children:n.position}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-label",children:"前面还有"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat-value",children:["~",n.estimated_wait,"s"]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-label",children:"预计等待"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-tip",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-queue-tip-icon",children:"💡"}),e.jsxRuntimeExports.jsx("span",{children:"小贴士:等待期间可先查看其他功能模块"})]})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-icon wandox-queue-icon--ready",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"56",height:"56",rx:"8",fill:"#10B981"}),e.jsxRuntimeExports.jsx("path",{d:"M18 32L28 42L46 22",stroke:"white",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-title wandox-queue-title--ready",children:"轮到您了!"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-subtitle",children:"正在处理您的请求..."})]})})})}function ns({open:n,actionName:s,defaultParams:i={},onCancel:o,onExecute:h}){const[j,l]=e.reactExports.useState({});e.reactExports.useEffect(()=>{if(n){const p={};for(const R of Object.keys(i)){const E=i[R];(typeof E=="string"||typeof E=="number")&&(p[R]=String(E))}l(p)}},[n,i]);const u=(p,R)=>{l(E=>({...E,[p]:R}))},v=p=>{p.preventDefault();const R={...i};for(const E of Object.keys(j))R[E]=j[E];h(R)},w=p=>{p.target===p.currentTarget&&o()},g=(p,R)=>typeof R=="object"&&R!==null?null:e.jsxRuntimeExports.jsxs("div",{className:"wandox-form-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-form-label",children:p}),e.jsxRuntimeExports.jsx("input",{type:"text",className:"wandox-form-input",placeholder:`请输入 ${p}`,value:j[p]||"",onChange:E=>u(p,E.target.value)})]},p);return n?e.jsxRuntimeExports.jsx("div",{className:"wandox-modal-overlay",onClick:w,children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal",style:{width:600},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-header",children:[e.jsxRuntimeExports.jsxs("h3",{className:"wandox-modal-title",children:["执行 Action: ",s]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-modal-close",onClick:o,"aria-label":"关闭",children:e.jsxRuntimeExports.jsx("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsxRuntimeExports.jsx("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})})})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-body",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-modal-description",children:"以下是默认参数,您可以修改后执行,或直接使用默认值执行"}),e.jsxRuntimeExports.jsxs("form",{onSubmit:v,children:[Object.keys(i).map(p=>g(p,i[p])),Object.keys(i).length===0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-params",children:"该 Action 无需参数"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-footer",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-button wandox-button-default",onClick:o,children:"取消"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-button wandox-button-primary",onClick:v,children:"执行"})]})]})}):null}const ot=["要努力呀,为了想要的生活,为了人间的烟火气,为了今天的风和月。","欣赏不来别人视若珍宝的,就该保持沉默。","日子总是有意思的,了无生趣的是打不起精神的你。","我们终其一生,就是要摆脱他人的期待,找到真正的自己。","别在最好的年纪选择了安逸,那是对自己最大的辜负。","你现在的气质里,藏着你走过的路、读过的书和爱过的人。","成长就是,你终于明白有些路只能一个人走。","不是每一次努力都有收获,但每一次收获都需要努力。","生活从不眷顾因循守旧、满足现状的人,而将更多机遇留给勇于探索的人。","所有的困难都是暂时的,熬过去就是晴天。","你若盛开,清风自来。","别人笑我太疯癫,我笑他人看不穿。","走慢一点,是为了走得更远。","不必羡慕别人,你的故事才刚刚开始。","心若向阳,何惧忧伤。","人生没有白走的路,每一步都算数。","你不是在浪费时间,你是在积蓄力量。","别让昨天的遗憾,占满今天的时间。","深夜的努力,终将照亮黎明。","只要路是对的,就不怕遥远。","生活不会辜负每一个认真的人。","做一个有温度的人,遇见有光的事。","你所经历的每一次失败,都是未来成功的伏笔。","不要因为走得太远,而忘记为什么出发。","把每一天当作礼物,而不是任务。","越努力,越幸运。","你值得拥有你所渴望的一切。","别把时间花在你不喜欢的事情上,除非它能带你去你喜欢的地方。","有些事现在不做,一辈子都不会做了。","你的潜力,远比你想象的要大。","不要等到准备好了才开始,开始了才会准备好。","慢慢来,比较快。","善待自己,你已经很努力了。","每一个你讨厌的早晨,都是别人求之不得的机会。","世界上只有一种真正的英雄主义,那就是认清生活的真相后仍然热爱它。","人生不是等待风暴过去,而是学会在雨中起舞。","别总想着逃离,先想想能不能改变。","你无法控制风向,但可以调整帆的方向。","没有人能替你走你该走的路。","不要因为没有掌声而停止歌唱。","把抱怨环境的心情,用来改善环境吧。","你今天的懒惰,是明天后悔的源头。","没有人永远年轻,但永远有人正在年轻。","读书破万卷,不如行路十里。","人生最大的遗憾,是轻易放弃了本不该放弃的。","你不是失败了,你只是还没成功。","今天的苦,是明天的底气。","别把别人的看法,活成自己的枷锁。","有一种勇敢,叫做即使害怕也要继续走。","生活是场修行,凡事皆有意义。","不要和自己过不去,人生很短,开心最重要。","你现在偷的懒,都是以后还的债。","最好的时机,就是现在。","你不必完美,但你必须真实。","与其等待一个完美的开始,不如从不完美中开始。","成功不是终点,失败也不是终结,重要的是继续的勇气。","每一个坚持的背后,都有一个不为人知的故事。","改变不了环境,就改变自己。","别用你的忙来掩盖你的懒,也别用你的懒来消耗你的忙。","人生就像骑自行车,要保持平衡就必须不断前行。","昨天已经过去,明天还未到来,今天才是你拥有的全部。","宁可辛苦一阵子,不要痛苦一辈子。","不要让今日的懒惰,成为明日的遗憾。","你的态度,决定了你人生的高度。","路是走出来的,不是想出来的。","做你自己,别人的角色已经有人在演了。","年轻时以为不读书不足惜,后来方知书中有乾坤。","你若想要,便去追;你若已得,便珍惜。","最怕你一生碌碌无为,还安慰自己平凡可贵。","人生没有捷径,弯路也是路。","种一棵树最好的时间是十年前,其次是现在。","每天进步一点点,人生就会不一样。","不要只是看,要有所感悟;不要只是听,要有所行动。","心态好了,一切都好了。","你的未来,取决于你现在的决定。","好好爱自己,才有能力去爱别人。","人生路上,勿忘初心。","有梦想就去追,别给自己的平庸找借口。","世界是你的,但首先你要努力。","坚持不一定成功,但放弃一定失败。","你比你想象的更坚强,比你感觉的更勇敢。","把每一次失败都当成学费,你就赚了。","选择了远方,便只顾风雨兼程。","人生的意义不在于拿一手好牌,而在于打好一手烂牌。","不要在还可以冲刺的年纪,选择散步。","钱不是万能的,但没有钱是万万不能的。努力赚钱,才是对自己最大的尊重。","所谓天才,不过是比别人多了一点坚持。","你改变不了昨天,但你可以决定明天。","做最好的自己,才能遇见最好的别人。","不要因为懒惰而失去了本来可以拥有的东西。","人生没有返回键,但有暂停和前进。","别等别人为你喝彩,先为自己鼓掌。","与其焦虑,不如行动。","每一个优秀的人,都曾经历过一段无人问津的岁月。","你的每一步努力,都在为未来的自己铺路。","不想当将军的士兵不是好士兵,但当不了将军的士兵也可以是好士兵。","生活的艺术,就是把每一个平凡的日子过得不平凡。","人生就是一场旅行,在乎的不是目的地,而是沿途的风景。","不要因为别人的否定,而放弃对自己的肯定。","勇敢不是不害怕,而是即使害怕也还是去做。","命运给了你一手烂牌,你要做的是把它打好。","真正的强大,是内心的平静。","你所不能击垮的,终将使你更强大。","成功的人找方法,失败的人找借口。","不要总是想着明天,今天就是你最年轻的一天。","人生最重要的不是你站在哪里,而是你朝哪个方向走。","每个人都是自己人生的主角,不要沦为配角。","你现在付出的努力,都是在为未来的幸福买单。","心宽了,路才宽。","你所拥有的,比你想要的更多。","不要用战术上的勤奋,掩盖战略上的懒惰。","很多人看起来很忙,实际上只是在低水平上勤奋。","格局大了,烦恼就少了。","你的圈子,决定了你的见识;你的见识,决定了你的未来。","别总是看别人的生活,好好经营自己的就够了。","脚踏实地,仰望星空,这才是人生的正确打开方式。","吃一堑,长一智;受一挫,强一分。","每一次跌倒,都是一次重新出发的机会。","低谷的时候,沉得住气;高峰的时候,守得住心。","你一定要过得很好,这样才不辜负自己受过的苦。","少说多做,是成功的捷径。","人生苦短,别把时间浪费在不值得的人和事上。","越是艰难处,越是修心时。","机会都是留给有准备的人的。","爱拼才会赢,努力才会赢。","人生就像一杯茶,不会苦一辈子,但总会苦一阵子。","不要轻言放弃,你不知道下一秒会发生什么奇迹。","真正的成熟,是能与不完美的自己握手言和。","你所走过的弯路,都是你成长的印记。","别人可以成功,你也可以。","只有不断超越自己,才能不断创造可能。","努力不一定成功,不努力一定不成功。","当你觉得累的时候,说明你在走上坡路。","不经历风雨,怎能见彩虹。","比起抱怨,不如改变。","年轻没有失败,试错才是成长。","你的样子,将决定你世界的样子。","愿你出走半生,归来仍是少年。","有时候你以为的终点,不过是下一段旅程的起点。","今天努力工作,明天努力生活。","不要总是活在别人的评价里,你自己最清楚自己是谁。","无论多难,都要坚持做你认为对的事。","你不需要变成别人,你只需要成为更好的自己。","凡事提前准备,才能游刃有余。","没有什么是理所当然的,感恩才能幸福。","不要把安全感建立在别人身上,那是一种危险的依赖。","清醒的认识自己,是成功的第一步。","沉默是金,但行动是钻石。","用行动证明,而不是用嘴巴解释。","最终你会明白,一切都是值得的。","把目光放长远,眼前的得失不算什么。","不要让自己的懒惰成为别人勤奋的舞台。","你的每一次选择,都在塑造未来的你。","有时候沉默不是因为没话说,而是因为懂得珍惜。","你今天的努力,是明天底气的来源。","先成为你想成为的人,其他的顺其自然。","把握现在,才能拥有未来。","越简单越快乐,越复杂越烦恼。","人生没有真正的绝境,除非你自己放弃。","你比你想象的更有力量。","把每一件平凡的事做好,就是不平凡。","那些没能打败你的,终将使你更强大。","做事情要有始有终,这是对自己最基本的尊重。","不在沉默中爆发,就在沉默中消亡。","不要害怕慢,就怕站。","只要还在走,就没有到不了的地方。","自律的人,才有资格谈自由。","与其等风来,不如追风去。","你有多自律,就有多自由。","凡是过往,皆为序章。","不要在该奋斗的年纪选择了安逸。","人生难得几回搏,此时不搏何时搏。","成长的代价是失去一些幼稚,但获得了更多可能。","有梦想的人,睡觉都是在充电。","不要辜负每一个认真的早晨。","生命的意义,在于不断地自我超越。","你有权利选择,但选择了就要承担。","最大的风险,是不冒任何风险。","生活会奖励那些敢于尝试的人。","不要拿别人的错误惩罚自己。","学会放下,才能腾出手来拥抱新的可能。","所有的天才都曾是努力的凡人。","比别人优秀不是目的,成为更好的自己才是。","你不需要被所有人喜欢,但你必须喜欢自己。","保持好奇心,世界就不会无聊。","每一个平静的背后,都有一颗强大的内心。","把抱怨的时间用来思考,把悲伤的时间用来行动。","只要心里有光,哪里都是出路。","你的奋斗轨迹,就是你最好的简历。","成功不是偶然的,它是努力、坚持和学习的结果。","不要小看自己,宇宙都是从一个点开始的。","真正的自由,是不依赖任何人的底气。","你的努力,终有一天会让你站在阳光下。","生活不在别处,就在此时此刻。","每一段经历,都是人生最好的礼物。"];function as(){return e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-row",children:[e.jsxRuntimeExports.jsx(e.Skeleton.Avatar,{active:!0,size:28,shape:"circle"}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:120,height:18}})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:40,borderRadius:10}}),e.jsxRuntimeExports.jsx(e.Skeleton.Button,{active:!0,style:{width:80,height:40,borderRadius:10}})]})]})}function is(){return e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-skeleton-insights",children:[1,2,3].map(n=>e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-skeleton-insight-card",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-insight-inner",children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:52,height:22,borderRadius:100}}),e.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:16,marginBottom:6}}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:"70%",height:12}})]})]})},n))})}function os(n){return!!n&&/^https?:\/\//.test(n)}function Qe(n){if(!n)return"✦";if(os(n))return e.jsxRuntimeExports.jsx("img",{src:n,alt:""});const s=q.agentIconMap.get(n);return s?s.component:n}function rs(n,s){const i=`${n||""} ${s||""}`.toLowerCase();return i.includes("red")||i.includes("critical")?"wandox-insight-severity--red":i.includes("orange")||i.includes("high")?"wandox-insight-severity--orange":i.includes("yellow")||i.includes("medium")?"wandox-insight-severity--yellow":"wandox-insight-severity--gray"}function ls(n){const s=n.match(new RegExp("^\\p{Extended_Pictographic}","u"));return(s==null?void 0:s[0])||"📌"}function rt(n){return n.replace(new RegExp("^\\p{Extended_Pictographic}\\s*","u"),"")}function lt(n){var s;return n.bind_type==="playbook"&&n.bind_playbook_id&&((s=n.playbook_args)!=null&&s.length)?"执行":n.bind_type==="agent"?"找智能体聊聊":n.bind_type==="chat"?"分析一下":"查看详情"}function cs(n,s){const i=n.asin||n.ASIN||n.sku||n.seller_sku,o=n.site||n.marketplace||n.country;if(i||o)return[i,o&&`(${o})`].filter(Boolean).join(" ");const h=Object.values(n).find(j=>j!=null&&String(j).trim());return h?String(h):`参数 ${s+1}`}function xs(n,s){var o;const i=(o=n.query_template)==null?void 0:o.trim();return!i||!s?n.title:i.replace(/\{\{?\s*([\w.-]+)\s*\}?\}/g,(h,j)=>{const l=s[j];return l==null?h:String(l)})}function ds(n){return!n||n.status==="disabled"||n.status==="error"||!n.scenes?[]:Object.entries(n.scenes).map(([s,i])=>({name:s,total_affected:i.total_affected,suggestions_count:i.suggestions_count,cards:Array.isArray(i.cards)?i.cards:[]})).filter(s=>s.cards.length>0)}function us({agentLoading:n,mainAgentForHub:s,mainAgentQuestions:i,agents:o,hubChatOpen:h,setHubChatOpen:j,hubChatInput:l,setHubChatInput:u,hubScrollIdx:v,hubScrollFading:w,onHubChatSend:g,onHubInputFocus:p,onHubInputBlur:R,messages:E,executing:B,hubInlineChatInput:z,setHubInlineChatInput:f,onHubInlineSend:r,onEnterProfessional:c,playbooks:N,executePlaybook:b,onRequestPlaybookParams:M,onAbort:S,onRespondToProposal:Q,ssoToken:$,ssoDomain:D,ssoCompany:C}){var L,k,fe,Ae,be;const I=n&&!s,U=localStorage.getItem("sso_username")||"",F=localStorage.getItem("sso_user_id")||"",Re=e.reactExports.useRef(null),te=e.reactExports.useRef(null),se=e.reactExports.useMemo(()=>[],[]),[Ee,J]=e.reactExports.useState(""),[Z,ue]=e.reactExports.useState([]),[X,ae]=e.reactExports.useState(!1),[W,le]=e.reactExports.useState("idle"),[ce,we]=e.reactExports.useState(0),[G,xe]=e.reactExports.useState(null),[ne,ke]=e.reactExports.useState(!1),_=o[0],O=(_==null?void 0:_.agent_code)||(_==null?void 0:_.agent_id)||"",pe=(L=_==null?void 0:_.questions)!=null&&L.length?_.questions:i,Ne=D!=="yunduo"&&pe[v%Math.max(pe.length,1)]||"今天仓库订单处理的怎么样了?",Te=e.reactExports.useMemo(()=>ot[Math.floor(Math.random()*ot.length)],[]),me=e.reactExports.useMemo(()=>({Authorization:`Bearer ${$}`,"X-Tenant-ID":C,"X-Domain":D,"Content-Type":"application/json"}),[$,C,D]),ee=e.reactExports.useCallback(async(a=!1)=>{if(!(!$||!D)){ae(!0);try{const y=await fetch(`${e.getBaseURL()}/api/v1/insights/${a?"refresh":"recommendations"}`,{method:a?"POST":"GET",headers:me});if(!y.ok)throw new Error(`HTTP ${y.status}`);const de=await y.json(),T=de==null?void 0:de.data;le((T==null?void 0:T.status)||"error"),we((T==null?void 0:T.total_cards)||0),ue(ds(T))}catch{le("error"),we(0),ue([])}finally{ae(!1)}}},[me,D,$]);e.reactExports.useEffect(()=>{ee()},[ee]),e.reactExports.useEffect(()=>{!Ee&&O&&J(O)},[O,Ee]);const ie=Z,V=Ee||O||((k=se[0])==null?void 0:k.agent_id)||(s==null?void 0:s.agent_id),K=e.useQuestionAutocomplete({token:$,domain:D,tenantId:C,agentId:V||"",limit:5});e.reactExports.useEffect(()=>{if(!ne||h){K.clear();return}K.search(l)},[ne,l,h,K.search,K.clear]);const P=ie.length>0&&ie.every(a=>a.cards.length===1),Se=se.slice(0,3),Ce=se.slice(3),Ie=V===O?_==null?void 0:_.name:(fe=se.find(a=>a.agent_id===V))==null?void 0:fe.name,Pe=V===O?_!=null&&_.icon?q.getAgentIconById(_.icon):q.getAgentIconById("robot"):Qe((Ae=se.find(a=>a.agent_id===V))==null?void 0:Ae.icon),he=V===O?_==null?void 0:_.description:(be=se.find(a=>a.agent_id===V))==null?void 0:be.description,t=(a,y)=>{if(a.bind_type==="agent"&&a.bind_agent_code){c(a.bind_agent_code);return}if(a.bind_type==="playbook"&&a.bind_playbook_id&&y){j(!0),b({message:xs(a,y),playbook_id:a.bind_playbook_id,playbook_params:y});return}g(V,a.title)},x=(a,y,de,T=!1,Be=!1)=>{const ye=Array.isArray(y.playbook_args)?y.playbook_args:[],ge=y.bind_type==="playbook"&&!!y.bind_playbook_id&&ye.length>0;return e.jsxRuntimeExports.jsxs("article",{className:`wandox-insight-card${T?" wandox-insight-card--modal":""}${Be?" wandox-insight-card--featured":""}`,children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-card-main",onClick:()=>{T&&xe(null),t(y,ye[0])},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-card-top",children:[e.jsxRuntimeExports.jsx("span",{className:`wandox-insight-severity ${rs(y.severity_color,y.priority)}`,children:y.severity_label||"观察"}),y.affected_count&&e.jsxRuntimeExports.jsx("span",{children:y.affected_count})]}),e.jsxRuntimeExports.jsx("h4",{children:y.title}),y.description&&e.jsxRuntimeExports.jsx("p",{children:y.description}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-card-foot",children:[e.jsxRuntimeExports.jsx("span",{children:y.value_hint||"建议进一步确认"}),!ge&&e.jsxRuntimeExports.jsxs("strong",{children:[lt(y)," →"]})]})]}),ge&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-arg-list",children:[ye.slice(0,T?10:3).map((ve,H)=>e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-arg-action",onClick:()=>{T&&xe(null),t(y,ve)},children:[e.jsxRuntimeExports.jsx("span",{children:cs(ve,H)}),e.jsxRuntimeExports.jsx("strong",{children:lt(y)})]},`${y.title}-${H}`)),!T&&ye.length>3&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-arg-more",onClick:()=>xe(ie.find(ve=>ve.name===a)||null),children:["还有 ",ye.length-3," 项可执行"]})]})]},`${a}-${y.title}-${de}`)};return e.jsxRuntimeExports.jsx("div",{className:"wandox-view-scroll",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-view-content wandox-hub-v2",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-header",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("h1",{className:"wandox-hub-v2-title",children:["您好,",U||"欢迎回来"]}),e.jsxRuntimeExports.jsx("p",{className:"wandox-hub-v2-subtitle",children:Te})]}),D!=="yunduo"&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-hub-v2-report",onClick:()=>{const a=new URLSearchParams;$&&a.append("authorization",$),D&&a.append("x-domain",D),C&&a.append("x-tenant-id",C),F&&a.append("user_id",F),U&&a.append("username",U),window.open(`https://ai.wandox.com/trend-report/trend-report-6.html${a.toString()?`?${a.toString()}`:""}`,"_blank")},children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-report-logo",children:"麦"}),e.jsxRuntimeExports.jsxs("span",{children:[e.jsxRuntimeExports.jsx("strong",{children:"麦多趋势报告"}),e.jsxRuntimeExports.jsx("small",{children:"第六期 已更新 →"})]})]})]}),I?e.jsxRuntimeExports.jsx(as,{}):e.jsxRuntimeExports.jsxs("div",{ref:Re,className:`wandox-hub-main-card${h?" wandox-hub-main-card--open":""}`,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-main-card-search",style:{opacity:h?0:1,maxHeight:h?0:520,transition:"opacity 0.2s ease, max-height 0.35s cubic-bezier(0.4,0,0.2,1)"},children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-head",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-agent-title",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-agent-mark",children:Pe}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:Ie||(s==null?void 0:s.name)||"通用问答"}),e.jsxRuntimeExports.jsx("span",{children:he||"问什么都行,系统会自动分流到对应的专业能力"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-chip-row",style:{display:"none"},children:[O&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-hub-v2-chip${V===O?" wandox-hub-v2-chip--active":""}`,onClick:()=>J(O),title:(_==null?void 0:_.description)||(_==null?void 0:_.name)||"全部",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:_!=null&&_.icon?q.getAgentIconById(_.icon):"✦"}),"全部"]}),Se.map(a=>e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-hub-v2-chip${a.agent_id===V?" wandox-hub-v2-chip--active":""}`,onClick:()=>J(a.agent_id),title:a.description||a.name,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:Qe(a.icon)}),a.name]},a.agent_id)),Ce.length>0&&e.jsxRuntimeExports.jsx(e.Dropdown,{menu:{items:Ce.map(a=>({key:a.agent_id,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-hub-v2-more-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:Qe(a.icon)}),e.jsxRuntimeExports.jsx("span",{children:a.name})]})})),onClick:({key:a})=>J(String(a))},placement:"bottomRight",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-hub-v2-chip wandox-hub-v2-chip--more",children:["更多 ",e.jsxRuntimeExports.jsx(e.RefIcon$3,{})]})})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-wrap",children:[e.jsxRuntimeExports.jsx(e.Input.TextArea,{value:l,onChange:a=>u(a.target.value),onPressEnter:a=>{a.shiftKey||(a.preventDefault(),g(V))},onFocus:()=>{ke(!0),p==null||p()},onBlur:()=>{window.setTimeout(()=>ke(!1),120),R==null||R()},placeholder:"请随便问,看看 AI 搭子怎么帮你避坑",autoSize:{minRows:3,maxRows:7},variant:"borderless",className:"wandox-hub-v2-textarea"}),e.jsxRuntimeExports.jsx(e.QuestionAutocomplete,{open:ne,rewrittenQuestion:K.rewrittenQuestion,questions:K.questions,loading:K.loading,placement:"bottom",onSelectRewrite:a=>{u(a),K.clear()},onSelectQuestion:a=>{u(""),K.clear(),g(V,a.title)}})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-bottom",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-example",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-example-label",children:"示例:"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-v2-example-text",onClick:()=>{u(Ne)},style:{opacity:w?0:1,transform:w?"translateY(-4px)":"translateY(0)"},children:Ne})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",icon:e.jsxRuntimeExports.jsx(e.RefIcon$15,{}),className:"wandox-hub-v2-send",onClick:()=>g(V),children:"发送问题"})]})]})}),e.jsxRuntimeExports.jsxs("div",{style:{height:h?"100%":0,display:"flex",flexDirection:"column",opacity:h?1:0,overflow:"hidden",transition:"opacity 0.3s ease 0.1s, max-height 0.4s cubic-bezier(0.4,0,0.2,1)",position:"relative",zIndex:h?1:-1},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-chat-header",children:[s&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-chat-agent-avatar",children:[q.getAgentIconById(s.icon),s.is_main&&e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-agent-badge"})]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-chat-agent-name",children:s==null?void 0:s.name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-chat-status",children:"对话中"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-chat-close",onClick:()=>{S(),j(!1)},children:"×"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-chat-section__body wandox-chat-section__body--hub",children:[e.jsxRuntimeExports.jsx(e.ChatMessageList,{messages:E,executing:B,ssoToken:$,ssoDomain:D,ssoCompany:C,onExecutePlaybook:a=>b(a),onFillPlaybookParams:a=>M({playbook_id:a.playbookId,name:a.playbookName,input_fields:a.inputFields,initial_params:a.initialParams,playbook_type:a.playbookType}),onRespondToProposal:Q,containerRef:te,className:"wandox-hub-messages"}),e.jsxRuntimeExports.jsx(e.ConversationOutline,{messages:E,scrollContainerRef:te})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-input-row",children:e.jsxRuntimeExports.jsx(e.ChatInput,{executing:B,onSend:r,playbooks:N,value:z,onValueChange:f,placeholder:"继续提问…",ssoToken:$,ssoDomain:D,ssoCompany:C,onRequestPlaybookParams:M})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-footer",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-chat-enter-link",onClick:()=>c(),children:"进入完整对话视图 →"})})]})]}),(X||W==="error"||W==="success"&&ce>=0)&&W!=="disabled"&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-section wandox-hub-v2-insights",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-heading",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-kicker",children:[e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("strong",{children:"基于你的数据,建议先看"})]}),e.jsxRuntimeExports.jsx("p",{children:"系统每天扫描你的店铺数据,自动识别出值得处理的场景"})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"text",size:"small",icon:e.jsxRuntimeExports.jsx(e.RefIcon$7,{}),className:"wandox-hub-v2-refresh",onClick:()=>ee(!0),children:"换一批"})]}),X?e.jsxRuntimeExports.jsx(is,{}):W==="error"?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-empty",children:[e.jsxRuntimeExports.jsx("strong",{children:"数据获取失败,请稍后重试"}),e.jsxRuntimeExports.jsx(e.Button,{type:"link",size:"small",onClick:()=>ee(),children:"重试"})]}):ie.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-empty",children:[e.jsxRuntimeExports.jsx("strong",{children:"暂无场景推荐,数据正常"}),e.jsxRuntimeExports.jsx("span",{children:"当前没有扫描到需要优先处理的运营场景"})]}):e.jsxRuntimeExports.jsx("div",{className:`wandox-insight-scene-list${P?" wandox-insight-scene-list--single-cards":""}${ie.length===1?" wandox-insight-scene-list--one-scene":""}`,children:ie.map(a=>e.jsxRuntimeExports.jsxs("section",{className:"wandox-insight-scene",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-insight-scene-head",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:rt(a.name)}),e.jsxRuntimeExports.jsxs("span",{children:["扫描到"," ",a.suggestions_count??a.cards.length," ","条建议"]})]})}),e.jsxRuntimeExports.jsx("div",{className:`wandox-insight-card-row${a.cards.length===1?" wandox-insight-card-row--single":""}`,children:a.cards.slice(0,4).map((y,de)=>x(a.name,y,de,!1,a.cards.length===1))}),a.cards.length>4&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-view-all",onClick:()=>xe(a),children:["查看全部 ",a.cards.length," 条建议 →"]})]},a.name))})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-section",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-heading",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-kicker",children:[e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("strong",{children:"需要执行更专业的任务?"})]}),e.jsxRuntimeExports.jsx("p",{children:"直接进入对应专家,按业务流程一步步处理"})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"link",size:"small",className:"wandox-hub-v2-refresh",onClick:()=>c(),children:"全部 →"})]}),I?e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-grid",children:[1,2,3].map(a=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-entry-card",style:{pointerEvents:"none"},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Avatar,{active:!0,size:36,shape:"square",style:{borderRadius:8,flexShrink:0}}),e.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:14,marginBottom:6}}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:"80%",height:11}})]})]},a))}):e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-grid",children:o.filter(a=>!a.is_main).slice(0,4).map(a=>{const y=e.getAgentPackageBenefit(a);return e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-agent-entry-card${y?" wandox-agent-entry-card--with-badge":""}`,onClick:()=>c(a.agent_id||void 0),children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-icon",children:q.getAgentIconById(a.icon)}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-entry-info",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-name",children:a.name}),e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-desc",children:a.description})]}),e.jsxRuntimeExports.jsx(e.RefIcon$6,{className:"wandox-agent-entry-arrow"}),y&&e.jsxRuntimeExports.jsx("span",{className:`wandox-agent-entry-badge wandox-agent-entry-badge--${y.kind}`,style:{background:y.badgeColor,color:y.badgeTextColor},children:y.badgeText})]},a.agent_id)})})]}),e.jsxRuntimeExports.jsx(e.Modal,{open:!!G,onCancel:()=>xe(null),footer:null,width:920,centered:!0,className:"wandox-insight-modal",title:G?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-modal-title",children:[e.jsxRuntimeExports.jsx("span",{children:ls(G.name)}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:rt(G.name)}),e.jsxRuntimeExports.jsxs("small",{children:[G.cards.length," 条数据建议"]})]})]}):null,styles:{container:{padding:0}},children:G&&e.jsxRuntimeExports.jsx("div",{className:"wandox-insight-modal-grid",children:G.cards.map((a,y)=>x(G.name,a,y,!0))})})]})})}function ps(n){const s=n.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),i=n.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${s}
|
|
3
|
-
${i}`}function Ue(n,s){return n.activeAgent===s.activeAgent&&n.webhookId===s.webhookId&&n.ssoToken===s.ssoToken&&n.ssoDomain===s.ssoDomain&&n.ssoCompany===s.ssoCompany}function ms(n){const{activeAgent:s,webhookId:i="",ssoToken:o="",ssoDomain:h="",ssoCompany:j=""}=n,[l,u]=e.reactExports.useState([]),v=e.reactExports.useRef({activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j});e.reactExports.useEffect(()=>{v.current={activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j},u([])},[s,i,o,h,j]);const w=e.reactExports.useCallback(async()=>{if(!s)return;const g={activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j};if(Ue(v.current,g))try{const p=await e.GET_Api_V1_Agents_Workspaces({agent_id:s,limit:10,use_cache:!1});if(!Ue(v.current,g))return;if(p!=null&&p.data&&Array.isArray(p.data)){const R=p.data.map(E=>{const B=Array.isArray(E.actions)?E.actions||[]:[],z=E.ui_payload,f=z==null?void 0:z.actions,r=Array.isArray(f)?f:[],N=[...B,...r].map(M=>{const S=M;return{label:S.display_name||S.label||"执行",action_id:S.action_id,playbook_id:S.playbook_id,display_name:S.display_name,display_icon:S.display_icon,params:S.params,params_fields_map:S.params_fields_map,type:S.type,url:S.url,style:S.style,status:S.action_status||S.status||void 0,sort_order:S.sort_order,executed_job_id:S.executed_job_id,supports_batch:S.supports_batch===!0,batch_max_items:S.batch_max_items,batch_id:S.batch_id,outputs:S.outputs}}),b=E.outputs;return{type:E.widget_type||"daily_report",priority:E.priority||"medium",title:E.title||"每日战报",summary:E.summary||"",timestamp:E.created_at?ps(new Date(E.created_at||"")):"",data:E.card_data||{},actions:N,id:E.inbox_id||"",agent_id:E.agent_id||"",read:!!E.is_read,ui_payload:b||z||{}}});if(R.length>0){const E=R.sort((B,z)=>{const f=B.timestamp?new Date(B.timestamp.replace(/\n/g," ")).getTime():0;return(z.timestamp?new Date(z.timestamp.replace(/\n/g," ")).getTime():0)-f});u(E)}else u([])}else u([])}catch(p){if(!Ue(v.current,g))return;throw u([]),p}},[s,i,o,h,j]);return{widgets:l,setWidgets:u,loadDailyReports:w}}function hs(){const[n,s]=e.reactExports.useState([]),[i,o]=e.reactExports.useState(!1),[h,j]=e.reactExports.useState(!1),[l,u]=e.reactExports.useState(""),[v,w]=e.reactExports.useState([]),[g,p]=e.reactExports.useState(!1),[R,E]=e.reactExports.useState(null),[B,z]=e.reactExports.useState(!0),f=e.reactExports.useRef(null),r=e.reactExports.useCallback(async()=>{if(f.current)return f.current;const C=(async()=>{o(!0);try{const I=await e.GET_Api_V1_Playbooks_SolidifyView_List({page:1,page_size:20});return Array.isArray(I==null?void 0:I.data)?(s(I.data),j(!0),!0):(j(!1),!1)}catch{return j(!1),!1}finally{o(!1),f.current=null}})();return f.current=C,C},[]),c=e.reactExports.useCallback(()=>h?Promise.resolve(!0):r(),[r,h]),N=e.reactExports.useCallback(C=>{u(C),E({session_id:C,type:"dashboard_intent",intents:[],data:{}}),z(!1),(async(U={})=>{p(!0);try{const F=await e.POST_Api_V1_Playbooks_SolidifyView_Run_ByPlaybookId(C,{params:U});F.success&&F.data&&(E(F.data),F.data.input_params&&w(F.data.input_params))}catch{}finally{p(!1)}})()},[]),b=e.reactExports.useCallback(C=>{if(!l)return;(async()=>{p(!0);try{const U=await e.POST_Api_V1_Playbooks_SolidifyView_Run_ByPlaybookId(l,{params:C});U.success&&U.data&&E(U.data)}catch{}finally{p(!1)}})()},[l]),M=e.reactExports.useCallback(C=>{l===C&&(u(""),E(null),w([])),r()},[l,r]),S=e.reactExports.useCallback(()=>{if(!l)return null;const C=n.find(I=>I.playbook_id===l);return(C==null?void 0:C.name)||null},[l,n]),Q=e.reactExports.useCallback((C,I)=>{E(C),z(I!==void 0?I:!0)},[]),$=e.reactExports.useCallback(()=>{},[]),D=e.reactExports.useCallback(()=>{u(""),E(null),w([])},[]);return{solidifiedPlaybooks:n,solidifiedPlaybooksLoading:i,solidifiedPlaybooksLoaded:h,activeSolidifiedPlaybook:l,setActiveSolidifiedPlaybook:u,solidifyInputParams:v,solidifyLoading:g,dashboardData:R,setDashboardData:E,dashboardShowSaveButton:B,setDashboardShowSaveButton:z,loadSolidifiedPlaybooks:r,ensureSolidifiedPlaybooksLoaded:c,handleSolidifiedPlaybookClick:N,handleSolidifyParamsSearch:b,handleSolidifiedPlaybookDelete:M,getCurrentSolidifiedPlaybookName:S,handleDashboardPreview:Q,handleSolidifyComplete:$,clearDashboard:D}}function js(){const{allQuestions:n,setCurrentQuestion:s}=e.useQuestionsStore();e.reactExports.useEffect(()=>{if(n.length===0)return;const i=Math.floor(Math.random()*n.length);s(n[i]);const o=setInterval(()=>{const h=Math.floor(Math.random()*n.length);s(n[h])},1e4);return()=>{clearInterval(o)}},[n,s])}const ct={chat:{title:"对话",subtitle:""},plan:{title:"自动化",subtitle:"创建、管理并追踪自动化智能体的执行结果,支持定时触发与对内流转"},professional:{title:"专业智能体",subtitle:"深度分析与专业领域对话"},goals:{title:"目标追踪",subtitle:"跟踪关键业务指标和目标进展"},settings:{title:"通知配置",subtitle:"配置 Webhook 通知,实时接收系统重要事件"}},Es=5*60*1e3,fs=3;function gs(n={}){const{showAside:s=!0,showLogout:i=!1,onLogout:o,presetAgents:h,webhookId:j,onReady:l,initialAgentId:u,initialPlaybookId:v,initialPlaybookParams:w}=n,g=localStorage.getItem("sso_token")||"",p=localStorage.getItem("sso_domain")||"maiduo",R=localStorage.getItem("sso_company")||"",B=`${e.getBaseURL()}/api/v1/oss/upload2`,z=e.reactExports.useCallback(async d=>{const{data:A}=await e.GET_Api_V1_Playbooks_Detail({playbook_id:d});return A},[]),f=e.reactExports.useCallback(d=>e.POST_Api_V1_Playbooks_SolidifyView_SaveV2({session_id:d.session_id||"",name:d.name,description:d.description}),[]),r=e.reactExports.useCallback(d=>e.POST_Api_V1_Playbooks_SolidifyView_PreviewV2({session_id:d.session_id||"",user_hint:d.user_hint||""}),[]),{activeAgent:c,setActiveAgent:N,sourceAgents:b,playbooks:M,userPlaybooks:S,userPlaybooksLoading:Q,childAgents:$,agentLoading:D,sceneLoading:C,loadUserPlaybooks:I,playbooksLoaded:U}=q.useWorkbenchRuntime({presetAgents:h,initialAgentId:u}),F=D||C,[Re,te]=e.reactExports.useState(()=>!!u),[se,Ee]=e.reactExports.useState(!1),[J,Z]=e.reactExports.useState(!1),[ue,X]=e.reactExports.useState([]),[ae,W]=e.reactExports.useState(0),le=e.reactExports.useRef(!1),{executing:ce,stopping:we,executingRef:G,queueStatus:xe,messageData:ne,actions:ke}=q.useWorkbenchSession({activeAgent:c,webhookId:j,ssoToken:g,ssoDomain:p,ssoCompany:R,onRecommendationsUpdate:X}),{sendMessage:_,executePlaybook:O,respondToProposal:pe,stopCurrent:Ne,retrigger:Te,abort:me,clearMessages:ee}=ke;e.reactExports.useEffect(()=>{le.current&&!ce&&W(d=>d+1),le.current=ce},[ce]);const{widgets:ie,setWidgets:V,loadDailyReports:K}=ms({activeAgent:c,webhookId:j,ssoToken:g,ssoDomain:p,ssoCompany:R}),P=hs();js();const[Se,Ce]=e.reactExports.useState(()=>localStorage.getItem("wandox_sidebar_agent_mode")==="true"),Ie=e.reactExports.useCallback(()=>{Ce(d=>{const A=!d;return localStorage.setItem("wandox_sidebar_agent_mode",String(A)),A})},[]),[Pe,he]=e.reactExports.useState(!1),[t,x]=e.reactExports.useState(!1),[L,k]=e.reactExports.useState(!1),[fe,Ae]=e.reactExports.useState(!1),[be,a]=e.reactExports.useState(null),[y,de]=e.reactExports.useState(!1),[T,Be]=e.reactExports.useState(null),[ye,ge]=e.reactExports.useState(""),[ve,H]=e.reactExports.useState(null),[oe,je]=e.reactExports.useState("chat"),[De,dt]=e.reactExports.useState(null),ut=e.reactExports.useCallback(()=>{he(!0),x(!1)},[]),pt=e.reactExports.useCallback(()=>{he(!1),x(!1)},[]),[Ye,Xe]=e.reactExports.useState(""),[Je,et]=e.reactExports.useState(0),[mt,ze]=e.reactExports.useState(!1),[tt,st]=e.reactExports.useState(!1),[ht,nt]=e.reactExports.useState(!1),[jt,Et]=e.reactExports.useState(""),Oe=e.reactExports.useRef(null),Le=e.reactExports.useRef(!1),[ft,gt]=e.reactExports.useState(null),[Rt,wt]=e.reactExports.useState(!1),bt=F||ne.loading,yt=e.reactExports.useCallback(d=>{a(()=>d)},[]);e.reactExports.useEffect(()=>{l&&l({showInspectionResults:d=>{gt(d||null),wt(!0)}})},[l]),e.reactExports.useEffect(()=>{te(!!u),Ee(!1),Z(!1)},[u,v,w]),e.reactExports.useEffect(()=>{if(c)return X([]),()=>{G.current&&me()}},[c,j,g,p,R]),e.reactExports.useEffect(()=>{if(oe!=="professional"){Le.current=!1;return}if(!c)return;Le.current||(ne.loadMessagesAndDailyReport(),K()),Le.current=!1;let d=0,A=null;return A=setInterval(async()=>{try{await K(),d=0}catch{d++,d>=fs&&A&&(clearInterval(A),A=null)}},Es),()=>{A&&clearInterval(A)}},[oe,c,j,g,p,R]);const Y=b.find(d=>d.is_main)??b[0],Me=(Y==null?void 0:Y.questions)||[];e.reactExports.useEffect(()=>{et(0),ze(!1)},[Y==null?void 0:Y.agent_id]),e.reactExports.useEffect(()=>{if(Me.length<=1||tt)return;let d;const A=setInterval(()=>{ze(!0),d=setTimeout(()=>{et(m=>(m+1)%Me.length),ze(!1)},350)},3500);return()=>{clearInterval(A),clearTimeout(d)}},[Me.length,tt]),e.reactExports.useEffect(()=>{if(Oe.current&&c&&c!=="default"){const d=Oe.current;Oe.current=null,_(d)}},[c,_]),e.reactExports.useEffect(()=>{if(!u||!Re||!c||c==="default"||b.length===0)return;!!e.findAgentById(b,u)||te(!1)},[u,Re,c,b]),e.reactExports.useEffect(()=>{!u||v||se||!c||c==="default"||!b.find(A=>e.matchesAgent(A,c)&&e.matchesAgent(A,u))||(Ee(!0),je("professional"),P.clearDashboard(),te(!1))},[u,v,se,c,b,P]),e.reactExports.useEffect(()=>{var at;if(!u||!v||J||!c||c==="default"||!U||!b.find(_e=>e.matchesAgent(_e,c)&&e.matchesAgent(_e,u)))return;const A=M.find(_e=>e.matchesPlaybook(_e,v));if(!A){je("professional"),e.staticMethods.error(`指定的场景(${v})不存在,已切换到智能体界面`),Z(!0),te(!1);return}Z(!0),je("professional"),Le.current=!0,ee(),P.clearDashboard(),H(null),ge("");const m=w||{},re=Object.keys(m).length>0,Ve=(A.input_fields??[]).filter(_e=>{if(!_e.required)return!1;const qe=m[_e.name];return qe==null||qe===""});if((((at=A.input_fields)==null?void 0:at.length)??0)>0&&(!re||Ve.length>0)){H(A),te(!1);return}O({message:A.name,playbook_id:v,playbook_params:m}),te(!1)},[u,v,J,c,U,b,M,w]);const We=e.reactExports.useCallback(d=>{e.isSameAgentSelection(b,c,d)||(G.current&&(me(),e.staticMethods.info("已中止当前场景,切换智能体")),N(d),ge(""),H(null),P.clearDashboard(),ee(),V([]))},[me,c,b,ee,G,N,P,V]),vt=(d,A)=>{const m=(A??Ye).trim()||Me[Je%Me.length]||"",re=d||(Y==null?void 0:Y.agent_id);!m||!re||(Xe(""),nt(!0),ee(),c===re?_(m):(Le.current=!0,Oe.current=m,N(re)))},_t=(d,A)=>{P.handleDashboardPreview(d,A),je("chat"),N("default")},kt=()=>{P.handleSolidifyComplete(),je("chat"),N("default")},Nt=d=>{je(d),(d==="goals"||d==="settings"||d==="plan"||d==="chat")&&P.clearDashboard()},St=()=>{x(!1),Ae(!0),P.ensureSolidifiedPlaybooksLoaded()},Ct=d=>{Ae(!1),P.handleSolidifiedPlaybookClick(d),je("chat"),N("default"),ge(""),H(null)},It=()=>{var d,A;if(P.dashboardData)return e.jsxRuntimeExports.jsx(e.DashboardRenderer,{data:P.dashboardData,showSaveButton:P.dashboardShowSaveButton,onSaveSuccess:P.loadSolidifiedPlaybooks,onSaveDashboard:f,onPreviewDashboard:r,title:P.getCurrentSolidifiedPlaybookName()||void 0,customParamsForm:P.solidifyInputParams.length>0?e.jsxRuntimeExports.jsx(Ht,{inputParams:P.solidifyInputParams,onSearch:P.handleSolidifyParamsSearch,loading:P.solidifyLoading}):void 0,showGlobalFilter:P.solidifyInputParams.length>0});switch(oe){case"chat":return e.jsxRuntimeExports.jsx(e.PlaybookContext.Provider,{value:{onExecutePlaybook:O,getPlaybookDetail:z,ossUploadUrl:B,ssoToken:g,ssoDomain:p,ssoCompany:R,onFillPlaybookParams:m=>{const re={playbook_id:m.playbookId,name:m.playbookName,input_fields:m.inputFields,initial_params:m.initialParams,playbook_type:m.playbookType};H(re),je("professional")}},children:e.jsxRuntimeExports.jsx(us,{agentLoading:F,mainAgentForHub:Y,mainAgentQuestions:Me,agents:b,hubChatOpen:ht,setHubChatOpen:nt,hubChatInput:Ye,setHubChatInput:Xe,hubScrollIdx:Je,hubScrollFading:mt,onHubChatSend:vt,onHubInputFocus:()=>st(!0),onHubInputBlur:()=>st(!1),messages:ne.messages,executing:ce,hubInlineChatInput:jt,setHubInlineChatInput:Et,onHubInlineSend:(m,re,Ve)=>{Y!=null&&Y.agent_id&&(c!==Y.agent_id&&N(Y.agent_id),_(m,re,Ve))},onEnterProfessional:m=>{m&&N(m),ge(""),H(null),P.clearDashboard(),V([]),je("professional")},playbooks:M,executePlaybook:O,onRequestPlaybookParams:H,clearMessages:ee,onAbort:me,onRespondToProposal:pe,ssoToken:g,ssoDomain:p,ssoCompany:R})});case"goals":return e.jsxRuntimeExports.jsx(e.GoalTracker,{});case"settings":return e.jsxRuntimeExports.jsx(q.SettingsWithTabs,{});case"plan":return e.jsxRuntimeExports.jsx(q.AutomationPage,{embedded:!0,onHeaderChange:dt,onCockpitEnter:ut,onCockpitExit:pt});case"professional":return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Jt,{title:((d=b.find(m=>e.matchesAgent(m,c)))==null?void 0:d.name)||"Wandox智能体",agentSwitcher:Se?void 0:e.jsxRuntimeExports.jsxs("div",{style:{display:"inline-flex",alignItems:"center",height:34,background:"#fff",border:"1px solid #e5e0f0",borderRadius:10,boxSizing:"border-box",overflow:"hidden"},children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 0 0 8px"},children:[e.jsxRuntimeExports.jsx("div",{style:{width:22,height:22,flexShrink:0},children:q.getAgentIconById((A=b.find(m=>e.matchesAgent(m,c)))==null?void 0:A.icon)}),e.jsxRuntimeExports.jsx(e.Select,{value:c,onChange:m=>We(m),options:b.map(m=>({value:m.agent_id,label:m.name})),variant:"borderless",suffixIcon:e.jsxRuntimeExports.jsx(e.RefIcon$13,{style:{color:"#9275ff",verticalAlign:"middle"}}),style:{fontWeight:600,fontSize:14,minWidth:100,color:"#4a3a6a"},popupMatchSelectWidth:!1})]}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:Ie,title:"切换为侧边栏选择",style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:"100%",cursor:"pointer",color:"#b0a0c8",borderLeft:"1px solid #e5e0f0",transition:"all 0.15s",background:"none",border:"none",padding:0},onMouseEnter:m=>{m.currentTarget.style.color="#7c3aed",m.currentTarget.style.background="#f5f0ff"},onMouseLeave:m=>{m.currentTarget.style.color="#b0a0c8",m.currentTarget.style.background="transparent"},children:e.jsxRuntimeExports.jsx(it,{style:{fontSize:13}})})]}),count:ie.length,widgets:ie,activeAgent:c,agents:b,childAgents:$,ssoDomain:p,ssoToken:g,ssoCompany:R,onWidgetsUpdate:V,onExecuteComplete:()=>{K()},externalRobotName:ft,externalShowPanel:Rt}),e.jsxRuntimeExports.jsx(e.Chat,{messages:ne.messages,playbooks:M,messagesTotal:ne.messagesTotal,loadMoreMessages:ne.loadMoreMessages,loading:bt,executing:ce,ssoToken:g,ssoDomain:p,ssoCompany:R,activeAgent:c,webhookId:j,onExecutePlaybook:O,onSolidifySuccess:P.loadSolidifiedPlaybooks,onDashboardPreview:_t,onSolidifyComplete:kt,onFillPlaybookParams:m=>{const re={playbook_id:m.playbookId,name:m.playbookName,input_fields:m.inputFields,initial_params:m.initialParams,playbook_type:m.playbookType};H(re)},onActionClick:m=>{m.action_id?(k(!0),be&&be({action_id:m.action_id,action_params:m.params})):m.playbook_id&&O({message:m.display_name||"执行",playbook_id:m.playbook_id,...m.params?{playbook_params:m.params}:{}})},onExecuteComplete:()=>{K()},onRespondToProposal:pe,onRetrigger:Te}),e.jsxRuntimeExports.jsxs("div",{className:"chat-input-area",children:[e.jsxRuntimeExports.jsx(e.PlaybookHub,{playbooks:M,playbookLoading:F,onPlaybookClick:O,onSelectPlaybook:m=>{H(m)},recommendations:ue,userPlaybooks:S,userPlaybooksLoading:Q,onLoadUserPlaybooks:I,agentId:e.getAgentPrimaryId(b.find(m=>e.matchesAgent(m,c)))||c,recentRefreshKey:ae}),e.jsxRuntimeExports.jsx(e.ChatInput,{executing:ce,stopping:we,onStop:Ne,onSend:_,playbooks:M,recommendations:ue,value:ye,onValueChange:ge,onRequestPlaybookParams:H,ssoToken:g,ssoDomain:p,ssoCompany:R})]})]});default:return null}},$e=oe==="plan"?De??ct.plan:ct[oe],Pt=(oe==="plan"||!P.dashboardData)&&oe!=="professional"&&oe!=="chat";return e.jsxRuntimeExports.jsx(e.LanguageProvider,{children:e.jsxRuntimeExports.jsxs(ts,{children:[e.jsxRuntimeExports.jsx("div",{className:`wandox-aside-overlay ${t?"wandox-aside-overlay--visible":""}`,onClick:()=>x(!1),onKeyDown:d=>d.key==="Escape"&&x(!1),role:"button",tabIndex:0,"aria-label":"关闭侧边栏"}),s&&e.jsxRuntimeExports.jsx(es,{active:c,agents:b,onChange:d=>{x(!1),We(d)},collapsed:Pe,onToggle:()=>he(d=>!d),className:t?"wandox-aside--mobile-open":"",activeView:oe,onViewChange:Nt,onToolboxOpen:St,showLogout:i,onLogout:o,sidebarAgentMode:Se,onToggleSidebarMode:Ie,onAgentSelect:d=>We(d)}),s&&Pe&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-aside-floating-open",onClick:()=>he(!1),"aria-label":"展开侧边栏",title:"展开侧边栏",children:e.jsxRuntimeExports.jsx(it,{})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-mobile-header",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-mobile-menu-btn",onClick:()=>{he(!1),x(!0)},children:"☰"}),e.jsxRuntimeExports.jsx("h1",{className:"wandox-mobile-title",children:"Wandox"}),i&&o?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:o,style:{width:40,height:40,background:"transparent",border:"none",cursor:"pointer"},children:"退出"}):e.jsxRuntimeExports.jsx("div",{style:{width:40}})]}),Pt&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace-topbar",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace-topbar-info",children:[e.jsxRuntimeExports.jsx("h1",{className:"wandox-workspace-topbar-title",children:($e==null?void 0:$e.title)??"您好,欢迎使用 AI 智能体"}),e.jsxRuntimeExports.jsx("p",{className:"wandox-workspace-topbar-subtitle",children:($e==null?void 0:$e.subtitle)??""})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-workspace-topbar-actions",children:oe==="plan"?De==null?void 0:De.actions:null})]}),e.jsxRuntimeExports.jsx("div",{className:`wandox-workspace-container${oe==="plan"?" wandox-workspace-container--automation":""}`,children:It()})]}),e.jsxRuntimeExports.jsx(Yt,{open:fe,loading:P.solidifiedPlaybooksLoading,playbooks:P.solidifiedPlaybooks,activePlaybookId:P.activeSolidifiedPlaybook,onClose:()=>Ae(!1),onPlaybookClick:Ct,onPlaybookDelete:P.handleSolidifiedPlaybookDelete}),e.jsxRuntimeExports.jsx(e.ActionExecutionDrawer,{open:L,ssoToken:g,ssoDomain:p,ssoCompany:R,onClose:()=>k(!1),onExecuteAction:yt,onExecuteComplete:()=>{setTimeout(()=>{K()},1e3)}}),e.jsxRuntimeExports.jsx(ns,{open:y,actionId:(T==null?void 0:T.action_id)||"",actionName:(T==null?void 0:T.display_name)||"",defaultParams:T==null?void 0:T.params,onCancel:()=>{de(!1),Be(null)},onExecute:d=>{de(!1),k(!0),be&&T&&be({action_id:T.action_id,action_params:d}),Be(null)}}),e.jsxRuntimeExports.jsx(Kt,{open:!!ve,playbook:ve,onClose:()=>H(null),onSubmit:(d,A)=>{H(null),O({message:d.name,playbook_id:d.playbook_id,playbook_params:A})}}),Re&&e.jsxRuntimeExports.jsx(e.InitialRouteLoading,{}),e.jsxRuntimeExports.jsx(ss,{queueStatus:xe})]})})}exports.default=gs;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-OiJ3pN8N.cjs"),q=require("./WorkbenchRuntime-CcgVGiw7.cjs"),Ye=require("./index-Mn9BkUmO.cjs");var At={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}},{tag:"path",attrs:{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"}}]},name:"aim",theme:"outlined"};function Fe(){return Fe=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Fe.apply(this,arguments)}const Mt=(n,s)=>e.reactExports.createElement(e.Icon,Fe({},n,{ref:s,icon:At})),$t=e.reactExports.forwardRef(Mt);var Tt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 01-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0165.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"}}]},name:"deployment-unit",theme:"outlined"};function Ge(){return Ge=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ge.apply(this,arguments)}const Lt=(n,s)=>e.reactExports.createElement(e.Icon,Ge({},n,{ref:s,icon:Tt})),Bt=e.reactExports.forwardRef(Lt);var Dt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"};function Ke(){return Ke=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ke.apply(this,arguments)}const Ot=(n,s)=>e.reactExports.createElement(e.Icon,Ke({},n,{ref:s,icon:Dt})),ot=e.reactExports.forwardRef(Ot);var zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"}}]},name:"poweroff",theme:"outlined"};function Ze(){return Ze=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Ze.apply(this,arguments)}const Wt=(n,s)=>e.reactExports.createElement(e.Icon,Ze({},n,{ref:s,icon:zt})),Vt=e.reactExports.forwardRef(Wt);var qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};function He(){return He=Object.assign?Object.assign.bind():function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},He.apply(this,arguments)}const Qt=(n,s)=>e.reactExports.createElement(e.Icon,He({},n,{ref:s,icon:qt})),Ut=e.reactExports.forwardRef(Qt);function Ft(n){return n instanceof Error?n.message:"上传失败"}function Gt({open:n,playbook:s,onClose:i,onSubmit:o}){const h=e.reactExports.useMemo(()=>e.normalizeAgentInputFields(s==null?void 0:s.input_fields),[s]),[j,l]=e.reactExports.useState({}),[u,v]=e.reactExports.useState({}),[w,g]=e.reactExports.useState({}),p=e.useDynamicFieldOptions(h,j,l),R=e.reactExports.useMemo(()=>q.getVisibleInputFields(h,j),[h,j]);e.reactExports.useEffect(()=>{n&&(l(q.buildDefaultInputValues(h,(s==null?void 0:s.initial_params)??{})),v({}),g({}))},[h,n,s==null?void 0:s.initial_params]);const E=e.reactExports.useCallback((f,r)=>{l(c=>({...c,[f]:r}))},[]),B=e.reactExports.useCallback((f,r)=>async({file:c,onSuccess:N,onError:b})=>{var M,S;v(Q=>({...Q,[f]:!0}));try{const Q=c,$=await e.POST_Api_V1_Oss_Upload2(Q),D=(M=$==null?void 0:$.data)==null?void 0:M.url,C=((S=$==null?void 0:$.data)==null?void 0:S.name)||Q.name;if(!D)throw new Error("上传结果缺少文件地址");g(I=>({...I,[D]:C})),l(I=>{if(r<=1)return{...I,[f]:D};const U=Array.isArray(I[f])?I[f]:I[f]?[I[f]]:[];return{...I,[f]:[...U,D]}}),N==null||N($),e.staticMethods.success("上传成功")}catch(Q){const $=Q instanceof Error?Q:new Error(Ft(Q));b==null||b($),e.staticMethods.error($.message)}finally{v(Q=>({...Q,[f]:!1}))}},[]),z=()=>{if(!s)return;const f=R.filter(r=>r.required&&q.isMissingFieldValue(j[r.name]));if(f.length>0){e.staticMethods.warning(`请填写必填参数:${f.map(r=>r.label).join("、")}`);return}o(s,j)};return e.jsxRuntimeExports.jsxs(Ye.Drawer,{className:"wandox-playbook-params-drawer",title:e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__title",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-main",children:"填写执行参数"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-playbook-params-drawer__title-sub",children:s==null?void 0:s.name})]}),open:n,size:640,destroyOnHidden:!0,maskClosable:!1,onClose:i,footer:e.jsxRuntimeExports.jsx("div",{className:"wandox-playbook-params-drawer__footer",children:e.jsxRuntimeExports.jsxs(e.Space,{children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:i,children:"取消"}),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",onClick:z,children:"开始执行"})]})}),children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__intro",children:[e.jsxRuntimeExports.jsx("span",{children:"填写本次运行需要的参数"}),e.jsxRuntimeExports.jsxs("span",{children:[R.length," 项"]})]}),e.jsxRuntimeExports.jsxs(e.Form,{layout:"vertical",className:"wandox-playbook-params-drawer__form",children:[R.map(f=>e.jsxRuntimeExports.jsx(e.Form.Item,{required:f.required,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-playbook-params-drawer__label",children:[f.label,f.description||f.hint?e.jsxRuntimeExports.jsx(e.Tooltip,{title:f.description||f.hint,children:e.jsxRuntimeExports.jsx(e.RefIcon$2,{"aria-label":`${f.label}说明`})}):null]}),children:e.jsxRuntimeExports.jsx(q.AgentInputFieldControl,{field:f,value:j[f.name],uploading:!!u[f.name],fileNameMap:w,getOptionState:p.getFieldState,onChange:E,onUpload:B,onDownloadTemplate:r=>window.open(r.path,"_blank","noopener,noreferrer")})},f.name)),R.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-playbook-params-drawer__empty",children:[e.jsxRuntimeExports.jsx(e.Spin,{size:"small"})," 正在读取参数配置"]}):null]})]})}function Kt({playbooks:n,onPlaybookClick:s,onPlaybookDelete:i,activePlaybookId:o}){const{t:h}=e.useLanguage(),[j,l]=e.reactExports.useState(""),[u,v]=e.reactExports.useState(!1),[w,g]=e.reactExports.useState(null),[p,R]=e.reactExports.useState(!1),E=n.filter(r=>{var c;return r.name.toLowerCase().includes(j.toLowerCase())||((c=r.description)==null?void 0:c.toLowerCase().includes(j.toLowerCase()))}),B=(r,c)=>{c.stopPropagation(),g(r),v(!0)},z=async()=>{if(w){R(!0);try{await e.DELETE_Api_V1_Playbooks_SolidifyView_ByPlaybookId(w.playbook_id),i==null||i(w.playbook_id),v(!1),g(null)}catch{}finally{R(!1)}}},f=()=>{v(!1),g(null)};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-list",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-search",children:e.jsxRuntimeExports.jsx(e.Input.Search,{placeholder:"搜索",value:j,onChange:r=>l(r.target.value),allowClear:!0,enterButton:!1})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-content",children:E.length===0?e.jsxRuntimeExports.jsx(e.Empty,{description:h(j?"noData":"solidified.empty"),image:e.Empty.PRESENTED_IMAGE_SIMPLE}):e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-list-grid",children:E.map(r=>e.jsxRuntimeExports.jsxs("div",{className:`wandox-solidified-card ${o===r.playbook_id?"active":""}`,onClick:()=>s==null?void 0:s(r.playbook_id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(s==null||s(r.playbook_id))},role:"button",tabIndex:0,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-icon",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"2",fill:"none"}),e.jsxRuntimeExports.jsx("path",{d:"M9 3v18M15 3v18M3 9h18M3 15h18",stroke:"currentColor",strokeWidth:"1.5"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-solidified-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-name",children:r.name}),r.description&&e.jsxRuntimeExports.jsx("div",{className:"wandox-solidified-card-desc",children:r.description})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-solidified-card-delete",onClick:c=>B(r,c),title:h("solidified.delete"),children:e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsxRuntimeExports.jsx("path",{d:"M6 7v12a2 2 0 002 2h8a2 2 0 002-2V7M4 7h16M10 11v6M14 11v6M9 7V4a1 1 0 011-1h4a1 1 0 011 1v3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},r.playbook_id))})}),e.jsxRuntimeExports.jsx(e.Modal,{title:h("solidified.deleteConfirm"),open:u,onOk:z,onCancel:f,okText:h("confirm"),cancelText:h("cancel"),okButtonProps:{danger:!0,loading:p},children:e.jsxRuntimeExports.jsxs("p",{children:[h("solidified.deleteConfirm")," 「",w==null?void 0:w.name,"」?"]})})]})}function Zt({inputParams:n,onSearch:s,loading:i=!1}){const[o]=e.Form.useForm();e.reactExports.useEffect(()=>{const l={};for(const u of n)u.default!==void 0&&u.default!==null&&u.default!==""&&(l[u.name]=u.default);o.setFieldsValue(l)},[n,o]);const h=()=>{o.validateFields().then(l=>{const u={};for(const v of Object.keys(l)){const w=l[v];w!=null&&w!==""&&(u[v]=w)}s(u)})},j=l=>{const{name:u,type:v,description:w}=l,g={placeholder:w||`请输入${u}`};switch(v){case"integer":return e.jsxRuntimeExports.jsx(e.TypedInputNumber,{...g,style:{width:"100%"}});case"array":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"boolean":return e.jsxRuntimeExports.jsx(e.Input,{...g});case"string":default:return e.jsxRuntimeExports.jsx(e.Input,{...g})}};return e.jsxRuntimeExports.jsx("div",{className:"wandox-solidify-params-form",children:e.jsxRuntimeExports.jsxs(e.Form,{form:o,layout:"inline",onFinish:h,style:{marginBottom:16},children:[n.map(l=>e.jsxRuntimeExports.jsx(e.Form.Item,{name:l.name,label:l.description||l.name,rules:[{required:l.required,message:`请输入${l.description||l.name}`}],style:{marginBottom:8},children:j(l)},l.name)),e.jsxRuntimeExports.jsx(e.Form.Item,{style:{marginBottom:8},children:e.jsxRuntimeExports.jsx(e.Button,{type:"primary",htmlType:"submit",loading:i,children:"查询"})})]})})}function Ht({open:n,loading:s,playbooks:i,activePlaybookId:o,onClose:h,onPlaybookClick:j,onPlaybookDelete:l}){return e.jsxRuntimeExports.jsx(Ye.Drawer,{title:"工具箱",placement:"right",size:"min(440px, 100vw)",open:n,loading:s,onClose:h,getContainer:!1,rootClassName:"wandox-toolbox-drawer",styles:{body:{padding:0,overflow:"hidden"}},children:e.jsxRuntimeExports.jsx(Kt,{playbooks:i,onPlaybookClick:j,onPlaybookDelete:l,activePlaybookId:o})})}const Yt="https://ai.maiduox.com/#/aitools/operation/product";function Xt(n){const{title:s,widgets:i,ssoDomain:o,ssoToken:h,ssoCompany:j,onExecuteComplete:l,activeAgent:u,agents:v,childAgents:w,externalRobotName:g,externalShowPanel:p,agentSwitcher:R}=n;n.onWidgetsUpdate,n.count,e.useLanguage();const[E,B]=e.reactExports.useState(!1),[z,f]=e.reactExports.useState(!1),[r,c]=e.reactExports.useState(null),[N,b]=e.reactExports.useState(null),[M,S]=e.reactExports.useState("results"),[Q,$]=e.reactExports.useState(!1),[D,C]=e.reactExports.useState([]),[I,U]=e.reactExports.useState(null),[F,Re]=e.reactExports.useState({}),[te,se]=e.reactExports.useState([]),[Ee,J]=e.reactExports.useState(!1),[Z,ue]=e.reactExports.useState(null),[X,ae]=e.reactExports.useState(void 0),[W,le]=e.reactExports.useState(!1),[ce,we]=e.reactExports.useState(!1),G=e.reactExports.useMemo(()=>(w||[]).map(t=>t.name),[w]),xe=e.reactExports.useMemo(()=>!u||u==="default"?null:(v==null?void 0:v.find(x=>x.agent_id===u||x.agent_code===u))||null,[u,v]),ne=e.reactExports.useMemo(()=>e.getAgentPackageBenefit(xe),[xe]);e.reactExports.useEffect(()=>{b(null)},[u]),e.reactExports.useEffect(()=>{ke(),w&&w.length>0&&_()},[w]),e.reactExports.useEffect(()=>{if(p&&(B(!0),g)){const t=G.find(x=>x===g);t?b(t):G.length>0}},[p,g,G]);const ke=async()=>{try{const t=await e.GET_Api_V1_Notification_Webhooks({});t!=null&&t.data&&se(t.data.map(x=>({webhook_id:x.webhook_id,name:x.name,platform:x.platform})))}catch{}},_=async()=>{try{const t={};await Promise.all(w.map(async x=>{var L;try{const k=await e.GET_Api_V1_Notification_Agents_Webhook_ByAgentId(x.agent_id,{});(L=k==null?void 0:k.data)!=null&&L.webhook_id&&(t[x.agent_id]=k.data.webhook_id)}catch{}})),Re(t)}catch{}},O=e.reactExports.useMemo(()=>N?i.filter(t=>{var k;const x=(k=t.title)==null?void 0:k.match(/^(.+?)\s*巡检结果$/);return(x?x[1]:t.agent_name)===N}):i,[i,N]),pe=e.reactExports.useMemo(()=>{if(!N)return"";const t=(w||[]).find(x=>x.name===N);return(t==null?void 0:t.agent_id)||""},[N,w]),Ne=o==="maiduo"&&N==="差评监控",Te=t=>{const x=N===t?null:t;b(x),x&&B(!0)},me=t=>{ue(t),ae(F[t.agent_id]),J(!0)},ee=e.reactExports.useCallback(async t=>{if(t){$(!0);try{const x=await e.GET_Api_V1_Agents_ActionExecutes({agent_id:t,limit:50});if(x!=null&&x.data&&Array.isArray(x.data)){const L=x.data.map((k,fe)=>({id:k.id||k.execute_id||`record_${fe}`,action_name:k.action_name||k.display_name||"未知动作",action_id:k.action_id||"",status:k.status||"pending",created_at:k.created_at||"",completed_at:k.completed_at,action_params:k.action_params,output_type:k.output_type,output_data:k.output_data,outputs:k.outputs,error:k.error})).sort((k,fe)=>new Date(fe.created_at).getTime()-new Date(k.created_at).getTime());C(L)}else C([])}catch{C([])}finally{$(!1)}}},[]),ie=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L} ${k}`}catch{return t}},V=t=>({pending:"等待中",running:"执行中",success:"成功",failed:"失败"})[t]||t,K=t=>({pending:"wandox-exec-status--pending",running:"wandox-exec-status--running",success:"wandox-exec-status--success",failed:"wandox-exec-status--failed"})[t]||"";e.reactExports.useEffect(()=>{M==="history"&&pe&&ee(pe)},[M,pe,ee]);const P=async()=>{if(!Z||!X){e.staticMethods.warning("请选择 Webhook");return}try{le(!0),await e.POST_Api_V1_Notification_Agents_Webhook({},{agent_id:Z.agent_id,webhook_id:X}),e.staticMethods.success("绑定成功"),J(!1),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"绑定失败")}finally{le(!1)}},Se=async()=>{if(Z)try{le(!0),await e.DELETE_Api_V1_Notification_Agents_Webhook_Delete_ByAgentId(Z.agent_id,{}),e.staticMethods.success("解绑成功"),J(!1),ae(void 0),_()}catch(t){e.staticMethods.error((t==null?void 0:t.message)||"解绑失败")}finally{le(!1)}},Ce=t=>{c(t),f(!0)},Ie=()=>{f(!1),c(null)},Pe=t=>{if(!t)return"";try{const x=new Date(t),L=x.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),k=x.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${L}
|
|
2
|
+
${k}`}catch{return t}},he=(t,x)=>{const L={high:"#ff4d4f",medium:"#faad14",low:"#52c41a"};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-dot-wrapper",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-timeline-time",style:{whiteSpace:"pre-line"},children:Pe(t.timestamp||"")}),e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-dot",style:{background:L[t.priority]}}),!x&&e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-line"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-widget-card",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-title",children:t.title}),t.ui_payload&&e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-content wandox-markdown-content",children:e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:t.ui_payload})}),t.actions&&t.actions.length>0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-widget-actions",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-widget-view-detail-btn",onClick:()=>Ce(t),children:[e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",children:[e.jsxRuntimeExports.jsx("title",{children:"快速执行"}),e.jsxRuntimeExports.jsx("path",{d:"M13 2L3 14H12L11 22L21 10H12L13 2Z",fill:"currentColor"})]}),"快速执行 (",t.actions.length,")"]})})]})]},t.id||`${t.type}_${t.title}_${t.timestamp}`)};return e.jsxRuntimeExports.jsxs("div",{className:"wandox-widget-section",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-section-header",children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[R??e.jsxRuntimeExports.jsx("span",{className:"wandox-widget-section-title",children:s}),e.jsxRuntimeExports.jsx(q.AgentPackageTag,{benefit:ne})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-inspection-controls",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-inspection-agent-btn ${E?"wandox-inspection-agent-btn--expanded":""}`,onClick:()=>{E?(B(!1),b(null)):B(!0)},children:[e.jsxRuntimeExports.jsxs("span",{className:"wandox-inspection-agent-icon",children:[e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"1.5"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-1"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-2"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-orbit-dot wandox-orbit-dot-3"})]}),e.jsxRuntimeExports.jsxs("span",{className:"wandox-inspection-agent-text",children:["巡检机器人(",G.length,")"]})]})})]}),E&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-list",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-filter-row wandox-agent-filter-row--with-close",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-filter-chips",children:[w.length>0&&e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-agent-filter-chip ${N===null?"active":""}`,onClick:()=>b(null),children:"全部"}),w.map(t=>{const x=!!F[t.agent_id];return e.jsxRuntimeExports.jsxs("div",{className:`wandox-agent-filter-chip-compound ${N===t.name?"active":""}`,children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-agent-filter-chip-name",onClick:()=>Te(t.name),children:t.name}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-agent-filter-chip-webhook ${x?"bound":""}`,onClick:()=>me(t),title:x?"已绑定 Webhook,点击修改":"绑定 Webhook 通知",children:x?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-dot","aria-hidden":"true"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-label",children:"已通知"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-plus","aria-hidden":"true",children:"+"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-webhook-label",children:"通知"})]})})]},t.agent_id)})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-timeline-list-close",onClick:()=>{B(!1),b(null),S("results")},title:"关闭",children:"✕"})]}),Ne&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-negative-review-notice",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-negative-review-notice-icon","aria-hidden":"true",children:"ℹ️"}),e.jsxRuntimeExports.jsxs("span",{children:["差评监控需要先设置需要监控的ASIN,请前往AI工具》",e.jsxRuntimeExports.jsx("a",{href:Yt,target:"_blank",rel:"noreferrer",className:"wandox-negative-review-notice-link",children:"新老诊断"}),"进行设置。每个asin每一次都需要0.01算力。"]})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-tabs-header",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-timeline-tabs-nav",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-timeline-tab-btn ${M==="results"?"active":""}`,onClick:()=>S("results"),children:["巡检结果",O.length>0&&e.jsxRuntimeExports.jsx("span",{className:"wandox-timeline-tab-badge",children:O.length})]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-timeline-tab-btn ${M==="history"?"active":""}`,onClick:()=>S("history"),children:"执行记录"})]})}),M==="results"?e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-list-content",children:O.length>0?O.sort((t,x)=>{const L=t.timestamp?new Date(t.timestamp).getTime():0;return(x.timestamp?new Date(x.timestamp).getTime():0)-L}).map((t,x,L)=>he(t,x===L.length-1)):e.jsxRuntimeExports.jsxs("div",{className:"wandox-empty-state",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-icon",children:"�"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:N?"没有符合筛选条件的数据":"暂无工作区数据"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-desc",children:N?"请调整筛选条件":"工作区数据将在这里显示"})]})}):e.jsxRuntimeExports.jsx("div",{className:"wandox-timeline-list-content wandox-history-panel",children:N?Q?e.jsxRuntimeExports.jsxs("div",{className:"wandox-loading-state",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-spinner wandox-spinner--small"}),e.jsxRuntimeExports.jsx("span",{children:"加载中..."})]}):D.length===0?e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-state",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:"暂无执行记录"})}):e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-history-list",children:D.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-header",onClick:()=>U(I===t.id?null:t.id),onKeyDown:x=>x.key==="Enter"&&U(I===t.id?null:t.id),role:"button",tabIndex:0,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-info",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-name",children:t.action_name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-time",children:ie(t.created_at)})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-status-wrapper",children:[e.jsxRuntimeExports.jsx("span",{className:`wandox-exec-status ${K(t.status)}`,children:V(t.status)}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-history-arrow","aria-hidden":"true",children:I===t.id?"▼":"▶"})]})]}),I===t.id&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-history-detail",children:[t.action_params&&Object.keys(t.action_params).length>0&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-params",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行参数"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-params-list",children:Object.entries(t.action_params).map(([x,L])=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-param-item",children:[e.jsxRuntimeExports.jsxs("span",{className:"wandox-exec-param-key",children:[x,":"]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-param-value",children:typeof L=="object"?JSON.stringify(L):String(L)})]},x))})]}),t.error?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-error",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-error-label",children:"错误信息:"}),e.jsxRuntimeExports.jsx("span",{className:"wandox-exec-error-msg",children:t.error})]}):t.output_type&&t.output_data?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-outputs",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行结果"}),e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:{type:t.output_type,...t.output_data}})]}):t.outputs?e.jsxRuntimeExports.jsxs("div",{className:"wandox-exec-outputs",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-section-label",children:"执行结果"}),e.jsxRuntimeExports.jsx(e.PayloadRenderer,{payload:t.outputs})]}):e.jsxRuntimeExports.jsx("div",{className:"wandox-exec-no-output",children:"暂无输出结果"})]})]},t.id))}):e.jsxRuntimeExports.jsxs("div",{className:"wandox-empty-state",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-icon",children:"🤖"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-text",children:"请先选择机器人"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-desc",children:"在上方选择一个机器人查看执行记录"})]})})]}),e.jsxRuntimeExports.jsx(e.ActionDetailDrawer,{open:z,title:(r==null?void 0:r.title)||"动作详情",actions:(r==null?void 0:r.actions)||[],widgetId:r==null?void 0:r.id,ssoToken:h,ssoDomain:o,ssoCompany:j,onClose:Ie,onExecuteComplete:l}),e.jsxRuntimeExports.jsx(e.Modal,{title:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12 22C10.8954 22 10 21.1046 10 20V14C10 12.8954 10.8954 12 12 12C13.1046 12 14 12.8954 14 14V20C14 21.1046 13.1046 22 12 22Z"}),e.jsxRuntimeExports.jsx("path",{d:"M18 16C16.8954 16 16 15.1046 16 14V10C16 8.89543 16.8954 8 18 8C19.1046 8 20 8.89543 20 10V14C20 15.1046 19.1046 16 18 16Z"}),e.jsxRuntimeExports.jsx("path",{d:"M6 16C4.89543 16 4 15.1046 4 14V10C4 8.89543 4.89543 8 6 8C7.10457 8 8 8.89543 8 10V14C8 15.1046 7.10457 16 6 16Z"}),e.jsxRuntimeExports.jsx("path",{d:"M10.5 4C10.5 2.61929 11.6193 1.5 13 1.5H13.5C14.8807 1.5 16 2.61929 16 4V6H10.5V4Z"})]}),e.jsxRuntimeExports.jsx("span",{children:"配置 Webhook 通知"})]}),open:Ee,onCancel:()=>{J(!1),ue(null),ae(void 0)},width:520,footer:null,centered:!0,children:e.jsxRuntimeExports.jsxs("div",{style:{padding:"8px 0"},children:[e.jsxRuntimeExports.jsxs("div",{style:{marginBottom:"20px",padding:"12px 16px",background:"#f5f7fa",borderRadius:"8px",border:"1px solid #e8eaed"},children:[e.jsxRuntimeExports.jsx("div",{style:{fontSize:"13px",color:"#666",marginBottom:"4px"},children:"智能体"}),e.jsxRuntimeExports.jsx("div",{style:{fontSize:"15px",color:"#1a1a1a",fontWeight:500},children:Z==null?void 0:Z.name})]}),e.jsxRuntimeExports.jsxs("div",{style:{marginBottom:"20px"},children:[e.jsxRuntimeExports.jsx("div",{style:{marginBottom:"8px",fontSize:"14px",color:"#333",fontWeight:500},children:"选择 通知地址"}),e.jsxRuntimeExports.jsx(e.Select,{style:{width:"100%"},size:"large",placeholder:"请选择 通知地址",value:X,onChange:ae,options:te.map(t=>({label:`${t.name} (${t.platform==="dingtalk"?"钉钉":t.platform==="feishu"?"飞书":"企业微信"})`,value:t.webhook_id})),disabled:W,popupRender:t=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[t,e.jsxRuntimeExports.jsx(Ye.Divider,{style:{margin:"8px 0"}}),e.jsxRuntimeExports.jsx(e.Space,{style:{padding:"0 8px 4px"},children:e.jsxRuntimeExports.jsx(e.Button,{type:"text",icon:e.jsxRuntimeExports.jsx("span",{children:"+"}),onClick:()=>we(!0),children:"添加新的通知地址"})})]})}),te.length===0&&e.jsxRuntimeExports.jsxs("div",{style:{marginTop:"8px",padding:"8px 12px",background:"#fff7e6",border:"1px solid #ffd591",borderRadius:"4px",fontSize:"13px",color:"#d46b08",display:"flex",alignItems:"center",gap:"6px"},children:[e.jsxRuntimeExports.jsx("span",{children:"⚠️"}),e.jsxRuntimeExports.jsx("span",{children:'暂无可用的 通知地址,请先在"通知配置"中创建'})]})]}),e.jsxRuntimeExports.jsxs("div",{style:{padding:"12px 16px",background:"#f0f9ff",borderRadius:"8px",border:"1px solid #bae7ff",marginBottom:"20px"},children:[e.jsxRuntimeExports.jsx("div",{style:{fontSize:"13px",color:"#0958d9",fontWeight:500,marginBottom:"8px"},children:"💡 功能说明"}),e.jsxRuntimeExports.jsxs("div",{style:{fontSize:"13px",color:"#096dd9",lineHeight:"1.8"},children:[e.jsxRuntimeExports.jsx("div",{children:"• 绑定后,该智能体执行完成时会自动发送通知"}),e.jsxRuntimeExports.jsx("div",{children:"• 通知内容包含执行结果和相关信息"}),e.jsxRuntimeExports.jsx("div",{children:"• 可随时修改或解除绑定"})]})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[F[(Z==null?void 0:Z.agent_id)||""]&&e.jsxRuntimeExports.jsx("button",{type:"button",onClick:Se,disabled:W,style:{marginRight:"auto",padding:"8px 20px",border:"1px solid #ff4d4f",borderRadius:"6px",background:"#fff",color:"#ff4d4f",cursor:W?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s",opacity:W?.6:1},onMouseEnter:t=>{W||(t.currentTarget.style.background="#fff1f0")},onMouseLeave:t=>{t.currentTarget.style.background="#fff"},children:"解除绑定"}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{J(!1),ue(null),ae(void 0)},disabled:W,style:{padding:"8px 24px",border:"1px solid #d9d9d9",borderRadius:"6px",background:"#fff",color:"#333",cursor:W?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s",opacity:W?.6:1},onMouseEnter:t=>{W||(t.currentTarget.style.background="#fafafa")},onMouseLeave:t=>{t.currentTarget.style.background="#fff"},children:"取消"}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:P,disabled:W||!X,style:{padding:"8px 24px",border:"none",borderRadius:"6px",background:W||!X?"#d9d9d9":"#1890ff",color:"#fff",cursor:W||!X?"not-allowed":"pointer",fontSize:"14px",fontWeight:500,transition:"all 0.2s"},onMouseEnter:t=>{!W&&X&&(t.currentTarget.style.background="#40a9ff")},onMouseLeave:t=>{!W&&X&&(t.currentTarget.style.background="#1890ff")},children:W?"保存中...":"保存"})]})]})}),e.jsxRuntimeExports.jsx(q.QuickAddWebhook,{open:ce,onClose:()=>we(!1),onSuccess:t=>{se(x=>[...x,t]),ae(t.webhook_id)}})]})}function Jt({active:n,agents:s,collapsed:i,onToggle:o,className:h,activeView:j="chat",onViewChange:l,onToolboxOpen:u,showLogout:v,onLogout:w,sidebarAgentMode:g=!1,onToggleSidebarMode:p,onAgentSelect:R}){const E=localStorage.getItem("sso_domain")||"",B=[{key:"chat",icon:e.jsxRuntimeExports.jsx(q.RefIcon$4,{}),title:"对话"},...["maiduo","eccang"].includes(E)?[{key:"plan",icon:e.jsxRuntimeExports.jsx(Bt,{}),title:"自动化Beta"}]:[],{key:"professional",icon:e.jsxRuntimeExports.jsx(e.RefIcon$14,{}),title:"专业智能体"}],f=[...E==="yunduo"?[]:[{key:"toolbox",icon:e.jsxRuntimeExports.jsx(Ut,{}),label:"工具箱"},{key:"goals",icon:e.jsxRuntimeExports.jsx($t,{}),label:"目标追踪"}],{key:"settings",icon:e.jsxRuntimeExports.jsx(q.RefIcon$2,{}),label:"通知配置"}];return e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-wrap",children:e.jsxRuntimeExports.jsxs("div",{className:`wandox-aside ${i?"wandox-aside--collapsed":""} ${h||""}`,"aria-hidden":i,children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-header",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-header__title",children:"AI 智能体"}),o&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-aside-header-toggle",onClick:o,"aria-label":i?"展开侧边栏":"收起侧边栏",title:i?"展开侧边栏":"收起侧边栏",children:e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",children:[e.jsxRuntimeExports.jsx("title",{children:i?"展开侧边栏":"收起侧边栏"}),e.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M21 5H11v14h10zM3 5h6v14H3zm0-2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm2 4.25a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5zm-.75 3.5A.75.75 0 0 1 5 10h2a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75m.75 2a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5z"})]})})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-main-nav",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-nav-list",children:B.map(r=>{const c=j===r.key,N=r.key==="professional";return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:`wandox-aside-nav-item-wrap${c?" wandox-aside-nav-item-wrap--active":""}`,children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>l==null?void 0:l(r.key),className:`wandox-aside-nav-item${c?" wandox-aside-nav-item--active":""}`,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:r.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:r.title})]}),N&&!i&&p&&e.jsxRuntimeExports.jsx(e.Tooltip,{title:g?"收起列表":"展开列表",placement:"right",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:`wandox-aside-mode-toggle${g?" wandox-aside-mode-toggle--active":""}`,onClick:b=>{b.stopPropagation(),p()},children:g?e.jsxRuntimeExports.jsx(e.RefIcon$12,{style:{fontSize:11}}):e.jsxRuntimeExports.jsx(e.RefIcon$13,{style:{fontSize:11}})})})]}),N&&(g||i)&&e.jsxRuntimeExports.jsx("div",{className:"wandox-aside-agent-list",children:s.map(b=>{const M=b.agent_id;if(!M)return null;const S=n===M&&j==="professional";return e.jsxRuntimeExports.jsx(e.Tooltip,{title:b.name,placement:"right",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-aside-agent-item${S?" wandox-aside-agent-item--active":""}`,onClick:()=>{R==null||R(M),j!=="professional"&&(l==null||l("professional"))},children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-agent-icon",children:q.getAgentIconById(b.icon)}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-agent-name",children:b.name})]})},M)})})]},r.key)})})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-bottom",children:[e.jsxRuntimeExports.jsx("p",{className:"wandox-aside-group-label",children:"系统功能"}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-aside-nav-list wandox-aside-nav-list--bottom",children:[f.map(r=>{const c=r.key!=="toolbox"&&j===r.key;return e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{if(r.key==="toolbox"){u==null||u();return}l==null||l(r.key)},className:`wandox-aside-nav-item${c?" wandox-aside-nav-item--active":""}`,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:r.icon}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:r.label})]},r.key)}),v&&e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:w,className:"wandox-aside-nav-item wandox-aside-nav-item--logout",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-icon",children:e.jsxRuntimeExports.jsx(Vt,{})}),e.jsxRuntimeExports.jsx("span",{className:"wandox-aside-nav-title",children:"退出登录"})]})]}),e.jsxRuntimeExports.jsx("div",{style:{height:8}})]})]})})}function es(n){const{children:s}=n;return e.jsxRuntimeExports.jsx("div",{className:"wandox-layout wandox-root",children:e.jsxRuntimeExports.jsx("main",{className:"wandox-layout-content",style:{padding:0},children:s})})}function ts({queueStatus:n}){if(!n)return null;const s=n.status==="waiting";return e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-overlay",children:e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-modal",children:s?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-icon wandox-queue-icon--waiting",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:"#E5E7EB",strokeWidth:"4"}),e.jsxRuntimeExports.jsx("path",{d:"M32 16V32L44 38",stroke:"#8B5CF6",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-title",children:"当前使用人数较多,正在排队中..."}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stats",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-value",children:n.position}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-label",children:"前面还有"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-stat-value",children:["~",n.estimated_wait,"s"]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-stat-label",children:"预计等待"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-queue-tip",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-queue-tip-icon",children:"💡"}),e.jsxRuntimeExports.jsx("span",{children:"小贴士:等待期间可先查看其他功能模块"})]})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-icon wandox-queue-icon--ready",children:e.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"56",height:"56",rx:"8",fill:"#10B981"}),e.jsxRuntimeExports.jsx("path",{d:"M18 32L28 42L46 22",stroke:"white",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-title wandox-queue-title--ready",children:"轮到您了!"}),e.jsxRuntimeExports.jsx("div",{className:"wandox-queue-subtitle",children:"正在处理您的请求..."})]})})})}function ss({open:n,actionName:s,defaultParams:i={},onCancel:o,onExecute:h}){const[j,l]=e.reactExports.useState({});e.reactExports.useEffect(()=>{if(n){const p={};for(const R of Object.keys(i)){const E=i[R];(typeof E=="string"||typeof E=="number")&&(p[R]=String(E))}l(p)}},[n,i]);const u=(p,R)=>{l(E=>({...E,[p]:R}))},v=p=>{p.preventDefault();const R={...i};for(const E of Object.keys(j))R[E]=j[E];h(R)},w=p=>{p.target===p.currentTarget&&o()},g=(p,R)=>typeof R=="object"&&R!==null?null:e.jsxRuntimeExports.jsxs("div",{className:"wandox-form-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-form-label",children:p}),e.jsxRuntimeExports.jsx("input",{type:"text",className:"wandox-form-input",placeholder:`请输入 ${p}`,value:j[p]||"",onChange:E=>u(p,E.target.value)})]},p);return n?e.jsxRuntimeExports.jsx("div",{className:"wandox-modal-overlay",onClick:w,children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal",style:{width:600},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-header",children:[e.jsxRuntimeExports.jsxs("h3",{className:"wandox-modal-title",children:["执行 Action: ",s]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-modal-close",onClick:o,"aria-label":"关闭",children:e.jsxRuntimeExports.jsx("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsxRuntimeExports.jsx("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})})})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-body",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-modal-description",children:"以下是默认参数,您可以修改后执行,或直接使用默认值执行"}),e.jsxRuntimeExports.jsxs("form",{onSubmit:v,children:[Object.keys(i).map(p=>g(p,i[p])),Object.keys(i).length===0&&e.jsxRuntimeExports.jsx("div",{className:"wandox-empty-params",children:"该 Action 无需参数"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-modal-footer",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-button wandox-button-default",onClick:o,children:"取消"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-button wandox-button-primary",onClick:v,children:"执行"})]})]})}):null}const rt=["要努力呀,为了想要的生活,为了人间的烟火气,为了今天的风和月。","欣赏不来别人视若珍宝的,就该保持沉默。","日子总是有意思的,了无生趣的是打不起精神的你。","我们终其一生,就是要摆脱他人的期待,找到真正的自己。","别在最好的年纪选择了安逸,那是对自己最大的辜负。","你现在的气质里,藏着你走过的路、读过的书和爱过的人。","成长就是,你终于明白有些路只能一个人走。","不是每一次努力都有收获,但每一次收获都需要努力。","生活从不眷顾因循守旧、满足现状的人,而将更多机遇留给勇于探索的人。","所有的困难都是暂时的,熬过去就是晴天。","你若盛开,清风自来。","别人笑我太疯癫,我笑他人看不穿。","走慢一点,是为了走得更远。","不必羡慕别人,你的故事才刚刚开始。","心若向阳,何惧忧伤。","人生没有白走的路,每一步都算数。","你不是在浪费时间,你是在积蓄力量。","别让昨天的遗憾,占满今天的时间。","深夜的努力,终将照亮黎明。","只要路是对的,就不怕遥远。","生活不会辜负每一个认真的人。","做一个有温度的人,遇见有光的事。","你所经历的每一次失败,都是未来成功的伏笔。","不要因为走得太远,而忘记为什么出发。","把每一天当作礼物,而不是任务。","越努力,越幸运。","你值得拥有你所渴望的一切。","别把时间花在你不喜欢的事情上,除非它能带你去你喜欢的地方。","有些事现在不做,一辈子都不会做了。","你的潜力,远比你想象的要大。","不要等到准备好了才开始,开始了才会准备好。","慢慢来,比较快。","善待自己,你已经很努力了。","每一个你讨厌的早晨,都是别人求之不得的机会。","世界上只有一种真正的英雄主义,那就是认清生活的真相后仍然热爱它。","人生不是等待风暴过去,而是学会在雨中起舞。","别总想着逃离,先想想能不能改变。","你无法控制风向,但可以调整帆的方向。","没有人能替你走你该走的路。","不要因为没有掌声而停止歌唱。","把抱怨环境的心情,用来改善环境吧。","你今天的懒惰,是明天后悔的源头。","没有人永远年轻,但永远有人正在年轻。","读书破万卷,不如行路十里。","人生最大的遗憾,是轻易放弃了本不该放弃的。","你不是失败了,你只是还没成功。","今天的苦,是明天的底气。","别把别人的看法,活成自己的枷锁。","有一种勇敢,叫做即使害怕也要继续走。","生活是场修行,凡事皆有意义。","不要和自己过不去,人生很短,开心最重要。","你现在偷的懒,都是以后还的债。","最好的时机,就是现在。","你不必完美,但你必须真实。","与其等待一个完美的开始,不如从不完美中开始。","成功不是终点,失败也不是终结,重要的是继续的勇气。","每一个坚持的背后,都有一个不为人知的故事。","改变不了环境,就改变自己。","别用你的忙来掩盖你的懒,也别用你的懒来消耗你的忙。","人生就像骑自行车,要保持平衡就必须不断前行。","昨天已经过去,明天还未到来,今天才是你拥有的全部。","宁可辛苦一阵子,不要痛苦一辈子。","不要让今日的懒惰,成为明日的遗憾。","你的态度,决定了你人生的高度。","路是走出来的,不是想出来的。","做你自己,别人的角色已经有人在演了。","年轻时以为不读书不足惜,后来方知书中有乾坤。","你若想要,便去追;你若已得,便珍惜。","最怕你一生碌碌无为,还安慰自己平凡可贵。","人生没有捷径,弯路也是路。","种一棵树最好的时间是十年前,其次是现在。","每天进步一点点,人生就会不一样。","不要只是看,要有所感悟;不要只是听,要有所行动。","心态好了,一切都好了。","你的未来,取决于你现在的决定。","好好爱自己,才有能力去爱别人。","人生路上,勿忘初心。","有梦想就去追,别给自己的平庸找借口。","世界是你的,但首先你要努力。","坚持不一定成功,但放弃一定失败。","你比你想象的更坚强,比你感觉的更勇敢。","把每一次失败都当成学费,你就赚了。","选择了远方,便只顾风雨兼程。","人生的意义不在于拿一手好牌,而在于打好一手烂牌。","不要在还可以冲刺的年纪,选择散步。","钱不是万能的,但没有钱是万万不能的。努力赚钱,才是对自己最大的尊重。","所谓天才,不过是比别人多了一点坚持。","你改变不了昨天,但你可以决定明天。","做最好的自己,才能遇见最好的别人。","不要因为懒惰而失去了本来可以拥有的东西。","人生没有返回键,但有暂停和前进。","别等别人为你喝彩,先为自己鼓掌。","与其焦虑,不如行动。","每一个优秀的人,都曾经历过一段无人问津的岁月。","你的每一步努力,都在为未来的自己铺路。","不想当将军的士兵不是好士兵,但当不了将军的士兵也可以是好士兵。","生活的艺术,就是把每一个平凡的日子过得不平凡。","人生就是一场旅行,在乎的不是目的地,而是沿途的风景。","不要因为别人的否定,而放弃对自己的肯定。","勇敢不是不害怕,而是即使害怕也还是去做。","命运给了你一手烂牌,你要做的是把它打好。","真正的强大,是内心的平静。","你所不能击垮的,终将使你更强大。","成功的人找方法,失败的人找借口。","不要总是想着明天,今天就是你最年轻的一天。","人生最重要的不是你站在哪里,而是你朝哪个方向走。","每个人都是自己人生的主角,不要沦为配角。","你现在付出的努力,都是在为未来的幸福买单。","心宽了,路才宽。","你所拥有的,比你想要的更多。","不要用战术上的勤奋,掩盖战略上的懒惰。","很多人看起来很忙,实际上只是在低水平上勤奋。","格局大了,烦恼就少了。","你的圈子,决定了你的见识;你的见识,决定了你的未来。","别总是看别人的生活,好好经营自己的就够了。","脚踏实地,仰望星空,这才是人生的正确打开方式。","吃一堑,长一智;受一挫,强一分。","每一次跌倒,都是一次重新出发的机会。","低谷的时候,沉得住气;高峰的时候,守得住心。","你一定要过得很好,这样才不辜负自己受过的苦。","少说多做,是成功的捷径。","人生苦短,别把时间浪费在不值得的人和事上。","越是艰难处,越是修心时。","机会都是留给有准备的人的。","爱拼才会赢,努力才会赢。","人生就像一杯茶,不会苦一辈子,但总会苦一阵子。","不要轻言放弃,你不知道下一秒会发生什么奇迹。","真正的成熟,是能与不完美的自己握手言和。","你所走过的弯路,都是你成长的印记。","别人可以成功,你也可以。","只有不断超越自己,才能不断创造可能。","努力不一定成功,不努力一定不成功。","当你觉得累的时候,说明你在走上坡路。","不经历风雨,怎能见彩虹。","比起抱怨,不如改变。","年轻没有失败,试错才是成长。","你的样子,将决定你世界的样子。","愿你出走半生,归来仍是少年。","有时候你以为的终点,不过是下一段旅程的起点。","今天努力工作,明天努力生活。","不要总是活在别人的评价里,你自己最清楚自己是谁。","无论多难,都要坚持做你认为对的事。","你不需要变成别人,你只需要成为更好的自己。","凡事提前准备,才能游刃有余。","没有什么是理所当然的,感恩才能幸福。","不要把安全感建立在别人身上,那是一种危险的依赖。","清醒的认识自己,是成功的第一步。","沉默是金,但行动是钻石。","用行动证明,而不是用嘴巴解释。","最终你会明白,一切都是值得的。","把目光放长远,眼前的得失不算什么。","不要让自己的懒惰成为别人勤奋的舞台。","你的每一次选择,都在塑造未来的你。","有时候沉默不是因为没话说,而是因为懂得珍惜。","你今天的努力,是明天底气的来源。","先成为你想成为的人,其他的顺其自然。","把握现在,才能拥有未来。","越简单越快乐,越复杂越烦恼。","人生没有真正的绝境,除非你自己放弃。","你比你想象的更有力量。","把每一件平凡的事做好,就是不平凡。","那些没能打败你的,终将使你更强大。","做事情要有始有终,这是对自己最基本的尊重。","不在沉默中爆发,就在沉默中消亡。","不要害怕慢,就怕站。","只要还在走,就没有到不了的地方。","自律的人,才有资格谈自由。","与其等风来,不如追风去。","你有多自律,就有多自由。","凡是过往,皆为序章。","不要在该奋斗的年纪选择了安逸。","人生难得几回搏,此时不搏何时搏。","成长的代价是失去一些幼稚,但获得了更多可能。","有梦想的人,睡觉都是在充电。","不要辜负每一个认真的早晨。","生命的意义,在于不断地自我超越。","你有权利选择,但选择了就要承担。","最大的风险,是不冒任何风险。","生活会奖励那些敢于尝试的人。","不要拿别人的错误惩罚自己。","学会放下,才能腾出手来拥抱新的可能。","所有的天才都曾是努力的凡人。","比别人优秀不是目的,成为更好的自己才是。","你不需要被所有人喜欢,但你必须喜欢自己。","保持好奇心,世界就不会无聊。","每一个平静的背后,都有一颗强大的内心。","把抱怨的时间用来思考,把悲伤的时间用来行动。","只要心里有光,哪里都是出路。","你的奋斗轨迹,就是你最好的简历。","成功不是偶然的,它是努力、坚持和学习的结果。","不要小看自己,宇宙都是从一个点开始的。","真正的自由,是不依赖任何人的底气。","你的努力,终有一天会让你站在阳光下。","生活不在别处,就在此时此刻。","每一段经历,都是人生最好的礼物。"];function ns(){return e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-row",children:[e.jsxRuntimeExports.jsx(e.Skeleton.Avatar,{active:!0,size:28,shape:"circle"}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:120,height:18}})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:40,borderRadius:10}}),e.jsxRuntimeExports.jsx(e.Skeleton.Button,{active:!0,style:{width:80,height:40,borderRadius:10}})]})]})}function as(){return e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-skeleton-insights",children:[1,2,3].map(n=>e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-skeleton-insight-card",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-skeleton-insight-inner",children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:52,height:22,borderRadius:100}}),e.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:16,marginBottom:6}}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:"70%",height:12}})]})]})},n))})}function is(n){return!!n&&/^https?:\/\//.test(n)}function Qe(n){if(!n)return"✦";if(is(n))return e.jsxRuntimeExports.jsx("img",{src:n,alt:""});const s=q.agentIconMap.get(n);return s?s.component:n}function os(n,s){const i=`${n||""} ${s||""}`.toLowerCase();return i.includes("red")||i.includes("critical")?"wandox-insight-severity--red":i.includes("orange")||i.includes("high")?"wandox-insight-severity--orange":i.includes("yellow")||i.includes("medium")?"wandox-insight-severity--yellow":"wandox-insight-severity--gray"}function rs(n){const s=n.match(new RegExp("^\\p{Extended_Pictographic}","u"));return(s==null?void 0:s[0])||"📌"}function lt(n){return n.replace(new RegExp("^\\p{Extended_Pictographic}\\s*","u"),"")}function ct(n){var s;return n.bind_type==="playbook"&&n.bind_playbook_id&&((s=n.playbook_args)!=null&&s.length)?"执行":n.bind_type==="agent"?"找智能体聊聊":n.bind_type==="chat"?"分析一下":"查看详情"}function ls(n,s){const i=n.asin||n.ASIN||n.sku||n.seller_sku,o=n.site||n.marketplace||n.country;if(i||o)return[i,o&&`(${o})`].filter(Boolean).join(" ");const h=Object.values(n).find(j=>j!=null&&String(j).trim());return h?String(h):`参数 ${s+1}`}function cs(n,s){var o;const i=(o=n.query_template)==null?void 0:o.trim();return!i||!s?n.title:i.replace(/\{\{?\s*([\w.-]+)\s*\}?\}/g,(h,j)=>{const l=s[j];return l==null?h:String(l)})}function xs(n){return!n||n.status==="disabled"||n.status==="error"||!n.scenes?[]:Object.entries(n.scenes).map(([s,i])=>({name:s,total_affected:i.total_affected,suggestions_count:i.suggestions_count,cards:Array.isArray(i.cards)?i.cards:[]})).filter(s=>s.cards.length>0)}function ds({agentLoading:n,mainAgentForHub:s,mainAgentQuestions:i,agents:o,hubChatOpen:h,setHubChatOpen:j,hubChatInput:l,setHubChatInput:u,hubScrollIdx:v,hubScrollFading:w,onHubChatSend:g,onHubInputFocus:p,onHubInputBlur:R,messages:E,executing:B,hubInlineChatInput:z,setHubInlineChatInput:f,onHubInlineSend:r,onEnterProfessional:c,playbooks:N,executePlaybook:b,onRequestPlaybookParams:M,onAbort:S,onRespondToProposal:Q,ssoToken:$,ssoDomain:D,ssoCompany:C}){var L,k,fe,Ae,be;const I=n&&!s,U=localStorage.getItem("sso_username")||"",F=localStorage.getItem("sso_user_id")||"",Re=e.reactExports.useRef(null),te=e.reactExports.useRef(null),se=e.reactExports.useMemo(()=>[],[]),[Ee,J]=e.reactExports.useState(""),[Z,ue]=e.reactExports.useState([]),[X,ae]=e.reactExports.useState(!1),[W,le]=e.reactExports.useState("idle"),[ce,we]=e.reactExports.useState(0),[G,xe]=e.reactExports.useState(null),[ne,ke]=e.reactExports.useState(!1),_=o[0],O=(_==null?void 0:_.agent_code)||(_==null?void 0:_.agent_id)||"",pe=(L=_==null?void 0:_.questions)!=null&&L.length?_.questions:i,Ne=D!=="yunduo"&&pe[v%Math.max(pe.length,1)]||"今天仓库订单处理的怎么样了?",Te=e.reactExports.useMemo(()=>rt[Math.floor(Math.random()*rt.length)],[]),me=e.reactExports.useMemo(()=>({Authorization:`Bearer ${$}`,"X-Tenant-ID":C,"X-Domain":D,"Content-Type":"application/json"}),[$,C,D]),ee=e.reactExports.useCallback(async(a=!1)=>{if(!(!$||!D)){ae(!0);try{const y=await fetch(`${e.getBaseURL()}/api/v1/insights/${a?"refresh":"recommendations"}`,{method:a?"POST":"GET",headers:me});if(!y.ok)throw new Error(`HTTP ${y.status}`);const de=await y.json(),T=de==null?void 0:de.data;le((T==null?void 0:T.status)||"error"),we((T==null?void 0:T.total_cards)||0),ue(xs(T))}catch{le("error"),we(0),ue([])}finally{ae(!1)}}},[me,D,$]);e.reactExports.useEffect(()=>{ee()},[ee]),e.reactExports.useEffect(()=>{!Ee&&O&&J(O)},[O,Ee]);const ie=Z,V=Ee||O||((k=se[0])==null?void 0:k.agent_id)||(s==null?void 0:s.agent_id),K=e.useQuestionAutocomplete({token:$,domain:D,tenantId:C,agentId:V||"",limit:5});e.reactExports.useEffect(()=>{if(!ne||h){K.clear();return}K.search(l)},[ne,l,h,K.search,K.clear]);const P=ie.length>0&&ie.every(a=>a.cards.length===1),Se=se.slice(0,3),Ce=se.slice(3),Ie=V===O?_==null?void 0:_.name:(fe=se.find(a=>a.agent_id===V))==null?void 0:fe.name,Pe=V===O?_!=null&&_.icon?q.getAgentIconById(_.icon):q.getAgentIconById("robot"):Qe((Ae=se.find(a=>a.agent_id===V))==null?void 0:Ae.icon),he=V===O?_==null?void 0:_.description:(be=se.find(a=>a.agent_id===V))==null?void 0:be.description,t=(a,y)=>{if(a.bind_type==="agent"&&a.bind_agent_code){c(a.bind_agent_code);return}if(a.bind_type==="playbook"&&a.bind_playbook_id&&y){j(!0),b({message:cs(a,y),playbook_id:a.bind_playbook_id,playbook_params:y});return}g(V,a.title)},x=(a,y,de,T=!1,Be=!1)=>{const ye=Array.isArray(y.playbook_args)?y.playbook_args:[],ge=y.bind_type==="playbook"&&!!y.bind_playbook_id&&ye.length>0;return e.jsxRuntimeExports.jsxs("article",{className:`wandox-insight-card${T?" wandox-insight-card--modal":""}${Be?" wandox-insight-card--featured":""}`,children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-card-main",onClick:()=>{T&&xe(null),t(y,ye[0])},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-card-top",children:[e.jsxRuntimeExports.jsx("span",{className:`wandox-insight-severity ${os(y.severity_color,y.priority)}`,children:y.severity_label||"观察"}),y.affected_count&&e.jsxRuntimeExports.jsx("span",{children:y.affected_count})]}),e.jsxRuntimeExports.jsx("h4",{children:y.title}),y.description&&e.jsxRuntimeExports.jsx("p",{children:y.description}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-card-foot",children:[e.jsxRuntimeExports.jsx("span",{children:y.value_hint||"建议进一步确认"}),!ge&&e.jsxRuntimeExports.jsxs("strong",{children:[ct(y)," →"]})]})]}),ge&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-arg-list",children:[ye.slice(0,T?10:3).map((ve,H)=>e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-arg-action",onClick:()=>{T&&xe(null),t(y,ve)},children:[e.jsxRuntimeExports.jsx("span",{children:ls(ve,H)}),e.jsxRuntimeExports.jsx("strong",{children:ct(y)})]},`${y.title}-${H}`)),!T&&ye.length>3&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-arg-more",onClick:()=>xe(ie.find(ve=>ve.name===a)||null),children:["还有 ",ye.length-3," 项可执行"]})]})]},`${a}-${y.title}-${de}`)};return e.jsxRuntimeExports.jsx("div",{className:"wandox-view-scroll",children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-view-content wandox-hub-v2",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-header",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("h1",{className:"wandox-hub-v2-title",children:["您好,",U||"欢迎回来"]}),e.jsxRuntimeExports.jsx("p",{className:"wandox-hub-v2-subtitle",children:Te})]}),D!=="yunduo"&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-hub-v2-report",onClick:()=>{const a=new URLSearchParams;$&&a.append("authorization",$),D&&a.append("x-domain",D),C&&a.append("x-tenant-id",C),F&&a.append("user_id",F),U&&a.append("username",U),window.open(`https://ai.wandox.com/trend-report/trend-report-6.html${a.toString()?`?${a.toString()}`:""}`,"_blank")},children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-report-logo",children:"麦"}),e.jsxRuntimeExports.jsxs("span",{children:[e.jsxRuntimeExports.jsx("strong",{children:"麦多趋势报告"}),e.jsxRuntimeExports.jsx("small",{children:"第六期 已更新 →"})]})]})]}),I?e.jsxRuntimeExports.jsx(ns,{}):e.jsxRuntimeExports.jsxs("div",{ref:Re,className:`wandox-hub-main-card${h?" wandox-hub-main-card--open":""}`,children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-main-card-search",style:{opacity:h?0:1,maxHeight:h?0:520,transition:"opacity 0.2s ease, max-height 0.35s cubic-bezier(0.4,0,0.2,1)"},children:e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-head",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-agent-title",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-agent-mark",children:Pe}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:Ie||(s==null?void 0:s.name)||"通用问答"}),e.jsxRuntimeExports.jsx("span",{children:he||"问什么都行,系统会自动分流到对应的专业能力"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-chip-row",style:{display:"none"},children:[O&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-hub-v2-chip${V===O?" wandox-hub-v2-chip--active":""}`,onClick:()=>J(O),title:(_==null?void 0:_.description)||(_==null?void 0:_.name)||"全部",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:_!=null&&_.icon?q.getAgentIconById(_.icon):"✦"}),"全部"]}),Se.map(a=>e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-hub-v2-chip${a.agent_id===V?" wandox-hub-v2-chip--active":""}`,onClick:()=>J(a.agent_id),title:a.description||a.name,children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:Qe(a.icon)}),a.name]},a.agent_id)),Ce.length>0&&e.jsxRuntimeExports.jsx(e.Dropdown,{menu:{items:Ce.map(a=>({key:a.agent_id,label:e.jsxRuntimeExports.jsxs("span",{className:"wandox-hub-v2-more-item",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-chip-icon",children:Qe(a.icon)}),e.jsxRuntimeExports.jsx("span",{children:a.name})]})})),onClick:({key:a})=>J(String(a))},placement:"bottomRight",children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-hub-v2-chip wandox-hub-v2-chip--more",children:["更多 ",e.jsxRuntimeExports.jsx(e.RefIcon$3,{})]})})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-wrap",children:[e.jsxRuntimeExports.jsx(e.Input.TextArea,{value:l,onChange:a=>u(a.target.value),onPressEnter:a=>{a.shiftKey||(a.preventDefault(),g(V))},onFocus:()=>{ke(!0),p==null||p()},onBlur:()=>{window.setTimeout(()=>ke(!1),120),R==null||R()},placeholder:"请随便问,看看 AI 搭子怎么帮你避坑",autoSize:{minRows:3,maxRows:7},variant:"borderless",className:"wandox-hub-v2-textarea"}),e.jsxRuntimeExports.jsx(e.QuestionAutocomplete,{open:ne,rewrittenQuestion:K.rewrittenQuestion,questions:K.questions,loading:K.loading,placement:"bottom",onSelectRewrite:a=>{u(a),K.clear()},onSelectQuestion:a=>{u(""),K.clear(),g(V,a.title)}})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-input-bottom",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-example",children:[e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-v2-example-label",children:"示例:"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-v2-example-text",onClick:()=>{u(Ne)},style:{opacity:w?0:1,transform:w?"translateY(-4px)":"translateY(0)"},children:Ne})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"primary",icon:e.jsxRuntimeExports.jsx(e.RefIcon$15,{}),className:"wandox-hub-v2-send",onClick:()=>g(V),children:"发送问题"})]})]})}),e.jsxRuntimeExports.jsxs("div",{style:{height:h?"100%":0,display:"flex",flexDirection:"column",opacity:h?1:0,overflow:"hidden",transition:"opacity 0.3s ease 0.1s, max-height 0.4s cubic-bezier(0.4,0,0.2,1)",position:"relative",zIndex:h?1:-1},children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-chat-header",children:[s&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-chat-agent-avatar",children:[q.getAgentIconById(s.icon),s.is_main&&e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-agent-badge"})]}),e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-chat-agent-name",children:s==null?void 0:s.name}),e.jsxRuntimeExports.jsx("span",{className:"wandox-hub-chat-status",children:"对话中"}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-chat-close",onClick:()=>{S(),j(!1)},children:"×"})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-chat-section__body wandox-chat-section__body--hub",children:[e.jsxRuntimeExports.jsx(e.ChatMessageList,{messages:E,executing:B,ssoToken:$,ssoDomain:D,ssoCompany:C,onExecutePlaybook:a=>b(a),onFillPlaybookParams:a=>M({playbook_id:a.playbookId,name:a.playbookName,input_fields:a.inputFields,initial_params:a.initialParams,playbook_type:a.playbookType}),onRespondToProposal:Q,containerRef:te,className:"wandox-hub-messages"}),e.jsxRuntimeExports.jsx(e.ConversationOutline,{messages:E,scrollContainerRef:te})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-input-row",children:e.jsxRuntimeExports.jsx(e.ChatInput,{executing:B,onSend:r,playbooks:N,value:z,onValueChange:f,placeholder:"继续提问…",ssoToken:$,ssoDomain:D,ssoCompany:C,onRequestPlaybookParams:M})}),e.jsxRuntimeExports.jsx("div",{className:"wandox-hub-chat-footer",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-hub-chat-enter-link",onClick:()=>c(),children:"进入完整对话视图 →"})})]})]}),(X||W==="error"||W==="success"&&ce>=0)&&W!=="disabled"&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-section wandox-hub-v2-insights",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-heading",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-kicker",children:[e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("strong",{children:"基于你的数据,建议先看"})]}),e.jsxRuntimeExports.jsx("p",{children:"系统每天扫描你的店铺数据,自动识别出值得处理的场景"})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"text",size:"small",icon:e.jsxRuntimeExports.jsx(e.RefIcon$7,{}),className:"wandox-hub-v2-refresh",onClick:()=>ee(!0),children:"换一批"})]}),X?e.jsxRuntimeExports.jsx(as,{}):W==="error"?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-empty",children:[e.jsxRuntimeExports.jsx("strong",{children:"数据获取失败,请稍后重试"}),e.jsxRuntimeExports.jsx(e.Button,{type:"link",size:"small",onClick:()=>ee(),children:"重试"})]}):ie.length===0?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-empty",children:[e.jsxRuntimeExports.jsx("strong",{children:"暂无场景推荐,数据正常"}),e.jsxRuntimeExports.jsx("span",{children:"当前没有扫描到需要优先处理的运营场景"})]}):e.jsxRuntimeExports.jsx("div",{className:`wandox-insight-scene-list${P?" wandox-insight-scene-list--single-cards":""}${ie.length===1?" wandox-insight-scene-list--one-scene":""}`,children:ie.map(a=>e.jsxRuntimeExports.jsxs("section",{className:"wandox-insight-scene",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-insight-scene-head",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:lt(a.name)}),e.jsxRuntimeExports.jsxs("span",{children:["扫描到"," ",a.suggestions_count??a.cards.length," ","条建议"]})]})}),e.jsxRuntimeExports.jsx("div",{className:`wandox-insight-card-row${a.cards.length===1?" wandox-insight-card-row--single":""}`,children:a.cards.slice(0,4).map((y,de)=>x(a.name,y,de,!1,a.cards.length===1))}),a.cards.length>4&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"wandox-insight-view-all",onClick:()=>xe(a),children:["查看全部 ",a.cards.length," 条建议 →"]})]},a.name))})]}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-section",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-heading",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-hub-v2-section-kicker",children:[e.jsxRuntimeExports.jsx("span",{}),e.jsxRuntimeExports.jsx("strong",{children:"需要执行更专业的任务?"})]}),e.jsxRuntimeExports.jsx("p",{children:"直接进入对应专家,按业务流程一步步处理"})]}),e.jsxRuntimeExports.jsx(e.Button,{type:"link",size:"small",className:"wandox-hub-v2-refresh",onClick:()=>c(),children:"全部 →"})]}),I?e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-grid",children:[1,2,3].map(a=>e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-entry-card",style:{pointerEvents:"none"},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Avatar,{active:!0,size:36,shape:"square",style:{borderRadius:8,flexShrink:0}}),e.jsxRuntimeExports.jsxs("div",{style:{flex:1},children:[e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,block:!0,style:{height:14,marginBottom:6}}),e.jsxRuntimeExports.jsx(e.Skeleton.Input,{active:!0,style:{width:"80%",height:11}})]})]},a))}):e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-grid",children:o.filter(a=>!a.is_main).slice(0,4).map(a=>{const y=e.getAgentPackageBenefit(a);return e.jsxRuntimeExports.jsxs("button",{type:"button",className:`wandox-agent-entry-card${y?" wandox-agent-entry-card--with-badge":""}`,onClick:()=>c(a.agent_id||void 0),children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-icon",children:q.getAgentIconById(a.icon)}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-agent-entry-info",children:[e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-name",children:a.name}),e.jsxRuntimeExports.jsx("div",{className:"wandox-agent-entry-desc",children:a.description})]}),e.jsxRuntimeExports.jsx(e.RefIcon$6,{className:"wandox-agent-entry-arrow"}),y&&e.jsxRuntimeExports.jsx("span",{className:`wandox-agent-entry-badge wandox-agent-entry-badge--${y.kind}`,style:{background:y.badgeColor,color:y.badgeTextColor},children:y.badgeText})]},a.agent_id)})})]}),e.jsxRuntimeExports.jsx(e.Modal,{open:!!G,onCancel:()=>xe(null),footer:null,width:920,centered:!0,className:"wandox-insight-modal",title:G?e.jsxRuntimeExports.jsxs("div",{className:"wandox-insight-modal-title",children:[e.jsxRuntimeExports.jsx("span",{children:rs(G.name)}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("strong",{children:lt(G.name)}),e.jsxRuntimeExports.jsxs("small",{children:[G.cards.length," 条数据建议"]})]})]}):null,styles:{container:{padding:0}},children:G&&e.jsxRuntimeExports.jsx("div",{className:"wandox-insight-modal-grid",children:G.cards.map((a,y)=>x(G.name,a,y,!0))})})]})})}function us(n){const s=n.toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}),i=n.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return`${s}
|
|
3
|
+
${i}`}function Ue(n,s){return n.activeAgent===s.activeAgent&&n.webhookId===s.webhookId&&n.ssoToken===s.ssoToken&&n.ssoDomain===s.ssoDomain&&n.ssoCompany===s.ssoCompany}function ps(n){const{activeAgent:s,webhookId:i="",ssoToken:o="",ssoDomain:h="",ssoCompany:j=""}=n,[l,u]=e.reactExports.useState([]),v=e.reactExports.useRef({activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j});e.reactExports.useEffect(()=>{v.current={activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j},u([])},[s,i,o,h,j]);const w=e.reactExports.useCallback(async()=>{if(!s)return;const g={activeAgent:s,webhookId:i,ssoToken:o,ssoDomain:h,ssoCompany:j};if(Ue(v.current,g))try{const p=await e.GET_Api_V1_Agents_Workspaces({agent_id:s,limit:10,use_cache:!1});if(!Ue(v.current,g))return;if(p!=null&&p.data&&Array.isArray(p.data)){const R=p.data.map(E=>{const B=Array.isArray(E.actions)?E.actions||[]:[],z=E.ui_payload,f=z==null?void 0:z.actions,r=Array.isArray(f)?f:[],N=[...B,...r].map(M=>{const S=M;return{label:S.display_name||S.label||"执行",action_id:S.action_id,playbook_id:S.playbook_id,display_name:S.display_name,display_icon:S.display_icon,params:S.params,params_fields_map:S.params_fields_map,type:S.type,url:S.url,style:S.style,status:S.action_status||S.status||void 0,sort_order:S.sort_order,executed_job_id:S.executed_job_id,supports_batch:S.supports_batch===!0,batch_max_items:S.batch_max_items,batch_id:S.batch_id,outputs:S.outputs}}),b=E.outputs;return{type:E.widget_type||"daily_report",priority:E.priority||"medium",title:E.title||"每日战报",summary:E.summary||"",timestamp:E.created_at?us(new Date(E.created_at||"")):"",data:E.card_data||{},actions:N,id:E.inbox_id||"",agent_id:E.agent_id||"",read:!!E.is_read,ui_payload:b||z||{}}});if(R.length>0){const E=R.sort((B,z)=>{const f=B.timestamp?new Date(B.timestamp.replace(/\n/g," ")).getTime():0;return(z.timestamp?new Date(z.timestamp.replace(/\n/g," ")).getTime():0)-f});u(E)}else u([])}else u([])}catch(p){if(!Ue(v.current,g))return;throw u([]),p}},[s,i,o,h,j]);return{widgets:l,setWidgets:u,loadDailyReports:w}}function ms(){const[n,s]=e.reactExports.useState([]),[i,o]=e.reactExports.useState(!1),[h,j]=e.reactExports.useState(!1),[l,u]=e.reactExports.useState(""),[v,w]=e.reactExports.useState([]),[g,p]=e.reactExports.useState(!1),[R,E]=e.reactExports.useState(null),[B,z]=e.reactExports.useState(!0),f=e.reactExports.useRef(null),r=e.reactExports.useCallback(async()=>{if(f.current)return f.current;const C=(async()=>{o(!0);try{const I=await e.GET_Api_V1_Playbooks_SolidifyView_List({page:1,page_size:20});return Array.isArray(I==null?void 0:I.data)?(s(I.data),j(!0),!0):(j(!1),!1)}catch{return j(!1),!1}finally{o(!1),f.current=null}})();return f.current=C,C},[]),c=e.reactExports.useCallback(()=>h?Promise.resolve(!0):r(),[r,h]),N=e.reactExports.useCallback(C=>{u(C),E({session_id:C,type:"dashboard_intent",intents:[],data:{}}),z(!1),(async(U={})=>{p(!0);try{const F=await e.POST_Api_V1_Playbooks_SolidifyView_Run_ByPlaybookId(C,{params:U});F.success&&F.data&&(E(F.data),F.data.input_params&&w(F.data.input_params))}catch{}finally{p(!1)}})()},[]),b=e.reactExports.useCallback(C=>{if(!l)return;(async()=>{p(!0);try{const U=await e.POST_Api_V1_Playbooks_SolidifyView_Run_ByPlaybookId(l,{params:C});U.success&&U.data&&E(U.data)}catch{}finally{p(!1)}})()},[l]),M=e.reactExports.useCallback(C=>{l===C&&(u(""),E(null),w([])),r()},[l,r]),S=e.reactExports.useCallback(()=>{if(!l)return null;const C=n.find(I=>I.playbook_id===l);return(C==null?void 0:C.name)||null},[l,n]),Q=e.reactExports.useCallback((C,I)=>{E(C),z(I!==void 0?I:!0)},[]),$=e.reactExports.useCallback(()=>{},[]),D=e.reactExports.useCallback(()=>{u(""),E(null),w([])},[]);return{solidifiedPlaybooks:n,solidifiedPlaybooksLoading:i,solidifiedPlaybooksLoaded:h,activeSolidifiedPlaybook:l,setActiveSolidifiedPlaybook:u,solidifyInputParams:v,solidifyLoading:g,dashboardData:R,setDashboardData:E,dashboardShowSaveButton:B,setDashboardShowSaveButton:z,loadSolidifiedPlaybooks:r,ensureSolidifiedPlaybooksLoaded:c,handleSolidifiedPlaybookClick:N,handleSolidifyParamsSearch:b,handleSolidifiedPlaybookDelete:M,getCurrentSolidifiedPlaybookName:S,handleDashboardPreview:Q,handleSolidifyComplete:$,clearDashboard:D}}function hs(){const{allQuestions:n,setCurrentQuestion:s}=e.useQuestionsStore();e.reactExports.useEffect(()=>{if(n.length===0)return;const i=Math.floor(Math.random()*n.length);s(n[i]);const o=setInterval(()=>{const h=Math.floor(Math.random()*n.length);s(n[h])},1e4);return()=>{clearInterval(o)}},[n,s])}const xt={chat:{title:"对话",subtitle:""},plan:{title:"自动化",subtitle:"创建、管理并追踪自动化智能体的执行结果,支持定时触发与对内流转"},professional:{title:"专业智能体",subtitle:"深度分析与专业领域对话"},goals:{title:"目标追踪",subtitle:"跟踪关键业务指标和目标进展"},settings:{title:"通知配置",subtitle:"配置 Webhook 通知,实时接收系统重要事件"}},js=5*60*1e3,Es=3;function fs(n={}){const{showAside:s=!0,showLogout:i=!1,onLogout:o,presetAgents:h,webhookId:j,onReady:l,initialAgentId:u,initialPlaybookId:v,initialPlaybookParams:w}=n,g=localStorage.getItem("sso_token")||"",p=localStorage.getItem("sso_domain")||"maiduo",R=localStorage.getItem("sso_company")||"",B=`${e.getBaseURL()}/api/v1/oss/upload2`,z=e.reactExports.useCallback(async d=>{const{data:A}=await e.GET_Api_V1_Playbooks_Detail({playbook_id:d});return A},[]),f=e.reactExports.useCallback(d=>e.POST_Api_V1_Playbooks_SolidifyView_SaveV2({session_id:d.session_id||"",name:d.name,description:d.description}),[]),r=e.reactExports.useCallback(d=>e.POST_Api_V1_Playbooks_SolidifyView_PreviewV2({session_id:d.session_id||"",user_hint:d.user_hint||""}),[]),{activeAgent:c,setActiveAgent:N,sourceAgents:b,playbooks:M,userPlaybooks:S,userPlaybooksLoading:Q,childAgents:$,agentLoading:D,sceneLoading:C,loadUserPlaybooks:I,playbooksLoaded:U}=q.useWorkbenchRuntime({presetAgents:h,initialAgentId:u}),F=D||C,[Re,te]=e.reactExports.useState(()=>!!u),[se,Ee]=e.reactExports.useState(!1),[J,Z]=e.reactExports.useState(!1),[ue,X]=e.reactExports.useState([]),[ae,W]=e.reactExports.useState(0),le=e.reactExports.useRef(!1),{executing:ce,stopping:we,executingRef:G,queueStatus:xe,messageData:ne,actions:ke}=q.useWorkbenchSession({activeAgent:c,webhookId:j,ssoToken:g,ssoDomain:p,ssoCompany:R,onRecommendationsUpdate:X}),{sendMessage:_,executePlaybook:O,respondToProposal:pe,stopCurrent:Ne,retrigger:Te,abort:me,clearMessages:ee}=ke;e.reactExports.useEffect(()=>{le.current&&!ce&&W(d=>d+1),le.current=ce},[ce]);const{widgets:ie,setWidgets:V,loadDailyReports:K}=ps({activeAgent:c,webhookId:j,ssoToken:g,ssoDomain:p,ssoCompany:R}),P=ms();hs();const[Se,Ce]=e.reactExports.useState(()=>localStorage.getItem("wandox_sidebar_agent_mode")==="true"),Ie=e.reactExports.useCallback(()=>{Ce(d=>{const A=!d;return localStorage.setItem("wandox_sidebar_agent_mode",String(A)),A})},[]),[Pe,he]=e.reactExports.useState(!1),[t,x]=e.reactExports.useState(!1),[L,k]=e.reactExports.useState(!1),[fe,Ae]=e.reactExports.useState(!1),[be,a]=e.reactExports.useState(null),[y,de]=e.reactExports.useState(!1),[T,Be]=e.reactExports.useState(null),[ye,ge]=e.reactExports.useState(""),[ve,H]=e.reactExports.useState(null),[oe,je]=e.reactExports.useState("chat"),[De,dt]=e.reactExports.useState(null),ut=e.reactExports.useCallback(()=>{he(!0),x(!1)},[]),pt=e.reactExports.useCallback(()=>{he(!1),x(!1)},[]),[Xe,Je]=e.reactExports.useState(""),[et,tt]=e.reactExports.useState(0),[mt,ze]=e.reactExports.useState(!1),[st,nt]=e.reactExports.useState(!1),[ht,at]=e.reactExports.useState(!1),[jt,Et]=e.reactExports.useState(""),Oe=e.reactExports.useRef(null),Le=e.reactExports.useRef(!1),[ft,gt]=e.reactExports.useState(null),[Rt,wt]=e.reactExports.useState(!1),bt=F||ne.loading,yt=e.reactExports.useCallback(d=>{a(()=>d)},[]);e.reactExports.useEffect(()=>{l&&l({showInspectionResults:d=>{gt(d||null),wt(!0)}})},[l]),e.reactExports.useEffect(()=>{te(!!u),Ee(!1),Z(!1)},[u,v,w]),e.reactExports.useEffect(()=>{if(c)return X([]),()=>{G.current&&me()}},[c,j,g,p,R]),e.reactExports.useEffect(()=>{if(oe!=="professional"){Le.current=!1;return}if(!c)return;Le.current||(ne.loadMessagesAndDailyReport(),K()),Le.current=!1;let d=0,A=null;return A=setInterval(async()=>{try{await K(),d=0}catch{d++,d>=Es&&A&&(clearInterval(A),A=null)}},js),()=>{A&&clearInterval(A)}},[oe,c,j,g,p,R]);const Y=b.find(d=>d.is_main)??b[0],Me=(Y==null?void 0:Y.questions)||[];e.reactExports.useEffect(()=>{tt(0),ze(!1)},[Y==null?void 0:Y.agent_id]),e.reactExports.useEffect(()=>{if(Me.length<=1||st)return;let d;const A=setInterval(()=>{ze(!0),d=setTimeout(()=>{tt(m=>(m+1)%Me.length),ze(!1)},350)},3500);return()=>{clearInterval(A),clearTimeout(d)}},[Me.length,st]),e.reactExports.useEffect(()=>{if(Oe.current&&c&&c!=="default"){const d=Oe.current;Oe.current=null,_(d)}},[c,_]),e.reactExports.useEffect(()=>{if(!u||!Re||!c||c==="default"||b.length===0)return;!!e.findAgentById(b,u)||te(!1)},[u,Re,c,b]),e.reactExports.useEffect(()=>{!u||v||se||!c||c==="default"||!b.find(A=>e.matchesAgent(A,c)&&e.matchesAgent(A,u))||(Ee(!0),je("professional"),P.clearDashboard(),te(!1))},[u,v,se,c,b,P]),e.reactExports.useEffect(()=>{var it;if(!u||!v||J||!c||c==="default"||!U||!b.find(_e=>e.matchesAgent(_e,c)&&e.matchesAgent(_e,u)))return;const A=M.find(_e=>e.matchesPlaybook(_e,v));if(!A){je("professional"),e.staticMethods.error(`指定的场景(${v})不存在,已切换到智能体界面`),Z(!0),te(!1);return}Z(!0),je("professional"),Le.current=!0,ee(),P.clearDashboard(),H(null),ge("");const m=w||{},re=Object.keys(m).length>0,Ve=(A.input_fields??[]).filter(_e=>{if(!_e.required)return!1;const qe=m[_e.name];return qe==null||qe===""});if((((it=A.input_fields)==null?void 0:it.length)??0)>0&&(!re||Ve.length>0)){H(A),te(!1);return}O({message:A.name,playbook_id:v,playbook_params:m}),te(!1)},[u,v,J,c,U,b,M,w]);const We=e.reactExports.useCallback(d=>{e.isSameAgentSelection(b,c,d)||(G.current&&(me(),e.staticMethods.info("已中止当前场景,切换智能体")),N(d),ge(""),H(null),P.clearDashboard(),ee(),V([]))},[me,c,b,ee,G,N,P,V]),vt=(d,A)=>{const m=(A??Xe).trim()||Me[et%Me.length]||"",re=d||(Y==null?void 0:Y.agent_id);!m||!re||(Je(""),at(!0),ee(),c===re?_(m):(Le.current=!0,Oe.current=m,N(re)))},_t=(d,A)=>{P.handleDashboardPreview(d,A),je("chat"),N("default")},kt=()=>{P.handleSolidifyComplete(),je("chat"),N("default")},Nt=d=>{je(d),(d==="goals"||d==="settings"||d==="plan"||d==="chat")&&P.clearDashboard()},St=()=>{x(!1),Ae(!0),P.ensureSolidifiedPlaybooksLoaded()},Ct=d=>{Ae(!1),P.handleSolidifiedPlaybookClick(d),je("chat"),N("default"),ge(""),H(null)},It=()=>{var d,A;if(P.dashboardData)return e.jsxRuntimeExports.jsx(e.DashboardRenderer,{data:P.dashboardData,showSaveButton:P.dashboardShowSaveButton,onSaveSuccess:P.loadSolidifiedPlaybooks,onSaveDashboard:f,onPreviewDashboard:r,title:P.getCurrentSolidifiedPlaybookName()||void 0,customParamsForm:P.solidifyInputParams.length>0?e.jsxRuntimeExports.jsx(Zt,{inputParams:P.solidifyInputParams,onSearch:P.handleSolidifyParamsSearch,loading:P.solidifyLoading}):void 0,showGlobalFilter:P.solidifyInputParams.length>0});switch(oe){case"chat":return e.jsxRuntimeExports.jsx(e.PlaybookContext.Provider,{value:{onExecutePlaybook:O,getPlaybookDetail:z,ossUploadUrl:B,ssoToken:g,ssoDomain:p,ssoCompany:R,onFillPlaybookParams:m=>{const re={playbook_id:m.playbookId,name:m.playbookName,input_fields:m.inputFields,initial_params:m.initialParams,playbook_type:m.playbookType};H(re),je("professional")}},children:e.jsxRuntimeExports.jsx(ds,{agentLoading:F,mainAgentForHub:Y,mainAgentQuestions:Me,agents:b,hubChatOpen:ht,setHubChatOpen:at,hubChatInput:Xe,setHubChatInput:Je,hubScrollIdx:et,hubScrollFading:mt,onHubChatSend:vt,onHubInputFocus:()=>nt(!0),onHubInputBlur:()=>nt(!1),messages:ne.messages,executing:ce,hubInlineChatInput:jt,setHubInlineChatInput:Et,onHubInlineSend:(m,re,Ve)=>{Y!=null&&Y.agent_id&&(c!==Y.agent_id&&N(Y.agent_id),_(m,re,Ve))},onEnterProfessional:m=>{m&&N(m),ge(""),H(null),P.clearDashboard(),V([]),je("professional")},playbooks:M,executePlaybook:O,onRequestPlaybookParams:H,clearMessages:ee,onAbort:me,onRespondToProposal:pe,ssoToken:g,ssoDomain:p,ssoCompany:R})});case"goals":return e.jsxRuntimeExports.jsx(e.GoalTracker,{});case"settings":return e.jsxRuntimeExports.jsx(q.SettingsWithTabs,{});case"plan":return e.jsxRuntimeExports.jsx(q.AutomationPage,{embedded:!0,onHeaderChange:dt,onCockpitEnter:ut,onCockpitExit:pt});case"professional":return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Xt,{title:((d=b.find(m=>e.matchesAgent(m,c)))==null?void 0:d.name)||"Wandox智能体",agentSwitcher:Se?void 0:e.jsxRuntimeExports.jsxs("div",{style:{display:"inline-flex",alignItems:"center",height:34,background:"#fff",border:"1px solid #e5e0f0",borderRadius:10,boxSizing:"border-box",overflow:"hidden"},children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 0 0 8px"},children:[e.jsxRuntimeExports.jsx("div",{style:{width:22,height:22,flexShrink:0},children:q.getAgentIconById((A=b.find(m=>e.matchesAgent(m,c)))==null?void 0:A.icon)}),e.jsxRuntimeExports.jsx(e.Select,{value:c,onChange:m=>We(m),options:b.map(m=>({value:m.agent_id,label:m.name})),variant:"borderless",suffixIcon:e.jsxRuntimeExports.jsx(e.RefIcon$13,{style:{color:"#9275ff",verticalAlign:"middle"}}),style:{fontWeight:600,fontSize:14,minWidth:100,color:"#4a3a6a"},popupMatchSelectWidth:!1})]}),e.jsxRuntimeExports.jsx("button",{type:"button",onClick:Ie,title:"切换为侧边栏选择",style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:"100%",cursor:"pointer",color:"#b0a0c8",borderLeft:"1px solid #e5e0f0",transition:"all 0.15s",background:"none",border:"none",padding:0},onMouseEnter:m=>{m.currentTarget.style.color="#7c3aed",m.currentTarget.style.background="#f5f0ff"},onMouseLeave:m=>{m.currentTarget.style.color="#b0a0c8",m.currentTarget.style.background="transparent"},children:e.jsxRuntimeExports.jsx(ot,{style:{fontSize:13}})})]}),count:ie.length,widgets:ie,activeAgent:c,agents:b,childAgents:$,ssoDomain:p,ssoToken:g,ssoCompany:R,onWidgetsUpdate:V,onExecuteComplete:()=>{K()},externalRobotName:ft,externalShowPanel:Rt}),e.jsxRuntimeExports.jsx(e.Chat,{messages:ne.messages,playbooks:M,messagesTotal:ne.messagesTotal,loadMoreMessages:ne.loadMoreMessages,loading:bt,executing:ce,ssoToken:g,ssoDomain:p,ssoCompany:R,activeAgent:c,webhookId:j,onExecutePlaybook:O,onSolidifySuccess:P.loadSolidifiedPlaybooks,onDashboardPreview:_t,onSolidifyComplete:kt,onFillPlaybookParams:m=>{const re={playbook_id:m.playbookId,name:m.playbookName,input_fields:m.inputFields,initial_params:m.initialParams,playbook_type:m.playbookType};H(re)},onActionClick:m=>{m.action_id?(k(!0),be&&be({action_id:m.action_id,action_params:m.params})):m.playbook_id&&O({message:m.display_name||"执行",playbook_id:m.playbook_id,...m.params?{playbook_params:m.params}:{}})},onExecuteComplete:()=>{K()},onRespondToProposal:pe,onRetrigger:Te}),e.jsxRuntimeExports.jsxs("div",{className:"chat-input-area",children:[e.jsxRuntimeExports.jsx(e.PlaybookHub,{playbooks:M,playbookLoading:F,onPlaybookClick:O,onSelectPlaybook:m=>{H(m)},recommendations:ue,userPlaybooks:S,userPlaybooksLoading:Q,onLoadUserPlaybooks:I,agentId:e.getAgentPrimaryId(b.find(m=>e.matchesAgent(m,c)))||c,recentRefreshKey:ae}),e.jsxRuntimeExports.jsx(e.ChatInput,{executing:ce,stopping:we,onStop:Ne,onSend:_,playbooks:M,recommendations:ue,value:ye,onValueChange:ge,onRequestPlaybookParams:H,ssoToken:g,ssoDomain:p,ssoCompany:R})]})]});default:return null}},$e=oe==="plan"?De??xt.plan:xt[oe],Pt=(oe==="plan"||!P.dashboardData)&&oe!=="professional"&&oe!=="chat";return e.jsxRuntimeExports.jsx(e.LanguageProvider,{children:e.jsxRuntimeExports.jsxs(es,{children:[e.jsxRuntimeExports.jsx("div",{className:`wandox-aside-overlay ${t?"wandox-aside-overlay--visible":""}`,onClick:()=>x(!1),onKeyDown:d=>d.key==="Escape"&&x(!1),role:"button",tabIndex:0,"aria-label":"关闭侧边栏"}),s&&e.jsxRuntimeExports.jsx(Jt,{active:c,agents:b,onChange:d=>{x(!1),We(d)},collapsed:Pe,onToggle:()=>he(d=>!d),className:t?"wandox-aside--mobile-open":"",activeView:oe,onViewChange:Nt,onToolboxOpen:St,showLogout:i,onLogout:o,sidebarAgentMode:Se,onToggleSidebarMode:Ie,onAgentSelect:d=>We(d)}),s&&Pe&&e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-aside-floating-open",onClick:()=>he(!1),"aria-label":"展开侧边栏",title:"展开侧边栏",children:e.jsxRuntimeExports.jsx(ot,{})}),e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-mobile-header",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"wandox-mobile-menu-btn",onClick:()=>{he(!1),x(!0)},children:"☰"}),e.jsxRuntimeExports.jsx("h1",{className:"wandox-mobile-title",children:"Wandox"}),i&&o?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:o,style:{width:40,height:40,background:"transparent",border:"none",cursor:"pointer"},children:"退出"}):e.jsxRuntimeExports.jsx("div",{style:{width:40}})]}),Pt&&e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace-topbar",children:[e.jsxRuntimeExports.jsxs("div",{className:"wandox-workspace-topbar-info",children:[e.jsxRuntimeExports.jsx("h1",{className:"wandox-workspace-topbar-title",children:($e==null?void 0:$e.title)??"您好,欢迎使用 AI 智能体"}),e.jsxRuntimeExports.jsx("p",{className:"wandox-workspace-topbar-subtitle",children:($e==null?void 0:$e.subtitle)??""})]}),e.jsxRuntimeExports.jsx("div",{className:"wandox-workspace-topbar-actions",children:oe==="plan"?De==null?void 0:De.actions:null})]}),e.jsxRuntimeExports.jsx("div",{className:`wandox-workspace-container${oe==="plan"?" wandox-workspace-container--automation":""}`,children:It()})]}),e.jsxRuntimeExports.jsx(Ht,{open:fe,loading:P.solidifiedPlaybooksLoading,playbooks:P.solidifiedPlaybooks,activePlaybookId:P.activeSolidifiedPlaybook,onClose:()=>Ae(!1),onPlaybookClick:Ct,onPlaybookDelete:P.handleSolidifiedPlaybookDelete}),e.jsxRuntimeExports.jsx(e.ActionExecutionDrawer,{open:L,ssoToken:g,ssoDomain:p,ssoCompany:R,onClose:()=>k(!1),onExecuteAction:yt,onExecuteComplete:()=>{setTimeout(()=>{K()},1e3)}}),e.jsxRuntimeExports.jsx(ss,{open:y,actionId:(T==null?void 0:T.action_id)||"",actionName:(T==null?void 0:T.display_name)||"",defaultParams:T==null?void 0:T.params,onCancel:()=>{de(!1),Be(null)},onExecute:d=>{de(!1),k(!0),be&&T&&be({action_id:T.action_id,action_params:d}),Be(null)}}),e.jsxRuntimeExports.jsx(Gt,{open:!!ve,playbook:ve,onClose:()=>H(null),onSubmit:(d,A)=>{H(null),O({message:d.name,playbook_id:d.playbook_id,playbook_params:A})}}),Re&&e.jsxRuntimeExports.jsx(e.InitialRouteLoading,{}),e.jsxRuntimeExports.jsx(ts,{queueStatus:xe})]})})}exports.default=fs;
|