ccstatusline 2.2.2 → 2.2.4

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.
@@ -56103,7 +56103,7 @@ function getTerminalWidth() {
56103
56103
  function canDetectTerminalWidth() {
56104
56104
  return probeTerminalWidth() !== null;
56105
56105
  }
56106
- var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.2";
56106
+ var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.4";
56107
56107
  var init_terminal = () => {};
56108
56108
 
56109
56109
  // src/utils/renderer.ts
@@ -58939,7 +58939,7 @@ var init_usage_types = __esm(() => {
58939
58939
  init_zod();
58940
58940
  FIVE_HOUR_BLOCK_MS = 5 * 60 * 60 * 1000;
58941
58941
  SEVEN_DAY_WINDOW_MS = 7 * 24 * 60 * 60 * 1000;
58942
- UsageErrorSchema = exports_external.enum(["no-credentials", "timeout", "api-error", "parse-error"]);
58942
+ UsageErrorSchema = exports_external.enum(["no-credentials", "timeout", "rate-limited", "api-error", "parse-error"]);
58943
58943
  });
58944
58944
 
58945
58945
  // src/utils/usage-fetch.ts
@@ -58994,20 +58994,30 @@ function parseUsageApiResponse(rawJson) {
58994
58994
  extraUsageUtilization: parsed.extra_usage?.utilization ?? undefined
58995
58995
  };
58996
58996
  }
58997
- function setCachedUsageError(error48, now2) {
58997
+ function ensureCacheDirExists() {
58998
+ if (!fs3.existsSync(CACHE_DIR)) {
58999
+ fs3.mkdirSync(CACHE_DIR, { recursive: true });
59000
+ }
59001
+ }
59002
+ function setCachedUsageError(error48, now2, maxAge = LOCK_MAX_AGE) {
58998
59003
  const errorData = { error: error48 };
58999
59004
  cachedUsageData = errorData;
59000
59005
  usageCacheTime = now2;
59006
+ usageErrorCacheMaxAge = maxAge;
59001
59007
  return errorData;
59002
59008
  }
59003
- function getStaleUsageOrError(error48, now2) {
59009
+ function cacheUsageData(data, now2) {
59010
+ cachedUsageData = data;
59011
+ usageCacheTime = now2;
59012
+ usageErrorCacheMaxAge = LOCK_MAX_AGE;
59013
+ return data;
59014
+ }
59015
+ function getStaleUsageOrError(error48, now2, errorCacheMaxAge = LOCK_MAX_AGE) {
59004
59016
  const stale = readStaleUsageCache();
59005
59017
  if (stale && !stale.error) {
59006
- cachedUsageData = stale;
59007
- usageCacheTime = now2;
59008
- return stale;
59018
+ return cacheUsageData(stale, now2);
59009
59019
  }
59010
- return setCachedUsageError(error48, now2);
59020
+ return setCachedUsageError(error48, now2, errorCacheMaxAge);
59011
59021
  }
59012
59022
  function getUsageToken() {
59013
59023
  const now2 = Math.floor(Date.now() / 1000);
@@ -59043,6 +59053,60 @@ function readStaleUsageCache() {
59043
59053
  return null;
59044
59054
  }
59045
59055
  }
59056
+ function writeUsageLock(blockedUntil, error48) {
59057
+ try {
59058
+ ensureCacheDirExists();
59059
+ fs3.writeFileSync(LOCK_FILE, JSON.stringify({ blockedUntil, error: error48 }));
59060
+ } catch {}
59061
+ }
59062
+ function readActiveUsageLock(now2) {
59063
+ let hasValidJsonLock = false;
59064
+ try {
59065
+ const parsed = parseJsonWithSchema(fs3.readFileSync(LOCK_FILE, "utf8"), UsageLockSchema);
59066
+ if (parsed) {
59067
+ hasValidJsonLock = true;
59068
+ if (parsed.blockedUntil > now2) {
59069
+ return {
59070
+ blockedUntil: parsed.blockedUntil,
59071
+ error: parsed.error ?? "timeout"
59072
+ };
59073
+ }
59074
+ return null;
59075
+ }
59076
+ } catch {}
59077
+ if (hasValidJsonLock) {
59078
+ return null;
59079
+ }
59080
+ try {
59081
+ const lockStat = fs3.statSync(LOCK_FILE);
59082
+ const lockMtime = Math.floor(lockStat.mtimeMs / 1000);
59083
+ const blockedUntil = lockMtime + LOCK_MAX_AGE;
59084
+ if (blockedUntil > now2) {
59085
+ return {
59086
+ blockedUntil,
59087
+ error: "timeout"
59088
+ };
59089
+ }
59090
+ } catch {}
59091
+ return null;
59092
+ }
59093
+ function parseRetryAfterSeconds(headerValue, nowMs = Date.now()) {
59094
+ const rawValue = Array.isArray(headerValue) ? headerValue[0] : headerValue;
59095
+ const trimmedValue = rawValue?.trim();
59096
+ if (!trimmedValue) {
59097
+ return null;
59098
+ }
59099
+ if (/^\d+$/.test(trimmedValue)) {
59100
+ const seconds = Number.parseInt(trimmedValue, 10);
59101
+ return seconds > 0 ? seconds : null;
59102
+ }
59103
+ const retryAtMs = Date.parse(trimmedValue);
59104
+ if (Number.isNaN(retryAtMs)) {
59105
+ return null;
59106
+ }
59107
+ const retryAfterSeconds = Math.ceil((retryAtMs - nowMs) / 1000);
59108
+ return retryAfterSeconds > 0 ? retryAfterSeconds : null;
59109
+ }
59046
59110
  function getUsageApiProxyUrl() {
59047
59111
  const proxyUrl = process.env.HTTPS_PROXY?.trim();
59048
59112
  if (proxyUrl === "") {
@@ -59080,7 +59144,7 @@ async function fetchFromUsageApi(token) {
59080
59144
  };
59081
59145
  const requestOptions = getUsageApiRequestOptions(token);
59082
59146
  if (!requestOptions) {
59083
- finish(null);
59147
+ finish({ kind: "error" });
59084
59148
  return;
59085
59149
  }
59086
59150
  const request2 = https.request(requestOptions, (response) => {
@@ -59091,18 +59155,25 @@ async function fetchFromUsageApi(token) {
59091
59155
  });
59092
59156
  response.on("end", () => {
59093
59157
  if (response.statusCode === 200 && data) {
59094
- finish(data);
59158
+ finish({ kind: "success", body: data });
59159
+ return;
59160
+ }
59161
+ if (response.statusCode === 429) {
59162
+ finish({
59163
+ kind: "rate-limited",
59164
+ retryAfterSeconds: parseRetryAfterSeconds(response.headers["retry-after"]) ?? DEFAULT_RATE_LIMIT_BACKOFF
59165
+ });
59095
59166
  return;
59096
59167
  }
59097
- finish(null);
59168
+ finish({ kind: "error" });
59098
59169
  });
59099
59170
  });
59100
59171
  request2.on("error", () => {
59101
- finish(null);
59172
+ finish({ kind: "error" });
59102
59173
  });
59103
59174
  request2.on("timeout", () => {
59104
59175
  request2.destroy();
59105
- finish(null);
59176
+ finish({ kind: "error" });
59106
59177
  });
59107
59178
  request2.end();
59108
59179
  });
@@ -59114,7 +59185,7 @@ async function fetchUsageData() {
59114
59185
  if (!cachedUsageData.error && cacheAge < CACHE_MAX_AGE) {
59115
59186
  return cachedUsageData;
59116
59187
  }
59117
- if (cachedUsageData.error && cacheAge < LOCK_MAX_AGE) {
59188
+ if (cachedUsageData.error && cacheAge < usageErrorCacheMaxAge) {
59118
59189
  return cachedUsageData;
59119
59190
  }
59120
59191
  }
@@ -59124,9 +59195,7 @@ async function fetchUsageData() {
59124
59195
  if (fileAge < CACHE_MAX_AGE) {
59125
59196
  const fileData = parseCachedUsageData(fs3.readFileSync(CACHE_FILE, "utf8"));
59126
59197
  if (fileData && !fileData.error) {
59127
- cachedUsageData = fileData;
59128
- usageCacheTime = now2;
59129
- return fileData;
59198
+ return cacheUsageData(fileData, now2);
59130
59199
  }
59131
59200
  }
59132
59201
  } catch {}
@@ -59134,29 +59203,21 @@ async function fetchUsageData() {
59134
59203
  if (!token) {
59135
59204
  return getStaleUsageOrError("no-credentials", now2);
59136
59205
  }
59137
- try {
59138
- const lockStat = fs3.statSync(LOCK_FILE);
59139
- const lockAge = now2 - Math.floor(lockStat.mtimeMs / 1000);
59140
- if (lockAge < LOCK_MAX_AGE) {
59141
- const stale = readStaleUsageCache();
59142
- if (stale && !stale.error)
59143
- return stale;
59144
- return { error: "timeout" };
59145
- }
59146
- } catch {}
59147
- try {
59148
- const lockDir = path2.dirname(LOCK_FILE);
59149
- if (!fs3.existsSync(lockDir)) {
59150
- fs3.mkdirSync(lockDir, { recursive: true });
59151
- }
59152
- fs3.writeFileSync(LOCK_FILE, "");
59153
- } catch {}
59206
+ const activeLock = readActiveUsageLock(now2);
59207
+ if (activeLock) {
59208
+ return getStaleUsageOrError(activeLock.error, now2, Math.max(1, activeLock.blockedUntil - now2));
59209
+ }
59210
+ writeUsageLock(now2 + LOCK_MAX_AGE, "timeout");
59154
59211
  try {
59155
59212
  const response = await fetchFromUsageApi(token);
59156
- if (!response) {
59213
+ if (response.kind === "rate-limited") {
59214
+ writeUsageLock(now2 + response.retryAfterSeconds, "rate-limited");
59215
+ return getStaleUsageOrError("rate-limited", now2, response.retryAfterSeconds);
59216
+ }
59217
+ if (response.kind === "error") {
59157
59218
  return getStaleUsageOrError("api-error", now2);
59158
59219
  }
59159
- const usageData = parseUsageApiResponse(response);
59220
+ const usageData = parseUsageApiResponse(response.body);
59160
59221
  if (!usageData) {
59161
59222
  return getStaleUsageOrError("parse-error", now2);
59162
59223
  }
@@ -59164,19 +59225,15 @@ async function fetchUsageData() {
59164
59225
  return getStaleUsageOrError("parse-error", now2);
59165
59226
  }
59166
59227
  try {
59167
- if (!fs3.existsSync(CACHE_DIR)) {
59168
- fs3.mkdirSync(CACHE_DIR, { recursive: true });
59169
- }
59228
+ ensureCacheDirExists();
59170
59229
  fs3.writeFileSync(CACHE_FILE, JSON.stringify(usageData));
59171
59230
  } catch {}
59172
- cachedUsageData = usageData;
59173
- usageCacheTime = now2;
59174
- return usageData;
59231
+ return cacheUsageData(usageData, now2);
59175
59232
  } catch {
59176
59233
  return getStaleUsageOrError("parse-error", now2);
59177
59234
  }
59178
59235
  }
59179
- var import_https_proxy_agent, CACHE_DIR, CACHE_FILE, LOCK_FILE, CACHE_MAX_AGE = 180, LOCK_MAX_AGE = 30, TOKEN_CACHE_MAX_AGE = 3600, UsageCredentialsSchema, CachedUsageDataSchema, UsageApiResponseSchema, cachedUsageData = null, usageCacheTime = 0, cachedUsageToken = null, usageTokenCacheTime = 0, USAGE_API_HOST = "api.anthropic.com", USAGE_API_PATH = "/api/oauth/usage", USAGE_API_TIMEOUT_MS = 5000;
59236
+ var import_https_proxy_agent, CACHE_DIR, CACHE_FILE, LOCK_FILE, CACHE_MAX_AGE = 180, LOCK_MAX_AGE = 30, DEFAULT_RATE_LIMIT_BACKOFF = 300, TOKEN_CACHE_MAX_AGE = 3600, UsageCredentialsSchema, UsageLockErrorSchema, UsageLockSchema, CachedUsageDataSchema, UsageApiResponseSchema, cachedUsageData = null, usageCacheTime = 0, cachedUsageToken = null, usageTokenCacheTime = 0, usageErrorCacheMaxAge, USAGE_API_HOST = "api.anthropic.com", USAGE_API_PATH = "/api/oauth/usage", USAGE_API_TIMEOUT_MS = 5000;
59180
59237
  var init_usage_fetch = __esm(() => {
59181
59238
  init_zod();
59182
59239
  init_claude_settings();
@@ -59186,6 +59243,11 @@ var init_usage_fetch = __esm(() => {
59186
59243
  CACHE_FILE = path2.join(CACHE_DIR, "usage.json");
59187
59244
  LOCK_FILE = path2.join(CACHE_DIR, "usage.lock");
59188
59245
  UsageCredentialsSchema = exports_external.object({ claudeAiOauth: exports_external.object({ accessToken: exports_external.string().nullable().optional() }).optional() });
59246
+ UsageLockErrorSchema = exports_external.enum(["timeout", "rate-limited"]);
59247
+ UsageLockSchema = exports_external.object({
59248
+ blockedUntil: exports_external.number(),
59249
+ error: UsageLockErrorSchema.optional()
59250
+ });
59189
59251
  CachedUsageDataSchema = exports_external.object({
59190
59252
  sessionUsage: exports_external.number().nullable().optional(),
59191
59253
  sessionResetAt: exports_external.string().nullable().optional(),
@@ -59213,11 +59275,12 @@ var init_usage_fetch = __esm(() => {
59213
59275
  utilization: exports_external.number().nullable().optional()
59214
59276
  }).optional()
59215
59277
  });
59278
+ usageErrorCacheMaxAge = LOCK_MAX_AGE;
59216
59279
  });
59217
59280
 
59218
59281
  // node_modules/fdir/dist/index.mjs
59219
59282
  import { createRequire as createRequire2 } from "module";
59220
- import { basename, dirname as dirname2, normalize, relative, resolve, sep } from "path";
59283
+ import { basename, dirname, normalize, relative, resolve, sep } from "path";
59221
59284
  import * as nativeFs from "fs";
59222
59285
  function cleanPath(path3) {
59223
59286
  let normalized = normalize(path3);
@@ -59310,7 +59373,7 @@ function build$2(options, isSynchronous) {
59310
59373
  function isRecursive(path3, resolved, state) {
59311
59374
  if (state.options.useRealPaths)
59312
59375
  return isRecursiveUsingRealPaths(resolved, state);
59313
- let parent = dirname2(path3);
59376
+ let parent = dirname(path3);
59314
59377
  let depth = 1;
59315
59378
  while (parent !== state.root && depth < 2) {
59316
59379
  const resolvedPath = state.symlinks.get(parent);
@@ -59318,7 +59381,7 @@ function isRecursive(path3, resolved, state) {
59318
59381
  if (isSameRoot)
59319
59382
  depth++;
59320
59383
  else
59321
- parent = dirname2(parent);
59384
+ parent = dirname(parent);
59322
59385
  }
59323
59386
  state.symlinks.set(path3, resolved);
59324
59387
  return depth > 1;
@@ -59571,7 +59634,7 @@ var __require2, SLASHES_REGEX, WINDOWS_ROOT_DIR_REGEX, pushDirectory = (director
59571
59634
  } else {
59572
59635
  resolvedPath = useRealPaths ? resolvedPath : path3;
59573
59636
  const filename = basename(resolvedPath);
59574
- const directoryPath$1 = normalizePath(dirname2(resolvedPath), this.state.options);
59637
+ const directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);
59575
59638
  resolvedPath = this.joinPath(filename, directoryPath$1);
59576
59639
  this.pushFile(resolvedPath, files, this.state.counts, filters);
59577
59640
  }
@@ -62112,11 +62175,57 @@ var init_jsonl_metrics = __esm(() => {
62112
62175
  init_jsonl_lines();
62113
62176
  });
62114
62177
 
62178
+ // src/utils/jsonl-metadata.ts
62179
+ function normalizeThinkingEffort(value) {
62180
+ if (!value) {
62181
+ return;
62182
+ }
62183
+ const normalized = value.toLowerCase();
62184
+ if (normalized === "low" || normalized === "medium" || normalized === "high" || normalized === "max") {
62185
+ return normalized;
62186
+ }
62187
+ return;
62188
+ }
62189
+ function getTranscriptThinkingEffort(transcriptPath) {
62190
+ if (!transcriptPath) {
62191
+ return;
62192
+ }
62193
+ try {
62194
+ const lines = readJsonlLinesSync(transcriptPath);
62195
+ for (let i = lines.length - 1;i >= 0; i--) {
62196
+ const line = lines[i];
62197
+ if (!line) {
62198
+ continue;
62199
+ }
62200
+ const entry = parseJsonlLine(line);
62201
+ if (typeof entry?.message?.content !== "string") {
62202
+ continue;
62203
+ }
62204
+ const visibleContent = getVisibleText(entry.message.content).trim();
62205
+ if (!visibleContent.startsWith(MODEL_STDOUT_PREFIX)) {
62206
+ continue;
62207
+ }
62208
+ const match = MODEL_STDOUT_EFFORT_REGEX.exec(visibleContent);
62209
+ return normalizeThinkingEffort(match?.[1]);
62210
+ }
62211
+ } catch {
62212
+ return;
62213
+ }
62214
+ return;
62215
+ }
62216
+ var MODEL_STDOUT_PREFIX = "<local-command-stdout>Set model to ", MODEL_STDOUT_EFFORT_REGEX;
62217
+ var init_jsonl_metadata = __esm(() => {
62218
+ init_ansi();
62219
+ init_jsonl_lines();
62220
+ MODEL_STDOUT_EFFORT_REGEX = /^<local-command-stdout>Set model to[\s\S]*? with (low|medium|high|max) effort<\/local-command-stdout>$/i;
62221
+ });
62222
+
62115
62223
  // src/utils/jsonl.ts
62116
62224
  var init_jsonl = __esm(() => {
62117
62225
  init_jsonl_cache();
62118
62226
  init_jsonl_blocks();
62119
62227
  init_jsonl_metrics();
62228
+ init_jsonl_metadata();
62120
62229
  });
62121
62230
 
62122
62231
  // src/utils/usage-windows.ts
@@ -62180,10 +62289,13 @@ function getWeeklyUsageWindowFromResetAt(weeklyResetAt, nowMs = Date.now()) {
62180
62289
  function resolveWeeklyUsageWindow(usageData, nowMs = Date.now()) {
62181
62290
  return getWeeklyUsageWindowFromResetAt(usageData.weeklyResetAt, nowMs);
62182
62291
  }
62183
- function formatUsageDuration(durationMs) {
62292
+ function formatUsageDuration(durationMs, compact2 = false) {
62184
62293
  const clampedMs = Math.max(0, durationMs);
62185
62294
  const elapsedHours = Math.floor(clampedMs / (1000 * 60 * 60));
62186
62295
  const elapsedMinutes = Math.floor(clampedMs % (1000 * 60 * 60) / (1000 * 60));
62296
+ if (compact2) {
62297
+ return elapsedMinutes === 0 ? `${elapsedHours}h` : `${elapsedHours}h${elapsedMinutes}m`;
62298
+ }
62187
62299
  if (elapsedMinutes === 0) {
62188
62300
  return `${elapsedHours}hr`;
62189
62301
  }
@@ -62195,6 +62307,8 @@ function getUsageErrorMessage(error48) {
62195
62307
  return "[No credentials]";
62196
62308
  case "timeout":
62197
62309
  return "[Timeout]";
62310
+ case "rate-limited":
62311
+ return "[Rate limited]";
62198
62312
  case "api-error":
62199
62313
  return "[API Error]";
62200
62314
  case "parse-error":
@@ -62235,7 +62349,13 @@ function getUsageProgressBarWidth(mode) {
62235
62349
  function isUsageInverted(item) {
62236
62350
  return isMetadataFlagEnabled(item, "invert");
62237
62351
  }
62238
- function getUsageDisplayModifierText(item) {
62352
+ function isUsageCompact(item) {
62353
+ return isMetadataFlagEnabled(item, "compact");
62354
+ }
62355
+ function toggleUsageCompact(item) {
62356
+ return toggleMetadataFlag(item, "compact");
62357
+ }
62358
+ function getUsageDisplayModifierText(item, options = {}) {
62239
62359
  const mode = getUsageDisplayMode(item);
62240
62360
  const modifiers = [];
62241
62361
  if (mode === "progress") {
@@ -62246,6 +62366,9 @@ function getUsageDisplayModifierText(item) {
62246
62366
  if (isUsageInverted(item)) {
62247
62367
  modifiers.push("inverted");
62248
62368
  }
62369
+ if (options.includeCompact && isUsageCompact(item)) {
62370
+ modifiers.push("compact");
62371
+ }
62249
62372
  return makeModifierText(modifiers);
62250
62373
  }
62251
62374
  function cycleUsageDisplayMode(item) {
@@ -62292,7 +62415,7 @@ class BlockTimerWidget {
62292
62415
  getEditorDisplay(item) {
62293
62416
  return {
62294
62417
  displayText: this.getDisplayName(),
62295
- modifierText: getUsageDisplayModifierText(item)
62418
+ modifierText: getUsageDisplayModifierText(item, { includeCompact: true })
62296
62419
  };
62297
62420
  }
62298
62421
  handleEditorAction(action, item) {
@@ -62302,11 +62425,15 @@ class BlockTimerWidget {
62302
62425
  if (action === "toggle-invert") {
62303
62426
  return toggleUsageInverted(item);
62304
62427
  }
62428
+ if (action === "toggle-compact") {
62429
+ return toggleUsageCompact(item);
62430
+ }
62305
62431
  return null;
62306
62432
  }
62307
62433
  render(item, context, settings) {
62308
62434
  const displayMode = getUsageDisplayMode(item);
62309
62435
  const inverted = isUsageInverted(item);
62436
+ const compact2 = isUsageCompact(item);
62310
62437
  if (context.isPreview) {
62311
62438
  const previewPercent = inverted ? 26.1 : 73.9;
62312
62439
  if (isUsageProgressMode(displayMode)) {
@@ -62314,7 +62441,7 @@ class BlockTimerWidget {
62314
62441
  const progressBar = makeTimerProgressBar(previewPercent, barWidth);
62315
62442
  return formatRawOrLabeledValue(item, "Block ", `[${progressBar}] ${previewPercent.toFixed(1)}%`);
62316
62443
  }
62317
- return formatRawOrLabeledValue(item, "Block: ", "3hr 45m");
62444
+ return formatRawOrLabeledValue(item, "Block: ", compact2 ? "3h45m" : "3hr 45m");
62318
62445
  }
62319
62446
  const usageData = context.usageData ?? {};
62320
62447
  const window2 = resolveUsageWindowWithFallback(usageData, context.blockMetrics);
@@ -62324,7 +62451,7 @@ class BlockTimerWidget {
62324
62451
  const emptyBar = "░".repeat(barWidth);
62325
62452
  return formatRawOrLabeledValue(item, "Block ", `[${emptyBar}] 0.0%`);
62326
62453
  }
62327
- return formatRawOrLabeledValue(item, "Block: ", "0hr 0m");
62454
+ return formatRawOrLabeledValue(item, "Block: ", compact2 ? "0h" : "0hr 0m");
62328
62455
  }
62329
62456
  if (isUsageProgressMode(displayMode)) {
62330
62457
  const barWidth = getUsageProgressBarWidth(displayMode);
@@ -62333,13 +62460,14 @@ class BlockTimerWidget {
62333
62460
  const percentage = percent.toFixed(1);
62334
62461
  return formatRawOrLabeledValue(item, "Block ", `[${progressBar}] ${percentage}%`);
62335
62462
  }
62336
- const elapsedTime = formatUsageDuration(window2.elapsedMs);
62463
+ const elapsedTime = formatUsageDuration(window2.elapsedMs, compact2);
62337
62464
  return formatRawOrLabeledValue(item, "Block: ", elapsedTime);
62338
62465
  }
62339
62466
  getCustomKeybinds() {
62340
62467
  return [
62341
62468
  { key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
62342
- { key: "v", label: "in(v)ert fill", action: "toggle-invert" }
62469
+ { key: "v", label: "in(v)ert fill", action: "toggle-invert" },
62470
+ { key: "s", label: "(s)hort time", action: "toggle-compact" }
62343
62471
  ];
62344
62472
  }
62345
62473
  supportsRawValue() {
@@ -63285,7 +63413,7 @@ class BlockResetTimerWidget {
63285
63413
  getEditorDisplay(item) {
63286
63414
  return {
63287
63415
  displayText: this.getDisplayName(),
63288
- modifierText: getUsageDisplayModifierText(item)
63416
+ modifierText: getUsageDisplayModifierText(item, { includeCompact: true })
63289
63417
  };
63290
63418
  }
63291
63419
  handleEditorAction(action, item) {
@@ -63295,11 +63423,15 @@ class BlockResetTimerWidget {
63295
63423
  if (action === "toggle-invert") {
63296
63424
  return toggleUsageInverted(item);
63297
63425
  }
63426
+ if (action === "toggle-compact") {
63427
+ return toggleUsageCompact(item);
63428
+ }
63298
63429
  return null;
63299
63430
  }
63300
63431
  render(item, context, settings) {
63301
63432
  const displayMode = getUsageDisplayMode(item);
63302
63433
  const inverted = isUsageInverted(item);
63434
+ const compact2 = isUsageCompact(item);
63303
63435
  if (context.isPreview) {
63304
63436
  const previewPercent = inverted ? 90 : 10;
63305
63437
  if (isUsageProgressMode(displayMode)) {
@@ -63307,7 +63439,7 @@ class BlockResetTimerWidget {
63307
63439
  const progressBar = makeTimerProgressBar2(previewPercent, barWidth);
63308
63440
  return formatRawOrLabeledValue(item, "Reset ", `[${progressBar}] ${previewPercent.toFixed(1)}%`);
63309
63441
  }
63310
- return formatRawOrLabeledValue(item, "Reset: ", "4hr 30m");
63442
+ return formatRawOrLabeledValue(item, "Reset: ", compact2 ? "4h30m" : "4hr 30m");
63311
63443
  }
63312
63444
  const usageData = context.usageData ?? {};
63313
63445
  const window2 = resolveUsageWindowWithFallback(usageData, context.blockMetrics);
@@ -63324,13 +63456,14 @@ class BlockResetTimerWidget {
63324
63456
  const percentage = percent.toFixed(1);
63325
63457
  return formatRawOrLabeledValue(item, "Reset ", `[${progressBar}] ${percentage}%`);
63326
63458
  }
63327
- const remainingTime = formatUsageDuration(window2.remainingMs);
63459
+ const remainingTime = formatUsageDuration(window2.remainingMs, compact2);
63328
63460
  return formatRawOrLabeledValue(item, "Reset: ", remainingTime);
63329
63461
  }
63330
63462
  getCustomKeybinds() {
63331
63463
  return [
63332
63464
  { key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
63333
- { key: "v", label: "in(v)ert fill", action: "toggle-invert" }
63465
+ { key: "v", label: "in(v)ert fill", action: "toggle-invert" },
63466
+ { key: "s", label: "(s)hort time", action: "toggle-compact" }
63334
63467
  ];
63335
63468
  }
63336
63469
  supportsRawValue() {
@@ -63369,7 +63502,7 @@ class WeeklyResetTimerWidget {
63369
63502
  getEditorDisplay(item) {
63370
63503
  return {
63371
63504
  displayText: this.getDisplayName(),
63372
- modifierText: getUsageDisplayModifierText(item)
63505
+ modifierText: getUsageDisplayModifierText(item, { includeCompact: true })
63373
63506
  };
63374
63507
  }
63375
63508
  handleEditorAction(action, item) {
@@ -63379,11 +63512,15 @@ class WeeklyResetTimerWidget {
63379
63512
  if (action === "toggle-invert") {
63380
63513
  return toggleUsageInverted(item);
63381
63514
  }
63515
+ if (action === "toggle-compact") {
63516
+ return toggleUsageCompact(item);
63517
+ }
63382
63518
  return null;
63383
63519
  }
63384
63520
  render(item, context, settings) {
63385
63521
  const displayMode = getUsageDisplayMode(item);
63386
63522
  const inverted = isUsageInverted(item);
63523
+ const compact2 = isUsageCompact(item);
63387
63524
  if (context.isPreview) {
63388
63525
  const previewPercent = inverted ? 90 : 10;
63389
63526
  if (isUsageProgressMode(displayMode)) {
@@ -63391,7 +63528,7 @@ class WeeklyResetTimerWidget {
63391
63528
  const progressBar = makeTimerProgressBar3(previewPercent, barWidth);
63392
63529
  return formatRawOrLabeledValue(item, "Weekly Reset ", `[${progressBar}] ${previewPercent.toFixed(1)}%`);
63393
63530
  }
63394
- return formatRawOrLabeledValue(item, "Weekly Reset: ", "36hr 30m");
63531
+ return formatRawOrLabeledValue(item, "Weekly Reset: ", compact2 ? "36h30m" : "36hr 30m");
63395
63532
  }
63396
63533
  const usageData = context.usageData ?? {};
63397
63534
  const window2 = resolveWeeklyUsageWindow(usageData);
@@ -63408,13 +63545,14 @@ class WeeklyResetTimerWidget {
63408
63545
  const percentage = percent.toFixed(1);
63409
63546
  return formatRawOrLabeledValue(item, "Weekly Reset ", `[${progressBar}] ${percentage}%`);
63410
63547
  }
63411
- const remainingTime = formatUsageDuration(window2.remainingMs);
63548
+ const remainingTime = formatUsageDuration(window2.remainingMs, compact2);
63412
63549
  return formatRawOrLabeledValue(item, "Weekly Reset: ", remainingTime);
63413
63550
  }
63414
63551
  getCustomKeybinds() {
63415
63552
  return [
63416
63553
  { key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
63417
- { key: "v", label: "in(v)ert fill", action: "toggle-invert" }
63554
+ { key: "v", label: "in(v)ert fill", action: "toggle-invert" },
63555
+ { key: "s", label: "(s)hort time", action: "toggle-compact" }
63418
63556
  ];
63419
63557
  }
63420
63558
  supportsRawValue() {
@@ -63906,6 +64044,64 @@ var init_Skills = __esm(async () => {
63906
64044
  MODE_LABELS = { current: "last used", count: "total count", list: "unique list" };
63907
64045
  });
63908
64046
 
64047
+ // src/widgets/ThinkingEffort.ts
64048
+ function normalizeThinkingEffort2(value) {
64049
+ if (!value) {
64050
+ return;
64051
+ }
64052
+ const normalized = value.toLowerCase();
64053
+ if (normalized === "low" || normalized === "medium" || normalized === "high" || normalized === "max") {
64054
+ return normalized;
64055
+ }
64056
+ return;
64057
+ }
64058
+ function resolveThinkingEffortFromSettings() {
64059
+ try {
64060
+ const settings = loadClaudeSettingsSync({ logErrors: false });
64061
+ return normalizeThinkingEffort2(settings.effortLevel);
64062
+ } catch {}
64063
+ return;
64064
+ }
64065
+ function resolveThinkingEffort(context) {
64066
+ return getTranscriptThinkingEffort(context.data?.transcript_path) ?? resolveThinkingEffortFromSettings() ?? "medium";
64067
+ }
64068
+
64069
+ class ThinkingEffortWidget {
64070
+ getDefaultColor() {
64071
+ return "magenta";
64072
+ }
64073
+ getDescription() {
64074
+ return `Displays the current thinking effort level (low, medium, high, max).
64075
+ May be incorrect when multiple Claude Code sessions are running due to current Claude Code limitations.`;
64076
+ }
64077
+ getDisplayName() {
64078
+ return "Thinking Effort";
64079
+ }
64080
+ getCategory() {
64081
+ return "Core";
64082
+ }
64083
+ getEditorDisplay(item) {
64084
+ return { displayText: this.getDisplayName() };
64085
+ }
64086
+ render(item, context, settings) {
64087
+ if (context.isPreview) {
64088
+ return item.rawValue ? "high" : "Thinking: high";
64089
+ }
64090
+ const effort = resolveThinkingEffort(context);
64091
+ return item.rawValue ? effort : `Thinking: ${effort}`;
64092
+ }
64093
+ supportsRawValue() {
64094
+ return true;
64095
+ }
64096
+ supportsColors(item) {
64097
+ return true;
64098
+ }
64099
+ }
64100
+ var init_ThinkingEffort = __esm(() => {
64101
+ init_claude_settings();
64102
+ init_jsonl();
64103
+ });
64104
+
63909
64105
  // src/widgets/index.ts
63910
64106
  var init_widgets = __esm(async () => {
63911
64107
  init_GitBranch();
@@ -63925,6 +64121,7 @@ var init_widgets = __esm(async () => {
63925
64121
  init_BlockResetTimer();
63926
64122
  init_WeeklyResetTimer();
63927
64123
  init_ContextBar();
64124
+ init_ThinkingEffort();
63928
64125
  await __promiseAll([
63929
64126
  init_TokensInput(),
63930
64127
  init_TokensOutput(),
@@ -63982,7 +64179,8 @@ var init_widget_manifest = __esm(async () => {
63982
64179
  { type: "reset-timer", create: () => new BlockResetTimerWidget },
63983
64180
  { type: "weekly-reset-timer", create: () => new WeeklyResetTimerWidget },
63984
64181
  { type: "context-bar", create: () => new ContextBarWidget },
63985
- { type: "skills", create: () => new SkillsWidget }
64182
+ { type: "skills", create: () => new SkillsWidget },
64183
+ { type: "thinking-effort", create: () => new ThinkingEffortWidget }
63986
64184
  ];
63987
64185
  LAYOUT_WIDGET_MANIFEST = [
63988
64186
  {
@@ -64348,6 +64546,22 @@ async function backupClaudeSettings(suffix = ".bak") {
64348
64546
  }
64349
64547
  return null;
64350
64548
  }
64549
+ function loadClaudeSettingsSync(options = {}) {
64550
+ const { logErrors = true } = options;
64551
+ const settingsPath2 = getClaudeSettingsPath();
64552
+ if (!fs10.existsSync(settingsPath2)) {
64553
+ return {};
64554
+ }
64555
+ try {
64556
+ const content = fs10.readFileSync(settingsPath2, "utf-8");
64557
+ return JSON.parse(content);
64558
+ } catch (error48) {
64559
+ if (logErrors) {
64560
+ console.error("Failed to load Claude settings:", error48);
64561
+ }
64562
+ throw error48;
64563
+ }
64564
+ }
64351
64565
  async function loadClaudeSettings(options = {}) {
64352
64566
  const { logErrors = true } = options;
64353
64567
  const settingsPath2 = getClaudeSettingsPath();
@@ -64879,7 +65093,7 @@ var dist_default4 = Gradient;
64879
65093
 
64880
65094
  // src/tui/App.tsx
64881
65095
  init_claude_settings();
64882
- var import_react48 = __toESM(require_react(), 1);
65096
+ var import_react46 = __toESM(require_react(), 1);
64883
65097
 
64884
65098
  // src/utils/clone-settings.ts
64885
65099
  function cloneSettings(settings) {
@@ -65626,60 +65840,184 @@ var import_react36 = __toESM(require_react(), 1);
65626
65840
 
65627
65841
  // src/tui/components/ConfirmDialog.tsx
65628
65842
  await init_build2();
65843
+
65844
+ // src/tui/components/List.tsx
65845
+ await init_build2();
65629
65846
  var import_react35 = __toESM(require_react(), 1);
65630
65847
  var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
65631
- var ConfirmDialog = ({ message, onConfirm, onCancel, inline = false }) => {
65632
- const [selectedIndex, setSelectedIndex] = import_react35.useState(0);
65633
- use_input_default((input, key) => {
65848
+ function List({
65849
+ items,
65850
+ onSelect,
65851
+ onSelectionChange,
65852
+ initialSelection = 0,
65853
+ showBackButton,
65854
+ color,
65855
+ wrapNavigation = false,
65856
+ ...boxProps
65857
+ }) {
65858
+ const [selectedIndex, setSelectedIndex] = import_react35.useState(initialSelection);
65859
+ const latestOnSelectionChangeRef = import_react35.useRef(onSelectionChange);
65860
+ const _items = import_react35.useMemo(() => {
65861
+ if (showBackButton) {
65862
+ return [...items, "-", { label: "← Back", value: "back" }];
65863
+ }
65864
+ return items;
65865
+ }, [items, showBackButton]);
65866
+ const selectableItems = _items.filter((item) => item !== "-" && !item.disabled);
65867
+ const selectedItem = selectableItems[selectedIndex];
65868
+ const selectedValue = selectedItem?.value;
65869
+ const actualIndex = _items.findIndex((item) => item === selectedItem);
65870
+ import_react35.useEffect(() => {
65871
+ latestOnSelectionChangeRef.current = onSelectionChange;
65872
+ }, [onSelectionChange]);
65873
+ import_react35.useEffect(() => {
65874
+ const maxIndex = Math.max(selectableItems.length - 1, 0);
65875
+ setSelectedIndex(Math.min(initialSelection, maxIndex));
65876
+ }, [initialSelection, selectableItems.length]);
65877
+ import_react35.useEffect(() => {
65878
+ if (selectedValue !== undefined) {
65879
+ latestOnSelectionChangeRef.current?.(selectedValue, selectedIndex);
65880
+ }
65881
+ }, [selectedIndex, selectedValue]);
65882
+ use_input_default((_, key) => {
65634
65883
  if (key.upArrow) {
65635
- setSelectedIndex(Math.max(0, selectedIndex - 1));
65636
- } else if (key.downArrow) {
65637
- setSelectedIndex(Math.min(1, selectedIndex + 1));
65638
- } else if (key.return) {
65639
- if (selectedIndex === 0) {
65640
- onConfirm();
65641
- } else {
65642
- onCancel();
65643
- }
65644
- } else if (key.escape) {
65645
- onCancel();
65884
+ const prev = selectedIndex - 1;
65885
+ const prevIndex = prev < 0 ? wrapNavigation ? selectableItems.length - 1 : 0 : prev;
65886
+ setSelectedIndex(prevIndex);
65887
+ return;
65888
+ }
65889
+ if (key.downArrow) {
65890
+ const next = selectedIndex + 1;
65891
+ const nextIndex = next > selectableItems.length - 1 ? wrapNavigation ? 0 : selectableItems.length - 1 : next;
65892
+ setSelectedIndex(nextIndex);
65893
+ return;
65894
+ }
65895
+ if (key.return && selectedItem) {
65896
+ onSelect(selectedItem.value, selectedIndex);
65897
+ return;
65646
65898
  }
65647
65899
  });
65648
- const renderOptions = () => {
65649
- const yesStyle = selectedIndex === 0 ? { color: "cyan" } : {};
65650
- const noStyle = selectedIndex === 1 ? { color: "cyan" } : {};
65651
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
65652
- flexDirection: "column",
65900
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
65901
+ flexDirection: "column",
65902
+ ...boxProps,
65903
+ children: [
65904
+ _items.map((item, index) => {
65905
+ if (item === "-") {
65906
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ListSeparator, {}, index, false, undefined, this);
65907
+ }
65908
+ const isSelected = index === actualIndex;
65909
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ListItem, {
65910
+ isSelected,
65911
+ color,
65912
+ disabled: item.disabled,
65913
+ ...item.props,
65914
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65915
+ children: [
65916
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65917
+ children: item.label
65918
+ }, undefined, false, undefined, this),
65919
+ item.sublabel && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65920
+ dimColor: !isSelected,
65921
+ children: [
65922
+ " ",
65923
+ item.sublabel
65924
+ ]
65925
+ }, undefined, true, undefined, this)
65926
+ ]
65927
+ }, undefined, true, undefined, this)
65928
+ }, index, false, undefined, this);
65929
+ }),
65930
+ selectedItem?.description && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
65931
+ marginTop: 1,
65932
+ paddingLeft: 2,
65933
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65934
+ dimColor: true,
65935
+ wrap: "wrap",
65936
+ children: selectedItem.description
65937
+ }, undefined, false, undefined, this)
65938
+ }, undefined, false, undefined, this)
65939
+ ]
65940
+ }, undefined, true, undefined, this);
65941
+ }
65942
+ function ListItem({
65943
+ children,
65944
+ isSelected,
65945
+ color = "green",
65946
+ disabled,
65947
+ ...boxProps
65948
+ }) {
65949
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
65950
+ ...boxProps,
65951
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65952
+ color: isSelected ? color : undefined,
65953
+ dimColor: disabled,
65653
65954
  children: [
65654
65955
  /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65655
- ...yesStyle,
65656
- children: [
65657
- selectedIndex === 0 ? "▶ " : " ",
65658
- "Yes"
65659
- ]
65660
- }, undefined, true, undefined, this),
65956
+ children: isSelected ? "▶ " : " "
65957
+ }, undefined, false, undefined, this),
65661
65958
  /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65662
- ...noStyle,
65663
- children: [
65664
- selectedIndex === 1 ? "▶ " : " ",
65665
- "No"
65666
- ]
65667
- }, undefined, true, undefined, this)
65959
+ children
65960
+ }, undefined, false, undefined, this)
65668
65961
  ]
65669
- }, undefined, true, undefined, this);
65670
- };
65962
+ }, undefined, true, undefined, this)
65963
+ }, undefined, false, undefined, this);
65964
+ }
65965
+ function ListSeparator() {
65966
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
65967
+ children: " "
65968
+ }, undefined, false, undefined, this);
65969
+ }
65970
+
65971
+ // src/tui/components/ConfirmDialog.tsx
65972
+ var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
65973
+ var CONFIRM_OPTIONS = [
65974
+ {
65975
+ label: "Yes",
65976
+ value: true
65977
+ },
65978
+ {
65979
+ label: "No",
65980
+ value: false
65981
+ }
65982
+ ];
65983
+ var ConfirmDialog = ({ message, onConfirm, onCancel, inline = false }) => {
65984
+ use_input_default((_, key) => {
65985
+ if (key.escape) {
65986
+ onCancel();
65987
+ }
65988
+ });
65671
65989
  if (inline) {
65672
- return renderOptions();
65990
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(List, {
65991
+ items: CONFIRM_OPTIONS,
65992
+ onSelect: (confirmed) => {
65993
+ if (confirmed) {
65994
+ onConfirm();
65995
+ return;
65996
+ }
65997
+ onCancel();
65998
+ },
65999
+ color: "cyan"
66000
+ }, undefined, false, undefined, this);
65673
66001
  }
65674
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
66002
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
65675
66003
  flexDirection: "column",
65676
66004
  children: [
65677
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
66005
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
65678
66006
  children: message
65679
66007
  }, undefined, false, undefined, this),
65680
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
66008
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
65681
66009
  marginTop: 1,
65682
- children: renderOptions()
66010
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(List, {
66011
+ items: CONFIRM_OPTIONS,
66012
+ onSelect: (confirmed) => {
66013
+ if (confirmed) {
66014
+ onConfirm();
66015
+ return;
66016
+ }
66017
+ onCancel();
66018
+ },
66019
+ color: "cyan"
66020
+ }, undefined, false, undefined, this)
65683
66021
  }, undefined, false, undefined, this)
65684
66022
  ]
65685
66023
  }, undefined, true, undefined, this);
@@ -65792,7 +66130,7 @@ function cycleWidgetColor({
65792
66130
  }
65793
66131
 
65794
66132
  // src/tui/components/ColorMenu.tsx
65795
- var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
66133
+ var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
65796
66134
  var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
65797
66135
  const [showSeparators, setShowSeparators] = import_react36.useState(false);
65798
66136
  const [hexInputMode, setHexInputMode] = import_react36.useState(false);
@@ -65942,30 +66280,30 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
65942
66280
  }
65943
66281
  });
65944
66282
  if (hasNoItems) {
65945
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66283
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
65946
66284
  flexDirection: "column",
65947
66285
  children: [
65948
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66286
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
65949
66287
  bold: true,
65950
66288
  children: [
65951
66289
  "Configure Colors",
65952
66290
  lineIndex !== undefined ? ` - Line ${lineIndex + 1}` : ""
65953
66291
  ]
65954
66292
  }, undefined, true, undefined, this),
65955
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66293
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
65956
66294
  marginTop: 1,
65957
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66295
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
65958
66296
  dimColor: true,
65959
66297
  children: "No colorable widgets in the status line."
65960
66298
  }, undefined, false, undefined, this)
65961
66299
  }, undefined, false, undefined, this),
65962
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66300
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
65963
66301
  dimColor: true,
65964
66302
  children: "Add a widget first to continue."
65965
66303
  }, undefined, false, undefined, this),
65966
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66304
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
65967
66305
  marginTop: 1,
65968
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66306
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
65969
66307
  children: "Press any key to go back..."
65970
66308
  }, undefined, false, undefined, this)
65971
66309
  }, undefined, false, undefined, this)
@@ -66058,36 +66396,36 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
66058
66396
  }
66059
66397
  }
66060
66398
  if (showClearConfirm) {
66061
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66399
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66062
66400
  flexDirection: "column",
66063
66401
  children: [
66064
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66402
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66065
66403
  bold: true,
66066
66404
  color: "yellow",
66067
66405
  children: "⚠ Confirm Clear All Colors"
66068
66406
  }, undefined, false, undefined, this),
66069
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66407
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66070
66408
  marginTop: 1,
66071
66409
  flexDirection: "column",
66072
66410
  children: [
66073
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66411
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66074
66412
  children: "This will reset all colors for all widgets to their defaults."
66075
66413
  }, undefined, false, undefined, this),
66076
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66414
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66077
66415
  color: "red",
66078
66416
  children: "This action cannot be undone!"
66079
66417
  }, undefined, false, undefined, this)
66080
66418
  ]
66081
66419
  }, undefined, true, undefined, this),
66082
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66420
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66083
66421
  marginTop: 2,
66084
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66422
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66085
66423
  children: "Continue?"
66086
66424
  }, undefined, false, undefined, this)
66087
66425
  }, undefined, false, undefined, this),
66088
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66426
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66089
66427
  marginTop: 1,
66090
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ConfirmDialog, {
66428
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ConfirmDialog, {
66091
66429
  inline: true,
66092
66430
  onConfirm: () => {
66093
66431
  const newItems = clearAllWidgetStyling(widgets);
@@ -66105,12 +66443,12 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
66105
66443
  const hasGlobalFgOverride = !!settings.overrideForegroundColor;
66106
66444
  const hasGlobalBgOverride = !!settings.overrideBackgroundColor && !powerlineEnabled;
66107
66445
  const globalOverrideMessage = hasGlobalFgOverride && hasGlobalBgOverride ? "⚠ Global override for FG and BG active" : hasGlobalFgOverride ? "⚠ Global override for FG active" : hasGlobalBgOverride ? "⚠ Global override for BG active" : null;
66108
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66446
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66109
66447
  flexDirection: "column",
66110
66448
  children: [
66111
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66449
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66112
66450
  children: [
66113
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66451
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66114
66452
  bold: true,
66115
66453
  children: [
66116
66454
  "Configure Colors",
@@ -66118,7 +66456,7 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
66118
66456
  editingBackground && source_default.yellow(" [Background Mode]")
66119
66457
  ]
66120
66458
  }, undefined, true, undefined, this),
66121
- globalOverrideMessage && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66459
+ globalOverrideMessage && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66122
66460
  color: "yellow",
66123
66461
  dimColor: true,
66124
66462
  children: [
@@ -66128,56 +66466,56 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
66128
66466
  }, undefined, true, undefined, this)
66129
66467
  ]
66130
66468
  }, undefined, true, undefined, this),
66131
- hexInputMode ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66469
+ hexInputMode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66132
66470
  flexDirection: "column",
66133
66471
  children: [
66134
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66472
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66135
66473
  children: "Enter 6-digit hex color code (without #):"
66136
66474
  }, undefined, false, undefined, this),
66137
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66475
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66138
66476
  children: [
66139
66477
  "#",
66140
66478
  hexInput,
66141
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66479
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66142
66480
  dimColor: true,
66143
66481
  children: hexInput.length < 6 ? "_".repeat(6 - hexInput.length) : ""
66144
66482
  }, undefined, false, undefined, this)
66145
66483
  ]
66146
66484
  }, undefined, true, undefined, this),
66147
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66485
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66148
66486
  children: " "
66149
66487
  }, undefined, false, undefined, this),
66150
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66488
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66151
66489
  dimColor: true,
66152
66490
  children: "Press Enter when done, ESC to cancel"
66153
66491
  }, undefined, false, undefined, this)
66154
66492
  ]
66155
- }, undefined, true, undefined, this) : ansi256InputMode ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66493
+ }, undefined, true, undefined, this) : ansi256InputMode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66156
66494
  flexDirection: "column",
66157
66495
  children: [
66158
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66496
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66159
66497
  children: "Enter ANSI 256 color code (0-255):"
66160
66498
  }, undefined, false, undefined, this),
66161
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66499
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66162
66500
  children: [
66163
66501
  ansi256Input,
66164
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66502
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66165
66503
  dimColor: true,
66166
66504
  children: ansi256Input.length === 0 ? "___" : ansi256Input.length === 1 ? "__" : ansi256Input.length === 2 ? "_" : ""
66167
66505
  }, undefined, false, undefined, this)
66168
66506
  ]
66169
66507
  }, undefined, true, undefined, this),
66170
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66508
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66171
66509
  children: " "
66172
66510
  }, undefined, false, undefined, this),
66173
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66511
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66174
66512
  dimColor: true,
66175
66513
  children: "Press Enter when done, ESC to cancel"
66176
66514
  }, undefined, false, undefined, this)
66177
66515
  ]
66178
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
66516
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
66179
66517
  children: [
66180
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66518
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66181
66519
  dimColor: true,
66182
66520
  children: [
66183
66521
  "↑↓ to select, ←→ to cycle",
@@ -66189,16 +66527,16 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
66189
66527
  "(r)eset, (c)lear all, ESC to go back"
66190
66528
  ]
66191
66529
  }, undefined, true, undefined, this),
66192
- !settings.powerline.enabled && !settings.defaultSeparator && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66530
+ !settings.powerline.enabled && !settings.defaultSeparator && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66193
66531
  dimColor: true,
66194
66532
  children: [
66195
66533
  "(s)how separators:",
66196
66534
  showSeparators ? source_default.green("ON") : source_default.gray("OFF")
66197
66535
  ]
66198
66536
  }, undefined, true, undefined, this),
66199
- selectedWidget ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66537
+ selectedWidget ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66200
66538
  marginTop: 1,
66201
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66539
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66202
66540
  children: [
66203
66541
  "Current",
66204
66542
  " ",
@@ -66212,19 +66550,19 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
66212
66550
  selectedWidget.bold && source_default.bold(" [BOLD]")
66213
66551
  ]
66214
66552
  }, undefined, true, undefined, this)
66215
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66553
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66216
66554
  marginTop: 1,
66217
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66555
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66218
66556
  children: " "
66219
66557
  }, undefined, false, undefined, this)
66220
66558
  }, undefined, false, undefined, this)
66221
66559
  ]
66222
66560
  }, undefined, true, undefined, this),
66223
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66561
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66224
66562
  marginTop: 1,
66225
- children: hexInputMode || ansi256InputMode ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66563
+ children: hexInputMode || ansi256InputMode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66226
66564
  flexDirection: "column",
66227
- children: menuItems.map((item) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66565
+ children: menuItems.map((item) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66228
66566
  color: item.value === highlightedItemId ? "cyan" : "white",
66229
66567
  bold: item.value === highlightedItemId,
66230
66568
  children: [
@@ -66232,28 +66570,28 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
66232
66570
  item.label
66233
66571
  ]
66234
66572
  }, item.value, true, undefined, this))
66235
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(SelectInput_default, {
66573
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(SelectInput_default, {
66236
66574
  items: menuItems,
66237
66575
  onSelect: handleSelect,
66238
66576
  onHighlight: handleHighlight,
66239
66577
  initialIndex: Math.max(0, menuItems.findIndex((item) => item.value === highlightedItemId)),
66240
- indicatorComponent: ({ isSelected }) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66578
+ indicatorComponent: ({ isSelected }) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66241
66579
  children: isSelected ? "▶" : " "
66242
66580
  }, undefined, false, undefined, this),
66243
- itemComponent: ({ isSelected, label }) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66581
+ itemComponent: ({ isSelected, label }) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66244
66582
  children: ` ${label}`
66245
66583
  }, undefined, false, undefined, this)
66246
66584
  }, `${showSeparators}-${highlightedItemId}`, false, undefined, this)
66247
66585
  }, undefined, false, undefined, this),
66248
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66586
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66249
66587
  marginTop: 1,
66250
66588
  flexDirection: "column",
66251
66589
  children: [
66252
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66590
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66253
66591
  color: "yellow",
66254
66592
  children: "⚠ VSCode Users: "
66255
66593
  }, undefined, false, undefined, this),
66256
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66594
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66257
66595
  dimColor: true,
66258
66596
  wrap: "wrap",
66259
66597
  children: 'If colors appear incorrect in the VSCode integrated terminal, the "Terminal › Integrated: Minimum Contrast Ratio" (`terminal.integrated.minimumContrastRatio`) setting is forcing a minimum contrast between foreground and background colors. You can adjust this setting to 1 to disable the contrast enforcement, or use a standalone terminal for accurate colors.'
@@ -66268,7 +66606,7 @@ init_colors();
66268
66606
  init_input_guards();
66269
66607
  await init_build2();
66270
66608
  var import_react37 = __toESM(require_react(), 1);
66271
- var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
66609
+ var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
66272
66610
  var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66273
66611
  const [editingPadding, setEditingPadding] = import_react37.useState(false);
66274
66612
  const [editingSeparator, setEditingSeparator] = import_react37.useState(false);
@@ -66378,95 +66716,95 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66378
66716
  }
66379
66717
  }
66380
66718
  });
66381
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66719
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66382
66720
  flexDirection: "column",
66383
66721
  children: [
66384
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66722
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66385
66723
  bold: true,
66386
66724
  children: "Global Overrides"
66387
66725
  }, undefined, false, undefined, this),
66388
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66726
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66389
66727
  dimColor: true,
66390
66728
  children: "Configure automatic padding and separators between widgets"
66391
66729
  }, undefined, false, undefined, this),
66392
- isPowerlineEnabled && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66730
+ isPowerlineEnabled && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66393
66731
  marginTop: 1,
66394
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66732
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66395
66733
  color: "yellow",
66396
66734
  children: "⚠ Some options are disabled while Powerline mode is active"
66397
66735
  }, undefined, false, undefined, this)
66398
66736
  }, undefined, false, undefined, this),
66399
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66737
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66400
66738
  marginTop: 1
66401
66739
  }, undefined, false, undefined, this),
66402
- editingPadding ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66740
+ editingPadding ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66403
66741
  flexDirection: "column",
66404
66742
  children: [
66405
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66743
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66406
66744
  children: [
66407
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66745
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66408
66746
  children: "Enter default padding (applied to left and right of each widget): "
66409
66747
  }, undefined, false, undefined, this),
66410
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66748
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66411
66749
  color: "cyan",
66412
66750
  children: paddingInput ? `"${paddingInput}"` : "(empty)"
66413
66751
  }, undefined, false, undefined, this)
66414
66752
  ]
66415
66753
  }, undefined, true, undefined, this),
66416
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66754
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66417
66755
  dimColor: true,
66418
66756
  children: "Press Enter to save, ESC to cancel"
66419
66757
  }, undefined, false, undefined, this)
66420
66758
  ]
66421
- }, undefined, true, undefined, this) : editingSeparator ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66759
+ }, undefined, true, undefined, this) : editingSeparator ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66422
66760
  flexDirection: "column",
66423
66761
  children: [
66424
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66762
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66425
66763
  children: [
66426
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66764
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66427
66765
  children: "Enter default separator (placed between widgets): "
66428
66766
  }, undefined, false, undefined, this),
66429
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66767
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66430
66768
  color: "cyan",
66431
66769
  children: separatorInput ? `"${separatorInput}"` : "(empty - no separator will be added)"
66432
66770
  }, undefined, false, undefined, this)
66433
66771
  ]
66434
66772
  }, undefined, true, undefined, this),
66435
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66773
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66436
66774
  dimColor: true,
66437
66775
  children: "Press Enter to save, ESC to cancel"
66438
66776
  }, undefined, false, undefined, this)
66439
66777
  ]
66440
- }, undefined, true, undefined, this) : confirmingSeparator ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66778
+ }, undefined, true, undefined, this) : confirmingSeparator ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66441
66779
  flexDirection: "column",
66442
66780
  children: [
66443
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66781
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66444
66782
  marginBottom: 1,
66445
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66783
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66446
66784
  color: "yellow",
66447
66785
  children: "⚠ Warning: Setting a default separator will remove all existing manual separators from your status lines."
66448
66786
  }, undefined, false, undefined, this)
66449
66787
  }, undefined, false, undefined, this),
66450
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66788
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66451
66789
  children: [
66452
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66790
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66453
66791
  children: "New default separator: "
66454
66792
  }, undefined, false, undefined, this),
66455
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66793
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66456
66794
  color: "cyan",
66457
66795
  children: separatorInput ? `"${separatorInput}"` : "(empty)"
66458
66796
  }, undefined, false, undefined, this)
66459
66797
  ]
66460
66798
  }, undefined, true, undefined, this),
66461
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66799
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66462
66800
  marginTop: 1,
66463
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66801
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66464
66802
  children: "Do you want to continue? "
66465
66803
  }, undefined, false, undefined, this)
66466
66804
  }, undefined, false, undefined, this),
66467
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66805
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66468
66806
  marginTop: 1,
66469
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ConfirmDialog, {
66807
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ConfirmDialog, {
66470
66808
  inline: true,
66471
66809
  onConfirm: () => {
66472
66810
  const updatedSettings = {
@@ -66484,47 +66822,47 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66484
66822
  }, undefined, false, undefined, this)
66485
66823
  }, undefined, false, undefined, this)
66486
66824
  ]
66487
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
66825
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
66488
66826
  children: [
66489
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66827
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66490
66828
  children: [
66491
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66829
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66492
66830
  children: " Global Bold: "
66493
66831
  }, undefined, false, undefined, this),
66494
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66832
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66495
66833
  color: globalBold ? "green" : "red",
66496
66834
  children: globalBold ? "✓ Enabled" : "✗ Disabled"
66497
66835
  }, undefined, false, undefined, this),
66498
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66836
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66499
66837
  dimColor: true,
66500
66838
  children: " - Press (o) to toggle"
66501
66839
  }, undefined, false, undefined, this)
66502
66840
  ]
66503
66841
  }, undefined, true, undefined, this),
66504
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66842
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66505
66843
  children: [
66506
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66844
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66507
66845
  children: " Default Padding: "
66508
66846
  }, undefined, false, undefined, this),
66509
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66847
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66510
66848
  color: "cyan",
66511
66849
  children: settings.defaultPadding ? `"${settings.defaultPadding}"` : "(none)"
66512
66850
  }, undefined, false, undefined, this),
66513
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66851
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66514
66852
  dimColor: true,
66515
66853
  children: " - Press (p) to edit"
66516
66854
  }, undefined, false, undefined, this)
66517
66855
  ]
66518
66856
  }, undefined, true, undefined, this),
66519
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66857
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66520
66858
  children: [
66521
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66859
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66522
66860
  children: "Override FG Color: "
66523
66861
  }, undefined, false, undefined, this),
66524
66862
  (() => {
66525
66863
  const fgColor = settings.overrideForegroundColor ?? "none";
66526
66864
  if (fgColor === "none") {
66527
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66865
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66528
66866
  color: "gray",
66529
66867
  children: "(none)"
66530
66868
  }, undefined, false, undefined, this);
@@ -66532,31 +66870,31 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66532
66870
  const displayName = getColorDisplayName(fgColor);
66533
66871
  const fgChalk = getChalkColor(fgColor, "ansi16", false);
66534
66872
  const display = fgChalk ? fgChalk(displayName) : displayName;
66535
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66873
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66536
66874
  children: display
66537
66875
  }, undefined, false, undefined, this);
66538
66876
  }
66539
66877
  })(),
66540
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66878
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66541
66879
  dimColor: true,
66542
66880
  children: " - (f) cycle, (g) clear"
66543
66881
  }, undefined, false, undefined, this)
66544
66882
  ]
66545
66883
  }, undefined, true, undefined, this),
66546
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66884
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66547
66885
  children: [
66548
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66886
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66549
66887
  children: "Override BG Color: "
66550
66888
  }, undefined, false, undefined, this),
66551
- isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66889
+ isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66552
66890
  dimColor: true,
66553
66891
  children: "[disabled - Powerline active]"
66554
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
66892
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
66555
66893
  children: [
66556
66894
  (() => {
66557
66895
  const bgColor = settings.overrideBackgroundColor ?? "none";
66558
66896
  if (bgColor === "none") {
66559
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66897
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66560
66898
  color: "gray",
66561
66899
  children: "(none)"
66562
66900
  }, undefined, false, undefined, this);
@@ -66564,12 +66902,12 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66564
66902
  const displayName = getColorDisplayName(bgColor);
66565
66903
  const bgChalk = getChalkColor(bgColor, "ansi16", true);
66566
66904
  const display = bgChalk ? bgChalk(` ${displayName} `) : displayName;
66567
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66905
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66568
66906
  children: display
66569
66907
  }, undefined, false, undefined, this);
66570
66908
  }
66571
66909
  })(),
66572
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66910
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66573
66911
  dimColor: true,
66574
66912
  children: " - (b) cycle, (c) clear"
66575
66913
  }, undefined, false, undefined, this)
@@ -66577,21 +66915,21 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66577
66915
  }, undefined, true, undefined, this)
66578
66916
  ]
66579
66917
  }, undefined, true, undefined, this),
66580
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66918
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66581
66919
  children: [
66582
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66920
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66583
66921
  children: " Inherit Colors: "
66584
66922
  }, undefined, false, undefined, this),
66585
- isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66923
+ isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66586
66924
  dimColor: true,
66587
66925
  children: "[disabled - Powerline active]"
66588
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
66926
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
66589
66927
  children: [
66590
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66928
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66591
66929
  color: inheritColors ? "green" : "red",
66592
66930
  children: inheritColors ? "✓ Enabled" : "✗ Disabled"
66593
66931
  }, undefined, false, undefined, this),
66594
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66932
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66595
66933
  dimColor: true,
66596
66934
  children: " - Press (i) to toggle"
66597
66935
  }, undefined, false, undefined, this)
@@ -66599,21 +66937,21 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66599
66937
  }, undefined, true, undefined, this)
66600
66938
  ]
66601
66939
  }, undefined, true, undefined, this),
66602
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66940
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66603
66941
  children: [
66604
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66942
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66605
66943
  children: "Default Separator: "
66606
66944
  }, undefined, false, undefined, this),
66607
- isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66945
+ isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66608
66946
  dimColor: true,
66609
66947
  children: "[disabled - Powerline active]"
66610
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
66948
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
66611
66949
  children: [
66612
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66950
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66613
66951
  color: "cyan",
66614
66952
  children: settings.defaultSeparator ? `"${settings.defaultSeparator}"` : "(none)"
66615
66953
  }, undefined, false, undefined, this),
66616
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66954
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66617
66955
  dimColor: true,
66618
66956
  children: " - Press (s) to edit"
66619
66957
  }, undefined, false, undefined, this)
@@ -66621,33 +66959,33 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66621
66959
  }, undefined, true, undefined, this)
66622
66960
  ]
66623
66961
  }, undefined, true, undefined, this),
66624
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66962
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66625
66963
  marginTop: 2,
66626
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66964
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66627
66965
  dimColor: true,
66628
66966
  children: "Press ESC to go back"
66629
66967
  }, undefined, false, undefined, this)
66630
66968
  }, undefined, false, undefined, this),
66631
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
66969
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66632
66970
  marginTop: 1,
66633
66971
  flexDirection: "column",
66634
66972
  children: [
66635
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66973
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66636
66974
  dimColor: true,
66637
66975
  wrap: "wrap",
66638
66976
  children: "Note: These settings are applied during rendering and don't add widgets to your widget list."
66639
66977
  }, undefined, false, undefined, this),
66640
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66978
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66641
66979
  dimColor: true,
66642
66980
  wrap: "wrap",
66643
66981
  children: "• Inherit colors: Separators will use colors from the preceding widget"
66644
66982
  }, undefined, false, undefined, this),
66645
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66983
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66646
66984
  dimColor: true,
66647
66985
  wrap: "wrap",
66648
66986
  children: "• Global Bold: Makes all text bold regardless of individual settings"
66649
66987
  }, undefined, false, undefined, this),
66650
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
66988
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66651
66989
  dimColor: true,
66652
66990
  wrap: "wrap",
66653
66991
  children: "• Override colors: All widgets will use these colors instead of their configured colors"
@@ -66662,54 +67000,57 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
66662
67000
  // src/tui/components/InstallMenu.tsx
66663
67001
  init_claude_settings();
66664
67002
  await init_build2();
66665
- var import_react38 = __toESM(require_react(), 1);
66666
- var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
67003
+ var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
66667
67004
  var InstallMenu = ({
66668
67005
  bunxAvailable,
66669
67006
  existingStatusLine,
66670
67007
  onSelectNpx,
66671
67008
  onSelectBunx,
66672
- onCancel
67009
+ onCancel,
67010
+ initialSelection = 0
66673
67011
  }) => {
66674
- const [selectedIndex, setSelectedIndex] = import_react38.useState(0);
66675
- const maxIndex = 2;
66676
- use_input_default((input, key) => {
67012
+ use_input_default((_, key) => {
66677
67013
  if (key.escape) {
66678
67014
  onCancel();
66679
- } else if (key.upArrow) {
66680
- if (selectedIndex === 2) {
66681
- setSelectedIndex(bunxAvailable ? 1 : 0);
66682
- } else {
66683
- setSelectedIndex(Math.max(0, selectedIndex - 1));
66684
- }
66685
- } else if (key.downArrow) {
66686
- if (selectedIndex === 0) {
66687
- setSelectedIndex(bunxAvailable ? 1 : 2);
66688
- } else if (selectedIndex === 1 && bunxAvailable) {
66689
- setSelectedIndex(2);
66690
- } else {
66691
- setSelectedIndex(Math.min(maxIndex, selectedIndex + 1));
66692
- }
66693
- } else if (key.return) {
66694
- if (selectedIndex === 0) {
67015
+ }
67016
+ });
67017
+ function onSelect(value) {
67018
+ switch (value) {
67019
+ case "npx":
66695
67020
  onSelectNpx();
66696
- } else if (selectedIndex === 1 && bunxAvailable) {
66697
- onSelectBunx();
66698
- } else if (selectedIndex === 2) {
67021
+ break;
67022
+ case "bunx":
67023
+ if (bunxAvailable) {
67024
+ onSelectBunx();
67025
+ }
67026
+ break;
67027
+ case "back":
66699
67028
  onCancel();
66700
- }
67029
+ break;
66701
67030
  }
66702
- });
66703
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67031
+ }
67032
+ const listItems = [
67033
+ {
67034
+ label: "npx - Node Package Execute",
67035
+ value: "npx"
67036
+ },
67037
+ {
67038
+ label: "bunx - Bun Package Execute",
67039
+ sublabel: bunxAvailable ? undefined : "(not installed)",
67040
+ value: "bunx",
67041
+ disabled: !bunxAvailable
67042
+ }
67043
+ ];
67044
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
66704
67045
  flexDirection: "column",
66705
67046
  children: [
66706
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67047
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
66707
67048
  bold: true,
66708
67049
  children: "Install ccstatusline to Claude Code"
66709
67050
  }, undefined, false, undefined, this),
66710
- existingStatusLine && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67051
+ existingStatusLine && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
66711
67052
  marginBottom: 1,
66712
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67053
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
66713
67054
  color: "yellow",
66714
67055
  children: [
66715
67056
  '⚠ Current status line: "',
@@ -66718,51 +67059,29 @@ var InstallMenu = ({
66718
67059
  ]
66719
67060
  }, undefined, true, undefined, this)
66720
67061
  }, undefined, false, undefined, this),
66721
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66722
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67062
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67063
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
66723
67064
  dimColor: true,
66724
67065
  children: "Select package manager to use:"
66725
67066
  }, undefined, false, undefined, this)
66726
67067
  }, undefined, false, undefined, this),
66727
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67068
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(List, {
67069
+ color: "blue",
66728
67070
  marginTop: 1,
66729
- flexDirection: "column",
66730
- children: [
66731
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66732
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66733
- color: selectedIndex === 0 ? "blue" : undefined,
66734
- children: [
66735
- selectedIndex === 0 ? "▶ " : " ",
66736
- "npx - Node Package Execute"
66737
- ]
66738
- }, undefined, true, undefined, this)
66739
- }, undefined, false, undefined, this),
66740
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66741
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66742
- color: selectedIndex === 1 && bunxAvailable ? "blue" : undefined,
66743
- dimColor: !bunxAvailable,
66744
- children: [
66745
- selectedIndex === 1 && bunxAvailable ? "▶ " : " ",
66746
- "bunx - Bun Package Execute",
66747
- !bunxAvailable && " (not installed)"
66748
- ]
66749
- }, undefined, true, undefined, this)
66750
- }, undefined, false, undefined, this),
66751
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
66752
- marginTop: 1,
66753
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
66754
- color: selectedIndex === 2 ? "blue" : undefined,
66755
- children: [
66756
- selectedIndex === 2 ? "▶ " : " ",
66757
- "← Back"
66758
- ]
66759
- }, undefined, true, undefined, this)
66760
- }, undefined, false, undefined, this)
66761
- ]
66762
- }, undefined, true, undefined, this),
66763
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67071
+ items: listItems,
67072
+ onSelect: (line) => {
67073
+ if (line === "back") {
67074
+ onCancel();
67075
+ return;
67076
+ }
67077
+ onSelect(line);
67078
+ },
67079
+ initialSelection,
67080
+ showBackButton: true
67081
+ }, undefined, false, undefined, this),
67082
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
66764
67083
  marginTop: 2,
66765
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67084
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
66766
67085
  dimColor: true,
66767
67086
  children: [
66768
67087
  "The selected command will be written to",
@@ -66771,9 +67090,9 @@ var InstallMenu = ({
66771
67090
  ]
66772
67091
  }, undefined, true, undefined, this)
66773
67092
  }, undefined, false, undefined, this),
66774
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67093
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
66775
67094
  marginTop: 1,
66776
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67095
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
66777
67096
  dimColor: true,
66778
67097
  children: "Press Enter to select, ESC to cancel"
66779
67098
  }, undefined, false, undefined, this)
@@ -66788,7 +67107,7 @@ await __promiseAll([
66788
67107
  init_build2(),
66789
67108
  init_widgets2()
66790
67109
  ]);
66791
- var import_react39 = __toESM(require_react(), 1);
67110
+ var import_react38 = __toESM(require_react(), 1);
66792
67111
 
66793
67112
  // src/tui/components/items-editor/input-handlers.ts
66794
67113
  await init_widgets2();
@@ -67100,14 +67419,32 @@ function handleNormalInputMode({
67100
67419
  }
67101
67420
  }
67102
67421
 
67422
+ // src/tui/components/items-editor/keybind-visibility.ts
67423
+ function isProgressMode(widget) {
67424
+ const mode = widget.metadata?.display;
67425
+ return mode === "progress" || mode === "progress-short";
67426
+ }
67427
+ function shouldShowCustomKeybind(widget, keybind) {
67428
+ if (keybind.action === "edit-list-limit") {
67429
+ return widget.type === "skills" && widget.metadata?.mode === "list";
67430
+ }
67431
+ if (keybind.action === "toggle-invert") {
67432
+ return isProgressMode(widget);
67433
+ }
67434
+ if (keybind.action === "toggle-compact") {
67435
+ return !isProgressMode(widget);
67436
+ }
67437
+ return true;
67438
+ }
67439
+
67103
67440
  // src/tui/components/ItemsEditor.tsx
67104
- var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
67441
+ var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
67105
67442
  var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67106
- const [selectedIndex, setSelectedIndex] = import_react39.useState(0);
67107
- const [moveMode, setMoveMode] = import_react39.useState(false);
67108
- const [customEditorWidget, setCustomEditorWidget] = import_react39.useState(null);
67109
- const [widgetPicker, setWidgetPicker] = import_react39.useState(null);
67110
- const [showClearConfirm, setShowClearConfirm] = import_react39.useState(false);
67443
+ const [selectedIndex, setSelectedIndex] = import_react38.useState(0);
67444
+ const [moveMode, setMoveMode] = import_react38.useState(false);
67445
+ const [customEditorWidget, setCustomEditorWidget] = import_react38.useState(null);
67446
+ const [widgetPicker, setWidgetPicker] = import_react38.useState(null);
67447
+ const [showClearConfirm, setShowClearConfirm] = import_react38.useState(false);
67111
67448
  const separatorChars = ["|", "-", ",", " "];
67112
67449
  const widgetCatalog = getWidgetCatalog(settings);
67113
67450
  const widgetCategories = ["All", ...getWidgetCatalogCategories(widgetCatalog)];
@@ -67136,16 +67473,6 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67136
67473
  const handleEditorCancel = () => {
67137
67474
  setCustomEditorWidget(null);
67138
67475
  };
67139
- const shouldShowCustomKeybind = (widget, keybind) => {
67140
- if (keybind.action !== "toggle-invert") {
67141
- if (keybind.action === "edit-list-limit") {
67142
- return widget.type === "skills" && widget.metadata?.mode === "list";
67143
- }
67144
- return true;
67145
- }
67146
- const mode = widget.metadata?.display;
67147
- return mode === "progress" || mode === "progress-short";
67148
- };
67149
67476
  const getVisibleCustomKeybinds = (widgetImpl, widget) => {
67150
67477
  if (!widgetImpl.getCustomKeybinds) {
67151
67478
  return [];
@@ -67304,19 +67631,19 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67304
67631
  });
67305
67632
  }
67306
67633
  if (showClearConfirm) {
67307
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67634
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67308
67635
  flexDirection: "column",
67309
67636
  children: [
67310
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67637
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67311
67638
  bold: true,
67312
67639
  color: "yellow",
67313
67640
  children: "⚠ Confirm Clear Line"
67314
67641
  }, undefined, false, undefined, this),
67315
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67642
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67316
67643
  marginTop: 1,
67317
67644
  flexDirection: "column",
67318
67645
  children: [
67319
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67646
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67320
67647
  children: [
67321
67648
  "This will remove all widgets from Line",
67322
67649
  " ",
@@ -67324,21 +67651,21 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67324
67651
  "."
67325
67652
  ]
67326
67653
  }, undefined, true, undefined, this),
67327
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67654
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67328
67655
  color: "red",
67329
67656
  children: "This action cannot be undone!"
67330
67657
  }, undefined, false, undefined, this)
67331
67658
  ]
67332
67659
  }, undefined, true, undefined, this),
67333
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67660
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67334
67661
  marginTop: 2,
67335
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67662
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67336
67663
  children: "Continue?"
67337
67664
  }, undefined, false, undefined, this)
67338
67665
  }, undefined, false, undefined, this),
67339
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67666
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67340
67667
  marginTop: 1,
67341
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ConfirmDialog, {
67668
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ConfirmDialog, {
67342
67669
  inline: true,
67343
67670
  onConfirm: () => {
67344
67671
  onUpdate([]);
@@ -67353,12 +67680,12 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67353
67680
  ]
67354
67681
  }, undefined, true, undefined, this);
67355
67682
  }
67356
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67683
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67357
67684
  flexDirection: "column",
67358
67685
  children: [
67359
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67686
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67360
67687
  children: [
67361
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67688
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67362
67689
  bold: true,
67363
67690
  children: [
67364
67691
  "Edit Line",
@@ -67367,17 +67694,17 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67367
67694
  " "
67368
67695
  ]
67369
67696
  }, undefined, true, undefined, this),
67370
- moveMode && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67697
+ moveMode && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67371
67698
  color: "blue",
67372
67699
  children: "[MOVE MODE]"
67373
67700
  }, undefined, false, undefined, this),
67374
- widgetPicker && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67701
+ widgetPicker && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67375
67702
  color: "cyan",
67376
67703
  children: `[${pickerActionLabel.toUpperCase()}]`
67377
67704
  }, undefined, false, undefined, this),
67378
- (settings.powerline.enabled || Boolean(settings.defaultSeparator)) && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67705
+ (settings.powerline.enabled || Boolean(settings.defaultSeparator)) && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67379
67706
  marginLeft: 2,
67380
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67707
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67381
67708
  color: "yellow",
67382
67709
  children: [
67383
67710
  "⚠",
@@ -67388,46 +67715,46 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67388
67715
  }, undefined, false, undefined, this)
67389
67716
  ]
67390
67717
  }, undefined, true, undefined, this),
67391
- moveMode ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67718
+ moveMode ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67392
67719
  flexDirection: "column",
67393
67720
  marginBottom: 1,
67394
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67721
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67395
67722
  dimColor: true,
67396
67723
  children: "↑↓ to move widget, ESC or Enter to exit move mode"
67397
67724
  }, undefined, false, undefined, this)
67398
- }, undefined, false, undefined, this) : widgetPicker ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67725
+ }, undefined, false, undefined, this) : widgetPicker ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67399
67726
  flexDirection: "column",
67400
- children: widgetPicker.level === "category" ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67727
+ children: widgetPicker.level === "category" ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
67401
67728
  children: [
67402
- widgetPicker.categoryQuery.trim().length > 0 ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67729
+ widgetPicker.categoryQuery.trim().length > 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67403
67730
  dimColor: true,
67404
67731
  children: "↑↓ select widget match, Enter apply, ESC clear/cancel"
67405
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67732
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67406
67733
  dimColor: true,
67407
67734
  children: "↑↓ select category, type to search all widgets, Enter continue, ESC cancel"
67408
67735
  }, undefined, false, undefined, this),
67409
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67736
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67410
67737
  children: [
67411
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67738
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67412
67739
  dimColor: true,
67413
67740
  children: "Search: "
67414
67741
  }, undefined, false, undefined, this),
67415
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67742
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67416
67743
  color: "cyan",
67417
67744
  children: widgetPicker.categoryQuery || "(none)"
67418
67745
  }, undefined, false, undefined, this)
67419
67746
  ]
67420
67747
  }, undefined, true, undefined, this)
67421
67748
  ]
67422
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67749
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
67423
67750
  children: [
67424
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67751
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67425
67752
  dimColor: true,
67426
67753
  children: "↑↓ select widget, type to search widgets, Enter apply, ESC back"
67427
67754
  }, undefined, false, undefined, this),
67428
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67755
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67429
67756
  children: [
67430
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67757
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67431
67758
  dimColor: true,
67432
67759
  children: [
67433
67760
  "Category:",
@@ -67438,7 +67765,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67438
67765
  " "
67439
67766
  ]
67440
67767
  }, undefined, true, undefined, this),
67441
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67768
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67442
67769
  color: "cyan",
67443
67770
  children: widgetPicker.widgetQuery || "(none)"
67444
67771
  }, undefined, false, undefined, this)
@@ -67446,132 +67773,132 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67446
67773
  }, undefined, true, undefined, this)
67447
67774
  ]
67448
67775
  }, undefined, true, undefined, this)
67449
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67776
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67450
67777
  flexDirection: "column",
67451
67778
  children: [
67452
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67779
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67453
67780
  dimColor: true,
67454
67781
  children: helpText
67455
67782
  }, undefined, false, undefined, this),
67456
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67783
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67457
67784
  dimColor: true,
67458
67785
  children: customKeybindsText || " "
67459
67786
  }, undefined, false, undefined, this)
67460
67787
  ]
67461
67788
  }, undefined, true, undefined, this),
67462
- hasFlexSeparator && !widthDetectionAvailable && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67789
+ hasFlexSeparator && !widthDetectionAvailable && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67463
67790
  marginTop: 1,
67464
67791
  children: [
67465
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67792
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67466
67793
  color: "yellow",
67467
67794
  children: "⚠ Note: Terminal width detection is currently unavailable in your environment."
67468
67795
  }, undefined, false, undefined, this),
67469
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67796
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67470
67797
  dimColor: true,
67471
67798
  children: " Flex separators will act as normal separators until width detection is available."
67472
67799
  }, undefined, false, undefined, this)
67473
67800
  ]
67474
67801
  }, undefined, true, undefined, this),
67475
- widgetPicker && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67802
+ widgetPicker && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67476
67803
  marginTop: 1,
67477
67804
  flexDirection: "column",
67478
- children: widgetPicker.level === "category" ? widgetPicker.categoryQuery.trim().length > 0 ? topLevelSearchEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67805
+ children: widgetPicker.level === "category" ? widgetPicker.categoryQuery.trim().length > 0 ? topLevelSearchEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67479
67806
  dimColor: true,
67480
67807
  children: "No widgets match the search."
67481
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67808
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
67482
67809
  children: [
67483
67810
  topLevelSearchEntries.map((entry, index) => {
67484
67811
  const isSelected = entry.type === selectedTopLevelSearchEntry?.type;
67485
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67812
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67486
67813
  flexDirection: "row",
67487
67814
  flexWrap: "nowrap",
67488
67815
  children: [
67489
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67816
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67490
67817
  width: 3,
67491
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67818
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67492
67819
  color: isSelected ? "green" : undefined,
67493
67820
  children: isSelected ? "▶ " : " "
67494
67821
  }, undefined, false, undefined, this)
67495
67822
  }, undefined, false, undefined, this),
67496
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67823
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67497
67824
  color: isSelected ? "green" : undefined,
67498
67825
  children: `${index + 1}. ${entry.displayName}`
67499
67826
  }, undefined, false, undefined, this)
67500
67827
  ]
67501
67828
  }, entry.type, true, undefined, this);
67502
67829
  }),
67503
- selectedTopLevelSearchEntry && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67830
+ selectedTopLevelSearchEntry && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67504
67831
  marginTop: 1,
67505
67832
  paddingLeft: 2,
67506
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67833
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67507
67834
  dimColor: true,
67508
67835
  children: selectedTopLevelSearchEntry.description
67509
67836
  }, undefined, false, undefined, this)
67510
67837
  }, undefined, false, undefined, this)
67511
67838
  ]
67512
- }, undefined, true, undefined, this) : pickerCategories.length === 0 ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67839
+ }, undefined, true, undefined, this) : pickerCategories.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67513
67840
  dimColor: true,
67514
67841
  children: "No categories available."
67515
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67842
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
67516
67843
  children: [
67517
67844
  pickerCategories.map((category, index) => {
67518
67845
  const isSelected = category === selectedPickerCategory;
67519
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67846
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67520
67847
  flexDirection: "row",
67521
67848
  flexWrap: "nowrap",
67522
67849
  children: [
67523
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67850
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67524
67851
  width: 3,
67525
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67852
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67526
67853
  color: isSelected ? "green" : undefined,
67527
67854
  children: isSelected ? "▶ " : " "
67528
67855
  }, undefined, false, undefined, this)
67529
67856
  }, undefined, false, undefined, this),
67530
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67857
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67531
67858
  color: isSelected ? "green" : undefined,
67532
67859
  children: `${index + 1}. ${category}`
67533
67860
  }, undefined, false, undefined, this)
67534
67861
  ]
67535
67862
  }, category, true, undefined, this);
67536
67863
  }),
67537
- selectedPickerCategory === "All" && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67864
+ selectedPickerCategory === "All" && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67538
67865
  marginTop: 1,
67539
67866
  paddingLeft: 2,
67540
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67867
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67541
67868
  dimColor: true,
67542
67869
  children: "Search across all widget categories."
67543
67870
  }, undefined, false, undefined, this)
67544
67871
  }, undefined, false, undefined, this)
67545
67872
  ]
67546
- }, undefined, true, undefined, this) : pickerEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67873
+ }, undefined, true, undefined, this) : pickerEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67547
67874
  dimColor: true,
67548
67875
  children: "No widgets match the current category/search."
67549
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67876
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
67550
67877
  children: [
67551
67878
  pickerEntries.map((entry, index) => {
67552
67879
  const isSelected = entry.type === selectedPickerEntry?.type;
67553
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67880
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67554
67881
  flexDirection: "row",
67555
67882
  flexWrap: "nowrap",
67556
67883
  children: [
67557
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67884
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67558
67885
  width: 3,
67559
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67886
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67560
67887
  color: isSelected ? "green" : undefined,
67561
67888
  children: isSelected ? "▶ " : " "
67562
67889
  }, undefined, false, undefined, this)
67563
67890
  }, undefined, false, undefined, this),
67564
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67891
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67565
67892
  color: isSelected ? "green" : undefined,
67566
67893
  children: `${index + 1}. ${entry.displayName}`
67567
67894
  }, undefined, false, undefined, this)
67568
67895
  ]
67569
67896
  }, entry.type, true, undefined, this);
67570
67897
  }),
67571
- selectedPickerEntry && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67898
+ selectedPickerEntry && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67572
67899
  marginTop: 1,
67573
67900
  paddingLeft: 2,
67574
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67901
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67575
67902
  dimColor: true,
67576
67903
  children: selectedPickerEntry.description
67577
67904
  }, undefined, false, undefined, this)
@@ -67579,60 +67906,60 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67579
67906
  ]
67580
67907
  }, undefined, true, undefined, this)
67581
67908
  }, undefined, false, undefined, this),
67582
- !widgetPicker && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67909
+ !widgetPicker && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67583
67910
  marginTop: 1,
67584
67911
  flexDirection: "column",
67585
- children: widgets.length === 0 ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67912
+ children: widgets.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67586
67913
  dimColor: true,
67587
67914
  children: "No widgets. Press 'a' to add one."
67588
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67915
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
67589
67916
  children: [
67590
67917
  widgets.map((widget, index) => {
67591
67918
  const isSelected = index === selectedIndex;
67592
67919
  const widgetImpl = widget.type !== "separator" && widget.type !== "flex-separator" ? getWidget(widget.type) : null;
67593
67920
  const { displayText, modifierText } = widgetImpl?.getEditorDisplay(widget) ?? { displayText: getWidgetDisplay(widget) };
67594
67921
  const supportsRawValue = widgetImpl?.supportsRawValue() ?? false;
67595
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67922
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67596
67923
  flexDirection: "row",
67597
67924
  flexWrap: "nowrap",
67598
67925
  children: [
67599
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67926
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67600
67927
  width: 3,
67601
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67928
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67602
67929
  color: isSelected ? moveMode ? "blue" : "green" : undefined,
67603
67930
  children: isSelected ? moveMode ? "◆ " : "▶ " : " "
67604
67931
  }, undefined, false, undefined, this)
67605
67932
  }, undefined, false, undefined, this),
67606
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67933
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67607
67934
  color: isSelected ? moveMode ? "blue" : "green" : undefined,
67608
67935
  children: `${index + 1}. ${displayText || getWidgetDisplay(widget)}`
67609
67936
  }, undefined, false, undefined, this),
67610
- modifierText && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67937
+ modifierText && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67611
67938
  dimColor: true,
67612
67939
  children: [
67613
67940
  " ",
67614
67941
  modifierText
67615
67942
  ]
67616
67943
  }, undefined, true, undefined, this),
67617
- supportsRawValue && widget.rawValue && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67944
+ supportsRawValue && widget.rawValue && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67618
67945
  dimColor: true,
67619
67946
  children: " (raw value)"
67620
67947
  }, undefined, false, undefined, this),
67621
- widget.merge === true && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67948
+ widget.merge === true && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67622
67949
  dimColor: true,
67623
67950
  children: " (merged→)"
67624
67951
  }, undefined, false, undefined, this),
67625
- widget.merge === "no-padding" && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67952
+ widget.merge === "no-padding" && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67626
67953
  dimColor: true,
67627
67954
  children: " (merged-no-pad→)"
67628
67955
  }, undefined, false, undefined, this)
67629
67956
  ]
67630
67957
  }, widget.id, true, undefined, this);
67631
67958
  }),
67632
- currentWidget && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67959
+ currentWidget && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67633
67960
  marginTop: 1,
67634
67961
  paddingLeft: 2,
67635
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67962
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67636
67963
  dimColor: true,
67637
67964
  children: (() => {
67638
67965
  if (currentWidget.type === "separator") {
@@ -67655,8 +67982,8 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
67655
67982
  // src/tui/components/LineSelector.tsx
67656
67983
  await init_build2();
67657
67984
  var import_pluralize = __toESM(require_pluralize(), 1);
67658
- var import_react40 = __toESM(require_react(), 1);
67659
- var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
67985
+ var import_react39 = __toESM(require_react(), 1);
67986
+ var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
67660
67987
  var LineSelector = ({
67661
67988
  lines,
67662
67989
  onSelect,
@@ -67668,14 +67995,17 @@ var LineSelector = ({
67668
67995
  settings,
67669
67996
  allowEditing = false
67670
67997
  }) => {
67671
- const [selectedIndex, setSelectedIndex] = import_react40.useState(initialSelection);
67672
- const [showDeleteDialog, setShowDeleteDialog] = import_react40.useState(false);
67673
- const [moveMode, setMoveMode] = import_react40.useState(false);
67674
- const [localLines, setLocalLines] = import_react40.useState(lines);
67675
- import_react40.useEffect(() => {
67998
+ const [selectedIndex, setSelectedIndex] = import_react39.useState(initialSelection);
67999
+ const [showDeleteDialog, setShowDeleteDialog] = import_react39.useState(false);
68000
+ const [moveMode, setMoveMode] = import_react39.useState(false);
68001
+ const [localLines, setLocalLines] = import_react39.useState(lines);
68002
+ import_react39.useEffect(() => {
67676
68003
  setLocalLines(lines);
67677
68004
  }, [lines]);
67678
- const selectedLine = import_react40.useMemo(() => localLines[selectedIndex], [localLines, selectedIndex]);
68005
+ import_react39.useEffect(() => {
68006
+ setSelectedIndex(initialSelection);
68007
+ }, [initialSelection]);
68008
+ const selectedLine = import_react39.useMemo(() => localLines[selectedIndex], [localLines, selectedIndex]);
67679
68009
  const appendLine = () => {
67680
68010
  const newLines = [...localLines, []];
67681
68011
  setLocalLines(newLines);
@@ -67735,7 +68065,7 @@ var LineSelector = ({
67735
68065
  }
67736
68066
  return;
67737
68067
  case "d":
67738
- if (allowEditing && localLines.length > 1) {
68068
+ if (allowEditing && localLines.length > 1 && selectedIndex < localLines.length) {
67739
68069
  setShowDeleteDialog(true);
67740
68070
  }
67741
68071
  return;
@@ -67747,29 +68077,19 @@ var LineSelector = ({
67747
68077
  }
67748
68078
  if (key.escape) {
67749
68079
  onBack();
67750
- } else if (key.upArrow) {
67751
- setSelectedIndex(Math.max(0, selectedIndex - 1));
67752
- } else if (key.downArrow) {
67753
- setSelectedIndex(Math.min(localLines.length, selectedIndex + 1));
67754
- } else if (key.return) {
67755
- if (selectedIndex === localLines.length) {
67756
- onBack();
67757
- } else {
67758
- onSelect(selectedIndex);
67759
- }
67760
68080
  }
67761
68081
  });
67762
68082
  if (isThemeManaged) {
67763
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68083
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67764
68084
  flexDirection: "column",
67765
68085
  children: [
67766
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68086
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67767
68087
  bold: true,
67768
68088
  children: title ?? "Select Line"
67769
68089
  }, undefined, false, undefined, this),
67770
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68090
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67771
68091
  marginTop: 1,
67772
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68092
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67773
68093
  color: "yellow",
67774
68094
  children: [
67775
68095
  "⚠ Colors are currently managed by the Powerline theme:",
@@ -67777,30 +68097,30 @@ var LineSelector = ({
67777
68097
  ]
67778
68098
  }, undefined, true, undefined, this)
67779
68099
  }, undefined, false, undefined, this),
67780
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68100
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67781
68101
  marginTop: 1,
67782
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68102
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67783
68103
  dimColor: true,
67784
68104
  children: "To customize colors, either:"
67785
68105
  }, undefined, false, undefined, this)
67786
68106
  }, undefined, false, undefined, this),
67787
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68107
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67788
68108
  marginLeft: 2,
67789
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68109
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67790
68110
  dimColor: true,
67791
68111
  children: "• Change to 'Custom' theme in Powerline Configuration → Themes"
67792
68112
  }, undefined, false, undefined, this)
67793
68113
  }, undefined, false, undefined, this),
67794
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68114
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67795
68115
  marginLeft: 2,
67796
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68116
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67797
68117
  dimColor: true,
67798
68118
  children: "• Disable Powerline mode in Powerline Configuration"
67799
68119
  }, undefined, false, undefined, this)
67800
68120
  }, undefined, false, undefined, this),
67801
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68121
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67802
68122
  marginTop: 2,
67803
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68123
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67804
68124
  children: "Press any key to go back..."
67805
68125
  }, undefined, false, undefined, this)
67806
68126
  }, undefined, false, undefined, this)
@@ -67809,26 +68129,25 @@ var LineSelector = ({
67809
68129
  }
67810
68130
  if (showDeleteDialog && selectedLine) {
67811
68131
  const suffix = selectedLine.length > 0 ? import_pluralize.default("widget", selectedLine.length, true) : "empty";
67812
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68132
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67813
68133
  flexDirection: "column",
67814
68134
  children: [
67815
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68135
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67816
68136
  flexDirection: "column",
67817
68137
  gap: 1,
67818
68138
  children: [
67819
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68139
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67820
68140
  bold: true,
67821
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68141
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67822
68142
  children: [
67823
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68143
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67824
68144
  children: [
67825
68145
  "☰ Line",
67826
- " ",
67827
68146
  selectedIndex + 1
67828
68147
  ]
67829
68148
  }, undefined, true, undefined, this),
67830
68149
  " ",
67831
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68150
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67832
68151
  dimColor: true,
67833
68152
  children: [
67834
68153
  "(",
@@ -67839,15 +68158,15 @@ var LineSelector = ({
67839
68158
  ]
67840
68159
  }, undefined, true, undefined, this)
67841
68160
  }, undefined, false, undefined, this),
67842
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68161
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67843
68162
  bold: true,
67844
68163
  children: "Are you sure you want to delete line?"
67845
68164
  }, undefined, false, undefined, this)
67846
68165
  ]
67847
68166
  }, undefined, true, undefined, this),
67848
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68167
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67849
68168
  marginTop: 1,
67850
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ConfirmDialog, {
68169
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ConfirmDialog, {
67851
68170
  inline: true,
67852
68171
  onConfirm: () => {
67853
68172
  deleteLine(selectedIndex);
@@ -67862,190 +68181,201 @@ var LineSelector = ({
67862
68181
  ]
67863
68182
  }, undefined, true, undefined, this);
67864
68183
  }
67865
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
67866
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68184
+ const lineItems = localLines.map((line, index) => ({
68185
+ label: `☰ Line ${index + 1}`,
68186
+ sublabel: `(${line.length > 0 ? import_pluralize.default("widget", line.length, true) : "empty"})`,
68187
+ value: index
68188
+ }));
68189
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
68190
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67867
68191
  flexDirection: "column",
67868
68192
  children: [
67869
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68193
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67870
68194
  children: [
67871
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68195
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67872
68196
  bold: true,
67873
68197
  children: [
67874
68198
  title ?? "Select Line to Edit",
67875
68199
  " "
67876
68200
  ]
67877
68201
  }, undefined, true, undefined, this),
67878
- moveMode && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68202
+ moveMode && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67879
68203
  color: "blue",
67880
68204
  children: "[MOVE MODE]"
67881
68205
  }, undefined, false, undefined, this)
67882
68206
  ]
67883
68207
  }, undefined, true, undefined, this),
67884
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68208
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67885
68209
  dimColor: true,
67886
68210
  children: "Choose which status line to configure"
67887
68211
  }, undefined, false, undefined, this),
67888
- moveMode ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68212
+ moveMode ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67889
68213
  dimColor: true,
67890
68214
  children: "↑↓ to move line, ESC or Enter to exit move mode"
67891
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68215
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
67892
68216
  dimColor: true,
67893
68217
  children: allowEditing ? localLines.length > 1 ? "(a) to append new line, (d) to delete line, (m) to move line, ESC to go back" : "(a) to append new line, ESC to go back" : "ESC to go back"
67894
68218
  }, undefined, false, undefined, this),
67895
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68219
+ moveMode ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
67896
68220
  marginTop: 1,
67897
68221
  flexDirection: "column",
67898
- children: [
67899
- localLines.map((line, index) => {
67900
- const isSelected = selectedIndex === index;
67901
- const suffix = line.length ? import_pluralize.default("widget", line.length, true) : "empty";
67902
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67903
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67904
- color: isSelected ? moveMode ? "blue" : "green" : undefined,
67905
- children: [
67906
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67907
- children: isSelected ? moveMode ? "◆ " : "▶ " : " "
67908
- }, undefined, false, undefined, this),
67909
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67910
- children: [
67911
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67912
- children: [
67913
- "☰ Line",
67914
- " ",
67915
- index + 1
67916
- ]
67917
- }, undefined, true, undefined, this),
67918
- " ",
67919
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67920
- dimColor: !isSelected,
67921
- children: [
67922
- "(",
67923
- suffix,
67924
- ")"
67925
- ]
67926
- }, undefined, true, undefined, this)
67927
- ]
67928
- }, undefined, true, undefined, this)
67929
- ]
67930
- }, undefined, true, undefined, this)
67931
- }, index, false, undefined, this);
67932
- }),
67933
- !moveMode && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
67934
- marginTop: 1,
67935
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
67936
- color: selectedIndex === localLines.length ? "green" : undefined,
68222
+ children: localLines.map((line, index) => {
68223
+ const isSelected = selectedIndex === index;
68224
+ const suffix = line.length ? import_pluralize.default("widget", line.length, true) : "empty";
68225
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68226
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68227
+ color: isSelected ? "blue" : undefined,
67937
68228
  children: [
67938
- selectedIndex === localLines.length ? "▶ " : " ",
67939
- " Back"
68229
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68230
+ children: isSelected ? "◆ " : " "
68231
+ }, undefined, false, undefined, this),
68232
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68233
+ children: [
68234
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68235
+ children: [
68236
+ "☰ Line",
68237
+ " ",
68238
+ index + 1
68239
+ ]
68240
+ }, undefined, true, undefined, this),
68241
+ " ",
68242
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68243
+ dimColor: !isSelected,
68244
+ children: [
68245
+ "(",
68246
+ suffix,
68247
+ ")"
68248
+ ]
68249
+ }, undefined, true, undefined, this)
68250
+ ]
68251
+ }, undefined, true, undefined, this)
67940
68252
  ]
67941
68253
  }, undefined, true, undefined, this)
67942
- }, undefined, false, undefined, this)
67943
- ]
67944
- }, undefined, true, undefined, this)
68254
+ }, index, false, undefined, this);
68255
+ })
68256
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(List, {
68257
+ marginTop: 1,
68258
+ items: lineItems,
68259
+ onSelect: (line) => {
68260
+ if (line === "back") {
68261
+ onBack();
68262
+ return;
68263
+ }
68264
+ onSelect(line);
68265
+ },
68266
+ onSelectionChange: (_, index) => {
68267
+ setSelectedIndex(index);
68268
+ },
68269
+ initialSelection: selectedIndex,
68270
+ showBackButton: true
68271
+ }, undefined, false, undefined, this)
67945
68272
  ]
67946
68273
  }, undefined, true, undefined, this)
67947
68274
  }, undefined, false, undefined, this);
67948
68275
  };
67949
68276
  // src/tui/components/MainMenu.tsx
67950
68277
  await init_build2();
67951
- var import_react41 = __toESM(require_react(), 1);
67952
- var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
67953
- var MainMenu = ({ onSelect, isClaudeInstalled, hasChanges, initialSelection = 0, powerlineFontStatus, settings, previewIsTruncated }) => {
67954
- const [selectedIndex, setSelectedIndex] = import_react41.useState(initialSelection);
68278
+ var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
68279
+ var MainMenu = ({
68280
+ onSelect,
68281
+ isClaudeInstalled,
68282
+ hasChanges,
68283
+ initialSelection = 0,
68284
+ powerlineFontStatus,
68285
+ settings,
68286
+ previewIsTruncated
68287
+ }) => {
67955
68288
  const menuItems = [
67956
- { label: "\uD83D\uDCDD Edit Lines", value: "lines", selectable: true },
67957
- { label: "\uD83C\uDFA8 Edit Colors", value: "colors", selectable: true },
67958
- { label: "⚡ Powerline Setup", value: "powerline", selectable: true },
67959
- { label: "", value: "_gap1", selectable: false },
67960
- { label: "\uD83D\uDCBB Terminal Options", value: "terminalConfig", selectable: true },
67961
- { label: "\uD83C\uDF10 Global Overrides", value: "globalOverrides", selectable: true },
67962
- { label: "", value: "_gap2", selectable: false },
67963
- { label: isClaudeInstalled ? "\uD83D\uDD0C Uninstall from Claude Code" : "\uD83D\uDCE6 Install to Claude Code", value: "install", selectable: true }
68289
+ {
68290
+ label: "\uD83D\uDCDD Edit Lines",
68291
+ value: "lines",
68292
+ description: "Configure any number of status lines with various widgets like model info, git status, and token usage"
68293
+ },
68294
+ {
68295
+ label: "\uD83C\uDFA8 Edit Colors",
68296
+ value: "colors",
68297
+ description: "Customize colors for each widget including foreground, background, and bold styling"
68298
+ },
68299
+ {
68300
+ label: "⚡ Powerline Setup",
68301
+ value: "powerline",
68302
+ description: "Install Powerline fonts for enhanced visual separators and symbols in your status line"
68303
+ },
68304
+ "-",
68305
+ {
68306
+ label: "\uD83D\uDCBB Terminal Options",
68307
+ value: "terminalConfig",
68308
+ description: "Configure terminal-specific settings for optimal display"
68309
+ },
68310
+ {
68311
+ label: "\uD83C\uDF10 Global Overrides",
68312
+ value: "globalOverrides",
68313
+ description: "Set global padding, separators, and color overrides that apply to all widgets"
68314
+ },
68315
+ "-",
68316
+ {
68317
+ label: isClaudeInstalled ? "\uD83D\uDD0C Uninstall from Claude Code" : "\uD83D\uDCE6 Install to Claude Code",
68318
+ value: "install",
68319
+ description: isClaudeInstalled ? "Remove ccstatusline from your Claude Code settings" : "Add ccstatusline to your Claude Code settings for automatic status line rendering"
68320
+ }
67964
68321
  ];
67965
68322
  if (hasChanges) {
67966
- menuItems.push({ label: "\uD83D\uDCBE Save & Exit", value: "save", selectable: true }, { label: "❌ Exit without saving", value: "exit", selectable: true }, { label: "", value: "_gap3", selectable: false }, { label: "⭐ Like ccstatusline? Star us on GitHub", value: "starGithub", selectable: true });
68323
+ menuItems.push({
68324
+ label: "\uD83D\uDCBE Save & Exit",
68325
+ value: "save",
68326
+ description: "Save all changes and exit the configuration tool"
68327
+ }, {
68328
+ label: "❌ Exit without saving",
68329
+ value: "exit",
68330
+ description: "Exit without saving your changes"
68331
+ }, "-", {
68332
+ label: "⭐ Like ccstatusline? Star us on GitHub",
68333
+ value: "starGithub",
68334
+ description: "Open the ccstatusline GitHub repository in your browser so you can star the project"
68335
+ });
67967
68336
  } else {
67968
- menuItems.push({ label: "\uD83D\uDEAA Exit", value: "exit", selectable: true }, { label: "", value: "_gap3", selectable: false }, { label: "⭐ Like ccstatusline? Star us on GitHub", value: "starGithub", selectable: true });
68337
+ menuItems.push({
68338
+ label: "\uD83D\uDEAA Exit",
68339
+ value: "exit",
68340
+ description: "Exit the configuration tool"
68341
+ }, "-", {
68342
+ label: "⭐ Like ccstatusline? Star us on GitHub",
68343
+ value: "starGithub",
68344
+ description: "Open the ccstatusline GitHub repository in your browser so you can star the project"
68345
+ });
67969
68346
  }
67970
- const selectableItems = menuItems.filter((item) => item.selectable);
67971
- use_input_default((input, key) => {
67972
- if (key.upArrow) {
67973
- setSelectedIndex(Math.max(0, selectedIndex - 1));
67974
- } else if (key.downArrow) {
67975
- setSelectedIndex(Math.min(selectableItems.length - 1, selectedIndex + 1));
67976
- } else if (key.return) {
67977
- const item = selectableItems[selectedIndex];
67978
- if (item) {
67979
- onSelect(item.value);
67980
- }
67981
- }
67982
- });
67983
- const getDescription = (value) => {
67984
- const descriptions = {
67985
- lines: "Configure any number of status lines with various widgets like model info, git status, and token usage",
67986
- colors: "Customize colors for each widget including foreground, background, and bold styling",
67987
- powerline: "Install Powerline fonts for enhanced visual separators and symbols in your status line",
67988
- globalOverrides: "Set global padding, separators, and color overrides that apply to all widgets",
67989
- install: isClaudeInstalled ? "Remove ccstatusline from your Claude Code settings" : "Add ccstatusline to your Claude Code settings for automatic status line rendering",
67990
- terminalConfig: "Configure terminal-specific settings for optimal display",
67991
- starGithub: "Open the ccstatusline GitHub repository in your browser so you can star the project",
67992
- save: "Save all changes and exit the configuration tool",
67993
- exit: hasChanges ? "Exit without saving your changes" : "Exit the configuration tool"
67994
- };
67995
- return descriptions[value] ?? "";
67996
- };
67997
- const selectedItem = selectableItems[selectedIndex];
67998
- const description = selectedItem ? getDescription(selectedItem.value) : "";
67999
68347
  const showTruncationWarning = previewIsTruncated && settings?.flexMode === "full-minus-40";
68000
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68348
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68001
68349
  flexDirection: "column",
68002
68350
  children: [
68003
- showTruncationWarning && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68351
+ showTruncationWarning && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68004
68352
  marginBottom: 1,
68005
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68353
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68006
68354
  color: "yellow",
68007
68355
  children: "⚠ Some lines are truncated, see Terminal Options → Terminal Width for info"
68008
68356
  }, undefined, false, undefined, this)
68009
68357
  }, undefined, false, undefined, this),
68010
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68358
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68011
68359
  bold: true,
68012
68360
  children: "Main Menu"
68013
68361
  }, undefined, false, undefined, this),
68014
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68362
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(List, {
68363
+ items: menuItems,
68015
68364
  marginTop: 1,
68016
- flexDirection: "column",
68017
- children: menuItems.map((item, idx) => {
68018
- if (!item.selectable && item.value.startsWith("_gap")) {
68019
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68020
- children: " "
68021
- }, item.value, false, undefined, this);
68365
+ onSelect: (value, index) => {
68366
+ if (value === "back") {
68367
+ return;
68022
68368
  }
68023
- const selectableIdx = selectableItems.indexOf(item);
68024
- const isSelected = selectableIdx === selectedIndex;
68025
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68026
- color: isSelected ? "green" : undefined,
68027
- children: [
68028
- isSelected ? "▶ " : " ",
68029
- item.label
68030
- ]
68031
- }, item.value, true, undefined, this);
68032
- })
68033
- }, undefined, false, undefined, this),
68034
- description && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68035
- marginTop: 1,
68036
- paddingLeft: 2,
68037
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68038
- dimColor: true,
68039
- wrap: "wrap",
68040
- children: description
68041
- }, undefined, false, undefined, this)
68369
+ onSelect(value, index);
68370
+ },
68371
+ initialSelection
68042
68372
  }, undefined, false, undefined, this)
68043
68373
  ]
68044
68374
  }, undefined, true, undefined, this);
68045
68375
  };
68046
68376
  // src/tui/components/PowerlineSetup.tsx
68047
68377
  await init_build2();
68048
- var import_react44 = __toESM(require_react(), 1);
68378
+ var import_react42 = __toESM(require_react(), 1);
68049
68379
  import * as os11 from "os";
68050
68380
 
68051
68381
  // src/utils/powerline-settings.ts
@@ -68076,8 +68406,8 @@ function buildEnabledPowerlineSettings(settings, removeManualSeparators) {
68076
68406
  // src/tui/components/PowerlineSeparatorEditor.tsx
68077
68407
  init_input_guards();
68078
68408
  await init_build2();
68079
- var import_react42 = __toESM(require_react(), 1);
68080
- var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
68409
+ var import_react40 = __toESM(require_react(), 1);
68410
+ var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
68081
68411
  var PowerlineSeparatorEditor = ({
68082
68412
  settings,
68083
68413
  mode,
@@ -68097,10 +68427,10 @@ var PowerlineSeparatorEditor = ({
68097
68427
  };
68098
68428
  const separators = getItems();
68099
68429
  const invertBgs = mode === "separator" ? powerlineConfig.separatorInvertBackground : [];
68100
- const [selectedIndex, setSelectedIndex] = import_react42.useState(0);
68101
- const [hexInputMode, setHexInputMode] = import_react42.useState(false);
68102
- const [hexInput, setHexInput] = import_react42.useState("");
68103
- const [cursorPos, setCursorPos] = import_react42.useState(0);
68430
+ const [selectedIndex, setSelectedIndex] = import_react40.useState(0);
68431
+ const [hexInputMode, setHexInputMode] = import_react40.useState(false);
68432
+ const [hexInput, setHexInput] = import_react40.useState("");
68433
+ const [cursorPos, setCursorPos] = import_react40.useState(0);
68104
68434
  const getPresets = () => {
68105
68435
  if (mode === "separator") {
68106
68436
  return [
@@ -68293,18 +68623,18 @@ var PowerlineSeparatorEditor = ({
68293
68623
  };
68294
68624
  const canAdd = mode === "separator" || separators.length < 3;
68295
68625
  const canDelete = mode !== "separator" || separators.length > 1;
68296
- return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68626
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68297
68627
  flexDirection: "column",
68298
68628
  children: [
68299
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68629
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68300
68630
  bold: true,
68301
68631
  children: getTitle()
68302
68632
  }, undefined, false, undefined, this),
68303
- hexInputMode ? /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68633
+ hexInputMode ? /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68304
68634
  marginTop: 2,
68305
68635
  flexDirection: "column",
68306
68636
  children: [
68307
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68637
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68308
68638
  children: [
68309
68639
  "Enter hex code (4-6 digits) for",
68310
68640
  " ",
@@ -68313,51 +68643,51 @@ var PowerlineSeparatorEditor = ({
68313
68643
  ":"
68314
68644
  ]
68315
68645
  }, undefined, true, undefined, this),
68316
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68646
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68317
68647
  children: [
68318
68648
  "U+",
68319
68649
  hexInput.slice(0, cursorPos),
68320
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68650
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68321
68651
  backgroundColor: "gray",
68322
68652
  color: "black",
68323
68653
  children: hexInput[cursorPos] ?? "_"
68324
68654
  }, undefined, false, undefined, this),
68325
68655
  hexInput.slice(cursorPos + 1),
68326
- hexInput.length < 6 && hexInput.length === cursorPos && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68656
+ hexInput.length < 6 && hexInput.length === cursorPos && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68327
68657
  dimColor: true,
68328
68658
  children: "_".repeat(6 - hexInput.length - 1)
68329
68659
  }, undefined, false, undefined, this)
68330
68660
  ]
68331
68661
  }, undefined, true, undefined, this),
68332
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68662
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68333
68663
  dimColor: true,
68334
68664
  children: "Enter 4-6 hex digits (0-9, A-F) for a Unicode code point, then press Enter. ESC to cancel."
68335
68665
  }, undefined, false, undefined, this),
68336
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68666
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68337
68667
  dimColor: true,
68338
68668
  children: "Examples: E0B0 (powerline), 1F984 (\uD83E\uDD84), 2764 (❤)"
68339
68669
  }, undefined, false, undefined, this)
68340
68670
  ]
68341
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(jsx_dev_runtime14.Fragment, {
68671
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
68342
68672
  children: [
68343
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68344
- children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68673
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68674
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68345
68675
  dimColor: true,
68346
68676
  children: `↑↓ select, ← → cycle${canAdd ? ", (a)dd, (i)nsert" : ""}${canDelete ? ", (d)elete" : ""}, (c)lear, (h)ex${mode === "separator" ? ", (t)oggle invert" : ""}, ESC back`
68347
68677
  }, undefined, false, undefined, this)
68348
68678
  }, undefined, false, undefined, this),
68349
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68679
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68350
68680
  marginTop: 2,
68351
68681
  flexDirection: "column",
68352
- children: separators.length > 0 ? separators.map((sep2, index) => /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68353
- children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68682
+ children: separators.length > 0 ? separators.map((sep2, index) => /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68683
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68354
68684
  color: index === selectedIndex ? "green" : undefined,
68355
68685
  children: [
68356
68686
  index === selectedIndex ? "▶ " : " ",
68357
68687
  `${index + 1}: ${getSeparatorDisplay(sep2, index)}`
68358
68688
  ]
68359
68689
  }, undefined, true, undefined, this)
68360
- }, index, false, undefined, this)) : /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68690
+ }, index, false, undefined, this)) : /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68361
68691
  dimColor: true,
68362
68692
  children: "(none configured - press 'a' to add)"
68363
68693
  }, undefined, false, undefined, this)
@@ -68372,143 +68702,150 @@ var PowerlineSeparatorEditor = ({
68372
68702
  init_ColorLevel();
68373
68703
  init_colors();
68374
68704
  await init_build2();
68375
- var import_react43 = __toESM(require_react(), 1);
68376
- var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
68705
+ var import_react41 = __toESM(require_react(), 1);
68706
+ var jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
68707
+ function buildPowerlineThemeItems(themes, originalTheme) {
68708
+ return themes.map((themeName) => {
68709
+ const theme = getPowerlineTheme(themeName);
68710
+ return {
68711
+ label: theme?.name ?? themeName,
68712
+ sublabel: themeName === originalTheme ? "(original)" : undefined,
68713
+ value: themeName,
68714
+ description: theme?.description ?? ""
68715
+ };
68716
+ });
68717
+ }
68718
+ function applyCustomPowerlineTheme(settings, themeName) {
68719
+ const theme = getPowerlineTheme(themeName);
68720
+ if (!theme || themeName === "custom") {
68721
+ return null;
68722
+ }
68723
+ const colorLevel = getColorLevelString(settings.colorLevel);
68724
+ const colorLevelKey = colorLevel === "ansi16" ? "1" : colorLevel === "ansi256" ? "2" : "3";
68725
+ const themeColors = theme[colorLevelKey];
68726
+ if (!themeColors) {
68727
+ return null;
68728
+ }
68729
+ const lines = settings.lines.map((line) => {
68730
+ let widgetColorIndex = 0;
68731
+ return line.map((widget) => {
68732
+ if (widget.type === "separator" || widget.type === "flex-separator") {
68733
+ return widget;
68734
+ }
68735
+ const fgColor = themeColors.fg[widgetColorIndex % themeColors.fg.length];
68736
+ const bgColor = themeColors.bg[widgetColorIndex % themeColors.bg.length];
68737
+ widgetColorIndex++;
68738
+ return {
68739
+ ...widget,
68740
+ color: fgColor,
68741
+ backgroundColor: bgColor
68742
+ };
68743
+ });
68744
+ });
68745
+ return {
68746
+ ...settings,
68747
+ powerline: {
68748
+ ...settings.powerline,
68749
+ theme: "custom"
68750
+ },
68751
+ lines
68752
+ };
68753
+ }
68377
68754
  var PowerlineThemeSelector = ({
68378
68755
  settings,
68379
68756
  onUpdate,
68380
68757
  onBack
68381
68758
  }) => {
68382
- const themes = getPowerlineThemes();
68759
+ const themes = import_react41.useMemo(() => getPowerlineThemes(), []);
68383
68760
  const currentTheme = settings.powerline.theme ?? "custom";
68384
- const [selectedIndex, setSelectedIndex] = import_react43.useState(Math.max(0, themes.indexOf(currentTheme)));
68385
- const [showCustomizeConfirm, setShowCustomizeConfirm] = import_react43.useState(false);
68386
- const originalThemeRef = import_react43.useRef(currentTheme);
68387
- const originalSettingsRef = import_react43.useRef(settings);
68388
- const applyTheme = (themeName) => {
68389
- const updatedSettings = {
68390
- ...settings,
68391
- powerline: {
68392
- ...settings.powerline,
68393
- theme: themeName
68394
- }
68395
- };
68396
- onUpdate(updatedSettings);
68397
- };
68398
- const customizeTheme = () => {
68399
- const currentThemeName = themes[selectedIndex];
68400
- if (!currentThemeName) {
68761
+ const [selectedIndex, setSelectedIndex] = import_react41.useState(Math.max(0, themes.indexOf(currentTheme)));
68762
+ const [showCustomizeConfirm, setShowCustomizeConfirm] = import_react41.useState(false);
68763
+ const originalThemeRef = import_react41.useRef(currentTheme);
68764
+ const originalSettingsRef = import_react41.useRef(settings);
68765
+ const latestSettingsRef = import_react41.useRef(settings);
68766
+ const latestOnUpdateRef = import_react41.useRef(onUpdate);
68767
+ const didHandleInitialSelectionRef = import_react41.useRef(false);
68768
+ import_react41.useEffect(() => {
68769
+ latestSettingsRef.current = settings;
68770
+ latestOnUpdateRef.current = onUpdate;
68771
+ }, [settings, onUpdate]);
68772
+ import_react41.useEffect(() => {
68773
+ const themeName = themes[selectedIndex];
68774
+ if (!themeName) {
68401
68775
  return;
68402
68776
  }
68403
- const theme = getPowerlineTheme(currentThemeName);
68404
- if (!theme || currentThemeName === "custom") {
68405
- onBack();
68777
+ if (!didHandleInitialSelectionRef.current) {
68778
+ didHandleInitialSelectionRef.current = true;
68406
68779
  return;
68407
68780
  }
68408
- const colorLevel = getColorLevelString(settings.colorLevel);
68409
- const colorLevelKey = colorLevel === "ansi16" ? "1" : colorLevel === "ansi256" ? "2" : "3";
68410
- const themeColors = theme[colorLevelKey];
68411
- if (themeColors) {
68412
- const newLines = settings.lines.map((line) => {
68413
- let widgetColorIndex = 0;
68414
- return line.map((widget) => {
68415
- if (widget.type === "separator" || widget.type === "flex-separator") {
68416
- return widget;
68417
- }
68418
- const fgColor = themeColors.fg[widgetColorIndex % themeColors.fg.length];
68419
- const bgColor = themeColors.bg[widgetColorIndex % themeColors.bg.length];
68420
- widgetColorIndex++;
68421
- return {
68422
- ...widget,
68423
- color: fgColor,
68424
- backgroundColor: bgColor
68425
- };
68426
- });
68427
- });
68428
- const updatedSettings = {
68429
- ...settings,
68430
- powerline: {
68431
- ...settings.powerline,
68432
- theme: "custom"
68433
- },
68434
- lines: newLines
68435
- };
68436
- onUpdate(updatedSettings);
68437
- }
68438
- onBack();
68439
- };
68781
+ latestOnUpdateRef.current({
68782
+ ...latestSettingsRef.current,
68783
+ powerline: {
68784
+ ...latestSettingsRef.current.powerline,
68785
+ theme: themeName
68786
+ }
68787
+ });
68788
+ }, [selectedIndex, themes]);
68440
68789
  use_input_default((input, key) => {
68441
68790
  if (showCustomizeConfirm) {
68442
68791
  return;
68443
68792
  }
68444
- {
68445
- if (key.escape) {
68446
- onUpdate(originalSettingsRef.current);
68447
- onBack();
68448
- } else if (key.upArrow) {
68449
- const newIndex = Math.max(0, selectedIndex - 1);
68450
- setSelectedIndex(newIndex);
68451
- const newTheme = themes[newIndex];
68452
- if (newTheme) {
68453
- applyTheme(newTheme);
68454
- }
68455
- } else if (key.downArrow) {
68456
- const newIndex = Math.min(themes.length - 1, selectedIndex + 1);
68457
- setSelectedIndex(newIndex);
68458
- const newTheme = themes[newIndex];
68459
- if (newTheme) {
68460
- applyTheme(newTheme);
68461
- }
68462
- } else if (key.return) {
68463
- onBack();
68464
- } else if (input === "c" || input === "C") {
68465
- const currentThemeName = themes[selectedIndex];
68466
- if (currentThemeName && currentThemeName !== "custom") {
68467
- setShowCustomizeConfirm(true);
68468
- }
68793
+ if (key.escape) {
68794
+ onUpdate(originalSettingsRef.current);
68795
+ onBack();
68796
+ } else if (input === "c" || input === "C") {
68797
+ const currentThemeName = themes[selectedIndex];
68798
+ if (currentThemeName && currentThemeName !== "custom") {
68799
+ setShowCustomizeConfirm(true);
68469
68800
  }
68470
68801
  }
68471
68802
  });
68472
68803
  const selectedThemeName = themes[selectedIndex];
68473
- const selectedTheme = selectedThemeName ? getPowerlineTheme(selectedThemeName) : undefined;
68804
+ const themeItems = import_react41.useMemo(() => buildPowerlineThemeItems(themes, originalThemeRef.current), [themes]);
68474
68805
  if (showCustomizeConfirm) {
68475
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68806
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68476
68807
  flexDirection: "column",
68477
68808
  children: [
68478
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68809
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68479
68810
  bold: true,
68480
68811
  color: "yellow",
68481
68812
  children: "⚠ Confirm Customization"
68482
68813
  }, undefined, false, undefined, this),
68483
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68814
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68484
68815
  marginTop: 1,
68485
68816
  flexDirection: "column",
68486
68817
  children: [
68487
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68818
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68488
68819
  children: "This will copy the current theme colors to your widgets"
68489
68820
  }, undefined, false, undefined, this),
68490
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68821
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68491
68822
  children: "and switch to Custom theme mode."
68492
68823
  }, undefined, false, undefined, this),
68493
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68824
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68494
68825
  color: "red",
68495
68826
  children: "This will overwrite any existing custom colors!"
68496
68827
  }, undefined, false, undefined, this)
68497
68828
  ]
68498
68829
  }, undefined, true, undefined, this),
68499
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68830
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68500
68831
  marginTop: 2,
68501
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68832
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68502
68833
  children: "Continue?"
68503
68834
  }, undefined, false, undefined, this)
68504
68835
  }, undefined, false, undefined, this),
68505
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68836
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68506
68837
  marginTop: 1,
68507
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ConfirmDialog, {
68838
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ConfirmDialog, {
68508
68839
  inline: true,
68509
68840
  onConfirm: () => {
68510
- customizeTheme();
68841
+ if (selectedThemeName) {
68842
+ const updatedSettings = applyCustomPowerlineTheme(settings, selectedThemeName);
68843
+ if (updatedSettings) {
68844
+ onUpdate(updatedSettings);
68845
+ }
68846
+ }
68511
68847
  setShowCustomizeConfirm(false);
68848
+ onBack();
68512
68849
  },
68513
68850
  onCancel: () => {
68514
68851
  setShowCustomizeConfirm(false);
@@ -68518,82 +68855,150 @@ var PowerlineThemeSelector = ({
68518
68855
  ]
68519
68856
  }, undefined, true, undefined, this);
68520
68857
  }
68521
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68858
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68522
68859
  flexDirection: "column",
68523
68860
  children: [
68524
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68861
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68525
68862
  bold: true,
68526
68863
  children: [
68527
68864
  `Powerline Theme Selection | `,
68528
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68865
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68529
68866
  dimColor: true,
68530
68867
  children: `Original: ${originalThemeRef.current}`
68531
68868
  }, undefined, false, undefined, this)
68532
68869
  ]
68533
68870
  }, undefined, true, undefined, this),
68534
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68535
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68871
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68872
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68536
68873
  dimColor: true,
68537
68874
  children: `↑↓ navigate, Enter apply${selectedThemeName && selectedThemeName !== "custom" ? ", (c)ustomize theme" : ""}, ESC cancel`
68538
68875
  }, undefined, false, undefined, this)
68539
68876
  }, undefined, false, undefined, this),
68540
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68877
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(List, {
68541
68878
  marginTop: 1,
68542
- flexDirection: "column",
68543
- children: themes.map((themeName, index) => {
68544
- const theme = getPowerlineTheme(themeName);
68545
- const isSelected = index === selectedIndex;
68546
- const isOriginal = themeName === originalThemeRef.current;
68547
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68548
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68549
- color: isSelected ? "green" : undefined,
68550
- children: [
68551
- isSelected ? "▶ " : " ",
68552
- theme?.name ?? themeName,
68553
- isOriginal && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68554
- dimColor: true,
68555
- children: " (original)"
68556
- }, undefined, false, undefined, this)
68557
- ]
68558
- }, undefined, true, undefined, this)
68559
- }, themeName, false, undefined, this);
68560
- })
68879
+ items: themeItems,
68880
+ onSelect: () => {
68881
+ onBack();
68882
+ },
68883
+ onSelectionChange: (themeName, index) => {
68884
+ if (themeName === "back") {
68885
+ return;
68886
+ }
68887
+ setSelectedIndex(index);
68888
+ },
68889
+ initialSelection: selectedIndex
68561
68890
  }, undefined, false, undefined, this),
68562
- selectedTheme && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68563
- marginTop: 2,
68564
- flexDirection: "column",
68565
- children: [
68566
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68567
- dimColor: true,
68568
- children: "Description:"
68569
- }, undefined, false, undefined, this),
68570
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68571
- marginLeft: 2,
68572
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68573
- children: selectedTheme.description
68574
- }, undefined, false, undefined, this)
68575
- }, undefined, false, undefined, this),
68576
- selectedThemeName && selectedThemeName !== "custom" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68577
- marginTop: 1,
68578
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68579
- dimColor: true,
68580
- children: "Press (c) to customize this theme - copies colors to widgets"
68581
- }, undefined, false, undefined, this)
68582
- }, undefined, false, undefined, this),
68583
- settings.colorLevel === 1 && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68584
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68585
- color: "yellow",
68586
- children: "⚠ 16 color mode themes have a very limited palette, we recommend switching color level in Terminal Options"
68587
- }, undefined, false, undefined, this)
68588
- }, undefined, false, undefined, this)
68589
- ]
68590
- }, undefined, true, undefined, this)
68891
+ selectedThemeName && selectedThemeName !== "custom" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68892
+ marginTop: 1,
68893
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68894
+ dimColor: true,
68895
+ children: "Press (c) to customize this theme - copies colors to widgets"
68896
+ }, undefined, false, undefined, this)
68897
+ }, undefined, false, undefined, this),
68898
+ settings.colorLevel === 1 && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68899
+ marginTop: 1,
68900
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68901
+ color: "yellow",
68902
+ children: "⚠ 16 color mode themes have a very limited palette, we recommend switching color level in Terminal Options"
68903
+ }, undefined, false, undefined, this)
68904
+ }, undefined, false, undefined, this)
68591
68905
  ]
68592
68906
  }, undefined, true, undefined, this);
68593
68907
  };
68594
68908
 
68595
68909
  // src/tui/components/PowerlineSetup.tsx
68596
- var jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
68910
+ var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
68911
+ var POWERLINE_MENU_LABEL_WIDTH = 11;
68912
+ function formatPowerlineMenuLabel(label) {
68913
+ return label.padEnd(POWERLINE_MENU_LABEL_WIDTH, " ");
68914
+ }
68915
+ function getSeparatorDisplay(powerlineConfig) {
68916
+ const seps = powerlineConfig.separators;
68917
+ if (seps.length > 1) {
68918
+ return "multiple";
68919
+ }
68920
+ const sep2 = seps[0] ?? "";
68921
+ const presets = [
68922
+ { char: "", name: "Triangle Right" },
68923
+ { char: "", name: "Triangle Left" },
68924
+ { char: "", name: "Round Right" },
68925
+ { char: "", name: "Round Left" }
68926
+ ];
68927
+ const preset = presets.find((item) => item.char === sep2);
68928
+ if (preset) {
68929
+ return `${preset.char} - ${preset.name}`;
68930
+ }
68931
+ return `${sep2} - Custom`;
68932
+ }
68933
+ function getCapDisplay(powerlineConfig, type) {
68934
+ const caps = type === "start" ? powerlineConfig.startCaps : powerlineConfig.endCaps;
68935
+ if (caps.length === 0) {
68936
+ return "none";
68937
+ }
68938
+ if (caps.length > 1) {
68939
+ return "multiple";
68940
+ }
68941
+ const cap = caps[0];
68942
+ if (!cap) {
68943
+ return "none";
68944
+ }
68945
+ const presets = type === "start" ? [
68946
+ { char: "", name: "Triangle" },
68947
+ { char: "", name: "Round" },
68948
+ { char: "", name: "Lower Triangle" },
68949
+ { char: "", name: "Diagonal" }
68950
+ ] : [
68951
+ { char: "", name: "Triangle" },
68952
+ { char: "", name: "Round" },
68953
+ { char: "", name: "Lower Triangle" },
68954
+ { char: "", name: "Diagonal" }
68955
+ ];
68956
+ const preset = presets.find((item) => item.char === cap);
68957
+ if (preset) {
68958
+ return `${preset.char} - ${preset.name}`;
68959
+ }
68960
+ return `${cap} - Custom`;
68961
+ }
68962
+ function getThemeDisplay(powerlineConfig) {
68963
+ const theme = powerlineConfig.theme;
68964
+ if (!theme || theme === "custom") {
68965
+ return "Custom";
68966
+ }
68967
+ return theme.charAt(0).toUpperCase() + theme.slice(1);
68968
+ }
68969
+ function buildPowerlineSetupMenuItems(powerlineConfig) {
68970
+ const disabled = !powerlineConfig.enabled;
68971
+ return [
68972
+ {
68973
+ label: formatPowerlineMenuLabel("Separator"),
68974
+ sublabel: `(${getSeparatorDisplay(powerlineConfig)})`,
68975
+ value: "separator",
68976
+ disabled,
68977
+ description: "Choose the glyph used between powerline segments."
68978
+ },
68979
+ {
68980
+ label: formatPowerlineMenuLabel("Start Cap"),
68981
+ sublabel: `(${getCapDisplay(powerlineConfig, "start")})`,
68982
+ value: "startCap",
68983
+ disabled,
68984
+ description: "Configure the cap glyph that appears at the start of each powerline line."
68985
+ },
68986
+ {
68987
+ label: formatPowerlineMenuLabel("End Cap"),
68988
+ sublabel: `(${getCapDisplay(powerlineConfig, "end")})`,
68989
+ value: "endCap",
68990
+ disabled,
68991
+ description: "Configure the cap glyph that appears at the end of each powerline line."
68992
+ },
68993
+ {
68994
+ label: formatPowerlineMenuLabel("Themes"),
68995
+ sublabel: `(${getThemeDisplay(powerlineConfig)})`,
68996
+ value: "themes",
68997
+ disabled,
68998
+ description: "Preview built-in powerline themes or copy a theme into custom widget colors."
68999
+ }
69000
+ ];
69001
+ }
68597
69002
  var PowerlineSetup = ({
68598
69003
  settings,
68599
69004
  powerlineFontStatus,
@@ -68605,68 +69010,11 @@ var PowerlineSetup = ({
68605
69010
  onClearMessage
68606
69011
  }) => {
68607
69012
  const powerlineConfig = settings.powerline;
68608
- const [screen, setScreen] = import_react44.useState("menu");
68609
- const [selectedMenuItem, setSelectedMenuItem] = import_react44.useState(0);
68610
- const [confirmingEnable, setConfirmingEnable] = import_react44.useState(false);
68611
- const [confirmingFontInstall, setConfirmingFontInstall] = import_react44.useState(false);
69013
+ const [screen, setScreen] = import_react42.useState("menu");
69014
+ const [selectedMenuItem, setSelectedMenuItem] = import_react42.useState(0);
69015
+ const [confirmingEnable, setConfirmingEnable] = import_react42.useState(false);
69016
+ const [confirmingFontInstall, setConfirmingFontInstall] = import_react42.useState(false);
68612
69017
  const hasSeparatorItems = settings.lines.some((line) => line.some((item) => item.type === "separator" || item.type === "flex-separator"));
68613
- const menuItems = [
68614
- { label: "Separator", value: "separator" },
68615
- { label: "Start Cap", value: "startCap" },
68616
- { label: "End Cap", value: "endCap" },
68617
- { label: "Themes", value: "themes" },
68618
- { label: "← Back", value: "back" }
68619
- ];
68620
- const getSeparatorDisplay = () => {
68621
- const seps = powerlineConfig.separators;
68622
- if (seps.length > 1) {
68623
- return "multiple";
68624
- }
68625
- const sep2 = seps[0] ?? "";
68626
- const presets = [
68627
- { char: "", name: "Triangle Right" },
68628
- { char: "", name: "Triangle Left" },
68629
- { char: "", name: "Round Right" },
68630
- { char: "", name: "Round Left" }
68631
- ];
68632
- const preset = presets.find((p) => p.char === sep2);
68633
- if (preset) {
68634
- return `${preset.char} - ${preset.name}`;
68635
- }
68636
- return `${sep2} - Custom`;
68637
- };
68638
- const getCapDisplay = (type) => {
68639
- const caps = type === "start" ? powerlineConfig.startCaps : powerlineConfig.endCaps;
68640
- if (caps.length === 0)
68641
- return "none";
68642
- if (caps.length > 1)
68643
- return "multiple";
68644
- const cap = caps[0];
68645
- if (!cap)
68646
- return "none";
68647
- const presets = type === "start" ? [
68648
- { char: "", name: "Triangle" },
68649
- { char: "", name: "Round" },
68650
- { char: "", name: "Lower Triangle" },
68651
- { char: "", name: "Diagonal" }
68652
- ] : [
68653
- { char: "", name: "Triangle" },
68654
- { char: "", name: "Round" },
68655
- { char: "", name: "Lower Triangle" },
68656
- { char: "", name: "Diagonal" }
68657
- ];
68658
- const preset = presets.find((c) => c.char === cap);
68659
- if (preset) {
68660
- return `${preset.char} - ${preset.name}`;
68661
- }
68662
- return `${cap} - Custom`;
68663
- };
68664
- const getThemeDisplay = () => {
68665
- const theme = powerlineConfig.theme;
68666
- if (!theme || theme === "custom")
68667
- return "Custom";
68668
- return theme.charAt(0).toUpperCase() + theme.slice(1);
68669
- };
68670
69018
  use_input_default((input, key) => {
68671
69019
  if (fontInstallMessage || installingFonts) {
68672
69020
  if (fontInstallMessage && !key.escape) {
@@ -68680,19 +69028,6 @@ var PowerlineSetup = ({
68680
69028
  if (screen === "menu") {
68681
69029
  if (key.escape) {
68682
69030
  onBack();
68683
- } else if (key.upArrow) {
68684
- setSelectedMenuItem(Math.max(0, selectedMenuItem - 1));
68685
- } else if (key.downArrow) {
68686
- setSelectedMenuItem(Math.min(menuItems.length - 1, selectedMenuItem + 1));
68687
- } else if (key.return) {
68688
- const selected = menuItems[selectedMenuItem];
68689
- if (selected) {
68690
- if (selected.value === "back") {
68691
- onBack();
68692
- } else if (powerlineConfig.enabled) {
68693
- setScreen(selected.value);
68694
- }
68695
- }
68696
69031
  } else if (input === "t" || input === "T") {
68697
69032
  if (!powerlineConfig.enabled) {
68698
69033
  if (hasSeparatorItems) {
@@ -68701,19 +69036,29 @@ var PowerlineSetup = ({
68701
69036
  onUpdate(buildEnabledPowerlineSettings(settings, false));
68702
69037
  }
68703
69038
  } else {
68704
- const newConfig = { ...powerlineConfig, enabled: false };
68705
- onUpdate({ ...settings, powerline: newConfig });
69039
+ onUpdate({
69040
+ ...settings,
69041
+ powerline: {
69042
+ ...powerlineConfig,
69043
+ enabled: false
69044
+ }
69045
+ });
68706
69046
  }
68707
69047
  } else if (input === "i" || input === "I") {
68708
69048
  setConfirmingFontInstall(true);
68709
69049
  } else if ((input === "a" || input === "A") && powerlineConfig.enabled) {
68710
- const newConfig = { ...powerlineConfig, autoAlign: !powerlineConfig.autoAlign };
68711
- onUpdate({ ...settings, powerline: newConfig });
69050
+ onUpdate({
69051
+ ...settings,
69052
+ powerline: {
69053
+ ...powerlineConfig,
69054
+ autoAlign: !powerlineConfig.autoAlign
69055
+ }
69056
+ });
68712
69057
  }
68713
69058
  }
68714
69059
  });
68715
69060
  if (screen === "separator") {
68716
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(PowerlineSeparatorEditor, {
69061
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineSeparatorEditor, {
68717
69062
  settings,
68718
69063
  mode: "separator",
68719
69064
  onUpdate,
@@ -68723,7 +69068,7 @@ var PowerlineSetup = ({
68723
69068
  }, undefined, false, undefined, this);
68724
69069
  }
68725
69070
  if (screen === "startCap") {
68726
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(PowerlineSeparatorEditor, {
69071
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineSeparatorEditor, {
68727
69072
  settings,
68728
69073
  mode: "startCap",
68729
69074
  onUpdate,
@@ -68733,7 +69078,7 @@ var PowerlineSetup = ({
68733
69078
  }, undefined, false, undefined, this);
68734
69079
  }
68735
69080
  if (screen === "endCap") {
68736
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(PowerlineSeparatorEditor, {
69081
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineSeparatorEditor, {
68737
69082
  settings,
68738
69083
  mode: "endCap",
68739
69084
  onUpdate,
@@ -68743,7 +69088,7 @@ var PowerlineSetup = ({
68743
69088
  }, undefined, false, undefined, this);
68744
69089
  }
68745
69090
  if (screen === "themes") {
68746
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(PowerlineThemeSelector, {
69091
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineThemeSelector, {
68747
69092
  settings,
68748
69093
  onUpdate,
68749
69094
  onBack: () => {
@@ -68751,140 +69096,140 @@ var PowerlineSetup = ({
68751
69096
  }
68752
69097
  }, undefined, false, undefined, this);
68753
69098
  }
68754
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69099
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68755
69100
  flexDirection: "column",
68756
69101
  children: [
68757
- !confirmingFontInstall && !installingFonts && !fontInstallMessage && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69102
+ !confirmingFontInstall && !installingFonts && !fontInstallMessage && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68758
69103
  bold: true,
68759
69104
  children: "Powerline Setup"
68760
69105
  }, undefined, false, undefined, this),
68761
- confirmingFontInstall ? /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69106
+ confirmingFontInstall ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68762
69107
  flexDirection: "column",
68763
69108
  children: [
68764
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69109
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68765
69110
  marginBottom: 1,
68766
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69111
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68767
69112
  color: "cyan",
68768
69113
  bold: true,
68769
69114
  children: "Font Installation"
68770
69115
  }, undefined, false, undefined, this)
68771
69116
  }, undefined, false, undefined, this),
68772
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69117
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68773
69118
  marginBottom: 1,
68774
69119
  flexDirection: "column",
68775
69120
  children: [
68776
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69121
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68777
69122
  bold: true,
68778
69123
  children: "What will happen:"
68779
69124
  }, undefined, false, undefined, this),
68780
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69125
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68781
69126
  children: [
68782
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69127
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68783
69128
  dimColor: true,
68784
69129
  children: "• Clone fonts from "
68785
69130
  }, undefined, false, undefined, this),
68786
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69131
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68787
69132
  color: "blue",
68788
69133
  children: "https://github.com/powerline/fonts"
68789
69134
  }, undefined, false, undefined, this)
68790
69135
  ]
68791
69136
  }, undefined, true, undefined, this),
68792
- os11.platform() === "darwin" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69137
+ os11.platform() === "darwin" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
68793
69138
  children: [
68794
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69139
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68795
69140
  dimColor: true,
68796
69141
  children: "• Run install.sh script which will:"
68797
69142
  }, undefined, false, undefined, this),
68798
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69143
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68799
69144
  dimColor: true,
68800
69145
  children: " - Copy all .ttf/.otf files to ~/Library/Fonts"
68801
69146
  }, undefined, false, undefined, this),
68802
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69147
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68803
69148
  dimColor: true,
68804
69149
  children: " - Register fonts with macOS"
68805
69150
  }, undefined, false, undefined, this)
68806
69151
  ]
68807
69152
  }, undefined, true, undefined, this),
68808
- os11.platform() === "linux" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69153
+ os11.platform() === "linux" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
68809
69154
  children: [
68810
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69155
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68811
69156
  dimColor: true,
68812
69157
  children: "• Run install.sh script which will:"
68813
69158
  }, undefined, false, undefined, this),
68814
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69159
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68815
69160
  dimColor: true,
68816
69161
  children: " - Copy all .ttf/.otf files to ~/.local/share/fonts"
68817
69162
  }, undefined, false, undefined, this),
68818
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69163
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68819
69164
  dimColor: true,
68820
69165
  children: " - Run fc-cache to update font cache"
68821
69166
  }, undefined, false, undefined, this)
68822
69167
  ]
68823
69168
  }, undefined, true, undefined, this),
68824
- os11.platform() === "win32" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69169
+ os11.platform() === "win32" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
68825
69170
  children: [
68826
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69171
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68827
69172
  dimColor: true,
68828
69173
  children: "• Copy Powerline .ttf/.otf files to:"
68829
69174
  }, undefined, false, undefined, this),
68830
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69175
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68831
69176
  dimColor: true,
68832
69177
  children: " AppData\\Local\\Microsoft\\Windows\\Fonts"
68833
69178
  }, undefined, false, undefined, this)
68834
69179
  ]
68835
69180
  }, undefined, true, undefined, this),
68836
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69181
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68837
69182
  dimColor: true,
68838
69183
  children: "• Clean up temporary files"
68839
69184
  }, undefined, false, undefined, this)
68840
69185
  ]
68841
69186
  }, undefined, true, undefined, this),
68842
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69187
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68843
69188
  marginBottom: 1,
68844
69189
  children: [
68845
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69190
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68846
69191
  color: "yellow",
68847
69192
  bold: true,
68848
69193
  children: "Requirements: "
68849
69194
  }, undefined, false, undefined, this),
68850
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69195
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68851
69196
  dimColor: true,
68852
69197
  children: "Git installed, Internet connection, Write permissions"
68853
69198
  }, undefined, false, undefined, this)
68854
69199
  ]
68855
69200
  }, undefined, true, undefined, this),
68856
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69201
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68857
69202
  marginBottom: 1,
68858
69203
  flexDirection: "column",
68859
69204
  children: [
68860
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69205
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68861
69206
  color: "green",
68862
69207
  bold: true,
68863
69208
  children: "After install:"
68864
69209
  }, undefined, false, undefined, this),
68865
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69210
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68866
69211
  dimColor: true,
68867
69212
  children: "• Restart terminal"
68868
69213
  }, undefined, false, undefined, this),
