@tom2012/cc-web 2026.4.25-a → 2026.4.26-a

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/adapters/claude/scheduled.d.ts +12 -13
  3. package/backend/dist/adapters/claude/scheduled.d.ts.map +1 -1
  4. package/backend/dist/adapters/claude/scheduled.js +27 -82
  5. package/backend/dist/adapters/claude/scheduled.js.map +1 -1
  6. package/frontend/dist/assets/{AssistantMessageContent-C4lyyfDm.js → AssistantMessageContent-D4Wm1DYe.js} +1 -1
  7. package/frontend/dist/assets/{GraphPreview-BRdkqlmD.js → GraphPreview-BHFhL4fV.js} +1 -1
  8. package/frontend/dist/assets/{MobilePage-qi0dfILy.js → MobilePage-BbMYb_fT.js} +3 -3
  9. package/frontend/dist/assets/{OfficePreview-BzBMiH_d.js → OfficePreview-Dah62nhN.js} +2 -2
  10. package/frontend/dist/assets/{ProjectPage-BqLfh1iX.js → ProjectPage-Bs5psd0R.js} +3 -3
  11. package/frontend/dist/assets/{SettingsPage-BzQIJxGE.js → SettingsPage-C6aUa7yV.js} +1 -1
  12. package/frontend/dist/assets/{SkillHubPage-CqPvzIcM.js → SkillHubPage-olcv0_pc.js} +1 -1
  13. package/frontend/dist/assets/{chevron-down-B_nhBlPg.js → chevron-down-CD91RjkB.js} +1 -1
  14. package/frontend/dist/assets/{chevron-up-Bod9VZ9-.js → chevron-up-Dm_1T3Ta.js} +1 -1
  15. package/frontend/dist/assets/{index-SO3nb-2m.js → index-BAXK8jaU.js} +1 -1
  16. package/frontend/dist/assets/{index-Ok4Og1hF.js → index-BzIwL5mK.js} +1 -1
  17. package/frontend/dist/assets/{index-CS2kkdD8.js → index-CHdNhmuD.js} +2 -2
  18. package/frontend/dist/assets/{jszip.min-D2NE_gdV.js → jszip.min-COWU92WI.js} +1 -1
  19. package/frontend/dist/assets/{search-6b8P41jh.js → search-BxWnQMGo.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.25-a | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
5
+ **Current version**: v2026.4.26-a | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
6
6
 
7
7
  ## Features
8
8
 
@@ -1,13 +1,18 @@
1
1
  /**
2
2
  * Claude Code CLI scheduled-tasks reader.
3
3
  *
4
- * Reads `~/.claude/scheduled_tasks.json` (durable /loop tasks Claude wrote
5
- * via CronCreate / ScheduleWakeup with `durable: true`) and filters to the
6
- * tasks whose originating session's cwd matches a given project folderPath.
4
+ * Reads `<projectFolderPath>/.claude/scheduled_tasks.json` (durable /loop
5
+ * tasks Claude wrote via CronCreate / ScheduleWakeup with `durable: true`).
7
6
  *
8
- * Claude CLI path / schema reverse-engineered from v2.1.117 Mach-O binary
9
- * (see research/scheduled-wakeup-panel-plan.md). Session-only tasks are
10
- * invisible here they live in CLI process memory, never hit disk.
7
+ * Path is per-project: Claude resolves `path.join(".claude",
8
+ * "scheduled_tasks.json")` relative to its working directory, so each
9
+ * project keeps its own file. Session-only tasks (default ScheduleWakeup
10
+ * and CronCreate without durable:true) live in CLI process memory and
11
+ * never hit disk — they are invisible to ccweb by design.
12
+ *
13
+ * Schema reverse-engineered from 2.1.119 Mach-O binary (BL1 constant,
14
+ * wQ_ creator function). Earlier versions of this file assumed a global
15
+ * `~/.claude/scheduled_tasks.json` — that was wrong.
11
16
  */
12
17
  export interface RawScheduledTask {
13
18
  id: string;
@@ -23,12 +28,6 @@ export interface RawScheduledTask {
23
28
  export interface ScheduledTask extends RawScheduledTask {
24
29
  nextFireAt: string | null;
25
30
  }
26
- export declare function loadScheduledTasks(): RawScheduledTask[];
27
- /**
28
- * Return scheduled tasks whose originating session's cwd === folderPath.
29
- * Tasks without `createdBySessionId` (agent/headless-created, rare) are
30
- * excluded — we can't attribute them. Tasks whose session has exited
31
- * (stale sessions file cleanup) are also excluded, by design.
32
- */
31
+ export declare function loadScheduledTasks(folderPath: string): RawScheduledTask[];
33
32
  export declare function tasksForProject(folderPath: string): ScheduledTask[];
34
33
  //# sourceMappingURL=scheduled.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scheduled.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude/scheduled.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,IAAI,gBAAgB,EAAE,CAmBvD;AA8DD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,EAAE,CAgBnE"}
1
+ {"version":3,"file":"scheduled.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude/scheduled.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAMD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAqBzE;AAgBD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,EAAE,CAOnE"}
@@ -2,13 +2,18 @@
2
2
  /**
3
3
  * Claude Code CLI scheduled-tasks reader.
4
4
  *
5
- * Reads `~/.claude/scheduled_tasks.json` (durable /loop tasks Claude wrote
6
- * via CronCreate / ScheduleWakeup with `durable: true`) and filters to the
7
- * tasks whose originating session's cwd matches a given project folderPath.
5
+ * Reads `<projectFolderPath>/.claude/scheduled_tasks.json` (durable /loop
6
+ * tasks Claude wrote via CronCreate / ScheduleWakeup with `durable: true`).
8
7
  *
9
- * Claude CLI path / schema reverse-engineered from v2.1.117 Mach-O binary
10
- * (see research/scheduled-wakeup-panel-plan.md). Session-only tasks are
11
- * invisible here they live in CLI process memory, never hit disk.
8
+ * Path is per-project: Claude resolves `path.join(".claude",
9
+ * "scheduled_tasks.json")` relative to its working directory, so each
10
+ * project keeps its own file. Session-only tasks (default ScheduleWakeup
11
+ * and CronCreate without durable:true) live in CLI process memory and
12
+ * never hit disk — they are invisible to ccweb by design.
13
+ *
14
+ * Schema reverse-engineered from 2.1.119 Mach-O binary (BL1 constant,
15
+ * wQ_ creator function). Earlier versions of this file assumed a global
16
+ * `~/.claude/scheduled_tasks.json` — that was wrong.
12
17
  */
13
18
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
19
  if (k2 === undefined) k2 = k;
@@ -48,76 +53,33 @@ exports.loadScheduledTasks = loadScheduledTasks;
48
53
  exports.tasksForProject = tasksForProject;
49
54
  const fs = __importStar(require("fs"));
50
55
  const path = __importStar(require("path"));
51
- const os = __importStar(require("os"));
52
56
  const cron_parser_1 = require("cron-parser");
53
57
  const logger_1 = require("../../logger");
54
58
  const log = (0, logger_1.modLogger)('scheduled');
55
- const SCHEDULED_FILE = path.join(os.homedir(), '.claude', 'scheduled_tasks.json');
56
- const SESSIONS_DIR = path.join(os.homedir(), '.claude', 'sessions');
57
- function loadScheduledTasks() {
59
+ function scheduledFileFor(folderPath) {
60
+ return path.join(folderPath, '.claude', 'scheduled_tasks.json');
61
+ }
62
+ function loadScheduledTasks(folderPath) {
63
+ const file = scheduledFileFor(folderPath);
58
64
  try {
59
- if (!fs.existsSync(SCHEDULED_FILE))
65
+ if (!fs.existsSync(file))
60
66
  return [];
61
- const raw = fs.readFileSync(SCHEDULED_FILE, 'utf-8');
67
+ const raw = fs.readFileSync(file, 'utf-8');
62
68
  const parsed = JSON.parse(raw);
63
69
  if (!Array.isArray(parsed)) {
64
- log.warn({ file: SCHEDULED_FILE }, 'scheduled_tasks.json is not an array');
70
+ log.warn({ file }, 'scheduled_tasks.json is not an array');
65
71
  return [];
66
72
  }
67
73
  return parsed.filter((t) => !!t && typeof t === 'object' && typeof t.id === 'string' &&
68
74
  typeof t.cron === 'string' &&
69
- typeof t.prompt === 'string');
75
+ typeof t.prompt === 'string' &&
76
+ typeof t.createdAt === 'number');
70
77
  }
71
78
  catch (err) {
72
- log.warn({ err, file: SCHEDULED_FILE }, 'failed to read scheduled_tasks.json');
79
+ log.warn({ err, file }, 'failed to read scheduled_tasks.json');
73
80
  return [];
74
81
  }
75
82
  }
76
- /**
77
- * Canonicalize an on-disk path for equality comparison: resolve symlinks +
78
- * normalize. Falls back to `path.resolve` if realpath fails (e.g., the path
79
- * no longer exists because the session's cwd was deleted). Without this
80
- * `Project.folderPath` (stored raw at create-time) and the CLI's captured
81
- * `cwd` can differ by trailing slash / symlink even when semantically equal.
82
- */
83
- function canonicalizePath(p) {
84
- try {
85
- return fs.realpathSync(p);
86
- }
87
- catch {
88
- return path.resolve(p);
89
- }
90
- }
91
- /**
92
- * Build a sessionId → canonical-cwd index by scanning `~/.claude/sessions/*.json`.
93
- * Files are named by PID, so we have to open each one. Cheap in practice
94
- * (O(few dozen), small JSON), and this is called at most once per request.
95
- */
96
- function buildSessionCwdIndex() {
97
- const index = new Map();
98
- try {
99
- if (!fs.existsSync(SESSIONS_DIR))
100
- return index;
101
- const files = fs.readdirSync(SESSIONS_DIR);
102
- for (const f of files) {
103
- if (!f.endsWith('.json'))
104
- continue;
105
- try {
106
- const raw = fs.readFileSync(path.join(SESSIONS_DIR, f), 'utf-8');
107
- const meta = JSON.parse(raw);
108
- if (meta.sessionId && meta.cwd)
109
- index.set(meta.sessionId, canonicalizePath(meta.cwd));
110
- }
111
- catch {
112
- // per-file parse failure is non-fatal; skip
113
- }
114
- }
115
- }
116
- catch (err) {
117
- log.warn({ err, dir: SESSIONS_DIR }, 'failed to scan sessions dir');
118
- }
119
- return index;
120
- }
121
83
  function computeNextFire(cron, fromHint) {
122
84
  // We want the next FUTURE fire. If the hint (lastFiredAt or createdAt) is
123
85
  // in the past (because the creator process died or the file is stale),
@@ -132,30 +94,13 @@ function computeNextFire(cron, fromHint) {
132
94
  return null;
133
95
  }
134
96
  }
135
- /**
136
- * Return scheduled tasks whose originating session's cwd === folderPath.
137
- * Tasks without `createdBySessionId` (agent/headless-created, rare) are
138
- * excluded — we can't attribute them. Tasks whose session has exited
139
- * (stale sessions file cleanup) are also excluded, by design.
140
- */
141
97
  function tasksForProject(folderPath) {
142
- const all = loadScheduledTasks();
98
+ const all = loadScheduledTasks(folderPath);
143
99
  if (all.length === 0)
144
100
  return [];
145
- const idx = buildSessionCwdIndex();
146
- const targetCwd = canonicalizePath(folderPath);
147
- const out = [];
148
- for (const t of all) {
149
- if (!t.createdBySessionId)
150
- continue;
151
- const cwd = idx.get(t.createdBySessionId);
152
- if (cwd !== targetCwd)
153
- continue;
154
- out.push({
155
- ...t,
156
- nextFireAt: computeNextFire(t.cron, t.lastFiredAt ?? t.createdAt),
157
- });
158
- }
159
- return out;
101
+ return all.map((t) => ({
102
+ ...t,
103
+ nextFireAt: computeNextFire(t.cron, t.lastFiredAt ?? t.createdAt),
104
+ }));
160
105
  }
161
106
  //# sourceMappingURL=scheduled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scheduled.js","sourceRoot":"","sources":["../../../src/adapters/claude/scheduled.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,gDAmBC;AAoED,0CAgBC;AAlID,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,6CAAmD;AACnD,yCAAyC;AAEzC,MAAM,GAAG,GAAG,IAAA,kBAAS,EAAC,WAAW,CAAC,CAAC;AAEnC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAClF,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAkBpE,SAAgB,kBAAkB;IAChC,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC;YAAE,OAAO,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,sCAAsC,CAAC,CAAC;YAC3E,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,CAAC,EAAyB,EAAE,CAC3B,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAQ,CAAsB,CAAC,EAAE,KAAK,QAAQ;YAC9E,OAAQ,CAAsB,CAAC,IAAI,KAAK,QAAQ;YAChD,OAAQ,CAAsB,CAAC,MAAM,KAAK,QAAQ,CACrD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,qCAAqC,CAAC,CAAC;QAC/E,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAOD;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,CAAS;IACjC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB;IAC3B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC3C,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAAE,SAAS;YACnC,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;gBACjE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;gBAC5C,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG;oBAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YACxF,CAAC;YAAC,MAAM,CAAC;gBACP,4CAA4C;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,6BAA6B,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,QAAgB;IACrD,0EAA0E;IAC1E,uEAAuE;IACvE,wEAAwE;IACxE,wDAAwD;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,kCAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9E,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,UAAkB;IAChD,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IACjC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,SAAS,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC/C,MAAM,GAAG,GAAoB,EAAE,CAAC;IAChC,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,CAAC,CAAC,kBAAkB;YAAE,SAAS;QACpC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAC1C,IAAI,GAAG,KAAK,SAAS;YAAE,SAAS;QAChC,GAAG,CAAC,IAAI,CAAC;YACP,GAAG,CAAC;YACJ,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,SAAS,CAAC;SAClE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"scheduled.js","sourceRoot":"","sources":["../../../src/adapters/claude/scheduled.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,gDAqBC;AAgBD,0CAOC;AAvED,uCAAyB;AACzB,2CAA6B;AAC7B,6CAAmD;AACnD,yCAAyC;AAEzC,MAAM,GAAG,GAAG,IAAA,kBAAS,EAAC,WAAW,CAAC,CAAC;AAkBnC,SAAS,gBAAgB,CAAC,UAAkB;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAClE,CAAC;AAED,SAAgB,kBAAkB,CAAC,UAAkB;IACnD,MAAM,IAAI,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;QACpC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,sCAAsC,CAAC,CAAC;YAC3D,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,CAAC,EAAyB,EAAE,CAC3B,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAQ,CAAsB,CAAC,EAAE,KAAK,QAAQ;YAC9E,OAAQ,CAAsB,CAAC,IAAI,KAAK,QAAQ;YAChD,OAAQ,CAAsB,CAAC,MAAM,KAAK,QAAQ;YAClD,OAAQ,CAAsB,CAAC,SAAS,KAAK,QAAQ,CACxD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,qCAAqC,CAAC,CAAC;QAC/D,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,QAAgB;IACrD,0EAA0E;IAC1E,uEAAuE;IACvE,wEAAwE;IACxE,wDAAwD;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,kCAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9E,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,UAAkB;IAChD,MAAM,GAAG,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACrB,GAAG,CAAC;QACJ,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,SAAS,CAAC;KAClE,CAAC,CAAC,CAAC;AACN,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-CS2kkdD8.js";import{C as E}from"./chevron-down-B_nhBlPg.js";import{C as S,a as v}from"./chevron-up-Bod9VZ9-.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-CHdNhmuD.js";import{C as E}from"./chevron-down-CD91RjkB.js";import{C as S,a as v}from"./chevron-up-Dm_1T3Ta.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-CS2kkdD8.js";import{Z as s,a as l}from"./ProjectPage-BqLfh1iX.js";import"./purify.es-CgRAQgUo.js";import"./AssistantMessageContent-C4lyyfDm.js";import"./chevron-down-B_nhBlPg.js";import"./chevron-up-Bod9VZ9-.js";import"./index-SO3nb-2m.js";import"./search-6b8P41jh.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-CHdNhmuD.js";import{Z as s,a as l}from"./ProjectPage-Bs5psd0R.js";import"./purify.es-CgRAQgUo.js";import"./AssistantMessageContent-D4Wm1DYe.js";import"./chevron-down-CD91RjkB.js";import"./chevron-up-Dm_1T3Ta.js";import"./index-BAXK8jaU.js";import"./search-BxWnQMGo.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-BzBMiH_d.js","assets/index-CS2kkdD8.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-CS2kkdD8.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-C4lyyfDm.js";import{C as X}from"./chevron-up-Bod9VZ9-.js";import{C as Y}from"./chevron-down-B_nhBlPg.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OfficePreview-Dah62nhN.js","assets/index-CHdNhmuD.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-CHdNhmuD.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-D4Wm1DYe.js";import{C as X}from"./chevron-up-Dm_1T3Ta.js";import{C as Y}from"./chevron-down-CD91RjkB.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-BzBMiH_d.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-CS2kkdD8.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-Dah62nhN.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-CHdNhmuD.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-Ok4Og1hF.js","assets/index-CS2kkdD8.js","assets/index-ChWqp_e7.css","assets/jszip.min-D2NE_gdV.js"])))=>i.map(i=>d[i]);
2
- import{j as e,r as t,_ as s,g as r,f as a}from"./index-CS2kkdD8.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-Ok4Og1hF.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-D2NE_gdV.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-BzIwL5mK.js","assets/index-CHdNhmuD.js","assets/index-ChWqp_e7.css","assets/jszip.min-COWU92WI.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as t,_ as s,g as r,f as a}from"./index-CHdNhmuD.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-BzIwL5mK.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-COWU92WI.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-BRdkqlmD.js","assets/index-CS2kkdD8.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js","assets/AssistantMessageContent-C4lyyfDm.js","assets/chevron-down-B_nhBlPg.js","assets/chevron-up-Bod9VZ9-.js","assets/AssistantMessageContent-wklAmtGL.css","assets/index-SO3nb-2m.js","assets/search-6b8P41jh.js","assets/OfficePreview-BzBMiH_d.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-CS2kkdD8.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-C4lyyfDm.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-SO3nb-2m.js";import{C as ei}from"./chevron-down-B_nhBlPg.js";import{S as ti}from"./search-6b8P41jh.js";import{C as ii}from"./chevron-up-Bod9VZ9-.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphPreview-BHFhL4fV.js","assets/index-CHdNhmuD.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js","assets/AssistantMessageContent-D4Wm1DYe.js","assets/chevron-down-CD91RjkB.js","assets/chevron-up-Dm_1T3Ta.js","assets/AssistantMessageContent-wklAmtGL.css","assets/index-BAXK8jaU.js","assets/search-BxWnQMGo.js","assets/OfficePreview-Dah62nhN.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-CHdNhmuD.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-D4Wm1DYe.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-BAXK8jaU.js";import{C as ei}from"./chevron-down-CD91RjkB.js";import{S as ti}from"./search-BxWnQMGo.js";import{C as ii}from"./chevron-up-Dm_1T3Ta.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-BRdkqlmD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(e=>({default:e.GraphPreview}))),Ci=C.lazy(()=>k(()=>import("./OfficePreview-BzBMiH_d.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-BHFhL4fV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(e=>({default:e.GraphPreview}))),Ci=C.lazy(()=>k(()=>import("./OfficePreview-Dah62nhN.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-CS2kkdD8.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-SO3nb-2m.js";import{C as pe}from"./chevron-down-B_nhBlPg.js";import{C as xe,a as fe}from"./chevron-up-Bod9VZ9-.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-CHdNhmuD.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-BAXK8jaU.js";import{C as pe}from"./chevron-down-CD91RjkB.js";import{C as xe,a as fe}from"./chevron-up-Dm_1T3Ta.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-CS2kkdD8.js";import{S as w}from"./search-6b8P41jh.js";import{C}from"./chevron-down-B_nhBlPg.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-CHdNhmuD.js";import{S as w}from"./search-BxWnQMGo.js";import{C}from"./chevron-down-CD91RjkB.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-CS2kkdD8.js";
1
+ import{c as o}from"./index-CHdNhmuD.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-CS2kkdD8.js";
1
+ import{c as e}from"./index-CHdNhmuD.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *