cc-viewer 1.6.181 → 1.6.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{App-C8CNTD-m.js → App-CNrQ1r4B.js} +3 -3
- package/dist/assets/{AppHeader.module-DH3cff8Z.js → AppHeader.module-Cfep06i2.js} +3 -3
- package/dist/assets/{Mobile-Q3dXLA2a.js → Mobile-M9her8kt.js} +1 -1
- package/dist/assets/{_baseUniq-rOMI_TZG.js → _baseUniq-B9F7jipu.js} +1 -1
- package/dist/assets/{arc-CboulKym.js → arc-CynSuGRD.js} +1 -1
- package/dist/assets/{architectureDiagram-Q4EWVU46-ByxL9O5h.js → architectureDiagram-Q4EWVU46-CaYDh0U8.js} +1 -1
- package/dist/assets/{blockDiagram-DXYQGD6D-D7OtZ-Su.js → blockDiagram-DXYQGD6D-DH53lUCG.js} +1 -1
- package/dist/assets/{c4Diagram-AHTNJAMY-DYMAemrg.js → c4Diagram-AHTNJAMY-B0Lesax1.js} +1 -1
- package/dist/assets/channel-mzoD3rY3.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-0Xr50pdE.js → chunk-4BX2VUAB-CwREaLcn.js} +1 -1
- package/dist/assets/{chunk-4TB4RGXK-Bs9TDAtQ.js → chunk-4TB4RGXK-DaysThRr.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-BjOIVHq2.js → chunk-55IACEB6--rkNDUme.js} +1 -1
- package/dist/assets/{chunk-EDXVE4YY-BPb7Scqg.js → chunk-EDXVE4YY-Cn_Hw1kB.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-D-ZvDfZk.js → chunk-FMBD7UC4-CHjMpQO_.js} +1 -1
- package/dist/assets/{chunk-OYMX7WX6-Cfy6Ve6x.js → chunk-OYMX7WX6-DxkBZLOn.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-CtDGgouw.js → chunk-QZHKN3VN-CEcNQmq8.js} +1 -1
- package/dist/assets/{chunk-YZCP3GAM-dIKHxrz1.js → chunk-YZCP3GAM-CVFEY5kV.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-CzNz4tFu.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-CzNz4tFu.js +1 -0
- package/dist/assets/clone-DPuQFdir.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BrhTr984.js → cose-bilkent-S5V4N54A-DPsF6jLB.js} +1 -1
- package/dist/assets/{dagre-KV5264BT-p__prPND.js → dagre-KV5264BT-QI4QFfbP.js} +1 -1
- package/dist/assets/{diagram-5BDNPKRD-B0dym4aO.js → diagram-5BDNPKRD-Do0BzIFe.js} +1 -1
- package/dist/assets/{diagram-G4DWMVQ6-CbAA79Ln.js → diagram-G4DWMVQ6-CVvuZ8FU.js} +1 -1
- package/dist/assets/{diagram-MMDJMWI5-DHJt8RL0.js → diagram-MMDJMWI5-CmeuA2db.js} +1 -1
- package/dist/assets/{diagram-TYMM5635-DeKzzShW.js → diagram-TYMM5635-B90Irbks.js} +1 -1
- package/dist/assets/{erDiagram-SMLLAGMA-yaO-7k73.js → erDiagram-SMLLAGMA-_3w237ct.js} +1 -1
- package/dist/assets/{flowDiagram-DWJPFMVM-l3oh8yWv.js → flowDiagram-DWJPFMVM-DIR7-K_k.js} +1 -1
- package/dist/assets/{ganttDiagram-T4ZO3ILL-D94Jpg73.js → ganttDiagram-T4ZO3ILL-DtM5nlfx.js} +1 -1
- package/dist/assets/{gitGraphDiagram-UUTBAWPF-CZjgd-f7.js → gitGraphDiagram-UUTBAWPF-FvAMJ2i5.js} +1 -1
- package/dist/assets/{graph-D-JTg60d.js → graph-DvmWkua1.js} +1 -1
- package/dist/assets/{index-Dfig4ra7.js → index-CQ5P7lQi.js} +2 -2
- package/dist/assets/{infoDiagram-42DDH7IO-CQZ72h8e.js → infoDiagram-42DDH7IO-DSF3BTCW.js} +1 -1
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-Bv7ZeUys.js → ishikawaDiagram-UXIWVN3A-BwFoBXkx.js} +1 -1
- package/dist/assets/{journeyDiagram-VCZTEJTY-DxJnjg93.js → journeyDiagram-VCZTEJTY-lbgmpsvI.js} +1 -1
- package/dist/assets/{kanban-definition-6JOO6SKY-Dv0We0J5.js → kanban-definition-6JOO6SKY-DagC1CXx.js} +1 -1
- package/dist/assets/{layout-Ba0RT59W.js → layout-CYvGQQtB.js} +1 -1
- package/dist/assets/{linear-BTfz1Ea0.js → linear-J9f9mKrL.js} +1 -1
- package/dist/assets/{mermaid.core-BOJAxVTM.js → mermaid.core-MGw0R-Yr.js} +4 -4
- package/dist/assets/{min-CAZ0iwNu.js → min-B3KMZtQG.js} +1 -1
- package/dist/assets/{mindmap-definition-QFDTVHPH-K_GigB1Z.js → mindmap-definition-QFDTVHPH-CKtAtz4K.js} +1 -1
- package/dist/assets/{pieDiagram-DEJITSTG-CcIU4Xmk.js → pieDiagram-DEJITSTG-DiCs6oG9.js} +1 -1
- package/dist/assets/{quadrantDiagram-34T5L4WZ-CybhA1G2.js → quadrantDiagram-34T5L4WZ-B1V_JsFK.js} +1 -1
- package/dist/assets/{requirementDiagram-MS252O5E-BK5Toa2G.js → requirementDiagram-MS252O5E-DYZx4toa.js} +1 -1
- package/dist/assets/{sankeyDiagram-XADWPNL6-C6xr0fly.js → sankeyDiagram-XADWPNL6-DZtUKtpU.js} +1 -1
- package/dist/assets/{sequenceDiagram-FGHM5R23-BiSlEqPj.js → sequenceDiagram-FGHM5R23-CKydm1ev.js} +1 -1
- package/dist/assets/{stateDiagram-FHFEXIEX-MJqsZOYD.js → stateDiagram-FHFEXIEX-mmQoyEVR.js} +1 -1
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-BFs-Juqf.js +1 -0
- package/dist/assets/{timeline-definition-GMOUNBTQ-BTAuq-uJ.js → timeline-definition-GMOUNBTQ-DEauFuh9.js} +1 -1
- package/dist/assets/{vennDiagram-DHZGUBPP-BHm1DyAc.js → vennDiagram-DHZGUBPP-D6AeTMhT.js} +1 -1
- package/dist/assets/{wardley-RL74JXVD-D2RdEO06.js → wardley-RL74JXVD-BOe-9JZP.js} +1 -1
- package/dist/assets/{wardleyDiagram-NUSXRM2D-BJuy_n-y.js → wardleyDiagram-NUSXRM2D-BLWMynOp.js} +1 -1
- package/dist/assets/{xychartDiagram-5P7HB3ND-QC3qQchZ.js → xychartDiagram-5P7HB3ND-Wa1KJpmO.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/channel-CgpTmQJL.js +0 -1
- package/dist/assets/classDiagram-6PBFFD2Q-B7-2zvya.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-B7-2zvya.js +0 -1
- package/dist/assets/clone-CFKvE47V.js +0 -1
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-CMQ51hzA.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var wt=Object.defineProperty;var Mt=(c,a,t)=>a in c?wt(c,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[a]=t;var M=(c,a,t)=>Mt(c,typeof a!="symbol"?a+"":a,t);import{j as e}from"./vendor-codemirror-C7imH6Hd.js";import{a as N,I as ee,b as te,R as ge,o as me,s as H,i as le,P as ue,p as Lt,M as X,S as pt,q as Ze,t as pe,D as Rt,T as Y,d as E,h as ae,u as ie,v as Ce,j as It,w as gt,x as Ee,y as _e,e as He,z as et,f as Pe,F as Et,A as Bt,E as Dt,G as At,H as re,L as tt,J as xt,K as ft,N as ce,O as de,C as Ft,Q as Be,U as Ht,V as Pt}from"./vendor-antd--lnyToqQ.js";import{a as K,t as l,l as fe,m as qt,n as Z,d as zt,e as $t,g as Vt,s,k as F,C as V,w as jt,h as Ot,x as Ut,j as je,p as st,y as Wt,z as Kt,O as yt,B as Jt,D as at,E as vt,G as nt,H as De,J as it,K as lt,L as Gt,M as Qt,A as Xt,N as be,P as ot,u as Yt,o as k,R as rt,r as Zt}from"./AppHeader.module-DH3cff8Z.js";import{s as es,b as ts}from"./index-Dfig4ra7.js";import{Q as ss}from"./vendor-qrcode-myYunK0Z.js";import"./vendor-markdown-CO-jRjTB.js";import"./vendor-xterm-DWMOrwSy.js";import"./vendor-highlight-D4ATuRwX.js";import"./vendor-virtuoso-DDKvHLUv.js";var as={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"},ns=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:as}))},ct=N.forwardRef(ns),is={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"},ls=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:is}))},dt=N.forwardRef(ls),os={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"},rs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:os}))},ht=N.forwardRef(rs),cs={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"},ds=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:cs}))},Ne=N.forwardRef(ds),hs={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"},us=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:hs}))},Ae=N.forwardRef(us),ms={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"},ps=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:ms}))},gs=N.forwardRef(ps),xs={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"},fs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:xs}))},ut=N.forwardRef(fs),js={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"},ys=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:js}))},vs=N.forwardRef(ys),_s={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"},bs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:_s}))},mt=N.forwardRef(bs);const Cs=[{label:"Auto",value:"auto"},{label:"Opus 4.6 (1M)",value:"opus-4.6-1m",tokens:1e6},{label:"Sonnet 4.6",value:"sonnet-4.6",tokens:2e5},{label:"GLM5",value:"glm5",tokens:2e5},{label:"Kimi K2.5",value:"kimi-k2.5",tokens:2e5},{label:"MiniMax 2.1",value:"minimax-2.1",tokens:2e5},{label:"Qwen 3.5",value:"Qwen 3.5",tokens:2e5}],Ns={calibrationModels:Cs},Fe=Ns.calibrationModels,Ss=[{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:"Українська"}],ks=c=>{const a=t=>t.toUpperCase().split("").map(i=>String.fromCodePoint(127462+i.charCodeAt(0)-65)).join("");return!c||c.length!==2?a("CN"):a(c)},oe=class oe extends ge.Component{constructor(t){super(t);M(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});M(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const i=[];for(const m of t){const u=[],g=m.timestamp?new Date(m.timestamp).toLocaleString():"";g&&u.push(`${g}:
|
|
1
|
+
var wt=Object.defineProperty;var Mt=(c,a,t)=>a in c?wt(c,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[a]=t;var M=(c,a,t)=>Mt(c,typeof a!="symbol"?a+"":a,t);import{j as e}from"./vendor-codemirror-C7imH6Hd.js";import{a as N,I as ee,b as te,R as ge,o as me,s as H,i as le,P as ue,p as Lt,M as X,S as pt,q as Ze,t as pe,D as Rt,T as Y,d as E,h as ae,u as ie,v as Ce,j as It,w as gt,x as Ee,y as _e,e as He,z as et,f as Pe,F as Et,A as Bt,E as Dt,G as At,H as re,L as tt,J as xt,K as ft,N as ce,O as de,C as Ft,Q as Be,U as Ht,V as Pt}from"./vendor-antd--lnyToqQ.js";import{a as K,t as l,l as fe,m as qt,n as Z,d as zt,e as $t,g as Vt,s,k as F,C as V,w as jt,h as Ot,x as Ut,j as je,p as st,y as Wt,z as Kt,O as yt,B as Jt,D as at,E as vt,G as nt,H as De,J as it,K as lt,L as Gt,M as Qt,A as Xt,N as be,P as ot,u as Yt,o as k,R as rt,r as Zt}from"./AppHeader.module-Cfep06i2.js";import{s as es,b as ts}from"./index-CQ5P7lQi.js";import{Q as ss}from"./vendor-qrcode-myYunK0Z.js";import"./vendor-markdown-CO-jRjTB.js";import"./vendor-xterm-DWMOrwSy.js";import"./vendor-highlight-D4ATuRwX.js";import"./vendor-virtuoso-DDKvHLUv.js";var as={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"},ns=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:as}))},ct=N.forwardRef(ns),is={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"},ls=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:is}))},dt=N.forwardRef(ls),os={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"},rs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:os}))},ht=N.forwardRef(rs),cs={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"},ds=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:cs}))},Ne=N.forwardRef(ds),hs={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"},us=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:hs}))},Ae=N.forwardRef(us),ms={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"},ps=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:ms}))},gs=N.forwardRef(ps),xs={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"},fs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:xs}))},ut=N.forwardRef(fs),js={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"},ys=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:js}))},vs=N.forwardRef(ys),_s={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"},bs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:_s}))},mt=N.forwardRef(bs);const Cs=[{label:"Auto",value:"auto"},{label:"Opus 4.6 (1M)",value:"opus-4.6-1m",tokens:1e6},{label:"Sonnet 4.6",value:"sonnet-4.6",tokens:2e5},{label:"GLM5",value:"glm5",tokens:2e5},{label:"Kimi K2.5",value:"kimi-k2.5",tokens:2e5},{label:"MiniMax 2.1",value:"minimax-2.1",tokens:2e5},{label:"Qwen 3.5",value:"Qwen 3.5",tokens:2e5}],Ns={calibrationModels:Cs},Fe=Ns.calibrationModels,Ss=[{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:"Українська"}],ks=c=>{const a=t=>t.toUpperCase().split("").map(i=>String.fromCodePoint(127462+i.charCodeAt(0)-65)).join("");return!c||c.length!==2?a("CN"):a(c)},oe=class oe extends ge.Component{constructor(t){super(t);M(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});M(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const i=[];for(const m of t){const u=[],g=m.timestamp?new Date(m.timestamp).toLocaleString():"";g&&u.push(`${g}:
|
|
2
2
|
`);const h=(m.segments||[]).filter(d=>d.type==="text").map(d=>d.content);h.length>0&&u.push(h.join(`
|
|
3
3
|
`)),i.push(u.join(`
|
|
4
4
|
`))}if(i.length===0)return;const o=new Blob([i.join(`
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
`)],{type:"text/plain;charset=utf-8"}),n=URL.createObjectURL(o),r=document.createElement("a");r.href=n,r.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,r.click(),URL.revokeObjectURL(n)});M(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});M(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(K("/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}))});M(this,"fetchPlugins",()=>fetch(K("/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(()=>{}));M(this,"handleShowPlugins",()=>{this.setState({pluginModalVisible:!0}),this.fetchPlugins()});M(this,"handleTogglePlugin",(t,i)=>{fetch(K("/api/preferences")).then(o=>o.json()).then(o=>{let n=Array.isArray(o.disabledPlugins)?[...o.disabledPlugins]:[];return i?n=n.filter(r=>r!==t):n.includes(t)||n.push(t),fetch(K("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:n})})}).then(()=>fetch(K("/api/plugins/reload"),{method:"POST"})).then(o=>{if(!o.ok)throw new Error(o.status);return o.json()}).then(o=>{this.setState({pluginsList:o.plugins||[],pluginsDir:o.pluginsDir||""})}).catch(()=>{})});M(this,"handleDeletePlugin",(t,i)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:i}})});M(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(K(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(i=>{if(!i.ok)throw new Error(i.status);return i.json()}).then(i=>{i.plugins&&this.setState({pluginsList:i.plugins,pluginsDir:i.pluginsDir||""})}).catch(()=>{}))});M(this,"handleReloadPlugins",()=>{fetch(K("/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(()=>{})});M(this,"handleAddPlugin",()=>{const t=document.createElement("input");t.type="file",t.accept=".js,.mjs",t.multiple=!0,t.onchange=()=>{const i=t.files;if(!i||i.length===0)return;for(const n of i)if(!n.name.endsWith(".js")&&!n.name.endsWith(".mjs")){H.error(l("ui.plugins.invalidFile"));return}const o=Array.from(i).map(n=>new Promise((r,m)=>{const u=new FileReader;u.onload=()=>r({name:n.name,content:u.result}),u.onerror=()=>m(new Error(`Failed to read ${n.name}`)),u.readAsText(n)}));Promise.all(o).then(n=>fetch(K("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:n})})).then(n=>n.ok?n.json():n.text().then(r=>{try{return JSON.parse(r)}catch{throw new Error(l("ui.plugins.serverError",{status:n.status}))}})).then(n=>{n.error?H.error(l("ui.plugins.addFailed",{reason:n.error})):n.plugins&&(this.setState({pluginsList:n.plugins,pluginsDir:n.pluginsDir||""}),H.success(l("ui.plugins.addSuccess")))}).catch(n=>{H.error(n.message)})},t.click()});M(this,"handleShowCdnModal",()=>{this.setState({cdnModalVisible:!0,cdnUrl:"",cdnLoading:!1})});M(this,"handleCdnUrlChange",t=>{this.setState({cdnUrl:t.target.value})});M(this,"handleCdnInstall",()=>{const{cdnUrl:t}=this.state;if(!t.trim()){H.error(l("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{H.error(l("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(K("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(i=>i.json()).then(i=>{i.error?H.error(l("ui.plugins.cdnInstallFailed",{reason:i.error})):(H.success(l("ui.plugins.cdnInstallSuccess")),i.plugins&&this.setState({pluginsList:i.plugins,pluginsDir:i.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(i=>{H.error(l("ui.plugins.cdnInstallFailed",{reason:i.message||"Network error"}))}).finally(()=>{this.setState({cdnLoading:!1})})});M(this,"handleCdnCancel",()=>{this.setState({cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1})});M(this,"fetchProcesses",()=>{this.setState({processLoading:!0}),fetch(K("/api/ccv-processes")).then(t=>t.json()).then(t=>{this.setState({processList:t.processes||[],processLoading:!1})}).catch(()=>{this.setState({processList:[],processLoading:!1})})});M(this,"handleShowProcesses",()=>{this.setState({processModalVisible:!0}),this.fetchProcesses()});M(this,"handleKillProcess",t=>{X.confirm({title:l("ui.processManagement.killConfirm"),onOk:()=>{fetch(K("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(i=>i.json()).then(i=>{i.ok?(H.success(l("ui.processManagement.killed")),this.fetchProcesses()):H.error(i.error||l("ui.processManagement.killFailed"))}).catch(()=>{H.error(l("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:(i=>Fe.some(o=>o.value===i)?i:"auto")(localStorage.getItem("ccv_calibrationModel")||"auto"),proxyModalVisible:!1,editingProxy:null,editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""},logDirDraft:null},this._countdownTimer=null,this._expiredTimer=null,this.updateCountdown=this.updateCountdown.bind(this)}componentDidMount(){this.startCountdown(),fetch(K("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(K("/api/claude-settings")).then(t=>t.json()).then(t=>{t.model&&this.setState({settingsModel:t.model})}).catch(()=>{}),fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(5e3)}).then(t=>t.json()).then(t=>{t.country&&this.setState({countryFlag:ks(t.country),countryInfo:t})}).catch(()=>{})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,i){return t.requests!==this.props.requests||t.requestCount!==this.props.requestCount||t.viewMode!==this.props.viewMode||t.cacheExpireAt!==this.props.cacheExpireAt||t.cacheType!==this.props.cacheType||t.isLocalLog!==this.props.isLocalLog||t.projectName!==this.props.projectName||t.collapseToolResults!==this.props.collapseToolResults||t.expandThinking!==this.props.expandThinking||t.showFullToolContent!==this.props.showFullToolContent||t.expandDiff!==this.props.expandDiff||t.filterIrrelevant!==this.props.filterIrrelevant||t.logDir!==this.props.logDir||t.cliMode!==this.props.cliMode||t.contextWindow!==this.props.contextWindow||t.serverCachedContent!==this.props.serverCachedContent||t.resumeAutoChoice!==this.props.resumeAutoChoice||t.proxyProfiles!==this.props.proxyProfiles||t.activeProxyId!==this.props.activeProxyId||t.defaultConfig!==this.props.defaultConfig||i!==this.state}componentWillUnmount(){this._countdownTimer&&clearTimeout(this._countdownTimer),this._expiredTimer&&clearTimeout(this._expiredTimer),this._cacheFadeClearTimer&&clearTimeout(this._cacheFadeClearTimer),this._cacheScrollSettleTimer&&clearTimeout(this._cacheScrollSettleTimer),this._cacheAutoFadeTimer&&clearTimeout(this._cacheAutoFadeTimer),this._cacheHighlightDelayTimer&&clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade()}startCountdown(){if(this._countdownTimer&&clearTimeout(this._countdownTimer),this._expiredTimer&&clearTimeout(this._expiredTimer),!this.props.cacheExpireAt){this.state.countdownText!==""&&this.setState({countdownText:""});return}this.updateCountdown()}updateCountdown(){const{cacheExpireAt:t}=this.props;if(!t){this.state.countdownText!==""&&this.setState({countdownText:""});return}const i=Date.now(),o=Math.max(0,t-i);if(o<=0){const u=l("ui.cacheExpired");this.state.countdownText!==u&&this.setState({countdownText:u}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const n=Math.ceil(o/1e3);let r;if(n>=60){const u=Math.floor(n/60),g=n%60;r=l("ui.minuteSecond",{m:u,s:String(g).padStart(2,"0")})}else r=l("ui.second",{s:n});r!==this.state.countdownText&&this.setState({countdownText:r});const m=1e3-i%1e3;this._countdownTimer=setTimeout(this.updateCountdown,m)}static parseSegments(t){const i=[],o=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let n=0,r;for(;(r=o.exec(t))!==null;){const u=t.slice(n,r.index).trim();u&&i.push({type:"text",content:u});const g=r[1];if(n=r.index+r[0].length,oe.COMMAND_TAGS.has(g))continue;const h=new RegExp(`^<${g}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${g}>$`),d=r[0].match(h),x=d?d[1].trim():r[0].trim();i.push({type:"system",content:x,label:g})}const m=t.slice(n).trim();return m&&i.push({type:"text",content:m}),i}static extractUserTexts(t){const i=[],o=[];let n=null;for(const r of t)if(r.role==="user"){if(typeof r.content=="string"){const m=r.content.trim();if(!m)continue;if(!fe(m)){if(/Implement the following plan:/i.test(m))continue;i.push(m),o.push(m)}}else if(Array.isArray(r.content)){const{commands:m,textBlocks:u}=qt(r.content);m.length>0&&(n=m[m.length-1]);const g=[];for(const d of u)/Implement the following plan:/i.test((d.text||"").trim())||g.push(d.text.trim());const h=r.content.filter(d=>{var x;return d.type==="text"&&((x=d.text)==null?void 0:x.trim())}).map(d=>d.text.trim());g.length>0&&(i.push(g.join(`
|
|
8
|
+
`)],{type:"text/plain;charset=utf-8"}),n=URL.createObjectURL(o),r=document.createElement("a");r.href=n,r.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,r.click(),URL.revokeObjectURL(n)});M(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});M(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(K("/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}))});M(this,"fetchPlugins",()=>fetch(K("/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(()=>{}));M(this,"handleShowPlugins",()=>{this.setState({pluginModalVisible:!0}),this.fetchPlugins()});M(this,"handleTogglePlugin",(t,i)=>{fetch(K("/api/preferences")).then(o=>o.json()).then(o=>{let n=Array.isArray(o.disabledPlugins)?[...o.disabledPlugins]:[];return i?n=n.filter(r=>r!==t):n.includes(t)||n.push(t),fetch(K("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:n})})}).then(()=>fetch(K("/api/plugins/reload"),{method:"POST"})).then(o=>{if(!o.ok)throw new Error(o.status);return o.json()}).then(o=>{this.setState({pluginsList:o.plugins||[],pluginsDir:o.pluginsDir||""})}).catch(()=>{})});M(this,"handleDeletePlugin",(t,i)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:i}})});M(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(K(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(i=>{if(!i.ok)throw new Error(i.status);return i.json()}).then(i=>{i.plugins&&this.setState({pluginsList:i.plugins,pluginsDir:i.pluginsDir||""})}).catch(()=>{}))});M(this,"handleReloadPlugins",()=>{fetch(K("/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(()=>{})});M(this,"handleAddPlugin",()=>{const t=document.createElement("input");t.type="file",t.accept=".js,.mjs",t.multiple=!0,t.onchange=()=>{const i=t.files;if(!i||i.length===0)return;for(const n of i)if(!n.name.endsWith(".js")&&!n.name.endsWith(".mjs")){H.error(l("ui.plugins.invalidFile"));return}const o=Array.from(i).map(n=>new Promise((r,m)=>{const u=new FileReader;u.onload=()=>r({name:n.name,content:u.result}),u.onerror=()=>m(new Error(`Failed to read ${n.name}`)),u.readAsText(n)}));Promise.all(o).then(n=>fetch(K("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:n})})).then(n=>n.ok?n.json():n.text().then(r=>{try{return JSON.parse(r)}catch{throw new Error(l("ui.plugins.serverError",{status:n.status}))}})).then(n=>{n.error?H.error(l("ui.plugins.addFailed",{reason:n.error})):n.plugins&&(this.setState({pluginsList:n.plugins,pluginsDir:n.pluginsDir||""}),H.success(l("ui.plugins.addSuccess")))}).catch(n=>{H.error(n.message)})},t.click()});M(this,"handleShowCdnModal",()=>{this.setState({cdnModalVisible:!0,cdnUrl:"",cdnLoading:!1})});M(this,"handleCdnUrlChange",t=>{this.setState({cdnUrl:t.target.value})});M(this,"handleCdnInstall",()=>{const{cdnUrl:t}=this.state;if(!t.trim()){H.error(l("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{H.error(l("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(K("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(i=>i.json()).then(i=>{i.error?H.error(l("ui.plugins.cdnInstallFailed",{reason:i.error})):(H.success(l("ui.plugins.cdnInstallSuccess")),i.plugins&&this.setState({pluginsList:i.plugins,pluginsDir:i.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(i=>{H.error(l("ui.plugins.cdnInstallFailed",{reason:i.message||"Network error"}))}).finally(()=>{this.setState({cdnLoading:!1})})});M(this,"handleCdnCancel",()=>{this.setState({cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1})});M(this,"fetchProcesses",()=>{this.setState({processLoading:!0}),fetch(K("/api/ccv-processes")).then(t=>t.json()).then(t=>{this.setState({processList:t.processes||[],processLoading:!1})}).catch(()=>{this.setState({processList:[],processLoading:!1})})});M(this,"handleShowProcesses",()=>{this.setState({processModalVisible:!0}),this.fetchProcesses()});M(this,"handleKillProcess",t=>{X.confirm({title:l("ui.processManagement.killConfirm"),onOk:()=>{fetch(K("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(i=>i.json()).then(i=>{i.ok?(H.success(l("ui.processManagement.killed")),this.fetchProcesses()):H.error(i.error||l("ui.processManagement.killFailed"))}).catch(()=>{H.error(l("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:(i=>Fe.some(o=>o.value===i)?i:"auto")(localStorage.getItem("ccv_calibrationModel")||"auto"),proxyModalVisible:!1,editingProxy:null,editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""},logDirDraft:null},this._countdownTimer=null,this._expiredTimer=null,this.updateCountdown=this.updateCountdown.bind(this)}componentDidMount(){this.startCountdown(),fetch(K("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(K("/api/claude-settings")).then(t=>t.json()).then(t=>{t.model&&this.setState({settingsModel:t.model})}).catch(()=>{}),fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(5e3)}).then(t=>t.json()).then(t=>{t.country&&this.setState({countryFlag:ks(t.country),countryInfo:t})}).catch(()=>{})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,i){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.localLogFile!==this.props.localLogFile||t.projectName!==this.props.projectName||t.collapseToolResults!==this.props.collapseToolResults||t.expandThinking!==this.props.expandThinking||t.showFullToolContent!==this.props.showFullToolContent||t.expandDiff!==this.props.expandDiff||t.filterIrrelevant!==this.props.filterIrrelevant||t.logDir!==this.props.logDir||t.updateInfo!==this.props.updateInfo||t.cliMode!==this.props.cliMode||t.sdkMode!==this.props.sdkMode||t.terminalVisible!==this.props.terminalVisible||t.contextWindow!==this.props.contextWindow||t.serverCachedContent!==this.props.serverCachedContent||t.resumeAutoChoice!==this.props.resumeAutoChoice||t.themeColor!==this.props.themeColor||t.autoApproveSeconds!==this.props.autoApproveSeconds||t.proxyProfiles!==this.props.proxyProfiles||t.activeProxyId!==this.props.activeProxyId||t.defaultConfig!==this.props.defaultConfig||i!==this.state}componentWillUnmount(){this._countdownTimer&&clearTimeout(this._countdownTimer),this._expiredTimer&&clearTimeout(this._expiredTimer),this._cacheFadeClearTimer&&clearTimeout(this._cacheFadeClearTimer),this._cacheScrollSettleTimer&&clearTimeout(this._cacheScrollSettleTimer),this._cacheAutoFadeTimer&&clearTimeout(this._cacheAutoFadeTimer),this._cacheHighlightDelayTimer&&clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade()}startCountdown(){if(this._countdownTimer&&clearTimeout(this._countdownTimer),this._expiredTimer&&clearTimeout(this._expiredTimer),!this.props.cacheExpireAt){this.state.countdownText!==""&&this.setState({countdownText:""});return}this.updateCountdown()}updateCountdown(){const{cacheExpireAt:t}=this.props;if(!t){this.state.countdownText!==""&&this.setState({countdownText:""});return}const i=Date.now(),o=Math.max(0,t-i);if(o<=0){const u=l("ui.cacheExpired");this.state.countdownText!==u&&this.setState({countdownText:u}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const n=Math.ceil(o/1e3);let r;if(n>=60){const u=Math.floor(n/60),g=n%60;r=l("ui.minuteSecond",{m:u,s:String(g).padStart(2,"0")})}else r=l("ui.second",{s:n});r!==this.state.countdownText&&this.setState({countdownText:r});const m=1e3-i%1e3;this._countdownTimer=setTimeout(this.updateCountdown,m)}static parseSegments(t){const i=[],o=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let n=0,r;for(;(r=o.exec(t))!==null;){const u=t.slice(n,r.index).trim();u&&i.push({type:"text",content:u});const g=r[1];if(n=r.index+r[0].length,oe.COMMAND_TAGS.has(g))continue;const h=new RegExp(`^<${g}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${g}>$`),d=r[0].match(h),x=d?d[1].trim():r[0].trim();i.push({type:"system",content:x,label:g})}const m=t.slice(n).trim();return m&&i.push({type:"text",content:m}),i}static extractUserTexts(t){const i=[],o=[];let n=null;for(const r of t)if(r.role==="user"){if(typeof r.content=="string"){const m=r.content.trim();if(!m)continue;if(!fe(m)){if(/Implement the following plan:/i.test(m))continue;i.push(m),o.push(m)}}else if(Array.isArray(r.content)){const{commands:m,textBlocks:u}=qt(r.content);m.length>0&&(n=m[m.length-1]);const g=[];for(const d of u)/Implement the following plan:/i.test((d.text||"").trim())||g.push(d.text.trim());const h=r.content.filter(d=>{var x;return d.type==="text"&&((x=d.text)==null?void 0:x.trim())}).map(d=>d.text.trim());g.length>0&&(i.push(g.join(`
|
|
9
9
|
`)),o.push(h.join(`
|
|
10
10
|
`)))}}return{userMsgs:i,fullTexts:o,slashCmd:n}}extractUserPrompts(){var m;const{requests:t=[]}=this.props,i=[],o=new Set;let n=null;const r=t.filter(u=>Z(u));for(let u=0;u<r.length;u++){const g=r[u],h=((m=g.body)==null?void 0:m.messages)||[],d=g.timestamp||"",{userMsgs:x,fullTexts:C,slashCmd:j}=oe.extractUserTexts(h);j&&j!=="/compact"&&j!==n&&i.push({type:"prompt",segments:[{type:"text",content:j}],timestamp:d}),n=j;for(let p=0;p<x.length;p++){const _=x[p];if(o.has(_))continue;o.add(_);const b=C[p]||_;i.push({type:"prompt",segments:oe.parseSegments(b),timestamp:d})}}return i}renderTokenStats(){const{requests:t=[]}=this.props,{cacheHighlightIdx:i,cacheHighlightFading:o}=this.state;if(this._tokenStatsCache&&this._tokenStatsCacheReq===t&&this._tokenStatsCacheHl===i&&this._tokenStatsCacheFade===o)return this._tokenStatsCache;const n=zt(t),r=Object.keys(n),m=$t(t),u=Vt(t);if(r.length===0&&m.length===0)return e.jsx("div",{className:s.tokenStatsEmpty,children:"暂无 token 数据"});const g=e.jsx("div",{className:s.tokenStatsColumn,children:r.map(j=>{const p=n[j],_=p.input+p.cacheCreation+p.cacheRead,b=_>0?(p.cacheRead/_*100).toFixed(1):"0.0";return e.jsxs("div",{className:r.length>1?s.modelCardSpaced:s.modelCard,children:[e.jsx("div",{className:s.modelName,children:j}),e.jsx("table",{className:s.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:"Token"}),e.jsx("td",{className:s.th,children:"input"}),e.jsx("td",{className:s.th,children:"output"})]}),e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label}),e.jsx("td",{className:s.td,children:F(_)}),e.jsx("td",{className:s.td,children:F(p.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:"Cache"}),e.jsx("td",{className:s.th,children:"create"}),e.jsx("td",{className:s.th,children:"read"})]}),e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label}),e.jsx("td",{className:s.td,children:F(p.cacheCreation)}),e.jsx("td",{className:s.td,children:F(p.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:l("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:s.td,children:[b,"%"]})]})]})})]},j)})}),h=this.renderCacheRebuildStats(),d=m.length>0?e.jsx("div",{className:s.toolStatsColumn,children:e.jsxs("div",{className:s.modelCard,children:[e.jsx("div",{className:s.modelName,children:l("ui.toolUsageStats")}),e.jsxs("table",{className:s.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${s.th} ${s.thLeft}`,children:"Tool"}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[m.map(([j,p])=>e.jsxs("tr",{className:s.rowBorder,children:[e.jsxs("td",{className:s.label,children:[j," ",e.jsx(V,{doc:`Tool-${j}`})]}),e.jsx("td",{className:s.td,children:p})]},j)),m.length>1&&e.jsxs("tr",{className:s.rebuildTotalRow,children:[e.jsx("td",{className:s.label,children:"Total"}),e.jsx("td",{className:s.td,children:m.reduce((j,p)=>j+p[1],0)})]})]})]})]})}):null,x=u.length>0?e.jsx("div",{className:s.toolStatsColumn,children:e.jsxs("div",{className:s.modelCard,children:[e.jsx("div",{className:s.modelName,children:l("ui.skillUsageStats")}),e.jsxs("table",{className:s.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${s.th} ${s.thLeft}`,children:"Skill"}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[u.map(([j,p])=>e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label,children:j}),e.jsx("td",{className:s.td,children:p})]},j)),u.length>1&&e.jsxs("tr",{className:s.rebuildTotalRow,children:[e.jsx("td",{className:s.label,children:"Total"}),e.jsx("td",{className:s.td,children:u.reduce((j,p)=>j+p[1],0)})]})]})]})]})}):null,C=e.jsxs("div",{className:s.tokenStatsContainer,children:[g,h,d,x]});return this._tokenStatsCache=C,this._tokenStatsCacheReq=t,this._tokenStatsCacheHl=i,this._tokenStatsCacheFade=o,C}_cacheUnbindScrollFade(){this._cacheOnScrollFade&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scroll",this._cacheOnScrollFade),this._cacheOnScrollFade=null)}_cacheBindScrollFade(){this._cacheUnbindScrollFade();const t=this._cacheScrollEl;t&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},t.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(t){if(this.props.viewMode==="raw"&&this.props.onNavigateCacheMsg&&this.props.onNavigateCacheMsg(t),(this.state._cacheSectionCollapsed||{}).messages){this.setState(u=>({_cacheSectionCollapsed:{...u._cacheSectionCollapsed||{},messages:!1}}),()=>this.scrollToCacheMsg(t));return}const i=this._cacheScrollEl;if(!i)return;const o=i.querySelector(`[data-msg-idx="${t}"]`);if(!o)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&i.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let n=!1,r=!1;const m=()=>{!n||!r||(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=()=>{i.removeEventListener("scrollend",this._cacheScrollEndHandler),n=!0,m()},i.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{i.removeEventListener("scrollend",this._cacheScrollEndHandler),n=!0,m()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{r=!0,m()},500),o.scrollIntoView({behavior:"smooth",block:"center"})}renderCacheContentPopover(t){const{requests:i=[],serverCachedContent:o}=this.props,n=o||jt(i);if(n&&(n.cacheCreateTokens>0||n.cacheReadTokens>0)&&(this._lastCachedTokens={cacheCreateTokens:n.cacheCreateTokens,cacheReadTokens:n.cacheReadTokens}),t>0&&(this._lastContextPercent=t),!n||n.system.length===0&&n.messages.length===0&&n.tools.length===0)return e.jsx("div",{className:s.cachePopoverEmpty,children:l("ui.noCachedContent")});const r=(h,d,x,C)=>{if(d.length===0)return null;const j=h===l("ui.messages"),p=(this.state._cacheSectionCollapsed||{})[C],_=p!==void 0?!!p:!0,b=()=>this.setState(w=>({_cacheSectionCollapsed:{...w._cacheSectionCollapsed||{},[C]:!_}}));return e.jsxs("div",{className:s.cacheSection,children:[e.jsxs("button",{type:"button",className:s.cacheSectionTitle,onClick:b,"aria-expanded":!_,children:[e.jsx("span",{className:s.cacheSectionArrow,children:_?"▶":"▼"}),h," (",d.length,")"]}),!_&&d.map((w,L)=>{const S=j?{"data-msg-idx":L}:{};let T=x||s.cacheCodeBlock;const I=j&&L===this.state.cacheHighlightIdx;return I&&(T+=" "+(this.state.cacheHighlightFading?s.cacheBlockHighlightFading:s.cacheBlockHighlight)),e.jsxs("pre",{className:T,...S,style:I?{position:"relative"}:void 0,children:[I&&e.jsx("svg",{className:`${s.cacheBorderSvg}${this.state.cacheHighlightFading?" "+s.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:s.cacheBorderRect})}),w]},L)})]})},m=()=>{const h=[];return n.tools.length>0&&(h.push(`=== ${l("ui.tools")} (${n.tools.length}) ===`),n.tools.forEach(d=>h.push(d))),n.system.length>0&&(h.push(`
|
|
11
11
|
=== ${l("ui.systemPrompt")} (${n.system.length}) ===`),n.system.forEach(d=>h.push(d))),n.messages.length>0&&(h.push(`
|
|
@@ -28,4 +28,4 @@ var wt=Object.defineProperty;var Mt=(c,a,t)=>a in c?wt(c,a,{enumerable:!0,config
|
|
|
28
28
|
---
|
|
29
29
|
`).filter(j=>j.trim()).map(j=>{try{return JSON.parse(j)}catch{return null}}).filter(Boolean);m.push(...C),u.push(g.name)}catch{}r++,r===o.length&&this._finishLocalLoad(m,u)},h.readAsText(g)})},t.click()});M(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((m,u)=>m+u.size,0)>500*1024*1024){H.error(l("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let o=0;const n=[],r=[];t.forEach(m=>{const u=new FileReader;u.onload=g=>{try{const d=g.target.result.split(`
|
|
30
30
|
---
|
|
31
|
-
`).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);n.push(...d),r.push(m.name)}catch{}o++,o===t.length&&this._finishLocalLoad(n,r)},u.readAsText(m)})});M(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));M(this,"_onDragOver",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;if(t.target.closest&&t.target.closest("[data-file-explorer]")){this.state.isDragging&&this.setState({isDragging:!1});return}this.state.isDragging||this.setState({isDragging:!0})});M(this,"_onDragLeave",t=>{const i=this._layoutRef.current;i&&!i.contains(t.relatedTarget)&&this.setState({isDragging:!1})});M(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const i=Array.from(t.dataTransfer.files);i.length&&Promise.all(i.map(o=>Yt(o).then(n=>({name:o.name,path:n})).catch(n=>(H.error(`${o.name}: ${n.message}`),null)))).then(o=>{const n=o.filter(Boolean).map(r=>`"${r.path}"`);n.length>0&&this.setState(r=>({pendingUploadPaths:[...r.pendingUploadPaths||[],...n]}))})});M(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"context",pendingCacheHighlight:null})}componentDidMount(){super.componentDidMount(),this._mqlNarrow=window.matchMedia("(max-width: 600px)"),this._modeSwitchDialog=null,this._onNarrowChange=t=>{t.matches?this._modeSwitchDialog=X.confirm({title:l("ui.modeSwitchTitle"),content:l("ui.modeSwitchToSidebar"),okText:l("ui.ok"),onOk:()=>{this._modeSwitchDialog=null,es("pad")},onCancel:()=>{this._modeSwitchDialog=null}}):this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null)},this._mqlNarrow.addEventListener("change",this._onNarrowChange)}componentWillUnmount(){this._mqlNarrow&&this._mqlNarrow.removeEventListener("change",this._onNarrowChange),this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null),super.componentWillUnmount()}render(){const{filteredRequests:t,selectedRequest:i,fileLoading:o,fileLoadingCount:n,mainAgentSessions:r,viewMode:m}=this.renderPrepare(),{selectedIndex:u,leftPanelWidth:g,currentTab:h}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(Ft,{theme:this.themeConfig,children:[o&&e.jsx("div",{className:k.loadingOverlay,children:e.jsxs("div",{className:k.loadingText,children:["Loading...(",n,")"]})}),this.state.isDragging&&e.jsx("div",{className:k.dragOverlay,children:e.jsxs("div",{className:k.dragOverlayContent,children:[e.jsx(rt,{className:k.dragIcon}),e.jsx("p",{children:l("ui.dragDropHint")})]})}),e.jsxs(Be,{className:k.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Be.Header,{className:k.header,children:e.jsx(ke,{requestCount:t.length,requests:t,viewMode:m,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,showFullToolContent:this.state.showFullToolContent,onShowFullToolContentChange:this.handleShowFullToolContentChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,logDir:this.state.logDir,onLogDirChange:this.handleLogDirChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(d=>({terminalVisible:!d.terminalVisible})),onReturnToWorkspaces:this.state.cliMode?this.handleReturnToWorkspaces:null,contextWindow:this.state.contextWindow,onNavigateCacheMsg:this.handleNavigateCacheMsg,serverCachedContent:this.state.serverCachedContent||this._lastKvCacheContent,resumeAutoChoice:this.state.resumeAutoChoice,onResumeAutoChoiceToggle:this.handleResumeAutoChoiceToggle,onResumeAutoChoiceChange:this.handleResumeAutoChoiceChange,themeColor:this.state.themeColor,onThemeColorChange:this.handleThemeColorChange,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),this.state.claudeMissing&&e.jsx(Ht,{type:"warning",showIcon:!0,banner:!0,message:l("ui.claudeMissing.title"),description:e.jsxs("span",{children:[l("ui.claudeMissing.desc"),e.jsx("br",{}),e.jsx("code",{style:{background:"var(--bg-code)",padding:"2px 6px",borderRadius:3},children:"npm install -g @anthropic-ai/claude-code"})," ",e.jsx("span",{style:{color:"var(--text-muted)",margin:"0 4px"},children:l("ui.claudeMissing.or")})," ",e.jsx("a",{href:"https://claude.ai/download",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary-light)"},children:l("ui.claudeMissing.native")})]})}),e.jsxs(Be.Content,{className:k.content,children:[m==="raw"&&(t.length===0?e.jsx("div",{className:k.guideContainer,children:e.jsxs("div",{className:k.guideContent,children:[e.jsx("h2",{className:k.guideTitle,children:l("ui.guide.title")}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"1"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step1")}),e.jsx("code",{className:k.guideCode,children:l("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"2"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step2")}),e.jsx("code",{className:k.guideCode,children:l("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"3"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step3")}),e.jsx("code",{className:k.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:k.mainContainer,children:[e.jsxs("div",{className:k.leftPanel,style:{width:g},children:[e.jsxs("div",{className:k.leftPanelHeader,children:[e.jsx("span",{children:l("ui.requestList")}),e.jsx("span",{className:k.leftPanelCount,children:l("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:k.leftPanelBody,children:e.jsx(Xs,{requests:t,selectedIndex:u,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(Ni,{onResize:this.handleResize}),e.jsx("div",{className:k.rightPanel,children:e.jsx(_i,{request:i,requests:t,allRequests:this.state.requests,selectedIndex:u,currentTab:h,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:k.chatViewWrapper,style:{display:m==="chat"?"flex":"none"},children:e.jsx(Zt,{requests:t,mainAgentSessions:r,streamingLatest:this.state.streamingLatest,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,sdkMode:this._isLocalLog?!1:this.state.sdkMode,terminalVisible:this._isLocalLog||this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(d=>({terminalVisible:!d.terminalVisible})),pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:d=>this.loadSession(d),lang:this.state.lang,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange})})]}),e.jsx("div",{className:k.footer,children:e.jsxs("div",{className:k.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:k.footerLink,children:[e.jsx("svg",{className:k.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:k.footerSep,children:"|"}),e.jsxs("span",{className:`${k.footerVersion}${this.state.updateInfo?` ${k.footerVersionNew}`:""}`,onClick:()=>this.setState({updateModalVisible:!0}),style:{cursor:"pointer"},children:["v","1.6.181",this.state.updateInfo&&e.jsxs("svg",{className:k.newBadge,width:"28",height:"12",viewBox:"0 0 28 12",children:[e.jsx("rect",{width:"28",height:"12",rx:"3",fill:"currentColor",opacity:"0.25"}),e.jsx("text",{x:"14",y:"9",textAnchor:"middle",fill:"currentColor",fontSize:"8",fontWeight:"600",fontFamily:"system-ui",children:"NEW"})]})]})]})})]}),e.jsx(X,{title:l("ui.update.title"),open:this.state.updateModalVisible,onCancel:()=>this.setState({updateModalVisible:!1}),footer:null,width:480,children:e.jsxs("div",{style:{lineHeight:1.8},children:[e.jsxs("p",{children:[e.jsxs("strong",{children:[l("ui.update.current"),":"]})," v","1.6.181"]}),this.state.updateInfo&&e.jsxs("p",{children:[e.jsxs("strong",{children:[l("ui.update.latest"),":"]})," v",this.state.updateInfo.version]}),e.jsx("p",{style:{marginTop:12},children:e.jsx("strong",{children:l("ui.update.npm")})}),e.jsx("code",{style:{display:"block",background:"var(--bg-code)",padding:"8px 12px",borderRadius:6,fontSize:13},children:"npm update -g cc-viewer"}),typeof window<"u"&&window.electronAPI&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{marginTop:16},children:e.jsx("strong",{children:l("ui.update.electron")})}),e.jsx("p",{style:{color:"var(--text-tertiary)",fontSize:13},children:l("ui.update.electronDesc")}),e.jsxs("ol",{style:{color:"var(--text-tertiary)",fontSize:13,paddingLeft:20,margin:"6px 0"},children:[e.jsx("li",{children:l("ui.update.step1")}),e.jsx("li",{children:l("ui.update.step2")}),e.jsx("li",{children:l("ui.update.step3")})]})]}),e.jsx("div",{style:{marginTop:16,textAlign:"right"},children:e.jsx(E,{type:"primary",href:"https://github.com/weiesky/cc-viewer/releases",target:"_blank",rel:"noopener noreferrer",children:l("ui.update.goReleases")})})]})}),e.jsx(X,{title:l("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:k.resumeFooterRight,children:[e.jsx(E,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:k.btnMarginRight,children:l("ui.resume.continue")},"continue"),e.jsx(E,{onClick:()=>this.handleResumeChoice("new"),children:l("ui.resume.new")},"new")]}),e.jsx("div",{className:k.resumeFooterLeft,children:e.jsx(Pt,{checked:this.state.resumeRememberChoice,onChange:d=>this.setState({resumeRememberChoice:d.target.checked}),className:k.resumeCheckboxOpacity,children:e.jsx("span",{className:k.resumeCheckboxOpacity,children:l("ui.resume.remember")})})})]}),children:e.jsx("p",{children:l("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(X,{title:e.jsxs("span",{className:k.modalTitleInline,children:[e.jsx(yt,{apiEndpoint:K("/api/open-log-dir"),title:l("ui.openLogDir"),size:16}),l("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:k.modalActions,children:[e.jsx(E,{icon:e.jsx(rt,{}),onClick:this.handleLoadLocalJsonlFile,children:l("ui.loadLocalJsonl")}),e.jsx(E,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:k.btnMarginLeft,children:l("ui.mergeLogs")}),e.jsx(E,{size:"small",danger:!0,icon:e.jsx(He,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:k.btnMarginLeft,children:l("ui.deleteLogs")}),e.jsx(E,{size:"small",icon:e.jsx(Pe,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:k.btnMarginLeft,children:l("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:k.spinCenter,children:e.jsx(pt,{})}):(()=>{const d=this.state.localLogs[this.state.currentProject];return!d||d.length===0?e.jsx("div",{className:k.emptyCenter,children:l("ui.noLogs")}):e.jsx("div",{className:k.logListContainer,children:this.renderLogTable(d,!1)})})()]})]})}}export{Ai as default};
|
|
31
|
+
`).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);n.push(...d),r.push(m.name)}catch{}o++,o===t.length&&this._finishLocalLoad(n,r)},u.readAsText(m)})});M(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));M(this,"_onDragOver",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;if(t.target.closest&&t.target.closest("[data-file-explorer]")){this.state.isDragging&&this.setState({isDragging:!1});return}this.state.isDragging||this.setState({isDragging:!0})});M(this,"_onDragLeave",t=>{const i=this._layoutRef.current;i&&!i.contains(t.relatedTarget)&&this.setState({isDragging:!1})});M(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const i=Array.from(t.dataTransfer.files);i.length&&Promise.all(i.map(o=>Yt(o).then(n=>({name:o.name,path:n})).catch(n=>(H.error(`${o.name}: ${n.message}`),null)))).then(o=>{const n=o.filter(Boolean).map(r=>`"${r.path}"`);n.length>0&&this.setState(r=>({pendingUploadPaths:[...r.pendingUploadPaths||[],...n]}))})});M(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"context",pendingCacheHighlight:null})}componentDidMount(){super.componentDidMount(),this._mqlNarrow=window.matchMedia("(max-width: 600px)"),this._modeSwitchDialog=null,this._onNarrowChange=t=>{t.matches?this._modeSwitchDialog=X.confirm({title:l("ui.modeSwitchTitle"),content:l("ui.modeSwitchToSidebar"),okText:l("ui.ok"),onOk:()=>{this._modeSwitchDialog=null,es("pad")},onCancel:()=>{this._modeSwitchDialog=null}}):this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null)},this._mqlNarrow.addEventListener("change",this._onNarrowChange)}componentWillUnmount(){this._mqlNarrow&&this._mqlNarrow.removeEventListener("change",this._onNarrowChange),this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null),super.componentWillUnmount()}render(){const{filteredRequests:t,selectedRequest:i,fileLoading:o,fileLoadingCount:n,mainAgentSessions:r,viewMode:m}=this.renderPrepare(),{selectedIndex:u,leftPanelWidth:g,currentTab:h}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(Ft,{theme:this.themeConfig,children:[o&&e.jsx("div",{className:k.loadingOverlay,children:e.jsxs("div",{className:k.loadingText,children:["Loading...(",n,")"]})}),this.state.isDragging&&e.jsx("div",{className:k.dragOverlay,children:e.jsxs("div",{className:k.dragOverlayContent,children:[e.jsx(rt,{className:k.dragIcon}),e.jsx("p",{children:l("ui.dragDropHint")})]})}),e.jsxs(Be,{className:k.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Be.Header,{className:k.header,children:e.jsx(ke,{requestCount:t.length,requests:t,viewMode:m,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,showFullToolContent:this.state.showFullToolContent,onShowFullToolContentChange:this.handleShowFullToolContentChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,logDir:this.state.logDir,onLogDirChange:this.handleLogDirChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(d=>({terminalVisible:!d.terminalVisible})),onReturnToWorkspaces:this.state.cliMode?this.handleReturnToWorkspaces:null,contextWindow:this.state.contextWindow,onNavigateCacheMsg:this.handleNavigateCacheMsg,serverCachedContent:this.state.serverCachedContent||this._lastKvCacheContent,resumeAutoChoice:this.state.resumeAutoChoice,onResumeAutoChoiceToggle:this.handleResumeAutoChoiceToggle,onResumeAutoChoiceChange:this.handleResumeAutoChoiceChange,themeColor:this.state.themeColor,onThemeColorChange:this.handleThemeColorChange,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),this.state.claudeMissing&&e.jsx(Ht,{type:"warning",showIcon:!0,banner:!0,message:l("ui.claudeMissing.title"),description:e.jsxs("span",{children:[l("ui.claudeMissing.desc"),e.jsx("br",{}),e.jsx("code",{style:{background:"var(--bg-code)",padding:"2px 6px",borderRadius:3},children:"npm install -g @anthropic-ai/claude-code"})," ",e.jsx("span",{style:{color:"var(--text-muted)",margin:"0 4px"},children:l("ui.claudeMissing.or")})," ",e.jsx("a",{href:"https://claude.ai/download",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary-light)"},children:l("ui.claudeMissing.native")})]})}),e.jsxs(Be.Content,{className:k.content,children:[m==="raw"&&(t.length===0?e.jsx("div",{className:k.guideContainer,children:e.jsxs("div",{className:k.guideContent,children:[e.jsx("h2",{className:k.guideTitle,children:l("ui.guide.title")}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"1"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step1")}),e.jsx("code",{className:k.guideCode,children:l("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"2"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step2")}),e.jsx("code",{className:k.guideCode,children:l("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"3"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step3")}),e.jsx("code",{className:k.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:k.mainContainer,children:[e.jsxs("div",{className:k.leftPanel,style:{width:g},children:[e.jsxs("div",{className:k.leftPanelHeader,children:[e.jsx("span",{children:l("ui.requestList")}),e.jsx("span",{className:k.leftPanelCount,children:l("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:k.leftPanelBody,children:e.jsx(Xs,{requests:t,selectedIndex:u,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(Ni,{onResize:this.handleResize}),e.jsx("div",{className:k.rightPanel,children:e.jsx(_i,{request:i,requests:t,allRequests:this.state.requests,selectedIndex:u,currentTab:h,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:k.chatViewWrapper,style:{display:m==="chat"?"flex":"none"},children:e.jsx(Zt,{requests:t,mainAgentSessions:r,streamingLatest:this.state.streamingLatest,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,sdkMode:this._isLocalLog?!1:this.state.sdkMode,terminalVisible:this._isLocalLog||this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(d=>({terminalVisible:!d.terminalVisible})),pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:d=>this.loadSession(d),lang:this.state.lang,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange})})]}),e.jsx("div",{className:k.footer,children:e.jsxs("div",{className:k.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:k.footerLink,children:[e.jsx("svg",{className:k.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:k.footerSep,children:"|"}),e.jsxs("span",{className:`${k.footerVersion}${this.state.updateInfo?` ${k.footerVersionNew}`:""}`,onClick:()=>this.setState({updateModalVisible:!0}),style:{cursor:"pointer"},children:["v","1.6.182",this.state.updateInfo&&e.jsxs("svg",{className:k.newBadge,width:"28",height:"12",viewBox:"0 0 28 12",children:[e.jsx("rect",{width:"28",height:"12",rx:"3",fill:"currentColor",opacity:"0.25"}),e.jsx("text",{x:"14",y:"9",textAnchor:"middle",fill:"currentColor",fontSize:"8",fontWeight:"600",fontFamily:"system-ui",children:"NEW"})]})]})]})})]}),e.jsx(X,{title:l("ui.update.title"),open:this.state.updateModalVisible,onCancel:()=>this.setState({updateModalVisible:!1}),footer:null,width:480,children:e.jsxs("div",{style:{lineHeight:1.8},children:[e.jsxs("p",{children:[e.jsxs("strong",{children:[l("ui.update.current"),":"]})," v","1.6.182"]}),this.state.updateInfo&&e.jsxs("p",{children:[e.jsxs("strong",{children:[l("ui.update.latest"),":"]})," v",this.state.updateInfo.version]}),e.jsx("p",{style:{marginTop:12},children:e.jsx("strong",{children:l("ui.update.npm")})}),e.jsx("code",{style:{display:"block",background:"var(--bg-code)",padding:"8px 12px",borderRadius:6,fontSize:13},children:"npm update -g cc-viewer"}),typeof window<"u"&&window.electronAPI&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{marginTop:16},children:e.jsx("strong",{children:l("ui.update.electron")})}),e.jsx("p",{style:{color:"var(--text-tertiary)",fontSize:13},children:l("ui.update.electronDesc")}),e.jsxs("ol",{style:{color:"var(--text-tertiary)",fontSize:13,paddingLeft:20,margin:"6px 0"},children:[e.jsx("li",{children:l("ui.update.step1")}),e.jsx("li",{children:l("ui.update.step2")}),e.jsx("li",{children:l("ui.update.step3")})]})]}),e.jsx("div",{style:{marginTop:16,textAlign:"right"},children:e.jsx(E,{type:"primary",href:"https://github.com/weiesky/cc-viewer/releases",target:"_blank",rel:"noopener noreferrer",children:l("ui.update.goReleases")})})]})}),e.jsx(X,{title:l("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:k.resumeFooterRight,children:[e.jsx(E,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:k.btnMarginRight,children:l("ui.resume.continue")},"continue"),e.jsx(E,{onClick:()=>this.handleResumeChoice("new"),children:l("ui.resume.new")},"new")]}),e.jsx("div",{className:k.resumeFooterLeft,children:e.jsx(Pt,{checked:this.state.resumeRememberChoice,onChange:d=>this.setState({resumeRememberChoice:d.target.checked}),className:k.resumeCheckboxOpacity,children:e.jsx("span",{className:k.resumeCheckboxOpacity,children:l("ui.resume.remember")})})})]}),children:e.jsx("p",{children:l("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(X,{title:e.jsxs("span",{className:k.modalTitleInline,children:[e.jsx(yt,{apiEndpoint:K("/api/open-log-dir"),title:l("ui.openLogDir"),size:16}),l("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:k.modalActions,children:[e.jsx(E,{icon:e.jsx(rt,{}),onClick:this.handleLoadLocalJsonlFile,children:l("ui.loadLocalJsonl")}),e.jsx(E,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:k.btnMarginLeft,children:l("ui.mergeLogs")}),e.jsx(E,{size:"small",danger:!0,icon:e.jsx(He,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:k.btnMarginLeft,children:l("ui.deleteLogs")}),e.jsx(E,{size:"small",icon:e.jsx(Pe,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:k.btnMarginLeft,children:l("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:k.spinCenter,children:e.jsx(pt,{})}):(()=>{const d=this.state.localLogs[this.state.currentProject];return!d||d.length===0?e.jsx("div",{className:k.emptyCenter,children:l("ui.noLogs")}):e.jsx("div",{className:k.logListContainer,children:this.renderLogTable(d,!1)})})()]})]})}}export{Ai as default};
|