@tom2012/cc-web 2026.4.24-c → 2026.4.24-d

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 (21) hide show
  1. package/README.md +1 -1
  2. package/backend/dist/session-manager.d.ts +5 -0
  3. package/backend/dist/session-manager.d.ts.map +1 -1
  4. package/backend/dist/session-manager.js +88 -3
  5. package/backend/dist/session-manager.js.map +1 -1
  6. package/frontend/dist/assets/{AssistantMessageContent-BTANxhK5.js → AssistantMessageContent-CfeXY1pI.js} +1 -1
  7. package/frontend/dist/assets/{GraphPreview-DIiARd_8.js → GraphPreview-BnXJj0a5.js} +1 -1
  8. package/frontend/dist/assets/{MobilePage-DrADJsIt.js → MobilePage-C2_rtGuX.js} +3 -3
  9. package/frontend/dist/assets/{OfficePreview-BbGnMRJ-.js → OfficePreview-24QUV5er.js} +2 -2
  10. package/frontend/dist/assets/{ProjectPage-sXiKT1HJ.js → ProjectPage-D7oLvBPc.js} +3 -3
  11. package/frontend/dist/assets/{SettingsPage-CWQI-wPS.js → SettingsPage-C6cvUezE.js} +1 -1
  12. package/frontend/dist/assets/{SkillHubPage-2mALS_yn.js → SkillHubPage-B2NTGQEy.js} +1 -1
  13. package/frontend/dist/assets/{chevron-down-bX-OgZFC.js → chevron-down-BTiZGbq0.js} +1 -1
  14. package/frontend/dist/assets/{chevron-up-7fAOg_hP.js → chevron-up-D4HVI5mq.js} +1 -1
  15. package/frontend/dist/assets/{index-Cu3CJscw.js → index-ByG0P9zl.js} +1 -1
  16. package/frontend/dist/assets/{index-BYUYfbwU.js → index-C2CvLxhQ.js} +2 -2
  17. package/frontend/dist/assets/{index-BX3QW1XT.js → index-CwVTA5xf.js} +1 -1
  18. package/frontend/dist/assets/{jszip.min-Dhy96y-M.js → jszip.min-CaL6bUDj.js} +1 -1
  19. package/frontend/dist/assets/{search-Bk9KisxM.js → search-BLcN7tH3.js} +1 -1
  20. package/frontend/dist/index.html +1 -1
  21. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A self-hosted web application (distributed as npm package) that provides a browser-based interface for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI sessions. Create projects, each with a persistent terminal running Claude Code, and interact with them through a real-time terminal UI.
4
4
 
5
- **Current version**: v2026.4.24-c | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
5
+ **Current version**: v2026.4.24-d | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
6
6
 
7
7
  ## Features
8
8
 
