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,4 +1,4 @@
1
- var Be=Object.defineProperty;var De=(t,i,n)=>i in t?Be(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n;var de=(t,i,n)=>De(t,typeof i!="symbol"?i+"":i,n);import{r as x,j as e,i as Ae}from"./index-DPLzENgP.js";import{g as ye,m as Fe,a as Se,r as we,K as q,u as E,C as he,i as _e,c as M,b as $e,d as He,I as We,_ as Ue,e as me,t as b,F as Ge,f as Ze,h as qe,j as Xe,k as Ke,l as Ye,s as l,n as se,o as G,A as Je,p as Qe,q as et,v as tt,w as c,B,R as st,x as it,T as ot,y as pe,z as nt,O as lt,D as at,E as rt,S as ct,G as je,H as dt}from"./AppHeader.module-mubLi1xV.js";const mt=new q("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),ht=new q("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),ut=new q("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),bt=new q("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),ft=new q("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),gt=new q("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),xt=t=>{const{componentCls:i,iconCls:n,antCls:s,badgeShadowSize:o,textFontSize:d,textFontSizeSM:a,statusSize:r,dotSize:h,textFontWeight:p,indicatorHeight:g,indicatorHeightSM:m,marginXS:v,calc:w}=t,N=`${s}-scroll-number`,S=Se(t,(j,{darkColor:u})=>({[`&${i} ${i}-color-${j}`]:{background:u,[`&:not(${i}-count)`]:{color:u},"a:hover &":{background:u}}}));return{[i]:Object.assign(Object.assign(Object.assign(Object.assign({},we(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${i}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:t.indicatorZIndex,minWidth:g,height:g,color:t.badgeTextColor,fontWeight:p,fontSize:d,lineHeight:E(g),whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:w(g).div(2).equal(),boxShadow:`0 0 0 ${E(o)} ${t.badgeShadowColor}`,transition:`background ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${i}-count-sm`]:{minWidth:m,height:m,fontSize:a,lineHeight:E(m),borderRadius:w(m).div(2).equal()},[`${i}-multiple-words`]:{padding:`0 ${E(t.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${i}-dot`]:{zIndex:t.indicatorZIndex,width:h,minWidth:h,height:h,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${E(o)} ${t.badgeShadowColor}`},[`${i}-count, ${i}-dot, ${N}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${n}-spin`]:{animationName:gt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${i}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${i}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:r,height:r,verticalAlign:"middle",borderRadius:"50%"},[`${i}-status-success`]:{backgroundColor:t.colorSuccess},[`${i}-status-processing`]:{overflow:"visible",color:t.colorInfo,backgroundColor:t.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:mt,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${i}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${i}-status-error`]:{backgroundColor:t.colorError},[`${i}-status-warning`]:{backgroundColor:t.colorWarning},[`${i}-status-text`]:{marginInlineStart:v,color:t.colorText,fontSize:t.fontSize}}}),S),{[`${i}-zoom-appear, ${i}-zoom-enter`]:{animationName:ht,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${i}-zoom-leave`]:{animationName:ut,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${i}-not-a-wrapper`]:{[`${i}-zoom-appear, ${i}-zoom-enter`]:{animationName:bt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${i}-zoom-leave`]:{animationName:ft,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${i}-status)`]:{verticalAlign:"middle"},[`${N}-custom-component, ${i}-count`]:{transform:"none"},[`${N}-custom-component, ${N}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[N]:{overflow:"hidden",transition:`all ${t.motionDurationMid} ${t.motionEaseOutBack}`,[`${N}-only`]:{position:"relative",display:"inline-block",height:g,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${N}-only-unit`]:{height:g,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${N}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${i}-count, ${i}-dot, ${N}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},Te=t=>{const{fontHeight:i,lineWidth:n,marginXS:s,colorBorderBg:o}=t,d=i,a=n,r=t.colorTextLightSolid,h=t.colorError,p=t.colorErrorHover;return Fe(t,{badgeFontHeight:d,badgeShadowSize:a,badgeTextColor:r,badgeColor:h,badgeColorHover:p,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:s,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},Le=t=>{const{fontSize:i,lineHeight:n,fontSizeSM:s,lineWidth:o}=t;return{indicatorZIndex:"auto",indicatorHeight:Math.round(i*n)-2*o,indicatorHeightSM:i,dotSize:s/2,textFontSize:s,textFontSizeSM:s,textFontWeight:"normal",statusSize:s/2}},pt=ye("Badge",t=>{const i=Te(t);return xt(i)},Le),jt=t=>{const{antCls:i,badgeFontHeight:n,marginXS:s,badgeRibbonOffset:o,calc:d}=t,a=`${i}-ribbon`,r=`${i}-ribbon-wrapper`,h=Se(t,(p,{darkColor:g})=>({[`&${a}-color-${p}`]:{background:g,color:g}}));return{[r]:{position:"relative"},[a]:Object.assign(Object.assign(Object.assign(Object.assign({},we(t)),{position:"absolute",top:s,padding:`0 ${E(t.paddingXS)}`,color:t.colorPrimary,lineHeight:E(n),whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${a}-text`]:{color:t.badgeTextColor},[`${a}-corner`]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:`${E(d(o).div(2).equal())} solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),h),{[`&${a}-placement-end`]:{insetInlineEnd:d(o).mul(-1).equal(),borderEndEndRadius:0,[`${a}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${a}-placement-start`]:{insetInlineStart:d(o).mul(-1).equal(),borderEndStartRadius:0,[`${a}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},vt=ye(["Badge","Ribbon"],t=>{const i=Te(t);return jt(i)},Le),Nt=t=>{const{className:i,prefixCls:n,style:s,color:o,children:d,text:a,placement:r="end",rootClassName:h}=t,{getPrefixCls:p,direction:g}=x.useContext(he),m=p("ribbon",n),v=`${m}-wrapper`,[w,N,S]=vt(m,v),j=_e(o,!1),u=M(m,`${m}-placement-${r}`,{[`${m}-rtl`]:g==="rtl",[`${m}-color-${o}`]:j},i),f={},L={};return o&&!j&&(f.background=o,L.color=o),w(x.createElement("div",{className:M(v,h,N,S)},d,x.createElement("div",{className:M(u,N),style:Object.assign(Object.assign({},f),s)},x.createElement("span",{className:`${m}-text`},a),x.createElement("div",{className:`${m}-corner`,style:L}))))},ve=t=>{const{prefixCls:i,value:n,current:s,offset:o=0}=t;let d;return o&&(d={position:"absolute",top:`${o}00%`,left:0}),x.createElement("span",{style:d,className:M(`${i}-only-unit`,{current:s})},n)};function Ct(t,i,n){let s=t,o=0;for(;(s+10)%10!==i;)s+=n,o+=n;return o}const yt=t=>{const{prefixCls:i,count:n,value:s}=t,o=Number(s),d=Math.abs(n),[a,r]=x.useState(o),[h,p]=x.useState(d),g=()=>{r(o),p(d)};x.useEffect(()=>{const w=setTimeout(g,1e3);return()=>clearTimeout(w)},[o]);let m,v;if(a===o||Number.isNaN(o)||Number.isNaN(a))m=[x.createElement(ve,Object.assign({},t,{key:o,current:!0}))],v={transition:"none"};else{m=[];const w=o+10,N=[];for(let f=o;f<=w;f+=1)N.push(f);const S=h<d?1:-1,j=N.findIndex(f=>f%10===a);m=(S<0?N.slice(0,j+1):N.slice(j)).map((f,L)=>{const P=f%10;return x.createElement(ve,Object.assign({},t,{key:f,value:P,offset:S<0?L-j:L,current:L===j}))}),v={transform:`translateY(${-Ct(a,o,S)}00%)`}}return x.createElement("span",{className:`${i}-only`,style:v,onTransitionEnd:g},m)};var St=function(t,i){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)i.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]]);return n};const wt=x.forwardRef((t,i)=>{const{prefixCls:n,count:s,className:o,motionClassName:d,style:a,title:r,show:h,component:p="sup",children:g}=t,m=St(t,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:v}=x.useContext(he),w=v("scroll-number",n),N=Object.assign(Object.assign({},m),{"data-show":h,style:a,className:M(w,o,d),title:r});let S=s;if(s&&Number(s)%1===0){const j=String(s).split("");S=x.createElement("bdi",null,j.map((u,f)=>x.createElement(yt,{prefixCls:w,count:Number(s),value:u,key:j.length-f})))}return a!=null&&a.borderColor&&(N.style=Object.assign(Object.assign({},a),{boxShadow:`0 0 0 1px ${a.borderColor} inset`})),g?$e(g,j=>({className:M(`${w}-custom-component`,j==null?void 0:j.className,d)})):x.createElement(p,Object.assign({},N,{ref:i}),S)});var _t=function(t,i){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)i.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]]);return n};const $t=x.forwardRef((t,i)=>{var n,s,o,d,a;const{prefixCls:r,scrollNumberPrefixCls:h,children:p,status:g,text:m,color:v,count:w=null,overflowCount:N=99,dot:S=!1,size:j="default",title:u,offset:f,style:L,className:P,rootClassName:D,classNames:V,styles:O,showZero:A=!1}=t,X=_t(t,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:F,direction:z,badge:C}=x.useContext(he),_=F("badge",r),[K,J,ie]=pt(_),$=w>N?`${N}+`:w,T=$==="0"||$===0||m==="0"||m===0,I=w===null||T&&!A,oe=(g!=null||v!=null)&&I,Oe=g!=null||!T,Y=S&&!T,H=Y?"":$,W=x.useMemo(()=>((H==null||H==="")&&(m==null||m==="")||T&&!A)&&!Y,[H,T,A,Y,m]),ue=x.useRef(w);W||(ue.current=w);const U=ue.current,be=x.useRef(H);W||(be.current=H);const ne=be.current,fe=x.useRef(Y);W||(fe.current=Y);const Q=x.useMemo(()=>{if(!f)return Object.assign(Object.assign({},C==null?void 0:C.style),L);const R={marginTop:f[1]};return z==="rtl"?R.left=Number.parseInt(f[0],10):R.right=-Number.parseInt(f[0],10),Object.assign(Object.assign(Object.assign({},R),C==null?void 0:C.style),L)},[z,f,L,C==null?void 0:C.style]),Re=u??(typeof U=="string"||typeof U=="number"?U:void 0),ge=!W&&(m===0?A:!!m&&m!==!0),Me=ge?x.createElement("span",{className:`${_}-status-text`},m):null,Pe=!U||typeof U!="object"?void 0:$e(U,R=>({style:Object.assign(Object.assign({},Q),R.style)})),ee=_e(v,!1),Ie=M(V==null?void 0:V.indicator,(n=C==null?void 0:C.classNames)===null||n===void 0?void 0:n.indicator,{[`${_}-status-dot`]:oe,[`${_}-status-${g}`]:!!g,[`${_}-color-${v}`]:ee}),le={};v&&!ee&&(le.color=v,le.background=v);const xe=M(_,{[`${_}-status`]:oe,[`${_}-not-a-wrapper`]:!p,[`${_}-rtl`]:z==="rtl"},P,D,C==null?void 0:C.className,(s=C==null?void 0:C.classNames)===null||s===void 0?void 0:s.root,V==null?void 0:V.root,J,ie);if(!p&&oe&&(m||Oe||!I)){const R=Q.color;return K(x.createElement("span",Object.assign({},X,{className:xe,style:Object.assign(Object.assign(Object.assign({},O==null?void 0:O.root),(o=C==null?void 0:C.styles)===null||o===void 0?void 0:o.root),Q)}),x.createElement("span",{className:Ie,style:Object.assign(Object.assign(Object.assign({},O==null?void 0:O.indicator),(d=C==null?void 0:C.styles)===null||d===void 0?void 0:d.indicator),le)}),ge&&x.createElement("span",{style:{color:R},className:`${_}-status-text`},m)))}return K(x.createElement("span",Object.assign({ref:i},X,{className:xe,style:Object.assign(Object.assign({},(a=C==null?void 0:C.styles)===null||a===void 0?void 0:a.root),O==null?void 0:O.root)}),p,x.createElement(He,{visible:!W,motionName:`${_}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:R})=>{var ae,re;const Ee=F("scroll-number",h),ce=fe.current,ze=M(V==null?void 0:V.indicator,(ae=C==null?void 0:C.classNames)===null||ae===void 0?void 0:ae.indicator,{[`${_}-dot`]:ce,[`${_}-count`]:!ce,[`${_}-count-sm`]:j==="small",[`${_}-multiple-words`]:!ce&&ne&&ne.toString().length>1,[`${_}-status-${g}`]:!!g,[`${_}-color-${v}`]:ee});let te=Object.assign(Object.assign(Object.assign({},O==null?void 0:O.indicator),(re=C==null?void 0:C.styles)===null||re===void 0?void 0:re.indicator),Q);return v&&!ee&&(te=te||{},te.background=v),x.createElement(wt,{prefixCls:Ee,show:!W,motionClassName:R,className:ze,count:ne,title:Re,style:te,key:"scrollNumber"},Pe)}),Me))}),ke=$t;ke.Ribbon=Nt;var Tt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z"}}]},name:"rollback",theme:"outlined"},Lt=function(i,n){return x.createElement(We,Ue({},i,{ref:n,icon:Tt}))},kt=x.forwardRef(Lt);const Vt="_container_kjcu0_1",Ot="_fileListSection_kjcu0_10",Rt="_header_kjcu0_19",Mt="_headerTitle_kjcu0_28",Pt="_fileCount_kjcu0_36",It="_changesContainer_kjcu0_44",Et="_changeItem_kjcu0_51",zt="_changeItemActive_kjcu0_68",Bt="_dirItem_kjcu0_77",Dt="_dirArrow_kjcu0_88",At="_dirName_kjcu0_97",Ft="_status_kjcu0_102",Ht="_icon_kjcu0_111",Wt="_fileName_kjcu0_120",Ut="_diffSection_kjcu0_127",Gt="_diffHeader_kjcu0_135",Zt="_diffFilePath_kjcu0_145",qt="_diffBadge_kjcu0_155",Xt="_diffContent_kjcu0_167",Kt="_diffPlaceholder_kjcu0_173",Yt="_statusText_kjcu0_184",Jt="_errorText_kjcu0_191",Qt="_emptyText_kjcu0_198",es="_warningText_kjcu0_205",ts="_fileSizeNote_kjcu0_217",ss="_statusTextItalic_kjcu0_222",is="_rotated90_kjcu0_226",y={container:Vt,fileListSection:Ot,header:Rt,headerTitle:Mt,fileCount:Pt,changesContainer:It,changeItem:Et,changeItemActive:zt,dirItem:Bt,dirArrow:Dt,dirName:At,status:Ft,icon:Ht,fileName:Wt,diffSection:Ut,diffHeader:Gt,diffFilePath:Zt,diffBadge:qt,diffContent:Xt,diffPlaceholder:Kt,statusText:Yt,errorText:Jt,emptyText:Qt,warningText:es,fileSizeNote:ts,statusTextItalic:ss,rotated90:is},os={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991","??":"#73c991"},ns={"??":"U"},ls={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function as(t){const i=t.includes(".")?t.split(".").pop().toLowerCase():"",n=ls[i]||"#888";return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.5",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function rs(){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:e.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})})}function cs(t){const i={dirs:{},files:[]};for(const n of t){const s=n.file.split("/");let o=i;for(let d=0;d<s.length-1;d++)o.dirs[s[d]]||(o.dirs[s[d]]={dirs:{},files:[]}),o=o.dirs[s[d]];o.files.push({name:s[s.length-1],status:n.status,fullPath:n.file})}return i}function Ve({name:t,node:i,depth:n,selectedFile:s,onFileClick:o}){const d=Object.keys(i.dirs).sort(),a=[...i.files].sort((r,h)=>r.name.localeCompare(h.name));return e.jsxs(e.Fragment,{children:[t&&e.jsxs("div",{className:y.dirItem,style:{paddingLeft:8+n*16},children:[e.jsx("span",{className:y.dirArrow,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:y.rotated90,children:e.jsx("polyline",{points:"9 6 15 12 9 18"})})}),e.jsx("span",{className:y.icon,children:rs()}),e.jsx("span",{className:y.dirName,children:t})]}),d.map(r=>e.jsx(Ve,{name:r,node:i.dirs[r],depth:t?n+1:n,selectedFile:s,onFileClick:o},r)),a.map(r=>e.jsxs("div",{className:`${y.changeItem} ${s===r.fullPath?y.changeItemActive:""}`,style:{paddingLeft:8+(t?n+1:n)*16},onClick:()=>o&&o(r.fullPath),children:[e.jsx("span",{className:y.icon,children:as(r.name)}),e.jsx("span",{className:y.fileName,children:r.name}),e.jsx("span",{className:y.status,style:{color:os[r.status]||"#888"},children:ns[r.status]||r.status})]},r.fullPath))]})}function ds({visible:t}){const[i,n]=x.useState(null),[s,o]=x.useState(null),[d,a]=x.useState(!0),[r,h]=x.useState(null),[p,g]=x.useState(null),[m,v]=x.useState(null),[w,N]=x.useState(!1),S=x.useRef(!0);return x.useEffect(()=>{if(S.current=!0,!!t)return a(!0),o(null),fetch(me("/api/git-status")).then(j=>j.ok?j.json():Promise.reject()).then(j=>{S.current&&(n(j.changes||[]),a(!1))}).catch(()=>{S.current&&(o("Failed to load git status"),a(!1))}),()=>{S.current=!1}},[t]),x.useEffect(()=>{if(!r){g(null),v(null);return}N(!0),g(null),v(null),fetch(me(`/api/git-diff?files=${encodeURIComponent(r)}`)).then(j=>{if(!j.ok)throw new Error(`HTTP ${j.status}`);return j.json()}).then(j=>{S.current&&(j.diffs&&j.diffs[0]?g(j.diffs[0]):v("No diff data available"),N(!1))}).catch(j=>{S.current&&(v(`${b("ui.fileLoadError")}: ${j.message}`),N(!1))})},[r]),e.jsxs("div",{className:y.container,children:[e.jsxs("div",{className:y.fileListSection,children:[e.jsxs("div",{className:y.header,children:[e.jsx("span",{className:y.headerTitle,children:b("ui.gitChanges")}),e.jsx("span",{className:y.fileCount,children:i?i.length:0})]}),e.jsxs("div",{className:y.changesContainer,children:[d&&e.jsx("div",{className:y.statusText,children:"Loading..."}),s&&e.jsx("div",{className:y.errorText,children:s}),!d&&!s&&i&&i.length===0&&e.jsx("div",{className:y.emptyText,children:"No changes"}),!d&&!s&&i&&i.length>0&&e.jsx(Ve,{name:"",node:cs(i),depth:0,selectedFile:r,onFileClick:h})]})]}),e.jsx("div",{className:y.diffSection,children:r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:y.diffHeader,children:[e.jsx("span",{className:y.diffFilePath,children:r}),e.jsx("span",{className:y.diffBadge,children:"DIFF"})]}),e.jsxs("div",{className:y.diffContent,children:[w&&e.jsx("div",{className:y.statusText,children:b("ui.loading")}),m&&e.jsx("div",{className:y.errorText,children:m}),!w&&!m&&p&&e.jsx(e.Fragment,{children:p.is_large?e.jsxs("div",{className:y.warningText,children:[e.jsx("p",{children:b("ui.largeFileWarning")}),e.jsxs("p",{className:y.fileSizeNote,children:[b("ui.fileSize"),": ",(p.size/(1024*1024)).toFixed(2)," MB"]})]}):p.is_binary?e.jsx("div",{className:`${y.statusText} ${y.statusTextItalic}`,children:b("ui.binaryFileNotice")}):e.jsx(Ge,{file_path:r,old_string:p.old_content,new_string:p.new_content})})]})]}):e.jsxs("div",{className:y.diffPlaceholder,children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#333",strokeWidth:"1.5",children:[e.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),e.jsx("circle",{cx:"18",cy:"6",r:"3"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),e.jsx("span",{children:b("ui.mobileGitDiffHint")})]})})]})}const ms="_container_vnezo_1",hs="_header_vnezo_9",us="_headerTitle_vnezo_18",bs="_closeBtn_vnezo_24",fs="_content_vnezo_38",gs="_empty_vnezo_47",xs="_fixedTable_vnezo_54",ps="_ellipsisCell_vnezo_58",js="_thLeft_vnezo_65",vs="_colWide_vnezo_69",Ns="_colNarrow_vnezo_73",k={container:ms,header:hs,headerTitle:us,closeBtn:bs,content:fs,empty:gs,fixedTable:xs,ellipsisCell:ps,thLeft:js,colWide:vs,colNarrow:Ns},Cs=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],Ne={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"};function ys({requests:t=[],visible:i,onClose:n}){const{byModel:s,models:o,toolStats:d,skillStats:a,cacheStats:r,activeReasons:h,totalCount:p,totalCache:g,hasCacheStats:m,subAgentEntries:v,hasSubAgentStats:w,teammateEntries:N,hasTeammateStats:S,isEmpty:j}=x.useMemo(()=>{const u=Ze(t),f=Object.keys(u),L=qe(t),P=Xe(t),D=Ke(t),V=Cs.filter($=>D[$].count>0),O=V.reduce(($,T)=>$+D[T].count,0),A=V.reduce(($,T)=>$+D[T].cacheCreate,0),X=V.length>0,F={},z={};for(let $=0;$<t.length;$++){const T=Ye(t[$],t[$+1]);if(T.type==="SubAgent"){const I=T.subType||"Other";F[I]=(F[I]||0)+1}else if(T.type==="Teammate"){const I=T.subType||"Teammate";z[I]=(z[I]||0)+1}}const C=Object.entries(F).sort(($,T)=>T[1]-$[1]),_=C.length>0,K=Object.entries(z).sort(($,T)=>T[1]-$[1]),J=K.length>0,ie=f.length===0&&L.length===0&&!X&&!_&&!J&&P.length===0;return{byModel:u,models:f,toolStats:L,skillStats:P,cacheStats:D,activeReasons:V,totalCount:O,totalCache:A,hasCacheStats:X,subAgentEntries:C,hasSubAgentStats:_,teammateEntries:K,hasTeammateStats:J,isEmpty:ie}},[t]);return i?e.jsxs("div",{className:k.container,children:[e.jsxs("div",{className:k.header,children:[e.jsx("span",{className:k.headerTitle,children:b("ui.tokenStats")}),e.jsx("button",{className:k.closeBtn,onClick:n,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:k.content,children:j?e.jsx("div",{className:k.empty,children:"—"}):e.jsxs(e.Fragment,{children:[a.length>0&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:b("ui.skillUsageStats")}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"Skill"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[a.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label,children:u}),e.jsx("td",{className:l.td,children:f})]},u)),a.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:a.reduce((u,f)=>u+f[1],0)})]})]})]})]}),w&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:b("ui.subAgentStats")}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[v.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsxs("td",{className:l.label,children:[u," ",e.jsx(se,{doc:`SubAgent-${u}`})]}),e.jsx("td",{className:l.td,children:f})]},u)),v.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:v.reduce((u,f)=>u+f[1],0)})]})]})]})]}),S&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:"Teammate"}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"Name"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[N.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label,children:u}),e.jsx("td",{className:l.td,children:f})]},u)),N.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:N.reduce((u,f)=>u+f[1],0)})]})]})]})]}),d.length>0&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:b("ui.toolUsageStats")}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"Tool"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[d.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsxs("td",{className:l.label,children:[u," ",e.jsx(se,{doc:`Tool-${u}`})]}),e.jsx("td",{className:l.td,children:f})]},u)),d.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:d.reduce((u,f)=>u+f[1],0)})]})]})]})]}),m&&e.jsxs("div",{className:l.modelCard,children:[e.jsxs("div",{className:l.modelName,children:["MainAgent",e.jsx(se,{doc:"MainAgent"})," ",b("ui.cacheRebuildStats"),e.jsx(se,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:`${l.statsTable} ${k.fixedTable}`,children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:k.colWide}),e.jsx("col",{className:k.colNarrow}),e.jsx("col",{className:k.colNarrow})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:b("ui.cacheRebuild.reason")}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[h.map(u=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:`${l.label} ${k.ellipsisCell}`,title:b(`ui.${Ne[u]}`),children:b(`ui.${Ne[u]}`)}),e.jsx("td",{className:l.td,children:r[u].count}),e.jsx("td",{className:l.td,children:G(r[u].cacheCreate)})]},u)),h.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:p}),e.jsx("td",{className:l.td,children:G(g)})]})]})]})]}),o.map(u=>{const f=s[u],L=f.input+f.cacheCreation+f.cacheRead,P=L>0?(f.cacheRead/L*100).toFixed(1):"0.0";return e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:u}),e.jsx("table",{className:l.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:l.label,children:"Token"}),e.jsx("td",{className:l.th,children:"input"}),e.jsx("td",{className:l.th,children:"output"})]}),e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label}),e.jsx("td",{className:l.td,children:G(L)}),e.jsx("td",{className:l.td,children:G(f.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:l.label,children:"Cache"}),e.jsx("td",{className:l.th,children:"create"}),e.jsx("td",{className:l.th,children:"read"})]}),e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label}),e.jsx("td",{className:l.td,children:G(f.cacheCreation)}),e.jsx("td",{className:l.td,children:G(f.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:l.label,children:b("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:l.td,children:[P,"%"]})]})]})})]},u)})]})})]}):null}const Z=class Z extends Je{constructor(n){super(n);de(this,"handleExportPromptsTxt",n=>{if(!n||n.length===0)return;const s=[];for(const r of n){const h=[],p=r.timestamp?new Date(r.timestamp).toLocaleString():"";p&&h.push(`${p}:
1
+ var Be=Object.defineProperty;var De=(t,i,n)=>i in t?Be(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n;var de=(t,i,n)=>De(t,typeof i!="symbol"?i+"":i,n);import{r as x,j as e,i as Ae}from"./index-C8H1VbBG.js";import{g as ye,m as Fe,a as Se,r as we,K as q,u as E,C as he,i as _e,c as M,b as $e,d as He,I as We,_ as Ue,e as me,t as b,F as Ge,f as Ze,h as qe,j as Xe,k as Ke,l as Ye,s as l,n as se,o as G,A as Je,p as Qe,q as et,v as tt,w as c,B,R as st,x as it,T as ot,y as pe,z as nt,O as lt,D as at,E as rt,S as ct,G as je,H as dt}from"./AppHeader.module-Dy9BXOVo.js";const mt=new q("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),ht=new q("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),ut=new q("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),bt=new q("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),ft=new q("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),gt=new q("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),xt=t=>{const{componentCls:i,iconCls:n,antCls:s,badgeShadowSize:o,textFontSize:d,textFontSizeSM:a,statusSize:r,dotSize:h,textFontWeight:p,indicatorHeight:g,indicatorHeightSM:m,marginXS:v,calc:w}=t,N=`${s}-scroll-number`,S=Se(t,(j,{darkColor:u})=>({[`&${i} ${i}-color-${j}`]:{background:u,[`&:not(${i}-count)`]:{color:u},"a:hover &":{background:u}}}));return{[i]:Object.assign(Object.assign(Object.assign(Object.assign({},we(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${i}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:t.indicatorZIndex,minWidth:g,height:g,color:t.badgeTextColor,fontWeight:p,fontSize:d,lineHeight:E(g),whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:w(g).div(2).equal(),boxShadow:`0 0 0 ${E(o)} ${t.badgeShadowColor}`,transition:`background ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${i}-count-sm`]:{minWidth:m,height:m,fontSize:a,lineHeight:E(m),borderRadius:w(m).div(2).equal()},[`${i}-multiple-words`]:{padding:`0 ${E(t.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${i}-dot`]:{zIndex:t.indicatorZIndex,width:h,minWidth:h,height:h,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${E(o)} ${t.badgeShadowColor}`},[`${i}-count, ${i}-dot, ${N}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${n}-spin`]:{animationName:gt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${i}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${i}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:r,height:r,verticalAlign:"middle",borderRadius:"50%"},[`${i}-status-success`]:{backgroundColor:t.colorSuccess},[`${i}-status-processing`]:{overflow:"visible",color:t.colorInfo,backgroundColor:t.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:mt,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${i}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${i}-status-error`]:{backgroundColor:t.colorError},[`${i}-status-warning`]:{backgroundColor:t.colorWarning},[`${i}-status-text`]:{marginInlineStart:v,color:t.colorText,fontSize:t.fontSize}}}),S),{[`${i}-zoom-appear, ${i}-zoom-enter`]:{animationName:ht,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${i}-zoom-leave`]:{animationName:ut,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${i}-not-a-wrapper`]:{[`${i}-zoom-appear, ${i}-zoom-enter`]:{animationName:bt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${i}-zoom-leave`]:{animationName:ft,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${i}-status)`]:{verticalAlign:"middle"},[`${N}-custom-component, ${i}-count`]:{transform:"none"},[`${N}-custom-component, ${N}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[N]:{overflow:"hidden",transition:`all ${t.motionDurationMid} ${t.motionEaseOutBack}`,[`${N}-only`]:{position:"relative",display:"inline-block",height:g,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${N}-only-unit`]:{height:g,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${N}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${i}-count, ${i}-dot, ${N}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},Te=t=>{const{fontHeight:i,lineWidth:n,marginXS:s,colorBorderBg:o}=t,d=i,a=n,r=t.colorTextLightSolid,h=t.colorError,p=t.colorErrorHover;return Fe(t,{badgeFontHeight:d,badgeShadowSize:a,badgeTextColor:r,badgeColor:h,badgeColorHover:p,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:s,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},Le=t=>{const{fontSize:i,lineHeight:n,fontSizeSM:s,lineWidth:o}=t;return{indicatorZIndex:"auto",indicatorHeight:Math.round(i*n)-2*o,indicatorHeightSM:i,dotSize:s/2,textFontSize:s,textFontSizeSM:s,textFontWeight:"normal",statusSize:s/2}},pt=ye("Badge",t=>{const i=Te(t);return xt(i)},Le),jt=t=>{const{antCls:i,badgeFontHeight:n,marginXS:s,badgeRibbonOffset:o,calc:d}=t,a=`${i}-ribbon`,r=`${i}-ribbon-wrapper`,h=Se(t,(p,{darkColor:g})=>({[`&${a}-color-${p}`]:{background:g,color:g}}));return{[r]:{position:"relative"},[a]:Object.assign(Object.assign(Object.assign(Object.assign({},we(t)),{position:"absolute",top:s,padding:`0 ${E(t.paddingXS)}`,color:t.colorPrimary,lineHeight:E(n),whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${a}-text`]:{color:t.badgeTextColor},[`${a}-corner`]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:`${E(d(o).div(2).equal())} solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),h),{[`&${a}-placement-end`]:{insetInlineEnd:d(o).mul(-1).equal(),borderEndEndRadius:0,[`${a}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${a}-placement-start`]:{insetInlineStart:d(o).mul(-1).equal(),borderEndStartRadius:0,[`${a}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},vt=ye(["Badge","Ribbon"],t=>{const i=Te(t);return jt(i)},Le),Nt=t=>{const{className:i,prefixCls:n,style:s,color:o,children:d,text:a,placement:r="end",rootClassName:h}=t,{getPrefixCls:p,direction:g}=x.useContext(he),m=p("ribbon",n),v=`${m}-wrapper`,[w,N,S]=vt(m,v),j=_e(o,!1),u=M(m,`${m}-placement-${r}`,{[`${m}-rtl`]:g==="rtl",[`${m}-color-${o}`]:j},i),f={},L={};return o&&!j&&(f.background=o,L.color=o),w(x.createElement("div",{className:M(v,h,N,S)},d,x.createElement("div",{className:M(u,N),style:Object.assign(Object.assign({},f),s)},x.createElement("span",{className:`${m}-text`},a),x.createElement("div",{className:`${m}-corner`,style:L}))))},ve=t=>{const{prefixCls:i,value:n,current:s,offset:o=0}=t;let d;return o&&(d={position:"absolute",top:`${o}00%`,left:0}),x.createElement("span",{style:d,className:M(`${i}-only-unit`,{current:s})},n)};function Ct(t,i,n){let s=t,o=0;for(;(s+10)%10!==i;)s+=n,o+=n;return o}const yt=t=>{const{prefixCls:i,count:n,value:s}=t,o=Number(s),d=Math.abs(n),[a,r]=x.useState(o),[h,p]=x.useState(d),g=()=>{r(o),p(d)};x.useEffect(()=>{const w=setTimeout(g,1e3);return()=>clearTimeout(w)},[o]);let m,v;if(a===o||Number.isNaN(o)||Number.isNaN(a))m=[x.createElement(ve,Object.assign({},t,{key:o,current:!0}))],v={transition:"none"};else{m=[];const w=o+10,N=[];for(let f=o;f<=w;f+=1)N.push(f);const S=h<d?1:-1,j=N.findIndex(f=>f%10===a);m=(S<0?N.slice(0,j+1):N.slice(j)).map((f,L)=>{const P=f%10;return x.createElement(ve,Object.assign({},t,{key:f,value:P,offset:S<0?L-j:L,current:L===j}))}),v={transform:`translateY(${-Ct(a,o,S)}00%)`}}return x.createElement("span",{className:`${i}-only`,style:v,onTransitionEnd:g},m)};var St=function(t,i){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)i.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]]);return n};const wt=x.forwardRef((t,i)=>{const{prefixCls:n,count:s,className:o,motionClassName:d,style:a,title:r,show:h,component:p="sup",children:g}=t,m=St(t,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:v}=x.useContext(he),w=v("scroll-number",n),N=Object.assign(Object.assign({},m),{"data-show":h,style:a,className:M(w,o,d),title:r});let S=s;if(s&&Number(s)%1===0){const j=String(s).split("");S=x.createElement("bdi",null,j.map((u,f)=>x.createElement(yt,{prefixCls:w,count:Number(s),value:u,key:j.length-f})))}return a!=null&&a.borderColor&&(N.style=Object.assign(Object.assign({},a),{boxShadow:`0 0 0 1px ${a.borderColor} inset`})),g?$e(g,j=>({className:M(`${w}-custom-component`,j==null?void 0:j.className,d)})):x.createElement(p,Object.assign({},N,{ref:i}),S)});var _t=function(t,i){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)i.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]]);return n};const $t=x.forwardRef((t,i)=>{var n,s,o,d,a;const{prefixCls:r,scrollNumberPrefixCls:h,children:p,status:g,text:m,color:v,count:w=null,overflowCount:N=99,dot:S=!1,size:j="default",title:u,offset:f,style:L,className:P,rootClassName:D,classNames:V,styles:O,showZero:A=!1}=t,X=_t(t,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:F,direction:z,badge:C}=x.useContext(he),_=F("badge",r),[K,J,ie]=pt(_),$=w>N?`${N}+`:w,T=$==="0"||$===0||m==="0"||m===0,I=w===null||T&&!A,oe=(g!=null||v!=null)&&I,Oe=g!=null||!T,Y=S&&!T,H=Y?"":$,W=x.useMemo(()=>((H==null||H==="")&&(m==null||m==="")||T&&!A)&&!Y,[H,T,A,Y,m]),ue=x.useRef(w);W||(ue.current=w);const U=ue.current,be=x.useRef(H);W||(be.current=H);const ne=be.current,fe=x.useRef(Y);W||(fe.current=Y);const Q=x.useMemo(()=>{if(!f)return Object.assign(Object.assign({},C==null?void 0:C.style),L);const R={marginTop:f[1]};return z==="rtl"?R.left=Number.parseInt(f[0],10):R.right=-Number.parseInt(f[0],10),Object.assign(Object.assign(Object.assign({},R),C==null?void 0:C.style),L)},[z,f,L,C==null?void 0:C.style]),Re=u??(typeof U=="string"||typeof U=="number"?U:void 0),ge=!W&&(m===0?A:!!m&&m!==!0),Me=ge?x.createElement("span",{className:`${_}-status-text`},m):null,Pe=!U||typeof U!="object"?void 0:$e(U,R=>({style:Object.assign(Object.assign({},Q),R.style)})),ee=_e(v,!1),Ie=M(V==null?void 0:V.indicator,(n=C==null?void 0:C.classNames)===null||n===void 0?void 0:n.indicator,{[`${_}-status-dot`]:oe,[`${_}-status-${g}`]:!!g,[`${_}-color-${v}`]:ee}),le={};v&&!ee&&(le.color=v,le.background=v);const xe=M(_,{[`${_}-status`]:oe,[`${_}-not-a-wrapper`]:!p,[`${_}-rtl`]:z==="rtl"},P,D,C==null?void 0:C.className,(s=C==null?void 0:C.classNames)===null||s===void 0?void 0:s.root,V==null?void 0:V.root,J,ie);if(!p&&oe&&(m||Oe||!I)){const R=Q.color;return K(x.createElement("span",Object.assign({},X,{className:xe,style:Object.assign(Object.assign(Object.assign({},O==null?void 0:O.root),(o=C==null?void 0:C.styles)===null||o===void 0?void 0:o.root),Q)}),x.createElement("span",{className:Ie,style:Object.assign(Object.assign(Object.assign({},O==null?void 0:O.indicator),(d=C==null?void 0:C.styles)===null||d===void 0?void 0:d.indicator),le)}),ge&&x.createElement("span",{style:{color:R},className:`${_}-status-text`},m)))}return K(x.createElement("span",Object.assign({ref:i},X,{className:xe,style:Object.assign(Object.assign({},(a=C==null?void 0:C.styles)===null||a===void 0?void 0:a.root),O==null?void 0:O.root)}),p,x.createElement(He,{visible:!W,motionName:`${_}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:R})=>{var ae,re;const Ee=F("scroll-number",h),ce=fe.current,ze=M(V==null?void 0:V.indicator,(ae=C==null?void 0:C.classNames)===null||ae===void 0?void 0:ae.indicator,{[`${_}-dot`]:ce,[`${_}-count`]:!ce,[`${_}-count-sm`]:j==="small",[`${_}-multiple-words`]:!ce&&ne&&ne.toString().length>1,[`${_}-status-${g}`]:!!g,[`${_}-color-${v}`]:ee});let te=Object.assign(Object.assign(Object.assign({},O==null?void 0:O.indicator),(re=C==null?void 0:C.styles)===null||re===void 0?void 0:re.indicator),Q);return v&&!ee&&(te=te||{},te.background=v),x.createElement(wt,{prefixCls:Ee,show:!W,motionClassName:R,className:ze,count:ne,title:Re,style:te,key:"scrollNumber"},Pe)}),Me))}),ke=$t;ke.Ribbon=Nt;var Tt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z"}}]},name:"rollback",theme:"outlined"},Lt=function(i,n){return x.createElement(We,Ue({},i,{ref:n,icon:Tt}))},kt=x.forwardRef(Lt);const Vt="_container_kjcu0_1",Ot="_fileListSection_kjcu0_10",Rt="_header_kjcu0_19",Mt="_headerTitle_kjcu0_28",Pt="_fileCount_kjcu0_36",It="_changesContainer_kjcu0_44",Et="_changeItem_kjcu0_51",zt="_changeItemActive_kjcu0_68",Bt="_dirItem_kjcu0_77",Dt="_dirArrow_kjcu0_88",At="_dirName_kjcu0_97",Ft="_status_kjcu0_102",Ht="_icon_kjcu0_111",Wt="_fileName_kjcu0_120",Ut="_diffSection_kjcu0_127",Gt="_diffHeader_kjcu0_135",Zt="_diffFilePath_kjcu0_145",qt="_diffBadge_kjcu0_155",Xt="_diffContent_kjcu0_167",Kt="_diffPlaceholder_kjcu0_173",Yt="_statusText_kjcu0_184",Jt="_errorText_kjcu0_191",Qt="_emptyText_kjcu0_198",es="_warningText_kjcu0_205",ts="_fileSizeNote_kjcu0_217",ss="_statusTextItalic_kjcu0_222",is="_rotated90_kjcu0_226",y={container:Vt,fileListSection:Ot,header:Rt,headerTitle:Mt,fileCount:Pt,changesContainer:It,changeItem:Et,changeItemActive:zt,dirItem:Bt,dirArrow:Dt,dirName:At,status:Ft,icon:Ht,fileName:Wt,diffSection:Ut,diffHeader:Gt,diffFilePath:Zt,diffBadge:qt,diffContent:Xt,diffPlaceholder:Kt,statusText:Yt,errorText:Jt,emptyText:Qt,warningText:es,fileSizeNote:ts,statusTextItalic:ss,rotated90:is},os={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991","??":"#73c991"},ns={"??":"U"},ls={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function as(t){const i=t.includes(".")?t.split(".").pop().toLowerCase():"",n=ls[i]||"#888";return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.5",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function rs(){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:e.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})})}function cs(t){const i={dirs:{},files:[]};for(const n of t){const s=n.file.split("/");let o=i;for(let d=0;d<s.length-1;d++)o.dirs[s[d]]||(o.dirs[s[d]]={dirs:{},files:[]}),o=o.dirs[s[d]];o.files.push({name:s[s.length-1],status:n.status,fullPath:n.file})}return i}function Ve({name:t,node:i,depth:n,selectedFile:s,onFileClick:o}){const d=Object.keys(i.dirs).sort(),a=[...i.files].sort((r,h)=>r.name.localeCompare(h.name));return e.jsxs(e.Fragment,{children:[t&&e.jsxs("div",{className:y.dirItem,style:{paddingLeft:8+n*16},children:[e.jsx("span",{className:y.dirArrow,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:y.rotated90,children:e.jsx("polyline",{points:"9 6 15 12 9 18"})})}),e.jsx("span",{className:y.icon,children:rs()}),e.jsx("span",{className:y.dirName,children:t})]}),d.map(r=>e.jsx(Ve,{name:r,node:i.dirs[r],depth:t?n+1:n,selectedFile:s,onFileClick:o},r)),a.map(r=>e.jsxs("div",{className:`${y.changeItem} ${s===r.fullPath?y.changeItemActive:""}`,style:{paddingLeft:8+(t?n+1:n)*16},onClick:()=>o&&o(r.fullPath),children:[e.jsx("span",{className:y.icon,children:as(r.name)}),e.jsx("span",{className:y.fileName,children:r.name}),e.jsx("span",{className:y.status,style:{color:os[r.status]||"#888"},children:ns[r.status]||r.status})]},r.fullPath))]})}function ds({visible:t}){const[i,n]=x.useState(null),[s,o]=x.useState(null),[d,a]=x.useState(!0),[r,h]=x.useState(null),[p,g]=x.useState(null),[m,v]=x.useState(null),[w,N]=x.useState(!1),S=x.useRef(!0);return x.useEffect(()=>{if(S.current=!0,!!t)return a(!0),o(null),fetch(me("/api/git-status")).then(j=>j.ok?j.json():Promise.reject()).then(j=>{S.current&&(n(j.changes||[]),a(!1))}).catch(()=>{S.current&&(o("Failed to load git status"),a(!1))}),()=>{S.current=!1}},[t]),x.useEffect(()=>{if(!r){g(null),v(null);return}N(!0),g(null),v(null),fetch(me(`/api/git-diff?files=${encodeURIComponent(r)}`)).then(j=>{if(!j.ok)throw new Error(`HTTP ${j.status}`);return j.json()}).then(j=>{S.current&&(j.diffs&&j.diffs[0]?g(j.diffs[0]):v("No diff data available"),N(!1))}).catch(j=>{S.current&&(v(`${b("ui.fileLoadError")}: ${j.message}`),N(!1))})},[r]),e.jsxs("div",{className:y.container,children:[e.jsxs("div",{className:y.fileListSection,children:[e.jsxs("div",{className:y.header,children:[e.jsx("span",{className:y.headerTitle,children:b("ui.gitChanges")}),e.jsx("span",{className:y.fileCount,children:i?i.length:0})]}),e.jsxs("div",{className:y.changesContainer,children:[d&&e.jsx("div",{className:y.statusText,children:"Loading..."}),s&&e.jsx("div",{className:y.errorText,children:s}),!d&&!s&&i&&i.length===0&&e.jsx("div",{className:y.emptyText,children:"No changes"}),!d&&!s&&i&&i.length>0&&e.jsx(Ve,{name:"",node:cs(i),depth:0,selectedFile:r,onFileClick:h})]})]}),e.jsx("div",{className:y.diffSection,children:r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:y.diffHeader,children:[e.jsx("span",{className:y.diffFilePath,children:r}),e.jsx("span",{className:y.diffBadge,children:"DIFF"})]}),e.jsxs("div",{className:y.diffContent,children:[w&&e.jsx("div",{className:y.statusText,children:b("ui.loading")}),m&&e.jsx("div",{className:y.errorText,children:m}),!w&&!m&&p&&e.jsx(e.Fragment,{children:p.is_large?e.jsxs("div",{className:y.warningText,children:[e.jsx("p",{children:b("ui.largeFileWarning")}),e.jsxs("p",{className:y.fileSizeNote,children:[b("ui.fileSize"),": ",(p.size/(1024*1024)).toFixed(2)," MB"]})]}):p.is_binary?e.jsx("div",{className:`${y.statusText} ${y.statusTextItalic}`,children:b("ui.binaryFileNotice")}):e.jsx(Ge,{file_path:r,old_string:p.old_content,new_string:p.new_content})})]})]}):e.jsxs("div",{className:y.diffPlaceholder,children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#333",strokeWidth:"1.5",children:[e.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),e.jsx("circle",{cx:"18",cy:"6",r:"3"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),e.jsx("span",{children:b("ui.mobileGitDiffHint")})]})})]})}const ms="_container_vnezo_1",hs="_header_vnezo_9",us="_headerTitle_vnezo_18",bs="_closeBtn_vnezo_24",fs="_content_vnezo_38",gs="_empty_vnezo_47",xs="_fixedTable_vnezo_54",ps="_ellipsisCell_vnezo_58",js="_thLeft_vnezo_65",vs="_colWide_vnezo_69",Ns="_colNarrow_vnezo_73",k={container:ms,header:hs,headerTitle:us,closeBtn:bs,content:fs,empty:gs,fixedTable:xs,ellipsisCell:ps,thLeft:js,colWide:vs,colNarrow:Ns},Cs=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],Ne={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"};function ys({requests:t=[],visible:i,onClose:n}){const{byModel:s,models:o,toolStats:d,skillStats:a,cacheStats:r,activeReasons:h,totalCount:p,totalCache:g,hasCacheStats:m,subAgentEntries:v,hasSubAgentStats:w,teammateEntries:N,hasTeammateStats:S,isEmpty:j}=x.useMemo(()=>{const u=Ze(t),f=Object.keys(u),L=qe(t),P=Xe(t),D=Ke(t),V=Cs.filter($=>D[$].count>0),O=V.reduce(($,T)=>$+D[T].count,0),A=V.reduce(($,T)=>$+D[T].cacheCreate,0),X=V.length>0,F={},z={};for(let $=0;$<t.length;$++){const T=Ye(t[$],t[$+1]);if(T.type==="SubAgent"){const I=T.subType||"Other";F[I]=(F[I]||0)+1}else if(T.type==="Teammate"){const I=T.subType||"Teammate";z[I]=(z[I]||0)+1}}const C=Object.entries(F).sort(($,T)=>T[1]-$[1]),_=C.length>0,K=Object.entries(z).sort(($,T)=>T[1]-$[1]),J=K.length>0,ie=f.length===0&&L.length===0&&!X&&!_&&!J&&P.length===0;return{byModel:u,models:f,toolStats:L,skillStats:P,cacheStats:D,activeReasons:V,totalCount:O,totalCache:A,hasCacheStats:X,subAgentEntries:C,hasSubAgentStats:_,teammateEntries:K,hasTeammateStats:J,isEmpty:ie}},[t]);return i?e.jsxs("div",{className:k.container,children:[e.jsxs("div",{className:k.header,children:[e.jsx("span",{className:k.headerTitle,children:b("ui.tokenStats")}),e.jsx("button",{className:k.closeBtn,onClick:n,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:k.content,children:j?e.jsx("div",{className:k.empty,children:"—"}):e.jsxs(e.Fragment,{children:[a.length>0&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:b("ui.skillUsageStats")}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"Skill"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[a.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label,children:u}),e.jsx("td",{className:l.td,children:f})]},u)),a.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:a.reduce((u,f)=>u+f[1],0)})]})]})]})]}),w&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:b("ui.subAgentStats")}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[v.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsxs("td",{className:l.label,children:[u," ",e.jsx(se,{doc:`SubAgent-${u}`})]}),e.jsx("td",{className:l.td,children:f})]},u)),v.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:v.reduce((u,f)=>u+f[1],0)})]})]})]})]}),S&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:"Teammate"}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"Name"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[N.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label,children:u}),e.jsx("td",{className:l.td,children:f})]},u)),N.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:N.reduce((u,f)=>u+f[1],0)})]})]})]})]}),d.length>0&&e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:b("ui.toolUsageStats")}),e.jsxs("table",{className:l.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:"Tool"}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[d.map(([u,f])=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsxs("td",{className:l.label,children:[u," ",e.jsx(se,{doc:`Tool-${u}`})]}),e.jsx("td",{className:l.td,children:f})]},u)),d.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:d.reduce((u,f)=>u+f[1],0)})]})]})]})]}),m&&e.jsxs("div",{className:l.modelCard,children:[e.jsxs("div",{className:l.modelName,children:["MainAgent",e.jsx(se,{doc:"MainAgent"})," ",b("ui.cacheRebuildStats"),e.jsx(se,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:`${l.statsTable} ${k.fixedTable}`,children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:k.colWide}),e.jsx("col",{className:k.colNarrow}),e.jsx("col",{className:k.colNarrow})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${l.th} ${k.thLeft}`,children:b("ui.cacheRebuild.reason")}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.count")}),e.jsx("td",{className:l.th,children:b("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[h.map(u=>e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:`${l.label} ${k.ellipsisCell}`,title:b(`ui.${Ne[u]}`),children:b(`ui.${Ne[u]}`)}),e.jsx("td",{className:l.td,children:r[u].count}),e.jsx("td",{className:l.td,children:G(r[u].cacheCreate)})]},u)),h.length>1&&e.jsxs("tr",{className:l.rebuildTotalRow,children:[e.jsx("td",{className:l.label,children:"Total"}),e.jsx("td",{className:l.td,children:p}),e.jsx("td",{className:l.td,children:G(g)})]})]})]})]}),o.map(u=>{const f=s[u],L=f.input+f.cacheCreation+f.cacheRead,P=L>0?(f.cacheRead/L*100).toFixed(1):"0.0";return e.jsxs("div",{className:l.modelCard,children:[e.jsx("div",{className:l.modelName,children:u}),e.jsx("table",{className:l.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:l.label,children:"Token"}),e.jsx("td",{className:l.th,children:"input"}),e.jsx("td",{className:l.th,children:"output"})]}),e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label}),e.jsx("td",{className:l.td,children:G(L)}),e.jsx("td",{className:l.td,children:G(f.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:l.label,children:"Cache"}),e.jsx("td",{className:l.th,children:"create"}),e.jsx("td",{className:l.th,children:"read"})]}),e.jsxs("tr",{className:l.rowBorder,children:[e.jsx("td",{className:l.label}),e.jsx("td",{className:l.td,children:G(f.cacheCreation)}),e.jsx("td",{className:l.td,children:G(f.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:l.label,children:b("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:l.td,children:[P,"%"]})]})]})})]},u)})]})})]}):null}const Z=class Z extends Je{constructor(n){super(n);de(this,"handleExportPromptsTxt",n=>{if(!n||n.length===0)return;const s=[];for(const r of n){const h=[],p=r.timestamp?new Date(r.timestamp).toLocaleString():"";p&&h.push(`${p}:
2
2
  `);const g=(r.segments||[]).filter(m=>m.type==="text").map(m=>m.content);g.length>0&&h.push(g.join(`
3
3
  `)),s.push(h.join(`
4
4
  `))}if(s.length===0)return;const o=new Blob([s.join(`