@kaitranntt/ccs 8.8.1-dev.3 → 8.8.1-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/services/profile-lifecycle-validation.d.ts.map +1 -1
- package/dist/api/services/profile-lifecycle-validation.js +3 -8
- package/dist/api/services/profile-lifecycle-validation.js.map +1 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts +1 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts.map +1 -1
- package/dist/cliproxy/config/generator.d.ts.map +1 -1
- package/dist/cliproxy/config/generator.js +22 -2
- package/dist/cliproxy/config/generator.js.map +1 -1
- package/dist/cliproxy/routing/retry-settings.d.ts +18 -0
- package/dist/cliproxy/routing/retry-settings.d.ts.map +1 -0
- package/dist/cliproxy/routing/retry-settings.js +185 -0
- package/dist/cliproxy/routing/retry-settings.js.map +1 -0
- package/dist/cliproxy/routing/routing-strategy-http.d.ts +3 -0
- package/dist/cliproxy/routing/routing-strategy-http.d.ts.map +1 -1
- package/dist/cliproxy/routing/routing-strategy-http.js +13 -3
- package/dist/cliproxy/routing/routing-strategy-http.js.map +1 -1
- package/dist/config/schemas/cliproxy.d.ts +23 -0
- package/dist/config/schemas/cliproxy.d.ts.map +1 -1
- package/dist/config/schemas/cliproxy.js +13 -1
- package/dist/config/schemas/cliproxy.js.map +1 -1
- package/dist/shared/extended-context-utils.d.ts +1 -1
- package/dist/shared/extended-context-utils.d.ts.map +1 -1
- package/dist/shared/extended-context-utils.js +1 -0
- package/dist/shared/extended-context-utils.js.map +1 -1
- package/dist/ui/assets/{Trans-BivhJwms.js → Trans-DiarGpf4.js} +1 -1
- package/dist/ui/assets/{accounts-BiEcMbqT.js → accounts-XuGix7UL.js} +1 -1
- package/dist/ui/assets/{alert-dialog-D-u0KNAx.js → alert-dialog-DZjLLVOc.js} +1 -1
- package/dist/ui/assets/{api-DcgHocM1.js → api-Di6M6xmB.js} +1 -1
- package/dist/ui/assets/{auth-section-CF4ODMsV.js → auth-section-CczmnmwY.js} +1 -1
- package/dist/ui/assets/{backups-section-CqjYRN5X.js → backups-section-BpqmEOp0.js} +1 -1
- package/dist/ui/assets/{channels-S5gHU7rz.js → channels-mwjJYQh5.js} +1 -1
- package/dist/ui/assets/{checkbox-g3p1GTL4.js → checkbox-BOmnNqsp.js} +1 -1
- package/dist/ui/assets/{claude-extension-DIds9k1j.js → claude-extension-L-97FhBs.js} +1 -1
- package/dist/ui/assets/cliproxy-DFpGEQXe.js +4 -0
- package/dist/ui/assets/{cliproxy-ai-providers-D8c3Mpgq.js → cliproxy-ai-providers-DzrfhSsZ.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-DfPlCbGD.js → cliproxy-control-panel-BCpxm9H2.js} +1 -1
- package/dist/ui/assets/{codex-DLLPlid5.js → codex-F125yBdl.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-Z0im6J9S.js → confirm-dialog-DuRwmiAz.js} +1 -1
- package/dist/ui/assets/{copilot-CXgYdFGi.js → copilot-CZ9A3FkD.js} +1 -1
- package/dist/ui/assets/{cursor-BUSl5PM4.js → cursor-BAOtHHVu.js} +1 -1
- package/dist/ui/assets/{droid-C70MJH6b.js → droid-D_uYhsMt.js} +1 -1
- package/dist/ui/assets/{globalenv-section-b5QbJZ0R.js → globalenv-section-B3FB5GKg.js} +1 -1
- package/dist/ui/assets/{health-MraAaslk.js → health-BI_SwyW_.js} +1 -1
- package/dist/ui/assets/{index-Cgu1C7Pc.js → index-B1dJhFRz.js} +1 -1
- package/dist/ui/assets/{index-CbH39Xjo.js → index-C-aSSDNH.js} +19 -19
- package/dist/ui/assets/{index-JAWfL91E.js → index-CTDRFudx.js} +1 -1
- package/dist/ui/assets/{index-DdEBcxB3.js → index-D8NPNC8B.js} +1 -1
- package/dist/ui/assets/{index-C30zS3wg.js → index-Djc-RnsN.js} +1 -1
- package/dist/ui/assets/{index-DbBLaEX-.js → index-FEToMW33.js} +1 -1
- package/dist/ui/assets/{index-CRaJjjbV.js → index-u89b1WWp.js} +1 -1
- package/dist/ui/assets/{logs-IWHIuCjH.js → logs-COoxY4CH.js} +1 -1
- package/dist/ui/assets/{masked-input-BsPNMst6.js → masked-input-DSnSaTcS.js} +1 -1
- package/dist/ui/assets/proxy-status-widget-UlQ-0XKl.js +1 -0
- package/dist/ui/assets/{raw-json-settings-editor-panel-DSgbOuAi.js → raw-json-settings-editor-panel-BcAkJoe5.js} +1 -1
- package/dist/ui/assets/{searchable-select-DzMpfcZm.js → searchable-select-GpaUacz1.js} +1 -1
- package/dist/ui/assets/{separator-CV9oGzr1.js → separator-Lk-8g1TR.js} +1 -1
- package/dist/ui/assets/{shared-DrNRROGw.js → shared-B9tLDHee.js} +1 -1
- package/dist/ui/assets/{table-DRdDH5F_.js → table-CYtYkS4-.js} +1 -1
- package/dist/ui/assets/{updates-DfXTDvQ7.js → updates-DoMWhMSj.js} +1 -1
- package/dist/ui/assets/{use-accounts-DehnXQzo.js → use-accounts-BeyUHuex.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/utils/shell-executor.d.ts +1 -1
- package/dist/utils/shell-executor.d.ts.map +1 -1
- package/dist/utils/shell-executor.js +5 -8
- package/dist/utils/shell-executor.js.map +1 -1
- package/dist/web-server/routes/cliproxy-routing-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-routing-routes.js +28 -0
- package/dist/web-server/routes/cliproxy-routing-routes.js.map +1 -1
- package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
- package/dist/web-server/routes/settings-routes.js +1 -0
- package/dist/web-server/routes/settings-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/cliproxy-BShK5X6b.js +0 -4
- package/dist/ui/assets/proxy-status-widget-BzdLxzaO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/settings-routes.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;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C9C,IAAA,mCAAgB,GAAE,CAAC;QAEnB,MAAM,OAAO,GAAG,IAAA,yBAAc,GAAE,CAAC;QACjC,GAAG,CAAC,IAAI,CAAC;YACP,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACN,KAAK,EAAE,IAAA,oBAAS,EAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;gBACtC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;aAClC;YACD,gBAAgB,EAAE;gBAChB,KAAK,EAAE,IAAA,oBAAS,EAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC;gBAChD,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAAQ;aAC5C;YACD,OAAO,EAAE,sDAAsD;SAChE,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,oBAAoB,CAAC,GAAG,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as u}from"./react-vendor-Bjx91N7w.js";import{a as Pt,u as os,b as Os}from"./tanstack-bhJxV1h8.js";import{a9 as Ls,a as W,e as G,C as ds,b as ls,aa as cs,ab as us,c as X,P as be,B as z,ac as xe,L as ee,I as ce,j as Oe,k as Le,l as _e,m as Fe,n as je,ad as ms,ae as ps,af as _s,ag as Fs,ah as qs,u as xs,ai as Tt,aj as Dt,ak as Et,al as It,Y as he,am as hs,an as Qt,ao as Us,ap as Gs,aq as qe,ar as fs,_ as tt,as as Ks,at as Wt,au as Jt,av as Hs,aw as zs,ax as Bs,ay as Vs,az as $s,aA as Qs,aB as Ws,aC as Js,aD as Xt,aE as Rt,aF as Xs,z as gs,aG as Ys,x as Ot,aH as Zs,aI as Lt,aJ as Yt,aK as ea,w as ta,aL as sa,aM as aa,T as Nt,o as kt,p as yt,q as wt,aN as na,aO as ia,aP as ra,aQ as ht,aR as oa,aS as da,aT as la,aU as ca,aV as ua,aW as ma,U as pa,V as xa,W as Zt,X as es,aX as ha,aY as fa,aZ as ga,a_ as va,a$ as ja,b0 as ba,b1 as Na,b2 as ka,b3 as ya,b4 as wa,b5 as Ca,b6 as Je,b7 as Aa,S as Sa}from"./index-CbH39Xjo.js";import{C as Ct}from"./default-ports-1QQSffYX.js";import{t as V}from"./notifications-B4_o8bcr.js";import{C as vs,L as ue,q as Pe,a0 as Ma,n as Te,p as js,aH as _t,R as dt,r as Ue,ab as Ft,T as it,a8 as ts,aI as bs,aG as Pa,D as qt,Z as Ge,$ as Ns,i as Ta,v as ks,aJ as Da,av as Ea,X as Ut,aa as lt,N as ys,I as ws,aK as Ia,au as Cs,aL as Ra,ay as Oa,aM as rt}from"./icons-DSLG1YsC.js";import{R as st,A as ss,D as ft,i as La,a as _a}from"./antigravity-responsibility-constants-Bvh4Ybz0.js";import{C as at}from"./checkbox-g3p1GTL4.js";import{C as Fa}from"./confirm-dialog-Z0im6J9S.js";import{S as Gt}from"./separator-CV9oGzr1.js";import{S as qa}from"./searchable-select-DzMpfcZm.js";import{P as Ua}from"./proxy-status-widget-BzdLxzaO.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";import"./alert-dialog-D-u0KNAx.js";import"./Trans-BivhJwms.js";const ne="gemini-3.1-pro-high",Ee="gemini-3.1-pro-low",Ga=Object.freeze({"gemini-3-pro-high":ne,"gemini-3.1-pro-high":ne,"gemini-3-pro-low":Ee,"gemini-3.1-pro-low":Ee,"gemini-3-pro-preview":ne,"gemini-3-pro-preview-customtools":ne,"gemini-3.1-pro-preview":ne,"gemini-3.1-pro-preview-customtools":ne,"gemini-3-1-pro-preview":ne,"gemini-3-1-pro-preview-customtools":ne}),As=Object.freeze({"gemini-3-pro-preview":"gemini-3.1-pro-preview","gemini-3.1-pro-preview":"gemini-3-pro-preview","gemini-3-flash-preview":"gemini-3.1-flash-preview","gemini-3.1-flash-preview":"gemini-3-flash-preview"}),Ka=/^gemini-(\d+(?:[.-]\d+)*)-(pro|flash)-preview(-customtools)?$/i,Ha=["agy/","gcli/"];function $(t){return Ls(t).toLowerCase()}function za(t){const a=t.trim(),s=a.toLowerCase();for(const n of Ha)if(s.startsWith(n))return a.slice(n.length);return a}function Ba(t){return t.replace(/-customtools$/i,"")}function Va(t){return Ga[$(t)]}function ot(t){const a=$(t),s=a.match(Ka);if(!s)return null;const[,n,i,d]=s;return{normalizedId:a,version:n.split(/[.-]/).map(o=>Number(o)),family:i,customtools:!!d,dottedVersion:n.includes(".")}}function Ss(t,a){const s=Math.max(t.length,a.length);for(let n=0;n<s;n+=1){const i=t[n]??0,d=a[n]??0;if(i!==d)return i>d?1:-1}return 0}function $a(t,a,s){if(t.customtools!==a.customtools)return t.customtools?1:-1;const n=Ss(t.version,a.version);if(n!==0)return n>0?-1:1;const i=+(t.dottedVersion===s.dottedVersion),d=+(a.dottedVersion===s.dottedVersion);return i!==d?d-i:t.normalizedId.localeCompare(a.normalizedId)}function as(t,a){const s=$(a);return t.find(n=>$(n.id)===s)?.id}function Qa(t,a){const s=ot(t);return!s||a.length===0?void 0:a.map(i=>{const d=ot(i.id);return!d||d.family!==s.family?null:{id:i.id,info:d}}).filter(i=>!!i).sort((i,d)=>$a(i.info,d.info,s))[0]?.id}const Ne={agy:{provider:"agy",displayName:"Antigravity",defaultModel:"claude-opus-4-6-thinking",models:[{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",description:"Latest flagship, extended thinking",extendedContext:!1,presetMapping:{default:"claude-opus-4-6-thinking",opus:"claude-opus-4-6-thinking",sonnet:"claude-sonnet-4-6",haiku:"claude-sonnet-4-6"}},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",description:"Latest Sonnet with thinking budget support",presetMapping:{default:"claude-sonnet-4-6",opus:"claude-opus-4-6-thinking",sonnet:"claude-sonnet-4-6",haiku:"claude-sonnet-4-6"}},{id:ne,name:"Gemini Pro High",description:"Current Antigravity Gemini Pro route with higher reasoning budget",extendedContext:!0,presetMapping:{default:ne,opus:ne,sonnet:ne,haiku:"gemini-3-1-flash-preview"}},{id:Ee,name:"Gemini Pro Low",description:"Current Antigravity Gemini Pro route with the lighter quota tier",extendedContext:!0,presetMapping:{default:Ee,opus:Ee,sonnet:Ee,haiku:"gemini-3-1-flash-preview"}},{id:"gemini-3-1-flash-preview",name:"Gemini Flash",description:"Resolves to the best advertised Gemini Flash preview via Antigravity",extendedContext:!0,presetMapping:{default:"gemini-3-1-flash-preview",opus:ne,sonnet:ne,haiku:"gemini-3-1-flash-preview"}}]},gemini:{provider:"gemini",displayName:"Gemini",defaultModel:"gemini-2.5-pro",models:[{id:"gemini-3.1-pro-preview",name:"Gemini Pro",tier:"paid",description:"Uses the best advertised Gemini Pro preview when Google exposes one",extendedContext:!0,presetMapping:{default:"gemini-3.1-pro-preview",opus:"gemini-3.1-pro-preview",sonnet:"gemini-3.1-pro-preview",haiku:"gemini-3-flash-preview"}},{id:"gemini-3-flash-preview",name:"Gemini Flash",tier:"paid",description:"Uses the best advertised Gemini Flash preview when Google exposes one",extendedContext:!0,presetMapping:{default:"gemini-3-flash-preview",opus:"gemini-3.1-pro-preview",sonnet:"gemini-3.1-pro-preview",haiku:"gemini-3-flash-preview"}},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Stable, works with free Google account",extendedContext:!0,presetMapping:{default:"gemini-2.5-pro",opus:"gemini-2.5-pro",sonnet:"gemini-2.5-pro",haiku:"gemini-2.5-flash"}}]},codex:{provider:"codex",displayName:"Codex",defaultModel:"gpt-5.4",models:[{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",description:"Latest frontier agentic coding model.",codexMaxEffort:"xhigh",codexEfforts:["low","medium","high","xhigh"],codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.6-sol",opus:"gpt-5.6-sol",sonnet:"gpt-5.6-sol",haiku:"gpt-5.4-mini"}},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",description:"Balanced agentic coding model for everyday work.",codexMaxEffort:"xhigh",codexEfforts:["low","medium","high","xhigh"],codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.6-terra",opus:"gpt-5.6-terra",sonnet:"gpt-5.6-terra",haiku:"gpt-5.4-mini"}},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",description:"Fast and affordable agentic coding model.",codexMaxEffort:"xhigh",codexEfforts:["low","medium","high","xhigh"],codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.6-luna",opus:"gpt-5.6-luna",sonnet:"gpt-5.6-luna",haiku:"gpt-5.4-mini"}},{id:"gpt-5.5",name:"GPT-5.5",tier:"paid",description:"Newest Codex-released GPT-5 family model; falls back to GPT-5.4 on free plans",codexMaxEffort:"xhigh",codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.5",opus:"gpt-5.5",sonnet:"gpt-5.5",haiku:"gpt-5.4-mini"}},{id:"gpt-5.4",name:"GPT-5.4",description:"Recommended Codex default for most coding and agentic tasks",codexMaxEffort:"xhigh",codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.4",opus:"gpt-5.4",sonnet:"gpt-5.4",haiku:"gpt-5.4-mini"}},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",description:"Fast, lower-cost Codex option for lighter tasks and haiku-tier routing",codexMaxEffort:"high",presetMapping:{default:"gpt-5.4-mini",opus:"gpt-5.4",sonnet:"gpt-5.4",haiku:"gpt-5.4-mini"}},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",tier:"paid",description:"Previous flagship coding model whose capabilities now power GPT-5.4",codexMaxEffort:"xhigh",presetMapping:{default:"gpt-5.3-codex",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5.4-mini"}},{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",tier:"paid",description:"Research preview model for ChatGPT Pro subscribers, optimized for near-instant coding iteration",codexMaxEffort:"xhigh",presetMapping:{default:"gpt-5.3-codex-spark",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5.4-mini"}},{id:"gpt-5.2",name:"GPT-5.2",description:"Previous general-purpose Codex model",codexMaxEffort:"xhigh",presetMapping:{default:"gpt-5.2",opus:"gpt-5.2",sonnet:"gpt-5.2",haiku:"gpt-5.4-mini"}}]},xai:{provider:"xai",displayName:"xAI (Grok)",defaultModel:"grok-build-0.1",models:[{id:"grok-build-0.1",name:"Grok Build 0.1",description:"Fast coding model for agentic software engineering workflows",presetMapping:{default:"grok-build-0.1",opus:"grok-4.5",sonnet:"grok-build-0.1",haiku:"grok-composer-2.5-fast"}},{id:"grok-4.5",name:"Grok 4.5",description:"Frontier model for coding, engineering, and agentic workflows",reasoningLevels:["low","medium","high"]},{id:"grok-4.3",name:"Grok 4.3",description:"General-purpose Grok model with a one-million-token context window",reasoningLevels:["none","low","medium","high"]},{id:"grok-4.20-0309-reasoning",name:"Grok 4.20 0309 Reasoning",description:"Reasoning model with a two-million-token context window"},{id:"grok-4.20-0309-non-reasoning",name:"Grok 4.20 0309 Non Reasoning",description:"Non-reasoning model with a two-million-token context window"},{id:"grok-4.20-multi-agent-0309",name:"Grok 4.20 Multi Agent 0309",description:"Multi-agent model with a two-million-token context window"},{id:"grok-3-mini",name:"Grok 3 Mini",description:"Compact reasoning model"},{id:"grok-3-mini-fast",name:"Grok 3 Mini Fast",description:"Faster compact reasoning model"},{id:"grok-composer-2.5-fast",name:"Grok Composer 2.5 Fast",description:"Fast Composer model for lightweight coding tasks"}]},qwen:{provider:"qwen",displayName:"Qwen",defaultModel:"qwen3-coder-plus",models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus",description:"Code-focused model (1M context)",presetMapping:{default:"qwen3-coder-plus",opus:"qwen3-max",sonnet:"qwen3-coder-plus",haiku:"qwen3-coder-flash"}},{id:"qwen3-max",name:"Qwen3 Max",description:"Flagship model (256K context)",presetMapping:{default:"qwen3-max",opus:"qwen3-max",sonnet:"qwen3-coder-plus",haiku:"qwen3-coder-flash"}},{id:"qwen3-max-preview",name:"Qwen3 Max Preview",description:"Preview with thinking support (256K)",presetMapping:{default:"qwen3-max-preview",opus:"qwen3-max-preview",sonnet:"qwen3-max",haiku:"qwen3-coder-flash"}},{id:"qwen3-235b",name:"Qwen3 235B",description:"Large 235B A22B model",presetMapping:{default:"qwen3-235b",opus:"qwen3-max",sonnet:"qwen3-235b",haiku:"qwen3-coder-flash"}},{id:"qwen3-vl-plus",name:"Qwen3 VL Plus",description:"Vision-language multimodal"},{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash",description:"Fast code generation"},{id:"qwen3-32b",name:"Qwen3 32B",description:"Qwen3 32B model"}]},iflow:{provider:"iflow",displayName:"iFlow",defaultModel:"qwen3-coder-plus",models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus",description:"Recommended default for iFlow accounts",presetMapping:{default:"qwen3-coder-plus",opus:"qwen3-coder-plus",sonnet:"qwen3-coder-plus",haiku:"qwen3-coder-plus"}},{id:"qwen3-max",name:"Qwen3 Max",description:"Flagship Qwen model via iFlow"},{id:"kimi-k2",name:"Kimi K2",description:"Kimi model currently available via iFlow"},{id:"deepseek-v3.2",name:"DeepSeek V3.2",description:"Current DeepSeek V3.2 model via iFlow"},{id:"deepseek-r1",name:"DeepSeek R1",description:"Reasoning-focused DeepSeek model"},{id:"glm-4.6",name:"GLM 4.6",description:"Zhipu GLM 4.6 via iFlow"},{id:"qwen3-vl-plus",name:"Qwen3 VL Plus",description:"Vision-language model"}]},qoder:{provider:"qoder",displayName:"Qoder",defaultModel:"qoder/auto",models:[{id:"qoder/auto",name:"Qoder Auto",description:"Auto selects the best Qoder model for your prompt",presetMapping:{default:"qoder/auto",opus:"qoder/auto",sonnet:"qoder/auto",haiku:"qoder/auto"}},{id:"qoder/ultimate",name:"Qoder Ultimate",description:"Highest quality Qoder tier",presetMapping:{default:"qoder/ultimate",opus:"qoder/ultimate",sonnet:"qoder/ultimate",haiku:"qoder/ultimate"}},{id:"qoder/performance",name:"Qoder Performance",description:"Balanced quality and speed",presetMapping:{default:"qoder/performance",opus:"qoder/performance",sonnet:"qoder/performance",haiku:"qoder/performance"}},{id:"qoder/efficient",name:"Qoder Efficient",description:"Cost-efficient Qoder tier",presetMapping:{default:"qoder/efficient",opus:"qoder/efficient",sonnet:"qoder/efficient",haiku:"qoder/efficient"}},{id:"qoder/lite",name:"Qoder Lite",description:"Fastest and most affordable Qoder tier",presetMapping:{default:"qoder/lite",opus:"qoder/lite",sonnet:"qoder/lite",haiku:"qoder/lite"}},{id:"qoder/qmodel",name:"Qwen 3.6 Plus (via Qoder)",description:"Qwen 3.6 Plus frontier model",presetMapping:{default:"qoder/qmodel",opus:"qoder/qmodel",sonnet:"qoder/qmodel",haiku:"qoder/qmodel"}},{id:"qoder/dmodel",name:"DeepSeek V4 Pro (via Qoder)",description:"DeepSeek V4 Pro frontier model",presetMapping:{default:"qoder/dmodel",opus:"qoder/dmodel",sonnet:"qoder/dmodel",haiku:"qoder/dfmodel"}},{id:"qoder/dfmodel",name:"DeepSeek V4 Flash (via Qoder)",description:"DeepSeek V4 Flash frontier model"},{id:"qoder/gm51model",name:"GLM 5.1 (via Qoder)",description:"GLM 5.1 frontier model",presetMapping:{default:"qoder/gm51model",opus:"qoder/gm51model",sonnet:"qoder/gm51model",haiku:"qoder/gm51model"}},{id:"qoder/kmodel",name:"Kimi K2.6 (via Qoder)",description:"Kimi K2.6 frontier model",presetMapping:{default:"qoder/kmodel",opus:"qoder/kmodel",sonnet:"qoder/kmodel",haiku:"qoder/kmodel"}},{id:"qoder/mmodel",name:"MiniMax M2.7 (via Qoder)",description:"MiniMax M2.7 frontier model",presetMapping:{default:"qoder/mmodel",opus:"qoder/mmodel",sonnet:"qoder/mmodel",haiku:"qoder/mmodel"}}]},kimi:{provider:"kimi",displayName:"Kimi (Moonshot)",defaultModel:"kimi-k2.5",models:[{id:"kimi-k2.5",name:"Kimi K2.5",description:"Latest multimodal model (262K context)",presetMapping:{default:"kimi-k2.5",opus:"kimi-k2.5",sonnet:"kimi-k2-thinking",haiku:"kimi-k2"}},{id:"kimi-k2-thinking",name:"Kimi K2 Thinking",description:"Extended reasoning model",presetMapping:{default:"kimi-k2-thinking",opus:"kimi-k2.5",sonnet:"kimi-k2-thinking",haiku:"kimi-k2"}},{id:"kimi-k2",name:"Kimi K2",description:"Flagship coding model"}]},kiro:{provider:"kiro",displayName:"Kiro (AWS)",defaultModel:"kiro-claude-sonnet-4-6",models:[{id:"kiro-claude-opus-4-6",name:"Kiro Claude Opus 4.6",description:"Claude Opus 4.6 via Kiro (2.2x credit)",presetMapping:{default:"kiro-claude-opus-4-6",opus:"kiro-claude-opus-4-6",sonnet:"kiro-claude-sonnet-4-6",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4-6",name:"Kiro Claude Sonnet 4.6",description:"Claude Sonnet 4.6 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4-6",opus:"kiro-claude-opus-4-6",sonnet:"kiro-claude-sonnet-4-6",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-opus-4-5",name:"Kiro Claude Opus 4.5",description:"Claude Opus 4.5 via Kiro (2.2x credit)",presetMapping:{default:"kiro-claude-opus-4-5",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4-5",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4-5",name:"Kiro Claude Sonnet 4.5",description:"Claude Sonnet 4.5 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4-5",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4-5",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4",name:"Kiro Claude Sonnet 4",description:"Claude Sonnet 4 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-haiku-4-5",name:"Kiro Claude Haiku 4.5",description:"Claude Haiku 4.5 via Kiro (0.4x credit)"}]},ghcp:{provider:"ghcp",displayName:"GitHub Copilot (OAuth)",defaultModel:"claude-sonnet-5",models:[{id:"claude-sonnet-5",name:"Claude Sonnet 5",description:"Anthropic Claude Sonnet 5 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"claude-sonnet-5",opus:"claude-opus-4.8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4.5"}},{id:"claude-opus-4.8",name:"Claude Opus 4.8",description:"Anthropic Claude Opus 4.8 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"claude-opus-4.8",opus:"claude-opus-4.8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4.5"}},{id:"claude-opus-4.8-fast-mode",name:"Claude Opus 4.8 Fast Mode",description:"Anthropic Claude Opus 4.8 preview fast mode via GitHub Copilot",extendedContext:!0},{id:"claude-opus-4.7",name:"Claude Opus 4.7",description:"Anthropic Claude Opus 4.7 via GitHub Copilot",extendedContext:!0},{id:"claude-opus-4.6",name:"Claude Opus 4.6",description:"Anthropic Claude Opus 4.6 via GitHub Copilot",extendedContext:!0},{id:"claude-opus-4.5",name:"Claude Opus 4.5",description:"Anthropic Claude Opus 4.5 via GitHub Copilot",presetMapping:{default:"claude-opus-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"}},{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",description:"Anthropic Claude Sonnet 4.6 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"claude-sonnet-4.6",opus:"claude-opus-4.7",sonnet:"claude-sonnet-4.6",haiku:"claude-haiku-4.5"}},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",description:"Anthropic Claude Sonnet 4.5 via GitHub Copilot",presetMapping:{default:"claude-sonnet-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"}},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",description:"Anthropic Claude Haiku 4.5 via GitHub Copilot"},{id:"claude-fable-5",name:"Claude Fable 5",description:"Anthropic Claude Fable 5 via GitHub Copilot",extendedContext:!0},{id:"gpt-5.5",name:"GPT-5.5",description:"OpenAI GPT-5.5 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"gpt-5.5",opus:"gpt-5.5",sonnet:"gpt-5.4",haiku:"gpt-5.4-mini"}},{id:"gpt-5.4",name:"GPT-5.4",description:"OpenAI GPT-5.4 via GitHub Copilot",extendedContext:!0},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",description:"OpenAI GPT-5.4 Mini via GitHub Copilot"},{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",description:"OpenAI GPT-5.4 Nano via GitHub Copilot"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",description:"OpenAI GPT-5.3 Codex via GitHub Copilot",extendedContext:!0,presetMapping:{default:"gpt-5.3-codex",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5-mini"}},{id:"gpt-5-mini",name:"GPT-5 Mini",description:"OpenAI GPT-5 Mini via GitHub Copilot"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Google Gemini 2.5 Pro via GitHub Copilot"},{id:"gemini-3-flash",name:"Gemini 3 Flash",description:"Google Gemini 3 Flash via GitHub Copilot"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",description:"Google Gemini 3.1 Pro via GitHub Copilot"},{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",description:"Google Gemini 3.5 Flash via GitHub Copilot"},{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",description:"Moonshot Kimi K2.7 Code via GitHub Copilot"},{id:"mai-code-1-flash",name:"MAI-Code-1-Flash",description:"Microsoft MAI-Code-1-Flash via GitHub Copilot"},{id:"raptor-mini",name:"Raptor Mini",description:"Microsoft Raptor Mini via GitHub Copilot"}]},claude:{provider:"claude",displayName:"Claude (Anthropic)",defaultModel:"claude-sonnet-5",models:[{id:"claude-sonnet-5",name:"Claude Sonnet 5",description:"Latest Sonnet model",extendedContext:!0,presetMapping:{default:"claude-sonnet-5",opus:"claude-opus-4-8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-fable-5",name:"Claude Fable 5",description:"Most powerful model",extendedContext:!0,presetMapping:{default:"claude-fable-5",opus:"claude-fable-5",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-8",name:"Claude Opus 4.8",description:"Latest flagship model",extendedContext:!0,presetMapping:{default:"claude-opus-4-8",opus:"claude-opus-4-8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-7",name:"Claude Opus 4.7",description:"Previous flagship model",extendedContext:!0,presetMapping:{default:"claude-opus-4-7",opus:"claude-opus-4-7",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-6",name:"Claude Opus 4.6",description:"Older flagship model",extendedContext:!0,presetMapping:{default:"claude-opus-4-6",opus:"claude-opus-4-6",sonnet:"claude-sonnet-4-6",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",description:"Balanced performance and speed",extendedContext:!0,presetMapping:{default:"claude-sonnet-4-6",opus:"claude-opus-4-6",sonnet:"claude-sonnet-4-6",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",description:"Most capable Claude model",extendedContext:!0,presetMapping:{default:"claude-opus-4-5-20251101",opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-5-20250929",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-sonnet-4-5-20250929",name:"Claude Sonnet 4.5",description:"Balanced performance and speed",extendedContext:!0,presetMapping:{default:"claude-sonnet-4-5-20250929",opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-5-20250929",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",description:"Previous generation Sonnet",extendedContext:!0,presetMapping:{default:"claude-sonnet-4-20250514",opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-20250514",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",description:"Fast and efficient"}]}};function Re(t,a){if(!t)return;const s=$(a);if(t.provider==="agy"){const o=Va(s);if(o){const c=t.models.find(r=>r.id===o);if(c)return c}}const n=As[s.toLowerCase()],i=t.models.find(o=>o.id===s||o.id===n);if(i)return i;const d=ot(s);if(d)return t.models.map(o=>({model:o,info:ot(o.id)})).filter(o=>!!(o.info&&o.info.family===d.family)).sort((o,c)=>Ss(c.info.version,o.info.version))[0]?.model}function Wa(t){if(t==="free")return"free";if(typeof t=="string"&&t.trim().length>0)return"paid"}function Ja(t,a){const s=t.toLowerCase(),n=Ne[s];if(!a||a.models.length===0)return n;const i=a.models.map(l=>({id:l.id,owned_by:a.provider})),d=a.models.map(l=>{const g=Re(n,l.id);return{...l,name:l.name||g?.name||l.id,tier:g?.tier??Wa(l.tier),description:l.description??g?.description,broken:g?.broken,issueUrl:g?.issueUrl,deprecated:g?.deprecated,deprecationReason:g?.deprecationReason,extendedContext:s==="xai"?void 0:l.extendedContext??g?.extendedContext,presetMapping:g?.presetMapping,reasoningLevels:l.reasoningLevels??g?.reasoningLevels,codexMaxEffort:l.codexMaxEffort??g?.codexMaxEffort,codexEfforts:l.codexEfforts??g?.codexEfforts,codexServiceTiers:l.codexServiceTiers??g?.codexServiceTiers}}),o=n?.defaultModel?Ie(n.defaultModel,i):void 0,c=typeof o=="string"&&i.some(l=>$(l.id)===$(o)),r=i.some(l=>$(l.id)===$(a.defaultModel)),m=c?o:r?a.defaultModel:d[0]?.id??"";return{provider:a.provider,displayName:a.displayName||n?.displayName||t,defaultModel:m,models:d}}function Kt(t){const a={},s=new Set([...Object.keys(Ne),...Object.keys(t??{})]);for(const n of s){const i=Ja(n,t?.[n]);i&&(a[n]=i)}return a}function Ke(t,a,s){const n=Re(s,a);return n||Re(Ne[t.toLowerCase()],a)}function Ie(t,a=[]){const s=$(t),n=Qa(s,a);if(n)return n;const i=as(a,s);if(i)return i;const d=As[s];return(d?as(a,d):void 0)??s}function Xa(t,a=[]){return{default:Ie(t.default,a),opus:Ie(t.opus,a),sonnet:Ie(t.sonnet,a),haiku:Ie(t.haiku,a)}}function Ht(t,a=[]){if(!t)return[];const s=Ne[t.provider.toLowerCase()]??t,n=new Set;return s.models.map(i=>{const d=Ie(i.id,a),o=i.presetMapping?Xa(i.presetMapping,a):void 0,c=t.models.find(r=>$(r.id)===$(d));return{...i,id:d,name:c?.name||i.name,description:c?.description??i.description,presetMapping:o}}).filter(i=>n.has(i.id)?!1:(n.add(i.id),!0))}function Ya(t,a,s=[]){const n=t.trim().toLowerCase();if(!a||!n)return[];const i=Ne[n]??a,d=Ht(a,s),o=new Set(d.map(l=>$(l.id))),c=new Set(d.map(l=>Re(i,l.id)?.id).filter(l=>!!l).map(l=>$(l))),r=new Set,m=new Set(s.map(l=>$(l.id)));return s.filter(l=>{const g=$(l.id),x=za(l.id),b=Ba(x),k=Re(i,x)??Re(i,b);if(o.has($(x))||g!==$(x)&&m.has($(x)))return!1;const S=$(b);if(S!==$(x)&&m.has(S))return!1;const O=k?$(k.id):S;return k&&c.has(O)||r.has(O)||!k&&n==="agy"?!1:(r.add(O),!0)})}function Za(t,a,s){return t.toLowerCase()==="xai"?!1:Ke(t,a,s)?.extendedContext===!0}const gt="ccs-internal-managed";async function en(){try{const t=await fetch("/api/settings/auth/tokens/raw");return t.ok?(await t.json())?.apiKey?.value??gt:gt}catch{return gt}}async function tn(t,a){if(a)return a;try{const s=await fetch("/api/cliproxy/catalog");if(!s.ok)return Ne[t];const n=await s.json();return Kt(n.catalogs)[t]??Ne[t]}catch{return Ne[t]}}async function At(t,a,s){const n=await tn(t,s);if(!n)return{success:!1};const i=n.models.find(l=>l.id===n.defaultModel)||n.models[0],d=i?.id??n.defaultModel,o=i?.presetMapping||{default:d,opus:d,sonnet:d,haiku:d},c=await en(),m={env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${Ct}/api/provider/${t}`,ANTHROPIC_AUTH_TOKEN:c,ANTHROPIC_MODEL:o.default,ANTHROPIC_DEFAULT_OPUS_MODEL:o.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:o.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:o.haiku}};try{return{success:(await fetch(`/api/settings/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:m})})).ok,presetName:i?.name||n.defaultModel}}catch{return{success:!1}}}function sn({currentProgress:t,allSteps:a}){return e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:a.map((s,n)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${t>=n?"bg-primary":"bg-muted"}`},s))})}function an({providers:t,onSelect:a}){return e.jsx("div",{className:"grid gap-2",children:t.map(s=>e.jsxs("button",{onClick:()=>a(s.id),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.description})]}),e.jsx(vs,{className:"w-4 h-4 text-muted-foreground"})]},s.id))})}function nn({selectedProvider:t,providers:a,authCommand:s,isRefreshing:n,isPending:i,onBack:d,onStartAuth:o,onRefresh:c}){const{t:r}=W(),[m,l]=u.useState(!1),g=async x=>{await navigator.clipboard.writeText(x),l(!0),setTimeout(()=>l(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:r("setupWizard.authStep.authenticateWith",{provider:a.find(x=>x.id===t)?.name})}),e.jsx(G,{onClick:o,disabled:i,className:"w-full gap-2",size:"lg",children:i?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 animate-spin"}),r("setupWizard.authStep.authenticating")]}):e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"w-4 h-4"}),r("setupWizard.authStep.authenticateInBrowser")]})}),i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:r("setupWizard.authStep.completeOAuth")})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:r("setupWizard.authStep.orUseTerminal")})})]}),e.jsx(ds,{children:e.jsxs(ls,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ma,{className:"w-4 h-4"}),r("setupWizard.authStep.runCommandHint")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:s}),e.jsx(G,{variant:"outline",size:"icon",onClick:()=>g(s),children:m?e.jsx(Te,{className:"w-4 h-4 text-green-500"}):e.jsx(js,{className:"w-4 h-4"})})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(G,{variant:"ghost",onClick:d,disabled:i,children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),r("setupWizard.authStep.back")]}),e.jsxs(G,{variant:"outline",onClick:c,disabled:n||i,children:[e.jsx(dt,{className:`w-4 h-4 mr-2 ${n?"animate-spin":""}`}),r(n?"setupWizard.authStep.checking":"setupWizard.authStep.refreshStatus")]})]})]})}function rn({accounts:t,privacyMode:a,onSelect:s,onAddNew:n,onBack:i}){const{t:d}=W();return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:d("setupWizard.accountStep.selectAccount",{count:t.length})}),e.jsx("div",{className:"grid gap-2 max-h-[320px] overflow-y-auto pr-1",children:t.map(o=>{const c=cs(o.id,o.email,o.tokenFile),r=o.provider?.toLowerCase()==="codex"?us(c):null;return e.jsxs("button",{type:"button",onClick:()=>s(o),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center",children:e.jsx(Ue,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:X("font-medium",a&&be),children:c.email}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[r?.label?e.jsx(z,{variant:"outline",className:X("text-[10px] h-4 px-1.5 border-transparent",a&&be,r.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":r.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:r.label}):c.audienceLabel?e.jsx(z,{variant:"outline",className:X("text-[10px] h-4 px-1.5 border-transparent",a&&be,c.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":c.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:c.audienceLabel}):null,!r?.label&&c.detailLabel&&e.jsx(z,{variant:"outline",className:X("text-[10px] h-4 px-1.5",a&&be),children:c.detailLabel}),o.isDefault&&e.jsx("span",{className:"text-xs text-muted-foreground",children:d("setupWizard.accountStep.defaultAccount")})]})]})]}),e.jsx(vs,{className:"w-4 h-4 text-muted-foreground"})]},o.id)})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:d("setupWizard.accountStep.or")})})]}),e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 p-3 border-2 border-dashed border-primary/50 rounded-lg hover:border-primary hover:bg-primary/5 transition-colors text-left",onClick:n,children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(Pe,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-primary",children:d("setupWizard.accountStep.addNewAccount")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:d("setupWizard.accountStep.addNewAccountDesc")})]})]}),e.jsx("div",{className:"flex items-center justify-between pt-2",children:e.jsxs(G,{variant:"ghost",onClick:i,children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),d("setupWizard.accountStep.back")]})})]})}const ns="__custom__";function on({selectedProvider:t,catalog:a,selectedAccount:s,variantName:n,modelName:i,isPending:d,privacyMode:o,onVariantNameChange:c,onModelChange:r,onBack:m,onSkip:l,onCreate:g}){const{t:x}=W(),b=a||Ne[t],k=b?.models||[],S=i&&!k.some(v=>v.id===i),[O,P]=u.useState(S),A=t==="agy"&&i.trim().length>0?xe(i):!1,y=s?cs(s.id,s.email,s.tokenFile):null,N=t==="codex"&&y?us(y):null,T=v=>{v===ns?(P(!0),r("")):(P(!1),r(v))};return e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"flex min-w-0 items-start gap-2 rounded-md bg-muted/50 p-2 text-sm",children:[e.jsx(Ue,{className:"w-4 h-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("span",{children:[x("setupVariant.using")," ",e.jsx("span",{className:X("break-all",o&&be),children:y?.email})]}),(y?.audienceLabel||y?.detailLabel)&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[N?.label?e.jsx(z,{variant:"outline",className:X("text-[10px] h-4 px-1.5 border-transparent",o&&be,N.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":N.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:N.label}):y?.audienceLabel?e.jsx(z,{variant:"outline",className:X("text-[10px] h-4 px-1.5 border-transparent",o&&be,y.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":y.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:y.audienceLabel}):null,!N?.label&&y?.detailLabel&&e.jsx(z,{variant:"outline",className:X("text-[10px] h-4 px-1.5",o&&be),children:y.detailLabel})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"variant-name",children:x("setupVariant.variantNameRequired")}),e.jsx(ce,{id:"variant-name",value:n,onChange:v=>c(v.target.value),placeholder:x("setupVariant.variantNamePlaceholder")}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[x("setupVariant.invokeHintPrefix")," ccs ",n||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{children:x("setupVariant.model")}),O?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{value:i,onChange:v=>r(v.target.value),placeholder:x("setupVariant.modelPlaceholder")}),A&&e.jsx("p",{className:"text-xs text-destructive",children:x("providerEditor.agyDenylist")}),e.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>{P(!1),t==="agy"&&xe(i)&&r("")},children:x("setupVariant.choosePresetInstead")})]}):e.jsxs(Oe,{value:k.some(v=>v.id===i)?i:"",onValueChange:T,children:[e.jsx(Le,{className:"min-w-0",children:e.jsx(_e,{placeholder:x("setupVariant.selectModel")})}),e.jsxs(Fe,{className:"max-w-[calc(100vw-2rem)]",children:[k.map(v=>e.jsx(je,{value:v.id,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate",children:v.name}),v.description&&e.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["- ",v.description]})]})},v.id)),e.jsx(je,{value:ns,children:e.jsx("span",{className:"text-primary",children:x("setupVariant.customModelName")})})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:O?x("setupVariant.enterAnyModel"):x("setupVariant.defaultModel",{model:b?.defaultModel||x("setupVariant.providerDefault")})})]}),e.jsxs("div",{className:"flex flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(G,{variant:"ghost",onClick:m,className:"justify-start",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),x("setupVariant.back")]}),e.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center",children:[e.jsx(G,{variant:"ghost",onClick:l,children:x("setupVariant.skip")}),e.jsx(G,{onClick:g,disabled:!n||d||A,children:x(d?"setupVariant.creating":"setupVariant.createVariant")})]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:x("setupVariant.skipHint")})]})}function dn({variantName:t,onClose:a}){const{t:s}=W();return e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:e.jsx(Te,{className:"w-8 h-8 text-green-600 dark:text-green-400"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:s("setupWizard.successStep.title")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("setupWizard.successStep.subtitle")})]}),e.jsx(ds,{children:e.jsxs(ls,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s("setupWizard.successStep.usage")}),e.jsxs("code",{className:"block px-3 py-2 bg-muted rounded-md font-mono text-sm",children:["ccs ",t,' "your prompt here"']})]})}),e.jsx(G,{onClick:a,className:"w-full",children:s("setupWizard.successStep.done")})]})}function ln({open:t,onClose:a}){const[s,n]=u.useState("provider"),[i,d]=u.useState(""),[o,c]=u.useState(null),[r,m]=u.useState(""),[l,g]=u.useState(""),[x,b]=u.useState(!1),[k,S]=u.useState(!1),{data:O,refetch:P}=ms(),{data:A}=ps(),y=_s(),N=Fs(),T=qs(),{privacyMode:v}=xs(),R=O?.authStatus.find(w=>w.provider===i),p=u.useMemo(()=>R?.accounts||[],[R?.accounts]),D=u.useMemo(()=>Kt(A?.catalogs),[A?.catalogs]),C=!!A;u.useEffect(()=>{if(!t){const w=setTimeout(()=>{n("provider"),d(""),c(null),m(""),g(""),S(!1)},0);return()=>clearTimeout(w)}},[t]),u.useEffect(()=>{if(s==="auth"&&p.length>0&&!k){const w=setTimeout(()=>{n("account")},0);return()=>clearTimeout(w)}},[s,p,k]);const H=async()=>{b(!0),await P(),b(!1)},E=()=>{const w=(R?.accounts?.length||0)===0;N.mutate({provider:i},{onSuccess:async J=>{if(w){const j=await At(i,void 0,C?D[i]:void 0);j.success&&j.presetName?V.success(`Applied "${j.presetName}" preset`):j.success||V.warning(he.t("commonToast.accountAddedPresetFailed"))}J.account&&(c(J.account),n("variant")),P()}})},h=w=>{d(w),(O?.authStatus.find(Y=>Y.provider===w)?.accounts||[]).length===0?n("auth"):n("account")},M=w=>{c(w),n("variant")},B=async()=>{if(!(!r||!i))try{await y.mutateAsync({name:r,provider:i,model:l||void 0,account:o?.id}),n("success")}catch(w){console.error("Failed to create variant:",w)}},L=`ccs ${i} --auth --add`,_=Gs(s),F=w=>{if(!w&&(N.isPending&&i&&T.mutate(i),s==="success"||s==="provider")){a();return}};return e.jsx(Tt,{open:t,onOpenChange:F,children:e.jsxs(Dt,{className:"grid max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-lg grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden p-0 sm:max-w-lg",onPointerDownOutside:w=>{s!=="success"&&s!=="provider"&&w.preventDefault()},onEscapeKeyDown:w=>{(N.isPending||y.isPending)&&w.preventDefault()},children:[e.jsxs(Et,{className:"min-w-0 px-6 pt-6 pr-12",children:[e.jsxs(It,{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Ft,{className:"w-5 h-5 text-primary"}),he.t("setupWizard.title")]}),e.jsxs(hs,{children:[s==="provider"&&he.t("setupWizard.stepProviderDesc"),s==="auth"&&he.t("setupWizard.stepAuthDesc"),s==="account"&&he.t("setupWizard.stepAccountDesc"),s==="variant"&&he.t("setupWizard.stepVariantDesc"),s==="success"&&he.t("setupWizard.stepSuccessDesc")]})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto px-6 py-4",children:[s==="provider"&&e.jsx(an,{providers:Qt,onSelect:h}),s==="auth"&&e.jsx(nn,{selectedProvider:i,providers:Qt,authCommand:L,isRefreshing:x,isPending:N.isPending,onBack:()=>n("provider"),onStartAuth:E,onRefresh:H}),s==="account"&&e.jsx(rn,{accounts:p,privacyMode:v,onSelect:M,onAddNew:()=>{S(!0),n("auth")},onBack:()=>n("provider")}),s==="variant"&&e.jsx(on,{selectedProvider:i,catalog:D[i],selectedAccount:o,variantName:r,modelName:l,isPending:y.isPending,privacyMode:v,onVariantNameChange:m,onModelChange:g,onBack:()=>p.length>0?n("account"):n("provider"),onSkip:a,onCreate:B}),s==="success"&&e.jsx(dn,{variantName:r,onClose:a})]}),e.jsx("div",{className:"px-6 pb-6",children:e.jsx(sn,{currentProgress:_,allSteps:Us})})]})})}const cn=3e3,un=300*1e3,mn=3;function vt(t){t.invalidateQueries({queryKey:["cliproxy-catalog"]}),t.invalidateQueries({queryKey:["cliproxy-models"]})}async function jt(t){const a=await t.text();if(!a)return{};try{return JSON.parse(a)}catch{const s=t.status>=400?`Request failed with status ${t.status}`:void 0;return s?{error:s}:{}}}function pn(t,a){const s=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:a,n=Array.isArray(t.hints)?t.hints.filter(i=>typeof i=="string"&&i.trim().length>0):[];return n.length>0?[s,...n].join(`
|
|
2
|
-
`):s}const ye={provider:null,isAuthenticating:!1,error:null,authUrl:null,oauthState:null,isSubmittingCallback:!1,isDeviceCodeFlow:!1};function xn(){const{t}=W(),[a,s]=u.useState(ye),n=u.useRef(ye),i=u.useRef(0),d=u.useRef(null),o=u.useRef(null),c=u.useRef(0),r=u.useRef(0),m=u.useRef(!1),l=Pt(),g=u.useCallback(P=>P===i.current,[]),x=u.useCallback(()=>{o.current&&(clearInterval(o.current),o.current=null),r.current=0},[]);u.useEffect(()=>()=>{d.current?.abort(),x(),m.current=!1},[x]),u.useEffect(()=>{n.current=a},[a]);const b=u.useCallback(async(P,A,y)=>{if(g(y)){if(Date.now()-c.current>un){x(),g(y)&&s(N=>({...N,isAuthenticating:!1,error:t("toasts.providerAuthTimeout")}));return}try{const N=await fetch(`/api/cliproxy/auth/${P}/status?state=${encodeURIComponent(A)}`);if(!g(y))return;const T=await N.json();if(r.current=0,T.status==="ok"){if(!(typeof T.account=="object"&&T.account!==null)){x();const R=t("toasts.providerAccountRegistrationFailed");V.error(R),s(p=>({...p,isAuthenticating:!1,error:R}));return}x(),l.invalidateQueries({queryKey:["cliproxy-auth"]}),l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["account-quota"]}),vt(l),V.success(t("toasts.providerAuthSuccess",{provider:P})),m.current=!1,s(ye)}else if(T.status==="auth_url"){const v=T.url||T.auth_url;v&&(s(R=>({...R,authUrl:v})),m.current||(m.current=!0,window.open(v,"_blank")))}else if(T.status==="device_code"){x();const v=T.user_code&&T.verification_url?`Open ${T.verification_url} and enter code: ${T.user_code}`:"Switch to Device Code method and try again.";V.error(t("toasts.providerDeviceCodeInCallback")),s(R=>({...R,isAuthenticating:!1,error:v}))}else if(T.status==="error"){x();const v=T.error||"Authentication failed";V.error(v),s(R=>({...R,isAuthenticating:!1,error:v}))}}catch(N){if(!g(y)||(r.current+=1,r.current<mn))return;x();const T=N instanceof Error&&N.message.trim().length>0?N.message:t("toasts.providerLostStatusEndpoint");V.error(T),s(v=>({...v,isAuthenticating:!1,error:T}))}}},[g,l,x,t]),k=u.useCallback(async(P,A)=>{if(!qe(P)){s({...ye,error:t("toasts.providerUnknown",{provider:P})});return}d.current?.abort(),x(),m.current=!1,r.current=0;const y=new AbortController,N=i.current+1;i.current=N,d.current=y;const v=(A?.flowType||(fs(P)?"device_code":"authorization_code"))==="device_code",R=A?.startEndpoint||(v?"start":"start-url"),p={accountId:A?.accountId,nickname:A?.nickname,kiroMethod:A?.kiroMethod,kiroIDCStartUrl:A?.kiroIDCStartUrl,kiroIDCRegion:A?.kiroIDCRegion,kiroIDCFlow:A?.kiroIDCFlow,gitlabAuthMode:A?.gitlabAuthMode,gitlabBaseUrl:A?.gitlabBaseUrl,gitlabPersonalAccessToken:A?.gitlabPersonalAccessToken,riskAcknowledgement:A?.riskAcknowledgement};s({provider:P,isAuthenticating:!0,error:null,authUrl:null,oauthState:null,isSubmittingCallback:!1,isDeviceCodeFlow:v});try{if(R==="start")fetch(`/api/cliproxy/auth/${P}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p),signal:y.signal}).then(async D=>{if(!g(N))return;const C=await jt(D);if(!g(N))return;const H=C.success===!0,E=typeof C.account=="object"&&C.account!==null;if(D.ok&&H&&E)l.invalidateQueries({queryKey:["cliproxy-auth"]}),l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["account-quota"]}),vt(l),m.current=!1,s(ye);else{const h=typeof C.error=="string"?C.error:t(H?"toasts.providerAccountRegistrationFailed":"auth.loginFailed");V.error(h),s(M=>({...M,isAuthenticating:!1,error:h}))}}).catch(D=>{if(!g(N)||D instanceof Error&&D.name==="AbortError")return;const C=D instanceof Error?D.message:"Authentication failed";V.error(C),s(H=>({...H,isAuthenticating:!1,error:C}))});else{const D=await fetch(`/api/cliproxy/auth/${P}/start-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p),signal:y.signal});if(!g(N))return;const C=await jt(D);if(!g(N))return;const H=C.success===!0;if(!D.ok||!H){const M=pn(C,t("toasts.providerStartOAuthFailed"));throw new Error(M)}const E=typeof C.authUrl=="string"?C.authUrl:null,h=typeof C.state=="string"?C.state:null;if(s(M=>({...M,authUrl:E,oauthState:h})),E&&(m.current=!0,window.open(E,"_blank")),h){if(c.current=Date.now(),!E){if(await b(P,h,N),!g(N))return;const M=n.current;if(!M.isAuthenticating||M.provider!==P)return}o.current=setInterval(()=>{b(P,h,N)},cn)}}}catch(D){if(!g(N))return;if(D instanceof Error&&D.name==="AbortError"){m.current=!1,s(ye);return}const C=D instanceof Error?D.message:t("auth.loginFailed");V.error(C),s(H=>({...H,isAuthenticating:!1,error:C}))}},[g,b,x,l,t]),S=u.useCallback(()=>{const P=a.provider;i.current+=1,d.current?.abort(),x(),m.current=!1,s(ye),P&&tt.cliproxy.auth.cancel(P).catch(()=>{})},[a.provider,x]),O=u.useCallback(async P=>{if(!a.provider)return;const A=i.current,y=a.provider;s(N=>({...N,isSubmittingCallback:!0,error:null}));try{const N=await fetch(`/api/cliproxy/auth/${y}/submit-callback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUrl:P})});if(!g(A))return;const T=await jt(N);if(!g(A))return;const v=T.success===!0,R=T.status==="wait",p=typeof T.account=="object"&&T.account!==null;if(N.ok&&R)s(D=>({...D,isSubmittingCallback:!1,error:null}));else if(N.ok&&v&&p)x(),l.invalidateQueries({queryKey:["cliproxy-auth"]}),l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["account-quota"]}),vt(l),V.success(t("toasts.providerAuthSuccess",{provider:y})),s(ye);else{const D=typeof T.error=="string"?T.error:t(v?"toasts.providerAccountRegistrationFailed":"toasts.providerCallbackFailed");throw new Error(D)}}catch(N){if(!g(A))return;const T=N instanceof Error?N.message:t("toasts.providerSubmitCallbackFailed");V.error(T),s(v=>({...v,isSubmittingCallback:!1,error:T}))}},[g,a.provider,l,x,t]);return u.useMemo(()=>({...a,startAuth:k,cancelAuth:S,submitCallback:O}),[a,k,S,O])}function St({className:t,compact:a=!1,showAcknowledgement:s=!1,acknowledgementPhrase:n=st,acknowledgementText:i="",onAcknowledgementTextChange:d,disabled:o=!1,showProxySettingsLink:c=!1}){const{t:r}=W(),m=r("accountSafetyWarning.title"),l=r("accountSafetyWarning.subtitle"),g=r("accountSafetyWarning.firstLine"),x=r("accountSafetyWarning.secondLine"),b="https://github.com/kaitranntt/ccs/issues/509",k=r("accountSafetyWarning.issueLabel"),S=r("accountSafetyWarning.proxySettingsLabel");return a?e.jsx("section",{role:"alert",className:X("border-b border-amber-200/70 bg-amber-50/45 dark:bg-amber-950/5",t),children:e.jsxs("div",{className:"flex flex-col gap-3 px-6 py-3 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"min-w-0 flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 items-center justify-center rounded-md bg-amber-500/12 text-amber-700 dark:text-amber-300",children:e.jsx(it,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-xs font-semibold leading-5",children:m}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:l})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:g}),e.jsx("p",{className:"text-xs font-medium leading-5 text-amber-900 dark:text-amber-200",children:x})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:justify-end",children:[e.jsxs("a",{href:b,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md border border-amber-500/25 bg-background/90 px-2 py-1 text-[11px] font-medium text-amber-800 transition-colors hover:bg-amber-500/10 dark:text-amber-200",children:[k,e.jsx(Pe,{className:"h-3 w-3"})]}),c?e.jsxs("a",{href:"/settings?tab=proxy",className:"inline-flex items-center gap-1 rounded-md border border-amber-500/25 bg-background/90 px-2 py-1 text-[11px] font-medium text-amber-800 transition-colors hover:bg-amber-500/10 dark:text-amber-200",children:[e.jsx(ts,{className:"h-3 w-3"}),S]}):null,e.jsx(z,{variant:"outline",className:"border-amber-500/40 text-[10px] text-amber-700 dark:text-amber-300",children:"High Risk"})]})]})}):e.jsxs("section",{role:"alert",className:X("relative overflow-hidden rounded-xl border border-amber-500/30 bg-gradient-to-br from-amber-50 via-background to-rose-50/70 shadow-sm dark:from-amber-950/20 dark:to-rose-950/20",t),children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-amber-500 via-orange-500 to-rose-500"}),e.jsxs("div",{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"mt-0.5 inline-flex h-7 w-7 items-center justify-center rounded-md bg-amber-500/15 text-amber-700 dark:text-amber-400",children:e.jsx(it,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold leading-5",children:m}),e.jsx("p",{className:"text-xs text-muted-foreground",children:l})]})]}),e.jsx(z,{variant:"outline",className:"border-amber-500/40 text-amber-700 dark:text-amber-300",children:"High Risk"})]}),e.jsxs("div",{className:"space-y-2 text-sm leading-relaxed",children:[e.jsx("p",{children:g}),e.jsx("p",{className:"font-medium text-amber-900 dark:text-amber-200",children:x}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"CCS is provided as-is and does not take responsibility for suspension, bans, or access loss from upstream providers."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("a",{href:b,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-800 transition-colors hover:bg-amber-500/15 dark:text-amber-200",children:[k,e.jsx(Pe,{className:"h-3.5 w-3.5"})]}),c&&e.jsxs("a",{href:"/settings?tab=proxy",className:"inline-flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-800 transition-colors hover:bg-amber-500/15 dark:text-amber-200",children:[e.jsx(ts,{className:"h-3.5 w-3.5"}),S]}),e.jsx("span",{className:"rounded-md border border-border/70 bg-muted/60 px-2.5 py-1 text-xs text-muted-foreground",children:"Applies to CLI and dashboard auth"})]}),s&&d&&e.jsxs("div",{className:"rounded-lg border border-amber-500/25 bg-amber-500/5 p-2.5",children:[e.jsxs(ee,{htmlFor:"account-risk-ack-text",className:"text-xs leading-5",children:["Type exact phrase to continue:"," ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:n})]}),e.jsx(ce,{id:"account-risk-ack-text",value:i,onChange:O=>d(O.target.value),placeholder:n,disabled:o,className:"mt-2 font-mono text-xs"})]})]})]})}function hn({className:t,value:a,onChange:s,disabled:n=!1}){const{t:i}=W(),d=[a.reviewedIssue509,a.understandsBanRisk,a.acceptsFullResponsibility,a.typedPhrase.trim().replace(/\s+/g," ").toUpperCase()===ss].filter(Boolean).length,o=d/4*100,c=r=>{s({...a,...r})};return e.jsxs("section",{role:"alert",className:X("relative overflow-hidden rounded-xl border border-rose-500/35 bg-gradient-to-br from-rose-50 via-background to-amber-50/70 p-4 shadow-sm dark:from-rose-950/20 dark:to-amber-950/20",t),children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-rose-500 via-orange-500 to-amber-500"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"mt-0.5 inline-flex h-7 w-7 items-center justify-center rounded-md bg-rose-500/15 text-rose-700 dark:text-rose-300",children:e.jsx(it,{className:"h-4 w-4"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-semibold leading-5",children:i("antigravityChecklist.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i("antigravityChecklist.subtitle")})]})]}),e.jsx(z,{variant:"outline",className:"border-rose-500/40 text-rose-700 dark:text-rose-300",children:i("antigravityChecklist.mandatory")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:i("antigravityChecklist.completion")}),e.jsx("span",{children:i("antigravityChecklist.stepsCount",{current:d})})]}),e.jsx(Ks,{value:o,className:"h-2"})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-rose-500/20 bg-rose-500/5 p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(at,{id:"agy-step-reviewed-issue",checked:a.reviewedIssue509,onCheckedChange:r=>c({reviewedIssue509:!!r}),disabled:n}),e.jsx(ee,{htmlFor:"agy-step-reviewed-issue",className:"text-xs leading-5",children:"Step 1: I reviewed issue #509 and understand AGY OAuth can trigger account bans/suspensions."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(at,{id:"agy-step-understands-risk",checked:a.understandsBanRisk,onCheckedChange:r=>c({understandsBanRisk:!!r}),disabled:n}),e.jsx(ee,{htmlFor:"agy-step-understands-risk",className:"text-xs leading-5",children:"Step 2: I understand this OAuth action is my own decision and I accept the upstream risk."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(at,{id:"agy-step-accept-responsibility",checked:a.acceptsFullResponsibility,onCheckedChange:r=>c({acceptsFullResponsibility:!!r}),disabled:n}),e.jsx(ee,{htmlFor:"agy-step-accept-responsibility",className:"text-xs leading-5",children:"Step 3: I accept full responsibility. CCS is not liable for suspension, bans, or access loss."})]})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-amber-500/25 bg-amber-500/5 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-amber-800 dark:text-amber-200",children:[e.jsx(bs,{className:"h-3.5 w-3.5"}),"Step 4: Type exact phrase to continue"]}),e.jsx(ce,{value:a.typedPhrase,onChange:r=>c({typedPhrase:r.target.value}),placeholder:ss,disabled:n,className:"font-mono text-xs"})]}),e.jsx("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:e.jsxs("a",{href:"https://github.com/kaitranntt/ccs/issues/509",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border border-rose-500/30 bg-rose-500/10 px-2.5 py-1 font-medium text-rose-800 transition-colors hover:bg-rose-500/15 dark:text-rose-200",children:["Read issue #509",e.jsx(Pe,{className:"h-3.5 w-3.5"})]})})]})]})}function fn(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function gn({open:t,onClose:a,provider:s,displayName:n,catalog:i,account:d,isFirstAccount:o=!1}){const[c,r]=u.useState(""),[m,l]=u.useState(""),[g,x]=u.useState(!1),[b,k]=u.useState(null),[S,O]=u.useState(""),[P,A]=u.useState(ft),[y,N]=u.useState(!1),[T,v]=u.useState(!1),[R,p]=u.useState(Wt),[D,C]=u.useState(""),[H,E]=u.useState(""),[h,M]=u.useState(Jt),[B,L]=u.useState("oauth"),[_,F]=u.useState(""),[w,J]=u.useState(""),{t:j}=W(),Y=u.useRef(!1),se=u.useRef(0),de=u.useRef(!1),K=xn(),ie=Hs(),Q=s==="kiro",Z=s==="gitlab",re=s==="agy"||s==="gemini",ke=s==="gemini"&&!y,fe=s==="agy"&&!y,Ae=re&&T,Se=La(P),f=fn(S)===st,U=fs(s),ge=zs(R),me=Q&&R==="idc",pe=Q&&Vs(R),Me=Q?Bs(R,h):void 0,ut=Q?Qs(R):void 0,mt=Q?Me==="device_code":U,le=K.isAuthenticating||ie.isPending,ze=c.trim(),Be=D.trim(),Ve=H.trim(),$e=_.trim(),q=w.trim(),te=b||K.error,ae=!!d,De=d?.email||d?.nickname||d?.id||n,Vt=u.useCallback(async()=>{const I=await fetch("/api/settings/auth/antigravity-risk");if(!I.ok)throw new Error("Failed to load power user mode setting");return(await I.json()).antigravityAckBypass===!0},[]),Qe=u.useCallback(async({pendingMessage:I=null,disabledMessage:ve=null}={})=>{const xt=++se.current;v(!0),I!==null&&k(I);try{const We=await Vt();return se.current!==xt||(N(We),ve?k(We?null:ve):I!==null&&k(null)),We}catch{return se.current!==xt||(N(!1),k(ve??j("addAccountDialog.powerUserLoadFailed")),de.current||(de.current=!0,V.error(j("addAccountDialog.powerUserLoadFailed")))),!1}finally{se.current===xt&&v(!1)}},[Vt,j]),pt=()=>{r(""),l(""),x(!1),k(null),O(""),A(ft),N(!1),v(!1),p(Wt),C(""),E(""),M(Jt),L("oauth"),F(""),J(""),se.current+=1,de.current=!1,Y.current=!1,a()};u.useEffect(()=>{t&&(O(""),A(ft),k(null))},[s,t]),u.useEffect(()=>()=>{se.current+=1},[]),u.useEffect(()=>{if(!t||!re){se.current+=1,N(!1),v(!1);return}Qe()},[t,s,re,Qe]),u.useEffect(()=>{if(!t||s!=="agy"||!K.error||!y)return;const I=K.error.toLowerCase();(I.includes("agy_risk_ack_required")||I.includes("responsibility acknowledgement")||I.includes("responsibility checklist"))&&Qe({pendingMessage:j("addAccountDialog.powerUserLoading"),disabledMessage:j("addAccountDialog.powerUserUnavailableRetry")})},[K.error,t,y,s,Qe,j]),u.useEffect(()=>{!K.isAuthenticating&&!K.error&&K.provider===null&&t&&Y.current&&(Y.current=!1,(async()=>{try{const ve=await At(s,void 0,i);ve.success&&ve.presetName&&o&&V.success(`Applied "${ve.presetName}" preset`)}catch{}pt()})())},[K.isAuthenticating,K.error,K.provider]);const $t=()=>{K.cancelAuth(),pt()},Ts=async()=>{K.authUrl&&(await navigator.clipboard.writeText(K.authUrl),x(!0),setTimeout(()=>x(!1),2e3))},Ds=()=>{m.trim()&&K.submitCallback(m.trim())},Es=()=>{if(Ae){k(j("addAccountDialog.powerUserLoading"));return}if(fe&&!Se){k("Complete all Antigravity responsibility steps before authenticating this provider.");return}if(ke&&!f){k(`Type "${st}" to acknowledge the account safety warning before authenticating this provider.`);return}if(k(null),me&&!Be){k("IDC Start URL is required for Kiro IAM Identity Center login.");return}if(Z&&B==="pat"&&!q){k(j("addAccountDialog.gitlabPatRequired"));return}Y.current=!0,K.startAuth(s,{accountId:d?.id,nickname:d?d.nickname:ze||void 0,kiroMethod:Q?R:void 0,kiroIDCStartUrl:me?Be:void 0,kiroIDCRegion:me&&Ve?Ve:void 0,kiroIDCFlow:me?h:void 0,gitlabAuthMode:Z?B:void 0,gitlabBaseUrl:Z&&$e?$e:void 0,gitlabPersonalAccessToken:Z&&B==="pat"&&q?q:void 0,flowType:Q?Me:void 0,startEndpoint:Q?ut:Z&&B==="pat"?"start":void 0,riskAcknowledgement:fe?{version:_a,reviewedIssue509:P.reviewedIssue509,understandsBanRisk:P.understandsBanRisk,acceptsFullResponsibility:P.acceptsFullResponsibility,typedPhrase:P.typedPhrase}:void 0})},Is=()=>{Y.current=!0,ie.mutate(void 0,{onSuccess:async()=>{const I=await At("kiro",void 0,i);I.success&&I.presetName&&o&&V.success(`Applied "${I.presetName}" preset`),pt()}})},Rs=I=>{I||$t()},oe=K.isAuthenticating;return e.jsx(Tt,{open:t,onOpenChange:Rs,children:e.jsxs(Dt,{className:"grid max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-md grid-rows-[auto_minmax(0,1fr)] overflow-hidden p-0 sm:max-w-md",onInteractOutside:I=>{oe&&I.preventDefault()},children:[e.jsxs(Et,{className:"min-w-0 px-6 pt-6 pr-12",children:[e.jsx(It,{children:ae?`Reauthenticate ${n}`:j("addAccountDialog.title",{displayName:n})}),e.jsx(hs,{children:ae?`Refresh credentials for ${De}.`:j(Q?"addAccountDialog.descKiro":mt?"addAccountDialog.descDeviceCode":"addAccountDialog.descOauth")})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto px-6 py-4",children:[fe&&!oe&&e.jsx(hn,{value:P,onChange:I=>{A(I),k(null)},disabled:le}),re&&y&&!oe&&e.jsxs("div",{className:"rounded-lg border border-amber-400/35 bg-amber-50/70 p-3 text-xs text-amber-900 dark:border-amber-800/60 dark:bg-amber-950/25 dark:text-amber-100",children:[e.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 font-semibold",children:[e.jsx(bs,{className:"h-3.5 w-3.5"}),j("addAccountDialog.powerUserEnabled")]}),j("addAccountDialog.powerUserSkipped")]}),ke&&!oe&&e.jsx(St,{showAcknowledgement:!0,acknowledgementPhrase:st,acknowledgementText:S,onAcknowledgementTextChange:I=>{O(I),k(null)},disabled:le}),Q&&!oe&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"kiro-auth-method",children:j("addAccountDialog.authMethod")}),e.jsxs(Oe,{value:R,onValueChange:I=>{p(I),k(null)},children:[e.jsx(Le,{id:"kiro-auth-method",children:e.jsx(_e,{placeholder:j("addAccountDialog.selectKiroAuthMethod")})}),e.jsx(Fe,{children:$s.map(I=>e.jsx(je,{value:I.id,children:I.label},I.id))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:ge.description}),pe&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["If your browser does not return automatically after login, CCS can accept the final",e.jsx("span",{className:"mx-1 rounded bg-muted px-1.5 py-0.5 font-mono text-[11px]",children:"kiro://..."}),"callback URL in the next step."]})]}),me&&!oe&&e.jsxs("div",{className:"space-y-4 rounded-lg border border-border/60 bg-muted/20 p-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"kiro-idc-start-url",children:"IDC Start URL"}),e.jsx(ce,{id:"kiro-idc-start-url",value:D,onChange:I=>{C(I.target.value),k(null)},placeholder:"https://d-xxx.awsapps.com/start",disabled:le}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for organization IAM Identity Center login."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"kiro-idc-region",children:"IDC Region"}),e.jsx(ce,{id:"kiro-idc-region",value:H,onChange:I=>{E(I.target.value),k(null)},placeholder:"us-east-1",disabled:le}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Leave blank to use the upstream default region."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"kiro-idc-flow",children:"IDC Flow"}),e.jsxs(Oe,{value:h,onValueChange:I=>{M(I),k(null)},children:[e.jsx(Le,{id:"kiro-idc-flow",children:e.jsx(_e,{placeholder:"{/* TODO i18n: missing key */}Select IDC flow"})}),e.jsxs(Fe,{children:[e.jsx(je,{value:"authcode",children:"Authorization Code"}),e.jsx(je,{value:"device",children:"Device Code"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Auth Code opens a browser and may need the final callback URL pasted back. Device Code shows a verification code instead."})]})]}),Z&&!oe&&e.jsxs("div",{className:"space-y-4 rounded-lg border border-border/60 bg-muted/20 p-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"gitlab-auth-mode",children:j("addAccountDialog.gitlabAuthMethod")}),e.jsxs(Oe,{value:B,onValueChange:I=>{L(I),k(null)},children:[e.jsx(Le,{id:"gitlab-auth-mode",children:e.jsx(_e,{placeholder:j("addAccountDialog.selectGitlabAuthMethod")})}),e.jsxs(Fe,{children:[e.jsx(je,{value:"oauth",children:j("addAccountDialog.gitlabAuthOAuth")}),e.jsx(je,{value:"pat",children:j("addAccountDialog.gitlabAuthPat")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:j("addAccountDialog.gitlabAuthHint")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"gitlab-base-url",children:j("addAccountDialog.gitlabUrl")}),e.jsx(ce,{id:"gitlab-base-url",value:_,onChange:I=>{F(I.target.value),k(null)},placeholder:j("addAccountDialog.gitlabUrlPlaceholder"),disabled:le}),e.jsx("p",{className:"text-xs text-muted-foreground",children:j("addAccountDialog.gitlabUrlHint")})]}),B==="pat"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"gitlab-pat",children:j("addAccountDialog.gitlabPat")}),e.jsx(ce,{id:"gitlab-pat",type:"password",value:w,onChange:I=>{J(I.target.value),k(null)},placeholder:j("addAccountDialog.gitlabPatPlaceholder"),disabled:le}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[j("addAccountDialog.gitlabPatHint")," ",e.jsx("span",{className:"font-mono",children:"api"})," and"," ",e.jsx("span",{className:"font-mono",children:"read_user"})," scopes."]})]})]}),!oe&&ae&&e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2 text-sm",children:[e.jsx("div",{className:"font-medium",children:De}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"This sign-in updates the selected account instead of creating another account."})]}),!oe&&!ae&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"nickname",children:j("addAccountDialog.nicknameOptional")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ue,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(ce,{id:"nickname",value:c,onChange:I=>{r(I.target.value),k(null)},placeholder:j("addAccountDialog.nicknamePlaceholder"),disabled:le,className:"flex-1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:j("addAccountDialog.nicknameOptionalHint")})]}),oe&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx(ue,{className:"w-4 h-4 inline mr-2 animate-spin"}),j("addAccountDialog.waitingForAuth")]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:K.isDeviceCodeFlow?j("addAccountDialog.deviceCodeHint"):pe?"Complete sign-in in your browser. If it does not return automatically, paste the final kiro:// callback URL below.":j("addAccountDialog.browserHint")})]}),K.authUrl&&!K.isDeviceCodeFlow&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-xs",children:j("addAccountDialog.openUrlLabel")}),e.jsxs("div",{className:"p-3 bg-muted rounded-md",children:[e.jsx("p",{className:"text-xs text-muted-foreground break-all font-mono line-clamp-3",children:K.authUrl}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(G,{variant:"outline",size:"sm",onClick:Ts,children:g?e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"w-3 h-3 mr-1"}),j("addAccountDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(js,{className:"w-3 h-3 mr-1"}),j("addAccountDialog.copy")]})}),e.jsxs(G,{variant:"outline",size:"sm",onClick:()=>{if(!K.authUrl)return;const I=window.open(K.authUrl,"_blank");(!I||I.closed||typeof I.closed>"u")&&V.warning(j("addAccountDialog.popupBlocked"),{duration:5e3})},children:[e.jsx(Pe,{className:"w-3 h-3 mr-1"}),j("addAccountDialog.open")]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"callback-url",className:"text-xs",children:pe?"Browser did not return? Paste the final kiro:// callback URL:":j("addAccountDialog.redirectPasteLabel")}),e.jsx(ce,{id:"callback-url",value:m,onChange:I=>l(I.target.value),placeholder:pe?"kiro://kiro.kiroAgent/authenticate-success?code=...&state=...":j("addAccountDialog.callbackPlaceholder"),className:"font-mono text-xs"}),e.jsx(G,{variant:"secondary",size:"sm",onClick:Ds,disabled:!m.trim()||K.isSubmittingCallback,children:K.isSubmittingCallback?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-3 h-3 mr-1 animate-spin"}),j("addAccountDialog.submitting")]}):j("addAccountDialog.submitCallback")})]})]}),!K.authUrl&&!K.isDeviceCodeFlow&&e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:pe?"Preparing the Kiro sign-in URL. If it does not open automatically, it will appear here shortly.":j("addAccountDialog.preparingUrl")})]}),te&&e.jsx("p",{className:"text-xs text-center text-destructive whitespace-pre-line",children:te}),ie.isPending&&e.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:[e.jsx(ue,{className:"w-4 h-4 inline mr-2 animate-spin"}),j("addAccountDialog.importingToken")]}),e.jsxs("div",{className:"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:items-center sm:justify-end",children:[e.jsx(G,{variant:"ghost",onClick:$t,className:"w-full sm:w-auto",children:j("addAccountDialog.cancel")}),Q&&!oe&&e.jsx(G,{variant:"outline",onClick:Is,disabled:le,className:"w-full sm:w-auto",children:ie.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 mr-2 animate-spin"}),j("addAccountDialog.importing")]}):e.jsxs(e.Fragment,{children:[e.jsx(Pa,{className:"w-4 h-4 mr-2"}),j("addAccountDialog.importFromIde")]})}),!oe&&e.jsxs(G,{onClick:Es,className:"w-full sm:w-auto",disabled:le||Ae||fe&&!Se||ke&&!f,children:[e.jsx(Pe,{className:"w-4 h-4 mr-2"}),ae?"Reauthenticate":j("addAccountDialog.authenticate")]})]})]})]})})}const vn=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"];function jn(t){const a=t?.env||{};return vn.filter(s=>!a[s]?.trim())}function bn(t,a){const[s,n]=u.useState(null),[i,d]=u.useState(!1),o=Pt(),{data:c,isLoading:r,refetch:m}=os({queryKey:["settings",t],queryFn:async()=>{const E=await fetch(`/api/settings/${t}/raw`);if(!E.ok){const h=t==="cursor"?`~/.ccs/cliproxy/providers/${t}.settings.json`:qe(t)?`~/.ccs/${t}.settings.json`:`~/.ccs/profiles/${t}/settings.json`;return{profile:t,settings:{env:{}},mtime:Date.now(),path:h}}return E.json()}}),l=c?.settings,g=u.useMemo(()=>s!==null?s:l?JSON.stringify(l,null,2):`{
|
|
3
|
-
"env": {}
|
|
4
|
-
}`,[s,l]),x=u.useCallback(E=>{n(E)},[]),b=u.useMemo(()=>{try{return JSON.parse(g)}catch{return l||{env:{}}}},[g,l]),k=b?.env?.ANTHROPIC_MODEL,S=b?.env?.ANTHROPIC_DEFAULT_OPUS_MODEL,O=b?.env?.ANTHROPIC_DEFAULT_SONNET_MODEL,P=b?.env?.ANTHROPIC_DEFAULT_HAIKU_MODEL,A=u.useMemo(()=>Ws(b?.env||{}),[b]),y=u.useCallback((E,h)=>Js(E,h,{supportsExtendedContext:M=>Za(t,M,a)}),[a,t]),N=u.useCallback((E,h)=>{const M={...b?.env||{},[E]:h},B=Xt(E)?y(M,A):M;delete B.CCS_EXTENDED_CONTEXT;const L={...b,env:B};n(JSON.stringify(L,null,2))},[y,b,A]),T=u.useCallback(E=>{const h=b?.env||{},M=y(h,E);delete M.CCS_EXTENDED_CONTEXT;const B={...b,env:M};n(JSON.stringify(B,null,2))},[y,b]),v=u.useCallback(E=>{const h={...b?.env||{},...E},B=Object.keys(E).some(Xt)?y(h,A):h;delete B.CCS_EXTENDED_CONTEXT;const L={...b,env:B};n(JSON.stringify(L,null,2))},[y,b,A]),R=u.useMemo(()=>{try{return JSON.parse(g),!0}catch{return!1}},[g]),p=u.useMemo(()=>s===null?!1:s!==JSON.stringify(l,null,2),[s,l]),D=u.useMemo(()=>jn(b),[b]),C=Os({mutationFn:async()=>{const E=JSON.parse(g),h=await fetch(`/api/settings/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:E,expectedMtime:c?.mtime})});if(h.status===409)throw new Error("CONFLICT");if(!h.ok)throw new Error("Failed to save");return h.json()},onSuccess:E=>{o.invalidateQueries({queryKey:["settings",t]}),n(null),E?.warning?V.success(he.t("settings.saved"),{description:E.warning}):V.success(he.t("settings.saved"))},onError:E=>{E.message==="CONFLICT"?d(!0):V.error(E.message)}}),H=async E=>{d(!1),E?(await m(),C.mutate()):n(null)};return{data:c,isLoading:r,refetch:m,rawJsonContent:g,rawJsonEdits:s,isRawJsonValid:R,hasChanges:p,currentSettings:b,currentModel:k,opusModel:S,sonnetModel:O,haikuModel:P,extendedContextEnabled:A,toggleExtendedContext:T,handleRawJsonChange:x,updateEnvValue:N,updateEnvValues:v,saveMutation:{mutate:()=>C.mutate(),isPending:C.isPending},conflictDialog:i,setConflictDialog:d,handleConflictResolve:H,missingRequiredFields:D}}const Nn=/-(minimal|low|medium|high|xhigh|fast)$/i,nt=["minimal","low","medium","high","xhigh"];function kn(t){return t?.trim()??""}function He(t){let a=kn(t),s,n;for(let i=0;i<2;i+=1){const d=a.match(Nn);if(!d?.[1])break;const o=d[1].toLowerCase();if(o==="fast"){if(n)break;n="fast"}else{if(s)break;s=o}a=a.slice(0,-d[0].length)}return{baseModel:a,effort:s,serviceTier:n}}function ct(t){return He(t).effort}function zt(t){return He(t).serviceTier}function Bt(t){return He(t).baseModel}function Mt(t,a){const s=He(t),n=s.baseModel;return!n||!a?s.serviceTier?`${n}-${s.serviceTier}`:n:[n,a,s.serviceTier].filter(Boolean).join("-")}function yn(t,a){const s=He(t);return s.baseModel?[s.baseModel,s.effort,a?"fast":void 0].filter(Boolean).join("-"):s.baseModel}function wn(t,a,s=[],n){if(!a){const c=ct(t);return[Mt(t,c)]}const i=Bt(t),d=[],o=c=>{const r=c?Mt(i,c):i;d.push(r);for(const m of s)d.push(`${r}-${m}`)};o(void 0);for(const c of n??nt)if(o(c),!n&&c===a)break;return d}function Cn(t,a){if(a?.length)return[...a];if(!t)return[...nt];const s=nt.indexOf(t);return nt.slice(0,s+1)}function An(t,a){if(!t)return null;const s=ct(t);return s?{label:`Pinned ${s}`,explicit:!0}:{label:"Auto effort",explicit:!1}}const Ms=/\(([a-z]+)\)$/i;function Sn(t){return t?.trim().match(Ms)?.[1]?.toLowerCase()}function Ps(t){return t?.trim().replace(Ms,"")??""}function Mn(t,a){const s=Ps(t);return!s||!a?s:`${s}(${a})`}const Pn={parse:t=>ct(t),strip:t=>Bt(t),apply:(t,a)=>Mt(t,a),getOptions:(t,a)=>{const s=t?Ke(a.provider,t,a):void 0;return Cn(s?.codexMaxEffort,s?.codexEfforts)}},Tn={parse:Sn,strip:Ps,apply:Mn,getOptions:(t,a)=>{if(!t)return null;const s=Ke(a.provider,t,a)?.reasoningLevels;return s?.length?[...s]:null}},Dn={codex:Pn,xai:Tn};function En(t){return t?Dn[t.toLowerCase()]:void 0}const In=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]*$/,Rn=/[._:/-]/;function On(t){const a=t.trim();return In.test(a)&&Rn.test(a)}function Ln({label:t}){return e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:t})}function Xe({modelId:t}){const a=An(t);return a?e.jsx(z,{variant:a.explicit?"secondary":"outline",className:"text-[9px] h-4 px-1 uppercase",children:a.label}):null}function Ye({modelId:t}){const a=zt(t);return a?e.jsx(z,{variant:"secondary",className:"text-[9px] h-4 px-1 uppercase",children:a}):null}function Ze(t,a){if(!t)return"";if(!a?.prefix)return t;const s=`${a.prefix}/`;return t.startsWith(s)?t.slice(s.length):t}function et(t,a){return a?.recommendedModelId??t}function bt(t,a,s,n,i){return i?wn(n,t,s,a):[n]}function _n(t,a){return a?zt(t)?"codex-fast":ct(t)?"codex-reasoning":"recommended":"recommended"}function Ce({label:t,description:a,value:s,onChange:n,catalog:i,allModels:d,routing:o,disabled:c}){const{t:r}=W(),m=i?.provider==="codex",l=u.useMemo(()=>Ht(i,d),[d,i]),g=u.useMemo(()=>Ya(i?.provider??"",i,d),[d,i]),x=new Set(l.map(h=>h.id)),b=u.useMemo(()=>new Map((o?.models??[]).map(h=>[h.modelId.toLowerCase(),h])),[o]),k=u.useMemo(()=>new Set(l.flatMap(h=>bt(h.codexMaxEffort,h.codexEfforts,h.codexServiceTiers,et(h.id,b.get(h.id.toLowerCase())),m))),[m,l,b]),S=u.useMemo(()=>b.get(Ze(s,o).toLowerCase()),[o,b,s]),O=h=>{const M=h.trim();return On(M)?{value:M,groupKey:"custom",searchText:M,triggerContent:e.jsx("span",{className:"truncate font-mono text-xs",children:M}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:M}),e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.customModel")})]})}:null},P=l.flatMap(h=>{const M=b.get(h.id.toLowerCase());return bt(h.codexMaxEffort,h.codexEfforts,h.codexServiceTiers,et(h.id,M),m).map(L=>({value:L,groupKey:_n(L,m),searchText:`${L} ${h.id} ${h.name} ${M?.recommendedModelId??""}`,keywords:[h.tier??"",i?.provider??""],triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:L}),M?.pinnedAvailable?e.jsx(z,{variant:"secondary",className:"text-[9px] h-4 px-1 uppercase",children:M.prefix}):null,m&&e.jsx(Xe,{modelId:L}),m&&e.jsx(Ye,{modelId:L})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:L}),h.tier==="paid"&&e.jsx(Ln,{label:r("providerModelSelector.paid")}),M?.unprefixedStatus==="shadowed"?e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.shadowed")}):null,M?.unprefixedStatus==="prefix-only"?e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.prefixOnly")}):null,m&&e.jsx(Xe,{modelId:L}),m&&e.jsx(Ye,{modelId:L})]})}))}),A=g.filter(h=>!x.has(h.id)).filter(h=>!k.has(et(h.id,b.get(h.id.toLowerCase())))).flatMap(h=>{const M=b.get(h.id.toLowerCase());return bt(void 0,void 0,void 0,et(h.id,M),m).map(L=>({value:L,groupKey:"all",searchText:`${L} ${h.id} ${M?.recommendedModelId??""}`,keywords:[h.owned_by],triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:L}),M?.pinnedAvailable?e.jsx(z,{variant:"secondary",className:"text-[9px] h-4 px-1 uppercase",children:M.prefix}):null,m&&e.jsx(Xe,{modelId:L}),m&&e.jsx(Ye,{modelId:L})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:L}),M?.unprefixedStatus==="shadowed"?e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.shadowed")}):null,M?.unprefixedStatus==="prefix-only"?e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.prefixOnly")}):null,m&&e.jsx(Xe,{modelId:L}),m&&e.jsx(Ye,{modelId:L})]})}))}),y=!!s&&!P.some(h=>h.value===s)&&!A.some(h=>h.value===s),N=s?{value:s,groupKey:"current",searchText:s,triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:s}),e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.current")})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:s}),e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.current")})]})}:null,T=P.length+A.length>0,v=En(i?.provider),R=v?.parse(s),p=v&&i?v.getOptions(v.strip(Ze(s,o)),i):null,D=p&&R&&!p.includes(R)?[...p,R]:p,C=m?zt(s):void 0,H=m&&i&&s?Ke(i.provider,Bt(Ze(s,o)),i):void 0,E=m&&(H?.codexServiceTiers?.includes("fast")===!0||C==="fast");return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium",children:t}),a&&e.jsx("p",{className:"text-[10px] text-muted-foreground",children:a})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(qa,{value:s||void 0,onChange:n,disabled:c,placeholder:r("providerModelSelector.selectModel"),searchPlaceholder:r("searchableSelect.searchModels"),emptyText:r(T?"searchableSelect.noResults":"providerModelSelector.noModelsAvailable"),className:"min-w-0 flex-1",triggerClassName:"h-9",createOption:O,groups:[...y&&N?[{key:"current",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.currentValue")})}]:[],{key:"recommended",label:e.jsx("span",{className:"text-xs text-primary",children:r("providerModelSelector.recommended")})},...m?[{key:"codex-reasoning",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.codexReasoningVariants")})},{key:"codex-fast",label:e.jsx("span",{className:"text-xs text-amber-600",children:r("providerModelSelector.codexFastVariants")})}]:[],...A.length>0?[{key:"all",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.allModelsCount",{count:A.length})})}]:[],{key:"custom",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.customModel")})}],options:[...y&&N?[N]:[],...P,...A]}),v&&D&&e.jsxs(Oe,{value:R??"auto",onValueChange:h=>n(v.apply(s,h==="auto"?void 0:h)),disabled:c||!s,children:[e.jsx(Le,{className:"h-9 w-28 shrink-0","aria-label":r("providerModelSelector.effortLabel"),children:e.jsx(_e,{})}),e.jsxs(Fe,{children:[e.jsx(je,{value:"auto",children:r("providerModelSelector.effortAuto")}),D.map(h=>e.jsx(je,{value:h,children:h},h))]})]}),E&&e.jsxs("label",{className:"flex h-9 shrink-0 items-center gap-1.5",children:[e.jsx(Rt,{checked:C==="fast",onCheckedChange:h=>n(yn(s,h)),disabled:c||!s,"aria-label":r("providerModelSelector.fastTier")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.fastTier")})]})]}),S?e.jsxs("div",{className:X("rounded-md border px-2.5 py-2 text-[11px]",S.unprefixedStatus==="safe"?"border-border/70 bg-muted/25 text-muted-foreground":"border-amber-300/60 bg-amber-50 text-amber-900 dark:border-amber-500/30 dark:bg-amber-950/25 dark:text-amber-100"),children:[e.jsxs("div",{className:"font-medium",children:[S.pinnedAvailable?r("providerModelSelector.preferredPinnedModel"):r("providerModelSelector.pinnedRouteStatus")," ",e.jsx("code",{children:S.pinnedAvailable?S.recommendedModelId:S.pinnedModelId})]}),e.jsx("p",{className:"mt-1 leading-5",children:S.summary})]}):null,s&&!S&&Ze(s,o)!==s?e.jsx("div",{className:"rounded-md border border-amber-300/60 bg-amber-50 px-2.5 py-2 text-[11px] text-amber-900 dark:border-amber-500/30 dark:bg-amber-950/25 dark:text-amber-100",children:r("providerModelSelector.pinnedModelNotAdvertised",{model:s})}):null]})}function is(t,a){const s=n=>a?.models.find(d=>d.modelId.toLowerCase()===n.toLowerCase())?.recommendedModelId??n;return{default:s(t.default),opus:s(t.opus),sonnet:s(t.sonnet),haiku:s(t.haiku)}}function Fn({open:t,onClose:a,currentValues:s,onApply:n,onSave:i,isSaving:d,catalog:o,allModels:c,routing:r}){const{t:m}=W(),[l,g]=u.useState(is(s,r)),[x,b]=u.useState(""),k=S=>{S?(g(is(s,r)),b("")):a()};return e.jsx(Tt,{open:t,onOpenChange:k,children:e.jsxs(Dt,{className:"sm:max-w-md",children:[e.jsx(Et,{children:e.jsxs(It,{className:"flex items-center gap-2",children:[e.jsx(Ft,{className:"w-4 h-4"}),m("customPresetDialog.title")]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"preset-name",children:m("customPresetDialog.presetNameOptional")}),e.jsx(ce,{id:"preset-name",value:x,onChange:S=>b(S.target.value),placeholder:m("customPresetDialog.presetNamePlaceholder"),className:"text-sm"})]}),e.jsx(Gt,{}),o?.provider==="codex"&&e.jsxs("p",{className:"text-[11px] text-muted-foreground rounded-md border bg-muted/30 px-2.5 py-2",children:[m("customPresetDialog.codexTipPrefix")," ",e.jsx("code",{children:"-medium"}),", ",e.jsx("code",{children:"-high"}),", and"," ",e.jsx("code",{children:"-xhigh"})," ",m("customPresetDialog.codexTipSuffix")]}),e.jsx(Ce,{label:m("customPresetDialog.defaultModel"),description:m("customPresetDialog.defaultModelDesc"),value:l.default,onChange:S=>g({...l,default:S}),catalog:o,allModels:c,routing:r}),e.jsx(Ce,{label:m("customPresetDialog.opusModel"),description:m("customPresetDialog.opusModelDesc"),value:l.opus,onChange:S=>g({...l,opus:S}),catalog:o,allModels:c,routing:r}),e.jsx(Ce,{label:m("customPresetDialog.sonnetModel"),description:m("customPresetDialog.sonnetModelDesc"),value:l.sonnet,onChange:S=>g({...l,sonnet:S}),catalog:o,allModels:c,routing:r}),e.jsx(Ce,{label:m("customPresetDialog.haikuModel"),description:m("customPresetDialog.haikuModelDesc"),value:l.haiku,onChange:S=>g({...l,haiku:S}),catalog:o,allModels:c,routing:r})]}),e.jsxs(Xs,{className:"gap-2 sm:gap-0",children:[e.jsx(G,{variant:"outline",onClick:a,children:m("customPresetDialog.cancel")}),i&&e.jsxs(G,{variant:"secondary",onClick:()=>i(l,x||void 0),disabled:d||!x.trim(),children:[d?e.jsx(ue,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(qt,{className:"w-4 h-4 mr-1"}),m("customPresetDialog.savePreset")]}),e.jsxs(G,{onClick:()=>n(l,x||void 0),children:[e.jsx(Ge,{className:"w-4 h-4 mr-1"}),m("customPresetDialog.applyPreset")]})]})]})})}function we({label:t,command:a}){return e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:t}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:a}),e.jsx(gs,{value:a,size:"icon",className:"h-6 w-6"})]})]})}function qn({provider:t,displayName:a,baseProvider:s,defaultTarget:n,data:i,authStatus:d,supportsModelConfig:o=!1}){const{t:c}=W(),r=n||"claude",m=r==="droid",l=t==="codex",g=s||d.provider||t,x=Ys(g),b=r==="claude"?`ccs ${t}`:`ccs ${t} --target claude`,k=`${b} --config`,S=`${b} --auth --add`,O=`${b} --accounts`;return e.jsx(Ot,{className:"h-full",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2 mb-3",children:[e.jsx(Ns,{className:"w-4 h-4"}),"Provider Information"]}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:c("providerEditor.provider")}),e.jsx("span",{className:"font-mono",children:a})]}),i&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:c("providerEditor.filePath")}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs break-all",children:i.path}),e.jsx(gs,{value:i.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:c("providerEditor.lastModified")}),e.jsx("span",{className:"text-xs",children:new Date(i.mtime).toLocaleString()})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:c("providerEditor.status")}),d.authenticated?e.jsxs(z,{variant:"outline",className:"w-fit text-green-600 border-green-200 bg-green-50",children:[e.jsx(Ta,{className:"w-3 h-3 mr-1"}),"Authenticated"]}):e.jsx(z,{variant:"outline",className:"w-fit text-muted-foreground",children:"Not connected"})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:c("providerEditor.defaultTarget")}),e.jsx("span",{className:"font-mono",children:r})]}),x&&e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-start",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:c("providerConfig.trackLabel")}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"font-mono",children:c(x.labelKey)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[c(x.hintKey),Zs(g)?` ${c("providerConfig.plusTrackNote")}`:""]})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:c("providerEditor.quickUsage")}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsx(we,{label:"Run with prompt",command:`ccs ${t} "your prompt"`}),l&&e.jsxs(e.Fragment,{children:[e.jsx(we,{label:"Run on native Codex (shortcut)",command:'ccsxp "your prompt"'}),e.jsx(we,{label:"Run on native Codex (--target)",command:`ccs ${t} --target codex "your prompt"`})]}),e.jsx(we,{label:m?"Droid alias (explicit)":"Run on Droid",command:`ccs-droid ${t} "your prompt"`}),e.jsx(we,{label:m?"Override to Claude":"Run on Droid (--target)",command:`ccs ${t} --target ${m?"claude":"droid"} "your prompt"`}),o&&e.jsx(we,{label:r==="claude"?"Change model":"Change model (Claude target)",command:k}),e.jsx(we,{label:r==="claude"?"Add account":"Add account (Claude target)",command:S}),e.jsx(we,{label:r==="claude"?"List accounts":"List accounts (Claude target)",command:O}),r!=="claude"&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Account and model-management flags stay on Claude target. Codex and Droid runtime launches reject those CLIProxy management commands."})]})]})]})})}function Un(t){const a=t.replace(/\\/g,"/"),n=a.lastIndexOf("/cliproxy/providers/");return n!==-1?a.slice(n+1):a.replace(/^.*\//,"")}function Gn({displayName:t,logoProvider:a,provider:s,data:n,isLoading:i,hasChanges:d,isRawJsonValid:o,isSaving:c,isRemoteMode:r,port:m,onRefetch:l,onSave:g}){const{t:x}=W();return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Lt,{provider:a||s,size:"lg"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:t}),r&&e.jsxs(z,{variant:"secondary",className:"text-xs gap-1 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[e.jsx(ks,{className:"w-3 h-3"}),"Remote"]}),m&&e.jsxs(z,{variant:"outline",className:"text-xs gap-1 font-mono",children:[e.jsx(Da,{className:"w-3 h-3"}),":",m]}),!r&&n?.path&&e.jsx(z,{variant:"outline",className:"text-xs",children:Un(n.path)})]}),r?e.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400 mt-0.5",children:"Traffic auto-routed to remote server"}):n&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[x("providerEditor.lastModified"),": ",new Date(n.mtime).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{variant:"ghost",size:"sm",onClick:l,disabled:i,children:e.jsx(dt,{className:`w-4 h-4 ${i?"animate-spin":""}`})}),e.jsx(G,{size:"sm",onClick:g,disabled:c||!d||!o,children:c?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ea,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Kn({models:t,provider:a,enabled:s,onToggle:n,disabled:i,className:d}){const{t:o}=W();if(t.length===0)return null;const c=t.some(l=>Yt(l.id)),r=t.some(l=>!Yt(l.id));let m="Compatible mappings stay on standard context unless you turn this on.";return c&&r?m="Gemini-compatible mappings can use 1M automatically. Claude mappings stay plain unless you turn this on.":c&&(m="Gemini-compatible mappings can use 1M by default. Turn this off to keep standard context."),e.jsxs("div",{className:X("rounded-lg border p-3 space-y-2",s?"border-primary/50 bg-primary/5":"border-border bg-muted/30",d),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:X("w-4 h-4",s?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"text-sm font-medium",children:o("extendedContext.extendedContext")}),e.jsx(z,{variant:s?"default":"secondary",className:"text-[10px] h-5 px-1.5",children:"1M tokens"})]}),e.jsx(Rt,{checked:s,onCheckedChange:n,disabled:i})]}),e.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[e.jsx(Ns,{className:"w-3.5 h-3.5 mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{children:["Applies the explicit ",e.jsx("code",{children:"[1m]"})," long-context suffix to compatible saved mappings."]}),e.jsx("p",{className:"text-[10px]",children:m}),e.jsxs("p",{className:"text-amber-600 dark:text-amber-500",children:["CCS only saves ",e.jsx("code",{children:"[1m]"}),". Provider pricing and entitlement are separate, and some accounts can still return 429 extra-usage errors for long-context requests."]})]})]})]})}function Hn(t,a){const s=t.presetMapping||{default:t.id,opus:t.id,sonnet:t.id,haiku:t.id};return{ANTHROPIC_MODEL:a(s.default),ANTHROPIC_DEFAULT_OPUS_MODEL:a(s.opus),ANTHROPIC_DEFAULT_SONNET_MODEL:a(s.sonnet),ANTHROPIC_DEFAULT_HAIKU_MODEL:a(s.haiku)}}function zn({catalog:t,savedPresets:a,currentModel:s,opusModel:n,sonnetModel:i,haikuModel:d,providerModels:o,routing:c,provider:r,extendedContextEnabled:m,onExtendedContextToggle:l,onApplyPreset:g,onUpdateEnvValue:x,onOpenCustomPreset:b,onDeletePreset:k,isDeletePending:S}){const{t:O}=W(),P=(c?.models??[]).some(p=>p.pinnedAvailable),A=u.useMemo(()=>new Map((c?.models??[]).map(p=>[p.modelId.toLowerCase(),p])),[c]),y=p=>A.get(p.toLowerCase())?.recommendedModelId??p,N=u.useMemo(()=>{if(!t)return[];const p=[s,n,i,d].filter(C=>!!C).map(C=>ea(C));return[...new Set(p)].map(C=>Ke(t.provider,C,t)).filter(C=>!!C?.extendedContext)},[t,s,n,i,d]),T=u.useMemo(()=>Ht(t,o),[t,o]),v=u.useMemo(()=>{const p=T.filter(C=>C.presetMapping);return p.length===0?[]:p.some(C=>C.tier==="paid")?[{key:"free",label:"Free Tier",description:"Available on free or paid plans",badgeClassName:"text-[10px] bg-green-100 text-green-700 border-green-200",iconClassName:"text-green-600",models:p.filter(C=>C.tier!=="paid")},{key:"paid",label:"Paid Tier",description:"Requires paid access",badgeClassName:"text-[10px] bg-amber-100 text-amber-700 border-amber-200",iconClassName:"text-amber-700",models:p.filter(C=>C.tier==="paid")}].filter(C=>C.models.length>0):[{key:"default",models:p.slice(0,4)}]},[T]),R=v.length>0||a.length>0;return e.jsxs(e.Fragment,{children:[R&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(Ft,{className:"w-4 h-4"}),"Presets"]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:O("providerEditor.presets")}),e.jsxs("div",{className:"space-y-4",children:[v.map(p=>e.jsxs("div",{children:["label"in p&&p.label&&e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(z,{variant:"outline",className:p.badgeClassName,children:p.label}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:p.description})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:p.models.map(D=>e.jsxs(G,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>g(Hn(D,y)),children:[e.jsx(Ge,{className:`w-3 h-3 ${"iconClassName"in p?p.iconClassName:""}`}),D.name]},D.id))})]},p.key)),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.map(p=>e.jsxs("div",{className:"group relative",children:[e.jsxs(G,{variant:"secondary",size:"sm",className:"text-xs h-7 gap-1 pr-6",onClick:()=>{g({ANTHROPIC_MODEL:y(p.default),ANTHROPIC_DEFAULT_OPUS_MODEL:y(p.opus),ANTHROPIC_DEFAULT_SONNET_MODEL:y(p.sonnet),ANTHROPIC_DEFAULT_HAIKU_MODEL:y(p.haiku)})},children:[e.jsx(qt,{className:"w-3 h-3 fill-current"}),p.name]}),e.jsx(G,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-7 w-5 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:D=>{D.stopPropagation(),k(p.name)},disabled:S,children:e.jsx(Ut,{className:"w-3 h-3"})})]},p.name)),e.jsxs(G,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1 border-primary/50 text-primary hover:bg-primary/10 hover:border-primary",onClick:b,children:[e.jsx(lt,{className:"w-3 h-3"}),"Custom"]})]})]})]}),e.jsx(Gt,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-2",children:O("providerEditor.modelMapping")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Configure which models to use for each tier"}),c?e.jsx("p",{className:"text-[11px] text-muted-foreground mb-3 rounded-md border bg-muted/30 px-2.5 py-2",children:P?e.jsxs(e.Fragment,{children:["Preferred pinned model names use the ",e.jsxs("code",{children:[c.prefix,"/"]})," prefix. Unprefixed names can still resolve to a different backend when providers overlap."]}):e.jsxs(e.Fragment,{children:["Managed pinning for ",e.jsxs("code",{children:[c.prefix,"/"]})," is not currently advertised by the proxy. Unprefixed names may still be ambiguous until prefix repair completes."]})}):null,r==="codex"&&e.jsxs("p",{className:"text-[11px] text-muted-foreground mb-3 rounded-md border bg-muted/30 px-2.5 py-2",children:["Codex tip: suffixes ",e.jsx("code",{children:"-minimal"}),", ",e.jsx("code",{children:"-low"}),", ",e.jsx("code",{children:"-medium"}),","," ",e.jsx("code",{children:"-high"}),", and ",e.jsx("code",{children:"-xhigh"})," pin reasoning effort. ",e.jsx("code",{children:"-fast"})," ","enables the Codex fast service tier on models that support it, including combined forms such as ",e.jsx("code",{children:"gpt-5.4-high-fast"}),"."]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ce,{label:"Default Model",description:"Used when no specific tier is requested",value:s,onChange:p=>x("ANTHROPIC_MODEL",p),catalog:t,allModels:o,routing:c}),N.length>0&&l&&e.jsx(Kn,{models:N,provider:r,enabled:m??!1,onToggle:l}),e.jsx(Ce,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:n,onChange:p=>x("ANTHROPIC_DEFAULT_OPUS_MODEL",p),catalog:t,allModels:o,routing:c}),e.jsx(Ce,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:i,onChange:p=>x("ANTHROPIC_DEFAULT_SONNET_MODEL",p),catalog:t,allModels:o,routing:c}),e.jsx(Ce,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:d,onChange:p=>x("ANTHROPIC_DEFAULT_HAIKU_MODEL",p),catalog:t,allModels:o,routing:c})]})]})]})}function Bn(t,a,s){return t?e.jsx(Nt,{children:e.jsxs(kt,{children:[e.jsx(yt,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ra,{className:"w-3 h-3","aria-hidden":"true"}),e.jsx("span",{className:X("font-mono max-w-[180px] truncate",a&&be),title:t,children:t})]})}),e.jsx(wt,{side:"bottom",children:e.jsx("p",{className:"text-xs",children:s("providerEditor.gcpProjectIdReadonly")})})]})}):e.jsx(Nt,{children:e.jsxs(kt,{children:[e.jsx(yt,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600 dark:text-amber-500",children:[e.jsx(it,{className:"w-3 h-3","aria-label":"Warning"}),e.jsx("span",{children:s("providerEditor.projectIdNA")})]})}),e.jsx(wt,{side:"bottom",className:"max-w-[250px]",children:e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsx("p",{className:"font-medium text-amber-600",children:s("providerEditor.missingProjectId")}),e.jsx("p",{children:s("providerEditor.missingProjectIdHint")})]})})]})})}function Vn({account:t,onSetDefault:a,onRemove:s,onReauth:n,onPauseToggle:i,isRemoving:d,isPausingAccount:o,privacyMode:c,showQuota:r,selectable:m,selected:l,onSelectChange:g}){const{t:x}=W(),b=t.provider.toLowerCase(),{data:k}=ta(r),{data:S,isLoading:O}=sa(b,t.id,r),P=aa(k,t)?.lastUsedAt,A=m||i?e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[m&&e.jsx("button",{type:"button",onClick:()=>g?.(!l),className:X("flex items-center justify-center w-5 h-5 rounded border-2 transition-colors shrink-0",l?"bg-primary border-primary text-primary-foreground":"border-muted-foreground/30 hover:border-primary/50"),"aria-label":l?"Deselect account":"Select account",children:l&&e.jsx(Te,{className:"w-3 h-3"})}),i&&e.jsx(Nt,{children:e.jsxs(kt,{children:[e.jsx(yt,{asChild:!0,children:e.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:()=>i(!t.paused),disabled:o,children:o?e.jsx(ue,{className:"w-4 h-4 animate-spin"}):t.paused?e.jsx(ys,{className:"w-4 h-4 text-emerald-500"}):e.jsx(ws,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})}),e.jsx(wt,{side:"top",children:t.paused?"Resume account":"Pause account"})]})})]}):void 0,y=e.jsxs(na,{children:[e.jsx(ia,{asChild:!0,children:e.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",children:e.jsx(Ia,{className:"w-4 h-4"})})}),e.jsxs(ra,{align:"end",children:[!t.isDefault&&e.jsxs(ht,{onClick:a,children:[e.jsx(qt,{className:"w-4 h-4 mr-2"}),"Set as default"]}),n&&e.jsxs(ht,{onClick:n,children:[e.jsx(dt,{className:"w-4 h-4 mr-2"}),"Reauthenticate"]}),e.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:s,disabled:d,children:[e.jsx(Cs,{className:"w-4 h-4 mr-2"}),d?"Removing...":"Remove account"]})]})]});return e.jsx("div",{className:X("rounded-lg border p-3 transition-colors overflow-hidden",t.isDefault?"border-primary/30 bg-primary/5":"border-border hover:bg-muted/30",t.paused&&"opacity-75",l&&"ring-2 ring-primary/50 bg-primary/5"),children:e.jsx(oa,{mode:"detailed",provider:t.provider,accountId:t.id,email:t.email,displayEmail:t.email||t.id,tokenFile:t.tokenFile,tier:t.tier,isDefault:t.isDefault,paused:t.paused,privacyMode:c,showQuota:r,quota:S,quotaLoading:O,runtimeLastUsed:P,beforeIdentity:A,headerEnd:y,bodySlot:t.provider==="agy"?Bn(t.projectId,c,x):null,quotaInsetClassName:"pl-11"})})}function $n({selectedCount:t,onPauseSelected:a,onResumeSelected:s,onClearSelection:n,isPausing:i,isResuming:d}){if(t<1)return null;const o=i||d;return e.jsxs("div",{className:"flex items-center gap-3 p-2 bg-muted/50 rounded-lg border mt-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t," selected"]}),e.jsx(G,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:n,disabled:o,children:"Clear"}),e.jsxs("div",{className:"flex gap-2 ml-auto",children:[e.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:a,disabled:o,children:[i?e.jsx(ue,{className:"w-3 h-3 animate-spin"}):e.jsx(ws,{className:"w-3 h-3"}),"Pause Selected"]}),e.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:s,disabled:o,children:[d?e.jsx(ue,{className:"w-3 h-3 animate-spin"}):e.jsx(ys,{className:"w-3 h-3"}),"Resume Selected"]})]})]})}function Qn({accounts:t,onAddAccount:a,onReauthAccount:s,onSetDefault:n,onRemoveAccount:i,onPauseToggle:d,onSoloMode:o,onBulkPause:c,onBulkResume:r,isRemovingAccount:m,isPausingAccount:l,isSoloingAccount:g,isBulkPausing:x,isBulkResuming:b,privacyMode:k,showQuota:S,isKiro:O,kiroNoIncognito:P,onKiroNoIncognitoChange:A,kiroSettingsLoading:y}){const{t:N}=W(),[T,v]=u.useState(new Set),R=u.useMemo(()=>new Set(t.map(w=>w.id)),[t]),p=u.useMemo(()=>new Set([...T].filter(w=>R.has(w))),[T,R]),D=!!(c&&r),C=p.size,H=t.length>0&&p.size===t.length,E=p.size>0&&p.size<t.length,h=u.useCallback(w=>{v(J=>{const j=new Set(J);return j.has(w)?j.delete(w):j.add(w),j})},[]),M=u.useCallback(()=>{v(new Set(t.map(w=>w.id)))},[t]),B=u.useCallback(()=>{v(new Set)},[]),L=u.useCallback(()=>{H?B():M()},[H,M,B]),_=u.useCallback(()=>{c&&p.size>0&&(c(Array.from(p)),v(new Set))},[c,p]),F=u.useCallback(()=>{r&&p.size>0&&(r(Array.from(p)),v(new Set))},[r,p]);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[D&&t.length>0&&e.jsx(at,{checked:H,onCheckedChange:L,"aria-label":"Select all accounts",className:E?"data-[state=checked]:bg-primary/50":"",...E?{"data-state":"indeterminate"}:{}}),e.jsx(Ue,{className:"w-4 h-4"}),N("providerEditor.accounts"),t.length>0&&e.jsx(z,{variant:"secondary",className:"text-xs",children:t.length})]}),e.jsxs(G,{variant:"default",size:"sm",className:"h-7 text-xs gap-1",onClick:a,children:[e.jsx(lt,{className:"w-3 h-3"}),N("providerEditor.addAccount")]})]}),D&&C>0&&e.jsx($n,{selectedCount:C,onPauseSelected:_,onResumeSelected:F,onClearSelection:B,isPausing:!!x,isResuming:!!b}),t.length>0?e.jsx("div",{className:"space-y-2",children:t.map(w=>e.jsx(Vn,{account:w,onSetDefault:()=>n(w.id),onRemove:()=>i(w.id),onReauth:s?()=>s(w):void 0,onPauseToggle:d?J=>d(w.id,J):void 0,onSoloMode:o?()=>o(w.id):void 0,isRemoving:m,isPausingAccount:l,isSoloingAccount:g,privacyMode:k,showQuota:S,selectable:D,selected:p.has(w.id),onSelectChange:()=>h(w.id)},w.id))}):e.jsxs("div",{className:"py-6 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx(Ue,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:N("providerEditor.noAccountsConnected")}),e.jsx("p",{className:"text-xs opacity-70",children:N("providerEditor.addAccountToStart")})]}),O&&A&&e.jsx("div",{className:"mt-3 pt-3 border-t border-dashed",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ks,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:N("providerEditor.useIncognito")})]}),e.jsx(Rt,{checked:!P,onCheckedChange:w=>A(!w),disabled:y,className:"scale-90"})]})})]})}function Wn({provider:t,catalog:a,savedPresets:s,currentModel:n,opusModel:i,sonnetModel:d,haikuModel:o,providerModels:c,routing:r,extendedContextEnabled:m,onExtendedContextToggle:l,onApplyPreset:g,onUpdateEnvValue:x,onOpenCustomPreset:b,onDeletePreset:k,isDeletePending:S,accounts:O,onAddAccount:P,onReauthAccount:A,onSetDefault:y,onRemoveAccount:N,onPauseToggle:T,onSoloMode:v,onBulkPause:R,onBulkResume:p,isRemovingAccount:D,isPausingAccount:C,isSoloingAccount:H,isBulkPausing:E,isBulkResuming:h,privacyMode:M,isRemoteMode:B}){const L=t.toLowerCase(),_=(da.includes(L)||["anthropic","antigravity","gemini-cli","copilot","github-copilot"].includes(L))&&!B,F=t==="kiro",[w,J]=u.useState(!0),[j,Y]=u.useState(!0),[se,de]=u.useState(!1),K=u.useCallback(async()=>{if(F)try{Y(!0);const Z=(await tt.config.get()).cliproxy;J(Z?.kiro_no_incognito??!0)}catch{J(!0)}finally{Y(!1)}},[F]),ie=u.useCallback(async Q=>{J(Q),de(!0);try{const Z=await tt.config.get(),re=Z.cliproxy??{};await tt.config.update({...Z,cliproxy:{...re,kiro_no_incognito:Q}})}catch{J(!Q)}finally{de(!1)}},[]);return u.useEffect(()=>{K()},[K]),e.jsx(Ot,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsx(zn,{catalog:a,savedPresets:s,currentModel:n,opusModel:i,sonnetModel:d,haikuModel:o,providerModels:c,routing:r,provider:t,extendedContextEnabled:m,onExtendedContextToggle:l,onApplyPreset:g,onUpdateEnvValue:x,onOpenCustomPreset:b,onDeletePreset:k,isDeletePending:S}),e.jsx(Gt,{}),e.jsx(Qn,{accounts:O,onAddAccount:P,onReauthAccount:A,onSetDefault:y,onRemoveAccount:N,onPauseToggle:T,onSoloMode:v,onBulkPause:R,onBulkResume:p,isRemovingAccount:D,isPausingAccount:C,isSoloingAccount:H,isBulkPausing:E,isBulkResuming:h,privacyMode:M,showQuota:_,isKiro:F,kiroNoIncognito:w,onKiroNoIncognitoChange:ie,kiroSettingsLoading:j||se})]})})}function rs({provider:t,displayName:a,authStatus:s,catalog:n,routing:i,logoProvider:d,baseProvider:o,isRemoteMode:c,port:r,defaultTarget:m,topNotice:l,onAddAccount:g,onReauthAccount:x,onSetDefault:b,onRemoveAccount:k,onPauseToggle:S,onSoloMode:O,onBulkPause:P,onBulkResume:A,isRemovingAccount:y,isPausingAccount:N,isSoloingAccount:T,isBulkPausing:v,isBulkResuming:R}){const[p,D]=u.useState(!1),{privacyMode:C}=xs(),{t:H}=W(),{data:E}=la(),{data:h}=ca(t),M=ua(),B=ma(),L=o||t,_=L.toLowerCase()==="agy",F=u.useMemo(()=>{const q=h?.presets||[];return _?q.filter(te=>!xe(te.default)&&!xe(te.opus)&&!xe(te.sonnet)&&!xe(te.haiku)):q},[_,h?.presets]),w=u.useMemo(()=>{if(!E?.models)return[];const te={gemini:["google"],agy:["antigravity"],codex:["openai"],cursor:["cursor"],gitlab:["gitlab","duo"],codebuddy:["codebuddy"],qwen:["alibaba","qwen"],iflow:["iflow"],kilo:["kilo"],qoder:["qoder"],kiro:["kiro","aws"],ghcp:["github","copilot"],kimi:["kimi","moonshot"]}[L.toLowerCase()]||[L.toLowerCase()];return E.models.filter(ae=>te.some(De=>ae.owned_by.toLowerCase().includes(De))?_?!xe(ae.id):!0:!1)},[_,E,L]),J=(o||t).toLowerCase(),{data:j,isLoading:Y,refetch:se,rawJsonContent:de,rawJsonEdits:K,isRawJsonValid:ie,hasChanges:Q,currentModel:Z,opusModel:re,sonnetModel:ke,haikuModel:fe,extendedContextEnabled:Ae,toggleExtendedContext:Se,handleRawJsonChange:f,updateEnvValue:U,updateEnvValues:ge,saveMutation:me,conflictDialog:pe,handleConflictResolve:Me,missingRequiredFields:ut}=bn(t,n),mt=u.useMemo(()=>(s.accounts||[]).map(q=>({...q,provider:q.provider||o||t})),[s.accounts,o,t]),{data:le}=os({queryKey:["auth-tokens-raw"],queryFn:async()=>{const q=await fetch("/api/settings/auth/tokens/raw");return q.ok?q.json():{apiKey:{value:"ccs-internal-managed"}}},staleTime:6e4}),ze=le?.apiKey?.value??"ccs-internal-managed",Be=q=>{if(_&&[q.ANTHROPIC_MODEL,q.ANTHROPIC_DEFAULT_OPUS_MODEL,q.ANTHROPIC_DEFAULT_SONNET_MODEL,q.ANTHROPIC_DEFAULT_HAIKU_MODEL].some(ae=>typeof ae=="string"&&xe(ae))){V.error(H("providerEditor.agyDenylist"));return}ge({ANTHROPIC_BASE_URL:`http://127.0.0.1:${r??Ct}/api/provider/${J}`,ANTHROPIC_AUTH_TOKEN:ze,...q}),V.success(`Applied "${q.ANTHROPIC_MODEL?.split("/").pop()||"preset"}" preset`)},Ve=(q,te)=>{if(_&&[q.default,q.opus,q.sonnet,q.haiku].some(De=>xe(De))){V.error(H("providerEditor.agyDenylist"));return}ge({ANTHROPIC_BASE_URL:`http://127.0.0.1:${r??Ct}/api/provider/${J}`,ANTHROPIC_AUTH_TOKEN:ze,ANTHROPIC_MODEL:q.default,ANTHROPIC_DEFAULT_OPUS_MODEL:q.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:q.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:q.haiku}),V.success(`Applied ${te?`"${te}"`:"custom"} preset`),D(!1)},$e=(q,te)=>{if(!te){V.error(he.t("commonToast.enterPresetName"));return}if(_&&[q.default,q.opus,q.sonnet,q.haiku].some(ae=>xe(ae))){V.error(H("providerEditor.agyDenylist"));return}M.mutate({profile:t,data:{name:te,...q}}),D(!1)};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Gn,{provider:t,displayName:a,logoProvider:d,data:j,isLoading:Y,hasChanges:Q,isRawJsonValid:ie,isSaving:me.isPending,isRemoteMode:c,port:r,onRefetch:se,onSave:()=>me.mutate()}),l?e.jsx("div",{className:"border-b bg-muted/10 px-4 py-3",children:l}):null,Y?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(ue,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:H("providerEditor.loadingSettings")})]}):e.jsxs("div",{className:"min-h-0 flex-1 grid grid-cols-[40%_60%] divide-x overflow-hidden",children:[e.jsx("div",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden bg-muted/5",children:e.jsxs(pa,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(xa,{className:"w-full",children:[e.jsx(Zt,{value:"config",className:"flex-1",children:"Model Config"}),e.jsx(Zt,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsx(es,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(Wn,{provider:t,catalog:n,savedPresets:F,currentModel:Z,opusModel:re,sonnetModel:ke,haikuModel:fe,providerModels:w,routing:i,extendedContextEnabled:Ae,onExtendedContextToggle:Se,onApplyPreset:Be,onUpdateEnvValue:U,onOpenCustomPreset:()=>D(!0),onDeletePreset:q=>B.mutate({profile:t,name:q}),isDeletePending:B.isPending,accounts:mt,onAddAccount:g,onReauthAccount:x,onSetDefault:b,onRemoveAccount:k,onPauseToggle:S,onSoloMode:O,onBulkPause:P,onBulkResume:A,isRemovingAccount:y,isPausingAccount:N,isSoloingAccount:T,isBulkPausing:v,isBulkResuming:R,privacyMode:C,isRemoteMode:c})}),e.jsx(es,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(qn,{provider:t,displayName:a,baseProvider:o,defaultTarget:m,data:j,authStatus:s,supportsModelConfig:!!n})})]})]})}),e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-2 bg-muted/30 border-b flex items-center gap-2 shrink-0 h-[45px]",children:[e.jsx(Oa,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:[H("rawEditorSection.rawConfig")," (JSON)"]})]}),e.jsx(ha,{rawJsonContent:de,isRawJsonValid:ie,rawJsonEdits:K,onRawJsonChange:f,profileEnv:j?.settings?.env,missingRequiredFields:ut})]})]}),e.jsx(Fa,{open:pe,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>Me(!0),onCancel:()=>Me(!1)}),e.jsx(Fn,{open:p,onClose:()=>D(!1),currentValues:{default:Z||"",opus:re||"",sonnet:ke||"",haiku:fe||""},onApply:Ve,onSave:$e,isSaving:M.isPending,catalog:n,allModels:w,routing:i})]})}function Jn({status:t,isSelected:a,onSelect:s}){const{t:n}=W(),i=t.accounts?.length||0;return e.jsxs("button",{className:X("w-full flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors cursor-pointer text-left",a?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:s,children:[e.jsx(Lt,{provider:t.provider,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:t.displayName}),i>0&&e.jsx(z,{variant:"secondary",className:"text-[10px] h-4 px-1",children:i})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:t.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-green-600",children:n("cliproxyPage.connected")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ut,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n("cliproxyPage.notConnected")})]})})]})]})}function Xn({variant:t,parentAuth:a,isSelected:s,onSelect:n,onDelete:i,isDeleting:d}){const{t:o}=W(),c=()=>{n()};return e.jsxs("div",{role:"button",tabIndex:0,className:X("group w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors cursor-pointer text-left pl-6",s?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:c,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),c())},children:[e.jsxs("div",{className:"relative",children:[e.jsx(Lt,{provider:t.provider,size:"sm"}),e.jsx(rt,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-muted-foreground"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:t.name}),e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1",children:o("cliproxyPage.variant")}),e.jsx(z,{variant:"outline",className:"text-[9px] h-4 px-1 uppercase",children:t.target||"claude"})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:a?.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-muted-foreground truncate",children:o("cliproxyPage.viaProvider",{provider:t.provider})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ut,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:o("cliproxyPage.parentNotConnected")})]})})]}),e.jsx(G,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:r=>{r.stopPropagation(),i()},disabled:d,children:e.jsx(Cs,{className:"w-3 h-3"})})]})}function Yn({onAddAccount:t,onCreateVariant:a}){const{t:s}=W();return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-6",children:e.jsx(Ge,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:s("cliproxyPage.emptyTitle")}),e.jsx("p",{className:"text-muted-foreground mb-4",children:s("cliproxyPage.emptyDesc")}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-6",children:[s("cliproxyPage.emptyControlPanelPrefix")," ",e.jsx("a",{href:"/cliproxy/control-panel",className:"text-primary hover:underline",children:s("cliproxyPage.controlPanel")}),"."]}),e.jsxs("div",{className:"flex flex-col justify-center gap-2 sm:flex-row",children:[e.jsxs(G,{onClick:t,className:"gap-2",children:[e.jsx(lt,{className:"w-4 h-4"}),s("cliproxyPage.addAccount")]}),e.jsxs(G,{onClick:a,variant:"outline",className:"gap-2",children:[e.jsx(rt,{className:"w-4 h-4"}),s("cliproxyPage.advancedVariant")]})]})]})})}function gi(){const{t}=W(),a=Pt(),{data:s,isLoading:n}=ms(),{data:i,isFetching:d}=fa(),{data:o}=ps(),{data:c}=ga(),r=va(),m=ja(),l=ba(),g=Na(),x=ka(),b=ya(),k=wa(),S=Ca(),[O,P]=u.useState(()=>{if(typeof window<"u"){const U=new URLSearchParams(window.location.search).get("provider")?.trim().toLowerCase();return U&&qe(U)?U:localStorage.getItem("cliproxy-selected-provider")}return null}),[A,y]=u.useState(null),[N,T]=u.useState(!1),[v,R]=u.useState(()=>{if(typeof window>"u")return null;const f=new URLSearchParams(window.location.search),U=f.get("provider")?.trim().toLowerCase();return f.get("action")!=="auth"||!U||!qe(U)?null:{provider:U,displayName:Je(U),isFirstAccount:!1}}),p=u.useMemo(()=>s?.authStatus||[],[s?.authStatus]),D=u.useMemo(()=>Aa(p,f=>f.provider),[p]),C=s?.source==="remote",H=u.useMemo(()=>i?.variants||[],[i?.variants]),E=u.useMemo(()=>Kt(o?.catalogs),[o?.catalogs]),h=o?.routing??{},M=!!o,B=f=>{P(f),f&&localStorage.setItem("cliproxy-selected-provider",f)},L=u.useMemo(()=>A?null:O&&p.some(f=>f.provider===O)?O:p.length>0&&(p.find(U=>(U.accounts?.length||0)>0)?.provider||p[0]?.provider)||null,[O,A,p]),_=p.find(f=>f.provider===L),F=H.find(f=>f.name===A),w=F?p.find(f=>f.provider===F.provider):void 0,J=F&&w?{provider:F.provider,displayName:w.displayName,accountCount:w.accounts?.length||0}:_?{provider:_.provider,displayName:_.displayName,accountCount:_.accounts?.length||0}:null,j=F?{provider:F.provider,displayName:Je(F.provider),accountCount:0}:O&&qe(O)?{provider:O,displayName:Je(O),accountCount:0}:{provider:"gemini",displayName:Je("gemini"),accountCount:0},Y=J??j,se=(F?.provider||_?.provider||"").toLowerCase().trim(),de=se==="gemini"||se==="agy",K=()=>{a.invalidateQueries({queryKey:["cliproxy"]}),a.invalidateQueries({queryKey:["cliproxy-auth"]}),a.invalidateQueries({queryKey:["cliproxy-catalog"]}),a.invalidateQueries({queryKey:["cliproxy-models"]})},ie=(f,U,ge)=>{l.isPending||g.isPending||(ge?l.mutate({provider:f,accountId:U}):g.mutate({provider:f,accountId:U}))},Q=(f,U)=>{x.isPending||x.mutate({provider:f,accountId:U})},Z=(f,U)=>{b.isPending||b.mutate({provider:f,accountIds:U})},re=(f,U)=>{k.isPending||k.mutate({provider:f,accountIds:U})},ke=f=>{B(f),y(null)},fe=f=>{y(f),B(null)},Ae=()=>{R({provider:Y.provider,displayName:Y.displayName,isFirstAccount:Y.accountCount===0})},Se=(f,U,ge,me)=>{const pe=ge?.find(Me=>Me.id===me);pe&&R({provider:f,displayName:U,isFirstAccount:!1,account:pe})};return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:c?.backendLabel??"CLIProxy"})]}),e.jsx(G,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:K,disabled:d,children:e.jsx(dt,{className:X("w-4 h-4",d&&"animate-spin")})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:t("cliproxyPage.accountManagement")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(G,{variant:"default",size:"sm",className:"w-full gap-2",onClick:Ae,children:[e.jsx(lt,{className:"w-4 h-4"}),t("cliproxyPage.addAccount")]}),e.jsxs(G,{variant:"outline",size:"sm",className:"w-full gap-2",onClick:()=>T(!0),children:[e.jsx(rt,{className:"w-4 h-4"}),t("cliproxyPage.advancedVariant")]}),e.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:t("cliproxyPage.setupActionsHint")})]})]}),e.jsx(Ot,{className:"flex-1",children:e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2",children:t("cliproxyPage.providers")}),n?e.jsx("div",{className:"space-y-2 px-2",children:[1,2,3,4].map(f=>e.jsx(Sa,{className:"h-14 w-full rounded-lg"},f))}):e.jsx("div",{className:"space-y-4",children:D.map(f=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"px-3",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t(f.labelKey)}),e.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:t(f.hintKey)})]}),e.jsx("div",{className:"space-y-1",children:f.items.map(U=>e.jsx(Jn,{status:U,isSelected:L===U.provider,onSelect:()=>ke(U.provider)},U.provider))})]},f.id))}),H.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2 mt-4 flex items-center gap-1.5",children:[e.jsx(rt,{className:"w-3 h-3"}),t("cliproxyPage.variants")]}),e.jsx("div",{className:"space-y-1",children:H.map(f=>e.jsx(Xn,{variant:f,parentAuth:p.find(U=>U.provider===f.provider),isSelected:A===f.name,onSelect:()=>fe(f.name),onDelete:()=>S.mutate(f.name),isDeleting:S.isPending},f.name))})]})]})}),e.jsx("div",{className:"p-3 border-t",children:e.jsx(Ua,{})}),e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:t("cliproxyPage.providerCount",{count:p.length})}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"w-3 h-3 text-green-600"}),t("cliproxyPage.connectedCount",{count:p.filter(f=>f.authenticated).length})]})]})})]}),e.jsx("div",{className:"flex-1 flex min-w-0 flex-col overflow-hidden bg-background",children:F&&w?e.jsx(e.Fragment,{children:e.jsx(rs,{provider:F.name,displayName:t("cliproxyPage.variantDisplay",{name:F.name,provider:F.provider}),authStatus:w,catalog:E[F.provider],routing:h[F.provider],logoProvider:F.provider,baseProvider:F.provider,defaultTarget:F.target,isRemoteMode:C,port:F.port,topNotice:de?e.jsx(St,{compact:!0,showProxySettingsLink:!0}):void 0,onAddAccount:()=>R({provider:F.provider,displayName:w.displayName,isFirstAccount:(w.accounts?.length||0)===0}),onReauthAccount:f=>Se(F.provider,w.displayName,w.accounts,f.id),onSetDefault:f=>r.mutate({provider:F.provider,accountId:f}),onRemoveAccount:f=>m.mutate({provider:F.provider,accountId:f}),onPauseToggle:(f,U)=>ie(F.provider,f,U),onSoloMode:f=>Q(F.provider,f),onBulkPause:f=>Z(F.provider,f),onBulkResume:f=>re(F.provider,f),isRemovingAccount:m.isPending,isPausingAccount:l.isPending||g.isPending,isSoloingAccount:x.isPending,isBulkPausing:b.isPending,isBulkResuming:k.isPending})}):_?e.jsx(e.Fragment,{children:e.jsx(rs,{provider:_.provider,displayName:_.displayName,authStatus:_,catalog:E[_.provider],routing:h[_.provider],isRemoteMode:C,topNotice:de?e.jsx(St,{compact:!0,showProxySettingsLink:!0}):void 0,onAddAccount:()=>R({provider:_.provider,displayName:_.displayName,isFirstAccount:(_.accounts?.length||0)===0}),onReauthAccount:f=>Se(_.provider,_.displayName,_.accounts,f.id),onSetDefault:f=>r.mutate({provider:_.provider,accountId:f}),onRemoveAccount:f=>m.mutate({provider:_.provider,accountId:f}),onPauseToggle:(f,U)=>ie(_.provider,f,U),onSoloMode:f=>Q(_.provider,f),onBulkPause:f=>Z(_.provider,f),onBulkResume:f=>re(_.provider,f),isRemovingAccount:m.isPending,isPausingAccount:l.isPending||g.isPending,isSoloingAccount:x.isPending,isBulkPausing:b.isPending,isBulkResuming:k.isPending})}):e.jsx(Yn,{onAddAccount:Ae,onCreateVariant:()=>T(!0)})}),e.jsx(ln,{open:N,onClose:()=>T(!1)}),e.jsx(gn,{open:v!==null,onClose:()=>R(null),provider:v?.provider||"",displayName:v?.displayName||"",catalog:M&&v?.provider?E[v.provider]:void 0,isFirstAccount:v?.isFirstAccount||!1,account:v?.account})]})}export{gi as CliproxyPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as x}from"./react-vendor-Bjx91N7w.js";import{a as le,c as f,B as N,e as q,bC as we,aZ as Ce,bG as ke,bH as Re,bI as Ae,bJ as Ge,bK as Te,bL as Pe,bM as We,bN as Ve,bO as De,T as Oe,O as _e,R as Ee,j as Ie,k as Ue,l as $e,m as Le,n as Fe,o as Me,p as qe,q as Be,_ as ze}from"./index-CbH39Xjo.js";import{A as He,a as Ke,b as Qe,c as Ye,d as Je,e as Xe,f as Ze,g as et}from"./alert-dialog-D-u0KNAx.js";import{u as he,a as tt,b as st,h as nt}from"./tanstack-bhJxV1h8.js";import{t as se}from"./notifications-B4_o8bcr.js";import{bg as ge,R as M,u as rt,t as at,v as it,A as ot,bh as lt,bi as dt,bj as ct,X as ut,e as xt,bk as gt,bl as mt,U as pt,w as ft,n as ht,x as bt,aG as yt,T as ne,aQ as jt}from"./icons-DSLG1YsC.js";import{T as me}from"./Trans-BivhJwms.js";async function vt(){const t=await fetch("/api/cliproxy/sync/status");if(!t.ok){let a="Failed to fetch sync status";try{const s=await t.json();a=s.error||s.message||a}catch{}throw new Error(a)}return t.json()}async function Nt(){const t=new AbortController,a=setTimeout(()=>t.abort(),3e4);try{const s=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal});if(!s.ok){let r="Sync failed";try{const i=await s.json();r=i.error||i.message||r}catch{}throw new Error(r)}return s.json()}catch(s){throw s instanceof Error&&s.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):s}finally{clearTimeout(a)}}function St(){return he({queryKey:["cliproxy-sync-status"],queryFn:vt,refetchInterval:3e4,retry:1,staleTime:1e4})}function wt(){const t=tt(),{t:a}=le();return st({mutationFn:Nt,onSuccess:s=>{t.invalidateQueries({queryKey:["cliproxy-sync-status"]}),t.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),s.syncedCount===0?se.info(a("toasts.noProfilesToSync")):se.success(`Synced ${s.syncedCount} profile${s.syncedCount===1?"":"s"} to CLIProxy`)},onError:s=>{se.error(a("toasts.syncFailed",{error:s.message}))}})}function pe(t){const a=t.trim().replace(/^v/,""),[s,r="0"]=a.split("-",2),[i=0,u=0,c=0]=s.split(".").map(P=>Number.parseInt(P,10)||0),T=/^\d+$/.test(r)&&Number.parseInt(r,10)||0;return{major:i,minor:u,patch:c,forkRelease:T}}function Q(t,a){return t>a?1:t<a?-1:0}function oe(t,a){const s=pe(t),r=pe(a);return Q(s.major,r.major)||Q(s.minor,r.minor)||Q(s.patch,r.patch)||Q(s.forkRelease,r.forkRelease)}function re(t,a){return oe(t,a)>0}function ae(t,a,s){return oe(t,a)>=0&&oe(t,s)<=0}const ie={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function fe({className:t,compact:a=!1,state:s,sessionAffinityState:r,isLoading:i,isSaving:u,error:c,onApply:T,onApplyAffinity:P}){const{t:n}=le(),w=s?.strategy??"round-robin",g=s?.poolRouting?.enabled??!1,_=s?.poolRouting?.maxRetryCredentials,W=s?.poolRouting?.manageable??!0,j=!W,E=s?.poolRouting?.message??n("routingGuidance.poolRoutingLocalOnly"),v=r?.enabled??!1,m=r?.ttl??"1h",p=r?.manageable??!0,[h,B]=x.useState(w),[A,V]=x.useState(v),[S,D]=x.useState(m),[b,J]=x.useState(!1),X=s?.source==="live"?"Live CLIProxy":"Saved startup default",I=i||u||!s||h===w,U=b?"Hide details":"Show details",G=i||u||!!c||!p,O=n(p?A?"routingGuidance.disableSessionAffinity":"routingGuidance.enableSessionAffinity":"routingGuidance.sessionAffinityUnavailable"),C=x.useRef(null),$=x.useRef(!1);x.useEffect(()=>{B(w)},[w]),x.useEffect(()=>{V(v),D(m)},[v,m]),x.useEffect(()=>{if(u||!C.current)return;const l=C.current;l.enabled===v&&l.ttl===m||(V(v),D(m)),C.current=null},[u,v,m]);const H=()=>{if(!p)return;const l=!A,d=S.trim()||"1h";C.current={enabled:l,ttl:d},V(l),P({enabled:l,ttl:d})},k=()=>{if(!p||c)return;if($.current){$.current=!1;return}const l=S.trim()||"1h";l!==m&&(C.current={enabled:A,ttl:l},P({enabled:A,ttl:l}))};if(a){const l=d=>{B(d),d!==w&&T(d)};return e.jsxs("div",{className:f("group/routing mt-1 space-y-2 -mx-1 rounded-lg p-1",t),children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg transition-colors hover:bg-primary/5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 text-xs font-medium text-foreground",children:[e.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx(ge,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),e.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),u&&e.jsx(M,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),e.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[e.jsx("div",{className:f("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",h==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(ie).map(([d,y])=>{const z=h===d;return e.jsx("button",{type:"button",className:f("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",z?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>l(d),disabled:i||u||!!c,title:y.description,children:y.title},d)})]})]}),g&&W?e.jsx("div",{role:"status",className:"rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-1.5 text-[10px] leading-4 text-amber-700 dark:text-amber-300",children:n("routingGuidance.poolRoutingApplyWarning")}):null,e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:n("routingGuidance.poolRouting")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:j?E:n(g?"routingGuidance.drainOrderHint":"routingGuidance.poolRoutingOffHint")})]}),e.jsx(N,{variant:j?"outline":g?"secondary":"outline",title:j?E:n(g?"routingGuidance.poolRoutingManaged":"routingGuidance.poolRoutingOffHint"),children:j?n("routingGuidance.localOnly"):g?`${n("routingGuidance.poolRoutingOn")} · ${n("routingGuidance.poolMaxRetry",{count:_??0})}`:n("routingGuidance.poolRoutingOff")})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:n("routingGuidance.sessionAffinity")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:p?n("routingGuidance.ttlBadge",{ttl:m}):n("routingGuidance.localOnlySetting")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[p?e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-6 w-14 rounded border border-border/70 bg-background px-2 text-[10px] text-foreground",value:S,onChange:d=>D(d.target.value),onBlur:k,disabled:G}):null,e.jsx("button",{type:"button","aria-label":O,className:f("rounded border px-2 py-1 text-[10px] font-medium transition-colors",p?"border-border/70 bg-background text-foreground hover:border-primary/40 hover:text-primary":"border-border/60 bg-muted/40 text-muted-foreground"),onMouseDown:()=>{$.current=!0},onClick:H,disabled:G,title:r?.message,children:n(p?A?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff":"routingGuidance.sessionAffinityUnavailable")})]})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:r.message}):null]})}return e.jsx("section",{className:f("rounded-xl border border-border/70 bg-background",t),children:e.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:e.jsx(ge,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-sm font-medium",children:n("routingGuidance.routingStrategy")}),e.jsx(N,{variant:"secondary",children:w}),s?e.jsx(N,{variant:"outline",children:X}):null,s?e.jsx(N,{variant:"outline",children:s.target}):null,s?e.jsxs(N,{variant:j?"outline":g?"secondary":"outline",title:j?E:n(g?"routingGuidance.poolRoutingManaged":"routingGuidance.poolRoutingOffHint"),children:[n("routingGuidance.poolRouting"),":"," ",n(j?"routingGuidance.localOnly":g?"routingGuidance.poolRoutingOn":"routingGuidance.poolRoutingOff"),!j&&g&&_!==void 0?` · ${n("routingGuidance.poolMaxRetry",{count:_})}`:""]}):null]}),e.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."}),e.jsx("p",{className:"max-w-3xl text-[11px] leading-5 text-muted-foreground",children:n("routingGuidance.drainOrderHint")})]}),e.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[e.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(ie).map(([l,d])=>{const y=h===l;return e.jsx("button",{type:"button",className:f("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",y?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>B(l),disabled:i||u||!!c,children:d.title},l)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(q,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>J(l=>!l),children:[b?e.jsx(rt,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(at,{className:"mr-1 h-3.5 w-3.5"}),U]}),e.jsx(q,{size:"sm",onClick:()=>T(h),disabled:I||!!c,children:u?"Saving...":`Use ${h}`})]}),g&&W?e.jsx("p",{role:"status",className:"max-w-xs text-[11px] leading-4 text-amber-700 dark:text-amber-400 xl:text-right",children:n("routingGuidance.poolRoutingApplyWarning")}):null]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[e.jsx("span",{children:n("routingGuidance.roundRobin")}),e.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),e.jsx("span",{children:n("routingGuidance.fillFirst")})]}),e.jsxs("div",{className:"grid gap-3 rounded-lg border border-border/70 bg-muted/20 px-3 py-3 xl:col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:n("routingGuidance.sessionAffinity")}),e.jsx(N,{variant:"secondary",children:n(A?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff")}),r?.ttl?e.jsx(N,{variant:"outline",children:n("routingGuidance.ttlBadge",{ttl:m})}):null,p?null:e.jsx(N,{variant:"outline",children:n("routingGuidance.localOnly")})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:n("routingGuidance.sessionAffinityDescription")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-9 w-24 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground",value:S,onChange:l=>D(l.target.value),onBlur:k,disabled:G}),e.jsx(q,{type:"button",variant:"outline",onMouseDown:()=>{$.current=!0},onClick:H,disabled:G,"aria-label":O,children:O})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground",children:r.message}):null]}),c?e.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:c.message}):null,!c&&s?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:s.message}):null,b?e.jsxs("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:[Object.entries(ie).map(([l,d])=>{const y=w===l;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:d.title}),y?e.jsx(N,{variant:"secondary",children:"Current"}):null]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:d.description})]},l)}),e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("div",{className:"text-sm font-medium",children:n("routingGuidance.sessionRecognitionTitle")}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:n("routingGuidance.sessionRecognitionDescription")})]})]}):null]})})}function Ct(t){if(!t)return"";const a=new Date(t).getTime(),r=Date.now()-a,i=Math.floor(r/(1e3*60*60)),u=Math.floor(r%(1e3*60*60)/(1e3*60));return i>0?`${i}h ${u}m`:`${u}m`}function kt(t,a){if(!t)return"";const s=Date.now()-t,r=Math.floor(s/(1e3*60)),i=Math.floor(s/(1e3*60*60));return r<1?a("proxyStatusWidget.justNow"):r<60?a("proxyStatusWidget.minutesAgo",{count:r}):a("proxyStatusWidget.hoursAgo",{count:i})}function Y({icon:t,tooltip:a,onClick:s,disabled:r,isPending:i,className:u,variant:c="ghost"}){return e.jsxs(Me,{children:[e.jsx(qe,{asChild:!0,children:e.jsx(q,{variant:c==="destructive-ghost"?"ghost":c,size:"sm",className:f("h-7 w-7 p-0",c==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",u),onClick:s,disabled:r,children:i?e.jsx(M,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(t,{className:"w-3.5 h-3.5"})})}),e.jsx(Be,{side:"bottom",className:"text-xs",children:a})]})}function Ot(){const{t}=le(),{data:a,isLoading:s}=we(),{data:r}=Ce(),{data:i,isLoading:u}=ke(),{data:c,isLoading:T,error:P}=Re(),n=Ae(),{data:w,isLoading:g,error:_}=Ge(),W=Te(),j=n.isPending||W.isPending,E=P instanceof Error?P:null,v=Pe(),m=We(),p=Ve(),h=De(),{data:B}=St(),{mutate:A,isPending:V}=wt(),[S,D]=x.useState(!1),[b,J]=x.useState(""),[X,I]=x.useState(!1),[U,G]=x.useState(null),[O,C]=x.useState(null),{data:$}=he({queryKey:["cliproxy-server-config"],queryFn:()=>ze.cliproxyServer.get(),staleTime:3e4}),H=nt({mutationKey:["update-backend"]})>0,k=$?.remote,l=k?.enabled&&k?.host,d=w??(_ instanceof Error?{source:"unsupported",target:c?.target??(l?"remote":"local"),reachable:!1,manageable:!1,message:_.message}:void 0),y=a?.running??!1,z=v.isPending||m.isPending||p.isPending||h.isPending||H||V,be=r?.hasUpdate??!1,L=r?.isStable===!1,de=r?.currentVersion,K=B?.configured??!1,ye=t(K?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),Z=L?r?.maxStableVersion||i?.latestStable:r?.latestVersion,ce=i?.maxStableVersion||r?.maxStableVersion||"6.6.80",F=i?.faultyRange,je=F&&`${F.min.replace(/-\d+$/,"")}-${F.max.replace(/-\d+$/,"")}`,ee=(o,R)=>{G(o),C(R),I(!0)},ue=async o=>{if(!o)return;const R=re(o,ce);if(F!==void 0&&ae(o,F.min,F.max)){ee(o,"faulty");return}if(R){ee(o,"experimental");return}try{const xe=await h.mutateAsync({version:o});xe.requiresConfirmation&&ee(o,xe.isFaulty?"faulty":"experimental")}catch{}},ve=()=>{U&&h.mutate({version:U,force:!0}),I(!1),G(null),C(null)},Ne=()=>{I(!1),G(null),C(null)},Se=l?(()=>{const o=k.protocol||"http",R=k.port||(o==="https"?443:80);return o==="https"&&R===443||o==="http"&&R===80?k.host:`${k.host}:${R}`})():null;return l?e.jsxs("div",{className:f("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(it,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:t("proxyStatusWidget.remoteProxy")}),e.jsx(N,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t("proxyStatusWidget.active")})]}),e.jsx(ot,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:Se})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:t("proxyStatusWidget.trafficAutoRouted")})]}),e.jsx(fe,{compact:!0,className:"mt-3",state:c,sessionAffinityState:d,isLoading:T||g,isSaving:j,error:E,onApply:o=>n.mutate(o),onApplyAffinity:o=>W.mutate(o)},`remote:${c?.strategy??"round-robin"}:${d?.enabled??"na"}:${d?.ttl??"na"}:${d?.manageable??"na"}`)]}):e.jsx(Oe,{delayDuration:300,children:e.jsxs("div",{className:f("rounded-lg border p-3 transition-colors",y?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:f("w-2 h-2 rounded-full",y?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:r?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[s?e.jsx(M,{className:"w-3 h-3 animate-spin text-muted-foreground"}):y?e.jsxs(e.Fragment,{children:[e.jsx(Y,{icon:V?M:lt,tooltip:t("proxyStatusWidget.tooltipSync"),onClick:()=>A(),disabled:!K||z,isPending:V}),e.jsx(Y,{icon:dt,tooltip:t("proxyStatusWidget.tooltipRestart"),onClick:()=>p.mutate(),disabled:z,isPending:p.isPending}),e.jsx(Y,{icon:ct,tooltip:t("proxyStatusWidget.tooltipStop"),onClick:()=>m.mutate(),disabled:z,isPending:m.isPending,variant:"destructive-ghost"})]}):null,e.jsx(Y,{icon:S?ut:xt,tooltip:t(S?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>D(!S),className:S?"bg-muted":void 0})]})]}),de&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:f("text-xs font-mono text-muted-foreground",L&&"text-amber-600 dark:text-amber-400"),children:["v",de]}),(be||L)&&Z&&e.jsxs(N,{variant:"secondary",className:f("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",L?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void ue(Z),title:t(L?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[L?e.jsx(gt,{className:"w-2.5 h-2.5"}):e.jsx(mt,{className:"w-2.5 h-2.5"}),Z]})]}),y&&a&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{className:"flex items-center gap-1",children:t("proxyStatusWidget.port",{port:a.port})}),a.sessionCount!==void 0&&a.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(pt,{className:"w-3 h-3"}),t("proxyStatusWidget.sessionCount",{count:a.sessionCount})]}),a.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ft,{className:"w-3 h-3"}),Ct(a.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[K?e.jsx(ht,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(bt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:f("text-xs",K?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:ye})]}),e.jsx(fe,{compact:!0,className:"mt-3",state:c,sessionAffinityState:d,isLoading:T||g,isSaving:j,error:E,onApply:o=>n.mutate(o),onApplyAffinity:o=>W.mutate(o)},`local:${c?.strategy??"round-robin"}:${d?.enabled??"na"}:${d?.ttl??"na"}:${d?.manageable??"na"}`),e.jsx(_e,{open:S,onOpenChange:D,children:e.jsxs(Ee,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:t("proxyStatusWidget.versionManagement")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ie,{value:b,onValueChange:J,disabled:u,children:[e.jsx(Ue,{className:"h-8 text-xs flex-1",children:e.jsx($e,{placeholder:t("proxyStatusWidget.selectVersionPlaceholder")})}),e.jsx(Le,{children:i?.versions.slice(0,20).map(o=>{const R=i?.maxStableVersion&&re(o,i.maxStableVersion),te=i?.faultyRange&&ae(o,i.faultyRange.min,i.faultyRange.max);return e.jsx(Fe,{value:o,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",o,o===i.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:t("proxyStatusWidget.stable")}),(te||R)&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},o)})})]}),e.jsxs(q,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void ue(b),disabled:h.isPending||!b,children:[h.isPending?e.jsx(M,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(yt,{className:"w-3.5 h-3.5"}),t("proxyStatusWidget.install")]})]}),b&&i?.maxStableVersion&&re(b,i.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(ne,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsAboveUnstable",{version:i.maxStableVersion})})]}),b&&i?.faultyRange&&ae(b,i.faultyRange.min,i.faultyRange.max)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(ne,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsKnownIssues",{version:b})})]}),r?.checkedAt&&e.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:t("proxyStatusWidget.lastChecked",{time:kt(r.checkedAt,t)})})]})}),!y&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t("proxyStatusWidget.notRunning")}),e.jsxs(q,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>v.mutate(),disabled:v.isPending,children:[v.isPending?e.jsx(M,{className:"w-3 h-3 animate-spin"}):e.jsx(jt,{className:"w-3 h-3"}),t("proxyStatusWidget.start")]})]}),e.jsx(He,{open:X,onOpenChange:I,children:e.jsxs(Ke,{children:[e.jsxs(Qe,{children:[e.jsxs(Ye,{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"w-5 h-5 text-amber-500"}),t(O==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),e.jsxs(Je,{className:"space-y-2",children:[O==="faulty"?e.jsx("p",{children:e.jsx(me,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:U??"",range:je||""},components:{strong:e.jsx("strong",{})}})}):e.jsx("p",{children:e.jsx(me,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:U??"",maxStable:ce},components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:t(O==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),e.jsx("p",{children:t("proxyStatusWidget.installUnstableConfirm")})]})]}),e.jsxs(Xe,{children:[e.jsx(Ze,{onClick:Ne,children:t("proxyStatusWidget.cancel")}),e.jsx(et,{onClick:ve,className:"bg-amber-500 hover:bg-amber-600 text-white",children:t("proxyStatusWidget.installAnyway")})]})]})})]})})}export{Ot as P};
|