cc-viewer 1.6.49 → 1.6.51

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.
@@ -1,39 +0,0 @@
1
- var Ss=Object.defineProperty;var ws=(a,s,t)=>s in a?Ss(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var O=(a,s,t)=>ws(a,typeof s!="symbol"?s+"":s,t);import{r as y,R as U,j as e,a as Ts}from"./index-DPLzENgP.js";import{J as Es,L as Ms,_ as le,c as ae,M as at,N as Rs,P as lt,d as ft,Q as ge,U as xt,V as Ze,W as vt,X as Is,Y as ut,Z as Ls,$ as jt,a0 as As,g as Os,m as Bs,u as Ae,a1 as Ps,a2 as Ds,a3 as Hs,a4 as Fs,a5 as $s,a6 as zs,a7 as Vs,a8 as yt,C as mt,I as xe,a9 as Us,aa as $t,ab as qs,ac as zt,ad as Ws,ae as Ks,af as Gs,e as de,t as p,p as Fe,q as Js,v as be,f as Qs,h as Ys,j as Xs,s as h,o as q,n as ye,ag as Vt,ah as Pe,ai as Q,aj as Ut,ak as Be,k as Zs,l as $e,al as en,am as Ce,S as qt,B as W,an as tn,ao as sn,ap as De,aq as nn,ar as fe,as as bt,at as Ct,x as an,H as ln,au as Wt,G as Oe,av as et,D as Kt,aw as on,E as ot,ax as rn,ay as we,az as _t,aA as cn,aB as Nt,aC as Gt,aD as Jt,aE as Te,aF as Ee,aG as Qt,aH as tt,aI as kt,aJ as St,aK as wt,aL as dn,aM as hn,A as un,aN as ze,aO as Tt,aP as mn,y as pn,w as M,z as gn,aQ as fn,O as xn}from"./AppHeader.module-mubLi1xV.js";var Et=y.createContext(null),Yt=y.createContext({}),vn=["prefixCls","className","containerRef"],jn=function(s){var t=s.prefixCls,n=s.className,c=s.containerRef,l=Es(s,vn),m=y.useContext(Yt),f=m.panel,i=Ms(f,c);return y.createElement("div",le({className:ae("".concat(t,"-content"),n),role:"dialog",ref:i},at(s,{aria:!0}),{"aria-modal":"true"},l))};function Mt(a){return typeof a=="string"&&String(Number(a))===a?(Rs(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(a)):a}var Rt={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function yn(a,s){var t,n,c,l=a.prefixCls,m=a.open,f=a.placement,i=a.inline,d=a.push,o=a.forceRender,r=a.autoFocus,u=a.keyboard,v=a.classNames,x=a.rootClassName,g=a.rootStyle,j=a.zIndex,b=a.className,k=a.id,_=a.style,C=a.motion,T=a.width,I=a.height,B=a.children,L=a.mask,E=a.maskClosable,R=a.maskMotion,P=a.maskClassName,ee=a.maskStyle,te=a.afterOpenChange,F=a.onClose,K=a.onMouseEnter,he=a.onMouseOver,w=a.onMouseLeave,V=a.onClick,oe=a.onKeyDown,ue=a.onKeyUp,G=a.styles,me=a.drawerRender,ie=y.useRef(),pe=y.useRef(),ve=y.useRef();y.useImperativeHandle(s,function(){return ie.current});var se=function(re){var Re=re.keyCode,Ie=re.shiftKey;switch(Re){case Ze.TAB:{if(Re===Ze.TAB){if(!Ie&&document.activeElement===ve.current){var Le;(Le=pe.current)===null||Le===void 0||Le.focus({preventScroll:!0})}else if(Ie&&document.activeElement===pe.current){var Xe;(Xe=ve.current)===null||Xe===void 0||Xe.focus({preventScroll:!0})}}break}case Ze.ESC:{F&&u&&(re.stopPropagation(),F(re));break}}};y.useEffect(function(){if(m&&r){var Z;(Z=ie.current)===null||Z===void 0||Z.focus({preventScroll:!0})}},[m]);var Y=y.useState(!1),D=lt(Y,2),X=D[0],ne=D[1],$=y.useContext(Et),Ne;typeof d=="boolean"?Ne=d?{}:{distance:0}:Ne=d||{};var je=(t=(n=(c=Ne)===null||c===void 0?void 0:c.distance)!==null&&n!==void 0?n:$==null?void 0:$.pushDistance)!==null&&t!==void 0?t:180,bs=y.useMemo(function(){return{pushDistance:je,push:function(){ne(!0)},pull:function(){ne(!1)}}},[je]);y.useEffect(function(){if(m){var Z;$==null||(Z=$.push)===null||Z===void 0||Z.call($)}else{var re;$==null||(re=$.pull)===null||re===void 0||re.call($)}},[m]),y.useEffect(function(){return function(){var Z;$==null||(Z=$.pull)===null||Z===void 0||Z.call($)}},[]);var Cs=y.createElement(ft,le({key:"mask"},R,{visible:L&&m}),function(Z,re){var Re=Z.className,Ie=Z.style;return y.createElement("div",{className:ae("".concat(l,"-mask"),Re,v==null?void 0:v.mask,P),style:ge(ge(ge({},Ie),ee),G==null?void 0:G.mask),onClick:E&&m?F:void 0,ref:re})}),_s=typeof C=="function"?C(f):C,ke={};if(X&&je)switch(f){case"top":ke.transform="translateY(".concat(je,"px)");break;case"bottom":ke.transform="translateY(".concat(-je,"px)");break;case"left":ke.transform="translateX(".concat(je,"px)");break;default:ke.transform="translateX(".concat(-je,"px)");break}f==="left"||f==="right"?ke.width=Mt(T):ke.height=Mt(I);var Ns={onMouseEnter:K,onMouseOver:he,onMouseLeave:w,onClick:V,onKeyDown:oe,onKeyUp:ue},ks=y.createElement(ft,le({key:"panel"},_s,{visible:m,forceRender:o,onVisibleChanged:function(re){te==null||te(re)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),function(Z,re){var Re=Z.className,Ie=Z.style,Le=y.createElement(jn,le({id:k,containerRef:re,prefixCls:l,className:ae(b,v==null?void 0:v.content),style:ge(ge({},_),G==null?void 0:G.content)},at(a,{aria:!0}),Ns),B);return y.createElement("div",le({className:ae("".concat(l,"-content-wrapper"),v==null?void 0:v.wrapper,Re),style:ge(ge(ge({},ke),Ie),G==null?void 0:G.wrapper)},at(a,{data:!0})),me?me(Le):Le)}),gt=ge({},g);return j&&(gt.zIndex=j),y.createElement(Et.Provider,{value:bs},y.createElement("div",{className:ae(l,"".concat(l,"-").concat(f),x,xt(xt({},"".concat(l,"-open"),m),"".concat(l,"-inline"),i)),style:gt,tabIndex:-1,ref:ie,onKeyDown:se},Cs,y.createElement("div",{tabIndex:0,ref:pe,style:Rt,"aria-hidden":"true","data-sentinel":"start"}),ks,y.createElement("div",{tabIndex:0,ref:ve,style:Rt,"aria-hidden":"true","data-sentinel":"end"})))}var bn=y.forwardRef(yn),Cn=function(s){var t=s.open,n=t===void 0?!1:t,c=s.prefixCls,l=c===void 0?"rc-drawer":c,m=s.placement,f=m===void 0?"right":m,i=s.autoFocus,d=i===void 0?!0:i,o=s.keyboard,r=o===void 0?!0:o,u=s.width,v=u===void 0?378:u,x=s.mask,g=x===void 0?!0:x,j=s.maskClosable,b=j===void 0?!0:j,k=s.getContainer,_=s.forceRender,C=s.afterOpenChange,T=s.destroyOnClose,I=s.onMouseEnter,B=s.onMouseOver,L=s.onMouseLeave,E=s.onClick,R=s.onKeyDown,P=s.onKeyUp,ee=s.panelRef,te=y.useState(!1),F=lt(te,2),K=F[0],he=F[1],w=y.useState(!1),V=lt(w,2),oe=V[0],ue=V[1];vt(function(){ue(!0)},[]);var G=oe?n:!1,me=y.useRef(),ie=y.useRef();vt(function(){G&&(ie.current=document.activeElement)},[G]);var pe=function(X){var ne;if(he(X),C==null||C(X),!X&&ie.current&&!((ne=me.current)!==null&&ne!==void 0&&ne.contains(ie.current))){var $;($=ie.current)===null||$===void 0||$.focus({preventScroll:!0})}},ve=y.useMemo(function(){return{panel:ee}},[ee]);if(!_&&!K&&!G&&T)return null;var se={onMouseEnter:I,onMouseOver:B,onMouseLeave:L,onClick:E,onKeyDown:R,onKeyUp:P},Y=ge(ge({},s),{},{open:G,prefixCls:l,placement:f,autoFocus:d,keyboard:r,width:v,mask:g,maskClosable:b,inline:k===!1,afterOpenChange:pe,ref:me},se);return y.createElement(Yt.Provider,{value:ve},y.createElement(Is,{open:G||_||K,autoDestroy:!1,getContainer:k,autoLock:g&&(G||K)},y.createElement(bn,Y)))};const Xt=a=>{var s,t;const{prefixCls:n,ariaId:c,title:l,footer:m,extra:f,closable:i,loading:d,onClose:o,headerStyle:r,bodyStyle:u,footerStyle:v,children:x,classNames:g,styles:j}=a,b=ut("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 _=y.useCallback(L=>y.createElement("button",{type:"button",onClick:o,className:ae(`${n}-close`,{[`${n}-close-${k}`]:k==="end"})},L),[o,n,k]),[C,T]=Ls(jt(a),jt(b),{closable:!0,closeIconRender:_}),I=()=>{var L,E;return!l&&!C?null:y.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(L=b.styles)===null||L===void 0?void 0:L.header),r),j==null?void 0:j.header),className:ae(`${n}-header`,{[`${n}-header-close-only`]:C&&!l&&!f},(E=b.classNames)===null||E===void 0?void 0:E.header,g==null?void 0:g.header)},y.createElement("div",{className:`${n}-header-title`},k==="start"&&T,l&&y.createElement("div",{className:`${n}-title`,id:c},l)),f&&y.createElement("div",{className:`${n}-extra`},f),k==="end"&&T)},B=()=>{var L,E;if(!m)return null;const R=`${n}-footer`;return y.createElement("div",{className:ae(R,(L=b.classNames)===null||L===void 0?void 0:L.footer,g==null?void 0:g.footer),style:Object.assign(Object.assign(Object.assign({},(E=b.styles)===null||E===void 0?void 0:E.footer),v),j==null?void 0:j.footer)},m)};return y.createElement(y.Fragment,null,I(),y.createElement("div",{className:ae(`${n}-body`,g==null?void 0:g.body,(s=b.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=b.styles)===null||t===void 0?void 0:t.body),u),j==null?void 0:j.body)},d?y.createElement(As,{active:!0,title:!1,paragraph:{rows:5},className:`${n}-body-skeleton`}):x),B())},_n=a=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[a]},Zt=(a,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},a),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":a})}),es=(a,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},Zt({opacity:a},{opacity:1})),Nn=(a,s)=>[es(.7,s),Zt({transform:_n(a)},{transform:"none"})],kn=a=>{const{componentCls:s,motionDurationSlow:t}=a;return{[s]:{[`${s}-mask-motion`]:es(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((n,c)=>Object.assign(Object.assign({},n),{[`&-${c}`]:Nn(c,t)}),{})}}},Sn=a=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:n,colorBgMask:c,colorBgElevated:l,motionDurationSlow:m,motionDurationMid:f,paddingXS:i,padding:d,paddingLG:o,fontSizeLG:r,lineHeightLG:u,lineWidth:v,lineType:x,colorSplit:g,marginXS:j,colorIcon:b,colorIconHover:k,colorBgTextHover:_,colorBgTextActive:C,colorText:T,fontWeightStrong:I,footerPaddingBlock:B,footerPaddingInline:L,calc:E}=a,R=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:n,pointerEvents:"none",color:T,"&-pure":{position:"relative",background:l,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:a.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:a.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:a.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:a.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:n,background:c,pointerEvents:"auto"},[R]:{position:"absolute",zIndex:n,maxWidth:"100vw",transition:`all ${m}`,"&-hidden":{display:"none"}},[`&-left > ${R}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:a.boxShadowDrawerLeft},[`&-right > ${R}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:a.boxShadowDrawerRight},[`&-top > ${R}`]:{top:0,insetInline:0,boxShadow:a.boxShadowDrawerUp},[`&-bottom > ${R}`]:{bottom:0,insetInline:0,boxShadow:a.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:`${Ae(d)} ${Ae(o)}`,fontSize:r,lineHeight:u,borderBottom:`${Ae(v)} ${x} ${g}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:E(r).add(i).equal(),height:E(r).add(i).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:b,fontWeight:I,fontSize:r,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${f}`,textRendering:"auto",[`&${t}-close-end`]:{marginInlineStart:j},[`&:not(${t}-close-end)`]:{marginInlineEnd:j},"&:hover":{color:k,backgroundColor:_,textDecoration:"none"},"&:active":{backgroundColor:C}},Ps(a)),[`${t}-title`]:{flex:1,margin:0,fontWeight:a.fontWeightStrong,fontSize:r,lineHeight:u},[`${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:`${Ae(B)} ${Ae(L)}`,borderTop:`${Ae(v)} ${x} ${g}`},"&-rtl":{direction:"rtl"}}}},wn=a=>({zIndexPopup:a.zIndexPopupBase,footerPaddingBlock:a.paddingXS,footerPaddingInline:a.padding}),ts=Os("Drawer",a=>{const s=Bs(a,{});return[Sn(s),kn(s)]},wn);var ss=function(a,s){var t={};for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&s.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,n=Object.getOwnPropertySymbols(a);c<n.length;c++)s.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(a,n[c])&&(t[n[c]]=a[n[c]]);return t};const Tn={distance:180},Ve=a=>{const{rootClassName:s,width:t,height:n,size:c="default",mask:l=!0,push:m=Tn,open:f,afterOpenChange:i,onClose:d,prefixCls:o,getContainer:r,panelRef:u=null,style:v,className:x,"aria-labelledby":g,visible:j,afterVisibleChange:b,maskStyle:k,drawerStyle:_,contentWrapperStyle:C,destroyOnClose:T,destroyOnHidden:I}=a,B=ss(a,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),L=Ds(),E=B.title?L:void 0,{getPopupContainer:R,getPrefixCls:P,direction:ee,className:te,style:F,classNames:K,styles:he}=ut("drawer"),w=P("drawer",o),[V,oe,ue]=ts(w),G=r===void 0&&R?()=>R(document.body):r,me=ae({"no-mask":!l,[`${w}-rtl`]:ee==="rtl"},s,oe,ue),ie=y.useMemo(()=>t??(c==="large"?736:378),[t,c]),pe=y.useMemo(()=>n??(c==="large"?736:378),[n,c]),ve={motionName:yt(w,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},se=je=>({motionName:yt(w,`panel-motion-${je}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Y=Hs(),D=Fs(u,Y),[X,ne]=$s("Drawer",B.zIndex),{classNames:$={},styles:Ne={}}=B;return V(y.createElement(zs,{form:!0,space:!0},y.createElement(Vs.Provider,{value:ne},y.createElement(Cn,Object.assign({prefixCls:w,onClose:d,maskMotion:ve,motion:se},B,{classNames:{mask:ae($.mask,K.mask),content:ae($.content,K.content),wrapper:ae($.wrapper,K.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},Ne.mask),k),he.mask),content:Object.assign(Object.assign(Object.assign({},Ne.content),_),he.content),wrapper:Object.assign(Object.assign(Object.assign({},Ne.wrapper),C),he.wrapper)},open:f??j,mask:l,push:m,width:ie,height:pe,style:Object.assign(Object.assign({},F),v),className:ae(te,x),rootClassName:me,getContainer:G,afterOpenChange:i??b,panelRef:D,zIndex:X,"aria-labelledby":g??E,destroyOnClose:I??T}),y.createElement(Xt,Object.assign({prefixCls:w},B,{ariaId:E,onClose:d}))))))},En=a=>{const{prefixCls:s,style:t,className:n,placement:c="right"}=a,l=ss(a,["prefixCls","style","className","placement"]),{getPrefixCls:m}=y.useContext(mt),f=m("drawer",s),[i,d,o]=ts(f),r=ae(f,`${f}-pure`,`${f}-${c}`,d,o,n);return i(y.createElement("div",{className:r,style:t},y.createElement(Xt,Object.assign({prefixCls:f},l))))};Ve._InternalPanelDoNotUseOrYouWillBeFired=En;var Mn={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"},Rn=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:Mn}))},Ue=y.forwardRef(Rn);function In(a,s,t){return typeof t=="boolean"?t:a.length?!0:Us(s).some(c=>c.type===$t)}var ns=function(a,s){var t={};for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&s.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,n=Object.getOwnPropertySymbols(a);c<n.length;c++)s.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(a,n[c])&&(t[n[c]]=a[n[c]]);return t};function Ye({suffixCls:a,tagName:s,displayName:t}){return n=>y.forwardRef((l,m)=>y.createElement(n,Object.assign({ref:m,suffixCls:a,tagName:s},l)))}const pt=y.forwardRef((a,s)=>{const{prefixCls:t,suffixCls:n,className:c,tagName:l}=a,m=ns(a,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:f}=y.useContext(mt),i=f("layout",t),[d,o,r]=zt(i),u=n?`${i}-${n}`:i;return d(y.createElement(l,Object.assign({className:ae(t||u,c,o,r),ref:s},m)))}),Ln=y.forwardRef((a,s)=>{const{direction:t}=y.useContext(mt),[n,c]=y.useState([]),{prefixCls:l,className:m,rootClassName:f,children:i,hasSider:d,tagName:o,style:r}=a,u=ns(a,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),v=qs(u,["suffixCls"]),{getPrefixCls:x,className:g,style:j}=ut("layout"),b=x("layout",l),k=In(n,i,d),[_,C,T]=zt(b),I=ae(b,{[`${b}-has-sider`]:k,[`${b}-rtl`]:t==="rtl"},g,m,f,C,T),B=y.useMemo(()=>({siderHook:{addSider:L=>{c(E=>[].concat(Ws(E),[L]))},removeSider:L=>{c(E=>E.filter(R=>R!==L))}}}),[]);return _(y.createElement(Ks.Provider,{value:B},y.createElement(o,Object.assign({ref:s,className:I,style:Object.assign(Object.assign({},j),r)},v),i)))}),An=Ye({tagName:"div",displayName:"Layout"})(Ln),On=Ye({suffixCls:"header",tagName:"header",displayName:"Header"})(pt),Bn=Ye({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(pt),Pn=Ye({suffixCls:"content",tagName:"main",displayName:"Content"})(pt),_e=An;_e.Header=On;_e.Footer=Bn;_e.Content=Pn;_e.Sider=$t;_e._InternalSiderContext=Gs;var Dn={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"},Hn=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:Dn}))},It=y.forwardRef(Hn),Fn={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"},$n=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:Fn}))},Lt=y.forwardRef($n),zn={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"},Vn=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:zn}))},At=y.forwardRef(Vn),Un={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"},qn=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:Un}))},qe=y.forwardRef(qn),Wn={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"},Kn=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:Wn}))},st=y.forwardRef(Kn),Gn={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"},Jn=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:Gn}))},Qn=y.forwardRef(Jn),Yn={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"},Xn=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:Yn}))},Zn=y.forwardRef(Xn),ea={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"},ta=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:ea}))},Ot=y.forwardRef(ta),sa={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"},na=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:sa}))},Bt=y.forwardRef(na),aa={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"},la=function(s,t){return y.createElement(xe,le({},s,{ref:t,icon:aa}))},Pt=y.forwardRef(la),oa=Object.defineProperty,We=Object.getOwnPropertySymbols,as=Object.prototype.hasOwnProperty,ls=Object.prototype.propertyIsEnumerable,Dt=(a,s,t)=>s in a?oa(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t,it=(a,s)=>{for(var t in s||(s={}))as.call(s,t)&&Dt(a,t,s[t]);if(We)for(var t of We(s))ls.call(s,t)&&Dt(a,t,s[t]);return a},rt=(a,s)=>{var t={};for(var n in a)as.call(a,n)&&s.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&We)for(var n of We(a))s.indexOf(n)<0&&ls.call(a,n)&&(t[n]=a[n]);return t};/**
2
- * @license QR Code generator library (TypeScript)
3
- * Copyright (c) Project Nayuki.
4
- * SPDX-License-Identifier: MIT
5
- */var Me;(a=>{const s=class A{constructor(i,d,o,r){if(this.version=i,this.errorCorrectionLevel=d,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 u=[];for(let x=0;x<this.size;x++)u.push(!1);for(let x=0;x<this.size;x++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();const v=this.addEccAndInterleave(o);if(this.drawCodewords(v),r==-1){let x=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const j=this.getPenaltyScore();j<x&&(r=g,x=j),this.applyMask(g)}}c(0<=r&&r<=7),this.mask=r,this.applyMask(r),this.drawFormatBits(r),this.isFunction=[]}static encodeText(i,d){const o=a.QrSegment.makeSegments(i);return A.encodeSegments(o,d)}static encodeBinary(i,d){const o=a.QrSegment.makeBytes(i);return A.encodeSegments([o],d)}static encodeSegments(i,d,o=1,r=40,u=-1,v=!0){if(!(A.MIN_VERSION<=o&&o<=r&&r<=A.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let x,g;for(x=o;;x++){const _=A.getNumDataCodewords(x,d)*8,C=m.getTotalBits(i,x);if(C<=_){g=C;break}if(x>=r)throw new RangeError("Data too long")}for(const _ of[A.Ecc.MEDIUM,A.Ecc.QUARTILE,A.Ecc.HIGH])v&&g<=A.getNumDataCodewords(x,_)*8&&(d=_);let j=[];for(const _ of i){t(_.mode.modeBits,4,j),t(_.numChars,_.mode.numCharCountBits(x),j);for(const C of _.getData())j.push(C)}c(j.length==g);const b=A.getNumDataCodewords(x,d)*8;c(j.length<=b),t(0,Math.min(4,b-j.length),j),t(0,(8-j.length%8)%8,j),c(j.length%8==0);for(let _=236;j.length<b;_^=253)t(_,8,j);let k=[];for(;k.length*8<j.length;)k.push(0);return j.forEach((_,C)=>k[C>>>3]|=_<<7-(C&7)),new A(x,d,k,u)}getModule(i,d){return 0<=i&&i<this.size&&0<=d&&d<this.size&&this.modules[d][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(),d=i.length;for(let o=0;o<d;o++)for(let r=0;r<d;r++)o==0&&r==0||o==0&&r==d-1||o==d-1&&r==0||this.drawAlignmentPattern(i[o],i[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const d=this.errorCorrectionLevel.formatBits<<3|i;let o=d;for(let u=0;u<10;u++)o=o<<1^(o>>>9)*1335;const r=(d<<10|o)^21522;c(r>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,n(r,u));this.setFunctionModule(8,7,n(r,6)),this.setFunctionModule(8,8,n(r,7)),this.setFunctionModule(7,8,n(r,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,n(r,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,n(r,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,n(r,u));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 d=this.version<<12|i;c(d>>>18==0);for(let o=0;o<18;o++){const r=n(d,o),u=this.size-11+o%3,v=Math.floor(o/3);this.setFunctionModule(u,v,r),this.setFunctionModule(v,u,r)}}drawFinderPattern(i,d){for(let o=-4;o<=4;o++)for(let r=-4;r<=4;r++){const u=Math.max(Math.abs(r),Math.abs(o)),v=i+r,x=d+o;0<=v&&v<this.size&&0<=x&&x<this.size&&this.setFunctionModule(v,x,u!=2&&u!=4)}}drawAlignmentPattern(i,d){for(let o=-2;o<=2;o++)for(let r=-2;r<=2;r++)this.setFunctionModule(i+r,d+o,Math.max(Math.abs(r),Math.abs(o))!=1)}setFunctionModule(i,d,o){this.modules[d][i]=o,this.isFunction[d][i]=!0}addEccAndInterleave(i){const d=this.version,o=this.errorCorrectionLevel;if(i.length!=A.getNumDataCodewords(d,o))throw new RangeError("Invalid argument");const r=A.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][d],u=A.ECC_CODEWORDS_PER_BLOCK[o.ordinal][d],v=Math.floor(A.getNumRawDataModules(d)/8),x=r-v%r,g=Math.floor(v/r);let j=[];const b=A.reedSolomonComputeDivisor(u);for(let _=0,C=0;_<r;_++){let T=i.slice(C,C+g-u+(_<x?0:1));C+=T.length;const I=A.reedSolomonComputeRemainder(T,b);_<x&&T.push(0),j.push(T.concat(I))}let k=[];for(let _=0;_<j[0].length;_++)j.forEach((C,T)=>{(_!=g-u||T>=x)&&k.push(C[_])});return c(k.length==v),k}drawCodewords(i){if(i.length!=Math.floor(A.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=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 u=0;u<2;u++){const v=o-u,g=(o+1&2)==0?this.size-1-r:r;!this.isFunction[g][v]&&d<i.length*8&&(this.modules[g][v]=n(i[d>>>3],7-(d&7)),d++)}}c(d==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let d=0;d<this.size;d++)for(let o=0;o<this.size;o++){let r;switch(i){case 0:r=(o+d)%2==0;break;case 1:r=d%2==0;break;case 2:r=o%3==0;break;case 3:r=(o+d)%3==0;break;case 4:r=(Math.floor(o/3)+Math.floor(d/2))%2==0;break;case 5:r=o*d%2+o*d%3==0;break;case 6:r=(o*d%2+o*d%3)%2==0;break;case 7:r=((o+d)%2+o*d%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[d][o]&&r&&(this.modules[d][o]=!this.modules[d][o])}}getPenaltyScore(){let i=0;for(let u=0;u<this.size;u++){let v=!1,x=0,g=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[u][j]==v?(x++,x==5?i+=A.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,g),v||(i+=this.finderPenaltyCountPatterns(g)*A.PENALTY_N3),v=this.modules[u][j],x=1);i+=this.finderPenaltyTerminateAndCount(v,x,g)*A.PENALTY_N3}for(let u=0;u<this.size;u++){let v=!1,x=0,g=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][u]==v?(x++,x==5?i+=A.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,g),v||(i+=this.finderPenaltyCountPatterns(g)*A.PENALTY_N3),v=this.modules[j][u],x=1);i+=this.finderPenaltyTerminateAndCount(v,x,g)*A.PENALTY_N3}for(let u=0;u<this.size-1;u++)for(let v=0;v<this.size-1;v++){const x=this.modules[u][v];x==this.modules[u][v+1]&&x==this.modules[u+1][v]&&x==this.modules[u+1][v+1]&&(i+=A.PENALTY_N2)}let d=0;for(const u of this.modules)d=u.reduce((v,x)=>v+(x?1:0),d);const o=this.size*this.size,r=Math.ceil(Math.abs(d*20-o*10)/o)-1;return c(0<=r&&r<=9),i+=r*A.PENALTY_N4,c(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{const i=Math.floor(this.version/7)+2,d=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-=d)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 d=(16*i+128)*i+64;if(i>=2){const o=Math.floor(i/7)+2;d-=(25*o-10)*o-55,i>=7&&(d-=36)}return c(208<=d&&d<=29648),d}static getNumDataCodewords(i,d){return Math.floor(A.getNumRawDataModules(i)/8)-A.ECC_CODEWORDS_PER_BLOCK[d.ordinal][i]*A.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let d=[];for(let r=0;r<i-1;r++)d.push(0);d.push(1);let o=1;for(let r=0;r<i;r++){for(let u=0;u<d.length;u++)d[u]=A.reedSolomonMultiply(d[u],o),u+1<d.length&&(d[u]^=d[u+1]);o=A.reedSolomonMultiply(o,2)}return d}static reedSolomonComputeRemainder(i,d){let o=d.map(r=>0);for(const r of i){const u=r^o.shift();o.push(0),d.forEach((v,x)=>o[x]^=A.reedSolomonMultiply(v,u))}return o}static reedSolomonMultiply(i,d){if(i>>>8||d>>>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^=(d>>>r&1)*i;return c(o>>>8==0),o}finderPenaltyCountPatterns(i){const d=i[1];c(d<=this.size*3);const o=d>0&&i[2]==d&&i[3]==d*3&&i[4]==d&&i[5]==d;return(o&&i[0]>=d*4&&i[6]>=d?1:0)+(o&&i[6]>=d*4&&i[0]>=d?1:0)}finderPenaltyTerminateAndCount(i,d,o){return i&&(this.finderPenaltyAddHistory(d,o),d=0),d+=this.size,this.finderPenaltyAddHistory(d,o),this.finderPenaltyCountPatterns(o)}finderPenaltyAddHistory(i,d){d[0]==0&&(i+=this.size),d.pop(),d.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]],a.QrCode=s;function t(f,i,d){if(i<0||i>31||f>>>i)throw new RangeError("Value out of range");for(let o=i-1;o>=0;o--)d.push(f>>>o&1)}function n(f,i){return(f>>>i&1)!=0}function c(f){if(!f)throw new Error("Assertion error")}const l=class J{constructor(i,d,o){if(this.mode=i,this.numChars=d,this.bitData=o,d<0)throw new RangeError("Invalid argument");this.bitData=o.slice()}static makeBytes(i){let d=[];for(const o of i)t(o,8,d);return new J(J.Mode.BYTE,i.length,d)}static makeNumeric(i){if(!J.isNumeric(i))throw new RangeError("String contains non-numeric characters");let d=[];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,d),o+=r}return new J(J.Mode.NUMERIC,i.length,d)}static makeAlphanumeric(i){if(!J.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let d=[],o;for(o=0;o+2<=i.length;o+=2){let r=J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o))*45;r+=J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o+1)),t(r,11,d)}return o<i.length&&t(J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o)),6,d),new J(J.Mode.ALPHANUMERIC,i.length,d)}static makeSegments(i){return i==""?[]:J.isNumeric(i)?[J.makeNumeric(i)]:J.isAlphanumeric(i)?[J.makeAlphanumeric(i)]:[J.makeBytes(J.toUtf8ByteArray(i))]}static makeEci(i){let d=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)t(i,8,d);else if(i<16384)t(2,2,d),t(i,14,d);else if(i<1e6)t(6,3,d),t(i,21,d);else throw new RangeError("ECI assignment value out of range");return new J(J.Mode.ECI,0,d)}static isNumeric(i){return J.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return J.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,d){let o=0;for(const r of i){const u=r.mode.numCharCountBits(d);if(r.numChars>=1<<u)return 1/0;o+=4+u+r.bitData.length}return o}static toUtf8ByteArray(i){i=encodeURI(i);let d=[];for(let o=0;o<i.length;o++)i.charAt(o)!="%"?d.push(i.charCodeAt(o)):(d.push(parseInt(i.substring(o+1,o+3),16)),o+=2);return d}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let m=l;a.QrSegment=l})(Me||(Me={}));(a=>{(s=>{const t=class{constructor(c,l){this.ordinal=c,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})(a.QrCode||(a.QrCode={}))})(Me||(Me={}));(a=>{(s=>{const t=class{constructor(c,l){this.modeBits=c,this.numBitsCharCount=l}numCharCountBits(c){return this.numBitsCharCount[Math.floor((c+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})(a.QrSegment||(a.QrSegment={}))})(Me||(Me={}));var He=Me;/**
6
- * @license qrcode.react
7
- * Copyright (c) Paul O'Shannessy
8
- * SPDX-License-Identifier: ISC
9
- */var ia={L:He.QrCode.Ecc.LOW,M:He.QrCode.Ecc.MEDIUM,Q:He.QrCode.Ecc.QUARTILE,H:He.QrCode.Ecc.HIGH},os=128,is="L",rs="#FFFFFF",cs="#000000",ds=!1,hs=1,ra=4,ca=0,da=.1;function us(a,s=0){const t=[];return a.forEach(function(n,c){let l=null;n.forEach(function(m,f){if(!m&&l!==null){t.push(`M${l+s} ${c+s}h${f-l}v1H${l+s}z`),l=null;return}if(f===n.length-1){if(!m)return;l===null?t.push(`M${f+s},${c+s} h1v1H${f+s}z`):t.push(`M${l+s},${c+s} h${f+1-l}v1H${l+s}z`);return}m&&l===null&&(l=f)})}),t.join("")}function ms(a,s){return a.slice().map((t,n)=>n<s.y||n>=s.y+s.h?t:t.map((c,l)=>l<s.x||l>=s.x+s.w?c:!1))}function ha(a,s,t,n){if(n==null)return null;const c=a.length+t*2,l=Math.floor(s*da),m=c/s,f=(n.width||l)*m,i=(n.height||l)*m,d=n.x==null?a.length/2-f/2:n.x*m,o=n.y==null?a.length/2-i/2:n.y*m,r=n.opacity==null?1:n.opacity;let u=null;if(n.excavate){let x=Math.floor(d),g=Math.floor(o),j=Math.ceil(f+d-x),b=Math.ceil(i+o-g);u={x,y:g,w:j,h:b}}const v=n.crossOrigin;return{x:d,y:o,h:i,w:f,excavation:u,opacity:r,crossOrigin:v}}function ua(a,s){return s!=null?Math.max(Math.floor(s),0):a?ra:ca}function ps({value:a,level:s,minVersion:t,includeMargin:n,marginSize:c,imageSettings:l,size:m,boostLevel:f}){let i=U.useMemo(()=>{const x=(Array.isArray(a)?a:[a]).reduce((g,j)=>(g.push(...He.QrSegment.makeSegments(j)),g),[]);return He.QrCode.encodeSegments(x,ia[s],t,void 0,void 0,f)},[a,s,t,f]);const{cells:d,margin:o,numCells:r,calculatedImageSettings:u}=U.useMemo(()=>{let v=i.getModules();const x=ua(n,c),g=v.length+x*2,j=ha(v,m,x,l);return{cells:v,margin:x,numCells:g,calculatedImageSettings:j}},[i,m,l,n,c]);return{qrcode:i,margin:o,cells:d,numCells:r,calculatedImageSettings:u}}var ma=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),gs=U.forwardRef(function(s,t){const n=s,{value:c,size:l=os,level:m=is,bgColor:f=rs,fgColor:i=cs,includeMargin:d=ds,minVersion:o=hs,boostLevel:r,marginSize:u,imageSettings:v}=n,g=rt(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:j}=g,b=rt(g,["style"]),k=v==null?void 0:v.src,_=U.useRef(null),C=U.useRef(null),T=U.useCallback(F=>{_.current=F,typeof t=="function"?t(F):t&&(t.current=F)},[t]),[I,B]=U.useState(!1),{margin:L,cells:E,numCells:R,calculatedImageSettings:P}=ps({value:c,level:m,minVersion:o,boostLevel:r,includeMargin:d,marginSize:u,imageSettings:v,size:l});U.useEffect(()=>{if(_.current!=null){const F=_.current,K=F.getContext("2d");if(!K)return;let he=E;const w=C.current,V=P!=null&&w!==null&&w.complete&&w.naturalHeight!==0&&w.naturalWidth!==0;V&&P.excavation!=null&&(he=ms(E,P.excavation));const oe=window.devicePixelRatio||1;F.height=F.width=l*oe;const ue=l/R*oe;K.scale(ue,ue),K.fillStyle=f,K.fillRect(0,0,R,R),K.fillStyle=i,ma?K.fill(new Path2D(us(he,L))):E.forEach(function(G,me){G.forEach(function(ie,pe){ie&&K.fillRect(pe+L,me+L,1,1)})}),P&&(K.globalAlpha=P.opacity),V&&K.drawImage(w,P.x+L,P.y+L,P.w,P.h)}}),U.useEffect(()=>{B(!1)},[k]);const ee=it({height:l,width:l},j);let te=null;return k!=null&&(te=U.createElement("img",{src:k,key:k,style:{display:"none"},onLoad:()=>{B(!0)},ref:C,crossOrigin:P==null?void 0:P.crossOrigin})),U.createElement(U.Fragment,null,U.createElement("canvas",it({style:ee,height:l,width:l,ref:T,role:"img"},b)),te)});gs.displayName="QRCodeCanvas";var pa=U.forwardRef(function(s,t){const n=s,{value:c,size:l=os,level:m=is,bgColor:f=rs,fgColor:i=cs,includeMargin:d=ds,minVersion:o=hs,boostLevel:r,title:u,marginSize:v,imageSettings:x}=n,g=rt(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:j,cells:b,numCells:k,calculatedImageSettings:_}=ps({value:c,level:m,minVersion:o,boostLevel:r,includeMargin:d,marginSize:v,imageSettings:x,size:l});let C=b,T=null;x!=null&&_!=null&&(_.excavation!=null&&(C=ms(b,_.excavation)),T=U.createElement("image",{href:x.src,height:_.h,width:_.w,x:_.x+j,y:_.y+j,preserveAspectRatio:"none",opacity:_.opacity,crossOrigin:_.crossOrigin}));const I=us(C,j);return U.createElement("svg",it({height:l,width:l,viewBox:`0 0 ${k} ${k}`,ref:t,role:"img"},g),!!u&&U.createElement("title",null,u),U.createElement("path",{fill:f,d:`M0,0 h${k}v${k}H0z`,shapeRendering:"crispEdges"}),U.createElement("path",{fill:i,d:I,shapeRendering:"crispEdges"}),T)});pa.displayName="QRCodeSVG";const ga=[{label:"Auto",value:"auto"},{label:"Opus 4.6",value:"opus-4.6",tokens:2e5},{label:"Opus 4.6 (1M)",value:"opus-4.6-1m",tokens:1e6},{label:"Sonnet 4.6",value:"sonnet-4.6",tokens:2e5},{label:"Sonnet 4.6 (1M)",value:"sonnet-4.6-1m",tokens:1e6},{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}],fa={calibrationModels:ga},Ht=fa.calibrationModels,xa=[{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:"Українська"}],Ft=a=>{const s=t=>t.toUpperCase().split("").map(n=>String.fromCodePoint(127462+n.charCodeAt(0)-65)).join("");return!a||a.length!==2?s("CN"):s(a)},Se=class Se extends U.Component{constructor(t){super(t);O(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});O(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const n=[];for(const f of t){const i=[],d=f.timestamp?new Date(f.timestamp).toLocaleString():"";d&&i.push(`${d}:
10
- `);const o=(f.segments||[]).filter(r=>r.type==="text").map(r=>r.content);o.length>0&&i.push(o.join(`
11
- `)),n.push(i.join(`
12
- `))}if(n.length===0)return;const c=new Blob([n.join(`
13
-
14
-
15
-
16
- `)],{type:"text/plain;charset=utf-8"}),l=URL.createObjectURL(c),m=document.createElement("a");m.href=l,m.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,m.click(),URL.revokeObjectURL(l)});O(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});O(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(de("/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}))});O(this,"fetchPlugins",()=>fetch(de("/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(()=>{}));O(this,"handleShowPlugins",()=>{this.setState({pluginModalVisible:!0}),this.fetchPlugins()});O(this,"handleTogglePlugin",(t,n)=>{fetch(de("/api/preferences")).then(c=>c.json()).then(c=>{let l=Array.isArray(c.disabledPlugins)?[...c.disabledPlugins]:[];return n?l=l.filter(m=>m!==t):l.includes(t)||l.push(t),fetch(de("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:l})})}).then(()=>fetch(de("/api/plugins/reload"),{method:"POST"})).then(c=>{if(!c.ok)throw new Error(c.status);return c.json()}).then(c=>{this.setState({pluginsList:c.plugins||[],pluginsDir:c.pluginsDir||""})}).catch(()=>{})});O(this,"handleDeletePlugin",(t,n)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:n}})});O(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(de(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(n=>{if(!n.ok)throw new Error(n.status);return n.json()}).then(n=>{n.plugins&&this.setState({pluginsList:n.plugins,pluginsDir:n.pluginsDir||""})}).catch(()=>{}))});O(this,"handleReloadPlugins",()=>{fetch(de("/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(()=>{})});O(this,"handleAddPlugin",()=>{const t=document.createElement("input");t.type="file",t.accept=".js,.mjs",t.multiple=!0,t.onchange=()=>{const n=t.files;if(!n||n.length===0)return;for(const l of n)if(!l.name.endsWith(".js")&&!l.name.endsWith(".mjs")){Q.error(p("ui.plugins.invalidFile"));return}const c=Array.from(n).map(l=>new Promise((m,f)=>{const i=new FileReader;i.onload=()=>m({name:l.name,content:i.result}),i.onerror=()=>f(new Error(`Failed to read ${l.name}`)),i.readAsText(l)}));Promise.all(c).then(l=>fetch(de("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:l})})).then(l=>l.ok?l.json():l.text().then(m=>{try{return JSON.parse(m)}catch{throw new Error(p("ui.plugins.serverError",{status:l.status}))}})).then(l=>{l.error?Q.error(p("ui.plugins.addFailed",{reason:l.error})):l.plugins&&(this.setState({pluginsList:l.plugins,pluginsDir:l.pluginsDir||""}),Q.success(p("ui.plugins.addSuccess")))}).catch(l=>{Q.error(l.message)})},t.click()});O(this,"handleShowCdnModal",()=>{this.setState({cdnModalVisible:!0,cdnUrl:"",cdnLoading:!1})});O(this,"handleCdnUrlChange",t=>{this.setState({cdnUrl:t.target.value})});O(this,"handleCdnInstall",()=>{const{cdnUrl:t}=this.state;if(!t.trim()){Q.error(p("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{Q.error(p("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(de("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(n=>n.json()).then(n=>{n.error?Q.error(p("ui.plugins.cdnInstallFailed",{reason:n.error})):(Q.success(p("ui.plugins.cdnInstallSuccess")),n.plugins&&this.setState({pluginsList:n.plugins,pluginsDir:n.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(n=>{Q.error(p("ui.plugins.cdnInstallFailed",{reason:n.message||"Network error"}))}).finally(()=>{this.setState({cdnLoading:!1})})});O(this,"handleCdnCancel",()=>{this.setState({cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1})});O(this,"fetchProcesses",()=>{this.setState({processLoading:!0}),fetch(de("/api/ccv-processes")).then(t=>t.json()).then(t=>{this.setState({processList:t.processes||[],processLoading:!1})}).catch(()=>{this.setState({processList:[],processLoading:!1})})});O(this,"handleShowProcesses",()=>{this.setState({processModalVisible:!0}),this.fetchProcesses()});O(this,"handleKillProcess",t=>{Ce.confirm({title:p("ui.processManagement.killConfirm"),onOk:()=>{fetch(de("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(n=>n.json()).then(n=>{n.ok?(Q.success(p("ui.processManagement.killed")),this.fetchProcesses()):Q.error(n.error||p("ui.processManagement.killFailed"))}).catch(()=>{Q.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:localStorage.getItem("ccv_calibrationModel")||"auto"},this._rafId=null,this._expiredTimer=null,this.updateCountdown=this.updateCountdown.bind(this)}componentDidMount(){this.startCountdown(),fetch(de("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(de("/api/claude-settings")).then(t=>t.json()).then(t=>{t.model&&this.setState({settingsModel:t.model})}).catch(()=>{}),fetch("https://ipinfo.io/json").then(t=>t.json()).then(t=>{t.country&&this.setState({countryFlag:Ft(t.country),countryInfo:t})}).catch(()=>{this.setState({countryFlag:Ft("CN")})})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,n){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.expandDiff!==this.props.expandDiff||t.filterIrrelevant!==this.props.filterIrrelevant||t.cliMode!==this.props.cliMode||t.contextWindow!==this.props.contextWindow||t.serverCachedContent!==this.props.serverCachedContent||t.resumeAutoChoice!==this.props.resumeAutoChoice||n!==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 n=Math.max(0,t-Date.now());if(n<=0){const m=p("ui.cacheExpired");this.state.countdownText!==m&&this.setState({countdownText:m}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const c=Math.ceil(n/1e3);let l;if(c>=60){const m=Math.floor(c/60),f=c%60;l=p("ui.minuteSecond",{m,s:String(f).padStart(2,"0")})}else l=p("ui.second",{s:c});l!==this.state.countdownText&&this.setState({countdownText:l}),this._rafId=requestAnimationFrame(this.updateCountdown)}static parseSegments(t){const n=[],c=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let l=0,m;for(;(m=c.exec(t))!==null;){const i=t.slice(l,m.index).trim();i&&n.push({type:"text",content:i});const d=m[1];if(l=m.index+m[0].length,Se.COMMAND_TAGS.has(d))continue;const o=new RegExp(`^<${d}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${d}>$`),r=m[0].match(o),u=r?r[1].trim():m[0].trim();n.push({type:"system",content:u,label:d})}const f=t.slice(l).trim();return f&&n.push({type:"text",content:f}),n}static extractUserTexts(t){const n=[],c=[];let l=null;for(const m of t)if(m.role==="user"){if(typeof m.content=="string"){const f=m.content.trim();if(!f)continue;if(!Fe(f)){if(/Implement the following plan:/i.test(f))continue;n.push(f),c.push(f)}}else if(Array.isArray(m.content)){const{commands:f,textBlocks:i}=Js(m.content);f.length>0&&(l=f[f.length-1]);const d=[];for(const r of i)/Implement the following plan:/i.test((r.text||"").trim())||d.push(r.text.trim());const o=m.content.filter(r=>{var u;return r.type==="text"&&((u=r.text)==null?void 0:u.trim())}).map(r=>r.text.trim());d.length>0&&(n.push(d.join(`
17
- `)),c.push(o.join(`
18
- `)))}}return{userMsgs:n,fullTexts:c,slashCmd:l}}extractUserPrompts(){var f;const{requests:t=[]}=this.props,n=[],c=new Set;let l=null;const m=t.filter(i=>be(i));for(let i=0;i<m.length;i++){const d=m[i],o=((f=d.body)==null?void 0:f.messages)||[],r=d.timestamp||"",{userMsgs:u,fullTexts:v,slashCmd:x}=Se.extractUserTexts(o);x&&x!=="/compact"&&x!==l&&n.push({type:"prompt",segments:[{type:"text",content:x}],timestamp:r}),l=x;for(let g=0;g<u.length;g++){const j=u[g];if(c.has(j))continue;c.add(j);const b=v[g]||j;n.push({type:"prompt",segments:Se.parseSegments(b),timestamp:r})}}return n}renderTokenStats(){const{requests:t=[]}=this.props,n=Qs(t),c=Object.keys(n),l=Ys(t),m=Xs(t);if(c.length===0&&l.length===0)return e.jsx("div",{className:h.tokenStatsEmpty,children:"暂无 token 数据"});const f=e.jsx("div",{className:h.tokenStatsColumn,children:c.map(r=>{const u=n[r],v=u.input+u.cacheCreation+u.cacheRead,x=v>0?(u.cacheRead/v*100).toFixed(1):"0.0";return e.jsxs("div",{className:c.length>1?h.modelCardSpaced:h.modelCard,children:[e.jsx("div",{className:h.modelName,children:r}),e.jsx("table",{className:h.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:h.label,children:"Token"}),e.jsx("td",{className:h.th,children:"input"}),e.jsx("td",{className:h.th,children:"output"})]}),e.jsxs("tr",{className:h.rowBorder,children:[e.jsx("td",{className:h.label}),e.jsx("td",{className:h.td,children:q(v)}),e.jsx("td",{className:h.td,children:q(u.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:h.label,children:"Cache"}),e.jsx("td",{className:h.th,children:"create"}),e.jsx("td",{className:h.th,children:"read"})]}),e.jsxs("tr",{className:h.rowBorder,children:[e.jsx("td",{className:h.label}),e.jsx("td",{className:h.td,children:q(u.cacheCreation)}),e.jsx("td",{className:h.td,children:q(u.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:h.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:h.td,children:[x,"%"]})]})]})})]},r)})}),i=this.renderCacheRebuildStats(),d=l.length>0?e.jsx("div",{className:h.toolStatsColumn,children:e.jsxs("div",{className:h.modelCard,children:[e.jsx("div",{className:h.modelName,children:p("ui.toolUsageStats")}),e.jsxs("table",{className:h.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${h.th} ${h.thLeft}`,children:"Tool"}),e.jsx("td",{className:h.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[l.map(([r,u])=>e.jsxs("tr",{className:h.rowBorder,children:[e.jsxs("td",{className:h.label,children:[r," ",e.jsx(ye,{doc:`Tool-${r}`})]}),e.jsx("td",{className:h.td,children:u})]},r)),l.length>1&&e.jsxs("tr",{className:h.rebuildTotalRow,children:[e.jsx("td",{className:h.label,children:"Total"}),e.jsx("td",{className:h.td,children:l.reduce((r,u)=>r+u[1],0)})]})]})]})]})}):null,o=m.length>0?e.jsx("div",{className:h.toolStatsColumn,children:e.jsxs("div",{className:h.modelCard,children:[e.jsx("div",{className:h.modelName,children:p("ui.skillUsageStats")}),e.jsxs("table",{className:h.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${h.th} ${h.thLeft}`,children:"Skill"}),e.jsx("td",{className:h.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[m.map(([r,u])=>e.jsxs("tr",{className:h.rowBorder,children:[e.jsx("td",{className:h.label,children:r}),e.jsx("td",{className:h.td,children:u})]},r)),m.length>1&&e.jsxs("tr",{className:h.rebuildTotalRow,children:[e.jsx("td",{className:h.label,children:"Total"}),e.jsx("td",{className:h.td,children:m.reduce((r,u)=>r+u[1],0)})]})]})]})]})}):null;return e.jsxs("div",{className:h.tokenStatsContainer,children:[f,i,d,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){this.props.viewMode==="raw"&&this.props.onNavigateCacheMsg&&this.props.onNavigateCacheMsg(t);const n=this._cacheScrollEl;if(!n)return;const c=n.querySelector(`[data-msg-idx="${t}"]`);if(!c)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&n.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let l=!1,m=!1;const f=()=>{!l||!m||(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=()=>{n.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,f()},n.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{n.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,f()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{m=!0,f()},500),c.scrollIntoView({behavior:"smooth",block:"center"})}renderCacheContentPopover(t){const{requests:n=[],serverCachedContent:c}=this.props,l=c||Vt(n);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:h.cachePopoverEmpty,children:p("ui.noCachedContent")});const m=(o,r,u)=>{if(r.length===0)return null;const v=o===p("ui.messages");return e.jsxs("div",{className:h.cacheSection,children:[e.jsxs("div",{className:h.cacheSectionTitle,children:[o," (",r.length,")"]}),r.map((x,g)=>{const j=v?{"data-msg-idx":g}:{};let b=u||h.cacheCodeBlock;const k=v&&g===this.state.cacheHighlightIdx;return k&&(b+=" "+(this.state.cacheHighlightFading?h.cacheBlockHighlightFading:h.cacheBlockHighlight)),e.jsxs("pre",{className:b,...j,style:k?{position:"relative"}:void 0,children:[k&&e.jsx("svg",{className:`${h.cacheBorderSvg}${this.state.cacheHighlightFading?" "+h.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:h.cacheBorderRect})}),x]},g)})]})},f=()=>{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 u=o.replace(/^\[user\]\s*/,"").trim();return!u||Fe(u)?{cleaned:"",msgIdx:r}:{cleaned:Se.parseSegments(u).filter(g=>g.type==="text").map(g=>g.content.trim()).filter(g=>g&&!Fe(g)).join(" ").trim(),msgIdx:r}}).filter(({cleaned:o})=>!(!o||/Implement the following plan:/i.test(o))),d=i.length>0?e.jsx("div",{className:h.cacheNavList,children:i.map(({cleaned:o,msgIdx:r})=>e.jsx("div",{className:h.cacheNavItem,onClick:()=>this.scrollToCacheMsg(r),children:o},r))}):null;return e.jsxs("div",{className:h.cachePopover,children:[e.jsx("div",{className:h.cachePopoverHeader,children:e.jsxs("div",{className:h.cachePopoverTitle,children:[p("ui.cachedContentTitle"),e.jsx(ye,{doc:"KVCacheContent"}),e.jsx(Pe,{className:h.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(f()).then(()=>{Q.success(p("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:h.cacheCalibrationLabel,children:p("ui.calibrationModelLabel")}),e.jsx(Ut,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:Ht,className:h.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const r=l.cacheCreateTokens>0||l.cacheReadTokens>0?l:this._lastCachedTokens,u=t>0?t:this._lastContextPercent||0;return r||d?e.jsxs("div",{className:h.cacheTokenInfo,children:[r&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:h.cacheWriteToken,children:["write ",q(r.cacheCreateTokens)]})," / ",e.jsxs("span",{className:h.cacheReadToken,children:["read ",q(r.cacheReadTokens)]}),u>0&&e.jsxs("span",{className:h.cacheCtxPercent,children:["(ctx:",u,"%)"]})]}),d&&e.jsx(Be,{content:d,trigger:"hover",placement:"left",children:e.jsx("span",{className:h.cacheNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:h.cacheScrollArea,ref:o=>{this._cacheScrollEl=o,o&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{o.scrollTop=o.scrollHeight}))},children:[m(p("ui.tools"),l.tools),m(p("ui.systemPrompt"),l.system,h.cacheCodeBlockSystem),m(p("ui.messages"),l.messages)]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,n=Zs(t),c=["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"},m=c.filter(j=>n[j].count>0),f=m.reduce((j,b)=>j+n[b].count,0),i=m.reduce((j,b)=>j+n[b].cacheCreate,0),d={},o={};for(let j=0;j<t.length;j++){const b=$e(t[j],t[j+1]);if(b.type==="SubAgent"){const k=b.subType||"Other";d[k]=(d[k]||0)+1}else if(b.type==="Teammate"){const k=b.subType||"Teammate";o[k]=(o[k]||0)+1}}const r=Object.entries(d).sort((j,b)=>b[1]-j[1]),u=Object.entries(o).sort((j,b)=>b[1]-j[1]),v=m.length>0,x=r.length>0,g=u.length>0;return!v&&!x&&!g?null:e.jsxs("div",{className:h.toolStatsColumn,children:[v&&e.jsxs("div",{className:x?h.modelCardSpaced:h.modelCard,children:[e.jsxs("div",{className:h.modelName,children:["MainAgent",e.jsx(ye,{doc:"MainAgent"})," ",p("ui.cacheRebuildStats"),e.jsx(ye,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:h.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${h.th} ${h.thLeft}`,children:p("ui.cacheRebuild.reason")}),e.jsx("td",{className:h.th,children:p("ui.cacheRebuild.count")}),e.jsx("td",{className:h.th,children:p("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[m.map(j=>e.jsxs("tr",{className:h.rowBorder,children:[e.jsx("td",{className:h.label,children:p(`ui.${l[j]}`)}),e.jsx("td",{className:h.td,children:n[j].count}),e.jsx("td",{className:h.td,children:q(n[j].cacheCreate)})]},j)),m.length>1&&e.jsxs("tr",{className:h.rebuildTotalRow,children:[e.jsx("td",{className:h.label,children:"Total"}),e.jsx("td",{className:h.td,children:f}),e.jsx("td",{className:h.td,children:q(i)})]})]})]})]}),x&&e.jsxs("div",{className:h.modelCard,children:[e.jsx("div",{className:h.modelName,children:p("ui.subAgentStats")}),e.jsxs("table",{className:h.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${h.th} ${h.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:h.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[r.map(([j,b])=>e.jsxs("tr",{className:h.rowBorder,children:[e.jsxs("td",{className:h.label,children:[j," ",e.jsx(ye,{doc:`SubAgent-${j}`})]}),e.jsx("td",{className:h.td,children:b})]},j)),r.length>1&&e.jsxs("tr",{className:h.rebuildTotalRow,children:[e.jsx("td",{className:h.label,children:"Total"}),e.jsx("td",{className:h.td,children:r.reduce((j,b)=>j+b[1],0)})]})]})]})]}),g&&e.jsxs("div",{className:h.modelCard,children:[e.jsx("div",{className:h.modelName,children:"Teammate"}),e.jsxs("table",{className:h.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${h.th} ${h.thLeft}`,children:"Name"}),e.jsx("td",{className:h.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[u.map(([j,b])=>e.jsxs("tr",{className:h.rowBorder,children:[e.jsx("td",{className:h.label,children:j}),e.jsx("td",{className:h.td,children:b})]},j)),u.length>1&&e.jsxs("tr",{className:h.rebuildTotalRow,children:[e.jsx("td",{className:h.label,children:"Total"}),e.jsx("td",{className:h.td,children:u.reduce((j,b)=>j+b[1],0)})]})]})]})]})]})}renderTextPrompt(t){return e.jsx("div",{className:h.textPromptCard,children:t.segments.map((n,c)=>n.type==="text"?e.jsx("pre",{className:h.preText,children:n.content},c):e.jsx(en,{size:"small",className:h.systemCollapse,items:[{key:`sys-${c}`,label:e.jsx("span",{className:h.systemLabel,children:n.label}),children:e.jsx("pre",{className:h.preSys,children:n.content})}]},c))})}renderOriginalPrompt(t){const n=t.segments.filter(c=>c.type==="text");return n.length===0?null:e.jsx("div",{className:h.textPromptCard,children:n.map((c,l)=>e.jsx("pre",{className:h.preText,children:c.content},l))})}buildTextModeContent(){const{promptData:t}=this.state,n=[];for(const c of t){const l=(c.segments||[]).filter(m=>m.type==="text").map(m=>m.content);l.length>0&&n.push(l.join(`
23
- `))}return n.join(`
24
-
25
-
26
- `)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:n}=this.state;if(n)return e.jsx("div",{className:h.projectStatsCenter,children:e.jsx(qt,{})});if(!t)return e.jsx("div",{className:h.projectStatsEmpty,children:p("ui.projectStats.noData")});const{summary:c,models:l,updatedAt:m}=t;l&&Object.entries(l).sort((d,o)=>o[1]-d[1]);const f={};if(t.files){for(const d of Object.values(t.files))if(d.models)for(const[o,r]of Object.entries(d.models))f[o]||(f[o]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),f[o].input+=r.input_tokens||0,f[o].output+=r.output_tokens||0,f[o].cacheRead+=r.cache_read_input_tokens||0,f[o].cacheCreation+=r.cache_creation_input_tokens||0,f[o].count+=r.count||0}const i=Object.entries(f).sort((d,o)=>o[1].count-d[1].count);return e.jsxs("div",{className:h.projectStatsContent,children:[m&&e.jsx("div",{className:h.projectStatsUpdated,children:p("ui.projectStats.updatedAt",{time:new Date(m).toLocaleString()})}),e.jsxs("div",{className:h.projectStatsSummary,children:[e.jsxs("div",{className:h.projectStatCard,children:[e.jsx("div",{className:h.projectStatValue,children:(c==null?void 0:c.requestCount)??0}),e.jsx("div",{className:h.projectStatLabel,children:p("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:h.projectStatCard,children:[e.jsx("div",{className:h.projectStatValue,children:(c==null?void 0:c.turnCount)??(c==null?void 0:c.sessionCount)??0}),e.jsx("div",{className:h.projectStatLabel,children:p("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:h.projectStatCard,children:[e.jsx("div",{className:h.projectStatValue,children:(c==null?void 0:c.fileCount)??0}),e.jsx("div",{className:h.projectStatLabel,children:p("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:h.projectStatCard,children:[e.jsx("div",{className:h.projectStatValue,children:q(c==null?void 0:c.input_tokens)}),e.jsx("div",{className:h.projectStatLabel,children:"Input Tokens"})]}),e.jsxs("div",{className:h.projectStatCard,children:[e.jsx("div",{className:h.projectStatValue,children:q(c==null?void 0:c.output_tokens)}),e.jsx("div",{className:h.projectStatLabel,children:"Output Tokens"})]})]}),i.length>0&&e.jsxs("div",{className:h.projectStatsSection,children:[e.jsx("div",{className:h.projectStatsSectionTitle,children:p("ui.projectStats.modelUsage")}),i.map(([d,o])=>{const r=o.input+o.cacheRead+o.cacheCreation,u=r>0?(o.cacheRead/r*100).toFixed(1):"0.0";return e.jsxs("div",{className:h.projectStatsModelCard,children:[e.jsxs("div",{className:h.projectStatsModelHeader,children:[e.jsx("span",{className:h.projectStatsModelName,children:d}),e.jsxs("span",{className:h.projectStatsModelCount,children:[o.count," reqs"]})]}),e.jsx("table",{className:h.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:h.label,children:"Token"}),e.jsx("td",{className:h.th,children:"input"}),e.jsx("td",{className:h.th,children:"output"})]}),e.jsxs("tr",{className:h.rowBorder,children:[e.jsx("td",{className:h.label}),e.jsx("td",{className:h.td,children:q(r)}),e.jsx("td",{className:h.td,children:q(o.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:h.label,children:"Cache"}),e.jsx("td",{className:h.th,children:"create"}),e.jsx("td",{className:h.th,children:"read"})]}),e.jsxs("tr",{className:h.rowBorder,children:[e.jsx("td",{className:h.label}),e.jsx("td",{className:h.td,children:q(o.cacheCreation)}),e.jsx("td",{className:h.td,children:q(o.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:h.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:h.td,children:[u,"%"]})]})]})})]},d)})]})]})}render(){const{requestCount:t,requests:n=[],viewMode:c,cacheType:l,onToggleViewMode:m,onImportLocalLogs:f,onLangChange:i,isLocalLog:d,localLogFile:o,projectName:r,collapseToolResults:u,onCollapseToolResultsChange:v,expandThinking:x,onExpandThinkingChange:g,expandDiff:j,onExpandDiffChange:b,filterIrrelevant:k,onFilterIrrelevantChange:_,updateInfo:C,onDismissUpdate:T,cliMode:I,terminalVisible:B,onToggleTerminal:L,onReturnToWorkspaces:E,contextWindow:R,serverCachedContent:P,resumeAutoChoice:ee,onResumeAutoChoiceToggle:te,onResumeAutoChoiceChange:F}=this.props,{countdownText:K}=this.state,he=[{key:"import-local",icon:e.jsx(Ot,{}),label:p("ui.importLocalLogs"),onClick:f},{key:"export-prompts",icon:e.jsx(Qn,{}),label:p("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(It,{}),label:p("ui.pluginManagement"),onClick:this.handleShowPlugins},...I&&E?[{key:"switch-workspace",icon:e.jsx(Ot,{className:h.iconMirror}),label:p("ui.switchWorkspace"),onClick:E}]:[],{key:"process-management",icon:e.jsx(st,{}),label:p("ui.processManagement"),onClick:this.handleShowProcesses},{type:"divider"},{key:"project-stats",icon:e.jsx(Lt,{}),label:p("ui.projectStats"),onClick:this.handleShowProjectStats},...c==="raw"?[{key:"global-settings",icon:e.jsx(Bt,{}),label:p("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...c==="chat"?[{key:"display-settings",icon:e.jsx(Bt,{}),label:p("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[],{key:"language",icon:e.jsx(Zn,{}),label:p("ui.languageSettings"),children:[{key:"lang-grid-container",type:"group",label:e.jsx("div",{className:h.langGrid,children:xa.map(w=>e.jsx(W,{size:"small",type:w.value===sn()?"primary":"default",onClick:V=>{V.stopPropagation(),tn(w.value),i&&i()},className:h.langBtn,children:w.label},w.value))})}]}];return e.jsxs("div",{className:h.headerBar,children:[e.jsxs(De,{size:"middle",children:[e.jsx(nn,{menu:{items:he,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:w=>this.setState({logoDropdownOpen:w}),align:{offset:[-4,0]},children:e.jsx("span",{className:`${h.logoWrap}${this.state.logoDropdownOpen?` ${h.logoWrapActive}`:""}`,children:e.jsx("img",{src:"/favicon.ico",alt:"Logo",className:`${h.logoImage}${this.state.logoDropdownOpen?` ${h.logoImageActive}`:""}`})})}),e.jsx(Be,{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(fe,{className:h.tokenStatsTag,children:[e.jsx(st,{className:h.tokenStatsIcon}),p("ui.tokenStats")]})}),(()=>{var G,me,ie,pe,ve;let w=0;const V=Ht.find(se=>se.value===this.state.calibrationModel),oe=V==null?void 0:V.tokens;if(!d){if(oe&&(R==null?void 0:R.used_percentage)!=null){const se=D=>{var ne,$;const X=($=(ne=D.response)==null?void 0:ne.body)==null?void 0:$.usage;return((X==null?void 0:X.input_tokens)||0)+((X==null?void 0:X.cache_creation_input_tokens)||0)+((X==null?void 0:X.cache_read_input_tokens)||0)};let Y=0;for(let D=n.length-1;D>=0;D--)if(be(n[D])&&((me=(G=n[D].response)==null?void 0:G.body)!=null&&me.usage)){Y=se(n[D]);break}if(Y>0){const D=oe*.835;w=Math.min(100,Math.max(0,Math.round(Y/D*100)))}else{const D=R.context_window_size||2e5;w=Math.min(100,Math.max(0,Math.round(R.used_percentage*D/oe/83.5*100)))}}else if((R==null?void 0:R.used_percentage)!=null){const se=this.state.settingsModel?bt(this.state.settingsModel):0,Y=R.context_window_size||2e5;se&&se!==Y?w=Math.min(100,Math.max(0,Math.round(R.used_percentage*Y/se/83.5*100))):w=Math.min(100,Math.max(0,Math.round(R.used_percentage/83.5*100)))}else if(n.length>0){const se=Y=>{var X,ne;const D=(ne=(X=Y.response)==null?void 0:X.body)==null?void 0:ne.usage;return((D==null?void 0:D.input_tokens)||0)+((D==null?void 0:D.cache_creation_input_tokens)||0)+((D==null?void 0:D.cache_read_input_tokens)||0)};for(let Y=n.length-1;Y>=0;Y--)if(be(n[Y])&&((pe=(ie=n[Y].response)==null?void 0:ie.body)!=null&&pe.usage)){const D=se(n[Y]),ne=(oe||(R==null?void 0:R.context_window_size)||bt(((ve=n[Y].body)==null?void 0:ve.model)||this.state.settingsModel))*.835;ne>0&&D>0&&(w=Math.min(100,Math.max(0,Math.round(D/ne*100))));break}}}w===0&&this._lastContextPercent>0&&(w=this._lastContextPercent);const ue=w>=80?"#ff4d4f":w>=60?"#faad14":"#52c41a";return d?e.jsx(fe,{className:`${h.liveTag} ${h.liveTagHistory}`,children:e.jsx("span",{className:h.liveTagText,children:p("ui.historyLog",{file:o})})}):e.jsx(Be,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(w):e.jsx("div",{className:h.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},onOpenChange:se=>{this.setState({_cachePopoverOpen:se}),se||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:h.liveTag,style:{borderColor:ue,color:ue},children:[e.jsx("span",{className:h.liveTagFill,style:{width:`${w}%`,backgroundColor:ue}}),e.jsx("span",{className:h.liveTagContent,children:e.jsxs("span",{className:h.liveTagText,children:[p("ui.liveMonitoring"),r?`:${r}`:""]})})]})})})(),C&&e.jsx(fe,{color:C.type==="completed"?"green":"orange",closable:!0,onClose:()=>T&&T(),children:C.type==="completed"?p("ui.update.completed",{version:C.version}):p("ui.update.majorAvailable",{version:C.version})})]}),e.jsxs(De,{size:"middle",children:[K&&e.jsxs(fe,{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:h.countdownStrong,children:K})]}),c==="chat"&&I&&!d&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&e.jsx(Be,{content:this.state.countryInfo?e.jsxs("div",{className:h.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:h.countryInfoMeta,children:this.state.countryInfo.org}),this.state.countryInfo.ip&&e.jsx("div",{className:h.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(W,{className:h.compactBtnNoBorder,icon:e.jsx("span",{className:h.countryFlagIcon,children:this.state.countryFlag})})}),e.jsx(Be,{content:e.jsxs("div",{className:h.qrcodePopover,children:[e.jsx("div",{className:h.qrcodeTitle,children:p("ui.scanToCoding")}),e.jsx(gs,{value:this.state.localUrl,size:200,bgColor:"#141414",fgColor:"#d9d9d9",level:"M"}),e.jsx(Ct,{readOnly:!0,value:this.state.localUrl,className:h.qrcodeUrlInput,suffix:e.jsx(Pe,{className:h.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{Q.success(p("ui.copied"))}).catch(()=>{})}})})]}),trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},children:e.jsx(W,{className:h.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:h.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"})]})})})]}),I&&c==="chat"&&!d&&e.jsx(W,{className:h.compactBtn,type:B?"primary":"default",ghost:B,icon:e.jsx(qe,{}),onClick:L,children:p("ui.terminal")}),e.jsx(W,{className:h.compactBtn,type:c==="raw"?"primary":"default",icon:c==="raw"?e.jsx(an,{}):e.jsx(Ue,{}),onClick:m,children:c==="raw"?p("ui.chatMode"):p("ui.rawMode")})]}),e.jsxs(Ce,{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:h.promptExportBar,children:e.jsx(W,{icon:e.jsx(ln,{}),onClick:this.handleExportPromptsTxt,children:p("ui.exportPromptsTxt")})}),e.jsx(Wt,{activeKey:this.state.promptViewMode,onChange:w=>this.setState({promptViewMode:w}),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:h.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:h.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:h.promptEmpty,children:p("ui.noPrompt")}),this.state.promptData.map((w,V)=>{const oe=w.timestamp?new Date(w.timestamp).toLocaleString():p("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:h.promptTimestamp,children:[oe,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(w):this.renderTextPrompt(w)]},V)})]})]}),e.jsxs(Ve,{title:p("ui.settings"),placement:"left",width:360,open:this.state.settingsDrawerVisible,onClose:()=>this.setState({settingsDrawerVisible:!1}),children:[e.jsxs("div",{className:h.settingsGroupBox,children:[e.jsx("div",{className:h.settingsGroupTitle,children:p("ui.chatDisplaySwitches")}),e.jsxs("div",{className:h.settingsItem,children:[e.jsx("span",{className:h.settingsLabel,children:p("ui.collapseToolResults")}),e.jsx(Oe,{checked:!!u,onChange:w=>v&&v(w)})]}),e.jsxs("div",{className:h.settingsItem,children:[e.jsx("span",{className:h.settingsLabel,children:p("ui.expandThinking")}),e.jsx(Oe,{checked:!!x,onChange:w=>g&&g(w)})]})]}),e.jsxs("div",{className:h.settingsGroupBox,children:[e.jsx("div",{className:h.settingsGroupTitle,children:p("ui.userPreferences")}),e.jsxs("div",{className:h.settingsItem,children:[e.jsx("span",{className:h.settingsLabel,children:p("ui.resumeAutoChoice")}),e.jsx(Oe,{checked:!!ee,onChange:w=>te&&te(w)})]}),ee&&e.jsx("div",{className:h.settingsItem,children:e.jsxs(et.Group,{value:ee,onChange:w=>F&&F(w.target.value),size:"small",children:[e.jsx(et,{value:"continue",children:p("ui.resumeAutoChoice.continue")}),e.jsx(et,{value:"new",children:p("ui.resumeAutoChoice.new")})]})})]})]}),e.jsxs(Ve,{title:p("ui.globalSettings"),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:h.settingsItem,children:[e.jsx("span",{className:h.settingsLabel,children:p("ui.filterIrrelevant")}),e.jsx(Oe,{checked:!!k,onChange:w=>_&&_(w)})]}),e.jsxs("div",{className:h.settingsItem,children:[e.jsx("span",{className:h.settingsLabel,children:p("ui.expandDiff")}),e.jsx(Oe,{checked:!!j,onChange:w=>b&&b(w)})]})]}),e.jsx(Ve,{title:e.jsxs("span",{children:[e.jsx(Lt,{className:h.titleIcon}),p("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(Ce,{title:e.jsxs("span",{children:[e.jsx(It,{className:h.titleIcon}),p("ui.pluginManagement")]}),open:this.state.pluginModalVisible,onCancel:()=>this.setState({pluginModalVisible:!1}),footer:e.jsxs("div",{className:h.pluginModalFooter,children:[e.jsxs("div",{className:h.pluginModalFooterLeft,children:[e.jsx(W,{icon:e.jsx(on,{}),onClick:this.handleAddPlugin,children:p("ui.plugins.add")}),e.jsx(W,{icon:e.jsx(At,{}),onClick:this.handleShowCdnModal,children:p("ui.plugins.cdnInstall")})]}),e.jsx(W,{icon:e.jsx(ot,{}),onClick:this.handleReloadPlugins,children:p("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:h.pluginDirHint,children:[e.jsxs("span",{className:h.pluginDirLabel,children:[p("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:h.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{Q.success(p("ui.copied"))}).catch(()=>{})},children:this.state.pluginsDir})]}),this.state.pluginsList.length===0?e.jsxs("div",{className:h.pluginEmpty,children:[e.jsx("div",{className:h.pluginEmptyTitle,children:p("ui.plugins.empty")}),e.jsx("div",{className:h.pluginEmptyHint,children:p("ui.plugins.emptyHint")})]}):e.jsx("div",{className:h.pluginList,children:this.state.pluginsList.map(w=>e.jsxs("div",{className:h.pluginItem,children:[e.jsxs("div",{className:h.pluginInfo,children:[e.jsx("span",{className:h.pluginName,children:w.name}),e.jsx("span",{className:h.pluginFile,children:w.file}),w.hooks.length>0&&e.jsx("span",{className:h.pluginHooks,children:w.hooks.map(V=>e.jsx("span",{className:h.pluginHookTag,children:V},V))})]}),e.jsxs("div",{className:h.pluginActions,children:[e.jsx(Oe,{size:"small",checked:w.enabled,onChange:V=>this.handleTogglePlugin(w.name,V)}),e.jsx(W,{type:"text",size:"small",danger:!0,icon:e.jsx(Kt,{}),onClick:()=>this.handleDeletePlugin(w.file,w.name)})]})]},w.file))})]}),e.jsx(Ce,{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(Ce,{title:e.jsxs("span",{children:[e.jsx(At,{className:h.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:h.cdnUrlLabel,children:p("ui.plugins.cdnUrl")}),e.jsx(Ct,{placeholder:p("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:h.cdnInput})]})}),e.jsx(Ce,{title:e.jsxs("span",{children:[e.jsx(st,{className:h.titleIcon}),p("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(W,{icon:e.jsx(ot,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:p("ui.processManagement.refresh")}),width:780,children:e.jsx(rn,{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:w=>w?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${w}`,target:"_blank",rel:"noopener noreferrer",children:w}):""},{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:(w,V)=>V.isCurrent?e.jsx(fe,{color:"green",children:p("ui.processManagement.current")}):e.jsx(W,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(V.pid),children:p("ui.processManagement.kill")})}]})})]})}};O(Se,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Ke=Se;const va="_centerEmpty_1x9ij_1",ja="_scrollContainer_1x9ij_8",ya="_listItem_1x9ij_15",ba="_listItemActive_1x9ij_27",Ca="_itemContent_1x9ij_36",_a="_itemHeader_1x9ij_41",Na="_tagNoMargin_1x9ij_49",ka="_modelName_1x9ij_54",Sa="_time_1x9ij_58",wa="_detailRow_1x9ij_64",Ta="_urlText_1x9ij_71",Ea="_duration_1x9ij_80",Ma="_statusOk_1x9ij_85",Ra="_statusErr_1x9ij_91",Ia="_statusDefault_1x9ij_96",La="_usageBox_1x9ij_101",Aa="_cacheDot_1x9ij_111",Oa="_cacheDotLoss_1x9ij_120",Ba="_cacheDotNormal_1x9ij_125",Pa="_tagPlan_1x9ij_129",Da="_tagMuted_1x9ij_135",Ha="_tooltipPreLine_1x9ij_141",z={centerEmpty:va,scrollContainer:ja,listItem:ya,listItemActive:ba,itemContent:Ca,itemHeader:_a,tagNoMargin:Na,modelName:ka,time:Sa,detailRow:wa,urlText:Ta,duration:Ea,statusOk:Ma,statusErr:Ra,statusDefault:Ia,usageBox:La,cacheDot:Aa,cacheDotLoss:Oa,cacheDotNormal:Ba,tagPlan:Pa,tagMuted:Da,tooltipPreLine:Ha};class Fa extends U.Component{constructor(t){super(t);O(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:n,selectedIndex:c,onSelect:l}=this.props;if(!n.length)return;t.preventDefault();const m=c??0,f=t.key==="ArrowUp"?Math.max(0,m-1):Math.min(n.length-1,m+1);f!==m&&l(f)});this.activeItemRef=U.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:n,onSelect:c}=this.props;return t.length===0?e.jsx("div",{className:z.centerEmpty,children:e.jsx(we,{description:p("ui.waitingRequests")})}):e.jsx("div",{className:z.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(_t,{dataSource:t,size:"small",split:!1,renderItem:(l,m)=>{var T,I,B;const f=new Date(l.timestamp).toLocaleTimeString("zh-CN"),i=m===n,d=l.response&&l.response.status<400,o=l.response&&l.response.status>=400,r=cn((T=l.body)==null?void 0:T.model),u=m+1<t.length?t[m+1]:null,{type:v,subType:x}=$e(l,u),g=(B=(I=l.response)==null?void 0:I.body)==null?void 0:B.usage,j=g?(g.input_tokens||0)+(g.cache_read_input_tokens||0)+(g.cache_creation_input_tokens||0):null,b=(g==null?void 0:g.output_tokens)||null,k=(g==null?void 0:g.cache_read_input_tokens)||0,_=(g==null?void 0:g.cache_creation_input_tokens)||0;let C=l.url;try{const L=new URL(l.url);C=L.host+L.pathname}catch{}return e.jsx(_t.Item,{ref:i?this.activeItemRef:void 0,tabIndex:0,onClick:()=>c(m),className:`${z.listItem} ${i?z.listItemActive:""}`,children:e.jsxs("div",{className:z.itemContent,children:[e.jsxs("div",{className:z.itemHeader,children:[v==="MainAgent"?e.jsx(fe,{color:"orange",className:z.tagNoMargin,children:"MainAgent"}):v==="Plan"?e.jsx(fe,{className:`${z.tagNoMargin} ${z.tagPlan}`,children:Nt(v,x)}):v==="Count"||v==="Preflight"?e.jsx(fe,{className:`${z.tagNoMargin} ${z.tagMuted}`,children:v}):e.jsx(fe,{className:z.tagNoMargin,children:Nt(v,x)}),r&&e.jsx("span",{className:z.modelName,style:{color:v==="MainAgent"?"#d4822d":"#8c8c8c"},children:r}),e.jsx("span",{className:z.time,children:f})]}),e.jsxs("div",{className:z.detailRow,children:[e.jsx("span",{className:z.urlText,title:l.url,children:C}),l.duration&&e.jsxs("span",{className:z.duration,children:[l.duration,"ms"]}),l.response&&e.jsx("span",{className:d?z.statusOk:o?z.statusErr:z.statusDefault,children:l.response.status})]}),g&&e.jsxs("div",{className:z.usageBox,children:[e.jsxs("div",{children:["token: output:",q(b)||0,", input: ",q(j)||0]}),(k>0||_>0)&&e.jsx("div",{children:(()=>{var P;const L=(P=this.props.cacheLossMap)==null?void 0:P.get(m),E={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 R;if(L){const te=(L.reasons||[L.reason]).map(F=>p(E[F]||E.key_change)).join(`
27
- `);R=e.jsx(Gt,{title:e.jsx("span",{className:z.tooltipPreLine,children:te}),children:e.jsx("span",{className:`${z.cacheDot} ${z.cacheDotLoss}`})})}else R=e.jsx("span",{className:`${z.cacheDot} ${z.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",R,": ",k>0?`read:${q(k)}`:"",k>0&&_>0?", ":"",_>0?`create:${q(_)}`:""]})})()})]})]})})}})})}}const $a=a=>typeof a=="boolean"||a instanceof Boolean,za=a=>typeof a=="number"||a instanceof Number,Va=a=>typeof a=="bigint"||a instanceof BigInt,fs=a=>!!a&&a instanceof Date,Ua=a=>typeof a=="string"||a instanceof String,qa=a=>Array.isArray(a),xs=a=>typeof a=="object"&&a!==null,vs=a=>!!a&&a instanceof Object&&typeof a=="function";function Ge(a,s){return s===void 0&&(s=!1),!a||s?`"${a}"`:a}function Wa(a,s,t){return t?JSON.stringify(a):s?`"${a}"`:a}function js(a){let{field:s,value:t,data:n,lastElement:c,openBracket:l,closeBracket:m,level:f,style:i,shouldExpandNode:d,clickToExpandNode:o,outerRef:r,beforeExpandChange:u}=a;const v=y.useRef(!1),[x,g]=y.useState(()=>d(f,t,s)),j=y.useRef(null);y.useEffect(()=>{v.current?g(d(f,t,s)):v.current=!0},[d]);const b=y.useId();if(n.length===0)return Ka({field:s,openBracket:l,closeBracket:m,lastElement:c,style:i});const k=x?i.collapseIcon:i.expandIcon,_=x?i.ariaLables.collapseJson:i.ariaLables.expandJson,C=f+1,T=n.length-1,I=E=>{x!==E&&(!u||u({level:f,value:t,field:s,newExpandValue:E}))&&g(E)},B=E=>{if(E.key==="ArrowRight"||E.key==="ArrowLeft")E.preventDefault(),I(E.key==="ArrowRight");else if(E.key==="ArrowUp"||E.key==="ArrowDown"){E.preventDefault();const R=E.key==="ArrowUp"?-1:1;if(!r.current)return;const P=r.current.querySelectorAll("[role=button]");let ee=-1;for(let F=0;F<P.length;F++)if(P[F].tabIndex===0){ee=F;break}if(ee<0)return;const te=(ee+R+P.length)%P.length;P[ee].tabIndex=-1,P[te].tabIndex=0,P[te].focus()}},L=()=>{var E;I(!x);const R=j.current;if(!R)return;const P=(E=r.current)===null||E===void 0?void 0:E.querySelector('[role=button][tabindex="0"]');P&&(P.tabIndex=-1),R.tabIndex=0,R.focus()};return y.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-expanded":x,"aria-selected":void 0},y.createElement("span",{className:k,onClick:L,onKeyDown:B,role:"button","aria-label":_,"aria-expanded":x,"aria-controls":x?b:void 0,ref:j,tabIndex:f===0?0:-1}),(s||s==="")&&(o?y.createElement("span",{className:i.clickableLabel,onClick:L,onKeyDown:B},Ge(s,i.quotesForFieldNames),":"):y.createElement("span",{className:i.label},Ge(s,i.quotesForFieldNames),":")),y.createElement("span",{className:i.punctuation},l),x?y.createElement("ul",{id:b,role:"group",className:i.childFieldsContainer},n.map((E,R)=>y.createElement(ct,{key:E[0]||R,field:E[0],value:E[1],style:i,lastElement:R===T,level:C,shouldExpandNode:d,clickToExpandNode:o,beforeExpandChange:u,outerRef:r}))):y.createElement("span",{className:i.collapsedContent,onClick:L,onKeyDown:B}),y.createElement("span",{className:i.punctuation},m),!c&&y.createElement("span",{className:i.punctuation},","))}function Ka(a){let{field:s,openBracket:t,closeBracket:n,lastElement:c,style:l}=a;return y.createElement("div",{className:l.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&y.createElement("span",{className:l.label},Ge(s,l.quotesForFieldNames),":"),y.createElement("span",{className:l.punctuation},t),y.createElement("span",{className:l.punctuation},n),!c&&y.createElement("span",{className:l.punctuation},","))}function Ga(a){let{field:s,value:t,style:n,lastElement:c,shouldExpandNode:l,clickToExpandNode:m,level:f,outerRef:i,beforeExpandChange:d}=a;return js({field:s,value:t,lastElement:c||!1,level:f,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:l,clickToExpandNode:m,data:Object.keys(t).map(o=>[o,t[o]]),outerRef:i,beforeExpandChange:d})}function Ja(a){let{field:s,value:t,style:n,lastElement:c,level:l,shouldExpandNode:m,clickToExpandNode:f,outerRef:i,beforeExpandChange:d}=a;return js({field:s,value:t,lastElement:c||!1,level:l,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:m,clickToExpandNode:f,data:t.map(o=>[void 0,o]),outerRef:i,beforeExpandChange:d})}function Qa(a){let{field:s,value:t,style:n,lastElement:c}=a,l,m=n.otherValue;return t===null?(l="null",m=n.nullValue):t===void 0?(l="undefined",m=n.undefinedValue):Ua(t)?(l=Wa(t,!n.noQuotesForStringValues,n.stringifyStringValues),m=n.stringValue):$a(t)?(l=t?"true":"false",m=n.booleanValue):za(t)?(l=t.toString(),m=n.numberValue):Va(t)?(l=`${t.toString()}n`,m=n.numberValue):fs(t)?l=t.toISOString():vs(t)?l="function() { }":l=t.toString(),y.createElement("div",{className:n.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&y.createElement("span",{className:n.label},Ge(s,n.quotesForFieldNames),":"),y.createElement("span",{className:m},l),!c&&y.createElement("span",{className:n.punctuation},","))}function ct(a){const s=a.value;return qa(s)?y.createElement(Ja,Object.assign({},a)):xs(s)&&!fs(s)&&!vs(s)?y.createElement(Ga,Object.assign({},a)):y.createElement(Qa,Object.assign({},a))}var H={"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 ys={collapseJson:"collapse JSON",expandJson:"expand JSON"},nt={container:H["container-light"],basicChildStyle:H["basic-element-style"],childFieldsContainer:H["child-fields-container"],label:H["label-light"],clickableLabel:H["clickable-label-light"],nullValue:H["value-null-light"],undefinedValue:H["value-undefined-light"],stringValue:H["value-string-light"],booleanValue:H["value-boolean-light"],numberValue:H["value-number-light"],otherValue:H["value-other-light"],punctuation:H["punctuation-light"],collapseIcon:H["collapse-icon-light"],expandIcon:H["expand-icon-light"],collapsedContent:H["collapsed-content-light"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:ys,stringifyStringValues:!1},Ya={container:H["container-dark"],basicChildStyle:H["basic-element-style"],childFieldsContainer:H["child-fields-container"],label:H["label-dark"],clickableLabel:H["clickable-label-dark"],nullValue:H["value-null-dark"],undefinedValue:H["value-undefined-dark"],stringValue:H["value-string-dark"],booleanValue:H["value-boolean-dark"],numberValue:H["value-number-dark"],otherValue:H["value-other-dark"],punctuation:H["punctuation-dark"],collapseIcon:H["collapse-icon-dark"],expandIcon:H["expand-icon-dark"],collapsedContent:H["collapsed-content-dark"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:ys,stringifyStringValues:!1},Xa=()=>!0,Za=a=>{let{data:s,style:t=nt,shouldExpandNode:n=Xa,clickToExpandNode:c=!1,beforeExpandChange:l,compactTopLevel:m,...f}=a;const i=y.useRef(null);return y.createElement("div",Object.assign({"aria-label":"JSON view"},f,{className:t.container,ref:i,role:"tree"}),m&&xs(s)?Object.entries(s).map(d=>{let[o,r]=d;return y.createElement(ct,{key:o,field:o,value:r,style:{...nt,...t},lastElement:!0,level:1,shouldExpandNode:n,clickToExpandNode:c,beforeExpandChange:l,outerRef:i})}):y.createElement(ct,{value:s,style:{...nt,...t},lastElement:!0,level:0,shouldExpandNode:n,clickToExpandNode:c,outerRef:i,beforeExpandChange:l}))},el="_container_1h2lr_1",tl={container:el},sl={...Ya,container:"rjv-container"};class Je extends U.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:n}=this.props;if(s==null)return null;const c=typeof n=="function"?n:t==="all"?()=>!0:t==="root"?l=>l<2:l=>l<1;return e.jsx("div",{className:tl.container,children:e.jsx(Za,{data:s,shouldExpandNode:c,style:sl})})}}function nl({currentId:a,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const n=s.findIndex(l=>l===a),c=t==="ArrowUp"?-1:1;return n>=0?s[n+c]??null:null}const al="_root_e46oo_1",ll="_sidebar_e46oo_9",ol="_section_e46oo_18",il="_sectionHeader_e46oo_22",rl="_arrow_e46oo_48",cl="_sectionTitle_e46oo_54",dl="_sectionCount_e46oo_62",hl="_sectionBody_e46oo_71",ul="_historyToggle_e46oo_76",ml="_historyToggleLabel_e46oo_102",pl="_item_e46oo_107",gl="_itemActive_e46oo_133",fl="_itemContent_e46oo_143",xl="_itemLabel_e46oo_149",vl="_itemSublabel_e46oo_157",jl="_itemTime_e46oo_166",yl="_content_e46oo_175",bl="_contentEmpty_e46oo_183",Cl="_contentInner_e46oo_190",_l="_emptyWrap_e46oo_194",Nl="_roleHeader_e46oo_202",kl="_roleBadge_e46oo_210",Sl="_role_user_e46oo_219",wl="_role_assistant_e46oo_225",Tl="_roleLabel_e46oo_231",El="_contentTime_e46oo_238",Ml="_turnDivider_e46oo_246",Rl="_textBlock_e46oo_253",Il="_textBlockBar_e46oo_260",Ll="_textBlockBody_e46oo_269",Al="_textBlockCompact_e46oo_277",Ol="_textBlockCompactFloat_e46oo_284",Bl="_thinkingBlock_e46oo_291",Pl="_thinkingHeader_e46oo_299",Dl="_thinkingPreview_e46oo_314",Hl="_thinkingBody_e46oo_324",Fl="_toolBlock_e46oo_330",$l="_toolBlockResult_e46oo_337",zl="_toolBlockError_e46oo_341",Vl="_toolBlockHeader_e46oo_345",Ul="_toolBlockBody_e46oo_356",ql="_toolName_e46oo_361",Wl="_toolId_e46oo_367",Kl="_errorLabel_e46oo_374",Gl="_blockTag_e46oo_384",Jl="_blockTagText_e46oo_397",Ql="_blockTagThinking_e46oo_403",Yl="_blockTagResult_e46oo_409",Xl="_blockTagError_e46oo_415",Zl="_jsonBlock_e46oo_422",eo="_jsonBlockLabel_e46oo_429",to="_blockSeparator_e46oo_439",so="_markdownBody_e46oo_446",S={root:al,sidebar:ll,section:ol,sectionHeader:il,arrow:rl,sectionTitle:cl,sectionCount:dl,sectionBody:hl,historyToggle:ul,historyToggleLabel:ml,item:pl,itemActive:gl,itemContent:fl,itemLabel:xl,itemSublabel:vl,itemTime:jl,content:yl,contentEmpty:bl,contentInner:Cl,emptyWrap:_l,roleHeader:Nl,roleBadge:kl,role_user:Sl,role_assistant:wl,roleLabel:Tl,contentTime:El,turnDivider:Ml,textBlock:Rl,textBlockBar:Il,textBlockBody:Ll,textBlockCompact:Al,textBlockCompactFloat:Ol,thinkingBlock:Bl,thinkingHeader:Pl,thinkingPreview:Dl,thinkingBody:Hl,toolBlock:Fl,toolBlockResult:$l,toolBlockError:zl,toolBlockHeader:Vl,toolBlockBody:Ul,toolName:ql,toolId:Wl,errorLabel:Kl,blockTag:Gl,blockTagText:Jl,blockTagThinking:Ql,blockTagResult:Yl,blockTagError:Xl,jsonBlock:Zl,jsonBlockLabel:eo,blockSeparator:to,markdownBody:so},{Text:no}=Jt;function dt(a){if(a==null)return[];if(typeof a=="string"){const s=a.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(a)){const s=[];for(const t of a)if(t)if(t.type==="text"){const n=(t.text||"").trim();n&&s.push({type:"markdown",text:n})}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 n=ao(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:n})}else if(t.type==="thinking"){const n=t.thinking||"";n.trim()&&s.push({type:"thinking",text:n})}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:a}]}function ao(a){if(a==null)return[];if(typeof a=="string"){const s=a.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(a)?a.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:a}]}function lo(a){if(!a)return null;if(typeof a=="string")return[{type:"markdown",text:a}];if(Array.isArray(a)){const s=[];return a.forEach((t,n)=>{n>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:a}]}function oo(a){const s=[],t=(a==null?void 0:a.name)||"unknown",n=(a==null?void 0:a.description)||"";let c=`### ${t}
28
-
29
- `;n&&(c+=`${n}
30
-
31
- `),s.push({type:"markdown",text:c});const l=(a==null?void 0:a.input_schema)||(a==null?void 0:a.parameters)||null;return l&&s.push({type:"json",label:"Parameters",data:l}),s}function io(a){var s;if(typeof a=="string")return a.slice(0,60).replace(/\n/g," ");if(Array.isArray(a)){for(const t of a)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 ro(a){var n;const s=[];let t=0;for(;t<a.length;){const c=a[t];if((c==null?void 0:c.role)!=="user"){t++;continue}const l=((n=a[t+1])==null?void 0:n.role)==="assistant"?a[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:c._timestamp||null,assistantTimestamp:(l==null?void 0:l._timestamp)||null,userBlocks:dt(c==null?void 0:c.content),assistantBlocks:l?dt(l.content):null,preview:io(c==null?void 0:c.content)}),t+=l?2:1}return s}function ht(a){try{return new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function co({text:a,compact:s}){const t=Qt(a);return s?e.jsx("div",{className:S.textBlockCompact,children:e.jsx("div",{className:`chat-md ${S.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:S.textBlock,children:[e.jsx("div",{className:S.textBlockBar,children:e.jsx("span",{className:`${S.blockTag} ${S.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${S.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function ho({block:a}){const[s,t]=y.useState(!0),n=a.text.length>60?a.text.slice(0,60).replace(/\n/g," ")+"…":a.text.replace(/\n/g," ");return e.jsxs("div",{className:S.thinkingBlock,children:[e.jsxs("div",{className:S.thinkingHeader,onClick:()=>t(c=>!c),children:[s?e.jsx(Te,{className:S.arrow}):e.jsx(Ee,{className:S.arrow}),e.jsx("span",{className:`${S.blockTag} ${S.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:S.thinkingPreview,children:n})]}),s&&e.jsx("div",{className:S.thinkingBody,children:e.jsx("div",{className:`chat-md ${S.markdownBody}`,dangerouslySetInnerHTML:{__html:Qt(a.text)}})})]})}function Qe({blocks:a,compact:s}){return!a||a.length===0?null:e.jsx(e.Fragment,{children:a.map((t,n)=>e.jsx(uo,{block:t,compact:s},n))})}function uo({block:a,compact:s}){var t;return a.type==="separator"?e.jsx("hr",{className:S.blockSeparator}):a.type==="markdown"?(t=a.text)!=null&&t.trim()?e.jsx(co,{text:a.text,compact:s}):null:a.type==="thinking"?e.jsx(ho,{block:a}):a.type==="tool_use"?e.jsxs("div",{className:S.toolBlock,children:[e.jsxs("div",{className:S.toolBlockHeader,children:[e.jsx("span",{className:S.blockTag,children:"tool_use"}),e.jsx("span",{className:S.toolName,children:a.name}),a.id&&e.jsx("span",{className:S.toolId,children:a.id})]}),e.jsx("div",{className:S.toolBlockBody,children:e.jsx(Je,{data:a.input,defaultExpand:"root"})})]}):a.type==="tool_result"?e.jsxs("div",{className:`${S.toolBlock} ${a.is_error?S.toolBlockError:S.toolBlockResult}`,children:[e.jsxs("div",{className:S.toolBlockHeader,children:[e.jsx("span",{className:`${S.blockTag} ${a.is_error?S.blockTagError:S.blockTagResult}`,children:"tool_result"}),a.tool_use_id&&e.jsx("span",{className:S.toolId,children:a.tool_use_id}),a.is_error&&e.jsx("span",{className:S.errorLabel,children:"error"})]}),e.jsx("div",{className:S.toolBlockBody,children:e.jsx(Qe,{blocks:a.content,compact:!0})})]}):a.type==="json"?e.jsxs("div",{className:S.jsonBlock,children:[a.label&&e.jsx("div",{className:S.jsonBlockLabel,children:a.label}),e.jsx(Je,{data:a.data,defaultExpand:"root"})]}):null}function mo({turn:a}){const s=a.timestamp?ht(a.timestamp):null,t=a.assistantTimestamp?ht(a.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:S.roleHeader,children:[e.jsx("span",{className:`${S.roleBadge} ${S.role_user}`,children:"user"}),e.jsx("span",{className:S.roleLabel,children:`Turn ${a.turnIndex+1}`}),s&&e.jsx("span",{className:S.contentTime,children:s})]}),e.jsx(Qe,{blocks:a.userBlocks}),a.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:S.turnDivider}),e.jsxs("div",{className:S.roleHeader,children:[e.jsx("span",{className:`${S.roleBadge} ${S.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:S.contentTime,children:t})]}),e.jsx(Qe,{blocks:a.assistantBlocks})]})]})}function po({sectionKey:a,title:s,items:t,historyItems:n=[],onSelect:c,onSelectById:l,selectedId:m,sidebarRef:f}){const[i,d]=y.useState(a!=="tools"),[o,r]=y.useState(!1),u=t.length+n.length,v=`${a}__history_toggle`;function x(b){var _;const k=(_=f.current)==null?void 0:_.querySelector(`[data-context-sidebar-control="${b}"]`);k&&(k.focus(),k.scrollIntoView({block:"nearest"}))}function g(b,k){var T;const _=Array.from(((T=f.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(I=>I.dataset.contextSidebarControl).filter(Boolean),C=nl({currentId:k,visibleIds:_,key:b.key});C&&(b.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var B;x(C);const I=(B=f.current)==null?void 0:B.querySelector(`[data-context-sidebar-control="${C}"]`);(I==null?void 0:I.dataset.controlType)==="item"&&l(C)}))}function j(b){const k=m===b.id;return e.jsxs("button",{type:"button",className:`${S.item} ${k?S.itemActive:""}`,onClick:()=>c(b),onKeyDown:_=>g(_,b.id),"aria-current":k?"true":void 0,"data-context-sidebar-control":b.id,"data-control-type":"item",children:[e.jsxs("div",{className:S.itemContent,children:[e.jsx("span",{className:S.itemLabel,children:b.label}),b.sublabel&&!k&&e.jsx("div",{className:S.itemSublabel,children:b.sublabel})]}),b.time&&e.jsx("span",{className:S.itemTime,children:b.time})]},b.id)}return e.jsxs("div",{className:S.section,children:[e.jsxs("button",{type:"button",className:S.sectionHeader,onClick:()=>d(b=>!b),"aria-expanded":i,children:[i?e.jsx(Te,{className:S.arrow}):e.jsx(Ee,{className:S.arrow}),e.jsx("span",{className:S.sectionTitle,children:s}),e.jsx("span",{className:S.sectionCount,children:u})]}),i&&e.jsxs("div",{className:S.sectionBody,children:[n.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:S.historyToggle,onClick:()=>r(b=>!b),onKeyDown:b=>g(b,v),"aria-expanded":o,"data-context-sidebar-control":v,"data-control-type":"toggle",children:[o?e.jsx(Te,{className:S.arrow}):e.jsx(Ee,{className:S.arrow}),e.jsxs("span",{className:S.historyToggleLabel,children:[p("ui.context.history")," (",n.length,")"]})]}),o&&n.map(j)]}),t.map(j)]})]})}function go({body:a,response:s}){const[t,n]=y.useState(null),c=y.useRef(null),l=y.useMemo(()=>{if(!Array.isArray(a==null?void 0:a.messages))return[];const o=ro(a.messages);if(o.length===0)return o;const r=o[o.length-1],u=s!=null&&s.content?dt(s.content):null;return[...o.slice(0,-1),{...r,assistantBlocks:u??r.assistantBlocks}]},[a,s]);if(y.useEffect(()=>{l.length>0?n(l[l.length-1]):n(null)},[a,s]),!a||typeof a!="object")return e.jsx("div",{className:S.emptyWrap,children:e.jsx(we,{description:p("ui.context.noData")})});const m=[];Array.isArray(a.tools)&&a.tools.length>0&&m.push({key:"tools",title:p("ui.context.tools"),items:a.tools.map((o,r)=>({id:`tool__${r}`,label:(o==null?void 0:o.name)||`Tool ${r}`,blocks:oo(o)}))});const f=lo(a.system);if(f!=null&&m.push({key:"system",title:p("ui.context.systemPrompt"),items:[{id:"system__0",label:p("ui.context.systemPrompt"),blocks:f}]}),l.length>0){const o=x=>({...x,label:p("ui.context.historyTurnNoTime",{n:x.turnIndex+1}),time:x.timestamp?ht(x.timestamp):null,sublabel:x.preview||void 0}),r=x=>({...x,label:p("ui.context.currentTurn"),sublabel:x.preview||void 0}),u=l.slice(0,-1).map(o),v=r(l[l.length-1]);m.push({key:"messages",title:p("ui.context.messages"),historyItems:u.length>0?u:void 0,items:[v]})}if(m.length===0)return e.jsx("div",{className:S.emptyWrap,children:e.jsx(we,{description:p("ui.context.noFields")})});const i=t!=null&&t.isTurn?l.find(o=>o.id===t.id)??null:t,d=new Map;return m.forEach(o=>{(o.historyItems||[]).forEach(r=>d.set(r.id,r)),o.items.forEach(r=>d.set(r.id,r))}),e.jsxs("div",{className:S.root,children:[e.jsx("div",{ref:c,className:S.sidebar,children:m.map(o=>e.jsx(po,{sectionKey:o.key,title:o.title,items:o.items,historyItems:o.historyItems,selectedId:i==null?void 0:i.id,onSelect:r=>n(r),onSelectById:r=>{const u=d.get(r);u&&n(u)},sidebarRef:c},o.key))}),e.jsx("div",{className:S.content,children:i==null?e.jsx("div",{className:S.contentEmpty,children:e.jsx(no,{type:"secondary",children:p("ui.context.selectPrompt")})}):e.jsx("div",{className:S.contentInner,children:i.isTurn?e.jsx(mo,{turn:i}):e.jsxs(e.Fragment,{children:[i.role&&e.jsxs("div",{className:S.roleHeader,children:[e.jsx("span",{className:`${S.roleBadge} ${S[`role_${i.role}`]||""}`,children:i.role}),e.jsx("span",{className:S.roleLabel,children:i.label})]}),e.jsx(Qe,{blocks:i.blocks})]})},i.id)})]})}const fo="_container_15skw_1",xo="_emptyState_15skw_9",vo="_urlSection_15skw_16",jo="_urlLeft_15skw_23",yo="_tokenStatsBox_15skw_28",bo="_tokenGrid_15skw_35",Co="_tokenRows_15skw_45",_o="_tokenRow_15skw_45",No="_tokenRowBorder_15skw_53",ko="_tokenLabel_15skw_57",So="_tokenTd_15skw_64",wo="_tokenHitRate_15skw_73",To="_tokenHitRateLabel_15skw_86",Eo="_urlText_15skw_96",Mo="_metaText_15skw_103",Ro="_headersContainer_15skw_107",Io="_headerRow_15skw_111",Lo="_headerKey_15skw_117",Ao="_headerValue_15skw_122",Oo="_streamingBox_15skw_127",Bo="_rawTextPre_15skw_140",Po="_tabContent_15skw_153",Do="_bodyLabel_15skw_161",Ho="_bodyHeader_15skw_165",Fo="_diffSection_15skw_172",$o="_diffToggle_15skw_176",zo="_diffIcon_15skw_182",Vo="_reminderSelect_15skw_208",Uo="_diffHeaderRow_15skw_227",qo="_diffSpaceRight_15skw_233",Wo="_reminderFilterWrapper_15skw_237",Ko="_reminderLabel_15skw_243",Go="_cacheTabContent_15skw_249",Jo="_userPromptList_15skw_254",Qo="_userPromptItem_15skw_260",Yo="_userPromptNavBtn_15skw_271",Xo="_cacheContent_15skw_282",Zo="_cacheTokenBar_15skw_289",ei="_cacheTokenWrite_15skw_299",ti="_cacheTokenRead_15skw_303",si="_cacheCopyIcon_15skw_307",ni="_cacheScrollArea_15skw_314",ai="_cacheSectionBlock_15skw_320",li="_cacheSectionHeader_15skw_324",oi="_cacheCollapseArrow_15skw_336",ii="_cachePre_15skw_342",ri="_cachePreSystem_15skw_356",N={container:fo,emptyState:xo,urlSection:vo,urlLeft:jo,tokenStatsBox:yo,tokenGrid:bo,tokenRows:Co,tokenRow:_o,tokenRowBorder:No,tokenLabel:ko,tokenTd:So,tokenHitRate:wo,tokenHitRateLabel:To,urlText:Eo,metaText:Mo,headersContainer:Ro,headerRow:Io,headerKey:Lo,headerValue:Ao,streamingBox:Oo,rawTextPre:Bo,tabContent:Po,bodyLabel:Do,bodyHeader:Ho,diffSection:Fo,diffToggle:$o,diffIcon:zo,reminderSelect:Vo,diffHeaderRow:Uo,diffSpaceRight:qo,reminderFilterWrapper:Wo,reminderLabel:Ko,cacheTabContent:Go,userPromptList:Jo,userPromptItem:Qo,userPromptNavBtn:Yo,cacheContent:Xo,cacheTokenBar:Zo,cacheTokenWrite:ei,cacheTokenRead:ti,cacheCopyIcon:si,cacheScrollArea:ni,cacheSectionBlock:ai,cacheSectionHeader:li,cacheCollapseArrow:oi,cachePre:ii,cachePreSystem:ri},{Text:ce,Paragraph:ci}=Jt;class di extends U.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){const t=this._cacheScrollEl;if(!t)return;const n=t.querySelector(`[data-msg-idx="${s}"]`);if(!n)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 c=!1,l=!1;const m=()=>{!c||!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),c=!0,m()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,m()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{l=!0,m()},500),n.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const c=be(s.request);this.setState({diffExpanded:c&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const n=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||n&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||n&&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||n&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var n,c;this.scrollToCacheMsg(t.msgIdx),(c=(n=this.props).onCacheHighlightDone)==null||c.call(n)},150)}toggleBodyViewMode(s){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[s]:t.bodyViewMode[s]==="json"?"text":"json"}}))}copyBody(s){var m;const{request:t}=this.props;if(!t)return;let n;if(s==="diff"?n=this._lastDiffResult:n=s==="request"?t.body:(m=t.response)==null?void 0:m.body,n==null)return;const c=typeof n=="object"?tt(n):n,l=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(l).then(()=>Q.success(p("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(ce,{type:"secondary",children:p("ui.noHeaders")}):e.jsx("div",{className:N.headersContainer,children:Object.entries(s).map(([t,n])=>e.jsxs("div",{className:N.headerRow,children:[e.jsx(ce,{code:!0,className:N.headerKey,children:t}),t==="authorization"&&e.jsx(ye,{doc:"TranslateContextPollution"}),e.jsx(ce,{type:"secondary",className:N.headerValue,children:String(n)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:n,requests:c,selectedIndex:l}=this.props;if(!n)return;const m=c&&l!=null?c[l+1]:null,{type:f}=$e(n,m);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 u=r.content;if(typeof u=="string")kt(u)&&i.add(r);else if(Array.isArray(u)){let v=!1;for(const x of u)x&&x.type==="text"&&kt(x.text)&&(i.add(x),v=!0);v&&(i.add(r),i.add(u))}}}let d=null;if(this.state.reminderFilters==="skills"&&Array.isArray(s.messages)){d=new Set,d.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const u=r.content;if(typeof u=="string")St(u)&&d.add(r);else if(Array.isArray(u)){let v=!1;for(const x of u)x&&x.type==="text"&&St(x.text)&&(d.add(x),v=!0);v&&(d.add(r),d.add(u))}}}const o=i||d;if(f==="Preflight"){const r=new Set,u=v=>{v&&typeof v=="object"&&(r.add(v),Array.isArray(v)?v.forEach(u):Object.values(v).forEach(u))};return Array.isArray(s.messages)&&u(s.messages),Array.isArray(s.system)&&s.system.length>=3&&u(s.system[2]),(v,x,g)=>!!(v<2||r.has(x)||o&&o.has(x)||v===1&&g==="system")}if(f==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const r=s.messages[0],u=r&&Array.isArray(r.content)?r.content:null,v=u&&u.length>0?u[u.length-1]:null,x=new Set,g=j=>{j&&typeof j=="object"&&(x.add(j),Array.isArray(j)?j.forEach(g):Object.values(j).forEach(g))};return v&&g(v),x.add(s.messages),r&&typeof r=="object"&&x.add(r),u&&x.add(u),(j,b,k)=>!!(j<2||x.has(b)||o&&o.has(b))}if(o)return(r,u,v)=>!!(r<2||o.has(u))}renderBody(s,t){const{bodyViewMode:n}=this.state;if(s==null)return e.jsx(ce,{type:"secondary",children:p("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:N.streamingBox,children:e.jsx(ce,{type:"secondary",children:p("ui.streamingResponse")})});const c=typeof s=="object"?tt(s):s,l=n[t]==="json",m=this.getRequestExpandNode(c,t);return e.jsx("div",{children:l?e.jsx(Je,{data:c,defaultExpand:t==="response"?"all":"root",expandNode:m}):e.jsx("pre",{className:N.rawTextPre,children:typeof c=="string"?c:JSON.stringify(c,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let n=t-1;n>=0;n--)if(be(s[n])){const c=s[n];return c._slimmed?wt(c,this.props.allRequests||s):c}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const n={},c=new Set([...Object.keys(s),...Object.keys(t)]);for(const l of c)if(!l.startsWith("_"))if(!(l in s))n[l]=t[l];else if(l in t){const m=JSON.stringify(s[l]),f=JSON.stringify(t[l]);m!==f&&(l==="messages"&&Array.isArray(s[l])&&Array.isArray(t[l])&&t[l].length>s[l].length?n[l]=t[l].slice(s[l].length):n[l]=t[l])}else continue;return Object.keys(n).length?n:null}render(){var u,v,x;let{request:s,currentTab:t,onTabChange:n}=this.props;if(!s)return e.jsx("div",{className:N.emptyState,children:e.jsx(we,{description:"选择一个请求查看详情"})});s._slimmed&&(s=wt(s,this.props.allRequests||this.props.requests));const c=new Date(s.timestamp).toLocaleString("zh-CN"),l=s.response&&s.response.status<400;let m=null;if(be(s)){const g=this.getPrevMainAgentRequest();if(g){const j=JSON.stringify(s.body).length,b=JSON.stringify(g.body).length;if(j<b)m=e.jsxs("div",{className:N.diffSection,children:[e.jsxs(ce,{strong:!0,className:N.diffToggle,onClick:()=>this.setState(_=>({diffExpanded:!_.diffExpanded})),children:["Body Diff JSON ",e.jsx(ye,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Te,{className:N.diffIcon}):e.jsx(Ee,{className:N.diffIcon})]}),this.state.diffExpanded&&e.jsx(ce,{type:"secondary",children:p("ui.diffSessionChanged")})]});else{const _=tt(this.computeDiff(g.body,s.body));_&&(this._lastDiffResult=_,m=e.jsxs("div",{className:N.diffSection,children:[e.jsxs("div",{className:N.diffHeaderRow,children:[e.jsxs(ce,{strong:!0,className:N.diffToggle,onClick:()=>this.setState(C=>({diffExpanded:!C.diffExpanded})),children:["Body Diff JSON ",e.jsx(ye,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Te,{className:N.diffIcon}):e.jsx(Ee,{className:N.diffIcon})]}),this.state.diffExpanded&&e.jsxs(De,{size:"small",className:N.diffSpaceRight,children:[e.jsx(W,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Ue,{}):e.jsx(qe,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(W,{size:"small",icon:e.jsx(Pe,{}),onClick:()=>this.copyBody("diff"),children:p("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(Je,{data:_,defaultExpand:"all"}):e.jsx("pre",{className:N.rawTextPre,children:JSON.stringify(_,null,2)})})]}))}}}const f=dn(s.body),i=hn(s.body),d=[{key:"request",label:"Request",children:e.jsxs("div",{className:N.tabContent,children:[e.jsxs("div",{className:N.diffSection,children:[e.jsxs(ce,{strong:!0,className:N.diffToggle,onClick:()=>this.setState(g=>({requestHeadersExpanded:!g.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Te,{className:N.diffIcon}):e.jsx(Ee,{className:N.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),m,e.jsxs("div",{children:[e.jsxs("div",{className:N.bodyHeader,children:[e.jsx(ce,{strong:!0,className:N.bodyLabel,children:"Body"}),e.jsxs(De,{size:"small",children:[(f||i)&&e.jsxs("span",{className:N.reminderFilterWrapper,children:[e.jsx("span",{className:N.reminderLabel,children:"system-reminder:"}),e.jsx(Ut,{size:"small",className:N.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:g=>this.setState({reminderFilters:g||null}),options:[{label:"CLAUDE.md",value:"claudeMd",disabled:!f},{label:"Skills",value:"skills",disabled:!i}],popupMatchSelectWidth:!1,allowClear:!0})]}),e.jsx(W,{size:"small",icon:this.state.bodyViewMode.request==="json"?e.jsx(Ue,{}):e.jsx(qe,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(W,{size:"small",icon:e.jsx(Pe,{}),onClick:()=>this.copyBody("request"),children:p("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:N.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:N.diffSection,children:[e.jsxs(ce,{strong:!0,className:N.diffToggle,onClick:()=>this.setState(g=>({responseHeadersExpanded:!g.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Te,{className:N.diffIcon}):e.jsx(Ee,{className:N.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:N.bodyHeader,children:[e.jsx(ce,{strong:!0,className:N.bodyLabel,children:"Body"}),e.jsxs(De,{size:"small",children:[e.jsx(W,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Ue,{}):e.jsx(qe,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(W,{size:"small",icon:e.jsx(Pe,{}),onClick:()=>this.copyBody("response"),children:p("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(we,{description:p("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(ye,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${N.tabContent} ${N.cacheTabContent}`,children:(()=>{const g=Vt([s]),j=s.timestamp+"|"+s.url;if(g&&(g.cacheCreateTokens>0||g.cacheReadTokens>0)&&(this._lastCachedTokensKey=j,this._lastCachedTokens={cacheCreateTokens:g.cacheCreateTokens,cacheReadTokens:g.cacheReadTokens}),!g||g.system.length===0&&g.messages.length===0&&g.tools.length===0)return e.jsx(we,{description:p("ui.noCachedContent"),image:we.PRESENTED_IMAGE_SIMPLE});const b=()=>{const C=[];return g.tools.length>0&&(C.push(`=== ${p("ui.tools")} ===`),g.tools.forEach(T=>C.push(T))),g.system.length>0&&(C.push(`
32
- === ${p("ui.systemPrompt")} ===`),g.system.forEach(T=>C.push(T))),g.messages.length>0&&(C.push(`
33
- === ${p("ui.messages")} ===`),g.messages.forEach(T=>C.push(T))),C.join(`
34
-
35
- `)},k=g.messages.map((C,T)=>({text:C,msgIdx:T})).filter(({text:C})=>C.startsWith("[user]")).map(({text:C,msgIdx:T})=>{const I=C.replace(/^\[user\]\s*/,"").trim();return!I||Fe(I)?{cleaned:"",msgIdx:T}:{cleaned:Ke.parseSegments(I).filter(E=>E.type==="text").map(E=>E.content.trim()).filter(E=>E&&!Fe(E)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:C})=>!(!C||/Implement the following plan:/i.test(C))),_=k.length>0?e.jsx("div",{className:N.userPromptList,children:k.map(({cleaned:C,msgIdx:T})=>e.jsx("div",{className:N.userPromptItem,onMouseEnter:I=>{I.currentTarget.style.background="rgba(22,104,220,0.2)",I.currentTarget.style.color="#fff"},onMouseLeave:I=>{I.currentTarget.style.background="",I.currentTarget.style.color="#ccc"},onClick:()=>this.scrollToCacheMsg(T),children:C},T))}):null;return e.jsxs("div",{className:N.cacheContent,children:[(()=>{const T=g.cacheCreateTokens>0||g.cacheReadTokens>0?g:this._lastCachedTokensKey===j?this._lastCachedTokens:null;return T||_?e.jsxs("div",{className:N.cacheTokenBar,children:[T&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:N.cacheTokenWrite,children:["write ",q(T.cacheCreateTokens)]})," / ",e.jsxs("span",{className:N.cacheTokenRead,children:["read ",q(T.cacheReadTokens)]}),e.jsx(Gt,{title:p("ui.copyAllCacheText"),children:e.jsx(Pe,{className:N.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(b()).then(()=>{Q.success(p("ui.copied"))}).catch(()=>{})}})})]}),_&&e.jsx(Be,{content:_,trigger:"hover",placement:"left",children:e.jsx("span",{className:N.userPromptNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:N.cacheScrollArea,ref:C=>{this._cacheScrollEl=C},children:[g.tools.length>0&&e.jsxs("div",{className:N.cacheSectionBlock,children:[e.jsxs("div",{className:N.cacheSectionHeader,onClick:()=>this.setState(C=>({cacheCollapsed:{...C.cacheCollapsed,tools:!C.cacheCollapsed.tools}})),children:[e.jsx("span",{className:N.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.tools")," (",g.tools.length,")"]}),!this.state.cacheCollapsed.tools&&g.tools.map((C,T)=>e.jsx("pre",{className:N.cachePre,children:C},T))]}),g.system.length>0&&e.jsxs("div",{className:N.cacheSectionBlock,children:[e.jsxs("div",{className:N.cacheSectionHeader,onClick:()=>this.setState(C=>({cacheCollapsed:{...C.cacheCollapsed,system:!C.cacheCollapsed.system}})),children:[e.jsx("span",{className:N.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.systemPrompt")," (",g.system.length,")"]}),!this.state.cacheCollapsed.system&&g.system.map((C,T)=>e.jsx("pre",{className:N.cachePreSystem,children:C},T))]}),g.messages.length>0&&e.jsxs("div",{className:N.cacheSectionBlock,children:[e.jsxs("div",{className:N.cacheSectionHeader,onClick:()=>this.setState(C=>({cacheCollapsed:{...C.cacheCollapsed,messages:!C.cacheCollapsed.messages}})),children:[e.jsx("span",{className:N.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.messages")," (",g.messages.length,")"]}),!this.state.cacheCollapsed.messages&&g.messages.map((C,T)=>{const I=T===this.state.cacheHighlightIdx,B=I?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:N.cachePre,style:B,children:[I&&e.jsx("svg",{style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",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"})})}),C]},T)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${N.tabContent} ${N.cacheTabContent}`,children:e.jsx(go,{body:s.body,response:(u=s.response)==null?void 0:u.body})})}],o=(x=(v=s.response)==null?void 0:v.body)==null?void 0:x.usage,r=o?(()=>{const g=o.input_tokens||0,j=o.output_tokens||0,b=o.cache_creation_input_tokens||0,k=o.cache_read_input_tokens||0,_=g+b+k,C=_>0?(k/_*100).toFixed(1):"0.0";return{input:g,output:j,cacheCreate:b,cacheRead:k,hitRate:C}})():null;return e.jsxs("div",{className:N.container,children:[e.jsxs("div",{className:N.urlSection,children:[e.jsxs("div",{className:N.urlLeft,children:[e.jsx(ci,{className:N.urlText,ellipsis:{rows:2,expandable:!0},children:s.url}),e.jsxs(De,{size:"small",wrap:!0,children:[e.jsx(fe,{color:s.method==="POST"?"blue":"green",children:s.method}),e.jsxs(ce,{type:"secondary",className:N.metaText,children:["🕐 ",c]}),s.duration&&e.jsxs(ce,{type:"secondary",className:N.metaText,children:["⏱️ ",s.duration,"ms"]}),s.response&&e.jsxs(fe,{color:l?"success":"error",children:["HTTP ",s.response.status]})]})]}),r&&e.jsx("div",{className:N.tokenStatsBox,children:e.jsxs("div",{className:N.tokenGrid,children:[e.jsxs("div",{className:N.tokenRows,children:[e.jsxs("div",{className:N.tokenRow,children:[e.jsx("span",{className:N.tokenLabel,children:"Token"}),e.jsxs("span",{className:N.tokenTd,children:["input: ",q(r.input)]}),e.jsxs("span",{className:N.tokenTd,children:["output: ",q(r.output)]})]}),e.jsxs("div",{className:`${N.tokenRow} ${N.tokenRowBorder}`,children:[e.jsx("span",{className:N.tokenLabel,children:"Cache"}),e.jsxs("span",{className:N.tokenTd,children:["create: ",q(r.cacheCreate)]}),e.jsxs("span",{className:N.tokenTd,children:["read: ",q(r.cacheRead)]})]})]}),e.jsxs("div",{className:N.tokenHitRate,children:[e.jsxs("div",{children:[r.hitRate,"%"]}),e.jsx("div",{className:N.tokenHitRateLabel,children:p("ui.hitRate")})]})]})})]}),e.jsx(Wt,{activeKey:t,onChange:n,items:d,size:"small"})]})}}const hi="_resizer_1xl2m_1",ui={resizer:hi};class mi extends U.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:ui.resizer})}}class ji extends un{constructor(t){super(t);O(this,"handleViewRequest",t=>{this.setState({viewMode:"raw",selectedIndex:t,scrollCenter:!0})});O(this,"handleViewInChat",()=>{this.setState(t=>{const c=(t.showAll?t.requests:ze(t.requests))[t.selectedIndex];if(!c)return null;let l=null;if(be(c)&&c.timestamp)l=c.timestamp;else{const m=$e(c);if((m.type==="SubAgent"||m.type==="Teammate")&&c.timestamp)l=c.timestamp;else{const f=t.requests.indexOf(c);f>=0&&(l=Tt(t.requests,f))}l||Q.info(p("ui.cannotMap"))}return{viewMode:"chat",chatScrollToTs:l}})});O(this,"handleToggleViewMode",()=>{this.setState(t=>{const n=t.viewMode==="raw"?"chat":"raw";if(n==="raw"){if(t.selectedIndex===null){const m=t.showAll?t.requests:ze(t.requests);return{viewMode:n,selectedIndex:m.length>0?m.length-1:null,scrollCenter:!0}}return{viewMode:n,scrollCenter:!0}}const c=t.showAll?t.requests:ze(t.requests),l=t.selectedIndex!=null?c[t.selectedIndex]:null;if(l){let m=null;if(be(l)&&l.timestamp)m=l.timestamp;else{const f=$e(l);if((f.type==="SubAgent"||f.type==="Teammate")&&l.timestamp)m=l.timestamp;else{const i=t.requests.indexOf(l);i>=0&&(m=Tt(t.requests,i)),m||Q.info(p("ui.cannotMap"))}}return{viewMode:n,chatScrollToTs:m}}return{viewMode:n,chatScrollToTs:null}},()=>{this.state.viewMode==="chat"&&this.state.terminalVisible&&this.state.cliMode&&!Ts&&requestAnimationFrame(()=>{const t=document.querySelector(".xterm-helper-textarea");t&&t.focus()})})});O(this,"handleTabChange",t=>{this.setState({currentTab:t})});O(this,"handleCacheHighlightDone",()=>{this.setState({pendingCacheHighlight:null})});O(this,"handleNavigateCacheMsg",t=>{const n=this.state.showAll?this.state.requests:ze(this.state.requests);let c=-1;for(let l=n.length-1;l>=0;l--)if(be(n[l])){c=l;break}c<0||this.setState({selectedIndex:c,scrollCenter:!0,currentTab:"kv-cache-text",pendingCacheHighlight:{msgIdx:t,key:Date.now()}})});O(this,"handleResize",t=>{const n=this.mainContainerRef.current;if(!n)return;const c=n.getBoundingClientRect(),l=t-c.left;l>=250&&l<=800&&this.setState({leftPanelWidth:l})});O(this,"handleLoadLocalJsonlFile",()=>{const t=document.createElement("input");t.type="file",t.accept=".jsonl",t.multiple=!0,t.onchange=n=>{const c=Array.from(n.target.files);if(c.length===0)return;if(c.reduce((d,o)=>d+o.size,0)>500*1024*1024){Q.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let m=0;const f=[],i=[];c.forEach(d=>{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);f.push(...v),i.push(d.name)}catch{}m++,m===c.length&&this._finishLocalLoad(f,i)},o.readAsText(d)})},t.click()});O(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((f,i)=>f+i.size,0)>500*1024*1024){Q.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let c=0;const l=[],m=[];t.forEach(f=>{const i=new FileReader;i.onload=d=>{try{const r=d.target.result.split(`
38
- ---
39
- `).filter(u=>u.trim()).map(u=>{try{return JSON.parse(u)}catch{return null}}).filter(Boolean);l.push(...r),m.push(f.name)}catch{}c++,c===t.length&&this._finishLocalLoad(l,m)},i.readAsText(f)})});O(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));O(this,"_onDragOver",t=>{t.preventDefault(),!this._isInternalDrag(t)&&(this.state.isDragging||this.setState({isDragging:!0}))});O(this,"_onDragLeave",t=>{const n=this._layoutRef.current;n&&!n.contains(t.relatedTarget)&&this.setState({isDragging:!1})});O(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const n=Array.from(t.dataTransfer.files);n.length&&Promise.all(n.map(c=>mn(c).then(l=>({name:c.name,path:l})).catch(l=>(Q.error(`${c.name}: ${l.message}`),null)))).then(c=>{const l=c.filter(Boolean).map(m=>`"${m.path}"`);l.length>0&&this.setState(m=>({pendingUploadPaths:[...m.pendingUploadPaths||[],...l]}))})});O(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"request",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:n,fileLoading:c,fileLoadingCount:l,mainAgentSessions:m,viewMode:f}=this.renderPrepare(),{selectedIndex:i,leftPanelWidth:d,currentTab:o}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(pn,{theme:this.darkThemeConfig,children:[c&&e.jsx("div",{className:M.loadingOverlay,children:e.jsxs("div",{className:M.loadingText,children:["Loading...(",l,")"]})}),this.state.isDragging&&e.jsx("div",{className:M.dragOverlay,children:e.jsxs("div",{className:M.dragOverlayContent,children:[e.jsx(Pt,{style:{fontSize:48}}),e.jsx("p",{children:p("ui.dragDropHint")})]})}),e.jsxs(_e,{className:M.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(_e.Header,{className:M.header,children:e.jsx(Ke,{requestCount:t.length,requests:t,viewMode:f,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,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,terminalVisible: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})}),e.jsxs(_e.Content,{className:M.content,children:[f==="raw"&&(t.length===0?e.jsx("div",{className:M.guideContainer,children:e.jsxs("div",{className:M.guideContent,children:[e.jsx("h2",{className:M.guideTitle,children:p("ui.guide.title")}),e.jsxs("div",{className:M.guideStep,children:[e.jsx("div",{className:M.guideStepNum,children:"1"}),e.jsxs("div",{className:M.guideStepBody,children:[e.jsx("p",{className:M.guideText,children:p("ui.guide.step1")}),e.jsx("code",{className:M.guideCode,children:p("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:M.guideStep,children:[e.jsx("div",{className:M.guideStepNum,children:"2"}),e.jsxs("div",{className:M.guideStepBody,children:[e.jsx("p",{className:M.guideText,children:p("ui.guide.step2")}),e.jsx("code",{className:M.guideCode,children:p("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:M.guideStep,children:[e.jsx("div",{className:M.guideStepNum,children:"3"}),e.jsxs("div",{className:M.guideStepBody,children:[e.jsx("p",{className:M.guideText,children:p("ui.guide.step3")}),e.jsx("code",{className:M.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:M.mainContainer,children:[e.jsxs("div",{className:M.leftPanel,style:{width:d},children:[e.jsxs("div",{className:M.leftPanelHeader,children:[e.jsx("span",{children:p("ui.requestList")}),e.jsx("span",{className:M.leftPanelCount,children:p("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:M.leftPanelBody,children:e.jsx(Fa,{requests:t,selectedIndex:i,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(mi,{onResize:this.handleResize}),e.jsx("div",{className:M.rightPanel,children:e.jsx(di,{request:n,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:M.chatViewWrapper,style:{display:f==="chat"?"flex":"none"},children:e.jsx(gn,{requests:t,mainAgentSessions:m,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,terminalVisible:this._isLocalLog?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(r=>({terminalVisible:!r.terminalVisible})),pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,fileLoading:this.state.fileLoading})})]}),e.jsx("div",{className:M.footer,children:e.jsxs("div",{className:M.footerRight,children:[e.jsx("span",{className:M.footerText,children:p("ui.footer.starRequest")}),e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:M.footerLink,children:[e.jsx("svg",{className:M.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("span",{className:M.footerDivider,children:"|"}),e.jsx("a",{href:"dingtalk://dingtalkclient/action/sendmsg?dingtalk_id=sthk5es",className:M.footerLink,children:p("ui.footer.contact")})]})})]}),e.jsx(Ce,{title:p("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:M.resumeFooterRight,children:[e.jsx(W,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:M.btnMarginRight,children:p("ui.resume.continue")},"continue"),e.jsx(W,{onClick:()=>this.handleResumeChoice("new"),children:p("ui.resume.new")},"new")]}),e.jsx("div",{className:M.resumeFooterLeft,children:e.jsx(fn,{checked:this.state.resumeRememberChoice,onChange:r=>this.setState({resumeRememberChoice:r.target.checked}),className:M.resumeCheckboxOpacity,children:e.jsx("span",{className:M.resumeCheckboxOpacity,children:p("ui.resume.remember")})})})]}),children:e.jsx("p",{children:p("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(Ce,{title:e.jsxs("span",{className:M.modalTitleInline,children:[e.jsx(xn,{apiEndpoint:de("/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:M.modalActions,children:[e.jsx(W,{icon:e.jsx(Pt,{}),onClick:this.handleLoadLocalJsonlFile,children:p("ui.loadLocalJsonl")}),e.jsx(W,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:M.btnMarginLeft,children:p("ui.mergeLogs")}),e.jsx(W,{size:"small",danger:!0,icon:e.jsx(Kt,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:M.btnMarginLeft,children:p("ui.deleteLogs")}),e.jsx(W,{size:"small",icon:e.jsx(ot,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:M.btnMarginLeft,children:p("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:M.spinCenter,children:e.jsx(qt,{})}):(()=>{const r=this.state.localLogs[this.state.currentProject];return!r||r.length===0?e.jsx("div",{className:M.emptyCenter,children:p("ui.noLogs")}):e.jsx("div",{className:M.logListContainer,children:this.renderLogTable(r,!1)})})()]})]})}}export{ji as default};