autoglm-gui 1.5.6__py3-none-any.whl → 1.5.8__py3-none-any.whl

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.
Files changed (21) hide show
  1. AutoGLM_GUI/static/assets/{about-DVviVdH2.js → about-DLIoLF4H.js} +1 -1
  2. AutoGLM_GUI/static/assets/{alert-dialog-IHmO2JCQ.js → alert-dialog-CP0Ln6uE.js} +1 -1
  3. AutoGLM_GUI/static/assets/{chat-C_3D0Ao7.js → chat-BeQeCo9v.js} +3 -3
  4. AutoGLM_GUI/static/assets/{dialog-DOpd71Lu.js → dialog-owGgcHW-.js} +1 -1
  5. AutoGLM_GUI/static/assets/{eye-CZP5ZJ_Y.js → eye-DRVKMcGF.js} +1 -1
  6. AutoGLM_GUI/static/assets/{folder-open-_KlT8ZW7.js → folder-open-DWIBudK5.js} +1 -1
  7. AutoGLM_GUI/static/assets/{history-BXMlCwUV.js → history-D-6VV8AF.js} +1 -1
  8. AutoGLM_GUI/static/assets/{index-DUNWZsFq.js → index-DSGEx4xN.js} +2 -2
  9. AutoGLM_GUI/static/assets/{index-Bh2f556h.js → index-Dulms-G2.js} +1 -1
  10. AutoGLM_GUI/static/assets/{label-CRZhpiYG.js → label-DPhMxT1N.js} +1 -1
  11. AutoGLM_GUI/static/assets/{logs-DEN9nDRS.js → logs-DfpuXl5p.js} +1 -1
  12. AutoGLM_GUI/static/assets/{popover-DitUZhUk.js → popover-BVLk9lq7.js} +1 -1
  13. AutoGLM_GUI/static/assets/{scheduled-tasks-boxDKe87.js → scheduled-tasks-Cw40Sske.js} +1 -1
  14. AutoGLM_GUI/static/assets/{textarea-CvRHzjfV.js → textarea-D8pE3YVl.js} +1 -1
  15. AutoGLM_GUI/static/assets/{workflows-Bg3qN-6j.js → workflows-C25VCn09.js} +1 -1
  16. AutoGLM_GUI/static/index.html +1 -1
  17. {autoglm_gui-1.5.6.dist-info → autoglm_gui-1.5.8.dist-info}/METADATA +1 -1
  18. {autoglm_gui-1.5.6.dist-info → autoglm_gui-1.5.8.dist-info}/RECORD +21 -21
  19. {autoglm_gui-1.5.6.dist-info → autoglm_gui-1.5.8.dist-info}/WHEEL +0 -0
  20. {autoglm_gui-1.5.6.dist-info → autoglm_gui-1.5.8.dist-info}/entry_points.txt +0 -0
  21. {autoglm_gui-1.5.6.dist-info → autoglm_gui-1.5.8.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- import{j as o}from"./index-DUNWZsFq.js";function t(){return o.jsx("div",{className:"p-2",children:o.jsx("h3",{children:"About"})})}export{t as component};
1
+ import{j as o}from"./index-DSGEx4xN.js";function t(){return o.jsx("div",{className:"p-2",children:o.jsx("h3",{children:"About"})})}export{t as component};
@@ -1 +1 @@
1
- import{b as u,r as o,j as a,e as r,B as d}from"./index-DUNWZsFq.js";import{P as g,c as x,b as f,d as m}from"./popover-DitUZhUk.js";import{D as p,d as h,e as w,f as j,g as D}from"./dialog-DOpd71Lu.js";const N=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b=u("check",N),c=o.createContext(void 0),P=({value:t="",onValueChange:e,children:s})=>{const[n,l]=o.useState(!1);return a.jsx(c.Provider,{value:{value:t,onValueChange:e||(()=>{}),open:n,setOpen:l},children:a.jsx(g,{open:n,onOpenChange:l,children:s})})},C=o.forwardRef(({className:t,children:e,...s},n)=>{if(!o.useContext(c))throw new Error("SelectTrigger must be used within Select");return a.jsx(x,{asChild:!0,children:a.jsxs("button",{ref:n,className:r("flex h-10 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-slate-500 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-800 dark:bg-slate-950 dark:ring-offset-slate-950 dark:placeholder:text-slate-400 dark:focus:ring-slate-300",t),...s,children:[e,a.jsx(f,{className:"h-4 w-4 opacity-50"})]})})});C.displayName="SelectTrigger";const V=({placeholder:t})=>{const e=o.useContext(c);if(!e)throw new Error("SelectValue must be used within Select");return a.jsx("span",{className:e.value?"":"text-slate-500",children:e.value||t})},I=({children:t,className:e})=>a.jsx(m,{className:r("w-[var(--radix-popover-trigger-width)] p-1",e),children:t}),O=({value:t,children:e,disabled:s,className:n})=>{const l=o.useContext(c);if(!l)throw new Error("SelectItem must be used within Select");const i=l.value===t;return a.jsxs("div",{role:"option","aria-selected":i,className:r("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-slate-100 focus:bg-slate-100 dark:hover:bg-slate-800 dark:focus:bg-slate-800",s&&"pointer-events-none opacity-50",n),onClick:()=>{s||(l.onValueChange(t),l.setOpen(!1))},children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i&&a.jsx(b,{className:"h-4 w-4"})}),e]})},B=({open:t,onOpenChange:e,children:s})=>a.jsx(p,{open:t,onOpenChange:e,children:s}),v=o.forwardRef(({className:t,...e},s)=>a.jsx(h,{ref:s,className:r("sm:max-w-[425px]",t),...e}));v.displayName="AlertDialogContent";const F=({className:t,...e})=>a.jsx(w,{className:r(t),...e}),H=({className:t,...e})=>a.jsx(D,{className:r(t),...e}),A=o.forwardRef(({className:t,...e},s)=>a.jsx(j,{ref:s,className:r(t),...e}));A.displayName="AlertDialogTitle";const S=o.forwardRef(({className:t,...e},s)=>a.jsx("p",{ref:s,className:r("text-sm text-slate-500 dark:text-slate-400",t),...e}));S.displayName="AlertDialogDescription";const y=o.forwardRef(({className:t,...e},s)=>a.jsx(d,{ref:s,className:r(t),...e}));y.displayName="AlertDialogAction";const k=o.forwardRef(({className:t,...e},s)=>a.jsx(d,{ref:s,variant:"outline",className:r(t),...e}));k.displayName="AlertDialogCancel";export{B as A,P as S,C as a,V as b,I as c,O as d,v as e,F as f,A as g,S as h,H as i,k as j,y as k};
1
+ import{b as u,r as o,j as a,e as r,B as d}from"./index-DSGEx4xN.js";import{P as g,c as x,b as f,d as m}from"./popover-BVLk9lq7.js";import{D as p,d as h,e as w,f as j,g as D}from"./dialog-owGgcHW-.js";const N=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b=u("check",N),c=o.createContext(void 0),P=({value:t="",onValueChange:e,children:s})=>{const[n,l]=o.useState(!1);return a.jsx(c.Provider,{value:{value:t,onValueChange:e||(()=>{}),open:n,setOpen:l},children:a.jsx(g,{open:n,onOpenChange:l,children:s})})},C=o.forwardRef(({className:t,children:e,...s},n)=>{if(!o.useContext(c))throw new Error("SelectTrigger must be used within Select");return a.jsx(x,{asChild:!0,children:a.jsxs("button",{ref:n,className:r("flex h-10 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-slate-500 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-800 dark:bg-slate-950 dark:ring-offset-slate-950 dark:placeholder:text-slate-400 dark:focus:ring-slate-300",t),...s,children:[e,a.jsx(f,{className:"h-4 w-4 opacity-50"})]})})});C.displayName="SelectTrigger";const V=({placeholder:t})=>{const e=o.useContext(c);if(!e)throw new Error("SelectValue must be used within Select");return a.jsx("span",{className:e.value?"":"text-slate-500",children:e.value||t})},I=({children:t,className:e})=>a.jsx(m,{className:r("w-[var(--radix-popover-trigger-width)] p-1",e),children:t}),O=({value:t,children:e,disabled:s,className:n})=>{const l=o.useContext(c);if(!l)throw new Error("SelectItem must be used within Select");const i=l.value===t;return a.jsxs("div",{role:"option","aria-selected":i,className:r("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-slate-100 focus:bg-slate-100 dark:hover:bg-slate-800 dark:focus:bg-slate-800",s&&"pointer-events-none opacity-50",n),onClick:()=>{s||(l.onValueChange(t),l.setOpen(!1))},children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i&&a.jsx(b,{className:"h-4 w-4"})}),e]})},B=({open:t,onOpenChange:e,children:s})=>a.jsx(p,{open:t,onOpenChange:e,children:s}),v=o.forwardRef(({className:t,...e},s)=>a.jsx(h,{ref:s,className:r("sm:max-w-[425px]",t),...e}));v.displayName="AlertDialogContent";const F=({className:t,...e})=>a.jsx(w,{className:r(t),...e}),H=({className:t,...e})=>a.jsx(D,{className:r(t),...e}),A=o.forwardRef(({className:t,...e},s)=>a.jsx(j,{ref:s,className:r(t),...e}));A.displayName="AlertDialogTitle";const S=o.forwardRef(({className:t,...e},s)=>a.jsx("p",{ref:s,className:r("text-sm text-slate-500 dark:text-slate-400",t),...e}));S.displayName="AlertDialogDescription";const y=o.forwardRef(({className:t,...e},s)=>a.jsx(d,{ref:s,className:r(t),...e}));y.displayName="AlertDialogAction";const k=o.forwardRef(({className:t,...e},s)=>a.jsx(d,{ref:s,variant:"outline",className:r(t),...e}));k.displayName="AlertDialogCancel";export{B as A,P as S,C as a,V as b,I as c,O as d,v as e,F as f,A as g,S as h,H as i,k as j,y as k};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DUNWZsFq.js","assets/index-84TrNz7w.css"])))=>i.map(i=>d[i]);
2
- import{b as Ye,j as o,u as pn,r as x,T as ln,v as cn,w as un,B as fe,i as Vn,x as jv,y as Av,z as Sr,R as Ke,A as Pt,D as ta,E as ii,P as gt,G as Pe,H as ga,I as an,J as zu,K as Pv,L as Mv,M as Cn,N as Dv,O as Iv,Q as Lv,S as Ov,U as Fv,V as Hu,W as Bv,e as Ln,X as Uv,Y as Vs,Z as Gv,h as $u,_ as Wv,$ as zv,a0 as Hv,a1 as $v,a2 as Wr,a3 as uu,a4 as qv,a5 as Xv,a6 as Yv,a7 as qu,a8 as Kv,a9 as du,aa as fu,ab as Vv,ac as Qv,ad as Jv,ae as Zv,af as oi,ag as Xu,q as Yu,l as Ku,s as Vu,t as Qu,ah as Ju,ai as e1,aj as t1,ak as n1,al as r1,am as s1,an as i1,ao as o1,ap as a1,aq as l1,ar as c1,as as u1,at as d1,au as f1,av as h1}from"./index-DUNWZsFq.js";import{L as At,T as xa,D as xr,d as _r,e as vr,f as br,h as yr,g as wr,i as p1,u as m1,R as g1,F as x1,C as gi,X as _1}from"./dialog-DOpd71Lu.js";import{S as Zu,L as et,I as dt,P as _a}from"./label-CRZhpiYG.js";import{C as va,E as Wo}from"./eye-CZP5ZJ_Y.js";import{b as ed,C as hu,a as pu,P as ai,c as li,d as ci}from"./popover-DitUZhUk.js";import{F as na,C as dn}from"./folder-open-_KlT8ZW7.js";import{T as td}from"./textarea-CvRHzjfV.js";const v1=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],b1=Ye("arrow-up-down",v1);const y1=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],nd=Ye("brain",y1);const w1=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],rd=Ye("chevron-left",w1);const E1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],S1=Ye("chevron-up",E1);const C1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ns=Ye("circle-check",C1);const N1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],R1=Ye("cpu",N1);const T1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],mu=Ye("external-link",T1);const k1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],gu=Ye("eye-off",k1);const j1=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],A1=Ye("fingerprint-pattern",j1);const P1=[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],M1=Ye("folder-cog",P1);const D1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],sd=Ye("grip-vertical",D1);const I1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],xu=Ye("image",I1);const L1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],O1=Ye("info",L1);const F1=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],ra=Ye("layers",F1);const B1=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],U1=Ye("maximize",B1);const G1=[["path",{d:"M5 12h14",key:"1ays0h"}]],W1=Ye("minus",G1);const z1=[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]],H1=Ye("monitor-play",z1);const $1=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],q1=Ye("plug",$1);const X1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],id=Ye("rotate-ccw",X1);const Y1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],od=Ye("send",Y1);const K1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],sa=Ye("server",K1);const V1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ad=Ye("settings",V1);const Q1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Zs=Ye("smartphone",Q1);const J1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],qr=Ye("sparkles",J1);const Z1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ld=Ye("square",Z1);const eb=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],tb=Ye("video",eb);const nb=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],rb=Ye("wifi-off",nb);const sb=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],ui=Ye("wifi",sb);const ib=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ob=Ye("wrench",ib);function ia({isOpen:s,title:n,content:r,onConfirm:a,onCancel:u,confirmText:l="确认",cancelText:m="取消",confirmVariant:b="default",disabled:h=!1}){if(!s)return null;const d=b==="destructive"?"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed":"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed";return o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm animate-in fade-in duration-200",children:o.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-xl max-w-md w-full overflow-hidden transform transition-all animate-in zoom-in-95 duration-200",onClick:p=>p.stopPropagation(),children:[o.jsxs("div",{className:"p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:n}),o.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm leading-relaxed whitespace-pre-wrap",children:r})]}),o.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 px-6 py-4 flex justify-end gap-3",children:[o.jsx("button",{onClick:p=>{p.stopPropagation(),u()},disabled:h,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:m}),o.jsx("button",{onClick:p=>{p.stopPropagation(),a()},disabled:h,className:d,children:l})]})]})})}function ab({id:s,serial:n,model:r,status:a,connectionType:u,displayName:l,agent:m,isActive:b,onClick:h,onConnectWifi:d,onDisconnectWifi:p,onNameUpdated:_,showToast:y}){const w=pn(),S=a==="device",P=u==="usb",N=u==="wifi",I=u==="remote",[L,k]=x.useState(!1),[B,Y]=x.useState(!1),[T,F]=x.useState(!1),[z,D]=x.useState(!1),[te,U]=x.useState(""),[M,G]=x.useState(!1),H=l||r||w.deviceCard.unknownDevice,Z=()=>{if(!S||!m)return"status-agent-none";switch(m.state){case"idle":return"status-agent-idle";case"busy":return"status-agent-busy";case"error":return"status-agent-error";case"initializing":return"status-agent-initializing";default:return"status-agent-none"}},Q=()=>{if(!S||!m)return w.deviceCard.statusTooltip.none;switch(m.state){case"idle":return w.deviceCard.statusTooltip.idle;case"busy":return w.deviceCard.statusTooltip.busy;case"error":return w.deviceCard.statusTooltip.error;case"initializing":return w.deviceCard.statusTooltip.initializing;default:return w.deviceCard.statusTooltip.none}},ee=le=>{le.stopPropagation(),!(L||!d)&&Y(!0)},ie=le=>{le.stopPropagation(),!(L||!p)&&F(!0)},ne=async()=>{Y(!1),k(!0);try{d&&await d()}finally{k(!1)}},A=async()=>{F(!1),k(!0);try{p&&await p()}finally{k(!1)}},$=le=>{le.stopPropagation(),U(l||r||""),D(!0)},re=async()=>{try{G(!0);const le=te.trim(),ve=await Av(n,le||null);if(!ve.success){y&&y(ve.error||w.deviceCard.saveNameError,"error");return}D(!1),_&&_(),y&&y(w.deviceCard.saveNameSuccess,"success")}catch(le){console.error("Failed to update device name:",le),y&&y(w.deviceCard.saveNameError,"error")}finally{G(!1)}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{onClick:h,role:"button",tabIndex:0,onKeyDown:le=>{(le.key==="Enter"||le.key===" ")&&h()},className:`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DSGEx4xN.js","assets/index-84TrNz7w.css"])))=>i.map(i=>d[i]);
2
+ import{b as Ye,j as o,u as pn,r as x,T as ln,v as cn,w as un,B as fe,i as Vn,x as jv,y as Av,z as Sr,R as Ke,A as Pt,D as ta,E as ii,P as gt,G as Pe,H as ga,I as an,J as zu,K as Pv,L as Mv,M as Cn,N as Dv,O as Iv,Q as Lv,S as Ov,U as Fv,V as Hu,W as Bv,e as Ln,X as Uv,Y as Vs,Z as Gv,h as $u,_ as Wv,$ as zv,a0 as Hv,a1 as $v,a2 as Wr,a3 as uu,a4 as qv,a5 as Xv,a6 as Yv,a7 as qu,a8 as Kv,a9 as du,aa as fu,ab as Vv,ac as Qv,ad as Jv,ae as Zv,af as oi,ag as Xu,q as Yu,l as Ku,s as Vu,t as Qu,ah as Ju,ai as e1,aj as t1,ak as n1,al as r1,am as s1,an as i1,ao as o1,ap as a1,aq as l1,ar as c1,as as u1,at as d1,au as f1,av as h1}from"./index-DSGEx4xN.js";import{L as At,T as xa,D as xr,d as _r,e as vr,f as br,h as yr,g as wr,i as p1,u as m1,R as g1,F as x1,C as gi,X as _1}from"./dialog-owGgcHW-.js";import{S as Zu,L as et,I as dt,P as _a}from"./label-DPhMxT1N.js";import{C as va,E as Wo}from"./eye-DRVKMcGF.js";import{b as ed,C as hu,a as pu,P as ai,c as li,d as ci}from"./popover-BVLk9lq7.js";import{F as na,C as dn}from"./folder-open-DWIBudK5.js";import{T as td}from"./textarea-D8pE3YVl.js";const v1=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],b1=Ye("arrow-up-down",v1);const y1=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],nd=Ye("brain",y1);const w1=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],rd=Ye("chevron-left",w1);const E1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],S1=Ye("chevron-up",E1);const C1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ns=Ye("circle-check",C1);const N1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],R1=Ye("cpu",N1);const T1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],mu=Ye("external-link",T1);const k1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],gu=Ye("eye-off",k1);const j1=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],A1=Ye("fingerprint-pattern",j1);const P1=[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],M1=Ye("folder-cog",P1);const D1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],sd=Ye("grip-vertical",D1);const I1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],xu=Ye("image",I1);const L1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],O1=Ye("info",L1);const F1=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],ra=Ye("layers",F1);const B1=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],U1=Ye("maximize",B1);const G1=[["path",{d:"M5 12h14",key:"1ays0h"}]],W1=Ye("minus",G1);const z1=[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]],H1=Ye("monitor-play",z1);const $1=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],q1=Ye("plug",$1);const X1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],id=Ye("rotate-ccw",X1);const Y1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],od=Ye("send",Y1);const K1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],sa=Ye("server",K1);const V1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ad=Ye("settings",V1);const Q1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Zs=Ye("smartphone",Q1);const J1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],qr=Ye("sparkles",J1);const Z1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ld=Ye("square",Z1);const eb=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],tb=Ye("video",eb);const nb=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],rb=Ye("wifi-off",nb);const sb=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],ui=Ye("wifi",sb);const ib=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ob=Ye("wrench",ib);function ia({isOpen:s,title:n,content:r,onConfirm:a,onCancel:u,confirmText:l="确认",cancelText:m="取消",confirmVariant:b="default",disabled:h=!1}){if(!s)return null;const d=b==="destructive"?"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed":"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed";return o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm animate-in fade-in duration-200",children:o.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-xl max-w-md w-full overflow-hidden transform transition-all animate-in zoom-in-95 duration-200",onClick:p=>p.stopPropagation(),children:[o.jsxs("div",{className:"p-6",children:[o.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:n}),o.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm leading-relaxed whitespace-pre-wrap",children:r})]}),o.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 px-6 py-4 flex justify-end gap-3",children:[o.jsx("button",{onClick:p=>{p.stopPropagation(),u()},disabled:h,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:m}),o.jsx("button",{onClick:p=>{p.stopPropagation(),a()},disabled:h,className:d,children:l})]})]})})}function ab({id:s,serial:n,model:r,status:a,connectionType:u,displayName:l,agent:m,isActive:b,onClick:h,onConnectWifi:d,onDisconnectWifi:p,onNameUpdated:_,showToast:y}){const w=pn(),S=a==="device",P=u==="usb",N=u==="wifi",I=u==="remote",[L,k]=x.useState(!1),[B,Y]=x.useState(!1),[T,F]=x.useState(!1),[z,D]=x.useState(!1),[te,U]=x.useState(""),[M,G]=x.useState(!1),H=l||r||w.deviceCard.unknownDevice,Z=()=>{if(!S||!m)return"status-agent-none";switch(m.state){case"idle":return"status-agent-idle";case"busy":return"status-agent-busy";case"error":return"status-agent-error";case"initializing":return"status-agent-initializing";default:return"status-agent-none"}},Q=()=>{if(!S||!m)return w.deviceCard.statusTooltip.none;switch(m.state){case"idle":return w.deviceCard.statusTooltip.idle;case"busy":return w.deviceCard.statusTooltip.busy;case"error":return w.deviceCard.statusTooltip.error;case"initializing":return w.deviceCard.statusTooltip.initializing;default:return w.deviceCard.statusTooltip.none}},ee=le=>{le.stopPropagation(),!(L||!d)&&Y(!0)},ie=le=>{le.stopPropagation(),!(L||!p)&&F(!0)},ne=async()=>{Y(!1),k(!0);try{d&&await d()}finally{k(!1)}},A=async()=>{F(!1),k(!0);try{p&&await p()}finally{k(!1)}},$=le=>{le.stopPropagation(),U(l||r||""),D(!0)},re=async()=>{try{G(!0);const le=te.trim(),ve=await Av(n,le||null);if(!ve.success){y&&y(ve.error||w.deviceCard.saveNameError,"error");return}D(!1),_&&_(),y&&y(w.deviceCard.saveNameSuccess,"success")}catch(le){console.error("Failed to update device name:",le),y&&y(w.deviceCard.saveNameError,"error")}finally{G(!1)}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{onClick:h,role:"button",tabIndex:0,onKeyDown:le=>{(le.key==="Enter"||le.key===" ")&&h()},className:`
3
3
  group relative w-full text-left p-4 rounded-xl transition-all duration-200 cursor-pointer
4
4
  border-2
5
5
  ${b?"bg-slate-50 border-[#1d9bf0] dark:bg-slate-800/50 dark:border-[#1d9bf0]":"bg-white border-transparent hover:border-slate-200 dark:bg-slate-900 dark:hover:border-slate-700"}
@@ -126,7 +126,7 @@ void main() {
126
126
  rounded-2xl px-4 py-3 flex items-start gap-2
127
127
  ${K.success===!1?"bg-red-100 dark:bg-red-900/20 text-red-600 dark:text-red-400":"bg-slate-100 dark:bg-slate-800 text-slate-700 dark:text-slate-300"}
128
128
  `,children:[o.jsx(ns,{className:`w-5 h-5 flex-shrink-0 mt-0.5 ${K.success===!1?"text-red-500":"text-green-500"}`}),o.jsxs("div",{children:[o.jsx("p",{className:"whitespace-pre-wrap",children:K.content}),K.steps!==void 0&&o.jsxs("p",{className:"text-xs mt-2 opacity-60 text-slate-500 dark:text-slate-400",children:[K.steps," steps completed"]})]})]}),K.isStreaming&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-slate-400",children:[o.jsx(At,{className:"w-4 h-4 animate-spin"}),"Processing..."]})]}):o.jsxs("div",{className:"max-w-[75%]",children:[o.jsx("div",{className:"chat-bubble-user px-4 py-3",children:o.jsx("p",{className:"whitespace-pre-wrap",children:K.content})}),o.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500 mt-1 text-right",children:K.timestamp.toLocaleTimeString()})]})},K.id)),o.jsx("div",{ref:te})]}),Q&&o.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-4 flex justify-center",children:o.jsx(fe,{onClick:_e,size:"sm",className:"pointer-events-auto shadow-lg bg-[#1d9bf0] text-white hover:bg-[#1a8cd8]","aria-label":m.devicePanel.newMessages,children:m.devicePanel.newMessages})})]}),o.jsx("div",{className:"p-4 border-t border-slate-200 dark:border-slate-800",children:o.jsxs("div",{className:"flex items-end gap-3",children:[o.jsx(td,{value:d,onChange:K=>p(K.target.value),onKeyDown:ce,placeholder:u?m.devicePanel.whatToDo:m.devicePanel.configureFirst,disabled:_,className:"flex-1 min-h-[40px] max-h-[120px] resize-none",rows:1}),o.jsxs(ln,{children:[o.jsx(cn,{asChild:!0,children:o.jsxs(ai,{open:F,onOpenChange:z,children:[o.jsx(li,{asChild:!0,children:o.jsx(fe,{variant:"outline",size:"icon",className:"h-10 w-10 flex-shrink-0",children:o.jsx(Xu,{className:"w-4 h-4"})})}),o.jsx(ci,{align:"start",className:"w-72 p-3",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:m.workflows.selectWorkflow}),Y.length===0?o.jsxs("div",{className:"text-sm text-slate-500 dark:text-slate-400 space-y-1",children:[o.jsx("p",{children:m.workflows.empty}),o.jsxs("p",{children:["前往"," ",o.jsx("a",{href:"/workflows",className:"text-primary underline",children:"工作流"})," ","页面创建。"]})]}):o.jsx(Jr,{className:"h-64",children:o.jsx("div",{className:"space-y-1",children:Y.map(K=>o.jsxs("button",{onClick:()=>Ue(K),className:"w-full text-left p-2 rounded hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:[o.jsx("div",{className:"font-medium text-sm",children:K.name}),o.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 line-clamp-2",children:K.text})]},K.uuid))})})]})})]})}),o.jsx(un,{side:"top",sideOffset:8,className:"max-w-xs",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"font-medium",children:m.devicePanel.tooltips.workflowButton}),o.jsx("p",{className:"text-xs opacity-80",children:m.devicePanel.tooltips.workflowButtonDesc})]})})]}),_&&o.jsx(fe,{onClick:ve,disabled:w,size:"icon",variant:"destructive",className:"h-10 w-10 rounded-full flex-shrink-0",title:m.chat.abortChat,children:w?o.jsx(At,{className:"h-4 w-4 animate-spin"}):o.jsx(ld,{className:"h-4 w-4"})}),!_&&o.jsx(fe,{onClick:re,disabled:!d.trim(),size:"icon",variant:"twitter",className:"h-10 w-10 rounded-full flex-shrink-0",children:o.jsx(od,{className:"h-4 w-4"})})]})})]}),o.jsx(eh,{deviceId:s,serial:n,connectionType:a,isVisible:l})]})}function hE({deviceId:s,deviceSerial:n,deviceName:r,deviceConnectionType:a,isVisible:u}){const l=pn(),[m,b]=x.useState([]),[h,d]=x.useState(""),[p,_]=x.useState(!1),[y,w]=x.useState(!1),[S,P]=x.useState(null),N=x.useRef(null),I=x.useRef(null),L=x.useRef(null),[k,B]=x.useState([]),[Y,T]=x.useState(!1),[F,z]=x.useState([]),[D,te]=x.useState(!1);x.useEffect(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[m]),x.useEffect(()=>()=>{I.current&&I.current.close()},[]),x.useEffect(()=>{(async()=>{try{const $=await Ku();B($.workflows)}catch($){console.error("Failed to load workflows:",$)}})()},[]),x.useEffect(()=>{D&&(async()=>{try{const $=await Yu(n,20,0);z($.records)}catch($){console.error("Failed to load history:",$),z([])}})()},[D,n]);const U=A=>{d(A.text),T(!1)},M=A=>{const $={id:`${A.id}-user`,role:"user",content:A.task_text,timestamp:new Date(A.start_time)},re={id:`${A.id}-agent`,role:"assistant",content:A.final_message,timestamp:A.end_time?new Date(A.end_time):new Date(A.start_time),steps:[],success:A.success,isStreaming:!1};b([$,re]),te(!1)},G=async()=>{if(confirm(l.history?.clearAllConfirm||"Clear all history?"))try{await Vu(n),z([])}catch(A){console.error("Failed to clear history:",A)}},H=async A=>{try{await Qu(n,A),z($=>$.filter(re=>re.id!==A))}catch($){console.error("Failed to delete history item:",$)}},Z=(A,$)=>{b(re=>re.map(le=>le.id===A?{...le,steps:le.steps?.map(ve=>ve.id===$?{...ve,isExpanded:!ve.isExpanded}:ve)}:le))},Q=x.useCallback(async()=>{const A=h.trim();if(!A||p)return;const $={id:Date.now().toString(),role:"user",content:A,timestamp:new Date};b(xe=>[...xe,$]),d(""),_(!0),P(null);const re=(Date.now()+1).toString(),le={id:re,role:"assistant",content:"",timestamp:new Date,steps:[],isStreaming:!0};b(xe=>[...xe,le]);const ve=new AbortController;L.current=ve;try{const xe=await fetch("/api/layered-agent/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:A,device_id:s,session_id:s}),signal:ve.signal});if(!xe.ok){let K=`HTTP error! status: ${xe.status}`;try{const pe=await xe.json();pe.detail&&(K=pe.detail)}catch{}throw new Error(K)}const Ue=xe.body?.getReader();if(!Ue)throw new Error("No response body");const Le=new TextDecoder;let _e="";const ce=[];for(;;){const{done:K,value:pe}=await Ue.read();if(K)break;_e+=Le.decode(pe,{stream:!0});const Se=_e.split(`
129
- `);_e=Se.pop()||"";for(const He of Se)if(He.startsWith("data: "))try{const ge=JSON.parse(He.slice(6));if(ge.type==="tool_call"){const Ie={id:`step-${Date.now()}-${Math.random()}`,type:"tool_call",content:ge.tool_name==="chat"?"发送指令给 Phone Agent":ge.tool_name==="list_devices"?"获取设备列表":`调用工具: ${ge.tool_name}`,toolName:ge.tool_name,toolArgs:ge.tool_args||{},timestamp:new Date,isExpanded:!0};ce.push(Ie),b(Te=>Te.map(Re=>Re.id===re?{...Re,steps:[...ce]}:Re))}else if(ge.type==="tool_result"){const Ie={id:`step-${Date.now()}-${Math.random()}`,type:"tool_result",content:ge.tool_name==="chat"?"Phone Agent 执行结果":`${ge.tool_name} 结果`,toolResult:ge.result,timestamp:new Date,isExpanded:!0};ce.push(Ie),b(Te=>Te.map(Re=>Re.id===re?{...Re,steps:[...ce]}:Re))}else if(ge.type==="message")b(Ie=>Ie.map(Te=>Te.id===re?{...Te,content:ge.content}:Te));else if(ge.type==="done"){const Ie={...le,content:ge.content||"",isStreaming:!1,success:ge.success,steps:[...ce],timestamp:new Date};b(Te=>Te.map(Re=>Re.id===re?Ie:Re))}else if(ge.type==="error"){const Ie={...le,content:`错误: ${ge.message}`,isStreaming:!1,success:!1,steps:[...ce],timestamp:new Date};b(Te=>Te.map(Re=>Re.id===re?Ie:Re)),P(ge.message)}}catch(ge){console.error("Failed to parse SSE data:",ge,He)}}b(K=>K.map(pe=>pe.id===re&&pe.isStreaming?{...pe,isStreaming:!1,success:!0}:pe))}catch(xe){if(xe instanceof Error&&xe.name==="AbortError"){console.log("Chat aborted by user");return}console.error("Chat error:",xe);const Ue=Ju(xe);P(Ue),b(Le=>Le.map(_e=>_e.id===re?{..._e,content:`错误: ${Ue}`,isStreaming:!1,success:!1}:_e))}finally{_(!1),L.current=null}},[h,p,s]),ee=x.useCallback(()=>{if(L.current){w(!0);try{L.current.abort(),L.current=null,b(A=>{const $=A[A.length-1];return $&&$.role==="assistant"&&$.isStreaming?A.map((re,le)=>le===A.length-1?{...re,content:re.content||l.chat?.aborted||"任务已中断",isStreaming:!1,success:!1}:re):A}),e1(async()=>{const{abortLayeredAgentChat:A}=await import("./index-DUNWZsFq.js").then($=>$.ay);return{abortLayeredAgentChat:A}},__vite__mapDeps([0,1])).then(({abortLayeredAgentChat:A})=>{A(s).catch($=>console.error("Backend abort failed:",$))})}catch(A){console.error("Failed to abort chat:",A)}finally{_(!1),w(!1)}}},[l,s]),ie=x.useCallback(async()=>{L.current&&(L.current.abort(),L.current=null),b([]),P(null),I.current&&(I.current.close(),I.current=null);try{await fetch("/api/layered-agent/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:s})})}catch(A){console.warn("Failed to reset backend session:",A)}},[s]),ne=A=>{(A.metaKey||A.ctrlKey)&&A.key==="Enter"&&(A.preventDefault(),Q())};return o.jsxs("div",{className:"flex-1 flex gap-4 p-4 items-stretch justify-center min-h-0",children:[o.jsxs(gi,{className:"flex-1 flex flex-col min-h-0 max-w-2xl overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-200 dark:border-slate-800",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-purple-500/10",children:o.jsx(ra,{className:"h-5 w-5 text-purple-500"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-bold text-slate-900 dark:text-slate-100",children:l.chatkit?.title||"AI Agent"}),o.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:[r," • ",l.chatkit?.layeredAgent||"分层代理模式"]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Vn,{variant:"secondary",className:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300",children:l.chatkit?.layeredAgent||"分层代理模式"}),o.jsxs(ai,{open:D,onOpenChange:te,children:[o.jsx(li,{asChild:!0,children:o.jsx(fe,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300",title:l.history?.title||"History",children:o.jsx(oi,{className:"h-4 w-4"})})}),o.jsxs(ci,{className:"w-96 p-0",align:"end",sideOffset:8,children:[o.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-200 dark:border-slate-800",children:[o.jsx("h3",{className:"font-semibold text-sm text-slate-900 dark:text-slate-100",children:l.history?.title||"History"}),F.length>0&&o.jsx(fe,{variant:"ghost",size:"sm",onClick:G,className:"h-7 text-xs",children:l.history?.clearAll||"Clear All"})]}),o.jsx(Jr,{className:"h-[400px]",children:o.jsx("div",{className:"p-4 space-y-2",children:F.length>0?F.map(A=>o.jsx(th,{item:A,onSelect:M,onDelete:H},A.id)):o.jsxs("div",{className:"text-center py-8",children:[o.jsx(oi,{className:"h-12 w-12 text-slate-300 dark:text-slate-700 mx-auto mb-3"}),o.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100",children:l.history?.noHistory||"No history yet"}),o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:l.history?.noHistoryDescription||"Your completed tasks will appear here"})]})})})]})]}),o.jsx(fe,{variant:"ghost",size:"icon",onClick:ie,className:"h-8 w-8 rounded-full",title:"重置对话",children:o.jsx(id,{className:"h-4 w-4"})})]})]}),S&&o.jsxs("div",{className:"mx-4 mt-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl text-sm text-red-600 dark:text-red-400 flex items-center gap-2",children:[o.jsx(dn,{className:"w-4 h-4 flex-shrink-0"}),S]}),o.jsx(Jr,{className:"flex-1 min-h-0",children:o.jsxs("div",{className:"p-4 space-y-4",children:[m.length===0?o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center py-12",children:[o.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900/30 mb-4",children:o.jsx(ra,{className:"h-8 w-8 text-purple-500"})}),o.jsx("p",{className:"font-medium text-slate-900 dark:text-slate-100",children:l.chatkit?.title||"分层代理模式"}),o.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400 max-w-xs",children:l.chatkit?.layeredAgentDesc||"决策模型负责规划任务,视觉模型负责执行。你可以看到每一步的执行过程。"})]}):m.map(A=>o.jsx("div",{className:"space-y-2",children:A.role==="user"?o.jsx("div",{className:"flex justify-end",children:o.jsxs("div",{className:"max-w-[80%]",children:[o.jsx("div",{className:"bg-purple-600 text-white px-4 py-2 rounded-2xl rounded-br-sm",children:o.jsx("p",{className:"whitespace-pre-wrap",children:A.content})}),o.jsx("p",{className:"text-xs text-slate-400 mt-1 text-right",children:A.timestamp.toLocaleTimeString()})]})}):o.jsxs("div",{className:"space-y-3",children:[A.steps&&A.steps.length>0&&o.jsx("div",{className:"space-y-2",children:A.steps.map(($,re)=>o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden",children:[o.jsxs("button",{onClick:()=>Z(A.id,$.id),className:"w-full flex items-center justify-between p-3 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-medium ${$.type==="tool_call"?"bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"bg-green-100 text-green-600 dark:bg-green-900/30 dark:text-green-400"}`,children:$.type==="tool_call"?o.jsx(ob,{className:"w-3 h-3"}):o.jsx(t1,{className:"w-3 h-3"})}),o.jsxs("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:["Step ",re+1,": ",$.content]})]}),$.isExpanded?o.jsx(S1,{className:"w-4 h-4 text-slate-400"}):o.jsx(ed,{className:"w-4 h-4 text-slate-400"})]}),$.isExpanded&&o.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[$.type==="tool_call"&&$.toolArgs&&o.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-lg p-3 text-sm",children:[o.jsx("p",{className:"text-xs text-slate-500 mb-1 font-medium",children:$.toolName==="chat"?"发送给 Phone Agent 的指令:":"工具参数:"}),$.toolName==="chat"?o.jsx("p",{className:"text-slate-700 dark:text-slate-300 whitespace-pre-wrap",children:$.toolArgs.message||JSON.stringify($.toolArgs,null,2)}):o.jsx("pre",{className:"text-xs text-slate-600 dark:text-slate-400 overflow-x-auto",children:JSON.stringify($.toolArgs,null,2)})]}),$.type==="tool_result"&&$.toolResult&&o.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-lg p-3 text-sm",children:[o.jsx("p",{className:"text-xs text-slate-500 mb-1 font-medium",children:"执行结果:"}),o.jsx("pre",{className:"text-xs text-slate-600 dark:text-slate-400 overflow-x-auto whitespace-pre-wrap",children:typeof $.toolResult=="string"?$.toolResult:JSON.stringify($.toolResult,null,2)})]})]})]},$.id))}),A.content&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:`max-w-[85%] rounded-2xl rounded-tl-sm px-4 py-3 ${A.success===!1?"bg-red-100 dark:bg-red-900/20 text-red-600 dark:text-red-400":"bg-slate-100 dark:bg-slate-800 text-slate-700 dark:text-slate-300"}`,children:o.jsxs("div",{className:"flex items-start gap-2",children:[A.success!==void 0&&o.jsx(ns,{className:`w-5 h-5 flex-shrink-0 mt-0.5 ${A.success?"text-green-500":"text-red-500"}`}),o.jsx("p",{className:"whitespace-pre-wrap",children:A.content})]})})}),A.isStreaming&&!A.content&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[o.jsx(At,{className:"w-4 h-4 animate-spin"}),"正在思考和执行..."]})]})},A.id)),o.jsx("div",{ref:N})]})}),o.jsx("div",{className:"p-4 border-t border-slate-200 dark:border-slate-800",children:o.jsxs("div",{className:"flex items-end gap-3",children:[o.jsx(td,{value:h,onChange:A=>d(A.target.value),onKeyDown:ne,placeholder:"描述你想要完成的任务... (Cmd+Enter 发送)",disabled:p,className:"flex-1 min-h-[40px] max-h-[120px] resize-none",rows:1}),o.jsxs(ln,{children:[o.jsx(cn,{asChild:!0,children:o.jsxs(ai,{open:Y,onOpenChange:T,children:[o.jsx(li,{asChild:!0,children:o.jsx(fe,{variant:"outline",size:"icon",className:"h-10 w-10 flex-shrink-0",children:o.jsx(Xu,{className:"w-4 h-4"})})}),o.jsx(ci,{align:"start",className:"w-72 p-3",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:l.workflows?.selectWorkflow||"Select Workflow"}),k.length===0?o.jsxs("div",{className:"text-sm text-slate-500 dark:text-slate-400 space-y-1",children:[o.jsx("p",{children:l.workflows?.empty||"No workflows yet"}),o.jsxs("p",{children:["前往"," ",o.jsx("a",{href:"/workflows",className:"text-primary underline",children:"工作流"})," ","页面创建。"]})]}):o.jsx(Jr,{className:"h-64",children:o.jsx("div",{className:"space-y-1",children:k.map(A=>o.jsxs("button",{onClick:()=>U(A),className:"w-full text-left p-2 rounded hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:[o.jsx("div",{className:"font-medium text-sm",children:A.name}),o.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 line-clamp-2",children:A.text})]},A.uuid))})})]})})]})}),o.jsx(un,{side:"top",sideOffset:8,className:"max-w-xs",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"font-medium",children:l.devicePanel?.tooltips?.workflowButton||"Quick Workflow"}),o.jsx("p",{className:"text-xs opacity-80",children:l.devicePanel?.tooltips?.workflowButtonDesc||"Select a workflow to quickly fill in the task"})]})})]}),p&&o.jsx(fe,{onClick:ee,disabled:y,size:"icon",variant:"destructive",className:"h-10 w-10 rounded-full flex-shrink-0",title:l.chat?.abortChat||"中断任务",children:y?o.jsx(At,{className:"h-4 w-4 animate-spin"}):o.jsx(ld,{className:"h-4 w-4"})}),!p&&o.jsx(fe,{onClick:Q,disabled:!h.trim(),size:"icon",className:"h-10 w-10 rounded-full flex-shrink-0 bg-purple-600 hover:bg-purple-700",children:o.jsx(od,{className:"h-4 w-4"})})]})})]}),o.jsx(eh,{deviceId:s,serial:n,connectionType:a,isVisible:u})]})}function pE({isOpen:s,onClose:n,onGroupsChanged:r,showToast:a}){const u=pn(),[l,m]=x.useState([]),[b,h]=x.useState(!1),[d,p]=x.useState(null),[_,y]=x.useState(!1),[w,S]=x.useState(""),[P,N]=x.useState(!1),[I,L]=x.useState(null),[k,B]=x.useState(""),[Y,T]=x.useState(!1),[F,z]=x.useState(null),[D,te]=x.useState(!1),[U,M]=x.useState(null),G=x.useCallback(async()=>{h(!0),p(null);try{const A=await $u();m(A.groups.sort(($,re)=>$.order-re.order))}catch(A){console.error("Failed to fetch groups:",A),p(u.deviceGroups?.fetchError||"获取分组失败")}finally{h(!1)}},[u.deviceGroups?.fetchError]);x.useEffect(()=>{s&&G()},[s,G]);const H=async()=>{if(w.trim()){N(!0);try{await r1(w.trim()),y(!1),S(""),await G(),r&&r(),a&&a(u.deviceGroups?.createSuccess||"分组创建成功","success")}catch(A){console.error("Failed to create group:",A),a&&a(u.deviceGroups?.createError||"创建分组失败","error")}finally{N(!1)}}},Z=async()=>{if(!(!I||!k.trim())){T(!0);try{await s1(I.id,k.trim()),L(null),B(""),await G(),r&&r(),a&&a(u.deviceGroups?.updateSuccess||"分组更新成功","success")}catch(A){console.error("Failed to update group:",A),a&&a(u.deviceGroups?.updateError||"更新分组失败","error")}finally{T(!1)}}},Q=async()=>{if(F){te(!0);try{const A=await i1(F.id);A.success?(z(null),await G(),r&&r(),a&&a(u.deviceGroups?.deleteSuccess||"分组删除成功","success")):a&&a(A.message||u.deviceGroups?.deleteError||"删除分组失败","error")}catch(A){console.error("Failed to delete group:",A),a&&a(u.deviceGroups?.deleteError||"删除分组失败","error")}finally{te(!1)}}},ee=A=>{M(A)},ie=(A,$)=>{if(A.preventDefault(),!U||U===$)return;const re=[...l],le=re.findIndex(Ue=>Ue.id===U),ve=re.findIndex(Ue=>Ue.id===$);if(le===-1||ve===-1)return;const[xe]=re.splice(le,1);re.splice(ve,0,xe),m(re)},ne=async()=>{if(!U)return;const A=l.map($=>$.id);try{await n1(A),r&&r()}catch($){console.error("Failed to reorder groups:",$),await G(),a&&a(u.deviceGroups?.reorderError||"调整顺序失败","error")}finally{M(null)}};return o.jsxs(o.Fragment,{children:[o.jsx(xr,{open:s,onOpenChange:A=>!A&&n(),children:o.jsxs(_r,{className:"sm:max-w-md max-h-[80vh] overflow-hidden flex flex-col",children:[o.jsxs(vr,{children:[o.jsx(br,{children:u.deviceGroups?.manageTitle||"管理设备分组"}),o.jsx(yr,{children:u.deviceGroups?.manageDescription||"创建、编辑、删除和排序设备分组。拖拽分组可调整顺序。"})]}),o.jsx("div",{className:"flex-1 overflow-y-auto py-4",children:b?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(At,{className:"h-6 w-6 animate-spin text-slate-400"})}):d?o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(dn,{className:"h-8 w-8 text-red-500 mb-2"}),o.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:d}),o.jsx(fe,{variant:"outline",size:"sm",onClick:G,className:"mt-2",children:u.common?.retry||"重试"})]}):o.jsxs("div",{className:"space-y-2",children:[l.map(A=>o.jsxs("div",{draggable:!A.is_default,onDragStart:()=>ee(A.id),onDragOver:$=>ie($,A.id),onDragEnd:ne,className:`
129
+ `);_e=Se.pop()||"";for(const He of Se)if(He.startsWith("data: "))try{const ge=JSON.parse(He.slice(6));if(ge.type==="tool_call"){const Ie={id:`step-${Date.now()}-${Math.random()}`,type:"tool_call",content:ge.tool_name==="chat"?"发送指令给 Phone Agent":ge.tool_name==="list_devices"?"获取设备列表":`调用工具: ${ge.tool_name}`,toolName:ge.tool_name,toolArgs:ge.tool_args||{},timestamp:new Date,isExpanded:!0};ce.push(Ie),b(Te=>Te.map(Re=>Re.id===re?{...Re,steps:[...ce]}:Re))}else if(ge.type==="tool_result"){const Ie={id:`step-${Date.now()}-${Math.random()}`,type:"tool_result",content:ge.tool_name==="chat"?"Phone Agent 执行结果":`${ge.tool_name} 结果`,toolResult:ge.result,timestamp:new Date,isExpanded:!0};ce.push(Ie),b(Te=>Te.map(Re=>Re.id===re?{...Re,steps:[...ce]}:Re))}else if(ge.type==="message")b(Ie=>Ie.map(Te=>Te.id===re?{...Te,content:ge.content}:Te));else if(ge.type==="done"){const Ie={...le,content:ge.content||"",isStreaming:!1,success:ge.success,steps:[...ce],timestamp:new Date};b(Te=>Te.map(Re=>Re.id===re?Ie:Re))}else if(ge.type==="error"){const Ie={...le,content:`错误: ${ge.message}`,isStreaming:!1,success:!1,steps:[...ce],timestamp:new Date};b(Te=>Te.map(Re=>Re.id===re?Ie:Re)),P(ge.message)}}catch(ge){console.error("Failed to parse SSE data:",ge,He)}}b(K=>K.map(pe=>pe.id===re&&pe.isStreaming?{...pe,isStreaming:!1,success:!0}:pe))}catch(xe){if(xe instanceof Error&&xe.name==="AbortError"){console.log("Chat aborted by user");return}console.error("Chat error:",xe);const Ue=Ju(xe);P(Ue),b(Le=>Le.map(_e=>_e.id===re?{..._e,content:`错误: ${Ue}`,isStreaming:!1,success:!1}:_e))}finally{_(!1),L.current=null}},[h,p,s]),ee=x.useCallback(()=>{if(L.current){w(!0);try{L.current.abort(),L.current=null,b(A=>{const $=A[A.length-1];return $&&$.role==="assistant"&&$.isStreaming?A.map((re,le)=>le===A.length-1?{...re,content:re.content||l.chat?.aborted||"任务已中断",isStreaming:!1,success:!1}:re):A}),e1(async()=>{const{abortLayeredAgentChat:A}=await import("./index-DSGEx4xN.js").then($=>$.ay);return{abortLayeredAgentChat:A}},__vite__mapDeps([0,1])).then(({abortLayeredAgentChat:A})=>{A(s).catch($=>console.error("Backend abort failed:",$))})}catch(A){console.error("Failed to abort chat:",A)}finally{_(!1),w(!1)}}},[l,s]),ie=x.useCallback(async()=>{L.current&&(L.current.abort(),L.current=null),b([]),P(null),I.current&&(I.current.close(),I.current=null);try{await fetch("/api/layered-agent/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:s})})}catch(A){console.warn("Failed to reset backend session:",A)}},[s]),ne=A=>{(A.metaKey||A.ctrlKey)&&A.key==="Enter"&&(A.preventDefault(),Q())};return o.jsxs("div",{className:"flex-1 flex gap-4 p-4 items-stretch justify-center min-h-0",children:[o.jsxs(gi,{className:"flex-1 flex flex-col min-h-0 max-w-2xl overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-200 dark:border-slate-800",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-purple-500/10",children:o.jsx(ra,{className:"h-5 w-5 text-purple-500"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-bold text-slate-900 dark:text-slate-100",children:l.chatkit?.title||"AI Agent"}),o.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:[r," • ",l.chatkit?.layeredAgent||"分层代理模式"]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Vn,{variant:"secondary",className:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300",children:l.chatkit?.layeredAgent||"分层代理模式"}),o.jsxs(ai,{open:D,onOpenChange:te,children:[o.jsx(li,{asChild:!0,children:o.jsx(fe,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300",title:l.history?.title||"History",children:o.jsx(oi,{className:"h-4 w-4"})})}),o.jsxs(ci,{className:"w-96 p-0",align:"end",sideOffset:8,children:[o.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-200 dark:border-slate-800",children:[o.jsx("h3",{className:"font-semibold text-sm text-slate-900 dark:text-slate-100",children:l.history?.title||"History"}),F.length>0&&o.jsx(fe,{variant:"ghost",size:"sm",onClick:G,className:"h-7 text-xs",children:l.history?.clearAll||"Clear All"})]}),o.jsx(Jr,{className:"h-[400px]",children:o.jsx("div",{className:"p-4 space-y-2",children:F.length>0?F.map(A=>o.jsx(th,{item:A,onSelect:M,onDelete:H},A.id)):o.jsxs("div",{className:"text-center py-8",children:[o.jsx(oi,{className:"h-12 w-12 text-slate-300 dark:text-slate-700 mx-auto mb-3"}),o.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100",children:l.history?.noHistory||"No history yet"}),o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:l.history?.noHistoryDescription||"Your completed tasks will appear here"})]})})})]})]}),o.jsx(fe,{variant:"ghost",size:"icon",onClick:ie,className:"h-8 w-8 rounded-full",title:"重置对话",children:o.jsx(id,{className:"h-4 w-4"})})]})]}),S&&o.jsxs("div",{className:"mx-4 mt-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl text-sm text-red-600 dark:text-red-400 flex items-center gap-2",children:[o.jsx(dn,{className:"w-4 h-4 flex-shrink-0"}),S]}),o.jsx(Jr,{className:"flex-1 min-h-0",children:o.jsxs("div",{className:"p-4 space-y-4",children:[m.length===0?o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center py-12",children:[o.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900/30 mb-4",children:o.jsx(ra,{className:"h-8 w-8 text-purple-500"})}),o.jsx("p",{className:"font-medium text-slate-900 dark:text-slate-100",children:l.chatkit?.title||"分层代理模式"}),o.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400 max-w-xs",children:l.chatkit?.layeredAgentDesc||"决策模型负责规划任务,视觉模型负责执行。你可以看到每一步的执行过程。"})]}):m.map(A=>o.jsx("div",{className:"space-y-2",children:A.role==="user"?o.jsx("div",{className:"flex justify-end",children:o.jsxs("div",{className:"max-w-[80%]",children:[o.jsx("div",{className:"bg-purple-600 text-white px-4 py-2 rounded-2xl rounded-br-sm",children:o.jsx("p",{className:"whitespace-pre-wrap",children:A.content})}),o.jsx("p",{className:"text-xs text-slate-400 mt-1 text-right",children:A.timestamp.toLocaleTimeString()})]})}):o.jsxs("div",{className:"space-y-3",children:[A.steps&&A.steps.length>0&&o.jsx("div",{className:"space-y-2",children:A.steps.map(($,re)=>o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden",children:[o.jsxs("button",{onClick:()=>Z(A.id,$.id),className:"w-full flex items-center justify-between p-3 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-medium ${$.type==="tool_call"?"bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"bg-green-100 text-green-600 dark:bg-green-900/30 dark:text-green-400"}`,children:$.type==="tool_call"?o.jsx(ob,{className:"w-3 h-3"}):o.jsx(t1,{className:"w-3 h-3"})}),o.jsxs("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:["Step ",re+1,": ",$.content]})]}),$.isExpanded?o.jsx(S1,{className:"w-4 h-4 text-slate-400"}):o.jsx(ed,{className:"w-4 h-4 text-slate-400"})]}),$.isExpanded&&o.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[$.type==="tool_call"&&$.toolArgs&&o.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-lg p-3 text-sm",children:[o.jsx("p",{className:"text-xs text-slate-500 mb-1 font-medium",children:$.toolName==="chat"?"发送给 Phone Agent 的指令:":"工具参数:"}),$.toolName==="chat"?o.jsx("p",{className:"text-slate-700 dark:text-slate-300 whitespace-pre-wrap",children:$.toolArgs.message||JSON.stringify($.toolArgs,null,2)}):o.jsx("pre",{className:"text-xs text-slate-600 dark:text-slate-400 overflow-x-auto",children:JSON.stringify($.toolArgs,null,2)})]}),$.type==="tool_result"&&$.toolResult&&o.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-lg p-3 text-sm",children:[o.jsx("p",{className:"text-xs text-slate-500 mb-1 font-medium",children:"执行结果:"}),o.jsx("pre",{className:"text-xs text-slate-600 dark:text-slate-400 overflow-x-auto whitespace-pre-wrap",children:typeof $.toolResult=="string"?$.toolResult:JSON.stringify($.toolResult,null,2)})]})]})]},$.id))}),A.content&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:`max-w-[85%] rounded-2xl rounded-tl-sm px-4 py-3 ${A.success===!1?"bg-red-100 dark:bg-red-900/20 text-red-600 dark:text-red-400":"bg-slate-100 dark:bg-slate-800 text-slate-700 dark:text-slate-300"}`,children:o.jsxs("div",{className:"flex items-start gap-2",children:[A.success!==void 0&&o.jsx(ns,{className:`w-5 h-5 flex-shrink-0 mt-0.5 ${A.success?"text-green-500":"text-red-500"}`}),o.jsx("p",{className:"whitespace-pre-wrap",children:A.content})]})})}),A.isStreaming&&!A.content&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[o.jsx(At,{className:"w-4 h-4 animate-spin"}),"正在思考和执行..."]})]})},A.id)),o.jsx("div",{ref:N})]})}),o.jsx("div",{className:"p-4 border-t border-slate-200 dark:border-slate-800",children:o.jsxs("div",{className:"flex items-end gap-3",children:[o.jsx(td,{value:h,onChange:A=>d(A.target.value),onKeyDown:ne,placeholder:"描述你想要完成的任务... (Cmd+Enter 发送)",disabled:p,className:"flex-1 min-h-[40px] max-h-[120px] resize-none",rows:1}),o.jsxs(ln,{children:[o.jsx(cn,{asChild:!0,children:o.jsxs(ai,{open:Y,onOpenChange:T,children:[o.jsx(li,{asChild:!0,children:o.jsx(fe,{variant:"outline",size:"icon",className:"h-10 w-10 flex-shrink-0",children:o.jsx(Xu,{className:"w-4 h-4"})})}),o.jsx(ci,{align:"start",className:"w-72 p-3",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:l.workflows?.selectWorkflow||"Select Workflow"}),k.length===0?o.jsxs("div",{className:"text-sm text-slate-500 dark:text-slate-400 space-y-1",children:[o.jsx("p",{children:l.workflows?.empty||"No workflows yet"}),o.jsxs("p",{children:["前往"," ",o.jsx("a",{href:"/workflows",className:"text-primary underline",children:"工作流"})," ","页面创建。"]})]}):o.jsx(Jr,{className:"h-64",children:o.jsx("div",{className:"space-y-1",children:k.map(A=>o.jsxs("button",{onClick:()=>U(A),className:"w-full text-left p-2 rounded hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:[o.jsx("div",{className:"font-medium text-sm",children:A.name}),o.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 line-clamp-2",children:A.text})]},A.uuid))})})]})})]})}),o.jsx(un,{side:"top",sideOffset:8,className:"max-w-xs",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"font-medium",children:l.devicePanel?.tooltips?.workflowButton||"Quick Workflow"}),o.jsx("p",{className:"text-xs opacity-80",children:l.devicePanel?.tooltips?.workflowButtonDesc||"Select a workflow to quickly fill in the task"})]})})]}),p&&o.jsx(fe,{onClick:ee,disabled:y,size:"icon",variant:"destructive",className:"h-10 w-10 rounded-full flex-shrink-0",title:l.chat?.abortChat||"中断任务",children:y?o.jsx(At,{className:"h-4 w-4 animate-spin"}):o.jsx(ld,{className:"h-4 w-4"})}),!p&&o.jsx(fe,{onClick:Q,disabled:!h.trim(),size:"icon",className:"h-10 w-10 rounded-full flex-shrink-0 bg-purple-600 hover:bg-purple-700",children:o.jsx(od,{className:"h-4 w-4"})})]})})]}),o.jsx(eh,{deviceId:s,serial:n,connectionType:a,isVisible:u})]})}function pE({isOpen:s,onClose:n,onGroupsChanged:r,showToast:a}){const u=pn(),[l,m]=x.useState([]),[b,h]=x.useState(!1),[d,p]=x.useState(null),[_,y]=x.useState(!1),[w,S]=x.useState(""),[P,N]=x.useState(!1),[I,L]=x.useState(null),[k,B]=x.useState(""),[Y,T]=x.useState(!1),[F,z]=x.useState(null),[D,te]=x.useState(!1),[U,M]=x.useState(null),G=x.useCallback(async()=>{h(!0),p(null);try{const A=await $u();m(A.groups.sort(($,re)=>$.order-re.order))}catch(A){console.error("Failed to fetch groups:",A),p(u.deviceGroups?.fetchError||"获取分组失败")}finally{h(!1)}},[u.deviceGroups?.fetchError]);x.useEffect(()=>{s&&G()},[s,G]);const H=async()=>{if(w.trim()){N(!0);try{await r1(w.trim()),y(!1),S(""),await G(),r&&r(),a&&a(u.deviceGroups?.createSuccess||"分组创建成功","success")}catch(A){console.error("Failed to create group:",A),a&&a(u.deviceGroups?.createError||"创建分组失败","error")}finally{N(!1)}}},Z=async()=>{if(!(!I||!k.trim())){T(!0);try{await s1(I.id,k.trim()),L(null),B(""),await G(),r&&r(),a&&a(u.deviceGroups?.updateSuccess||"分组更新成功","success")}catch(A){console.error("Failed to update group:",A),a&&a(u.deviceGroups?.updateError||"更新分组失败","error")}finally{T(!1)}}},Q=async()=>{if(F){te(!0);try{const A=await i1(F.id);A.success?(z(null),await G(),r&&r(),a&&a(u.deviceGroups?.deleteSuccess||"分组删除成功","success")):a&&a(A.message||u.deviceGroups?.deleteError||"删除分组失败","error")}catch(A){console.error("Failed to delete group:",A),a&&a(u.deviceGroups?.deleteError||"删除分组失败","error")}finally{te(!1)}}},ee=A=>{M(A)},ie=(A,$)=>{if(A.preventDefault(),!U||U===$)return;const re=[...l],le=re.findIndex(Ue=>Ue.id===U),ve=re.findIndex(Ue=>Ue.id===$);if(le===-1||ve===-1)return;const[xe]=re.splice(le,1);re.splice(ve,0,xe),m(re)},ne=async()=>{if(!U)return;const A=l.map($=>$.id);try{await n1(A),r&&r()}catch($){console.error("Failed to reorder groups:",$),await G(),a&&a(u.deviceGroups?.reorderError||"调整顺序失败","error")}finally{M(null)}};return o.jsxs(o.Fragment,{children:[o.jsx(xr,{open:s,onOpenChange:A=>!A&&n(),children:o.jsxs(_r,{className:"sm:max-w-md max-h-[80vh] overflow-hidden flex flex-col",children:[o.jsxs(vr,{children:[o.jsx(br,{children:u.deviceGroups?.manageTitle||"管理设备分组"}),o.jsx(yr,{children:u.deviceGroups?.manageDescription||"创建、编辑、删除和排序设备分组。拖拽分组可调整顺序。"})]}),o.jsx("div",{className:"flex-1 overflow-y-auto py-4",children:b?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(At,{className:"h-6 w-6 animate-spin text-slate-400"})}):d?o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(dn,{className:"h-8 w-8 text-red-500 mb-2"}),o.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:d}),o.jsx(fe,{variant:"outline",size:"sm",onClick:G,className:"mt-2",children:u.common?.retry||"重试"})]}):o.jsxs("div",{className:"space-y-2",children:[l.map(A=>o.jsxs("div",{draggable:!A.is_default,onDragStart:()=>ee(A.id),onDragOver:$=>ie($,A.id),onDragEnd:ne,className:`
130
130
  flex items-center gap-2 p-3 rounded-lg border
131
131
  ${U===A.id?"border-[#1d9bf0] bg-blue-50 dark:bg-blue-950/20":"border-slate-200 dark:border-slate-700 hover:bg-slate-50 dark:hover:bg-slate-800"}
132
132
  ${A.is_default?"opacity-80":"cursor-move"}
@@ -1,4 +1,4 @@
1
- import{b as ae,r as i,j as u,e as S,I as de,A as G,P as F,H as et,z as tt,E as Y,M as oe,N as nt,G as _,D as rt,Q as at,ax as ot}from"./index-DUNWZsFq.js";const it=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pn=ae("loader-circle",it);const ct=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Mn=ae("trash-2",ct);const st=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lt=ae("x",st),ut=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("rounded-2xl border border-slate-200 bg-white text-slate-950 shadow-sm dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",e),...t}));ut.displayName="Card";const dt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("flex flex-col space-y-1.5 p-6",e),...t}));dt.displayName="CardHeader";const ft=i.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:S("text-xl font-semibold leading-none tracking-tight",e),...t}));ft.displayName="CardTitle";const vt=i.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:S("text-sm text-slate-500 dark:text-slate-400",e),...t}));vt.displayName="CardDescription";const mt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("p-6 pt-0",e),...t}));mt.displayName="CardContent";const pt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("flex items-center p-6 pt-0",e),...t}));pt.displayName="CardFooter";var Z="focusScope.autoFocusOnMount",q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},ht="FocusScope",we=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[c,y]=i.useState(null),h=de(a),m=de(o),f=i.useRef(null),p=G(t,s=>y(s)),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let s=function(E){if(g.paused||!c)return;const C=E.target;c.contains(C)?f.current=C:T(f.current,{select:!0})},d=function(E){if(g.paused||!c)return;const C=E.relatedTarget;C!==null&&(c.contains(C)||T(f.current,{select:!0}))},v=function(E){if(document.activeElement===document.body)for(const w of E)w.removedNodes.length>0&&T(c)};document.addEventListener("focusin",s),document.addEventListener("focusout",d);const b=new MutationObserver(v);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",d),b.disconnect()}}},[r,c,g.paused]),i.useEffect(()=>{if(c){me.add(g);const s=document.activeElement;if(!c.contains(s)){const v=new CustomEvent(Z,fe);c.addEventListener(Z,h),c.dispatchEvent(v),v.defaultPrevented||(gt(wt(xe(c)),{select:!0}),document.activeElement===s&&T(c))}return()=>{c.removeEventListener(Z,h),setTimeout(()=>{const v=new CustomEvent(q,fe);c.addEventListener(q,m),c.dispatchEvent(v),v.defaultPrevented||T(s??document.body,{select:!0}),c.removeEventListener(q,m),me.remove(g)},0)}}},[c,h,m,g]);const x=i.useCallback(s=>{if(!n&&!r||g.paused)return;const d=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,v=document.activeElement;if(d&&v){const b=s.currentTarget,[E,C]=yt(b);E&&C?!s.shiftKey&&v===C?(s.preventDefault(),n&&T(E,{select:!0})):s.shiftKey&&v===E&&(s.preventDefault(),n&&T(C,{select:!0})):v===b&&s.preventDefault()}},[n,r,g.paused]);return u.jsx(F.div,{tabIndex:-1,...l,ref:p,onKeyDown:x})});we.displayName=ht;function gt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(T(r,{select:t}),document.activeElement!==n)return}function yt(e){const t=xe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function xe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!bt(n,{upTo:t}))return n}function bt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Et(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Et(e)&&t&&e.select()}}var me=Ct();function Ct(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=pe(e,t),e.unshift(t)},remove(t){e=pe(e,t),e[0]?.resume()}}}function pe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wt(e){return e.filter(t=>t.tagName!=="A")}var Q=0;function xt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??he()),document.body.insertAdjacentElement("beforeend",e[1]??he()),Q++,()=>{Q===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Q--}},[])}function he(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function St(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",Nt="with-scroll-bars-hidden",Rt="--removed-body-scroll-bar-size";function J(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dt(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var kt=typeof window<"u"?i.useLayoutEffect:i.useEffect,ge=new WeakMap;function Tt(e,t){var n=Dt(null,function(r){return e.forEach(function(a){return J(a,r)})});return kt(function(){var r=ge.get(n);if(r){var a=new Set(r),o=new Set(e),l=n.current;a.forEach(function(c){o.has(c)||J(c,null)}),o.forEach(function(c){a.has(c)||J(c,l)})}ge.set(n,e)},[e]),n}function At(e){return e}function Pt(e,t){t===void 0&&(t=At);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(o),l=n}var y=function(){var m=l;l=[],m.forEach(o)},h=function(){return Promise.resolve().then(y)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return a}function Mt(e){e===void 0&&(e={});var t=Pt(null);return t.options=R({async:!0,ssr:!1},e),t}var Ne=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,R({},n))};Ne.isSideCarExport=!0;function Ot(e,t){return e.useMedium(t),Ne}var Re=Mt(),ee=function(){},K=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ee,onWheelCapture:ee,onTouchMoveCapture:ee}),a=r[0],o=r[1],l=e.forwardProps,c=e.children,y=e.className,h=e.removeScrollBar,m=e.enabled,f=e.shards,p=e.sideCar,g=e.noRelative,x=e.noIsolation,s=e.inert,d=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,E=e.gapMode,C=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,D=Tt([n,t]),k=R(R({},C),a);return i.createElement(i.Fragment,null,m&&i.createElement(w,{sideCar:Re,removeScrollBar:h,shards:f,noRelative:g,noIsolation:x,inert:s,setCallbacks:o,allowPinchZoom:!!d,lockRef:n,gapMode:E}),l?i.cloneElement(i.Children.only(c),R(R({},k),{ref:D})):i.createElement(b,R({},k,{className:y,ref:D}),c))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var It=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ft(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=It();return t&&e.setAttribute("nonce",t),e}function _t(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ft())&&(_t(t,n),jt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wt=function(){var e=Lt();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},De=function(){var e=Wt(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Bt={left:0,top:0,right:0,gap:0},te=function(e){return parseInt(e||"",10)||0},Ht=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[te(n),te(r),te(a)]},Ut=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bt;var t=Ht(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$t=De(),I="data-scroll-locked",Vt=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
1
+ import{b as ae,r as i,j as u,e as S,I as de,A as G,P as F,H as et,z as tt,E as Y,M as oe,N as nt,G as _,D as rt,Q as at,ax as ot}from"./index-DSGEx4xN.js";const it=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pn=ae("loader-circle",it);const ct=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Mn=ae("trash-2",ct);const st=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lt=ae("x",st),ut=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("rounded-2xl border border-slate-200 bg-white text-slate-950 shadow-sm dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",e),...t}));ut.displayName="Card";const dt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("flex flex-col space-y-1.5 p-6",e),...t}));dt.displayName="CardHeader";const ft=i.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:S("text-xl font-semibold leading-none tracking-tight",e),...t}));ft.displayName="CardTitle";const vt=i.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:S("text-sm text-slate-500 dark:text-slate-400",e),...t}));vt.displayName="CardDescription";const mt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("p-6 pt-0",e),...t}));mt.displayName="CardContent";const pt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("flex items-center p-6 pt-0",e),...t}));pt.displayName="CardFooter";var Z="focusScope.autoFocusOnMount",q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},ht="FocusScope",we=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[c,y]=i.useState(null),h=de(a),m=de(o),f=i.useRef(null),p=G(t,s=>y(s)),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let s=function(E){if(g.paused||!c)return;const C=E.target;c.contains(C)?f.current=C:T(f.current,{select:!0})},d=function(E){if(g.paused||!c)return;const C=E.relatedTarget;C!==null&&(c.contains(C)||T(f.current,{select:!0}))},v=function(E){if(document.activeElement===document.body)for(const w of E)w.removedNodes.length>0&&T(c)};document.addEventListener("focusin",s),document.addEventListener("focusout",d);const b=new MutationObserver(v);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",d),b.disconnect()}}},[r,c,g.paused]),i.useEffect(()=>{if(c){me.add(g);const s=document.activeElement;if(!c.contains(s)){const v=new CustomEvent(Z,fe);c.addEventListener(Z,h),c.dispatchEvent(v),v.defaultPrevented||(gt(wt(xe(c)),{select:!0}),document.activeElement===s&&T(c))}return()=>{c.removeEventListener(Z,h),setTimeout(()=>{const v=new CustomEvent(q,fe);c.addEventListener(q,m),c.dispatchEvent(v),v.defaultPrevented||T(s??document.body,{select:!0}),c.removeEventListener(q,m),me.remove(g)},0)}}},[c,h,m,g]);const x=i.useCallback(s=>{if(!n&&!r||g.paused)return;const d=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,v=document.activeElement;if(d&&v){const b=s.currentTarget,[E,C]=yt(b);E&&C?!s.shiftKey&&v===C?(s.preventDefault(),n&&T(E,{select:!0})):s.shiftKey&&v===E&&(s.preventDefault(),n&&T(C,{select:!0})):v===b&&s.preventDefault()}},[n,r,g.paused]);return u.jsx(F.div,{tabIndex:-1,...l,ref:p,onKeyDown:x})});we.displayName=ht;function gt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(T(r,{select:t}),document.activeElement!==n)return}function yt(e){const t=xe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function xe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!bt(n,{upTo:t}))return n}function bt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Et(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Et(e)&&t&&e.select()}}var me=Ct();function Ct(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=pe(e,t),e.unshift(t)},remove(t){e=pe(e,t),e[0]?.resume()}}}function pe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wt(e){return e.filter(t=>t.tagName!=="A")}var Q=0;function xt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??he()),document.body.insertAdjacentElement("beforeend",e[1]??he()),Q++,()=>{Q===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Q--}},[])}function he(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function St(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",Nt="with-scroll-bars-hidden",Rt="--removed-body-scroll-bar-size";function J(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dt(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var kt=typeof window<"u"?i.useLayoutEffect:i.useEffect,ge=new WeakMap;function Tt(e,t){var n=Dt(null,function(r){return e.forEach(function(a){return J(a,r)})});return kt(function(){var r=ge.get(n);if(r){var a=new Set(r),o=new Set(e),l=n.current;a.forEach(function(c){o.has(c)||J(c,null)}),o.forEach(function(c){a.has(c)||J(c,l)})}ge.set(n,e)},[e]),n}function At(e){return e}function Pt(e,t){t===void 0&&(t=At);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(o),l=n}var y=function(){var m=l;l=[],m.forEach(o)},h=function(){return Promise.resolve().then(y)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return a}function Mt(e){e===void 0&&(e={});var t=Pt(null);return t.options=R({async:!0,ssr:!1},e),t}var Ne=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,R({},n))};Ne.isSideCarExport=!0;function Ot(e,t){return e.useMedium(t),Ne}var Re=Mt(),ee=function(){},K=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ee,onWheelCapture:ee,onTouchMoveCapture:ee}),a=r[0],o=r[1],l=e.forwardProps,c=e.children,y=e.className,h=e.removeScrollBar,m=e.enabled,f=e.shards,p=e.sideCar,g=e.noRelative,x=e.noIsolation,s=e.inert,d=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,E=e.gapMode,C=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,D=Tt([n,t]),k=R(R({},C),a);return i.createElement(i.Fragment,null,m&&i.createElement(w,{sideCar:Re,removeScrollBar:h,shards:f,noRelative:g,noIsolation:x,inert:s,setCallbacks:o,allowPinchZoom:!!d,lockRef:n,gapMode:E}),l?i.cloneElement(i.Children.only(c),R(R({},k),{ref:D})):i.createElement(b,R({},k,{className:y,ref:D}),c))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var It=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ft(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=It();return t&&e.setAttribute("nonce",t),e}function _t(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ft())&&(_t(t,n),jt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wt=function(){var e=Lt();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},De=function(){var e=Wt(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Bt={left:0,top:0,right:0,gap:0},te=function(e){return parseInt(e||"",10)||0},Ht=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[te(n),te(r),te(a)]},Ut=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bt;var t=Ht(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$t=De(),I="data-scroll-locked",Vt=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
2
2
  .`.concat(Nt,` {
3
3
  overflow: hidden `).concat(r,`;
4
4
  padding-right: `).concat(c,"px ").concat(r,`;
@@ -1 +1 @@
1
- import{b as c}from"./index-DUNWZsFq.js";const e=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],n=c("chevron-right",e);const o=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r=c("eye",o);export{n as C,r as E};
1
+ import{b as c}from"./index-DSGEx4xN.js";const e=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],n=c("chevron-right",e);const o=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r=c("eye",o);export{n as C,r as E};
@@ -1 +1 @@
1
- import{b as e}from"./index-DUNWZsFq.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],l=e("circle-alert",c);const a=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],r=e("folder-open",a);export{l as C,r as F};
1
+ import{b as e}from"./index-DSGEx4xN.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],l=e("circle-alert",c);const a=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],r=e("folder-open",a);export{l as C,r as F};
@@ -1 +1 @@
1
- import{b as K,u as de,r,q as xe,j as e,B as h,i as m,C as E,g as he,s as me,t as ge}from"./index-DUNWZsFq.js";import{T as F,L as H,C as ue,c as pe,D as je,d as fe,e as ye,f as Ne}from"./dialog-DOpd71Lu.js";import{S as ke,a as be,b as ve,c as we,d as R,A as z,e as B,f as V,g as q,h as I,i as J,j as U,k as X}from"./alert-dialog-IHmO2JCQ.js";import{C as Y,a as G,b as De}from"./popover-DitUZhUk.js";import{E as Se,C as Ce}from"./eye-CZP5ZJ_Y.js";const Pe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Le=K("bot",Pe);const Ae=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],_e=K("user",Ae);function Fe(){const t=de(),[N,Q]=r.useState([]),[n,k]=r.useState(""),[o,x]=r.useState([]),[W,b]=r.useState(!1),[v,w]=r.useState(!1),[D,g]=r.useState(0),[S,u]=r.useState(0),[Z,p]=r.useState(!1),[ee,j]=r.useState(!1),[f,C]=r.useState(null),[se,P]=r.useState(!1),[i,te]=r.useState(null),[y,L]=r.useState(new Set),ae=20;r.useEffect(()=>{(async()=>{try{const a=await he();Q(a),a.length>0&&!n&&k(a[0].serial)}catch(a){console.error("Failed to load devices:",a)}})()},[n]);const A=r.useCallback(async(s,a=!0)=>{if(s)try{a?(b(!0),u(0)):w(!0);const l=a?0:S,c=await xe(s,ae,l);x(a?c.records:d=>[...d,...c.records]),g(c.total),u(l+c.records.length)}catch(l){console.error("Failed to load history:",l)}finally{b(!1),w(!1)}},[S]);r.useEffect(()=>{n&&A(n,!0)},[n]);const le=()=>{n&&o.length<D&&A(n,!1)},re=async()=>{if(n){try{await me(n),x([]),g(0),u(0)}catch(s){console.error("Failed to clear history:",s)}p(!1)}},ne=async()=>{if(!(!n||!f)){try{await ge(n,f),x(s=>s.filter(a=>a.id!==f)),g(s=>s-1)}catch(s){console.error("Failed to delete record:",s)}j(!1),C(null)}},_=s=>{te(s);const a=new Set;s.messages.forEach(l=>{l.step!==null&&l.step!==void 0&&a.add(l.step)}),L(a),P(!0)},ie=s=>{L(a=>{const l=new Set(a);return l.has(s)?l.delete(s):l.add(s),l})},M=s=>s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}min`,ce=s=>{const a=new Date(s),l=new Date,c=a.toDateString()===l.toDateString(),d=new Date(l);d.setDate(d.getDate()-1);const oe=a.toDateString()===d.toDateString(),$=a.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return c?`${t.history.today} ${$}`:oe?`${t.history.yesterday} ${$}`:a.toLocaleDateString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},T=s=>({chat:t.historyPage.source.chat,layered:t.historyPage.source.layered,scheduled:t.historyPage.source.scheduled})[s]||s,O=s=>{switch(s){case"chat":return"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300";case"layered":return"bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300";case"scheduled":return"bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300";default:return"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}};return e.jsxs("div",{className:"container mx-auto p-6 max-w-4xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:t.historyPage.title}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(ke,{value:n,onValueChange:k,children:[e.jsx(be,{className:"w-[200px]",children:e.jsx(ve,{placeholder:t.historyPage.selectDevice})}),e.jsx(we,{children:N.length===0?e.jsx(R,{value:"_none",disabled:!0,children:t.historyPage.noDevices}):N.map(s=>e.jsx(R,{value:s.serial,children:s.model||s.serial},s.serial))})]}),o.length>0&&e.jsxs(h,{variant:"destructive",size:"sm",onClick:()=>p(!0),children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),t.historyPage.clearAll]})]})]}),W?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(H,{className:"w-8 h-8 animate-spin text-slate-400"})}):o.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:t.historyPage.noRecords}),e.jsx("p",{className:"text-sm text-slate-400 dark:text-slate-500 mt-2",children:t.historyPage.noRecordsDesc})]}):e.jsxs("div",{className:"space-y-4",children:[o.map(s=>e.jsx(ue,{className:"hover:shadow-md transition-shadow cursor-pointer",onClick:()=>_(s),children:e.jsx(pe,{className:"p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100 line-clamp-2 mb-2",children:s.task_text}),e.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 line-clamp-2 mb-3",children:s.final_message}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.success?e.jsxs(m,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700",children:[e.jsx(Y,{className:"w-3 h-3 mr-1"}),t.historyPage.success]}):e.jsxs(m,{variant:"outline",className:"text-red-600 border-red-300 dark:text-red-400 dark:border-red-700",children:[e.jsx(G,{className:"w-3 h-3 mr-1"}),t.historyPage.failed]}),e.jsxs(m,{className:O(s.source),children:[T(s.source),s.source_detail&&`: ${s.source_detail}`]}),s.steps>0&&e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:t.historyPage.steps.replace("{count}",String(s.steps))}),e.jsxs("span",{className:"text-slate-500 dark:text-slate-400 flex items-center",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),M(s.duration_ms)]}),e.jsx("span",{className:"text-slate-400 dark:text-slate-500",children:ce(s.start_time)})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(h,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-blue-500",onClick:a=>{a.stopPropagation(),_(s)},children:e.jsx(Se,{className:"w-4 h-4"})}),e.jsx(h,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-red-500",onClick:a=>{a.stopPropagation(),C(s.id),j(!0)},children:e.jsx(F,{className:"w-4 h-4"})})]})]})})},s.id)),o.length<D&&e.jsx("div",{className:"text-center py-4",children:e.jsx(h,{variant:"outline",onClick:le,disabled:v,children:v?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),t.historyPage.loading]}):t.historyPage.loadMore})})]}),e.jsx(z,{open:Z,onOpenChange:p,children:e.jsxs(B,{children:[e.jsxs(V,{children:[e.jsx(q,{children:t.historyPage.clearAll}),e.jsx(I,{children:t.historyPage.clearAllConfirm})]}),e.jsxs(J,{children:[e.jsx(U,{children:t.common.cancel}),e.jsx(X,{onClick:re,children:t.common.confirm})]})]})}),e.jsx(z,{open:ee,onOpenChange:j,children:e.jsxs(B,{children:[e.jsxs(V,{children:[e.jsx(q,{children:t.common.delete}),e.jsx(I,{children:t.historyPage.deleteConfirm})]}),e.jsxs(J,{children:[e.jsx(U,{children:t.common.cancel}),e.jsx(X,{onClick:ne,children:t.common.confirm})]})]})}),e.jsx(je,{open:se,onOpenChange:P,children:e.jsxs(fe,{className:"max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[e.jsx(ye,{className:"flex-shrink-0",children:e.jsxs(Ne,{className:"flex items-center gap-2",children:[i?.success?e.jsx(Y,{className:"w-5 h-5 text-green-500"}):e.jsx(G,{className:"w-5 h-5 text-red-500"}),t.historyPage.detailTitle||"对话详情"]})}),i&&e.jsx("div",{className:"overflow-y-auto max-h-[calc(80vh-120px)] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-900 rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:t.historyPage.taskLabel||"任务"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:i.task_text})]}),e.jsx("div",{className:"space-y-3",children:i.messages.length>0?i.messages.map((s,a)=>e.jsx("div",{className:"space-y-2",children:s.role==="user"?e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center flex-shrink-0",children:e.jsx(_e,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),e.jsx("div",{className:"flex-1 p-3 bg-blue-50 dark:bg-blue-900/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:s.content})})]}):e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-emerald-100 dark:bg-emerald-900 flex items-center justify-center flex-shrink-0",children:e.jsx(Le,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400"})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[s.step!==null&&s.step!==void 0&&e.jsxs("button",{className:"flex items-center gap-1 text-xs text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200",onClick:()=>ie(s.step),children:[y.has(s.step)?e.jsx(De,{className:"w-3 h-3"}):e.jsx(Ce,{className:"w-3 h-3"}),t.historyPage.stepLabel?.replace("{step}",String(s.step))||`步骤 ${s.step}`]}),s.thinking&&(s.step===null||s.step===void 0||y.has(s.step))&&e.jsxs("div",{className:"p-3 bg-slate-100 dark:bg-slate-800 rounded-lg",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 mb-1",children:t.historyPage.thinkingLabel||"思考"}),e.jsx("p",{className:"text-sm text-slate-700 dark:text-slate-300 whitespace-pre-wrap",children:s.thinking})]}),s.action&&(s.step===null||s.step===void 0||y.has(s.step))&&e.jsxs("div",{className:"p-3 bg-amber-50 dark:bg-amber-900/20 rounded-lg",children:[e.jsx("p",{className:"text-xs font-medium text-amber-600 dark:text-amber-400 mb-1",children:t.historyPage.actionLabel||"动作"}),e.jsx("pre",{className:"text-xs text-slate-700 dark:text-slate-300 overflow-x-auto",children:JSON.stringify(s.action,null,2)})]})]})]})},a)):e.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 text-center py-4",children:t.historyPage.noMessages||"暂无详细消息记录"})}),e.jsxs("div",{className:`p-3 rounded-lg ${i.success?"bg-green-50 dark:bg-green-900/20":"bg-red-50 dark:bg-red-900/20"}`,children:[e.jsx("p",{className:`text-xs font-medium mb-1 ${i.success?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:t.historyPage.resultLabel||"结果"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:i.final_message})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-xs text-slate-500 dark:text-slate-400 pt-2 border-t border-slate-200 dark:border-slate-700",children:[e.jsx("span",{children:t.historyPage.steps.replace("{count}",String(i.steps))}),e.jsxs("span",{className:"flex items-center",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),M(i.duration_ms)]}),e.jsx(m,{className:O(i.source),children:T(i.source)})]})]})})]})})]})}export{Fe as component};
1
+ import{b as K,u as de,r,q as xe,j as e,B as h,i as m,C as E,g as he,s as me,t as ge}from"./index-DSGEx4xN.js";import{T as F,L as H,C as ue,c as pe,D as je,d as fe,e as ye,f as Ne}from"./dialog-owGgcHW-.js";import{S as ke,a as be,b as ve,c as we,d as R,A as z,e as B,f as V,g as q,h as I,i as J,j as U,k as X}from"./alert-dialog-CP0Ln6uE.js";import{C as Y,a as G,b as De}from"./popover-BVLk9lq7.js";import{E as Se,C as Ce}from"./eye-DRVKMcGF.js";const Pe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Le=K("bot",Pe);const Ae=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],_e=K("user",Ae);function Fe(){const t=de(),[N,Q]=r.useState([]),[n,k]=r.useState(""),[o,x]=r.useState([]),[W,b]=r.useState(!1),[v,w]=r.useState(!1),[D,g]=r.useState(0),[S,u]=r.useState(0),[Z,p]=r.useState(!1),[ee,j]=r.useState(!1),[f,C]=r.useState(null),[se,P]=r.useState(!1),[i,te]=r.useState(null),[y,L]=r.useState(new Set),ae=20;r.useEffect(()=>{(async()=>{try{const a=await he();Q(a),a.length>0&&!n&&k(a[0].serial)}catch(a){console.error("Failed to load devices:",a)}})()},[n]);const A=r.useCallback(async(s,a=!0)=>{if(s)try{a?(b(!0),u(0)):w(!0);const l=a?0:S,c=await xe(s,ae,l);x(a?c.records:d=>[...d,...c.records]),g(c.total),u(l+c.records.length)}catch(l){console.error("Failed to load history:",l)}finally{b(!1),w(!1)}},[S]);r.useEffect(()=>{n&&A(n,!0)},[n]);const le=()=>{n&&o.length<D&&A(n,!1)},re=async()=>{if(n){try{await me(n),x([]),g(0),u(0)}catch(s){console.error("Failed to clear history:",s)}p(!1)}},ne=async()=>{if(!(!n||!f)){try{await ge(n,f),x(s=>s.filter(a=>a.id!==f)),g(s=>s-1)}catch(s){console.error("Failed to delete record:",s)}j(!1),C(null)}},_=s=>{te(s);const a=new Set;s.messages.forEach(l=>{l.step!==null&&l.step!==void 0&&a.add(l.step)}),L(a),P(!0)},ie=s=>{L(a=>{const l=new Set(a);return l.has(s)?l.delete(s):l.add(s),l})},M=s=>s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}min`,ce=s=>{const a=new Date(s),l=new Date,c=a.toDateString()===l.toDateString(),d=new Date(l);d.setDate(d.getDate()-1);const oe=a.toDateString()===d.toDateString(),$=a.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return c?`${t.history.today} ${$}`:oe?`${t.history.yesterday} ${$}`:a.toLocaleDateString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},T=s=>({chat:t.historyPage.source.chat,layered:t.historyPage.source.layered,scheduled:t.historyPage.source.scheduled})[s]||s,O=s=>{switch(s){case"chat":return"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300";case"layered":return"bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300";case"scheduled":return"bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300";default:return"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}};return e.jsxs("div",{className:"container mx-auto p-6 max-w-4xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:t.historyPage.title}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(ke,{value:n,onValueChange:k,children:[e.jsx(be,{className:"w-[200px]",children:e.jsx(ve,{placeholder:t.historyPage.selectDevice})}),e.jsx(we,{children:N.length===0?e.jsx(R,{value:"_none",disabled:!0,children:t.historyPage.noDevices}):N.map(s=>e.jsx(R,{value:s.serial,children:s.model||s.serial},s.serial))})]}),o.length>0&&e.jsxs(h,{variant:"destructive",size:"sm",onClick:()=>p(!0),children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),t.historyPage.clearAll]})]})]}),W?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(H,{className:"w-8 h-8 animate-spin text-slate-400"})}):o.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:t.historyPage.noRecords}),e.jsx("p",{className:"text-sm text-slate-400 dark:text-slate-500 mt-2",children:t.historyPage.noRecordsDesc})]}):e.jsxs("div",{className:"space-y-4",children:[o.map(s=>e.jsx(ue,{className:"hover:shadow-md transition-shadow cursor-pointer",onClick:()=>_(s),children:e.jsx(pe,{className:"p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100 line-clamp-2 mb-2",children:s.task_text}),e.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 line-clamp-2 mb-3",children:s.final_message}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.success?e.jsxs(m,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700",children:[e.jsx(Y,{className:"w-3 h-3 mr-1"}),t.historyPage.success]}):e.jsxs(m,{variant:"outline",className:"text-red-600 border-red-300 dark:text-red-400 dark:border-red-700",children:[e.jsx(G,{className:"w-3 h-3 mr-1"}),t.historyPage.failed]}),e.jsxs(m,{className:O(s.source),children:[T(s.source),s.source_detail&&`: ${s.source_detail}`]}),s.steps>0&&e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:t.historyPage.steps.replace("{count}",String(s.steps))}),e.jsxs("span",{className:"text-slate-500 dark:text-slate-400 flex items-center",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),M(s.duration_ms)]}),e.jsx("span",{className:"text-slate-400 dark:text-slate-500",children:ce(s.start_time)})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(h,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-blue-500",onClick:a=>{a.stopPropagation(),_(s)},children:e.jsx(Se,{className:"w-4 h-4"})}),e.jsx(h,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-red-500",onClick:a=>{a.stopPropagation(),C(s.id),j(!0)},children:e.jsx(F,{className:"w-4 h-4"})})]})]})})},s.id)),o.length<D&&e.jsx("div",{className:"text-center py-4",children:e.jsx(h,{variant:"outline",onClick:le,disabled:v,children:v?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),t.historyPage.loading]}):t.historyPage.loadMore})})]}),e.jsx(z,{open:Z,onOpenChange:p,children:e.jsxs(B,{children:[e.jsxs(V,{children:[e.jsx(q,{children:t.historyPage.clearAll}),e.jsx(I,{children:t.historyPage.clearAllConfirm})]}),e.jsxs(J,{children:[e.jsx(U,{children:t.common.cancel}),e.jsx(X,{onClick:re,children:t.common.confirm})]})]})}),e.jsx(z,{open:ee,onOpenChange:j,children:e.jsxs(B,{children:[e.jsxs(V,{children:[e.jsx(q,{children:t.common.delete}),e.jsx(I,{children:t.historyPage.deleteConfirm})]}),e.jsxs(J,{children:[e.jsx(U,{children:t.common.cancel}),e.jsx(X,{onClick:ne,children:t.common.confirm})]})]})}),e.jsx(je,{open:se,onOpenChange:P,children:e.jsxs(fe,{className:"max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[e.jsx(ye,{className:"flex-shrink-0",children:e.jsxs(Ne,{className:"flex items-center gap-2",children:[i?.success?e.jsx(Y,{className:"w-5 h-5 text-green-500"}):e.jsx(G,{className:"w-5 h-5 text-red-500"}),t.historyPage.detailTitle||"对话详情"]})}),i&&e.jsx("div",{className:"overflow-y-auto max-h-[calc(80vh-120px)] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-900 rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:t.historyPage.taskLabel||"任务"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:i.task_text})]}),e.jsx("div",{className:"space-y-3",children:i.messages.length>0?i.messages.map((s,a)=>e.jsx("div",{className:"space-y-2",children:s.role==="user"?e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center flex-shrink-0",children:e.jsx(_e,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),e.jsx("div",{className:"flex-1 p-3 bg-blue-50 dark:bg-blue-900/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:s.content})})]}):e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-emerald-100 dark:bg-emerald-900 flex items-center justify-center flex-shrink-0",children:e.jsx(Le,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400"})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[s.step!==null&&s.step!==void 0&&e.jsxs("button",{className:"flex items-center gap-1 text-xs text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200",onClick:()=>ie(s.step),children:[y.has(s.step)?e.jsx(De,{className:"w-3 h-3"}):e.jsx(Ce,{className:"w-3 h-3"}),t.historyPage.stepLabel?.replace("{step}",String(s.step))||`步骤 ${s.step}`]}),s.thinking&&(s.step===null||s.step===void 0||y.has(s.step))&&e.jsxs("div",{className:"p-3 bg-slate-100 dark:bg-slate-800 rounded-lg",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 mb-1",children:t.historyPage.thinkingLabel||"思考"}),e.jsx("p",{className:"text-sm text-slate-700 dark:text-slate-300 whitespace-pre-wrap",children:s.thinking})]}),s.action&&(s.step===null||s.step===void 0||y.has(s.step))&&e.jsxs("div",{className:"p-3 bg-amber-50 dark:bg-amber-900/20 rounded-lg",children:[e.jsx("p",{className:"text-xs font-medium text-amber-600 dark:text-amber-400 mb-1",children:t.historyPage.actionLabel||"动作"}),e.jsx("pre",{className:"text-xs text-slate-700 dark:text-slate-300 overflow-x-auto",children:JSON.stringify(s.action,null,2)})]})]})]})},a)):e.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 text-center py-4",children:t.historyPage.noMessages||"暂无详细消息记录"})}),e.jsxs("div",{className:`p-3 rounded-lg ${i.success?"bg-green-50 dark:bg-green-900/20":"bg-red-50 dark:bg-red-900/20"}`,children:[e.jsx("p",{className:`text-xs font-medium mb-1 ${i.success?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:t.historyPage.resultLabel||"结果"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:i.final_message})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-xs text-slate-500 dark:text-slate-400 pt-2 border-t border-slate-200 dark:border-slate-700",children:[e.jsx("span",{children:t.historyPage.steps.replace("{count}",String(i.steps))}),e.jsxs("span",{className:"flex items-center",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),M(i.duration_ms)]}),e.jsx(m,{className:O(i.source),children:T(i.source)})]})]})})]})})]})}export{Fe as component};