68869
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69214
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68870
69215
  dimColor: true,
68871
69216
  children: "• Select a Powerline font"
68872
69217
  }, undefined, false, undefined, this),
68873
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69218
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68874
69219
  dimColor: true,
68875
69220
  children: ' (e.g. "Meslo LG S for Powerline")'
68876
69221
  }, undefined, false, undefined, this)
68877
69222
  ]
68878
69223
  }, undefined, true, undefined, this),
68879
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69224
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68880
69225
  marginTop: 1,
68881
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69226
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68882
69227
  children: "Proceed? "
68883
69228
  }, undefined, false, undefined, this)
68884
69229
  }, undefined, false, undefined, this),
68885
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69230
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68886
69231
  marginTop: 1,
68887
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ConfirmDialog, {
69232
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ConfirmDialog, {
68888
69233
  inline: true,
68889
69234
  onConfirm: () => {
68890
69235
  setConfirmingFontInstall(false);
@@ -68896,36 +69241,36 @@ var PowerlineSetup = ({
68896
69241
  }, undefined, false, undefined, this)
68897
69242
  }, undefined, false, undefined, this)
68898
69243
  ]
68899
- }, undefined, true, undefined, this) : confirmingEnable ? /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69244
+ }, undefined, true, undefined, this) : confirmingEnable ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68900
69245
  flexDirection: "column",
68901
69246
  marginTop: 1,
68902
69247
  children: [
68903
- hasSeparatorItems && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69248
+ hasSeparatorItems && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
68904
69249
  children: [
68905
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68906
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69250
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69251
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68907
69252
  color: "yellow",
68908
69253
  children: "⚠ Warning: Enabling Powerline mode will remove all existing separators and flex-separators from your status lines."
68909
69254
  }, undefined, false, undefined, this)
68910
69255
  }, undefined, false, undefined, this),
68911
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69256
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68912
69257
  marginBottom: 1,
68913
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69258
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68914
69259
  dimColor: true,
68915
69260
  children: "Powerline mode uses its own separator system and is incompatible with manual separators."
68916
69261
  }, undefined, false, undefined, this)
68917
69262
  }, undefined, false, undefined, this)
68918
69263
  ]
68919
69264
  }, undefined, true, undefined, this),
68920
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69265
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68921
69266
  marginTop: hasSeparatorItems ? 1 : 0,
68922
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69267
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68923
69268
  children: "Do you want to continue? "
68924
69269
  }, undefined, false, undefined, this)
68925
69270
  }, undefined, false, undefined, this),
68926
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69271
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68927
69272
  marginTop: 1,
68928
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ConfirmDialog, {
69273
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ConfirmDialog, {
68929
69274
  inline: true,
68930
69275
  onConfirm: () => {
68931
69276
  onUpdate(buildEnabledPowerlineSettings(settings, true));
@@ -68937,51 +69282,51 @@ var PowerlineSetup = ({
68937
69282
  }, undefined, false, undefined, this)
68938
69283
  }, undefined, false, undefined, this)
68939
69284
  ]
68940
- }, undefined, true, undefined, this) : installingFonts ? /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68941
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69285
+ }, undefined, true, undefined, this) : installingFonts ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69286
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68942
69287
  color: "yellow",
68943
69288
  children: "Installing Powerline fonts... This may take a moment."
68944
69289
  }, undefined, false, undefined, this)
68945
- }, undefined, false, undefined, this) : fontInstallMessage ? /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69290
+ }, undefined, false, undefined, this) : fontInstallMessage ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68946
69291
  flexDirection: "column",
68947
69292
  children: [
68948
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69293
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68949
69294
  color: fontInstallMessage.includes("success") ? "green" : "red",
68950
69295
  children: fontInstallMessage
68951
69296
  }, undefined, false, undefined, this),
68952
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69297
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68953
69298
  marginTop: 1,
68954
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69299
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68955
69300
  dimColor: true,
68956
69301
  children: "Press any key to continue..."
68957
69302
  }, undefined, false, undefined, this)
68958
69303
  }, undefined, false, undefined, this)
68959
69304
  ]
68960
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69305
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
68961
69306
  children: [
68962
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69307
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68963
69308
  flexDirection: "column",
68964
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69309
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68965
69310
  children: [
68966
69311
  " Font Status: ",
68967
- powerlineFontStatus.installed ? /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69312
+ powerlineFontStatus.installed ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
68968
69313
  children: [
68969
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69314
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68970
69315
  color: "green",
68971
69316
  children: "✓ Installed"
68972
69317
  }, undefined, false, undefined, this),
68973
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69318
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68974
69319
  dimColor: true,
68975
69320
  children: " - Ensure fonts are active in your terminal"
68976
69321
  }, undefined, false, undefined, this)
68977
69322
  ]
68978
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69323
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
68979
69324
  children: [
68980
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69325
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68981
69326
  color: "yellow",
68982
69327
  children: "✗ Not Installed"
68983
69328
  }, undefined, false, undefined, this),
68984
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69329
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68985
69330
  dimColor: true,
68986
69331
  children: " - Press (i) to install Powerline fonts"
68987
69332
  }, undefined, false, undefined, this)
@@ -68990,105 +69335,70 @@ var PowerlineSetup = ({
68990
69335
  ]
68991
69336
  }, undefined, true, undefined, this)
68992
69337
  }, undefined, false, undefined, this),
68993
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69338
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
68994
69339
  children: [
68995
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69340
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68996
69341
  children: " Powerline Mode: "
68997
69342
  }, undefined, false, undefined, this),
68998
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69343
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
68999
69344
  color: powerlineConfig.enabled ? "green" : "red",
69000
69345
  children: powerlineConfig.enabled ? "✓ Enabled " : "✗ Disabled "
69001
69346
  }, undefined, false, undefined, this),
69002
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69347
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69003
69348
  dimColor: true,
69004
69349
  children: " - Press (t) to toggle"
69005
69350
  }, undefined, false, undefined, this)
69006
69351
  ]
69007
69352
  }, undefined, true, undefined, this),
69008
- powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69353
+ powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
69009
69354
  children: [
69010
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69355
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69011
69356
  children: [
69012
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69357
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69013
69358
  children: " Align Widgets: "
69014
69359
  }, undefined, false, undefined, this),
69015
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69360
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69016
69361
  color: powerlineConfig.autoAlign ? "green" : "red",
69017
69362
  children: powerlineConfig.autoAlign ? "✓ Enabled " : "✗ Disabled "
69018
69363
  }, undefined, false, undefined, this),
69019
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69364
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69020
69365
  dimColor: true,
69021
69366
  children: " - Press (a) to toggle"
69022
69367
  }, undefined, false, undefined, this)
69023
69368
  ]
69024
69369
  }, undefined, true, undefined, this),
69025
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69370
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69026
69371
  flexDirection: "column",
69027
69372
  marginTop: 1,
69028
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69373
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69029
69374
  dimColor: true,
69030
69375
  children: "When enabled, global overrides are disabled and powerline separators are used"
69031
69376
  }, undefined, false, undefined, this)
69032
69377
  }, undefined, false, undefined, this)
69033
69378
  ]
69034
69379
  }, undefined, true, undefined, this),
69035
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69380
+ !powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69036
69381
  marginTop: 1,
69037
- flexDirection: "column",
69038
- children: powerlineConfig.enabled ? /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69039
- children: menuItems.map((item, index) => {
69040
- const isSelected = index === selectedMenuItem;
69041
- let displayValue = "";
69042
- switch (item.value) {
69043
- case "separator":
69044
- displayValue = getSeparatorDisplay();
69045
- break;
69046
- case "startCap":
69047
- displayValue = getCapDisplay("start");
69048
- break;
69049
- case "endCap":
69050
- displayValue = getCapDisplay("end");
69051
- break;
69052
- case "themes":
69053
- displayValue = getThemeDisplay();
69054
- break;
69055
- case "back":
69056
- displayValue = "";
69057
- break;
69058
- }
69059
- if (item.value === "back") {
69060
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69061
- marginTop: 1,
69062
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69063
- color: isSelected ? "green" : undefined,
69064
- children: [
69065
- isSelected ? "▶ " : " ",
69066
- item.label
69067
- ]
69068
- }, undefined, true, undefined, this)
69069
- }, item.value, false, undefined, this);
69070
- }
69071
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69072
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69073
- color: isSelected ? "green" : undefined,
69074
- children: [
69075
- isSelected ? "▶ " : " ",
69076
- item.label.padEnd(11, " "),
69077
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69078
- dimColor: true,
69079
- children: displayValue && `(${displayValue})`
69080
- }, undefined, false, undefined, this)
69081
- ]
69082
- }, undefined, true, undefined, this)
69083
- }, item.value, false, undefined, this);
69084
- })
69085
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69086
- marginTop: 1,
69087
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69088
- dimColor: true,
69089
- children: "Press ESC to go back"
69090
- }, undefined, false, undefined, this)
69382
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69383
+ dimColor: true,
69384
+ children: "Enable Powerline mode to configure separators, caps, and themes."
69091
69385
  }, undefined, false, undefined, this)
69386
+ }, undefined, false, undefined, this),
69387
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(List, {
69388
+ marginTop: 1,
69389
+ items: buildPowerlineSetupMenuItems(powerlineConfig),
69390
+ onSelect: (value) => {
69391
+ if (value === "back") {
69392
+ onBack();
69393
+ return;
69394
+ }
69395
+ setScreen(value);
69396
+ },
69397
+ onSelectionChange: (_, index) => {
69398
+ setSelectedMenuItem(index);
69399
+ },
69400
+ initialSelection: selectedMenuItem,
69401
+ showBackButton: true
69092
69402
  }, undefined, false, undefined, this)
69093
69403
  ]
69094
69404
  }, undefined, true, undefined, this)
@@ -69101,7 +69411,7 @@ await __promiseAll([
69101
69411
  init_build2(),
69102
69412
  init_renderer2()
69103
69413
  ]);
69104
- var import_react45 = __toESM(require_react(), 1);
69414
+ var import_react43 = __toESM(require_react(), 1);
69105
69415
 
69106
69416
  // src/utils/separator-index.ts
69107
69417
  function countSeparatorSlots(widgets) {
@@ -69113,7 +69423,7 @@ function advanceGlobalSeparatorIndex(currentIndex, widgets) {
69113
69423
  }
69114
69424
 
69115
69425
  // src/tui/components/StatusLinePreview.tsx
69116
- var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
69426
+ var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
69117
69427
  var renderSingleLine = (widgets, terminalWidth, settings, lineIndex, globalSeparatorIndex, preRenderedWidgets, preCalculatedMaxWidths) => {
69118
69428
  const context = {
69119
69429
  terminalWidth,
@@ -69124,7 +69434,7 @@ var renderSingleLine = (widgets, terminalWidth, settings, lineIndex, globalSepar
69124
69434
  return renderStatusLineWithInfo(widgets, settings, context, preRenderedWidgets, preCalculatedMaxWidths);
69125
69435
  };
69126
69436
  var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange }) => {
69127
- const { renderedLines, anyTruncated } = import_react45.default.useMemo(() => {
69437
+ const { renderedLines, anyTruncated } = import_react43.default.useMemo(() => {
69128
69438
  if (!settings)
69129
69439
  return { renderedLines: [], anyTruncated: false };
69130
69440
  const preRenderedLines = preRenderAllWidgets(lines, settings, { terminalWidth, isPreview: true });
@@ -69146,29 +69456,29 @@ var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange })
69146
69456
  }
69147
69457
  return { renderedLines: result2, anyTruncated: truncated };
69148
69458
  }, [lines, terminalWidth, settings]);
69149
- import_react45.default.useEffect(() => {
69459
+ import_react43.default.useEffect(() => {
69150
69460
  onTruncationChange?.(anyTruncated);
69151
69461
  }, [anyTruncated, onTruncationChange]);
69152
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69462
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69153
69463
  flexDirection: "column",
69154
69464
  children: [
69155
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69465
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69156
69466
  borderStyle: "round",
69157
69467
  borderColor: "gray",
69158
69468
  borderDimColor: true,
69159
69469
  width: "100%",
69160
69470
  paddingLeft: 1,
69161
- children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69471
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69162
69472
  children: [
69163
69473
  ">",
69164
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69474
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69165
69475
  dimColor: true,
69166
69476
  children: " Preview (ctrl+s to save configuration at any time)"
69167
69477
  }, undefined, false, undefined, this)
69168
69478
  ]
69169
69479
  }, undefined, true, undefined, this)
69170
69480
  }, undefined, false, undefined, this),
69171
- renderedLines.map((line, index) => /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69481
+ renderedLines.map((line, index) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69172
69482
  children: [
69173
69483
  " ",
69174
69484
  line,
@@ -69181,7 +69491,7 @@ var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange })
69181
69491
  // src/tui/components/TerminalOptionsMenu.tsx
69182
69492
  init_source();
69183
69493
  await init_build2();
69184
- var import_react46 = __toESM(require_react(), 1);
69494
+ var import_react44 = __toESM(require_react(), 1);
69185
69495
 
69186
69496
  // src/utils/color-sanitize.ts
69187
69497
  await init_widgets2();
@@ -69236,33 +69546,66 @@ function sanitizeLinesForColorLevel(lines, nextLevel) {
69236
69546
  }
69237
69547
 
69238
69548
  // src/tui/components/TerminalOptionsMenu.tsx
69239
- var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
69240
- var TerminalOptionsMenu = ({ settings, onUpdate, onBack }) => {
69241
- const [showColorWarning, setShowColorWarning] = import_react46.useState(false);
69242
- const [pendingColorLevel, setPendingColorLevel] = import_react46.useState(null);
69243
- const [selectedIndex, setSelectedIndex] = import_react46.useState(0);
69244
- const handleSelect = () => {
69245
- if (selectedIndex === 2) {
69549
+ var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
69550
+ function getNextColorLevel(level) {
69551
+ return (level + 1) % 4;
69552
+ }
69553
+ function shouldWarnOnColorLevelChange(currentLevel, nextLevel, hasCustomColors) {
69554
+ return hasCustomColors && (currentLevel === 2 && nextLevel !== 2 || currentLevel === 3 && nextLevel !== 3);
69555
+ }
69556
+ function buildTerminalOptionsItems(colorLevel) {
69557
+ return [
69558
+ {
69559
+ label: "◱ Terminal Width",
69560
+ value: "width",
69561
+ description: "Configure how the status line uses available terminal width and when it should compact."
69562
+ },
69563
+ {
69564
+ label: "▓ Color Level",
69565
+ sublabel: `(${getColorLevelLabel(colorLevel)})`,
69566
+ value: "colorLevel",
69567
+ description: [
69568
+ "Color level affects how colors are rendered:",
69569
+ "• Truecolor: Full 24-bit RGB colors (16.7M colors)",
69570
+ "• 256 Color: Extended color palette (256 colors)",
69571
+ "• Basic: Standard 16-color terminal palette",
69572
+ "• No Color: Disables all color output"
69573
+ ].join(`
69574
+ `)
69575
+ }
69576
+ ];
69577
+ }
69578
+ var TerminalOptionsMenu = ({
69579
+ settings,
69580
+ onUpdate,
69581
+ onBack
69582
+ }) => {
69583
+ const [showColorWarning, setShowColorWarning] = import_react44.useState(false);
69584
+ const [pendingColorLevel, setPendingColorLevel] = import_react44.useState(null);
69585
+ const handleSelect = (value) => {
69586
+ if (value === "back") {
69246
69587
  onBack();
69247
- } else if (selectedIndex === 0) {
69588
+ return;
69589
+ }
69590
+ if (value === "width") {
69248
69591
  onBack("width");
69249
- } else if (selectedIndex === 1) {
69250
- const hasCustomColors = hasCustomWidgetColors(settings.lines);
69251
- const currentLevel = settings.colorLevel;
69252
- const nextLevel = (currentLevel + 1) % 4;
69253
- if (hasCustomColors && (currentLevel === 2 && nextLevel !== 2 || currentLevel === 3 && nextLevel !== 3)) {
69254
- setShowColorWarning(true);
69255
- setPendingColorLevel(nextLevel);
69256
- } else {
69257
- source_default.level = nextLevel;
69258
- const cleanedLines = sanitizeLinesForColorLevel(settings.lines, nextLevel);
69259
- onUpdate({
69260
- ...settings,
69261
- lines: cleanedLines,
69262
- colorLevel: nextLevel
69263
- });
69264
- }
69592
+ return;
69265
69593
  }
69594
+ const hasCustomColors = hasCustomWidgetColors(settings.lines);
69595
+ const currentLevel = settings.colorLevel;
69596
+ const nextLevel = getNextColorLevel(currentLevel);
69597
+ if (shouldWarnOnColorLevelChange(currentLevel, nextLevel, hasCustomColors)) {
69598
+ setShowColorWarning(true);
69599
+ setPendingColorLevel(nextLevel);
69600
+ return;
69601
+ }
69602
+ source_default.level = nextLevel;
69603
+ const cleanedLines = sanitizeLinesForColorLevel(settings.lines, nextLevel);
69604
+ onUpdate({
69605
+ ...settings,
69606
+ lines: cleanedLines,
69607
+ colorLevel: nextLevel
69608
+ });
69266
69609
  };
69267
69610
  const handleColorConfirm = () => {
69268
69611
  if (pendingColorLevel !== null) {
@@ -69281,42 +69624,32 @@ var TerminalOptionsMenu = ({ settings, onUpdate, onBack }) => {
69281
69624
  setShowColorWarning(false);
69282
69625
  setPendingColorLevel(null);
69283
69626
  };
69284
- use_input_default((input, key) => {
69285
- if (key.escape) {
69286
- if (!showColorWarning) {
69287
- onBack();
69288
- }
69289
- } else if (!showColorWarning) {
69290
- if (key.upArrow) {
69291
- setSelectedIndex(Math.max(0, selectedIndex - 1));
69292
- } else if (key.downArrow) {
69293
- setSelectedIndex(Math.min(2, selectedIndex + 1));
69294
- } else if (key.return) {
69295
- handleSelect();
69296
- }
69627
+ use_input_default((_, key) => {
69628
+ if (key.escape && !showColorWarning) {
69629
+ onBack();
69297
69630
  }
69298
69631
  });
69299
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69632
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69300
69633
  flexDirection: "column",
69301
69634
  children: [
69302
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69635
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69303
69636
  bold: true,
69304
69637
  children: "Terminal Options"
69305
69638
  }, undefined, false, undefined, this),
69306
- showColorWarning ? /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69639
+ showColorWarning ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69307
69640
  flexDirection: "column",
69308
69641
  marginTop: 1,
69309
69642
  children: [
69310
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69643
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69311
69644
  color: "yellow",
69312
69645
  children: "⚠ Warning: Custom colors detected!"
69313
69646
  }, undefined, false, undefined, this),
69314
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69647
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69315
69648
  children: "Switching color modes will reset custom ansi256 or hex colors to defaults."
69316
69649
  }, undefined, false, undefined, this),
69317
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69650
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69318
69651
  marginTop: 1,
69319
- children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(ConfirmDialog, {
69652
+ children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ConfirmDialog, {
69320
69653
  message: "Continue?",
69321
69654
  onConfirm: handleColorConfirm,
69322
69655
  onCancel: handleColorCancel,
@@ -69324,74 +69657,18 @@ var TerminalOptionsMenu = ({ settings, onUpdate, onBack }) => {
69324
69657
  }, undefined, false, undefined, this)
69325
69658
  }, undefined, false, undefined, this)
69326
69659
  ]
69327
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(jsx_dev_runtime18.Fragment, {
69660
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
69328
69661
  children: [
69329
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69662
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69330
69663
  color: "white",
69331
69664
  children: "Configure terminal-specific settings for optimal display"
69332
69665
  }, undefined, false, undefined, this),
69333
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69666
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(List, {
69334
69667
  marginTop: 1,
69335
- flexDirection: "column",
69336
- children: [
69337
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69338
- children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69339
- color: selectedIndex === 0 ? "green" : undefined,
69340
- children: [
69341
- selectedIndex === 0 ? "▶ " : " ",
69342
- "◱ Terminal Width"
69343
- ]
69344
- }, undefined, true, undefined, this)
69345
- }, undefined, false, undefined, this),
69346
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69347
- children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69348
- color: selectedIndex === 1 ? "green" : undefined,
69349
- children: [
69350
- selectedIndex === 1 ? "▶ " : " ",
69351
- "▓ Color Level:",
69352
- " ",
69353
- getColorLevelLabel(settings.colorLevel)
69354
- ]
69355
- }, undefined, true, undefined, this)
69356
- }, undefined, false, undefined, this),
69357
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69358
- marginTop: 1,
69359
- children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69360
- color: selectedIndex === 2 ? "green" : undefined,
69361
- children: [
69362
- selectedIndex === 2 ? "▶ " : " ",
69363
- "← Back"
69364
- ]
69365
- }, undefined, true, undefined, this)
69366
- }, undefined, false, undefined, this)
69367
- ]
69368
- }, undefined, true, undefined, this),
69369
- selectedIndex === 1 && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69370
- marginTop: 1,
69371
- flexDirection: "column",
69372
- children: [
69373
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69374
- dimColor: true,
69375
- children: "Color level affects how colors are rendered:"
69376
- }, undefined, false, undefined, this),
69377
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69378
- dimColor: true,
69379
- children: "• Truecolor: Full 24-bit RGB colors (16.7M colors)"
69380
- }, undefined, false, undefined, this),
69381
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69382
- dimColor: true,
69383
- children: "• 256 Color: Extended color palette (256 colors)"
69384
- }, undefined, false, undefined, this),
69385
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69386
- dimColor: true,
69387
- children: "• Basic: Standard 16-color terminal palette"
69388
- }, undefined, false, undefined, this),
69389
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69390
- dimColor: true,
69391
- children: "• No Color: Disables all color output"
69392
- }, undefined, false, undefined, this)
69393
- ]
69394
- }, undefined, true, undefined, this)
69668
+ items: buildTerminalOptionsItems(settings.colorLevel),
69669
+ onSelect: handleSelect,
69670
+ showBackButton: true
69671
+ }, undefined, false, undefined, this)
69395
69672
  ]
69396
69673
  }, undefined, true, undefined, this)
69397
69674
  ]
@@ -69415,28 +69692,67 @@ var getColorLevelLabel = (level) => {
69415
69692
  // src/tui/components/TerminalWidthMenu.tsx
69416
69693
  init_input_guards();
69417
69694
  await init_build2();
69418
- var import_react47 = __toESM(require_react(), 1);
69419
- var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
69420
- var TerminalWidthMenu = ({ settings, onUpdate, onBack }) => {
69421
- const [selectedOption, setSelectedOption] = import_react47.useState(settings.flexMode);
69422
- const [compactThreshold, setCompactThreshold] = import_react47.useState(settings.compactThreshold);
69423
- const [editingThreshold, setEditingThreshold] = import_react47.useState(false);
69424
- const [thresholdInput, setThresholdInput] = import_react47.useState(String(settings.compactThreshold));
69425
- const [validationError, setValidationError] = import_react47.useState(null);
69426
- const [selectedIndex, setSelectedIndex] = import_react47.useState(() => {
69427
- const options2 = ["full", "full-minus-40", "full-until-compact"];
69428
- return options2.indexOf(settings.flexMode);
69429
- });
69430
- const options = ["full", "full-minus-40", "full-until-compact"];
69695
+ var import_react45 = __toESM(require_react(), 1);
69696
+ var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
69697
+ var TERMINAL_WIDTH_OPTIONS = ["full", "full-minus-40", "full-until-compact"];
69698
+ function getTerminalWidthSelectionIndex(selectedOption) {
69699
+ const selectedIndex = TERMINAL_WIDTH_OPTIONS.indexOf(selectedOption);
69700
+ return selectedIndex >= 0 ? selectedIndex : 0;
69701
+ }
69702
+ function validateCompactThresholdInput(value) {
69703
+ const parsedValue = parseInt(value, 10);
69704
+ if (isNaN(parsedValue)) {
69705
+ return "Please enter a valid number";
69706
+ }
69707
+ if (parsedValue < 1 || parsedValue > 99) {
69708
+ return `Value must be between 1 and 99 (you entered ${parsedValue})`;
69709
+ }
69710
+ return null;
69711
+ }
69712
+ function buildTerminalWidthItems(selectedOption, compactThreshold) {
69713
+ return [
69714
+ {
69715
+ value: "full",
69716
+ label: "Full width always",
69717
+ sublabel: selectedOption === "full" ? "(active)" : undefined,
69718
+ description: `Uses the full terminal width minus 4 characters for terminal padding. If the auto-compact message appears, it may cause the line to wrap.
69719
+
69720
+ NOTE: If /ide integration is enabled, it is not recommended to use this mode.`
69721
+ },
69722
+ {
69723
+ value: "full-minus-40",
69724
+ label: "Full width minus 40",
69725
+ sublabel: selectedOption === "full-minus-40" ? "(active)" : "(default)",
69726
+ description: "Leaves a gap to the right of the status line to accommodate the auto-compact message. This prevents wrapping but may leave unused space. This limitation exists because we cannot detect when the message will appear."
69727
+ },
69728
+ {
69729
+ value: "full-until-compact",
69730
+ label: "Full width until compact",
69731
+ sublabel: selectedOption === "full-until-compact" ? `(threshold ${compactThreshold}%, active)` : `(threshold ${compactThreshold}%)`,
69732
+ description: `Dynamically adjusts width based on context usage. When context reaches ${compactThreshold}%, it switches to leaving space for the auto-compact message.
69733
+
69734
+ NOTE: If /ide integration is enabled, it is not recommended to use this mode.`
69735
+ }
69736
+ ];
69737
+ }
69738
+ var TerminalWidthMenu = ({
69739
+ settings,
69740
+ onUpdate,
69741
+ onBack
69742
+ }) => {
69743
+ const [selectedOption, setSelectedOption] = import_react45.useState(settings.flexMode);
69744
+ const [compactThreshold, setCompactThreshold] = import_react45.useState(settings.compactThreshold);
69745
+ const [editingThreshold, setEditingThreshold] = import_react45.useState(false);
69746
+ const [thresholdInput, setThresholdInput] = import_react45.useState(String(settings.compactThreshold));
69747
+ const [validationError, setValidationError] = import_react45.useState(null);
69431
69748
  use_input_default((input, key) => {
69432
69749
  if (editingThreshold) {
69433
69750
  if (key.return) {
69434
- const value = parseInt(thresholdInput, 10);
69435
- if (isNaN(value)) {
69436
- setValidationError("Please enter a valid number");
69437
- } else if (value < 1 || value > 99) {
69438
- setValidationError(`Value must be between 1 and 99 (you entered ${value})`);
69751
+ const error48 = validateCompactThresholdInput(thresholdInput);
69752
+ if (error48) {
69753
+ setValidationError(error48);
69439
69754
  } else {
69755
+ const value = parseInt(thresholdInput, 10);
69440
69756
  setCompactThreshold(value);
69441
69757
  const updatedSettings = {
69442
69758
  ...settings,
@@ -69461,77 +69777,33 @@ var TerminalWidthMenu = ({ settings, onUpdate, onBack }) => {
69461
69777
  setValidationError(null);
69462
69778
  }
69463
69779
  }
69464
- } else {
69465
- if (key.escape) {
69466
- onBack();
69467
- } else if (key.upArrow) {
69468
- setSelectedIndex(Math.max(0, selectedIndex - 1));
69469
- } else if (key.downArrow) {
69470
- setSelectedIndex(Math.min(3, selectedIndex + 1));
69471
- } else if (key.return) {
69472
- if (selectedIndex === 3) {
69473
- onBack();
69474
- } else if (selectedIndex >= 0 && selectedIndex < options.length) {
69475
- const mode = options[selectedIndex];
69476
- if (mode) {
69477
- setSelectedOption(mode);
69478
- const updatedSettings = {
69479
- ...settings,
69480
- flexMode: mode,
69481
- compactThreshold
69482
- };
69483
- onUpdate(updatedSettings);
69484
- if (mode === "full-until-compact") {
69485
- setEditingThreshold(true);
69486
- }
69487
- }
69488
- }
69489
- }
69780
+ return;
69490
69781
  }
69491
- });
69492
- const optionDetails = [
69493
- {
69494
- value: "full",
69495
- label: "Full width always",
69496
- description: `Uses the full terminal width minus 4 characters for terminal padding. If the auto-compact message appears, it may cause the line to wrap.
69497
-
69498
- NOTE: If /ide integration is enabled, it's not recommended to use this mode.`
69499
- },
69500
- {
69501
- value: "full-minus-40",
69502
- label: "Full width minus 40 (default)",
69503
- description: "Leaves a gap to the right of the status line to accommodate the auto-compact message. This prevents wrapping but may leave unused space. This limitation exists because we cannot detect when the message will appear."
69504
- },
69505
- {
69506
- value: "full-until-compact",
69507
- label: "Full width until compact",
69508
- description: `Dynamically adjusts width based on context usage. When context reaches ${compactThreshold}%, it switches to leaving space for the auto-compact message.
69509
-
69510
- NOTE: If /ide integration is enabled, it's not recommended to use this mode.`
69782
+ if (key.escape) {
69783
+ onBack();
69511
69784
  }
69512
- ];
69513
- const currentOption = selectedIndex < 3 ? optionDetails[selectedIndex] : null;
69514
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69785
+ });
69786
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69515
69787
  flexDirection: "column",
69516
69788
  children: [
69517
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69789
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69518
69790
  bold: true,
69519
69791
  children: "Terminal Width"
69520
69792
  }, undefined, false, undefined, this),
69521
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69793
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69522
69794
  color: "white",
69523
69795
  children: "These settings affect where long lines are truncated, and where right-alignment occurs when using flex separators"
69524
69796
  }, undefined, false, undefined, this),
69525
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69797
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69526
69798
  dimColor: true,
69527
69799
  wrap: "wrap",
69528
69800
  children: "Claude code does not currently provide an available width variable for the statusline and features like IDE integration, auto-compaction notices, etc all cause the statusline to wrap if we do not truncate it"
69529
69801
  }, undefined, false, undefined, this),
69530
- editingThreshold ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69802
+ editingThreshold ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69531
69803
  marginTop: 1,
69532
69804
  flexDirection: "column",
69533
69805
  children: [
69534
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69806
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69535
69807
  children: [
69536
69808
  "Enter compact threshold (1-99):",
69537
69809
  " ",
@@ -69539,94 +69811,71 @@ NOTE: If /ide integration is enabled, it's not recommended to use this mode.`
69539
69811
  "%"
69540
69812
  ]
69541
69813
  }, undefined, true, undefined, this),
69542
- validationError ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69814
+ validationError ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69543
69815
  color: "red",
69544
69816
  children: validationError
69545
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69817
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69546
69818
  dimColor: true,
69547
69819
  children: "Press Enter to confirm, ESC to cancel"
69548
69820
  }, undefined, false, undefined, this)
69549
69821
  ]
69550
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
69551
- children: [
69552
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69553
- marginTop: 1,
69554
- flexDirection: "column",
69555
- children: [
69556
- optionDetails.map((opt, index) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69557
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69558
- color: selectedIndex === index ? "green" : undefined,
69559
- children: [
69560
- selectedIndex === index ? "▶ " : " ",
69561
- opt.label,
69562
- opt.value === selectedOption ? " ✓" : ""
69563
- ]
69564
- }, undefined, true, undefined, this)
69565
- }, opt.value, false, undefined, this)),
69566
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69567
- marginTop: 1,
69568
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69569
- color: selectedIndex === 3 ? "green" : undefined,
69570
- children: [
69571
- selectedIndex === 3 ? "▶ " : " ",
69572
- "← Back"
69573
- ]
69574
- }, undefined, true, undefined, this)
69575
- }, undefined, false, undefined, this)
69576
- ]
69577
- }, undefined, true, undefined, this),
69578
- currentOption && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69579
- marginTop: 1,
69580
- marginBottom: 1,
69581
- borderStyle: "round",
69582
- borderColor: "dim",
69583
- paddingX: 1,
69584
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69585
- flexDirection: "column",
69586
- children: [
69587
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69588
- children: [
69589
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69590
- color: "yellow",
69591
- children: currentOption.label
69592
- }, undefined, false, undefined, this),
69593
- currentOption.value === "full-until-compact" && ` | Current threshold: ${compactThreshold}%`
69594
- ]
69595
- }, undefined, true, undefined, this),
69596
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69597
- dimColor: true,
69598
- wrap: "wrap",
69599
- children: currentOption.description
69600
- }, undefined, false, undefined, this)
69601
- ]
69602
- }, undefined, true, undefined, this)
69603
- }, undefined, false, undefined, this)
69604
- ]
69605
- }, undefined, true, undefined, this)
69822
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(List, {
69823
+ marginTop: 1,
69824
+ items: buildTerminalWidthItems(selectedOption, compactThreshold),
69825
+ initialSelection: getTerminalWidthSelectionIndex(selectedOption),
69826
+ onSelect: (value) => {
69827
+ if (value === "back") {
69828
+ onBack();
69829
+ return;
69830
+ }
69831
+ setSelectedOption(value);
69832
+ const updatedSettings = {
69833
+ ...settings,
69834
+ flexMode: value,
69835
+ compactThreshold
69836
+ };
69837
+ onUpdate(updatedSettings);
69838
+ if (value === "full-until-compact") {
69839
+ setEditingThreshold(true);
69840
+ }
69841
+ },
69842
+ showBackButton: true
69843
+ }, undefined, false, undefined, this)
69606
69844
  ]
69607
69845
  }, undefined, true, undefined, this);
69608
69846
  };
69609
69847
  // src/tui/App.tsx
69610
- var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
69848
+ var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
69611
69849
  var GITHUB_REPO_URL = "https://github.com/sirmalloc/ccstatusline";
69850
+ function getConfirmCancelScreen(confirmDialog) {
69851
+ return confirmDialog?.cancelScreen ?? "main";
69852
+ }
69853
+ function clearInstallMenuSelection(menuSelections) {
69854
+ if (menuSelections.install === undefined) {
69855
+ return menuSelections;
69856
+ }
69857
+ const next = { ...menuSelections };
69858
+ delete next.install;
69859
+ return next;
69860
+ }
69612
69861
  var App2 = () => {
69613
69862
  const { exit } = use_app_default();
69614
- const [settings, setSettings] = import_react48.useState(null);
69615
- const [originalSettings, setOriginalSettings] = import_react48.useState(null);
69616
- const [hasChanges, setHasChanges] = import_react48.useState(false);
69617
- const [screen, setScreen] = import_react48.useState("main");
69618
- const [selectedLine, setSelectedLine] = import_react48.useState(0);
69619
- const [menuSelections, setMenuSelections] = import_react48.useState({});
69620
- const [confirmDialog, setConfirmDialog] = import_react48.useState(null);
69621
- const [isClaudeInstalled, setIsClaudeInstalled] = import_react48.useState(false);
69622
- const [terminalWidth, setTerminalWidth] = import_react48.useState(process.stdout.columns || 80);
69623
- const [powerlineFontStatus, setPowerlineFontStatus] = import_react48.useState({ installed: false });
69624
- const [installingFonts, setInstallingFonts] = import_react48.useState(false);
69625
- const [fontInstallMessage, setFontInstallMessage] = import_react48.useState(null);
69626
- const [existingStatusLine, setExistingStatusLine] = import_react48.useState(null);
69627
- const [flashMessage, setFlashMessage] = import_react48.useState(null);
69628
- const [previewIsTruncated, setPreviewIsTruncated] = import_react48.useState(false);
69629
- import_react48.useEffect(() => {
69863
+ const [settings, setSettings] = import_react46.useState(null);
69864
+ const [originalSettings, setOriginalSettings] = import_react46.useState(null);
69865
+ const [hasChanges, setHasChanges] = import_react46.useState(false);
69866
+ const [screen, setScreen] = import_react46.useState("main");
69867
+ const [selectedLine, setSelectedLine] = import_react46.useState(0);
69868
+ const [menuSelections, setMenuSelections] = import_react46.useState({});
69869
+ const [confirmDialog, setConfirmDialog] = import_react46.useState(null);
69870
+ const [isClaudeInstalled, setIsClaudeInstalled] = import_react46.useState(false);
69871
+ const [terminalWidth, setTerminalWidth] = import_react46.useState(process.stdout.columns || 80);
69872
+ const [powerlineFontStatus, setPowerlineFontStatus] = import_react46.useState({ installed: false });
69873
+ const [installingFonts, setInstallingFonts] = import_react46.useState(false);
69874
+ const [fontInstallMessage, setFontInstallMessage] = import_react46.useState(null);
69875
+ const [existingStatusLine, setExistingStatusLine] = import_react46.useState(null);
69876
+ const [flashMessage, setFlashMessage] = import_react46.useState(null);
69877
+ const [previewIsTruncated, setPreviewIsTruncated] = import_react46.useState(false);
69878
+ import_react46.useEffect(() => {
69630
69879
  getExistingStatusLine().then(setExistingStatusLine);
69631
69880
  loadSettings().then((loadedSettings) => {
69632
69881
  source_default.level = loadedSettings.colorLevel;
@@ -69647,13 +69896,13 @@ var App2 = () => {
69647
69896
  process.stdout.off("resize", handleResize);
69648
69897
  };
69649
69898
  }, []);
69650
- import_react48.useEffect(() => {
69899
+ import_react46.useEffect(() => {
69651
69900
  if (originalSettings) {
69652
69901
  const hasAnyChanges = JSON.stringify(settings) !== JSON.stringify(originalSettings);
69653
69902
  setHasChanges(hasAnyChanges);
69654
69903
  }
69655
69904
  }, [settings, originalSettings]);
69656
- import_react48.useEffect(() => {
69905
+ import_react46.useEffect(() => {
69657
69906
  if (flashMessage) {
69658
69907
  const timer = setTimeout(() => {
69659
69908
  setFlashMessage(null);
@@ -69679,7 +69928,7 @@ var App2 = () => {
69679
69928
  })();
69680
69929
  }
69681
69930
  });
69682
- const handleInstallSelection = import_react48.useCallback((command, displayName, useBunx) => {
69931
+ const handleInstallSelection = import_react46.useCallback((command, displayName, useBunx) => {
69683
69932
  getExistingStatusLine().then((existing) => {
69684
69933
  const isAlreadyInstalled = isKnownCommand(existing ?? "");
69685
69934
  let message;
@@ -69697,6 +69946,7 @@ Continue?`;
69697
69946
  }
69698
69947
  setConfirmDialog({
69699
69948
  message,
69949
+ cancelScreen: "install",
69700
69950
  action: async () => {
69701
69951
  await installStatusLine(useBunx);
69702
69952
  setIsClaudeInstalled(true);
@@ -69708,14 +69958,20 @@ Continue?`;
69708
69958
  setScreen("confirm");
69709
69959
  });
69710
69960
  }, []);
69711
- const handleNpxInstall = import_react48.useCallback(() => {
69961
+ const handleNpxInstall = import_react46.useCallback(() => {
69962
+ setMenuSelections((prev) => ({ ...prev, install: 0 }));
69712
69963
  handleInstallSelection(CCSTATUSLINE_COMMANDS.NPM, "npx", false);
69713
69964
  }, [handleInstallSelection]);
69714
- const handleBunxInstall = import_react48.useCallback(() => {
69965
+ const handleBunxInstall = import_react46.useCallback(() => {
69966
+ setMenuSelections((prev) => ({ ...prev, install: 1 }));
69715
69967
  handleInstallSelection(CCSTATUSLINE_COMMANDS.BUNX, "bunx", true);
69716
69968
  }, [handleInstallSelection]);
69969
+ const handleInstallMenuCancel = import_react46.useCallback(() => {
69970
+ setMenuSelections(clearInstallMenuSelection);
69971
+ setScreen("main");
69972
+ }, []);
69717
69973
  if (!settings) {
69718
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69974
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69719
69975
  children: "Loading settings..."
69720
69976
  }, undefined, false, undefined, this);
69721
69977
  }
@@ -69804,56 +70060,47 @@ ${GITHUB_REPO_URL}`,
69804
70060
  setSelectedLine(lineIndex);
69805
70061
  setScreen("items");
69806
70062
  };
69807
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
70063
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69808
70064
  flexDirection: "column",
69809
70065
  children: [
69810
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
70066
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69811
70067
  marginBottom: 1,
69812
70068
  children: [
69813
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
70069
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69814
70070
  bold: true,
69815
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(dist_default4, {
70071
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(dist_default4, {
69816
70072
  name: "retro",
69817
70073
  children: "CCStatusline Configuration"
69818
70074
  }, undefined, false, undefined, this)
69819
70075
  }, undefined, false, undefined, this),
69820
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
70076
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69821
70077
  bold: true,
69822
70078
  children: ` | ${getPackageVersion() && `v${getPackageVersion()}`}`
69823
70079
  }, undefined, false, undefined, this),
69824
- flashMessage && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
70080
+ flashMessage && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69825
70081
  color: flashMessage.color,
69826
70082
  bold: true,
69827
70083
  children: ` ${flashMessage.text}`
69828
70084
  }, undefined, false, undefined, this)
69829
70085
  ]
69830
70086
  }, undefined, true, undefined, this),
69831
- isCustomConfigPath() && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
70087
+ isCustomConfigPath() && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69832
70088
  dimColor: true,
69833
70089
  children: `Config: ${getConfigPath()}`
69834
70090
  }, undefined, false, undefined, this),
69835
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusLinePreview, {
70091
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusLinePreview, {
69836
70092
  lines: settings.lines,
69837
70093
  terminalWidth,
69838
70094
  settings,
69839
70095
  onTruncationChange: setPreviewIsTruncated
69840
70096
  }, undefined, false, undefined, this),
69841
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
70097
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69842
70098
  marginTop: 1,
69843
70099
  children: [
69844
- screen === "main" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(MainMenu, {
69845
- onSelect: (value) => {
70100
+ screen === "main" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(MainMenu, {
70101
+ onSelect: (value, index) => {
69846
70102
  if (value !== "save" && value !== "exit") {
69847
- const menuMap = {
69848
- lines: 0,
69849
- colors: 1,
69850
- powerline: 2,
69851
- terminalConfig: 3,
69852
- globalOverrides: 4,
69853
- install: 5,
69854
- starGithub: hasChanges ? 8 : 7
69855
- };
69856
- setMenuSelections((prev) => ({ ...prev, main: menuMap[value] ?? 0 }));
70103
+ setMenuSelections((prev) => ({ ...prev, main: index }));
69857
70104
  }
69858
70105
  handleMainMenuSelect(value);
69859
70106
  },
@@ -69864,7 +70111,7 @@ ${GITHUB_REPO_URL}`,
69864
70111
  settings,
69865
70112
  previewIsTruncated
69866
70113
  }, undefined, false, undefined, this),
69867
- screen === "lines" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(LineSelector, {
70114
+ screen === "lines" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(LineSelector, {
69868
70115
  lines: settings.lines,
69869
70116
  onSelect: (line) => {
69870
70117
  setMenuSelections((prev) => ({ ...prev, lines: line }));
@@ -69879,7 +70126,7 @@ ${GITHUB_REPO_URL}`,
69879
70126
  title: "Select Line to Edit Items",
69880
70127
  allowEditing: true
69881
70128
  }, undefined, false, undefined, this),
69882
- screen === "items" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ItemsEditor, {
70129
+ screen === "items" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ItemsEditor, {
69883
70130
  widgets: settings.lines[selectedLine] ?? [],
69884
70131
  onUpdate: (widgets) => {
69885
70132
  updateLine(selectedLine, widgets);
@@ -69891,7 +70138,7 @@ ${GITHUB_REPO_URL}`,
69891
70138
  lineNumber: selectedLine + 1,
69892
70139
  settings
69893
70140
  }, undefined, false, undefined, this),
69894
- screen === "colorLines" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(LineSelector, {
70141
+ screen === "colorLines" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(LineSelector, {
69895
70142
  lines: settings.lines,
69896
70143
  onLinesUpdate: updateLines,
69897
70144
  onSelect: (line) => {
@@ -69909,7 +70156,7 @@ ${GITHUB_REPO_URL}`,
69909
70156
  settings,
69910
70157
  allowEditing: false
69911
70158
  }, undefined, false, undefined, this),
69912
- screen === "colors" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ColorMenu, {
70159
+ screen === "colors" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ColorMenu, {
69913
70160
  widgets: settings.lines[selectedLine] ?? [],
69914
70161
  lineIndex: selectedLine,
69915
70162
  settings,
@@ -69922,7 +70169,7 @@ ${GITHUB_REPO_URL}`,
69922
70169
  setScreen("colorLines");
69923
70170
  }
69924
70171
  }, undefined, false, undefined, this),
69925
- screen === "terminalConfig" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(TerminalOptionsMenu, {
70172
+ screen === "terminalConfig" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(TerminalOptionsMenu, {
69926
70173
  settings,
69927
70174
  onUpdate: (updatedSettings) => {
69928
70175
  setSettings(updatedSettings);
@@ -69936,7 +70183,7 @@ ${GITHUB_REPO_URL}`,
69936
70183
  }
69937
70184
  }
69938
70185
  }, undefined, false, undefined, this),
69939
- screen === "terminalWidth" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(TerminalWidthMenu, {
70186
+ screen === "terminalWidth" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(TerminalWidthMenu, {
69940
70187
  settings,
69941
70188
  onUpdate: (updatedSettings) => {
69942
70189
  setSettings(updatedSettings);
@@ -69945,7 +70192,7 @@ ${GITHUB_REPO_URL}`,
69945
70192
  setScreen("terminalConfig");
69946
70193
  }
69947
70194
  }, undefined, false, undefined, this),
69948
- screen === "globalOverrides" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(GlobalOverridesMenu, {
70195
+ screen === "globalOverrides" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(GlobalOverridesMenu, {
69949
70196
  settings,
69950
70197
  onUpdate: (updatedSettings) => {
69951
70198
  setSettings(updatedSettings);
@@ -69955,24 +70202,23 @@ ${GITHUB_REPO_URL}`,
69955
70202
  setScreen("main");
69956
70203
  }
69957
70204
  }, undefined, false, undefined, this),
69958
- screen === "confirm" && confirmDialog && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ConfirmDialog, {
70205
+ screen === "confirm" && confirmDialog && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ConfirmDialog, {
69959
70206
  message: confirmDialog.message,
69960
70207
  onConfirm: () => void confirmDialog.action(),
69961
70208
  onCancel: () => {
69962
- setScreen("main");
70209
+ setScreen(getConfirmCancelScreen(confirmDialog));
69963
70210
  setConfirmDialog(null);
69964
70211
  }
69965
70212
  }, undefined, false, undefined, this),
69966
- screen === "install" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(InstallMenu, {
70213
+ screen === "install" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(InstallMenu, {
69967
70214
  bunxAvailable: isBunxAvailable(),
69968
70215
  existingStatusLine,
69969
70216
  onSelectNpx: handleNpxInstall,
69970
70217
  onSelectBunx: handleBunxInstall,
69971
- onCancel: () => {
69972
- setScreen("main");
69973
- }
70218
+ onCancel: handleInstallMenuCancel,
70219
+ initialSelection: menuSelections.install
69974
70220
  }, undefined, false, undefined, this),
69975
- screen === "powerline" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(PowerlineSetup, {
70221
+ screen === "powerline" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(PowerlineSetup, {
69976
70222
  settings,
69977
70223
  powerlineFontStatus,
69978
70224
  onUpdate: (updatedSettings) => {
@@ -70006,7 +70252,7 @@ ${GITHUB_REPO_URL}`,
70006
70252
  };
70007
70253
  function runTUI() {
70008
70254
  process.stdout.write("\x1B[2J\x1B[H");
70009
- render_default(/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(App2, {}, undefined, false, undefined, this));
70255
+ render_default(/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(App2, {}, undefined, false, undefined, this));
70010
70256
  }
70011
70257
  // src/types/StatusJSON.ts
70012
70258
  init_zod();