@@ -90,6 +90,11 @@ declare class SessionManager extends EventEmitter {
90
90
  /** Stop the session poller for a project (public for cleanup on terminal stop) */
91
91
  stopWatcherForProject(projectId: string): void;
92
92
  private stopWatcher;
93
+ /** Attach an fs.watch to state.jsonlPath. Detaches any existing watcher
94
+ * first. Debounces 'change' events and dispatches into readNewLines on
95
+ * the same code path as hook-driven triggerRead. */
96
+ private attachFsWatch;
97
+ private detachFsWatch;
93
98
  /** Called by hooks route on PreToolUse.
94
99
  * Updates semantic status directly from env var — does NOT read JSONL
95
100
  * (JSONL has not been written yet at this point). */
@@ -1 +1 @@
1
- {"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../src/session-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAWvC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;IACvD;;iDAE6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;2EAEuE;IACvE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;2EACuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB;;;2BAGuB;IACvB,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,MAAM,GAAG,IAAI;IAyDpC,wFAAwF;IACxF,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAM5C,+DAA+D;IAC/D,OAAO,CAAC,YAAY;IAepB,2GAA2G;IAC3G,OAAO,CAAC,oBAAoB;IA4C5B,gDAAgD;IAChD,OAAO,CAAC,oBAAoB;CA8E7B;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
@@ -59,6 +59,10 @@ const log = (0, logger_1.modLogger)('session');
59
59
  function makeBlockId(jsonlPath, source) {
60
60
  return crypto.createHash('sha1').update(jsonlPath + '\0' + source).digest('hex').slice(0, 16);
61
61
  }
62
+ // 50ms is small enough to feel "live" to humans but large enough to
63
+ // collapse a burst of fs events from a multi-write entry flush into a
64
+ // single read pass.
65
+ const FS_WATCH_DEBOUNCE_MS = 50;
62
66
  // ── SessionManager ────────────────────────────────────────────────────────────
63
67
  class SessionManager extends events_1.EventEmitter {
64
68
  constructor() {
@@ -225,23 +229,95 @@ class SessionManager extends events_1.EventEmitter {
225
229
  * subsequent hook-driven `triggerRead()` calls can tail the JSONL. */
226
230
  startSession(projectId, folderPath, cliTool = 'claude') {
227
231
  this.stopWatcher(projectId);
228
- this.watchers.set(projectId, {
232
+ const state = {
229
233
  folderPath,
230
234
  cliTool,
231
235
  jsonlPath: null,
232
236
  fileOffset: 0,
233
237
  startedAt: Date.now(),
234
- });
235
- log.info({ projectId, folderPath, cliTool }, 'session watcher started');
238
+ fsWatcher: null,
239
+ debounceTimer: null,
240
+ };
241
+ this.watchers.set(projectId, state);
242
+ // Best-effort early attach: if the JSONL already exists (e.g. --continue
243
+ // resumes an old file), hook onto it immediately so live writes land in
244
+ // the chat view without waiting for the first PostToolUse hook.
245
+ const initial = this.findLatestJsonlForProject(folderPath, cliTool);
246
+ if (initial) {
247
+ state.jsonlPath = initial;
248
+ this.attachFsWatch(projectId, state);
249
+ }
250
+ log.info({ projectId, folderPath, cliTool, initialJsonl: initial ?? null }, 'session watcher started');
236
251
  }
237
252
  /** Stop the session poller for a project (public for cleanup on terminal stop) */
238
253
  stopWatcherForProject(projectId) {
239
254
  this.stopWatcher(projectId);
240
255
  }
241
256
  stopWatcher(projectId) {
257
+ const state = this.watchers.get(projectId);
258
+ if (state)
259
+ this.detachFsWatch(state);
242
260
  this.watchers.delete(projectId);
243
261
  this.semanticStatus.delete(projectId);
244
262
  }
263
+ /** Attach an fs.watch to state.jsonlPath. Detaches any existing watcher
264
+ * first. Debounces 'change' events and dispatches into readNewLines on
265
+ * the same code path as hook-driven triggerRead. */
266
+ attachFsWatch(projectId, state) {
267
+ this.detachFsWatch(state);
268
+ if (!state.jsonlPath)
269
+ return;
270
+ const watchedPath = state.jsonlPath;
271
+ try {
272
+ const watcher = fs.watch(watchedPath, (eventType) => {
273
+ // 'rename' on macOS/linux means the file was moved/deleted under us
274
+ // (rotation). Bail the watcher; hook path + triggerRead's file-switch
275
+ // detection will pick up the new file on next PostToolUse.
276
+ if (eventType === 'rename') {
277
+ const s = this.watchers.get(projectId);
278
+ if (s && s.fsWatcher === watcher)
279
+ this.detachFsWatch(s);
280
+ return;
281
+ }
282
+ const s = this.watchers.get(projectId);
283
+ if (!s || s.jsonlPath !== watchedPath)
284
+ return;
285
+ if (s.debounceTimer)
286
+ clearTimeout(s.debounceTimer);
287
+ s.debounceTimer = setTimeout(() => {
288
+ s.debounceTimer = null;
289
+ const cur = this.watchers.get(projectId);
290
+ if (!cur || cur.jsonlPath !== watchedPath)
291
+ return;
292
+ this.readNewLines(projectId, cur);
293
+ }, FS_WATCH_DEBOUNCE_MS);
294
+ });
295
+ watcher.on('error', (err) => {
296
+ log.debug({ err, projectId, jsonlPath: watchedPath }, 'fs.watch errored — hook path still active');
297
+ const s = this.watchers.get(projectId);
298
+ if (s && s.fsWatcher === watcher)
299
+ this.detachFsWatch(s);
300
+ });
301
+ state.fsWatcher = watcher;
302
+ log.debug({ projectId, jsonlPath: watchedPath }, 'fs.watch attached');
303
+ }
304
+ catch (err) {
305
+ log.debug({ err, projectId, jsonlPath: watchedPath }, 'fs.watch attach failed — hook path still active');
306
+ }
307
+ }
308
+ detachFsWatch(state) {
309
+ if (state.debounceTimer) {
310
+ clearTimeout(state.debounceTimer);
311
+ state.debounceTimer = null;
312
+ }
313
+ if (state.fsWatcher) {
314
+ try {
315
+ state.fsWatcher.close();
316
+ }
317
+ catch { /**/ }
318
+ state.fsWatcher = null;
319
+ }
320
+ }
245
321
  /** Called by hooks route on PreToolUse.
246
322
  * Updates semantic status directly from env var — does NOT read JSONL
247
323
  * (JSONL has not been written yet at this point). */
@@ -269,6 +345,14 @@ class SessionManager extends events_1.EventEmitter {
269
345
  if (latest && latest !== state.jsonlPath) {
270
346
  state.jsonlPath = latest;
271
347
  state.fileOffset = 0;
348
+ this.attachFsWatch(projectId, state);
349
+ }
350
+ else if (state.jsonlPath && !state.fsWatcher) {
351
+ // Spurious 'rename' (e.g. some editors' atomic-save pattern) caused
352
+ // detach but the path is still the correct file — re-attach so we
353
+ // don't silently degrade to hook-only. Without this, one stray
354
+ // rename kills live updates for the rest of the session.
355
+ this.attachFsWatch(projectId, state);
272
356
  }
273
357
  if (!state.jsonlPath) {
274
358
  // Brand-new project or session dir not yet created — retry a few times.
@@ -296,6 +380,7 @@ class SessionManager extends events_1.EventEmitter {
296
380
  s.jsonlPath = later;
297
381
  s.fileOffset = 0;
298
382
  s.retryChainActive = false;
383
+ this.attachFsWatch(projectId, s);
299
384
  this.readNewLines(projectId, s);
300
385
  }
301
386
  else if (attempt + 1 < delays.length) {
@@ -1 +1 @@
1
- {"version":3,"file":"session-manager.js","sourceRoot":"","sources":["../src/session-manager.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,mCAAsC;AACtC,qCAAsC;AACtC,yCAAwC;AAExC,qCAAqC;AAErC,8EAA8E;AAC9E,4EAA4E;AAC5E,2EAA2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C,IAAI,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CAEF;AAEY,QAAA,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import{bB as e,bC as t,r as n,bD as r,c as a,f as i,bE as o,bF as s,j as l,R as c,d as u,aK as d,bG as p,t as m,A as g,p as h,b2 as f,bH as b,a as y}from"./index-BYUYfbwU.js";import{C as E}from"./chevron-down-bX-OgZFC.js";import{C as S,a as v}from"./chevron-up-7fAOg_hP.js";function w(){!e.current&&t();const[a]=n.useState(r.current);return a}
1
+ import{bB as e,bC as t,r as n,bD as r,c as a,f as i,bE as o,bF as s,j as l,R as c,d as u,aK as d,bG as p,t as m,A as g,p as h,b2 as f,bH as b,a as y}from"./index-C2CvLxhQ.js";import{C as E}from"./chevron-down-BTiZGbq0.js";import{C as S,a as v}from"./chevron-up-D4HVI5mq.js";function w(){!e.current&&t();const[a]=n.useState(r.current);return a}
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as e,r as t,b as n,j as i,aK as r,B as o,l as a}from"./index-BYUYfbwU.js";import{Z as s,a as l}from"./ProjectPage-sXiKT1HJ.js";import"./purify.es-CgRAQgUo.js";import"./AssistantMessageContent-BTANxhK5.js";import"./chevron-down-bX-OgZFC.js";import"./chevron-up-7fAOg_hP.js";import"./index-BX3QW1XT.js";import"./search-Bk9KisxM.js";
1
+ import{c as e,r as t,b as n,j as i,aK as r,B as o,l as a}from"./index-C2CvLxhQ.js";import{Z as s,a as l}from"./ProjectPage-D7oLvBPc.js";import"./purify.es-CgRAQgUo.js";import"./AssistantMessageContent-CfeXY1pI.js";import"./chevron-down-BTiZGbq0.js";import"./chevron-up-D4HVI5mq.js";import"./index-CwVTA5xf.js";import"./search-BLcN7tH3.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OfficePreview-BbGnMRJ-.js","assets/index-BYUYfbwU.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js"])))=>i.map(i=>d[i]);
2
- import{c as e,aE as t,b1 as s,r as a,bt as n,bu as r,j as l,bv as o,l as c,d as i,bw as d,bx as x,aS as u,aT as m,ab as h,aa as p,by as f,a9 as g,aG as j,aK as b,a_ as v,a as y,b as N,g as w,D as k,f as C,R as S,_ as I,k as z,X as M,o as P,bz as U,bA as T,C as $,A,p as D}from"./index-BYUYfbwU.js";import{A as E,f as L,T as R,G as _,M as H,r as O,a as F,b as q,c as B,e as W,h as K,o as V,d as G,I as J,F as Q}from"./AssistantMessageContent-BTANxhK5.js";import{C as X}from"./chevron-up-7fAOg_hP.js";import{C as Y}from"./chevron-down-bX-OgZFC.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OfficePreview-24QUV5er.js","assets/index-C2CvLxhQ.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js"])))=>i.map(i=>d[i]);
2
+ import{c as e,aE as t,b1 as s,r as a,bt as n,bu as r,j as l,bv as o,l as c,d as i,bw as d,bx as x,aS as u,aT as m,ab as h,aa as p,by as f,a9 as g,aG as j,aK as b,a_ as v,a as y,b as N,g as w,D as k,f as C,R as S,_ as I,k as z,X as M,o as P,bz as U,bA as T,C as $,A,p as D}from"./index-C2CvLxhQ.js";import{A as E,f as L,T as R,G as _,M as H,r as O,a as F,b as q,c as B,e as W,h as K,o as V,d as G,I as J,F as Q}from"./AssistantMessageContent-CfeXY1pI.js";import{C as X}from"./chevron-up-D4HVI5mq.js";import{C as Y}from"./chevron-down-BTiZGbq0.js";
3
3
  /**
4
4
  * @license lucide-react v0.309.0 - ISC
5
5
  *
@@ -11,4 +11,4 @@ import{c as e,aE as t,b1 as s,r as a,bt as n,bu as r,j as l,bv as o,l as c,d as
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */function ne({onSelectProject:e}){const x=t(),{projects:u,fetchProjects:m,hasFetched:h,loading:p}=s(),[f,g]=a.useState(new Map),[j,b]=a.useState(new Set),[v,y]=a.useState(!1);a.useEffect(()=>{m()},[m]);const N=a.useCallback(e=>{e.status&&g(t=>{const s=new Map(t);return s.set(e.projectId,e.status),s}),void 0!==e.active&&b(t=>{const s=new Set(t);return e.active?s.add(e.projectId):s.delete(e.projectId),s})},[]);n({onActivityUpdate:N});const{applyOrder:w}=r(),k=w(u.filter(e=>!e.archived));return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 h-12 border-b border-border shrink-0",children:[l.jsx("span",{className:"font-semibold text-base flex-1",children:"CC Web"}),l.jsx(o,{}),l.jsx("button",{onClick:()=>{(async()=>{y(!0);try{await m()}finally{y(!1)}})()},className:"text-muted-foreground active:text-foreground",disabled:v,children:l.jsx(c,{className:i("h-4 w-4",v&&"animate-spin")})}),!ae&&l.jsx("button",{onClick:()=>x("/"),className:"text-muted-foreground active:text-foreground",title:"桌面模式",children:l.jsx(d,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[p&&!h&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"加载中..."}),h&&0===k.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"暂无项目"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:k.map(t=>{var s;const a="running"===(s=t,f.get(s.id)??s.status??"stopped"),n=j.has(t.id),r=l.jsxs("button",{onClick:()=>e(t.id),className:i("w-full text-left rounded-xl border bg-card p-2.5 active:bg-accent transition-colors",n?"border-transparent":"border-border"),children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",a?"bg-green-500":"bg-zinc-400")}),l.jsx("span",{className:"font-medium text-sm truncate flex-1",children:t.name})]}),l.jsx("div",{className:"text-[10px] text-muted-foreground font-mono truncate",children:t.cliTool??"claude"})]});return l.jsx("div",{className:n?"card-active-glow rounded-xl":void 0,children:r},t.id)})})]})]})}function re(e){if(!e.phase)return null;if("thinking"===e.phase)return"思考中";if("tool_result"===e.phase)return"处理结果";if("tool_use"===e.phase){const t=(e.detail||"").toLowerCase();return"bash"===t?"执行命令":"read"===t?"读取文件":"edit"===t||"multiedit"===t?"编辑文件":"write"===t?"写入文件":"grep"===t?"搜索内容":"glob"===t?"匹配文件":"webfetch"===t||"websearch"===t?"访问网络":"task"===t?"调度子任务":"todowrite"===t?"更新任务列表":"notebookedit"===t?"编辑 Notebook":e.detail?`调用 ${e.detail}`:"调用工具"}return null}function le({project:e,onBack:t,onOpenPanel:s,onContextUpdate:n}){const[r,o]=a.useState(""),c=a.useRef(null),d=a.useRef(null),[y,N]=a.useState([]),w=a.useCallback(e=>{N(t=>{const s=[...t,e];return s.length>200?s.slice(-200):s})},[]),k=a.useRef(null),C=a.useCallback(e=>{var t;"stopped"===e&&(null==(t=k.current)||t.call(k,"stopped"))},[]),[S,I]=a.useState([]),z=a.useRef(new Set),M=a.useCallback(e=>{z.current.has(e.toolUseId)||I(t=>t.some(t=>t.toolUseId===e.toolUseId)?t:[...t,{projectId:e.projectId,toolUseId:e.toolUseId,toolName:e.toolName,toolInput:e.toolInput,sessionId:e.sessionId,createdAt:e.createdAt}])},[]),P=a.useCallback(e=>{z.current.add(e.toolUseId),I(t=>t.filter(t=>t.toolUseId!==e.toolUseId))},[]),U=a.useCallback(e=>{z.current.add(e),I(t=>t.filter(t=>t.toolUseId!==e))},[]),[T,$]=a.useState(null),A=a.useRef(0),D=a.useCallback(e=>{var t,s,a;if(!e.active)return void $(null);if("text"===(null==(t=e.semantic)?void 0:t.phase))return void $(null);const n=null==(s=e.semantic)?void 0:s.phase,r=null==(a=e.semantic)?void 0:a.detail;$(e=>e?e.phase===n&&e.detail===r?e:{...e,phase:n,detail:r}:{id:"mab"+ ++A.current,phase:n,detail:r})},[]),{sendInput:H,connected:O}=x({projectId:e.id,enabled:!0,onChatMessage:w,onStatusChange:C,onContextUpdate:n,onApprovalRequest:M,onApprovalResolved:P,onSemanticUpdate:D});a.useEffect(()=>{if(!O)return;if("claude"!==e.cliTool)return;let t=!1;return u(e.id).then(e=>{if(t)return;const s=e.pending.filter(e=>!z.current.has(e.toolUseId));I(e=>{const t=new Map;for(const a of s)t.set(a.toolUseId,a);for(const s of e)t.has(s.toolUseId)||z.current.has(s.toolUseId)||t.set(s.toolUseId,s);return[...t.values()]})}).catch(()=>{}),()=>{t=!0}},[e.id,e.cliTool,O]);const{state:F,setState:q,messages:B,hasMoreHistory:W,loadMoreHistory:K,sendMessage:V,isWaking:G}=m({project:e,liveMessages:y,ws:{send:H,connected:O},historyLimit:20});k.current=q;const J=a.useRef(O);a.useEffect(()=>{!J.current&&O&&N([]),J.current=O},[O]);const Q=(()=>{for(let e=B.length-1;e>=0;e--)if("assistant"===B[e].role)return e;return-1})(),[ee,te]=a.useState([]),[ae,ne]=a.useState([]),[le,oe]=a.useState(null);a.useEffect(()=>{h().then(te).catch(()=>{}),p(e.id).then(ne).catch(()=>{})},[e.id]);const ce=a.useCallback(async()=>{const e=c.current,t=(null==e?void 0:e.scrollHeight)??0;await K(),requestAnimationFrame(()=>{e&&(e.scrollTop+=e.scrollHeight-t)})},[K]),ie=a.useRef(0);a.useEffect(()=>{const e=c.current;if(!e)return;const t=B.length>ie.current,s=0===ie.current&&B.length>0;ie.current=B.length,s?e.scrollTo({top:e.scrollHeight}):t&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[B,S.length]);const[de,xe]=a.useState(!1),ue=a.useCallback(async()=>{const e=r.trim();if(!e||de)return;xe(!0);const t=await V(e);xe(!1),"delivered"===t&&(o(""),d.current&&(d.current.style.height="auto"))},[r,de,V]),me=f(ue,"shift"),he=a.useCallback((t,s)=>{oe(null),V(t.command),"project"===s&&g(e.id,t.id,!0).catch(e=>{console.error("Failed to mark shortcut used:",e)})},[V,e.id]),pe="live"===F;return l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(j,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[l.jsx("span",{className:"font-medium text-sm truncate",children:e.name}),l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",pe?"bg-green-500":G?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),l.jsx("button",{onClick:s,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(se,{className:"h-5 w-5"})})]}),l.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto px-3 py-3 space-y-3 min-h-0",children:[W&&l.jsx("div",{className:"flex justify-center pb-1",children:l.jsxs("button",{onClick:()=>{ce()},className:"flex items-center gap-1 px-3 py-1.5 rounded-full text-xs text-muted-foreground border border-border active:bg-accent transition-colors",children:[l.jsx(X,{className:"h-3 w-3"}),"加载更早消息"]})}),B.map((e,t)=>{const s="user"===e.role;return l.jsx("div",{className:i("flex",s?"justify-end":"justify-start"),children:l.jsx("div",{className:i("max-w-[85%] rounded-xl px-3 py-2 break-words text-sm leading-relaxed",s?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm whitespace-pre-wrap":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:s?e.content:l.jsx(E,{content:e.content,blocks:e.blocks,isLatest:t===Q})})},e.id)}),S.map(e=>l.jsx(L,{approval:e,onResolved:U},e.toolUseId)),T&&0===S.length&&l.jsx("div",{className:"flex justify-start",children:l.jsxs("div",{className:"rounded-2xl rounded-bl-md px-3 py-1.5 bg-black/5 dark:bg-white/10 border border-black/10 dark:border-white/15 flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(R,{}),re(T)&&l.jsx("span",{children:re(T)})]})},T.id),0===B.length&&0===S.length&&!T&&"stopped"===F&&l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-sm",children:"暂无对话记录"}),G&&l.jsx("div",{className:"flex items-center justify-center py-4 text-yellow-400 text-sm animate-pulse",children:"启动中..."})]}),le&&l.jsx("div",{className:"border-t border-border max-h-48 overflow-y-auto shrink-0",children:l.jsxs("div",{className:"px-3 py-2 space-y-1",children:[("global"===le?ee:ae).map(e=>l.jsxs("button",{onClick:()=>he(e,le),disabled:G,className:i("w-full text-left rounded-md px-2.5 py-2 text-sm active:bg-accent transition-colors border border-border/50",G&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-medium text-xs",children:e.label}),l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.command})]},e.id)),0===("global"===le?ee:ae).length&&l.jsx("div",{className:"text-center text-muted-foreground text-xs py-3",children:"暂无快捷 Prompts"})]})}),(ee.length>0||ae.length>0)&&l.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-t border-border shrink-0",children:[l.jsxs("button",{onClick:()=>oe(e=>"global"===e?null:"global"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","global"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(_,{className:"h-3 w-3"}),"全局","global"===le&&l.jsx(Y,{className:"h-3 w-3"})]}),l.jsxs("button",{onClick:()=>oe(e=>"project"===e?null:"project"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","project"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(Z,{className:"h-3 w-3"}),"项目","project"===le&&l.jsx(Y,{className:"h-3 w-3"})]})]}),l.jsx("div",{className:"border-t border-border px-3 py-2 shrink-0",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("textarea",{ref:d,value:r,onChange:e=>o(e.target.value),onKeyDown:me,disabled:G||de,placeholder:G?"启动中...":de?"发送中…":"stopped"===F?"输入消息(自动启动)...":"输入消息...",rows:1,className:i("flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none","focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50","max-h-32 overflow-y-auto",(G||de)&&"opacity-50 cursor-not-allowed"),style:{minHeight:"2.5rem"},onInput:e=>{const t=e.currentTarget;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,128)+"px"}}),l.jsx("button",{onClick:ue,disabled:G||de||!r.trim(),className:i("shrink-0 p-2 rounded-md transition-colors",r.trim()&&!de?"text-blue-500 active:bg-blue-500/10":"text-muted-foreground/30"),children:de?l.jsx(b,{className:"h-5 w-5 animate-spin"}):l.jsx(v,{className:"h-5 w-5"})})]})})]})}const oe=S.lazy(()=>I(()=>import("./OfficePreview-BbGnMRJ-.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.OfficePreview}))),ce=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),ie=new Set(["docx","xlsx","xls","pptx"]),de={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};function xe(e){return e.split("/").pop()??e}function ue({filePath:e,onBack:t}){const[s,n]=a.useState(null),[r,o]=a.useState(!0),[c,i]=a.useState(null),{resolved:d}=y(),x=function(e){const t=e.split("/").pop()??"",s=t.toLowerCase();if("dockerfile"===s)return"dockerfile";if("makefile"===s)return"makefile";const a=t.lastIndexOf(".");return a>=0?t.slice(a+1).toLowerCase():""}(e),u=ce.has(x),m=ie.has(x),h=de[x],p="dark"===d;a.useEffect(()=>{u||m?o(!1):(o(!0),i(null),N(e).then(n).catch(e=>i(e instanceof Error?e.message:"Failed to load")).finally(()=>o(!1)))},[e,u,m]);const f=C(e),g=a.useMemo(()=>{const e=w();return e?`${f}&token=${encodeURIComponent(e)}`:f},[f]),v=a.useMemo(()=>u?`${g}&t=${Date.now()}`:"",[g,u]);return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(j,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:xe(e)}),l.jsx("a",{href:g,download:!0,className:"text-muted-foreground active:text-foreground p-1",onClick:e=>e.stopPropagation(),children:l.jsx(k,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[r&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),c&&l.jsx("div",{className:"text-center text-destructive text-sm py-12 px-4",children:c}),u&&l.jsx("div",{className:"flex items-center justify-center p-4 h-full",children:l.jsx("img",{src:v,alt:xe(e),className:"max-w-full max-h-full object-contain rounded",style:{touchAction:"pinch-zoom"}})}),m&&l.jsx(a.Suspense,{fallback:l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),children:l.jsx(oe,{filePath:e,ext:x,zoom:100})}),s&&(s.binary||s.tooLarge)&&l.jsxs("div",{className:"text-center py-12 px-4 space-y-3",children:[l.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.binary?"二进制文件":"文件过大",s.size>0&&` (${S=s.size,S<1024?`${S} B`:S<1048576?`${(S/1024).toFixed(1)} KB`:`${(S/1048576).toFixed(1)} MB`})`]}),l.jsxs("a",{href:g,download:!0,className:"inline-flex items-center gap-1.5 text-sm text-blue-500 active:text-blue-400",children:[l.jsx(k,{className:"h-4 w-4"}),"下载文件"]})]}),s&&!s.binary&&!s.tooLarge&&null!=s.content&&l.jsxs(l.Fragment,{children:["md"===x&&l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none px-4 py-3",children:l.jsx(H,{remarkPlugins:[F,q],rehypePlugins:[O],urlTransform:(e,t,s)=>"src"===t&&"img"===s.tagName?e:W(e),components:{img:({src:t,alt:s,...a})=>l.jsx("img",{...a,src:B(e,t,w()),alt:s??"",loading:"lazy",style:{maxWidth:"100%",height:"auto"}})},children:s.content})}),"md"!==x&&h&&l.jsx(K,{language:h,style:p?V:G,customStyle:{margin:0,fontSize:"12px",borderRadius:0},showLineNumbers:!0,children:s.content}),"md"!==x&&!h&&l.jsx("pre",{className:"p-4 text-xs font-mono whitespace-pre-wrap break-words",children:s.content})]})]})]});var S}const me=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),he=new Set(["js","jsx","ts","tsx","py","rb","go","rs","java","c","cpp","h","swift","kt","cs","php","sh","bash","zsh","r","lua","dart","zig","css","scss","less","html","htm","xml","sql"]),pe=new Set(["json","yaml","yml","toml","csv","tsv"]);function fe({entry:e}){if("dir"===e.type)return l.jsx(P,{className:"h-8 w-8 text-blue-400"});const t=function(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}(e.name);return me.has(t)?l.jsx(J,{className:"h-8 w-8 text-emerald-400"}):he.has(t)?l.jsx(ee,{className:"h-8 w-8 text-orange-400"}):pe.has(t)?l.jsx(te,{className:"h-8 w-8 text-yellow-400"}):"md"===t?l.jsx(Q,{className:"h-8 w-8 text-sky-400"}):l.jsx(U,{className:"h-8 w-8 text-muted-foreground"})}function ge({rootPath:e,onClose:t}){const[s,n]=a.useState(e),[r,o]=a.useState([]),[c,i]=a.useState(!0),[d,x]=a.useState(null),u=a.useCallback(async e=>{i(!0);try{const t=[...(await z(e)).entries].sort((e,t)=>e.type!==t.type?"dir"===e.type?-1:1:e.name.localeCompare(t.name));o(t),n(e)}catch{o([])}finally{i(!1)}},[]);a.useEffect(()=>{u(e)},[e,u]);const m=s!==e,h=s.startsWith(e)?s.slice(e.length)||"/":s;return d?l.jsx(ue,{filePath:d,onBack:()=>x(null)}):l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(M,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 text-sm",children:[m&&l.jsx("button",{onClick:()=>{if(s===e)return;const t=s.replace(/\/[^/]+$/,"")||"/";t.startsWith(e)&&u(t)},className:"text-muted-foreground active:text-foreground p-0.5 shrink-0",children:l.jsx(j,{className:"h-4 w-4"})}),l.jsx("span",{className:"truncate text-muted-foreground font-mono text-xs",children:h})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[c&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!c&&0===r.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"空目录"}),!c&&l.jsx("div",{className:"grid grid-cols-3 gap-1",children:r.map(e=>l.jsxs("button",{onClick:()=>(e=>{"dir"===e.type?u(e.path):x(e.path)})(e),className:"flex flex-col items-center gap-1 p-2 rounded-md active:bg-accent transition-colors",children:[l.jsx(fe,{entry:e}),l.jsx("span",{className:"text-[11px] text-center leading-tight w-full line-clamp-2 break-all",children:e.name})]},e.path))})]})]})}function je(e){return e<50?"text-green-400":e<80?"text-yellow-400":"text-red-400"}function be(e){return e<50?"bg-green-500":e<80?"bg-yellow-500":"bg-red-500"}function ve({projectName:e,cliTool:t,folderPath:s,contextData:n,onClose:r}){const[o,d]=a.useState(new Set(["context","usage","files"])),[x,u]=a.useState(null),[m,h]=a.useState(!1),p=e=>{d(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};a.useEffect(()=>{h(!0),T(t).then(u).catch(()=>u(null)).finally(()=>h(!1))},[t]);const f=n?Math.round(n.usedPercentage):null;return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:r,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(M,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 font-medium text-sm truncate",children:e})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsxs("button",{onClick:()=>p("context"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("context")?l.jsx(Y,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"上下文"}),null!==f&&l.jsxs("span",{className:i("text-xs font-mono ml-auto",je(f)),children:[f,"%"]})]}),o.has("context")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:null!==f&&n?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-2 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full transition-all",be(f)),style:{width:`${Math.min(f,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-10 text-right",je(f)),children:[f,"%"]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-muted-foreground",children:[l.jsx("span",{children:"窗口大小"}),l.jsx("span",{className:"text-right font-mono",children:n.contextWindowSize>=1e6?`${(n.contextWindowSize/1e6).toFixed(1)}M`:`${Math.round(n.contextWindowSize/1e3)}K`}),l.jsx("span",{children:"输入 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.inputTokens.toLocaleString()}),l.jsx("span",{children:"输出 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.outputTokens.toLocaleString()})]})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:"暂无数据"})}),l.jsxs("div",{className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 cursor-pointer",role:"button",tabIndex:0,onClick:()=>p("usage"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||p("usage")},children:[o.has("usage")?l.jsx(Y,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"用量"}),l.jsx("button",{onClick:e=>{e.stopPropagation(),(async()=>{h(!0);try{const{refreshUsage:e}=await I(async()=>{const{refreshUsage:e}=await import("./index-BYUYfbwU.js").then(e=>e.bJ);return{refreshUsage:e}},__vite__mapDeps([1,2]));u(await e(t))}catch{}finally{h(!1)}})()},className:"ml-auto text-muted-foreground active:text-foreground",children:l.jsx(c,{className:i("h-3 w-3",m&&"animate-spin")})})]}),o.has("usage")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:x?l.jsxs("div",{className:"space-y-2",children:[x.planName&&l.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Plan: ",l.jsx("span",{className:"font-medium text-foreground",children:x.planName})]}),l.jsx(ye,{label:"5h",bucket:x.fiveHour}),l.jsx(ye,{label:"7d",bucket:x.sevenDay}),x.sevenDaySonnet&&l.jsx(ye,{label:"7d Sonnet",bucket:x.sevenDaySonnet}),x.sevenDayOpus&&l.jsx(ye,{label:"7d Opus",bucket:x.sevenDayOpus}),!x.fiveHour&&!x.sevenDay&&l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center",children:"暂无数据"})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:m?"加载中...":"暂无数据"})}),l.jsxs("button",{onClick:()=>p("files"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("files")?l.jsx(Y,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"文件"})]}),o.has("files")&&l.jsx("div",{className:"h-[60vh]",children:l.jsx(ge,{rootPath:s,onClose:()=>p("files")})})]})]})}function ye({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const s=t.utilization,a=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);return s>0?`${s}h${a}m`:`${a}m`}(t.resetAt);return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground w-16",children:e}),l.jsx("div",{className:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full",be(s)),style:{width:`${Math.min(s,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-8 text-right",je(s)),children:[s,"%"]}),a&&l.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:a})]})}function Ne(){a.useEffect(()=>{const e=document.querySelector('meta[name="viewport"]');if(!e)return;const t=e.getAttribute("content")??"";return e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"),()=>{e.setAttribute("content",t)}},[]);const[e,t]=a.useState({screen:"list"}),[n,r]=a.useState(null),o=s(e=>e.projects),c=a.useCallback(e=>{t({screen:"chat",projectId:e}),r(null)},[]),i=a.useCallback(e=>{t({screen:"panel",projectId:e})},[]),d=a.useCallback(()=>{t(e=>"panel"===e.screen?{screen:"chat",projectId:e.projectId}:{screen:"list"})},[]),x="list"!==e.screen?o.find(t=>t.id===e.projectId):void 0;return l.jsxs("div",{className:"fixed inset-0 bg-background overflow-hidden",children:[l.jsxs(A,{mode:"wait",children:["list"===e.screen&&l.jsx(D.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{x:"-30%",opacity:0},transition:{duration:.2},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(ne,{onSelectProject:c})},"list"),"chat"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(le,{project:x,onBack:d,onOpenPanel:()=>i(e.projectId),onContextUpdate:r})},`chat-${e.projectId}`)]}),l.jsx(A,{children:"panel"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0 z-50 bg-background",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(ve,{projectName:x.name,cliTool:x.cliTool??"claude",folderPath:x.folderPath,contextData:n,onClose:d})},"panel")})]})}export{Ne as MobilePage};
14
+ */function ne({onSelectProject:e}){const x=t(),{projects:u,fetchProjects:m,hasFetched:h,loading:p}=s(),[f,g]=a.useState(new Map),[j,b]=a.useState(new Set),[v,y]=a.useState(!1);a.useEffect(()=>{m()},[m]);const N=a.useCallback(e=>{e.status&&g(t=>{const s=new Map(t);return s.set(e.projectId,e.status),s}),void 0!==e.active&&b(t=>{const s=new Set(t);return e.active?s.add(e.projectId):s.delete(e.projectId),s})},[]);n({onActivityUpdate:N});const{applyOrder:w}=r(),k=w(u.filter(e=>!e.archived));return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 h-12 border-b border-border shrink-0",children:[l.jsx("span",{className:"font-semibold text-base flex-1",children:"CC Web"}),l.jsx(o,{}),l.jsx("button",{onClick:()=>{(async()=>{y(!0);try{await m()}finally{y(!1)}})()},className:"text-muted-foreground active:text-foreground",disabled:v,children:l.jsx(c,{className:i("h-4 w-4",v&&"animate-spin")})}),!ae&&l.jsx("button",{onClick:()=>x("/"),className:"text-muted-foreground active:text-foreground",title:"桌面模式",children:l.jsx(d,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[p&&!h&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"加载中..."}),h&&0===k.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"暂无项目"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:k.map(t=>{var s;const a="running"===(s=t,f.get(s.id)??s.status??"stopped"),n=j.has(t.id),r=l.jsxs("button",{onClick:()=>e(t.id),className:i("w-full text-left rounded-xl border bg-card p-2.5 active:bg-accent transition-colors",n?"border-transparent":"border-border"),children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",a?"bg-green-500":"bg-zinc-400")}),l.jsx("span",{className:"font-medium text-sm truncate flex-1",children:t.name})]}),l.jsx("div",{className:"text-[10px] text-muted-foreground font-mono truncate",children:t.cliTool??"claude"})]});return l.jsx("div",{className:n?"card-active-glow rounded-xl":void 0,children:r},t.id)})})]})]})}function re(e){if(!e.phase)return null;if("thinking"===e.phase)return"思考中";if("tool_result"===e.phase)return"处理结果";if("tool_use"===e.phase){const t=(e.detail||"").toLowerCase();return"bash"===t?"执行命令":"read"===t?"读取文件":"edit"===t||"multiedit"===t?"编辑文件":"write"===t?"写入文件":"grep"===t?"搜索内容":"glob"===t?"匹配文件":"webfetch"===t||"websearch"===t?"访问网络":"task"===t?"调度子任务":"todowrite"===t?"更新任务列表":"notebookedit"===t?"编辑 Notebook":e.detail?`调用 ${e.detail}`:"调用工具"}return null}function le({project:e,onBack:t,onOpenPanel:s,onContextUpdate:n}){const[r,o]=a.useState(""),c=a.useRef(null),d=a.useRef(null),[y,N]=a.useState([]),w=a.useCallback(e=>{N(t=>{const s=[...t,e];return s.length>200?s.slice(-200):s})},[]),k=a.useRef(null),C=a.useCallback(e=>{var t;"stopped"===e&&(null==(t=k.current)||t.call(k,"stopped"))},[]),[S,I]=a.useState([]),z=a.useRef(new Set),M=a.useCallback(e=>{z.current.has(e.toolUseId)||I(t=>t.some(t=>t.toolUseId===e.toolUseId)?t:[...t,{projectId:e.projectId,toolUseId:e.toolUseId,toolName:e.toolName,toolInput:e.toolInput,sessionId:e.sessionId,createdAt:e.createdAt}])},[]),P=a.useCallback(e=>{z.current.add(e.toolUseId),I(t=>t.filter(t=>t.toolUseId!==e.toolUseId))},[]),U=a.useCallback(e=>{z.current.add(e),I(t=>t.filter(t=>t.toolUseId!==e))},[]),[T,$]=a.useState(null),A=a.useRef(0),D=a.useCallback(e=>{var t,s,a;if(!e.active)return void $(null);if("text"===(null==(t=e.semantic)?void 0:t.phase))return void $(null);const n=null==(s=e.semantic)?void 0:s.phase,r=null==(a=e.semantic)?void 0:a.detail;$(e=>e?e.phase===n&&e.detail===r?e:{...e,phase:n,detail:r}:{id:"mab"+ ++A.current,phase:n,detail:r})},[]),{sendInput:H,connected:O}=x({projectId:e.id,enabled:!0,onChatMessage:w,onStatusChange:C,onContextUpdate:n,onApprovalRequest:M,onApprovalResolved:P,onSemanticUpdate:D});a.useEffect(()=>{if(!O)return;if("claude"!==e.cliTool)return;let t=!1;return u(e.id).then(e=>{if(t)return;const s=e.pending.filter(e=>!z.current.has(e.toolUseId));I(e=>{const t=new Map;for(const a of s)t.set(a.toolUseId,a);for(const s of e)t.has(s.toolUseId)||z.current.has(s.toolUseId)||t.set(s.toolUseId,s);return[...t.values()]})}).catch(()=>{}),()=>{t=!0}},[e.id,e.cliTool,O]);const{state:F,setState:q,messages:B,hasMoreHistory:W,loadMoreHistory:K,sendMessage:V,isWaking:G}=m({project:e,liveMessages:y,ws:{send:H,connected:O},historyLimit:20});k.current=q;const J=a.useRef(O);a.useEffect(()=>{!J.current&&O&&N([]),J.current=O},[O]);const Q=(()=>{for(let e=B.length-1;e>=0;e--)if("assistant"===B[e].role)return e;return-1})(),[ee,te]=a.useState([]),[ae,ne]=a.useState([]),[le,oe]=a.useState(null);a.useEffect(()=>{h().then(te).catch(()=>{}),p(e.id).then(ne).catch(()=>{})},[e.id]);const ce=a.useCallback(async()=>{const e=c.current,t=(null==e?void 0:e.scrollHeight)??0;await K(),requestAnimationFrame(()=>{e&&(e.scrollTop+=e.scrollHeight-t)})},[K]),ie=a.useRef(0);a.useEffect(()=>{const e=c.current;if(!e)return;const t=B.length>ie.current,s=0===ie.current&&B.length>0;ie.current=B.length,s?e.scrollTo({top:e.scrollHeight}):t&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[B,S.length]);const[de,xe]=a.useState(!1),ue=a.useCallback(async()=>{const e=r.trim();if(!e||de)return;xe(!0);const t=await V(e);xe(!1),"delivered"===t&&(o(""),d.current&&(d.current.style.height="auto"))},[r,de,V]),me=f(ue,"shift"),he=a.useCallback((t,s)=>{oe(null),V(t.command),"project"===s&&g(e.id,t.id,!0).catch(e=>{console.error("Failed to mark shortcut used:",e)})},[V,e.id]),pe="live"===F;return l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(j,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[l.jsx("span",{className:"font-medium text-sm truncate",children:e.name}),l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",pe?"bg-green-500":G?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),l.jsx("button",{onClick:s,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(se,{className:"h-5 w-5"})})]}),l.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto px-3 py-3 space-y-3 min-h-0",children:[W&&l.jsx("div",{className:"flex justify-center pb-1",children:l.jsxs("button",{onClick:()=>{ce()},className:"flex items-center gap-1 px-3 py-1.5 rounded-full text-xs text-muted-foreground border border-border active:bg-accent transition-colors",children:[l.jsx(X,{className:"h-3 w-3"}),"加载更早消息"]})}),B.map((e,t)=>{const s="user"===e.role;return l.jsx("div",{className:i("flex",s?"justify-end":"justify-start"),children:l.jsx("div",{className:i("max-w-[85%] rounded-xl px-3 py-2 break-words text-sm leading-relaxed",s?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm whitespace-pre-wrap":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:s?e.content:l.jsx(E,{content:e.content,blocks:e.blocks,isLatest:t===Q})})},e.id)}),S.map(e=>l.jsx(L,{approval:e,onResolved:U},e.toolUseId)),T&&0===S.length&&l.jsx("div",{className:"flex justify-start",children:l.jsxs("div",{className:"rounded-2xl rounded-bl-md px-3 py-1.5 bg-black/5 dark:bg-white/10 border border-black/10 dark:border-white/15 flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(R,{}),re(T)&&l.jsx("span",{children:re(T)})]})},T.id),0===B.length&&0===S.length&&!T&&"stopped"===F&&l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-sm",children:"暂无对话记录"}),G&&l.jsx("div",{className:"flex items-center justify-center py-4 text-yellow-400 text-sm animate-pulse",children:"启动中..."})]}),le&&l.jsx("div",{className:"border-t border-border max-h-48 overflow-y-auto shrink-0",children:l.jsxs("div",{className:"px-3 py-2 space-y-1",children:[("global"===le?ee:ae).map(e=>l.jsxs("button",{onClick:()=>he(e,le),disabled:G,className:i("w-full text-left rounded-md px-2.5 py-2 text-sm active:bg-accent transition-colors border border-border/50",G&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-medium text-xs",children:e.label}),l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.command})]},e.id)),0===("global"===le?ee:ae).length&&l.jsx("div",{className:"text-center text-muted-foreground text-xs py-3",children:"暂无快捷 Prompts"})]})}),(ee.length>0||ae.length>0)&&l.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-t border-border shrink-0",children:[l.jsxs("button",{onClick:()=>oe(e=>"global"===e?null:"global"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","global"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(_,{className:"h-3 w-3"}),"全局","global"===le&&l.jsx(Y,{className:"h-3 w-3"})]}),l.jsxs("button",{onClick:()=>oe(e=>"project"===e?null:"project"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","project"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(Z,{className:"h-3 w-3"}),"项目","project"===le&&l.jsx(Y,{className:"h-3 w-3"})]})]}),l.jsx("div",{className:"border-t border-border px-3 py-2 shrink-0",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("textarea",{ref:d,value:r,onChange:e=>o(e.target.value),onKeyDown:me,disabled:G||de,placeholder:G?"启动中...":de?"发送中…":"stopped"===F?"输入消息(自动启动)...":"输入消息...",rows:1,className:i("flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none","focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50","max-h-32 overflow-y-auto",(G||de)&&"opacity-50 cursor-not-allowed"),style:{minHeight:"2.5rem"},onInput:e=>{const t=e.currentTarget;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,128)+"px"}}),l.jsx("button",{onClick:ue,disabled:G||de||!r.trim(),className:i("shrink-0 p-2 rounded-md transition-colors",r.trim()&&!de?"text-blue-500 active:bg-blue-500/10":"text-muted-foreground/30"),children:de?l.jsx(b,{className:"h-5 w-5 animate-spin"}):l.jsx(v,{className:"h-5 w-5"})})]})})]})}const oe=S.lazy(()=>I(()=>import("./OfficePreview-24QUV5er.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.OfficePreview}))),ce=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),ie=new Set(["docx","xlsx","xls","pptx"]),de={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};function xe(e){return e.split("/").pop()??e}function ue({filePath:e,onBack:t}){const[s,n]=a.useState(null),[r,o]=a.useState(!0),[c,i]=a.useState(null),{resolved:d}=y(),x=function(e){const t=e.split("/").pop()??"",s=t.toLowerCase();if("dockerfile"===s)return"dockerfile";if("makefile"===s)return"makefile";const a=t.lastIndexOf(".");return a>=0?t.slice(a+1).toLowerCase():""}(e),u=ce.has(x),m=ie.has(x),h=de[x],p="dark"===d;a.useEffect(()=>{u||m?o(!1):(o(!0),i(null),N(e).then(n).catch(e=>i(e instanceof Error?e.message:"Failed to load")).finally(()=>o(!1)))},[e,u,m]);const f=C(e),g=a.useMemo(()=>{const e=w();return e?`${f}&token=${encodeURIComponent(e)}`:f},[f]),v=a.useMemo(()=>u?`${g}&t=${Date.now()}`:"",[g,u]);return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(j,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:xe(e)}),l.jsx("a",{href:g,download:!0,className:"text-muted-foreground active:text-foreground p-1",onClick:e=>e.stopPropagation(),children:l.jsx(k,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[r&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),c&&l.jsx("div",{className:"text-center text-destructive text-sm py-12 px-4",children:c}),u&&l.jsx("div",{className:"flex items-center justify-center p-4 h-full",children:l.jsx("img",{src:v,alt:xe(e),className:"max-w-full max-h-full object-contain rounded",style:{touchAction:"pinch-zoom"}})}),m&&l.jsx(a.Suspense,{fallback:l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),children:l.jsx(oe,{filePath:e,ext:x,zoom:100})}),s&&(s.binary||s.tooLarge)&&l.jsxs("div",{className:"text-center py-12 px-4 space-y-3",children:[l.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.binary?"二进制文件":"文件过大",s.size>0&&` (${S=s.size,S<1024?`${S} B`:S<1048576?`${(S/1024).toFixed(1)} KB`:`${(S/1048576).toFixed(1)} MB`})`]}),l.jsxs("a",{href:g,download:!0,className:"inline-flex items-center gap-1.5 text-sm text-blue-500 active:text-blue-400",children:[l.jsx(k,{className:"h-4 w-4"}),"下载文件"]})]}),s&&!s.binary&&!s.tooLarge&&null!=s.content&&l.jsxs(l.Fragment,{children:["md"===x&&l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none px-4 py-3",children:l.jsx(H,{remarkPlugins:[F,q],rehypePlugins:[O],urlTransform:(e,t,s)=>"src"===t&&"img"===s.tagName?e:W(e),components:{img:({src:t,alt:s,...a})=>l.jsx("img",{...a,src:B(e,t,w()),alt:s??"",loading:"lazy",style:{maxWidth:"100%",height:"auto"}})},children:s.content})}),"md"!==x&&h&&l.jsx(K,{language:h,style:p?V:G,customStyle:{margin:0,fontSize:"12px",borderRadius:0},showLineNumbers:!0,children:s.content}),"md"!==x&&!h&&l.jsx("pre",{className:"p-4 text-xs font-mono whitespace-pre-wrap break-words",children:s.content})]})]})]});var S}const me=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),he=new Set(["js","jsx","ts","tsx","py","rb","go","rs","java","c","cpp","h","swift","kt","cs","php","sh","bash","zsh","r","lua","dart","zig","css","scss","less","html","htm","xml","sql"]),pe=new Set(["json","yaml","yml","toml","csv","tsv"]);function fe({entry:e}){if("dir"===e.type)return l.jsx(P,{className:"h-8 w-8 text-blue-400"});const t=function(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}(e.name);return me.has(t)?l.jsx(J,{className:"h-8 w-8 text-emerald-400"}):he.has(t)?l.jsx(ee,{className:"h-8 w-8 text-orange-400"}):pe.has(t)?l.jsx(te,{className:"h-8 w-8 text-yellow-400"}):"md"===t?l.jsx(Q,{className:"h-8 w-8 text-sky-400"}):l.jsx(U,{className:"h-8 w-8 text-muted-foreground"})}function ge({rootPath:e,onClose:t}){const[s,n]=a.useState(e),[r,o]=a.useState([]),[c,i]=a.useState(!0),[d,x]=a.useState(null),u=a.useCallback(async e=>{i(!0);try{const t=[...(await z(e)).entries].sort((e,t)=>e.type!==t.type?"dir"===e.type?-1:1:e.name.localeCompare(t.name));o(t),n(e)}catch{o([])}finally{i(!1)}},[]);a.useEffect(()=>{u(e)},[e,u]);const m=s!==e,h=s.startsWith(e)?s.slice(e.length)||"/":s;return d?l.jsx(ue,{filePath:d,onBack:()=>x(null)}):l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(M,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 text-sm",children:[m&&l.jsx("button",{onClick:()=>{if(s===e)return;const t=s.replace(/\/[^/]+$/,"")||"/";t.startsWith(e)&&u(t)},className:"text-muted-foreground active:text-foreground p-0.5 shrink-0",children:l.jsx(j,{className:"h-4 w-4"})}),l.jsx("span",{className:"truncate text-muted-foreground font-mono text-xs",children:h})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[c&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!c&&0===r.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"空目录"}),!c&&l.jsx("div",{className:"grid grid-cols-3 gap-1",children:r.map(e=>l.jsxs("button",{onClick:()=>(e=>{"dir"===e.type?u(e.path):x(e.path)})(e),className:"flex flex-col items-center gap-1 p-2 rounded-md active:bg-accent transition-colors",children:[l.jsx(fe,{entry:e}),l.jsx("span",{className:"text-[11px] text-center leading-tight w-full line-clamp-2 break-all",children:e.name})]},e.path))})]})]})}function je(e){return e<50?"text-green-400":e<80?"text-yellow-400":"text-red-400"}function be(e){return e<50?"bg-green-500":e<80?"bg-yellow-500":"bg-red-500"}function ve({projectName:e,cliTool:t,folderPath:s,contextData:n,onClose:r}){const[o,d]=a.useState(new Set(["context","usage","files"])),[x,u]=a.useState(null),[m,h]=a.useState(!1),p=e=>{d(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};a.useEffect(()=>{h(!0),T(t).then(u).catch(()=>u(null)).finally(()=>h(!1))},[t]);const f=n?Math.round(n.usedPercentage):null;return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:r,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(M,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 font-medium text-sm truncate",children:e})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsxs("button",{onClick:()=>p("context"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("context")?l.jsx(Y,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"上下文"}),null!==f&&l.jsxs("span",{className:i("text-xs font-mono ml-auto",je(f)),children:[f,"%"]})]}),o.has("context")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:null!==f&&n?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-2 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full transition-all",be(f)),style:{width:`${Math.min(f,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-10 text-right",je(f)),children:[f,"%"]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-muted-foreground",children:[l.jsx("span",{children:"窗口大小"}),l.jsx("span",{className:"text-right font-mono",children:n.contextWindowSize>=1e6?`${(n.contextWindowSize/1e6).toFixed(1)}M`:`${Math.round(n.contextWindowSize/1e3)}K`}),l.jsx("span",{children:"输入 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.inputTokens.toLocaleString()}),l.jsx("span",{children:"输出 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.outputTokens.toLocaleString()})]})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:"暂无数据"})}),l.jsxs("div",{className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 cursor-pointer",role:"button",tabIndex:0,onClick:()=>p("usage"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||p("usage")},children:[o.has("usage")?l.jsx(Y,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"用量"}),l.jsx("button",{onClick:e=>{e.stopPropagation(),(async()=>{h(!0);try{const{refreshUsage:e}=await I(async()=>{const{refreshUsage:e}=await import("./index-C2CvLxhQ.js").then(e=>e.bJ);return{refreshUsage:e}},__vite__mapDeps([1,2]));u(await e(t))}catch{}finally{h(!1)}})()},className:"ml-auto text-muted-foreground active:text-foreground",children:l.jsx(c,{className:i("h-3 w-3",m&&"animate-spin")})})]}),o.has("usage")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:x?l.jsxs("div",{className:"space-y-2",children:[x.planName&&l.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Plan: ",l.jsx("span",{className:"font-medium text-foreground",children:x.planName})]}),l.jsx(ye,{label:"5h",bucket:x.fiveHour}),l.jsx(ye,{label:"7d",bucket:x.sevenDay}),x.sevenDaySonnet&&l.jsx(ye,{label:"7d Sonnet",bucket:x.sevenDaySonnet}),x.sevenDayOpus&&l.jsx(ye,{label:"7d Opus",bucket:x.sevenDayOpus}),!x.fiveHour&&!x.sevenDay&&l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center",children:"暂无数据"})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:m?"加载中...":"暂无数据"})}),l.jsxs("button",{onClick:()=>p("files"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("files")?l.jsx(Y,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"文件"})]}),o.has("files")&&l.jsx("div",{className:"h-[60vh]",children:l.jsx(ge,{rootPath:s,onClose:()=>p("files")})})]})]})}function ye({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const s=t.utilization,a=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);return s>0?`${s}h${a}m`:`${a}m`}(t.resetAt);return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground w-16",children:e}),l.jsx("div",{className:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full",be(s)),style:{width:`${Math.min(s,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-8 text-right",je(s)),children:[s,"%"]}),a&&l.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:a})]})}function Ne(){a.useEffect(()=>{const e=document.querySelector('meta[name="viewport"]');if(!e)return;const t=e.getAttribute("content")??"";return e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"),()=>{e.setAttribute("content",t)}},[]);const[e,t]=a.useState({screen:"list"}),[n,r]=a.useState(null),o=s(e=>e.projects),c=a.useCallback(e=>{t({screen:"chat",projectId:e}),r(null)},[]),i=a.useCallback(e=>{t({screen:"panel",projectId:e})},[]),d=a.useCallback(()=>{t(e=>"panel"===e.screen?{screen:"chat",projectId:e.projectId}:{screen:"list"})},[]),x="list"!==e.screen?o.find(t=>t.id===e.projectId):void 0;return l.jsxs("div",{className:"fixed inset-0 bg-background overflow-hidden",children:[l.jsxs(A,{mode:"wait",children:["list"===e.screen&&l.jsx(D.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{x:"-30%",opacity:0},transition:{duration:.2},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(ne,{onSelectProject:c})},"list"),"chat"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(le,{project:x,onBack:d,onOpenPanel:()=>i(e.projectId),onContextUpdate:r})},`chat-${e.projectId}`)]}),l.jsx(A,{children:"panel"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0 z-50 bg-background",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(ve,{projectName:x.name,cliTool:x.cliTool??"claude",folderPath:x.folderPath,contextData:n,onClose:d})},"panel")})]})}export{Ne as MobilePage};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cu3CJscw.js","assets/index-BYUYfbwU.js","assets/index-ChWqp_e7.css","assets/jszip.min-Dhy96y-M.js"])))=>i.map(i=>d[i]);
2
- import{j as e,r as t,_ as s,g as r,f as a}from"./index-BYUYfbwU.js";import{p as n}from"./purify.es-CgRAQgUo.js";async function l(e){let t=a(e);const s=r();s&&(t+=`${t.includes("?")?"&":"?"}token=${encodeURIComponent(s)}`);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file: ${n.status}`);return n.arrayBuffer()}function o({filePath:r,zoom:a}){const[o,i]=t.useState(""),[d,c]=t.useState(null),[x,u]=t.useState(!0);return t.useEffect(()=>{let e=!1;return u(!0),c(null),(async()=>{try{const t=await s(()=>import("./index-Cu3CJscw.js").then(e=>e.i),__vite__mapDeps([0,1,2,3])),a=await l(r),n=await t.convertToHtml({arrayBuffer:a});e||i(n.value)}catch(t){e||c(t instanceof Error?t.message:"Failed to render docx")}finally{e||u(!1)}})(),()=>{e=!0}},[r]),x?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Word 文档中..."}):d?e.jsx("p",{className:"text-sm text-destructive p-4",children:d}):e.jsx("div",{className:"p-6 prose dark:prose-invert max-w-none",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize(o)}})}function i({filePath:r,zoom:a}){var o;const[i,d]=t.useState([]),[c,x]=t.useState(0),[u,p]=t.useState(null),[m,f]=t.useState(!0);return t.useEffect(()=>{let e=!1;return f(!0),p(null),(async()=>{try{const t=await s(()=>import("./xlsx-DfDjAMCE.js"),[]),a=await l(r),n=t.read(a,{type:"array"}),o=n.SheetNames.map(e=>({name:e,html:t.utils.sheet_to_html(n.Sheets[e],{editable:!1})}));e||(d(o),x(0))}catch(t){e||p(t instanceof Error?t.message:"Failed to render xlsx")}finally{e||f(!1)}})(),()=>{e=!0}},[r]),m?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Excel 文件中..."}):u?e.jsx("p",{className:"text-sm text-destructive p-4",children:u}):0===i.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsxs("div",{className:"flex flex-col h-full",children:[i.length>1&&e.jsx("div",{className:"flex gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30 flex-shrink-0 overflow-x-auto",children:i.map((t,s)=>e.jsx("button",{onClick:()=>x(s),className:"px-3 py-1 text-xs rounded-t transition-colors whitespace-nowrap "+(s===c?"bg-background text-foreground border border-b-0 border-border":"text-muted-foreground hover:text-foreground"),children:t.name},s))}),e.jsx("div",{className:"flex-1 overflow-auto p-2 xlsx-preview",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize((null==(o=i[c])?void 0:o.html)??"")}}),e.jsx("style",{children:"\n .xlsx-preview table { border-collapse: collapse; width: auto; min-width: 100%; }\n .xlsx-preview td, .xlsx-preview th {\n border: 1px solid hsl(var(--border));\n padding: 4px 8px;\n text-align: left;\n white-space: nowrap;\n font-size: inherit;\n }\n .xlsx-preview th { background: hsl(var(--muted)); font-weight: 600; }\n .xlsx-preview tr:hover td { background: hsl(var(--accent) / 0.3); }\n "})]})}function d({filePath:r,zoom:a}){const[n,o]=t.useState([]),[i,d]=t.useState(null),[c,x]=t.useState(!0);return t.useEffect(()=>{let e=!1;return x(!0),d(null),(async()=>{try{const t=await l(r),a=await async function(e){const{default:t}=await s(async()=>{const{default:e}=await import("./jszip.min-Dhy96y-M.js").then(e=>e.j);return{default:e}},__vite__mapDeps([3,1,2])),r=await t.loadAsync(e),a=[],n=Object.keys(r.files).filter(e=>/^ppt\/slides\/slide\d+\.xml$/i.test(e)).sort((e,t)=>{var s,r;return parseInt((null==(s=e.match(/slide(\d+)/))?void 0:s[1])??"0")-parseInt((null==(r=t.match(/slide(\d+)/))?void 0:r[1])??"0")});for(let s=0;s<n.length;s++){const e=await r.file(n[s]).async("text"),t=[],l=/<a:t[^>]*>([\s\S]*?)<\/a:t>/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').trim();e&&t.push(e)}a.push({index:s+1,texts:t})}return a}(t);e||o(a)}catch(t){e||d(t instanceof Error?t.message:"Failed to render pptx")}finally{e||x(!1)}})(),()=>{e=!0}},[r]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 PPT 文件中..."}):i?e.jsx("p",{className:"text-sm text-destructive p-4",children:i}):0===n.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsx("div",{className:"p-4 space-y-4",style:{fontSize:12*a/100+"px"},children:n.map(t=>e.jsxs("div",{className:"border border-border rounded-xl p-5 bg-muted/20",children:[e.jsxs("div",{className:"text-xs text-muted-foreground mb-2 font-medium",children:["Slide ",t.index]}),t.texts.length>0?e.jsx("div",{className:"space-y-1.5",children:t.texts.map((t,s)=>e.jsx("p",{className:"text-foreground leading-relaxed",style:{fontSize:"inherit"},children:t},s))}):e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"(无文本内容)"})]},t.index))})}const c=new Set(["docx","xlsx","xls","pptx"]);function x({filePath:t,ext:s,zoom:r}){return"docx"===s?e.jsx(o,{filePath:t,zoom:r}):"xlsx"===s||"xls"===s?e.jsx(i,{filePath:t,zoom:r}):"pptx"===s?e.jsx(d,{filePath:t,zoom:r}):null}export{c as OFFICE_EXTS,x as OfficePreview};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-ByG0P9zl.js","assets/index-C2CvLxhQ.js","assets/index-ChWqp_e7.css","assets/jszip.min-CaL6bUDj.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as t,_ as s,g as r,f as a}from"./index-C2CvLxhQ.js";import{p as n}from"./purify.es-CgRAQgUo.js";async function l(e){let t=a(e);const s=r();s&&(t+=`${t.includes("?")?"&":"?"}token=${encodeURIComponent(s)}`);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file: ${n.status}`);return n.arrayBuffer()}function o({filePath:r,zoom:a}){const[o,i]=t.useState(""),[d,c]=t.useState(null),[x,u]=t.useState(!0);return t.useEffect(()=>{let e=!1;return u(!0),c(null),(async()=>{try{const t=await s(()=>import("./index-ByG0P9zl.js").then(e=>e.i),__vite__mapDeps([0,1,2,3])),a=await l(r),n=await t.convertToHtml({arrayBuffer:a});e||i(n.value)}catch(t){e||c(t instanceof Error?t.message:"Failed to render docx")}finally{e||u(!1)}})(),()=>{e=!0}},[r]),x?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Word 文档中..."}):d?e.jsx("p",{className:"text-sm text-destructive p-4",children:d}):e.jsx("div",{className:"p-6 prose dark:prose-invert max-w-none",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize(o)}})}function i({filePath:r,zoom:a}){var o;const[i,d]=t.useState([]),[c,x]=t.useState(0),[u,p]=t.useState(null),[m,f]=t.useState(!0);return t.useEffect(()=>{let e=!1;return f(!0),p(null),(async()=>{try{const t=await s(()=>import("./xlsx-DfDjAMCE.js"),[]),a=await l(r),n=t.read(a,{type:"array"}),o=n.SheetNames.map(e=>({name:e,html:t.utils.sheet_to_html(n.Sheets[e],{editable:!1})}));e||(d(o),x(0))}catch(t){e||p(t instanceof Error?t.message:"Failed to render xlsx")}finally{e||f(!1)}})(),()=>{e=!0}},[r]),m?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Excel 文件中..."}):u?e.jsx("p",{className:"text-sm text-destructive p-4",children:u}):0===i.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsxs("div",{className:"flex flex-col h-full",children:[i.length>1&&e.jsx("div",{className:"flex gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30 flex-shrink-0 overflow-x-auto",children:i.map((t,s)=>e.jsx("button",{onClick:()=>x(s),className:"px-3 py-1 text-xs rounded-t transition-colors whitespace-nowrap "+(s===c?"bg-background text-foreground border border-b-0 border-border":"text-muted-foreground hover:text-foreground"),children:t.name},s))}),e.jsx("div",{className:"flex-1 overflow-auto p-2 xlsx-preview",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize((null==(o=i[c])?void 0:o.html)??"")}}),e.jsx("style",{children:"\n .xlsx-preview table { border-collapse: collapse; width: auto; min-width: 100%; }\n .xlsx-preview td, .xlsx-preview th {\n border: 1px solid hsl(var(--border));\n padding: 4px 8px;\n text-align: left;\n white-space: nowrap;\n font-size: inherit;\n }\n .xlsx-preview th { background: hsl(var(--muted)); font-weight: 600; }\n .xlsx-preview tr:hover td { background: hsl(var(--accent) / 0.3); }\n "})]})}function d({filePath:r,zoom:a}){const[n,o]=t.useState([]),[i,d]=t.useState(null),[c,x]=t.useState(!0);return t.useEffect(()=>{let e=!1;return x(!0),d(null),(async()=>{try{const t=await l(r),a=await async function(e){const{default:t}=await s(async()=>{const{default:e}=await import("./jszip.min-CaL6bUDj.js").then(e=>e.j);return{default:e}},__vite__mapDeps([3,1,2])),r=await t.loadAsync(e),a=[],n=Object.keys(r.files).filter(e=>/^ppt\/slides\/slide\d+\.xml$/i.test(e)).sort((e,t)=>{var s,r;return parseInt((null==(s=e.match(/slide(\d+)/))?void 0:s[1])??"0")-parseInt((null==(r=t.match(/slide(\d+)/))?void 0:r[1])??"0")});for(let s=0;s<n.length;s++){const e=await r.file(n[s]).async("text"),t=[],l=/<a:t[^>]*>([\s\S]*?)<\/a:t>/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').trim();e&&t.push(e)}a.push({index:s+1,texts:t})}return a}(t);e||o(a)}catch(t){e||d(t instanceof Error?t.message:"Failed to render pptx")}finally{e||x(!1)}})(),()=>{e=!0}},[r]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 PPT 文件中..."}):i?e.jsx("p",{className:"text-sm text-destructive p-4",children:i}):0===n.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsx("div",{className:"p-4 space-y-4",style:{fontSize:12*a/100+"px"},children:n.map(t=>e.jsxs("div",{className:"border border-border rounded-xl p-5 bg-muted/20",children:[e.jsxs("div",{className:"text-xs text-muted-foreground mb-2 font-medium",children:["Slide ",t.index]}),t.texts.length>0?e.jsx("div",{className:"space-y-1.5",children:t.texts.map((t,s)=>e.jsx("p",{className:"text-foreground leading-relaxed",style:{fontSize:"inherit"},children:t},s))}):e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"(无文本内容)"})]},t.index))})}const c=new Set(["docx","xlsx","xls","pptx"]);function x({filePath:t,ext:s,zoom:r}){return"docx"===s?e.jsx(o,{filePath:t,zoom:r}):"xlsx"===s||"xls"===s?e.jsx(i,{filePath:t,zoom:r}):"pptx"===s?e.jsx(d,{filePath:t,zoom:r}):null}export{c as OFFICE_EXTS,x as OfficePreview};
@@ -1,11 +1,11 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphPreview-DIiARd_8.js","assets/index-BYUYfbwU.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js","assets/AssistantMessageContent-BTANxhK5.js","assets/chevron-down-bX-OgZFC.js","assets/chevron-up-7fAOg_hP.js","assets/AssistantMessageContent-wklAmtGL.css","assets/index-BX3QW1XT.js","assets/search-Bk9KisxM.js","assets/OfficePreview-BbGnMRJ-.js"])))=>i.map(i=>d[i]);
2
- var e,t,i,s,r,n;import{c as o,u as a,r as l,a as h,g as c,b as d,w as u,t as f,j as _,d as p,E as m,P as g,M as v,e as b,X as S,f as w,h as x,S as y,R as C,_ as k,s as E,i as N,k as R,D as M,T as D,l as L,F as P,m as T,n as j,C as B,o as A,A as O,p as I,q as z,v as W,B as H,x as F,y as $,I as U,z as K,G as q,H as V,J as Y,K as X,L as G,N as J,O as Z,Q,U as ee,V as te,W as ie,Y as se,Z as re,$ as ne,a0 as oe,a1 as ae,a2 as le,a3 as he,a4 as ce,a5 as de,a6 as ue,a7 as fe,a8 as _e,a9 as pe,aa as me,ab as ge,ac as ve,ad as be,ae as Se,af as we,ag as xe,ah as ye,ai as Ce,aj as ke,ak as Ee,al as Ne,am as Re,an as Me,ao as De,ap as Le,aq as Pe,ar as Te,as as je,at as Be,au as Ae,av as Oe,aw as Ie,ax as ze,ay as We,az as He,aA as Fe,aB as $e,aC as Ue,aD as Ke,aE as qe,aF as Ve,aG as Ye,aH as Xe,aI as Ge,aJ as Je,aK as Ze,aL as Qe,aM as et,aN as tt,aO as it,aP as st,aQ as rt,aR as nt,aS as ot,aT as at,aU as lt,aV as ht,aW as ct,aX as dt,aY as ut,aZ as ft,a_ as _t,a$ as pt,b0 as mt,b1 as gt,b2 as vt}from"./index-BYUYfbwU.js";import{p as bt}from"./purify.es-CgRAQgUo.js";import{F as St,M as wt,r as xt,a as yt,b as Ct,c as kt,h as Et,o as Nt,d as Rt,e as Mt,I as Dt,C as Lt,u as Pt,A as Tt,T as jt,f as Bt}from"./AssistantMessageContent-BTANxhK5.js";import{S as At,U as Ot,T as It,a as zt,b as Wt,c as Ht,u as Ft,R as $t,A as Ut,d as Kt,e as qt,f as Vt,I as Yt,g as Xt,C as Gt,h as Jt,i as Zt,j as Qt}from"./index-BX3QW1XT.js";import{C as ei}from"./chevron-down-bX-OgZFC.js";import{S as ti}from"./search-Bk9KisxM.js";import{C as ii}from"./chevron-up-7fAOg_hP.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphPreview-BnXJj0a5.js","assets/index-C2CvLxhQ.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js","assets/AssistantMessageContent-CfeXY1pI.js","assets/chevron-down-BTiZGbq0.js","assets/chevron-up-D4HVI5mq.js","assets/AssistantMessageContent-wklAmtGL.css","assets/index-CwVTA5xf.js","assets/search-BLcN7tH3.js","assets/OfficePreview-24QUV5er.js"])))=>i.map(i=>d[i]);
2
+ var e,t,i,s,r,n;import{c as o,u as a,r as l,a as h,g as c,b as d,w as u,t as f,j as _,d as p,E as m,P as g,M as v,e as b,X as S,f as w,h as x,S as y,R as C,_ as k,s as E,i as N,k as R,D as M,T as D,l as L,F as P,m as T,n as j,C as B,o as A,A as O,p as I,q as z,v as W,B as H,x as F,y as $,I as U,z as K,G as q,H as V,J as Y,K as X,L as G,N as J,O as Z,Q,U as ee,V as te,W as ie,Y as se,Z as re,$ as ne,a0 as oe,a1 as ae,a2 as le,a3 as he,a4 as ce,a5 as de,a6 as ue,a7 as fe,a8 as _e,a9 as pe,aa as me,ab as ge,ac as ve,ad as be,ae as Se,af as we,ag as xe,ah as ye,ai as Ce,aj as ke,ak as Ee,al as Ne,am as Re,an as Me,ao as De,ap as Le,aq as Pe,ar as Te,as as je,at as Be,au as Ae,av as Oe,aw as Ie,ax as ze,ay as We,az as He,aA as Fe,aB as $e,aC as Ue,aD as Ke,aE as qe,aF as Ve,aG as Ye,aH as Xe,aI as Ge,aJ as Je,aK as Ze,aL as Qe,aM as et,aN as tt,aO as it,aP as st,aQ as rt,aR as nt,aS as ot,aT as at,aU as lt,aV as ht,aW as ct,aX as dt,aY as ut,aZ as ft,a_ as _t,a$ as pt,b0 as mt,b1 as gt,b2 as vt}from"./index-C2CvLxhQ.js";import{p as bt}from"./purify.es-CgRAQgUo.js";import{F as St,M as wt,r as xt,a as yt,b as Ct,c as kt,h as Et,o as Nt,d as Rt,e as Mt,I as Dt,C as Lt,u as Pt,A as Tt,T as jt,f as Bt}from"./AssistantMessageContent-CfeXY1pI.js";import{S as At,U as Ot,T as It,a as zt,b as Wt,c as Ht,u as Ft,R as $t,A as Ut,d as Kt,e as qt,f as Vt,I as Yt,g as Xt,C as Gt,h as Jt,i as Zt,j as Qt}from"./index-CwVTA5xf.js";import{C as ei}from"./chevron-down-BTiZGbq0.js";import{S as ti}from"./search-BLcN7tH3.js";import{C as ii}from"./chevron-up-D4HVI5mq.js";
3
3
  /**
4
4
  * @license lucide-react v0.309.0 - ISC
5
5
  *
6
6
  * This source code is licensed under the ISC license.
7
7
  * See the LICENSE file in the root directory of this source tree.
8
- */const si=o("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),ri=o("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),ni=o("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),oi=o("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),ai=o("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),li=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),hi=o("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),ci=o("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),di=o("ListRestart",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M7 12H3",key:"13ou7f"}],["path",{d:"M7 18H3",key:"1sijw9"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14",key:"qth677"}],["path",{d:"M11 10v4h4",key:"172dkj"}]]),ui=o("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),fi=o("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),_i=o("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),pi=o("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),mi=o("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),gi=o("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),vi=o("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),bi=o("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]),Si=o("StopCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]),wi=o("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),xi=o("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),yi=C.lazy(()=>k(()=>import("./GraphPreview-DIiARd_8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(e=>({default:e.GraphPreview}))),Ci=C.lazy(()=>k(()=>import("./OfficePreview-BbGnMRJ-.js"),__vite__mapDeps([10,1,2,3])).then(e=>({default:e.OfficePreview}))),ki=new Set(["docx","xlsx","xls","pptx"]),Ei={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};
8
+ */const si=o("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),ri=o("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),ni=o("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),oi=o("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),ai=o("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),li=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),hi=o("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),ci=o("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),di=o("ListRestart",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M7 12H3",key:"13ou7f"}],["path",{d:"M7 18H3",key:"1sijw9"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14",key:"qth677"}],["path",{d:"M11 10v4h4",key:"172dkj"}]]),ui=o("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),fi=o("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),_i=o("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),pi=o("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),mi=o("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),gi=o("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),vi=o("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),bi=o("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]),Si=o("StopCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]),wi=o("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),xi=o("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),yi=C.lazy(()=>k(()=>import("./GraphPreview-BnXJj0a5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(e=>({default:e.GraphPreview}))),Ci=C.lazy(()=>k(()=>import("./OfficePreview-24QUV5er.js"),__vite__mapDeps([10,1,2,3])).then(e=>({default:e.OfficePreview}))),ki=new Set(["docx","xlsx","xls","pptx"]),Ei={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};
9
9
  /**
10
10
  * @license lucide-react v0.309.0 - ISC
11
11
  *
@@ -1,4 +1,4 @@
1
- import{c as e,r as s,$ as t,b3 as n,j as a,a1 as r,a0 as l,W as o,d as i,U as c,b4 as d,aR as u,Z as h,b5 as m,V as p,a2 as x,a4 as f,a5 as g,a6 as v,a7 as j,x as b,aF as y,b6 as w,t as N,al as k,I as S,B as C,aK as _,X as R,D as P,b7 as E,b8 as I,b9 as T,ba as M,u as D,bb as A,T as H,bc as O,bd as L,be as V,bf as F,bg as B,aE as z,bh as W,bi as $,h as K,S as U,bj as q,aG as G,K as Z,s as X,bk as Q}from"./index-BYUYfbwU.js";import{k as Y,u as J,R as ee,d as se,f as te,A as ne,C as ae,j as re,h as le,S as oe,U as ie,i as ce,T as de,a as ue,b as he,c as me}from"./index-BX3QW1XT.js";import{C as pe}from"./chevron-down-bX-OgZFC.js";import{C as xe,a as fe}from"./chevron-up-7fAOg_hP.js";
1
+ import{c as e,r as s,$ as t,b3 as n,j as a,a1 as r,a0 as l,W as o,d as i,U as c,b4 as d,aR as u,Z as h,b5 as m,V as p,a2 as x,a4 as f,a5 as g,a6 as v,a7 as j,x as b,aF as y,b6 as w,t as N,al as k,I as S,B as C,aK as _,X as R,D as P,b7 as E,b8 as I,b9 as T,ba as M,u as D,bb as A,T as H,bc as O,bd as L,be as V,bf as F,bg as B,aE as z,bh as W,bi as $,h as K,S as U,bj as q,aG as G,K as Z,s as X,bk as Q}from"./index-C2CvLxhQ.js";import{k as Y,u as J,R as ee,d as se,f as te,A as ne,C as ae,j as re,h as le,S as oe,U as ie,i as ce,T as de,a as ue,b as he,c as me}from"./index-CwVTA5xf.js";import{C as pe}from"./chevron-down-BTiZGbq0.js";import{C as xe,a as fe}from"./chevron-up-D4HVI5mq.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as e,aE as s,r as t,bn as a,bo as r,t as n,bp as l,bq as i,br as c,ab as d,bs as o,j as m,B as x,aG as u,d as p,I as h,T as g,p as f,D as b,aB as j,aC as N,A as y,an as v,at as k}from"./index-BYUYfbwU.js";import{S as w}from"./search-Bk9KisxM.js";import{C}from"./chevron-down-bX-OgZFC.js";
1
+ import{c as e,aE as s,r as t,bn as a,bo as r,t as n,bp as l,bq as i,br as c,ab as d,bs as o,j as m,B as x,aG as u,d as p,I as h,T as g,p as f,D as b,aB as j,aC as N,A as y,an as v,at as k}from"./index-C2CvLxhQ.js";import{S as w}from"./search-BLcN7tH3.js";import{C}from"./chevron-down-BTiZGbq0.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-BYUYfbwU.js";
1
+ import{c as o}from"./index-C2CvLxhQ.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-BYUYfbwU.js";
1
+ import{c as e}from"./index-C2CvLxhQ.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *