cc-viewer 1.6.110 → 1.6.112

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 (60) hide show
  1. package/dist/assets/App-DVxX6m37.js +39 -0
  2. package/dist/assets/{AppHeader.module-BqUDDV4r.js → AppHeader.module-1ZVfPqWh.js} +50 -50
  3. package/dist/assets/Mobile-azmyXv2v.js +10 -0
  4. package/dist/assets/{_basePickBy-Cq8AScBD.js → _basePickBy-D4UFjZo2.js} +1 -1
  5. package/dist/assets/{_baseUniq-lcO0Ial9.js → _baseUniq-07_vyIey.js} +1 -1
  6. package/dist/assets/{arc-Qw8bGp9G.js → arc-DeGWSnN3.js} +1 -1
  7. package/dist/assets/{architectureDiagram-2XIMDMQ5-eqxyxKwd.js → architectureDiagram-2XIMDMQ5-DyQQbBc9.js} +1 -1
  8. package/dist/assets/{blockDiagram-WCTKOSBZ-DuWzY-Pj.js → blockDiagram-WCTKOSBZ-qTYnRNH-.js} +1 -1
  9. package/dist/assets/{c4Diagram-IC4MRINW-BoUyFGh8.js → c4Diagram-IC4MRINW-DObDEPwR.js} +1 -1
  10. package/dist/assets/channel-DJixG6uY.js +1 -0
  11. package/dist/assets/{chunk-4BX2VUAB-gCI4jvG2.js → chunk-4BX2VUAB-Djr68SEE.js} +1 -1
  12. package/dist/assets/{chunk-55IACEB6-B0LTmeqt.js → chunk-55IACEB6-B_HEud9l.js} +1 -1
  13. package/dist/assets/{chunk-FMBD7UC4-BJCx4Xju.js → chunk-FMBD7UC4-CyG8nlfa.js} +1 -1
  14. package/dist/assets/{chunk-JSJVCQXG-DU48_nnF.js → chunk-JSJVCQXG-D3bFI4OQ.js} +1 -1
  15. package/dist/assets/{chunk-KX2RTZJC-C4kaJAhA.js → chunk-KX2RTZJC-DOonEo-V.js} +1 -1
  16. package/dist/assets/{chunk-NQ4KR5QH-BTIwR8K2.js → chunk-NQ4KR5QH-BkMD2jCF.js} +1 -1
  17. package/dist/assets/{chunk-QZHKN3VN-hyF0IWfq.js → chunk-QZHKN3VN-ClWf16r-.js} +1 -1
  18. package/dist/assets/{chunk-WL4C6EOR-CQPlxMDM.js → chunk-WL4C6EOR-DCZxpN8F.js} +1 -1
  19. package/dist/assets/classDiagram-VBA2DB6C-Dh7GkTdY.js +1 -0
  20. package/dist/assets/classDiagram-v2-RAHNMMFH-Dh7GkTdY.js +1 -0
  21. package/dist/assets/clone-DJ-32A9K.js +1 -0
  22. package/dist/assets/{cose-bilkent-S5V4N54A-BCqy6VVH.js → cose-bilkent-S5V4N54A-BaOURhaP.js} +1 -1
  23. package/dist/assets/{dagre-KLK3FWXG-BBblP_VG.js → dagre-KLK3FWXG-CI6Qeq1v.js} +1 -1
  24. package/dist/assets/{diagram-E7M64L7V-B-T_Y7LR.js → diagram-E7M64L7V-DtBET-xM.js} +1 -1
  25. package/dist/assets/{diagram-IFDJBPK2-BaTnJ2He.js → diagram-IFDJBPK2-C1lKRJHf.js} +1 -1
  26. package/dist/assets/{diagram-P4PSJMXO-BneNnlq0.js → diagram-P4PSJMXO-Dj2XO6ES.js} +1 -1
  27. package/dist/assets/{erDiagram-INFDFZHY-DWlrSRpV.js → erDiagram-INFDFZHY-NNFbRg6t.js} +1 -1
  28. package/dist/assets/{flowDiagram-PKNHOUZH-CiJDScLg.js → flowDiagram-PKNHOUZH-DJ7NZQjt.js} +1 -1
  29. package/dist/assets/{ganttDiagram-A5KZAMGK-BZhcC_Pw.js → ganttDiagram-A5KZAMGK-8v_TiCCa.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-K3NZZRJ6-WV6W7TGZ.js → gitGraphDiagram-K3NZZRJ6-go-oRzV2.js} +1 -1
  31. package/dist/assets/{graph-BGjQi_mi.js → graph-C31Sazs0.js} +1 -1
  32. package/dist/assets/{index-C2IvyW2h.js → index-B1FzBIb2.js} +2 -2
  33. package/dist/assets/{infoDiagram-LFFYTUFH-BPyNdV8W.js → infoDiagram-LFFYTUFH-DWU2q6Ap.js} +1 -1
  34. package/dist/assets/{ishikawaDiagram-PHBUUO56-vFHZq5Qo.js → ishikawaDiagram-PHBUUO56-DcQYi5bF.js} +1 -1
  35. package/dist/assets/{journeyDiagram-4ABVD52K-CrZkIx-J.js → journeyDiagram-4ABVD52K-BiPbAl09.js} +1 -1
  36. package/dist/assets/{kanban-definition-K7BYSVSG-C2SyUhEX.js → kanban-definition-K7BYSVSG-CFkKXIxT.js} +1 -1
  37. package/dist/assets/{layout-DNSK3yH4.js → layout-DvNOTp2g.js} +1 -1
  38. package/dist/assets/{linear-B4uuXUpd.js → linear-zSlsMBc8.js} +1 -1
  39. package/dist/assets/{mermaid.core-DCQdPyWp.js → mermaid.core-DgFRVf7o.js} +4 -4
  40. package/dist/assets/{mindmap-definition-YRQLILUH-BOvpcga4.js → mindmap-definition-YRQLILUH-JTA7ITgi.js} +1 -1
  41. package/dist/assets/{pieDiagram-SKSYHLDU-B5nyZJi0.js → pieDiagram-SKSYHLDU-D9yoGAr2.js} +1 -1
  42. package/dist/assets/{quadrantDiagram-337W2JSQ-D1Bv6cBQ.js → quadrantDiagram-337W2JSQ-opzoCL8H.js} +1 -1
  43. package/dist/assets/{requirementDiagram-Z7DCOOCP-DVSsTNei.js → requirementDiagram-Z7DCOOCP-BFy28Mfi.js} +1 -1
  44. package/dist/assets/{sankeyDiagram-WA2Y5GQK-C1A6MkHr.js → sankeyDiagram-WA2Y5GQK-sko5w5wy.js} +1 -1
  45. package/dist/assets/{sequenceDiagram-2WXFIKYE-BueicL8T.js → sequenceDiagram-2WXFIKYE-S1E5xyWG.js} +1 -1
  46. package/dist/assets/{stateDiagram-RAJIS63D-D90uMf9a.js → stateDiagram-RAJIS63D-OhgDm6KK.js} +1 -1
  47. package/dist/assets/stateDiagram-v2-FVOUBMTO-BwQiA1UM.js +1 -0
  48. package/dist/assets/{timeline-definition-YZTLITO2-D_CuZyuK.js → timeline-definition-YZTLITO2-DcGCxJng.js} +1 -1
  49. package/dist/assets/{treemap-KZPCXAKY-ntNogJ7R.js → treemap-KZPCXAKY-DxkAy74s.js} +1 -1
  50. package/dist/assets/{vennDiagram-LZ73GAT5-DgFnhmrL.js → vennDiagram-LZ73GAT5-Bvp6bOHT.js} +1 -1
  51. package/dist/assets/{xychartDiagram-JWTSCODW-D-4JL-SJ.js → xychartDiagram-JWTSCODW-mbJvC1Eu.js} +1 -1
  52. package/dist/index.html +1 -1
  53. package/package.json +1 -1
  54. package/dist/assets/App-CwzDs8sx.js +0 -39
  55. package/dist/assets/Mobile-B2O4m2FO.js +0 -10
  56. package/dist/assets/channel-VYVJYVX0.js +0 -1
  57. package/dist/assets/classDiagram-VBA2DB6C-BcvUGXW5.js +0 -1
  58. package/dist/assets/classDiagram-v2-RAHNMMFH-BcvUGXW5.js +0 -1
  59. package/dist/assets/clone-CQpjavLQ.js +0 -1
  60. package/dist/assets/stateDiagram-v2-FVOUBMTO-BLWNKrxk.js +0 -1
