cx-viewer 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +28 -10
  2. package/cli.js +6 -20
  3. package/dist/assets/{App-B_TIw8e4.js → App-BN2YmKSu.js} +2 -2
  4. package/dist/assets/{AppHeader.module-Y8uZjbOm.js → AppHeader.module-CvH9GQQ2.js} +3 -3
  5. package/dist/assets/{Mobile-BMOIr-Ox.js → Mobile-CbC8YD3O.js} +1 -1
  6. package/dist/assets/{_baseUniq-rFMjvMp9.js → _baseUniq-B2ddYY2A.js} +1 -1
  7. package/dist/assets/{arc--Wq2RaH7.js → arc-DFPOHgcd.js} +1 -1
  8. package/dist/assets/{architectureDiagram-Q4EWVU46-BvEf2lP5.js → architectureDiagram-Q4EWVU46-1tuXixQv.js} +1 -1
  9. package/dist/assets/{blockDiagram-DXYQGD6D-OPovcZG5.js → blockDiagram-DXYQGD6D-BfVKQPAV.js} +1 -1
  10. package/dist/assets/{c4Diagram-AHTNJAMY-kgKyKOjo.js → c4Diagram-AHTNJAMY-Bua8O4-1.js} +1 -1
  11. package/dist/assets/channel-Cf9uPxYW.js +1 -0
  12. package/dist/assets/{chunk-4BX2VUAB-DzorV1it.js → chunk-4BX2VUAB-YOIkSNn_.js} +1 -1
  13. package/dist/assets/{chunk-4TB4RGXK-CqLZ1UMO.js → chunk-4TB4RGXK-CjZt-To5.js} +1 -1
  14. package/dist/assets/{chunk-55IACEB6-DSt0287z.js → chunk-55IACEB6-BAEfMF5S.js} +1 -1
  15. package/dist/assets/{chunk-EDXVE4YY-Ba5P02iy.js → chunk-EDXVE4YY-BUYDmLXU.js} +1 -1
  16. package/dist/assets/{chunk-FMBD7UC4-B74A73-h.js → chunk-FMBD7UC4-Cw_LDap-.js} +1 -1
  17. package/dist/assets/{chunk-OYMX7WX6-BAHzADpU.js → chunk-OYMX7WX6-PlfZFFxd.js} +1 -1
  18. package/dist/assets/{chunk-QZHKN3VN-BD8A_1ir.js → chunk-QZHKN3VN-C2ReFZl_.js} +1 -1
  19. package/dist/assets/{chunk-YZCP3GAM-ClWecwcp.js → chunk-YZCP3GAM-B7IVGkPB.js} +1 -1
  20. package/dist/assets/classDiagram-6PBFFD2Q-DdwVeNLZ.js +1 -0
  21. package/dist/assets/classDiagram-v2-HSJHXN6E-DdwVeNLZ.js +1 -0
  22. package/dist/assets/clone-C8Lz0121.js +1 -0
  23. package/dist/assets/{cose-bilkent-S5V4N54A-D_ghrbfg.js → cose-bilkent-S5V4N54A-M6rBKf0y.js} +1 -1
  24. package/dist/assets/{dagre-KV5264BT-CB0vROfS.js → dagre-KV5264BT-UPacTWnL.js} +1 -1
  25. package/dist/assets/{diagram-5BDNPKRD-BpcZ1UHM.js → diagram-5BDNPKRD-Cjjtnh0e.js} +1 -1
  26. package/dist/assets/{diagram-G4DWMVQ6-BrFuDts4.js → diagram-G4DWMVQ6-CjXILMP0.js} +1 -1
  27. package/dist/assets/{diagram-MMDJMWI5-CsU-BG3D.js → diagram-MMDJMWI5-C_-XZ9gc.js} +1 -1
  28. package/dist/assets/{diagram-TYMM5635-B1sb0AXF.js → diagram-TYMM5635-Dxe2GxUR.js} +1 -1
  29. package/dist/assets/{erDiagram-SMLLAGMA-CQyK2nOQ.js → erDiagram-SMLLAGMA-1w-wtgMd.js} +1 -1
  30. package/dist/assets/{flowDiagram-DWJPFMVM-DZBShvn4.js → flowDiagram-DWJPFMVM-B9naMGCj.js} +1 -1
  31. package/dist/assets/{ganttDiagram-T4ZO3ILL-m6fTKdLL.js → ganttDiagram-T4ZO3ILL-BPZBdhPv.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-UUTBAWPF-DkFErNFt.js → gitGraphDiagram-UUTBAWPF-_P9PdiGG.js} +1 -1
  33. package/dist/assets/{graph-bSi0W7jc.js → graph-CjOY8lRz.js} +1 -1
  34. package/dist/assets/{index-Br7dizB3.js → index-BcCW9op4.js} +2 -2
  35. package/dist/assets/{infoDiagram-42DDH7IO-CSm4RFl4.js → infoDiagram-42DDH7IO-Ch8SOTtq.js} +1 -1
  36. package/dist/assets/{ishikawaDiagram-UXIWVN3A-Bwg4bCOs.js → ishikawaDiagram-UXIWVN3A-XLscQrJT.js} +1 -1
  37. package/dist/assets/{journeyDiagram-VCZTEJTY-DPHJjuBf.js → journeyDiagram-VCZTEJTY-C3FQ_QPk.js} +1 -1
  38. package/dist/assets/{kanban-definition-6JOO6SKY-Cv9ev85o.js → kanban-definition-6JOO6SKY-DIQDTOi3.js} +1 -1
  39. package/dist/assets/{layout-Ds0a2T6Q.js → layout-DO9W0X_b.js} +1 -1
  40. package/dist/assets/{linear-Cp7l1b4X.js → linear-ClCJqwn1.js} +1 -1
  41. package/dist/assets/{mermaid.core-CqjmsXPZ.js → mermaid.core-BW02B1TS.js} +4 -4
  42. package/dist/assets/{min-Dt_Z0wyg.js → min-BuzClhio.js} +1 -1
  43. package/dist/assets/{mindmap-definition-QFDTVHPH-CX3dSqAw.js → mindmap-definition-QFDTVHPH-DuCaTeZu.js} +1 -1
  44. package/dist/assets/{pieDiagram-DEJITSTG-Dx1Yb4B1.js → pieDiagram-DEJITSTG-BZoZ6CI1.js} +1 -1
  45. package/dist/assets/{quadrantDiagram-34T5L4WZ-DuVKMvkU.js → quadrantDiagram-34T5L4WZ-DFNwvtmc.js} +1 -1
  46. package/dist/assets/{requirementDiagram-MS252O5E-D_k1MqxJ.js → requirementDiagram-MS252O5E-DPG-7raV.js} +1 -1
  47. package/dist/assets/{sankeyDiagram-XADWPNL6-Dd_dC8NM.js → sankeyDiagram-XADWPNL6-Bp92e1ie.js} +1 -1
  48. package/dist/assets/{sequenceDiagram-FGHM5R23-zK876LNJ.js → sequenceDiagram-FGHM5R23-C6ADwqJY.js} +1 -1
  49. package/dist/assets/{stateDiagram-FHFEXIEX-u5eiAg1J.js → stateDiagram-FHFEXIEX-BfrwZGmF.js} +1 -1
  50. package/dist/assets/stateDiagram-v2-QKLJ7IA2-4gBW7EPI.js +1 -0
  51. package/dist/assets/{timeline-definition-GMOUNBTQ-DR55BNQ6.js → timeline-definition-GMOUNBTQ-Bb-TxYx2.js} +1 -1
  52. package/dist/assets/{vennDiagram-DHZGUBPP-DYZc8vSs.js → vennDiagram-DHZGUBPP-DTRiNXJu.js} +1 -1
  53. package/dist/assets/{wardley-RL74JXVD-ofYR-6m2.js → wardley-RL74JXVD-C8j_kjXS.js} +1 -1
  54. package/dist/assets/{wardleyDiagram-NUSXRM2D-DnwarCdv.js → wardleyDiagram-NUSXRM2D-CvICMc3N.js} +1 -1
  55. package/dist/assets/{xychartDiagram-5P7HB3ND-1fCoOMAS.js → xychartDiagram-5P7HB3ND-DI0bBGwq.js} +1 -1
  56. package/dist/index.html +1 -1
  57. package/i18n.js +3 -3
  58. package/lib/cli-args.js +56 -0
  59. package/package.json +1 -1
  60. package/server.js +11 -9
  61. package/dist/assets/channel-73kvDnsL.js +0 -1
  62. package/dist/assets/classDiagram-6PBFFD2Q-eoMr9KbW.js +0 -1
  63. package/dist/assets/classDiagram-v2-HSJHXN6E-eoMr9KbW.js +0 -1
  64. package/dist/assets/clone-Dcc2YhiK.js +0 -1
  65. package/dist/assets/stateDiagram-v2-QKLJ7IA2-D0bdvVZJ.js +0 -1
package/README.md CHANGED
@@ -19,25 +19,34 @@ npm install -g cx-viewer --registry=https://registry.npmjs.org
19
19
 
20
20
  ### Programming Mode
21
21
 
22
- cxv is a drop-in replacement for codex all arguments are passed through to codex while launching the Web Viewer.
22
+ `cxv` launches the Web Viewer and then forwards the real Codex CLI surface through unchanged. CXV only adds a few wrapper features of its own:
23
+
24
+ - `cxv continue` is a convenience alias for `codex resume --last`
25
+ - `cxv --d` is a convenience alias for `codex --dangerously-bypass-approvals-and-sandbox`
26
+ - `cxv --ad` is a legacy compatibility flag kept only for CXV-side bypass toggles
27
+
28
+ Everything else should be treated as standard Codex CLI syntax.
23
29
 
24
30
  ```bash
25
- cxv # == codex (interactive mode)
26
- cxv -c # == codex --continue (continue last conversation)
27
- cxv -r # == codex --resume (resume a conversation)
28
- cxv -p "hello" # == codex --print "hello" (print mode)
29
- cxv --d # == codex --dangerously-skip-permissions (shortcut)
30
- cxv --model opus # == codex --model opus
31
+ cxv # == codex (interactive mode)
32
+ cxv continue # == codex resume --last
33
+ cxv resume --last # == codex resume --last
34
+ cxv -c 'model="gpt-5.5"' # == codex -c 'model="gpt-5.5"'
35
+ cxv exec "summarize this repo" # == codex exec "summarize this repo"
36
+ cxv review # == codex review
37
+ cxv --search --model gpt-5.5 # == codex --search --model gpt-5.5
38
+ cxv --d # == codex --dangerously-bypass-approvals-and-sandbox
31
39
  ```
32
40
 
33
41
  The author's most-used command is:
34
- ```
35
- cxv -c --d # == codex --continue --dangerously-skip-permissions
42
+
43
+ ```bash
44
+ cxv continue --d
36
45
  ```
37
46
 
38
47
  After launching in programming mode, a web page will open automatically.
39
48
 
40
- You can use Claude directly from the web page while viewing the full request payloads and code changes.
49
+ You can use Codex directly from the web page while viewing the full request payloads and code changes.
41
50
 
42
51
  Even better — you can even code from your mobile device!
43
52
 
@@ -90,6 +99,15 @@ See:
90
99
  cxv -h
91
100
  ```
92
101
 
102
+ The most useful inherited Codex commands in CXV are:
103
+
104
+ - `cxv resume [session-id]`
105
+ - `cxv exec [prompt]`
106
+ - `cxv review`
107
+ - `cxv -c key=value`
108
+ - `cxv --search`
109
+ - `cxv -C <dir>`
110
+
93
111
  ### Configuration Override
94
112
 
95
113
  If you need to use a custom API endpoint (e.g., a corporate proxy), simply configure it in `~/.codex/settings.json` or set the `OPENAI_BASE_URL` environment variable. `cxv` will automatically detect and correctly forward requests.
package/cli.js CHANGED
@@ -10,6 +10,7 @@ import { homedir } from 'node:os';
10
10
  import { spawn } from 'node:child_process';
11
11
  import { t } from './i18n.js';
12
12
  import { INJECT_IMPORT, resolveCliPath, resolveNativePath, resolveNpmCodexPath, buildShellCandidates } from './findcx.js';
13
+ import { normalizeCodexArgs, hasBypassPermissions } from './lib/cli-args.js';
13
14
  import { ensureHooks } from './lib/ensure-hooks.js';
14
15
 
15
16
  const __dirname = fileURLToPath(new URL('.', import.meta.url));
@@ -269,8 +270,8 @@ async function runCliMode(extraCodexArgs = [], cwd) {
269
270
  // 2. 设置 CLI 模式标记
270
271
  process.env.CXV_CLI_MODE = '1';
271
272
  process.env.CXV_PROJECT_DIR = workingDir;
272
- // 当 --dangerously-skip-permissions 生效时,通知 perm-bridge 不要拦截
273
- if (extraCodexArgs.includes('--dangerously-skip-permissions')) {
273
+ // 当 bypass 模式生效时,通知 perm-bridge 不要拦截
274
+ if (hasBypassPermissions(extraCodexArgs)) {
274
275
  process.env.CXV_BYPASS_PERMISSIONS = '1';
275
276
  }
276
277
 
@@ -426,10 +427,8 @@ async function runSdkMode(extraCodexArgs = [], cwd) {
426
427
  const { basename } = await import('node:path');
427
428
 
428
429
  // 解析 permission mode from CLI args
429
- // --d / --dangerously-skip-permissions → bypassPermissions(跳过所有权限检查)
430
- // --ad / --allow-dangerously-skip-permissions → default(只是允许用户后续切换,不立即跳过)
431
430
  let permissionMode = 'default';
432
- if (extraCodexArgs.includes('--dangerously-skip-permissions')) {
431
+ if (hasBypassPermissions(extraCodexArgs)) {
433
432
  permissionMode = 'bypassPermissions';
434
433
  }
435
434
 
@@ -705,11 +704,7 @@ if (args[0] === 'run') {
705
704
  runProxyCommand(args);
706
705
  } else if (args.includes('-SDK') || args.includes('--sdk')) {
707
706
  // SDK 模式(显式 -SDK 切换)
708
- let codexArgs = args.filter(a => a !== '-SDK' && a !== '--sdk')
709
- .map(a => a === '--d' ? '--dangerously-skip-permissions' : a === '--ad' ? '--allow-dangerously-skip-permissions' : a);
710
-
711
- // 处理 codex 不支持的 -c/--continue 参数(codex 使用 resume 子命令)
712
- codexArgs = codexArgs.filter(a => a !== '-c' && a !== '--continue');
707
+ const { codexArgs } = normalizeCodexArgs(args.filter(a => a !== '-SDK' && a !== '--sdk'));
713
708
 
714
709
  runSdkMode(codexArgs, process.cwd()).catch(err => {
715
710
  console.error('SDK mode error:', err);
@@ -717,16 +712,7 @@ if (args[0] === 'run') {
717
712
  });
718
713
  } else {
719
714
  // PTY 模式(默认)
720
- // -c/--continue 转换为 codex 的 resume 子命令
721
- let codexArgs = args.map(a => a === '--d' ? '--dangerously-skip-permissions' : a === '--ad' ? '--allow-dangerously-skip-permissions' : a);
722
-
723
- // 处理 codex 不支持的 -c/--continue 参数
724
- const hasContinue = codexArgs.includes('-c') || codexArgs.includes('--continue');
725
- codexArgs = codexArgs.filter(a => a !== '-c' && a !== '--continue');
726
-
727
- // 如果用户想继续会话,在 codex 中使用 resume 子命令
728
- // 但子命令需要在参数列表开头,所以我们不能直接添加
729
- // 暂时忽略 -c 参数,codex 会自动恢复最近的会话
715
+ const { codexArgs } = normalizeCodexArgs(args);
730
716
 
731
717
  runCliMode(codexArgs, process.cwd()).catch(err => {
732
718
  console.error('CLI mode error:', err);
@@ -1,4 +1,4 @@
1
- var Bs=Object.defineProperty;var Os=(n,s,t)=>s in n?Bs(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var B=(n,s,t)=>Os(n,typeof s!="symbol"?s+"":s,t);import{r as v,R as U,j as e,b as Ds}from"./index-Br7dizB3.js";import{g as Zt,r as $s,u as Re,V as dt,c as se,W as at,d as xt,X as es,Y as Fs,Z as Hs,$ as zs,a0 as Vs,a1 as qs,a2 as ts,a3 as Tt,a4 as Us,a5 as Ws,a6 as Ks,a7 as Gs,a8 as Js,a9 as Qs,aa as Xs,_ as le,ab as Ys,ac as vt,ad as _e,ae as Mt,af as mt,ag as Et,ah as Zs,ai as ea,aj as Rt,ak as ta,m as sa,al as aa,am as na,an as oa,ao as ia,ap as la,aq as ra,ar as It,C as wt,I as be,as as ca,at as ss,au as da,av as as,aw as ha,ax as ua,ay as ma,e as de,t as m,w as Je,x as pa,y as Te,j as ga,k as fa,l as xa,s as c,v as G,q as he,az as ns,aA as Ie,aB as K,P as Ae,aC as qe,n as va,aD as ya,o as Qe,aE as ja,aF as je,S as os,aG as Be,aH as Ca,aI as Ce,aJ as Lt,B as F,N as Me,aK as Ee,Q as ba,aL as is,aM as Ye,aN as Na,aO as Sa,L as nt,aP as Pt,M as yt,aQ as _a,O as ls,aR as wa,aS as ka,aT as Le,aU as At,aV as Ta,aW as Bt,aX as rs,aY as cs,aZ as De,a_ as $e,a$ as ds,b0 as pt,b1 as Ot,b2 as Dt,b3 as $t,b4 as Ma,b5 as Ea,A as Ra,b6 as Ze,b7 as Ft,b8 as Ia,D as La,z as R,E as Pa,b9 as Aa}from"./AppHeader.module-Y8uZjbOm.js";const et=(n,s,t,a,r)=>({background:n,border:`${Re(a.lineWidth)} ${a.lineType} ${s}`,[`${r}-icon`]:{color:t}}),Ba=n=>{const{componentCls:s,motionDurationSlow:t,marginXS:a,marginSM:r,fontSize:o,fontSizeLG:u,lineHeight:g,borderRadiusLG:i,motionEaseInOutCirc:h,withDescriptionIconSize:l,colorText:d,colorTextHeading:p,withDescriptionPadding:y,defaultPadding:x}=n;return{[s]:Object.assign(Object.assign({},$s(n)),{position:"relative",display:"flex",alignItems:"center",padding:x,wordWrap:"break-word",borderRadius:i,[`&${s}-rtl`]:{direction:"rtl"},[`${s}-content`]:{flex:1,minWidth:0},[`${s}-icon`]:{marginInlineEnd:a,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:g},"&-message":{color:p},[`&${s}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${t} ${h}, opacity ${t} ${h},
1
+ var Bs=Object.defineProperty;var Os=(n,s,t)=>s in n?Bs(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var B=(n,s,t)=>Os(n,typeof s!="symbol"?s+"":s,t);import{r as v,R as U,j as e,b as Ds}from"./index-BcCW9op4.js";import{g as Zt,r as $s,u as Re,V as dt,c as se,W as at,d as xt,X as es,Y as Fs,Z as Hs,$ as zs,a0 as Vs,a1 as qs,a2 as ts,a3 as Tt,a4 as Us,a5 as Ws,a6 as Ks,a7 as Gs,a8 as Js,a9 as Qs,aa as Xs,_ as le,ab as Ys,ac as vt,ad as _e,ae as Mt,af as mt,ag as Et,ah as Zs,ai as ea,aj as Rt,ak as ta,m as sa,al as aa,am as na,an as oa,ao as ia,ap as la,aq as ra,ar as It,C as wt,I as be,as as ca,at as ss,au as da,av as as,aw as ha,ax as ua,ay as ma,e as de,t as m,w as Je,x as pa,y as Te,j as ga,k as fa,l as xa,s as c,v as G,q as he,az as ns,aA as Ie,aB as K,P as Ae,aC as qe,n as va,aD as ya,o as Qe,aE as ja,aF as je,S as os,aG as Be,aH as Ca,aI as Ce,aJ as Lt,B as F,N as Me,aK as Ee,Q as ba,aL as is,aM as Ye,aN as Na,aO as Sa,L as nt,aP as Pt,M as yt,aQ as _a,O as ls,aR as wa,aS as ka,aT as Le,aU as At,aV as Ta,aW as Bt,aX as rs,aY as cs,aZ as De,a_ as $e,a$ as ds,b0 as pt,b1 as Ot,b2 as Dt,b3 as $t,b4 as Ma,b5 as Ea,A as Ra,b6 as Ze,b7 as Ft,b8 as Ia,D as La,z as R,E as Pa,b9 as Aa}from"./AppHeader.module-CvH9GQQ2.js";const et=(n,s,t,a,r)=>({background:n,border:`${Re(a.lineWidth)} ${a.lineType} ${s}`,[`${r}-icon`]:{color:t}}),Ba=n=>{const{componentCls:s,motionDurationSlow:t,marginXS:a,marginSM:r,fontSize:o,fontSizeLG:u,lineHeight:g,borderRadiusLG:i,motionEaseInOutCirc:h,withDescriptionIconSize:l,colorText:d,colorTextHeading:p,withDescriptionPadding:y,defaultPadding:x}=n;return{[s]:Object.assign(Object.assign({},$s(n)),{position:"relative",display:"flex",alignItems:"center",padding:x,wordWrap:"break-word",borderRadius:i,[`&${s}-rtl`]:{direction:"rtl"},[`${s}-content`]:{flex:1,minWidth:0},[`${s}-icon`]:{marginInlineEnd:a,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:g},"&-message":{color:p},[`&${s}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${t} ${h}, opacity ${t} ${h},
2
2
  padding-top ${t} ${h}, padding-bottom ${t} ${h},
3
3
  margin-bottom ${t} ${h}`},[`&${s}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${s}-with-description`]:{alignItems:"flex-start",padding:y,[`${s}-icon`]:{marginInlineEnd:r,fontSize:l,lineHeight:0},[`${s}-message`]:{display:"block",marginBottom:a,color:p,fontSize:u},[`${s}-description`]:{display:"block",color:d}},[`${s}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},Oa=n=>{const{componentCls:s,colorSuccess:t,colorSuccessBorder:a,colorSuccessBg:r,colorWarning:o,colorWarningBorder:u,colorWarningBg:g,colorError:i,colorErrorBorder:h,colorErrorBg:l,colorInfo:d,colorInfoBorder:p,colorInfoBg:y}=n;return{[s]:{"&-success":et(r,a,t,n,s),"&-info":et(y,p,d,n,s),"&-warning":et(g,u,o,n,s),"&-error":Object.assign(Object.assign({},et(l,h,i,n,s)),{[`${s}-description > pre`]:{margin:0,padding:0}})}}},Da=n=>{const{componentCls:s,iconCls:t,motionDurationMid:a,marginXS:r,fontSizeIcon:o,colorIcon:u,colorIconHover:g}=n;return{[s]:{"&-action":{marginInlineStart:r},[`${s}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:o,lineHeight:Re(o),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${t}-close`]:{color:u,transition:`color ${a}`,"&:hover":{color:g}}},"&-close-text":{color:u,transition:`color ${a}`,"&:hover":{color:g}}}}},$a=n=>({withDescriptionIconSize:n.fontSizeHeading3,defaultPadding:`${n.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${n.paddingMD}px ${n.paddingContentHorizontalLG}px`}),Fa=Zt("Alert",n=>[Ba(n),Oa(n),Da(n)],$a);var Ht=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(n);r<a.length;r++)s.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(n,a[r])&&(t[a[r]]=n[a[r]]);return t};const Ha={success:qs,info:Vs,error:zs,warning:Hs},za=n=>{const{icon:s,prefixCls:t,type:a}=n,r=Ha[a]||null;return s?Fs(s,v.createElement("span",{className:`${t}-icon`},s),()=>({className:se(`${t}-icon`,s.props.className)})):v.createElement(r,{className:`${t}-icon`})},Va=n=>{const{isClosable:s,prefixCls:t,closeIcon:a,handleClose:r,ariaProps:o}=n,u=a===!0||a===void 0?v.createElement(ts,null):a;return s?v.createElement("button",Object.assign({type:"button",onClick:r,className:`${t}-close-icon`,tabIndex:0},o),u):null},hs=v.forwardRef((n,s)=>{const{description:t,prefixCls:a,message:r,banner:o,className:u,rootClassName:g,style:i,onMouseEnter:h,onMouseLeave:l,onClick:d,afterClose:p,showIcon:y,closable:x,closeText:j,closeIcon:f,action:C,id:w}=n,S=Ht(n,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[M,_]=v.useState(!1),T=v.useRef(null);v.useImperativeHandle(s,()=>({nativeElement:T.current}));const{getPrefixCls:I,direction:L,closable:E,closeIcon:P,className:D,style:ae}=dt("alert"),H=I("alert",a),[A,J,re]=Fa(H),Y=ee=>{var b;_(!0),(b=n.onClose)===null||b===void 0||b.call(n,ee)},ue=v.useMemo(()=>n.type!==void 0?n.type:o?"warning":"info",[n.type,o]),oe=v.useMemo(()=>typeof x=="object"&&x.closeIcon||j?!0:typeof x=="boolean"?x:f!==!1&&f!==null&&f!==void 0?!0:!!E,[j,f,x,E]),ce=o&&y===void 0?!0:y,W=se(H,`${H}-${ue}`,{[`${H}-with-description`]:!!t,[`${H}-no-icon`]:!ce,[`${H}-banner`]:!!o,[`${H}-rtl`]:L==="rtl"},D,u,g,re,J),ge=at(S,{aria:!0,data:!0}),ne=v.useMemo(()=>typeof x=="object"&&x.closeIcon?x.closeIcon:j||(f!==void 0?f:typeof E=="object"&&E.closeIcon?E.closeIcon:P),[f,x,E,j,P]),ve=v.useMemo(()=>{const ee=x??E;if(typeof ee=="object"){const{closeIcon:b}=ee;return Ht(ee,["closeIcon"])}return{}},[x,E]);return A(v.createElement(xt,{visible:!M,motionName:`${H}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:ee=>({maxHeight:ee.offsetHeight}),onLeaveEnd:p},({className:ee,style:b},Q)=>v.createElement("div",Object.assign({id:w,ref:es(T,Q),"data-show":!M,className:se(W,ee),style:Object.assign(Object.assign(Object.assign({},ae),i),b),onMouseEnter:h,onMouseLeave:l,onClick:d,role:"alert"},ge),ce?v.createElement(za,{description:t,icon:n.icon,prefixCls:H,type:ue}):null,v.createElement("div",{className:`${H}-content`},r?v.createElement("div",{className:`${H}-message`},r):null,t?v.createElement("div",{className:`${H}-description`},t):null),C?v.createElement("div",{className:`${H}-action`},C):null,v.createElement(Va,{isClosable:oe,prefixCls:H,closeIcon:ne,handleClose:Y,ariaProps:ve}))))});function qa(n,s,t){return s=Tt(s),Us(n,Ws()?Reflect.construct(s,t||[],Tt(n).constructor):s.apply(n,t))}let Ua=(function(n){function s(){var t;return Js(this,s),t=qa(this,s,arguments),t.state={error:void 0,info:{componentStack:""}},t}return Ks(s,n),Gs(s,[{key:"componentDidCatch",value:function(a,r){this.setState({error:a,info:r})}},{key:"render",value:function(){const{message:a,description:r,id:o,children:u}=this.props,{error:g,info:i}=this.state,h=(i==null?void 0:i.componentStack)||null,l=typeof a>"u"?(g||"").toString():a,d=typeof r>"u"?h:r;return g?v.createElement(hs,{id:o,type:"error",message:l,description:v.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},d)}):u}}])})(v.Component);const us=hs;us.ErrorBoundary=Ua;var zt=v.createContext(null),ms=v.createContext({}),Wa=["prefixCls","className","containerRef"],Ka=function(s){var t=s.prefixCls,a=s.className,r=s.containerRef,o=Qs(s,Wa),u=v.useContext(ms),g=u.panel,i=Xs(g,r);return v.createElement("div",le({className:se("".concat(t,"-content"),a),role:"dialog",ref:i},at(s,{aria:!0}),{"aria-modal":"true"},o))};function Vt(n){return typeof n=="string"&&String(Number(n))===n?(Ys(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(n)):n}var qt={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Ga(n,s){var t,a,r,o=n.prefixCls,u=n.open,g=n.placement,i=n.inline,h=n.push,l=n.forceRender,d=n.autoFocus,p=n.keyboard,y=n.classNames,x=n.rootClassName,j=n.rootStyle,f=n.zIndex,C=n.className,w=n.id,S=n.style,M=n.motion,_=n.width,T=n.height,I=n.children,L=n.mask,E=n.maskClosable,P=n.maskMotion,D=n.maskClassName,ae=n.maskStyle,H=n.afterOpenChange,A=n.onClose,J=n.onMouseEnter,re=n.onMouseOver,Y=n.onMouseLeave,ue=n.onClick,oe=n.onKeyDown,ce=n.onKeyUp,W=n.styles,ge=n.drawerRender,ne=v.useRef(),ve=v.useRef(),ee=v.useRef();v.useImperativeHandle(s,function(){return ne.current});var b=function(xe){var He=xe.keyCode,ze=xe.shiftKey;switch(He){case mt.TAB:{if(He===mt.TAB){if(!ze&&document.activeElement===ee.current){var Ve;(Ve=ve.current)===null||Ve===void 0||Ve.focus({preventScroll:!0})}else if(ze&&document.activeElement===ve.current){var ut;(ut=ee.current)===null||ut===void 0||ut.focus({preventScroll:!0})}}break}case mt.ESC:{A&&p&&(xe.stopPropagation(),A(xe));break}}};v.useEffect(function(){if(u&&d){var Z;(Z=ne.current)===null||Z===void 0||Z.focus({preventScroll:!0})}},[u]);var Q=v.useState(!1),te=vt(Q,2),Ne=te[0],Se=te[1],q=v.useContext(zt),we;typeof h=="boolean"?we=h?{}:{distance:0}:we=h||{};var ye=(t=(a=(r=we)===null||r===void 0?void 0:r.distance)!==null&&a!==void 0?a:q==null?void 0:q.pushDistance)!==null&&t!==void 0?t:180,Xe=v.useMemo(function(){return{pushDistance:ye,push:function(){Se(!0)},pull:function(){Se(!1)}}},[ye]);v.useEffect(function(){if(u){var Z;q==null||(Z=q.push)===null||Z===void 0||Z.call(q)}else{var xe;q==null||(xe=q.pull)===null||xe===void 0||xe.call(q)}},[u]),v.useEffect(function(){return function(){var Z;q==null||(Z=q.pull)===null||Z===void 0||Z.call(q)}},[]);var fe=v.createElement(xt,le({key:"mask"},P,{visible:L&&u}),function(Z,xe){var He=Z.className,ze=Z.style;return v.createElement("div",{className:se("".concat(o,"-mask"),He,y==null?void 0:y.mask,D),style:_e(_e(_e({},ze),ae),W==null?void 0:W.mask),onClick:E&&u?A:void 0,ref:xe})}),ie=typeof M=="function"?M(g):M,$={};if(Ne&&ye)switch(g){case"top":$.transform="translateY(".concat(ye,"px)");break;case"bottom":$.transform="translateY(".concat(-ye,"px)");break;case"left":$.transform="translateX(".concat(ye,"px)");break;default:$.transform="translateX(".concat(-ye,"px)");break}g==="left"||g==="right"?$.width=Vt(_):$.height=Vt(T);var me={onMouseEnter:J,onMouseOver:re,onMouseLeave:Y,onClick:ue,onKeyDown:oe,onKeyUp:ce},ke=v.createElement(xt,le({key:"panel"},ie,{visible:u,forceRender:l,onVisibleChanged:function(xe){H==null||H(xe)},removeOnLeave:!1,leavedClassName:"".concat(o,"-content-wrapper-hidden")}),function(Z,xe){var He=Z.className,ze=Z.style,Ve=v.createElement(Ka,le({id:w,containerRef:xe,prefixCls:o,className:se(C,y==null?void 0:y.content),style:_e(_e({},S),W==null?void 0:W.content)},at(n,{aria:!0}),me),I);return v.createElement("div",le({className:se("".concat(o,"-content-wrapper"),y==null?void 0:y.wrapper,He),style:_e(_e(_e({},$),ze),W==null?void 0:W.wrapper)},at(n,{data:!0})),ge?ge(Ve):Ve)}),We=_e({},j);return f&&(We.zIndex=f),v.createElement(zt.Provider,{value:Xe},v.createElement("div",{className:se(o,"".concat(o,"-").concat(g),x,Mt(Mt({},"".concat(o,"-open"),u),"".concat(o,"-inline"),i)),style:We,tabIndex:-1,ref:ne,onKeyDown:b},fe,v.createElement("div",{tabIndex:0,ref:ve,style:qt,"aria-hidden":"true","data-sentinel":"start"}),ke,v.createElement("div",{tabIndex:0,ref:ee,style:qt,"aria-hidden":"true","data-sentinel":"end"})))}var Ja=v.forwardRef(Ga),Qa=function(s){var t=s.open,a=t===void 0?!1:t,r=s.prefixCls,o=r===void 0?"rc-drawer":r,u=s.placement,g=u===void 0?"right":u,i=s.autoFocus,h=i===void 0?!0:i,l=s.keyboard,d=l===void 0?!0:l,p=s.width,y=p===void 0?378:p,x=s.mask,j=x===void 0?!0:x,f=s.maskClosable,C=f===void 0?!0:f,w=s.getContainer,S=s.forceRender,M=s.afterOpenChange,_=s.destroyOnClose,T=s.onMouseEnter,I=s.onMouseOver,L=s.onMouseLeave,E=s.onClick,P=s.onKeyDown,D=s.onKeyUp,ae=s.panelRef,H=v.useState(!1),A=vt(H,2),J=A[0],re=A[1],Y=v.useState(!1),ue=vt(Y,2),oe=ue[0],ce=ue[1];Et(function(){ce(!0)},[]);var W=oe?a:!1,ge=v.useRef(),ne=v.useRef();Et(function(){W&&(ne.current=document.activeElement)},[W]);var ve=function(Ne){var Se;if(re(Ne),M==null||M(Ne),!Ne&&ne.current&&!((Se=ge.current)!==null&&Se!==void 0&&Se.contains(ne.current))){var q;(q=ne.current)===null||q===void 0||q.focus({preventScroll:!0})}},ee=v.useMemo(function(){return{panel:ae}},[ae]);if(!S&&!J&&!W&&_)return null;var b={onMouseEnter:T,onMouseOver:I,onMouseLeave:L,onClick:E,onKeyDown:P,onKeyUp:D},Q=_e(_e({},s),{},{open:W,prefixCls:o,placement:g,autoFocus:h,keyboard:d,width:y,mask:j,maskClosable:C,inline:w===!1,afterOpenChange:ve,ref:ge},b);return v.createElement(ms.Provider,{value:ee},v.createElement(Zs,{open:W||S||J,autoDestroy:!1,getContainer:w,autoLock:j&&(W||J)},v.createElement(Ja,Q)))};const ps=n=>{var s,t;const{prefixCls:a,ariaId:r,title:o,footer:u,extra:g,closable:i,loading:h,onClose:l,headerStyle:d,bodyStyle:p,footerStyle:y,children:x,classNames:j,styles:f}=n,C=dt("drawer");let w;i===!1?w=void 0:i===void 0||i===!0?w="start":w=(i==null?void 0:i.placement)==="end"?"end":"start";const S=v.useCallback(L=>v.createElement("button",{type:"button",onClick:l,className:se(`${a}-close`,{[`${a}-close-${w}`]:w==="end"})},L),[l,a,w]),[M,_]=ea(Rt(n),Rt(C),{closable:!0,closeIconRender:S}),T=()=>{var L,E;return!o&&!M?null:v.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(L=C.styles)===null||L===void 0?void 0:L.header),d),f==null?void 0:f.header),className:se(`${a}-header`,{[`${a}-header-close-only`]:M&&!o&&!g},(E=C.classNames)===null||E===void 0?void 0:E.header,j==null?void 0:j.header)},v.createElement("div",{className:`${a}-header-title`},w==="start"&&_,o&&v.createElement("div",{className:`${a}-title`,id:r},o)),g&&v.createElement("div",{className:`${a}-extra`},g),w==="end"&&_)},I=()=>{var L,E;if(!u)return null;const P=`${a}-footer`;return v.createElement("div",{className:se(P,(L=C.classNames)===null||L===void 0?void 0:L.footer,j==null?void 0:j.footer),style:Object.assign(Object.assign(Object.assign({},(E=C.styles)===null||E===void 0?void 0:E.footer),y),f==null?void 0:f.footer)},u)};return v.createElement(v.Fragment,null,T(),v.createElement("div",{className:se(`${a}-body`,j==null?void 0:j.body,(s=C.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=C.styles)===null||t===void 0?void 0:t.body),p),f==null?void 0:f.body)},h?v.createElement(ta,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):x),I())},Xa=n=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[n]},gs=(n,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},n),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":n})}),fs=(n,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},gs({opacity:n},{opacity:1})),Ya=(n,s)=>[fs(.7,s),gs({transform:Xa(n)},{transform:"none"})],Za=n=>{const{componentCls:s,motionDurationSlow:t}=n;return{[s]:{[`${s}-mask-motion`]:fs(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((a,r)=>Object.assign(Object.assign({},a),{[`&-${r}`]:Ya(r,t)}),{})}}},en=n=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:a,colorBgMask:r,colorBgElevated:o,motionDurationSlow:u,motionDurationMid:g,paddingXS:i,padding:h,paddingLG:l,fontSizeLG:d,lineHeightLG:p,lineWidth:y,lineType:x,colorSplit:j,marginXS:f,colorIcon:C,colorIconHover:w,colorBgTextHover:S,colorBgTextActive:M,colorText:_,fontWeightStrong:T,footerPaddingBlock:I,footerPaddingInline:L,calc:E}=n,P=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:a,pointerEvents:"none",color:_,"&-pure":{position:"relative",background:o,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:n.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:n.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:n.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:n.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:a,background:r,pointerEvents:"auto"},[P]:{position:"absolute",zIndex:a,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${P}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:n.boxShadowDrawerLeft},[`&-right > ${P}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:n.boxShadowDrawerRight},[`&-top > ${P}`]:{top:0,insetInline:0,boxShadow:n.boxShadowDrawerUp},[`&-bottom > ${P}`]:{bottom:0,insetInline:0,boxShadow:n.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:o,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Re(h)} ${Re(l)}`,fontSize:d,lineHeight:p,borderBottom:`${Re(y)} ${x} ${j}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:E(d).add(i).equal(),height:E(d).add(i).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:C,fontWeight:T,fontSize:d,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${g}`,textRendering:"auto",[`&${t}-close-end`]:{marginInlineStart:f},[`&:not(${t}-close-end)`]:{marginInlineEnd:f},"&:hover":{color:w,backgroundColor:S,textDecoration:"none"},"&:active":{backgroundColor:M}},aa(n)),[`${t}-title`]:{flex:1,margin:0,fontWeight:n.fontWeightStrong,fontSize:d,lineHeight:p},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:l,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${Re(I)} ${Re(L)}`,borderTop:`${Re(y)} ${x} ${j}`},"&-rtl":{direction:"rtl"}}}},tn=n=>({zIndexPopup:n.zIndexPopupBase,footerPaddingBlock:n.paddingXS,footerPaddingInline:n.padding}),xs=Zt("Drawer",n=>{const s=sa(n,{});return[en(s),Za(s)]},tn);var vs=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(n);r<a.length;r++)s.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(n,a[r])&&(t[a[r]]=n[a[r]]);return t};const sn={distance:180},tt=n=>{const{rootClassName:s,width:t,height:a,size:r="default",mask:o=!0,push:u=sn,open:g,afterOpenChange:i,onClose:h,prefixCls:l,getContainer:d,panelRef:p=null,style:y,className:x,"aria-labelledby":j,visible:f,afterVisibleChange:C,maskStyle:w,drawerStyle:S,contentWrapperStyle:M,destroyOnClose:_,destroyOnHidden:T}=n,I=vs(n,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),L=na(),E=I.title?L:void 0,{getPopupContainer:P,getPrefixCls:D,direction:ae,className:H,style:A,classNames:J,styles:re}=dt("drawer"),Y=D("drawer",l),[ue,oe,ce]=xs(Y),W=d===void 0&&P?()=>P(document.body):d,ge=se({"no-mask":!o,[`${Y}-rtl`]:ae==="rtl"},s,oe,ce),ne=v.useMemo(()=>t??(r==="large"?736:378),[t,r]),ve=v.useMemo(()=>a??(r==="large"?736:378),[a,r]),ee={motionName:It(Y,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},b=ye=>({motionName:It(Y,`panel-motion-${ye}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Q=oa(),te=es(p,Q),[Ne,Se]=ia("Drawer",I.zIndex),{classNames:q={},styles:we={}}=I;return ue(v.createElement(la,{form:!0,space:!0},v.createElement(ra.Provider,{value:Se},v.createElement(Qa,Object.assign({prefixCls:Y,onClose:h,maskMotion:ee,motion:b},I,{classNames:{mask:se(q.mask,J.mask),content:se(q.content,J.content),wrapper:se(q.wrapper,J.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},we.mask),w),re.mask),content:Object.assign(Object.assign(Object.assign({},we.content),S),re.content),wrapper:Object.assign(Object.assign(Object.assign({},we.wrapper),M),re.wrapper)},open:g??f,mask:o,push:u,width:ne,height:ve,style:Object.assign(Object.assign({},A),y),className:se(H,x),rootClassName:ge,getContainer:W,afterOpenChange:i??C,panelRef:te,zIndex:Ne,"aria-labelledby":j??E,destroyOnClose:T??_}),v.createElement(ps,Object.assign({prefixCls:Y},I,{ariaId:E,onClose:h}))))))},an=n=>{const{prefixCls:s,style:t,className:a,placement:r="right"}=n,o=vs(n,["prefixCls","style","className","placement"]),{getPrefixCls:u}=v.useContext(wt),g=u("drawer",s),[i,h,l]=xs(g),d=se(g,`${g}-pure`,`${g}-${r}`,h,l,a);return i(v.createElement("div",{className:d,style:t},v.createElement(ps,Object.assign({prefixCls:g},o))))};tt._InternalPanelDoNotUseOrYouWillBeFired=an;var nn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},on=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:nn}))},Ke=v.forwardRef(on),ln={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},rn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:ln}))},Ut=v.forwardRef(rn);function cn(n,s,t){return typeof t=="boolean"?t:n.length?!0:ca(s).some(r=>r.type===ss)}var ys=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(n);r<a.length;r++)s.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(n,a[r])&&(t[a[r]]=n[a[r]]);return t};function ht({suffixCls:n,tagName:s,displayName:t}){return a=>v.forwardRef((o,u)=>v.createElement(a,Object.assign({ref:u,suffixCls:n,tagName:s},o)))}const kt=v.forwardRef((n,s)=>{const{prefixCls:t,suffixCls:a,className:r,tagName:o}=n,u=ys(n,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:g}=v.useContext(wt),i=g("layout",t),[h,l,d]=as(i),p=a?`${i}-${a}`:i;return h(v.createElement(o,Object.assign({className:se(t||p,r,l,d),ref:s},u)))}),dn=v.forwardRef((n,s)=>{const{direction:t}=v.useContext(wt),[a,r]=v.useState([]),{prefixCls:o,className:u,rootClassName:g,children:i,hasSider:h,tagName:l,style:d}=n,p=ys(n,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),y=da(p,["suffixCls"]),{getPrefixCls:x,className:j,style:f}=dt("layout"),C=x("layout",o),w=cn(a,i,h),[S,M,_]=as(C),T=se(C,{[`${C}-has-sider`]:w,[`${C}-rtl`]:t==="rtl"},j,u,g,M,_),I=v.useMemo(()=>({siderHook:{addSider:L=>{r(E=>[].concat(ha(E),[L]))},removeSider:L=>{r(E=>E.filter(P=>P!==L))}}}),[]);return S(v.createElement(ua.Provider,{value:I},v.createElement(l,Object.assign({ref:s,className:T,style:Object.assign(Object.assign({},f),d)},y),i)))}),hn=ht({tagName:"div",displayName:"Layout"})(dn),un=ht({suffixCls:"header",tagName:"header",displayName:"Header"})(kt),mn=ht({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(kt),pn=ht({suffixCls:"content",tagName:"main",displayName:"Content"})(kt),Pe=hn;Pe.Header=un;Pe.Footer=mn;Pe.Content=pn;Pe.Sider=ss;Pe._InternalSiderContext=ma;var gn={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"},fn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:gn}))},Wt=v.forwardRef(fn),xn={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"},vn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:xn}))},Kt=v.forwardRef(vn),yn={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"},jn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:yn}))},Gt=v.forwardRef(jn),Cn={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"},bn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:Cn}))},Ge=v.forwardRef(bn),Nn={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"},Sn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:Nn}))},gt=v.forwardRef(Sn),_n={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"},wn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:_n}))},kn=v.forwardRef(wn),Tn={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"},Mn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:Tn}))},Jt=v.forwardRef(Mn),En={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"},Rn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:En}))},In=v.forwardRef(Rn),Ln={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"},Pn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:Ln}))},Qt=v.forwardRef(Pn),An={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},Bn=function(s,t){return v.createElement(be,le({},s,{ref:t,icon:An}))},Xt=v.forwardRef(Bn),On=Object.defineProperty,ot=Object.getOwnPropertySymbols,js=Object.prototype.hasOwnProperty,Cs=Object.prototype.propertyIsEnumerable,Yt=(n,s,t)=>s in n?On(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t,jt=(n,s)=>{for(var t in s||(s={}))js.call(s,t)&&Yt(n,t,s[t]);if(ot)for(var t of ot(s))Cs.call(s,t)&&Yt(n,t,s[t]);return n},Ct=(n,s)=>{var t={};for(var a in n)js.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&ot)for(var a of ot(n))s.indexOf(a)<0&&Cs.call(n,a)&&(t[a]=n[a]);return t};/**
4
4
  * @license QR Code generator library (TypeScript)
@@ -38,4 +38,4 @@ var Bs=Object.defineProperty;var Os=(n,s,t)=>s in n?Bs(n,s,{enumerable:!0,config
38
38
  ---
39
39
  `).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);g.push(...y),i.push(h.name)}catch{}u++,u===r.length&&this._finishLocalLoad(g,i)},l.readAsText(h)})},t.click()});B(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((g,i)=>g+i.size,0)>500*1024*1024){K.error(m("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let r=0;const o=[],u=[];t.forEach(g=>{const i=new FileReader;i.onload=h=>{try{const d=h.target.result.split(`
40
40
  ---
41
- `).filter(p=>p.trim()).map(p=>{try{return JSON.parse(p)}catch{return null}}).filter(Boolean);o.push(...d),u.push(g.name)}catch{}r++,r===t.length&&this._finishLocalLoad(o,u)},i.readAsText(g)})});B(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));B(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})});B(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});B(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(r=>Ia(r).then(o=>({name:r.name,path:o})).catch(o=>(K.error(`${r.name}: ${o.message}`),null)))).then(r=>{const o=r.filter(Boolean).map(u=>`"${u.path}"`);o.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...o]}))})});B(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"context",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:r,fileLoadingCount:o,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:i,leftPanelWidth:h,currentTab:l}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(La,{theme:this.themeConfig,children:[r&&e.jsx("div",{className:R.loadingOverlay,children:e.jsxs("div",{className:R.loadingText,children:["Loading...(",o,")"]})}),this.state.isDragging&&e.jsx("div",{className:R.dragOverlay,children:e.jsxs("div",{className:R.dragOverlayContent,children:[e.jsx(Xt,{className:R.dragIcon}),e.jsx("p",{children:m("ui.dragDropHint")})]})}),e.jsxs(Pe,{className:R.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Pe.Header,{className:R.header,children:e.jsx(it,{requestCount:t.length,requests:t,viewMode:g,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,showFullToolContent:this.state.showFullToolContent,onShowFullToolContentChange:this.handleShowFullToolContentChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,logDir:this.state.logDir,onLogDirChange:this.handleLogDirChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(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.codexMissing&&e.jsx(us,{type:"warning",showIcon:!0,banner:!0,message:m("ui.codexMissing.title"),description:e.jsxs("span",{children:[m("ui.codexMissing.desc"),e.jsx("br",{}),e.jsx("code",{style:{background:"var(--bg-code)",padding:"2px 6px",borderRadius:3},children:"npm install -g codex"})," ",e.jsx("span",{style:{color:"var(--text-muted)",margin:"0 4px"},children:m("ui.codexMissing.or")})," ",e.jsx("a",{href:"https://openai.com/codex",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary-light)"},children:m("ui.codexMissing.native")})]})}),e.jsxs(Pe.Content,{className:R.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:R.guideContainer,children:e.jsxs("div",{className:R.guideContent,children:[e.jsx("h2",{className:R.guideTitle,children:m("ui.guide.title")}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"1"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:m("ui.guide.step1")}),e.jsx("code",{className:R.guideCode,children:m("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"2"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:m("ui.guide.step2")}),e.jsx("code",{className:R.guideCode,children:m("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"3"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:m("ui.guide.step3")}),e.jsx("code",{className:R.guideCode,children:"npm install -g codex"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:R.mainContainer,children:[e.jsxs("div",{className:R.leftPanel,style:{width:h},children:[e.jsxs("div",{className:R.leftPanelHeader,children:[e.jsx("span",{children:m("ui.requestList")}),e.jsx("span",{className:R.leftPanelCount,children:m("ui.totalRequests",{count:t.length})}),e.jsx(nt,{className:R.leftPanelClear,title:m("ui.clearRequests"),onClick:this.handleClearRequests})]}),e.jsx("div",{className:R.leftPanelBody,children:e.jsx(Co,{requests:t,selectedIndex:i,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(Kl,{onResize:this.handleResize}),e.jsx("div",{className:R.rightPanel,children:e.jsx(ql,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:i,currentTab:l,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:R.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(Pa,{requests:this.state.requests,mainAgentSessions:u,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,sdkMode:this._isLocalLog?!1:this.state.sdkMode,chatVisible:g==="chat",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:R.footer,children:e.jsxs("div",{className:R.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:R.footerLink,children:[e.jsx("svg",{className:R.footerIcon,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",this.state.githubStars!=null?` ★ ${this.state.githubStars}`:""]}),e.jsx("span",{className:R.footerSep,children:"|"}),e.jsxs("span",{className:`${R.footerVersion}${this.state.updateInfo?` ${R.footerVersionNew}`:""}`,onClick:()=>this.setState({updateModalVisible:!0}),style:{cursor:"pointer"},children:["v","1.0.1",this.state.updateInfo&&e.jsxs("svg",{className:R.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(je,{title:m("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:[m("ui.update.current"),":"]})," v","1.0.1"]}),this.state.updateInfo&&e.jsxs("p",{children:[e.jsxs("strong",{children:[m("ui.update.latest"),":"]})," v",this.state.updateInfo.version]}),e.jsx("p",{style:{marginTop:12},children:e.jsx("strong",{children:m("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:m("ui.update.electron")})}),e.jsx("p",{style:{color:"var(--text-tertiary)",fontSize:13},children:m("ui.update.electronDesc")}),e.jsxs("ol",{style:{color:"var(--text-tertiary)",fontSize:13,paddingLeft:20,margin:"6px 0"},children:[e.jsx("li",{children:m("ui.update.step1")}),e.jsx("li",{children:m("ui.update.step2")}),e.jsx("li",{children:m("ui.update.step3")})]})]}),e.jsx("div",{style:{marginTop:16,textAlign:"right"},children:e.jsx(F,{type:"primary",href:"https://github.com/weiesky/cc-viewer/releases",target:"_blank",rel:"noopener noreferrer",children:m("ui.update.goReleases")})})]})}),e.jsx(je,{title:m("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:R.resumeFooterRight,children:[e.jsx(F,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:R.btnMarginRight,children:m("ui.resume.continue")},"continue"),e.jsx(F,{onClick:()=>this.handleResumeChoice("new"),children:m("ui.resume.new")},"new")]}),e.jsx("div",{className:R.resumeFooterLeft,children:e.jsx(Aa,{checked:this.state.resumeRememberChoice,onChange:d=>this.setState({resumeRememberChoice:d.target.checked}),className:R.resumeCheckboxOpacity,children:e.jsx("span",{className:R.resumeCheckboxOpacity,children:m("ui.resume.remember")})})})]}),children:e.jsx("p",{children:m("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(je,{title:e.jsxs("span",{className:R.modalTitleInline,children:[e.jsx(ls,{apiEndpoint:de("/api/open-log-dir"),title:m("ui.openLogDir"),size:16}),m("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:R.modalActions,children:[this.renderLogProjectSelector(!1),e.jsx(F,{icon:e.jsx(Xt,{}),onClick:this.handleLoadLocalJsonlFile,children:m("ui.loadLocalJsonl")}),e.jsx(F,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:R.btnMarginLeft,children:m("ui.mergeLogs")}),e.jsx(F,{size:"small",danger:!0,icon:e.jsx(nt,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:R.btnMarginLeft,children:m("ui.deleteLogs")}),e.jsx(F,{size:"small",icon:e.jsx(yt,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:R.btnMarginLeft,children:m("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:R.spinCenter,children:e.jsx(os,{})}):(()=>{const d=this.state.localLogs[this.state.currentProject];return!d||d.length===0?e.jsx("div",{className:R.emptyCenter,children:m("ui.noLogs")}):e.jsx("div",{className:R.logListContainer,children:this.renderLogTable(d,!1)})})()]})]})}}export{Zl as default};
41
+ `).filter(p=>p.trim()).map(p=>{try{return JSON.parse(p)}catch{return null}}).filter(Boolean);o.push(...d),u.push(g.name)}catch{}r++,r===t.length&&this._finishLocalLoad(o,u)},i.readAsText(g)})});B(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));B(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})});B(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});B(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(r=>Ia(r).then(o=>({name:r.name,path:o})).catch(o=>(K.error(`${r.name}: ${o.message}`),null)))).then(r=>{const o=r.filter(Boolean).map(u=>`"${u.path}"`);o.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...o]}))})});B(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"context",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:r,fileLoadingCount:o,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:i,leftPanelWidth:h,currentTab:l}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(La,{theme:this.themeConfig,children:[r&&e.jsx("div",{className:R.loadingOverlay,children:e.jsxs("div",{className:R.loadingText,children:["Loading...(",o,")"]})}),this.state.isDragging&&e.jsx("div",{className:R.dragOverlay,children:e.jsxs("div",{className:R.dragOverlayContent,children:[e.jsx(Xt,{className:R.dragIcon}),e.jsx("p",{children:m("ui.dragDropHint")})]})}),e.jsxs(Pe,{className:R.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Pe.Header,{className:R.header,children:e.jsx(it,{requestCount:t.length,requests:t,viewMode:g,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,showFullToolContent:this.state.showFullToolContent,onShowFullToolContentChange:this.handleShowFullToolContentChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,logDir:this.state.logDir,onLogDirChange:this.handleLogDirChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(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.codexMissing&&e.jsx(us,{type:"warning",showIcon:!0,banner:!0,message:m("ui.codexMissing.title"),description:e.jsxs("span",{children:[m("ui.codexMissing.desc"),e.jsx("br",{}),e.jsx("code",{style:{background:"var(--bg-code)",padding:"2px 6px",borderRadius:3},children:"npm install -g codex"})," ",e.jsx("span",{style:{color:"var(--text-muted)",margin:"0 4px"},children:m("ui.codexMissing.or")})," ",e.jsx("a",{href:"https://openai.com/codex",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary-light)"},children:m("ui.codexMissing.native")})]})}),e.jsxs(Pe.Content,{className:R.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:R.guideContainer,children:e.jsxs("div",{className:R.guideContent,children:[e.jsx("h2",{className:R.guideTitle,children:m("ui.guide.title")}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"1"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:m("ui.guide.step1")}),e.jsx("code",{className:R.guideCode,children:m("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"2"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:m("ui.guide.step2")}),e.jsx("code",{className:R.guideCode,children:m("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"3"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:m("ui.guide.step3")}),e.jsx("code",{className:R.guideCode,children:"npm install -g codex"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:R.mainContainer,children:[e.jsxs("div",{className:R.leftPanel,style:{width:h},children:[e.jsxs("div",{className:R.leftPanelHeader,children:[e.jsx("span",{children:m("ui.requestList")}),e.jsx("span",{className:R.leftPanelCount,children:m("ui.totalRequests",{count:t.length})}),e.jsx(nt,{className:R.leftPanelClear,title:m("ui.clearRequests"),onClick:this.handleClearRequests})]}),e.jsx("div",{className:R.leftPanelBody,children:e.jsx(Co,{requests:t,selectedIndex:i,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(Kl,{onResize:this.handleResize}),e.jsx("div",{className:R.rightPanel,children:e.jsx(ql,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:i,currentTab:l,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:R.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(Pa,{requests:this.state.requests,mainAgentSessions:u,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,sdkMode:this._isLocalLog?!1:this.state.sdkMode,chatVisible:g==="chat",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:R.footer,children:e.jsxs("div",{className:R.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:R.footerLink,children:[e.jsx("svg",{className:R.footerIcon,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",this.state.githubStars!=null?` ★ ${this.state.githubStars}`:""]}),e.jsx("span",{className:R.footerSep,children:"|"}),e.jsxs("span",{className:`${R.footerVersion}${this.state.updateInfo?` ${R.footerVersionNew}`:""}`,onClick:()=>this.setState({updateModalVisible:!0}),style:{cursor:"pointer"},children:["v","1.0.3",this.state.updateInfo&&e.jsxs("svg",{className:R.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(je,{title:m("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:[m("ui.update.current"),":"]})," v","1.0.3"]}),this.state.updateInfo&&e.jsxs("p",{children:[e.jsxs("strong",{children:[m("ui.update.latest"),":"]})," v",this.state.updateInfo.version]}),e.jsx("p",{style:{marginTop:12},children:e.jsx("strong",{children:m("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:m("ui.update.electron")})}),e.jsx("p",{style:{color:"var(--text-tertiary)",fontSize:13},children:m("ui.update.electronDesc")}),e.jsxs("ol",{style:{color:"var(--text-tertiary)",fontSize:13,paddingLeft:20,margin:"6px 0"},children:[e.jsx("li",{children:m("ui.update.step1")}),e.jsx("li",{children:m("ui.update.step2")}),e.jsx("li",{children:m("ui.update.step3")})]})]}),e.jsx("div",{style:{marginTop:16,textAlign:"right"},children:e.jsx(F,{type:"primary",href:"https://github.com/weiesky/cc-viewer/releases",target:"_blank",rel:"noopener noreferrer",children:m("ui.update.goReleases")})})]})}),e.jsx(je,{title:m("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:R.resumeFooterRight,children:[e.jsx(F,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:R.btnMarginRight,children:m("ui.resume.continue")},"continue"),e.jsx(F,{onClick:()=>this.handleResumeChoice("new"),children:m("ui.resume.new")},"new")]}),e.jsx("div",{className:R.resumeFooterLeft,children:e.jsx(Aa,{checked:this.state.resumeRememberChoice,onChange:d=>this.setState({resumeRememberChoice:d.target.checked}),className:R.resumeCheckboxOpacity,children:e.jsx("span",{className:R.resumeCheckboxOpacity,children:m("ui.resume.remember")})})})]}),children:e.jsx("p",{children:m("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(je,{title:e.jsxs("span",{className:R.modalTitleInline,children:[e.jsx(ls,{apiEndpoint:de("/api/open-log-dir"),title:m("ui.openLogDir"),size:16}),m("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:R.modalActions,children:[this.renderLogProjectSelector(!1),e.jsx(F,{icon:e.jsx(Xt,{}),onClick:this.handleLoadLocalJsonlFile,children:m("ui.loadLocalJsonl")}),e.jsx(F,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:R.btnMarginLeft,children:m("ui.mergeLogs")}),e.jsx(F,{size:"small",danger:!0,icon:e.jsx(nt,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:R.btnMarginLeft,children:m("ui.deleteLogs")}),e.jsx(F,{size:"small",icon:e.jsx(yt,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:R.btnMarginLeft,children:m("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:R.spinCenter,children:e.jsx(os,{})}):(()=>{const d=this.state.localLogs[this.state.currentProject];return!d||d.length===0?e.jsx("div",{className:R.emptyCenter,children:m("ui.noLogs")}):e.jsx("div",{className:R.logListContainer,children:this.renderLogTable(d,!1)})})()]})]})}}export{Zl as default};