@kaitranntt/ccs 7.79.1-dev.5 → 7.79.1-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -11
- package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
- package/dist/bin/ccsxp-runtime.js +8 -0
- package/dist/bin/ccsxp-runtime.js.map +1 -1
- package/dist/bin/codex-runtime-router.d.ts +24 -0
- package/dist/bin/codex-runtime-router.d.ts.map +1 -0
- package/dist/bin/codex-runtime-router.js +91 -0
- package/dist/bin/codex-runtime-router.js.map +1 -0
- package/dist/bin/codex-runtime.d.ts +1 -0
- package/dist/bin/codex-runtime.js +7 -2
- package/dist/bin/codex-runtime.js.map +1 -1
- package/dist/codex-auth/codex-account-identity.d.ts +8 -0
- package/dist/codex-auth/codex-account-identity.d.ts.map +1 -0
- package/dist/codex-auth/codex-account-identity.js +53 -0
- package/dist/codex-auth/codex-account-identity.js.map +1 -0
- package/dist/codex-auth/codex-auth-dashboard-service.d.ts +46 -0
- package/dist/codex-auth/codex-auth-dashboard-service.d.ts.map +1 -0
- package/dist/codex-auth/codex-auth-dashboard-service.js +228 -0
- package/dist/codex-auth/codex-auth-dashboard-service.js.map +1 -0
- package/dist/codex-auth/codex-auth-help.d.ts +7 -0
- package/dist/codex-auth/codex-auth-help.d.ts.map +1 -0
- package/dist/codex-auth/codex-auth-help.js +87 -0
- package/dist/codex-auth/codex-auth-help.js.map +1 -0
- package/dist/codex-auth/codex-auth-router.d.ts +16 -0
- package/dist/codex-auth/codex-auth-router.d.ts.map +1 -0
- package/dist/codex-auth/codex-auth-router.js +77 -0
- package/dist/codex-auth/codex-auth-router.js.map +1 -0
- package/dist/codex-auth/codex-config-symlink.d.ts +14 -0
- package/dist/codex-auth/codex-config-symlink.d.ts.map +1 -0
- package/dist/codex-auth/codex-config-symlink.js +128 -0
- package/dist/codex-auth/codex-config-symlink.js.map +1 -0
- package/dist/codex-auth/codex-profile-paths.d.ts +5 -0
- package/dist/codex-auth/codex-profile-paths.d.ts.map +1 -0
- package/dist/codex-auth/codex-profile-paths.js +58 -0
- package/dist/codex-auth/codex-profile-paths.js.map +1 -0
- package/dist/codex-auth/codex-profile-registry.d.ts +34 -0
- package/dist/codex-auth/codex-profile-registry.d.ts.map +1 -0
- package/dist/codex-auth/codex-profile-registry.js +360 -0
- package/dist/codex-auth/codex-profile-registry.js.map +1 -0
- package/dist/codex-auth/commands/create-command.d.ts +9 -0
- package/dist/codex-auth/commands/create-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/create-command.js +189 -0
- package/dist/codex-auth/commands/create-command.js.map +1 -0
- package/dist/codex-auth/commands/import-default-command.d.ts +18 -0
- package/dist/codex-auth/commands/import-default-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/import-default-command.js +385 -0
- package/dist/codex-auth/commands/import-default-command.js.map +1 -0
- package/dist/codex-auth/commands/index.d.ts +13 -0
- package/dist/codex-auth/commands/index.d.ts.map +1 -0
- package/dist/codex-auth/commands/index.js +27 -0
- package/dist/codex-auth/commands/index.js.map +1 -0
- package/dist/codex-auth/commands/login-command.d.ts +9 -0
- package/dist/codex-auth/commands/login-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/login-command.js +152 -0
- package/dist/codex-auth/commands/login-command.js.map +1 -0
- package/dist/codex-auth/commands/remove-command.d.ts +10 -0
- package/dist/codex-auth/commands/remove-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/remove-command.js +230 -0
- package/dist/codex-auth/commands/remove-command.js.map +1 -0
- package/dist/codex-auth/commands/show-command.d.ts +10 -0
- package/dist/codex-auth/commands/show-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/show-command.js +127 -0
- package/dist/codex-auth/commands/show-command.js.map +1 -0
- package/dist/codex-auth/commands/show-detail-view.d.ts +7 -0
- package/dist/codex-auth/commands/show-detail-view.d.ts.map +1 -0
- package/dist/codex-auth/commands/show-detail-view.js +134 -0
- package/dist/codex-auth/commands/show-detail-view.js.map +1 -0
- package/dist/codex-auth/commands/switch-command.d.ts +7 -0
- package/dist/codex-auth/commands/switch-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/switch-command.js +48 -0
- package/dist/codex-auth/commands/switch-command.js.map +1 -0
- package/dist/codex-auth/commands/types.d.ts +45 -0
- package/dist/codex-auth/commands/types.d.ts.map +1 -0
- package/dist/codex-auth/commands/types.js +85 -0
- package/dist/codex-auth/commands/types.js.map +1 -0
- package/dist/codex-auth/commands/use-command.d.ts +16 -0
- package/dist/codex-auth/commands/use-command.d.ts.map +1 -0
- package/dist/codex-auth/commands/use-command.js +86 -0
- package/dist/codex-auth/commands/use-command.js.map +1 -0
- package/dist/codex-auth/decode-id-token.d.ts +12 -0
- package/dist/codex-auth/decode-id-token.d.ts.map +1 -0
- package/dist/codex-auth/decode-id-token.js +83 -0
- package/dist/codex-auth/decode-id-token.js.map +1 -0
- package/dist/codex-auth/index.d.ts +8 -0
- package/dist/codex-auth/index.d.ts.map +1 -0
- package/dist/codex-auth/index.js +19 -0
- package/dist/codex-auth/index.js.map +1 -0
- package/dist/codex-auth/resolve-active-profile.d.ts +13 -0
- package/dist/codex-auth/resolve-active-profile.d.ts.map +1 -0
- package/dist/codex-auth/resolve-active-profile.js +161 -0
- package/dist/codex-auth/resolve-active-profile.js.map +1 -0
- package/dist/codex-auth/shell-detect.d.ts +19 -0
- package/dist/codex-auth/shell-detect.d.ts.map +1 -0
- package/dist/codex-auth/shell-detect.js +129 -0
- package/dist/codex-auth/shell-detect.js.map +1 -0
- package/dist/codex-auth/types.d.ts +26 -0
- package/dist/codex-auth/types.d.ts.map +1 -0
- package/dist/codex-auth/types.js +34 -0
- package/dist/codex-auth/types.js.map +1 -0
- package/dist/dispatcher/pre-dispatch.d.ts.map +1 -1
- package/dist/dispatcher/pre-dispatch.js +7 -0
- package/dist/dispatcher/pre-dispatch.js.map +1 -1
- package/dist/ui/assets/Trans-J6qQqjkU.js +1 -0
- package/dist/ui/assets/{accounts-C-sOjvWS.js → accounts-B9Y9uOFl.js} +1 -1
- package/dist/ui/assets/{alert-dialog-BrOo6Lh3.js → alert-dialog-B7gsksZn.js} +1 -1
- package/dist/ui/assets/{api-CXdC3ABc.js → api-Cz8U6P7R.js} +1 -1
- package/dist/ui/assets/{auth-section-XJ5PohAT.js → auth-section-C8dzvYje.js} +1 -1
- package/dist/ui/assets/{backups-section-DjMi9NN5.js → backups-section-D0dn59k8.js} +1 -1
- package/dist/ui/assets/{channels-dD6o7KFj.js → channels-BEmwDrRW.js} +1 -1
- package/dist/ui/assets/{checkbox-CVS69doq.js → checkbox-DD0s2D_O.js} +1 -1
- package/dist/ui/assets/{claude-extension-D47wkgfq.js → claude-extension-DHVBsw6b.js} +1 -1
- package/dist/ui/assets/{cliproxy-CXgzAe6X.js → cliproxy-BMlbpAIO.js} +2 -2
- package/dist/ui/assets/{cliproxy-ai-providers-POOrpQVc.js → cliproxy-ai-providers-B440rPlH.js} +2 -2
- package/dist/ui/assets/{cliproxy-control-panel-BWa_KiNM.js → cliproxy-control-panel-Bo-Y41B_.js} +1 -1
- package/dist/ui/assets/codex-DPe04ol4.js +30 -0
- package/dist/ui/assets/{confirm-dialog-BuxHs897.js → confirm-dialog-MQNmqmha.js} +1 -1
- package/dist/ui/assets/{copilot-BQ4Cltbo.js → copilot-COZj29YU.js} +1 -1
- package/dist/ui/assets/{cursor-BVUNUVux.js → cursor-D0occhsH.js} +1 -1
- package/dist/ui/assets/{droid-Bw34FF6c.js → droid-CSaYFApd.js} +1 -1
- package/dist/ui/assets/{globalenv-section-B4UDGHiP.js → globalenv-section-BwuNrdbO.js} +1 -1
- package/dist/ui/assets/{health-30TwUdp_.js → health-DjNOO9K-.js} +1 -1
- package/dist/ui/assets/{index-BUBCzEHD.js → index-Bm_0r3qk.js} +1 -1
- package/dist/ui/assets/{index-BxIFAuoV.js → index-Bnzie_zG.js} +1 -1
- package/dist/ui/assets/{index-C6j8gpEb.js → index-CSlgRg0s.js} +27 -27
- package/dist/ui/assets/index-CjM3Ehb8.js +1 -0
- package/dist/ui/assets/{index-BjQ5PWH7.js → index-CmOBelFi.js} +1 -1
- package/dist/ui/assets/{index-DtiygQmg.js → index-D9HfyuQr.js} +1 -1
- package/dist/ui/assets/index-G3mgTfgR.css +1 -0
- package/dist/ui/assets/{index-ByGCSVsI.js → index-i2MPNni3.js} +1 -1
- package/dist/ui/assets/{logs-CDD_WQvt.js → logs-7bWvuc1l.js} +1 -1
- package/dist/ui/assets/{masked-input-DpM1vKP_.js → masked-input-D_amxi96.js} +1 -1
- package/dist/ui/assets/proxy-status-widget-BkC-wCtI.js +1 -0
- package/dist/ui/assets/{raw-json-settings-editor-panel-D-zQkcvr.js → raw-json-settings-editor-panel-CVP5Bjfm.js} +1 -1
- package/dist/ui/assets/{searchable-select-B8Kp0x8p.js → searchable-select-e5sY7o6g.js} +1 -1
- package/dist/ui/assets/{separator-DlXQBF83.js → separator-BR5bmtI7.js} +1 -1
- package/dist/ui/assets/{shared-D_h3QKy6.js → shared-CsqW2cFN.js} +1 -1
- package/dist/ui/assets/{table-Dyt0FuBK.js → table-DPheAd4c.js} +1 -1
- package/dist/ui/assets/{updates-DfIV0IC0.js → updates-D07RjKLJ.js} +1 -1
- package/dist/ui/assets/{use-accounts-Dy2ogHT-.js → use-accounts-CWVR2NXQ.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/web-server/routes/codex-routes.d.ts.map +1 -1
- package/dist/web-server/routes/codex-routes.js +14 -0
- package/dist/web-server/routes/codex-routes.js.map +1 -1
- package/package.json +1 -1
- package/scripts/run-test-bucket.js +1 -0
- package/dist/ui/assets/codex-CYyPdHS4.js +0 -30
- package/dist/ui/assets/index-nSsKQx8t.css +0 -1
- package/dist/ui/assets/index-s94_IKNx.js +0 -1
- package/dist/ui/assets/proxy-status-widget-7iMiOpQe.js +0 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shell detection for codex-auth use command.
|
|
4
|
+
* Determines current shell to emit correct eval-safe export syntax.
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.formatExport = exports.detectShell = void 0;
|
|
31
|
+
const childProcess = __importStar(require("child_process"));
|
|
32
|
+
/**
|
|
33
|
+
* Detect current shell from environment.
|
|
34
|
+
* On Windows: inspect explicit shell executable hints, else default to cmd.
|
|
35
|
+
* On Unix: inspect $SHELL suffix.
|
|
36
|
+
*/
|
|
37
|
+
function detectShell(env = process.env, platform = process.platform, parentProcessName) {
|
|
38
|
+
if (platform === 'win32') {
|
|
39
|
+
return (shellFromExecutable(env.SHELL) ??
|
|
40
|
+
shellFromExecutable(parentProcessName ?? detectParentProcessName(platform)) ??
|
|
41
|
+
shellFromExecutable(env.ComSpec ?? env.COMSPEC) ??
|
|
42
|
+
'cmd');
|
|
43
|
+
}
|
|
44
|
+
const sh = (env.SHELL ?? '').toLowerCase();
|
|
45
|
+
if (sh.endsWith('/fish'))
|
|
46
|
+
return 'fish';
|
|
47
|
+
if (sh.endsWith('/zsh'))
|
|
48
|
+
return 'zsh';
|
|
49
|
+
return 'bash'; // default for bash, sh, dash, ksh
|
|
50
|
+
}
|
|
51
|
+
exports.detectShell = detectShell;
|
|
52
|
+
function detectParentProcessName(platform) {
|
|
53
|
+
if (platform !== 'win32' || !Number.isInteger(process.ppid) || process.ppid <= 0) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const result = childProcess.spawnSync('powershell.exe', [
|
|
57
|
+
'-NoProfile',
|
|
58
|
+
'-NonInteractive',
|
|
59
|
+
'-Command',
|
|
60
|
+
`(Get-Process -Id ${process.ppid} -ErrorAction Stop).ProcessName`,
|
|
61
|
+
], { encoding: 'utf8', timeout: 1500, windowsHide: true });
|
|
62
|
+
if (result.status !== 0 || !result.stdout)
|
|
63
|
+
return undefined;
|
|
64
|
+
return result.stdout.trim().split(/\r?\n/).pop()?.trim();
|
|
65
|
+
}
|
|
66
|
+
function shellFromExecutable(value) {
|
|
67
|
+
if (!value)
|
|
68
|
+
return null;
|
|
69
|
+
const base = value
|
|
70
|
+
.replace(/^["']|["']$/g, '')
|
|
71
|
+
.replace(/\\/g, '/')
|
|
72
|
+
.split('/')
|
|
73
|
+
.pop()
|
|
74
|
+
?.toLowerCase()
|
|
75
|
+
.replace(/\.(exe|cmd|ps1|bat)$/i, '');
|
|
76
|
+
switch (base) {
|
|
77
|
+
case 'fish':
|
|
78
|
+
case 'zsh':
|
|
79
|
+
case 'bash':
|
|
80
|
+
case 'cmd':
|
|
81
|
+
return base;
|
|
82
|
+
case 'pwsh':
|
|
83
|
+
case 'powershell':
|
|
84
|
+
return 'pwsh';
|
|
85
|
+
default:
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Single-quote escape for POSIX shells (bash/zsh/fish).
|
|
91
|
+
* Closes the single-quote, inserts escaped quote, reopens.
|
|
92
|
+
*/
|
|
93
|
+
function posixSingleQuote(value) {
|
|
94
|
+
return "'" + value.replace(/'/g, "'\\''") + "'";
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Double-quote escape for PowerShell.
|
|
98
|
+
* Wraps in double quotes; escapes the PowerShell escape char first, doubles
|
|
99
|
+
* internal double quotes, and backtick-escapes $ to prevent interpolation.
|
|
100
|
+
*/
|
|
101
|
+
function pwshDoubleQuote(value) {
|
|
102
|
+
return '"' + value.replace(/`/g, '``').replace(/"/g, '""').replace(/\$/g, '`$') + '"';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Quote a cmd.exe SET assignment. `set "KEY=value"` keeps command separators
|
|
106
|
+
* like &, |, <, and > inside the assignment instead of executing them.
|
|
107
|
+
*/
|
|
108
|
+
function cmdSetQuote(value) {
|
|
109
|
+
return value.replace(/\^/g, '^^').replace(/%/g, '%%').replace(/"/g, '^"').replace(/!/g, '^^!');
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Format a single env var export statement for the target shell.
|
|
113
|
+
* Used by use-command to emit eval-safe lines.
|
|
114
|
+
*/
|
|
115
|
+
function formatExport(shell, key, value) {
|
|
116
|
+
switch (shell) {
|
|
117
|
+
case 'fish':
|
|
118
|
+
return `set -gx ${key} ${posixSingleQuote(value)};`;
|
|
119
|
+
case 'pwsh':
|
|
120
|
+
return `$env:${key} = ${pwshDoubleQuote(value)}`;
|
|
121
|
+
case 'cmd':
|
|
122
|
+
return `set "${key}=${cmdSetQuote(value)}"`;
|
|
123
|
+
default:
|
|
124
|
+
// bash / zsh
|
|
125
|
+
return `export ${key}=${posixSingleQuote(value)}`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.formatExport = formatExport;
|
|
129
|
+
//# sourceMappingURL=shell-detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-detect.js","sourceRoot":"","sources":["../../src/codex-auth/shell-detect.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4DAA8C;AAI9C;;;;GAIG;AACH,SAAgB,WAAW,CACzB,MAAyB,OAAO,CAAC,GAAG,EACpC,WAAmB,OAAO,CAAC,QAAQ,EACnC,iBAA0B;IAE1B,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,CACL,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC;YAC9B,mBAAmB,CAAC,iBAAiB,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC;YAC3E,mBAAmB,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC;YAC/C,KAAK,CACN,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,MAAM,CAAC,CAAC,kCAAkC;AACnD,CAAC;AAjBD,kCAiBC;AAED,SAAS,uBAAuB,CAAC,QAAgB;IAC/C,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC;QACjF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CACnC,gBAAgB,EAChB;QACE,YAAY;QACZ,iBAAiB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CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;AACxF,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACjG,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,KAAY,EAAE,GAAW,EAAE,KAAa;IACnE,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,MAAM;YACT,OAAO,WAAW,GAAG,IAAI,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC;QACtD,KAAK,MAAM;YACT,OAAO,QAAQ,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QACnD,KAAK,KAAK;YACR,OAAO,QAAQ,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC;QAC9C;YACE,aAAa;YACb,OAAO,UAAU,GAAG,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;IACtD,CAAC;AACH,CAAC;AAZD,oCAYC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface CodexProfileMetadata {
|
|
2
|
+
type: 'codex';
|
|
3
|
+
created: string;
|
|
4
|
+
last_used: string | null;
|
|
5
|
+
email?: string;
|
|
6
|
+
plan_type?: string | null;
|
|
7
|
+
account_id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CodexProfileData {
|
|
10
|
+
version: string;
|
|
11
|
+
default: string | null;
|
|
12
|
+
profiles: Record<string, CodexProfileMetadata>;
|
|
13
|
+
}
|
|
14
|
+
export interface CodexAccountIdentity {
|
|
15
|
+
email?: string;
|
|
16
|
+
plan_type?: string;
|
|
17
|
+
account_id?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const CODEX_PROFILE_SCHEMA_VERSION = "1.0";
|
|
20
|
+
/**
|
|
21
|
+
* Profile name must match /^[a-z0-9][a-z0-9_-]{0,63}$/ and not be reserved.
|
|
22
|
+
* Rejects uppercase, path separators, leading dash/underscore, length >64.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isValidCodexProfileName(name: string): boolean;
|
|
25
|
+
export declare function getCodexProfileNameError(name: string): string | null;
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/codex-auth/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAIlD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK7D;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASpE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCodexProfileNameError = exports.isValidCodexProfileName = exports.CODEX_PROFILE_SCHEMA_VERSION = void 0;
|
|
4
|
+
exports.CODEX_PROFILE_SCHEMA_VERSION = '1.0';
|
|
5
|
+
const RESERVED_CODEX_PROFILE_NAMES = new Set(['default', 'current']);
|
|
6
|
+
/**
|
|
7
|
+
* Profile name must match /^[a-z0-9][a-z0-9_-]{0,63}$/ and not be reserved.
|
|
8
|
+
* Rejects uppercase, path separators, leading dash/underscore, length >64.
|
|
9
|
+
*/
|
|
10
|
+
function isValidCodexProfileName(name) {
|
|
11
|
+
if (!name || name.length > 64)
|
|
12
|
+
return false;
|
|
13
|
+
if (RESERVED_CODEX_PROFILE_NAMES.has(name))
|
|
14
|
+
return false;
|
|
15
|
+
if (name.includes('/') || name.includes('\\'))
|
|
16
|
+
return false;
|
|
17
|
+
return /^[a-z0-9][a-z0-9_-]{0,63}$/.test(name);
|
|
18
|
+
}
|
|
19
|
+
exports.isValidCodexProfileName = isValidCodexProfileName;
|
|
20
|
+
function getCodexProfileNameError(name) {
|
|
21
|
+
if (!name)
|
|
22
|
+
return 'Profile name is required.';
|
|
23
|
+
if (RESERVED_CODEX_PROFILE_NAMES.has(name))
|
|
24
|
+
return `Profile name "${name}" is reserved.`;
|
|
25
|
+
if (name.includes('/') || name.includes('\\'))
|
|
26
|
+
return 'Profile name must not contain path separators.';
|
|
27
|
+
if (name.length > 64)
|
|
28
|
+
return 'Profile name must be 64 characters or fewer.';
|
|
29
|
+
if (!/^[a-z0-9][a-z0-9_-]{0,63}$/.test(name))
|
|
30
|
+
return 'Profile name must match [a-z0-9][a-z0-9_-]{0,63}.';
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
exports.getCodexProfileNameError = getCodexProfileNameError;
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/codex-auth/types.ts"],"names":[],"mappings":";;;AAqBa,QAAA,4BAA4B,GAAG,KAAK,CAAC;AAElD,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAErE;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,IAAY;IAClD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,4BAA4B,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACzD,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5D,OAAO,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AALD,0DAKC;AAED,SAAgB,wBAAwB,CAAC,IAAY;IACnD,IAAI,CAAC,IAAI;QAAE,OAAO,2BAA2B,CAAC;IAC9C,IAAI,4BAA4B,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,iBAAiB,IAAI,gBAAgB,CAAC;IACzF,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC3C,OAAO,gDAAgD,CAAC;IAC1D,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE;QAAE,OAAO,8CAA8C,CAAC;IAC5E,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1C,OAAO,mDAAmD,CAAC;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC;AATD,4DASC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pre-dispatch.d.ts","sourceRoot":"","sources":["../../src/dispatcher/pre-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIzD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAID;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"pre-dispatch.d.ts","sourceRoot":"","sources":["../../src/dispatcher/pre-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIzD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAID;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CA8HtF"}
|
|
@@ -71,6 +71,13 @@ async function runPreDispatchHandlers(ctx) {
|
|
|
71
71
|
(0, environment_builder_1.refreshUpdateCache)();
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
// CCS_NO_PRE_DISPATCH guard — set by `ccsx auth use` to keep stdout clean
|
|
75
|
+
// for shell eval. Must be checked BEFORE autoMigrate/recovery, both of which
|
|
76
|
+
// write to stdout and would otherwise contaminate `eval "$(ccsx auth use <name>)"`.
|
|
77
|
+
// See: src/codex-auth/commands/use-command.ts (C2 in plan.md §Validation findings)
|
|
78
|
+
if (process.env.CCS_NO_PRE_DISPATCH === '1') {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
74
81
|
// Auto-migrate to unified config format (silent if already migrated)
|
|
75
82
|
// Skip if user is explicitly running migrate command
|
|
76
83
|
if (firstArg !== 'migrate') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pre-dispatch.js","sourceRoot":"","sources":["../../src/dispatcher/pre-disp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bT as D,bU as H,bV as L,bW as te,bX as ne}from"./index-CSlgRg0s.js";var W,M;function re(){return M||(M=1,W={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),W}var se=re();const ae=K(se);var ie=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Z(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(ae[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var i=new RegExp(ie),s=null;(s=i.exec(e))!==null;)if(s[0].trim())if(s[1]){var o=s[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),t.attrs[l[0]]=l[1],i.lastIndex--}else s[2]&&(t.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return t}var oe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,le=/^\s*$/,ce=Object.create(null);function J(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?(function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""})(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(J,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var ue={parse:function(e,t){t||(t={}),t.components||(t.components=ce);var n,r=[],i=[],s=-1,o=!1;if(e.indexOf("<")!==0){var l=e.indexOf("<");r.push({type:"text",content:l===-1?e:e.substring(0,l)})}return e.replace(oe,function(c,p){if(o){if(c!=="</"+n.name+">")return;o=!1}var f,v=c.charAt(1)!=="/",C=c.startsWith("<!--"),g=p+c.length,u=e.charAt(g);if(C){var j=Z(c);return s<0?(r.push(j),r):((f=i[s]).children.push(j),r)}if(v&&(s++,(n=Z(c)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!u||u==="<"||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),s===0&&r.push(n),(f=i[s-1])&&f.children.push(n),i[s]=n),(!v||n.voidElement)&&(s>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(s--,n=s===-1?r:i[s]),!o&&u!=="<"&&u)){f=s===-1?r:i[s].children;var h=e.indexOf("<",g),$=e.slice(g,h===-1?void 0:h);le.test($)&&($=" "),(h>-1&&s+f.length>=0||$!==" ")&&f.push({type:"text",content:$})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+J("",n)},"")}};const z=(e,t)=>{if(!e)return!1;const n=e.props?.children??e.children;return t?n.length>0:!!n},B=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?_(t):t},pe=e=>Array.isArray(e)&&e.every(A.isValidElement),_=e=>Array.isArray(e)?e:[e],fe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},me=e=>{const t={};if(!e)return t;const n=r=>{_(r).forEach(s=>{D(s)||(z(s)?n(B(s)):L(s)&&!A.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},Y=(e,t,n,r)=>{if(!e)return"";let i="";const s=_(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(D(l)){i+=`${l}`;return}if(A.isValidElement(l)){const{props:p,type:f}=l,v=Object.keys(p).length,C=o.indexOf(f)>-1,g=p.children;if(!g&&C&&!v){i+=`<${f}/>`;return}if(!g&&(!C||v)||p.i18nIsDynamicList){i+=`<${c}></${c}>`;return}if(C&&v===1&&D(g)){i+=`<${f}>${g}</${f}>`;return}const u=Y(g,t,n,r);i+=`<${c}>${u}</${c}>`;return}if(l===null){H(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(L(l)){const{format:p,...f}=l,v=Object.keys(f);if(v.length===1){const C=p?`${v[0]}, ${p}`:v[0];i+=`{{${C}}}`;return}H(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:l});return}H(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:l})}),i},he=(e,t=[],n={})=>{if(!e)return e;const r=Object.keys(n),i=[...t,...r];let s="",o=0;for(;o<e.length;)if(e[o]==="<"){let l=!1;const c=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(c){const p=c[1];(/^\d+$/.test(p)||i.includes(p))&&(l=!0,s+=c[0],o+=c[0].length)}if(!l){const p=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(p){const f=p[1];(/^\d+$/.test(f)||i.includes(f))&&(l=!0,s+=p[0],o+=p[0].length)}}l||(s+="<",o+=1)}else s+=e[o],o+=1;return s},de=(e,t,n,r,i,s,o)=>{if(n==="")return[];const l=i.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(d=>`<${d}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const p=t??{},f=d=>{_(d).forEach(y=>{D(y)||(z(y)?f(B(y)):L(y)&&!A.isValidElement(y)&&Object.assign(p,y))})};f(e);const v=he(n,l,p),C=ue.parse(`<0>${v}</0>`),g={...p,...s},u=(d,O,y)=>{const N=B(d),I=h(N,O.children,y);return pe(N)&&I.length===0||d.props?.i18nIsDynamicList?N:I},j=(d,O,y,N,I)=>{d.dummy?(d.children=O,y.push(A.cloneElement(d,{key:N},I?void 0:O))):y.push(...A.Children.map([d],m=>{const a="data-i18n-is-dynamic-list",V={key:N,[a]:void 0};return m&&m.props&&Object.keys(m.props).forEach(T=>{T==="ref"||T==="children"||T==="i18nIsDynamicList"||T===a||(V[T]=m.props[T])}),A.cloneElement(m,V,I?null:O)}))},h=(d,O,y)=>{const N=_(d);return _(O).reduce((m,a,V)=>{const T=a.children?.[0]?.content&&r.services.interpolator.interpolate(a.children[0].content,g,r.language);if(a.type==="tag"){let x=N[parseInt(a.name,10)];!x&&t&&(x=t[a.name]),y.length===1&&!x&&(x=y[0][a.name]),x||(x={});const k={...a.attrs};o&&Object.keys(k).forEach(E=>{const P=k[E];D(P)&&(k[E]=te(P))});const b=Object.keys(k).length!==0?fe({props:k},x):x,S=A.isValidElement(b),F=S&&z(a,!0)&&!a.voidElement,w=c&&L(b)&&b.dummy&&!S,R=L(t)&&Object.hasOwnProperty.call(t,a.name);if(D(b)){const E=r.services.interpolator.interpolate(b,g,r.language);m.push(E)}else if(z(b)||F){const E=u(b,a,y);j(b,E,m,V)}else if(w){const E=h(N,a.children,y);j(b,E,m,V)}else if(Number.isNaN(parseFloat(a.name)))if(R){const E=u(b,a,y);j(b,E,m,V,a.voidElement)}else if(i.transSupportBasicHtmlNodes&&l.indexOf(a.name)>-1)if(a.voidElement)m.push(A.createElement(a.name,{key:`${a.name}-${V}`}));else{const E=h(N,a.children,y);m.push(A.createElement(a.name,{key:`${a.name}-${V}`},E))}else if(a.voidElement)m.push(`<${a.name} />`);else{const E=h(N,a.children,y);m.push(`<${a.name}>${E}</${a.name}>`)}else if(L(b)&&!S){const E=a.children[0]?T:null;E&&m.push(E)}else j(b,T,m,V,a.children.length!==1||!T)}else if(a.type==="text"){const x=i.transWrapTextNodes,k=typeof i.unescape=="function"?i.unescape:q().unescape,b=o?k(r.services.interpolator.interpolate(a.content,g,r.language)):r.services.interpolator.interpolate(a.content,g,r.language);x?m.push(A.createElement(x,{key:`${a.name}-${V}`},b)):m.push(b)}return m},[])},$=h([{dummy:!0,children:e||[]}],C,_(e||[]));return B($[0])},Q=(e,t,n)=>{const r=e.key||t,i=A.cloneElement(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function s(){return A.createElement(A.Fragment,null,i)}return A.createElement(s,{key:r})},ye=(e,t)=>e.map((n,r)=>Q(n,r,t)),ge=(e,t)=>{const n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:Q(e[r],r,t)})}),n},Ee=(e,t,n,r)=>e?Array.isArray(e)?ye(e,t):L(e)?ge(e,t):(U(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,be=e=>!L(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function ve({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s={},values:o,defaults:l,components:c,ns:p,i18n:f,t:v,shouldUnescape:C,...g}){const u=f||X();if(!u)return U(u,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const j=v||u.t.bind(u)||(G=>G),h={...q(),...u.options?.react};let $=p||j.ns||u.options?.defaultNS;$=D($)?[$]:$||["translation"];const{transDefaultProps:d}=h,O=d?.tOptions?{...d.tOptions,...s}:s,y=C??d?.shouldUnescape,N=d?.values?{...d.values,...o}:o,I=d?.components?{...d.components,...c}:c,m=Y(e,h,u,r),a=l||O?.defaultValue||m||h.transEmptyNodeValue||(typeof r=="function"?ee(r):r),{hashTransKey:V}=h,T=r||(V?V(m||a):m||a);u.options?.interpolation?.defaultVariables?o=N&&Object.keys(N).length>0?{...N,...u.options.interpolation.defaultVariables}:{...u.options.interpolation.defaultVariables}:o=N;const x=me(e);x&&typeof x.count=="number"&&t===void 0&&(t=x.count);const k=o||t!==void 0&&!u.options?.interpolation?.alwaysFormat||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},b={...O,context:i||O.context,count:t,...o,...k,defaultValue:a,ns:$};let S=T?j(T,b):a;S===T&&a&&(S=a);const F=Ee(I,S,u,r);let w=F||e,R=null;be(F)&&(R=F,w=e);const E=de(w,R,S,u,h,b,y),P=n??h.defaultTransParent;return P?A.createElement(P,g,E):E}function xe({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s={},values:o,defaults:l,components:c,ns:p,i18n:f,t:v,shouldUnescape:C,...g}){const{i18n:u,defaultNS:j}=A.useContext(ne)||{},h=f||u||X(),$=v||h?.t.bind(h);return ve({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s,values:o,defaults:l,components:c,ns:p||$?.ns||j||h?.options?.defaultNS,i18n:h,t:v,shouldUnescape:C,...g})}export{xe as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as k,e as Ae}from"./react-vendor-Bjx91N7w.js";import{e as Pe,f as se,g as De}from"./tanstack-bhJxV1h8.js";import{T as Te,a as Se,b as te,c as Re,d as _e,e as Oe}from"./table-Dyt0FuBK.js";import{a as R,ah as q,ai as W,aj as Q,ak as J,al as Y,L as S,I as E,x as P,aD as pe,d as p,r as Ge,s as Me,t as ze,v as Le,w as ae,bi as ne,bj as re,bk as ce,B as C,c as $e,C as O,j as M,k as z,_ as F,b as G,e as Ie,f as He,g as Fe,n as Be}from"./index-C6j8gpEb.js";import{A as Ue,a as Ke,b as Ee,c as Ze,d as Ve,e as Xe,f as qe,g as We}from"./alert-dialog-BrOo6Lh3.js";import{u as fe,a as Qe,b as Je,c as Ye,d as es,e as ss,f as ts}from"./use-accounts-Dy2ogHT-.js";import{b1 as Z,b2 as L,b3 as ee,aH as be,_ as je,b4 as Ne,ai as ye,w as as,b5 as ns,b6 as rs,m as V,at as cs,Q as os,b7 as ds,a7 as ls,$ as ve,a6 as B,T as X,x as is,o as oe,U as xs,a9 as de,Z as le}from"./icons-DzKUh8vG.js";import{C as ie}from"./checkbox-CVS69doq.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const xe=64,us=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ms({account:a,groupSummaries:x,plainCcsLane:t,onClose:m}){const{t:s}=R(),u=fe(),[r,l]=k.useState(a.context_mode==="shared"?"shared":"isolated"),[g,b]=k.useState(a.context_group||"default"),[h,v]=k.useState(a.continuity_mode==="deeper"?"deeper":"standard"),d=k.useMemo(()=>g.trim().toLowerCase().replace(/\s+/g,"-"),[g]),c=k.useMemo(()=>x.find(f=>f.group===d),[x,d]),N=d.length>0&&d.length<=xe&&us.test(d),j=r==="isolated"||N,y=r==="shared"?Math.max((c?.sharedCount??0)-(a.context_mode==="shared"&&a.context_group===d?1:0),0):0,n=r==="shared"?Math.max((c?.deeperCount??0)-(a.continuity_mode==="deeper"&&a.context_group===d?1:0),0):0,o=t?.account_name===a.name,i=!!t&&!o,w=`ccs auth default ${a.name}`,D=`ccs auth backup ${a.name}`,A=(f,I,_,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(f.key))return;f.preventDefault();const ke=_.indexOf(I),we=f.key==="ArrowLeft"||f.key==="ArrowUp"?-1:1,Ce=(ke+we+_.length)%_.length;H(_[Ce])},$=t?t.kind==="native"?s("continuityOverview.lane.native"):t.kind==="account-default"?s("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?s("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?s("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",T=()=>{j&&u.mutate({name:a.name,context_mode:r,context_group:r==="shared"?d:void 0,continuity_mode:r==="shared"?h:void 0},{onSuccess:()=>{m()}})},U=f=>{f||m()};return e.jsx(q,{open:!0,onOpenChange:U,children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:s("editAccountContext.title")}),e.jsx(Y,{children:s("editAccountContext.description",{name:a.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.syncMode")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="isolated",tabIndex:r==="isolated"?0:-1,onClick:()=>l("isolated"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="isolated"?"bg-background text-blue-600 dark:text-blue-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(Z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="shared",tabIndex:r==="shared"?0:-1,onClick:()=>l("shared"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="shared"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(r==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"context-group",children:s("editAccountContext.historySyncGroup")}),e.jsx(E,{id:"context-group",value:g,onChange:f=>b(f.target.value),placeholder:s("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.groupHint",{max:xe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:s("editAccountContext.invalidGroup")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.continuityDepth")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.continuityDepth"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="standard",tabIndex:h==="standard"?0:-1,onClick:()=>v("standard"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="standard"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.standardOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="deeper",tabIndex:h==="deeper"?0:-1,onClick:()=>v("deeper"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="deeper"?"bg-background text-indigo-600 dark:text-indigo-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(h==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.credentialsIsolated")}),i&&e.jsx("div",{className:"rounded-[14px] border border-amber-200 bg-amber-50/50 p-4 text-xs shadow-sm dark:border-amber-900/40 dark:bg-amber-900/10",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s("continuityOverview.plainLaneDescription",{lane:$||"plain ccs",name:a.name})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:D}),e.jsx(P,{value:D,size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:w}),e.jsx(P,{value:w,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${r==="isolated"?"bg-blue-50/50 border-blue-200 dark:bg-blue-900/10 dark:border-blue-800/40":"bg-muted/40 border-border/60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[r==="isolated"?e.jsx(be,{className:"h-4 w-4 text-blue-500 mt-0.5 shrink-0"}):e.jsx(je,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1.5 flex-1 text-muted-foreground leading-relaxed",children:[r==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:s("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:s("editAccountContext.sameGroupRule",{group:d})})," ",y>0?s("editAccountContext.sameGroupPeerCount",{count:y}):s("editAccountContext.noSameGroupPeer")]}),h==="deeper"&&e.jsx("p",{children:n>0?s("editAccountContext.deeperReady",{count:n}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:s("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${r==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:s("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:m,disabled:u.isPending,children:s("editAccountContext.cancel")}),e.jsx(p,{onClick:T,disabled:!j||u.isPending,children:u.isPending?s("editAccountContext.saving"):s("editAccountContext.save")})]})]})})}function hs({account:a,onClose:x}){const{t}=R(),m=Qe(),[s,u]=k.useState(a.shared_resource_mode||"shared"),r=()=>{m.mutate({name:a.name,shared_resource_mode:s},{onSuccess:()=>{x()}})};return e.jsx(q,{open:!0,onOpenChange:x,children:e.jsxs(W,{className:"sm:max-w-[425px]",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("editAccountSharedResources.title")}),e.jsx(Y,{children:t("editAccountSharedResources.description",{name:a.name})})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"resource-mode",children:t("editAccountSharedResources.resourceMode")}),e.jsxs(Ge,{value:s,onValueChange:l=>u(l),children:[e.jsx(Me,{id:"resource-mode",className:"w-full",children:e.jsx(ze,{placeholder:t("editAccountSharedResources.selectResourceMode")})}),e.jsxs(Le,{children:[e.jsx(ae,{value:"shared",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.sharedOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.sharedHint")})]})}),e.jsx(ae,{value:"profile-local",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.profileLocalHint")})]})})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t("editAccountSharedResources.implicationTitle")}),s==="shared"?e.jsxs(ne,{className:"border-emerald-500/20 bg-emerald-500/5",children:[e.jsx(Ne,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),e.jsx(re,{className:"text-xs font-semibold text-emerald-800 dark:text-emerald-300",children:t("editAccountSharedResources.sharedOption")}),e.jsx(ce,{className:"text-xs text-emerald-700/80 dark:text-emerald-400/80",children:t("editAccountSharedResources.sharedImplication")})]}):e.jsxs(ne,{className:"border-amber-500/20 bg-amber-500/5",children:[e.jsx(ye,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),e.jsx(re,{className:"text-xs font-semibold text-amber-800 dark:text-amber-300",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx(ce,{className:"text-xs text-amber-700/80 dark:text-amber-400/80",children:t("editAccountSharedResources.profileLocalImplication")})]})]}),a.shared_resource_inferred&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted/50 p-3",children:[e.jsx(as,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("accountsTable.legacyReview")})]})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:x,children:t("editAccountSharedResources.cancel")}),e.jsx(p,{onClick:r,disabled:m.isPending,children:m.isPending?t("editAccountSharedResources.saving"):t("editAccountSharedResources.save")})]})]})})}function ue({data:a,defaultAccount:x,groupSummaries:t,plainCcsLane:m}){const{t:s}=R(),u=Je(),r=Ye(),l=es(),g=fe(),[b,h]=k.useState(null),[v,d]=k.useState(null),[c,N]=k.useState(null),j=[{accessorKey:"name",header:s("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===x&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:s("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:s("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:s("accountsTable.created"),size:150,cell:({row:n})=>{const o=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{accessorKey:"last_used",header:s("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{id:"context",header:s("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const i=n.original.context_group||"default",w=n.original.continuity_mode==="deeper";return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(C,{variant:"outline",className:`font-mono text-[10px] uppercase px-1.5 py-0 border ${w?"text-indigo-700 border-indigo-300/60 bg-indigo-50/50 dark:text-indigo-300 dark:border-indigo-900/40 dark:bg-indigo-900/20":"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20"}`,children:s(w?"accountsTable.badges.deeper":"accountsTable.badges.shared")}),e.jsx("span",{className:"text-xs font-semibold text-foreground/80",children:i})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:n.original.sameGroupPeerCount>0?s("accountsTable.sameGroupPeerCount",{count:n.original.sameGroupPeerCount}):s("accountsTable.noSameGroupPeer")})]})}return n.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:"outline",className:"text-amber-700 border-amber-300/60 bg-amber-50/50 dark:text-amber-400 dark:border-amber-900/40 dark:bg-amber-900/20 font-mono text-[10px] uppercase px-1.5 py-0",children:s("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(C,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:s("accountsTable.badges.isolated")})})}},{id:"resources",header:s("accountsTable.sharedResources"),size:150,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=n.original.shared_resource_mode||"shared",i=n.original.shared_resource_inferred;return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:o==="shared"?"outline":"secondary",className:$e("font-mono text-[10px] uppercase px-1.5 py-0",o==="shared"?"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20":"text-muted-foreground bg-muted/60 border-transparent shadow-none"),children:s(o==="shared"?"accountsTable.resourcesShared":"accountsTable.resourcesProfileLocal")}),i&&e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]})}},{id:"actions",header:s("accountsTable.actions"),size:220,cell:({row:n})=>{const o=n.original.name===x,i=u.isPending||r.isPending||g.isPending,w=n.original.type==="cliproxy",D=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>d(n.original),title:s("accountsTable.syncTitle"),children:[e.jsx(ns,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sync")]}),!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>N(n.original),title:s("accountsTable.resourcesTitle"),children:[e.jsx(Ne,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sharedResources")]}),!w&&D&&e.jsxs(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:i,onClick:()=>g.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:s("accountsTable.confirmLegacyTitle"),children:[e.jsx(rs,{className:"w-3 h-3 mr-1"}),s("accountsTable.confirm")]}),e.jsxs(p,{variant:o?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:o||i,onClick:()=>u.mutate(n.original.name),children:[e.jsx(V,{className:`w-3 h-3 mr-1 ${o?"opacity-50":""}`}),s(o?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:o||i,onClick:()=>h(n.original.name),title:s(o?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(cs,{className:"w-4 h-4"})})]})}}],y=Pe({data:a,columns:j,getCoreRowModel:De()});return a.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Te,{children:[e.jsx(Se,{children:y.getHeaderGroups().map(n=>e.jsx(te,{children:n.headers.map(o=>{const i={name:"w-[180px]",type:"w-[80px]",created:"w-[120px]",last_used:"w-[120px]",context:"w-[150px]",resources:"w-[120px]",actions:"w-[320px]"}[o.id]||"w-auto";return e.jsx(Re,{className:i,children:o.isPlaceholder?null:se(o.column.columnDef.header,o.getContext())},o.id)})},n.id))}),e.jsx(_e,{children:y.getRowModel().rows.map(n=>e.jsx(te,{children:n.getVisibleCells().map(o=>e.jsx(Oe,{children:se(o.column.columnDef.cell,o.getContext())},o.id))},n.id))})]})}),x&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:l.isPending,children:[e.jsx(os,{className:"w-4 h-4 mr-2"}),s("accountsTable.resetToDefault")]})})]}),v&&e.jsx(ms,{account:v,groupSummaries:t,plainCcsLane:m,onClose:()=>d(null)}),c&&e.jsx(hs,{account:c,onClose:()=>N(null)}),e.jsx(Ue,{open:!!b,onOpenChange:n=>!n&&h(null),children:e.jsxs(Ke,{children:[e.jsxs(Ee,{children:[e.jsx(Ze,{children:s("accountsTable.deleteDialogTitle")}),e.jsx(Ve,{children:s("accountsTable.deleteDialogDesc",{name:b??""})})]}),e.jsxs(Xe,{children:[e.jsx(qe,{children:s("accountsTable.cancel")}),e.jsx(We,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{b&&(r.mutate(b),h(null))},children:s("accountsTable.delete")})]})]})})]})}function me({totalAccounts:a,isolatedCount:x,sharedPeerGroups:t,deeperReadyGroups:m}){const{t:s}=R(),u=m[0]||t[0]||"daily",r=a<2?"empty":m.length>0?"deeper":t.length>0?"shared":a>=2&&x===a?"isolated":a===0?"empty":"mixed",l=`ccs auth create work2 --share-context --context-group ${u} --deeper-continuity`;return e.jsxs(O,{className:"overflow-hidden",children:[e.jsx(M,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(z,{className:"text-lg",children:s("accountRouteGuide.title")}),e.jsx(F,{children:s("accountRouteGuide.description")})]}),e.jsx(C,{variant:r==="deeper"?"default":"secondary",children:s(`accountRouteGuide.status.${r}`)})]})}),e.jsxs(G,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("section",{className:"rounded-md border bg-blue-50/50 p-3 text-sm dark:bg-blue-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ye,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),s("accountRouteGuide.cards.isolated.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.isolated.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-emerald-50/50 p-3 text-sm dark:bg-emerald-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ds,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),s("accountRouteGuide.cards.select.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.select.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-sky-50/50 p-3 text-sm dark:bg-sky-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ls,{className:"h-4 w-4 text-sky-600 dark:text-sky-400"}),s("accountRouteGuide.cards.settings.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.settings.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-indigo-50/50 p-3 text-sm dark:bg-indigo-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(L,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400"}),s("accountRouteGuide.cards.sync.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.sync.desc")})]})]}),e.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.isolated")]}),["ccs auth create work","ccs auth create personal","ccs work","ccs personal"].map(g=>e.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:g}),e.jsx(P,{value:g,size:"icon"})]},g))]}),e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.sync")]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:l}),e.jsx(P,{value:l,size:"icon"})]}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.commands.syncDesc",{group:u})})]})]})]})]})}const K=({titleKey:a,descKey:x})=>{const{t}=R();return e.jsxs(Ie,{children:[e.jsx(He,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"icon","aria-label":t(a),className:"h-5 w-5 rounded-full hover:bg-muted text-muted-foreground/70 transition-colors",children:e.jsx(je,{className:"h-3 w-3"})})}),e.jsxs(Fe,{className:"w-72 p-4 rounded-xl shadow-lg border-border/50 text-sm",side:"top",align:"center",children:[e.jsx("p",{className:"font-semibold tracking-tight",children:t(a)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(x)})]})]})};function he({totalAccounts:a,primaryAccountName:x,isolatedCount:t,sharedStandardCount:m,deeperSharedCount:s,sharedAloneCount:u,sharedPeerAccountCount:r,deeperReadyAccountCount:l,sharedPeerGroups:g,deeperReadyGroups:b,legacyTargetCount:h,cliproxyCount:v,plainCcsLane:d}){const{t:c}=R(),N=d?d.kind==="native"?c("continuityOverview.lane.native"):d.kind==="account-default"?c("continuityOverview.lane.accountDefault",{name:d.account_name||""}):d.kind==="account-inherited"?c("continuityOverview.lane.accountInherited",{name:d.account_name||""}):d.kind==="profile-default"?c("continuityOverview.lane.profileDefault",{name:d.profile_name||"default"}):d.label:"",j=a<2?"single":g.length===0?t===a?"isolated":"shared-alone":b.length===0?"shared-standard":t>0||u>0||l<r||b.length<g.length?"partial":"ready",y=b[0]||g[0]||"default",n=b.length>0&&(t>0||m>0||g.length>b.length),i={ready:e.jsx(is,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(L,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"}),single:e.jsx(be,{className:"h-6 w-6 text-stone-400"}),isolated:e.jsx(Z,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),"shared-alone":e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),partial:e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}[j],w=!!x&&d?.account_name===x,D=a>0&&!!d&&(!x||!w),A=a>1&&j!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(O,{className:"flex flex-col justify-between overflow-hidden relative group p-0 border-border bg-card shadow-sm hover:shadow-md transition-shadow duration-300",children:e.jsxs(G,{className:"p-6 flex flex-col h-full bg-gradient-to-br from-card to-muted/20 space-y-4",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[e.jsx("div",{className:"rounded-2xl bg-background p-3 shadow-sm ring-1 ring-border/50 self-start shrink-0",children:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:c(`continuityReadiness.messages.${j}.title`,{group:y})}),e.jsx(C,{variant:j==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:c(`continuityReadiness.state.${j}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:c(`continuityReadiness.messages.${j}.description`,{group:y,count:u})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[v>0&&e.jsx(C,{variant:"outline",className:"text-blue-700 bg-blue-50/50 border-blue-200/60 dark:border-blue-900/40 dark:bg-blue-900/20 dark:text-blue-300",children:c("historySyncLearningMap.cliproxyManaged",{count:v})}),h>0&&e.jsx(C,{variant:"outline",className:"text-amber-700 bg-amber-50/50 border-amber-200/60 dark:border-amber-900/40 dark:bg-amber-900/20 dark:text-amber-300",children:c("historySyncLearningMap.legacyConfirmation",{count:h})}),g.length>0&&b.length===0&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.recommendBadge",{group:y})}),n&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.partialBadge",{group:y})})]})]})}),(D||A)&&e.jsx(O,{className:"border-dashed",children:e.jsxs(G,{className:"p-5 space-y-4",children:[D&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c("continuityOverview.plainLaneDescription",{lane:N||"plain ccs"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),x?e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:`ccs auth default ${x}`}),e.jsx(P,{value:`ccs auth default ${x}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:c("continuityOverview.setDefaultHint")})]})]}),A&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:c("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:c("continuityReadiness.steps.sameGroup",{group:y})}),e.jsx("li",{children:c("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:c("continuityReadiness.steps.resumeOriginal")})]})]})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-3",children:[e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-blue-300/40 bg-blue-50/50 dark:border-blue-900/30 dark:bg-blue-900/10 shadow-sm transition-colors hover:bg-blue-100/40 dark:hover:bg-blue-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4 text-blue-700/80 dark:text-blue-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-900 dark:text-blue-200",children:c("historySyncLearningMap.isolated")}),e.jsx(K,{titleKey:"accountsPage.isolated",descKey:"accountsPage.isolatedDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-blue-900 dark:text-blue-200",children:t})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-emerald-300/40 bg-emerald-50/50 dark:border-emerald-900/30 dark:bg-emerald-900/10 shadow-sm transition-colors hover:bg-emerald-100/40 dark:hover:bg-emerald-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-emerald-700/80 dark:text-emerald-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-900 dark:text-emerald-200",children:c("historySyncLearningMap.shared")}),e.jsx(K,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:m})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-indigo-300/40 bg-indigo-50/50 dark:border-indigo-900/30 dark:bg-indigo-900/10 shadow-sm transition-colors hover:bg-indigo-100/40 dark:hover:bg-indigo-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"h-4 w-4 text-indigo-700/80 dark:text-indigo-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-indigo-900 dark:text-indigo-200",children:c("historySyncLearningMap.deeper")}),e.jsx(K,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:s})]})]})]})}const ge=64;function gs({open:a,onClose:x}){const{t}=R(),[m,s]=k.useState(""),[u,r]=k.useState(!1),[l,g]=k.useState(""),[b,h]=k.useState(!1),[v,d]=k.useState(!1),c=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(m),N=l.trim().toLowerCase().replace(/\s+/g,"-"),j=N.length===0||N.length<=ge&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),y=m&&c?[`ccs auth create ${m}`,u?N.length>0?`--context-group ${N}`:"--share-context":"",u&&b?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),n=async()=>{!c||u&&!j||(await navigator.clipboard.writeText(y),d(!0),setTimeout(()=>d(!1),2e3))},o=()=>{s(""),r(!1),g(""),h(!1),d(!1),x()};return e.jsx(q,{open:a,onOpenChange:i=>!i&&o(),children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("createAuthProfileDialog.title")}),e.jsx(Y,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(E,{id:"profile-name",value:m,onChange:i=>s(i.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),m&&!c&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{id:"share-context",checked:u,onCheckedChange:i=>r(i===!0)}),e.jsx(S,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),u&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(S,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(E,{id:"context-group",value:l,onChange:i=>g(i.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(ie,{id:"deeper-continuity",checked:b,onCheckedChange:i=>h(i===!0)}),e.jsx(S,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),l.trim().length>0&&!j&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ge})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(ve,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:y}),e.jsx(p,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:n,disabled:!c||u&&!j,children:v?e.jsx(V,{className:"w-4 h-4 text-green-500"}):e.jsx(oe,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(p,{variant:"ghost",onClick:o,children:t("createAuthProfileDialog.close")}),e.jsx(p,{onClick:n,disabled:!c||u&&!j,children:v?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function Ts(){const{t:a}=R(),x=Ae(),{data:t,isLoading:m}=ss(),s=ts(),[u,r]=k.useState(!1),l=t?.accounts||[],g=t?.cliproxyCount||0,b=t?.legacyContextCount||0,h=t?.legacyContinuityCount||0,v=t?.sharedCount||0,d=t?.sharedStandardCount||0,c=t?.deeperSharedCount||0,N=t?.isolatedCount||0,j=t?.sharedAloneCount||0,y=t?.sharedPeerAccountCount||0,n=t?.deeperReadyAccountCount||0,o=t?.sharedPeerGroups||[],i=t?.deeperReadyGroups||[],w=t?.sharedGroups||[],D=t?.groupSummaries||[],A=t?.plainCcsLane||null,$=l.filter(H=>H.context_inferred||H.continuity_inferred),T=$.length,U=T>0,f=()=>x("/cliproxy?provider=claude"),I=()=>x("/cliproxy?provider=claude&action=auth"),_=()=>s.mutate($);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xs,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:a("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.manageSuffix")]})]}),e.jsx(Be,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.primaryActions")}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:I,children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),a("accountsPage.authClaudeInPool")]}),e.jsxs(p,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:f,children:[a("accountsPage.openClaudePoolSettings"),e.jsx(B,{className:"w-4 h-4 ml-auto"})]})]}),U?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(X,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContextPending",{count:b})}),h>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContinuityPending",{count:h})})]})]}),e.jsx(p,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:a("accountsPage.noLegacyFollowup")}),e.jsxs(O,{children:[e.jsxs(M,{className:"pb-2",children:[e.jsx(z,{className:"text-sm",children:a("accountsPage.quickCommands")}),e.jsx(F,{children:a("accountsPage.quickCommandsDesc")})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity"}),e.jsx(P,{value:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(P,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",children:a("accountsPage.workspaceBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.historySyncBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.resourcesBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:a("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[a("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:a("accountsTable.sync")}),a("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{className:"flex flex-col",children:[e.jsxs(M,{className:"pb-3",children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.accountMatrix")}),e.jsx(F,{children:a("accountsPage.sharedTotalDesc",{count:v})})]}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(O,{children:[e.jsxs(M,{children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.title")}),e.jsxs(F,{children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.mobileManageSuffix")]})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs(p,{className:"w-full",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:f,children:[a("accountsPage.openCliProxyClaudePool"),e.jsx(B,{className:"w-4 h-4 ml-2"})]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:I,children:[a("accountsPage.authClaudeInPool"),e.jsx(le,{className:"w-4 h-4 ml-2"})]}),e.jsx(p,{variant:"outline",className:"w-full",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}),e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{children:[e.jsx(M,{className:"pb-3",children:e.jsx(z,{className:"text-base",children:a("accountsPage.accountMatrix")})}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]}),e.jsx(gs,{open:u,onClose:()=>r(!1)})]})}export{Ts as AccountsPage};
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as k,e as Ae}from"./react-vendor-Bjx91N7w.js";import{e as Pe,f as se,g as De}from"./tanstack-bhJxV1h8.js";import{T as Te,a as Se,b as te,c as Re,d as _e,e as Oe}from"./table-DPheAd4c.js";import{a as R,ah as q,ai as W,aj as Q,ak as J,al as Y,L as S,I as E,x as P,aD as pe,d as p,r as Ge,s as Me,t as ze,v as Le,w as ae,bi as ne,bj as re,bk as ce,B as C,c as $e,C as O,j as M,k as z,_ as F,b as G,e as Ie,f as He,g as Fe,n as Be}from"./index-CSlgRg0s.js";import{A as Ue,a as Ke,b as Ee,c as Ze,d as Ve,e as Xe,f as qe,g as We}from"./alert-dialog-B7gsksZn.js";import{u as fe,a as Qe,b as Je,c as Ye,d as es,e as ss,f as ts}from"./use-accounts-CWVR2NXQ.js";import{b1 as Z,b2 as L,b3 as ee,aH as be,_ as je,b4 as Ne,ai as ye,w as as,b5 as ns,b6 as rs,m as V,at as cs,Q as os,b7 as ds,a7 as ls,$ as ve,a6 as B,T as X,x as is,o as oe,U as xs,a9 as de,Z as le}from"./icons-DzKUh8vG.js";import{C as ie}from"./checkbox-DD0s2D_O.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const xe=64,us=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ms({account:a,groupSummaries:x,plainCcsLane:t,onClose:m}){const{t:s}=R(),u=fe(),[r,l]=k.useState(a.context_mode==="shared"?"shared":"isolated"),[g,b]=k.useState(a.context_group||"default"),[h,v]=k.useState(a.continuity_mode==="deeper"?"deeper":"standard"),d=k.useMemo(()=>g.trim().toLowerCase().replace(/\s+/g,"-"),[g]),c=k.useMemo(()=>x.find(f=>f.group===d),[x,d]),N=d.length>0&&d.length<=xe&&us.test(d),j=r==="isolated"||N,y=r==="shared"?Math.max((c?.sharedCount??0)-(a.context_mode==="shared"&&a.context_group===d?1:0),0):0,n=r==="shared"?Math.max((c?.deeperCount??0)-(a.continuity_mode==="deeper"&&a.context_group===d?1:0),0):0,o=t?.account_name===a.name,i=!!t&&!o,w=`ccs auth default ${a.name}`,D=`ccs auth backup ${a.name}`,A=(f,I,_,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(f.key))return;f.preventDefault();const ke=_.indexOf(I),we=f.key==="ArrowLeft"||f.key==="ArrowUp"?-1:1,Ce=(ke+we+_.length)%_.length;H(_[Ce])},$=t?t.kind==="native"?s("continuityOverview.lane.native"):t.kind==="account-default"?s("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?s("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?s("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",T=()=>{j&&u.mutate({name:a.name,context_mode:r,context_group:r==="shared"?d:void 0,continuity_mode:r==="shared"?h:void 0},{onSuccess:()=>{m()}})},U=f=>{f||m()};return e.jsx(q,{open:!0,onOpenChange:U,children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:s("editAccountContext.title")}),e.jsx(Y,{children:s("editAccountContext.description",{name:a.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.syncMode")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="isolated",tabIndex:r==="isolated"?0:-1,onClick:()=>l("isolated"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="isolated"?"bg-background text-blue-600 dark:text-blue-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(Z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="shared",tabIndex:r==="shared"?0:-1,onClick:()=>l("shared"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="shared"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(r==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"context-group",children:s("editAccountContext.historySyncGroup")}),e.jsx(E,{id:"context-group",value:g,onChange:f=>b(f.target.value),placeholder:s("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.groupHint",{max:xe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:s("editAccountContext.invalidGroup")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.continuityDepth")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.continuityDepth"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="standard",tabIndex:h==="standard"?0:-1,onClick:()=>v("standard"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="standard"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.standardOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="deeper",tabIndex:h==="deeper"?0:-1,onClick:()=>v("deeper"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="deeper"?"bg-background text-indigo-600 dark:text-indigo-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(h==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.credentialsIsolated")}),i&&e.jsx("div",{className:"rounded-[14px] border border-amber-200 bg-amber-50/50 p-4 text-xs shadow-sm dark:border-amber-900/40 dark:bg-amber-900/10",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s("continuityOverview.plainLaneDescription",{lane:$||"plain ccs",name:a.name})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:D}),e.jsx(P,{value:D,size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:w}),e.jsx(P,{value:w,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${r==="isolated"?"bg-blue-50/50 border-blue-200 dark:bg-blue-900/10 dark:border-blue-800/40":"bg-muted/40 border-border/60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[r==="isolated"?e.jsx(be,{className:"h-4 w-4 text-blue-500 mt-0.5 shrink-0"}):e.jsx(je,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1.5 flex-1 text-muted-foreground leading-relaxed",children:[r==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:s("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:s("editAccountContext.sameGroupRule",{group:d})})," ",y>0?s("editAccountContext.sameGroupPeerCount",{count:y}):s("editAccountContext.noSameGroupPeer")]}),h==="deeper"&&e.jsx("p",{children:n>0?s("editAccountContext.deeperReady",{count:n}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:s("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${r==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:s("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:m,disabled:u.isPending,children:s("editAccountContext.cancel")}),e.jsx(p,{onClick:T,disabled:!j||u.isPending,children:u.isPending?s("editAccountContext.saving"):s("editAccountContext.save")})]})]})})}function hs({account:a,onClose:x}){const{t}=R(),m=Qe(),[s,u]=k.useState(a.shared_resource_mode||"shared"),r=()=>{m.mutate({name:a.name,shared_resource_mode:s},{onSuccess:()=>{x()}})};return e.jsx(q,{open:!0,onOpenChange:x,children:e.jsxs(W,{className:"sm:max-w-[425px]",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("editAccountSharedResources.title")}),e.jsx(Y,{children:t("editAccountSharedResources.description",{name:a.name})})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"resource-mode",children:t("editAccountSharedResources.resourceMode")}),e.jsxs(Ge,{value:s,onValueChange:l=>u(l),children:[e.jsx(Me,{id:"resource-mode",className:"w-full",children:e.jsx(ze,{placeholder:t("editAccountSharedResources.selectResourceMode")})}),e.jsxs(Le,{children:[e.jsx(ae,{value:"shared",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.sharedOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.sharedHint")})]})}),e.jsx(ae,{value:"profile-local",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.profileLocalHint")})]})})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t("editAccountSharedResources.implicationTitle")}),s==="shared"?e.jsxs(ne,{className:"border-emerald-500/20 bg-emerald-500/5",children:[e.jsx(Ne,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),e.jsx(re,{className:"text-xs font-semibold text-emerald-800 dark:text-emerald-300",children:t("editAccountSharedResources.sharedOption")}),e.jsx(ce,{className:"text-xs text-emerald-700/80 dark:text-emerald-400/80",children:t("editAccountSharedResources.sharedImplication")})]}):e.jsxs(ne,{className:"border-amber-500/20 bg-amber-500/5",children:[e.jsx(ye,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),e.jsx(re,{className:"text-xs font-semibold text-amber-800 dark:text-amber-300",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx(ce,{className:"text-xs text-amber-700/80 dark:text-amber-400/80",children:t("editAccountSharedResources.profileLocalImplication")})]})]}),a.shared_resource_inferred&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted/50 p-3",children:[e.jsx(as,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("accountsTable.legacyReview")})]})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:x,children:t("editAccountSharedResources.cancel")}),e.jsx(p,{onClick:r,disabled:m.isPending,children:m.isPending?t("editAccountSharedResources.saving"):t("editAccountSharedResources.save")})]})]})})}function ue({data:a,defaultAccount:x,groupSummaries:t,plainCcsLane:m}){const{t:s}=R(),u=Je(),r=Ye(),l=es(),g=fe(),[b,h]=k.useState(null),[v,d]=k.useState(null),[c,N]=k.useState(null),j=[{accessorKey:"name",header:s("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===x&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:s("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:s("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:s("accountsTable.created"),size:150,cell:({row:n})=>{const o=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{accessorKey:"last_used",header:s("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{id:"context",header:s("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const i=n.original.context_group||"default",w=n.original.continuity_mode==="deeper";return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(C,{variant:"outline",className:`font-mono text-[10px] uppercase px-1.5 py-0 border ${w?"text-indigo-700 border-indigo-300/60 bg-indigo-50/50 dark:text-indigo-300 dark:border-indigo-900/40 dark:bg-indigo-900/20":"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20"}`,children:s(w?"accountsTable.badges.deeper":"accountsTable.badges.shared")}),e.jsx("span",{className:"text-xs font-semibold text-foreground/80",children:i})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:n.original.sameGroupPeerCount>0?s("accountsTable.sameGroupPeerCount",{count:n.original.sameGroupPeerCount}):s("accountsTable.noSameGroupPeer")})]})}return n.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:"outline",className:"text-amber-700 border-amber-300/60 bg-amber-50/50 dark:text-amber-400 dark:border-amber-900/40 dark:bg-amber-900/20 font-mono text-[10px] uppercase px-1.5 py-0",children:s("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(C,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:s("accountsTable.badges.isolated")})})}},{id:"resources",header:s("accountsTable.sharedResources"),size:150,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=n.original.shared_resource_mode||"shared",i=n.original.shared_resource_inferred;return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:o==="shared"?"outline":"secondary",className:$e("font-mono text-[10px] uppercase px-1.5 py-0",o==="shared"?"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20":"text-muted-foreground bg-muted/60 border-transparent shadow-none"),children:s(o==="shared"?"accountsTable.resourcesShared":"accountsTable.resourcesProfileLocal")}),i&&e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]})}},{id:"actions",header:s("accountsTable.actions"),size:220,cell:({row:n})=>{const o=n.original.name===x,i=u.isPending||r.isPending||g.isPending,w=n.original.type==="cliproxy",D=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>d(n.original),title:s("accountsTable.syncTitle"),children:[e.jsx(ns,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sync")]}),!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>N(n.original),title:s("accountsTable.resourcesTitle"),children:[e.jsx(Ne,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sharedResources")]}),!w&&D&&e.jsxs(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:i,onClick:()=>g.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:s("accountsTable.confirmLegacyTitle"),children:[e.jsx(rs,{className:"w-3 h-3 mr-1"}),s("accountsTable.confirm")]}),e.jsxs(p,{variant:o?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:o||i,onClick:()=>u.mutate(n.original.name),children:[e.jsx(V,{className:`w-3 h-3 mr-1 ${o?"opacity-50":""}`}),s(o?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:o||i,onClick:()=>h(n.original.name),title:s(o?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(cs,{className:"w-4 h-4"})})]})}}],y=Pe({data:a,columns:j,getCoreRowModel:De()});return a.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Te,{children:[e.jsx(Se,{children:y.getHeaderGroups().map(n=>e.jsx(te,{children:n.headers.map(o=>{const i={name:"w-[180px]",type:"w-[80px]",created:"w-[120px]",last_used:"w-[120px]",context:"w-[150px]",resources:"w-[120px]",actions:"w-[320px]"}[o.id]||"w-auto";return e.jsx(Re,{className:i,children:o.isPlaceholder?null:se(o.column.columnDef.header,o.getContext())},o.id)})},n.id))}),e.jsx(_e,{children:y.getRowModel().rows.map(n=>e.jsx(te,{children:n.getVisibleCells().map(o=>e.jsx(Oe,{children:se(o.column.columnDef.cell,o.getContext())},o.id))},n.id))})]})}),x&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:l.isPending,children:[e.jsx(os,{className:"w-4 h-4 mr-2"}),s("accountsTable.resetToDefault")]})})]}),v&&e.jsx(ms,{account:v,groupSummaries:t,plainCcsLane:m,onClose:()=>d(null)}),c&&e.jsx(hs,{account:c,onClose:()=>N(null)}),e.jsx(Ue,{open:!!b,onOpenChange:n=>!n&&h(null),children:e.jsxs(Ke,{children:[e.jsxs(Ee,{children:[e.jsx(Ze,{children:s("accountsTable.deleteDialogTitle")}),e.jsx(Ve,{children:s("accountsTable.deleteDialogDesc",{name:b??""})})]}),e.jsxs(Xe,{children:[e.jsx(qe,{children:s("accountsTable.cancel")}),e.jsx(We,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{b&&(r.mutate(b),h(null))},children:s("accountsTable.delete")})]})]})})]})}function me({totalAccounts:a,isolatedCount:x,sharedPeerGroups:t,deeperReadyGroups:m}){const{t:s}=R(),u=m[0]||t[0]||"daily",r=a<2?"empty":m.length>0?"deeper":t.length>0?"shared":a>=2&&x===a?"isolated":a===0?"empty":"mixed",l=`ccs auth create work2 --share-context --context-group ${u} --deeper-continuity`;return e.jsxs(O,{className:"overflow-hidden",children:[e.jsx(M,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(z,{className:"text-lg",children:s("accountRouteGuide.title")}),e.jsx(F,{children:s("accountRouteGuide.description")})]}),e.jsx(C,{variant:r==="deeper"?"default":"secondary",children:s(`accountRouteGuide.status.${r}`)})]})}),e.jsxs(G,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("section",{className:"rounded-md border bg-blue-50/50 p-3 text-sm dark:bg-blue-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ye,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),s("accountRouteGuide.cards.isolated.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.isolated.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-emerald-50/50 p-3 text-sm dark:bg-emerald-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ds,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),s("accountRouteGuide.cards.select.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.select.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-sky-50/50 p-3 text-sm dark:bg-sky-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ls,{className:"h-4 w-4 text-sky-600 dark:text-sky-400"}),s("accountRouteGuide.cards.settings.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.settings.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-indigo-50/50 p-3 text-sm dark:bg-indigo-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(L,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400"}),s("accountRouteGuide.cards.sync.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.sync.desc")})]})]}),e.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.isolated")]}),["ccs auth create work","ccs auth create personal","ccs work","ccs personal"].map(g=>e.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:g}),e.jsx(P,{value:g,size:"icon"})]},g))]}),e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.sync")]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:l}),e.jsx(P,{value:l,size:"icon"})]}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.commands.syncDesc",{group:u})})]})]})]})]})}const K=({titleKey:a,descKey:x})=>{const{t}=R();return e.jsxs(Ie,{children:[e.jsx(He,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"icon","aria-label":t(a),className:"h-5 w-5 rounded-full hover:bg-muted text-muted-foreground/70 transition-colors",children:e.jsx(je,{className:"h-3 w-3"})})}),e.jsxs(Fe,{className:"w-72 p-4 rounded-xl shadow-lg border-border/50 text-sm",side:"top",align:"center",children:[e.jsx("p",{className:"font-semibold tracking-tight",children:t(a)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(x)})]})]})};function he({totalAccounts:a,primaryAccountName:x,isolatedCount:t,sharedStandardCount:m,deeperSharedCount:s,sharedAloneCount:u,sharedPeerAccountCount:r,deeperReadyAccountCount:l,sharedPeerGroups:g,deeperReadyGroups:b,legacyTargetCount:h,cliproxyCount:v,plainCcsLane:d}){const{t:c}=R(),N=d?d.kind==="native"?c("continuityOverview.lane.native"):d.kind==="account-default"?c("continuityOverview.lane.accountDefault",{name:d.account_name||""}):d.kind==="account-inherited"?c("continuityOverview.lane.accountInherited",{name:d.account_name||""}):d.kind==="profile-default"?c("continuityOverview.lane.profileDefault",{name:d.profile_name||"default"}):d.label:"",j=a<2?"single":g.length===0?t===a?"isolated":"shared-alone":b.length===0?"shared-standard":t>0||u>0||l<r||b.length<g.length?"partial":"ready",y=b[0]||g[0]||"default",n=b.length>0&&(t>0||m>0||g.length>b.length),i={ready:e.jsx(is,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(L,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"}),single:e.jsx(be,{className:"h-6 w-6 text-stone-400"}),isolated:e.jsx(Z,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),"shared-alone":e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),partial:e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}[j],w=!!x&&d?.account_name===x,D=a>0&&!!d&&(!x||!w),A=a>1&&j!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(O,{className:"flex flex-col justify-between overflow-hidden relative group p-0 border-border bg-card shadow-sm hover:shadow-md transition-shadow duration-300",children:e.jsxs(G,{className:"p-6 flex flex-col h-full bg-gradient-to-br from-card to-muted/20 space-y-4",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[e.jsx("div",{className:"rounded-2xl bg-background p-3 shadow-sm ring-1 ring-border/50 self-start shrink-0",children:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:c(`continuityReadiness.messages.${j}.title`,{group:y})}),e.jsx(C,{variant:j==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:c(`continuityReadiness.state.${j}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:c(`continuityReadiness.messages.${j}.description`,{group:y,count:u})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[v>0&&e.jsx(C,{variant:"outline",className:"text-blue-700 bg-blue-50/50 border-blue-200/60 dark:border-blue-900/40 dark:bg-blue-900/20 dark:text-blue-300",children:c("historySyncLearningMap.cliproxyManaged",{count:v})}),h>0&&e.jsx(C,{variant:"outline",className:"text-amber-700 bg-amber-50/50 border-amber-200/60 dark:border-amber-900/40 dark:bg-amber-900/20 dark:text-amber-300",children:c("historySyncLearningMap.legacyConfirmation",{count:h})}),g.length>0&&b.length===0&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.recommendBadge",{group:y})}),n&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.partialBadge",{group:y})})]})]})}),(D||A)&&e.jsx(O,{className:"border-dashed",children:e.jsxs(G,{className:"p-5 space-y-4",children:[D&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c("continuityOverview.plainLaneDescription",{lane:N||"plain ccs"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),x?e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:`ccs auth default ${x}`}),e.jsx(P,{value:`ccs auth default ${x}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:c("continuityOverview.setDefaultHint")})]})]}),A&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:c("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:c("continuityReadiness.steps.sameGroup",{group:y})}),e.jsx("li",{children:c("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:c("continuityReadiness.steps.resumeOriginal")})]})]})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-3",children:[e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-blue-300/40 bg-blue-50/50 dark:border-blue-900/30 dark:bg-blue-900/10 shadow-sm transition-colors hover:bg-blue-100/40 dark:hover:bg-blue-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4 text-blue-700/80 dark:text-blue-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-900 dark:text-blue-200",children:c("historySyncLearningMap.isolated")}),e.jsx(K,{titleKey:"accountsPage.isolated",descKey:"accountsPage.isolatedDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-blue-900 dark:text-blue-200",children:t})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-emerald-300/40 bg-emerald-50/50 dark:border-emerald-900/30 dark:bg-emerald-900/10 shadow-sm transition-colors hover:bg-emerald-100/40 dark:hover:bg-emerald-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-emerald-700/80 dark:text-emerald-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-900 dark:text-emerald-200",children:c("historySyncLearningMap.shared")}),e.jsx(K,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:m})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-indigo-300/40 bg-indigo-50/50 dark:border-indigo-900/30 dark:bg-indigo-900/10 shadow-sm transition-colors hover:bg-indigo-100/40 dark:hover:bg-indigo-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"h-4 w-4 text-indigo-700/80 dark:text-indigo-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-indigo-900 dark:text-indigo-200",children:c("historySyncLearningMap.deeper")}),e.jsx(K,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:s})]})]})]})}const ge=64;function gs({open:a,onClose:x}){const{t}=R(),[m,s]=k.useState(""),[u,r]=k.useState(!1),[l,g]=k.useState(""),[b,h]=k.useState(!1),[v,d]=k.useState(!1),c=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(m),N=l.trim().toLowerCase().replace(/\s+/g,"-"),j=N.length===0||N.length<=ge&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),y=m&&c?[`ccs auth create ${m}`,u?N.length>0?`--context-group ${N}`:"--share-context":"",u&&b?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),n=async()=>{!c||u&&!j||(await navigator.clipboard.writeText(y),d(!0),setTimeout(()=>d(!1),2e3))},o=()=>{s(""),r(!1),g(""),h(!1),d(!1),x()};return e.jsx(q,{open:a,onOpenChange:i=>!i&&o(),children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("createAuthProfileDialog.title")}),e.jsx(Y,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(E,{id:"profile-name",value:m,onChange:i=>s(i.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),m&&!c&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{id:"share-context",checked:u,onCheckedChange:i=>r(i===!0)}),e.jsx(S,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),u&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(S,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(E,{id:"context-group",value:l,onChange:i=>g(i.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(ie,{id:"deeper-continuity",checked:b,onCheckedChange:i=>h(i===!0)}),e.jsx(S,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),l.trim().length>0&&!j&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ge})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(ve,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:y}),e.jsx(p,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:n,disabled:!c||u&&!j,children:v?e.jsx(V,{className:"w-4 h-4 text-green-500"}):e.jsx(oe,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(p,{variant:"ghost",onClick:o,children:t("createAuthProfileDialog.close")}),e.jsx(p,{onClick:n,disabled:!c||u&&!j,children:v?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function Ts(){const{t:a}=R(),x=Ae(),{data:t,isLoading:m}=ss(),s=ts(),[u,r]=k.useState(!1),l=t?.accounts||[],g=t?.cliproxyCount||0,b=t?.legacyContextCount||0,h=t?.legacyContinuityCount||0,v=t?.sharedCount||0,d=t?.sharedStandardCount||0,c=t?.deeperSharedCount||0,N=t?.isolatedCount||0,j=t?.sharedAloneCount||0,y=t?.sharedPeerAccountCount||0,n=t?.deeperReadyAccountCount||0,o=t?.sharedPeerGroups||[],i=t?.deeperReadyGroups||[],w=t?.sharedGroups||[],D=t?.groupSummaries||[],A=t?.plainCcsLane||null,$=l.filter(H=>H.context_inferred||H.continuity_inferred),T=$.length,U=T>0,f=()=>x("/cliproxy?provider=claude"),I=()=>x("/cliproxy?provider=claude&action=auth"),_=()=>s.mutate($);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xs,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:a("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.manageSuffix")]})]}),e.jsx(Be,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.primaryActions")}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:I,children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),a("accountsPage.authClaudeInPool")]}),e.jsxs(p,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:f,children:[a("accountsPage.openClaudePoolSettings"),e.jsx(B,{className:"w-4 h-4 ml-auto"})]})]}),U?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(X,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContextPending",{count:b})}),h>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContinuityPending",{count:h})})]})]}),e.jsx(p,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:a("accountsPage.noLegacyFollowup")}),e.jsxs(O,{children:[e.jsxs(M,{className:"pb-2",children:[e.jsx(z,{className:"text-sm",children:a("accountsPage.quickCommands")}),e.jsx(F,{children:a("accountsPage.quickCommandsDesc")})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity"}),e.jsx(P,{value:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(P,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",children:a("accountsPage.workspaceBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.historySyncBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.resourcesBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:a("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[a("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:a("accountsTable.sync")}),a("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{className:"flex flex-col",children:[e.jsxs(M,{className:"pb-3",children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.accountMatrix")}),e.jsx(F,{children:a("accountsPage.sharedTotalDesc",{count:v})})]}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(O,{children:[e.jsxs(M,{children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.title")}),e.jsxs(F,{children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.mobileManageSuffix")]})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs(p,{className:"w-full",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:f,children:[a("accountsPage.openCliProxyClaudePool"),e.jsx(B,{className:"w-4 h-4 ml-2"})]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:I,children:[a("accountsPage.authClaudeInPool"),e.jsx(le,{className:"w-4 h-4 ml-2"})]}),e.jsx(p,{variant:"outline",className:"w-full",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}),e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{children:[e.jsx(M,{className:"pb-3",children:e.jsx(z,{className:"text-base",children:a("accountsPage.accountMatrix")})}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]}),e.jsx(gs,{open:u,onClose:()=>r(!1)})]})}export{Ts as AccountsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as o,bY as l}from"./index-
|
|
1
|
+
import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as o,bY as l}from"./index-CSlgRg0s.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function z({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,z as f,y as g};
|