@@ -0,0 +1,39 @@
1
+ var Ts=Object.defineProperty;var Ms=(n,s,t)=>s in n?Ts(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var D=(n,s,t)=>Ms(n,typeof s!="symbol"?s+"":s,t);import{r as j,R as W,j as e,a as Es}from"./index-B1FzBIb2.js";import{M as Rs,N as Is,_ as te,c as se,P as dt,Q as Ls,U as ht,d as Nt,V as ye,W as _t,X as lt,Y as St,Z as Ps,$ as vt,a0 as As,a1 as kt,a2 as Bs,g as Ds,m as Os,u as Fe,a3 as Fs,a4 as $s,a5 as Hs,a6 as zs,a7 as Vs,a8 as Us,a9 as qs,aa as wt,C as jt,I as ue,ab as Ws,ac as Kt,ad as Ks,ae as Gt,af as Gs,ag as Js,ah as Qs,e as ie,t as p,q as qe,v as Ys,w as Se,f as Xs,h as Zs,j as ea,s as c,o as G,n as oe,ai as Jt,aj as He,ak as J,H as Ue,al as $e,k as ta,am as sa,l as We,an as aa,ao as Ne,S as Qt,B as F,ap as na,aq as la,ar as ze,as as ia,at as pe,au as Tt,av as Me,J as oa,aw as Yt,G as Ee,ax as Ke,D as ut,ay as Mt,E as mt,az as ra,O as Xt,aA as ca,aB as da,aC as ha,aD as Ie,aE as Et,aF as ua,aG as Rt,aH as Zt,aI as es,aJ as Le,aK as Pe,aL as ts,aM as it,aN as It,aO as Lt,aP as Pt,aQ as ma,aR as pa,A as ga,aS as Ge,aT as At,aU as fa,y as xa,x as R,z as ya,aV as va}from"./AppHeader.module-1ZVfPqWh.js";var Bt=j.createContext(null),ss=j.createContext({}),ja=["prefixCls","className","containerRef"],Ca=function(s){var t=s.prefixCls,a=s.className,d=s.containerRef,l=Rs(s,ja),u=j.useContext(ss),g=u.panel,i=Is(g,d);return j.createElement("div",te({className:se("".concat(t,"-content"),a),role:"dialog",ref:i},dt(s,{aria:!0}),{"aria-modal":"true"},l))};function Dt(n){return typeof n=="string"&&String(Number(n))===n?(Ls(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(n)):n}var Ot={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function ba(n,s){var t,a,d,l=n.prefixCls,u=n.open,g=n.placement,i=n.inline,h=n.push,o=n.forceRender,r=n.autoFocus,m=n.keyboard,v=n.classNames,x=n.rootClassName,f=n.rootStyle,y=n.zIndex,C=n.className,k=n.id,N=n.style,b=n.motion,T=n.width,E=n.height,L=n.children,I=n.mask,M=n.maskClosable,B=n.maskMotion,O=n.maskClassName,ae=n.maskStyle,ne=n.afterOpenChange,P=n.onClose,X=n.onMouseEnter,re=n.onMouseOver,ee=n.onMouseLeave,me=n.onClick,ve=n.onKeyDown,ge=n.onKeyUp,K=n.styles,fe=n.drawerRender,_=j.useRef(),z=j.useRef(),ce=j.useRef();j.useImperativeHandle(s,function(){return _.current});var _e=function(de){var Be=de.keyCode,De=de.shiftKey;switch(Be){case lt.TAB:{if(Be===lt.TAB){if(!De&&document.activeElement===ce.current){var Oe;(Oe=z.current)===null||Oe===void 0||Oe.focus({preventScroll:!0})}else if(De&&document.activeElement===z.current){var nt;(nt=ce.current)===null||nt===void 0||nt.focus({preventScroll:!0})}}break}case lt.ESC:{P&&m&&(de.stopPropagation(),P(de));break}}};j.useEffect(function(){if(u&&r){var Y;(Y=_.current)===null||Y===void 0||Y.focus({preventScroll:!0})}},[u]);var ke=j.useState(!1),we=ht(ke,2),je=we[0],xe=we[1],V=j.useContext(Bt),Z;typeof h=="boolean"?Z=h?{}:{distance:0}:Z=h||{};var q=(t=(a=(d=Z)===null||d===void 0?void 0:d.distance)!==null&&a!==void 0?a:V==null?void 0:V.pushDistance)!==null&&t!==void 0?t:180,U=j.useMemo(function(){return{pushDistance:q,push:function(){xe(!0)},pull:function(){xe(!1)}}},[q]);j.useEffect(function(){if(u){var Y;V==null||(Y=V.push)===null||Y===void 0||Y.call(V)}else{var de;V==null||(de=V.pull)===null||de===void 0||de.call(V)}},[u]),j.useEffect(function(){return function(){var Y;V==null||(Y=V.pull)===null||Y===void 0||Y.call(V)}},[]);var le=j.createElement(Nt,te({key:"mask"},B,{visible:I&&u}),function(Y,de){var Be=Y.className,De=Y.style;return j.createElement("div",{className:se("".concat(l,"-mask"),Be,v==null?void 0:v.mask,O),style:ye(ye(ye({},De),ae),K==null?void 0:K.mask),onClick:M&&u?P:void 0,ref:de})}),Ce=typeof b=="function"?b(g):b,be={};if(je&&q)switch(g){case"top":be.transform="translateY(".concat(q,"px)");break;case"bottom":be.transform="translateY(".concat(-q,"px)");break;case"left":be.transform="translateX(".concat(q,"px)");break;default:be.transform="translateX(".concat(-q,"px)");break}g==="left"||g==="right"?be.width=Dt(T):be.height=Dt(E);var ks={onMouseEnter:X,onMouseOver:re,onMouseLeave:ee,onClick:me,onKeyDown:ve,onKeyUp:ge},ws=j.createElement(Nt,te({key:"panel"},Ce,{visible:u,forceRender:o,onVisibleChanged:function(de){ne==null||ne(de)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),function(Y,de){var Be=Y.className,De=Y.style,Oe=j.createElement(Ca,te({id:k,containerRef:de,prefixCls:l,className:se(C,v==null?void 0:v.content),style:ye(ye({},N),K==null?void 0:K.content)},dt(n,{aria:!0}),ks),L);return j.createElement("div",te({className:se("".concat(l,"-content-wrapper"),v==null?void 0:v.wrapper,Be),style:ye(ye(ye({},be),De),K==null?void 0:K.wrapper)},dt(n,{data:!0})),fe?fe(Oe):Oe)}),bt=ye({},f);return y&&(bt.zIndex=y),j.createElement(Bt.Provider,{value:U},j.createElement("div",{className:se(l,"".concat(l,"-").concat(g),x,_t(_t({},"".concat(l,"-open"),u),"".concat(l,"-inline"),i)),style:bt,tabIndex:-1,ref:_,onKeyDown:_e},le,j.createElement("div",{tabIndex:0,ref:z,style:Ot,"aria-hidden":"true","data-sentinel":"start"}),ws,j.createElement("div",{tabIndex:0,ref:ce,style:Ot,"aria-hidden":"true","data-sentinel":"end"})))}var Na=j.forwardRef(ba),_a=function(s){var t=s.open,a=t===void 0?!1:t,d=s.prefixCls,l=d===void 0?"rc-drawer":d,u=s.placement,g=u===void 0?"right":u,i=s.autoFocus,h=i===void 0?!0:i,o=s.keyboard,r=o===void 0?!0:o,m=s.width,v=m===void 0?378:m,x=s.mask,f=x===void 0?!0:x,y=s.maskClosable,C=y===void 0?!0:y,k=s.getContainer,N=s.forceRender,b=s.afterOpenChange,T=s.destroyOnClose,E=s.onMouseEnter,L=s.onMouseOver,I=s.onMouseLeave,M=s.onClick,B=s.onKeyDown,O=s.onKeyUp,ae=s.panelRef,ne=j.useState(!1),P=ht(ne,2),X=P[0],re=P[1],ee=j.useState(!1),me=ht(ee,2),ve=me[0],ge=me[1];St(function(){ge(!0)},[]);var K=ve?a:!1,fe=j.useRef(),_=j.useRef();St(function(){K&&(_.current=document.activeElement)},[K]);var z=function(je){var xe;if(re(je),b==null||b(je),!je&&_.current&&!((xe=fe.current)!==null&&xe!==void 0&&xe.contains(_.current))){var V;(V=_.current)===null||V===void 0||V.focus({preventScroll:!0})}},ce=j.useMemo(function(){return{panel:ae}},[ae]);if(!N&&!X&&!K&&T)return null;var _e={onMouseEnter:E,onMouseOver:L,onMouseLeave:I,onClick:M,onKeyDown:B,onKeyUp:O},ke=ye(ye({},s),{},{open:K,prefixCls:l,placement:g,autoFocus:h,keyboard:r,width:v,mask:f,maskClosable:C,inline:k===!1,afterOpenChange:z,ref:fe},_e);return j.createElement(ss.Provider,{value:ce},j.createElement(Ps,{open:K||N||X,autoDestroy:!1,getContainer:k,autoLock:f&&(K||X)},j.createElement(Na,ke)))};const as=n=>{var s,t;const{prefixCls:a,ariaId:d,title:l,footer:u,extra:g,closable:i,loading:h,onClose:o,headerStyle:r,bodyStyle:m,footerStyle:v,children:x,classNames:f,styles:y}=n,C=vt("drawer");let k;i===!1?k=void 0:i===void 0||i===!0?k="start":k=(i==null?void 0:i.placement)==="end"?"end":"start";const N=j.useCallback(I=>j.createElement("button",{type:"button",onClick:o,className:se(`${a}-close`,{[`${a}-close-${k}`]:k==="end"})},I),[o,a,k]),[b,T]=As(kt(n),kt(C),{closable:!0,closeIconRender:N}),E=()=>{var I,M;return!l&&!b?null:j.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(I=C.styles)===null||I===void 0?void 0:I.header),r),y==null?void 0:y.header),className:se(`${a}-header`,{[`${a}-header-close-only`]:b&&!l&&!g},(M=C.classNames)===null||M===void 0?void 0:M.header,f==null?void 0:f.header)},j.createElement("div",{className:`${a}-header-title`},k==="start"&&T,l&&j.createElement("div",{className:`${a}-title`,id:d},l)),g&&j.createElement("div",{className:`${a}-extra`},g),k==="end"&&T)},L=()=>{var I,M;if(!u)return null;const B=`${a}-footer`;return j.createElement("div",{className:se(B,(I=C.classNames)===null||I===void 0?void 0:I.footer,f==null?void 0:f.footer),style:Object.assign(Object.assign(Object.assign({},(M=C.styles)===null||M===void 0?void 0:M.footer),v),y==null?void 0:y.footer)},u)};return j.createElement(j.Fragment,null,E(),j.createElement("div",{className:se(`${a}-body`,f==null?void 0:f.body,(s=C.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=C.styles)===null||t===void 0?void 0:t.body),m),y==null?void 0:y.body)},h?j.createElement(Bs,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):x),L())},Sa=n=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[n]},ns=(n,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},n),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":n})}),ls=(n,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},ns({opacity:n},{opacity:1})),ka=(n,s)=>[ls(.7,s),ns({transform:Sa(n)},{transform:"none"})],wa=n=>{const{componentCls:s,motionDurationSlow:t}=n;return{[s]:{[`${s}-mask-motion`]:ls(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((a,d)=>Object.assign(Object.assign({},a),{[`&-${d}`]:ka(d,t)}),{})}}},Ta=n=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:a,colorBgMask:d,colorBgElevated:l,motionDurationSlow:u,motionDurationMid:g,paddingXS:i,padding:h,paddingLG:o,fontSizeLG:r,lineHeightLG:m,lineWidth:v,lineType:x,colorSplit:f,marginXS:y,colorIcon:C,colorIconHover:k,colorBgTextHover:N,colorBgTextActive:b,colorText:T,fontWeightStrong:E,footerPaddingBlock:L,footerPaddingInline:I,calc:M}=n,B=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:a,pointerEvents:"none",color:T,"&-pure":{position:"relative",background:l,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:n.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:n.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:n.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:n.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:a,background:d,pointerEvents:"auto"},[B]:{position:"absolute",zIndex:a,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${B}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:n.boxShadowDrawerLeft},[`&-right > ${B}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:n.boxShadowDrawerRight},[`&-top > ${B}`]:{top:0,insetInline:0,boxShadow:n.boxShadowDrawerUp},[`&-bottom > ${B}`]:{bottom:0,insetInline:0,boxShadow:n.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:l,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Fe(h)} ${Fe(o)}`,fontSize:r,lineHeight:m,borderBottom:`${Fe(v)} ${x} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:M(r).add(i).equal(),height:M(r).add(i).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:C,fontWeight:E,fontSize:r,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${g}`,textRendering:"auto",[`&${t}-close-end`]:{marginInlineStart:y},[`&:not(${t}-close-end)`]:{marginInlineEnd:y},"&:hover":{color:k,backgroundColor:N,textDecoration:"none"},"&:active":{backgroundColor:b}},Fs(n)),[`${t}-title`]:{flex:1,margin:0,fontWeight:n.fontWeightStrong,fontSize:r,lineHeight:m},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:o,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${Fe(L)} ${Fe(I)}`,borderTop:`${Fe(v)} ${x} ${f}`},"&-rtl":{direction:"rtl"}}}},Ma=n=>({zIndexPopup:n.zIndexPopupBase,footerPaddingBlock:n.paddingXS,footerPaddingInline:n.padding}),is=Ds("Drawer",n=>{const s=Os(n,{});return[Ta(s),wa(s)]},Ma);var os=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,a=Object.getOwnPropertySymbols(n);d<a.length;d++)s.indexOf(a[d])<0&&Object.prototype.propertyIsEnumerable.call(n,a[d])&&(t[a[d]]=n[a[d]]);return t};const Ea={distance:180},Je=n=>{const{rootClassName:s,width:t,height:a,size:d="default",mask:l=!0,push:u=Ea,open:g,afterOpenChange:i,onClose:h,prefixCls:o,getContainer:r,panelRef:m=null,style:v,className:x,"aria-labelledby":f,visible:y,afterVisibleChange:C,maskStyle:k,drawerStyle:N,contentWrapperStyle:b,destroyOnClose:T,destroyOnHidden:E}=n,L=os(n,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),I=$s(),M=L.title?I:void 0,{getPopupContainer:B,getPrefixCls:O,direction:ae,className:ne,style:P,classNames:X,styles:re}=vt("drawer"),ee=O("drawer",o),[me,ve,ge]=is(ee),K=r===void 0&&B?()=>B(document.body):r,fe=se({"no-mask":!l,[`${ee}-rtl`]:ae==="rtl"},s,ve,ge),_=j.useMemo(()=>t??(d==="large"?736:378),[t,d]),z=j.useMemo(()=>a??(d==="large"?736:378),[a,d]),ce={motionName:wt(ee,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},_e=q=>({motionName:wt(ee,`panel-motion-${q}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),ke=Hs(),we=zs(m,ke),[je,xe]=Vs("Drawer",L.zIndex),{classNames:V={},styles:Z={}}=L;return me(j.createElement(Us,{form:!0,space:!0},j.createElement(qs.Provider,{value:xe},j.createElement(_a,Object.assign({prefixCls:ee,onClose:h,maskMotion:ce,motion:_e},L,{classNames:{mask:se(V.mask,X.mask),content:se(V.content,X.content),wrapper:se(V.wrapper,X.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},Z.mask),k),re.mask),content:Object.assign(Object.assign(Object.assign({},Z.content),N),re.content),wrapper:Object.assign(Object.assign(Object.assign({},Z.wrapper),b),re.wrapper)},open:g??y,mask:l,push:u,width:_,height:z,style:Object.assign(Object.assign({},P),v),className:se(ne,x),rootClassName:fe,getContainer:K,afterOpenChange:i??C,panelRef:we,zIndex:je,"aria-labelledby":f??M,destroyOnClose:E??T}),j.createElement(as,Object.assign({prefixCls:ee},L,{ariaId:M,onClose:h}))))))},Ra=n=>{const{prefixCls:s,style:t,className:a,placement:d="right"}=n,l=os(n,["prefixCls","style","className","placement"]),{getPrefixCls:u}=j.useContext(jt),g=u("drawer",s),[i,h,o]=is(g),r=se(g,`${g}-pure`,`${g}-${d}`,h,o,a);return i(j.createElement("div",{className:r,style:t},j.createElement(as,Object.assign({prefixCls:g},l))))};Je._InternalPanelDoNotUseOrYouWillBeFired=Ra;var Ia={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},La=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:Ia}))},Qe=j.forwardRef(La),Pa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},Aa=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:Pa}))},Ft=j.forwardRef(Aa);function Ba(n,s,t){return typeof t=="boolean"?t:n.length?!0:Ws(s).some(d=>d.type===Kt)}var rs=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,a=Object.getOwnPropertySymbols(n);d<a.length;d++)s.indexOf(a[d])<0&&Object.prototype.propertyIsEnumerable.call(n,a[d])&&(t[a[d]]=n[a[d]]);return t};function at({suffixCls:n,tagName:s,displayName:t}){return a=>j.forwardRef((l,u)=>j.createElement(a,Object.assign({ref:u,suffixCls:n,tagName:s},l)))}const Ct=j.forwardRef((n,s)=>{const{prefixCls:t,suffixCls:a,className:d,tagName:l}=n,u=rs(n,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:g}=j.useContext(jt),i=g("layout",t),[h,o,r]=Gt(i),m=a?`${i}-${a}`:i;return h(j.createElement(l,Object.assign({className:se(t||m,d,o,r),ref:s},u)))}),Da=j.forwardRef((n,s)=>{const{direction:t}=j.useContext(jt),[a,d]=j.useState([]),{prefixCls:l,className:u,rootClassName:g,children:i,hasSider:h,tagName:o,style:r}=n,m=rs(n,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),v=Ks(m,["suffixCls"]),{getPrefixCls:x,className:f,style:y}=vt("layout"),C=x("layout",l),k=Ba(a,i,h),[N,b,T]=Gt(C),E=se(C,{[`${C}-has-sider`]:k,[`${C}-rtl`]:t==="rtl"},f,u,g,b,T),L=j.useMemo(()=>({siderHook:{addSider:I=>{d(M=>[].concat(Gs(M),[I]))},removeSider:I=>{d(M=>M.filter(B=>B!==I))}}}),[]);return N(j.createElement(Js.Provider,{value:L},j.createElement(o,Object.assign({ref:s,className:E,style:Object.assign(Object.assign({},y),r)},v),i)))}),Oa=at({tagName:"div",displayName:"Layout"})(Da),Fa=at({suffixCls:"header",tagName:"header",displayName:"Header"})(Ct),$a=at({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(Ct),Ha=at({suffixCls:"content",tagName:"main",displayName:"Content"})(Ct),Te=Oa;Te.Header=Fa;Te.Footer=$a;Te.Content=Ha;Te.Sider=Kt;Te._InternalSiderContext=Qs;var za={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},Va=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:za}))},$t=j.forwardRef(Va),Ua={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},qa=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:Ua}))},Ht=j.forwardRef(qa),Wa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},Ka=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:Wa}))},zt=j.forwardRef(Ka),Ga={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},Ja=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:Ga}))},Ye=j.forwardRef(Ja),Qa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z"}}]},name:"dashboard",theme:"outlined"},Ya=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:Qa}))},ot=j.forwardRef(Ya),Xa={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},Za=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:Xa}))},en=j.forwardRef(Za),tn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},sn=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:tn}))},an=j.forwardRef(sn),nn={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},ln=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:nn}))},Vt=j.forwardRef(ln),on={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"},rn=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:on}))},cn=j.forwardRef(rn),dn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},hn=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:dn}))},Ut=j.forwardRef(hn),un={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},mn=function(s,t){return j.createElement(ue,te({},s,{ref:t,icon:un}))},qt=j.forwardRef(mn),pn=Object.defineProperty,Xe=Object.getOwnPropertySymbols,cs=Object.prototype.hasOwnProperty,ds=Object.prototype.propertyIsEnumerable,Wt=(n,s,t)=>s in n?pn(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t,pt=(n,s)=>{for(var t in s||(s={}))cs.call(s,t)&&Wt(n,t,s[t]);if(Xe)for(var t of Xe(s))ds.call(s,t)&&Wt(n,t,s[t]);return n},gt=(n,s)=>{var t={};for(var a in n)cs.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&Xe)for(var a of Xe(n))s.indexOf(a)<0&&ds.call(n,a)&&(t[a]=n[a]);return t};/**
2
+ * @license QR Code generator library (TypeScript)
3
+ * Copyright (c) Project Nayuki.
4
+ * SPDX-License-Identifier: MIT
5
+ */var Ae;(n=>{const s=class A{constructor(i,h,o,r){if(this.version=i,this.errorCorrectionLevel=h,this.modules=[],this.isFunction=[],i<A.MIN_VERSION||i>A.MAX_VERSION)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=i*4+17;let m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const v=this.addEccAndInterleave(o);if(this.drawCodewords(v),r==-1){let x=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);const y=this.getPenaltyScore();y<x&&(r=f,x=y),this.applyMask(f)}}d(0<=r&&r<=7),this.mask=r,this.applyMask(r),this.drawFormatBits(r),this.isFunction=[]}static encodeText(i,h){const o=n.QrSegment.makeSegments(i);return A.encodeSegments(o,h)}static encodeBinary(i,h){const o=n.QrSegment.makeBytes(i);return A.encodeSegments([o],h)}static encodeSegments(i,h,o=1,r=40,m=-1,v=!0){if(!(A.MIN_VERSION<=o&&o<=r&&r<=A.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,f;for(x=o;;x++){const N=A.getNumDataCodewords(x,h)*8,b=u.getTotalBits(i,x);if(b<=N){f=b;break}if(x>=r)throw new RangeError("Data too long")}for(const N of[A.Ecc.MEDIUM,A.Ecc.QUARTILE,A.Ecc.HIGH])v&&f<=A.getNumDataCodewords(x,N)*8&&(h=N);let y=[];for(const N of i){t(N.mode.modeBits,4,y),t(N.numChars,N.mode.numCharCountBits(x),y);for(const b of N.getData())y.push(b)}d(y.length==f);const C=A.getNumDataCodewords(x,h)*8;d(y.length<=C),t(0,Math.min(4,C-y.length),y),t(0,(8-y.length%8)%8,y),d(y.length%8==0);for(let N=236;y.length<C;N^=253)t(N,8,y);let k=[];for(;k.length*8<y.length;)k.push(0);return y.forEach((N,b)=>k[b>>>3]|=N<<7-(b&7)),new A(x,h,k,m)}getModule(i,h){return 0<=i&&i<this.size&&0<=h&&h<this.size&&this.modules[h][i]}getModules(){return this.modules}drawFunctionPatterns(){for(let o=0;o<this.size;o++)this.setFunctionModule(6,o,o%2==0),this.setFunctionModule(o,6,o%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const i=this.getAlignmentPatternPositions(),h=i.length;for(let o=0;o<h;o++)for(let r=0;r<h;r++)o==0&&r==0||o==0&&r==h-1||o==h-1&&r==0||this.drawAlignmentPattern(i[o],i[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const h=this.errorCorrectionLevel.formatBits<<3|i;let o=h;for(let m=0;m<10;m++)o=o<<1^(o>>>9)*1335;const r=(h<<10|o)^21522;d(r>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,a(r,m));this.setFunctionModule(8,7,a(r,6)),this.setFunctionModule(8,8,a(r,7)),this.setFunctionModule(7,8,a(r,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,a(r,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,a(r,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,a(r,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let o=0;o<12;o++)i=i<<1^(i>>>11)*7973;const h=this.version<<12|i;d(h>>>18==0);for(let o=0;o<18;o++){const r=a(h,o),m=this.size-11+o%3,v=Math.floor(o/3);this.setFunctionModule(m,v,r),this.setFunctionModule(v,m,r)}}drawFinderPattern(i,h){for(let o=-4;o<=4;o++)for(let r=-4;r<=4;r++){const m=Math.max(Math.abs(r),Math.abs(o)),v=i+r,x=h+o;0<=v&&v<this.size&&0<=x&&x<this.size&&this.setFunctionModule(v,x,m!=2&&m!=4)}}drawAlignmentPattern(i,h){for(let o=-2;o<=2;o++)for(let r=-2;r<=2;r++)this.setFunctionModule(i+r,h+o,Math.max(Math.abs(r),Math.abs(o))!=1)}setFunctionModule(i,h,o){this.modules[h][i]=o,this.isFunction[h][i]=!0}addEccAndInterleave(i){const h=this.version,o=this.errorCorrectionLevel;if(i.length!=A.getNumDataCodewords(h,o))throw new RangeError("Invalid argument");const r=A.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][h],m=A.ECC_CODEWORDS_PER_BLOCK[o.ordinal][h],v=Math.floor(A.getNumRawDataModules(h)/8),x=r-v%r,f=Math.floor(v/r);let y=[];const C=A.reedSolomonComputeDivisor(m);for(let N=0,b=0;N<r;N++){let T=i.slice(b,b+f-m+(N<x?0:1));b+=T.length;const E=A.reedSolomonComputeRemainder(T,C);N<x&&T.push(0),y.push(T.concat(E))}let k=[];for(let N=0;N<y[0].length;N++)y.forEach((b,T)=>{(N!=f-m||T>=x)&&k.push(b[N])});return d(k.length==v),k}drawCodewords(i){if(i.length!=Math.floor(A.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let h=0;for(let o=this.size-1;o>=1;o-=2){o==6&&(o=5);for(let r=0;r<this.size;r++)for(let m=0;m<2;m++){const v=o-m,f=(o+1&2)==0?this.size-1-r:r;!this.isFunction[f][v]&&h<i.length*8&&(this.modules[f][v]=a(i[h>>>3],7-(h&7)),h++)}}d(h==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let h=0;h<this.size;h++)for(let o=0;o<this.size;o++){let r;switch(i){case 0:r=(o+h)%2==0;break;case 1:r=h%2==0;break;case 2:r=o%3==0;break;case 3:r=(o+h)%3==0;break;case 4:r=(Math.floor(o/3)+Math.floor(h/2))%2==0;break;case 5:r=o*h%2+o*h%3==0;break;case 6:r=(o*h%2+o*h%3)%2==0;break;case 7:r=((o+h)%2+o*h%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[h][o]&&r&&(this.modules[h][o]=!this.modules[h][o])}}getPenaltyScore(){let i=0;for(let m=0;m<this.size;m++){let v=!1,x=0,f=[0,0,0,0,0,0,0];for(let y=0;y<this.size;y++)this.modules[m][y]==v?(x++,x==5?i+=A.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,f),v||(i+=this.finderPenaltyCountPatterns(f)*A.PENALTY_N3),v=this.modules[m][y],x=1);i+=this.finderPenaltyTerminateAndCount(v,x,f)*A.PENALTY_N3}for(let m=0;m<this.size;m++){let v=!1,x=0,f=[0,0,0,0,0,0,0];for(let y=0;y<this.size;y++)this.modules[y][m]==v?(x++,x==5?i+=A.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,f),v||(i+=this.finderPenaltyCountPatterns(f)*A.PENALTY_N3),v=this.modules[y][m],x=1);i+=this.finderPenaltyTerminateAndCount(v,x,f)*A.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let v=0;v<this.size-1;v++){const x=this.modules[m][v];x==this.modules[m][v+1]&&x==this.modules[m+1][v]&&x==this.modules[m+1][v+1]&&(i+=A.PENALTY_N2)}let h=0;for(const m of this.modules)h=m.reduce((v,x)=>v+(x?1:0),h);const o=this.size*this.size,r=Math.ceil(Math.abs(h*20-o*10)/o)-1;return d(0<=r&&r<=9),i+=r*A.PENALTY_N4,d(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{const i=Math.floor(this.version/7)+2,h=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2;let o=[6];for(let r=this.size-7;o.length<i;r-=h)o.splice(1,0,r);return o}}static getNumRawDataModules(i){if(i<A.MIN_VERSION||i>A.MAX_VERSION)throw new RangeError("Version number out of range");let h=(16*i+128)*i+64;if(i>=2){const o=Math.floor(i/7)+2;h-=(25*o-10)*o-55,i>=7&&(h-=36)}return d(208<=h&&h<=29648),h}static getNumDataCodewords(i,h){return Math.floor(A.getNumRawDataModules(i)/8)-A.ECC_CODEWORDS_PER_BLOCK[h.ordinal][i]*A.NUM_ERROR_CORRECTION_BLOCKS[h.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let h=[];for(let r=0;r<i-1;r++)h.push(0);h.push(1);let o=1;for(let r=0;r<i;r++){for(let m=0;m<h.length;m++)h[m]=A.reedSolomonMultiply(h[m],o),m+1<h.length&&(h[m]^=h[m+1]);o=A.reedSolomonMultiply(o,2)}return h}static reedSolomonComputeRemainder(i,h){let o=h.map(r=>0);for(const r of i){const m=r^o.shift();o.push(0),h.forEach((v,x)=>o[x]^=A.reedSolomonMultiply(v,m))}return o}static reedSolomonMultiply(i,h){if(i>>>8||h>>>8)throw new RangeError("Byte out of range");let o=0;for(let r=7;r>=0;r--)o=o<<1^(o>>>7)*285,o^=(h>>>r&1)*i;return d(o>>>8==0),o}finderPenaltyCountPatterns(i){const h=i[1];d(h<=this.size*3);const o=h>0&&i[2]==h&&i[3]==h*3&&i[4]==h&&i[5]==h;return(o&&i[0]>=h*4&&i[6]>=h?1:0)+(o&&i[6]>=h*4&&i[0]>=h?1:0)}finderPenaltyTerminateAndCount(i,h,o){return i&&(this.finderPenaltyAddHistory(h,o),h=0),h+=this.size,this.finderPenaltyAddHistory(h,o),this.finderPenaltyCountPatterns(o)}finderPenaltyAddHistory(i,h){h[0]==0&&(i+=this.size),h.pop(),h.unshift(i)}};s.MIN_VERSION=1,s.MAX_VERSION=40,s.PENALTY_N1=3,s.PENALTY_N2=3,s.PENALTY_N3=40,s.PENALTY_N4=10,s.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],s.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],n.QrCode=s;function t(g,i,h){if(i<0||i>31||g>>>i)throw new RangeError("Value out of range");for(let o=i-1;o>=0;o--)h.push(g>>>o&1)}function a(g,i){return(g>>>i&1)!=0}function d(g){if(!g)throw new Error("Assertion error")}const l=class Q{constructor(i,h,o){if(this.mode=i,this.numChars=h,this.bitData=o,h<0)throw new RangeError("Invalid argument");this.bitData=o.slice()}static makeBytes(i){let h=[];for(const o of i)t(o,8,h);return new Q(Q.Mode.BYTE,i.length,h)}static makeNumeric(i){if(!Q.isNumeric(i))throw new RangeError("String contains non-numeric characters");let h=[];for(let o=0;o<i.length;){const r=Math.min(i.length-o,3);t(parseInt(i.substring(o,o+r),10),r*3+1,h),o+=r}return new Q(Q.Mode.NUMERIC,i.length,h)}static makeAlphanumeric(i){if(!Q.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let h=[],o;for(o=0;o+2<=i.length;o+=2){let r=Q.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o))*45;r+=Q.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o+1)),t(r,11,h)}return o<i.length&&t(Q.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o)),6,h),new Q(Q.Mode.ALPHANUMERIC,i.length,h)}static makeSegments(i){return i==""?[]:Q.isNumeric(i)?[Q.makeNumeric(i)]:Q.isAlphanumeric(i)?[Q.makeAlphanumeric(i)]:[Q.makeBytes(Q.toUtf8ByteArray(i))]}static makeEci(i){let h=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)t(i,8,h);else if(i<16384)t(2,2,h),t(i,14,h);else if(i<1e6)t(6,3,h),t(i,21,h);else throw new RangeError("ECI assignment value out of range");return new Q(Q.Mode.ECI,0,h)}static isNumeric(i){return Q.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return Q.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,h){let o=0;for(const r of i){const m=r.mode.numCharCountBits(h);if(r.numChars>=1<<m)return 1/0;o+=4+m+r.bitData.length}return o}static toUtf8ByteArray(i){i=encodeURI(i);let h=[];for(let o=0;o<i.length;o++)i.charAt(o)!="%"?h.push(i.charCodeAt(o)):(h.push(parseInt(i.substring(o+1,o+3),16)),o+=2);return h}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let u=l;n.QrSegment=l})(Ae||(Ae={}));(n=>{(s=>{const t=class{constructor(d,l){this.ordinal=d,this.formatBits=l}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),s.Ecc=t})(n.QrCode||(n.QrCode={}))})(Ae||(Ae={}));(n=>{(s=>{const t=class{constructor(d,l){this.modeBits=d,this.numBitsCharCount=l}numCharCountBits(d){return this.numBitsCharCount[Math.floor((d+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),s.Mode=t})(n.QrSegment||(n.QrSegment={}))})(Ae||(Ae={}));var Ve=Ae;/**
6
+ * @license qrcode.react
7
+ * Copyright (c) Paul O'Shannessy
8
+ * SPDX-License-Identifier: ISC
9
+ */var gn={L:Ve.QrCode.Ecc.LOW,M:Ve.QrCode.Ecc.MEDIUM,Q:Ve.QrCode.Ecc.QUARTILE,H:Ve.QrCode.Ecc.HIGH},hs=128,us="L",ms="#FFFFFF",ps="#000000",gs=!1,fs=1,fn=4,xn=0,yn=.1;function xs(n,s=0){const t=[];return n.forEach(function(a,d){let l=null;a.forEach(function(u,g){if(!u&&l!==null){t.push(`M${l+s} ${d+s}h${g-l}v1H${l+s}z`),l=null;return}if(g===a.length-1){if(!u)return;l===null?t.push(`M${g+s},${d+s} h1v1H${g+s}z`):t.push(`M${l+s},${d+s} h${g+1-l}v1H${l+s}z`);return}u&&l===null&&(l=g)})}),t.join("")}function ys(n,s){return n.slice().map((t,a)=>a<s.y||a>=s.y+s.h?t:t.map((d,l)=>l<s.x||l>=s.x+s.w?d:!1))}function vn(n,s,t,a){if(a==null)return null;const d=n.length+t*2,l=Math.floor(s*yn),u=d/s,g=(a.width||l)*u,i=(a.height||l)*u,h=a.x==null?n.length/2-g/2:a.x*u,o=a.y==null?n.length/2-i/2:a.y*u,r=a.opacity==null?1:a.opacity;let m=null;if(a.excavate){let x=Math.floor(h),f=Math.floor(o),y=Math.ceil(g+h-x),C=Math.ceil(i+o-f);m={x,y:f,w:y,h:C}}const v=a.crossOrigin;return{x:h,y:o,h:i,w:g,excavation:m,opacity:r,crossOrigin:v}}function jn(n,s){return s!=null?Math.max(Math.floor(s),0):n?fn:xn}function vs({value:n,level:s,minVersion:t,includeMargin:a,marginSize:d,imageSettings:l,size:u,boostLevel:g}){let i=W.useMemo(()=>{const x=(Array.isArray(n)?n:[n]).reduce((f,y)=>(f.push(...Ve.QrSegment.makeSegments(y)),f),[]);return Ve.QrCode.encodeSegments(x,gn[s],t,void 0,void 0,g)},[n,s,t,g]);const{cells:h,margin:o,numCells:r,calculatedImageSettings:m}=W.useMemo(()=>{let v=i.getModules();const x=jn(a,d),f=v.length+x*2,y=vn(v,u,x,l);return{cells:v,margin:x,numCells:f,calculatedImageSettings:y}},[i,u,l,a,d]);return{qrcode:i,margin:o,cells:h,numCells:r,calculatedImageSettings:m}}var Cn=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),js=W.forwardRef(function(s,t){const a=s,{value:d,size:l=hs,level:u=us,bgColor:g=ms,fgColor:i=ps,includeMargin:h=gs,minVersion:o=fs,boostLevel:r,marginSize:m,imageSettings:v}=a,f=gt(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:y}=f,C=gt(f,["style"]),k=v==null?void 0:v.src,N=W.useRef(null),b=W.useRef(null),T=W.useCallback(P=>{N.current=P,typeof t=="function"?t(P):t&&(t.current=P)},[t]),[E,L]=W.useState(!1),{margin:I,cells:M,numCells:B,calculatedImageSettings:O}=vs({value:d,level:u,minVersion:o,boostLevel:r,includeMargin:h,marginSize:m,imageSettings:v,size:l});W.useEffect(()=>{if(N.current!=null){const P=N.current,X=P.getContext("2d");if(!X)return;let re=M;const ee=b.current,me=O!=null&&ee!==null&&ee.complete&&ee.naturalHeight!==0&&ee.naturalWidth!==0;me&&O.excavation!=null&&(re=ys(M,O.excavation));const ve=window.devicePixelRatio||1;P.height=P.width=l*ve;const ge=l/B*ve;X.scale(ge,ge),X.fillStyle=g,X.fillRect(0,0,B,B),X.fillStyle=i,Cn?X.fill(new Path2D(xs(re,I))):M.forEach(function(K,fe){K.forEach(function(_,z){_&&X.fillRect(z+I,fe+I,1,1)})}),O&&(X.globalAlpha=O.opacity),me&&X.drawImage(ee,O.x+I,O.y+I,O.w,O.h)}}),W.useEffect(()=>{L(!1)},[k]);const ae=pt({height:l,width:l},y);let ne=null;return k!=null&&(ne=W.createElement("img",{src:k,key:k,style:{display:"none"},onLoad:()=>{L(!0)},ref:b,crossOrigin:O==null?void 0:O.crossOrigin})),W.createElement(W.Fragment,null,W.createElement("canvas",pt({style:ae,height:l,width:l,ref:T,role:"img"},C)),ne)});js.displayName="QRCodeCanvas";var bn=W.forwardRef(function(s,t){const a=s,{value:d,size:l=hs,level:u=us,bgColor:g=ms,fgColor:i=ps,includeMargin:h=gs,minVersion:o=fs,boostLevel:r,title:m,marginSize:v,imageSettings:x}=a,f=gt(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:y,cells:C,numCells:k,calculatedImageSettings:N}=vs({value:d,level:u,minVersion:o,boostLevel:r,includeMargin:h,marginSize:v,imageSettings:x,size:l});let b=C,T=null;x!=null&&N!=null&&(N.excavation!=null&&(b=ys(C,N.excavation)),T=W.createElement("image",{href:x.src,height:N.h,width:N.w,x:N.x+y,y:N.y+y,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const E=xs(b,y);return W.createElement("svg",pt({height:l,width:l,viewBox:`0 0 ${k} ${k}`,ref:t,role:"img"},f),!!m&&W.createElement("title",null,m),W.createElement("path",{fill:g,d:`M0,0 h${k}v${k}H0z`,shapeRendering:"crispEdges"}),W.createElement("path",{fill:i,d:E,shapeRendering:"crispEdges"}),T)});bn.displayName="QRCodeSVG";const Nn=[{label:"Auto",value:"auto"},{label:"Opus 4.6 (1M)",value:"opus-4.6-1m",tokens:1e6},{label:"Sonnet 4.6",value:"sonnet-4.6",tokens:2e5},{label:"GLM5",value:"glm5",tokens:2e5},{label:"Kimi K2.5",value:"kimi-k2.5",tokens:2e5},{label:"MiniMax 2.1",value:"minimax-2.1",tokens:2e5},{label:"Qwen 3.5",value:"Qwen 3.5",tokens:2e5}],_n={calibrationModels:Nn},rt=_n.calibrationModels,Sn=[{value:"zh",short:"zh",label:"简体中文"},{value:"en",short:"en",label:"English"},{value:"zh-TW",short:"zh-TW",label:"繁體中文"},{value:"ko",short:"ko",label:"한국어"},{value:"ja",short:"ja",label:"日本語"},{value:"de",short:"de",label:"Deutsch"},{value:"es",short:"es",label:"Español"},{value:"fr",short:"fr",label:"Français"},{value:"it",short:"it",label:"Italiano"},{value:"da",short:"da",label:"Dansk"},{value:"pl",short:"pl",label:"Polski"},{value:"ru",short:"ru",label:"Русский"},{value:"ar",short:"ar",label:"العربية"},{value:"no",short:"no",label:"Norsk"},{value:"pt-BR",short:"pt-BR",label:"Português (Brasil)"},{value:"th",short:"th",label:"ไทย"},{value:"tr",short:"tr",label:"Türkçe"},{value:"uk",short:"uk",label:"Українська"}],kn=n=>{const s=t=>t.toUpperCase().split("").map(a=>String.fromCodePoint(127462+a.charCodeAt(0)-65)).join("");return!n||n.length!==2?s("CN"):s(n)},Re=class Re extends W.Component{constructor(t){super(t);D(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});D(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const a=[];for(const g of t){const i=[],h=g.timestamp?new Date(g.timestamp).toLocaleString():"";h&&i.push(`${h}:
10
+ `);const o=(g.segments||[]).filter(r=>r.type==="text").map(r=>r.content);o.length>0&&i.push(o.join(`
11
+ `)),a.push(i.join(`
12
+ `))}if(a.length===0)return;const d=new Blob([a.join(`
13
+
14
+
15
+
16
+ `)],{type:"text/plain;charset=utf-8"}),l=URL.createObjectURL(d),u=document.createElement("a");u.href=l,u.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,u.click(),URL.revokeObjectURL(l)});D(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});D(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(ie("/api/project-stats")).then(t=>{if(!t.ok)throw new Error("not found");return t.json()}).then(t=>this.setState({projectStats:t,projectStatsLoading:!1})).catch(()=>this.setState({projectStats:null,projectStatsLoading:!1}))});D(this,"fetchPlugins",()=>fetch(ie("/api/plugins")).then(t=>{if(!t.ok)throw new Error(t.status);return t.json()}).then(t=>{this.setState({pluginsList:t.plugins||[],pluginsDir:t.pluginsDir||""})}).catch(()=>{}));D(this,"handleShowPlugins",()=>{this.setState({pluginModalVisible:!0}),this.fetchPlugins()});D(this,"handleTogglePlugin",(t,a)=>{fetch(ie("/api/preferences")).then(d=>d.json()).then(d=>{let l=Array.isArray(d.disabledPlugins)?[...d.disabledPlugins]:[];return a?l=l.filter(u=>u!==t):l.includes(t)||l.push(t),fetch(ie("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:l})})}).then(()=>fetch(ie("/api/plugins/reload"),{method:"POST"})).then(d=>{if(!d.ok)throw new Error(d.status);return d.json()}).then(d=>{this.setState({pluginsList:d.plugins||[],pluginsDir:d.pluginsDir||""})}).catch(()=>{})});D(this,"handleDeletePlugin",(t,a)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:a}})});D(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(ie(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(a=>{if(!a.ok)throw new Error(a.status);return a.json()}).then(a=>{a.plugins&&this.setState({pluginsList:a.plugins,pluginsDir:a.pluginsDir||""})}).catch(()=>{}))});D(this,"handleReloadPlugins",()=>{fetch(ie("/api/plugins/reload"),{method:"POST"}).then(t=>{if(!t.ok)throw new Error(t.status);return t.json()}).then(t=>{this.setState({pluginsList:t.plugins||[],pluginsDir:t.pluginsDir||""})}).catch(()=>{})});D(this,"handleAddPlugin",()=>{const t=document.createElement("input");t.type="file",t.accept=".js,.mjs",t.multiple=!0,t.onchange=()=>{const a=t.files;if(!a||a.length===0)return;for(const l of a)if(!l.name.endsWith(".js")&&!l.name.endsWith(".mjs")){J.error(p("ui.plugins.invalidFile"));return}const d=Array.from(a).map(l=>new Promise((u,g)=>{const i=new FileReader;i.onload=()=>u({name:l.name,content:i.result}),i.onerror=()=>g(new Error(`Failed to read ${l.name}`)),i.readAsText(l)}));Promise.all(d).then(l=>fetch(ie("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:l})})).then(l=>l.ok?l.json():l.text().then(u=>{try{return JSON.parse(u)}catch{throw new Error(p("ui.plugins.serverError",{status:l.status}))}})).then(l=>{l.error?J.error(p("ui.plugins.addFailed",{reason:l.error})):l.plugins&&(this.setState({pluginsList:l.plugins,pluginsDir:l.pluginsDir||""}),J.success(p("ui.plugins.addSuccess")))}).catch(l=>{J.error(l.message)})},t.click()});D(this,"handleShowCdnModal",()=>{this.setState({cdnModalVisible:!0,cdnUrl:"",cdnLoading:!1})});D(this,"handleCdnUrlChange",t=>{this.setState({cdnUrl:t.target.value})});D(this,"handleCdnInstall",()=>{const{cdnUrl:t}=this.state;if(!t.trim()){J.error(p("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{J.error(p("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(ie("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(a=>a.json()).then(a=>{a.error?J.error(p("ui.plugins.cdnInstallFailed",{reason:a.error})):(J.success(p("ui.plugins.cdnInstallSuccess")),a.plugins&&this.setState({pluginsList:a.plugins,pluginsDir:a.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(a=>{J.error(p("ui.plugins.cdnInstallFailed",{reason:a.message||"Network error"}))}).finally(()=>{this.setState({cdnLoading:!1})})});D(this,"handleCdnCancel",()=>{this.setState({cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1})});D(this,"fetchProcesses",()=>{this.setState({processLoading:!0}),fetch(ie("/api/ccv-processes")).then(t=>t.json()).then(t=>{this.setState({processList:t.processes||[],processLoading:!1})}).catch(()=>{this.setState({processList:[],processLoading:!1})})});D(this,"handleShowProcesses",()=>{this.setState({processModalVisible:!0}),this.fetchProcesses()});D(this,"handleKillProcess",t=>{Ne.confirm({title:p("ui.processManagement.killConfirm"),onOk:()=>{fetch(ie("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(a=>a.json()).then(a=>{a.ok?(J.success(p("ui.processManagement.killed")),this.fetchProcesses()):J.error(a.error||p("ui.processManagement.killFailed"))}).catch(()=>{J.error(p("ui.processManagement.killFailed"))})}})});this.state={countdownText:"",countryFlag:null,countryInfo:null,promptModalVisible:!1,promptData:[],promptViewMode:"original",settingsDrawerVisible:!1,globalSettingsVisible:!1,projectStatsVisible:!1,projectStats:null,projectStatsLoading:!1,localUrl:"",pluginModalVisible:!1,pluginsList:[],pluginsDir:"",deleteConfirmVisible:!1,deleteTarget:null,processModalVisible:!1,processList:[],processLoading:!1,logoDropdownOpen:!1,cacheHighlightIdx:null,cacheHighlightFading:!1,cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1,calibrationModel:(a=>rt.some(d=>d.value===a)?a:"auto")(localStorage.getItem("ccv_calibrationModel")||"auto"),proxyModalVisible:!1,editingProxy:null,editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""},logDirDraft:null},this._rafId=null,this._expiredTimer=null,this.updateCountdown=this.updateCountdown.bind(this)}componentDidMount(){this.startCountdown(),fetch(ie("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(ie("/api/claude-settings")).then(t=>t.json()).then(t=>{t.model&&this.setState({settingsModel:t.model})}).catch(()=>{}),fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(5e3)}).then(t=>t.json()).then(t=>{t.country&&this.setState({countryFlag:kn(t.country),countryInfo:t})}).catch(()=>{})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,a){return t.requests!==this.props.requests||t.requestCount!==this.props.requestCount||t.viewMode!==this.props.viewMode||t.cacheExpireAt!==this.props.cacheExpireAt||t.cacheType!==this.props.cacheType||t.isLocalLog!==this.props.isLocalLog||t.projectName!==this.props.projectName||t.collapseToolResults!==this.props.collapseToolResults||t.expandThinking!==this.props.expandThinking||t.showFullToolContent!==this.props.showFullToolContent||t.expandDiff!==this.props.expandDiff||t.filterIrrelevant!==this.props.filterIrrelevant||t.logDir!==this.props.logDir||t.cliMode!==this.props.cliMode||t.contextWindow!==this.props.contextWindow||t.serverCachedContent!==this.props.serverCachedContent||t.resumeAutoChoice!==this.props.resumeAutoChoice||t.proxyProfiles!==this.props.proxyProfiles||t.activeProxyId!==this.props.activeProxyId||t.defaultConfig!==this.props.defaultConfig||a!==this.state}componentWillUnmount(){this._rafId&&cancelAnimationFrame(this._rafId),this._expiredTimer&&clearTimeout(this._expiredTimer),this._cacheFadeClearTimer&&clearTimeout(this._cacheFadeClearTimer),this._cacheUnbindScrollFade()}startCountdown(){if(this._rafId&&cancelAnimationFrame(this._rafId),this._expiredTimer&&clearTimeout(this._expiredTimer),!this.props.cacheExpireAt){this.state.countdownText!==""&&this.setState({countdownText:""});return}this._rafId=requestAnimationFrame(this.updateCountdown)}updateCountdown(){const{cacheExpireAt:t}=this.props;if(!t){this.state.countdownText!==""&&this.setState({countdownText:""});return}const a=Math.max(0,t-Date.now());if(a<=0){const u=p("ui.cacheExpired");this.state.countdownText!==u&&this.setState({countdownText:u}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const d=Math.ceil(a/1e3);let l;if(d>=60){const u=Math.floor(d/60),g=d%60;l=p("ui.minuteSecond",{m:u,s:String(g).padStart(2,"0")})}else l=p("ui.second",{s:d});l!==this.state.countdownText&&this.setState({countdownText:l}),this._rafId=requestAnimationFrame(this.updateCountdown)}static parseSegments(t){const a=[],d=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let l=0,u;for(;(u=d.exec(t))!==null;){const i=t.slice(l,u.index).trim();i&&a.push({type:"text",content:i});const h=u[1];if(l=u.index+u[0].length,Re.COMMAND_TAGS.has(h))continue;const o=new RegExp(`^<${h}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${h}>$`),r=u[0].match(o),m=r?r[1].trim():u[0].trim();a.push({type:"system",content:m,label:h})}const g=t.slice(l).trim();return g&&a.push({type:"text",content:g}),a}static extractUserTexts(t){const a=[],d=[];let l=null;for(const u of t)if(u.role==="user"){if(typeof u.content=="string"){const g=u.content.trim();if(!g)continue;if(!qe(g)){if(/Implement the following plan:/i.test(g))continue;a.push(g),d.push(g)}}else if(Array.isArray(u.content)){const{commands:g,textBlocks:i}=Ys(u.content);g.length>0&&(l=g[g.length-1]);const h=[];for(const r of i)/Implement the following plan:/i.test((r.text||"").trim())||h.push(r.text.trim());const o=u.content.filter(r=>{var m;return r.type==="text"&&((m=r.text)==null?void 0:m.trim())}).map(r=>r.text.trim());h.length>0&&(a.push(h.join(`
17
+ `)),d.push(o.join(`
18
+ `)))}}return{userMsgs:a,fullTexts:d,slashCmd:l}}extractUserPrompts(){var g;const{requests:t=[]}=this.props,a=[],d=new Set;let l=null;const u=t.filter(i=>Se(i));for(let i=0;i<u.length;i++){const h=u[i],o=((g=h.body)==null?void 0:g.messages)||[],r=h.timestamp||"",{userMsgs:m,fullTexts:v,slashCmd:x}=Re.extractUserTexts(o);x&&x!=="/compact"&&x!==l&&a.push({type:"prompt",segments:[{type:"text",content:x}],timestamp:r}),l=x;for(let f=0;f<m.length;f++){const y=m[f];if(d.has(y))continue;d.add(y);const C=v[f]||y;a.push({type:"prompt",segments:Re.parseSegments(C),timestamp:r})}}return a}renderTokenStats(){const{requests:t=[]}=this.props,a=Xs(t),d=Object.keys(a),l=Zs(t),u=ea(t);if(d.length===0&&l.length===0)return e.jsx("div",{className:c.tokenStatsEmpty,children:"暂无 token 数据"});const g=e.jsx("div",{className:c.tokenStatsColumn,children:d.map(r=>{const m=a[r],v=m.input+m.cacheCreation+m.cacheRead,x=v>0?(m.cacheRead/v*100).toFixed(1):"0.0";return e.jsxs("div",{className:d.length>1?c.modelCardSpaced:c.modelCard,children:[e.jsx("div",{className:c.modelName,children:r}),e.jsx("table",{className:c.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:c.label,children:"Token"}),e.jsx("td",{className:c.th,children:"input"}),e.jsx("td",{className:c.th,children:"output"})]}),e.jsxs("tr",{className:c.rowBorder,children:[e.jsx("td",{className:c.label}),e.jsx("td",{className:c.td,children:G(v)}),e.jsx("td",{className:c.td,children:G(m.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:c.label,children:"Cache"}),e.jsx("td",{className:c.th,children:"create"}),e.jsx("td",{className:c.th,children:"read"})]}),e.jsxs("tr",{className:c.rowBorder,children:[e.jsx("td",{className:c.label}),e.jsx("td",{className:c.td,children:G(m.cacheCreation)}),e.jsx("td",{className:c.td,children:G(m.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:c.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:c.td,children:[x,"%"]})]})]})})]},r)})}),i=this.renderCacheRebuildStats(),h=l.length>0?e.jsx("div",{className:c.toolStatsColumn,children:e.jsxs("div",{className:c.modelCard,children:[e.jsx("div",{className:c.modelName,children:p("ui.toolUsageStats")}),e.jsxs("table",{className:c.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${c.th} ${c.thLeft}`,children:"Tool"}),e.jsx("td",{className:c.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[l.map(([r,m])=>e.jsxs("tr",{className:c.rowBorder,children:[e.jsxs("td",{className:c.label,children:[r," ",e.jsx(oe,{doc:`Tool-${r}`})]}),e.jsx("td",{className:c.td,children:m})]},r)),l.length>1&&e.jsxs("tr",{className:c.rebuildTotalRow,children:[e.jsx("td",{className:c.label,children:"Total"}),e.jsx("td",{className:c.td,children:l.reduce((r,m)=>r+m[1],0)})]})]})]})]})}):null,o=u.length>0?e.jsx("div",{className:c.toolStatsColumn,children:e.jsxs("div",{className:c.modelCard,children:[e.jsx("div",{className:c.modelName,children:p("ui.skillUsageStats")}),e.jsxs("table",{className:c.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${c.th} ${c.thLeft}`,children:"Skill"}),e.jsx("td",{className:c.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[u.map(([r,m])=>e.jsxs("tr",{className:c.rowBorder,children:[e.jsx("td",{className:c.label,children:r}),e.jsx("td",{className:c.td,children:m})]},r)),u.length>1&&e.jsxs("tr",{className:c.rebuildTotalRow,children:[e.jsx("td",{className:c.label,children:"Total"}),e.jsx("td",{className:c.td,children:u.reduce((r,m)=>r+m[1],0)})]})]})]})]})}):null;return e.jsxs("div",{className:c.tokenStatsContainer,children:[g,i,h,o]})}_cacheUnbindScrollFade(){this._cacheOnScrollFade&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scroll",this._cacheOnScrollFade),this._cacheOnScrollFade=null)}_cacheBindScrollFade(){this._cacheUnbindScrollFade();const t=this._cacheScrollEl;t&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},t.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(t){if(this.props.viewMode==="raw"&&this.props.onNavigateCacheMsg&&this.props.onNavigateCacheMsg(t),(this.state._cacheSectionCollapsed||{}).messages){this.setState(i=>({_cacheSectionCollapsed:{...i._cacheSectionCollapsed||{},messages:!1}}),()=>this.scrollToCacheMsg(t));return}const a=this._cacheScrollEl;if(!a)return;const d=a.querySelector(`[data-msg-idx="${t}"]`);if(!d)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&a.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let l=!1,u=!1;const g=()=>{!l||!u||(this.setState({cacheHighlightIdx:t,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===t&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{a.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,g()},a.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{a.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,g()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{u=!0,g()},500),d.scrollIntoView({behavior:"smooth",block:"center"})}renderCacheContentPopover(t){const{requests:a=[],serverCachedContent:d}=this.props,l=d||Jt(a);if(l&&(l.cacheCreateTokens>0||l.cacheReadTokens>0)&&(this._lastCachedTokens={cacheCreateTokens:l.cacheCreateTokens,cacheReadTokens:l.cacheReadTokens}),t>0&&(this._lastContextPercent=t),!l||l.system.length===0&&l.messages.length===0&&l.tools.length===0)return e.jsx("div",{className:c.cachePopoverEmpty,children:p("ui.noCachedContent")});const u=(o,r,m,v)=>{if(r.length===0)return null;const x=o===p("ui.messages"),f=(this.state._cacheSectionCollapsed||{})[v],y=f!==void 0?!!f:v==="tools",C=()=>this.setState(k=>({_cacheSectionCollapsed:{...k._cacheSectionCollapsed||{},[v]:!y}}));return e.jsxs("div",{className:c.cacheSection,children:[e.jsxs("button",{type:"button",className:c.cacheSectionTitle,onClick:C,"aria-expanded":!y,children:[e.jsx("span",{className:c.cacheSectionArrow,children:y?"▶":"▼"}),o," (",r.length,")"]}),!y&&r.map((k,N)=>{const b=x?{"data-msg-idx":N}:{};let T=m||c.cacheCodeBlock;const E=x&&N===this.state.cacheHighlightIdx;return E&&(T+=" "+(this.state.cacheHighlightFading?c.cacheBlockHighlightFading:c.cacheBlockHighlight)),e.jsxs("pre",{className:T,...b,style:E?{position:"relative"}:void 0,children:[E&&e.jsx("svg",{className:`${c.cacheBorderSvg}${this.state.cacheHighlightFading?" "+c.cacheBorderSvgFading:""}`,preserveAspectRatio:"none",children:e.jsx("rect",{x:"0.5",y:"0.5",width:"calc(100% - 1px)",height:"calc(100% - 1px)",rx:"4",ry:"4",fill:"none",stroke:"#1668dc",strokeWidth:"1",strokeDasharray:"6 4",className:c.cacheBorderRect})}),k]},N)})]})},g=()=>{const o=[];return l.tools.length>0&&(o.push(`=== ${p("ui.tools")} (${l.tools.length}) ===`),l.tools.forEach(r=>o.push(r))),l.system.length>0&&(o.push(`
19
+ === ${p("ui.systemPrompt")} (${l.system.length}) ===`),l.system.forEach(r=>o.push(r))),l.messages.length>0&&(o.push(`
20
+ === ${p("ui.messages")} (${l.messages.length}) ===`),l.messages.forEach(r=>o.push(r))),o.join(`
21
+
22
+ `)},i=l.messages.map((o,r)=>({text:o,msgIdx:r})).filter(({text:o})=>o.startsWith("[user]")).map(({text:o,msgIdx:r})=>{const m=o.replace(/^\[user\]\s*/,"").trim();return!m||qe(m)?{cleaned:"",msgIdx:r}:{cleaned:Re.parseSegments(m).filter(f=>f.type==="text").map(f=>f.content.trim()).filter(f=>f&&!qe(f)).join(" ").trim(),msgIdx:r}}).filter(({cleaned:o})=>!(!o||/Implement the following plan:/i.test(o))),h=i.length>0?e.jsx("div",{className:c.cacheNavList,children:i.map(({cleaned:o,msgIdx:r})=>e.jsx("div",{className:c.cacheNavItem,onClick:()=>this.scrollToCacheMsg(r),children:o},r))}):null;return e.jsxs("div",{className:c.cachePopover,children:[e.jsx("div",{className:c.cachePopoverHeader,children:e.jsxs("div",{className:c.cachePopoverTitle,children:[p("ui.cachedContentTitle"),e.jsx(oe,{doc:"KVCacheContent"}),e.jsx(He,{className:c.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(g()).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:c.cacheCalibrationLabel,children:p("ui.calibrationModelLabel")}),e.jsx(Ue,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:rt,className:c.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const r=l.cacheCreateTokens>0||l.cacheReadTokens>0?l:this._lastCachedTokens,m=t>0?t:this._lastContextPercent||0;return r||h?e.jsxs("div",{className:c.cacheTokenInfo,children:[r&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:c.cacheWriteToken,children:["write ",G(r.cacheCreateTokens)]})," / ",e.jsxs("span",{className:c.cacheReadToken,children:["read ",G(r.cacheReadTokens)]}),m>0&&e.jsxs("span",{className:c.cacheCtxPercent,children:["(ctx:",m,"%)"]})]}),h&&e.jsx($e,{content:h,trigger:"hover",placement:"left",children:e.jsx("span",{className:c.cacheNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:c.cacheScrollArea,ref:o=>{this._cacheScrollEl=o,o&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{o.scrollTop=o.scrollHeight}))},children:[u(p("ui.tools"),l.tools,void 0,"tools"),u(p("ui.systemPrompt"),l.system,c.cacheCodeBlockSystem,"system"),u(p("ui.messages"),l.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,a=ta(t),d=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],l={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"},u=d.filter(y=>a[y].count>0),g=u.reduce((y,C)=>y+a[C].count,0),i=u.reduce((y,C)=>y+a[C].cacheCreate,0);sa(t);const h={},o={};for(let y=0;y<t.length;y++){const C=We(t[y],t[y+1]);if(C.type==="SubAgent"){const k=C.subType||"Other";h[k]=(h[k]||0)+1}else if(C.type==="Teammate"){const k=C.subType||"Teammate";o[k]=(o[k]||0)+1}}const r=Object.entries(h).sort((y,C)=>C[1]-y[1]),m=Object.entries(o).sort((y,C)=>C[1]-y[1]),v=u.length>0,x=r.length>0,f=m.length>0;return!v&&!x&&!f?null:e.jsxs("div",{className:c.toolStatsColumn,children:[v&&e.jsxs("div",{className:x?c.modelCardSpaced:c.modelCard,children:[e.jsxs("div",{className:c.modelName,children:["MainAgent",e.jsx(oe,{doc:"MainAgent"})," ",p("ui.cacheRebuildStats"),e.jsx(oe,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:c.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${c.th} ${c.thLeft}`,children:p("ui.cacheRebuild.reason")}),e.jsx("td",{className:c.th,children:p("ui.cacheRebuild.count")}),e.jsx("td",{className:c.th,children:p("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[u.map(y=>e.jsxs("tr",{className:c.rowBorder,children:[e.jsx("td",{className:c.label,children:p(`ui.${l[y]}`)}),e.jsx("td",{className:c.td,children:a[y].count}),e.jsx("td",{className:c.td,children:G(a[y].cacheCreate)})]},y)),u.length>1&&e.jsxs("tr",{className:c.rebuildTotalRow,children:[e.jsx("td",{className:c.label,children:"Total"}),e.jsx("td",{className:c.td,children:g}),e.jsx("td",{className:c.td,children:G(i)})]})]})]})]}),x&&e.jsxs("div",{className:f?c.modelCardSpaced:c.modelCard,children:[e.jsx("div",{className:c.modelName,children:p("ui.subAgentStats")}),e.jsxs("table",{className:c.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${c.th} ${c.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:c.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[r.map(([y,C])=>e.jsxs("tr",{className:c.rowBorder,children:[e.jsxs("td",{className:c.label,children:[y," ",e.jsx(oe,{doc:`SubAgent-${y}`})]}),e.jsx("td",{className:c.td,children:C})]},y)),r.length>1&&e.jsxs("tr",{className:c.rebuildTotalRow,children:[e.jsx("td",{className:c.label,children:"Total"}),e.jsx("td",{className:c.td,children:r.reduce((y,C)=>y+C[1],0)})]})]})]})]}),f&&e.jsxs("div",{className:c.modelCard,children:[e.jsxs("div",{className:c.modelName,children:["Teammate",e.jsx(oe,{doc:"Teammate"})]}),e.jsxs("table",{className:c.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${c.th} ${c.thLeft}`,children:"Name"}),e.jsx("td",{className:c.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[m.map(([y,C])=>e.jsxs("tr",{className:c.rowBorder,children:[e.jsx("td",{className:c.label,children:y}),e.jsx("td",{className:c.td,children:C})]},y)),m.length>1&&e.jsxs("tr",{className:c.rebuildTotalRow,children:[e.jsx("td",{className:c.label,children:"Total"}),e.jsx("td",{className:c.td,children:m.reduce((y,C)=>y+C[1],0)})]})]})]})]})]})}renderTextPrompt(t){return e.jsx("div",{className:c.textPromptCard,children:t.segments.map((a,d)=>a.type==="text"?e.jsx("pre",{className:c.preText,children:a.content},d):e.jsx(aa,{size:"small",className:c.systemCollapse,items:[{key:`sys-${d}`,label:e.jsx("span",{className:c.systemLabel,children:a.label}),children:e.jsx("pre",{className:c.preSys,children:a.content})}]},d))})}renderOriginalPrompt(t){const a=t.segments.filter(d=>d.type==="text");return a.length===0?null:e.jsx("div",{className:c.textPromptCard,children:a.map((d,l)=>e.jsx("pre",{className:c.preText,children:d.content},l))})}buildTextModeContent(){const{promptData:t}=this.state,a=[];for(const d of t){const l=(d.segments||[]).filter(u=>u.type==="text").map(u=>u.content);l.length>0&&a.push(l.join(`
23
+ `))}return a.join(`
24
+
25
+
26
+ `)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:a}=this.state;if(a)return e.jsx("div",{className:c.projectStatsCenter,children:e.jsx(Qt,{})});if(!t)return e.jsx("div",{className:c.projectStatsEmpty,children:p("ui.projectStats.noData")});const{summary:d,models:l,updatedAt:u}=t;l&&Object.entries(l).sort((h,o)=>o[1]-h[1]);const g={};if(t.files){for(const h of Object.values(t.files))if(h.models)for(const[o,r]of Object.entries(h.models))g[o]||(g[o]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),g[o].input+=r.input_tokens||0,g[o].output+=r.output_tokens||0,g[o].cacheRead+=r.cache_read_input_tokens||0,g[o].cacheCreation+=r.cache_creation_input_tokens||0,g[o].count+=r.count||0}const i=Object.entries(g).sort((h,o)=>o[1].count-h[1].count);return e.jsxs("div",{className:c.projectStatsContent,children:[u&&e.jsx("div",{className:c.projectStatsUpdated,children:p("ui.projectStats.updatedAt",{time:new Date(u).toLocaleString()})}),e.jsxs("div",{className:c.projectStatsSummary,children:[e.jsxs("div",{className:c.projectStatCard,children:[e.jsx("div",{className:c.projectStatValue,children:(d==null?void 0:d.requestCount)??0}),e.jsx("div",{className:c.projectStatLabel,children:p("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:c.projectStatCard,children:[e.jsx("div",{className:c.projectStatValue,children:(d==null?void 0:d.turnCount)??(d==null?void 0:d.sessionCount)??0}),e.jsx("div",{className:c.projectStatLabel,children:p("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:c.projectStatCard,children:[e.jsx("div",{className:c.projectStatValue,children:(d==null?void 0:d.fileCount)??0}),e.jsx("div",{className:c.projectStatLabel,children:p("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:c.projectStatCard,children:[e.jsx("div",{className:c.projectStatValue,children:G(d==null?void 0:d.input_tokens)}),e.jsx("div",{className:c.projectStatLabel,children:"Input Tokens"})]}),e.jsxs("div",{className:c.projectStatCard,children:[e.jsx("div",{className:c.projectStatValue,children:G(d==null?void 0:d.output_tokens)}),e.jsx("div",{className:c.projectStatLabel,children:"Output Tokens"})]})]}),i.length>0&&e.jsxs("div",{className:c.projectStatsSection,children:[e.jsx("div",{className:c.projectStatsSectionTitle,children:p("ui.projectStats.modelUsage")}),i.map(([h,o])=>{const r=o.input+o.cacheRead+o.cacheCreation,m=r>0?(o.cacheRead/r*100).toFixed(1):"0.0";return e.jsxs("div",{className:c.projectStatsModelCard,children:[e.jsxs("div",{className:c.projectStatsModelHeader,children:[e.jsx("span",{className:c.projectStatsModelName,children:h}),e.jsxs("span",{className:c.projectStatsModelCount,children:[o.count," reqs"]})]}),e.jsx("table",{className:c.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:c.label,children:"Token"}),e.jsx("td",{className:c.th,children:"input"}),e.jsx("td",{className:c.th,children:"output"})]}),e.jsxs("tr",{className:c.rowBorder,children:[e.jsx("td",{className:c.label}),e.jsx("td",{className:c.td,children:G(r)}),e.jsx("td",{className:c.td,children:G(o.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:c.label,children:"Cache"}),e.jsx("td",{className:c.th,children:"create"}),e.jsx("td",{className:c.th,children:"read"})]}),e.jsxs("tr",{className:c.rowBorder,children:[e.jsx("td",{className:c.label}),e.jsx("td",{className:c.td,children:G(o.cacheCreation)}),e.jsx("td",{className:c.td,children:G(o.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:c.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:c.td,children:[m,"%"]})]})]})})]},h)})]})]})}render(){const{requestCount:t,requests:a=[],viewMode:d,cacheType:l,onToggleViewMode:u,onImportLocalLogs:g,onLangChange:i,isLocalLog:h,localLogFile:o,projectName:r,collapseToolResults:m,onCollapseToolResultsChange:v,expandThinking:x,onExpandThinkingChange:f,showFullToolContent:y,onShowFullToolContentChange:C,expandDiff:k,onExpandDiffChange:N,filterIrrelevant:b,onFilterIrrelevantChange:T,logDir:E,onLogDirChange:L,updateInfo:I,onDismissUpdate:M,cliMode:B,terminalVisible:O,onToggleTerminal:ae,onReturnToWorkspaces:ne,contextWindow:P,serverCachedContent:X,resumeAutoChoice:re,onResumeAutoChoiceToggle:ee,onResumeAutoChoiceChange:me,themeColor:ve,onThemeColorChange:ge}=this.props,{countdownText:K}=this.state,fe=[{key:"import-local",icon:e.jsx(Vt,{}),label:p("ui.importLocalLogs"),onClick:g},{key:"export-prompts",icon:e.jsx(en,{}),label:p("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx($t,{}),label:p("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx(Vt,{className:c.iconMirror}),label:e.jsx("span",{className:c.disabledMenuItem,children:p("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(ot,{}),label:p("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx(Ft,{}),label:p("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx(Ht,{}),label:p("ui.projectStats"),onClick:this.handleShowProjectStats},...d==="raw"?[{key:"global-settings",icon:e.jsx(Ut,{}),label:p("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...d==="chat"?[{key:"display-settings",icon:e.jsx(Ut,{}),label:p("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[],{key:"language",icon:e.jsx(an,{}),label:p("ui.languageSettings"),children:[{key:"lang-grid-container",type:"group",label:e.jsx("div",{className:c.langGrid,children:Sn.map(_=>e.jsx(F,{size:"small",type:_.value===la()?"primary":"default",onClick:z=>{z.stopPropagation(),na(_.value),i&&i()},className:c.langBtn,children:_.label},_.value))})}]}];return e.jsxs("div",{className:c.headerBar,children:[e.jsxs(ze,{size:"middle",children:[e.jsx(ia,{menu:{items:fe,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:_=>this.setState({logoDropdownOpen:_}),align:{offset:[-4,0]},children:e.jsx("span",{className:`${c.logoWrap}${this.state.logoDropdownOpen?` ${c.logoWrapActive}`:""}`,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`${c.logoImage}${this.state.logoDropdownOpen?` ${c.logoImageActive}`:""}`,children:[e.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}),e.jsx($e,{content:this.renderTokenStats(),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px",maxHeight:"80vh",overflowY:"auto"},children:e.jsxs(pe,{className:c.tokenStatsTag,children:[e.jsx(ot,{className:c.tokenStatsIcon}),p("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const _=(this.props.proxyProfiles||[]).find(z=>z.id===this.props.activeProxyId);return _?e.jsxs(pe,{className:c.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx(Ft,{className:c.proxySwapIcon}),_.name,_.activeModel?` · ${_.activeModel}`:""]}):null})(),(()=>{var ke,we,je,xe,V;let _=0;const z=rt.find(Z=>Z.value===this.state.calibrationModel),ce=z==null?void 0:z.tokens;if(!h){if(ce&&(P==null?void 0:P.used_percentage)!=null){const Z=U=>{var Ce,be;const le=(be=(Ce=U.response)==null?void 0:Ce.body)==null?void 0:be.usage;return((le==null?void 0:le.input_tokens)||0)+((le==null?void 0:le.cache_creation_input_tokens)||0)+((le==null?void 0:le.cache_read_input_tokens)||0)};let q=0;for(let U=a.length-1;U>=0;U--)if(Se(a[U])&&((we=(ke=a[U].response)==null?void 0:ke.body)!=null&&we.usage)){q=Z(a[U]);break}if(q>0){const U=ce*.835;_=Math.min(100,Math.max(0,Math.round(q/U*100)))}else{const U=P.context_window_size||2e5;_=Math.min(100,Math.max(0,Math.round(P.used_percentage*U/ce/83.5*100)))}}else if((P==null?void 0:P.used_percentage)!=null){const Z=this.state.settingsModel?Tt(this.state.settingsModel):0,q=P.context_window_size||2e5;Z&&Z!==q?_=Math.min(100,Math.max(0,Math.round(P.used_percentage*q/Z/83.5*100))):_=Math.min(100,Math.max(0,Math.round(P.used_percentage/83.5*100)))}else if(a.length>0){const Z=q=>{var le,Ce;const U=(Ce=(le=q.response)==null?void 0:le.body)==null?void 0:Ce.usage;return((U==null?void 0:U.input_tokens)||0)+((U==null?void 0:U.cache_creation_input_tokens)||0)+((U==null?void 0:U.cache_read_input_tokens)||0)};for(let q=a.length-1;q>=0;q--)if(Se(a[q])&&((xe=(je=a[q].response)==null?void 0:je.body)!=null&&xe.usage)){const U=Z(a[q]),Ce=(ce||(P==null?void 0:P.context_window_size)||Tt(((V=a[q].body)==null?void 0:V.model)||this.state.settingsModel))*.835;Ce>0&&U>0&&(_=Math.min(100,Math.max(0,Math.round(U/Ce*100))));break}}}_===0&&this._lastContextPercent>0&&(_=this._lastContextPercent);const _e=_>=80?"#ff4d4f":_>=60?"#faad14":"#52c41a";return h?e.jsx(pe,{className:`${c.liveTag} ${c.liveTagHistory}`,children:e.jsx("span",{className:c.liveTagText,children:p("ui.historyLog",{file:o})})}):e.jsx($e,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(_):e.jsx("div",{className:c.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},onOpenChange:Z=>{this.setState({_cachePopoverOpen:Z}),Z||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:c.liveTag,style:{borderColor:_e,color:_e},children:[e.jsx("span",{className:c.liveTagFill,style:{width:`${_}%`,backgroundColor:_e}}),e.jsx("span",{className:c.liveTagContent,children:e.jsxs("span",{className:c.liveTagText,children:[p("ui.liveMonitoring"),r?`:${r}`:""]})})]})})})(),I&&e.jsx(pe,{color:I.type==="completed"?"green":"orange",closable:!0,onClose:()=>M&&M(),children:I.type==="completed"?p("ui.update.completed",{version:I.version}):p("ui.update.majorAvailable",{version:I.version})})]}),e.jsxs(ze,{size:"middle",children:[K&&d==="raw"&&e.jsxs(pe,{style:{background:"#2a2a2a",border:"1px solid #3a3a3a",color:K===p("ui.cacheExpired")?"#ff6b6b":"#ccc"},children:[p("ui.cacheCountdown",{type:l?`(${l})`:""}),e.jsx("strong",{className:c.countdownStrong,children:K})]}),d==="chat"&&B&&!h&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&e.jsx($e,{content:this.state.countryInfo?e.jsxs("div",{className:c.countryInfoPopover,children:[e.jsxs("div",{children:[this.state.countryFlag," ",this.state.countryInfo.country]}),this.state.countryInfo.region&&e.jsx("div",{children:this.state.countryInfo.region}),this.state.countryInfo.city&&e.jsx("div",{children:this.state.countryInfo.city}),this.state.countryInfo.org&&e.jsx("div",{className:c.countryInfoMeta,children:this.state.countryInfo.org}),this.state.countryInfo.ip&&e.jsx("div",{className:c.countryInfoMeta,children:this.state.countryInfo.ip})]}):null,trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 12px"},children:e.jsx(F,{className:c.compactBtnNoBorder,icon:e.jsx("span",{className:c.countryFlagIcon,children:this.state.countryFlag})})}),e.jsx($e,{content:e.jsxs("div",{className:c.qrcodePopover,children:[e.jsx("div",{className:c.qrcodeTitle,children:p("ui.scanToCoding")}),e.jsx(js,{value:this.state.localUrl,size:200,bgColor:"#141414",fgColor:"#d9d9d9",level:"M"}),e.jsx(Me,{readOnly:!0,value:this.state.localUrl,className:c.qrcodeUrlInput,suffix:e.jsx(He,{className:c.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}})})]}),trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},children:e.jsx(F,{className:c.compactBtnNoBorder,icon:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:c.svgIcon,children:[e.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.jsx("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})]})})})]}),B&&d==="chat"&&!h&&e.jsx(F,{className:c.compactBtn,type:O?"primary":"default",ghost:O,icon:e.jsx(Ye,{}),onClick:ae,children:p("ui.terminal")}),e.jsx(F,{className:c.compactBtn,type:d==="raw"?"primary":"default",icon:d==="raw"?e.jsx(cn,{}):e.jsx(Qe,{}),onClick:u,children:d==="raw"?p("ui.chatMode"):p("ui.rawMode")})]}),e.jsxs(Ne,{title:`${p("ui.userPrompt")} (${this.state.promptData.length}${p("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:c.promptExportBar,children:e.jsx(F,{icon:e.jsx(oa,{}),onClick:this.handleExportPromptsTxt,children:p("ui.exportPromptsTxt")})}),e.jsx(Yt,{activeKey:this.state.promptViewMode,onChange:_=>this.setState({promptViewMode:_}),size:"small",items:[{key:"original",label:p("ui.promptModeOriginal")},{key:"context",label:p("ui.promptModeContext")},{key:"text",label:p("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:c.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:c.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:c.promptEmpty,children:p("ui.noPrompt")}),this.state.promptData.map((_,z)=>{const ce=_.timestamp?new Date(_.timestamp).toLocaleString():p("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:c.promptTimestamp,children:[ce,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(_):this.renderTextPrompt(_)]},z)})]})]}),e.jsxs(Je,{title:p("ui.settings"),placement:"left",width:360,open:this.state.settingsDrawerVisible,onClose:()=>this.setState({settingsDrawerVisible:!1}),children:[e.jsxs("div",{className:c.settingsGroupBox,children:[e.jsx("div",{className:c.settingsGroupTitle,children:p("ui.chatDisplaySwitches")}),e.jsxs("div",{className:c.settingsItem,children:[e.jsx("span",{className:c.settingsLabel,children:p("ui.collapseToolResults")}),e.jsx(Ee,{checked:!!m,onChange:_=>v&&v(_)})]}),e.jsxs("div",{className:c.settingsItem,children:[e.jsx("span",{className:c.settingsLabel,children:p("ui.expandThinking")}),e.jsx(Ee,{checked:!!x,onChange:_=>f&&f(_)})]}),e.jsxs("div",{className:c.settingsItem,children:[e.jsx("span",{className:c.settingsLabel,children:p("ui.showFullToolContent")}),e.jsx(Ee,{checked:!!y,onChange:_=>C&&C(_)})]})]}),e.jsxs("div",{className:c.settingsGroupBox,children:[e.jsx("div",{className:c.settingsGroupTitle,children:p("ui.userPreferences")}),e.jsxs("div",{className:c.settingsItem,children:[e.jsx("span",{className:c.settingsLabel,children:p("ui.resumeAutoChoice")}),e.jsx(Ee,{checked:!!re,onChange:_=>ee&&ee(_)})]}),re&&e.jsx("div",{className:c.settingsItem,children:e.jsxs(Ke.Group,{value:re,onChange:_=>me&&me(_.target.value),size:"small",children:[e.jsx(Ke,{value:"continue",children:p("ui.resumeAutoChoice.continue")}),e.jsx(Ke,{value:"new",children:p("ui.resumeAutoChoice.new")})]})})]}),e.jsx("div",{className:c.settingsGroupBox,children:e.jsxs("div",{className:c.settingsItem,children:[e.jsx("span",{className:c.settingsLabel,children:p("ui.themeColor")}),e.jsx(Ue,{size:"small",value:ve||"dark",onChange:_=>ge&&ge(_),options:[{label:p("ui.themeColor.dark"),value:"dark"},{label:p("ui.themeColor.light"),value:"light"}],style:{width:140}})]})})]}),e.jsxs(Je,{title:e.jsxs("span",{children:[p("ui.globalSettings")," ",e.jsx(oe,{doc:"GlobalSettings"})]}),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:c.settingsItem,children:[e.jsx("span",{className:c.settingsLabel,children:p("ui.filterIrrelevant")}),e.jsx(Ee,{checked:!!b,onChange:_=>T&&T(_)})]}),e.jsxs("div",{className:c.settingsItem,children:[e.jsx("span",{className:c.settingsLabel,children:p("ui.expandDiff")}),e.jsx(Ee,{checked:!!k,onChange:_=>N&&N(_)})]}),e.jsx("div",{className:c.settingsDivider}),e.jsx("div",{className:c.settingsLabel,children:p("ui.logDirTitle")}),e.jsx(Me,{className:c.logDirInput,value:this.state.logDirDraft??E,onChange:_=>this.setState({logDirDraft:_.target.value}),onBlur:()=>{const _=this.state.logDirDraft;_!=null&&_!==E&&(L==null||L(_)),this.setState({logDirDraft:null})},onPressEnter:()=>{const _=this.state.logDirDraft;_!=null&&_!==E&&(L==null||L(_)),this.setState({logDirDraft:null})},placeholder:"~/.claude/cc-viewer"})]}),e.jsx(Je,{title:e.jsxs("span",{children:[e.jsx(Ht,{className:c.titleIcon}),p("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(Ne,{title:e.jsxs("span",{children:[e.jsx($t,{className:c.titleIcon}),p("ui.pluginManagement")]}),open:this.state.pluginModalVisible,onCancel:()=>this.setState({pluginModalVisible:!1}),footer:e.jsxs("div",{className:c.pluginModalFooter,children:[e.jsxs("div",{className:c.pluginModalFooterLeft,children:[e.jsx(F,{icon:e.jsx(Mt,{}),onClick:this.handleAddPlugin,children:p("ui.plugins.add")}),e.jsx(F,{icon:e.jsx(zt,{}),onClick:this.handleShowCdnModal,children:p("ui.plugins.cdnInstall")})]}),e.jsx(F,{icon:e.jsx(mt,{}),onClick:this.handleReloadPlugins,children:p("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:c.pluginDirHint,children:[e.jsxs("span",{className:c.pluginDirLabel,children:[p("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:c.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})},children:this.state.pluginsDir})]}),this.state.pluginsList.length===0?e.jsxs("div",{className:c.pluginEmpty,children:[e.jsx("div",{className:c.pluginEmptyTitle,children:p("ui.plugins.empty")}),e.jsx("div",{className:c.pluginEmptyHint,children:p("ui.plugins.emptyHint")})]}):e.jsx("div",{className:c.pluginList,children:this.state.pluginsList.map(_=>e.jsxs("div",{className:c.pluginItem,children:[e.jsxs("div",{className:c.pluginInfo,children:[e.jsx("span",{className:c.pluginName,children:_.name}),e.jsx("span",{className:c.pluginFile,children:_.file}),_.hooks.length>0&&e.jsx("span",{className:c.pluginHooks,children:_.hooks.map(z=>e.jsx("span",{className:c.pluginHookTag,children:z},z))})]}),e.jsxs("div",{className:c.pluginActions,children:[e.jsx(Ee,{size:"small",checked:_.enabled,onChange:z=>this.handleTogglePlugin(_.name,z)}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(ut,{}),onClick:()=>this.handleDeletePlugin(_.file,_.name)})]})]},_.file))})]}),e.jsx(Ne,{title:p("ui.plugins.delete"),open:this.state.deleteConfirmVisible,onCancel:()=>this.setState({deleteConfirmVisible:!1,deleteTarget:null}),onOk:this.handleDeletePluginConfirm,okType:"danger",okText:"OK",cancelText:"Cancel",children:e.jsx("p",{children:this.state.deleteTarget?p("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(Ne,{title:e.jsxs("span",{children:[e.jsx(zt,{className:c.titleIcon}),p("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:p("ui.plugins.cdnInstallBtn"),cancelText:p("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:c.cdnUrlLabel,children:p("ui.plugins.cdnUrl")}),e.jsx(Me,{placeholder:p("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:c.cdnInput})]})}),e.jsx(Ne,{title:e.jsxs("span",{children:[e.jsx(ot,{className:c.titleIcon}),p("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(F,{icon:e.jsx(mt,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:p("ui.processManagement.refresh")}),width:780,children:e.jsx(ra,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:p("ui.processManagement.port"),dataIndex:"port",width:80,render:_=>_?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${_}`,target:"_blank",rel:"noopener noreferrer",children:_}):""},{title:"PID",dataIndex:"pid",width:80},{title:p("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:p("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:p("ui.processManagement.action"),width:100,render:(_,z)=>z.isCurrent?e.jsx(F,{size:"small",className:c.currentProcessBtn,children:p("ui.processManagement.current")}):e.jsx(F,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(z.pid),children:p("ui.processManagement.kill")})}]})}),e.jsx(Ne,{title:e.jsxs("span",{children:[e.jsx(Xt,{apiEndpoint:ie("/api/open-profile-dir"),title:p("ui.proxy.openConfigDir"),size:16})," ",p("ui.proxySwitch")," ",e.jsx(oe,{doc:"ProxySwitch",zIndex:1100})]}),open:this.state.proxyModalVisible,onCancel:()=>this.setState({proxyModalVisible:!1,editingProxy:null}),footer:null,width:520,children:this.renderProxyProfileList()})]})}renderProxyProfileList(){const t=this.props.proxyProfiles||[],a=this.props.activeProxyId||"max",{editingProxy:d,editForm:l}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:c.proxyWarning,children:["⚠️ ",p("ui.proxy.maxWarning")]}),e.jsx("div",{className:c.proxyList,children:t.map(u=>{var g;return e.jsxs("div",{className:`${c.proxyItem} ${u.id===a?c.proxyItemActive:""}`,children:[e.jsxs("div",{className:c.proxyItemMain,onClick:()=>{if(u.id!==a){const i={active:u.id,profiles:t};this.props.onProxyProfileChange(i)}},children:[e.jsx(Ke,{checked:u.id===a,style:{marginRight:8}}),e.jsxs("div",{className:c.proxyItemInfo,children:[e.jsxs("div",{className:c.proxyItemNameRow,children:[e.jsx("span",{className:c.proxyItemName,children:u.name}),u.id==="max"&&e.jsx(pe,{className:c.proxyBuiltinTag,children:p("ui.proxy.builtin")})]}),u.id==="max"&&this.props.defaultConfig&&e.jsxs("div",{className:c.proxyItemDetail,children:[(()=>{try{return new URL(this.props.defaultConfig.origin).host}catch{return this.props.defaultConfig.origin}})(),this.props.defaultConfig.authType?` · ${this.props.defaultConfig.authType}`:"",this.props.defaultConfig.apiKey?` · ${this.props.defaultConfig.apiKey}`:"",this.props.defaultConfig.model?` · ${this.props.defaultConfig.model}`:""]}),u.id!=="max"&&u.baseURL&&e.jsxs("div",{className:c.proxyItemDetail,children:[(()=>{try{return new URL(u.baseURL).host}catch{return u.baseURL}})(),u.activeModel?` · ${u.activeModel}`:(g=u.models)!=null&&g.length?` · ${u.models[0]}`:""]})]})]}),u.id!=="max"&&e.jsxs("div",{className:c.proxyItemActions,children:[e.jsx(F,{type:"text",size:"small",icon:e.jsx(ca,{}),onClick:()=>this.setState({editingProxy:u.id,editForm:{name:u.name||"",baseURL:u.baseURL||"",apiKey:u.apiKey||"",models:(u.models||[]).join(", "),activeModel:u.activeModel||""}})}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(ut,{}),onClick:()=>{Ne.confirm({title:p("ui.proxy.deleteProxy"),content:p("ui.proxy.deleteConfirm",{name:u.name}),okType:"danger",onOk:()=>{const i=t.filter(o=>o.id!==u.id),h=a===u.id?"max":a;this.props.onProxyProfileChange({active:h,profiles:i})}})}})]})]},u.id)})}),d&&e.jsxs("div",{className:c.proxyEditForm,children:[e.jsxs("div",{className:c.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.name")," ",e.jsx("span",{className:c.proxyRequired,children:"*"})]}),e.jsx(Me,{size:"small",value:l.name,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,name:g}}))}})]}),e.jsxs("div",{className:c.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.baseURL")," ",e.jsx("span",{className:c.proxyRequired,children:"*"})]}),e.jsx(Me,{size:"small",value:l.baseURL,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,baseURL:g}}))},placeholder:"https://api.example.com"})]}),e.jsxs("div",{className:c.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.apiKey")," ",e.jsx("span",{className:c.proxyRequired,children:"*"})]}),e.jsx(Me.Password,{size:"small",value:l.apiKey,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,apiKey:g}}))},placeholder:"sk-..."})]}),e.jsx("div",{className:c.proxyEditDivider}),e.jsxs("div",{className:c.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.models")}),e.jsx(Me,{size:"small",value:l.models,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,models:g}}))},placeholder:"model-1, model-2"})]}),e.jsxs("div",{className:c.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.activeModel")}),e.jsx(Ue,{size:"small",className:c.fullWidthSelect,value:l.activeModel||void 0,onChange:u=>this.setState(g=>({editForm:{...g.editForm,activeModel:u}})),placeholder:p("ui.proxy.activeModel"),children:(l.models||"").split(",").map(u=>u.trim()).filter(Boolean).map(u=>e.jsx(Ue.Option,{value:u,children:u},u))})]}),e.jsxs("div",{className:c.proxyEditBtns,children:[e.jsx(F,{size:"small",icon:e.jsx(da,{}),type:"primary",onClick:()=>{var h,o,r;if(!((h=l.name)!=null&&h.trim())||!((o=l.baseURL)!=null&&o.trim())||!((r=l.apiKey)!=null&&r.trim())){J.warning(p("ui.proxy.requiredFields"));return}const u=(l.models||"").split(",").map(m=>m.trim()).filter(Boolean),g={id:d==="__new__"?`proxy_${Date.now()}`:d,name:l.name.trim(),baseURL:l.baseURL.trim(),apiKey:l.apiKey.trim(),models:u,activeModel:l.activeModel||u[0]||""};let i;d==="__new__"?i=[...t,g]:i=t.map(m=>m.id===d?{...m,...g,id:m.id}:m),this.props.onProxyProfileChange({active:a,profiles:i}),this.setState({editingProxy:null})},children:p("ui.proxy.save")}),e.jsx(F,{size:"small",icon:e.jsx(ha,{}),onClick:()=>this.setState({editingProxy:null}),children:p("ui.proxy.cancel")})]})]}),!d&&e.jsx(F,{block:!0,type:"dashed",icon:e.jsx(Mt,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:p("ui.proxy.addProxy")})]})}};D(Re,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Ze=Re;const wn="_centerEmpty_18l8t_1",Tn="_scrollContainer_18l8t_8",Mn="_listItem_18l8t_15",En="_listItemActive_18l8t_27",Rn="_itemContent_18l8t_36",In="_itemHeader_18l8t_41",Ln="_tagNoMargin_18l8t_49",Pn="_modelName_18l8t_54",An="_modelNameMain_18l8t_59",Bn="_time_18l8t_63",Dn="_detailRow_18l8t_69",On="_urlText_18l8t_76",Fn="_duration_18l8t_85",$n="_statusOk_18l8t_90",Hn="_statusErr_18l8t_96",zn="_statusDefault_18l8t_101",Vn="_usageBox_18l8t_106",Un="_cacheDot_18l8t_116",qn="_cacheDotLoss_18l8t_125",Wn="_cacheDotNormal_18l8t_130",Kn="_tagMainAgent_18l8t_134",Gn="_tagPlan_18l8t_140",Jn="_tagMuted_18l8t_146",Qn="_tooltipPreLine_18l8t_152",H={centerEmpty:wn,scrollContainer:Tn,listItem:Mn,listItemActive:En,itemContent:Rn,itemHeader:In,tagNoMargin:Ln,modelName:Pn,modelNameMain:An,time:Bn,detailRow:Dn,urlText:On,duration:Fn,statusOk:$n,statusErr:Hn,statusDefault:zn,usageBox:Vn,cacheDot:Un,cacheDotLoss:qn,cacheDotNormal:Wn,tagMainAgent:Kn,tagPlan:Gn,tagMuted:Jn,tooltipPreLine:Qn};class Yn extends W.Component{constructor(t){super(t);D(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:a,selectedIndex:d,onSelect:l}=this.props;if(!a.length)return;t.preventDefault();const u=d??0,g=t.key==="ArrowUp"?Math.max(0,u-1):Math.min(a.length-1,u+1);g!==u&&l(g)});this.activeItemRef=W.createRef()}componentDidMount(){this.scrollToSelected(!0)}shouldComponentUpdate(t){return t.requests!==this.props.requests||t.selectedIndex!==this.props.selectedIndex||t.scrollCenter!==this.props.scrollCenter||t.cacheLossMap!==this.props.cacheLossMap}componentDidUpdate(t){this.props.scrollCenter&&t.selectedIndex!==this.props.selectedIndex?this.scrollToSelected(!0):t.selectedIndex!==this.props.selectedIndex&&(this.scrollToSelected(!1),this.activeItemRef.current&&this.activeItemRef.current.focus({preventScroll:!0}))}scrollToSelected(t){this.activeItemRef.current&&(this.activeItemRef.current.scrollIntoView({block:t?"center":"nearest",behavior:"instant"}),t&&this.props.onScrollDone&&this.props.onScrollDone())}render(){const{requests:t,selectedIndex:a,onSelect:d}=this.props;return t.length===0?e.jsx("div",{className:H.centerEmpty,children:e.jsx(Ie,{description:p("ui.waitingRequests")})}):e.jsx("div",{className:H.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(Et,{dataSource:t,size:"small",split:!1,renderItem:(l,u)=>{var T,E,L;const g=new Date(l.timestamp).toLocaleTimeString("zh-CN"),i=u===a,h=l.response&&l.response.status<400,o=l.response&&l.response.status>=400,r=ua((T=l.body)==null?void 0:T.model),m=u+1<t.length?t[u+1]:null,{type:v,subType:x}=We(l,m),f=(L=(E=l.response)==null?void 0:E.body)==null?void 0:L.usage,y=f?(f.input_tokens||0)+(f.cache_read_input_tokens||0)+(f.cache_creation_input_tokens||0):null,C=(f==null?void 0:f.output_tokens)||null,k=(f==null?void 0:f.cache_read_input_tokens)||0,N=(f==null?void 0:f.cache_creation_input_tokens)||0;let b=l.url;try{const I=new URL(l.url);b=I.host+I.pathname}catch{}return e.jsx(Et.Item,{ref:i?this.activeItemRef:void 0,tabIndex:0,onClick:()=>d(u),className:`${H.listItem} ${i?H.listItemActive:""}`,children:e.jsxs("div",{className:H.itemContent,children:[e.jsxs("div",{className:H.itemHeader,children:[v==="MainAgent"?e.jsx(pe,{className:`${H.tagNoMargin} ${H.tagMainAgent}`,children:"MainAgent"}):v==="Plan"?e.jsx(pe,{className:`${H.tagNoMargin} ${H.tagPlan}`,children:Rt(v,x)}):v==="Count"||v==="Preflight"?e.jsx(pe,{className:`${H.tagNoMargin} ${H.tagMuted}`,children:v}):e.jsx(pe,{className:H.tagNoMargin,children:Rt(v,x)}),r&&e.jsx("span",{className:`${H.modelName} ${v==="MainAgent"?H.modelNameMain:""}`,children:r}),e.jsx("span",{className:H.time,children:g})]}),e.jsxs("div",{className:H.detailRow,children:[e.jsx("span",{className:H.urlText,title:l.url,children:b}),l.duration&&e.jsxs("span",{className:H.duration,children:[l.duration,"ms"]}),l.response&&e.jsx("span",{className:h?H.statusOk:o?H.statusErr:H.statusDefault,children:l.response.status})]}),f&&e.jsxs("div",{className:H.usageBox,children:[e.jsxs("div",{children:["token: output:",G(C)||0,", input: ",G(y)||0]}),(k>0||N>0)&&e.jsx("div",{children:(()=>{var O;const I=(O=this.props.cacheLossMap)==null?void 0:O.get(u),M={ttl:"ui.cacheLoss.ttl",system_change:"ui.cacheLoss.systemChange",tools_change:"ui.cacheLoss.toolsChange",model_change:"ui.cacheLoss.modelChange",msg_truncated:"ui.cacheLoss.msgTruncated",msg_modified:"ui.cacheLoss.msgModified",key_change:"ui.cacheLoss.keyChange"};let B;if(I){const ne=(I.reasons||[I.reason]).map(P=>p(M[P]||M.key_change)).join(`
27
+ `);B=e.jsx(Zt,{title:e.jsx("span",{className:H.tooltipPreLine,children:ne}),children:e.jsx("span",{className:`${H.cacheDot} ${H.cacheDotLoss}`})})}else B=e.jsx("span",{className:`${H.cacheDot} ${H.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",B,": ",k>0?`read:${G(k)}`:"",k>0&&N>0?", ":"",N>0?`create:${G(N)}`:""]})})()})]})]})})}})})}}const Xn=n=>typeof n=="boolean"||n instanceof Boolean,Zn=n=>typeof n=="number"||n instanceof Number,el=n=>typeof n=="bigint"||n instanceof BigInt,Cs=n=>!!n&&n instanceof Date,tl=n=>typeof n=="string"||n instanceof String,sl=n=>Array.isArray(n),bs=n=>typeof n=="object"&&n!==null,Ns=n=>!!n&&n instanceof Object&&typeof n=="function";function et(n,s){return s===void 0&&(s=!1),!n||s?`"${n}"`:n}function al(n,s,t){return t?JSON.stringify(n):s?`"${n}"`:n}function _s(n){let{field:s,value:t,data:a,lastElement:d,openBracket:l,closeBracket:u,level:g,style:i,shouldExpandNode:h,clickToExpandNode:o,outerRef:r,beforeExpandChange:m}=n;const v=j.useRef(!1),[x,f]=j.useState(()=>h(g,t,s)),y=j.useRef(null);j.useEffect(()=>{v.current?f(h(g,t,s)):v.current=!0},[h]);const C=j.useId();if(a.length===0)return nl({field:s,openBracket:l,closeBracket:u,lastElement:d,style:i});const k=x?i.collapseIcon:i.expandIcon,N=x?i.ariaLables.collapseJson:i.ariaLables.expandJson,b=g+1,T=a.length-1,E=M=>{x!==M&&(!m||m({level:g,value:t,field:s,newExpandValue:M}))&&f(M)},L=M=>{if(M.key==="ArrowRight"||M.key==="ArrowLeft")M.preventDefault(),E(M.key==="ArrowRight");else if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();const B=M.key==="ArrowUp"?-1:1;if(!r.current)return;const O=r.current.querySelectorAll("[role=button]");let ae=-1;for(let P=0;P<O.length;P++)if(O[P].tabIndex===0){ae=P;break}if(ae<0)return;const ne=(ae+B+O.length)%O.length;O[ae].tabIndex=-1,O[ne].tabIndex=0,O[ne].focus()}},I=()=>{var M;E(!x);const B=y.current;if(!B)return;const O=(M=r.current)===null||M===void 0?void 0:M.querySelector('[role=button][tabindex="0"]');O&&(O.tabIndex=-1),B.tabIndex=0,B.focus()};return j.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-expanded":x,"aria-selected":void 0},j.createElement("span",{className:k,onClick:I,onKeyDown:L,role:"button","aria-label":N,"aria-expanded":x,"aria-controls":x?C:void 0,ref:y,tabIndex:g===0?0:-1}),(s||s==="")&&(o?j.createElement("span",{className:i.clickableLabel,onClick:I,onKeyDown:L},et(s,i.quotesForFieldNames),":"):j.createElement("span",{className:i.label},et(s,i.quotesForFieldNames),":")),j.createElement("span",{className:i.punctuation},l),x?j.createElement("ul",{id:C,role:"group",className:i.childFieldsContainer},a.map((M,B)=>j.createElement(ft,{key:M[0]||B,field:M[0],value:M[1],style:i,lastElement:B===T,level:b,shouldExpandNode:h,clickToExpandNode:o,beforeExpandChange:m,outerRef:r}))):j.createElement("span",{className:i.collapsedContent,onClick:I,onKeyDown:L}),j.createElement("span",{className:i.punctuation},u),!d&&j.createElement("span",{className:i.punctuation},","))}function nl(n){let{field:s,openBracket:t,closeBracket:a,lastElement:d,style:l}=n;return j.createElement("div",{className:l.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:l.label},et(s,l.quotesForFieldNames),":"),j.createElement("span",{className:l.punctuation},t),j.createElement("span",{className:l.punctuation},a),!d&&j.createElement("span",{className:l.punctuation},","))}function ll(n){let{field:s,value:t,style:a,lastElement:d,shouldExpandNode:l,clickToExpandNode:u,level:g,outerRef:i,beforeExpandChange:h}=n;return _s({field:s,value:t,lastElement:d||!1,level:g,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:l,clickToExpandNode:u,data:Object.keys(t).map(o=>[o,t[o]]),outerRef:i,beforeExpandChange:h})}function il(n){let{field:s,value:t,style:a,lastElement:d,level:l,shouldExpandNode:u,clickToExpandNode:g,outerRef:i,beforeExpandChange:h}=n;return _s({field:s,value:t,lastElement:d||!1,level:l,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:u,clickToExpandNode:g,data:t.map(o=>[void 0,o]),outerRef:i,beforeExpandChange:h})}function ol(n){let{field:s,value:t,style:a,lastElement:d}=n,l,u=a.otherValue;return t===null?(l="null",u=a.nullValue):t===void 0?(l="undefined",u=a.undefinedValue):tl(t)?(l=al(t,!a.noQuotesForStringValues,a.stringifyStringValues),u=a.stringValue):Xn(t)?(l=t?"true":"false",u=a.booleanValue):Zn(t)?(l=t.toString(),u=a.numberValue):el(t)?(l=`${t.toString()}n`,u=a.numberValue):Cs(t)?l=t.toISOString():Ns(t)?l="function() { }":l=t.toString(),j.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:a.label},et(s,a.quotesForFieldNames),":"),j.createElement("span",{className:u},l),!d&&j.createElement("span",{className:a.punctuation},","))}function ft(n){const s=n.value;return sl(s)?j.createElement(il,Object.assign({},n)):bs(s)&&!Cs(s)&&!Ns(s)?j.createElement(ll,Object.assign({},n)):j.createElement(ol,Object.assign({},n))}var $={"container-light":"_2IvMF _GzYRV","basic-element-style":"_2bkNM","child-fields-container":"_1BXBN","label-light":"_1MGIk","clickable-label-light":"_2YKJg _1MGIk _1MFti","punctuation-light":"_3uHL6 _3eOF8","value-null-light":"_2T6PJ","value-undefined-light":"_1Gho6","value-string-light":"_vGjyY","value-number-light":"_1bQdo","value-boolean-light":"_3zQKs","value-other-light":"_1xvuR","collapse-icon-light":"_oLqym _f10Tu _1MFti _1LId0","expand-icon-light":"_2AXVT _f10Tu _1MFti _1UmXx","collapsed-content-light":"_2KJWg _1pNG9 _1MFti","container-dark":"_11RoI _GzYRV","expand-icon-dark":"_17H2C _f10Tu _1MFti _1UmXx","collapse-icon-dark":"_3QHg2 _f10Tu _1MFti _1LId0","collapsed-content-dark":"_3fDAz _1pNG9 _1MFti","label-dark":"_2bSDX","clickable-label-dark":"_1RQEj _2bSDX _1MFti","punctuation-dark":"_gsbQL _3eOF8","value-null-dark":"_LaAZe","value-undefined-dark":"_GTKgm","value-string-dark":"_Chy1W","value-number-dark":"_2bveF","value-boolean-dark":"_2vRm-","value-other-dark":"_1prJR"};const Ss={collapseJson:"collapse JSON",expandJson:"expand JSON"},ct={container:$["container-light"],basicChildStyle:$["basic-element-style"],childFieldsContainer:$["child-fields-container"],label:$["label-light"],clickableLabel:$["clickable-label-light"],nullValue:$["value-null-light"],undefinedValue:$["value-undefined-light"],stringValue:$["value-string-light"],booleanValue:$["value-boolean-light"],numberValue:$["value-number-light"],otherValue:$["value-other-light"],punctuation:$["punctuation-light"],collapseIcon:$["collapse-icon-light"],expandIcon:$["expand-icon-light"],collapsedContent:$["collapsed-content-light"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:Ss,stringifyStringValues:!1},rl={container:$["container-dark"],basicChildStyle:$["basic-element-style"],childFieldsContainer:$["child-fields-container"],label:$["label-dark"],clickableLabel:$["clickable-label-dark"],nullValue:$["value-null-dark"],undefinedValue:$["value-undefined-dark"],stringValue:$["value-string-dark"],booleanValue:$["value-boolean-dark"],numberValue:$["value-number-dark"],otherValue:$["value-other-dark"],punctuation:$["punctuation-dark"],collapseIcon:$["collapse-icon-dark"],expandIcon:$["expand-icon-dark"],collapsedContent:$["collapsed-content-dark"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:Ss,stringifyStringValues:!1},cl=()=>!0,dl=n=>{let{data:s,style:t=ct,shouldExpandNode:a=cl,clickToExpandNode:d=!1,beforeExpandChange:l,compactTopLevel:u,...g}=n;const i=j.useRef(null);return j.createElement("div",Object.assign({"aria-label":"JSON view"},g,{className:t.container,ref:i,role:"tree"}),u&&bs(s)?Object.entries(s).map(h=>{let[o,r]=h;return j.createElement(ft,{key:o,field:o,value:r,style:{...ct,...t},lastElement:!0,level:1,shouldExpandNode:a,clickToExpandNode:d,beforeExpandChange:l,outerRef:i})}):j.createElement(ft,{value:s,style:{...ct,...t},lastElement:!0,level:0,shouldExpandNode:a,clickToExpandNode:d,outerRef:i,beforeExpandChange:l}))},hl="_container_17kea_1",ul={container:hl},ml={...rl,container:"rjv-container"};class tt extends W.Component{shouldComponentUpdate(s){return s.data!==this.props.data||s.defaultExpand!==this.props.defaultExpand||s.expandNode!==this.props.expandNode}render(){const{data:s,defaultExpand:t,expandNode:a}=this.props;if(s==null)return null;const d=typeof a=="function"?a:t==="all"?()=>!0:t==="root"?l=>l<2:l=>l<1;return e.jsx("div",{className:ul.container,children:e.jsx(dl,{data:s,shouldExpandNode:d,style:ml})})}}function pl({currentId:n,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const a=s.findIndex(l=>l===n),d=t==="ArrowUp"?-1:1;return a>=0?s[a+d]??null:null}const gl="_root_9isis_1",fl="_sidebar_9isis_9",xl="_section_9isis_18",yl="_sectionHeader_9isis_22",vl="_arrow_9isis_48",jl="_sectionTitle_9isis_54",Cl="_sectionCount_9isis_62",bl="_sectionBody_9isis_71",Nl="_historyToggle_9isis_76",_l="_historyToggleLabel_9isis_102",Sl="_item_9isis_107",kl="_itemActive_9isis_133",wl="_itemContent_9isis_143",Tl="_itemLabel_9isis_149",Ml="_itemSublabel_9isis_157",El="_itemTime_9isis_166",Rl="_content_9isis_175",Il="_contentEmpty_9isis_183",Ll="_contentInner_9isis_190",Pl="_emptyWrap_9isis_194",Al="_roleHeader_9isis_202",Bl="_roleBadge_9isis_210",Dl="_role_user_9isis_219",Ol="_role_assistant_9isis_225",Fl="_roleLabel_9isis_231",$l="_contentTime_9isis_238",Hl="_turnDivider_9isis_246",zl="_textBlock_9isis_253",Vl="_textBlockBar_9isis_260",Ul="_textBlockBody_9isis_269",ql="_textBlockCompact_9isis_277",Wl="_textBlockCompactFloat_9isis_284",Kl="_thinkingBlock_9isis_291",Gl="_thinkingHeader_9isis_299",Jl="_thinkingPreview_9isis_314",Ql="_thinkingBody_9isis_324",Yl="_toolBlock_9isis_330",Xl="_toolBlockResult_9isis_337",Zl="_toolBlockError_9isis_341",ei="_toolBlockHeader_9isis_345",ti="_toolBlockBody_9isis_356",si="_toolName_9isis_361",ai="_toolId_9isis_367",ni="_errorLabel_9isis_374",li="_blockTag_9isis_384",ii="_blockTagText_9isis_397",oi="_blockTagThinking_9isis_403",ri="_blockTagResult_9isis_409",ci="_blockTagError_9isis_415",di="_jsonBlock_9isis_422",hi="_jsonBlockLabel_9isis_429",ui="_blockSeparator_9isis_439",mi="_markdownBody_9isis_446",w={root:gl,sidebar:fl,section:xl,sectionHeader:yl,arrow:vl,sectionTitle:jl,sectionCount:Cl,sectionBody:bl,historyToggle:Nl,historyToggleLabel:_l,item:Sl,itemActive:kl,itemContent:wl,itemLabel:Tl,itemSublabel:Ml,itemTime:El,content:Rl,contentEmpty:Il,contentInner:Ll,emptyWrap:Pl,roleHeader:Al,roleBadge:Bl,role_user:Dl,role_assistant:Ol,roleLabel:Fl,contentTime:$l,turnDivider:Hl,textBlock:zl,textBlockBar:Vl,textBlockBody:Ul,textBlockCompact:ql,textBlockCompactFloat:Wl,thinkingBlock:Kl,thinkingHeader:Gl,thinkingPreview:Jl,thinkingBody:Ql,toolBlock:Yl,toolBlockResult:Xl,toolBlockError:Zl,toolBlockHeader:ei,toolBlockBody:ti,toolName:si,toolId:ai,errorLabel:ni,blockTag:li,blockTagText:ii,blockTagThinking:oi,blockTagResult:ri,blockTagError:ci,jsonBlock:di,jsonBlockLabel:hi,blockSeparator:ui,markdownBody:mi},{Text:pi}=es;function xt(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(n)){const s=[];for(const t of n)if(t)if(t.type==="text"){const a=(t.text||"").trim();a&&s.push({type:"markdown",text:a})}else if(t.type==="tool_use")s.push({type:"tool_use",name:t.name||"unknown",id:t.id||"",input:t.input??{}});else if(t.type==="tool_result"){const a=gi(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:a})}else if(t.type==="thinking"){const a=t.thinking||"";a.trim()&&s.push({type:"thinking",text:a})}else t.type==="image"?s.push({type:"json",label:"image",data:t}):s.push({type:"json",label:t.type||"block",data:t});return s}return[{type:"json",label:"content",data:n}]}function gi(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(n)?n.flatMap(s=>{if(!s)return[];if(s.type==="text"){const t=(s.text||"").trim();return t?[{type:"markdown",text:t}]:[]}return[{type:"json",label:s.type||"block",data:s}]}):[{type:"json",label:"content",data:n}]}function fi(n){if(!n)return null;if(typeof n=="string")return[{type:"markdown",text:n}];if(Array.isArray(n)){const s=[];return n.forEach((t,a)=>{a>0&&s.push({type:"separator"}),t&&(typeof t=="string"?s.push({type:"markdown",text:t}):t.type==="text"?s.push({type:"markdown",text:t.text||""}):s.push({type:"json",label:t.type||"item",data:t}))}),s}return[{type:"json",label:"system",data:n}]}function xi(n){const s=[],t=(n==null?void 0:n.name)||"unknown",a=(n==null?void 0:n.description)||"";let d=`### ${t}
28
+
29
+ `;a&&(d+=`${a}
30
+
31
+ `),s.push({type:"markdown",text:d});const l=(n==null?void 0:n.input_schema)||(n==null?void 0:n.parameters)||null;return l&&s.push({type:"json",label:"Parameters",data:l}),s}function yi(n){var s;if(typeof n=="string")return n.slice(0,60).replace(/\n/g," ");if(Array.isArray(n)){for(const t of n)if((t==null?void 0:t.type)==="text"&&((s=t.text)!=null&&s.trim()))return t.text.trim().slice(0,60).replace(/\n/g," ")}return""}function vi(n){var a;const s=[];let t=0;for(;t<n.length;){const d=n[t];if((d==null?void 0:d.role)!=="user"){t++;continue}const l=((a=n[t+1])==null?void 0:a.role)==="assistant"?n[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:d._timestamp||null,assistantTimestamp:(l==null?void 0:l._timestamp)||null,userBlocks:xt(d==null?void 0:d.content),assistantBlocks:l?xt(l.content):null,preview:yi(d==null?void 0:d.content)}),t+=l?2:1}return s}function yt(n){try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function ji({text:n,compact:s}){const t=ts(n);return s?e.jsx("div",{className:w.textBlockCompact,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:w.textBlock,children:[e.jsx("div",{className:w.textBlockBar,children:e.jsx("span",{className:`${w.blockTag} ${w.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${w.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function Ci({block:n}){const[s,t]=j.useState(!0),a=n.text.length>60?n.text.slice(0,60).replace(/\n/g," ")+"…":n.text.replace(/\n/g," ");return e.jsxs("div",{className:w.thinkingBlock,children:[e.jsxs("div",{className:w.thinkingHeader,onClick:()=>t(d=>!d),children:[s?e.jsx(Le,{className:w.arrow}):e.jsx(Pe,{className:w.arrow}),e.jsx("span",{className:`${w.blockTag} ${w.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:w.thinkingPreview,children:a})]}),s&&e.jsx("div",{className:w.thinkingBody,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:ts(n.text)}})})]})}function st({blocks:n,compact:s}){return!n||n.length===0?null:e.jsx(e.Fragment,{children:n.map((t,a)=>e.jsx(bi,{block:t,compact:s},a))})}function bi({block:n,compact:s}){var t;return n.type==="separator"?e.jsx("hr",{className:w.blockSeparator}):n.type==="markdown"?(t=n.text)!=null&&t.trim()?e.jsx(ji,{text:n.text,compact:s}):null:n.type==="thinking"?e.jsx(Ci,{block:n}):n.type==="tool_use"?e.jsxs("div",{className:w.toolBlock,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:w.blockTag,children:"tool_use"}),e.jsx("span",{className:w.toolName,children:n.name}),n.id&&e.jsx("span",{className:w.toolId,children:n.id})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(tt,{data:n.input,defaultExpand:"root"})})]}):n.type==="tool_result"?e.jsxs("div",{className:`${w.toolBlock} ${n.is_error?w.toolBlockError:w.toolBlockResult}`,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:`${w.blockTag} ${n.is_error?w.blockTagError:w.blockTagResult}`,children:"tool_result"}),n.tool_use_id&&e.jsx("span",{className:w.toolId,children:n.tool_use_id}),n.is_error&&e.jsx("span",{className:w.errorLabel,children:"error"})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(st,{blocks:n.content,compact:!0})})]}):n.type==="json"?e.jsxs("div",{className:w.jsonBlock,children:[n.label&&e.jsx("div",{className:w.jsonBlockLabel,children:n.label}),e.jsx(tt,{data:n.data,defaultExpand:"root"})]}):null}function Ni({turn:n}){const s=n.timestamp?yt(n.timestamp):null,t=n.assistantTimestamp?yt(n.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_user}`,children:"user"}),e.jsx("span",{className:w.roleLabel,children:`Turn ${n.turnIndex+1}`}),s&&e.jsx("span",{className:w.contentTime,children:s})]}),e.jsx(st,{blocks:n.userBlocks}),n.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:w.turnDivider}),e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:w.contentTime,children:t})]}),e.jsx(st,{blocks:n.assistantBlocks})]})]})}function _i({sectionKey:n,title:s,items:t,historyItems:a=[],onSelect:d,onSelectById:l,selectedId:u,sidebarRef:g}){const[i,h]=j.useState(n!=="tools"),[o,r]=j.useState(!1),m=t.length+a.length,v=`${n}__history_toggle`;function x(C){var N;const k=(N=g.current)==null?void 0:N.querySelector(`[data-context-sidebar-control="${C}"]`);k&&(k.focus(),k.scrollIntoView({block:"nearest"}))}function f(C,k){var T;const N=Array.from(((T=g.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(E=>E.dataset.contextSidebarControl).filter(Boolean),b=pl({currentId:k,visibleIds:N,key:C.key});b&&(C.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var L;x(b);const E=(L=g.current)==null?void 0:L.querySelector(`[data-context-sidebar-control="${b}"]`);(E==null?void 0:E.dataset.controlType)==="item"&&l(b)}))}function y(C){const k=u===C.id;return e.jsxs("button",{type:"button",className:`${w.item} ${k?w.itemActive:""}`,onClick:()=>d(C),onKeyDown:N=>f(N,C.id),"aria-current":k?"true":void 0,"data-context-sidebar-control":C.id,"data-control-type":"item",children:[e.jsxs("div",{className:w.itemContent,children:[e.jsx("span",{className:w.itemLabel,children:C.label}),C.sublabel&&!k&&e.jsx("div",{className:w.itemSublabel,children:C.sublabel})]}),C.time&&e.jsx("span",{className:w.itemTime,children:C.time})]},C.id)}return e.jsxs("div",{className:w.section,children:[e.jsxs("button",{type:"button",className:w.sectionHeader,onClick:()=>h(C=>!C),"aria-expanded":i,children:[i?e.jsx(Le,{className:w.arrow}):e.jsx(Pe,{className:w.arrow}),e.jsx("span",{className:w.sectionTitle,children:s}),e.jsx("span",{className:w.sectionCount,children:m})]}),i&&e.jsxs("div",{className:w.sectionBody,children:[a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:w.historyToggle,onClick:()=>r(C=>!C),onKeyDown:C=>f(C,v),"aria-expanded":o,"data-context-sidebar-control":v,"data-control-type":"toggle",children:[o?e.jsx(Le,{className:w.arrow}):e.jsx(Pe,{className:w.arrow}),e.jsxs("span",{className:w.historyToggleLabel,children:[p("ui.context.history")," (",a.length,")"]})]}),o&&a.map(y)]}),t.map(y)]})]})}function Si({body:n,response:s}){const[t,a]=j.useState(null),d=j.useRef(null),l=j.useMemo(()=>{if(!Array.isArray(n==null?void 0:n.messages))return[];const o=vi(n.messages);if(o.length===0)return o;const r=o[o.length-1],m=s!=null&&s.content?xt(s.content):null;return[...o.slice(0,-1),{...r,assistantBlocks:m??r.assistantBlocks}]},[n,s]);if(j.useEffect(()=>{l.length>0?a(l[l.length-1]):a(null)},[n,s]),!n||typeof n!="object")return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ie,{description:p("ui.context.noData")})});const u=[];Array.isArray(n.tools)&&n.tools.length>0&&u.push({key:"tools",title:e.jsxs(e.Fragment,{children:[p("ui.context.tools")," ",e.jsx(oe,{doc:"ToolsFirst"})]}),items:n.tools.map((o,r)=>({id:`tool__${r}`,label:(o==null?void 0:o.name)||`Tool ${r}`,blocks:xi(o)}))});const g=fi(n.system);if(g!=null&&u.push({key:"system",title:p("ui.context.systemPrompt"),items:[{id:"system__0",label:p("ui.context.systemPrompt"),blocks:g}]}),l.length>0){const o=x=>({...x,label:p("ui.context.historyTurnNoTime",{n:x.turnIndex+1}),time:x.timestamp?yt(x.timestamp):null,sublabel:x.preview||void 0}),r=x=>({...x,label:p("ui.context.currentTurn"),sublabel:x.preview||void 0}),m=l.slice(0,-1).map(o),v=r(l[l.length-1]);u.push({key:"messages",title:p("ui.context.messages"),historyItems:m.length>0?m:void 0,items:[v]})}if(u.length===0)return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ie,{description:p("ui.context.noFields")})});const i=t!=null&&t.isTurn?l.find(o=>o.id===t.id)??null:t,h=new Map;return u.forEach(o=>{(o.historyItems||[]).forEach(r=>h.set(r.id,r)),o.items.forEach(r=>h.set(r.id,r))}),e.jsxs("div",{className:w.root,children:[e.jsx("div",{ref:d,className:w.sidebar,children:u.map(o=>e.jsx(_i,{sectionKey:o.key,title:o.title,items:o.items,historyItems:o.historyItems,selectedId:i==null?void 0:i.id,onSelect:r=>a(r),onSelectById:r=>{const m=h.get(r);m&&a(m)},sidebarRef:d},o.key))}),e.jsx("div",{className:w.content,children:i==null?e.jsx("div",{className:w.contentEmpty,children:e.jsx(pi,{type:"secondary",children:p("ui.context.selectPrompt")})}):e.jsx("div",{className:w.contentInner,children:i.isTurn?e.jsx(Ni,{turn:i}):e.jsxs(e.Fragment,{children:[i.role&&e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w[`role_${i.role}`]||""}`,children:i.role}),e.jsx("span",{className:w.roleLabel,children:i.label})]}),e.jsx(st,{blocks:i.blocks})]})},i.id)})]})}const ki="_container_1yyka_1",wi="_emptyState_1yyka_9",Ti="_urlSection_1yyka_16",Mi="_urlLeft_1yyka_23",Ei="_tokenStatsBox_1yyka_28",Ri="_tokenGrid_1yyka_35",Ii="_tokenRows_1yyka_45",Li="_tokenRow_1yyka_45",Pi="_tokenRowBorder_1yyka_53",Ai="_tokenLabel_1yyka_57",Bi="_tokenTd_1yyka_64",Di="_tokenHitRate_1yyka_73",Oi="_tokenHitRateLabel_1yyka_86",Fi="_urlText_1yyka_96",$i="_metaText_1yyka_103",Hi="_headersContainer_1yyka_107",zi="_headerRow_1yyka_111",Vi="_headerKey_1yyka_117",Ui="_headerValue_1yyka_122",qi="_streamingBox_1yyka_127",Wi="_rawTextPre_1yyka_140",Ki="_tabContent_1yyka_153",Gi="_bodyLabel_1yyka_161",Ji="_bodyHeader_1yyka_165",Qi="_diffSection_1yyka_172",Yi="_diffToggle_1yyka_176",Xi="_diffIcon_1yyka_182",Zi="_reminderSelect_1yyka_208",eo="_diffHeaderRow_1yyka_227",to="_diffSpaceRight_1yyka_233",so="_reminderFilterWrapper_1yyka_237",ao="_reminderLabel_1yyka_243",no="_cacheTabContent_1yyka_249",lo="_userPromptList_1yyka_254",io="_userPromptItem_1yyka_260",oo="_userPromptNavBtn_1yyka_271",ro="_cacheContent_1yyka_282",co="_cacheTokenBar_1yyka_289",ho="_cacheTokenWrite_1yyka_299",uo="_cacheTokenRead_1yyka_303",mo="_cacheCopyIcon_1yyka_307",po="_cacheScrollArea_1yyka_314",go="_cacheSectionBlock_1yyka_320",fo="_cacheSectionHeader_1yyka_324",xo="_cacheCollapseArrow_1yyka_336",yo="_cachePre_1yyka_342",vo="_cacheHighlightSvg_1yyka_356",jo="_cachePreSystem_1yyka_365",S={container:ki,emptyState:wi,urlSection:Ti,urlLeft:Mi,tokenStatsBox:Ei,tokenGrid:Ri,tokenRows:Ii,tokenRow:Li,tokenRowBorder:Pi,tokenLabel:Ai,tokenTd:Bi,tokenHitRate:Di,tokenHitRateLabel:Oi,urlText:Fi,metaText:$i,headersContainer:Hi,headerRow:zi,headerKey:Vi,headerValue:Ui,streamingBox:qi,rawTextPre:Wi,tabContent:Ki,bodyLabel:Gi,bodyHeader:Ji,diffSection:Qi,diffToggle:Yi,diffIcon:Xi,reminderSelect:Zi,diffHeaderRow:eo,diffSpaceRight:to,reminderFilterWrapper:so,reminderLabel:ao,cacheTabContent:no,userPromptList:lo,userPromptItem:io,userPromptNavBtn:oo,cacheContent:ro,cacheTokenBar:co,cacheTokenWrite:ho,cacheTokenRead:uo,cacheCopyIcon:mo,cacheScrollArea:po,cacheSectionBlock:go,cacheSectionHeader:fo,cacheCollapseArrow:xo,cachePre:yo,cacheHighlightSvg:vo,cachePreSystem:jo},{Text:he,Paragraph:Co}=es;class bo extends W.Component{constructor(s){super(s),this.state={bodyViewMode:{request:"json",response:"json",diff:"json"},diffExpanded:!1,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null,cacheHighlightIdx:null,cacheHighlightFading:!1,cacheCollapsed:{tools:!1,system:!1,messages:!1}}}_cacheUnbindScrollFade(){this._cacheOnScrollFade&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scroll",this._cacheOnScrollFade),this._cacheOnScrollFade=null)}_cacheClearAllTimers(){clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scrollend",this._cacheScrollEndHandler),this._cacheScrollEndHandler=null)}componentWillUnmount(){this._cacheClearAllTimers()}_cacheBindScrollFade(){this._cacheUnbindScrollFade();const s=this._cacheScrollEl;s&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},s.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(s){if(this.state.cacheCollapsed.messages){this.setState(g=>({cacheCollapsed:{...g.cacheCollapsed,messages:!1}}),()=>this.scrollToCacheMsg(s));return}const t=this._cacheScrollEl;if(!t)return;const a=t.querySelector(`[data-msg-idx="${s}"]`);if(!a)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&t.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let d=!1,l=!1;const u=()=>{!d||!l||(this.setState({cacheHighlightIdx:s,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===s&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),d=!0,u()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),d=!0,u()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{l=!0,u()},500),a.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const d=Se(s.request);this.setState({diffExpanded:d&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const a=s.currentTab==="kv-cache-text";return s.request!==this.props.request||s.currentTab!==this.props.currentTab||s.onTabChange!==this.props.onTabChange||s.selectedIndex!==this.props.selectedIndex||s.expandDiff!==this.props.expandDiff||s.pendingCacheHighlight!==this.props.pendingCacheHighlight||t.bodyViewMode!==this.state.bodyViewMode||a&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||a&&t.cacheHighlightFading!==this.state.cacheHighlightFading||t.diffExpanded!==this.state.diffExpanded||t.requestHeadersExpanded!==this.state.requestHeadersExpanded||t.responseHeadersExpanded!==this.state.responseHeadersExpanded||t.reminderFilters!==this.state.reminderFilters||a&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var a,d;this.scrollToCacheMsg(t.msgIdx),(d=(a=this.props).onCacheHighlightDone)==null||d.call(a)},150)}toggleBodyViewMode(s){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[s]:t.bodyViewMode[s]==="json"?"text":"json"}}))}copyBody(s){var u;const{request:t}=this.props;if(!t)return;let a;if(s==="diff"?a=this._lastDiffResult:a=s==="request"?t.body:(u=t.response)==null?void 0:u.body,a==null)return;const d=typeof a=="object"?it(a):a,l=typeof d=="string"?d:JSON.stringify(d,null,2);navigator.clipboard.writeText(l).then(()=>J.success(p("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(he,{type:"secondary",children:p("ui.noHeaders")}):e.jsx("div",{className:S.headersContainer,children:Object.entries(s).map(([t,a])=>e.jsxs("div",{className:S.headerRow,children:[e.jsx(he,{code:!0,className:S.headerKey,children:t}),t==="authorization"&&e.jsx(oe,{doc:"TranslateContextPollution"}),e.jsx(he,{type:"secondary",className:S.headerValue,children:String(a)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:a,requests:d,selectedIndex:l}=this.props;if(!a)return;const u=d&&l!=null?d[l+1]:null,{type:g}=We(a,u);let i=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(s.messages)){i=new Set,i.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")It(m)&&i.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&It(x.text)&&(i.add(x),v=!0);v&&(i.add(r),i.add(m))}}}let h=null;if(this.state.reminderFilters==="skills"&&Array.isArray(s.messages)){h=new Set,h.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")Lt(m)&&h.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&Lt(x.text)&&(h.add(x),v=!0);v&&(h.add(r),h.add(m))}}}const o=i||h;if(g==="Preflight"){const r=new Set,m=v=>{v&&typeof v=="object"&&(r.add(v),Array.isArray(v)?v.forEach(m):Object.values(v).forEach(m))};return Array.isArray(s.messages)&&m(s.messages),Array.isArray(s.system)&&s.system.length>=3&&m(s.system[2]),(v,x,f)=>!!(v<2||r.has(x)||o&&o.has(x)||v===1&&f==="system")}if(g==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const r=s.messages[0],m=r&&Array.isArray(r.content)?r.content:null,v=m&&m.length>0?m[m.length-1]:null,x=new Set,f=y=>{y&&typeof y=="object"&&(x.add(y),Array.isArray(y)?y.forEach(f):Object.values(y).forEach(f))};return v&&f(v),x.add(s.messages),r&&typeof r=="object"&&x.add(r),m&&x.add(m),(y,C,k)=>!!(y<2||x.has(C)||o&&o.has(C))}if(o)return(r,m,v)=>!!(r<2||o.has(m))}renderBody(s,t){const{bodyViewMode:a}=this.state;if(s==null)return e.jsx(he,{type:"secondary",children:p("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:S.streamingBox,children:e.jsx(he,{type:"secondary",children:p("ui.streamingResponse")})});const d=typeof s=="object"?it(s):s,l=a[t]==="json",u=this.getRequestExpandNode(d,t);return e.jsx("div",{children:l?e.jsx(tt,{data:d,defaultExpand:t==="response"?"all":"root",expandNode:u}):e.jsx("pre",{className:S.rawTextPre,children:typeof d=="string"?d:JSON.stringify(d,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let a=t-1;a>=0;a--)if(Se(s[a])){const d=s[a];return d._slimmed?Pt(d,this.props.allRequests||s):d}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const a={},d=new Set([...Object.keys(s),...Object.keys(t)]);for(const l of d)if(!l.startsWith("_"))if(!(l in s))a[l]=t[l];else if(l in t){const u=JSON.stringify(s[l]),g=JSON.stringify(t[l]);u!==g&&(l==="messages"&&Array.isArray(s[l])&&Array.isArray(t[l])&&t[l].length>s[l].length?a[l]=t[l].slice(s[l].length):a[l]=t[l])}else continue;return Object.keys(a).length?a:null}render(){var m,v,x;let{request:s,currentTab:t,onTabChange:a}=this.props;if(!s)return e.jsx("div",{className:S.emptyState,children:e.jsx(Ie,{description:"选择一个请求查看详情"})});s._slimmed&&(s=Pt(s,this.props.allRequests||this.props.requests));const d=new Date(s.timestamp).toLocaleString("zh-CN"),l=s.response&&s.response.status<400;let u=null;if(Se(s)){const f=this.getPrevMainAgentRequest();if(f){const y=JSON.stringify(s.body).length,C=JSON.stringify(f.body).length;if(y<C)u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(N=>({diffExpanded:!N.diffExpanded})),children:["Body Diff JSON ",e.jsx(oe,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Le,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsx(he,{type:"secondary",children:p("ui.diffSessionChanged")})]});else{const N=it(this.computeDiff(f.body,s.body));N&&(this._lastDiffResult=N,u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs("div",{className:S.diffHeaderRow,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(b=>({diffExpanded:!b.diffExpanded})),children:["Body Diff JSON ",e.jsx(oe,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Le,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsxs(ze,{size:"small",className:S.diffSpaceRight,children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Qe,{}):e.jsx(Ye,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(He,{}),onClick:()=>this.copyBody("diff"),children:p("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(tt,{data:N,defaultExpand:"all"}):e.jsx("pre",{className:S.rawTextPre,children:JSON.stringify(N,null,2)})})]}))}}}const g=ma(s.body),i=pa(s.body),h=[{key:"request",label:"Request",children:e.jsxs("div",{className:S.tabContent,children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(f=>({requestHeadersExpanded:!f.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Le,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),u,e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(he,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(oe,{doc:"BodyFields"})]}),e.jsxs(ze,{size:"small",children:[(g||i)&&e.jsxs("span",{className:S.reminderFilterWrapper,children:[e.jsx("span",{className:S.reminderLabel,children:"system-reminder:"}),e.jsx(Ue,{size:"small",className:S.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:f=>this.setState({reminderFilters:f||null}),options:[{label:"CLAUDE.md",value:"claudeMd",disabled:!g},{label:"Skills",value:"skills",disabled:!i}],popupMatchSelectWidth:!1,allowClear:!0})]}),e.jsx(F,{size:"small",icon:this.state.bodyViewMode.request==="json"?e.jsx(Qe,{}):e.jsx(Ye,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(He,{}),onClick:()=>this.copyBody("request"),children:p("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:S.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(f=>({responseHeadersExpanded:!f.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Le,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(he,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(oe,{doc:"ResponseFields"})]}),e.jsxs(ze,{size:"small",children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Qe,{}):e.jsx(Ye,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(He,{}),onClick:()=>this.copyBody("response"),children:p("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(Ie,{description:p("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(oe,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${S.tabContent} ${S.cacheTabContent}`,children:(()=>{const f=Jt([s]),y=s.timestamp+"|"+s.url;if(f&&(f.cacheCreateTokens>0||f.cacheReadTokens>0)&&(this._lastCachedTokensKey=y,this._lastCachedTokens={cacheCreateTokens:f.cacheCreateTokens,cacheReadTokens:f.cacheReadTokens}),!f||f.system.length===0&&f.messages.length===0&&f.tools.length===0)return e.jsx(Ie,{description:p("ui.noCachedContent"),image:Ie.PRESENTED_IMAGE_SIMPLE});const C=()=>{const b=[];return f.tools.length>0&&(b.push(`=== ${p("ui.tools")} ===`),f.tools.forEach(T=>b.push(T))),f.system.length>0&&(b.push(`
32
+ === ${p("ui.systemPrompt")} ===`),f.system.forEach(T=>b.push(T))),f.messages.length>0&&(b.push(`
33
+ === ${p("ui.messages")} ===`),f.messages.forEach(T=>b.push(T))),b.join(`
34
+
35
+ `)},k=f.messages.map((b,T)=>({text:b,msgIdx:T})).filter(({text:b})=>b.startsWith("[user]")).map(({text:b,msgIdx:T})=>{const E=b.replace(/^\[user\]\s*/,"").trim();return!E||qe(E)?{cleaned:"",msgIdx:T}:{cleaned:Ze.parseSegments(E).filter(M=>M.type==="text").map(M=>M.content.trim()).filter(M=>M&&!qe(M)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:b})=>!(!b||/Implement the following plan:/i.test(b))),N=k.length>0?e.jsx("div",{className:S.userPromptList,children:k.map(({cleaned:b,msgIdx:T})=>e.jsx("div",{className:S.userPromptItem,onMouseEnter:E=>{E.currentTarget.style.background="rgba(22,104,220,0.2)",E.currentTarget.style.color="#fff"},onMouseLeave:E=>{E.currentTarget.style.background="",E.currentTarget.style.color="#ccc"},onClick:()=>this.scrollToCacheMsg(T),children:b},T))}):null;return e.jsxs("div",{className:S.cacheContent,children:[(()=>{const T=f.cacheCreateTokens>0||f.cacheReadTokens>0?f:this._lastCachedTokensKey===y?this._lastCachedTokens:null;return T||N?e.jsxs("div",{className:S.cacheTokenBar,children:[T&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:S.cacheTokenWrite,children:["write ",G(T.cacheCreateTokens)]})," / ",e.jsxs("span",{className:S.cacheTokenRead,children:["read ",G(T.cacheReadTokens)]}),e.jsx(Zt,{title:p("ui.copyAllCacheText"),children:e.jsx(He,{className:S.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(C()).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}})})]}),N&&e.jsx($e,{content:N,trigger:"hover",placement:"left",children:e.jsx("span",{className:S.userPromptNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:S.cacheScrollArea,ref:b=>{this._cacheScrollEl=b},children:[f.tools.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,tools:!b.cacheCollapsed.tools}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.tools")," (",f.tools.length,")"]}),!this.state.cacheCollapsed.tools&&f.tools.map((b,T)=>e.jsx("pre",{className:S.cachePre,children:b},T))]}),f.system.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,system:!b.cacheCollapsed.system}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.systemPrompt")," (",f.system.length,")"]}),!this.state.cacheCollapsed.system&&f.system.map((b,T)=>e.jsx("pre",{className:S.cachePreSystem,children:b},T))]}),f.messages.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,messages:!b.cacheCollapsed.messages}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.messages")," (",f.messages.length,")"]}),!this.state.cacheCollapsed.messages&&f.messages.map((b,T)=>{const E=T===this.state.cacheHighlightIdx,L=E?this.state.cacheHighlightFading?{boxShadow:"0 0 10px rgba(22,104,220,0)",transition:"box-shadow 3s ease-out",position:"relative"}:{boxShadow:"0 0 10px rgba(22,104,220,0.6)",transition:"box-shadow 0.2s ease-in",position:"relative"}:{};return e.jsxs("pre",{"data-msg-idx":T,className:S.cachePre,style:L,children:[E&&e.jsx("svg",{className:S.cacheHighlightSvg,style:{opacity:this.state.cacheHighlightFading?0:1,transition:this.state.cacheHighlightFading?"opacity 3s ease-out":void 0},preserveAspectRatio:"none",children:e.jsx("rect",{x:"0.5",y:"0.5",width:"calc(100% - 1px)",height:"calc(100% - 1px)",rx:"4",ry:"4",fill:"none",stroke:"#1668dc",strokeWidth:"1",strokeDasharray:"6 4",children:e.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"-100",dur:"4s",repeatCount:"indefinite"})})}),b]},T)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${S.tabContent} ${S.cacheTabContent}`,children:e.jsx(Si,{body:s.body,response:(m=s.response)==null?void 0:m.body})})}],o=(x=(v=s.response)==null?void 0:v.body)==null?void 0:x.usage,r=o?(()=>{const f=o.input_tokens||0,y=o.output_tokens||0,C=o.cache_creation_input_tokens||0,k=o.cache_read_input_tokens||0,N=f+C+k,b=N>0?(k/N*100).toFixed(1):"0.0";return{input:f,output:y,cacheCreate:C,cacheRead:k,hitRate:b}})():null;return e.jsxs("div",{className:S.container,children:[e.jsxs("div",{className:S.urlSection,children:[e.jsxs("div",{className:S.urlLeft,children:[e.jsx(Co,{className:S.urlText,ellipsis:{rows:2,expandable:!0},children:s.url}),e.jsxs(ze,{size:"small",wrap:!0,children:[e.jsx(pe,{color:s.method==="POST"?"blue":"green",children:s.method}),e.jsxs(he,{type:"secondary",className:S.metaText,children:["🕐 ",d]}),s.duration&&e.jsxs(he,{type:"secondary",className:S.metaText,children:["⏱️ ",s.duration,"ms"]}),s.response&&e.jsxs(pe,{color:l?"success":"error",children:["HTTP ",s.response.status]})]})]}),r&&e.jsx("div",{className:S.tokenStatsBox,children:e.jsxs("div",{className:S.tokenGrid,children:[e.jsxs("div",{className:S.tokenRows,children:[e.jsxs("div",{className:S.tokenRow,children:[e.jsx("span",{className:S.tokenLabel,children:"Token"}),e.jsxs("span",{className:S.tokenTd,children:["input: ",G(r.input)]}),e.jsxs("span",{className:S.tokenTd,children:["output: ",G(r.output)]})]}),e.jsxs("div",{className:`${S.tokenRow} ${S.tokenRowBorder}`,children:[e.jsx("span",{className:S.tokenLabel,children:"Cache"}),e.jsxs("span",{className:S.tokenTd,children:["create: ",G(r.cacheCreate)]}),e.jsxs("span",{className:S.tokenTd,children:["read: ",G(r.cacheRead)]})]})]}),e.jsxs("div",{className:S.tokenHitRate,children:[e.jsxs("div",{children:[r.hitRate,"%"]}),e.jsx("div",{className:S.tokenHitRateLabel,children:p("ui.hitRate")})]})]})})]}),e.jsx(Yt,{activeKey:t,onChange:a,items:h,size:"small"})]})}}const No="_resizer_1xl2m_1",_o={resizer:No};class So extends W.Component{constructor(s){super(s),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}handleMouseDown(s){s.preventDefault(),document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}handleMouseMove(s){this.props.onResize&&this.props.onResize(s.clientX)}handleMouseUp(){document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}componentWillUnmount(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}render(){return e.jsx("div",{onMouseDown:this.handleMouseDown,className:_o.resizer})}}class Ro extends ga{constructor(t){super(t);D(this,"handleViewRequest",t=>{this.setState({viewMode:"raw",selectedIndex:t,scrollCenter:!0})});D(this,"handleViewInChat",()=>{this.setState(t=>{const d=(t.showAll?t.requests:Ge(t.requests))[t.selectedIndex];if(!d)return null;let l=null;if(Se(d)&&d.timestamp)l=d.timestamp;else{const u=We(d);if((u.type==="SubAgent"||u.type==="Teammate")&&d.timestamp)l=d.timestamp;else{const g=t.requests.indexOf(d);g>=0&&(l=At(t.requests,g))}l||J.info(p("ui.cannotMap"))}return{viewMode:"chat",chatScrollToTs:l}})});D(this,"handleToggleViewMode",()=>{this.setState(t=>{const a=t.viewMode==="raw"?"chat":"raw";if(a==="raw"){if(t.selectedIndex===null){const u=t.showAll?t.requests:Ge(t.requests);return{viewMode:a,selectedIndex:u.length>0?u.length-1:null,scrollCenter:!0}}return{viewMode:a,scrollCenter:!0}}const d=t.showAll?t.requests:Ge(t.requests),l=t.selectedIndex!=null?d[t.selectedIndex]:null;if(l){let u=null;if(Se(l)&&l.timestamp)u=l.timestamp;else{const g=We(l);if((g.type==="SubAgent"||g.type==="Teammate")&&l.timestamp)u=l.timestamp;else{const i=t.requests.indexOf(l);i>=0&&(u=At(t.requests,i)),u||J.info(p("ui.cannotMap"))}}return{viewMode:a,chatScrollToTs:u}}return{viewMode:a,chatScrollToTs:null}},()=>{this.state.viewMode==="chat"&&this.state.terminalVisible&&this.state.cliMode&&!Es&&requestAnimationFrame(()=>{const t=document.querySelector(".xterm-helper-textarea");t&&t.focus()})})});D(this,"handleTabChange",t=>{this.setState({currentTab:t})});D(this,"handleCacheHighlightDone",()=>{this.setState({pendingCacheHighlight:null})});D(this,"handleNavigateCacheMsg",t=>{const a=this.state.showAll?this.state.requests:Ge(this.state.requests);let d=-1;for(let l=a.length-1;l>=0;l--)if(Se(a[l])){d=l;break}d<0||this.setState({selectedIndex:d,scrollCenter:!0,currentTab:"kv-cache-text",pendingCacheHighlight:{msgIdx:t,key:Date.now()}})});D(this,"handleResize",t=>{const a=this.mainContainerRef.current;if(!a)return;const d=a.getBoundingClientRect(),l=t-d.left;l>=250&&l<=800&&this.setState({leftPanelWidth:l})});D(this,"handleLoadLocalJsonlFile",()=>{const t=document.createElement("input");t.type="file",t.accept=".jsonl",t.multiple=!0,t.onchange=a=>{const d=Array.from(a.target.files);if(d.length===0)return;if(d.reduce((h,o)=>h+o.size,0)>500*1024*1024){J.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let u=0;const g=[],i=[];d.forEach(h=>{const o=new FileReader;o.onload=r=>{try{const v=r.target.result.split(`
36
+ ---
37
+ `).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);g.push(...v),i.push(h.name)}catch{}u++,u===d.length&&this._finishLocalLoad(g,i)},o.readAsText(h)})},t.click()});D(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((g,i)=>g+i.size,0)>500*1024*1024){J.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let d=0;const l=[],u=[];t.forEach(g=>{const i=new FileReader;i.onload=h=>{try{const r=h.target.result.split(`
38
+ ---
39
+ `).filter(m=>m.trim()).map(m=>{try{return JSON.parse(m)}catch{return null}}).filter(Boolean);l.push(...r),u.push(g.name)}catch{}d++,d===t.length&&this._finishLocalLoad(l,u)},i.readAsText(g)})});D(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));D(this,"_onDragOver",t=>{t.preventDefault(),!this._isInternalDrag(t)&&(this.state.isDragging||this.setState({isDragging:!0}))});D(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});D(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(d=>fa(d).then(l=>({name:d.name,path:l})).catch(l=>(J.error(`${d.name}: ${l.message}`),null)))).then(d=>{const l=d.filter(Boolean).map(u=>`"${u.path}"`);l.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...l]}))})});D(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"request",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:d,fileLoadingCount:l,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:i,leftPanelWidth:h,currentTab:o}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(xa,{theme:this.darkThemeConfig,children:[d&&e.jsx("div",{className:R.loadingOverlay,children:e.jsxs("div",{className:R.loadingText,children:["Loading...(",l,")"]})}),this.state.isDragging&&e.jsx("div",{className:R.dragOverlay,children:e.jsxs("div",{className:R.dragOverlayContent,children:[e.jsx(qt,{className:R.dragIcon}),e.jsx("p",{children:p("ui.dragDropHint")})]})}),e.jsxs(Te,{className:R.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Te.Header,{className:R.header,children:e.jsx(Ze,{requestCount:t.length,requests:t,viewMode:g,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,showFullToolContent:this.state.showFullToolContent,onShowFullToolContentChange:this.handleShowFullToolContentChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,logDir:this.state.logDir,onLogDirChange:this.handleLogDirChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(r=>({terminalVisible:!r.terminalVisible})),onReturnToWorkspaces:this.state.cliMode?this.handleReturnToWorkspaces:null,contextWindow:this.state.contextWindow,onNavigateCacheMsg:this.handleNavigateCacheMsg,serverCachedContent:this.state.serverCachedContent||this._lastKvCacheContent,resumeAutoChoice:this.state.resumeAutoChoice,onResumeAutoChoiceToggle:this.handleResumeAutoChoiceToggle,onResumeAutoChoiceChange:this.handleResumeAutoChoiceChange,themeColor:this.state.themeColor,onThemeColorChange:this.handleThemeColorChange,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),e.jsxs(Te.Content,{className:R.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:R.guideContainer,children:e.jsxs("div",{className:R.guideContent,children:[e.jsx("h2",{className:R.guideTitle,children:p("ui.guide.title")}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"1"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:p("ui.guide.step1")}),e.jsx("code",{className:R.guideCode,children:p("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"2"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:p("ui.guide.step2")}),e.jsx("code",{className:R.guideCode,children:p("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"3"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:p("ui.guide.step3")}),e.jsx("code",{className:R.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:R.mainContainer,children:[e.jsxs("div",{className:R.leftPanel,style:{width:h},children:[e.jsxs("div",{className:R.leftPanelHeader,children:[e.jsx("span",{children:p("ui.requestList")}),e.jsx("span",{className:R.leftPanelCount,children:p("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:R.leftPanelBody,children:e.jsx(Yn,{requests:t,selectedIndex:i,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(So,{onResize:this.handleResize}),e.jsx("div",{className:R.rightPanel,children:e.jsx(bo,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:i,currentTab:o,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:R.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(ya,{requests:t,mainAgentSessions:u,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,sdkMode:this._isLocalLog?!1:this.state.sdkMode,terminalVisible:this._isLocalLog||this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(r=>({terminalVisible:!r.terminalVisible})),pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:r=>this.loadSession(r),lang:this.state.lang})})]}),e.jsx("div",{className:R.footer,children:e.jsx("div",{className:R.footerRight,children:e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:R.footerLink,children:[e.jsx("svg",{className:R.footerIcon,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",this.state.githubStars!=null?` ★ ${this.state.githubStars}`:""]})})})]}),e.jsx(Ne,{title:p("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:R.resumeFooterRight,children:[e.jsx(F,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:R.btnMarginRight,children:p("ui.resume.continue")},"continue"),e.jsx(F,{onClick:()=>this.handleResumeChoice("new"),children:p("ui.resume.new")},"new")]}),e.jsx("div",{className:R.resumeFooterLeft,children:e.jsx(va,{checked:this.state.resumeRememberChoice,onChange:r=>this.setState({resumeRememberChoice:r.target.checked}),className:R.resumeCheckboxOpacity,children:e.jsx("span",{className:R.resumeCheckboxOpacity,children:p("ui.resume.remember")})})})]}),children:e.jsx("p",{children:p("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(Ne,{title:e.jsxs("span",{className:R.modalTitleInline,children:[e.jsx(Xt,{apiEndpoint:ie("/api/open-log-dir"),title:p("ui.openLogDir"),size:16}),p("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:R.modalActions,children:[e.jsx(F,{icon:e.jsx(qt,{}),onClick:this.handleLoadLocalJsonlFile,children:p("ui.loadLocalJsonl")}),e.jsx(F,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:R.btnMarginLeft,children:p("ui.mergeLogs")}),e.jsx(F,{size:"small",danger:!0,icon:e.jsx(ut,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:R.btnMarginLeft,children:p("ui.deleteLogs")}),e.jsx(F,{size:"small",icon:e.jsx(mt,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:R.btnMarginLeft,children:p("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:R.spinCenter,children:e.jsx(Qt,{})}):(()=>{const r=this.state.localLogs[this.state.currentProject];return!r||r.length===0?e.jsx("div",{className:R.emptyCenter,children:p("ui.noLogs")}):e.jsx("div",{className:R.logListContainer,children:this.renderLogTable(r,!1)})})()]})]})}}export{Ro as default};