@xbzbing/dsh-git-panel 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -0
- package/README.md +4 -0
- package/lib/client.js +126 -32
- package/lib/host/actions.js +44 -2
- package/lib/host/core.d.ts +8 -2
- package/lib/host/core.js +15 -6
- package/lib/host/index.d.ts +8 -2
- package/lib/host/index.js +52 -5
- package/lib/host/open-file.d.ts +16 -0
- package/lib/host/open-file.js +29 -0
- package/lib/host/queries.d.ts +8 -0
- package/lib/host/queries.js +1 -0
- package/lib/host/suggest.js +5 -1
- package/lib/host/types.d.ts +35 -2
- package/lib/host/types.js +2 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({ id: "@xbzbing/dsh-git-panel", factory: (require) => {
|
|
2
2
|
var module = { exports: {} }; var exports = module.exports;
|
|
3
|
-
"use strict";var
|
|
3
|
+
"use strict";var Wr=require("react");var Ms=`
|
|
4
4
|
.gp-panel{display:flex;flex-direction:column;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-size:13px;position:relative;
|
|
5
5
|
/* One selection language across the three list panes (Overview commits,
|
|
6
6
|
* Changes rows, Files tree): primary-tinted fill + a 3px inset left bar. */
|
|
@@ -86,6 +86,12 @@ var module = { exports: {} }; var exports = module.exports;
|
|
|
86
86
|
.gp-btn--primary:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 85%,#000);color:#fff}
|
|
87
87
|
.gp-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer}
|
|
88
88
|
.gp-icon-btn:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
89
|
+
/* Tip shell: carries the hover handlers so a disabled child still explains
|
|
90
|
+
* itself. Hit-testing must reach the wrapper \u2014 a disabled control swallows
|
|
91
|
+
* pointer events in browsers \u2014 and the shell itself is a tight flex box so the
|
|
92
|
+
* child's geometry (and the tip anchor) is unchanged. */
|
|
93
|
+
.gp-tip-wrap{display:inline-flex;align-items:center;flex:none;min-width:0}
|
|
94
|
+
.gp-tip-wrap>.gp-icon-btn:disabled,.gp-tip-wrap>.gp-btn:disabled{pointer-events:none}
|
|
89
95
|
|
|
90
96
|
/* three-column overview \u2014 side columns shrink (with a min floor) instead of
|
|
91
97
|
* staying fixed, and the middle keeps a guaranteed min so it never collapses to
|
|
@@ -222,7 +228,17 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
222
228
|
.gp-changes__right{flex:1 1 0;min-width:180px;display:flex;flex-direction:column;min-height:0}
|
|
223
229
|
/* files browser: resizable tree column + preview pane */
|
|
224
230
|
.gp-files{display:flex;width:100%;height:100%;min-height:0}
|
|
225
|
-
|
|
231
|
+
/* The tree column keeps the entries in a scrolling child so the refresh
|
|
232
|
+
* control can float at the box's top-right corner: it neither takes a row of
|
|
233
|
+
* its own above the list nor scrolls away with the entries. */
|
|
234
|
+
.gp-files__tree-wrap{flex:0 0 300px;min-width:180px;position:relative;display:flex;flex-direction:column;min-height:0}
|
|
235
|
+
.gp-files__tree{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 0}
|
|
236
|
+
.gp-files__refresh{position:absolute;top:5px;right:10px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer}
|
|
237
|
+
.gp-files__refresh:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
238
|
+
.gp-files__refresh:disabled{opacity:.55;cursor:default}
|
|
239
|
+
.gp-files__refresh:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
240
|
+
.gp-files__refresh--busy svg{animation:gp-spin 1s linear infinite}
|
|
241
|
+
.gp-panel[data-layout="compact"] .gp-files__refresh{width:30px;height:30px}
|
|
226
242
|
.gp-files__preview{flex:1 1 0;min-width:180px;display:flex;flex-direction:column;min-height:0}
|
|
227
243
|
.gp-files__preview-content{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
|
|
228
244
|
.gp-files__bar{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:6px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
@@ -247,6 +263,7 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
247
263
|
.gp-files__props:disabled{opacity:0.5;cursor:default}
|
|
248
264
|
.gp-files__props:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
249
265
|
.gp-files__props[aria-pressed="true"]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);color:var(--dsw-alias-state-business-primary);border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary) 35%,transparent)}
|
|
266
|
+
.gp-files__scripts{font:600 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0.02em;padding:5px 6px}
|
|
250
267
|
.gp-files__mode-seg{flex:none}
|
|
251
268
|
/* Compact preview toolbar: the relative path and the two copy buttons are gone
|
|
252
269
|
* (they forced three wrapped rows on a phone). Back + the official source/render
|
|
@@ -267,7 +284,30 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
267
284
|
.gp-mermaid--loading{min-height:64px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-skeleton);color:var(--dsw-alias-label-tertiary)}
|
|
268
285
|
.gp-mermaid__loading-text{font-size:12px;line-height:20px}
|
|
269
286
|
.gp-mermaid__fallback{overflow:auto;background:var(--dsw-alias-markdown-code-block);border-radius:6px;padding:10px 12px;font-family:var(--dsw-font-mono,monospace);font-size:12px;margin:8px 0}
|
|
287
|
+
.gp-files__html-wrap{flex:1;min-height:0;display:flex;flex-direction:column}
|
|
288
|
+
.gp-files__html-note{flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
289
|
+
.gp-files__html-note-run{flex:none;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:3px 8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);cursor:pointer;font-size:12px}
|
|
290
|
+
.gp-files__html-note-run:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
291
|
+
.gp-files__html-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
|
|
270
292
|
.gp-files__html{flex:1;min-height:0;width:100%;border:0;background:#fff}
|
|
293
|
+
/* Covers the frame until its load event: a blob: document is drawn by another
|
|
294
|
+
* renderer process, so the panel shows an empty frame in the meantime. */
|
|
295
|
+
.gp-files__html-mask{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:16px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font-size:12px;transition:opacity .18s ease}
|
|
296
|
+
.gp-files__html-mask[data-state="ready"]{opacity:0;pointer-events:none}
|
|
297
|
+
/* A page that is merely slow must not look like a dead panel: the mask keeps
|
|
298
|
+
* showing but stops taking clicks, so the tree, the toolbar and the reader
|
|
299
|
+
* stay usable while the page finishes. */
|
|
300
|
+
.gp-files__html-mask[data-state="slow"]{pointer-events:none;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 72%,transparent)}
|
|
301
|
+
.gp-files__html-mask[data-state="slow"] .gp-files__html-mask-stop{pointer-events:auto}
|
|
302
|
+
.gp-files__html-mask-elapsed{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-tertiary)}
|
|
303
|
+
.gp-files__html-mask-stop{border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:3px 10px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;font-size:12px}
|
|
304
|
+
.gp-files__html-mask-stop:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
305
|
+
.gp-files__html-mask-stop:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
306
|
+
/* The platform loader owns its own animation; a transparent mask must not keep
|
|
307
|
+
* it running behind the finished page. */
|
|
308
|
+
.gp-files__html-mask-spin{flex:none;display:inline-flex}
|
|
309
|
+
.gp-files__html-mask[data-state="ready"] .gp-files__html-mask-spin *{animation:none}
|
|
310
|
+
.gp-files__html-mask-label{max-width:80%;text-align:center;line-height:1.5}
|
|
271
311
|
.gp-files__code{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;font-family:var(--dsw-font-mono,monospace);font-size:12px;position:relative}
|
|
272
312
|
/* Both sticky axes: the header must also stay put under horizontal scroll
|
|
273
313
|
* (reachable only in nowrap mode), or the find bar slides out of view. */
|
|
@@ -320,6 +360,15 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
320
360
|
/* A group kept only for its count has nothing to collapse: no chevron, no hand. */
|
|
321
361
|
.gp-group-head--static{cursor:default}
|
|
322
362
|
.gp-group-head__chev-spacer{display:inline-block;width:12px;flex:none}
|
|
363
|
+
/* Group select-all checkbox (issue #60): sits between the chevron and the
|
|
364
|
+
* label; a padded wrapper keeps the tap target \u226524px without changing the
|
|
365
|
+
* 14px box itself. */
|
|
366
|
+
.gp-group-head__pick{margin:0 2px;padding:6px;box-sizing:content-box;display:inline-flex;align-items:center;flex:none;cursor:pointer}
|
|
367
|
+
.gp-group-head__pick .gp-check{margin:0}
|
|
368
|
+
/* Truncation bar under the change list: expand lifts the host list cap,
|
|
369
|
+
* collapse returns to the capped poll. Sits between list and stash section. */
|
|
370
|
+
.gp-changes__expandbar{display:flex;align-items:center;gap:8px;padding:6px 12px;font-size:11px;color:var(--dsw-alias-label-tertiary);border-top:1px solid var(--dsw-alias-border-l2)}
|
|
371
|
+
.gp-changes__expandbar__text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
323
372
|
.gp-file-row{display:flex;align-items:center;gap:8px;padding:4px 10px 4px 20px;cursor:pointer;font-size:12px;border-radius:4px}
|
|
324
373
|
.gp-file-row:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
325
374
|
/* Selected change row: identical accent to the Git overview commit list
|
|
@@ -330,6 +379,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
330
379
|
* so hovering never changes the row's width \u2014 no wobble. */
|
|
331
380
|
.gp-file-row__actions{margin-left:auto;display:flex;gap:4px;flex:none;visibility:hidden}
|
|
332
381
|
.gp-file-row:hover .gp-file-row__actions{visibility:visible}
|
|
382
|
+
/* The trash glyph sits in an aria-hidden span; without flex the span is a
|
|
383
|
+
* baseline inline box and the SVG rides above the "+" text's centre line. */
|
|
384
|
+
.gp-file-row__actions .gp-icon-btn>span{display:inline-flex;align-items:center;justify-content:center}
|
|
333
385
|
|
|
334
386
|
/* stats bar */
|
|
335
387
|
.gp-stats{display:flex;align-items:center;gap:14px;padding:8px 12px;min-height:33px;box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);font-size:12px;color:var(--dsw-alias-label-secondary);flex:none;flex-wrap:wrap}
|
|
@@ -340,20 +392,26 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
340
392
|
.gp-stats__del{color:var(--dsw-alias-state-error-primary)}
|
|
341
393
|
/* "simplified" marker on a huge change set: muted + help cursor + dotted hint. */
|
|
342
394
|
.gp-stats__partial{color:var(--dsw-alias-label-tertiary);cursor:help;text-decoration:underline dotted;text-underline-offset:2px}
|
|
343
|
-
/* Compact stats bar: the counts on one clipped, never-wrapping line.
|
|
344
|
-
*
|
|
345
|
-
*
|
|
395
|
+
/* Compact stats bar: the counts on one clipped, never-wrapping line. A cramped
|
|
396
|
+
* panel (narrow and short) drops the timestamps entirely so the bar never costs
|
|
397
|
+
* a second row above the change list; a narrow-but-tall panel keeps them and
|
|
398
|
+
* spends that row, since it has the height to spare. */
|
|
346
399
|
.gp-stats--compact{padding:6px 8px 6px 12px;gap:4px 8px;align-items:center}
|
|
347
400
|
.gp-stats--compact .gp-stats__main{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:14px;overflow:hidden;white-space:nowrap}
|
|
348
401
|
.gp-stats--compact .gp-stats__main>.gp-stats__item{flex:none}
|
|
402
|
+
/* Timed compact: the timestamps take a full row of their own under the counts. */
|
|
403
|
+
.gp-stats--timed{flex-wrap:wrap}
|
|
404
|
+
.gp-stats--timed>.gp-stats__main{flex:1 1 100%}
|
|
405
|
+
.gp-stats--timed>.gp-stats__times{flex:1 1 100%;padding-top:2px}
|
|
349
406
|
|
|
350
407
|
/* commit box */
|
|
351
408
|
.gp-commitbox{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:8px 10px;display:flex;flex-direction:column;gap:8px}
|
|
352
409
|
.gp-commitbox__msg{width:100%;min-height:72px;resize:vertical;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:8px;box-sizing:border-box}
|
|
353
410
|
.gp-commitbox__msg-wrap{position:relative;display:block}
|
|
354
411
|
.gp-commitbox__msg-wrap--busy .gp-commitbox__msg{padding-right:28px}
|
|
355
|
-
/* Loading indicator inside the disabled field (AI suggest in flight)
|
|
356
|
-
|
|
412
|
+
/* Loading indicator inside the disabled field (AI suggest in flight): a
|
|
413
|
+
* positioning box around the platform loader. */
|
|
414
|
+
.gp-commitbox__spin{position:absolute;top:8px;right:8px;display:inline-flex;pointer-events:none}
|
|
357
415
|
.gp-commitbox__msg[readonly]{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);cursor:progress}
|
|
358
416
|
.gp-commitbox__msg:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
359
417
|
.gp-commitbox__row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
|
|
@@ -365,6 +423,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
365
423
|
.gp-commitbar__open:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
366
424
|
.gp-commitbar__ph,.gp-commitbar__draft{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
367
425
|
.gp-commitbar__ph{color:var(--dsw-alias-label-tertiary)}
|
|
426
|
+
/* Generation entry in the folded bar: the icon plus the two letters only, so it
|
|
427
|
+
* fits beside Commit on a phone (its accessible name keeps the full wording). */
|
|
428
|
+
.gp-commitbar__ai{flex:none;padding:0 8px;gap:5px}
|
|
368
429
|
.gp-panel[data-layout="compact"] .gp-commitbar .gp-btn{height:30px}
|
|
369
430
|
/* Compact commit row: AI suggest / Commit / fold all share the 30px height, so
|
|
370
431
|
* the fold button lines up with its neighbours and the row loses vertical padding. */
|
|
@@ -452,6 +513,13 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
452
513
|
.gp-svgdiff__bar{flex:none;display:flex;justify-content:flex-end;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
453
514
|
.gp-svgdiff__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
|
|
454
515
|
.gp-feedback{padding:6px 10px;font-size:12px;color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);display:flex;align-items:center;gap:8px}
|
|
516
|
+
/* Dismissible error banner: the message line is centred on a one-line banner;
|
|
517
|
+
* when the message wraps, the close control drops to the bottom-right corner. */
|
|
518
|
+
.gp-feedback--dismissible .gp-feedback__close{align-self:flex-end}
|
|
519
|
+
.gp-feedback__text{flex:1 1 auto;min-width:0}
|
|
520
|
+
.gp-feedback__close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;opacity:.75}
|
|
521
|
+
.gp-feedback__close:hover{opacity:1;background:var(--dsw-alias-interactive-bg-hover)}
|
|
522
|
+
.gp-feedback__close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
455
523
|
.gp-notice{padding:6px 10px;font-size:12px;color:var(--dsw-alias-label-secondary);background:color-mix(in srgb,var(--dsw-alias-label-secondary) 10%,transparent);display:flex;align-items:center;gap:8px}
|
|
456
524
|
/* Dismissible banner: the text takes the free width, the close button pins right. */
|
|
457
525
|
.gp-notice__text{flex:1 1 auto;min-width:0}
|
|
@@ -496,7 +564,6 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
496
564
|
.gp-modal__overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:20px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 82%,transparent);backdrop-filter:blur(1.5px);border-radius:inherit;animation:gp-fade-in .12s ease}
|
|
497
565
|
.gp-modal__overlay-label{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
498
566
|
@keyframes gp-fade-in{from{opacity:0}to{opacity:1}}
|
|
499
|
-
.gp-spinner{width:26px;height:26px;border-radius:50%;border:2.5px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-state-business-primary);animation:gp-spin .7s linear infinite}
|
|
500
567
|
.gp-modal__check{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer;user-select:none}
|
|
501
568
|
.gp-input{width:100%;box-sizing:border-box;height:30px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}
|
|
502
569
|
.gp-input:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}
|
|
@@ -592,6 +659,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
592
659
|
.gp-stash-row__meta{display:flex;gap:8px;font-size:10px;color:var(--dsw-alias-label-tertiary)}
|
|
593
660
|
.gp-stash-row__actions{flex:none;display:flex;align-items:center;gap:4px}
|
|
594
661
|
|
|
662
|
+
/* Publish strip above the commit editor: shown only while the branch exists
|
|
663
|
+
* solely on the local side, so a fresh local branch still has a visible way
|
|
664
|
+
* onto the remote (issue #63). Mirrors VSCode's "Publish Branch" affordance \u2014
|
|
665
|
+
* a full-width primary action directly above the commit message field. */
|
|
666
|
+
.gp-publishbar{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:8px 10px}
|
|
667
|
+
.gp-publishbar__btn{width:100%;justify-content:center}
|
|
668
|
+
.gp-panel[data-layout="compact"] .gp-publishbar__btn{height:30px}
|
|
669
|
+
|
|
595
670
|
/* commit hover card (middle column): pointer-anchored, lists changed files */
|
|
596
671
|
.gp-hovercard{position:fixed;z-index:70;padding:10px 12px;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:10px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));box-shadow:0 8px 28px rgba(0,0,0,.2),0 1px 3px rgba(0,0,0,.12);font-size:12px;pointer-events:none;max-height:60vh;overflow:hidden;display:flex;flex-direction:column}
|
|
597
672
|
.gp-hovercard__subject{font-weight:600;color:var(--dsw-alias-label-primary);margin-bottom:4px;white-space:normal;word-break:break-word;overflow-wrap:anywhere}
|
|
@@ -687,16 +762,24 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
687
762
|
* own classes / viewport media queries instead.
|
|
688
763
|
* =================================================================== */
|
|
689
764
|
|
|
690
|
-
/* Tab bar: one row.
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
|
|
765
|
+
/* Tab bar: one row. Compact shows the short tab labels (Git / \u53D8\u66F4 / \u6587\u4EF6)
|
|
766
|
+
* and drops the font stepper + version cluster entirely (the font step lives
|
|
767
|
+
* on the plugin config page). The long labels are swapped for short ones in
|
|
768
|
+
* Panel.tsx; nothing is clipped.
|
|
769
|
+
* Keep the platform track's grey module background and sliding indicator (the
|
|
770
|
+
* animation is transform on the indicator); only tighten the paddings so the
|
|
771
|
+
* short labels get more of the row width. */
|
|
772
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs{flex:1 1 auto;padding:2px;border-radius:8px}
|
|
697
773
|
.gp-panel[data-layout="compact"] .gp-tabbar__tabs--single{flex:0 0 auto}
|
|
774
|
+
/* Indicator width is an inline calc((100% - 8px) / n) from the primitive.
|
|
775
|
+
* Platform DOM contract pinned here: the indicator is a DIRECT span child with
|
|
776
|
+
* aria-hidden and that inline width \u2014 if the primitive wraps it or changes the
|
|
777
|
+
* width formula, compact indicator geometry breaks silently (watch the e2e). */
|
|
778
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs>span[aria-hidden="true"]{inset:2px auto 2px 2px;width:calc((100% - 4px) / 3) !important}
|
|
779
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs--single>span[aria-hidden="true"]{width:calc(100% - 4px) !important}
|
|
780
|
+
/* Slightly shorter cells + less side padding so "Overview" fits on a phone. */
|
|
781
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs>[role="tab"]{height:30px;padding:0 8px;font-size:12px}
|
|
698
782
|
.gp-panel[data-layout="compact"] .gp-tabbar__trailing{display:flex;flex:none;align-items:center;margin-left:auto}
|
|
699
|
-
.gp-panel[data-layout="compact"] .gp-tab__label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
|
|
700
783
|
|
|
701
784
|
/* Shared drill-in back bar (overview detail / files preview). The Changes
|
|
702
785
|
* diff and Files bar reuse just the .gp-subhead__back button inline. */
|
|
@@ -730,9 +813,20 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
730
813
|
/* Changes / Files: the single visible pane takes the full width. */
|
|
731
814
|
.gp-changes--compact .gp-changes__left,
|
|
732
815
|
.gp-changes--compact .gp-changes__right{flex:1 1 100%;min-width:0;width:100%}
|
|
733
|
-
.gp-files--compact .gp-files__tree,
|
|
816
|
+
.gp-files--compact .gp-files__tree-wrap,
|
|
734
817
|
.gp-files--compact .gp-files__preview{flex:1 1 100%;min-width:0;width:100%}
|
|
735
818
|
|
|
819
|
+
/* Fullscreen reader: the tab's live preview restyled in place \u2014 nothing is
|
|
820
|
+
* re-rendered, so a rendered HTML document keeps its frame and a code view
|
|
821
|
+
* keeps its scroll position. The card is fixed rather than portaled (moving
|
|
822
|
+
* the node would reload the frame), so it depends on no ancestor creating a
|
|
823
|
+
* containing block (transform, filter, contain: paint) and on the backdrop
|
|
824
|
+
* sitting below it in document order. */
|
|
825
|
+
.gp-files .gp-files__preview--full{position:fixed;inset:0;margin:auto;z-index:1000;width:min(920px,86vw);height:min(680px,82vh);min-width:0;max-height:100vh;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:14px;overflow:hidden;box-shadow:0 24px 64px rgba(0,0,0,.32),0 4px 12px rgba(0,0,0,.18);animation:gp-modal-in .18s cubic-bezier(.16,1,.3,1)}
|
|
826
|
+
.gp-files__fs-backdrop{position:fixed;inset:0;z-index:999;background:color-mix(in srgb,var(--dsw-alias-bg-base,#000) 62%,transparent);animation:gp-fade-in .12s ease}
|
|
827
|
+
.gp-files__fs-screen{flex:none}
|
|
828
|
+
|
|
829
|
+
|
|
736
830
|
/* Image compare stacks vertically in compact: two ~195px columns are unusable
|
|
737
831
|
* on a phone. The single-image before/after mode keeps its full-height row.
|
|
738
832
|
* The portaled diff modal lives outside .gp-panel, so it keeps side-by-side
|
|
@@ -808,21 +902,21 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
808
902
|
.gp-zl-close:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
809
903
|
.gp-zl-close:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:3px}
|
|
810
904
|
@media (prefers-reduced-motion:reduce){
|
|
811
|
-
.gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop,.gp-zl-mask{animation:none}
|
|
905
|
+
.gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop,.gp-zl-mask,.gp-files__html-mask,.gp-files__fs-backdrop,.gp-files__preview--full{animation:none;transition:none}
|
|
812
906
|
}
|
|
813
|
-
`,Er=!1;function ya(){if(Er||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){Er=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=Zi,document.head.appendChild(t),Er=!0}var ba={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","panel.fontSize":"\u9762\u677F\u5B57\u53F7","panel.tabs":"\u9762\u677F\u6807\u7B7E\u9875","tab.overview":"Git \u603B\u89C8","tab.changes":"\u53D8\u66F4\u8BB0\u5F55","tab.files":"\u6587\u4EF6\u6D4F\u89C8","pill.unavailable":"Git \u4E0D\u53EF\u7528","pill.detached":"\u6E38\u79BB HEAD","pill.synced":"\u672C\u5730\u5DF2\u540C\u6B65","pill.dirty":"\u6709\u5F85\u63D0\u4EA4\u7684\u53D8\u66F4","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.retry":"\u91CD\u8BD5","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","ops.aiHint":"\u63D0\u793A\uFF1A\u7ED9 AI \u591A\u4E00\u70B9\u4FE1\u4EFB\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u8BA9 AI \u76F4\u63A5\u6267\u884C Git \u64CD\u4F5C\u3002","version.check":"\u68C0\u67E5\u65B0\u7248\u672C","version.checking":"\u68C0\u67E5\u4E2D\u2026","version.upToDate":"\u5DF2\u662F\u6700\u65B0\uFF08{current}\uFF09","version.updateAvailable":"\u6709\u65B0\u7248\u672C {latest}\uFF08\u5F53\u524D {current}\uFF09","version.viewRelease":"\u67E5\u770B\u53D1\u5E03","version.error":"\u68C0\u67E5\u5931\u8D25","version.noRepo":"\u672A\u914D\u7F6E\u4ED3\u5E93\u5730\u5740","version.openRepo":"\u8BBF\u95EE GitHub \u67E5\u770B @xbzbing/dsh-git-panel \u9879\u76EE\uFF0C\u8BF7\u4E3A\u9879\u76EE\u70B9\u4EAE\u4E00\u9897\u5C0F\u661F\u661F\u5427 \u2B50","overview.head":"\u5168\u90E8\u5206\u652F","overview.local":"\u672C\u5730","overview.currentBranch":"\u5F53\u524D\u5206\u652F","overview.primaryBranch":"\u4E3B\u5206\u652F","overview.branchAhead":"\u6BD4\u4E0A\u6E38\u9886\u5148 {n} \u4E2A\u63D0\u4EA4","overview.branchBehind":"\u6BD4\u4E0A\u6E38\u843D\u540E {n} \u4E2A\u63D0\u4EA4","overview.remote":"\u8FDC\u7A0B","overview.tags":"\u6807\u7B7E","overview.search":"\u641C\u7D22\u63D0\u4EA4\uFF08\u6D88\u606F / \u54C8\u5E0C\uFF09","overview.searchShort":"\u641C\u7D22\u63D0\u4EA4","overview.allUsers":"\u5168\u90E8\u4F5C\u8005","overview.allTime":"\u5168\u90E8\u65F6\u95F4","overview.today":"\u4ECA\u5929","overview.last7d":"\u8FD1 7 \u5929","overview.last30d":"\u8FD1 30 \u5929","overview.selectCommit":"\u9009\u62E9\u4E00\u4E2A\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5","overview.noMessage":"\uFF08\u65E0\u63D0\u4EA4\u6B63\u6587\uFF09","overview.noResults":"\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4","overview.loadFailed":"\u52A0\u8F7D\u5931\u8D25","overview.detailFailed":"\u8BE6\u60C5\u52A0\u8F7D\u5931\u8D25","overview.diffFailed":"\u5DEE\u5F02\u52A0\u8F7D\u5931\u8D25","overview.openFileDiff":"\u67E5\u770B\u8BE5\u6587\u4EF6\u5728\u6B64\u63D0\u4EA4\u4E2D\u7684\u53D8\u66F4","overview.changeSummary":"{files} \u4E2A\u6587\u4EF6","overview.expandDir":"\u5C55\u5F00\u76EE\u5F55","overview.collapseDir":"\u6298\u53E0\u76EE\u5F55","overview.fetch":"\u62C9\u53D6\u8FDC\u7A0B","overview.branchesError":"\u5206\u652F\u52A0\u8F7D\u5931\u8D25","overview.filterBranch":"\u6309\u5206\u652F\u7B5B\u9009","overview.moreFilters":"\u66F4\u591A\u7B5B\u9009","overview.backToList":"\u8FD4\u56DE\u5217\u8868","overview.createTag":"\u521B\u5EFA\u6807\u7B7E","overview.revert":"\u8FD8\u539F\u6B64\u63D0\u4EA4","overview.reset":"\u91CD\u7F6E\u5230\u6B64","switch.action":"\u5207\u6362","switch.rowTitle":"\u5207\u6362\u5230 {name}","switch.rowTitleTrack":"\u4ECE {ref} \u65B0\u5EFA\u8DDF\u8E2A\u5206\u652F {name} \u5E76\u5207\u6362","switch.detached":"\u6E38\u79BB HEAD","switch.confirmTitle":"\u5207\u6362\u5206\u652F","switch.body":"\u4ECE {from} \u5207\u6362\u5230 {to}\u3002","switch.trackingNote":"\u672C\u5730\u8FD8\u6CA1\u6709 {name}\uFF0C\u5C06\u5148\u4ECE {ref} \u521B\u5EFA\u5B83\u5E76\u8BBE\u7F6E\u8DDF\u8E2A\uFF08upstream\uFF09\u3002","switch.dirtyWarn":"\u5F53\u524D\u6709 {count} \u4E2A\u6587\u4EF6\u5B58\u5728\u672A\u63D0\u4EA4\u53D8\u66F4\u3002","switch.modeDirect":"\u76F4\u63A5\u5207\u6362","switch.modeDirectHint":"\u672A\u63D0\u4EA4\u53D8\u66F4\u4F1A\u968F\u5DE5\u4F5C\u533A\u5E26\u8FC7\u53BB\uFF1B\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\uFF0CGit \u4F1A\u62D2\u7EDD\u5207\u6362\uFF0C\u5DE5\u4F5C\u533A\u4FDD\u6301\u4E0D\u53D8\u3002","switch.modeStash":"\u5148\u8D2E\u85CF {count} \u4E2A\u6587\u4EF6\u7684\u53D8\u66F4\uFF0C\u518D\u5207\u6362","switch.modeStashHint":"\u53D8\u66F4\u79FB\u5165\u8D2E\u85CF\u6808\u9876\uFF08\u542B\u672A\u8DDF\u8E2A\u6587\u4EF6\uFF09\uFF0C\u5207\u6362\u540E\u53EF\u4ECE\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\u3002\u6CE8\u610F\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u6062\u590D\uFF1B\u6062\u590D\u65F6\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\u9700\u624B\u52A8\u89E3\u51B3\u3002","switch.confirm":"\u5207\u6362","switch.confirmStash":"\u8D2E\u85CF\u5E76\u5207\u6362","switch.switching":"\u6B63\u5728\u5207\u6362\u2026","switch.stashMessage":"\u5207\u6362\u5230 {branch} \u524D\u81EA\u52A8\u8D2E\u85CF","tag.createTitle":"\u5728\u6B64\u63D0\u4EA4\u521B\u5EFA\u6807\u7B7E","tag.namePlaceholder":"\u6807\u7B7E\u540D","tag.annotated":"\u9644\u6CE8\u6807\u7B7E\uFF08\u5E26\u8BF4\u660E\uFF09","tag.messagePlaceholder":"\u6807\u7B7E\u8BF4\u660E","tag.create":"\u521B\u5EFA\u6807\u7B7E","tag.deleteTitle":"\u5220\u9664\u6807\u7B7E","tag.deleteConfirm":"\u786E\u5B9A\u5220\u9664\u6807\u7B7E\u300C{name}\u300D\uFF1F","tag.deleteOne":"\u5220\u9664\u6807\u7B7E\u300C{name}\u300D","ops.dirtyWarn":"\u68C0\u6D4B\u5230\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8FD9\u4E9B\u6539\u52A8\u53EF\u80FD\u662F dsh AI \u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\u3002","revert.title":"\u8FD8\u539F\u63D0\u4EA4","revert.body":"\u5C06\u5728\u5F53\u524D HEAD \u8FFD\u52A0\u4E00\u4E2A\u53CD\u5411\u63D0\u4EA4\uFF0C\u8FD8\u539F {ref} \u7684\u6539\u52A8\u3002\u4E0D\u4F1A\u4E22\u5F03\u4F60\u7684\u5DE5\u4F5C\u533A\u6539\u52A8\u3002","revert.confirm":"\u8FD8\u539F","reset.title":"\u91CD\u7F6E\u5206\u652F","reset.body":"\u5C06\u628A\u5F53\u524D\u5206\u652F\u7684 HEAD \u4ECE {from} \u79FB\u52A8\u5230 {to}\u3002","reset.modeSoft":"\u8F6F\u91CD\u7F6E\uFF08--soft\uFF09","reset.softHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u6682\u5B58\u533A\u3002","reset.modeMixed":"\u6DF7\u5408\u91CD\u7F6E\uFF08--mixed\uFF0C\u9ED8\u8BA4\uFF09","reset.mixedHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u5DE5\u4F5C\u533A\u3002","reset.modeHard":"\u786C\u91CD\u7F6E\uFF08--hard\uFF09","reset.hardHint":"\u79FB\u52A8 HEAD \u5230\u6B64\u63D0\u4EA4\u5E76\u4E22\u5F03\u6240\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF08\u672A\u63D0\u4EA4\u6539\u52A8\u65E0\u6CD5\u6062\u590D\uFF09\u3002","reset.hardOrphan":"\u5F53\u524D\u5206\u652F\u4E0A\u665A\u4E8E\u76EE\u6807\u7684\u63D0\u4EA4\u4F1A\u79BB\u5F00\u5206\u652F\uFF08\u4ECD\u53EF\u7528 git reflog \u627E\u56DE\uFF09\u3002","reset.hardWarn":"\u4EE5\u4E0B\u672A\u63D0\u4EA4\u6539\u52A8\u5C06\u88AB\u6C38\u4E45\u4E22\u5F03\uFF1A","reset.lostMore":"\u2026\u8FD8\u6709\u66F4\u591A\u672A\u63D0\u4EA4\u6539\u52A8\u672A\u663E\u793A\uFF08\u5217\u8868\u5DF2\u622A\u65AD\uFF09","reset.hardAck":"\u6211\u5DF2\u4E86\u89E3\uFF0C\u786E\u8BA4\u4E22\u5F03\u8FD9\u4E9B\u672A\u63D0\u4EA4\u6539\u52A8","reset.hardAckClean":"\u6211\u5DF2\u4E86\u89E3\u6B64\u64CD\u4F5C\u7684\u540E\u679C\uFF0C\u786E\u8BA4\u91CD\u7F6E","reset.confirm":"\u91CD\u7F6E","changes.groupStaged":"\u5DF2\u6682\u5B58\u7684\u66F4\u6539","changes.groupUnstaged":"\u66F4\u6539","changes.groupUntracked":"\u672A\u7248\u672C\u63A7\u5236\u7684\u6587\u4EF6","changes.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u53D8\u66F4","changes.noChanges":"\u6CA1\u6709\u672A\u63D0\u4EA4\u7684\u53D8\u66F4","changes.actions":"\u4ED3\u5E93\u53D8\u66F4\u64CD\u4F5C","changes.refresh":"\u5237\u65B0\u5F53\u524D\u4ED3\u5E93\u72B6\u6001","changes.stageAll":"\u5168\u90E8\u6682\u5B58","changes.unstageAll":"\u5168\u90E8\u53D6\u6D88\u6682\u5B58","changes.stage":"\u6682\u5B58","changes.unstage":"\u53D6\u6D88\u6682\u5B58","changes.discard":"\u653E\u5F03\u66F4\u6539","changes.discardConfirm":"\u518D\u6B21\u70B9\u51FB\u4EE5\u786E\u8BA4\u653E\u5F03","changes.stageTip":"\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u4E0B\u4E00\u6B21\u63D0\u4EA4\u4F1A\u5305\u542B\u5B83\u7684\u6539\u52A8","changes.unstageTip":"\u53D6\u6D88\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u6539\u52A8\u4ECD\u7559\u5728\u5DE5\u4F5C\u533A","changes.discardTip":"\u653E\u5F03\u6B64\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u6539\u52A8\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\uFF1B\u518D\u70B9\u4E00\u6B21\u786E\u8BA4","changes.discardTipArmed":"\u518D\u70B9\u4E00\u6B21\u5373\u653E\u5F03\u6B64\u6587\u4EF6\u7684\u6539\u52A8\uFF0C\u4E0D\u53EF\u6062\u590D","changes.discardPicked":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedTitle":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedBody":"\u5C06\u653E\u5F03 {count} \u4E2A\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u672A\u63D0\u4EA4\u66F4\u6539\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","changes.discardPickedStaged":"\u53E6\u6709 {count} \u4E2A\u9009\u4E2D\u9879\u5728\u6682\u5B58\u533A\uFF0C\u4E0D\u5728\u6B64\u6B21\u653E\u5F03\u8303\u56F4\uFF08\u5982\u9700\u64A4\u9500\u6682\u5B58\u8BF7\u7528\u300C\u53D6\u6D88\u6682\u5B58\u300D\uFF09\u3002","changes.discardPickedUntracked":"\u5176\u4E2D {count} \u4E2A\u662F\u672A\u8DDF\u8E2A\u7684\u6587\u4EF6\u6216\u76EE\u5F55\uFF0C\u5C06\u4ECE\u78C1\u76D8\u5220\u9664\uFF08\u4E0D\u5728 Git \u5386\u53F2\u4E2D\uFF0C\u65E0\u6CD5\u6062\u590D\uFF09\u3002","changes.discarding":"\u6B63\u5728\u653E\u5F03\u2026","changes.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","changes.untrackedCollapsed":"\u672A\u8DDF\u8E2A\u9879\u4EE5\u76EE\u5F55\u5F62\u5F0F\u663E\u793A\uFF0C\u672A\u9010\u4E2A\u5C55\u5F00","changes.truncatedCap":"\u53D8\u66F4\u8FC7\u591A\uFF0C\u5217\u8868\u4EC5\u663E\u793A\u524D {n} \u9879\uFF1B\u8BA1\u6570\u4ECD\u4E3A\u5168\u90E8\u53D8\u66F4\u7684\u7EDF\u8BA1","changes.truncatedLossy":"Git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF0C\u5217\u8868\u53EF\u80FD\u7F3A\u5C11\u5F00\u5934\u90E8\u5206","changes.truncatedUnknown":"\u5217\u8868\u4E0D\u5B8C\u6574\uFF0C\u53EF\u80FD\u7F3A\u5C11\u90E8\u5206\u53D8\u66F4","stash.title":"\u8D2E\u85CF\u5F53\u524D\u66F4\u6539","stash.messagePlaceholder":"\u8D2E\u85CF\u8BF4\u660E\uFF08\u53EF\u9009\uFF09","stash.save":"\u8D2E\u85CF","stash.section":"\u8D2E\u85CF","stash.onBranch":"\u4F4D\u4E8E {branch}","stash.apply":"\u5E94\u7528","stash.pop":"\u5F39\u51FA","stash.drop":"\u4E22\u5F03","stash.dropTitle":"\u4E22\u5F03\u8D2E\u85CF","stash.dropConfirm":"\u786E\u5B9A\u4E22\u5F03\u6B64\u8D2E\u85CF\u6761\u76EE\uFF1F\u4E22\u5F03\u540E\u65E0\u6CD5\u6062\u590D\uFF1A{name}","files.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.loadFailed":"\u52A0\u8F7D\u5931\u8D25","files.notFound":"\u6587\u4EF6\u4E0D\u5B58\u5728\uFF08\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u79FB\u52A8\uFF09","files.backToTree":"\u8FD4\u56DE\u6587\u4EF6\u6811","files.truncated":"\u6761\u76EE\u8FC7\u591A\uFF0C\u5DF2\u622A\u65AD","files.tooLarge":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8","files.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u9884\u89C8","files.highlightOff":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5173\u95ED\u8BED\u6CD5\u9AD8\u4EAE\u4EE5\u4FDD\u6301\u6D41\u7545","files.lineTruncated":" \u2026\uFF08\u6B64\u884C\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09","files.findPlaceholder":"\u5728\u6B64\u6587\u4EF6\u4E2D\u67E5\u627E","files.findNoMatch":"\u65E0\u5339\u914D","files.findPrev":"\u4E0A\u4E00\u4E2A","files.findNext":"\u4E0B\u4E00\u4E2A","files.findClose":"\u5173\u95ED\u67E5\u627E","files.findCase":"\u533A\u5206\u5927\u5C0F\u5199","files.previewMode":"\u9884\u89C8\u65B9\u5F0F","files.source":"\u6E90\u7801","files.render":"\u6E32\u67D3","files.wrap":"\u81EA\u52A8\u6362\u884C","files.wrapDisabled":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u81EA\u52A8\u6362\u884C\u4E0D\u53EF\u7528","files.mermaidLoading":"\u6B63\u5728\u52A0\u8F7D\u56FE\u8868\u5F15\u64CE\u2026","files.copyPath":"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","files.pathCopied":"\u8DEF\u5F84\u5DF2\u590D\u5236","files.pathCopyFailed":"\u590D\u5236\u5931\u8D25","files.copyContent":"\u590D\u5236\u6587\u4EF6\u5185\u5BB9","files.contentCopied":"\u5185\u5BB9\u5DF2\u590D\u5236","files.contentCopyFailed":"\u590D\u5236\u5931\u8D25","files.ignored":"\u5DF2\u88AB Git \u5FFD\u7565","files.copy":"\u590D\u5236\u4EE3\u7801","files.copied":"\u5DF2\u590D\u5236","files.footnotes":"\u6CE8\u91CA","files.zoomBar":"\u56FE\u7247\u7F29\u653E","files.zoomIn":"\u653E\u5927","files.zoomOut":"\u7F29\u5C0F","files.zoomActual":"\u5B9E\u9645\u5927\u5C0F\uFF08100%\uFF09","files.zoomFit":"\u9002\u5E94\u7A97\u53E3","files.zoomFullscreen":"\u5168\u5C4F\u67E5\u770B","files.fullscreen":"\u5168\u5C4F\u67E5\u770B\u6587\u4EF6","files.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","files.propsTitle":"\u6587\u4EF6\u5C5E\u6027","files.propsGroupStats":"\u5927\u5C0F\u4E0E\u7EDF\u8BA1","files.propsGroupTime":"\u65F6\u95F4","files.propsName":"\u540D\u79F0","files.propsType":"\u7C7B\u578B","files.propsTypeImage":"{fmt} \u56FE\u7247","files.propsTypeText":"\u6587\u672C\u6587\u4EF6","files.propsTypeBinary":"\u4E8C\u8FDB\u5236\u6587\u4EF6","files.propsTypeUnread":"\u8FC7\u5927\u672A\u8BFB\u53D6","files.propsTypeFmt":"{label}\uFF08.{ext}\uFF09","files.propsRelPath":"\u76F8\u5BF9\u8DEF\u5F84","files.propsAbsPath":"\u7EDD\u5BF9\u8DEF\u5F84","files.propsCopyHint":"\u70B9\u51FB\u590D\u5236","files.propsSize":"\u5927\u5C0F","files.propsSizeBytes":"\uFF08{bytes} \u5B57\u8282\uFF09","files.propsLines":"\u884C\u6570","files.propsImageSize":"\u56FE\u7247\u5C3A\u5BF8","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"\u4FEE\u6539\u65F6\u95F4","files.propsUntracked":"\u672A\u8DDF\u8E2A","files.propsTrackedYes":"\u5DF2\u8DDF\u8E2A","files.propsStaged":"\u5DF2\u6682\u5B58","files.stAdded":"\u5DF2\u6DFB\u52A0","files.stModified":"\u5DF2\u4FEE\u6539","files.stDeleted":"\u5DF2\u5220\u9664","files.stRenamed":"\u5DF2\u91CD\u547D\u540D","files.stConflicted":"\u6709\u51B2\u7A81","files.stTypechange":"\u7C7B\u578B\u53D8\u66F4","stats.files":"{n} \u4E2A\u6587\u4EF6","stats.lastChange":"\u6700\u8FD1\u53D8\u66F4 {time}","stats.lastCommit":"\u4E0A\u6B21\u63D0\u4EA4 {time}","stats.staged":"\u5DF2\u6682\u5B58 {n}","stats.modified":"\u5DF2\u4FEE\u6539 {n}","stats.untracked":"\u672A\u8DDF\u8E2A {n}","stats.partial":"\u7EDF\u8BA1\u5DF2\u7B80\u5316","stats.partialHint":"\u53D8\u66F4\u6570\u91CF\u8F83\u591A\uFF0C\u5DF2\u8DF3\u8FC7\u672A\u8DDF\u8E2A\u6587\u4EF6\u884C\u6570\u4E0E\u6700\u8FD1\u53D8\u66F4\u65F6\u95F4\u7684\u7CBE\u786E\u7EDF\u8BA1\u4EE5\u4FDD\u6301\u9762\u677F\u6D41\u7545\u3002","commit.placeholder":"\u63D0\u4EA4\u4FE1\u606F","commit.commit":"\u63D0\u4EA4","commit.amend":"Amend \u63D0\u4EA4","commit.edit":"\u7F16\u8F91\u63D0\u4EA4\u4FE1\u606F","commit.collapse":"\u6536\u8D77\u63D0\u4EA4\u6846","commit.suggest":"AI \u751F\u6210","commit.suggesting":"\u751F\u6210\u4E2D\u2026","commit.suggestOverwrite":"\u518D\u6B21\u70B9\u51FB\u300CAI \u751F\u6210\u300D\u4EE5\u8986\u76D6\u5F53\u524D\u63D0\u4EA4\u4FE1\u606F","commit.suggestTruncated":"diff \u8FC7\u957F\u5DF2\u622A\u65AD\uFF0C\u751F\u6210\u7684\u5EFA\u8BAE\u53EF\u80FD\u4E0D\u5B8C\u6574","diff.unified":"\u7EDF\u4E00","diff.split":"\u5BF9\u7167","diff.before":"\u53D8\u66F4\u524D","diff.after":"\u53D8\u66F4\u540E","diff.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.tooLarge":"\u56FE\u7247\u8FC7\u5927\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.imageMissing":"\u4E0D\u5B58\u5728","diff.svgRender":"\u6E32\u67D3","diff.svgSource":"\u6E90\u7801","diff.empty":"\u65E0\u5DEE\u5F02","diff.expandAll":"\u5C55\u5F00\u5168\u90E8","diff.collapse":"\u6298\u53E0\u672A\u53D8\u66F4","diff.expandGap":"\u5C55\u5F00\u5168\u90E8 {n} \u884C","diff.expandUp":"\u5411\u4E0A\u5C55\u5F00 {n} \u884C","diff.expandDown":"\u5411\u4E0B\u5C55\u5F00 {n} \u884C","diff.expandCapped":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5C55\u5F00 {n} \u884C\u4E0A\u4E0B\u6587\uFF0C\u5176\u4F59\u4FDD\u6301\u6298\u53E0\uFF0C\u53EF\u9010\u6BB5\u5C55\u5F00","diff.truncated":"git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF1A\u6B64\u5DEE\u5F02\u53EA\u4FDD\u7559\u4E86\u5C3E\u6BB5\uFF0C\u5F00\u5934\u7684\u6539\u52A8\u4E0E\u589E\u5220\u7EDF\u8BA1\u53EF\u80FD\u7F3A\u5931","time.justNow":"\u521A\u521A","time.minutesAgo":"{n} \u5206\u949F\u524D","time.hoursAgo":"{n} \u5C0F\u65F6\u524D","time.daysAgo":"{n} \u5929\u524D","error.generic":"\u64CD\u4F5C\u5931\u8D25","error.notARepo":"\u5F53\u524D\u76EE\u5F55\u4E0D\u662F Git \u4ED3\u5E93","error.noCwd":"\u5F53\u524D\u4F1A\u8BDD\u65E0\u5DE5\u4F5C\u76EE\u5F55","error.localChangesBlock":"\u672C\u5730\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u64CD\u4F5C\u88AB\u963B\u6B62","error.emptyMessage":"\u63D0\u4EA4\u4FE1\u606F\u4E0D\u80FD\u4E3A\u7A7A","error.emptyDiff":"\u6CA1\u6709\u53EF\u751F\u6210\u7684\u53D8\u66F4","error.llmUnavailable":"AI \u670D\u52A1\u4E0D\u53EF\u7528","error.llmFailed":"AI \u751F\u6210\u5931\u8D25","error.suggestDisabled":"AI \u751F\u6210\u5DF2\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u5173\u95ED","error.conflict":"\u8D2E\u85CF\u5E94\u7528\u4EA7\u751F\u51B2\u7A81\uFF0C\u8D2E\u85CF\u6761\u76EE\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u624B\u52A8\u89E3\u51B3\u51B2\u7A81\u540E\u518D\u8BD5","error.revertConflict":"\u8FD8\u539F\u4F1A\u4E0E\u5F53\u524D\u5185\u5BB9\u51B2\u7A81\uFF0C\u5DF2\u81EA\u52A8\u53D6\u6D88\u8FD8\u539F\uFF08\u672A\u6539\u52A8\u4F60\u7684\u5DE5\u4F5C\u533A\uFF09","error.revertStuck":"\u8FD8\u539F\u4EA7\u751F\u51B2\u7A81\u4E14\u81EA\u52A8\u53D6\u6D88\u5931\u8D25\uFF0C\u4ED3\u5E93\u4ECD\u5904\u4E8E\u8FD8\u539F\u4E2D\uFF0C\u8BF7\u624B\u52A8\u6267\u884C git revert --abort \u6216\u89E3\u51B3\u51B2\u7A81","error.revertMerge":"\u8FD9\u662F\u4E00\u4E2A\u5408\u5E76\u63D0\u4EA4\uFF0C\u9762\u677F\u6682\u4E0D\u652F\u6301\u8FD8\u539F\uFF08\u9700\u6307\u5B9A\u4E3B\u7EBF\u7236\u63D0\u4EA4\uFF09\uFF0C\u8BF7\u5728\u547D\u4EE4\u884C\u7528 git revert -m \u5904\u7406","error.indexBusy":"Git \u6B63\u5FD9\uFF08\u53E6\u4E00\u8FDB\u7A0B\u5360\u7528\u7D22\u5F15\uFF09\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","error.notFound":"\u76EE\u6807\u4E0D\u5B58\u5728\uFF08\u5206\u652F / \u6807\u7B7E / \u8D2E\u85CF\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u91CD\u547D\u540D\uFF09","error.branchInUse":"\u8BE5\u5206\u652F\u5DF2\u5728\u53E6\u4E00\u4E2A\u5DE5\u4F5C\u6811\u4E2D\u68C0\u51FA\uFF0C\u65E0\u6CD5\u5728\u6B64\u5207\u6362","error.nestedRepo":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u653E\u5F03\u4F1A\u8FDE\u5E26\u5220\u9664\u6574\u4E2A\u5185\u90E8\u4ED3\u5E93\uFF1B\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.nestedRepoPartial":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u62D2\u7EDD\u8FDE\u5E26\u5220\u9664\uFF1B\u4F46\u540C\u6279\u4E2D\u4F4D\u4E8E\u5B83\u4E4B\u524D\u7684\u6761\u76EE\u5DF2\u7ECF\u88AB\u5220\u9664\u4E86\uFF0C\u8BF7\u5237\u65B0\u540E\u786E\u8BA4\u5269\u4F59\u53D8\u66F4\uFF0C\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.stashSwitchFailed":"\u672A\u63D0\u4EA4\u53D8\u66F4\u5DF2\u8D2E\u85CF\uFF08\u53EF\u5728\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\uFF09\uFF0C\u4F46\u5207\u6362\u5931\u8D25\uFF1A{reason}","error.invalidName":"\u540D\u79F0\u4E0D\u5408\u6CD5","error.notFastForward":"\u672C\u5730\u4E0E\u8FDC\u7A0B\u5206\u652F\u5DF2\u5206\u53C9\uFF0C\u65E0\u6CD5\u5FEB\u8FDB\u62C9\u53D6\uFF0C\u8BF7\u624B\u52A8\u5408\u5E76\u6216\u53D8\u57FA","error.pushRejected":"\u63A8\u9001\u88AB\u62D2\u7EDD\uFF1A\u8FDC\u7A0B\u5DF2\u6709\u65B0\u63D0\u4EA4\uFF0C\u8BF7\u5148\u300C\u68C0\u67E5\u540C\u6B65\u300D\u5E76\u62C9\u53D6\u540E\u518D\u63A8\u9001","error.authFailed":"\u8BA4\u8BC1\u5931\u8D25\uFF1A\u6CA1\u6709\u53EF\u7528\u7684 git \u51ED\u636E\uFF08HTTPS \u9700\u51ED\u636E\u52A9\u624B\u3001SSH \u9700\u5BC6\u94A5\uFF09\u3002\u8BF7\u5148\u5728\u547D\u4EE4\u884C\u5B8C\u6210\u4E00\u6B21\u63A8\u9001\u4EE5\u7F13\u5B58\u51ED\u636E","status.openRepo":"\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.openRepoOn":"\u5728 {host} \u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.synced":"\u5DF2\u4E0E\u8FDC\u7A0B\u540C\u6B65","status.ahead":"\u9886\u5148 {n}","status.behind":"\u843D\u540E {n}","status.diverged":"\u5DF2\u5206\u53C9\uFF08\u9886\u5148 {ahead} / \u843D\u540E {behind}\uFF09","status.noUpstream":"\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u5206\u652F","status.detached":"\u6E38\u79BB HEAD\uFF0C\u65E0\u5206\u652F\u540C\u6B65\u72B6\u6001","status.check":"\u68C0\u67E5\u540C\u6B65\u72B6\u6001","status.checkTitle":"\u68C0\u67E5\u4E0E\u8FDC\u7A0B\u7684\u540C\u6B65\u72B6\u6001\uFF1A\u6267\u884C git fetch \u62C9\u53D6\u6700\u65B0\u5F15\u7528\u5E76\u5237\u65B0\u9886\u5148/\u843D\u540E\u8BA1\u6570\uFF0C\u4E0D\u6539\u52A8\u5DE5\u4F5C\u533A","status.pull":"\u62C9\u53D6","status.pulling":"\u540C\u6B65\u4E2D\u2026","status.pullTitle":"\u5FEB\u8FDB\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmTitle":"\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmBody":"\u5C06\u4EE5\u5FEB\u8FDB\u65B9\u5F0F\u628A\u5F53\u524D\u5206\u652F {branch} \u66F4\u65B0\u5230\u8FDC\u7A0B\u6700\u65B0\u63D0\u4EA4\uFF08\u843D\u540E {behind} \u4E2A\u63D0\u4EA4\uFF09\u3002\u4EC5\u5728\u672A\u5206\u53C9\u65F6\u53EF\u884C\uFF0C\u4E0D\u4F1A\u4EA7\u751F\u5408\u5E76\u63D0\u4EA4\uFF0C\u4E5F\u4E0D\u4F1A\u6539\u52A8\u4F60\u7684\u672A\u63D0\u4EA4\u5185\u5BB9\u3002","status.pullConfirm":"\u62C9\u53D6","status.pullScope":"\u5C06\u5F15\u5165 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pullScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u8FDC\u7A0B\u5DEE\u5F02\u2026","status.push":"\u63A8\u9001","status.pushTitle":"\u63A8\u9001\u672C\u5730\u63D0\u4EA4\u5230\u8FDC\u7A0B","status.pushConfirmTitle":"\u63A8\u9001\u5230\u8FDC\u7A0B","status.pushConfirmBody":"\u5C06\u628A\u5F53\u524D\u5206\u652F {branch} \u9886\u5148\u8FDC\u7A0B\u7684 {ahead} \u4E2A\u63D0\u4EA4\u63A8\u9001\u5230\u4E0A\u6E38\u3002\u4EC5\u505A\u5FEB\u8FDB\u63A8\u9001\uFF0C\u4E0D\u4F1A\u5F3A\u5236\u8986\u76D6\u8FDC\u7A0B\u5386\u53F2\u3002","status.pushConfirm":"\u63A8\u9001","status.pushing":"\u63A8\u9001\u4E2D\u2026","status.pushScope":"\u5C06\u63A8\u9001 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pushScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u5F85\u63A8\u9001\u5DEE\u5F02\u2026","status.publish":"\u53D1\u5E03","status.publishTitle":"\u53D1\u5E03\u5206\u652F\u5E76\u8BBE\u7F6E\u4E0A\u6E38","status.publishConfirmTitle":"\u53D1\u5E03\u5206\u652F\u5230\u8FDC\u7A0B","status.publishConfirmBody":"\u5F53\u524D\u5206\u652F {branch} \u5C1A\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u3002\u5C06\u6267\u884C git push -u {remote} \u5728\u8FDC\u7A0B\u521B\u5EFA\u540C\u540D\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\u8DDF\u8E2A\u3002","status.publishConfirm":"\u53D1\u5E03","status.publishing":"\u53D1\u5E03\u4E2D\u2026","cfg.title":"\u8F93\u5165\u6846\u5206\u652F\u6807\u8BB0","cfg.toggle":"\u663E\u793A\u8F93\u5165\u6846\u6807\u8BB0","cfg.hint":"\u5F00\u542F\u65F6\u5728\u8F93\u5165\u6846\u663E\u793A zsh \u98CE\u683C\u7684 <\u4ED3\u5E93\u540D> (\u5206\u652F) \u6807\u8BB0\uFF1B\u5173\u95ED\u540E\u6539\u4E3A\u5728 Git \u6807\u7B7E\u65C1\u663E\u793A\u72B6\u6001\u5706\u70B9\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffTitle":"\u5DEE\u5F02\u5BF9\u6BD4\u9ED8\u8BA4\u89C6\u56FE","cfg.diffHint":"\u9009\u62E9\u53D8\u66F4\u5BF9\u6BD4\u9ED8\u8BA4\u6253\u5F00\u7684\u5E03\u5C40\uFF1A\u7EDF\u4E00\u89C6\u56FE\u4E3A\u5355\u680F\u884C\u5185\u5BF9\u6BD4\uFF0C\u5E76\u6392\u89C6\u56FE\u4E3A\u5DE6\u53F3\u5206\u680F\u5BF9\u6BD4\u3002\u4ECD\u53EF\u5728\u6BCF\u4E2A\u5DEE\u5F02\u89C6\u56FE\u4E2D\u4E34\u65F6\u5207\u6362\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffUnified":"\u7EDF\u4E00\u89C6\u56FE\uFF08\u5355\u680F\u884C\u5185\uFF09","cfg.diffSplit":"\u5E76\u6392\u89C6\u56FE\uFF08\u5DE6\u53F3\u5206\u680F\uFF09","cfg.graphTitle":"\u63D0\u4EA4\u5386\u53F2\u56FE\u7EBF\u6761\u6837\u5F0F","cfg.graphHint":"\u9009\u62E9\u63D0\u4EA4\u5386\u53F2\u56FE\u7684\u8FDE\u7EBF\u753B\u6CD5\uFF1A\u5E73\u884C\u7EBF\u4E3A VSCode / \u56FE\u5F62\u754C\u9762\u98CE\u683C\uFF0C\u5206\u652F\u5404\u5360\u4E00\u5217\u3001\u5171\u4EAB\u7956\u5148\u4EE5\u5E76\u884C\u7EBF\u8868\u793A\uFF1B\u7D27\u51D1\u4E3A git log \u547D\u4EE4\u884C\u98CE\u683C\uFF0C\u5171\u4EAB\u7956\u5148\u5408\u5E76\u4E3A\u4E00\u5217\u3001\u7EBF\u66F4\u5C11\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.graphParallel":"\u5E73\u884C\u7EBF\uFF08VSCode \u98CE\u683C\uFF09","cfg.graphCompact":"\u7D27\u51D1\uFF08git log \u98CE\u683C\uFF09","cfg.suggestTitle":"AI \u751F\u6210\u63D0\u4EA4\u4FE1\u606F","cfg.suggestToggle":"\u63D0\u4EA4\u6846\u663E\u793A AI \u751F\u6210\u6309\u94AE","cfg.suggestLangLabel":"\u751F\u6210\u8BED\u8A00","cfg.suggestLangAuto":"\u81EA\u52A8","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"\u81EA\u52A8 = \u8DDF\u968F\u4F60\u5728\u6B64\u4ED3\u5E93\u7684\u63D0\u4EA4\u8BED\u8A00\uFF08\u5C31\u8FD1\u52A0\u6743\uFF0C\u5F53\u524D git \u4F5C\u8005\u4F18\u5148\uFF0C\u5FFD\u7565 release / merge \u7B49\u673A\u68B0\u63D0\u4EA4\uFF09\uFF1B\u4E2D\u6587 / English \u76F4\u63A5\u6307\u5B9A\u3002","cfg.suggestMaxBytesLabel":"\u8F93\u5165\u9884\u7B97","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"\u53D1\u9001\u7ED9\u6A21\u578B\u7684 diff \u4E0A\u9650\uFF0C\u8D85\u51FA\u4F1A\u622A\u65AD\uFF1B\u8303\u56F4 16\u2013512\u3002","cfg.suggestOutputLabel":"\u8F93\u51FA\u4E0A\u9650","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"\u6A21\u578B\u751F\u6210\u9884\u7B97\uFF1B\u601D\u8003\u6A21\u578B\u7684\u63A8\u7406\u8BA1\u5165\u8BE5\u9884\u7B97\uFF1B\u8303\u56F4 256\u201316384\u3002","cfg.suggestTimeoutLabel":"\u751F\u6210\u8D85\u65F6","cfg.suggestTimeoutUnit":"\u79D2","cfg.suggestTimeoutHint":"\u8D85\u65F6\u5373\u751F\u6210\u5931\u8D25\uFF1B\u8303\u56F4 5\u2013120\u3002","cfg.suggestModelLabel":"\u6A21\u578B","cfg.suggestModelSession":"\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4","cfg.suggestModelLoading":"\u52A0\u8F7D\u6A21\u578B\u5217\u8868\u2026","cfg.suggestModelEmpty":"\u672A\u68C0\u6D4B\u5230\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u5148\u5728 DSH \u8BBE\u7F6E\u4E2D\u914D\u7F6E","cfg.suggestModelFailed":"\u6A21\u578B\u5217\u8868\u52A0\u8F7D\u5931\u8D25","cfg.suggestModelRetry":"\u91CD\u8BD5","cfg.suggestProviderLabel":"\u63D0\u4F9B\u65B9","cfg.suggestModelPick":"\u9009\u62E9\u6A21\u578B","cfg.suggestEffortLabel":"\u63A8\u7406\u5F3A\u5EA6","cfg.suggestEffortUnset":"\u4E0D\u8BBE\u7F6E\uFF08\u7528\u6A21\u578B\u9ED8\u8BA4\uFF09","cfg.suggestHint":"\u5F00\u542F\u540E\u63D0\u4EA4\u6846\u65C1\u4F1A\u51FA\u73B0\u300CAI \u751F\u6210\u300D\u6309\u94AE\uFF1A\u6839\u636E\u5F53\u524D\u53D8\u66F4\u4E0E\u4ED3\u5E93\u65E2\u6709\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u9009\u56FA\u5B9A\u6A21\u578B\u540E\uFF0C\u751F\u6210\u4F1A\u628A diff \u53D1\u7ED9\u8BE5\u6A21\u578B\u7684\u4F9B\u5E94\u5546\uFF1B\u9009\u300C\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4\u300D\u5219\u7528\u5F53\u524D\u4F1A\u8BDD\u7684 Agent \u6A21\u578B\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.notLoaded":"\u914D\u7F6E\u672A\u52A0\u8F7D\uFF1A\u8BE5\u914D\u7F6E\u7531\u8FD0\u884C\u4E2D\u7684\u5BBF\u4E3B\u63D0\u4F9B\uFF0C\u82E5\u957F\u65F6\u95F4\u7A7A\u767D\u8BF7\u91CD\u542F DSH \u540E\u91CD\u8BD5\u3002","cfg.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"},va={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","panel.fontSize":"Panel font size","panel.tabs":"Panel tabs","tab.overview":"Overview","tab.changes":"Changes","tab.files":"Files","pill.unavailable":"Git unavailable","pill.detached":"detached HEAD","pill.synced":"Everything committed","pill.dirty":"Uncommitted changes","common.loading":"Loading\u2026","common.retry":"Retry","common.close":"Close","common.cancel":"Cancel","ops.aiHint":"Tip: Trust AI more, try direct Git\u2011operation execution by AI.","version.check":"Check for updates","version.checking":"Checking\u2026","version.upToDate":"Up to date ({current})","version.updateAvailable":"New version {latest} available (current {current})","version.viewRelease":"View release","version.error":"Check failed","version.noRepo":"Repository not configured","version.openRepo":"Visit @xbzbing/dsh-git-panel on GitHub \u2014 please give the project a little star \u2B50","overview.head":"All branches","overview.local":"Local","overview.currentBranch":"Current branch","overview.primaryBranch":"Primary branch","overview.branchAhead":"{n} commits ahead of upstream","overview.branchBehind":"{n} commits behind upstream","overview.remote":"Remote","overview.tags":"Tags","overview.search":"Search commits (message / hash)","overview.searchShort":"Search","overview.allUsers":"All authors","overview.allTime":"All time","overview.today":"Today","overview.last7d":"Last 7 days","overview.last30d":"Last 30 days","overview.selectCommit":"Select a commit to see details","overview.noMessage":"(no commit body)","overview.noResults":"No matching commits","overview.loadFailed":"Load failed","overview.detailFailed":"Failed to load details","overview.diffFailed":"Failed to load diff","overview.openFileDiff":"View this file\u2019s changes in this commit","overview.changeSummary":"{files} files","overview.expandDir":"Expand folder","overview.collapseDir":"Collapse folder","overview.fetch":"Fetch","overview.branchesError":"Failed to load branches","overview.filterBranch":"Filter by branch","overview.moreFilters":"More filters","overview.backToList":"Back to list","overview.createTag":"Create tag","switch.action":"Switch","switch.rowTitle":"Switch to {name}","switch.rowTitleTrack":"Create {name} tracking {ref} and switch to it","switch.detached":"detached HEAD","switch.confirmTitle":"Switch branch","switch.body":"Switch from {from} to {to}.","switch.trackingNote":"There is no local {name} yet: it will be created from {ref} and set to track it.","switch.dirtyWarn":"{count} file(s) have uncommitted changes.","switch.modeDirect":"Switch directly","switch.modeDirectHint":"Uncommitted changes come along; if they collide with the target branch, git refuses the switch and the work tree stays untouched.","switch.modeStash":"Stash the {count} file(s) first, then switch","switch.modeStashHint":"The changes (including untracked files) move to the top of the stash; restore them from Changes \u2192 Stash afterwards. Note: they are not restored automatically, and restoring may need manual conflict resolution.","switch.confirm":"Switch","switch.confirmStash":"Stash and switch","switch.switching":"Switching\u2026","switch.stashMessage":"Auto-stash before switching to {branch}","overview.revert":"Revert this commit","overview.reset":"Reset to here","tag.createTitle":"Create a tag at this commit","tag.namePlaceholder":"Tag name","tag.annotated":"Annotated tag (with message)","tag.messagePlaceholder":"Tag message","tag.create":"Create tag","tag.deleteTitle":"Delete tag","tag.deleteConfirm":'Delete tag "{name}"?',"tag.deleteOne":'Delete tag "{name}"',"ops.dirtyWarn":"There are uncommitted changes \u2014 they may be work the dsh AI is doing.","revert.title":"Revert commit","revert.body":"Appends a reverse commit at the current HEAD that undoes the changes in {ref}. Your working-tree changes are kept.","revert.confirm":"Revert","reset.title":"Reset branch","reset.body":"Moves the current branch HEAD from {from} to {to}.","reset.modeSoft":"Soft (--soft)","reset.softHint":"Moves HEAD; changes stay staged.","reset.modeMixed":"Mixed (--mixed, default)","reset.mixedHint":"Moves HEAD; changes stay in the working tree.","reset.modeHard":"Hard (--hard)","reset.hardHint":"Moves HEAD to this commit and discards all uncommitted changes (uncommitted changes cannot be recovered).","reset.hardOrphan":"Commits after the target leave the branch (still recoverable via git reflog).","reset.hardWarn":"The following uncommitted changes will be permanently discarded:","reset.lostMore":"\u2026 more uncommitted changes not shown (list capped)","reset.hardAck":"I understand these uncommitted changes will be lost","reset.hardAckClean":"I understand the consequences and confirm the reset","reset.confirm":"Reset","changes.groupStaged":"Staged changes","changes.groupUnstaged":"Changes","changes.groupUntracked":"Unversioned files","changes.selectFile":"Select a file to see its diff","changes.noChanges":"No uncommitted changes","changes.actions":"Repository change actions","changes.refresh":"Refresh repository status","changes.stageAll":"Stage all","changes.unstageAll":"Unstage all","changes.stage":"Stage","changes.unstage":"Unstage","changes.discard":"Discard changes","changes.discardConfirm":"Click again to confirm discard","changes.stageTip":"Stage this file so the next commit includes its changes","changes.unstageTip":"Unstage this file; its changes stay in the working tree","changes.discardTip":"Discard this file's working-tree changes (cannot be undone); click again to confirm","changes.discardTipArmed":"Click again to discard this file's changes \u2014 cannot be undone","changes.discardPicked":"Discard selected","changes.discardPickedTitle":"Discard selected changes","changes.discardPickedBody":"Discards uncommitted working-tree changes in {count} file(s). This cannot be undone.","changes.discardPickedStaged":"{count} of the selected rows are on the staged side and are not affected; use Unstage to undo the index.","changes.discardPickedUntracked":"{count} of them are untracked files or directories that will be deleted from disk (never in Git history \u2014 unrecoverable).","changes.discarding":"Discarding\u2026","changes.backToList":"Back to list","changes.stash":"Stash changes","changes.untrackedCollapsed":"Untracked entries are shown as directories, not expanded","changes.truncatedCap":"Too many changes \u2014 showing the first {n}; counts still cover all changes","changes.truncatedLossy":"Git output exceeded the limit; the list may be missing its opening entries","changes.truncatedUnknown":"The list is incomplete; some changes may be missing","stash.title":"Stash current changes","stash.messagePlaceholder":"Stash message (optional)","stash.save":"Stash","stash.section":"Stashes","stash.onBranch":"on {branch}","stash.apply":"Apply","stash.pop":"Pop","stash.drop":"Drop","stash.dropTitle":"Drop stash","stash.dropConfirm":"Drop this stash? This cannot be undone: {name}","files.selectFile":"Select a file to preview","files.loadFailed":"Load failed","files.notFound":"File not found (deleted or moved)","files.backToTree":"Back to files","files.truncated":"Too many entries \u2014 truncated","files.tooLarge":"File too large to preview","files.binary":"Binary file \u2014 no preview","files.highlightOff":"Large file \u2014 syntax highlighting disabled for performance","files.lineTruncated":" \u2026 (line too long, truncated)","files.findPlaceholder":"Find in file","files.findNoMatch":"No results","files.findPrev":"Previous match","files.findNext":"Next match","files.findClose":"Close find","files.findCase":"Match case","files.previewMode":"Preview mode","files.source":"Source","files.render":"Rendered","files.wrap":"Word wrap","files.wrapDisabled":"Word wrap unavailable for large files","files.mermaidLoading":"Loading diagram engine\u2026","files.copyPath":"Copy relative path","files.pathCopied":"Path copied","files.pathCopyFailed":"Copy failed","files.copyContent":"Copy file content","files.contentCopied":"Content copied","files.contentCopyFailed":"Copy failed","files.ignored":"Ignored by Git","files.copy":"Copy code","files.copied":"Copied","files.footnotes":"Footnotes","files.zoomBar":"Image zoom","files.zoomIn":"Zoom in","files.zoomOut":"Zoom out","files.zoomActual":"Actual size (100%)","files.zoomFit":"Fit to window","files.zoomFullscreen":"View fullscreen","files.fullscreen":"View file full screen","files.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","files.propsTitle":"File properties","files.propsGroupStats":"Size & stats","files.propsGroupTime":"Timestamps","files.propsName":"Name","files.propsType":"Type","files.propsTypeImage":"{fmt} image","files.propsTypeText":"Text file","files.propsTypeBinary":"Binary file","files.propsTypeUnread":"Too large to read","files.propsTypeFmt":"{label} (.{ext})","files.propsRelPath":"Relative path","files.propsAbsPath":"Absolute path","files.propsCopyHint":"Click to copy","files.propsSize":"Size","files.propsSizeBytes":"({bytes} bytes)","files.propsLines":"Lines","files.propsImageSize":"Dimensions","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"Modified","files.propsUntracked":"Untracked","files.propsTrackedYes":"Tracked","files.propsStaged":"Staged","files.stAdded":"Added","files.stModified":"Modified","files.stDeleted":"Deleted","files.stRenamed":"Renamed","files.stConflicted":"Conflicted","files.stTypechange":"Type changed","stats.files":"{n} files","stats.lastChange":"changed {time}","stats.lastCommit":"last commit {time}","stats.staged":"{n} staged","stats.modified":"{n} modified","stats.untracked":"{n} untracked","stats.partial":"simplified","stats.partialHint":"Large change set \u2014 untracked line counts and last-change time are omitted to keep the panel responsive.","commit.placeholder":"Commit message","commit.commit":"Commit","commit.amend":"Amend previous commit","commit.edit":"Edit commit message","commit.collapse":"Collapse commit editor","commit.suggest":"AI suggest","commit.suggesting":"Generating\u2026","commit.suggestOverwrite":'Click "AI suggest" again to replace the current message',"commit.suggestTruncated":"The diff was truncated; the suggestion may be incomplete","diff.unified":"Unified","diff.split":"Split","diff.before":"Before","diff.after":"After","diff.binary":"Binary file \u2014 no diff to show","diff.tooLarge":"Image too large to compare","diff.imageMissing":"Does not exist","diff.svgRender":"Rendered","diff.svgSource":"Source","diff.empty":"No differences","diff.expandAll":"Expand all","diff.collapse":"Collapse unchanged","diff.expandGap":"Expand all {n} lines","diff.expandUp":"Expand up {n} lines","diff.expandDown":"Expand down {n} lines","diff.expandCapped":"Large file: expanded {n} lines of context; the rest stays collapsed and can be expanded in place","diff.truncated":"git output exceeded the output cap: only the tail of this diff survived, so the opening changes and the +/- counts may be missing","time.justNow":"just now","time.minutesAgo":"{n}m ago","time.hoursAgo":"{n}h ago","time.daysAgo":"{n}d ago","error.generic":"Operation failed","error.notARepo":"Not a Git repository","error.noCwd":"This session has no working directory","error.localChangesBlock":"Local changes block this operation","error.emptyMessage":"Commit message cannot be empty","error.emptyDiff":"No changes to summarize","error.llmUnavailable":"AI service unavailable","error.llmFailed":"AI generation failed","error.suggestDisabled":"AI suggest is turned off in the plugin config","error.conflict":"Applying the stash produced conflicts; the stash entry is kept \u2014 resolve them and retry","error.revertConflict":"The revert would conflict with the current content; it was cancelled automatically (your working tree is unchanged)","error.revertStuck":"The revert conflicted and could not be auto-cancelled; the repository is mid-revert \u2014 run `git revert --abort` or resolve it manually","error.revertMerge":"This is a merge commit; the panel cannot revert it (a mainline parent is required) \u2014 use `git revert -m` on the command line","error.indexBusy":"Git is busy (another process holds the index lock); try again shortly","error.notFound":"Target not found (the branch / tag / stash may have been removed or renamed)","error.branchInUse":"That branch is checked out in another worktree, so it cannot be switched to here","error.nestedRepo":"That entry is a Git repository itself (a nested repo or a submodule): discarding it would delete the whole inner repository. Do it from a terminal instead","error.nestedRepoPartial":"That entry is a Git repository itself (a nested repo or a submodule), so it was not deleted \u2014 but earlier entries in this batch already were. Refresh to see what is left, and handle this one from a terminal","error.stashSwitchFailed":"The uncommitted changes were stashed (restore them from Changes \u2192 Stash), but the switch failed: {reason}","error.invalidName":"Invalid name","error.notFastForward":"Local and remote have diverged \u2014 a fast-forward pull is not possible; merge or rebase manually","error.pushRejected":"Push rejected: the remote has new commits \u2014 run \u201CCheck sync\u201D and pull first, then push","error.authFailed":"Authentication failed: no usable git credentials (HTTPS needs a credential helper, SSH needs a key). Push once from the command line first to cache them","status.openRepo":"Open the repository home in the browser","status.openRepoOn":"Open the repository home on {host}","status.synced":"Up to date with remote","status.ahead":"{n} ahead","status.behind":"{n} behind","status.diverged":"Diverged ({ahead} ahead / {behind} behind)","status.noUpstream":"No upstream branch","status.detached":"Detached HEAD \u2014 no branch sync state","status.check":"Check sync status","status.checkTitle":"Check sync with the remote: runs git fetch to update refs and refresh the ahead/behind counts; your working tree is untouched","status.pull":"Pull","status.pulling":"Syncing\u2026","status.pullTitle":"Fast-forward pull of remote updates","status.pullConfirmTitle":"Pull remote updates","status.pullConfirmBody":"Fast-forwards the current branch {branch} to the latest remote commit ({behind} behind). Only possible when not diverged; it creates no merge commit and leaves your uncommitted work untouched.","status.pullConfirm":"Pull","status.pullScope":"Brings in {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pullScopeLoading":"Measuring incoming changes\u2026","status.push":"Push","status.pushTitle":"Push local commits to the remote","status.pushConfirmTitle":"Push to remote","status.pushConfirmBody":"Pushes the {ahead} commits that {branch} is ahead of the remote to its upstream. Fast-forward only \u2014 it never force-overwrites remote history.","status.pushConfirm":"Push","status.pushing":"Pushing\u2026","status.pushScope":"Pushes {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pushScopeLoading":"Measuring outgoing changes\u2026","status.publish":"Publish","status.publishTitle":"Publish the branch and set its upstream","status.publishConfirmTitle":"Publish branch to remote","status.publishConfirmBody":"The current branch {branch} has no upstream yet. This runs git push -u {remote} to create a same-named branch on the remote and set it as the upstream.","status.publishConfirm":"Publish","status.publishing":"Publishing\u2026","cfg.title":"Input-bar branch marker","cfg.toggle":"Show input-bar marker","cfg.hint":"When on, the input bar shows the zsh-style <repo> (branch) marker; when off, a status dot appears beside the Git tab instead. Saved changes apply immediately.","cfg.diffTitle":"Default diff view","cfg.diffHint":"Choose the layout diffs open with: unified is a single inline column, split is side-by-side. You can still switch per diff. Saved changes apply immediately.","cfg.diffUnified":"Unified (single inline column)","cfg.diffSplit":"Split (side-by-side)","cfg.graphTitle":"Commit graph line style","cfg.graphHint":"Choose how the commit graph draws its lines: parallel is the VSCode / GUI style \u2014 each branch keeps its own column and a shared ancestor shows as parallel lines; compact is the git log style \u2014 a shared ancestor merges into one column with fewer lines. Saved changes apply immediately.","cfg.graphParallel":"Parallel (VSCode style)","cfg.graphCompact":"Compact (git log style)","cfg.suggestTitle":"AI commit message","cfg.suggestToggle":"Show AI suggest button in the commit box","cfg.suggestLangLabel":"Language","cfg.suggestLangAuto":"Auto","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"Auto follows the language you write commits in for this repository (recency-weighted, with the current git author preferred, ignoring mechanical commits such as releases and merges); \u4E2D\u6587 / English pin it.","cfg.suggestMaxBytesLabel":"Input budget","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"Diff bytes sent to the model; beyond it the diff is truncated. Range 16\u2013512.","cfg.suggestOutputLabel":"Output limit","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"Model generation budget; reasoning tokens count against it on thinking models. Range 256\u201316384.","cfg.suggestTimeoutLabel":"Generation timeout","cfg.suggestTimeoutUnit":"s","cfg.suggestTimeoutHint":"Generation fails after the timeout. Range 5\u2013120.","cfg.suggestModelLabel":"Model","cfg.suggestModelSession":"Follow session default","cfg.suggestModelLoading":"Loading model list\u2026","cfg.suggestModelEmpty":"No models detected \u2014 configure one in DSH Settings first","cfg.suggestModelFailed":"Failed to load the model list","cfg.suggestModelRetry":"Retry","cfg.suggestProviderLabel":"Provider","cfg.suggestModelPick":"Select a model","cfg.suggestEffortLabel":"Reasoning effort","cfg.suggestEffortUnset":"Not set (model default)","cfg.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the repository\u2019s existing commit style, filled in for you to edit before committing. A fixed model sends the diff to that model\u2019s provider; "Follow session default" uses the current session\u2019s Agent model. Saved changes apply immediately.',"cfg.notLoaded":"Config not loaded: it is served by the running host. Restart DSH if this stays blank.","cfg.saveFailed":"Save failed, please retry"};var Sn=require("react");function es(e=()=>typeof document>"u"?void 0:document){let t=new Set,n,r=!0,a=()=>e()?.hidden!==!0,o=()=>{let s=a();if(s!==r){r=s;for(let i of[...t])i()}};return{isVisible:a,subscribe(s){return t.size===0&&(n=e(),r=a(),n?.addEventListener("visibilitychange",o)),t.add(s),()=>{t.delete(s),t.size===0&&(n?.removeEventListener("visibilitychange",o),n=void 0)}}}}var Qe=es();var ts=new Set(["cwd-unavailable"]),wa=3e4,ns=6e4,An=class{constructor(t,n,r=Qe){this.remote=t;this.sessionId=n;this.visibility=r;this.unsubscribeVisibility=r.subscribe(()=>{this.disposed||(this.visibilityGeneration+=1,this.publish(this.view,this.unreadySignal()),r.isVisible()?this.refresh():this.clearPoll())})}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=wa;unsubscribeVisibility;visibilityGeneration=0;requestGeneration=0;querySignal={tick:0,sampledAt:0,ready:!1,root:null};queryListeners=new Set;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}subscribeQueries(t){return this.queryListeners.add(t),()=>{this.queryListeners.delete(t)}}getQuerySignal(){return this.querySignal}ensure(){this.inflight!==void 0||this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){if(this.disposed)return Promise.resolve();if(!this.visibility.isVisible())return this.pendingRefresh=!0,this.clearPoll(),Promise.resolve();if(this.inflight!==void 0)return this.pendingRefresh=!0,this.inflight.then(()=>this.inflight);this.pendingRefresh=!1,this.clearPoll();let t=this.visibilityGeneration,n=this.requestGeneration;return this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(r=>{if(!(this.disposed||n!==this.requestGeneration)){if(r.ok)this.publishSnapshot(r.value,t,!1);else if(r.error.code!=="cancelled")if(ts.has(r.error.code))this.pollMs=ns,this.setView({state:"no-cwd"});else if(r.error.code==="not-a-git-repo"){let a=r.error;this.setView({state:"error",error:{code:"not-a-git-repo",...a.cwd?{cwd:a.cwd}:{},...a.showInputPill!==void 0?{showInputPill:a.showInputPill}:{}}})}else if(r.error.code==="git-unavailable"){let a=r.error;this.setView({state:"error",error:{code:"git-unavailable",...a.detail?{detail:a.detail}:{},...a.cwd?{cwd:a.cwd}:{},...a.isGitRepo!==void 0?{isGitRepo:a.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:r.error.code,..."detail"in r.error?{detail:r.error.detail}:{}}})}}).catch(r=>{this.disposed||n!==this.requestGeneration||this.setView({state:"error",error:{code:"git-unavailable",detail:r instanceof Error?r.message:String(r)}})}).finally(()=>{this.inflight=void 0,!(this.disposed||!this.visibility.isVisible())&&(this.pendingRefresh?this.refresh():this.schedulePoll())}),this.inflight}resync(){this.disposed||(this.requestGeneration+=1,this.refresh())}accept(t){this.disposed||(this.requestGeneration+=1,this.pendingRefresh=!1,this.publishSnapshot(t,this.visibilityGeneration,!0),this.schedulePoll())}publishSnapshot(t,n,r){this.pollMs=t.refreshIntervalMs||wa;let a=this.view.state==="ready"?this.view.snapshot:null,o=!r&&a!==null&&t.root===a.root&&t.stateFingerprint!==void 0&&t.stateFingerprint===a.stateFingerprint,s={tick:this.querySignal.tick+1,sampledAt:t.checkedAt,ready:this.visibility.isVisible()&&n===this.visibilityGeneration,root:t.root};this.publish(o?this.view:{state:"ready",snapshot:t},s)}unreadySignal(){return this.querySignal.ready?{...this.querySignal,ready:!1}:this.querySignal}clearPoll(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}schedulePoll(){this.clearPoll(),!(this.disposed||!this.visibility.isVisible()||this.inflight!==void 0||this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.timer=void 0,this.refresh()},this.pollMs))}setView(t){this.publish(t,this.unreadySignal())}publish(t,n){let r=t!==this.view,a=n!==this.querySignal;if(this.view=t,this.querySignal=n,r)for(let o of this.listeners)o();if(a)for(let o of this.queryListeners)o()}dispose(){this.disposed=!0,this.clearPoll(),this.unsubscribeVisibility(),this.pendingRefresh=!1,this.listeners.clear(),this.queryListeners.clear()}};var zn=require("react"),Mr={tick:0,sampledAt:0,ready:!1,root:null};function rs(e,t){let[n,r]=(0,zn.useState)(()=>e?.getQuerySignal()??Mr);return(0,zn.useEffect)(()=>{if(e===void 0){r(Mr);return}let a=()=>r(e.getQuerySignal());if(!t){a();return}let o=e.subscribeQueries(a);return a(),o},[e,t]),t?e?.getQuerySignal()??Mr:n}function xa(e,t,n){let r=rs(e,t);return{signal:r,queryVisible:t&&r.ready&&r.root===n,queryKey:[r.root,r.tick]}}var as="/api",os="gitPanel";function is(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,a,o)=>n.call(t,as,r,a,o)}catch{}}function ss(e){let t=e;if(t===null||typeof t!="object")return{ok:!1,error:{code:"git-unavailable",message:"malformed rpc result"}};if(t.ok!==!0){let n=t.error;return{ok:!1,error:{code:typeof n?.code=="string"?n.code:"git-unavailable",message:typeof n?.message=="string"?n.message:void 0}}}return t.value===void 0?{ok:!1,error:{code:"git-unavailable",message:"missing value"}}:t.value}function ve(e,t){return!e.ok||e.value.kind!==t?null:e.value}function Ct(e){return e!==void 0&&e!==""}var ka=new WeakMap;function Vt(e){let t=ka.get(e);if(t!==void 0)return t;let n=async(a,o,s)=>{let i=is(e);if(i===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await i(`${os}/${a}`,{args:{request:o}},s);return ss(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},r={snapshot:(a,o)=>n("snapshot",a,o),run:(a,o)=>n("run",a,o),query:(a,o)=>n("query",a,o),suggest:(a,o)=>n("suggest",a,o),version:(a,o)=>n("version",a,o)};return ka.set(e,r),r}var Rt=new Map,_a,Gr;function Sa(e){Gr=e,_a=Vt(e)}function jt(e){let t=Rt.get(e);if(t===void 0){let n=_a??(Gr?Vt(Gr):void 0);t=new An(n??ds(),e),Rt.set(e,t)}return t}var ls=6e4,an=new Map;function Ca(e){let t=an.get(e);t!==void 0&&(clearTimeout(t),an.delete(e)),qt.set(e,(qt.get(e)??0)+1)}function Ta(e,t){if(Rt.get(e)!==t)return;let n=(qt.get(e)??1)-1;if(n>0){qt.set(e,n);return}qt.delete(e);let r=setTimeout(()=>{Rt.get(e)===t&&(an.delete(e),!((qt.get(e)??0)>0)&&(t.dispose(),Rt.delete(e)))},ls);an.set(e,r)}var qt=new Map;function Ut(){for(let e of Rt.values())e.resync()}function Na(){for(let e of Rt.values())e.dispose();Rt.clear();for(let e of an.values())clearTimeout(e);an.clear(),qt.clear()}function ds(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e}}function Fn(e,t,n){let r=e?t?jt(e):Rt.get(e):void 0,a=xa(r,t,n);return(0,Sn.useEffect)(()=>{if(!(!t||r===void 0||e===void 0))return Ca(e),r.ensure(),()=>Ta(e,r)},[r,e,t]),a}function Hn(e){let[,t]=(0,Sn.useState)(0),n=e?jt(e):void 0,r=n?n.getSnapshot():{state:"cold"};return(0,Sn.useEffect)(()=>{if(n===void 0||e===void 0)return;Ca(e);let a=n.subscribe(()=>t(o=>o+1));return n.getSnapshot()!==r&&t(o=>o+1),n.ensure(),()=>{a(),Ta(e,n)}},[n,e]),r}var q=require("react"),Ai=require("@deepseek-ai/dsh-client-ui-primitives");var Ea="[data-conversation-tabs]",Tn='[data-conversation-tabs] button[role="tab"]',Pr=new Map,Cn=new Map;function Ma(e,t){let n=Cn.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}Pr.set(e,t)}function Ga(e){let t=Pr.get(e);return t===void 0?null:(Pr.delete(e),t)}function Pa(e,t){let n=Cn.get(e);return n===void 0&&(n=new Set,Cn.set(e,n)),n.add(t),()=>{let r=Cn.get(e);r!==void 0&&(r.delete(t),r.size===0&&Cn.delete(e))}}var cs=6e4,Rr=new Map;function Ra(e,t){Rr.set(e,{tab:t,leftAt:Date.now()})}function La(e){let t=Rr.get(e);return t===void 0?null:Date.now()-t.leftAt>cs?(Rr.delete(e),null):t.tab}function Da(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function Aa(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function za(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var p=require("react"),ur=require("react-dom"),Xr=require("@deepseek-ai/dsh-client-ui-primitives");var Bn=require("react"),Fa=require("@deepseek-ai/dsh-client-ui-primitives");function Nn(e,t,n,r={}){let a=r.extraClass===void 0?"gp-select-trigger":`gp-select-trigger ${r.extraClass}`;return(0,Bn.createElement)("button",{type:"button",className:a,"aria-haspopup":"menu","aria-expanded":e,title:t,disabled:r.disabled,onClick:n},[(0,Bn.createElement)("span",{key:"l",className:"gp-select-trigger__label"},t),(0,Bn.createElement)(Fa.IconChevronDownOutlineRegular,{key:"c",className:"gp-select-trigger__chevron",size:14})])}var A=require("react"),ps="M2 7V3h4l8 8-4 4z",Ha="M8 1.8l1.76 3.57 3.94.57-2.85 2.78.67 3.92L8 10.78l-3.52 1.85.67-3.92L2.3 5.94l3.94-.57z";function xe(e,t=15,n=!1){return(0,A.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round",...n?{"aria-hidden":!0}:{}},e)}function In({size:e}){return xe([(0,A.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,A.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,A.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function Ba({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M4 2v8"}),(0,A.createElement)("path",{key:"b",d:"M2 4h4"}),(0,A.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,A.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,A.createElement)("path",{key:"e",d:"M12 6v4"}),(0,A.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function Lr({size:e}){return xe([(0,A.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,A.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,A.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,A.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,A.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function Ia(e,t=!1){return xe([(0,A.createElement)("path",{key:"a",d:ps}),(0,A.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e,t)}function on({size:e}){return Ia(e)}function Lt({size:e,open:t}){return xe([(0,A.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function gt({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function Oa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 6V2h4"}),(0,A.createElement)("path",{key:"b",d:"M10 2h4v4"}),(0,A.createElement)("path",{key:"c",d:"M14 10v4h-4"}),(0,A.createElement)("path",{key:"d",d:"M6 14H2v-4"})],e)}function $a({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 3.5h12"}),(0,A.createElement)("path",{key:"b",d:"M2 7.5h12"}),(0,A.createElement)("path",{key:"c",d:"M2 11.5h7"}),(0,A.createElement)("path",{key:"d",d:"M2 11.5c0 2 1.5 3 3.5 3H10"})],e)}function sn({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,A.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function Xa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function Ja({size:e}){return xe([(0,A.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,A.createElement)("path",{key:"plus",d:"M11 8v6M8 11h6"})],e,!0)}function Ka({size:e}){return xe([(0,A.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,A.createElement)("path",{key:"minus",d:"M8 11h6"})],e,!0)}function ln({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,A.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function Va({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M8 2.6l1.4 4 4 1.4-4 1.4-1.4 4-1.4-4-4-1.4 4-1.4z"}),(0,A.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function qa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,A.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function ja({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 12.5V3.5h4l1.5 2H14v7z"})],e)}function On({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,A.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,A.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function $n({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,A.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,A.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function Ua({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,A.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function Xn({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M13 3v10"}),(0,A.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function Wa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,A.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,A.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function Qa({size:e=15}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,A.createElement)("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"}))}function Ya({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,A.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,A.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function En({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,A.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,A.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Za({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,A.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,A.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,A.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function eo({size:e}){return xe([(0,A.createElement)("circle",{key:"a",cx:8,cy:8,r:6}),(0,A.createElement)("path",{key:"b",d:"M8 7.2v3.6"}),(0,A.createElement)("circle",{key:"c",cx:8,cy:5.2,r:.5,fill:"currentColor",stroke:"none"})],e)}function to({size:e=15,filled:t}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},(0,A.createElement)("path",{d:Ha}))}function no({size:e}){return Ia(e,!0)}function ro({size:e=15}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},(0,A.createElement)("path",{d:Ha}))}function ao({size:e,direction:t}){let n=e??15,r=t==="ahead"?"M4.5 11.5L11.5 4.5":"M11.5 4.5L4.5 11.5",a=t==="ahead"?"M6.5 4.5h5v5":"M9.5 11.5h-5v-5";return(0,A.createElement)("svg",{className:"gp-branch-row__sync-icon","data-direction":t,width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},[(0,A.createElement)("path",{key:"a",d:r}),(0,A.createElement)("path",{key:"b",d:a})])}function oo(e){let t=0;for(let n of e){t=Math.max(t,n.lane+1);for(let r of n.edges)t=Math.max(t,r.fromLane+1,r.toLane+1)}return t}function Jn(e,t,n){let r=[],a=[],o=[],s=[],i=[],l=0,d=()=>{if(i.length===0)return l++;let w=Math.min(...i);return i.splice(i.indexOf(w),1),w},c=w=>{w!==null&&!i.includes(w)&&i.push(w)},u=(w,k)=>{let y=a.findIndex(x=>x===null);return y===-1&&(y=a.length,a.push(null),o.push(null),s.push(!1)),a[y]=w,o[y]=d(),s[y]=k,y},f=w=>a.findIndex(k=>k===w),v=(w,k)=>{let y=a.findIndex((x,C)=>x===w&&s[C]===k);return y===-1?u(w,k):y},g=(w,k,y,x,C)=>C?{fromLane:w,toLane:k,color:y,kind:x,indirect:!0}:{fromLane:w,toLane:k,color:y,kind:x};for(let w=0;w<e.length;w++){let k=e[w],y=n===void 0?void 0:n[w],x=y===void 0?k.parents.length:y.length,C=L=>y===void 0?k.parents[L]:y[L].hash,T=L=>y!==void 0&&y[L].indirect,F=f(k.hash),M=F!==-1,E=F===-1?u(k.hash,!1):F,J=o[E],te=[...a],Z=[...o],I=[...s],K=k.parents.length>=2;for(let L=0;L<a.length;L++)L!==E&&a[L]===k.hash&&(c(o[L]),a[L]=null,o[L]=null);let U=-1,se=[];if(x===0)c(o[E]),a[E]=null,o[E]=null;else{let L=C(0),ne=T(0),ae=t==="compact"?a.findIndex((oe,H)=>oe===L&&H!==E&&s[H]===ne):-1;if(ae===-1)a[E]=L,s[E]=ne,U=E;else{let oe=Math.min(E,ae),H=Math.max(E,ae);a[oe]=L,s[oe]=ne,c(o[H]),a[H]=null,o[H]=null,U=oe}for(let oe=1;oe<x;oe++)se.push(v(C(oe),T(oe)))}let de=[];for(let L=0;L<te.length;L++){let ne=te[L];if(ne!==null)if(ne===k.hash){if(L===E&&!M)continue;de.push(g(L,E,Z[L],"into",I[L]))}else{let ae=a[L]===ne?L:a.findIndex((oe,H)=>oe===ne&&s[H]===I[L]);ae!==-1&&de.push(g(L,ae,Z[L],"pass",I[L]))}}U!==-1&&de.push(g(E,U,o[U],"out",s[U]));for(let L of se)de.push(g(E,L,o[L],"out",s[L]));for(r.push({commit:k,lane:E,color:J,edges:de,merge:K});a.length>0&&a[a.length-1]===null;)a=a.slice(0,-1),o=o.slice(0,-1),s=s.slice(0,-1)}return r}var io=4096,us=1e6,gs=1e5;function so(e,t,n){let r=new Map;for(let g of t)r.set(g.hash,g.parents);let a=new Map;e.forEach((g,w)=>a.set(g.hash,w));let o=Math.min(io,a.size),s=new Map,i=0,l=g=>{let w=s.get(g);if(w!==void 0)return w;let k=[{hash:g,expanded:!1}],y=new Set,x=[];for(;k.length>0;){let C=k[k.length-1];if(!C.expanded){C.expanded=!0,y.add(C.hash);let T=r.get(C.hash);for(let F=T.length-1;F>=0;F--){let M=T[F];a.has(M)||!r.has(M)||y.has(M)||s.has(M)||k.push({hash:M,expanded:!1})}continue}x.push(C.hash),k.pop()}for(let C of x){if(s.has(C))continue;let T=r.get(C),F,M=T.length>0;for(let I of T){if(a.has(I)){M=!1;break}let K=s.get(I);if(K===void 0){M=!1;break}if(F===void 0)F=K;else if(F!==K){M=!1;break}}if(M&&F!==void 0){s.set(C,F);continue}let E=[],J=new Set,te=!1,Z=I=>{if(!J.has(I)){if(E.length>=o||i>=us){te=!0;return}J.add(I),E.push(I),i++}};for(let I of T){if(a.has(I)){Z(I);continue}let K=s.get(I);if(K===void 0){te=!0;continue}for(let U of K.ancestors)Z(U);K.unknown&&(te=!0)}s.set(C,{ancestors:E,unknown:te})}return s.get(g)},d=io,c=gs,u=[],f=[];for(let g=0;g<e.length;g++){let k=e[g].parents,y=[],x=new Map,C=!1,T=M=>{let E=a.get(M);return E!==void 0&&E>g},F=(M,E)=>{let J=x.get(M);if(J===void 0){let te=a.get(M)-g+1;if(d===0||c<te){C=!0;return}d--,c-=te,x.set(M,y.length),y.push({hash:M,indirect:E})}else!E&&y[J].indirect&&(y[J]={hash:M,indirect:!1})};for(let M of k){if(a.has(M)){T(M)?F(M,!1):C=!0;continue}if(!r.has(M)){C=!0;continue}let E=l(M);(E.ancestors.length===0||E.unknown)&&(C=!0);for(let J of E.ancestors)T(J)?F(J,!0):C=!0}u.push(y),f.push(C)}let v=Jn(e,n,u);return f.some(g=>g)?v.map((g,w)=>f[w]===!0?{...g,boundary:!0}:g):v}var rt=require("react"),Wt=14,Kn=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function lo({row:e,laneCount:t,rowH:n,current:r}){let a=(0,rt.useId)(),o=Math.max(Wt,t*Wt),s=c=>c*Wt+Wt/2,i=n/2,l=Kn[e.color%Kn.length],d=e.edges.map(c=>{let u=c.kind==="out"?i:0,f=c.kind==="into"?i:n,v=(u+f)/2;return(0,rt.createElement)("path",{key:`${c.kind}-${c.fromLane}-${c.toLane}-${c.color}`,className:"gp-graph-edge",d:`M ${s(c.fromLane)} ${u} C ${s(c.fromLane)} ${v}, ${s(c.toLane)} ${v}, ${s(c.toLane)} ${f}`,stroke:Kn[c.color%Kn.length],strokeWidth:1.6,fill:"none",...c.indirect?{strokeDasharray:"7 5","data-indirect":"true"}:{}})});if(e.boundary){let c=s(e.lane)+(e.edges.some(u=>u.kind==="out")?5:0);d.push((0,rt.createElement)("path",{key:"boundary",className:"gp-graph-boundary",d:`M ${s(e.lane)} ${i} L ${c} ${i+7} V ${Math.min(n-3,i+13)}`,stroke:l,strokeWidth:1.6,strokeDasharray:"3 3",fill:"none"}))}return(0,rt.createElement)("svg",{className:"gp-graph-svg",width:o,height:n,"aria-hidden":!0},[r?(0,rt.createElement)("defs",{key:"defs"},(0,rt.createElement)("mask",{id:a,maskUnits:"userSpaceOnUse",x:0,y:0,width:o,height:n},[(0,rt.createElement)("rect",{key:"area",x:0,y:0,width:o,height:n,fill:"white"}),(0,rt.createElement)("circle",{key:"hole",cx:s(e.lane),cy:i,r:6.2,fill:"black"})])):null,(0,rt.createElement)("g",{key:"edges",...r?{mask:`url(#${a})`}:{}},d),(0,rt.createElement)("circle",{key:"node",className:`gp-graph-node${r?" gp-graph-node--current":""}`,cx:s(e.lane),cy:i,r:r?5.2:e.merge?4:3.2,fill:r?"none":l,stroke:r?l:"var(--dsw-alias-bg-layer-1)",strokeWidth:r?2:1}),r?(0,rt.createElement)("circle",{key:"head-dot",className:"gp-graph-node__dot",cx:s(e.lane),cy:i,r:2.2,fill:l}):null])}function fs(e){return/^[0-9a-fA-F]{7,40}$/.test(e.trim())}function Dr(e){let t=e.search?.trim()??"";return!fs(t)&&(t!==""||(e.author??"")!==""||(e.since??"")!=="")}var Vn=10*1024*1024,at={maxBytes:{min:16*1024,max:512*1024,default:200*1024},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},qn=["auto","zh","en"],Ar="auto",ms={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff"};function Mn(e){let t=e.lastIndexOf(".");return t<0?null:ms[e.slice(t+1).toLowerCase()]??null}function jn(e){let t=[],n=new Set;for(let o of e){let s=o.name.split("/").filter(l=>l!=="");if(s.length===0)continue;t.push({segments:s,branch:o});let i="";for(let l=0;l<s.length-1;l++)i=i===""?s[l]:`${i}/${s[l]}`,n.add(i)}let r=new Map,a=[];for(let{segments:o,branch:s}of t){let i=o.join("/"),l=n.has(i),d=a,c="";for(let u=0;u<o.length;u++){let f=o[u];c=c===""?f:`${c}/${f}`;let v=u===o.length-1;if(v&&!l){d.push({kind:"leaf",label:f,path:i,branch:s});break}let g=r.get(c);g===void 0&&(g={kind:"dir",label:f,path:c,self:null,children:[]},r.set(c,g),d.push(g)),v?g.self=s:d=g.children}}return co(a)}function co(e){return e.map(t=>{if(t.kind==="leaf")return t;let n=t;for(;;){let r=n.children.length===1?n.children[0]:void 0;if(n.self!==null||r===void 0||r.kind!=="dir")break;n={kind:"dir",label:`${n.label}/${r.label}`,path:r.path,self:r.self,children:r.children}}return{kind:"dir",label:n.label,path:n.path,self:n.self,children:co(n.children)}})}function po(e,t){let n=r=>e.some(a=>a.name===r);return t!==null&&n(t)?t:n("main")?"main":n("master")?"master":null}function uo(e,t){if(t===null)return e;let n=e.findIndex(r=>r.name===t);return n<=0?e:[e[n],...e.slice(0,n),...e.slice(n+1)]}function go(e,t,n){if(t===null)return null;let r=n===null?["main","master"]:[n,"main","master"];for(let a of r){let o=`${t}/${a}`;if(e.some(s=>s.name===o))return o}return null}function fo(e,t,n){let r=[],a=s=>{if(s===null||r.some(l=>l.name===s))return;let i=e.find(l=>l.name===s);i!==void 0&&r.push(i)};a(t),a(n);let o=new Set(r.map(s=>s.name));return{pinned:r,nodes:jn(e.filter(s=>!o.has(s.name)))}}function mo(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(s=>s!==""),a=t,o="";for(let s=0;s<r.length;s++){let i=r[s];o=o===""?i:`${o}/${i}`;let l=s===r.length-1,d=a.children.find(c=>c.name===i&&c.dir===!l);d===void 0&&(d={name:i,path:o,dir:!l,children:[],...l?{meta:n.meta}:{}},a.children.push(d)),a=d}}return ho(t),yo(t.children)}function ho(e){e.children.sort((t,n)=>t.dir!==n.dir?t.dir?-1:1:t.name.localeCompare(n.name));for(let t of e.children)ho(t)}function yo(e){return e.map(t=>{if(!t.dir)return t;let n=t;for(;n.children.length===1&&n.children[0].dir;){let r=n.children[0];n={name:`${n.name}/${r.name}`,path:r.path,dir:!0,children:r.children}}return{...n,children:yo(n.children)}})}function Ft(e,t,n){if(e===null)return"";let r=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(r))return"";let a=Math.max(0,t-r),o=Math.floor(a/6e4);if(o<1)return n("time.justNow");if(o<60)return n("time.minutesAgo",{n:o});let s=Math.floor(o/60);if(s<24)return n("time.hoursAgo",{n:s});let i=Math.floor(s/24);return n("time.daysAgo",{n:i})}function Gn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Pn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Un={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function cn(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}function bo(e,t){return e.some(n=>n.status==="untracked"&&(n.isDirectory?t.startsWith(`${n.path}/`):n.path===t))}var R=require("react");function vo(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function wo(e){return Mn(e)!==null}function xo(e){return/\.svg$/i.test(e)}function hs(e){let t=e.split(`
|
|
814
|
-
`),n=[],r=!1;for(let
|
|
815
|
-
`),a=Number.isFinite(t)&&t>0?t:0,o=0,s=0,i=!0,l=!1,d=0;for(;d<r.length&&!r[d].startsWith("@@");d++);for(;d<r.length;d++){let u=r[d];if(u.startsWith("@@")){let g=ys.exec(u);if(g){let w=Number(g[1]),k=Number(g[3]),y=w-k;if(i)k>1&&n.push(Qt({rightStart:1,count:k-1,delta:y,atStart:!0}));else{let x=k-s;x>0&&n.push(Qt({rightStart:s,count:x,delta:y,atStart:!1}))}o=w,s=k,i=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:u});continue}if(u.startsWith("\\"))continue;let f=u[0],v=u.slice(1);f==="+"?(n.push({kind:"add",leftNo:null,rightNo:s,leftText:null,rightText:v}),s++,l=!0):f==="-"?(n.push({kind:"del",leftNo:o,rightNo:null,leftText:v,rightText:null}),o++,l=!0):f===" "&&(n.push({kind:"context",leftNo:o,rightNo:s,leftText:v,rightText:v}),o++,s++,l=!0)}let c=a-s+1;return l&&!i&&s>0&&c>0&&n.push(Qt({rightStart:s,count:c,delta:o-s,atStart:!1})),bs(n)}function So(e,t){let n=e[e.length-1],r=n!==void 0&&n.kind==="gap",a=r?n.gap:void 0,o=r?e[e.length-2]:n,s=o===void 0?null:o.rightNo,i=s!==null&&s>0?s:0,l=Number.isFinite(t)?t-i:0,d=l>0?l:0;if(a===void 0){if(d===0||i===0)return e;let c=o===void 0?null:o.leftNo;return c===null?null:[...e,Qt({rightStart:i+1,count:d,delta:c-i,atStart:!1})]}return a.rightStart===i+1&&a.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),Qt({rightStart:i+1,count:d,delta:a.delta,atStart:!1})]}function Qt(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function bs(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let a=[],o=n;for(;o<e.length&&e[o].kind==="del";)a.push(e[o]),o++;let s=[];for(;o<e.length&&e[o].kind==="add";)s.push(e[o]),o++;let i=Math.max(a.length,s.length);for(let l=0;l<i;l++){let d=a[l],c=s[l];if(d&&c){let u=vs(d.leftText??"",c.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:c.rightNo,leftText:d.leftText,rightText:c.rightText,...u!==null?{leftWord:u.left,rightWord:u.right}:{}})}else d?t.push({kind:"del",leftNo:d.leftNo,rightNo:null,leftText:d.leftText,rightText:null}):c&&t.push({kind:"add",leftNo:null,rightNo:c.rightNo,leftText:null,rightText:c.rightText})}n=o}else t.push(r),n++}return t}function vs(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let a=0;for(;a<n-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return r===0&&a===0?null:{left:[r,e.length-a],right:[r,t.length-a]}}function ws(e,t,n){return n.map((r,a)=>{let o=t+a;return{kind:"context",leftNo:o+e,rightNo:o,leftText:r,rightText:r}})}var Yt=20;function Co(e){let t=[];for(let n of e)n.kind==="mod"?(t.push({kind:"del",leftNo:n.leftNo,rightNo:null,leftText:n.leftText,rightText:null,...n.leftWord!==void 0?{leftWord:n.leftWord}:{}}),t.push({kind:"add",leftNo:null,rightNo:n.rightNo,leftText:null,rightText:n.rightText,...n.rightWord!==void 0?{rightWord:n.rightWord}:{}})):t.push(n);return t}function To(e,t,n,r,a,o){let s=e.findIndex(u=>u.kind==="gap"&&u.gap?.rightStart===t);if(s<0)return e.slice();let i=e[s].gap,l=ws(i.delta,r,a),d=[],c=i.count;if(n==="all"||a.length>=c)d.push(...l);else if(n==="down")d.push(...l),o||d.push(Qt({rightStart:i.rightStart+a.length,count:c-a.length,delta:i.delta,atStart:!1}));else{if(a.length===0)return[...e.slice(0,s),...e.slice(s+1)];let u=c-a.length;d.push(Qt({rightStart:i.rightStart,count:u,delta:i.delta,atStart:i.atStart})),d.push(...l)}return[...e.slice(0,s),...d,...e.slice(s+1)]}var lr=require("@deepseek-ai/dsh-client-ui-primitives");function No(e,t){let n=[[],[],[]],r=0;for(let a of e){let o=r+a.text.length,s=[r,Math.max(r,Math.min(o,t[0])),Math.max(r,Math.min(o,t[1])),o];for(let i=0;i<3;i++){let l=a.text.slice(s[i]-r,s[i+1]-r);l!==""&&n[i].push({text:l,style:a.style})}r=o}return n}function Eo(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.size>=8e3&&t.clear(),t.set(n,r),r}}function pn(e){let t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t}function Mo(e,t){let n=0,r=e.length-1;for(;n<r;){let a=n+r+1>>1;e[a]<=t?n=a:r=a-1}return n}function un(e,t,n,r){let a=e.length-1;if(a<=0)return{first:0,last:0};let o=Mo(e,t-r),s=Math.min(a,Mo(e,t+n+r)+1);return{first:o,last:s}}function Wn(e,t,n,r){return t<0?e:t>=e.first&&t<e.last?{first:Math.min(e.first,Math.max(0,t-r)),last:Math.max(e.last,Math.min(n,t+r))}:{first:Math.max(0,t-r),last:Math.min(n,t+r)}}var Zt=require("react");function gn(){let[e,t]=(0,Zt.useState)({top:0,height:0}),n=(0,Zt.useRef)(null),r=(0,Zt.useRef)(null);return{setEl:(0,Zt.useCallback)(o=>{if(r.current!==null&&(r.current(),r.current=null),n.current=o,o===null)return;let s=()=>t(l=>{let d=o.scrollTop,c=o.clientHeight;return l.top===d&&l.height===c?l:{top:d,height:c}});s(),o.addEventListener("scroll",s,{passive:!0});let i=typeof ResizeObserver<"u"?new ResizeObserver(s):null;i?.observe(o),r.current=()=>{o.removeEventListener("scroll",s),i?.disconnect()}},[]),viewport:e,elRef:n}}var Ye=require("react"),Qn=5e3,Yn=120;function Zn(e,t){let[n,r]=(0,Ye.useState)(e);return(0,Ye.useEffect)(()=>{let a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}function er(e,t){if(t==="")return[];let n=[],r=0;for(;;){let a=e.indexOf(t,r);if(a<0)break;n.push([a,a+t.length]),r=a+t.length}return n}function zr(e,t,n,r,a){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let o=[],s=0,i=0;for(let l of e){let d=s+l.text.length,c=Math.max(n,s),u=Math.min(r,d);if(u>c&&o.push((0,Ye.createElement)("span",{key:`${a}-${i++}`,style:l.style},l.text.slice(c-s,u-s))),s=d,s>=r)break}return o}function tr(e,t,n,r,a,o){let s=[],i=0,l=[...t].sort((d,c)=>d[0]-c[0]);for(let[d,c]of l){if(d<i)continue;d>i&&s.push(...zr(n,e,i,d,`${r}b${i}`));let u=a!==null&&a[0]===d&&a[1]===c;s.push((0,Ye.createElement)("mark",{key:`mk${r}-${d}`,className:`gp-find-hit${u?" gp-find-hit--active":""}`,...u?{ref:o}:{}},zr(n,e,d,c,`mk${r}-${d}`))),i=c}return i<e.length&&s.push(...zr(n,e,i,e.length,`${r}e`)),s}function nr(e){return(0,Ye.createElement)("div",{key:"find",className:"gp-find"},[(0,Ye.createElement)("input",{key:"in",ref:e.inputRef,className:"gp-find__input",type:"text",placeholder:e.t("files.findPlaceholder"),value:e.query,spellCheck:!1,"aria-label":e.t("files.findPlaceholder"),onChange:t=>e.onChange(t.target.value),onKeyDown:t=>{t.key==="Escape"?(t.preventDefault(),t.stopPropagation(),e.onClose()):t.key==="Enter"&&(t.preventDefault(),e.onStep(t.shiftKey?-1:1))}}),(0,Ye.createElement)("button",{key:"case",type:"button",className:`gp-find__btn gp-find__case${e.caseSensitive?" gp-find__case--active":""}`,title:e.t("files.findCase"),"aria-label":e.t("files.findCase"),"aria-pressed":e.caseSensitive,onClick:()=>e.onToggleCase()},"Aa"),(0,Ye.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,Ye.createElement)("button",{key:"prev",type:"button",className:"gp-find__btn",title:e.t("files.findPrev"),"aria-label":e.t("files.findPrev"),disabled:e.matches===0,onClick:()=>e.onStep(-1)},"\u2039"),(0,Ye.createElement)("button",{key:"next",type:"button",className:"gp-find__btn",title:e.t("files.findNext"),"aria-label":e.t("files.findNext"),disabled:e.matches===0,onClick:()=>e.onStep(1)},"\u203A"),(0,Ye.createElement)("button",{key:"x",type:"button",className:"gp-find__btn",title:e.t("files.findClose"),"aria-label":e.t("files.findClose"),onClick:()=>e.onClose()},"\u2715")])}var Ht=require("react");var Q=require("react");var fn=require("react"),xs='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function rr(e,t,n){let r=(0,fn.useRef)(t);(0,fn.useLayoutEffect)(()=>{r.current=t}),(0,fn.useEffect)(()=>{let a=document.activeElement instanceof HTMLElement?document.activeElement:null;n?.current?.focus();let o=()=>{let i=e.current;return i===null?[]:[...i.querySelectorAll(xs)].filter(l=>!l.hasAttribute("disabled")&&l.getClientRects().length>0)},s=i=>{if(i.key==="Escape"){i.stopPropagation(),r.current();return}if(i.key!=="Tab")return;let l=o();if(l.length===0)return;let d=document.activeElement instanceof HTMLElement?document.activeElement:null,c=d===null?-1:l.indexOf(d);i.preventDefault();let u=i.shiftKey?-1:1,f=c===-1?u===-1?l.length-1:0:(c+u+l.length)%l.length;l[f]?.focus()};return window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("keydown",s,!0),a?.focus()}},[e,n])}var zo=require("react-dom");function Po(e){let t=e.deltaMode===1?8:e.deltaMode===2?24:1;return Math.sign(e.deltaY)*Math.min(24,Math.abs(e.deltaY*t))}function Ro(e){let t=Math.sign(e)*Math.min(24,Math.abs(e));return t<=0?1-2*t/100:1/(1+2*t/100)}var ks=.1,_s=8,Fr=1.25;function Lo(e){return Number.isFinite(e)?Math.min(_s,Math.max(ks,e)):1}function Hr(e,t,n){return(e+t)*n-t}var Go=3;function Do(e,t){return e*e+t*t>=Go*Go}function Ao(e,t,n,r){return{left:e-n,top:t-r}}var Ss=300;function Rn({src:e,alt:t,t:n,viewportClass:r,fullscreen:a=!0,onEmptyAreaMouseDown:o}){let s=(0,Q.useRef)(null),i=(0,Q.useRef)(null),l=(0,Q.useRef)(null),[d,c]=(0,Q.useState)(null),[u,f]=(0,Q.useState)("fit"),[v,g]=(0,Q.useState)(null),[w,k]=(0,Q.useState)(!1),[y,x]=(0,Q.useState)(!1),C=(0,Q.useRef)("fit"),T=(0,Q.useRef)(null),F=(0,Q.useRef)(null),M=(0,Q.useRef)(null),E=(0,Q.useRef)(0),J=(0,Q.useCallback)(()=>{let N=l.current;return N===null||N.naturalWidth===0||N.clientWidth===0?null:N.clientWidth/N.naturalWidth},[]),te=(0,Q.useCallback)((N,G,$)=>{let B=i.current,z=l.current;if(B===null||z===null||z.naturalWidth===0||z.clientWidth===0)return;let Y=z.clientWidth/z.naturalWidth,S=Lo(N);if(S===Y)return;let W=B.getBoundingClientRect();T.current={x:G-W.left,y:$-W.top,ratio:S/Y},f(S)},[]),Z=(0,Q.useCallback)(N=>{let G=i.current,$=J();if(G===null||$===null)return;let B=G.getBoundingClientRect();te($*N,B.left+B.width/2,B.top+B.height/2)},[J,te]),I=(0,Q.useCallback)(()=>{let N=i.current;if(N===null)return;let G=N.getBoundingClientRect();te(1,G.left+G.width/2,G.top+G.height/2)},[te]),K=(0,Q.useCallback)(()=>{f("fit")},[]),U=(0,Q.useCallback)(()=>{let N=l.current;N===null||N.naturalWidth===0||N.clientWidth===0||g(Math.round(N.clientWidth/N.naturalWidth*100))},[]);(0,Q.useLayoutEffect)(()=>{C.current=u,u==="fit"&&U();let N=T.current;T.current=null;let G=i.current;N===null||G===null||(G.scrollLeft=Hr(G.scrollLeft,N.x,N.ratio),G.scrollTop=Hr(G.scrollTop,N.y,N.ratio))},[u,U]),(0,Q.useEffect)(()=>{C.current="fit",T.current=null,F.current=null,f("fit"),c(null),g(null)},[e]),(0,Q.useEffect)(()=>{let N=s.current;if(N===null)return;let G=Y=>{if(!Y.ctrlKey)return;Y.cancelable&&Y.preventDefault();let S=l.current;if(S===null||!S.complete||S.naturalWidth===0)return;let W=J();W!==null&&te(W*Ro(Po(Y)),Y.clientX,Y.clientY)},$=Y=>{let S=Y,W=J();W!==null&&(S.cancelable&&S.preventDefault(),F.current={base:W,x:S.clientX,y:S.clientY})},B=Y=>{let S=Y,W=F.current;W!==null&&(S.cancelable&&S.preventDefault(),te(W.base*S.scale,W.x,W.y))},z=()=>{F.current=null};return N.addEventListener("wheel",G,{passive:!1}),N.addEventListener("gesturestart",$,{passive:!1}),N.addEventListener("gesturechange",B,{passive:!1}),N.addEventListener("gestureend",z),()=>{N.removeEventListener("wheel",G),N.removeEventListener("gesturestart",$),N.removeEventListener("gesturechange",B),N.removeEventListener("gestureend",z)}},[J,te]);let se=(0,Q.useCallback)(N=>{if(N.button!==0||N.pointerType!=="mouse")return;let G=i.current;if(G===null)return;let{offsetX:$,offsetY:B}=N.nativeEvent;N.target===G&&($>=G.clientWidth||B>=G.clientHeight)||(M.current={id:N.pointerId,x:N.clientX,y:N.clientY,left:G.scrollLeft,top:G.scrollTop,pan:G.scrollWidth>G.clientWidth||G.scrollHeight>G.clientHeight,moved:!1})},[]);(0,Q.useEffect)(()=>{let N=B=>{let z=M.current;z===null||B!==z.id||(z.moved&&(E.current=performance.now()),M.current=null,x(!1))},G=B=>{let z=M.current;if(z===null||B.pointerId!==z.id)return;if(B.buttons===0){N(B.pointerId);return}let Y=B.clientX-z.x,S=B.clientY-z.y;if(!z.moved){if(!Do(Y,S))return;z.moved=!0,x(!0)}let W=i.current;if(W===null||!z.pan)return;let be=Ao(z.left,z.top,Y,S);W.scrollLeft=be.left,W.scrollTop=be.top},$=B=>{N(B.pointerId)};return window.addEventListener("pointermove",G),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$),()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$)}},[]),(0,Q.useEffect)(()=>{let N=i.current;if(N===null||typeof ResizeObserver>"u")return;let G=new ResizeObserver(()=>{C.current==="fit"&&U()});return G.observe(N),()=>G.disconnect()},[U]);let de=(0,Q.useCallback)(()=>{let N=l.current;N!==null&&(c({w:N.naturalWidth,h:N.naturalHeight}),C.current==="fit"&&U())},[U]),L=(0,Q.useCallback)(()=>{performance.now()-E.current<Ss||(u==="fit"?I():K())},[u,I,K]),ne=(0,Q.useCallback)(()=>{k(!1)},[]),ae=u==="fit"?v!==null?`${v}%`:"\u2014":`${Math.round(u*100)}%`,oe=u!=="fit"&&d!==null?{width:`${d.w*u}px`,maxWidth:"none",maxHeight:"none"}:void 0,H=d!==null?(0,Q.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,Q.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>Z(1/Fr)},"\u2212"),(0,Q.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${ae}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:I},ae),(0,Q.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>Z(Fr)},"+"),(0,Q.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":u==="fit",onClick:K},n("files.zoomFit")),a?(0,Q.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>k(!0)},"\u2921"):null]):null;return(0,Q.createElement)("div",{className:"gp-zoom",ref:s,"data-zoomed":u==="fit"?void 0:"true","data-dragging":y?"true":void 0},[(0,Q.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${r}`,ref:i,onPointerDown:se,onMouseDown:o===void 0?void 0:N=>{N.target===N.currentTarget&&o()}},(0,Q.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:oe,draggable:!1,onLoad:de,onDoubleClick:L})),H,w?(0,Q.createElement)(Cs,{key:"lb",src:e,alt:t,t:n,onClose:ne}):null])}function Cs({src:e,alt:t,t:n,onClose:r}){let a=(0,Q.useRef)(null),o=(0,Q.useRef)(null);return rr(a,r,o),(0,zo.createPortal)((0,Q.createElement)("div",{className:"gp-zl-backdrop",ref:a,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,Q.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,Q.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:r}),(0,Q.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,Q.createElement)(Rn,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:r})),(0,Q.createElement)("button",{key:"close",ref:o,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:r},(0,Q.createElement)(gt,{size:16}))])]),document.body)}function ar(e,t,n){let r=n(`diff.${e}`);return(0,Ht.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,Ht.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,Ht.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,Ht.createElement)(Rn,{key:"img",src:t,alt:r,t:n,viewportClass:"gp-imgcmp__img"})])}function Fo({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,Ht.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ar("before",e,r)):n==="after"?(0,Ht.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ar("after",t,r)):(0,Ht.createElement)("div",{className:"gp-imgcmp"},[ar("before",e,r),ar("after",t,r)])}var Ho=require("react");var Tt=require("react");function Bt(e,t,n,r){let a=JSON.stringify(e),o=(0,Tt.useRef)({key:a,visible:t,load:n,onError:r});o.current={key:a,visible:t,load:n,onError:r};let s=(0,Tt.useRef)(!0),i=(0,Tt.useRef)(0),l=(0,Tt.useRef)(null);(0,Tt.useEffect)(()=>(s.current=!0,()=>{s.current=!1,i.current+=1,l.current=null}),[]);let d=(0,Tt.useCallback)(()=>{let c=o.current;if(!s.current||!c.visible||!Qe.isVisible())return Promise.resolve();if(l.current?.key===c.key)return l.current.promise;let u=++i.current,f=()=>s.current&&u===i.current&&o.current.key===c.key,v=()=>f()&&o.current.visible&&Qe.isVisible(),g=c.load(f,v).catch(()=>{f()&&c.onError()}).finally(()=>{l.current?.promise===g&&(l.current=null)});return l.current={key:c.key,promise:g},g},[]);return(0,Tt.useEffect)(()=>{t&&d()},[a,t,d]),d}function Bo(e,t,n,r,a,o){let s=[t,n,r,a],[i,l]=(0,Ho.useState)({queryKey:s,value:{kind:"idle"}}),d=c=>c.length===s.length&&c.every((u,f)=>u===s[f]);return Bt(s,o&&e!==void 0&&t!==void 0&&n!==void 0&&r!==void 0,async c=>{if(e===void 0||t===void 0||n===void 0||r===void 0)return;l(g=>d(g.queryKey)&&g.value.kind==="ready"?g:{queryKey:s,value:{kind:"loading"}});let u=r==="commit"&&a!==void 0?{kind:"image-diff",path:n,base:"commit",commit:a}:r==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"},f=await e.query({sessionId:t,query:u});if(!c())return;let v=ve(f,"image-diff");l({queryKey:s,value:v!==null?{kind:"ready",res:v}:{kind:"failed"}})},()=>l({queryKey:s,value:{kind:"failed"}})),d(i.queryKey)?i.value:{kind:"idle"}}var Dt=require("react");function At({text:e,closeLabel:t,onClose:n,status:r=!1}){return(0,Dt.createElement)("div",{className:"gp-notice",...r?{role:"status"}:{}},[(0,Dt.createElement)("span",{key:"txt",className:"gp-notice__text"},e),(0,Dt.createElement)("button",{key:"close",type:"button",className:"gp-notice__close",title:t,"aria-label":t,onClick:n},(0,Dt.createElement)(gt,{key:"i",size:12}))])}function or(){let[e,t]=(0,Dt.useState)(()=>new Set);return(0,Dt.useMemo)(()=>({isDismissed:n=>e.has(n),dismiss:n=>t(r=>r.has(n)?r:new Set(r).add(n))}),[e])}var Br=20,Ts=27,Ns=29,Io=12,Es=600,dr=(0,R.memo)(function({visible:t=!0,text:n,mode:r,path:a,remote:o,sessionId:s,base:i,commit:l,expanded:d,truncated:c,newLines:u,t:f}){let v=or(),g=(0,R.useMemo)(()=>_o(n,u),[n,u]),w=vo(n),k=(0,lr.useCodeHighlighter)(a===void 0?void 0:(0,lr.languageForPath)(a)),y=(0,R.useMemo)(()=>Eo(k),[k]),[x,C]=(0,R.useState)(g),T=(0,R.useRef)(n);(0,R.useEffect)(()=>{if(T.current!==n){T.current=n,C(g);return}C(ee=>So(ee,u)??g)},[n,u,g]);let F=Rs(x,C,o,s,a,i,l),M=a!==void 0&&xo(a),[E,J]=(0,R.useState)("render");(0,R.useEffect)(()=>{J("render")},[a]);let Z=(w||M)&&a!==void 0&&wo(a)&&o!==void 0&&s!==void 0&&i!==void 0&&(!M||E==="render"),I=Bo(Z?o:void 0,Z?s:void 0,Z?a:void 0,Z?i:void 0,Z?l:void 0,t),[K,U]=(0,R.useState)(!1),[se,de]=(0,R.useState)(""),[L,ne]=(0,R.useState)(!1),[ae,oe]=(0,R.useState)(0),H=(0,R.useRef)(null),N=(0,R.useRef)(null),G=(0,R.useRef)(null);(0,R.useEffect)(()=>{U(!1),de(""),oe(0)},[n,a]);let $=(0,R.useMemo)(()=>r==="unified"?Co(x):null,[r,x]),B=(0,R.useMemo)(()=>r==="before"?Ds(x):r==="after"?As(x):null,[r,x]),z=(0,R.useMemo)(()=>Gs(x,$,B),[x,$,B]),Y=(0,R.useMemo)(()=>z.map(ee=>({key:ee.key,text:ee.text.toLowerCase()})),[z]),S=Zn(se,Yn),W=L?S:S.toLowerCase(),be=L?z:Y,ke=(0,R.useMemo)(()=>Ps(be,W),[be,W]);(0,R.useEffect)(()=>{oe(0)},[W]);let Le=ke.length===0?0:Math.min(ae,ke.length-1),De=ke.length>0?ke[Le]:null,Te=De?.cellKey??null,Fe=De?.start??-1,Je=(0,R.useMemo)(()=>{let ee=new Map;for(let V of ke){let he=ee.get(V.cellKey)??[];he.push([V.start,V.end]),ee.set(V.cellKey,he)}return ee},[ke]);(0,R.useEffect)(()=>{if(Te===null)return;let ee=requestAnimationFrame(()=>G.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(ee)},[Le,ke,Te,Fe]);let ft=(0,R.useCallback)(ee=>{oe(V=>ke.length===0?0:(V+ee+ke.length)%ke.length)},[ke.length]);(0,R.useEffect)(()=>{let ee=V=>{if(!((V.ctrlKey||V.metaKey)&&(V.key==="f"||V.key==="F")))return;let he=H.current;he===null||he.offsetParent===null||(V.preventDefault(),U(!0),requestAnimationFrame(()=>N.current?.select()))};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[]);let{setEl:xt,viewport:Ze,elRef:Ve}=gn(),Oe=(0,R.useRef)(null),[et,O]=(0,R.useState)(0),[pe,me]=(0,R.useState)(0),le=(0,R.useRef)({mode:r,rows:x,heights:[]});(le.current.mode!==r||le.current.rows!==x)&&(le.current={mode:r,rows:x,heights:[]});let Ne=le.current.heights,He=$!==null?$.length:B!==null?B.length:x.length,Ge=(0,R.useCallback)(ee=>{let V=$!==null?$[ee]??null:B===null?x[ee]??null:null;return V===null?Br:V.kind==="hunk"?Ts:V.kind==="gap"?Ns:Br},[$,B,x]),mt=(0,R.useMemo)(()=>{let ee=new Array(He);for(let V=0;V<He;V++){let he=Ne[V];ee[V]=he!==void 0&&he>0?he:Ge(V)}return ee},[He,Ne,Ge,pe]),Be=(0,R.useMemo)(()=>pn(mt),[mt]),Nt=Ze.height>0?Ze.height:Es,{first:dt,last:ct}=un(Be,Math.max(0,Ze.top-et),Nt,Io*Br),Se=Te===null?-1:Ms(Te),{first:ht,last:qe}=Wn({first:dt,last:ct},Se,He,Io);if((0,R.useLayoutEffect)(()=>{let ee=Oe.current,V=Ve.current;if(ee===null||V===null)return;let he=ee.getBoundingClientRect().top-V.getBoundingClientRect().top+V.scrollTop;Math.abs(he-et)>.5&&O(he);let tt=new Map;for(let We of ee.querySelectorAll("[data-r]")){let ut=Number(We.dataset.r),b=We.getBoundingClientRect().height;if(!Number.isFinite(b)||b<=0)continue;let ye=tt.get(ut);(ye===void 0||b>ye)&&tt.set(ut,b)}let _t=!1;for(let[We,ut]of tt){let b=Ne[We];(b===void 0||Math.abs(b-ut)>.5)&&(Ne[We]=ut,_t=!0)}_t&&me(We=>We+1)}),Z){let ee=(()=>{if(I.kind==="idle"||I.kind==="loading")return(0,R.createElement)("div",{className:"gp-empty"},f("common.loading"));if(I.kind==="ready"){let V=I.res;if(V.tooLarge===!0)return(0,R.createElement)("div",{className:"gp-empty"},f("diff.tooLarge"));if(V.mime!==null&&(V.old!==void 0||V.new!==void 0))return(0,R.createElement)(Fo,{oldUrl:V.old,newUrl:V.new,mode:r,t:f})}return(0,R.createElement)("div",{className:"gp-empty"},f("diff.binary"))})();return M?Oo(E,J,ee,f):ee}if(w&&!M)return(0,R.createElement)("div",{className:"gp-empty"},f("diff.binary"));let pt=K&&W!==""?{perCell:Je,activeKey:Te,activeRange:De!==null?[De.start,De.end]:null,activeRef:G}:null,Et=(ee,V)=>V>.5?(0,R.createElement)("div",{key:ee,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${V}px`}}):null,kt=Et("lead",Be[ht]),je=Et("tail",Be[He]-Be[qe]),Mt=(()=>{if(n.trim()==="")return(0,R.createElement)("div",{className:"gp-empty"},f("diff.empty"));if(B!==null){let V=[kt];for(let he=ht;he<qe;he++){let tt=B[he];V.push((0,R.createElement)("div",{key:`n${he}`,className:"gp-diff-no"},tt.no??"")),V.push(sr("gp-diff-cell",`c${he}`,tt.text,y,pt,he))}return V.push(je),(0,R.createElement)("div",{className:"gp-diff__single",ref:Oe},V)}if($!==null){let V=[kt];for(let he=ht;he<qe;he++)V.push(...Fs($[he],he,y,F,pt,f));return V.push(je),(0,R.createElement)("div",{className:"gp-diff__unified",ref:Oe},V)}let ee=[kt];for(let V=ht;V<qe;V++)ee.push(...zs(x[V],V,y,F,pt,f));return ee.push(je),(0,R.createElement)("div",{className:"gp-diff__side",ref:Oe},ee)})(),ie=K?(0,R.createElement)(nr,{inputRef:N,query:se,matches:ke.length,active:Le,caseSensitive:L,onChange:de,onToggleCase:()=>ne(ee=>!ee),onStep:ft,onClose:()=>U(!1),t:f}):null,Ue=d===!0&&x.some(ee=>ee.kind==="gap"),Ie=f("diff.truncated"),Gt=f("diff.expandCapped",{n:2e3}),Ae=ee=>`${a??""}\0${ee}`,yt=(0,R.createElement)("div",{className:"gp-diff__wrap",ref:H},[ie,c===!0&&!v.isDismissed(Ae(Ie))?(0,R.createElement)(At,{key:"truncated",text:Ie,closeLabel:f("common.close"),onClose:()=>v.dismiss(Ae(Ie))}):null,Ue&&!v.isDismissed(Ae(Gt))?(0,R.createElement)(At,{key:"capped",text:Gt,closeLabel:f("common.close"),onClose:()=>v.dismiss(Ae(Gt))}):null,(0,R.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:xt},Mt)]);return M?Oo(E,J,yt,f):yt});function Ms(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function Gs(e,t,n){let r=[];return n!==null?(n.forEach((a,o)=>r.push({key:`c${o}`,text:a.text})),r):t!==null?(t.forEach((a,o)=>{if(a.kind==="hunk"||a.kind==="gap")return;let s=a.rightText??a.leftText??"";s!==""&&r.push({key:`c${o}`,text:s})}),r):(e.forEach((a,o)=>{a.kind==="hunk"||a.kind==="gap"||(a.leftText!==null&&a.leftText!==""&&r.push({key:`l${o}`,text:a.leftText}),a.rightText!==null&&a.rightText!==""&&r.push({key:`r${o}`,text:a.rightText}))}),r)}function Ps(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[a,o]of er(r.text,t))if(n.push({cellKey:r.key,start:a,end:o}),n.length>=Qn)return n;return n}function Oo(e,t,n,r){let a=(o,s)=>(0,R.createElement)("button",{key:o,type:"button",className:`gp-seg__btn${e===o?" gp-seg__btn--active":""}`,"aria-pressed":e===o,onClick:()=>t(o)},s);return(0,R.createElement)("div",{className:"gp-svgdiff"},[(0,R.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,R.createElement)("div",{className:"gp-seg"},[a("render",r("diff.svgRender")),a("source",r("diff.svgSource"))])),(0,R.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function Rs(e,t,n,r,a,o,s){let[i,l]=(0,R.useState)(null),d=(0,R.useRef)(0);(0,R.useEffect)(()=>{d.current+=1,l(null)},[e]);let c=(0,R.useCallback)((u,f)=>{if(n===void 0||r===void 0||a===void 0||o===void 0)return;let v=`${u.rightStart}:${f}`;l(v);let g=++d.current,{start:w,end:k}=Ls(u,f),y=o==="commit"&&s!==void 0?{kind:"file-lines",path:a,base:"commit",commit:s,start:w,end:k}:o==="staged"?{kind:"file-lines",path:a,base:"staged",start:w,end:k}:{kind:"file-lines",path:a,base:"worktree",start:w,end:k};n.query({sessionId:r,query:y}).then(x=>{if(g!==d.current)return;let C=ve(x,"file-lines");l(null),C!==null&&t(T=>To(T,u.rightStart,f,C.start,C.lines,C.eof))}).catch(()=>{g===d.current&&l(null)})},[n,r,a,o,s,t]);return{busy:i,run:c}}function Ls(e,t){let n=e.count;return t==="all"||n<=Yt?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+Yt-1}:{start:e.rightStart+n-Yt,end:e.rightStart+n-1}}function ir(e,t=""){return e.map((n,r)=>(0,R.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function $o(e,t,n,r){if(n===null)return null;let a=n.perCell.get(t);if(a===void 0||a.length===0)return null;let o=n.activeKey===t?n.activeRange:null;return tr(e,a,r,t,o,n.activeRef)}function sr(e,t,n,r,a=null,o=-1){let s={key:t,className:e,"data-r":o>=0?o:void 0};if(n==="")return(0,R.createElement)("div",s,"\xA0");let i=r(n)?.[0],l=$o(n,t,a,i);return l!==null?(0,R.createElement)("div",s,l):(0,R.createElement)("div",s,i===void 0?n:ir(i))}function Ir(e,t,n,r,a,o,s=null,i=-1){let l={key:t,className:e,"data-r":i>=0?i:void 0},d=o(n)?.[0]??[{text:n,style:{}}],c=$o(n,t,s,d);if(c!==null)return(0,R.createElement)("div",l,c);let[u,f,v]=No(d,r);return(0,R.createElement)("div",l,[...ir(u,"p"),(0,R.createElement)("span",{key:"w",className:a},f.length===0?"\xA0":ir(f)),...ir(v,"s")])}function Ds(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function As(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function zs(e,t,n,r,a,o){if(e.kind==="hunk")return[(0,R.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[Xo(e.gap,t,r,o)];let s=e.kind==="del"||e.kind==="mod"?"gp-diff-row--del":"",i=e.kind==="add"||e.kind==="mod"?"gp-diff-row--add":"",l=e.leftText===null?(0,R.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.leftWord!==void 0?Ir(`gp-diff-cell ${s}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,a,t):sr(`gp-diff-cell ${s}`,`l${t}`,e.leftText,n,a,t),d=e.rightText===null?(0,R.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${i}`}):e.kind==="mod"&&e.rightWord!==void 0?Ir(`gp-diff-cell ${i}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,a,t):sr(`gp-diff-cell ${i}`,`r${t}`,e.rightText,n,a,t);return[(0,R.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,R.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function Fs(e,t,n,r,a,o){if(e.kind==="hunk")return[(0,R.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[Xo(e.gap,t,r,o)];let s=e.kind==="del",i=e.kind==="add",l=i?"gp-diff-row--add":s?"gp-diff-row--del":"",d=i?"+":s?"\u2212":"\xA0",c=e.rightText??e.leftText??"",u=i?e.rightWord:s?e.leftWord:void 0,f=i?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",v=`gp-diff-cell gp-diff-uni__code ${l}`,g=u!==void 0?Ir(v,`c${t}`,c,u,f,n,a,t):sr(v,`c${t}`,c,n,a,t);return[(0,R.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,R.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,R.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),g]}function Xo(e,t,n,r){let a=n.busy===`${e.rightStart}:all`,o=n.busy===`${e.rightStart}:up`,s=n.busy===`${e.rightStart}:down`,i=(c,u,f)=>(0,R.createElement)("button",{key:c,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:v=>{v.stopPropagation(),n.run(e,c)}},f?r("common.loading"):u),l=[],d=e.count;return d<=Yt?l.push(i("all",r("diff.expandGap",{n:d}),a)):(e.atStart||l.push(i("up",r("diff.expandUp",{n:Yt}),o)),l.push(i("all",r("diff.expandGap",{n:d}),a)),l.push(i("down",r("diff.expandDown",{n:Yt}),s))),(0,R.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function cr(e){return ko(e)}var re=require("react");var Hs=100;function Ko(e,t,n,r=!0){let[a,o]=(0,re.useState)(null),[s,i]=(0,re.useState)(!1),[l,d]=(0,re.useState)([]),c=Bt([t,...n],r,async(u,f)=>{i(!1);let[v,g]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]);if(!u())return;let w=ve(v,"branches"),k=ve(g,"tags");if(w===null){i(!0);return}if(o({current:w.current,defaultBranch:w.defaultBranch,local:w.local,remote:w.remote,tags:k?.tags??a?.tags??[]}),!f())return;let y=await e.query({sessionId:t,query:{kind:"authors"}});if(!u())return;let x=ve(y,"authors");d(x?.authors??[])},()=>i(!0));return{tree:a,treeError:s,authors:l,reload:c}}var Jo=2e4;function Bs(e,t,n){if(t===void 0)return e;let r=n.map(l=>({hash:l.hash,parents:l.parents})),a=new Set(r.map(l=>l.hash)),o=new Map;for(let l of[...e??[],...t])a.has(l.hash)||(o.delete(l.hash),o.set(l.hash,l.parents));let s=[...o],i=s.length>Jo?s.slice(s.length-Jo):s;return[...r,...i.map(([l,d])=>({hash:l,parents:d}))]}function Vo(e,t,n,r,a,o=!0){let[s,i]=(0,re.useState)({commits:[],topology:void 0,total:0,appliedFilter:n}),{commits:l,topology:d,total:c,appliedFilter:u}=s,[f,v]=(0,re.useState)(!1),[g,w]=(0,re.useState)(!1),k=(0,re.useRef)(0),y=(0,re.useRef)(!1),x=(0,re.useRef)(s),C=(0,re.useRef)(!1),T=(0,re.useRef)(()=>!1),F=(0,re.useRef)(o);F.current=o;let M=(0,re.useRef)(null),E=(0,re.useCallback)(async(I,K,U)=>{if(y.current)return;y.current=!0;let se=k.current;v(!0),w(!1);let de=await e.query({sessionId:t,query:{kind:"history",limit:Hs,skip:I,...K.ref?{ref:K.ref}:{},...K.search?{search:K.search}:{},...K.author?{author:K.author}:{},...K.since?{since:K.since}:{}}});if(!U()||se!==k.current)return;y.current=!1,v(!1);let L=ve(de,"history");if(L===null){w(!0);return}let ne=x.current,ae=I===0?L.commits:[...ne.commits,...L.commits],oe={commits:ae,topology:Bs(I===0?void 0:ne.topology,L.topology,ae),total:L.total,appliedFilter:K};x.current=oe,C.current=!0,i(oe)},[e,t]),J=(0,re.useRef)(n);Bt([t,...r,n.ref,n.search,n.author,n.since],o,async I=>{k.current+=1,y.current=!1,T.current=I,C.current=!1,J.current!==n&&(J.current=n,a(),M.current&&(M.current.scrollTop=0)),await E(0,n,I)},()=>{y.current=!1,v(!1),w(!0)});let te=c<0?!0:l.length<c,Z=(0,re.useCallback)(()=>{if(!F.current||!Qe.isVisible()||y.current||!C.current||!te||!T.current())return;let I=T.current;E(l.length,n,I).catch(()=>{I()&&(y.current=!1,v(!1),w(!0))})},[E,l.length,n,te]);return{commits:l,topology:d,appliedFilter:u,total:c,loading:f,listError:g,hasMore:te,listRef:M,loadMore:Z}}function qo(e,t,n,r=!0){let[a,o]=(0,re.useState)(null),[s,i]=(0,re.useState)(null),[l,d]=(0,re.useState)(!1),[c,u]=(0,re.useState)(null),[f,v]=(0,re.useState)(null),[g,w]=(0,re.useState)(!1),[k,y]=(0,re.useState)(n),[x,C]=(0,re.useState)(!1),T=(0,re.useRef)(0),F=(0,re.useRef)(null),M=(0,re.useRef)(new Map),E=(0,re.useCallback)((G,$)=>{let B=M.current;for(B.set(G,$);B.size>50;){let z=B.keys().next().value;if(z===void 0)break;B.delete(z)}},[]),J=(0,re.useCallback)(()=>{o(null),i(null),F.current=null},[]),te=(0,re.useCallback)(G=>{F.current===G.hash&&o(G)},[]),Z=(0,re.useCallback)(async G=>{F.current=G.hash,o(G),d(!1),T.current+=1,u(null),v(null),w(!1);let $=M.current.get(G.hash);if($!==void 0){i($);return}i(null);let B=await e.query({sessionId:t,query:{kind:"show",ref:G.hash}});if(F.current!==G.hash)return;let z=ve(B,"show");if(z!==null){let Y={commit:z.commit,body:z.body,stats:z.stats,insertions:z.insertions,deletions:z.deletions};E(G.hash,Y),i(Y)}else d(!0)},[e,t,E]),I=(0,re.useCallback)(async(G,$,B,z=!1)=>{let Y=++T.current;u({path:G,hash:$,shortHash:B}),v(null),w(!1),C(z);let S=await e.query({sessionId:t,query:{kind:"diff",path:G,base:"commit",commit:$,...z?{context:2e3}:{}}});if(Y!==T.current)return;let W=ve(S,"diff");W!==null?v({text:W.text,newLines:W.newLines,truncated:W.truncated}):w(!0)},[e,t]),K=(0,re.useCallback)(()=>{T.current+=1,u(null),v(null),w(!1),C(!1)},[]);(0,re.useEffect)(()=>{if(c===null)return;let G=$=>{$.key==="Escape"&&K()};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[c,K]);let[U,se]=(0,re.useState)(null),[de,L]=(0,re.useState)(null),ne=(0,re.useRef)(void 0),ae=(0,re.useRef)(null),oe=(0,re.useRef)(r);oe.current=r;let H=(0,re.useCallback)((G,$,B)=>{ne.current!==void 0&&clearTimeout(ne.current),ne.current=setTimeout(()=>{if(!oe.current||!Qe.isVisible())return;ae.current=G.hash,se({commit:G,x:$,y:B});let z=M.current.get(G.hash);if(z!==void 0){L(z.body);return}L(null),e.query({sessionId:t,query:{kind:"show",ref:G.hash}}).then(Y=>{if(ae.current!==G.hash)return;let S=ve(Y,"show");S!==null?(E(G.hash,{commit:S.commit,body:S.body,stats:S.stats,insertions:S.insertions,deletions:S.deletions}),L(S.body)):L("")})},260)},[e,t,E]),N=(0,re.useCallback)(()=>{ne.current!==void 0&&clearTimeout(ne.current),ae.current=null,se(null),L(null)},[]);return(0,re.useEffect)(()=>{r||N()},[r,N]),(0,re.useEffect)(()=>()=>{ne.current!==void 0&&clearTimeout(ne.current)},[]),{selected:a,detail:s,detailError:l,select:Z,resyncSelected:te,clearSelection:J,fileDiff:c,fileDiffData:f,fileDiffError:g,fileDiffMode:k,setFileDiffMode:y,fileDiffExpanded:x,openFileDiff:I,closeFileDiff:K,hover:U,hoverBody:de,onHoverEnter:H,onHoverLeave:N}}var vt=require("react"),Is=(e,t,n)=>Math.max(t,Math.min(n,e));function Os(e,t){try{let n=typeof localStorage<"u"?localStorage.getItem(e):null,r=n===null?NaN:Number(n);return Number.isFinite(r)?r:t}catch{return t}}function $s(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function en(e){let{storageKey:t,initial:n,min:r,reserve:a,edge:o}=e,[s,i]=(0,vt.useState)(()=>Os(t,n)),l=(0,vt.useRef)(null),d=(0,vt.useRef)(null),c=(0,vt.useCallback)(f=>{let g=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:f.clientX,w:s,max:Math.max(r,g-a)},f.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[s,r,a]);(0,vt.useEffect)(()=>{if(typeof window>"u")return;let f=g=>{let w=d.current;if(w===null)return;let k=g.clientX-w.x;i(Is(w.w+(o==="end"?k:-k),r,w.max))},v=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),i(g=>($s(t,g),g)))};return window.addEventListener("pointermove",f),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",v)}},[o,r,t]);let u=(0,vt.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:c});return{width:s,divider:u}}var jo=require("react");function It(e,t,n,r,a=!1){return e.map(o=>(0,jo.createElement)("button",{key:o,type:"button",className:`gp-seg__btn${t===o?" gp-seg__btn--active":""}`,...a?{disabled:!0}:{},onClick:()=>n(o)},r(o)))}var Ee=require("react"),Uo=require("react-dom");function tn(e,t,n){switch(e){case"empty-message":return n("error.emptyMessage");case"not-a-git-repo":return n("error.notARepo");case"cwd-unavailable":return n("error.noCwd");case"local-changes-block":return n("error.localChangesBlock");case"not-ff":return n("error.notFastForward");case"push-rejected":return n("error.pushRejected");case"auth-failed":return n("error.authFailed");case"conflict":return n("error.conflict");case"revert-conflict":return n("error.revertConflict");case"revert-stuck":return n("error.revertStuck");case"revert-merge":return n("error.revertMerge");case"index-busy":return n("error.indexBusy");case"not-found":return n("error.notFound");case"branch-in-use":return n("error.branchInUse");case"nested-repo":return n("error.nestedRepo");case"nested-repo-partial":return n("error.nestedRepoPartial");case"stash-switch-failed":return n("error.stashSwitchFailed",{reason:t??""});case"invalid-name":case"invalid-index":return n("error.invalidName");default:return t??n("error.generic")}}function mn(e){return(0,Ee.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function hn(e){return(0,Ee.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,Ee.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,Ee.createElement)("button",{key:"ok",type:"button",className:`gp-btn ${e.danger?"gp-btn--danger":"gp-btn--primary"}`,disabled:e.confirmDisabled,onClick:e.onConfirm},e.confirmLabel)])}function Ot(e){return typeof document>"u"?null:(0,Ee.createElement)(Xs,e)}function Xs({onClose:e,title:t,icon:n,hash:r,body:a,footer:o,overlay:s,portalKey:i,t:l}){let d=s!=null;(0,Ee.useEffect)(()=>{let u=f=>{f.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,d]);let c=(0,Ee.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{!d&&u.target===u.currentTarget&&e()}},(0,Ee.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,Ee.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,Ee.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,Ee.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,Ee.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,Ee.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,Ee.createElement)(gt,{size:15}))]),(0,Ee.createElement)("div",{key:"body",className:"gp-modal__form"},a),o,s??null]));return(0,Uo.createPortal)(c,document.body,i)}function Js(e){return(0,Ee.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,Ee.createElement)("div",{key:"sp",className:"gp-spinner"}),(0,Ee.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function ot(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return Ot({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,Ee.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,mn(e.t),e.error!==null?(0,Ee.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:hn({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:Js(e.busyLabel)}:{}})}var ue=require("react");function Wo(e,t){return typeof document>"u"?null:(0,ue.createElement)(Ks,{target:e,...t})}function Ks({target:e,onClose:t,onCreate:n,error:r,t:a}){let[o,s]=(0,ue.useState)(""),[i,l]=(0,ue.useState)(!1),[d,c]=(0,ue.useState)(""),u=()=>{o.trim()!==""&&n(o.trim(),i?d:"")};return Ot({onClose:t,title:a("tag.createTitle"),icon:(0,ue.createElement)(on,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:a,body:[(0,ue.createElement)("input",{key:"name",className:"gp-input",placeholder:a("tag.namePlaceholder"),value:o,autoFocus:!0,onChange:f=>s(f.target.value),onKeyDown:f=>{f.key==="Enter"&&u()}}),(0,ue.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,ue.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:i,onChange:()=>l(f=>!f)}),a("tag.annotated")]),i?(0,ue.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:a("tag.messagePlaceholder"),value:d,onChange:f=>c(f.target.value)}):null,mn(a),r!==null?(0,ue.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:hn({onClose:t,onConfirm:u,confirmLabel:a("tag.create"),confirmDisabled:o.trim()==="",danger:!1,t:a})})}function Qo(e,t){return typeof document>"u"?null:(0,ue.createElement)(Vs,{target:e,...t})}function Vs({target:e,from:t,dirty:n,lostFiles:r,lostTotal:a,lostTruncated:o,busy:s,error:i,onReset:l,onClose:d,t:c}){let[u,f]=(0,ue.useState)("mixed"),[v,g]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{u!=="hard"&&g(!1)},[u]);let w=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],k=s||u==="hard"&&!v;return Ot({onClose:d,title:c("reset.title"),icon:(0,ue.createElement)(Xn,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:c,body:[(0,ue.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},c("reset.body",{from:t,to:e.shortHash})),(0,ue.createElement)("div",{key:"modes",className:"gp-reset__modes"},w.map(y=>(0,ue.createElement)("label",{key:y.value,className:`gp-reset__mode${u===y.value?" gp-reset__mode--on":""}${y.value==="hard"?" gp-reset__mode--danger":""}`},[(0,ue.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:u===y.value,onChange:()=>f(y.value)}),(0,ue.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,ue.createElement)("span",{key:"l",className:"gp-reset__modelabel"},c(y.label)),(0,ue.createElement)("span",{key:"h",className:"gp-reset__modehint"},c(y.hint))])]))),u==="hard"?(0,ue.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},c("reset.hardOrphan")):null,u==="hard"&&a>0?(0,ue.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,ue.createElement)("div",{key:"w",className:"gp-reset__warn"},c("reset.hardWarn")),(0,ue.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(y=>(0,ue.createElement)("li",{key:y,title:y},y)),o?(0,ue.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},c("reset.lostMore")):null])]):null,u==="hard"?(0,ue.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,ue.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:v,onChange:()=>g(y=>!y)}),c(a>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,ue.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},c("ops.dirtyWarn")):null,mn(c),i!==null?(0,ue.createElement)("div",{key:"err",className:"gp-feedback"},i):null],footer:hn({onClose:d,onConfirm:()=>void l(u),confirmLabel:c("reset.confirm"),confirmDisabled:k,danger:u==="hard",t:c})})}var it=require("react");function Yo(e,t){return typeof document>"u"?null:(0,it.createElement)(qs,{target:e,...t})}function qs({target:e,from:t,dirty:n,busy:r,error:a,onConfirm:o,onClose:s,t:i}){let[l,d]=(0,it.useState)(!1),c=(u,f,v,g)=>(0,it.createElement)("label",{key:f,className:`gp-bpick__mode${l===u?" gp-bpick__mode--on":""}`},[(0,it.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===u,onChange:()=>d(u)}),(0,it.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,it.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},v),(0,it.createElement)("span",{key:"h",className:"gp-bpick__modehint"},g)])]);return ot({title:i("switch.confirmTitle"),body:i("switch.body",{from:t??i("switch.detached"),to:e.name}),extra:(0,it.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,it.createElement)("div",{key:"trk",className:"gp-bpick__note"},i("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,it.createElement)("div",{key:"dw",className:"gp-bpick__warn"},i("switch.dirtyWarn",{count:n})),n===0?null:(0,it.createElement)("div",{key:"md",className:"gp-bpick__modes"},[c(!1,"direct",i("switch.modeDirect"),i("switch.modeDirectHint")),c(!0,"stash",i("switch.modeStash",{count:n}),i("switch.modeStashHint"))])]),confirmLabel:i(l?"switch.confirmStash":"switch.confirm"),danger:!1,error:a,confirmBusy:r,busyLabel:i("switch.switching"),onConfirm:()=>o(l),onClose:s,t:i})}function js(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function Zo(e){let t=new Set(e.local.map(a=>a.name)),n=e.local.map(a=>({key:`local:${a.name}`,group:"local",label:a.name,name:a.name,reused:!1,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})),r=[];for(let a of e.remote){let o=js(a.name);if(o===null)continue;let s=t.has(o.branch);r.push({key:`remote:${a.name}`,group:"remote",label:a.name,name:o.branch,createFrom:s?void 0:a.name,reused:s,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})}return[...n,...r]}function ei(e,t){return e.name!==t}var _e=require("react");var Re=require("react"),ti=require("react-dom"),Us=140,Ws=260;function $t(e){let t=e?.placement??"above",n=e?.delayMs??Us,r=e?.maxWidth??Ws,[a,o]=(0,Re.useState)(null),[s,i]=(0,Re.useState)(!1),l=(0,Re.useRef)(!1),d=(0,Re.useRef)(void 0),c=(0,Re.useCallback)(C=>{l.current=C,i(C)},[]),u=(0,Re.useCallback)(()=>{d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),c(!1),o(null)},[c]),f=(0,Re.useCallback)((C,T)=>{let F=C.getBoundingClientRect(),M=C.closest('.gp-panel[data-layout="compact"]')!==null,E=M?F.left+F.width/2:F.left,J=Math.min(r,Math.max(80,window.innerWidth-16));o(t==="below"?{text:T,left:E,center:M,maxW:J,top:F.bottom+6}:{text:T,left:E,center:M,maxW:J,bottom:Math.max(8,window.innerHeight-F.top+6)})},[t,r]),v=(0,Re.useCallback)((C,T)=>{l.current||(d.current!==void 0&&clearTimeout(d.current),c(!1),d.current=setTimeout(()=>f(C,T),n))},[f,n,c]),g=(0,Re.useCallback)((C,T)=>{d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),c(!0),f(C,T)},[f,c]),w=(0,Re.useRef)(null);(0,Re.useLayoutEffect)(()=>{let C=w.current;if(C===null||a===null)return;let T=8,F=window.innerWidth,M=window.innerHeight,E=C.getBoundingClientRect(),J=a.center===!0?T+E.width/2:T,te=a.center===!0?F-T-E.width/2:F-T-E.width,Z=Math.min(Math.max(a.left,J),Math.max(J,te)),I=Math.max(T,M-T-E.height),K=a.top===void 0?void 0:Math.min(Math.max(a.top,T),I),U=a.bottom===void 0?void 0:Math.min(Math.max(a.bottom,T),I);Z===a.left&&K===a.top&&U===a.bottom||o(se=>{if(se===null)return se;let de={...se,left:Z};return K!==void 0&&(de.top=K),U!==void 0&&(de.bottom=U),de})},[a]),(0,Re.useEffect)(()=>{if(!s)return;let C=F=>{let M=F.target;M instanceof Element&&M.closest(".gp-tip")!==null||u()},T=F=>{F.key==="Escape"&&u()};return document.addEventListener("pointerdown",C,!0),document.addEventListener("keydown",T,!0),()=>{document.removeEventListener("pointerdown",C,!0),document.removeEventListener("keydown",T,!0)}},[s,u]);let k=(0,Re.useCallback)(C=>({onMouseEnter:T=>v(T.currentTarget,C),onMouseLeave:()=>{l.current||u()},onFocus:T=>v(T.currentTarget,C),onBlur:()=>{l.current||u()}}),[v,u]),y={left:a?.left??0,maxWidth:a?.maxW??r};a?.top!==void 0&&(y.top=a.top),a?.bottom!==void 0&&(y.bottom=a.bottom);let x=a!==null&&typeof document<"u"?(0,ti.createPortal)((0,Re.createElement)("div",{ref:w,className:`gp-tip gp-tip--sb${a.center===!0?" gp-tip--center":""}`,style:y},a.text),document.body):null;return{tipProps:k,tipNode:x,hideTip:u,showTipNow:g}}function zt(e){return e.hasUpstream===!0&&e.ahead>0&&e.behind===0}function ni(e,t,n){if(e==="loading"||e===null)return(0,_e.createElement)("div",{className:"gp-pullscope gp-pullscope--loading"},t(n.loading));let r=t(n.line,{commits:e.commits,files:e.files,ins:e.insertions,del:e.deletions}),a=r.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(a===null)return(0,_e.createElement)("div",{className:"gp-pullscope"},r);let o=r.indexOf(a[0]);return(0,_e.createElement)("div",{className:"gp-pullscope"},[r.slice(0,o),(0,_e.createElement)("span",{key:"add",className:"gp-pullscope__add"},a[1])," / ",(0,_e.createElement)("span",{key:"del",className:"gp-pullscope__del"},a[2]),r.slice(o+a[0].length)])}function ri(e,t){return ni(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function ai(e,t){return ni(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function Qs(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function Or(e,t){return(0,_e.createElement)(Ys,{snapshot:e,cb:t})}function Ys({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:a,hideTip:o}=$t({placement:"above"}),s=e.remote??null,i=e.hasUpstream===!0,l=(()=>{if(s===null||s.hostKind!=="github")return null;let y=(0,_e.createElement)(Qa,{size:14});if(s.webUrl===null)return(0,_e.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":s.url,...r(s.url)},(0,_e.createElement)("span",{className:"gp-statusbar__ic"},y));let x=s.host!==null?n("status.openRepoOn",{host:s.host}):n("status.openRepo"),C=`${Qs(s.webUrl)} \xB7 ${x}`;return(0,_e.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:s.webUrl,target:"_blank",rel:"noreferrer","aria-label":C,...r(C)},(0,_e.createElement)("span",{className:"gp-statusbar__ic"},y))})(),{ahead:d,behind:c,branch:u}=e,f=i&&c>0&&d===0,v=zt(e),g=!i&&u!==null&&s!==null,w=(()=>{let y,x="";return u===null?y=n("status.detached"):i?d===0&&c===0?(y=n("status.synced"),x=" gp-statusbar__state--ok"):d>0&&c>0?(y=n("status.diverged",{ahead:d,behind:c}),x=" gp-statusbar__state--warn"):c>0?(y=n("status.behind",{n:c}),x=" gp-statusbar__state--warn"):y=n("status.ahead",{n:d}):y=n("status.noUpstream"),t.syncError!==null?(0,_e.createElement)("span",{key:"error",className:"gp-statusbar__state gp-statusbar__state--warn",role:"alert",title:t.syncError},t.syncError):(0,_e.createElement)("span",{key:"s",className:`gp-statusbar__state${x}`},y)})(),k=[s!==null?(0,_e.createElement)("button",{key:"check",type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),...r(n("status.checkTitle")),onClick:()=>{o(),t.onCheck()}},(0,_e.createElement)(Za,{size:13})):null,f?(0,_e.createElement)("button",{key:"pull",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),...r(n("status.pullTitle")),onClick:()=>{o(),t.onPull()}},[(0,_e.createElement)(Ya,{key:"i",size:12}),n("status.pull")]):null,v?(0,_e.createElement)("button",{key:"push",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),...r(n("status.pushTitle")),onClick:()=>{o(),t.onPush()}},[(0,_e.createElement)(En,{key:"i",size:12}),n("status.push")]):null,g?(0,_e.createElement)("button",{key:"publish",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),...r(n("status.publishTitle")),onClick:()=>{o(),t.onPublish()}},[(0,_e.createElement)(En,{key:"i",size:12}),n("status.publish")]):null];return(0,_e.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,_e.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[w,...k]),a])}var st=require("react");function pr({remote:e,sessionId:t,snapshot:n,onAction:r,onClose:a,t:o,onBusyChange:s}){let i=JSON.stringify([t,n.root,n.branch,n.head]),l=(0,st.useRef)(i),d=(0,st.useRef)({scope:i,snapshot:n});d.current={scope:i,snapshot:n};let c=(0,st.useRef)(!1),u=(0,st.useRef)(!1),[f,v]=(0,st.useState)("loading"),[g,w]=(0,st.useState)(null),[k,y]=(0,st.useState)(!1),x=i===l.current;(0,st.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]),(0,st.useEffect)(()=>{(!x||!zt(n))&&(u.current||a())},[x,n,k,a]),(0,st.useEffect)(()=>{if(!x)return;let T=!0;return v("loading"),(async()=>{try{let F=await e.query({sessionId:t,query:{kind:"push-preview"}});if(!T||d.current.scope!==l.current)return;let M=ve(F,"push-preview");M!==null&&M.hasUpstream?v(M):(v(null),w(F.ok?o("error.generic"):tn(F.error.code,F.error.message,o)))}catch(F){if(!T||d.current.scope!==l.current)return;v(null),w(F instanceof Error?F.message:o("error.generic"))}})(),()=>{T=!1}},[e,t,i,x,o]);let C=async()=>{if(!(u.current||d.current.scope!==l.current||!zt(d.current.snapshot))){u.current=!0,w(null),y(!0),s?.(!0);try{let T=await r({kind:"push"});if(!c.current)return;T.ok?a():d.current.scope===l.current&&w(T.error??o("error.generic"))}catch(T){c.current&&d.current.scope===l.current&&w(T instanceof Error?T.message:o("error.generic"))}finally{u.current=!1,c.current&&y(!1),s?.(!1)}}};return x?ot({title:o("status.pushConfirmTitle"),body:o("status.pushConfirmBody",{branch:n.branch??"HEAD",ahead:n.ahead}),extra:f===null?null:ai(f,o),confirmLabel:o("status.pushConfirm"),danger:!1,error:g,confirmBusy:k,busyLabel:o("status.pushing"),onConfirm:()=>void C(),onClose:()=>{u.current||a()},t:o}):null}var $r=new Set,oi=22,ii=24,si=[["","overview.allTime"],["1 day ago","overview.today"],["7 days ago","overview.last7d"],["30 days ago","overview.last30d"]],Zs=30;function el(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].kind!==t[n].kind||e[n].name!==t[n].name||e[n].head!==t[n].head)return!1;return!0}var tl=46,nl=260;function rl(e,t){let[n,r]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=()=>r(e.clientWidth>0&&e.clientWidth<t);a();let o=new ResizeObserver(a);return o.observe(e),()=>o.disconnect()},[e,t]),n}function li({remote:e,sessionId:t,visible:n=!0,defaultDiffView:r,snapshot:a,onAction:o,onResync:s,compact:i,t:l}){let{signal:d,queryVisible:c,queryKey:u}=Fn(t,n,a.root),[f,v]=(0,p.useState)({ref:null,search:"",author:"",since:""}),[g,w]=(0,p.useState)(""),[k,y]=(0,p.useState)(!1),[x,C]=(0,p.useState)(!1),[T,F]=(0,p.useState)(null),M=rl(T,nl),[E,J]=(0,p.useState)(!1),te=(0,p.useId)(),[Z,I]=(0,p.useState)(new Set(["tags","remote"])),[K,U]=(0,p.useState)(0),se=[...u,K],de=()=>U(_=>_+1),[L,ne]=(0,p.useState)(null),[ae,oe]=(0,p.useState)(null),[H,N]=(0,p.useState)(null),[G,$]=(0,p.useState)(null),[B,z]=(0,p.useState)(null),[Y,S]=(0,p.useState)(!1),[W,be]=(0,p.useState)(!1),[ke,Le]=(0,p.useState)(null),[De,Te]=(0,p.useState)(!1),[Fe,Je]=(0,p.useState)(!1),[ft,xt]=(0,p.useState)(!1),[Ze,Ve]=(0,p.useState)(!1),[Oe,et]=(0,p.useState)(!1),[O,pe]=(0,p.useState)(!1),[me,le]=(0,p.useState)(null),[Ne,He]=(0,p.useState)("list"),[Ge,mt]=(0,p.useState)(null),[Be,Nt]=(0,p.useState)(!1),[dt,ct]=(0,p.useState)(!1);(0,p.useEffect)(()=>{if(!dt)return;let _=X=>{X.key==="Escape"&&ct(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[dt]),(0,p.useEffect)(()=>{!i&&dt&&ct(!1)},[i,dt]),(0,p.useEffect)(()=>{if(!Fe){le(null);return}let _=!0;return le("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then(X=>{if(!_)return;let we=ve(X,"pull-preview");le(we!==null&&we.hasUpstream?{commits:we.commits,files:we.files,insertions:we.insertions,deletions:we.deletions}:null)}),()=>{_=!1}},[Fe,e,t]);let{tree:Se,treeError:ht,authors:qe,reload:pt}=Ko(e,t,se,c),Et=(0,p.useMemo)(()=>{let _=new Map;if(Se===null)return _;for(let X of Zo(Se))ei(X,Se.current)&&_.set(X.key,X);return _},[Se]),kt=a.remote?.name??null,je=(0,p.useMemo)(()=>{let _=Se?.local??[],X=Se?.remote??[],we=Se?.defaultBranch??null,Kt=po(_,we),ma=go(X,kt,we),ha=fo(_,Se?.current??null,Kt);return{local:ha.nodes,localPinned:ha.pinned,localPrimary:Kt,remotePrimary:ma,remote:jn(uo(X,ma)),tags:jn(Se?.tags??[])}},[Se?.local,Se?.remote,Se?.tags,Se?.current,Se?.defaultBranch,kt]),Mt=_=>{z(null),mt(_)},ie=qo(e,t,r,c),{commits:Ue,topology:Ie,appliedFilter:Gt,loading:Ae,listError:yt,hasMore:ee,listRef:V,loadMore:he}=Vo(e,t,f,se,ie.clearSelection,c);(0,p.useEffect)(()=>{let _=setTimeout(()=>v(X=>X.search===g?X:{...X,search:g}),300);return()=>clearTimeout(_)},[g]);let tt=Ie!==void 0||Dr(Gt),_t=(0,p.useMemo)(()=>tt?so(Ue,Ie??[],a.graphStyle):Jn(Ue,a.graphStyle),[Ue,Ie,tt,a.graphStyle]),We=(0,p.useMemo)(()=>oo(_t),[_t]),ut=Math.max(Wt,We*Wt),b=i?tl:Zs,ye=i?`${ut}px minmax(0,1fr)`:`${ut}px minmax(120px,1fr) 72px 120px 96px`,$e=()=>{let _=V.current;_===null||!ee||_.scrollTop+_.clientHeight>=_.scrollHeight-240&&he()},nt=_=>{ie.select(_),i&&He("detail")},Jt=(0,p.useMemo)(()=>Date.now(),[Ue,d.sampledAt]),bt=(0,p.useMemo)(()=>ie.detail===null?[]:mo(ie.detail.stats.map(_=>({path:_.path,meta:_.status}))),[ie.detail]),fe=ie.selected,Pt=fe?.hash??null,[wn,Tr]=(0,p.useState)({hash:null,dirs:$r}),Nr=wn.hash===Pt?wn.dirs:$r,xn=(0,p.useCallback)(_=>{Tr(X=>{let we=X.hash===Pt?X.dirs:$r,Kt=new Set(we);return Kt.has(_)?Kt.delete(_):Kt.add(_),{hash:Pt,dirs:Kt}})},[Pt]);(0,p.useEffect)(()=>{if(fe===null)return;let _=Ue.find(X=>X.hash===fe.hash);_!==void 0&&_!==fe&&!el(_.refs,fe.refs)&&ie.resyncSelected(_)},[Ue,fe]);let nn=en({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),kn=en({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),_n=_=>v(X=>({...X,ref:_})),Dn=async(_,X)=>{if(!(L===null||Y)){z(null),S(!0);try{let we=await e.run({sessionId:t,action:{kind:"tag-create",name:_,commit:L.hash,...X.trim()!==""?{message:X}:{}}});we.ok?(ne(null),de()):z(tn(we.error.code,we.error.message,l))}finally{S(!1)}}},P=async _=>{if(!Y){z(null),S(!0);try{let X=await e.run({sessionId:t,action:{kind:"tag-delete",name:_}});X.ok?(oe(null),de()):z(tn(X.error.code,X.error.message,l))}finally{S(!1)}}},j=async()=>{if(!(H===null||Y)){z(null),S(!0);try{let _=await o({kind:"revert",commit:H.hash});_.ok?N(null):z(_.error??l("error.generic"))}finally{S(!1)}}},ce=async _=>{if(!(G===null||Y)){z(null),S(!0);try{let X=await o({kind:"reset",commit:G.hash,mode:_});X.ok?$(null):z(X.error??l("error.generic"))}finally{S(!1)}}},Me=async _=>{if(!(Ge===null||Be)){z(null),Nt(!0);try{let X=await o({kind:"branch-checkout",name:Ge.name,...Ge.createFrom===void 0?{}:{createFrom:Ge.createFrom},..._?{stashMessage:l("switch.stashMessage",{branch:Ge.name})}:{}});X.ok?(mt(null),Pe(!0)):z(X.error??l("error.generic"))}finally{Nt(!1)}}},Pe=async(_=!1)=>{if(!(W||a.remote===null)){_||Le(null),be(!0);try{let X=await o({kind:"fetch"});X.ok?Le(null):_||Le(X.error??l("error.generic"))}catch(X){_||Le(X instanceof Error?X.message:l("error.generic"))}finally{be(!1)}}},rn=async()=>{if(!De){z(null),Te(!0);try{let _=await o({kind:"pull-ff"});_.ok?Je(!1):z(_.error??l("error.generic"))}finally{Te(!1)}}},St=async()=>{if(!(Oe||a.remote===null)){z(null),et(!0);try{let _=await o({kind:"publish",remote:a.remote.name});_.ok?pe(!1):z(_.error??l("error.generic"))}finally{et(!1)}}},oa={syncBusy:W,syncError:ke,pullBusy:De,pushBusy:ft,publishBusy:Oe,onCheck:()=>void Pe(),onPull:()=>{z(null),Je(!0)},onPush:()=>{zt(a)&&!ft&&Ve(!0)},onPublish:()=>{z(null),pe(!0)},t:l},ia=ll(ie.fileDiff,{visible:c,data:ie.fileDiffData,error:ie.fileDiffError,mode:ie.fileDiffMode,onMode:ie.setFileDiffMode,expanded:ie.fileDiffExpanded,onExpand:_=>{ie.fileDiff!==null&&ie.openFileDiff(ie.fileDiff.path,ie.fileDiff.hash,ie.fileDiff.shortHash,_)},onClose:ie.closeFileDiff,remote:e,sessionId:t,compact:i,t:l}),sa=(0,p.useMemo)(()=>[...new Set(a.changes.filter(_=>_.status!=="untracked").map(_=>_.path))],[a.changes]),la=[L!==null?Wo(L,{onClose:()=>ne(null),onCreate:Dn,error:B,compact:i,t:l}):null,ae!==null?ot({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:ae}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:B,confirmBusy:Y,onConfirm:()=>void P(ae),onClose:()=>oe(null),t:l}):null,H!==null?ot({title:l("revert.title"),body:l("revert.body",{ref:`${H.shortHash} ${H.subject}`})+(a.dirty?`
|
|
816
|
-
|
|
817
|
-
${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:B,confirmBusy:Y,onConfirm:()=>void j(),onClose:()=>N(null),t:l}):null,G!==null?Qo(G,{from:a.head??G.shortHash,dirty:a.dirty,lostFiles:sa,lostTotal:sa.length,lostTruncated:a.truncated,busy:Y,error:B,onReset:ce,onClose:()=>$(null),t:l}):null,Fe?ot({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:a.branch??"HEAD",behind:a.behind}),extra:ri(me,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:B,confirmBusy:De,busyLabel:l("status.pulling"),onConfirm:()=>void rn(),onClose:()=>Je(!1),t:l}):null,Ze?(0,p.createElement)(pr,{key:"push",remote:e,sessionId:t,snapshot:a,onAction:o,onClose:()=>Ve(!1),onBusyChange:xt,t:l}):null,O?ot({title:l("status.publishConfirmTitle"),body:l("status.publishConfirmBody",{branch:a.branch??"HEAD",remote:a.remote?.name??"origin"}),confirmLabel:l("status.publishConfirm"),danger:!1,error:B,confirmBusy:Oe,busyLabel:l("status.publishing"),onConfirm:()=>void St(),onClose:()=>pe(!1),t:l}):null,Ge!==null?Yo(Ge,{from:a.branch,dirty:a.dirty?Math.max(1,a.stats.fileCount):0,busy:Be,error:B,onConfirm:_=>void Me(_),onClose:()=>mt(null),t:l}):null],Ki=[{id:"",label:l("overview.allUsers")},...qe.map(_=>({id:_,label:_}))],Vi=si.map(([_,X])=>({id:_,label:l(X)})),qi=l(si.find(([_])=>_===f.since)?.[1]??"overview.allTime"),ji=f.author===""?l("overview.allUsers"):f.author,da=i?(0,p.createElement)("button",{key:"more",type:"button",className:`gp-btn gp-toolbar__more-toggle${f.author!==""||f.since!==""?" gp-btn--primary":""}`,title:l("overview.moreFilters"),"aria-label":l("overview.moreFilters"),"aria-expanded":E,...E?{"aria-controls":te}:{},onClick:()=>J(_=>!_)},(0,p.createElement)("span",{key:"c",className:`gp-toolbar__chev${E?" gp-toolbar__chev--up":""}`},(0,p.createElement)(Lt,{size:14,open:!0}))):null,Ui=(0,p.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),disabled:W,onClick:()=>void Pe()},(0,p.createElement)(ln,{size:14})),Wi=(0,p.createElement)(Xr.Menu,{key:"author",open:k,onClose:()=>y(!1),items:Ki,selectedId:f.author,onSelect:_=>{y(!1),v(X=>({...X,author:_}))},align:"start",portal:!0,className:"gp-filter",anchor:Nn(k,ji,()=>y(_=>!_))}),Qi=(0,p.createElement)(Xr.Menu,{key:"since",open:x,onClose:()=>C(!1),items:Vi,selectedId:f.since,onSelect:_=>{C(!1),v(X=>({...X,since:_}))},align:"start",portal:!0,className:"gp-filter",anchor:Nn(x,qi,()=>C(_=>!_))}),ca=(0,p.createElement)("input",{key:"search",className:"gp-search",placeholder:l(M||i?"overview.searchShort":"overview.search"),value:g,onChange:_=>w(_.target.value)}),pa=[Wi,Qi,Ui],Yi=i?[(0,p.createElement)("button",{key:"filter",type:"button",className:`gp-btn${f.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>ct(!0)},[(0,p.createElement)(Xa,{key:"ic",size:13}),(0,p.createElement)("span",{key:"l",className:"gp-btn__label"},f.ref??l("overview.filterBranch"))]),ca,...da===null?[]:[da],...E?[(0,p.createElement)("div",{key:"more",id:te,className:"gp-toolbar__more"},pa)]:[]]:[ca,...pa],ua=(0,p.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,p.createElement)("div",{key:"tb",className:"gp-toolbar",ref:F},Yi),(0,p.createElement)("div",{key:"list",className:"gp-history__list",ref:V,onScroll:$e},Ue.length===0?(0,p.createElement)("div",{className:"gp-empty"},l(Ae?"common.loading":yt?"overview.loadFailed":"overview.noResults")):_t.map(_=>il(_,{selected:fe?.hash===_.commit.hash,current:!a.unborn&&a.head!==null&&a.head!==""&&_.commit.hash.startsWith(a.head),gridTpl:ye,laneCount:We,now:Jt,compact:i,rowH:b,onSelect:()=>nt(_.commit),onHoverEnter:ie.onHoverEnter,onHoverLeave:ie.onHoverLeave,t:l})))]),ga=_=>ie.detail!==null&&ie.detail.stats.length>0?(0,p.createElement)("div",{className:_},[(0,p.createElement)("span",{key:"f"},l("overview.changeSummary",{files:ie.detail.stats.length})),(0,p.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,p.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ie.detail.insertions}`),(0,p.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ie.detail.deletions}`)]):null,fa=fe===null?[(0,p.createElement)("div",{key:"empty",className:"gp-empty"},[(0,p.createElement)(In,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,p.createElement)("div",{key:"files",className:"gp-detail__files"},ie.detail===null?(0,p.createElement)("div",{className:"gp-empty"},ie.detailError?l("overview.detailFailed"):l("common.loading")):[i?null:ga("gp-detail__summary"),sl(bt,{activePath:ie.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:_=>{fe!==null&&ie.openFileDiff(_,fe.hash,fe.shortHash)},collapsed:Nr,onToggleDir:xn,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,p.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,p.createElement)("div",{key:"subj",className:"gp-detail__subject"},fe.subject),(0,p.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},fe.shortHash),(0,p.createElement)("span",{key:"a"},fe.author),(0,p.createElement)("span",{key:"t"},Pn(fe.dateIso))]),(0,p.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let _=fe.refs.filter(X=>X.kind==="tag");return[_.length>0?(0,p.createElement)("div",{key:"tags",className:"gp-detail__tags"},_.map(X=>(0,p.createElement)("span",{key:`tag-${X.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:X.name},[(0,p.createElement)(on,{key:"i",size:11}),(0,p.createElement)("span",{key:"n",className:"gp-detail__tagname"},X.name),(0,p.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:X.name}),onClick:()=>{z(null),oe(X.name)}},(0,p.createElement)(gt,{size:11}))]))):null,(0,p.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,p.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{z(null),N({hash:fe.hash,shortHash:fe.shortHash,subject:fe.subject})}},[(0,p.createElement)(Ua,{key:"i",size:12}),l("overview.revert")]),(0,p.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{z(null),s(),$({hash:fe.hash,shortHash:fe.shortHash,subject:fe.subject})}},[(0,p.createElement)(Xn,{key:"i",size:12}),l("overview.reset")]),(0,p.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{z(null),ne({hash:fe.hash,shortHash:fe.shortHash})}},[(0,p.createElement)(on,{key:"i",size:12}),l("overview.createTag")])])]})()),ie.detail!==null&&ie.detail.body!==""?(0,p.createElement)("pre",{key:"body",className:"gp-detail__body"},ie.detail.body):(0,p.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return i?(0,p.createElement)("div",{className:"gp-overview gp-overview--compact"},[ia,...la,Ne==="detail"?(0,p.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,p.createElement)("div",{key:"back",className:"gp-subhead"},[(0,p.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>He("list")},[(0,p.createElement)(sn,{key:"i",size:14}),l("overview.backToList")]),ga("gp-detail__summary gp-detail__summary--inline")]),...fa]):ua,Or(a,oa),dt?ol(Se,ht,f.ref,Z,{onFilter:_=>{_n(_),ct(!1)},switchOptions:Et,onSwitch:_=>{ct(!1),Mt(_)},onToggle:_=>I(X=>{let we=new Set(X);return we.has(_)?we.delete(_):we.add(_),we}),onRetry:pt,onClose:()=>ct(!1),t:l},je):null]):(0,p.createElement)("div",{className:"gp-overview"},[ia,...la,(0,p.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${nn.width}px`}},[(0,p.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},di(Se,ht,f.ref,Z,{onFilter:_=>_n(_),switchOptions:Et,onSwitch:Mt,onToggle:_=>I(X=>{let we=new Set(X);return we.has(_)?we.delete(_):we.add(_),we}),onRetry:pt,t:l},je)),Or(a,oa)]),nn.divider,ua,kn.divider,(0,p.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${kn.width}px`}},fa),al(ie.hover,ie.hoverBody,l)])}function al(e,t,n){if(e===null||typeof document>"u")return null;let r=460,a=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-r-12),o=e.y+14,s=(0,p.createElement)("div",{className:"gp-hovercard",style:{left:a,top:o,maxWidth:r}},[(0,p.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,p.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,p.createElement)("span",{key:"a"},e.commit.author),(0,p.createElement)("span",{key:"t"},Pn(e.commit.dateIso))]),t===null?(0,p.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,p.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,p.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,ur.createPortal)(s,document.body,"commit-hovercard")}function di(e,t,n,r,a,o){if(t)return(0,p.createElement)("div",{className:"gp-empty"},[(0,p.createElement)("span",{key:"m"},a.t("overview.branchesError")),(0,p.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:a.onRetry},a.t("common.retry"))]);if(e===null)return(0,p.createElement)("div",{className:"gp-empty"},a.t("common.loading"));let s=(d,c,u,f,v)=>{let g=d.name,w=f==="local"&&e.current===d.name,k=f==="local"&&o.localPrimary===d.name||f==="remote"&&o.remotePrimary===d.name,y=`gp-branch-row${n===g?" gp-branch-row--active":""}${w?" gp-branch-row--current":""}${k?" gp-branch-row--primary":""}`,x=a.switchOptions.get(`${f}:${d.name}`),C=[w?a.t("overview.currentBranch"):"",k?a.t("overview.primaryBranch"):""].filter(Boolean).join(" \xB7 "),T=w?(0,p.createElement)(no,{size:14}):k?(0,p.createElement)(ro,{size:14}):v,F=(M,E)=>E&&E>0?(0,p.createElement)("span",{key:M,className:"gp-branch-row__sync",title:a.t(M==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:E}),"aria-label":a.t(M==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:E})},[(0,p.createElement)(ao,{key:"icon",size:12,direction:M}),(0,p.createElement)("span",{key:"count"},E)]):null;return(0,p.createElement)("div",{key:d.name,className:y,style:{paddingLeft:oi+u*ii},title:d.name,"data-current":w?"true":void 0,"data-primary":k?"true":void 0,onClick:()=>a.onFilter(n===g?null:g)},[(0,p.createElement)("span",{key:"i",className:`gp-branch-row__ic${w?" gp-branch-row__ic--current":k?" gp-branch-row__ic--primary":""}`,title:C||void 0,"aria-label":C||void 0},T),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},c),d.ahead||d.behind?(0,p.createElement)("span",{key:"t",className:"gp-branch-row__track"},[F("ahead",d.ahead),F("behind",d.behind)]):null,x===void 0?null:(0,p.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:a.t(x.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:x.name,ref:x.label}),onClick:M=>{M.stopPropagation(),a.onSwitch(x)}},a.t("switch.action"))])},i=(d,c,u,f,v)=>{for(let g of d){if(g.kind==="leaf"){v.push(s(g.branch,g.label,c,u,f));continue}let w=`${u}:${g.path}`,k=c===0,y=r.has(w)?!k:k;v.push((0,p.createElement)("div",{key:w,className:"gp-branch-row gp-branch-row--dir",style:{paddingLeft:oi+c*ii},title:g.path,role:"button",tabIndex:0,"aria-expanded":y,onClick:()=>a.onToggle(w),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a.onToggle(w))}},[(0,p.createElement)("span",{key:"c",className:"gp-branch-row__chev"},(0,p.createElement)(Lt,{size:11,open:y})),(0,p.createElement)("span",{key:"i",className:"gp-branch-row__ic gp-branch-row__ic--folder"},(0,p.createElement)(ja,{size:13})),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},g.label)])),y&&(g.self!==null&&v.push(s(g.self,g.path,c+1,u,f)),i(g.children,c+1,u,f,v))}},l=(d,c,u,f,v,g=[])=>{let w=[];if(!r.has(d)){for(let k of g)w.push(s(k,k.name,0,d,f));i(v,0,d,f,w)}return(0,p.createElement)("div",{key:d,className:"gp-branch-group"},[(0,p.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>a.onToggle(d)},[(0,p.createElement)(Lt,{key:"c",size:11,open:!r.has(d)}),`${a.t(c)} (${u})`]),...w])};return(0,p.createElement)("div",{},[(0,p.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>a.onFilter(null)},a.t("overview.head")),l("local","overview.local",e.local.length,(0,p.createElement)(Lr,{size:13}),o.local,o.localPinned),l("remote","overview.remote",e.remote.length,(0,p.createElement)(Lr,{size:13}),o.remote),l("tags","overview.tags",e.tags.length,(0,p.createElement)(on,{size:13}),o.tags)])}function ol(e,t,n,r,a,o){if(typeof document>"u")return null;let s=(0,p.createElement)("div",{className:"gp-sheet-backdrop",onClick:i=>{i.target===i.currentTarget&&a.onClose()}},(0,p.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,p.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,p.createElement)("span",{key:"title",className:"gp-sheet__title"},a.t("overview.filterBranch")),(0,p.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:a.t("common.close"),onClick:a.onClose},(0,p.createElement)(gt,{size:15}))]),(0,p.createElement)("div",{key:"body",className:"gp-sheet__body"},di(e,t,n,r,a,o))]));return(0,ur.createPortal)(s,document.body,"branch-filter-sheet")}function il(e,t){let n=e.commit,r=n.refs.map(o=>(0,p.createElement)("span",{key:o.name,className:`gp-ref-chip${o.head?" gp-ref-chip--head":""}${o.kind==="remote"?" gp-ref-chip--remote":""}${o.kind==="tag"?" gp-ref-chip--tag":""}`},o.name)),a=(0,p.createElement)("div",{key:"g",className:"gp-graph-cell"},(0,p.createElement)(lo,{row:e,laneCount:t.laneCount,rowH:t.rowH,current:t.current}));return t.compact?(0,p.createElement)("div",{key:n.hash,className:`gp-commit-row gp-commit-row--compact${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl,height:`${t.rowH}px`},onClick:t.onSelect},[a,(0,p.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,p.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,p.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,p.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,p.createElement)("span",{key:"d",className:"gp-commit-date"},Ft(n.dateIso,t.now,t.t))])])]):(0,p.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:o=>t.onHoverEnter(n,o.clientX,o.clientY),onMouseLeave:t.onHoverLeave},[a,(0,p.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,p.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,p.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,p.createElement)("div",{key:"d",className:"gp-commit-date",title:Gn(n.dateIso)},Ft(n.dateIso,t.now,t.t))])}function sl(e,t){let n=[],r=(a,o)=>{for(let s of a)if(s.dir){let i=t.collapsed.has(s.path);n.push((0,p.createElement)("div",{key:s.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+o*14},title:i?t.expandLabel:t.collapseLabel,role:"button",tabIndex:0,"aria-expanded":!i,onClick:()=>t.onToggleDir(s.path),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onToggleDir(s.path))}},[(0,p.createElement)(Lt,{key:"c",size:11,open:!i}),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},s.name)])),i||r(s.children,o+1)}else{let i=String(s.meta??"modified"),l=t.activePath===s.path;n.push((0,p.createElement)("div",{key:s.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+o*14},title:t.openTitle,onClick:()=>t.onOpen(s.path)},[(0,p.createElement)("span",{key:"st",className:`gp-status-badge ${cn(i)}`},(Un[i]??i[0]??"M").toUpperCase()),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},s.name)]))}};return r(e,0),(0,p.createElement)("div",{},n)}function ll(e,t){if(e===null||typeof document>"u")return null;let{visible:n,data:r,error:a,mode:o,onMode:s,expanded:i,onExpand:l,onClose:d,remote:c,sessionId:u,compact:f,t:v}=t,g=f?["unified","before","after"]:["unified","split","before","after"],w=f&&o==="split"?"unified":o,k=r!==null&&r.text!==""?(()=>{let E=cr(r.text);return(0,p.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,p.createElement)("span",{key:"a",className:"gp-stats__add"},`+${E.add}`),(0,p.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${E.del}`)])})():null,y=(0,p.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${i?" gp-seg__btn--active":""}`,disabled:w!=="split"&&w!=="unified",title:v(i?"diff.collapse":"diff.expandAll"),onClick:()=>l(!i)},v(i?"diff.collapse":"diff.expandAll")),x=(0,p.createElement)("div",{key:"seg",className:"gp-seg"},It(g,w,s,E=>v(`diff.${E}`))),C=(0,p.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:v("common.close"),onClick:d},(0,p.createElement)(gt,{size:15})),T=[(0,p.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,p.createElement)(qa,{size:15})),(0,p.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},dl(e.path)),(0,p.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),k,y],F=f?[(0,p.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},T),(0,p.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[x,C])]:[...T,x,C],M=(0,p.createElement)("div",{className:"gp-modal-backdrop",onClick:E=>{E.target===E.currentTarget&&d()}},(0,p.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,p.createElement)("div",{key:"bar",className:"gp-modal__bar"},F),(0,p.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},r===null?(0,p.createElement)("div",{className:"gp-empty"},v(a?"overview.diffFailed":"common.loading")):(0,p.createElement)(dr,{key:"diff",visible:n,text:r.text,mode:w,path:e.path,remote:c,sessionId:u,base:"commit",commit:e.hash,expanded:i,truncated:r.truncated===!0,newLines:r.newLines,t:v}))]));return(0,ur.createPortal)(M,document.body,"file-diff-modal")}function dl(e){let t=e.lastIndexOf("/");return t<0?[(0,p.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,p.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,p.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var m=require("react");var wt=require("react");function ci(e,t,n,r,a,o){let[s,i]=(0,wt.useState)([]),[l,d]=(0,wt.useState)(null),[c,u]=(0,wt.useState)(null),f=(0,wt.useRef)(null),v=(0,wt.useRef)(0);Bt([t,...o],r,async y=>{let x=await e.query({sessionId:t,query:{kind:"stash-list"}});if(!y())return;let C=ve(x,"stash-list");C!==null?i(C.entries):a()},a);let g=l!==null&&n.changes.some(y=>y.path===l.path);(0,wt.useEffect)(()=>{l===null||g||(f.current=null,d(null),u(null))},[l,g]);let w=[t,...o,l?.path,l?.base,l?.expand,l?.version];Bt(w,r&&g,async y=>{if(l===null)return;let x=l,C=await e.query({sessionId:t,query:{kind:"diff",path:x.path,base:x.base,...x.expand?{context:2e3}:{}}});if(!y()||f.current!==x)return;let T=ve(C,"diff");u(T!==null?{text:T.text,newLines:T.newLines,truncated:T.truncated}:{text:"",newLines:0})},()=>u({text:"",newLines:0}));let k=(0,wt.useCallback)((y,x,C=!1)=>{let T={path:y,base:x,expand:C,version:++v.current};f.current=T,d(T),u(null)},[]);return{stashes:s,diffPath:l,diffData:c,expanded:l?.expand??!1,showDiff:k}}var Ke=require("react");function pi({stats:e,compact:t=!1,t:n}){let r=Date.now(),a=[(0,Ke.createElement)("span",{key:"files",className:"gp-stats__item"},n("stats.files",{n:e.fileCount})),(0,Ke.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,Ke.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,Ke.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&a.push((0,Ke.createElement)("span",{key:"st",className:"gp-stats__item"},n("stats.staged",{n:e.staged}))),e.modified>0&&a.push((0,Ke.createElement)("span",{key:"mo",className:"gp-stats__item"},n("stats.modified",{n:e.modified}))),e.untracked>0&&a.push((0,Ke.createElement)("span",{key:"un",className:"gp-stats__item"},n("stats.untracked",{n:e.untracked}))),e.partial&&a.push((0,Ke.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial",title:n("stats.partialHint")},n("stats.partial")));let o=[];e.lastChangeAt!==null&&o.push((0,Ke.createElement)("span",{key:"lc",className:"gp-stats__item",title:Gn(e.lastChangeAt)},n("stats.lastChange",{time:Ft(e.lastChangeAt,r,n)}))),e.headCommittedAt!==null&&o.push((0,Ke.createElement)("span",{key:"hc",className:"gp-stats__item",title:Gn(e.headCommittedAt)},n("stats.lastCommit",{time:Ft(e.headCommittedAt,r,n)})));let s=o.length>0?(0,Ke.createElement)("span",{key:"times",className:"gp-stats__times"},o):null;return t?(0,Ke.createElement)("div",{className:"gp-stats gp-stats--compact"},(0,Ke.createElement)("div",{key:"main",className:"gp-stats__main"},a)):(0,Ke.createElement)("div",{className:"gp-stats"},s===null?a:[...a,s])}function gr(e){return e.path+(e.staged?":s":":w")}function ui(e){return e.endsWith(":s")?"s":e.endsWith(":w")?"w":null}function fr(e){return ui(e)===null?e:e.slice(0,-2)}function gi(e){let t=new Set,n=new Set,r={w:t,s:n};for(let a of e){let o=ui(a);o!==null&&r[o].add(fr(a))}return{paths:[...t].sort(),stagedOnly:[...n].filter(a=>!t.has(a)).sort()}}var yn=require("react");function fi({paths:e,stagedOnly:t,snapshot:n,busy:r,error:a,onConfirm:o,onClose:s,t:i}){let l=(0,yn.useMemo)(()=>{let c=new Set(e);return n.changes.filter(u=>u.status==="untracked"&&c.has(u.path)).length},[e,n]),d=t.length>0||l>0?(0,yn.createElement)("div",{key:"notes"},[t.length>0?(0,yn.createElement)("div",{key:"staged",className:"gp-modal__confirmtext"},i("changes.discardPickedStaged",{count:t.length})):null,l>0?(0,yn.createElement)("div",{key:"untracked",className:"gp-modal__confirmtext"},i("changes.discardPickedUntracked",{count:l})):null]):null;return ot({title:i("changes.discardPickedTitle"),body:i("changes.discardPickedBody",{count:e.length}),extra:d,confirmLabel:i("changes.discard"),danger:!0,error:a,confirmBusy:r,busyLabel:i("changes.discarding"),onConfirm:o,onClose:s,t:i})}var Xe=require("react");function mi(e){let{snapshot:t,busy:n,t:r}=e,[a,o]=(0,Xe.useState)(!1),s=(0,Xe.useRef)(!1),{tipProps:i,tipNode:l,hideTip:d}=$t({placement:"below"});(0,Xe.useEffect)(()=>{d()},[t,d]);let c=async()=>{if(!s.current){s.current=!0,o(!0);try{await e.onRefresh()}finally{s.current=!1,o(!1)}}},u=n||a,f=(v,g,w,k,y,x="")=>(0,Xe.createElement)("button",{key:v,type:"button",className:`gp-icon-btn gp-changes__${v}${x}`,"aria-label":r(g),disabled:u||k,...v==="refresh"?{"aria-busy":a}:{},...i(r(g)),onClick:()=>{d(),y()}},(0,Xe.createElement)("span",{"aria-hidden":!0},w));return(0,Xe.createElement)("div",{className:"gp-toolbar gp-changes__toolbar",role:"group","aria-label":r("changes.actions")},[f("stage-all","changes.stageAll",(0,Xe.createElement)(Ja,{size:16}),t.changes.length===0,e.onStageAll),f("unstage-all","changes.unstageAll",(0,Xe.createElement)(Ka,{size:16}),t.staged===0,e.onUnstageAll),f("discard-picked","changes.discardPicked",(0,Xe.createElement)($n,{size:16}),!e.hasDiscardTargets,e.onDiscard),f("stash","changes.stash",(0,Xe.createElement)(On,{size:16}),t.staged===0&&t.modified===0,e.onStash),f("push","status.pushTitle",(0,Xe.createElement)(En,{size:16}),!zt(t),e.onPush),f("refresh","changes.refresh",(0,Xe.createElement)(ln,{size:16}),!1,()=>void c(),a?" gp-changes__refresh--busy":""),l])}var Jr=28,hi=26,cl=8,pl=600;function yi({remote:e,sessionId:t,visible:n=!0,snapshot:r,onAction:a,onRefresh:o,compact:s,t:i}){let{queryVisible:l,queryKey:d}=Fn(t,n,r.root),[c,u]=(0,m.useState)(new Set),[f,v]=(0,m.useState)(""),[g,w]=(0,m.useState)(!1),[k,y]=(0,m.useState)(!1),[x,C]=(0,m.useState)(!1),[T,F]=(0,m.useState)(!1),M=k||T,[E,J]=(0,m.useState)(null),[te,Z]=(0,m.useState)(new Set),[I,K]=(0,m.useState)(null),[U,se]=(0,m.useState)(!1),{stashes:de,diffPath:L,diffData:ne,expanded:ae,showDiff:oe}=ci(e,t,r,l,()=>J(i("error.generic")),d),[H,N]=(0,m.useState)(()=>r.defaultDiffView),[G,$]=(0,m.useState)(!1),[B,z]=(0,m.useState)(!1),[Y,S]=(0,m.useState)(!1),[W,be]=(0,m.useState)(null),ke=or(),[Le,De]=(0,m.useState)("list"),[Te,Fe]=(0,m.useState)(!1),[Je,ft]=(0,m.useState)(!0),[xt,Ze]=(0,m.useState)(!1),[Ve,Oe]=(0,m.useState)(null),et=(0,m.useRef)(null),O=(0,m.useRef)(null),pe=(0,m.useCallback)(P=>{et.current=P,P!==null&&s&&Te&&P.focus()},[s,Te]),{setEl:me,viewport:le}=gn(),{tipProps:Ne,tipNode:He,hideTip:Ge,showTipNow:mt}=$t({placement:"above",maxWidth:300}),Be=(0,m.useMemo)(()=>r.changes.filter(P=>P.staged).sort(Kr),[r]),Nt=(0,m.useMemo)(()=>r.changes.filter(P=>!P.staged&&P.status!=="untracked").sort(Kr),[r]),dt=(0,m.useMemo)(()=>r.changes.filter(P=>P.status==="untracked").sort(Kr),[r]),ct=[{key:"staged",labelKey:"changes.groupStaged",items:Be},{key:"unstaged",labelKey:"changes.groupUnstaged",items:Nt},{key:"untracked",labelKey:"changes.groupUntracked",items:dt}],Se={staged:r.stats.staged,unstaged:r.stats.modified,untracked:r.stats.untracked},ht=ct.filter(P=>P.items.length>0||r.truncated&&Se[P.key]>0),{items:qe,tops:pt,totalH:Et}=(0,m.useMemo)(()=>{let P=[];for(let ce of ht){let Me=r.truncated?Se[ce.key]:ce.items.length;if(P.push({kind:"head",g:{key:ce.key,labelKey:ce.labelKey,count:Me,collapsible:ce.items.length>0}}),!te.has(ce.key))for(let Pe of ce.items)P.push({kind:"row",c:Pe})}let j=pn(P.map(ce=>ce.kind==="head"?hi:Jr));return{items:P,tops:j,totalH:j[P.length]}},[Be,Nt,dt,te,r.truncated,r.stats]),kt=le.height>0?le.height:pl,{first:je,last:Mt}=un(pt,le.top,kt,cl*Jr);(0,m.useEffect)(()=>{Ge()},[je,Mt,r,Ge]),(0,m.useEffect)(()=>{u(P=>{if(P.size===0)return P;let j=new Set(r.changes.map(Pe=>gr(Pe))),ce=new Set,Me=!1;for(let Pe of P)j.has(Pe)?ce.add(Pe):Me=!0;return Me?ce:P})},[r]),(0,m.useEffect)(()=>{if(!l||!Qe.isVisible()||!g||G||f.trim()!=="")return;let P=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(j=>{let ce=ve(j,"last-commit-message");P&&ce!==null&&(v(ce.message),$(!0))}),()=>{P=!1}},[g,G,f,e,t,l]),(0,m.useEffect)(()=>{L===null&&De("list")},[L]),(0,m.useEffect)(()=>{Le==="diff"&&Fe(!1)},[Le]),(0,m.useEffect)(()=>{if(!s||!Te||typeof document>"u")return;let P=j=>{if(B)return;let ce=O.current;ce!==null&&j.target instanceof Node&&ce.contains(j.target)||j.target instanceof Element&&j.target.closest(".gp-notice")!==null||Fe(!1)};return document.addEventListener("pointerdown",P),()=>document.removeEventListener("pointerdown",P)},[s,Te,B]);let ie=(0,m.useRef)(null),Ue=(0,m.useRef)(!1);(0,m.useEffect)(()=>{let P=Ue.current;Ue.current=s&&Te,s&&P&&!Te&&ie.current?.focus({preventScroll:!0})},[s,Te]),(0,m.useEffect)(()=>{K(null)},[r]),(0,m.useEffect)(()=>{S(!1)},[r]);let Ie=(0,m.useMemo)(()=>gi(c),[c]);(0,m.useEffect)(()=>{U&&Ie.paths.length===0&&se(!1)},[U,Ie]);let Gt=P=>{u(j=>{let ce=new Set(j);return ce.has(P)?ce.delete(P):ce.add(P),ce})},Ae=async P=>{if(M)return!1;y(!0),J(null),be(null);try{let j=await a(P);return j.ok?!0:(J(j.error??i("error.generic")),!1)}catch(j){return J(j instanceof Error?j.message:i("error.generic")),!1}finally{y(!1)}},yt=async()=>{let P=f.trim();if(P===""&&!g){J(i("error.emptyMessage"));return}let j=c.size>0?[...new Set([...c].map(Me=>fr(Me)))]:void 0;await Ae({kind:"commit",message:P,...j?{paths:j}:{},...g?{amend:!0}:{}})&&(v(""),u(new Set),w(!1),$(!1),Fe(!1))},ee=async P=>{await Ae({kind:"stash-push",...P.trim()!==""?{message:P}:{}})&&Ze(!1)},V=(P,j)=>{Ae({kind:"stash-apply",index:P,sha:j})},he=(P,j)=>{Ae({kind:"stash-pop",index:P,sha:j})},tt=async(P,j)=>{await Ae({kind:"stash-drop",index:P,sha:j})&&Oe(null)},_t=async()=>{let P=[...Ie.paths];if(P.length===0){se(!1);return}await Ae({kind:"discard",paths:P})&&se(!1)},We=(P,j)=>{switch(P){case"empty-diff":return i("error.emptyDiff");case"llm-unavailable":return i("error.llmUnavailable");case"suggest-disabled":return i("error.suggestDisabled");case"llm-error":case"llm-output":return j===void 0?i("error.llmFailed"):`${i("error.llmFailed")}: ${j}`;default:return j??i("error.generic")}},ut=async()=>{if(B)return;if(g&&!Y&&f.trim()!==""){S(!0),J(null),be(i("commit.suggestOverwrite"));return}S(!1);let P=c.size>0?[...new Set([...c].map(j=>fr(j)))]:void 0;z(!0),J(null),be(null);try{let j=await e.suggest({sessionId:t,...P&&P.length>0?{paths:P}:{}});j.ok?(v(j.value.message),j.value.truncated===!0&&be(i("commit.suggestTruncated")),et.current?.focus()):J(We(j.error.code,j.error.message))}catch(j){J(j instanceof Error?j.message:i("error.generic"))}finally{z(!1)}},b=P=>{Z(j=>{let ce=new Set(j);return ce.has(P)?ce.delete(P):ce.add(P),ce})},ye=ne!==null&&ne.text!==""?cr(ne.text):null,$e=en({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),nt=(P,j)=>{oe(P,j),s&&De("diff")},Jt=s?["unified","before","after"]:["unified","split","before","after"],bt=s&&H==="split"?"unified":H,fe=f.trim(),Pt=fe.split(`
|
|
818
|
-
`)[0]??"",wn=M||B||fe==="",Tr=(0,m.createElement)("div",{key:"box",className:"gp-commitbox",ref:O},[(0,m.createElement)("div",{key:"msg",className:`gp-commitbox__msg-wrap${B?" gp-commitbox__msg-wrap--busy":""}`},[(0,m.createElement)("textarea",{key:"ta",className:"gp-commitbox__msg",placeholder:i("commit.placeholder"),value:f,ref:pe,readOnly:B,"aria-busy":B,onChange:P=>v(P.target.value)}),B?(0,m.createElement)("span",{key:"spin",className:"gp-commitbox__spin","aria-hidden":"true"}):null]),(0,m.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,m.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,m.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:g,disabled:B,onChange:()=>{w(P=>!P),$(!1)}}),i("commit.amend")]),(0,m.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[r.suggestEnabled!==!1?(0,m.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:M||B||r.changes.length===0,onClick:()=>void ut(),title:i("commit.suggest")},[(0,m.createElement)(Va,{key:"ic",size:13}),i(B?"commit.suggesting":"commit.suggest")]):null,(0,m.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:wn,onClick:()=>void yt()},i("commit.commit")),s?(0,m.createElement)("button",{key:"fold",type:"button",className:"gp-icon-btn gp-commitbox__fold",disabled:B,title:i("commit.collapse"),"aria-label":i("commit.collapse"),onClick:()=>Fe(!1)},(0,m.createElement)(Lt,{key:"i",size:13,open:!0})):null])])]),Nr=!s||Te?Tr:(0,m.createElement)("div",{key:"box",className:"gp-commitbar"},[(0,m.createElement)("button",{key:"open",type:"button",className:"gp-commitbar__open",ref:ie,title:i("commit.edit"),"aria-label":i("commit.edit"),onClick:()=>Fe(!0)},fe===""?(0,m.createElement)("span",{key:"ph",className:"gp-commitbar__ph"},i("commit.placeholder")):(0,m.createElement)("span",{key:"draft",className:"gp-commitbar__draft"},Pt)),(0,m.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary gp-commitbar__commit",disabled:wn,onClick:()=>void yt()},i("commit.commit"))]),xn=i("changes.untrackedCollapsed"),nn=i(r.truncatedReason==="lossy"?"changes.truncatedLossy":r.truncatedReason==="cap"?"changes.truncatedCap":"changes.truncatedUnknown",{n:r.changes.length}),kn=[(0,m.createElement)(pi,{key:"stats",stats:r.stats,compact:s,t:i}),(0,m.createElement)(mi,{key:"toolbar",snapshot:r,busy:M,hasDiscardTargets:Ie.paths.length>0,onStageAll:()=>void Ae({kind:"stage-all"}),onUnstageAll:()=>void Ae({kind:"unstage-all"}),onDiscard:()=>{J(null),se(!0)},onStash:()=>{J(null),Ze(!0)},onPush:()=>{Ge(),C(!0)},onRefresh:o,t:i}),E!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},E):null,W!==null?(0,m.createElement)(At,{key:"notice",text:W,closeLabel:i("common.close"),onClose:()=>be(null)}):null,r.untrackedCollapsed===!0&&!ke.isDismissed(xn)?(0,m.createElement)(At,{key:"collapsed",status:!0,text:xn,closeLabel:i("common.close"),onClose:()=>ke.dismiss(xn)}):null,r.truncated&&!ke.isDismissed(nn)?(0,m.createElement)(At,{key:"truncated",status:!0,text:nn,closeLabel:i("common.close"),onClose:()=>ke.dismiss(nn)}):null,(0,m.createElement)("div",{key:"list",className:"gp-changes__list",ref:me},r.changes.length===0?(0,m.createElement)("div",{className:"gp-empty"},i("changes.noChanges")):(0,m.createElement)("div",{className:"gp-changes__vlist",style:{height:Et}},qe.slice(je,Mt).map((P,j)=>{let ce=je+j;if(P.kind==="head"){let St=P.g;return(0,m.createElement)("div",{key:`h:${St.key}`,className:"gp-changes__vrow",style:{top:pt[ce],height:hi}},(0,m.createElement)("div",{className:`gp-group-head${St.collapsible?"":" gp-group-head--static"}`,...St.collapsible?{onClick:()=>b(St.key)}:{}},[St.collapsible?(0,m.createElement)(Lt,{key:"chev",size:12,open:!te.has(St.key)}):(0,m.createElement)("span",{key:"chev",className:"gp-group-head__chev-spacer"}),`${i(St.labelKey)} (${St.count})`]))}let Me=P.c,Pe=gr(Me),rn=Me.staged?"staged":"worktree";return(0,m.createElement)("div",{key:Pe,className:"gp-changes__vrow",style:{top:pt[ce],height:Jr}},fl(Me,{selected:c.has(Pe),active:L?.path===Me.path&&L.base===rn,busy:M,armed:I===Pe,onToggle:()=>Gt(Pe),onOpen:()=>nt(Me.path,rn),onStage:()=>void Ae(Me.staged?{kind:"unstage",paths:[Me.path]}:{kind:"stage",paths:[Me.path]}),onDiscard:()=>{I===Pe?(Ae({kind:"discard",paths:[Me.path]}),K(null)):K(Pe)},tipProps:Ne,hideTip:Ge,showTipNow:mt,t:i}))}))),de.length>0?(0,m.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,m.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>ft(P=>!P)},[(0,m.createElement)(Lt,{key:"chev",size:12,open:!Je}),`${i("stash.section")} (${de.length})`]),Je?null:(0,m.createElement)("div",{key:"items"},de.map(P=>gl(P,{busy:M,onApply:()=>V(P.index,P.sha),onPop:()=>he(P.index,P.sha),onDrop:()=>{J(null),Oe(P)},t:i})))]):null,Nr],_n=L===null?(0,m.createElement)("div",{className:"gp-empty"},i("changes.selectFile")):(0,m.createElement)("div",{className:"gp-diff"},[(0,m.createElement)("div",{key:"tb",className:`gp-diff__toolbar${s?" gp-diff__toolbar--compact":""}`},(()=>{let P=s?(0,m.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>De("list")},[(0,m.createElement)(sn,{key:"i",size:14}),i("changes.backToList")]):null,j=(0,m.createElement)("span",{key:"path",className:"gp-diff__path"},L.path),ce=ye?(0,m.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,m.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ye.add}`)," ",(0,m.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ye.del}`)]):null,Me=(0,m.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${ae?" gp-seg__btn--active":""}`,style:ye||s?{}:{marginLeft:"auto"},disabled:bt!=="split"&&bt!=="unified",title:i(ae?"diff.collapse":"diff.expandAll"),onClick:()=>void oe(L.path,L.base,!ae)},i(ae?"diff.collapse":"diff.expandAll")),Pe=(0,m.createElement)("div",{key:"seg",className:"gp-seg"},It(Jt,bt,N,rn=>i(`diff.${rn}`)));return s?[(0,m.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[P,j,ce]),(0,m.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[Me,Pe])]:[P,j,ce,Me,Pe]})()),ne===null?(0,m.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,m.createElement)("div",{className:"gp-empty"},i("common.loading"))):(0,m.createElement)(dr,{key:"diff",visible:l,text:ne.text,mode:bt,path:L.path,remote:e,sessionId:t,base:L.base,expanded:ae,truncated:ne.truncated===!0,newLines:ne.newLines,t:i})]),Dn=[x?(0,m.createElement)(pr,{key:"remote-push",remote:e,sessionId:t,snapshot:r,onAction:a,onClose:()=>C(!1),onBusyChange:F,t:i}):null,xt?(0,m.createElement)(ul,{key:"push",onClose:()=>Ze(!1),onStash:ee,error:E,t:i}):null,Ve!==null?ot({title:i("stash.dropTitle"),body:i("stash.dropConfirm",{name:Ve.message}),confirmLabel:i("stash.drop"),danger:!0,error:E,onConfirm:()=>void tt(Ve.index,Ve.sha),onClose:()=>Oe(null),t:i}):null,U&&Ie.paths.length>0?(0,m.createElement)(fi,{key:"discard-picked",paths:Ie.paths,stagedOnly:Ie.stagedOnly,snapshot:r,busy:M,error:E,onConfirm:()=>void _t(),onClose:()=>se(!1),t:i}):null];return s?(0,m.createElement)("div",{className:"gp-changes gp-changes--compact"},[...Dn,He,Le==="diff"?(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},_n):(0,m.createElement)("div",{key:"left",className:"gp-changes__left"},kn)]):(0,m.createElement)("div",{className:"gp-changes"},[...Dn,He,(0,m.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${$e.width}px`}},kn),$e.divider,(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},_n)])}function ul({onClose:e,onStash:t,error:n,t:r}){let[a,o]=(0,m.useState)("");return Ot({onClose:e,title:r("stash.title"),icon:(0,m.createElement)(On,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,m.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:a,autoFocus:!0,onChange:s=>o(s.target.value),onKeyDown:s=>{s.key==="Enter"&&t(a)}}),mn(r),n!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:hn({onClose:e,onConfirm:()=>void t(a),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function gl(e,t){return(0,m.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,m.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,m.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,m.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,m.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,m.createElement)("span",{key:"t"},e.relTime):null])]),(0,m.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,m.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,m.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,m.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,m.createElement)($n,{size:14}))])])}function Kr(e,t){return e.path.localeCompare(t.path)}function fl(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,m.createElement)("div",{key:gr(e),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,m.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,onClick:a=>a.stopPropagation(),onChange:t.onToggle}),(0,m.createElement)("span",{key:"st",className:`gp-status-badge ${cn(e.status)}`},Un[e.status]??"?"),(0,m.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,m.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,m.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,m.createElement)("button",{key:"stg",type:"button",className:"gp-icon-btn","aria-label":e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,...t.tipProps(e.staged?t.t("changes.unstageTip"):t.t("changes.stageTip")),onClick:a=>{a.stopPropagation(),t.hideTip(),t.onStage()}},e.staged?"\u2212":"+"),e.staged?null:(0,m.createElement)("button",{key:"dis",type:"button",className:"gp-icon-btn","aria-label":t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,...t.tipProps(t.armed?t.t("changes.discardTipArmed"):t.t("changes.discardTip")),onClick:a=>{if(a.stopPropagation(),t.armed){t.hideTip(),t.onDiscard();return}t.onDiscard(),t.showTipNow(a.currentTarget,t.t("changes.discardTipArmed"))}},"\u21BA")])])}var h=require("react"),Mi=require("react-dom");var ze=require("@deepseek-ai/dsh-client-ui-primitives");var ge=require("react");function Vr(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],n=e/1024,r=0;for(;(n>=1024||Number(n.toFixed(1))>=1024)&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}var ml={bash:"Bash",c:"C",cpp:"C++",csharp:"C#",css:"CSS",dockerfile:"Dockerfile",go:"Go",html:"HTML",java:"Java",javascript:"JavaScript",json:"JSON",jsx:"JSX",kotlin:"Kotlin",markdown:"Markdown",php:"PHP",python:"Python",ruby:"Ruby",rust:"Rust",scss:"SCSS",shellscript:"Shell",sql:"SQL",swift:"Swift",toml:"TOML",tsx:"TSX",typescript:"TypeScript",vue:"Vue",xml:"XML",yaml:"YAML"};function bi(e){return ml[e]??hl(e)}function hl(e){return e.charAt(0).toUpperCase()+e.slice(1)}var bn=require("@deepseek-ai/dsh-client-ui-primitives");function yl(e,t){let n=bl(e.path);if(e.kind==="binary")return t("files.propsTypeBinary");let r=Mn(e.path);if((e.kind==="image"||e.kind==="tooLarge")&&r!==null){let i=r.slice(6).toUpperCase();return t("files.propsTypeFmt",{label:t("files.propsTypeImage",{fmt:i}),ext:n})}let a=(0,bn.languageForPath)(e.path),s=a!==void 0&&a!==""?bi(a):e.kind==="tooLarge"?t("files.propsTypeUnread"):t("files.propsTypeText");return n===""?s:t("files.propsTypeFmt",{label:s,ext:n})}function bl(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1):""}function Xt(e,t,n){return{label:e,value:typeof t=="string"?(0,ge.createElement)("span",{},t):t,key:n}}function qr(e,t,n){return(0,ge.createElement)("div",{key:n,className:"gp-props__group"},[e!==null?(0,ge.createElement)("div",{key:"t",className:"gp-props__group-title"},e):null,...t.map(r=>(0,ge.createElement)("div",{key:r.key,className:"gp-props__row"},[(0,ge.createElement)("span",{key:"l",className:"gp-props__label"},r.label),(0,ge.createElement)("span",{key:"v",className:"gp-props__value"},r.value)]))])}function vi(e,t,n){return(0,ge.createElement)("button",{type:"button",className:"gp-props__copy",title:t,"aria-label":t,onClick:n},(0,ge.createElement)("code",{className:"gp-props__mono"},e))}function vl(e,t,n){let r=[],a=e.filter(o=>o.path===t&&!o.isDirectory);a.some(o=>o.staged)&&r.push((0,ge.createElement)("span",{key:"staged",className:"gp-props__badge gp-status--added"},n("files.propsStaged")));for(let o of a)o.staged||o.status==="untracked"||r.push((0,ge.createElement)("span",{key:o.status,className:`gp-props__badge ${cn(o.status)}`},wl(o.status,n)));return r}function wl(e,t){switch(e){case"added":return t("files.stAdded");case"modified":return t("files.stModified");case"deleted":return t("files.stDeleted");case"renamed":return t("files.stRenamed");case"untracked":return t("files.propsUntracked");case"conflicted":return t("files.stConflicted");case"typechange":return t("files.stTypechange")}}function wi({input:e,snapshot:t,onClose:n,t:r}){let[a,o]=(0,ge.useState)(null);(0,ge.useEffect)(()=>{if(e.kind!=="image"||e.dataUrl===void 0)return;let x=!0,C=new Image;return C.onload=()=>{x&&o({w:C.naturalWidth,h:C.naturalHeight})},C.src=e.dataUrl,()=>{x=!1}},[e.kind,e.dataUrl]);let[s,i]=(0,ge.useState)(null),l=(0,ge.useRef)(void 0);(0,ge.useEffect)(()=>{i(null)},[e.path]),(0,ge.useEffect)(()=>()=>{l.current!==void 0&&clearTimeout(l.current)},[]);let d=x=>{(0,bn.writeClipboard)(x).then(C=>{i(C?"copied":"error"),l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>i(null),1600)})},c=e.path.lastIndexOf("/"),u=c<0?e.path:e.path.slice(c+1),f=[Xt(r("files.propsName"),(0,ge.createElement)("span",{className:"gp-props__strong"},u),"name"),Xt(r("files.propsType"),yl(e,r),"type"),Xt(r("files.propsRelPath"),vi(e.path,r("files.propsCopyHint"),()=>d(e.path)),"rel")];if(t!==null){let x=`${t.root}/${e.path}`;f.push(Xt(r("files.propsAbsPath"),vi(x,r("files.propsCopyHint"),()=>d(x)),"abs"))}let v=[];if(e.size!==void 0){let x=e.size>=1024?(0,ge.createElement)("span",{},[(0,ge.createElement)("span",{key:"h",className:"gp-props__strong"},Vr(e.size)),(0,ge.createElement)("span",{key:"b",className:"gp-props__sub"},r("files.propsSizeBytes",{bytes:e.size.toLocaleString("en-US")}))]):(0,ge.createElement)("span",{className:"gp-props__strong"},Vr(e.size));v.push(Xt(r("files.propsSize"),x,"size"))}e.kind==="text"&&e.lines!==void 0&&v.push(Xt(r("files.propsLines"),(0,ge.createElement)("span",{className:"gp-props__strong"},String(e.lines)),"lines")),a!==null&&v.push(Xt(r("files.propsImageSize"),(0,ge.createElement)("span",{className:"gp-props__strong"},r("files.propsImageSizeFmt",a)),"dims"));let g=[];e.mtimeMs!==void 0&&g.push(Xt(r("files.propsMtime"),(0,ge.createElement)("span",{title:Ft(e.mtimeMs,Date.now(),r)},Pn(e.mtimeMs)),"mtime"));let w=[qr(null,f,"g-basic"),v.length>0?qr(r("files.propsGroupStats"),v,"g-stats"):null,g.length>0?qr(r("files.propsGroupTime"),g,"g-time"):null],k=[];t!==null&&(k.push(e.ignored?(0,ge.createElement)("span",{key:"ig",className:"gp-props__badge gp-props__badge--muted"},r("files.ignored")):bo(t.changes,e.path)?(0,ge.createElement)("span",{key:"un",className:"gp-props__badge gp-props__badge--muted"},r("files.propsUntracked")):(0,ge.createElement)("span",{key:"tr",className:"gp-props__badge gp-props__badge--ok"},r("files.propsTrackedYes"))),k.push(...vl(t.changes,e.path,r)));let y=(0,ge.createElement)("div",{key:"status",className:"gp-modal__footer gp-props__statusbar","aria-live":"polite"},[k.length>0?(0,ge.createElement)("span",{key:"chips",className:"gp-props__footer-chips"},k):null,s!==null?(0,ge.createElement)("span",{key:"fb",className:`gp-props__copied${s==="error"?" gp-props__copied--err":""}`},r(s==="copied"?"files.pathCopied":"files.pathCopyFailed")):null]);return Ot({onClose:n,title:r("files.propsTitle"),icon:(0,ge.createElement)(bn.FileTypeIcon,{path:e.path,size:15}),body:w,footer:y,portalKey:"file-props",t:r})}function jr(e){return e.kind!=="text"?!1:e.size!==void 0?e.size<Vn:new TextEncoder().encode(e.content??"").length<Vn}function xi(e){return e.startsWith("/")||/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")}function xl(e){let t=e.replace(/[/\\]+$/,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"))+1;return t.slice(0,n)}function kl(e,t){if(!(!/^https?:/.test(e)&&!e.startsWith("dsh-app://app/"))&&xi(t)&&!/^[/\\]{2}/.test(t)&&!/[\x00-\x1f\x7f]/.test(t))return new URL(`api/file?path=${encodeURIComponent(t)}`,e).href}function _l(e,t,n){let r=n.search(/[?#]/),a;try{a=decodeURIComponent(r===-1?n:n.slice(0,r))}catch{return}if(a.length!==0&&!(!/^[a-z]:[/\\]/i.test(a)&&/^[a-z][a-z\d+.-]*:/i.test(a))){if(!xi(a)){if(t===void 0)return;a=xl(t)+a}return kl(e,a)}}function ki(e,t){return{resolve:n=>_l(e,t,n)}}function Wr(e){let t=e.endsWith("\r")?e.slice(0,-1):e,n=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(t);if(n===null)return null;let r=n[1][0],a=n[2].trim();return r==="`"&&a.includes("`")?null:{marker:r,length:n[1].length,info:a}}function Ur(e,t){let n=Wr(e);return n!==null&&n.marker===t.marker&&n.length>=t.length&&n.info===""}function Sl(e){return/^mermaid(\s|$)/i.test(e)}function _i(e){let t=e.split(`
|
|
819
|
-
`),n=[],r=[],
|
|
820
|
-
`);r=[],l!==""&&n.push({kind:"markdown",text:l})};for(let l of t){if(
|
|
821
|
-
`)}),
|
|
822
|
-
`)}),
|
|
823
|
-
`),n=null;return t.map(r=>{if(n!==null)return
|
|
824
|
-
`)}function Cl(e){let t=/(`+)[\s\S]*?\1/g,n=/<kbd>([\s\S]*?)<\/kbd>/gi,r=(i,l)=>Tl(l),a="",o=0,s;for(;(s=t.exec(e))!==null;)a+=e.slice(o,s.index).replace(n,r),a+=s[0],o=s.index+s[0].length;return a+e.slice(o).replace(n,r)}function Tl(e){let t=0;for(let a of e.match(/`+/g)??[])t=Math.max(t,a.length);let n="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${r}${e}${r}${n}`}var lt=require("react"),Nl=require.async,Qr;function El(){return Qr??=Nl("./client.mermaid.js").then(e=>e,e=>{throw Qr=void 0,e}),Qr}function Ci(){return typeof document<"u"&&document.body.hasAttribute("data-ds-dark-theme")?"dark":"default"}function Ti({source:e,t}){let[n,r]=(0,lt.useState)(null),[a,o]=(0,lt.useState)(!1),[s,i]=(0,lt.useState)(Ci);return(0,lt.useEffect)(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;let l=new MutationObserver(()=>i(Ci()));return l.observe(document.body,{attributes:!0,attributeFilter:["data-ds-dark-theme"]}),()=>l.disconnect()},[]),(0,lt.useEffect)(()=>{let l=!0;return r(null),o(!1),El().then(d=>d.renderMermaid(e,s)).then(d=>{l&&r(d)}).catch(()=>{l&&o(!0)}),()=>{l=!1}},[e,s]),n!==null?(0,lt.createElement)("div",{className:"gp-mermaid","data-mermaid":"",dangerouslySetInnerHTML:{__html:n}}):a?(0,lt.createElement)("pre",{className:"gp-mermaid__fallback","data-mermaid-fallback":""},(0,lt.createElement)("code",null,e)):(0,lt.createElement)("div",{className:"gp-mermaid gp-mermaid--loading","data-mermaid":"loading",role:"status"},(0,lt.createElement)("span",{className:"gp-mermaid__loading-text"},t("files.mermaidLoading")))}function Gi(e){return/\.(?:md|markdown)$/i.test(e)}function Yr(e){return/\.(?:html?|xhtml)$/i.test(e)}function Ml(e){return Gi(e)||Yr(e)}var Gl=256*1024,Pl=5e3,Ni=5e3,mr=20,Ei=12,Rl=600,Ll=2e3,Dl=1024*1024;function Pi(e,t){return t<=Ll&&e.length<=Dl}var Al=6e4,yr=new Map;function zl(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;yr.set(e,{state:{...t,file:n},leftAt:Date.now()})}function Fl(e){let t=yr.get(e);return t===void 0?null:Date.now()-t.leftAt>Al?(yr.delete(e),null):t.state}function Zr({remote:e,sessionId:t,compact:n,worktreeGen:r,snapshot:a,t:o}){let s=(0,h.useRef)(void 0);s.current===void 0&&(s.current=Fl(t));let i=s.current,[l,d]=(0,h.useState)(()=>i?.dirs??new Map),[c,u]=(0,h.useState)(()=>i?.open??new Set([""])),[f,v]=(0,h.useState)(()=>i?.selected??null),[g,w]=(0,h.useState)(()=>i?.file??{kind:"idle"}),[k,y]=(0,h.useState)(()=>i?.renderMarkdown??!0),[x,C]=(0,h.useState)(()=>i?.wrap??!0),[T,F]=(0,h.useState)("idle"),[M,E]=(0,h.useState)("idle"),[J,te]=(0,h.useState)(!1),[Z,I]=(0,h.useState)(!1),[K,U]=(0,h.useState)(()=>i?.pane??"tree"),se=(0,h.useId)(),de=(0,h.useMemo)(()=>({code:{copyLabel:o("files.copy"),copiedLabel:o("files.copied")},footnotes:o("files.footnotes")}),[o]),L=(0,h.useMemo)(()=>g.kind==="text"&&g.absolutePath!==void 0?ki(document.baseURI,g.absolutePath):void 0,[g]),ne=(0,h.useMemo)(()=>{if(g.kind==="text")return _i(g.content).map(O=>O.kind==="mermaid"?O:{kind:"markdown",text:Si(O.text)})},[g]),ae=(0,h.useRef)(0),oe=en({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),H=(0,h.useCallback)(O=>{d(pe=>{let me=pe.get(O);if(me!==void 0&&me.status!=="error")return pe;let le=new Map(pe);return le.set(O,{status:"loading"}),le}),e.query({sessionId:t,query:{kind:"dir-list",path:O}}).then(pe=>{let me=ve(pe,"dir-list");d(le=>{let Ne=new Map(le);return Ne.set(O,me===null?{status:"error"}:{status:"ready",entries:me.entries,truncated:me.truncated}),Ne})}).catch(()=>{d(pe=>{let me=new Map(pe);return me.set(O,{status:"error"}),me})})},[e,t]);(0,h.useEffect)(()=>{H("")},[H]);let N=(0,h.useRef)(r);(0,h.useEffect)(()=>{N.current!==r&&(N.current=r,yr.delete(t),d(new Map),u(new Set([""])),v(null),w({kind:"idle"}),U("tree"),H(""))},[r,t,H]);let G=(0,h.useCallback)(O=>{u(pe=>{let me=new Set(pe);return me.has(O)?(me.delete(O),me):(me.add(O),l.get(O)===void 0&&H(O),me)})},[l,H]),$=(0,h.useCallback)(O=>{v(O),n&&U("preview"),y(!Yr(O)),F("idle"),E("idle"),te(!1);let pe=++ae.current;w({kind:"loading",path:O}),e.query({sessionId:t,query:{kind:"file-content",path:O}}).then(me=>{if(pe!==ae.current)return;let le=ve(me,"file-content");if(le===null){w({kind:"error",path:O,...me.ok?{}:{code:me.error.code}});return}let Ne={...le.size!==void 0?{size:le.size}:{},...le.mtimeMs!==void 0?{mtimeMs:le.mtimeMs}:{}};if(le.tooLarge===!0){w({kind:"tooLarge",path:O,...Ne});return}if(le.variant==="image"&&le.dataUrl!==void 0){w({kind:"image",path:O,dataUrl:le.dataUrl,...Ne});return}if(le.variant==="text"){w({kind:"text",path:O,content:le.content??"",lines:le.lines??0,...Ne,...le.absolutePath!==void 0?{absolutePath:le.absolutePath}:{}});return}w({kind:"binary",path:O,...Ne})}).catch(()=>{pe===ae.current&&w({kind:"error",path:O})})},[e,t,n]),B=(0,h.useRef)({dirs:l,open:c,selected:f,file:g,renderMarkdown:k,wrap:x,pane:K});B.current={dirs:l,open:c,selected:f,file:g,renderMarkdown:k,wrap:x,pane:K},(0,h.useEffect)(()=>()=>{zl(t,B.current)},[t]);let z=(0,h.useRef)(!1);(0,h.useEffect)(()=>{z.current||(z.current=!0,i!==null&&i.selected!==null&&g.kind==="idle"&&$(i.selected))},[i,g.kind,$]);let Y=(0,h.useMemo)(()=>Ri("",0,{dirs:l,open:c,selected:f,toggleDir:G,selectFile:$,t:o}),[l,c,f,G,$,o]),S=async()=>{if(f===null)return;let O=ae.current,pe=await(0,ze.writeClipboard)(f);O===ae.current&&F(pe?"copied":"error")},W=async()=>{if(g.kind!=="text"||!jr(g))return;let O=ae.current,pe=await(0,ze.writeClipboard)(g.content);O===ae.current&&E(pe?"copied":"error")},be=(()=>{if(f===null||g.kind!=="text"&&g.kind!=="image"&&g.kind!=="binary"&&g.kind!=="tooLarge")return null;let O=f.lastIndexOf("/"),pe=O<0?"":f.slice(0,O),me=O<0?f:f.slice(O+1),le=l.get(pe),Ne=le?.status==="ready"?le.entries.find(He=>!He.dir&&He.name===me):void 0;return{path:f,kind:g.kind,...g.size!==void 0?{size:g.size}:{},...g.mtimeMs!==void 0?{mtimeMs:g.mtimeMs}:{},...g.kind==="text"?{lines:g.lines}:{},...g.kind==="image"?{dataUrl:g.dataUrl}:{},ignored:Ne?.ignored===!0}})(),ke=(0,h.createElement)("div",{key:"left",className:"gp-files__tree",style:n?void 0:{flex:`0 0 ${oe.width}px`}},Y),Le=g.kind==="text"&&Ml(g.path),De=Le?(0,h.createElement)(ze.SegmentedControl,{key:"mode",className:"gp-files__mode-seg",id:se,label:o("files.previewMode"),value:k?"render":"source",options:[{value:"source",label:o("files.source")},{value:"render",label:o("files.render")}],onChange:O=>y(O==="render")}):null,Te=g.kind==="text"?(0,h.createElement)("button",{key:"full",type:"button",className:"gp-files__props",title:o("files.fullscreen"),"aria-label":o("files.fullscreen"),onClick:()=>I(!0)},(0,h.createElement)(Oa,{size:14})):null,Fe=g.kind==="text"&&(Le?!k:!0),Je=g.kind==="text"?Pi(g.content,g.lines):!1,ft=Fe?(0,h.createElement)("button",{key:"wrap",type:"button",className:"gp-files__props",title:o(Je?"files.wrap":"files.wrapDisabled"),"aria-label":o("files.wrap"),"aria-pressed":Je&&x,disabled:!Je,onClick:()=>C(O=>!O)},(0,h.createElement)($a,{size:14})):null,xt=(0,h.createElement)("button",{key:"props",type:"button",className:"gp-files__props",title:o("files.propsTitle"),"aria-label":o("files.propsTitle"),disabled:be===null,onClick:()=>te(!0)},(0,h.createElement)(eo,{size:14})),Ze=n?(0,h.createElement)("div",{key:"bar",className:"gp-files__bar gp-files__bar--compact"},[(0,h.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>U("tree")},[(0,h.createElement)(sn,{key:"i",size:14}),o("files.backToTree")]),De,(0,h.createElement)("div",{key:"end",className:"gp-files__bar-end"},[ft,Te,xt])]):null,Ve=n?null:(0,h.createElement)("div",{key:"bar",className:"gp-files__bar"},[(0,h.createElement)("code",{key:"path",className:"gp-files__path",title:f??""},f??""),De,(0,h.createElement)("div",{key:"copy",className:"gp-files__copy-group"},[(0,h.createElement)("button",{key:"copy-path",type:"button",className:`gp-files__copy-path${T==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{S()}},o(T==="copied"?"files.pathCopied":T==="error"?"files.pathCopyFailed":"files.copyPath")),jr(g)?(0,h.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${M==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{W()}},o(M==="copied"?"files.contentCopied":M==="error"?"files.contentCopyFailed":"files.copyContent")):null]),ft,Te,xt]),Oe=Le?[(0,h.createElement)("div",{key:"src",id:`${se}-source-panel`,role:"tabpanel","aria-labelledby":`${se}-source`,style:k?{display:"none"}:{display:"contents"}},k?null:hr(g,!1,x,de,L,ne,o)),(0,h.createElement)("div",{key:"rnd",id:`${se}-render-panel`,role:"tabpanel","aria-labelledby":`${se}-render`,style:k?{display:"contents"}:{display:"none"}},k?hr(g,!0,x,de,L,ne,o):null)]:hr(g,k,x,de,L,ne,o),et=(0,h.createElement)("div",{key:"right",className:"gp-files__preview"},[f!==null?n?Ze:Ve:null,(0,h.createElement)("div",{key:"content",className:"gp-files__preview-content"},Oe),Z&&f!==null&&g.kind==="text"?(0,h.createElement)(Hl,{key:"full",file:g,renderMarkdown:k,wrap:x,markdownLabels:de,pathImages:L,markdownSegments:ne,onClose:()=>I(!1),t:o}):null,be!==null&&J?(0,h.createElement)(wi,{key:"props-modal",input:be,snapshot:a,onClose:()=>te(!1),t:o}):null]);return n?(0,h.createElement)("div",{className:"gp-files gp-files--compact"},K==="preview"?et:ke):(0,h.createElement)("div",{className:"gp-files"},[ke,oe.divider,et])}function hr(e,t,n,r,a,o,s){if(e.kind==="text"&&t&&Gi(e.path)&&o!==void 0){let i={labels:r,variant:"body",...a!==void 0?{pathImages:a}:{}};return o.length===1&&o[0].kind==="markdown"?(0,h.createElement)("div",{className:"gp-files__markdown"},(0,h.createElement)(ze.MarkdownText,{text:o[0].text,...i})):(0,h.createElement)("div",{className:"gp-files__markdown"},o.map((l,d)=>l.kind==="mermaid"?(0,h.createElement)(Ti,{key:d,source:l.source,t:s}):(0,h.createElement)(ze.MarkdownText,{key:d,text:l.text,...i})))}return e.kind==="text"&&t&&Yr(e.path)?(0,h.createElement)("iframe",{className:"gp-files__html",title:e.path,srcDoc:e.content,sandbox:"allow-scripts",referrerPolicy:"no-referrer"}):Bl(e,n,s)}function Hl(e){let{file:t,renderMarkdown:n,wrap:r,markdownLabels:a,pathImages:o,markdownSegments:s,onClose:i,t:l}=e,d=(0,h.useRef)(null),c=(0,h.useRef)(null);return rr(d,i,c),typeof document>"u"||t.kind!=="text"?null:(0,Mi.createPortal)((0,h.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{u.target===u.currentTarget&&i()}},(0,h.createElement)("div",{ref:d,className:"gp-modal",role:"dialog","aria-modal":!0,"aria-label":l("files.fullscreen")},[(0,h.createElement)("div",{key:"bar",className:"gp-modal__bar"},[(0,h.createElement)("code",{key:"path",className:"gp-modal__path",title:t.path},t.path),(0,h.createElement)("button",{key:"close",ref:c,type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),"aria-label":l("common.close"),onClick:i},(0,h.createElement)(gt,{size:15}))]),(0,h.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},(0,h.createElement)("div",{key:"body",className:"gp-files__preview-content"},hr(t,n,r,a,o,s,l)))])),document.body,"file-fullscreen")}function Ri(e,t,n){let r=n.dirs.get(e);if(r===void 0||r.status==="loading")return t===0?[(0,h.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,h.createElement)("div",{key:`l${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("common.loading"))];if(r.status==="error")return[(0,h.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.loadFailed"))];let a=[];for(let o of r.entries){let s=e===""?o.name:`${e}/${o.name}`;if(o.dir){let i=n.open.has(s);a.push((0,h.createElement)("button",{key:s,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${o.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-expanded":i,"aria-label":o.ignored?`${o.name} (${n.t("files.ignored")})`:o.name,onClick:()=>n.toggleDir(s)},[(0,h.createElement)("span",{key:"i",className:"gp-tree-ic"},i?(0,h.createElement)(ze.IconFolderOpenRegular,{size:16}):(0,h.createElement)(ze.IconFolderCloseRegular,{size:16})),(0,h.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)])),i&&a.push(...Ri(s,t+1,n))}else{let i=n.selected===s;a.push((0,h.createElement)("button",{key:s,type:"button",className:`gp-tree-row gp-files__entry${i?" gp-tree-row--active":""}${o.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-current":i?"true":void 0,"aria-label":o.ignored?`${o.name} (${n.t("files.ignored")})`:o.name,onClick:()=>n.selectFile(s)},[(0,h.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,h.createElement)(ze.FileTypeIcon,{path:s,size:16})),(0,h.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)]))}}return r.truncated&&a.push((0,h.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.truncated"))),a}function Bl(e,t,n){switch(e.kind){case"idle":return(0,h.createElement)("div",{className:"gp-empty"},n("files.selectFile"));case"loading":return(0,h.createElement)("div",{className:"gp-empty"},n("common.loading"));case"error":return(0,h.createElement)("div",{className:"gp-empty"},e.code==="file-not-found"?n("files.notFound"):n("files.loadFailed"));case"tooLarge":return(0,h.createElement)("div",{className:"gp-empty"},n("files.tooLarge"));case"binary":return(0,h.createElement)("div",{className:"gp-empty"},n("files.binary"));case"image":return(0,h.createElement)(Rn,{src:e.dataUrl,alt:e.path,t:n,viewportClass:"gp-files__image"});case"text":return(0,h.createElement)(Ol,{content:e.content,path:e.path,wrap:t,t:n})}}function Il(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[a,o]of er(e[r],t))if(n.push({line:r,start:a,end:o}),n.length>=Qn)return n;return n}function Ol({content:e,path:t,wrap:n,t:r}){let a=(0,h.useMemo)(()=>{let S=e.split(`
|
|
825
|
-
`);return
|
|
826
|
-
`)),[o,i,a]),[d,c]=(0,h.useState)(!1),[u,f]=(0,h.useState)(""),[v,g]=(0,h.useState)(!1),[w,k]=(0,h.useState)(0),{setEl:y,viewport:x,elRef:C}=gn(),T=(0,h.useRef)(null),F=(0,h.useRef)(null);(0,h.useEffect)(()=>{c(!1),f(""),k(0)},[t]);let M=Zn(u,Yn),E=(0,h.useMemo)(()=>a.map(S=>S.toLowerCase()),[a]),J=v?M:M.toLowerCase(),te=v?a:E,Z=(0,h.useMemo)(()=>Il(te,J),[te,J]);(0,h.useEffect)(()=>{k(0)},[J]);let I=Z.length===0?0:Math.min(w,Z.length-1),K=(0,h.useMemo)(()=>{let S=new Map;for(let W of Z){let be=S.get(W.line)??[];be.push([W.start,W.end]),S.set(W.line,be)}return S},[Z]);(0,h.useEffect)(()=>{let S=W=>{if(!((W.ctrlKey||W.metaKey)&&(W.key==="f"||W.key==="F")))return;let be=C.current;be===null||be.offsetParent===null||(W.preventDefault(),c(!0),requestAnimationFrame(()=>T.current?.select()))};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[]);let U=a.length,se=n&&Pi(e,U),de=(0,h.useMemo)(()=>pn(new Array(U).fill(mr)),[U]),L=x.height>0?x.height:Rl,{first:ne,last:ae}=un(de,x.top,L,Ei*mr),oe=Z.length>0?Z[I].line:-1,{first:H,last:N}=se?{first:0,last:U}:Wn({first:ne,last:ae},oe,U,Ei);(0,h.useEffect)(()=>{if(oe<0)return;let S=requestAnimationFrame(()=>F.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(S)},[I,Z,oe]);let G=(0,h.useCallback)(S=>{k(W=>Z.length===0?0:(W+S+Z.length)%Z.length)},[Z.length]),$=Z.length>0?Z[I]:null,B=d?(0,h.createElement)(nr,{inputRef:T,query:u,matches:Z.length,active:I,caseSensitive:v,onChange:f,onToggleCase:()=>g(S=>!S),onStep:G,onClose:()=>c(!1),t:r}):null,z=o||d?(0,h.createElement)("div",{key:"hd",className:"gp-files__header"},[o?(0,h.createElement)("div",{key:"note",className:"gp-files__note"},r("files.highlightOff")):null,B]):null,Y=[];for(let S=H;S<N;S++)Y.push((0,h.createElement)("div",{key:S,className:"gp-files__row",style:se?void 0:{top:S*mr}},[(0,h.createElement)("div",{key:"n",className:"gp-diff-no"},S+1),$l(a[S],S,l?.[S],K.get(S),$,F,r)]));return(0,h.createElement)("div",{className:`gp-files__code gp-diff__scroll${se?" gp-files__code--wrap":" gp-files__code--nowrap"}`,ref:y},[z,(0,h.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",...se?{}:{style:{height:U*mr}}},Y)])}function $l(e,t,n,r,a,o,s){if(e==="")return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>Ni)return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,Ni),(0,h.createElement)("span",{key:"trunc",className:"gp-files__trunc"},s("files.lineTruncated"))]);if(r===void 0||r.length===0)return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,h.createElement)("span",{key:d,style:l.style},l.text)):e);let i=a!==null&&a.line===t?[a.start,a.end]:null;return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},tr(e,r,n,`c${t}`,i,o))}var br=require("react"),Xl=620;function Li(e){let[t,n]=(0,br.useState)(!1);return(0,br.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(e.clientWidth>0&&e.clientWidth<=Xl);r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}var vr=require("react");function Di(){let[e,t]=(0,vr.useState)(()=>Qe.isVisible());return(0,vr.useEffect)(()=>{let n=()=>t(Qe.isVisible()),r=Qe.subscribe(n);return n(),r},[]),e}var zi="gp.panel.fontDelta";function Jl(){if(typeof localStorage>"u")return 0;let e=Number(localStorage.getItem(zi));return e===-1||e===1?e:0}function Fi({ctx:e,sessionId:t,t:n}){let r=Di(),[a,o]=(0,q.useState)(Jl),[s,i]=(0,q.useState)(null),[l,d]=(0,q.useState)(null),c=Li(l),u=Hn(t),f=Vt(e),v=u.state==="error"&&u.error.code==="git-unavailable",g=u.state==="error"&&(u.error.code==="not-a-git-repo"||u.error.code==="git-unavailable"),w=v&&u.state==="error"&&u.error.isGitRepo===!0,k=g?"files":s!==null&&s.sessionId===t?s.tab:null,y=(0,q.useRef)({tabs:new Set});y.current.sessionId!==t&&(y.current={sessionId:t,tabs:new Set}),k!==null&&y.current.tabs.add(k);let x=y.current.tabs.has("files");(0,q.useEffect)(()=>{if(!Ct(t))return;if(g){i(null);return}if(s?.sessionId===t)return;let H=Ga(t);if(H!==null){i({sessionId:t,tab:H});return}let N=La(t);if(N!==null){i({sessionId:t,tab:N});return}u.state==="ready"&&i({sessionId:t,tab:u.snapshot.dirty?"changes":"overview"})},[t,u,g,s?.sessionId]),(0,q.useEffect)(()=>{if(Ct(t))return Pa(t,H=>i({sessionId:t,tab:H}))},[t]);let C=(0,q.useRef)({tab:null});C.current={sessionId:t,tab:k},(0,q.useEffect)(()=>()=>{let{sessionId:H,tab:N}=C.current;H!==void 0&&N!==null&&Ra(H,N)},[]);let T=r&&Ct(t),[F,M]=(0,q.useState)(0),[E,J]=(0,q.useState)(!1),te=async H=>{if(!Ct(t))return{ok:!1,error:n("error.noCwd")};let N=await f.run({sessionId:t,action:H});return N.ok?(jt(t).accept(N.snapshot),H.kind==="branch-checkout"&&M(G=>G+1),{ok:!0}):(H.kind==="branch-checkout"&&H.stashMessage!==void 0&&M(G=>G+1),jt(t).resync(),{ok:!1,error:tn(N.error.code,N.error.message,n)})},Z=H=>{o(H),typeof localStorage<"u"&&localStorage.setItem(zi,String(H))},I=[{key:"overview",label:n("tab.overview"),icon:(0,q.createElement)(In,{size:14})},{key:"changes",label:n("tab.changes"),icon:(0,q.createElement)(Ba,{size:14})},{key:"files",label:n("tab.files"),icon:(0,q.createElement)(Wa,{size:14})}],K=g?I.filter(H=>H.key==="files"):I,U=(0,q.useId)(),se=K.map(H=>({value:H.key,label:[(0,q.createElement)("span",{key:"i",className:"gp-tab__icon"},H.icon),(0,q.createElement)("span",{key:"l",className:"gp-tab__label"},H.label)],id:`${U}-${H.key}`,panelId:`${U}-${H.key}-panel`})),de=k??K[0]?.key??"overview",L=!Ct(t)||u.state==="no-cwd"?(0,q.createElement)("div",{className:"gp-empty"},n("error.noCwd")):g?null:u.state==="error"?(0,q.createElement)("div",{className:"gp-empty"},n("pill.unavailable")):u.state==="cold"||u.state==="loading"||k===null?(0,q.createElement)("div",{className:"gp-empty"},n("common.loading")):null,ne=H=>{if(L!==null)return H===de?L:null;if(!Ct(t))return null;if(g)return x?(0,q.createElement)(Zr,{key:t,remote:f,sessionId:t,compact:c,worktreeGen:F,snapshot:null,t:n}):null;if(u.state!=="ready")return null;let N=u.snapshot;return H==="overview"?y.current.tabs.has("overview")?(0,q.createElement)(li,{key:t,remote:f,sessionId:t,visible:T&&k==="overview",defaultDiffView:N.defaultDiffView,snapshot:N,onAction:te,onResync:()=>jt(t).resync(),compact:c,t:n}):null:H==="changes"?y.current.tabs.has("changes")?(0,q.createElement)(yi,{key:t,remote:f,sessionId:t,visible:T&&k==="changes",snapshot:N,onAction:te,onRefresh:()=>jt(t).refresh(),compact:c,t:n}):null:x?(0,q.createElement)(Zr,{key:t,remote:f,sessionId:t,compact:c,worktreeGen:F,snapshot:N,t:n}):null},ae=K.map(H=>(0,q.createElement)("div",{key:H.key,id:`${U}-${H.key}-panel`,role:"tabpanel","aria-labelledby":`${U}-${H.key}`,style:de===H.key?{display:"contents"}:{display:"none"}},ne(H.key))),oe=w?(0,q.createElement)("div",{className:"gp-files-wrap"},[E?null:(0,q.createElement)(At,{key:"notice",text:n("files.gitNotInstalled"),closeLabel:n("common.close"),onClose:()=>J(!0)}),...ae]):(0,q.createElement)("div",{style:{display:"contents"}},ae);return(0,q.createElement)("div",{className:"gp-panel",ref:d,"data-conversation-composer-overlay":"","data-font-delta":a,"data-layout":c?"compact":"wide"},[(0,q.createElement)("div",{key:"tabs",className:"gp-tabbar"},[(0,q.createElement)(Ai.SegmentedTabs,{key:"switcher",className:`gp-tabbar__tabs${K.length===1?" gp-tabbar__tabs--single":""}`,label:n("panel.tabs"),items:se,value:de,onChange:H=>{let N=K.find(G=>G.key===H);N!==void 0&&Ct(t)&&i({sessionId:t,tab:N.key})}}),(0,q.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[(0,q.createElement)("div",{key:"font",className:"gp-font",role:"group","aria-label":n("panel.fontSize")},[(0,q.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease","aria-pressed":a===-1,onClick:()=>Z(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,q.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset","aria-pressed":a===0,onClick:()=>Z(0),"aria-label":n("panel.fontReset")},"A"),(0,q.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase","aria-pressed":a===1,onClick:()=>Z(1),"aria-label":n("panel.fontIncrease")},"A+")]),c?null:(0,q.createElement)(Kl,{key:"ver",remote:f,t:n})])]),(0,q.createElement)("div",{key:"body",className:"gp-body"},oe)])}function Kl({remote:e,t}){let[n,r]=(0,q.useState)({kind:"idle"}),{tipProps:a,tipNode:o}=$t({placement:"below",maxWidth:300});(0,q.useEffect)(()=>{let d=!0;return e.version({}).then(c=>{d&&"current"in c&&r(u=>({...u,info:c}))}),()=>{d=!1}},[e]);let s=async()=>{r(c=>({kind:"checking",info:c.info}));let d=await e.version({check:!0});r({kind:"idle",info:"current"in d?d:void 0})},i=n.info,l=n.kind==="checking"?(0,q.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):i===void 0||!i.checkedRemote?null:i.error!==void 0?(0,q.createElement)("span",{className:"gp-verbar__status gp-verbar__status--err",title:i.error},i.error==="repository is not configured"?t("version.noRepo"):t("version.error")):i.updateAvailable&&i.latest!==void 0?(0,q.createElement)("span",{},[(0,q.createElement)("span",{key:"s",className:"gp-verbar__status gp-verbar__status--new"},t("version.updateAvailable",{latest:i.latest,current:i.current})),i.releaseUrl!==void 0?(0,q.createElement)("a",{key:"l",className:"gp-verbar__link",href:i.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,q.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:i.current}));return(0,q.createElement)("div",{className:"gp-verbar"},[i!==void 0?(0,q.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${i.current}`):null,l,(0,q.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void s()},[(0,q.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,q.createElement)(ln,{size:12})),t("version.check")]),i?.repositoryUrl!==void 0?(0,q.createElement)("a",{key:"gh",className:"gp-icon-btn gp-verbar__gh gp-verbar__gh--starred",href:i.repositoryUrl,target:"_blank",rel:"noreferrer","aria-label":t("version.openRepo"),...a(t("version.openRepo"))},(0,q.createElement)(to,{size:15})):null,o])}var Ce=require("react"),Oi=require("react-dom");var Hi="data-gp-tab-dot",vn,ea=null,Bi="",xr=null,wr;function Vl(e){if(typeof document>"u")return null;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function ta(){let e=Vl(Bi);if(e===null)return;let t=e.querySelector(`[${Hi}]`);if(xr===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${xr}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(Hi,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function ql(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(Ea);if(e!==ea){if(vn?.disconnect(),ea=e,e===null){vn=void 0;return}vn=new MutationObserver(()=>ta()),vn.observe(e,{childList:!0,subtree:!0})}}function jl(){vn?.disconnect(),vn=void 0,ea=null}function Ii(e,t,n){if(!(typeof document>"u")){if(n===null){na(e);return}wr=e,Bi=t,xr=n,ql(),ta()}}function na(e){wr!==void 0&&wr!==e||(wr=void 0,xr=null,ta(),jl())}function Ul(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function Wl(){let[e,t]=(0,Ce.useState)(!1),[n,r]=(0,Ce.useState)(null),a=(0,Ce.useRef)(null);return(0,Ce.useLayoutEffect)(()=>{if(!e||a.current===null){r(null);return}let i=a.current.getBoundingClientRect();r({left:i.left,bottom:window.innerHeight-i.top+8})},[e]),{bind:{ref:i=>{a.current=i},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:i=>!e||n===null||typeof document>"u"?null:(0,Oi.createPortal)((0,Ce.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},i.map((l,d)=>(0,Ce.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function Ql(e){let[t,n]=(0,Ce.useState)(!1);return(0,Ce.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=e.closest("[data-conversation-region]")??document.body,o=()=>n(a.clientWidth>0&&a.clientWidth<Yl);o();let s=new ResizeObserver(o);return s.observe(a),()=>s.disconnect()},[e]),t}var Yl=620;function $i({sessionId:e,t}){let n=Hn(e),r=Wl(),[a,o]=(0,Ce.useState)(null),s=Ql(a),i=(0,Ce.useRef)(Symbol("gp-tab-dot")),l=n.state==="ready"&&n.snapshot.showInputPill===!1?n.snapshot.dirty?"dirty":"synced":null,d=t("panel.tab");if((0,Ce.useEffect)(()=>{Ii(i.current,d,l);let k=i.current;return()=>{na(k)}},[d,l]),n.state==="cold"||n.state==="loading"||n.state==="no-cwd")return null;if(n.state==="error")return n.error.code==="not-a-git-repo"||n.error.code==="git-unavailable"||n.error.showInputPill===!1?null:(0,Ce.createElement)("span",{className:"gp-pill gp-pill--degraded",title:n.error.detail??t("pill.unavailable")},t("pill.unavailable"));let c=n.snapshot;if(c.showInputPill===!1)return null;let u=Ul(c.root),f=c.branch??`(${t("pill.detached")})`,v=c.dirty,g=v?"gp-pill--dirty":"gp-pill--synced",w=()=>{if(Aa(d)){za(d);return}Ct(e)&&Ma(e,v?"changes":"overview"),Da(d)};return(0,Ce.createElement)("span",{className:"gp-pill-wrap",ref:o},[(0,Ce.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${g}${s?" gp-pill--compact":""}`,onClick:w,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,Ce.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,Ce.createElement)("span",{key:"repo",className:"gp-pill__repo"},u),(0,Ce.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,Ce.createElement)("span",{key:"b",className:"gp-pill__branch"},f),")"])]),r.render([c.root,t(v?"pill.dirty":"pill.synced")])])}var D=require("react"),Sr=require("@deepseek-ai/dsh-client-ui-primitives");function Xi(e,t,n){return t===""?"":e.find(a=>a.id===t)?.models.some(a=>a.id===n)===!0?n:""}function ra(e,t,n,r){if(n==="")return"";let o=e.find(s=>s.id===t)?.models.find(s=>s.id===n)?.reasoning?.efforts;return o!==void 0&&o.some(s=>s.id===r)?r:""}function Zl(e){for(let t of e){let n=t.schema?.dict;if(n!==void 0&&"showInputPill"in n||JSON.stringify(t.schema).includes("showInputPill"))return t.ns}}var ed="",kr={min:at.maxBytes.min/1024,max:at.maxBytes.max/1024},_r={min:at.timeoutMs.min/1e3,max:at.timeoutMs.max/1e3};function aa(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function td(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Ji({ctx:e,t}){let[,n]=(0,D.useState)(0),[r,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(!1),[i,l]=(0,D.useState)(null),[d,c]=(0,D.useState)(null),[u,f]=(0,D.useState)(null),[v,g]=(0,D.useState)(null),[w,k]=(0,D.useState)(null),[y,x]=(0,D.useState)(null),[C,T]=(0,D.useState)(null),[F,M]=(0,D.useState)(null),[E,J]=(0,D.useState)([]),[te,Z]=(0,D.useState)([]),[I,K]=(0,D.useState)("idle"),[U,se]=(0,D.useState)(null),[de,L]=(0,D.useState)(!1),[ne,ae]=(0,D.useState)(!1),[oe,H]=(0,D.useState)(!1),N=()=>{n(b=>b+1)},G=e.get("configForms"),$=(0,D.useMemo)(()=>G?.describe(),[G]);(0,D.useEffect)(()=>{if($!==void 0)return $.ensure(),$.subscribe(N)},[$]);let B=$?.getSnapshot().view,z=(0,D.useMemo)(()=>B===void 0?void 0:Zl(B.namespaces),[B]),Y=(0,D.useMemo)(()=>G!==void 0&&z!==void 0?G.get(z):void 0,[G,z]);(0,D.useEffect)(()=>{if(Y!==void 0)return Y.subscribe(N)},[Y]);let S=Y?.getSnapshot(),W=Y!==void 0&&S!==void 0&&S.status==="ready",be=$?.getSnapshot().status,ke=i??(typeof S?.value?.showInputPill=="boolean"?S.value.showInputPill:!0),Le=d??(S?.value?.defaultDiffView==="split"?"split":"unified"),De=u??(S?.value?.graphStyle==="compact"?"compact":"parallel"),Te=v??(typeof S?.value?.suggestEnabled=="boolean"?S.value.suggestEnabled:!0),Fe=S?.value?.suggestLanguage,Je=w??(typeof Fe=="string"&&qn.includes(Fe)?Fe:Ar),ft=aa(typeof S?.value?.suggestMaxBytes=="number"?S.value.suggestMaxBytes/1024:at.maxBytes.default/1024,kr),xt=aa(typeof S?.value?.suggestMaxOutputTokens=="number"?S.value.suggestMaxOutputTokens:at.maxOutputTokens.default,at.maxOutputTokens),Ze=aa(typeof S?.value?.suggestTimeoutMs=="number"?S.value.suggestTimeoutMs/1e3:at.timeoutMs.default/1e3,_r),Ve=typeof S?.value?.suggestProvider=="string"?S.value.suggestProvider:"",Oe=typeof S?.value?.suggestModel=="string"?S.value.suggestModel:"",et=typeof S?.value?.suggestReasoningEffort=="string"?S.value.suggestReasoningEffort:"",O=U?.provider??Ve,pe=U!==null?U.model:Ve!==""?Oe:"",me=U!==null?U.effort:et,le=O!==""&&pe!==""?me:"",Ne=E.find(b=>b.id===O),He=Ne?.models.find(b=>b.id===pe),Ge=He?.reasoning?.efforts,mt=()=>{K("loading"),Vt(e).query({sessionId:ed,query:{kind:"model-catalog"}}).then(b=>{let ye=ve(b,"model-catalog");if(ye===null){K("error");return}J(ye.groups),Z(ye.failures),K("ready")}).catch(()=>{K("error")})};(0,D.useEffect)(()=>{W&&I==="idle"&&mt()},[W]);let Be=async(b,ye,$e)=>{if(Y!==void 0){s(!1),a(!0);try{let nt=await Y.set(b,ye);$e(),nt?(Ut(),setTimeout(()=>Ut(),1e3)):s(!0)}catch{$e(),s(!0)}finally{a(!1)}}},Nt=b=>(l(b),Be("showInputPill",b,()=>l(null))),dt=b=>b===Le?Promise.resolve():(c(b),Be("defaultDiffView",b,()=>c(null))),ct=b=>b===De?Promise.resolve():(f(b),Be("graphStyle",b,()=>f(null))),Se=b=>(g(b),Be("suggestEnabled",b,()=>g(null))),ht=b=>b===Je?Promise.resolve():(k(b),Be("suggestLanguage",b,()=>k(null))),qe=async(b,ye,$e)=>{if(Y===void 0)return;s(!1),a(!0),se({provider:b,model:ye,effort:$e});let nt=!1;try{let Jt=await Y.set("suggestProvider",b),bt=await Y.set("suggestModel",ye),fe=await Y.set("suggestReasoningEffort",$e);nt=Jt&&bt&&fe,nt?(Ut(),setTimeout(()=>Ut(),1e3)):s(!0)}catch{s(!0)}finally{a(!1),(b===""||ye!==""||!nt)&&se(null)}},pt=b=>{if(b==="")return qe("","","");let ye=Xi(E,b,pe),$e=ra(E,b,ye,me);return qe(b,ye,$e)},Et=b=>{if(b==="")return qe(O,"","");let ye=ra(E,O,b,me);return qe(O,b,ye)},kt=b=>qe(O,pe,b),je=(b,ye,$e,nt,Jt,bt)=>{let fe=b===null?null:td(b);if(fe===null)return bt(),Promise.resolve();let Pt=Math.min(ye.max,Math.max(ye.min,Math.floor(fe)));return Jt(String(Pt)),Be(nt,Pt*$e,bt)},Mt=b=>je(b,kr,1024,"suggestMaxBytes",x,()=>x(null)),ie=b=>je(b,at.maxOutputTokens,1,"suggestMaxOutputTokens",T,()=>T(null)),Ue=b=>je(b,_r,1e3,"suggestTimeoutMs",M,()=>M(null)),Ie=[{id:"",label:t("cfg.suggestModelSession")},...E.map(b=>({id:b.id,label:b.name}))],Gt=[{id:"",label:t("cfg.suggestModelPick")},...(Ne?.models??[]).map(b=>({id:b.id,label:b.name}))],Ae=[{id:"",label:t("cfg.suggestEffortUnset")},...(Ge??[]).map(b=>({id:b.id,label:b.name}))],yt=(b,ye,$e,nt)=>Nn(b,ye,$e,{disabled:nt,extraClass:"gp-cfg__select-trigger"}),ee=r||S?.writable===!1,V=O===""?t("cfg.suggestModelSession"):E.find(b=>b.id===O)?.name??O,he=pe===""?t("cfg.suggestModelPick"):He?.name??pe,tt=le===""?t("cfg.suggestEffortUnset"):Ge?.find(b=>b.id===le)?.name??le,_t=(0,D.createElement)(Sr.Menu,{key:"provider",open:de,onClose:()=>L(!1),items:Ie,selectedId:O,onSelect:b=>{L(!1),pt(b)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:yt(de,V,()=>L(b=>!b),ee||I==="loading")}),We=(0,D.createElement)(Sr.Menu,{key:"model",open:ne,onClose:()=>ae(!1),items:Gt,selectedId:pe,onSelect:b=>{ae(!1),Et(b)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:yt(ne,he,()=>ae(b=>!b),ee||Ne===void 0)}),ut=(0,D.createElement)(Sr.Menu,{key:"effort",open:oe,onClose:()=>H(!1),items:Ae,selectedId:le,onSelect:b=>{H(!1),kt(b)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:yt(oe,tt,()=>H(b=>!b),ee)});return G===void 0?(0,D.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):W?(0,D.createElement)("div",{className:"gp-cfg"},[(0,D.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,D.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,D.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:ke,disabled:r||S?.writable===!1,onChange:b=>{Nt(b.currentTarget.checked)}}),(0,D.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,D.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,D.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,D.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},It(["unified","split"],Le,b=>{dt(b)},b=>t(b==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||S?.writable===!1)),(0,D.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,D.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,D.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},It(["parallel","compact"],De,b=>{ct(b)},b=>t(b==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||S?.writable===!1)),(0,D.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,D.createElement)("h3",{key:"sgtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.suggestTitle")),(0,D.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,D.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:Te,disabled:r||S?.writable===!1,onChange:b=>{Se(b.currentTarget.checked)}}),(0,D.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,D.createElement)("p",{key:"sglangtitle",className:"gp-cfg__seglabel"},t("cfg.suggestLangLabel")),(0,D.createElement)("div",{key:"sglang",className:"gp-seg gp-cfg__seg",role:"group","aria-label":t("cfg.suggestLangLabel")},It([...qn],Je,b=>{ht(b)},b=>t(b==="auto"?"cfg.suggestLangAuto":b==="zh"?"cfg.suggestLangZh":"cfg.suggestLangEn"),r||S?.writable===!1)),(0,D.createElement)("p",{key:"sglanghint",className:"gp-cfg__rangehint"},t("cfg.suggestLangHint")),(0,D.createElement)("div",{key:"numax",className:"gp-cfg__numrow"},[(0,D.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-maxkib"},t("cfg.suggestMaxBytesLabel")),(0,D.createElement)("input",{key:"input",id:"gp-cfg-maxkib",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:kr.min,max:kr.max,"aria-describedby":"gp-cfg-maxkib-hint",value:y??String(ft),disabled:r||S?.writable===!1,onChange:b=>{x(b.currentTarget.value)},onBlur:()=>{Mt(y)},onKeyDown:b=>{b.key==="Enter"&&b.currentTarget.blur()}}),(0,D.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestMaxBytesUnit"))]),(0,D.createElement)("p",{key:"numaxhint",id:"gp-cfg-maxkib-hint",className:"gp-cfg__rangehint"},t("cfg.suggestMaxBytesHint")),(0,D.createElement)("div",{key:"nuout",className:"gp-cfg__numrow"},[(0,D.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-outtok"},t("cfg.suggestOutputLabel")),(0,D.createElement)("input",{key:"input",id:"gp-cfg-outtok",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:at.maxOutputTokens.min,max:at.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:C??String(xt),disabled:r||S?.writable===!1,onChange:b=>{T(b.currentTarget.value)},onBlur:()=>{ie(C)},onKeyDown:b=>{b.key==="Enter"&&b.currentTarget.blur()}}),(0,D.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestOutputUnit"))]),(0,D.createElement)("p",{key:"nuouthint",id:"gp-cfg-outtok-hint",className:"gp-cfg__rangehint"},t("cfg.suggestOutputHint")),(0,D.createElement)("div",{key:"nuto",className:"gp-cfg__numrow"},[(0,D.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-timeout"},t("cfg.suggestTimeoutLabel")),(0,D.createElement)("input",{key:"input",id:"gp-cfg-timeout",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:_r.min,max:_r.max,"aria-describedby":"gp-cfg-timeout-hint",value:F??String(Ze),disabled:r||S?.writable===!1,onChange:b=>{M(b.currentTarget.value)},onBlur:()=>{Ue(F)},onKeyDown:b=>{b.key==="Enter"&&b.currentTarget.blur()}}),(0,D.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestTimeoutUnit"))]),(0,D.createElement)("p",{key:"nutohint",id:"gp-cfg-timeout-hint",className:"gp-cfg__rangehint"},t("cfg.suggestTimeoutHint")),(0,D.createElement)("div",{key:"sgmodel",className:"gp-cfg__menur"},[(0,D.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestModelLabel")),_t]),O!==""?(0,D.createElement)("div",{key:"sgmodel2",className:"gp-cfg__menur"},[(0,D.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestProviderLabel")),We]):null,O!==""&&pe!==""&&Ge!==void 0&&Ge.length>0?(0,D.createElement)("div",{key:"sgeffort",className:"gp-cfg__menur"},[(0,D.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestEffortLabel")),ut]):null,I==="loading"?(0,D.createElement)("p",{key:"sgload",className:"gp-cfg__rangehint"},t("cfg.suggestModelLoading")):I==="error"?(0,D.createElement)("p",{key:"sgerr",className:"gp-cfg__err",role:"alert"},[t("cfg.suggestModelFailed")," ",(0,D.createElement)("button",{key:"retry",type:"button",className:"gp-cfg__retry",onClick:()=>{mt()}},t("cfg.suggestModelRetry"))]):te.length>0?(0,D.createElement)("p",{key:"sgfail",className:"gp-cfg__rangehint"},`${t("cfg.suggestModelFailed")}: ${te.map(b=>b.name).join(", ")}`):E.length===0?(0,D.createElement)("p",{key:"sgempty",className:"gp-cfg__rangehint"},t("cfg.suggestModelEmpty")):null,(0,D.createElement)("p",{key:"sghint2",className:"gp-cfg__hint"},t("cfg.suggestHint")),o?(0,D.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):be==="idle"||be==="loading"?(0,D.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,D.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var Ln="gitPanel",nd=["dsh-git-panel","@xbzbing/dsh-git-panel"],rd=["slots","locale","connection"],ad="dsh-git-panel";function od(e){ya(),Sa(e),e.effect(()=>e.locale.register(Ln,{zh:ba,en:va})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(Ln),n=[],r=a=>{typeof a=="function"&&n.push(a)};r(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:Ln,label:()=>t("panel.tab")},a=>(0,Cr.createElement)(Fi,{ctx:e,sessionId:a.sessionId,t})))),r(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:Ln},a=>(0,Cr.createElement)($i,{sessionId:a.sessionId,t}))));for(let a of nd)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:a,locale:Ln},o=>o.view==="summary"?t("cfg.title"):(0,Cr.createElement)(Ji,{ctx:e,t}))));e.effect(()=>{let a=e.on("connection/reset",()=>Ut());return()=>{typeof a=="function"&&a();for(let o of n.splice(0))try{o()}catch{}Na()}},"dsh-git-panel: lifecycle")}module.exports={name:ad,inject:rd,apply:od};
|
|
907
|
+
`,ei=!1;function Bi(){if(ei||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){ei=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=Ms,document.head.appendChild(t),ei=!0}var Ii={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","panel.fontSize":"\u9762\u677F\u5B57\u53F7","panel.tabs":"\u9762\u677F\u6807\u7B7E\u9875","tab.overview":"Git \u603B\u89C8","tab.changes":"\u53D8\u66F4\u8BB0\u5F55","tab.files":"\u6587\u4EF6\u6D4F\u89C8","tab.overviewShort":"Git","tab.changesShort":"\u53D8\u66F4","tab.filesShort":"\u6587\u4EF6","pill.unavailable":"Git \u4E0D\u53EF\u7528","pill.detached":"\u6E38\u79BB HEAD","pill.synced":"\u672C\u5730\u5DF2\u540C\u6B65","pill.dirty":"\u6709\u5F85\u63D0\u4EA4\u7684\u53D8\u66F4","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.retry":"\u91CD\u8BD5","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","ops.aiHint":"\u63D0\u793A\uFF1A\u7ED9 AI \u591A\u4E00\u70B9\u4FE1\u4EFB\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u8BA9 AI \u76F4\u63A5\u6267\u884C Git \u64CD\u4F5C\u3002","version.check":"\u68C0\u67E5\u65B0\u7248\u672C","version.checking":"\u68C0\u67E5\u4E2D\u2026","version.upToDate":"\u5DF2\u662F\u6700\u65B0\uFF08{current}\uFF09","version.updateAvailable":"\u6709\u65B0\u7248\u672C {latest}\uFF08\u5F53\u524D {current}\uFF09","version.viewRelease":"\u67E5\u770B\u53D1\u5E03","version.error":"\u68C0\u67E5\u5931\u8D25","version.noRepo":"\u672A\u914D\u7F6E\u4ED3\u5E93\u5730\u5740","version.openRepo":"\u8BBF\u95EE GitHub \u67E5\u770B @xbzbing/dsh-git-panel \u9879\u76EE\uFF0C\u8BF7\u4E3A\u9879\u76EE\u70B9\u4EAE\u4E00\u9897\u5C0F\u661F\u661F\u5427 \u2B50","overview.head":"\u5168\u90E8\u5206\u652F","overview.local":"\u672C\u5730","overview.currentBranch":"\u5F53\u524D\u5206\u652F","overview.primaryBranch":"\u4E3B\u5206\u652F","overview.branchAhead":"\u6BD4\u4E0A\u6E38\u9886\u5148 {n} \u4E2A\u63D0\u4EA4","overview.branchBehind":"\u6BD4\u4E0A\u6E38\u843D\u540E {n} \u4E2A\u63D0\u4EA4","overview.remote":"\u8FDC\u7A0B","overview.tags":"\u6807\u7B7E","overview.search":"\u641C\u7D22\u63D0\u4EA4\uFF08\u6D88\u606F / \u54C8\u5E0C\uFF09","overview.searchShort":"\u641C\u7D22\u63D0\u4EA4","overview.allUsers":"\u5168\u90E8\u4F5C\u8005","overview.allTime":"\u5168\u90E8\u65F6\u95F4","overview.today":"\u4ECA\u5929","overview.last7d":"\u8FD1 7 \u5929","overview.last30d":"\u8FD1 30 \u5929","overview.selectCommit":"\u9009\u62E9\u4E00\u4E2A\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5","overview.noMessage":"\uFF08\u65E0\u63D0\u4EA4\u6B63\u6587\uFF09","overview.noResults":"\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4","overview.loadFailed":"\u52A0\u8F7D\u5931\u8D25","overview.detailFailed":"\u8BE6\u60C5\u52A0\u8F7D\u5931\u8D25","overview.diffFailed":"\u5DEE\u5F02\u52A0\u8F7D\u5931\u8D25","overview.openFileDiff":"\u67E5\u770B\u8BE5\u6587\u4EF6\u5728\u6B64\u63D0\u4EA4\u4E2D\u7684\u53D8\u66F4","overview.changeSummary":"{files} \u4E2A\u6587\u4EF6","overview.expandDir":"\u5C55\u5F00\u76EE\u5F55","overview.collapseDir":"\u6298\u53E0\u76EE\u5F55","overview.fetch":"\u62C9\u53D6\u8FDC\u7A0B","overview.branchesError":"\u5206\u652F\u52A0\u8F7D\u5931\u8D25","overview.filterBranch":"\u6309\u5206\u652F\u7B5B\u9009","overview.moreFilters":"\u66F4\u591A\u7B5B\u9009","overview.backToList":"\u8FD4\u56DE\u5217\u8868","overview.createTag":"\u521B\u5EFA\u6807\u7B7E","overview.revert":"\u8FD8\u539F\u6B64\u63D0\u4EA4","overview.reset":"\u91CD\u7F6E\u5230\u6B64","switch.action":"\u5207\u6362","switch.rowTitle":"\u5207\u6362\u5230 {name}","switch.rowTitleTrack":"\u4ECE {ref} \u65B0\u5EFA\u8DDF\u8E2A\u5206\u652F {name} \u5E76\u5207\u6362","switch.detached":"\u6E38\u79BB HEAD","switch.confirmTitle":"\u5207\u6362\u5206\u652F","switch.body":"\u4ECE {from} \u5207\u6362\u5230 {to}\u3002","switch.trackingNote":"\u672C\u5730\u8FD8\u6CA1\u6709 {name}\uFF0C\u5C06\u5148\u4ECE {ref} \u521B\u5EFA\u5B83\u5E76\u8BBE\u7F6E\u8DDF\u8E2A\uFF08upstream\uFF09\u3002","switch.dirtyWarn":"\u5F53\u524D\u6709 {count} \u4E2A\u6587\u4EF6\u5B58\u5728\u672A\u63D0\u4EA4\u53D8\u66F4\u3002","switch.modeDirect":"\u76F4\u63A5\u5207\u6362","switch.modeDirectHint":"\u672A\u63D0\u4EA4\u53D8\u66F4\u4F1A\u968F\u5DE5\u4F5C\u533A\u5E26\u8FC7\u53BB\uFF1B\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\uFF0CGit \u4F1A\u62D2\u7EDD\u5207\u6362\uFF0C\u5DE5\u4F5C\u533A\u4FDD\u6301\u4E0D\u53D8\u3002","switch.modeStash":"\u5148\u8D2E\u85CF {count} \u4E2A\u6587\u4EF6\u7684\u53D8\u66F4\uFF0C\u518D\u5207\u6362","switch.modeStashHint":"\u53D8\u66F4\u79FB\u5165\u8D2E\u85CF\u6808\u9876\uFF08\u542B\u672A\u8DDF\u8E2A\u6587\u4EF6\uFF09\uFF0C\u5207\u6362\u540E\u53EF\u4ECE\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\u3002\u6CE8\u610F\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u6062\u590D\uFF1B\u6062\u590D\u65F6\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\u9700\u624B\u52A8\u89E3\u51B3\u3002","switch.confirm":"\u5207\u6362","switch.confirmStash":"\u8D2E\u85CF\u5E76\u5207\u6362","switch.switching":"\u6B63\u5728\u5207\u6362\u2026","switch.stashMessage":"\u5207\u6362\u5230 {branch} \u524D\u81EA\u52A8\u8D2E\u85CF","tag.createTitle":"\u5728\u6B64\u63D0\u4EA4\u521B\u5EFA\u6807\u7B7E","tag.namePlaceholder":"\u6807\u7B7E\u540D","tag.annotated":"\u9644\u6CE8\u6807\u7B7E\uFF08\u5E26\u8BF4\u660E\uFF09","tag.messagePlaceholder":"\u6807\u7B7E\u8BF4\u660E","tag.create":"\u521B\u5EFA\u6807\u7B7E","tag.deleteTitle":"\u5220\u9664\u6807\u7B7E","tag.deleteConfirm":"\u786E\u5B9A\u5220\u9664\u6807\u7B7E\u300C{name}\u300D\uFF1F","tag.deleteOne":"\u5220\u9664\u6807\u7B7E\u300C{name}\u300D","ops.dirtyWarn":"\u68C0\u6D4B\u5230\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8FD9\u4E9B\u6539\u52A8\u53EF\u80FD\u662F dsh AI \u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\u3002","revert.title":"\u8FD8\u539F\u63D0\u4EA4","revert.body":"\u5C06\u5728\u5F53\u524D HEAD \u8FFD\u52A0\u4E00\u4E2A\u53CD\u5411\u63D0\u4EA4\uFF0C\u8FD8\u539F {ref} \u7684\u6539\u52A8\u3002\u4E0D\u4F1A\u4E22\u5F03\u4F60\u7684\u5DE5\u4F5C\u533A\u6539\u52A8\u3002","revert.confirm":"\u8FD8\u539F","reset.title":"\u91CD\u7F6E\u5206\u652F","reset.body":"\u5C06\u628A\u5F53\u524D\u5206\u652F\u7684 HEAD \u4ECE {from} \u79FB\u52A8\u5230 {to}\u3002","reset.modeSoft":"\u8F6F\u91CD\u7F6E\uFF08--soft\uFF09","reset.softHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u6682\u5B58\u533A\u3002","reset.modeMixed":"\u6DF7\u5408\u91CD\u7F6E\uFF08--mixed\uFF0C\u9ED8\u8BA4\uFF09","reset.mixedHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u5DE5\u4F5C\u533A\u3002","reset.modeHard":"\u786C\u91CD\u7F6E\uFF08--hard\uFF09","reset.hardHint":"\u79FB\u52A8 HEAD \u5230\u6B64\u63D0\u4EA4\u5E76\u4E22\u5F03\u6240\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF08\u672A\u63D0\u4EA4\u6539\u52A8\u65E0\u6CD5\u6062\u590D\uFF09\u3002","reset.hardOrphan":"\u5F53\u524D\u5206\u652F\u4E0A\u665A\u4E8E\u76EE\u6807\u7684\u63D0\u4EA4\u4F1A\u79BB\u5F00\u5206\u652F\uFF08\u4ECD\u53EF\u7528 git reflog \u627E\u56DE\uFF09\u3002","reset.hardWarn":"\u4EE5\u4E0B\u672A\u63D0\u4EA4\u6539\u52A8\u5C06\u88AB\u6C38\u4E45\u4E22\u5F03\uFF1A","reset.lostMore":"\u2026\u8FD8\u6709\u66F4\u591A\u672A\u63D0\u4EA4\u6539\u52A8\u672A\u663E\u793A\uFF08\u5217\u8868\u5DF2\u622A\u65AD\uFF09","reset.hardAck":"\u6211\u5DF2\u4E86\u89E3\uFF0C\u786E\u8BA4\u4E22\u5F03\u8FD9\u4E9B\u672A\u63D0\u4EA4\u6539\u52A8","reset.hardAckClean":"\u6211\u5DF2\u4E86\u89E3\u6B64\u64CD\u4F5C\u7684\u540E\u679C\uFF0C\u786E\u8BA4\u91CD\u7F6E","reset.confirm":"\u91CD\u7F6E","changes.groupStaged":"\u5DF2\u6682\u5B58\u7684\u66F4\u6539","changes.groupUnstaged":"\u66F4\u6539","changes.groupUntracked":"\u672A\u7248\u672C\u63A7\u5236\u7684\u6587\u4EF6","changes.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u53D8\u66F4","changes.noChanges":"\u6CA1\u6709\u672A\u63D0\u4EA4\u7684\u53D8\u66F4","changes.actions":"\u4ED3\u5E93\u53D8\u66F4\u64CD\u4F5C","changes.refresh":"\u5237\u65B0\u5F53\u524D\u4ED3\u5E93\u72B6\u6001","changes.stageAll":"\u5168\u90E8\u6682\u5B58","changes.unstageAll":"\u5168\u90E8\u53D6\u6D88\u6682\u5B58","changes.selectAllGroup":"\u9009\u62E9\u672C\u7EC4\u5168\u90E8\u6587\u4EF6\uFF1A{group}","changes.stage":"\u6682\u5B58","changes.unstage":"\u53D6\u6D88\u6682\u5B58","changes.discard":"\u653E\u5F03\u66F4\u6539","changes.discardConfirm":"\u518D\u6B21\u70B9\u51FB\u4EE5\u786E\u8BA4\u653E\u5F03","changes.stageTip":"\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u4E0B\u4E00\u6B21\u63D0\u4EA4\u4F1A\u5305\u542B\u5B83\u7684\u6539\u52A8","changes.unstageTip":"\u53D6\u6D88\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u6539\u52A8\u4ECD\u7559\u5728\u5DE5\u4F5C\u533A","changes.discardTip":"\u653E\u5F03\u6B64\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u6539\u52A8\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\uFF1B\u518D\u70B9\u4E00\u6B21\u786E\u8BA4","changes.discardTipArmed":"\u518D\u70B9\u4E00\u6B21\u5373\u653E\u5F03\u6B64\u6587\u4EF6\u7684\u6539\u52A8\uFF0C\u4E0D\u53EF\u6062\u590D","changes.discardPicked":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedTitle":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedBody":"\u5C06\u653E\u5F03 {count} \u4E2A\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u672A\u63D0\u4EA4\u66F4\u6539\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","changes.discardPickedStaged":"\u53E6\u6709 {count} \u4E2A\u9009\u4E2D\u9879\u5728\u6682\u5B58\u533A\uFF0C\u4E0D\u5728\u6B64\u6B21\u653E\u5F03\u8303\u56F4\uFF08\u5982\u9700\u64A4\u9500\u6682\u5B58\u8BF7\u7528\u300C\u53D6\u6D88\u6682\u5B58\u300D\uFF09\u3002","changes.discardPickedUntracked":"\u5176\u4E2D {count} \u4E2A\u662F\u672A\u8DDF\u8E2A\u7684\u6587\u4EF6\u6216\u76EE\u5F55\uFF0C\u5C06\u4ECE\u78C1\u76D8\u5220\u9664\uFF08\u4E0D\u5728 Git \u5386\u53F2\u4E2D\uFF0C\u65E0\u6CD5\u6062\u590D\uFF09\u3002","changes.discardAll":"\u653E\u5F03\u5168\u90E8\u53D8\u66F4","changes.discardAllTitle":"\u653E\u5F03\u5168\u90E8\u5DE5\u4F5C\u533A\u66F4\u6539","changes.discardAllBody":"\u5C06\u653E\u5F03\u5168\u90E8 {count} \u4E2A\u5DE5\u4F5C\u533A\u6587\u4EF6\u7684\u672A\u63D0\u4EA4\u66F4\u6539\uFF0C\u56DE\u5230\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u7684\u72B6\u6001\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","changes.discardAllUntracked":"\u5176\u4E2D {count} \u4E2A\u662F\u672A\u8DDF\u8E2A\u7684\u6587\u4EF6\u6216\u76EE\u5F55\uFF0C\u5C06\u4ECE\u78C1\u76D8\u5220\u9664\uFF08\u4E0D\u5728 Git \u5386\u53F2\u4E2D\uFF0C\u65E0\u6CD5\u6062\u590D\uFF09\u3002","changes.discardAllStaged":"\u6682\u5B58\u533A\u7684 {count} \u4E2A\u66F4\u6539\u4E0D\u53D7\u5F71\u54CD\uFF08\u5982\u9700\u64A4\u9500\u6682\u5B58\u8BF7\u7528\u300C\u53D6\u6D88\u6682\u5B58\u300D\uFF09\u3002","changes.expandAll":"\u5C55\u5F00\u5168\u90E8","changes.expanding":"\u6B63\u5728\u52A0\u8F7D\u5168\u90E8\u53D8\u66F4\u2026","changes.expandedAll":"\u5DF2\u5C55\u5F00\u5168\u90E8 {n} \u4E2A\u53D8\u66F4","changes.collapseList":"\u6536\u8D77","changes.discarding":"\u6B63\u5728\u653E\u5F03\u2026","changes.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","changes.untrackedCollapsed":"\u672A\u8DDF\u8E2A\u9879\u4EE5\u76EE\u5F55\u5F62\u5F0F\u663E\u793A\uFF0C\u672A\u9010\u4E2A\u5C55\u5F00","changes.truncatedCap":"\u53D8\u66F4\u8FC7\u591A\uFF0C\u5217\u8868\u4EC5\u663E\u793A\u524D {n} \u9879\uFF1B\u8BA1\u6570\u4ECD\u4E3A\u5168\u90E8\u53D8\u66F4\u7684\u7EDF\u8BA1","changes.truncatedLossy":"Git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF0C\u5217\u8868\u53EF\u80FD\u7F3A\u5C11\u5F00\u5934\u90E8\u5206","changes.truncatedUnknown":"\u5217\u8868\u4E0D\u5B8C\u6574\uFF0C\u53EF\u80FD\u7F3A\u5C11\u90E8\u5206\u53D8\u66F4","changes.noRemoteTarget":"\u5F53\u524D\u5206\u652F\u6CA1\u6709\u53EF\u63A8\u9001\u6216\u53EF\u53D1\u5E03\u7684\u63D0\u4EA4\uFF08\u5DF2\u540C\u6B65\u3001\u5DF2\u843D\u540E\u6216\u5DF2\u5206\u53C9\uFF0C\u6216\u6CA1\u6709\u53EF\u7528\u7684\u8FDC\u7A0B\uFF09","stash.title":"\u8D2E\u85CF\u5F53\u524D\u66F4\u6539","stash.messagePlaceholder":"\u8D2E\u85CF\u8BF4\u660E\uFF08\u53EF\u9009\uFF09","stash.save":"\u8D2E\u85CF","stash.section":"\u8D2E\u85CF","stash.onBranch":"\u4F4D\u4E8E {branch}","stash.apply":"\u5E94\u7528","stash.pop":"\u5F39\u51FA","stash.drop":"\u4E22\u5F03","stash.dropTitle":"\u4E22\u5F03\u8D2E\u85CF","stash.dropConfirm":"\u786E\u5B9A\u4E22\u5F03\u6B64\u8D2E\u85CF\u6761\u76EE\uFF1F\u4E22\u5F03\u540E\u65E0\u6CD5\u6062\u590D\uFF1A{name}","files.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.loadFailed":"\u52A0\u8F7D\u5931\u8D25","files.notFound":"\u6587\u4EF6\u4E0D\u5B58\u5728\uFF08\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u79FB\u52A8\uFF09","files.backToTree":"\u8FD4\u56DE\u6587\u4EF6\u6811","files.truncated":"\u6761\u76EE\u8FC7\u591A\uFF0C\u5DF2\u622A\u65AD","files.refresh":"\u5237\u65B0\u6587\u4EF6\u6D4F\u89C8","files.tooLarge":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8","files.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u9884\u89C8","files.highlightOff":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5173\u95ED\u8BED\u6CD5\u9AD8\u4EAE\u4EE5\u4FDD\u6301\u6D41\u7545","files.lineTruncated":" \u2026\uFF08\u6B64\u884C\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09","files.findPlaceholder":"\u5728\u6B64\u6587\u4EF6\u4E2D\u67E5\u627E","files.findNoMatch":"\u65E0\u5339\u914D","files.findPrev":"\u4E0A\u4E00\u4E2A","files.findNext":"\u4E0B\u4E00\u4E2A","files.findClose":"\u5173\u95ED\u67E5\u627E","files.findCase":"\u533A\u5206\u5927\u5C0F\u5199","files.previewMode":"\u9884\u89C8\u65B9\u5F0F","files.source":"\u6E90\u7801","files.render":"\u6E32\u67D3","files.wrap":"\u81EA\u52A8\u6362\u884C","files.wrapDisabled":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u81EA\u52A8\u6362\u884C\u4E0D\u53EF\u7528","files.runScripts":"\u8FD0\u884C\u9875\u9762\u811A\u672C","files.scriptsOff":"\u9759\u6001\u9884\u89C8\uFF1A\u4E0D\u6267\u884C\u9875\u9762\u811A\u672C\u3002\u70B9\u51FB\u8FD0\u884C\u811A\u672C\uFF08\u5927\u6587\u4EF6\u53EF\u80FD\u5361\u987F\uFF09","files.scriptsSkipped":"\u9759\u6001\u9884\u89C8\u5DF2\u8DF3\u8FC7\u9875\u9762\u811A\u672C\uFF0C\u4F9D\u8D56\u811A\u672C\u6E32\u67D3\u7684\u5185\u5BB9\u4F1A\u663E\u793A\u4E3A\u7A7A\u767D\u3002","files.htmlRendering":"\u6B63\u5728\u6E32\u67D3\u9884\u89C8\u2026","files.htmlRenderingSlow":"\u9875\u9762\u811A\u672C\u4ECD\u5728\u6267\u884C\uFF0C\u9884\u89C8\u7A0D\u540E\u51FA\u73B0","files.htmlRenderingSeconds":"\u5DF2\u7B49\u5F85 {seconds} \u79D2","files.htmlStopRendering":"\u505C\u6B62\u6E32\u67D3","files.htmlHeavyWhy":"\u8BE5\u9875\u9762\u81EA\u5E26 {size} \u5185\u8054\u811A\u672C\u3002","files.htmlHeavyInline":"\u5728\u5185\u5D4C\u9884\u89C8\u4E2D\u6E32\u67D3\u5B83\uFF0C\u53EF\u80FD\u8BA9\u6574\u4E2A\u754C\u9762\u5931\u53BB\u54CD\u5E94\u5341\u51E0\u79D2\u2014\u2014\u9875\u9762\u81EA\u8EAB\u7684\u7ED8\u56FE\u4F1A\u5360\u6EE1\u5E94\u7528\u5171\u7528\u7684 GPU \u8FDB\u7A0B\uFF0C\u5C4A\u65F6\u6240\u6709\u7A97\u53E3\u90FD\u4E0D\u518D\u5237\u65B0\u3002","files.htmlHeavyRemote":"\u8FD9\u662F\u8FDC\u7A0B\u5B9E\u4F8B\uFF0C\u6587\u4EF6\u5728\u8FDC\u7A0B\u673A\u5668\u4E0A\uFF0C\u65E0\u6CD5\u5728\u672C\u5730\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00\u3002\u4F60\u4ECD\u53EF\u5185\u5D4C\u6E32\u67D3\uFF0C\u5E76\u5728\u7B49\u5F85\u671F\u95F4\u70B9\u51FB\u300C\u505C\u6B62\u6E32\u67D3\u300D\u3002","files.htmlHeavyRun":"\u4ECD\u7136\u6E32\u67D3","files.htmlOpenInBrowser":"\u5728\u7CFB\u7EDF\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00","files.htmlOpening":"\u6B63\u5728\u6253\u5F00\u2026","files.htmlOpenFailed":"\u65E0\u6CD5\u5728\u672C\u673A\u6253\u5F00\u8BE5\u6587\u4EF6\uFF08\u8FDC\u7A0B\u5B9E\u4F8B\u6216\u7CFB\u7EDF\u4E0D\u652F\u6301\uFF09\u3002","files.scriptsOn":"\u6B63\u5728\u6267\u884C\u9875\u9762\u811A\u672C\u3002\u70B9\u51FB\u6539\u56DE\u9759\u6001\u9884\u89C8","files.mermaidLoading":"\u6B63\u5728\u52A0\u8F7D\u56FE\u8868\u5F15\u64CE\u2026","files.copyPath":"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","files.pathCopied":"\u8DEF\u5F84\u5DF2\u590D\u5236","files.pathCopyFailed":"\u590D\u5236\u5931\u8D25","files.copyContent":"\u590D\u5236\u6587\u4EF6\u5185\u5BB9","files.contentCopied":"\u5185\u5BB9\u5DF2\u590D\u5236","files.contentCopyFailed":"\u590D\u5236\u5931\u8D25","files.ignored":"\u5DF2\u88AB Git \u5FFD\u7565","files.copy":"\u590D\u5236\u4EE3\u7801","files.copied":"\u5DF2\u590D\u5236","files.footnotes":"\u6CE8\u91CA","files.zoomBar":"\u56FE\u7247\u7F29\u653E","files.zoomIn":"\u653E\u5927","files.zoomOut":"\u7F29\u5C0F","files.zoomActual":"\u5B9E\u9645\u5927\u5C0F\uFF08100%\uFF09","files.zoomFit":"\u9002\u5E94\u7A97\u53E3","files.zoomFullscreen":"\u5168\u5C4F\u67E5\u770B","files.screenFull":"\u5168\u5C4F\u663E\u793A","files.enterFullscreen":"\u8FDB\u5165\u5168\u5C4F","files.exitFullscreen":"\u9000\u51FA\u5168\u5C4F","files.fullscreen":"\u5168\u5C4F\u67E5\u770B\u6587\u4EF6","files.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","files.propsTitle":"\u6587\u4EF6\u5C5E\u6027","files.propsGroupStats":"\u5927\u5C0F\u4E0E\u7EDF\u8BA1","files.propsGroupTime":"\u65F6\u95F4","files.propsName":"\u540D\u79F0","files.propsType":"\u7C7B\u578B","files.propsTypeImage":"{fmt} \u56FE\u7247","files.propsTypeText":"\u6587\u672C\u6587\u4EF6","files.propsTypeBinary":"\u4E8C\u8FDB\u5236\u6587\u4EF6","files.propsTypeUnread":"\u8FC7\u5927\u672A\u8BFB\u53D6","files.propsTypeFmt":"{label}\uFF08.{ext}\uFF09","files.propsRelPath":"\u76F8\u5BF9\u8DEF\u5F84","files.propsAbsPath":"\u7EDD\u5BF9\u8DEF\u5F84","files.propsCopyHint":"\u70B9\u51FB\u590D\u5236","files.propsSize":"\u5927\u5C0F","files.propsSizeBytes":"\uFF08{bytes} \u5B57\u8282\uFF09","files.propsLines":"\u884C\u6570","files.propsImageSize":"\u56FE\u7247\u5C3A\u5BF8","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"\u4FEE\u6539\u65F6\u95F4","files.propsUntracked":"\u672A\u8DDF\u8E2A","files.propsTrackedYes":"\u5DF2\u8DDF\u8E2A","files.propsStaged":"\u5DF2\u6682\u5B58","files.stAdded":"\u5DF2\u6DFB\u52A0","files.stModified":"\u5DF2\u4FEE\u6539","files.stDeleted":"\u5DF2\u5220\u9664","files.stRenamed":"\u5DF2\u91CD\u547D\u540D","files.stConflicted":"\u6709\u51B2\u7A81","files.stTypechange":"\u7C7B\u578B\u53D8\u66F4","stats.files":"{n} \u4E2A\u6587\u4EF6","stats.lastChange":"\u6700\u8FD1\u53D8\u66F4 {time}","stats.lastCommit":"\u4E0A\u6B21\u63D0\u4EA4 {time}","stats.staged":"\u5DF2\u6682\u5B58 {n}","stats.modified":"\u5DF2\u4FEE\u6539 {n}","stats.untracked":"\u672A\u8DDF\u8E2A {n}","stats.partial":"\u7EDF\u8BA1\u5DF2\u7B80\u5316","stats.partialHint":"\u53D8\u66F4\u6570\u91CF\u8F83\u591A\uFF0C\u5DF2\u8DF3\u8FC7\u672A\u8DDF\u8E2A\u6587\u4EF6\u884C\u6570\u4E0E\u6700\u8FD1\u53D8\u66F4\u65F6\u95F4\u7684\u7CBE\u786E\u7EDF\u8BA1\u4EE5\u4FDD\u6301\u9762\u677F\u6D41\u7545\u3002","commit.placeholder":"\u63D0\u4EA4\u4FE1\u606F","commit.commit":"\u63D0\u4EA4","commit.amend":"Amend \u63D0\u4EA4","commit.edit":"\u7F16\u8F91\u63D0\u4EA4\u4FE1\u606F","commit.collapse":"\u6536\u8D77\u63D0\u4EA4\u6846","commit.suggest":"AI \u751F\u6210","commit.ai":"AI","commit.suggesting":"\u751F\u6210\u4E2D\u2026","commit.suggestOverwrite":"\u518D\u6B21\u70B9\u51FB\u300CAI \u751F\u6210\u300D\u4EE5\u8986\u76D6\u5F53\u524D\u63D0\u4EA4\u4FE1\u606F","commit.suggestTruncated":"diff \u8FC7\u957F\u5DF2\u622A\u65AD\uFF0C\u751F\u6210\u7684\u5EFA\u8BAE\u53EF\u80FD\u4E0D\u5B8C\u6574","commit.publish":"\u53D1\u5E03\u5206\u652F","commit.publishTitle":"\u8FDC\u7A0B\u8FD8\u6CA1\u6709\u8FD9\u4E2A\u5206\u652F\uFF1A\u521B\u5EFA\u540C\u540D\u8FDC\u7A0B\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\uFF08git push -u\uFF09","diff.unified":"\u7EDF\u4E00","diff.split":"\u5BF9\u7167","diff.before":"\u53D8\u66F4\u524D","diff.after":"\u53D8\u66F4\u540E","diff.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.tooLarge":"\u56FE\u7247\u8FC7\u5927\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.imageMissing":"\u4E0D\u5B58\u5728","diff.svgRender":"\u6E32\u67D3","diff.svgSource":"\u6E90\u7801","diff.empty":"\u65E0\u5DEE\u5F02","diff.expandAll":"\u5C55\u5F00\u5168\u90E8","diff.collapse":"\u6298\u53E0\u672A\u53D8\u66F4","diff.expandGap":"\u5C55\u5F00\u5168\u90E8 {n} \u884C","diff.expandUp":"\u5411\u4E0A\u5C55\u5F00 {n} \u884C","diff.expandDown":"\u5411\u4E0B\u5C55\u5F00 {n} \u884C","diff.expandCapped":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5C55\u5F00 {n} \u884C\u4E0A\u4E0B\u6587\uFF0C\u5176\u4F59\u4FDD\u6301\u6298\u53E0\uFF0C\u53EF\u9010\u6BB5\u5C55\u5F00","diff.truncated":"git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF1A\u6B64\u5DEE\u5F02\u53EA\u4FDD\u7559\u4E86\u5C3E\u6BB5\uFF0C\u5F00\u5934\u7684\u6539\u52A8\u4E0E\u589E\u5220\u7EDF\u8BA1\u53EF\u80FD\u7F3A\u5931","time.justNow":"\u521A\u521A","time.minutesAgo":"{n} \u5206\u949F\u524D","time.hoursAgo":"{n} \u5C0F\u65F6\u524D","time.daysAgo":"{n} \u5929\u524D","error.generic":"\u64CD\u4F5C\u5931\u8D25","error.notARepo":"\u5F53\u524D\u76EE\u5F55\u4E0D\u662F Git \u4ED3\u5E93","error.noCwd":"\u5F53\u524D\u4F1A\u8BDD\u65E0\u5DE5\u4F5C\u76EE\u5F55","error.localChangesBlock":"\u672C\u5730\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u64CD\u4F5C\u88AB\u963B\u6B62","error.emptyMessage":"\u63D0\u4EA4\u4FE1\u606F\u4E0D\u80FD\u4E3A\u7A7A","error.nothingToCommit":"\u6CA1\u6709\u53EF\u63D0\u4EA4\u7684\u53D8\u66F4\uFF1A\u8BF7\u5148\u6682\u5B58\uFF0C\u6216\u5728\u5217\u8868\u4E2D\u52FE\u9009\u6709\u6539\u52A8\u7684\u6587\u4EF6","error.timeout":"Git \u64CD\u4F5C\u8D85\u65F6\uFF1A\u547D\u4EE4\u672A\u5728\u9650\u5B9A\u65F6\u95F4\u5185\u5B8C\u6210","error.cancelled":"\u64CD\u4F5C\u5DF2\u53D6\u6D88","error.invalidPath":"\u8DEF\u5F84\u4E0D\u5408\u6CD5\uFF1A\u4E0D\u5728\u4ED3\u5E93\u5185\u6216\u4E0D\u53D7\u652F\u6301","error.emptyDiff":"\u6CA1\u6709\u53EF\u751F\u6210\u7684\u53D8\u66F4","error.llmUnavailable":"AI \u670D\u52A1\u4E0D\u53EF\u7528","error.llmFailed":"AI \u751F\u6210\u5931\u8D25","error.suggestDisabled":"AI \u751F\u6210\u5DF2\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u5173\u95ED","error.conflict":"\u8D2E\u85CF\u5E94\u7528\u4EA7\u751F\u51B2\u7A81\uFF0C\u8D2E\u85CF\u6761\u76EE\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u624B\u52A8\u89E3\u51B3\u51B2\u7A81\u540E\u518D\u8BD5","error.revertConflict":"\u8FD8\u539F\u4F1A\u4E0E\u5F53\u524D\u5185\u5BB9\u51B2\u7A81\uFF0C\u5DF2\u81EA\u52A8\u53D6\u6D88\u8FD8\u539F\uFF08\u672A\u6539\u52A8\u4F60\u7684\u5DE5\u4F5C\u533A\uFF09","error.revertStuck":"\u8FD8\u539F\u4EA7\u751F\u51B2\u7A81\u4E14\u81EA\u52A8\u53D6\u6D88\u5931\u8D25\uFF0C\u4ED3\u5E93\u4ECD\u5904\u4E8E\u8FD8\u539F\u4E2D\uFF0C\u8BF7\u624B\u52A8\u6267\u884C git revert --abort \u6216\u89E3\u51B3\u51B2\u7A81","error.revertMerge":"\u8FD9\u662F\u4E00\u4E2A\u5408\u5E76\u63D0\u4EA4\uFF0C\u9762\u677F\u6682\u4E0D\u652F\u6301\u8FD8\u539F\uFF08\u9700\u6307\u5B9A\u4E3B\u7EBF\u7236\u63D0\u4EA4\uFF09\uFF0C\u8BF7\u5728\u547D\u4EE4\u884C\u7528 git revert -m \u5904\u7406","error.indexBusy":"Git \u6B63\u5FD9\uFF08\u53E6\u4E00\u8FDB\u7A0B\u5360\u7528\u7D22\u5F15\uFF09\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","error.notFound":"\u76EE\u6807\u4E0D\u5B58\u5728\uFF08\u5206\u652F / \u6807\u7B7E / \u8D2E\u85CF\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u91CD\u547D\u540D\uFF09","error.branchInUse":"\u8BE5\u5206\u652F\u5DF2\u5728\u53E6\u4E00\u4E2A\u5DE5\u4F5C\u6811\u4E2D\u68C0\u51FA\uFF0C\u65E0\u6CD5\u5728\u6B64\u5207\u6362","error.nestedRepo":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u653E\u5F03\u4F1A\u8FDE\u5E26\u5220\u9664\u6574\u4E2A\u5185\u90E8\u4ED3\u5E93\uFF1B\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.nestedRepoPartial":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u62D2\u7EDD\u8FDE\u5E26\u5220\u9664\uFF1B\u4F46\u540C\u6279\u4E2D\u4F4D\u4E8E\u5B83\u4E4B\u524D\u7684\u6761\u76EE\u5DF2\u7ECF\u88AB\u5220\u9664\u4E86\uFF0C\u8BF7\u5237\u65B0\u540E\u786E\u8BA4\u5269\u4F59\u53D8\u66F4\uFF0C\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.statusLossy":"Git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B8C\u6574\u53D8\u66F4\u96C6\uFF1B\u300C\u653E\u5F03\u5168\u90E8\u300D\u5DF2\u53D6\u6D88\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\u6216\u6539\u7528\u9010\u9879\u653E\u5F03","error.stashSwitchFailed":"\u672A\u63D0\u4EA4\u53D8\u66F4\u5DF2\u8D2E\u85CF\uFF08\u53EF\u5728\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\uFF09\uFF0C\u4F46\u5207\u6362\u5931\u8D25\uFF1A{reason}","error.invalidName":"\u540D\u79F0\u4E0D\u5408\u6CD5","error.notFastForward":"\u672C\u5730\u4E0E\u8FDC\u7A0B\u5206\u652F\u5DF2\u5206\u53C9\uFF0C\u65E0\u6CD5\u5FEB\u8FDB\u62C9\u53D6\uFF0C\u8BF7\u624B\u52A8\u5408\u5E76\u6216\u53D8\u57FA","error.pushRejected":"\u63A8\u9001\u88AB\u62D2\u7EDD\uFF1A\u8FDC\u7A0B\u5DF2\u6709\u65B0\u63D0\u4EA4\uFF0C\u8BF7\u5148\u300C\u68C0\u67E5\u540C\u6B65\u300D\u5E76\u62C9\u53D6\u540E\u518D\u63A8\u9001","error.authFailed":"\u8BA4\u8BC1\u5931\u8D25\uFF1A\u6CA1\u6709\u53EF\u7528\u7684 git \u51ED\u636E\uFF08HTTPS \u9700\u51ED\u636E\u52A9\u624B\u3001SSH \u9700\u5BC6\u94A5\uFF09\u3002\u8BF7\u5148\u5728\u547D\u4EE4\u884C\u5B8C\u6210\u4E00\u6B21\u63A8\u9001\u4EE5\u7F13\u5B58\u51ED\u636E","error.noBranch":"\u5F53\u524D\u4E0D\u5728\u4EFB\u4F55\u5206\u652F\u4E0A\uFF08\u6E38\u79BB HEAD \u6216\u5C1A\u65E0\u63D0\u4EA4\uFF09\uFF0C\u65E0\u6CD5\u53D1\u5E03\u5206\u652F\uFF1A\u8BF7\u5148\u5207\u5230\u5206\u652F\u5E76\u5B8C\u6210\u4E00\u6B21\u63D0\u4EA4","status.openRepo":"\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.openRepoOn":"\u5728 {host} \u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.synced":"\u5DF2\u4E0E\u8FDC\u7A0B\u540C\u6B65","status.ahead":"\u9886\u5148 {n}","status.behind":"\u843D\u540E {n}","status.diverged":"\u5DF2\u5206\u53C9\uFF08\u9886\u5148 {ahead} / \u843D\u540E {behind}\uFF09","status.noUpstream":"\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u5206\u652F","status.detached":"\u6E38\u79BB HEAD\uFF0C\u65E0\u5206\u652F\u540C\u6B65\u72B6\u6001","status.check":"\u68C0\u67E5\u540C\u6B65\u72B6\u6001","status.checkTitle":"\u68C0\u67E5\u4E0E\u8FDC\u7A0B\u7684\u540C\u6B65\u72B6\u6001\uFF1A\u6267\u884C git fetch \u62C9\u53D6\u6700\u65B0\u5F15\u7528\u5E76\u5237\u65B0\u9886\u5148/\u843D\u540E\u8BA1\u6570\uFF0C\u4E0D\u6539\u52A8\u5DE5\u4F5C\u533A","status.pull":"\u62C9\u53D6","status.pulling":"\u540C\u6B65\u4E2D\u2026","status.pullTitle":"\u5FEB\u8FDB\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmTitle":"\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmBody":"\u5C06\u4EE5\u5FEB\u8FDB\u65B9\u5F0F\u628A\u5F53\u524D\u5206\u652F {branch} \u66F4\u65B0\u5230\u8FDC\u7A0B\u6700\u65B0\u63D0\u4EA4\uFF08\u843D\u540E {behind} \u4E2A\u63D0\u4EA4\uFF09\u3002\u4EC5\u5728\u672A\u5206\u53C9\u65F6\u53EF\u884C\uFF0C\u4E0D\u4F1A\u4EA7\u751F\u5408\u5E76\u63D0\u4EA4\uFF0C\u4E5F\u4E0D\u4F1A\u6539\u52A8\u4F60\u7684\u672A\u63D0\u4EA4\u5185\u5BB9\u3002","status.pullConfirm":"\u62C9\u53D6","status.pullScope":"\u5C06\u5F15\u5165 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pullScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u8FDC\u7A0B\u5DEE\u5F02\u2026","status.push":"\u63A8\u9001","status.pushTitle":"\u63A8\u9001\u672C\u5730\u63D0\u4EA4\u5230\u8FDC\u7A0B","status.pushConfirmTitle":"\u63A8\u9001\u5230\u8FDC\u7A0B","status.pushConfirmBody":"\u5C06\u628A\u5F53\u524D\u5206\u652F {branch} \u9886\u5148\u8FDC\u7A0B\u7684 {ahead} \u4E2A\u63D0\u4EA4\u63A8\u9001\u5230\u4E0A\u6E38\u3002\u4EC5\u505A\u5FEB\u8FDB\u63A8\u9001\uFF0C\u4E0D\u4F1A\u5F3A\u5236\u8986\u76D6\u8FDC\u7A0B\u5386\u53F2\u3002","status.pushConfirm":"\u63A8\u9001","status.pushing":"\u63A8\u9001\u4E2D\u2026","status.pushScope":"\u5C06\u63A8\u9001 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pushScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u5F85\u63A8\u9001\u5DEE\u5F02\u2026","status.publish":"\u53D1\u5E03","status.publishTitle":"\u53D1\u5E03\u5206\u652F\u5E76\u8BBE\u7F6E\u4E0A\u6E38","status.publishConfirmTitle":"\u53D1\u5E03\u5206\u652F\u5230\u8FDC\u7A0B","status.publishConfirmBody":"\u5F53\u524D\u5206\u652F {branch} \u5C1A\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u3002\u5C06\u6267\u884C git push -u {remote} \u5728\u8FDC\u7A0B\u521B\u5EFA\u540C\u540D\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\u8DDF\u8E2A\u3002","status.publishConfirm":"\u53D1\u5E03","status.publishing":"\u53D1\u5E03\u4E2D\u2026","cfg.title":"\u8F93\u5165\u6846\u5206\u652F\u6807\u8BB0","cfg.toggle":"\u663E\u793A\u8F93\u5165\u6846\u6807\u8BB0","cfg.hint":"\u5F00\u542F\u65F6\u5728\u8F93\u5165\u6846\u663E\u793A zsh \u98CE\u683C\u7684 <\u4ED3\u5E93\u540D> (\u5206\u652F) \u6807\u8BB0\uFF1B\u5173\u95ED\u540E\u6539\u4E3A\u5728 Git \u6807\u7B7E\u65C1\u663E\u793A\u72B6\u6001\u5706\u70B9\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffTitle":"\u5DEE\u5F02\u5BF9\u6BD4\u9ED8\u8BA4\u89C6\u56FE","cfg.diffHint":"\u9009\u62E9\u53D8\u66F4\u5BF9\u6BD4\u9ED8\u8BA4\u6253\u5F00\u7684\u5E03\u5C40\uFF1A\u7EDF\u4E00\u89C6\u56FE\u4E3A\u5355\u680F\u884C\u5185\u5BF9\u6BD4\uFF0C\u5E76\u6392\u89C6\u56FE\u4E3A\u5DE6\u53F3\u5206\u680F\u5BF9\u6BD4\u3002\u4ECD\u53EF\u5728\u6BCF\u4E2A\u5DEE\u5F02\u89C6\u56FE\u4E2D\u4E34\u65F6\u5207\u6362\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffUnified":"\u7EDF\u4E00\u89C6\u56FE\uFF08\u5355\u680F\u884C\u5185\uFF09","cfg.diffSplit":"\u5E76\u6392\u89C6\u56FE\uFF08\u5DE6\u53F3\u5206\u680F\uFF09","cfg.graphTitle":"\u63D0\u4EA4\u5386\u53F2\u56FE\u7EBF\u6761\u6837\u5F0F","cfg.graphHint":"\u9009\u62E9\u63D0\u4EA4\u5386\u53F2\u56FE\u7684\u8FDE\u7EBF\u753B\u6CD5\uFF1A\u5E73\u884C\u7EBF\u4E3A VSCode / \u56FE\u5F62\u754C\u9762\u98CE\u683C\uFF0C\u5206\u652F\u5404\u5360\u4E00\u5217\u3001\u5171\u4EAB\u7956\u5148\u4EE5\u5E76\u884C\u7EBF\u8868\u793A\uFF1B\u7D27\u51D1\u4E3A git log \u547D\u4EE4\u884C\u98CE\u683C\uFF0C\u5171\u4EAB\u7956\u5148\u5408\u5E76\u4E3A\u4E00\u5217\u3001\u7EBF\u66F4\u5C11\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.graphParallel":"\u5E73\u884C\u7EBF\uFF08VSCode \u98CE\u683C\uFF09","cfg.graphCompact":"\u7D27\u51D1\uFF08git log \u98CE\u683C\uFF09","cfg.fontTitle":"\u9762\u677F\u5B57\u53F7","cfg.fontSmaller":"\u8F83\u5C0F\uFF08A\u2212\uFF09","cfg.fontDefault":"\u9ED8\u8BA4\uFF08A\uFF09","cfg.fontLarger":"\u8F83\u5927\uFF08A+\uFF09","cfg.fontHint":"\u5F71\u54CD Git \u9762\u677F\u5185\u6240\u6709\u6587\u5B57\u7684\u663E\u793A\u5927\u5C0F\uFF1B\u5BBD\u9762\u677F\u5DE5\u5177\u680F\u7684 A\u2212/A/A+ \u4E0E\u6B64\u540C\u6B65\u3002","cfg.suggestTitle":"AI \u751F\u6210\u63D0\u4EA4\u4FE1\u606F","cfg.suggestToggle":"\u63D0\u4EA4\u6846\u663E\u793A AI \u751F\u6210\u6309\u94AE","cfg.suggestLangLabel":"\u751F\u6210\u8BED\u8A00","cfg.suggestLangAuto":"\u81EA\u52A8","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"\u81EA\u52A8 = \u8DDF\u968F\u4F60\u5728\u6B64\u4ED3\u5E93\u7684\u63D0\u4EA4\u8BED\u8A00\uFF08\u5C31\u8FD1\u52A0\u6743\uFF0C\u5F53\u524D git \u4F5C\u8005\u4F18\u5148\uFF0C\u5FFD\u7565 release / merge \u7B49\u673A\u68B0\u63D0\u4EA4\uFF09\uFF1B\u4E2D\u6587 / English \u76F4\u63A5\u6307\u5B9A\u3002","cfg.suggestMaxBytesLabel":"\u8F93\u5165\u9884\u7B97","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"\u53D1\u9001\u7ED9\u6A21\u578B\u7684 diff \u4E0A\u9650\uFF0C\u8D85\u51FA\u4F1A\u622A\u65AD\uFF1B\u8303\u56F4 16\u2013512\u3002","cfg.suggestOutputLabel":"\u8F93\u51FA\u4E0A\u9650","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"\u6A21\u578B\u751F\u6210\u9884\u7B97\uFF1B\u601D\u8003\u6A21\u578B\u7684\u63A8\u7406\u8BA1\u5165\u8BE5\u9884\u7B97\uFF1B\u8303\u56F4 256\u201316384\u3002","cfg.suggestTimeoutLabel":"\u751F\u6210\u8D85\u65F6","cfg.suggestTimeoutUnit":"\u79D2","cfg.suggestTimeoutHint":"\u8D85\u65F6\u5373\u751F\u6210\u5931\u8D25\uFF1B\u8303\u56F4 5\u2013120\u3002","cfg.suggestModelLabel":"\u6A21\u578B","cfg.suggestModelSession":"\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4","cfg.suggestModelLoading":"\u52A0\u8F7D\u6A21\u578B\u5217\u8868\u2026","cfg.suggestModelEmpty":"\u672A\u68C0\u6D4B\u5230\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u5148\u5728 DSH \u8BBE\u7F6E\u4E2D\u914D\u7F6E","cfg.suggestModelFailed":"\u6A21\u578B\u5217\u8868\u52A0\u8F7D\u5931\u8D25","cfg.suggestModelRetry":"\u91CD\u8BD5","cfg.suggestProviderLabel":"\u63D0\u4F9B\u65B9","cfg.suggestModelPick":"\u9009\u62E9\u6A21\u578B","cfg.suggestEffortLabel":"\u63A8\u7406\u5F3A\u5EA6","cfg.suggestEffortUnset":"\u4E0D\u8BBE\u7F6E\uFF08\u7528\u6A21\u578B\u9ED8\u8BA4\uFF09","cfg.suggestHint":"\u5F00\u542F\u540E\u63D0\u4EA4\u6846\u65C1\u4F1A\u51FA\u73B0\u300CAI \u751F\u6210\u300D\u6309\u94AE\uFF1A\u6839\u636E\u5F53\u524D\u53D8\u66F4\u4E0E\u4ED3\u5E93\u65E2\u6709\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u9009\u56FA\u5B9A\u6A21\u578B\u540E\uFF0C\u751F\u6210\u4F1A\u628A diff \u53D1\u7ED9\u8BE5\u6A21\u578B\u7684\u4F9B\u5E94\u5546\uFF1B\u9009\u300C\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4\u300D\u5219\u7528\u5F53\u524D\u4F1A\u8BDD\u7684 Agent \u6A21\u578B\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.notLoaded":"\u914D\u7F6E\u672A\u52A0\u8F7D\uFF1A\u8BE5\u914D\u7F6E\u7531\u8FD0\u884C\u4E2D\u7684\u5BBF\u4E3B\u63D0\u4F9B\uFF0C\u82E5\u957F\u65F6\u95F4\u7A7A\u767D\u8BF7\u91CD\u542F DSH \u540E\u91CD\u8BD5\u3002","cfg.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"},Oi={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","panel.fontSize":"Panel font size","panel.tabs":"Panel tabs","tab.overview":"Overview","tab.changes":"Changes","tab.files":"Files","tab.overviewShort":"Overview","tab.changesShort":"Changes","tab.filesShort":"Files","pill.unavailable":"Git unavailable","pill.detached":"detached HEAD","pill.synced":"Everything committed","pill.dirty":"Uncommitted changes","common.loading":"Loading\u2026","common.retry":"Retry","common.close":"Close","common.cancel":"Cancel","ops.aiHint":"Tip: Trust AI more, try direct Git\u2011operation execution by AI.","version.check":"Check for updates","version.checking":"Checking\u2026","version.upToDate":"Up to date ({current})","version.updateAvailable":"New version {latest} available (current {current})","version.viewRelease":"View release","version.error":"Check failed","version.noRepo":"Repository not configured","version.openRepo":"Visit @xbzbing/dsh-git-panel on GitHub \u2014 please give the project a little star \u2B50","overview.head":"All branches","overview.local":"Local","overview.currentBranch":"Current branch","overview.primaryBranch":"Primary branch","overview.branchAhead":"{n} commits ahead of upstream","overview.branchBehind":"{n} commits behind upstream","overview.remote":"Remote","overview.tags":"Tags","overview.search":"Search commits (message / hash)","overview.searchShort":"Search","overview.allUsers":"All authors","overview.allTime":"All time","overview.today":"Today","overview.last7d":"Last 7 days","overview.last30d":"Last 30 days","overview.selectCommit":"Select a commit to see details","overview.noMessage":"(no commit body)","overview.noResults":"No matching commits","overview.loadFailed":"Load failed","overview.detailFailed":"Failed to load details","overview.diffFailed":"Failed to load diff","overview.openFileDiff":"View this file\u2019s changes in this commit","overview.changeSummary":"{files} files","overview.expandDir":"Expand folder","overview.collapseDir":"Collapse folder","overview.fetch":"Fetch","overview.branchesError":"Failed to load branches","overview.filterBranch":"Filter by branch","overview.moreFilters":"More filters","overview.backToList":"Back to list","overview.createTag":"Create tag","switch.action":"Switch","switch.rowTitle":"Switch to {name}","switch.rowTitleTrack":"Create {name} tracking {ref} and switch to it","switch.detached":"detached HEAD","switch.confirmTitle":"Switch branch","switch.body":"Switch from {from} to {to}.","switch.trackingNote":"There is no local {name} yet: it will be created from {ref} and set to track it.","switch.dirtyWarn":"{count} file(s) have uncommitted changes.","switch.modeDirect":"Switch directly","switch.modeDirectHint":"Uncommitted changes come along; if they collide with the target branch, git refuses the switch and the work tree stays untouched.","switch.modeStash":"Stash the {count} file(s) first, then switch","switch.modeStashHint":"The changes (including untracked files) move to the top of the stash; restore them from Changes \u2192 Stash afterwards. Note: they are not restored automatically, and restoring may need manual conflict resolution.","switch.confirm":"Switch","switch.confirmStash":"Stash and switch","switch.switching":"Switching\u2026","switch.stashMessage":"Auto-stash before switching to {branch}","overview.revert":"Revert this commit","overview.reset":"Reset to here","tag.createTitle":"Create a tag at this commit","tag.namePlaceholder":"Tag name","tag.annotated":"Annotated tag (with message)","tag.messagePlaceholder":"Tag message","tag.create":"Create tag","tag.deleteTitle":"Delete tag","tag.deleteConfirm":'Delete tag "{name}"?',"tag.deleteOne":'Delete tag "{name}"',"ops.dirtyWarn":"There are uncommitted changes \u2014 they may be work the dsh AI is doing.","revert.title":"Revert commit","revert.body":"Appends a reverse commit at the current HEAD that undoes the changes in {ref}. Your working-tree changes are kept.","revert.confirm":"Revert","reset.title":"Reset branch","reset.body":"Moves the current branch HEAD from {from} to {to}.","reset.modeSoft":"Soft (--soft)","reset.softHint":"Moves HEAD; changes stay staged.","reset.modeMixed":"Mixed (--mixed, default)","reset.mixedHint":"Moves HEAD; changes stay in the working tree.","reset.modeHard":"Hard (--hard)","reset.hardHint":"Moves HEAD to this commit and discards all uncommitted changes (uncommitted changes cannot be recovered).","reset.hardOrphan":"Commits after the target leave the branch (still recoverable via git reflog).","reset.hardWarn":"The following uncommitted changes will be permanently discarded:","reset.lostMore":"\u2026 more uncommitted changes not shown (list capped)","reset.hardAck":"I understand these uncommitted changes will be lost","reset.hardAckClean":"I understand the consequences and confirm the reset","reset.confirm":"Reset","changes.groupStaged":"Staged changes","changes.groupUnstaged":"Changes","changes.groupUntracked":"Unversioned files","changes.selectFile":"Select a file to see its diff","changes.noChanges":"No uncommitted changes","changes.actions":"Repository change actions","changes.refresh":"Refresh repository status","changes.stageAll":"Stage all","changes.unstageAll":"Unstage all","changes.selectAllGroup":"Select all files in this group: {group}","changes.stage":"Stage","changes.unstage":"Unstage","changes.discard":"Discard changes","changes.discardConfirm":"Click again to confirm discard","changes.stageTip":"Stage this file so the next commit includes its changes","changes.unstageTip":"Unstage this file; its changes stay in the working tree","changes.discardTip":"Discard this file's working-tree changes (cannot be undone); click again to confirm","changes.discardTipArmed":"Click again to discard this file's changes \u2014 cannot be undone","changes.discardPicked":"Discard selected","changes.discardPickedTitle":"Discard selected changes","changes.discardPickedBody":"Discards uncommitted working-tree changes in {count} file(s). This cannot be undone.","changes.discardPickedStaged":"{count} of the selected rows are on the staged side and are not affected; use Unstage to undo the index.","changes.discardPickedUntracked":"{count} of them are untracked files or directories that will be deleted from disk (never in Git history \u2014 unrecoverable).","changes.discardAll":"Discard all changes","changes.discardAllTitle":"Discard all working-tree changes","changes.discardAllBody":"Discards uncommitted working-tree changes in all {count} file(s), restoring the last committed state. This cannot be undone.","changes.discardAllUntracked":"{count} of them are untracked files or directories that will be deleted from disk (never in Git history \u2014 unrecoverable).","changes.discardAllStaged":"{count} staged change(s) are not affected; use Unstage to undo the index.","changes.expandAll":"Expand all","changes.expanding":"Loading all changes\u2026","changes.expandedAll":"All {n} changes expanded","changes.collapseList":"Collapse","changes.discarding":"Discarding\u2026","changes.backToList":"Back to list","changes.stash":"Stash changes","changes.untrackedCollapsed":"Untracked entries are shown as directories, not expanded","changes.truncatedCap":"Too many changes \u2014 showing the first {n}; counts still cover all changes","changes.truncatedLossy":"Git output exceeded the limit; the list may be missing its opening entries","changes.truncatedUnknown":"The list is incomplete; some changes may be missing","changes.noRemoteTarget":"This branch has nothing to push or publish (already in sync, behind, diverged, or no usable remote)","stash.title":"Stash current changes","stash.messagePlaceholder":"Stash message (optional)","stash.save":"Stash","stash.section":"Stashes","stash.onBranch":"on {branch}","stash.apply":"Apply","stash.pop":"Pop","stash.drop":"Drop","stash.dropTitle":"Drop stash","stash.dropConfirm":"Drop this stash? This cannot be undone: {name}","files.selectFile":"Select a file to preview","files.loadFailed":"Load failed","files.notFound":"File not found (deleted or moved)","files.backToTree":"Back to files","files.truncated":"Too many entries \u2014 truncated","files.refresh":"Refresh the file browser","files.tooLarge":"File too large to preview","files.binary":"Binary file \u2014 no preview","files.highlightOff":"Large file \u2014 syntax highlighting disabled for performance","files.lineTruncated":" \u2026 (line too long, truncated)","files.findPlaceholder":"Find in file","files.findNoMatch":"No results","files.findPrev":"Previous match","files.findNext":"Next match","files.findClose":"Close find","files.findCase":"Match case","files.previewMode":"Preview mode","files.source":"Source","files.render":"Rendered","files.wrap":"Word wrap","files.wrapDisabled":"Word wrap unavailable for large files","files.runScripts":"Run page scripts","files.scriptsOff":"Static preview: page scripts are off. Click to run them (large pages can stall)","files.scriptsSkipped":"The static preview skipped the page scripts, so script-rendered content is blank.","files.htmlRendering":"Rendering preview\u2026","files.htmlRenderingSlow":"Page scripts are still running; the preview will appear shortly","files.htmlRenderingSeconds":"Waiting for {seconds} s","files.htmlStopRendering":"Stop rendering","files.htmlHeavyWhy":"This page carries {size} of inline scripts.","files.htmlHeavyInline":"Rendering it inline can freeze the whole interface for a dozen seconds: the page's own drawing saturates the GPU process that every window of the app shares, and nothing repaints until it finishes.","files.htmlHeavyRemote":'This is a remote instance, so the file lives on the remote machine and cannot be opened in a local browser. You can still render it inline and press "Stop rendering" while it waits.',"files.htmlHeavyRun":"Render anyway","files.htmlOpenInBrowser":"Open in the system browser","files.htmlOpening":"Opening\u2026","files.htmlOpenFailed":"Could not open the file on this machine (remote instance, or no desktop opener).","files.scriptsOn":"Page scripts are running. Click to return to the static preview","files.mermaidLoading":"Loading diagram engine\u2026","files.copyPath":"Copy relative path","files.pathCopied":"Path copied","files.pathCopyFailed":"Copy failed","files.copyContent":"Copy file content","files.contentCopied":"Content copied","files.contentCopyFailed":"Copy failed","files.ignored":"Ignored by Git","files.copy":"Copy code","files.copied":"Copied","files.footnotes":"Footnotes","files.zoomBar":"Image zoom","files.zoomIn":"Zoom in","files.zoomOut":"Zoom out","files.zoomActual":"Actual size (100%)","files.zoomFit":"Fit to window","files.zoomFullscreen":"View fullscreen","files.screenFull":"Full screen","files.enterFullscreen":"Enter full screen","files.exitFullscreen":"Exit full screen","files.fullscreen":"View file full screen","files.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","files.propsTitle":"File properties","files.propsGroupStats":"Size & stats","files.propsGroupTime":"Timestamps","files.propsName":"Name","files.propsType":"Type","files.propsTypeImage":"{fmt} image","files.propsTypeText":"Text file","files.propsTypeBinary":"Binary file","files.propsTypeUnread":"Too large to read","files.propsTypeFmt":"{label} (.{ext})","files.propsRelPath":"Relative path","files.propsAbsPath":"Absolute path","files.propsCopyHint":"Click to copy","files.propsSize":"Size","files.propsSizeBytes":"({bytes} bytes)","files.propsLines":"Lines","files.propsImageSize":"Dimensions","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"Modified","files.propsUntracked":"Untracked","files.propsTrackedYes":"Tracked","files.propsStaged":"Staged","files.stAdded":"Added","files.stModified":"Modified","files.stDeleted":"Deleted","files.stRenamed":"Renamed","files.stConflicted":"Conflicted","files.stTypechange":"Type changed","stats.files":"{n} files","stats.lastChange":"changed {time}","stats.lastCommit":"last commit {time}","stats.staged":"{n} staged","stats.modified":"{n} modified","stats.untracked":"{n} untracked","stats.partial":"simplified","stats.partialHint":"Large change set \u2014 untracked line counts and last-change time are omitted to keep the panel responsive.","commit.placeholder":"Commit message","commit.commit":"Commit","commit.amend":"Amend previous commit","commit.edit":"Edit commit message","commit.collapse":"Collapse commit editor","commit.suggest":"AI suggest","commit.ai":"AI","commit.suggesting":"Generating\u2026","commit.suggestOverwrite":'Click "AI suggest" again to replace the current message',"commit.suggestTruncated":"The diff was truncated; the suggestion may be incomplete","commit.publish":"Publish Branch","commit.publishTitle":"The remote has no such branch yet: create a same-named remote branch and set it as upstream (git push -u)","diff.unified":"Unified","diff.split":"Split","diff.before":"Before","diff.after":"After","diff.binary":"Binary file \u2014 no diff to show","diff.tooLarge":"Image too large to compare","diff.imageMissing":"Does not exist","diff.svgRender":"Rendered","diff.svgSource":"Source","diff.empty":"No differences","diff.expandAll":"Expand all","diff.collapse":"Collapse unchanged","diff.expandGap":"Expand all {n} lines","diff.expandUp":"Expand up {n} lines","diff.expandDown":"Expand down {n} lines","diff.expandCapped":"Large file: expanded {n} lines of context; the rest stays collapsed and can be expanded in place","diff.truncated":"git output exceeded the output cap: only the tail of this diff survived, so the opening changes and the +/- counts may be missing","time.justNow":"just now","time.minutesAgo":"{n}m ago","time.hoursAgo":"{n}h ago","time.daysAgo":"{n}d ago","error.generic":"Operation failed","error.notARepo":"Not a Git repository","error.noCwd":"This session has no working directory","error.localChangesBlock":"Local changes block this operation","error.emptyMessage":"Commit message cannot be empty","error.nothingToCommit":"Nothing to commit: stage the changes first, or select files that have changes in the list","error.timeout":"Git operation timed out: the command did not finish within the limit","error.cancelled":"Operation cancelled","error.invalidPath":"Invalid path: outside the repository or unsupported","error.emptyDiff":"No changes to summarize","error.llmUnavailable":"AI service unavailable","error.llmFailed":"AI generation failed","error.suggestDisabled":"AI suggest is turned off in the plugin config","error.conflict":"Applying the stash produced conflicts; the stash entry is kept \u2014 resolve them and retry","error.revertConflict":"The revert would conflict with the current content; it was cancelled automatically (your working tree is unchanged)","error.revertStuck":"The revert conflicted and could not be auto-cancelled; the repository is mid-revert \u2014 run `git revert --abort` or resolve it manually","error.revertMerge":"This is a merge commit; the panel cannot revert it (a mainline parent is required) \u2014 use `git revert -m` on the command line","error.indexBusy":"Git is busy (another process holds the index lock); try again shortly","error.notFound":"Target not found (the branch / tag / stash may have been removed or renamed)","error.branchInUse":"That branch is checked out in another worktree, so it cannot be switched to here","error.nestedRepo":"That entry is a Git repository itself (a nested repo or a submodule): discarding it would delete the whole inner repository. Do it from a terminal instead","error.nestedRepoPartial":"That entry is a Git repository itself (a nested repo or a submodule), so it was not deleted \u2014 but earlier entries in this batch already were. Refresh to see what is left, and handle this one from a terminal","error.statusLossy":"Git output exceeded the limit, so the full change set cannot be confirmed; \u201CDiscard all\u201D was cancelled \u2014 refresh and retry, or discard selectively","error.stashSwitchFailed":"The uncommitted changes were stashed (restore them from Changes \u2192 Stash), but the switch failed: {reason}","error.invalidName":"Invalid name","error.notFastForward":"Local and remote have diverged \u2014 a fast-forward pull is not possible; merge or rebase manually","error.pushRejected":"Push rejected: the remote has new commits \u2014 run \u201CCheck sync\u201D and pull first, then push","error.authFailed":"Authentication failed: no usable git credentials (HTTPS needs a credential helper, SSH needs a key). Push once from the command line first to cache them","error.noBranch":"HEAD is not on a branch (detached, or no commits yet), so there is no branch to publish: switch to a branch and commit first","status.openRepo":"Open the repository home in the browser","status.openRepoOn":"Open the repository home on {host}","status.synced":"Up to date with remote","status.ahead":"{n} ahead","status.behind":"{n} behind","status.diverged":"Diverged ({ahead} ahead / {behind} behind)","status.noUpstream":"No upstream branch","status.detached":"Detached HEAD \u2014 no branch sync state","status.check":"Check sync status","status.checkTitle":"Check sync with the remote: runs git fetch to update refs and refresh the ahead/behind counts; your working tree is untouched","status.pull":"Pull","status.pulling":"Syncing\u2026","status.pullTitle":"Fast-forward pull of remote updates","status.pullConfirmTitle":"Pull remote updates","status.pullConfirmBody":"Fast-forwards the current branch {branch} to the latest remote commit ({behind} behind). Only possible when not diverged; it creates no merge commit and leaves your uncommitted work untouched.","status.pullConfirm":"Pull","status.pullScope":"Brings in {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pullScopeLoading":"Measuring incoming changes\u2026","status.push":"Push","status.pushTitle":"Push local commits to the remote","status.pushConfirmTitle":"Push to remote","status.pushConfirmBody":"Pushes the {ahead} commits that {branch} is ahead of the remote to its upstream. Fast-forward only \u2014 it never force-overwrites remote history.","status.pushConfirm":"Push","status.pushing":"Pushing\u2026","status.pushScope":"Pushes {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pushScopeLoading":"Measuring outgoing changes\u2026","status.publish":"Publish","status.publishTitle":"Publish the branch and set its upstream","status.publishConfirmTitle":"Publish branch to remote","status.publishConfirmBody":"The current branch {branch} has no upstream yet. This runs git push -u {remote} to create a same-named branch on the remote and set it as the upstream.","status.publishConfirm":"Publish","status.publishing":"Publishing\u2026","cfg.title":"Input-bar branch marker","cfg.toggle":"Show input-bar marker","cfg.hint":"When on, the input bar shows the zsh-style <repo> (branch) marker; when off, a status dot appears beside the Git tab instead. Saved changes apply immediately.","cfg.diffTitle":"Default diff view","cfg.diffHint":"Choose the layout diffs open with: unified is a single inline column, split is side-by-side. You can still switch per diff. Saved changes apply immediately.","cfg.diffUnified":"Unified (single inline column)","cfg.diffSplit":"Split (side-by-side)","cfg.graphTitle":"Commit graph line style","cfg.graphHint":"Choose how the commit graph draws its lines: parallel is the VSCode / GUI style \u2014 each branch keeps its own column and a shared ancestor shows as parallel lines; compact is the git log style \u2014 a shared ancestor merges into one column with fewer lines. Saved changes apply immediately.","cfg.graphParallel":"Parallel (VSCode style)","cfg.graphCompact":"Compact (git log style)","cfg.fontTitle":"Panel font size","cfg.fontSmaller":"Smaller (A\u2212)","cfg.fontDefault":"Default (A)","cfg.fontLarger":"Larger (A+)","cfg.fontHint":"Scales all text inside the Git panel; the wide-layout A\u2212/A/A+ stepper stays in sync.","cfg.suggestTitle":"AI commit message","cfg.suggestToggle":"Show AI suggest button in the commit box","cfg.suggestLangLabel":"Language","cfg.suggestLangAuto":"Auto","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"Auto follows the language you write commits in for this repository (recency-weighted, with the current git author preferred, ignoring mechanical commits such as releases and merges); \u4E2D\u6587 / English pin it.","cfg.suggestMaxBytesLabel":"Input budget","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"Diff bytes sent to the model; beyond it the diff is truncated. Range 16\u2013512.","cfg.suggestOutputLabel":"Output limit","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"Model generation budget; reasoning tokens count against it on thinking models. Range 256\u201316384.","cfg.suggestTimeoutLabel":"Generation timeout","cfg.suggestTimeoutUnit":"s","cfg.suggestTimeoutHint":"Generation fails after the timeout. Range 5\u2013120.","cfg.suggestModelLabel":"Model","cfg.suggestModelSession":"Follow session default","cfg.suggestModelLoading":"Loading model list\u2026","cfg.suggestModelEmpty":"No models detected \u2014 configure one in DSH Settings first","cfg.suggestModelFailed":"Failed to load the model list","cfg.suggestModelRetry":"Retry","cfg.suggestProviderLabel":"Provider","cfg.suggestModelPick":"Select a model","cfg.suggestEffortLabel":"Reasoning effort","cfg.suggestEffortUnset":"Not set (model default)","cfg.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the repository\u2019s existing commit style, filled in for you to edit before committing. A fixed model sends the diff to that model\u2019s provider; "Follow session default" uses the current session\u2019s Agent model. Saved changes apply immediately.',"cfg.notLoaded":"Config not loaded: it is served by the running host. Restart DSH if this stays blank.","cfg.saveFailed":"Save failed, please retry"};var Kn=require("react");function Gs(e=()=>typeof document>"u"?void 0:document){let t=new Set,n,r=!0,i=()=>e()?.hidden!==!0,a=()=>{let o=i();if(o!==r){r=o;for(let s of[...t])s()}};return{isVisible:i,subscribe(o){return t.size===0&&(n=e(),r=i(),n?.addEventListener("visibilitychange",a)),t.add(o),()=>{t.delete(o),t.size===0&&(n?.removeEventListener("visibilitychange",a),n=void 0)}}}}var ht=Gs();var Ps=new Set(["cwd-unavailable"]),Xi=3e4,Rs=6e4,or=class{constructor(t,n,r=ht){this.remote=t;this.sessionId=n;this.visibility=r;this.unsubscribeVisibility=r.subscribe(()=>{this.disposed||(this.visibilityGeneration+=1,this.publish(this.view,this.unreadySignal()),r.isVisible()?this.refresh():this.clearPoll())})}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=Xi;unsubscribeVisibility;visibilityGeneration=0;requestGeneration=0;querySignal={tick:0,sampledAt:0,ready:!1,root:null};queryListeners=new Set;fullChanges=!1;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}subscribeQueries(t){return this.queryListeners.add(t),()=>{this.queryListeners.delete(t)}}getQuerySignal(){return this.querySignal}ensure(){this.inflight!==void 0||this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){if(this.disposed)return Promise.resolve();if(!this.visibility.isVisible())return this.pendingRefresh=!0,this.clearPoll(),Promise.resolve();if(this.inflight!==void 0)return this.pendingRefresh=!0,this.inflight.then(()=>this.inflight);this.pendingRefresh=!1,this.clearPoll();let t=this.visibilityGeneration,n=this.requestGeneration;return this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId,...this.fullChanges?{fullChanges:!0}:{}}).then(r=>{if(!(this.disposed||n!==this.requestGeneration)){if(r.ok)this.publishSnapshot(r.value,t,!1);else if(r.error.code!=="cancelled")if(Ps.has(r.error.code))this.pollMs=Rs,this.setView({state:"no-cwd"});else if(r.error.code==="not-a-git-repo"){let i=r.error;this.setView({state:"error",error:{code:"not-a-git-repo",...i.cwd?{cwd:i.cwd}:{},...i.showInputPill!==void 0?{showInputPill:i.showInputPill}:{}}})}else if(r.error.code==="git-unavailable"){let i=r.error;this.setView({state:"error",error:{code:"git-unavailable",...i.detail?{detail:i.detail}:{},...i.cwd?{cwd:i.cwd}:{},...i.isGitRepo!==void 0?{isGitRepo:i.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:r.error.code,..."detail"in r.error?{detail:r.error.detail}:{}}})}}).catch(r=>{this.disposed||n!==this.requestGeneration||this.setView({state:"error",error:{code:"git-unavailable",detail:r instanceof Error?r.message:String(r)}})}).finally(()=>{this.inflight=void 0,!(this.disposed||!this.visibility.isVisible())&&(this.pendingRefresh?this.refresh():this.schedulePoll())}),this.inflight}resync(){this.disposed||(this.requestGeneration+=1,this.refresh())}setFullChanges(t){return this.disposed?Promise.resolve():(this.fullChanges=t,this.requestGeneration+=1,this.refresh())}accept(t){this.disposed||(this.requestGeneration+=1,this.pendingRefresh=!1,this.publishSnapshot(t,this.visibilityGeneration,!0),this.schedulePoll())}publishSnapshot(t,n,r){this.pollMs=t.refreshIntervalMs||Xi;let i=this.view.state==="ready"?this.view.snapshot:null,a=!r&&i!==null&&t.root===i.root&&t.stateFingerprint!==void 0&&t.stateFingerprint===i.stateFingerprint,o={tick:this.querySignal.tick+1,sampledAt:t.checkedAt,ready:this.visibility.isVisible()&&n===this.visibilityGeneration,root:t.root};this.publish(a?this.view:{state:"ready",snapshot:t},o)}unreadySignal(){return this.querySignal.ready?{...this.querySignal,ready:!1}:this.querySignal}clearPoll(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}schedulePoll(){this.clearPoll(),!(this.disposed||!this.visibility.isVisible()||this.inflight!==void 0||this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.timer=void 0,this.refresh()},this.pollMs))}setView(t){this.publish(t,this.unreadySignal())}publish(t,n){let r=t!==this.view,i=n!==this.querySignal;if(this.view=t,this.querySignal=n,r)for(let a of this.listeners)a();if(i)for(let a of this.queryListeners)a()}dispose(){this.disposed=!0,this.clearPoll(),this.unsubscribeVisibility(),this.pendingRefresh=!1,this.listeners.clear(),this.queryListeners.clear()}};var sr=require("react"),ti={tick:0,sampledAt:0,ready:!1,root:null};function Ls(e,t){let[n,r]=(0,sr.useState)(()=>e?.getQuerySignal()??ti);return(0,sr.useEffect)(()=>{if(e===void 0){r(ti);return}let i=()=>r(e.getQuerySignal());if(!t){i();return}let a=e.subscribeQueries(i);return i(),a},[e,t]),t?e?.getQuerySignal()??ti:n}function $i(e,t,n){let r=Ls(e,t);return{signal:r,queryVisible:t&&r.ready&&r.root===n,queryKey:[r.root,r.tick]}}var As="/api",Ds="gitPanel";function Fs(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,i,a)=>n.call(t,As,r,i,a)}catch{}}function zs(e){let t=e;if(t===null||typeof t!="object")return{ok:!1,error:{code:"git-unavailable",message:"malformed rpc result"}};if(t.ok!==!0){let n=t.error;return{ok:!1,error:{code:typeof n?.code=="string"?n.code:"git-unavailable",message:typeof n?.message=="string"?n.message:void 0}}}return t.value===void 0?{ok:!1,error:{code:"git-unavailable",message:"missing value"}}:t.value}function _e(e,t){return!e.ok||e.value.kind!==t?null:e.value}function It(e){return e!==void 0&&e!==""}var Ki=new WeakMap;function pn(e){let t=Ki.get(e);if(t!==void 0)return t;let n=async(i,a,o)=>{let s=Fs(e);if(s===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await s(`${Ds}/${i}`,{args:{request:a}},o);return zs(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},r={snapshot:(i,a)=>n("snapshot",i,a),run:(i,a)=>n("run",i,a),query:(i,a)=>n("query",i,a),suggest:(i,a)=>n("suggest",i,a),version:(i,a)=>n("version",i,a),openFile:(i,a)=>n("openFile",i,a)};return Ki.set(e,r),r}var Vt=new Map,Ji,ni;function ji(e){ni=e,Ji=pn(e)}function tn(e){let t=Vt.get(e);if(t===void 0){let n=Ji??(ni?pn(ni):void 0);t=new or(n??Bs(),e),Vt.set(e,t)}return t}var Hs=6e4,Sn=new Map;function Vi(e){let t=Sn.get(e);t!==void 0&&(clearTimeout(t),Sn.delete(e)),un.set(e,(un.get(e)??0)+1)}function qi(e,t){if(Vt.get(e)!==t)return;let n=(un.get(e)??1)-1;if(n>0){un.set(e,n);return}un.delete(e);let r=setTimeout(()=>{Vt.get(e)===t&&(Sn.delete(e),!((un.get(e)??0)>0)&&(t.dispose(),Vt.delete(e)))},Hs);Sn.set(e,r)}var un=new Map;function Jn(){for(let e of Vt.values())e.resync()}function Ui(){for(let e of Vt.values())e.dispose();Vt.clear();for(let e of Sn.values())clearTimeout(e);Sn.clear(),un.clear()}function Bs(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e,openFile:e}}function lr(e,t,n){let r=e?t?tn(e):Vt.get(e):void 0,i=$i(r,t,n);return(0,Kn.useEffect)(()=>{if(!(!t||r===void 0||e===void 0))return Vi(e),r.ensure(),()=>qi(e,r)},[r,e,t]),i}function dr(e){let[,t]=(0,Kn.useState)(0),n=e?tn(e):void 0,r=n?n.getSnapshot():{state:"cold"};return(0,Kn.useEffect)(()=>{if(n===void 0||e===void 0)return;Vi(e);let i=n.subscribe(()=>t(a=>a+1));return n.getSnapshot()!==r&&t(a=>a+1),n.ensure(),()=>{i(),qi(e,n)}},[n,e]),r}var K=require("react"),ws=require("@deepseek-ai/dsh-client-ui-primitives");var Wi="[data-conversation-tabs]",Vn='[data-conversation-tabs] button[role="tab"]',ri=new Map,jn=new Map;function Qi(e,t){let n=jn.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}ri.set(e,t)}function Yi(e){let t=ri.get(e);return t===void 0?null:(ri.delete(e),t)}function Zi(e,t){let n=jn.get(e);return n===void 0&&(n=new Set,jn.set(e,n)),n.add(t),()=>{let r=jn.get(e);r!==void 0&&(r.delete(t),r.size===0&&jn.delete(e))}}var Is=6e4,ii=new Map;function ea(e,t){ii.set(e,{tab:t,leftAt:Date.now()})}function ta(e){let t=ii.get(e);return t===void 0?null:Date.now()-t.leftAt>Is?(ii.delete(e),null):t.tab}function na(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function ra(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function ia(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var u=require("react"),Hr=require("react-dom"),yi=require("@deepseek-ai/dsh-client-ui-primitives");var cr=require("react"),aa=require("@deepseek-ai/dsh-client-ui-primitives");function qn(e,t,n,r={}){let i=r.extraClass===void 0?"gp-select-trigger":`gp-select-trigger ${r.extraClass}`;return(0,cr.createElement)("button",{type:"button",className:i,"aria-haspopup":"menu","aria-expanded":e,title:t,disabled:r.disabled,onClick:n},[(0,cr.createElement)("span",{key:"l",className:"gp-select-trigger__label"},t),(0,cr.createElement)(aa.IconChevronDownOutlineRegular,{key:"c",className:"gp-select-trigger__chevron",size:14})])}var P=require("react"),Os="M2 7V3h4l8 8-4 4z",oa="M8 1.8l1.76 3.57 3.94.57-2.85 2.78.67 3.92L8 10.78l-3.52 1.85.67-3.92L2.3 5.94l3.94-.57z";function Se(e,t=15,n=!1){return(0,P.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round",...n?{"aria-hidden":!0}:{}},e)}function pr({size:e}){return Se([(0,P.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,P.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,P.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function sa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M4 2v8"}),(0,P.createElement)("path",{key:"b",d:"M2 4h4"}),(0,P.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,P.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,P.createElement)("path",{key:"e",d:"M12 6v4"}),(0,P.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function ai({size:e}){return Se([(0,P.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,P.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,P.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,P.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,P.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function la(e,t=!1){return Se([(0,P.createElement)("path",{key:"a",d:Os}),(0,P.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e,t)}function Cn({size:e}){return la(e)}function qt({size:e,open:t}){return Se([(0,P.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function yt({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function oi({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 6V2h4"}),(0,P.createElement)("path",{key:"b",d:"M10 2h4v4"}),(0,P.createElement)("path",{key:"c",d:"M14 10v4h-4"}),(0,P.createElement)("path",{key:"d",d:"M6 14H2v-4"})],e)}function da({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M6 2v4H2"}),(0,P.createElement)("path",{key:"b",d:"M14 6h-4V2"}),(0,P.createElement)("path",{key:"c",d:"M10 14v-4h4"}),(0,P.createElement)("path",{key:"d",d:"M2 10h4v4"})],e)}function ca({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 3.5h12"}),(0,P.createElement)("path",{key:"b",d:"M2 7.5h12"}),(0,P.createElement)("path",{key:"c",d:"M2 11.5h7"}),(0,P.createElement)("path",{key:"d",d:"M2 11.5c0 2 1.5 3 3.5 3H10"})],e)}function Tn({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,P.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function pa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function ua({size:e}){return Se([(0,P.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,P.createElement)("path",{key:"plus",d:"M11 8v6M8 11h6"})],e,!0)}function ga({size:e}){return Se([(0,P.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,P.createElement)("path",{key:"minus",d:"M8 11h6"})],e,!0)}function nn({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,P.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function si({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M8 2.6l1.4 4 4 1.4-4 1.4-1.4 4-1.4-4-4-1.4 4-1.4z"}),(0,P.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function fa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,P.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function ma({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 12.5V3.5h4l1.5 2H14v7z"})],e)}function ur({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,P.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,P.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function Un({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,P.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,P.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function ha({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,P.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,P.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"}),(0,P.createElement)("path",{key:"d",d:"M1.5 6.5h1.2"}),(0,P.createElement)("path",{key:"e",d:"M13.3 6.5h1.2"})],e)}function ya({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,P.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function gr({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M13 3v10"}),(0,P.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function ba({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,P.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,P.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function va({size:e=15}){return(0,P.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,P.createElement)("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"}))}function wa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,P.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,P.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function gn({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,P.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,P.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function xa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,P.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,P.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,P.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function ka({size:e}){return Se([(0,P.createElement)("circle",{key:"a",cx:8,cy:8,r:6}),(0,P.createElement)("path",{key:"b",d:"M8 7.2v3.6"}),(0,P.createElement)("circle",{key:"c",cx:8,cy:5.2,r:.5,fill:"currentColor",stroke:"none"})],e)}function _a({size:e=15,filled:t}){return(0,P.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},(0,P.createElement)("path",{d:oa}))}function Sa({size:e}){return la(e,!0)}function Ca({size:e=15}){return(0,P.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},(0,P.createElement)("path",{d:oa}))}function Ta({size:e,direction:t}){let n=e??15,r=t==="ahead"?"M4.5 11.5L11.5 4.5":"M11.5 4.5L4.5 11.5",i=t==="ahead"?"M6.5 4.5h5v5":"M9.5 11.5h-5v-5";return(0,P.createElement)("svg",{className:"gp-branch-row__sync-icon","data-direction":t,width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},[(0,P.createElement)("path",{key:"a",d:r}),(0,P.createElement)("path",{key:"b",d:i})])}function Ea(e){let t=0;for(let n of e){t=Math.max(t,n.lane+1);for(let r of n.edges)t=Math.max(t,r.fromLane+1,r.toLane+1)}return t}function fr(e,t,n){let r=[],i=[],a=[],o=[],s=[],l=0,d=()=>{if(s.length===0)return l++;let x=Math.min(...s);return s.splice(s.indexOf(x),1),x},p=x=>{x!==null&&!s.includes(x)&&s.push(x)},f=(x,h)=>{let b=i.findIndex(v=>v===null);return b===-1&&(b=i.length,i.push(null),a.push(null),o.push(!1)),i[b]=x,a[b]=d(),o[b]=h,b},g=x=>i.findIndex(h=>h===x),k=(x,h)=>{let b=i.findIndex((v,C)=>v===x&&o[C]===h);return b===-1?f(x,h):b},c=(x,h,b,v,C)=>C?{fromLane:x,toLane:h,color:b,kind:v,indirect:!0}:{fromLane:x,toLane:h,color:b,kind:v};for(let x=0;x<e.length;x++){let h=e[x],b=n===void 0?void 0:n[x],v=b===void 0?h.parents.length:b.length,C=N=>b===void 0?h.parents[N]:b[N].hash,E=N=>b!==void 0&&b[N].indirect,B=g(h.hash),H=B!==-1,F=B===-1?f(h.hash,!1):B,ee=a[F],q=[...i],W=[...a],j=[...o],Q=h.parents.length>=2;for(let N=0;N<i.length;N++)N!==F&&i[N]===h.hash&&(p(a[N]),i[N]=null,a[N]=null);let te=-1,re=[];if(v===0)p(a[F]),i[F]=null,a[F]=null;else{let N=C(0),se=E(0),ce=t==="compact"?i.findIndex((ie,le)=>ie===N&&le!==F&&o[le]===se):-1;if(ce===-1)i[F]=N,o[F]=se,te=F;else{let ie=Math.min(F,ce),le=Math.max(F,ce);i[ie]=N,o[ie]=se,p(a[le]),i[le]=null,a[le]=null,te=ie}for(let ie=1;ie<v;ie++)re.push(k(C(ie),E(ie)))}let de=[];for(let N=0;N<q.length;N++){let se=q[N];if(se!==null)if(se===h.hash){if(N===F&&!H)continue;de.push(c(N,F,W[N],"into",j[N]))}else{let ce=i[N]===se?N:i.findIndex((ie,le)=>ie===se&&o[le]===j[N]);ce!==-1&&de.push(c(N,ce,W[N],"pass",j[N]))}}te!==-1&&de.push(c(F,te,a[te],"out",o[te]));for(let N of re)de.push(c(F,N,a[N],"out",o[N]));for(r.push({commit:h,lane:F,color:ee,edges:de,merge:Q});i.length>0&&i[i.length-1]===null;)i=i.slice(0,-1),a=a.slice(0,-1),o=o.slice(0,-1)}return r}var Na=4096,Xs=1e6,$s=1e5;function Ma(e,t,n){let r=new Map;for(let c of t)r.set(c.hash,c.parents);let i=new Map;e.forEach((c,x)=>i.set(c.hash,x));let a=Math.min(Na,i.size),o=new Map,s=0,l=c=>{let x=o.get(c);if(x!==void 0)return x;let h=[{hash:c,expanded:!1}],b=new Set,v=[];for(;h.length>0;){let C=h[h.length-1];if(!C.expanded){C.expanded=!0,b.add(C.hash);let E=r.get(C.hash);for(let B=E.length-1;B>=0;B--){let H=E[B];i.has(H)||!r.has(H)||b.has(H)||o.has(H)||h.push({hash:H,expanded:!1})}continue}v.push(C.hash),h.pop()}for(let C of v){if(o.has(C))continue;let E=r.get(C),B,H=E.length>0;for(let j of E){if(i.has(j)){H=!1;break}let Q=o.get(j);if(Q===void 0){H=!1;break}if(B===void 0)B=Q;else if(B!==Q){H=!1;break}}if(H&&B!==void 0){o.set(C,B);continue}let F=[],ee=new Set,q=!1,W=j=>{if(!ee.has(j)){if(F.length>=a||s>=Xs){q=!0;return}ee.add(j),F.push(j),s++}};for(let j of E){if(i.has(j)){W(j);continue}let Q=o.get(j);if(Q===void 0){q=!0;continue}for(let te of Q.ancestors)W(te);Q.unknown&&(q=!0)}o.set(C,{ancestors:F,unknown:q})}return o.get(c)},d=Na,p=$s,f=[],g=[];for(let c=0;c<e.length;c++){let h=e[c].parents,b=[],v=new Map,C=!1,E=H=>{let F=i.get(H);return F!==void 0&&F>c},B=(H,F)=>{let ee=v.get(H);if(ee===void 0){let q=i.get(H)-c+1;if(d===0||p<q){C=!0;return}d--,p-=q,v.set(H,b.length),b.push({hash:H,indirect:F})}else!F&&b[ee].indirect&&(b[ee]={hash:H,indirect:!1})};for(let H of h){if(i.has(H)){E(H)?B(H,!1):C=!0;continue}if(!r.has(H)){C=!0;continue}let F=l(H);(F.ancestors.length===0||F.unknown)&&(C=!0);for(let ee of F.ancestors)E(ee)?B(ee,!0):C=!0}f.push(b),g.push(C)}let k=fr(e,n,f);return g.some(c=>c)?k.map((c,x)=>g[x]===!0?{...c,boundary:!0}:c):k}var Ct=require("react"),fn=14,mr=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function Ga({row:e,laneCount:t,rowH:n,current:r}){let i=(0,Ct.useId)(),a=Math.max(fn,t*fn),o=p=>p*fn+fn/2,s=n/2,l=mr[e.color%mr.length],d=e.edges.map(p=>{let f=p.kind==="out"?s:0,g=p.kind==="into"?s:n,k=(f+g)/2;return(0,Ct.createElement)("path",{key:`${p.kind}-${p.fromLane}-${p.toLane}-${p.color}`,className:"gp-graph-edge",d:`M ${o(p.fromLane)} ${f} C ${o(p.fromLane)} ${k}, ${o(p.toLane)} ${k}, ${o(p.toLane)} ${g}`,stroke:mr[p.color%mr.length],strokeWidth:1.6,fill:"none",...p.indirect?{strokeDasharray:"7 5","data-indirect":"true"}:{}})});if(e.boundary){let p=o(e.lane)+(e.edges.some(f=>f.kind==="out")?5:0);d.push((0,Ct.createElement)("path",{key:"boundary",className:"gp-graph-boundary",d:`M ${o(e.lane)} ${s} L ${p} ${s+7} V ${Math.min(n-3,s+13)}`,stroke:l,strokeWidth:1.6,strokeDasharray:"3 3",fill:"none"}))}return(0,Ct.createElement)("svg",{className:"gp-graph-svg",width:a,height:n,"aria-hidden":!0},[r?(0,Ct.createElement)("defs",{key:"defs"},(0,Ct.createElement)("mask",{id:i,maskUnits:"userSpaceOnUse",x:0,y:0,width:a,height:n},[(0,Ct.createElement)("rect",{key:"area",x:0,y:0,width:a,height:n,fill:"white"}),(0,Ct.createElement)("circle",{key:"hole",cx:o(e.lane),cy:s,r:6.2,fill:"black"})])):null,(0,Ct.createElement)("g",{key:"edges",...r?{mask:`url(#${i})`}:{}},d),(0,Ct.createElement)("circle",{key:"node",className:`gp-graph-node${r?" gp-graph-node--current":""}`,cx:o(e.lane),cy:s,r:r?5.2:e.merge?4:3.2,fill:r?"none":l,stroke:r?l:"var(--dsw-alias-bg-layer-1)",strokeWidth:r?2:1}),r?(0,Ct.createElement)("circle",{key:"head-dot",className:"gp-graph-node__dot",cx:o(e.lane),cy:s,r:2.2,fill:l}):null])}function Ks(e){return/^[0-9a-fA-F]{7,40}$/.test(e.trim())}function li(e){let t=e.search?.trim()??"";return!Ks(t)&&(t!==""||(e.author??"")!==""||(e.since??"")!=="")}var hr=10*1024*1024,Tt={maxBytes:{min:16*1024,max:512*1024,default:200*1024},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},yr=["auto","zh","en"],di="auto",Js={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff"};function Wn(e){let t=e.lastIndexOf(".");return t<0?null:Js[e.slice(t+1).toLowerCase()]??null}function br(e){let t=[],n=new Set;for(let a of e){let o=a.name.split("/").filter(l=>l!=="");if(o.length===0)continue;t.push({segments:o,branch:a});let s="";for(let l=0;l<o.length-1;l++)s=s===""?o[l]:`${s}/${o[l]}`,n.add(s)}let r=new Map,i=[];for(let{segments:a,branch:o}of t){let s=a.join("/"),l=n.has(s),d=i,p="";for(let f=0;f<a.length;f++){let g=a[f];p=p===""?g:`${p}/${g}`;let k=f===a.length-1;if(k&&!l){d.push({kind:"leaf",label:g,path:s,branch:o});break}let c=r.get(p);c===void 0&&(c={kind:"dir",label:g,path:p,self:null,children:[]},r.set(p,c),d.push(c)),k?c.self=o:d=c.children}}return Pa(i)}function Pa(e){return e.map(t=>{if(t.kind==="leaf")return t;let n=t;for(;;){let r=n.children.length===1?n.children[0]:void 0;if(n.self!==null||r===void 0||r.kind!=="dir")break;n={kind:"dir",label:`${n.label}/${r.label}`,path:r.path,self:r.self,children:r.children}}return{kind:"dir",label:n.label,path:n.path,self:n.self,children:Pa(n.children)}})}function Ra(e,t){let n=r=>e.some(i=>i.name===r);return t!==null&&n(t)?t:n("main")?"main":n("master")?"master":null}function La(e,t){if(t===null)return e;let n=e.findIndex(r=>r.name===t);return n<=0?e:[e[n],...e.slice(0,n),...e.slice(n+1)]}function Aa(e,t,n){if(t===null)return null;let r=n===null?["main","master"]:[n,"main","master"];for(let i of r){let a=`${t}/${i}`;if(e.some(o=>o.name===a))return a}return null}function Da(e,t,n){let r=[],i=o=>{if(o===null||r.some(l=>l.name===o))return;let s=e.find(l=>l.name===o);s!==void 0&&r.push(s)};i(t),i(n);let a=new Set(r.map(o=>o.name));return{pinned:r,nodes:br(e.filter(o=>!a.has(o.name)))}}function Fa(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(o=>o!==""),i=t,a="";for(let o=0;o<r.length;o++){let s=r[o];a=a===""?s:`${a}/${s}`;let l=o===r.length-1,d=i.children.find(p=>p.name===s&&p.dir===!l);d===void 0&&(d={name:s,path:a,dir:!l,children:[],...l?{meta:n.meta}:{}},i.children.push(d)),i=d}}return za(t),Ha(t.children)}function za(e){e.children.sort((t,n)=>t.dir!==n.dir?t.dir?-1:1:t.name.localeCompare(n.name));for(let t of e.children)za(t)}function Ha(e){return e.map(t=>{if(!t.dir)return t;let n=t;for(;n.children.length===1&&n.children[0].dir;){let r=n.children[0];n={name:`${n.name}/${r.name}`,path:r.path,dir:!0,children:r.children}}return{...n,children:Ha(n.children)}})}function rn(e,t,n){if(e===null)return"";let r=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(r))return"";let i=Math.max(0,t-r),a=Math.floor(i/6e4);if(a<1)return n("time.justNow");if(a<60)return n("time.minutesAgo",{n:a});let o=Math.floor(a/60);if(o<24)return n("time.hoursAgo",{n:o});let s=Math.floor(o/24);return n("time.daysAgo",{n:s})}function Qn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Yn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var vr={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function Nn(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}function Ba(e,t){return e.some(n=>n.status==="untracked"&&(n.isDirectory?t.startsWith(`${n.path}/`):n.path===t))}var L=require("react");function Ia(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function Oa(e){return Wn(e)!==null}function Xa(e){return/\.svg$/i.test(e)}function js(e){let t=e.split(`
|
|
908
|
+
`),n=[],r=!1;for(let i of t){if(i.startsWith("@@")){r=!0;continue}if(r){if(i.startsWith("diff ")||i.startsWith("index ")){r=!1;continue}i!==""&&n.push(i)}}return n}function $a(e){let t=0,n=0;for(let r of js(e))r.startsWith("+")?t++:r.startsWith("-")&&n++;return{add:t,del:n}}var Vs=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function Ka(e,t){let n=[],r=e.split(`
|
|
909
|
+
`),i=Number.isFinite(t)&&t>0?t:0,a=0,o=0,s=!0,l=!1,d=0;for(;d<r.length&&!r[d].startsWith("@@");d++);for(;d<r.length;d++){let f=r[d];if(f.startsWith("@@")){let c=Vs.exec(f);if(c){let x=Number(c[1]),h=Number(c[3]),b=x-h;if(s)h>1&&n.push(mn({rightStart:1,count:h-1,delta:b,atStart:!0}));else{let v=h-o;v>0&&n.push(mn({rightStart:o,count:v,delta:b,atStart:!1}))}a=x,o=h,s=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:f});continue}if(f.startsWith("\\"))continue;let g=f[0],k=f.slice(1);g==="+"?(n.push({kind:"add",leftNo:null,rightNo:o,leftText:null,rightText:k}),o++,l=!0):g==="-"?(n.push({kind:"del",leftNo:a,rightNo:null,leftText:k,rightText:null}),a++,l=!0):g===" "&&(n.push({kind:"context",leftNo:a,rightNo:o,leftText:k,rightText:k}),a++,o++,l=!0)}let p=i-o+1;return l&&!s&&o>0&&p>0&&n.push(mn({rightStart:o,count:p,delta:a-o,atStart:!1})),qs(n)}function Ja(e,t){let n=e[e.length-1],r=n!==void 0&&n.kind==="gap",i=r?n.gap:void 0,a=r?e[e.length-2]:n,o=a===void 0?null:a.rightNo,s=o!==null&&o>0?o:0,l=Number.isFinite(t)?t-s:0,d=l>0?l:0;if(i===void 0){if(d===0||s===0)return e;let p=a===void 0?null:a.leftNo;return p===null?null:[...e,mn({rightStart:s+1,count:d,delta:p-s,atStart:!1})]}return i.rightStart===s+1&&i.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),mn({rightStart:s+1,count:d,delta:i.delta,atStart:!1})]}function mn(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function qs(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let i=[],a=n;for(;a<e.length&&e[a].kind==="del";)i.push(e[a]),a++;let o=[];for(;a<e.length&&e[a].kind==="add";)o.push(e[a]),a++;let s=Math.max(i.length,o.length);for(let l=0;l<s;l++){let d=i[l],p=o[l];if(d&&p){let f=Us(d.leftText??"",p.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:p.rightNo,leftText:d.leftText,rightText:p.rightText,...f!==null?{leftWord:f.left,rightWord:f.right}:{}})}else d?t.push({kind:"del",leftNo:d.leftNo,rightNo:null,leftText:d.leftText,rightText:null}):p&&t.push({kind:"add",leftNo:null,rightNo:p.rightNo,leftText:null,rightText:p.rightText})}n=a}else t.push(r),n++}return t}function Us(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=0;for(;i<n-r&&e[e.length-1-i]===t[t.length-1-i];)i++;return r===0&&i===0?null:{left:[r,e.length-i],right:[r,t.length-i]}}function Ws(e,t,n){return n.map((r,i)=>{let a=t+i;return{kind:"context",leftNo:a+e,rightNo:a,leftText:r,rightText:r}})}var hn=20;function ja(e){let t=[];for(let n of e)n.kind==="mod"?(t.push({kind:"del",leftNo:n.leftNo,rightNo:null,leftText:n.leftText,rightText:null,...n.leftWord!==void 0?{leftWord:n.leftWord}:{}}),t.push({kind:"add",leftNo:null,rightNo:n.rightNo,leftText:null,rightText:n.rightText,...n.rightWord!==void 0?{rightWord:n.rightWord}:{}})):t.push(n);return t}function Va(e,t,n,r,i,a){let o=e.findIndex(f=>f.kind==="gap"&&f.gap?.rightStart===t);if(o<0)return e.slice();let s=e[o].gap,l=Ws(s.delta,r,i),d=[],p=s.count;if(n==="all"||i.length>=p)d.push(...l);else if(n==="down")d.push(...l),a||d.push(mn({rightStart:s.rightStart+i.length,count:p-i.length,delta:s.delta,atStart:!1}));else{if(i.length===0)return[...e.slice(0,o),...e.slice(o+1)];let f=p-i.length;d.push(mn({rightStart:s.rightStart,count:f,delta:s.delta,atStart:s.atStart})),d.push(...l)}return[...e.slice(0,o),...d,...e.slice(o+1)]}var Rr=require("@deepseek-ai/dsh-client-ui-primitives");function qa(e,t){let n=[[],[],[]],r=0;for(let i of e){let a=r+i.text.length,o=[r,Math.max(r,Math.min(a,t[0])),Math.max(r,Math.min(a,t[1])),a];for(let s=0;s<3;s++){let l=i.text.slice(o[s]-r,o[s+1]-r);l!==""&&n[s].push({text:l,style:i.style})}r=a}return n}function Ua(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.size>=8e3&&t.clear(),t.set(n,r),r}}function Mn(e){let t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t}function Wa(e,t){let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n}function Gn(e,t,n,r){let i=e.length-1;if(i<=0)return{first:0,last:0};let a=Wa(e,t-r),o=Math.min(i,Wa(e,t+n+r)+1);return{first:a,last:o}}function wr(e,t,n,r){return t<0?e:t>=e.first&&t<e.last?{first:Math.min(e.first,Math.max(0,t-r)),last:Math.max(e.last,Math.min(n,t+r))}:{first:Math.max(0,t-r),last:Math.min(n,t+r)}}var yn=require("react");function Pn(){let[e,t]=(0,yn.useState)({top:0,height:0}),n=(0,yn.useRef)(null),r=(0,yn.useRef)(null);return{setEl:(0,yn.useCallback)(a=>{if(r.current!==null&&(r.current(),r.current=null),n.current=a,a===null)return;let o=()=>t(l=>{let d=a.scrollTop,p=a.clientHeight;return l.top===d&&l.height===p?l:{top:d,height:p}});o(),a.addEventListener("scroll",o,{passive:!0});let s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;s?.observe(a),r.current=()=>{a.removeEventListener("scroll",o),s?.disconnect()}},[]),viewport:e,elRef:n}}var bt=require("react"),xr=5e3,kr=120;function _r(e,t){let[n,r]=(0,bt.useState)(e);return(0,bt.useEffect)(()=>{let i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function Sr(e,t){if(t==="")return[];let n=[],r=0;for(;;){let i=e.indexOf(t,r);if(i<0)break;n.push([i,i+t.length]),r=i+t.length}return n}function ci(e,t,n,r,i){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let a=[],o=0,s=0;for(let l of e){let d=o+l.text.length,p=Math.max(n,o),f=Math.min(r,d);if(f>p&&a.push((0,bt.createElement)("span",{key:`${i}-${s++}`,style:l.style},l.text.slice(p-o,f-o))),o=d,o>=r)break}return a}function Cr(e,t,n,r,i,a){let o=[],s=0,l=[...t].sort((d,p)=>d[0]-p[0]);for(let[d,p]of l){if(d<s)continue;d>s&&o.push(...ci(n,e,s,d,`${r}b${s}`));let f=i!==null&&i[0]===d&&i[1]===p;o.push((0,bt.createElement)("mark",{key:`mk${r}-${d}`,className:`gp-find-hit${f?" gp-find-hit--active":""}`,...f?{ref:a}:{}},ci(n,e,d,p,`mk${r}-${d}`))),s=p}return s<e.length&&o.push(...ci(n,e,s,e.length,`${r}e`)),o}function Tr(e){return(0,bt.createElement)("div",{key:"find",className:"gp-find"},[(0,bt.createElement)("input",{key:"in",ref:e.inputRef,className:"gp-find__input",type:"text",placeholder:e.t("files.findPlaceholder"),value:e.query,spellCheck:!1,"aria-label":e.t("files.findPlaceholder"),onChange:t=>e.onChange(t.target.value),onKeyDown:t=>{t.key==="Escape"?(t.preventDefault(),t.stopPropagation(),e.onClose()):t.key==="Enter"&&(t.preventDefault(),e.onStep(t.shiftKey?-1:1))}}),(0,bt.createElement)("button",{key:"case",type:"button",className:`gp-find__btn gp-find__case${e.caseSensitive?" gp-find__case--active":""}`,title:e.t("files.findCase"),"aria-label":e.t("files.findCase"),"aria-pressed":e.caseSensitive,onClick:()=>e.onToggleCase()},"Aa"),(0,bt.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,bt.createElement)("button",{key:"prev",type:"button",className:"gp-find__btn",title:e.t("files.findPrev"),"aria-label":e.t("files.findPrev"),disabled:e.matches===0,onClick:()=>e.onStep(-1)},"\u2039"),(0,bt.createElement)("button",{key:"next",type:"button",className:"gp-find__btn",title:e.t("files.findNext"),"aria-label":e.t("files.findNext"),disabled:e.matches===0,onClick:()=>e.onStep(1)},"\u203A"),(0,bt.createElement)("button",{key:"x",type:"button",className:"gp-find__btn",title:e.t("files.findClose"),"aria-label":e.t("files.findClose"),onClick:()=>e.onClose()},"\u2715")])}var an=require("react");var U=require("react");var Rn=require("react"),Qs='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Er(e,t,n,r){let i=(0,Rn.useRef)(t);(0,Rn.useLayoutEffect)(()=>{i.current=t}),(0,Rn.useEffect)(()=>{let a=document.activeElement instanceof HTMLElement?document.activeElement:null;n?.current?.focus();let o=()=>{let l=e.current;return l===null?[]:[...l.querySelectorAll(Qs)].filter(d=>!d.hasAttribute("disabled")&&d.getClientRects().length>0)},s=l=>{if(l.key==="Escape"){l.stopPropagation(),i.current();return}if(l.key!=="Tab")return;let d=o();if(d.length===0)return;let p=document.activeElement instanceof HTMLElement?document.activeElement:null,f=p===null?-1:d.indexOf(p);l.preventDefault();let g=l.shiftKey?-1:1,k=f===-1?g===-1?d.length-1:0:(f+g+d.length)%d.length;d[k]?.focus()};return window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("keydown",s,!0),(r?.current??a)?.focus()}},[e,n,r])}var ro=require("react-dom");function Ya(e){let t=e.deltaMode===1?8:e.deltaMode===2?24:1;return Math.sign(e.deltaY)*Math.min(24,Math.abs(e.deltaY*t))}function Za(e){let t=Math.sign(e)*Math.min(24,Math.abs(e));return t<=0?1-2*t/100:1/(1+2*t/100)}var Ys=.1,Zs=8,pi=1.25;function eo(e){return Number.isFinite(e)?Math.min(Zs,Math.max(Ys,e)):1}function ui(e,t,n){return(e+t)*n-t}var Qa=3;function to(e,t){return e*e+t*t>=Qa*Qa}function no(e,t,n,r){return{left:e-n,top:t-r}}var el=300;function Zn({src:e,alt:t,t:n,viewportClass:r,fullscreen:i=!0,onEmptyAreaMouseDown:a}){let o=(0,U.useRef)(null),s=(0,U.useRef)(null),l=(0,U.useRef)(null),[d,p]=(0,U.useState)(null),[f,g]=(0,U.useState)("fit"),[k,c]=(0,U.useState)(null),[x,h]=(0,U.useState)(!1),[b,v]=(0,U.useState)(!1),C=(0,U.useRef)("fit"),E=(0,U.useRef)(null),B=(0,U.useRef)(null),H=(0,U.useRef)(null),F=(0,U.useRef)(0),ee=(0,U.useCallback)(()=>{let D=l.current;return D===null||D.naturalWidth===0||D.clientWidth===0?null:D.clientWidth/D.naturalWidth},[]),q=(0,U.useCallback)((D,M,V)=>{let O=s.current,z=l.current;if(O===null||z===null||z.naturalWidth===0||z.clientWidth===0)return;let Y=z.clientWidth/z.naturalWidth,G=eo(D);if(G===Y)return;let S=O.getBoundingClientRect();E.current={x:M-S.left,y:V-S.top,ratio:G/Y},g(G)},[]),W=(0,U.useCallback)(D=>{let M=s.current,V=ee();if(M===null||V===null)return;let O=M.getBoundingClientRect();q(V*D,O.left+O.width/2,O.top+O.height/2)},[ee,q]),j=(0,U.useCallback)(()=>{let D=s.current;if(D===null)return;let M=D.getBoundingClientRect();q(1,M.left+M.width/2,M.top+M.height/2)},[q]),Q=(0,U.useCallback)(()=>{g("fit")},[]),te=(0,U.useCallback)(()=>{let D=l.current;D===null||D.naturalWidth===0||D.clientWidth===0||c(Math.round(D.clientWidth/D.naturalWidth*100))},[]);(0,U.useLayoutEffect)(()=>{C.current=f,f==="fit"&&te();let D=E.current;E.current=null;let M=s.current;D===null||M===null||(M.scrollLeft=ui(M.scrollLeft,D.x,D.ratio),M.scrollTop=ui(M.scrollTop,D.y,D.ratio))},[f,te]),(0,U.useEffect)(()=>{C.current="fit",E.current=null,B.current=null,g("fit"),p(null),c(null)},[e]),(0,U.useEffect)(()=>{let D=o.current;if(D===null)return;let M=Y=>{if(!Y.ctrlKey)return;Y.cancelable&&Y.preventDefault();let G=l.current;if(G===null||!G.complete||G.naturalWidth===0)return;let S=ee();S!==null&&q(S*Za(Ya(Y)),Y.clientX,Y.clientY)},V=Y=>{let G=Y,S=ee();S!==null&&(G.cancelable&&G.preventDefault(),B.current={base:S,x:G.clientX,y:G.clientY})},O=Y=>{let G=Y,S=B.current;S!==null&&(G.cancelable&&G.preventDefault(),q(S.base*G.scale,S.x,S.y))},z=()=>{B.current=null};return D.addEventListener("wheel",M,{passive:!1}),D.addEventListener("gesturestart",V,{passive:!1}),D.addEventListener("gesturechange",O,{passive:!1}),D.addEventListener("gestureend",z),()=>{D.removeEventListener("wheel",M),D.removeEventListener("gesturestart",V),D.removeEventListener("gesturechange",O),D.removeEventListener("gestureend",z)}},[ee,q]);let re=(0,U.useCallback)(D=>{if(D.button!==0||D.pointerType!=="mouse")return;let M=s.current;if(M===null)return;let{offsetX:V,offsetY:O}=D.nativeEvent;D.target===M&&(V>=M.clientWidth||O>=M.clientHeight)||(H.current={id:D.pointerId,x:D.clientX,y:D.clientY,left:M.scrollLeft,top:M.scrollTop,pan:M.scrollWidth>M.clientWidth||M.scrollHeight>M.clientHeight,moved:!1})},[]);(0,U.useEffect)(()=>{let D=O=>{let z=H.current;z===null||O!==z.id||(z.moved&&(F.current=performance.now()),H.current=null,v(!1))},M=O=>{let z=H.current;if(z===null||O.pointerId!==z.id)return;if(O.buttons===0){D(O.pointerId);return}let Y=O.clientX-z.x,G=O.clientY-z.y;if(!z.moved){if(!to(Y,G))return;z.moved=!0,v(!0)}let S=s.current;if(S===null||!z.pan)return;let R=no(z.left,z.top,Y,G);S.scrollLeft=R.left,S.scrollTop=R.top},V=O=>{D(O.pointerId)};return window.addEventListener("pointermove",M),window.addEventListener("pointerup",V),window.addEventListener("pointercancel",V),()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",V),window.removeEventListener("pointercancel",V)}},[]),(0,U.useEffect)(()=>{let D=s.current;if(D===null||typeof ResizeObserver>"u")return;let M=new ResizeObserver(()=>{C.current==="fit"&&te()});return M.observe(D),()=>M.disconnect()},[te]);let de=(0,U.useCallback)(()=>{let D=l.current;D!==null&&(p({w:D.naturalWidth,h:D.naturalHeight}),C.current==="fit"&&te())},[te]),N=(0,U.useCallback)(()=>{performance.now()-F.current<el||(f==="fit"?j():Q())},[f,j,Q]),se=(0,U.useCallback)(()=>{h(!1)},[]),ce=f==="fit"?k!==null?`${k}%`:"\u2014":`${Math.round(f*100)}%`,ie=f!=="fit"&&d!==null?{width:`${d.w*f}px`,maxWidth:"none",maxHeight:"none"}:void 0,le=d!==null?(0,U.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,U.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>W(1/pi)},"\u2212"),(0,U.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${ce}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:j},ce),(0,U.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>W(pi)},"+"),(0,U.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":f==="fit",onClick:Q},n("files.zoomFit")),i?(0,U.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>h(!0)},"\u2921"):null]):null;return(0,U.createElement)("div",{className:"gp-zoom",ref:o,"data-zoomed":f==="fit"?void 0:"true","data-dragging":b?"true":void 0},[(0,U.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${r}`,ref:s,onPointerDown:re,onMouseDown:a===void 0?void 0:D=>{D.target===D.currentTarget&&a()}},(0,U.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:ie,draggable:!1,onLoad:de,onDoubleClick:N})),le,x?(0,U.createElement)(tl,{key:"lb",src:e,alt:t,t:n,onClose:se}):null])}function tl({src:e,alt:t,t:n,onClose:r}){let i=(0,U.useRef)(null),a=(0,U.useRef)(null);return Er(i,r,a),(0,ro.createPortal)((0,U.createElement)("div",{className:"gp-zl-backdrop",ref:i,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,U.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,U.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:r}),(0,U.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,U.createElement)(Zn,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:r})),(0,U.createElement)("button",{key:"close",ref:a,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:r},(0,U.createElement)(yt,{size:16}))])]),document.body)}function Nr(e,t,n){let r=n(`diff.${e}`);return(0,an.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,an.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,an.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,an.createElement)(Zn,{key:"img",src:t,alt:r,t:n,viewportClass:"gp-imgcmp__img"})])}function io({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,an.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},Nr("before",e,r)):n==="after"?(0,an.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},Nr("after",t,r)):(0,an.createElement)("div",{className:"gp-imgcmp"},[Nr("before",e,r),Nr("after",t,r)])}var ao=require("react");var Ot=require("react");function on(e,t,n,r){let i=JSON.stringify(e),a=(0,Ot.useRef)({key:i,visible:t,load:n,onError:r});a.current={key:i,visible:t,load:n,onError:r};let o=(0,Ot.useRef)(!0),s=(0,Ot.useRef)(0),l=(0,Ot.useRef)(null);(0,Ot.useEffect)(()=>(o.current=!0,()=>{o.current=!1,s.current+=1,l.current=null}),[]);let d=(0,Ot.useCallback)(()=>{let p=a.current;if(!o.current||!p.visible||!ht.isVisible())return Promise.resolve();if(l.current?.key===p.key)return l.current.promise;let f=++s.current,g=()=>o.current&&f===s.current&&a.current.key===p.key,k=()=>g()&&a.current.visible&&ht.isVisible(),c=p.load(g,k).catch(()=>{g()&&p.onError()}).finally(()=>{l.current?.promise===c&&(l.current=null)});return l.current={key:p.key,promise:c},c},[]);return(0,Ot.useEffect)(()=>{t&&d()},[i,t,d]),d}function oo(e,t,n,r,i,a){let o=[t,n,r,i],[s,l]=(0,ao.useState)({queryKey:o,value:{kind:"idle"}}),d=p=>p.length===o.length&&p.every((f,g)=>f===o[g]);return on(o,a&&e!==void 0&&t!==void 0&&n!==void 0&&r!==void 0,async p=>{if(e===void 0||t===void 0||n===void 0||r===void 0)return;l(c=>d(c.queryKey)&&c.value.kind==="ready"?c:{queryKey:o,value:{kind:"loading"}});let f=r==="commit"&&i!==void 0?{kind:"image-diff",path:n,base:"commit",commit:i}:r==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"},g=await e.query({sessionId:t,query:f});if(!p())return;let k=_e(g,"image-diff");l({queryKey:o,value:k!==null?{kind:"ready",res:k}:{kind:"failed"}})},()=>l({queryKey:o,value:{kind:"failed"}})),d(s.queryKey)?s.value:{kind:"idle"}}var Ut=require("react");function Wt({text:e,closeLabel:t,onClose:n,status:r=!1}){return(0,Ut.createElement)("div",{className:"gp-notice",...r?{role:"status"}:{}},[(0,Ut.createElement)("span",{key:"txt",className:"gp-notice__text"},e),(0,Ut.createElement)("button",{key:"close",type:"button",className:"gp-notice__close",title:t,"aria-label":t,onClick:n},(0,Ut.createElement)(yt,{key:"i",size:12}))])}function Mr(){let[e,t]=(0,Ut.useState)(()=>new Set);return(0,Ut.useMemo)(()=>({isDismissed:n=>e.has(n),dismiss:n=>t(r=>r.has(n)?r:new Set(r).add(n))}),[e])}var gi=20,nl=27,rl=29,so=12,il=600,Lr=(0,L.memo)(function({visible:t=!0,text:n,mode:r,path:i,remote:a,sessionId:o,base:s,commit:l,expanded:d,truncated:p,newLines:f,t:g}){let k=Mr(),c=(0,L.useMemo)(()=>Ka(n,f),[n,f]),x=Ia(n),h=(0,Rr.useCodeHighlighter)(i===void 0?void 0:(0,Rr.languageForPath)(i)),b=(0,L.useMemo)(()=>Ua(h),[h]),[v,C]=(0,L.useState)(c),E=(0,L.useRef)(n);(0,L.useEffect)(()=>{if(E.current!==n){E.current=n,C(c);return}C(Z=>Ja(Z,f)??c)},[n,f,c]);let B=ll(v,C,a,o,i,s,l),H=i!==void 0&&Xa(i),[F,ee]=(0,L.useState)("render");(0,L.useEffect)(()=>{ee("render")},[i]);let W=(x||H)&&i!==void 0&&Oa(i)&&a!==void 0&&o!==void 0&&s!==void 0&&(!H||F==="render"),j=oo(W?a:void 0,W?o:void 0,W?i:void 0,W?s:void 0,W?l:void 0,t),[Q,te]=(0,L.useState)(!1),[re,de]=(0,L.useState)(""),[N,se]=(0,L.useState)(!1),[ce,ie]=(0,L.useState)(0),le=(0,L.useRef)(null),D=(0,L.useRef)(null),M=(0,L.useRef)(null);(0,L.useEffect)(()=>{te(!1),de(""),ie(0)},[n,i]);let V=(0,L.useMemo)(()=>r==="unified"?ja(v):null,[r,v]),O=(0,L.useMemo)(()=>r==="before"?cl(v):r==="after"?pl(v):null,[r,v]),z=(0,L.useMemo)(()=>ol(v,V,O),[v,V,O]),Y=(0,L.useMemo)(()=>z.map(Z=>({key:Z.key,text:Z.text.toLowerCase()})),[z]),G=_r(re,kr),S=N?G:G.toLowerCase(),R=N?z:Y,oe=(0,L.useMemo)(()=>sl(R,S),[R,S]);(0,L.useEffect)(()=>{ie(0)},[S]);let ke=oe.length===0?0:Math.min(ce,oe.length-1),Qe=oe.length>0?oe[ke]:null,dt=Qe?.cellKey??null,vt=Qe?.start??-1,rt=(0,L.useMemo)(()=>{let Z=new Map;for(let X of oe){let he=Z.get(X.cellKey)??[];he.push([X.start,X.end]),Z.set(X.cellKey,he)}return Z},[oe]);(0,L.useEffect)(()=>{if(dt===null)return;let Z=requestAnimationFrame(()=>M.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(Z)},[ke,oe,dt,vt]);let De=(0,L.useCallback)(Z=>{ie(X=>oe.length===0?0:(X+Z+oe.length)%oe.length)},[oe.length]);(0,L.useEffect)(()=>{let Z=X=>{if(!((X.ctrlKey||X.metaKey)&&(X.key==="f"||X.key==="F")))return;let he=le.current;he===null||he.offsetParent===null||(X.preventDefault(),te(!0),requestAnimationFrame(()=>D.current?.select()))};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[]);let{setEl:wt,viewport:it,elRef:Gt}=Pn(),gt=(0,L.useRef)(null),[Ke,Ye]=(0,L.useState)(0),[ft,at]=(0,L.useState)(0),ge=(0,L.useRef)({mode:r,rows:v,heights:[]});(ge.current.mode!==r||ge.current.rows!==v)&&(ge.current={mode:r,rows:v,heights:[]});let ve=ge.current.heights,ze=V!==null?V.length:O!==null?O.length:v.length,He=(0,L.useCallback)(Z=>{let X=V!==null?V[Z]??null:O===null?v[Z]??null:null;return X===null?gi:X.kind==="hunk"?nl:X.kind==="gap"?rl:gi},[V,O,v]),Ie=(0,L.useMemo)(()=>{let Z=new Array(ze);for(let X=0;X<ze;X++){let he=ve[X];Z[X]=he!==void 0&&he>0?he:He(X)}return Z},[ze,ve,He,ft]),Ze=(0,L.useMemo)(()=>Mn(Ie),[Ie]),Je=it.height>0?it.height:il,{first:ot,last:Ne}=Gn(Ze,Math.max(0,it.top-Ke),Je,so*gi),Me=dt===null?-1:al(dt),{first:xt,last:kt}=wr({first:ot,last:Ne},Me,ze,so);if((0,L.useLayoutEffect)(()=>{let Z=gt.current,X=Gt.current;if(Z===null||X===null)return;let he=Z.getBoundingClientRect().top-X.getBoundingClientRect().top+X.scrollTop;Math.abs(he-Ke)>.5&&Ye(he);let je=new Map;for(let qe of Z.querySelectorAll("[data-r]")){let st=Number(qe.dataset.r),nt=qe.getBoundingClientRect().height;if(!Number.isFinite(nt)||nt<=0)continue;let lt=je.get(st);(lt===void 0||nt>lt)&&je.set(st,nt)}let Ve=!1;for(let[qe,st]of je){let nt=ve[qe];(nt===void 0||Math.abs(nt-st)>.5)&&(ve[qe]=st,Ve=!0)}Ve&&at(qe=>qe+1)}),W){let Z=(()=>{if(j.kind==="idle"||j.kind==="loading")return(0,L.createElement)("div",{className:"gp-empty"},g("common.loading"));if(j.kind==="ready"){let X=j.res;if(X.tooLarge===!0)return(0,L.createElement)("div",{className:"gp-empty"},g("diff.tooLarge"));if(X.mime!==null&&(X.old!==void 0||X.new!==void 0))return(0,L.createElement)(io,{oldUrl:X.old,newUrl:X.new,mode:r,t:g})}return(0,L.createElement)("div",{className:"gp-empty"},g("diff.binary"))})();return H?lo(F,ee,Z,g):Z}if(x&&!H)return(0,L.createElement)("div",{className:"gp-empty"},g("diff.binary"));let Fe=Q&&S!==""?{perCell:rt,activeKey:dt,activeRange:Qe!==null?[Qe.start,Qe.end]:null,activeRef:M}:null,Pt=(Z,X)=>X>.5?(0,L.createElement)("div",{key:Z,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${X}px`}}):null,mt=Pt("lead",Ze[xt]),Ee=Pt("tail",Ze[ze]-Ze[kt]),_t=(()=>{if(n.trim()==="")return(0,L.createElement)("div",{className:"gp-empty"},g("diff.empty"));if(O!==null){let X=[mt];for(let he=xt;he<kt;he++){let je=O[he];X.push((0,L.createElement)("div",{key:`n${he}`,className:"gp-diff-no"},je.no??"")),X.push(Pr("gp-diff-cell",`c${he}`,je.text,b,Fe,he))}return X.push(Ee),(0,L.createElement)("div",{className:"gp-diff__single",ref:gt},X)}if(V!==null){let X=[mt];for(let he=xt;he<kt;he++)X.push(...gl(V[he],he,b,B,Fe,g));return X.push(Ee),(0,L.createElement)("div",{className:"gp-diff__unified",ref:gt},X)}let Z=[mt];for(let X=xt;X<kt;X++)Z.push(...ul(v[X],X,b,B,Fe,g));return Z.push(Ee),(0,L.createElement)("div",{className:"gp-diff__side",ref:gt},Z)})(),ae=Q?(0,L.createElement)(Tr,{inputRef:D,query:re,matches:oe.length,active:ke,caseSensitive:N,onChange:de,onToggleCase:()=>se(Z=>!Z),onStep:De,onClose:()=>te(!1),t:g}):null,et=d===!0&&v.some(Z=>Z.kind==="gap"),tt=g("diff.truncated"),Rt=g("diff.expandCapped",{n:2e3}),St=Z=>`${i??""}\0${Z}`,zt=(0,L.createElement)("div",{className:"gp-diff__wrap",ref:le},[ae,p===!0&&!k.isDismissed(St(tt))?(0,L.createElement)(Wt,{key:"truncated",text:tt,closeLabel:g("common.close"),onClose:()=>k.dismiss(St(tt))}):null,et&&!k.isDismissed(St(Rt))?(0,L.createElement)(Wt,{key:"capped",text:Rt,closeLabel:g("common.close"),onClose:()=>k.dismiss(St(Rt))}):null,(0,L.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:wt},_t)]);return H?lo(F,ee,zt,g):zt});function al(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function ol(e,t,n){let r=[];return n!==null?(n.forEach((i,a)=>r.push({key:`c${a}`,text:i.text})),r):t!==null?(t.forEach((i,a)=>{if(i.kind==="hunk"||i.kind==="gap")return;let o=i.rightText??i.leftText??"";o!==""&&r.push({key:`c${a}`,text:o})}),r):(e.forEach((i,a)=>{i.kind==="hunk"||i.kind==="gap"||(i.leftText!==null&&i.leftText!==""&&r.push({key:`l${a}`,text:i.leftText}),i.rightText!==null&&i.rightText!==""&&r.push({key:`r${a}`,text:i.rightText}))}),r)}function sl(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[i,a]of Sr(r.text,t))if(n.push({cellKey:r.key,start:i,end:a}),n.length>=xr)return n;return n}function lo(e,t,n,r){let i=(a,o)=>(0,L.createElement)("button",{key:a,type:"button",className:`gp-seg__btn${e===a?" gp-seg__btn--active":""}`,"aria-pressed":e===a,onClick:()=>t(a)},o);return(0,L.createElement)("div",{className:"gp-svgdiff"},[(0,L.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,L.createElement)("div",{className:"gp-seg"},[i("render",r("diff.svgRender")),i("source",r("diff.svgSource"))])),(0,L.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function ll(e,t,n,r,i,a,o){let[s,l]=(0,L.useState)(null),d=(0,L.useRef)(0);(0,L.useEffect)(()=>{d.current+=1,l(null)},[e]);let p=(0,L.useCallback)((f,g)=>{if(n===void 0||r===void 0||i===void 0||a===void 0)return;let k=`${f.rightStart}:${g}`;l(k);let c=++d.current,{start:x,end:h}=dl(f,g),b=a==="commit"&&o!==void 0?{kind:"file-lines",path:i,base:"commit",commit:o,start:x,end:h}:a==="staged"?{kind:"file-lines",path:i,base:"staged",start:x,end:h}:{kind:"file-lines",path:i,base:"worktree",start:x,end:h};n.query({sessionId:r,query:b}).then(v=>{if(c!==d.current)return;let C=_e(v,"file-lines");l(null),C!==null&&t(E=>Va(E,f.rightStart,g,C.start,C.lines,C.eof))}).catch(()=>{c===d.current&&l(null)})},[n,r,i,a,o,t]);return{busy:s,run:p}}function dl(e,t){let n=e.count;return t==="all"||n<=hn?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+hn-1}:{start:e.rightStart+n-hn,end:e.rightStart+n-1}}function Gr(e,t=""){return e.map((n,r)=>(0,L.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function co(e,t,n,r){if(n===null)return null;let i=n.perCell.get(t);if(i===void 0||i.length===0)return null;let a=n.activeKey===t?n.activeRange:null;return Cr(e,i,r,t,a,n.activeRef)}function Pr(e,t,n,r,i=null,a=-1){let o={key:t,className:e,"data-r":a>=0?a:void 0};if(n==="")return(0,L.createElement)("div",o,"\xA0");let s=r(n)?.[0],l=co(n,t,i,s);return l!==null?(0,L.createElement)("div",o,l):(0,L.createElement)("div",o,s===void 0?n:Gr(s))}function fi(e,t,n,r,i,a,o=null,s=-1){let l={key:t,className:e,"data-r":s>=0?s:void 0},d=a(n)?.[0]??[{text:n,style:{}}],p=co(n,t,o,d);if(p!==null)return(0,L.createElement)("div",l,p);let[f,g,k]=qa(d,r);return(0,L.createElement)("div",l,[...Gr(f,"p"),(0,L.createElement)("span",{key:"w",className:i},g.length===0?"\xA0":Gr(g)),...Gr(k,"s")])}function cl(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function pl(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function ul(e,t,n,r,i,a){if(e.kind==="hunk")return[(0,L.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[po(e.gap,t,r,a)];let o=e.kind==="del"||e.kind==="mod"?"gp-diff-row--del":"",s=e.kind==="add"||e.kind==="mod"?"gp-diff-row--add":"",l=e.leftText===null?(0,L.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${o}`}):e.kind==="mod"&&e.leftWord!==void 0?fi(`gp-diff-cell ${o}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,i,t):Pr(`gp-diff-cell ${o}`,`l${t}`,e.leftText,n,i,t),d=e.rightText===null?(0,L.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.rightWord!==void 0?fi(`gp-diff-cell ${s}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,i,t):Pr(`gp-diff-cell ${s}`,`r${t}`,e.rightText,n,i,t);return[(0,L.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,L.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function gl(e,t,n,r,i,a){if(e.kind==="hunk")return[(0,L.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[po(e.gap,t,r,a)];let o=e.kind==="del",s=e.kind==="add",l=s?"gp-diff-row--add":o?"gp-diff-row--del":"",d=s?"+":o?"\u2212":"\xA0",p=e.rightText??e.leftText??"",f=s?e.rightWord:o?e.leftWord:void 0,g=s?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",k=`gp-diff-cell gp-diff-uni__code ${l}`,c=f!==void 0?fi(k,`c${t}`,p,f,g,n,i,t):Pr(k,`c${t}`,p,n,i,t);return[(0,L.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,L.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,L.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),c]}function po(e,t,n,r){let i=n.busy===`${e.rightStart}:all`,a=n.busy===`${e.rightStart}:up`,o=n.busy===`${e.rightStart}:down`,s=(p,f,g)=>(0,L.createElement)("button",{key:p,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:k=>{k.stopPropagation(),n.run(e,p)}},g?r("common.loading"):f),l=[],d=e.count;return d<=hn?l.push(s("all",r("diff.expandGap",{n:d}),i)):(e.atStart||l.push(s("up",r("diff.expandUp",{n:hn}),a)),l.push(s("all",r("diff.expandGap",{n:d}),i)),l.push(s("down",r("diff.expandDown",{n:hn}),o))),(0,L.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function Ar(e){return $a(e)}var ne=require("react");var fl=100;function go(e,t,n,r=!0){let[i,a]=(0,ne.useState)(null),[o,s]=(0,ne.useState)(!1),[l,d]=(0,ne.useState)([]),p=on([t,...n],r,async(f,g)=>{s(!1);let[k,c]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]);if(!f())return;let x=_e(k,"branches"),h=_e(c,"tags");if(x===null){s(!0);return}if(a({current:x.current,defaultBranch:x.defaultBranch,local:x.local,remote:x.remote,tags:h?.tags??i?.tags??[]}),!g())return;let b=await e.query({sessionId:t,query:{kind:"authors"}});if(!f())return;let v=_e(b,"authors");d(v?.authors??[])},()=>s(!0));return{tree:i,treeError:o,authors:l,reload:p}}var uo=2e4;function ml(e,t,n){if(t===void 0)return e;let r=n.map(l=>({hash:l.hash,parents:l.parents})),i=new Set(r.map(l=>l.hash)),a=new Map;for(let l of[...e??[],...t])i.has(l.hash)||(a.delete(l.hash),a.set(l.hash,l.parents));let o=[...a],s=o.length>uo?o.slice(o.length-uo):o;return[...r,...s.map(([l,d])=>({hash:l,parents:d}))]}function fo(e,t,n,r,i,a=!0){let[o,s]=(0,ne.useState)({commits:[],topology:void 0,total:0,appliedFilter:n}),{commits:l,topology:d,total:p,appliedFilter:f}=o,[g,k]=(0,ne.useState)(!1),[c,x]=(0,ne.useState)(!1),h=(0,ne.useRef)(0),b=(0,ne.useRef)(!1),v=(0,ne.useRef)(o),C=(0,ne.useRef)(!1),E=(0,ne.useRef)(()=>!1),B=(0,ne.useRef)(a);B.current=a;let H=(0,ne.useRef)(null),F=(0,ne.useCallback)(async(j,Q,te)=>{if(b.current)return;b.current=!0;let re=h.current;k(!0),x(!1);let de=await e.query({sessionId:t,query:{kind:"history",limit:fl,skip:j,...Q.ref?{ref:Q.ref}:{},...Q.search?{search:Q.search}:{},...Q.author?{author:Q.author}:{},...Q.since?{since:Q.since}:{}}});if(!te()||re!==h.current)return;b.current=!1,k(!1);let N=_e(de,"history");if(N===null){x(!0);return}let se=v.current,ce=j===0?N.commits:[...se.commits,...N.commits],ie={commits:ce,topology:ml(j===0?void 0:se.topology,N.topology,ce),total:N.total,appliedFilter:Q};v.current=ie,C.current=!0,s(ie)},[e,t]),ee=(0,ne.useRef)(n);on([t,...r,n.ref,n.search,n.author,n.since],a,async j=>{h.current+=1,b.current=!1,E.current=j,C.current=!1,ee.current!==n&&(ee.current=n,i(),H.current&&(H.current.scrollTop=0)),await F(0,n,j)},()=>{b.current=!1,k(!1),x(!0)});let q=p<0?!0:l.length<p,W=(0,ne.useCallback)(()=>{if(!B.current||!ht.isVisible()||b.current||!C.current||!q||!E.current())return;let j=E.current;F(l.length,n,j).catch(()=>{j()&&(b.current=!1,k(!1),x(!0))})},[F,l.length,n,q]);return{commits:l,topology:d,appliedFilter:f,total:p,loading:g,listError:c,hasMore:q,listRef:H,loadMore:W}}function mo(e,t,n,r=!0){let[i,a]=(0,ne.useState)(null),[o,s]=(0,ne.useState)(null),[l,d]=(0,ne.useState)(!1),[p,f]=(0,ne.useState)(null),[g,k]=(0,ne.useState)(null),[c,x]=(0,ne.useState)(!1),[h,b]=(0,ne.useState)(n),[v,C]=(0,ne.useState)(!1),E=(0,ne.useRef)(0),B=(0,ne.useRef)(null),H=(0,ne.useRef)(new Map),F=(0,ne.useCallback)((M,V)=>{let O=H.current;for(O.set(M,V);O.size>50;){let z=O.keys().next().value;if(z===void 0)break;O.delete(z)}},[]),ee=(0,ne.useCallback)(()=>{a(null),s(null),B.current=null},[]),q=(0,ne.useCallback)(M=>{B.current===M.hash&&a(M)},[]),W=(0,ne.useCallback)(async M=>{B.current=M.hash,a(M),d(!1),E.current+=1,f(null),k(null),x(!1);let V=H.current.get(M.hash);if(V!==void 0){s(V);return}s(null);let O=await e.query({sessionId:t,query:{kind:"show",ref:M.hash}});if(B.current!==M.hash)return;let z=_e(O,"show");if(z!==null){let Y={commit:z.commit,body:z.body,stats:z.stats,insertions:z.insertions,deletions:z.deletions};F(M.hash,Y),s(Y)}else d(!0)},[e,t,F]),j=(0,ne.useCallback)(async(M,V,O,z=!1)=>{let Y=++E.current;f({path:M,hash:V,shortHash:O}),k(null),x(!1),C(z);let G=await e.query({sessionId:t,query:{kind:"diff",path:M,base:"commit",commit:V,...z?{context:2e3}:{}}});if(Y!==E.current)return;let S=_e(G,"diff");S!==null?k({text:S.text,newLines:S.newLines,truncated:S.truncated}):x(!0)},[e,t]),Q=(0,ne.useCallback)(()=>{E.current+=1,f(null),k(null),x(!1),C(!1)},[]);(0,ne.useEffect)(()=>{if(p===null)return;let M=V=>{V.key==="Escape"&&Q()};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,Q]);let[te,re]=(0,ne.useState)(null),[de,N]=(0,ne.useState)(null),se=(0,ne.useRef)(void 0),ce=(0,ne.useRef)(null),ie=(0,ne.useRef)(r);ie.current=r;let le=(0,ne.useCallback)((M,V,O)=>{se.current!==void 0&&clearTimeout(se.current),se.current=setTimeout(()=>{if(!ie.current||!ht.isVisible())return;ce.current=M.hash,re({commit:M,x:V,y:O});let z=H.current.get(M.hash);if(z!==void 0){N(z.body);return}N(null),e.query({sessionId:t,query:{kind:"show",ref:M.hash}}).then(Y=>{if(ce.current!==M.hash)return;let G=_e(Y,"show");G!==null?(F(M.hash,{commit:G.commit,body:G.body,stats:G.stats,insertions:G.insertions,deletions:G.deletions}),N(G.body)):N("")})},260)},[e,t,F]),D=(0,ne.useCallback)(()=>{se.current!==void 0&&clearTimeout(se.current),ce.current=null,re(null),N(null)},[]);return(0,ne.useEffect)(()=>{r||D()},[r,D]),(0,ne.useEffect)(()=>()=>{se.current!==void 0&&clearTimeout(se.current)},[]),{selected:i,detail:o,detailError:l,select:W,resyncSelected:q,clearSelection:ee,fileDiff:p,fileDiffData:g,fileDiffError:c,fileDiffMode:h,setFileDiffMode:b,fileDiffExpanded:v,openFileDiff:j,closeFileDiff:Q,hover:te,hoverBody:de,onHoverEnter:le,onHoverLeave:D}}var At=require("react"),hl=(e,t,n)=>Math.max(t,Math.min(n,e));function yl(e,t){try{let n=typeof localStorage<"u"?localStorage.getItem(e):null,r=n===null?NaN:Number(n);return Number.isFinite(r)?r:t}catch{return t}}function bl(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function bn(e){let{storageKey:t,initial:n,min:r,reserve:i,edge:a}=e,[o,s]=(0,At.useState)(()=>yl(t,n)),l=(0,At.useRef)(null),d=(0,At.useRef)(null),p=(0,At.useCallback)(g=>{let c=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:g.clientX,w:o,max:Math.max(r,c-i)},g.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[o,r,i]);(0,At.useEffect)(()=>{if(typeof window>"u")return;let g=c=>{let x=d.current;if(x===null)return;let h=c.clientX-x.x;s(hl(x.w+(a==="end"?h:-h),r,x.max))},k=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),s(c=>(bl(t,c),c)))};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",k),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",k)}},[a,r,t]);let f=(0,At.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:p});return{width:o,divider:f}}var ho=require("react");function Qt(e,t,n,r,i=!1){return e.map(a=>(0,ho.createElement)("button",{key:a,type:"button",className:`gp-seg__btn${t===a?" gp-seg__btn--active":""}`,...i?{disabled:!0}:{},onClick:()=>n(a)},r(a)))}var Ae=require("react"),yo=require("react-dom"),bo=require("@deepseek-ai/dsh-client-ui-primitives");function vn(e,t,n){switch(e){case"empty-message":return n("error.emptyMessage");case"nothing-to-commit":return n("error.nothingToCommit");case"not-a-git-repo":return n("error.notARepo");case"cwd-unavailable":return n("error.noCwd");case"local-changes-block":return n("error.localChangesBlock");case"not-ff":return n("error.notFastForward");case"push-rejected":return n("error.pushRejected");case"auth-failed":return n("error.authFailed");case"conflict":return n("error.conflict");case"revert-conflict":return n("error.revertConflict");case"revert-stuck":return n("error.revertStuck");case"revert-merge":return n("error.revertMerge");case"index-busy":return n("error.indexBusy");case"not-found":return n("error.notFound");case"branch-in-use":return n("error.branchInUse");case"nested-repo":return n("error.nestedRepo");case"nested-repo-partial":return n("error.nestedRepoPartial");case"status-lossy":return n("error.statusLossy");case"stash-switch-failed":return n("error.stashSwitchFailed",{reason:t??""});case"no-branch":return n("error.noBranch");case"invalid-name":case"invalid-index":return n("error.invalidName");case"invalid-path":return n("error.invalidPath");case"timeout":return n("error.timeout");case"cancelled":return n("error.cancelled");default:return t??n("error.generic")}}function Ln(e){return(0,Ae.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function An(e){return(0,Ae.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,Ae.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,Ae.createElement)("button",{key:"ok",type:"button",className:`gp-btn ${e.danger?"gp-btn--danger":"gp-btn--primary"}`,disabled:e.confirmDisabled,onClick:e.onConfirm},e.confirmLabel)])}function Xt(e){return typeof document>"u"?null:(0,Ae.createElement)(vl,e)}function vl({onClose:e,title:t,icon:n,hash:r,body:i,footer:a,overlay:o,portalKey:s,t:l}){let d=o!=null;(0,Ae.useEffect)(()=>{let f=g=>{g.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,d]);let p=(0,Ae.createElement)("div",{className:"gp-modal-backdrop",onClick:f=>{!d&&f.target===f.currentTarget&&e()}},(0,Ae.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,Ae.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,Ae.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,Ae.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,Ae.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,Ae.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,Ae.createElement)(yt,{size:15}))]),(0,Ae.createElement)("div",{key:"body",className:"gp-modal__form"},i),a,o??null]));return(0,yo.createPortal)(p,document.body,s)}function wl(e){return(0,Ae.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,Ae.createElement)(bo.StateDot,{key:"sp",state:"ongoing",size:26}),(0,Ae.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function pt(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return Xt({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,Ae.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,Ln(e.t),e.error!==null?(0,Ae.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:An({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:wl(e.busyLabel)}:{}})}var fe=require("react");function vo(e,t){return typeof document>"u"?null:(0,fe.createElement)(xl,{target:e,...t})}function xl({target:e,onClose:t,onCreate:n,error:r,t:i}){let[a,o]=(0,fe.useState)(""),[s,l]=(0,fe.useState)(!1),[d,p]=(0,fe.useState)(""),f=()=>{a.trim()!==""&&n(a.trim(),s?d:"")};return Xt({onClose:t,title:i("tag.createTitle"),icon:(0,fe.createElement)(Cn,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:i,body:[(0,fe.createElement)("input",{key:"name",className:"gp-input",placeholder:i("tag.namePlaceholder"),value:a,autoFocus:!0,onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&f()}}),(0,fe.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,fe.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:s,onChange:()=>l(g=>!g)}),i("tag.annotated")]),s?(0,fe.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:i("tag.messagePlaceholder"),value:d,onChange:g=>p(g.target.value)}):null,Ln(i),r!==null?(0,fe.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:An({onClose:t,onConfirm:f,confirmLabel:i("tag.create"),confirmDisabled:a.trim()==="",danger:!1,t:i})})}function wo(e,t){return typeof document>"u"?null:(0,fe.createElement)(kl,{target:e,...t})}function kl({target:e,from:t,dirty:n,lostFiles:r,lostTotal:i,lostTruncated:a,busy:o,error:s,onReset:l,onClose:d,t:p}){let[f,g]=(0,fe.useState)("mixed"),[k,c]=(0,fe.useState)(!1);(0,fe.useEffect)(()=>{f!=="hard"&&c(!1)},[f]);let x=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],h=o||f==="hard"&&!k;return Xt({onClose:d,title:p("reset.title"),icon:(0,fe.createElement)(gr,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:p,body:[(0,fe.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},p("reset.body",{from:t,to:e.shortHash})),(0,fe.createElement)("div",{key:"modes",className:"gp-reset__modes"},x.map(b=>(0,fe.createElement)("label",{key:b.value,className:`gp-reset__mode${f===b.value?" gp-reset__mode--on":""}${b.value==="hard"?" gp-reset__mode--danger":""}`},[(0,fe.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:f===b.value,onChange:()=>g(b.value)}),(0,fe.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,fe.createElement)("span",{key:"l",className:"gp-reset__modelabel"},p(b.label)),(0,fe.createElement)("span",{key:"h",className:"gp-reset__modehint"},p(b.hint))])]))),f==="hard"?(0,fe.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},p("reset.hardOrphan")):null,f==="hard"&&i>0?(0,fe.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,fe.createElement)("div",{key:"w",className:"gp-reset__warn"},p("reset.hardWarn")),(0,fe.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(b=>(0,fe.createElement)("li",{key:b,title:b},b)),a?(0,fe.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},p("reset.lostMore")):null])]):null,f==="hard"?(0,fe.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,fe.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:k,onChange:()=>c(b=>!b)}),p(i>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,fe.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},p("ops.dirtyWarn")):null,Ln(p),s!==null?(0,fe.createElement)("div",{key:"err",className:"gp-feedback"},s):null],footer:An({onClose:d,onConfirm:()=>void l(f),confirmLabel:p("reset.confirm"),confirmDisabled:h,danger:f==="hard",t:p})})}var Et=require("react");function xo(e,t){return typeof document>"u"?null:(0,Et.createElement)(_l,{target:e,...t})}function _l({target:e,from:t,dirty:n,busy:r,error:i,onConfirm:a,onClose:o,t:s}){let[l,d]=(0,Et.useState)(!1),p=(f,g,k,c)=>(0,Et.createElement)("label",{key:g,className:`gp-bpick__mode${l===f?" gp-bpick__mode--on":""}`},[(0,Et.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===f,onChange:()=>d(f)}),(0,Et.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,Et.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},k),(0,Et.createElement)("span",{key:"h",className:"gp-bpick__modehint"},c)])]);return pt({title:s("switch.confirmTitle"),body:s("switch.body",{from:t??s("switch.detached"),to:e.name}),extra:(0,Et.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,Et.createElement)("div",{key:"trk",className:"gp-bpick__note"},s("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,Et.createElement)("div",{key:"dw",className:"gp-bpick__warn"},s("switch.dirtyWarn",{count:n})),n===0?null:(0,Et.createElement)("div",{key:"md",className:"gp-bpick__modes"},[p(!1,"direct",s("switch.modeDirect"),s("switch.modeDirectHint")),p(!0,"stash",s("switch.modeStash",{count:n}),s("switch.modeStashHint"))])]),confirmLabel:s(l?"switch.confirmStash":"switch.confirm"),danger:!1,error:i,confirmBusy:r,busyLabel:s("switch.switching"),onConfirm:()=>a(l),onClose:o,t:s})}function Sl(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function ko(e){let t=new Set(e.local.map(i=>i.name)),n=e.local.map(i=>({key:`local:${i.name}`,group:"local",label:i.name,name:i.name,reused:!1,ahead:i.ahead,behind:i.behind,shortHash:i.shortHash})),r=[];for(let i of e.remote){let a=Sl(i.name);if(a===null)continue;let o=t.has(a.branch);r.push({key:`remote:${i.name}`,group:"remote",label:i.name,name:a.branch,createFrom:o?void 0:i.name,reused:o,ahead:i.ahead,behind:i.behind,shortHash:i.shortHash})}return[...n,...r]}function _o(e,t){return e.name!==t}var xe=require("react");var $e=require("react"),So=require("react-dom"),Cl=140,Tl=260;function $t(e){let t=e?.placement??"above",n=e?.delayMs??Cl,r=e?.maxWidth??Tl,[i,a]=(0,$e.useState)(null),o=(0,$e.useRef)(!1),s=(0,$e.useRef)(void 0),l=(0,$e.useCallback)(()=>{s.current!==void 0&&(clearTimeout(s.current),s.current=void 0),o.current=!1,a(null)},[]),d=(0,$e.useCallback)((h,b)=>{let v=h.getBoundingClientRect(),C=h.closest('.gp-panel[data-layout="compact"]')!==null,E=C?v.left+v.width/2:v.left,B=Math.min(r,Math.max(80,window.innerWidth-16));a(t==="below"?{text:b,left:E,center:C,maxW:B,top:v.bottom+6}:{text:b,left:E,center:C,maxW:B,bottom:Math.max(8,window.innerHeight-v.top+6)})},[t,r]),p=(0,$e.useCallback)((h,b)=>{o.current||(s.current!==void 0&&clearTimeout(s.current),o.current=!1,s.current=setTimeout(()=>d(h,b),n))},[d,n]),f=(0,$e.useCallback)((h,b)=>{s.current!==void 0&&(clearTimeout(s.current),s.current=void 0),o.current=!0,d(h,b)},[d]),g=(0,$e.useRef)(null);(0,$e.useLayoutEffect)(()=>{let h=g.current;if(h===null||i===null)return;let b=8,v=window.innerWidth,C=window.innerHeight,E=h.getBoundingClientRect(),B=i.center===!0?b+E.width/2:b,H=i.center===!0?v-b-E.width/2:v-b-E.width,F=Math.min(Math.max(i.left,B),Math.max(B,H)),ee=Math.max(b,C-b-E.height),q=i.top===void 0?void 0:Math.min(Math.max(i.top,b),ee),W=i.bottom===void 0?void 0:Math.min(Math.max(i.bottom,b),ee);F===i.left&&q===i.top&&W===i.bottom||a(j=>{if(j===null)return j;let Q={...j,left:F};return q!==void 0&&(Q.top=q),W!==void 0&&(Q.bottom=W),Q})},[i]),(0,$e.useEffect)(()=>{if(i===null)return;let h=v=>{let C=v.target;C instanceof Element&&C.closest(".gp-tip")!==null||l()},b=v=>{v.key==="Escape"&&l()};return document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",b,!0),()=>{document.removeEventListener("pointerdown",h,!0),document.removeEventListener("keydown",b,!0)}},[i,l]);let k=(0,$e.useCallback)(h=>({onMouseEnter:b=>p(b.currentTarget,h),onMouseLeave:()=>{o.current||l()},onFocus:b=>p(b.currentTarget,h),onBlur:()=>{o.current||l()}}),[p,l]),c={left:i?.left??0,maxWidth:i?.maxW??r};i?.top!==void 0&&(c.top=i.top),i?.bottom!==void 0&&(c.bottom=i.bottom);let x=i!==null&&typeof document<"u"?(0,So.createPortal)((0,$e.createElement)("div",{ref:g,className:`gp-tip gp-tip--sb${i.center===!0?" gp-tip--center":""}`,style:c},i.text),document.body):null;return{tipProps:k,tipNode:x,hideTip:l,showTipNow:f}}function Kt(e){return(0,$e.createElement)("span",{className:"gp-tip-wrap",...e.tipProps},e.children)}function Dn(e){return e.hasUpstream===!0&&e.ahead>0&&e.behind===0}function Fn(e){return e.hasUpstream!==!0&&e.branch!==null&&e.unborn!==!0&&e.head!==null&&e.head!==""&&e.remote!==null}function Dr(e){return Dn(e)?"push":Fn(e)?"publish":null}function Co(e,t,n){if(e==="loading"||e===null)return(0,xe.createElement)("div",{className:"gp-pullscope gp-pullscope--loading"},t(n.loading));let r=t(n.line,{commits:e.commits,files:e.files,ins:e.insertions,del:e.deletions}),i=r.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(i===null)return(0,xe.createElement)("div",{className:"gp-pullscope"},r);let a=r.indexOf(i[0]);return(0,xe.createElement)("div",{className:"gp-pullscope"},[r.slice(0,a),(0,xe.createElement)("span",{key:"add",className:"gp-pullscope__add"},i[1])," / ",(0,xe.createElement)("span",{key:"del",className:"gp-pullscope__del"},i[2]),r.slice(a+i[0].length)])}function To(e,t){return Co(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function Eo(e,t){return Co(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function El(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function mi(e,t){return(0,xe.createElement)(Nl,{snapshot:e,cb:t})}function Nl({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:i,hideTip:a}=$t({placement:"above"}),o=e.remote??null,s=e.hasUpstream===!0,l=(()=>{if(o===null||o.hostKind!=="github")return null;let h=(0,xe.createElement)(va,{size:14});if(o.webUrl===null)return(0,xe.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":o.url,...r(o.url)},(0,xe.createElement)("span",{className:"gp-statusbar__ic"},h));let b=o.host!==null?n("status.openRepoOn",{host:o.host}):n("status.openRepo"),v=`${El(o.webUrl)} \xB7 ${b}`;return(0,xe.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:o.webUrl,target:"_blank",rel:"noreferrer","aria-label":v,...r(v)},(0,xe.createElement)("span",{className:"gp-statusbar__ic"},h))})(),{ahead:d,behind:p,branch:f}=e,g=s&&p>0&&d===0,k=Dr(e),c=(()=>{let h,b="";return f===null?h=n("status.detached"):s?d===0&&p===0?(h=n("status.synced"),b=" gp-statusbar__state--ok"):d>0&&p>0?(h=n("status.diverged",{ahead:d,behind:p}),b=" gp-statusbar__state--warn"):p>0?(h=n("status.behind",{n:p}),b=" gp-statusbar__state--warn"):h=n("status.ahead",{n:d}):h=n("status.noUpstream"),t.syncError!==null?(0,xe.createElement)("span",{key:"error",className:"gp-statusbar__state gp-statusbar__state--warn",role:"alert",title:t.syncError},t.syncError):(0,xe.createElement)("span",{key:"s",className:`gp-statusbar__state${b}`},h)})(),x=[o!==null?(0,xe.createElement)(Kt,{key:"check",tipProps:r(n("status.checkTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),onClick:()=>{a(),t.onCheck()}},(0,xe.createElement)(xa,{size:13}))):null,g?(0,xe.createElement)(Kt,{key:"pull",tipProps:r(n("status.pullTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),onClick:()=>{a(),t.onPull()}},[(0,xe.createElement)(wa,{key:"i",size:12}),n("status.pull")])):null,k==="push"?(0,xe.createElement)(Kt,{key:"push",tipProps:r(n("status.pushTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),onClick:()=>{a(),t.onPush()}},[(0,xe.createElement)(gn,{key:"i",size:12}),n("status.push")])):null,k==="publish"?(0,xe.createElement)(Kt,{key:"publish",tipProps:r(n("status.publishTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),onClick:()=>{a(),t.onPublish()}},[(0,xe.createElement)(gn,{key:"i",size:12}),n("status.publish")])):null];return(0,xe.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,xe.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[c,...x]),i])}var Nt=require("react");function Fr({remote:e,sessionId:t,snapshot:n,onAction:r,onClose:i,t:a,onBusyChange:o}){let s=JSON.stringify([t,n.root,n.branch,n.head]),l=(0,Nt.useRef)(s),d=(0,Nt.useRef)({scope:s,snapshot:n});d.current={scope:s,snapshot:n};let p=(0,Nt.useRef)(!1),f=(0,Nt.useRef)(!1),[g,k]=(0,Nt.useState)("loading"),[c,x]=(0,Nt.useState)(null),[h,b]=(0,Nt.useState)(!1),v=s===l.current;(0,Nt.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]),(0,Nt.useEffect)(()=>{(!v||!Dn(n))&&(f.current||i())},[v,n,h,i]),(0,Nt.useEffect)(()=>{if(!v)return;let E=!0;return k("loading"),(async()=>{try{let B=await e.query({sessionId:t,query:{kind:"push-preview"}});if(!E||d.current.scope!==l.current)return;let H=_e(B,"push-preview");H!==null&&H.hasUpstream?k(H):(k(null),x(B.ok?a("error.generic"):vn(B.error.code,B.error.message,a)))}catch(B){if(!E||d.current.scope!==l.current)return;k(null),x(B instanceof Error?B.message:a("error.generic"))}})(),()=>{E=!1}},[e,t,s,v,a]);let C=async()=>{if(!(f.current||d.current.scope!==l.current||!Dn(d.current.snapshot))){f.current=!0,x(null),b(!0),o?.(!0);try{let E=await r({kind:"push"});if(!p.current)return;E.ok?i():d.current.scope===l.current&&x(E.error??a("error.generic"))}catch(E){p.current&&d.current.scope===l.current&&x(E instanceof Error?E.message:a("error.generic"))}finally{f.current=!1,p.current&&b(!1),o?.(!1)}}};return v?pt({title:a("status.pushConfirmTitle"),body:a("status.pushConfirmBody",{branch:n.branch??"HEAD",ahead:n.ahead}),extra:g===null?null:Eo(g,a),confirmLabel:a("status.pushConfirm"),danger:!1,error:c,confirmBusy:h,busyLabel:a("status.pushing"),onConfirm:()=>void C(),onClose:()=>{f.current||i()},t:a}):null}var Dt=require("react");function zr({snapshot:e,onAction:t,onClose:n,t:r,onBusyChange:i}){let a=JSON.stringify([e.root,e.branch,e.head,e.remote?.name??null]),o=(0,Dt.useRef)(a),s=(0,Dt.useRef)({scope:a,snapshot:e});s.current={scope:a,snapshot:e};let l=(0,Dt.useRef)(!1),d=(0,Dt.useRef)(!1),[p,f]=(0,Dt.useState)(null),[g,k]=(0,Dt.useState)(!1),c=a===o.current,x=e.remote;(0,Dt.useEffect)(()=>(l.current=!0,()=>{l.current=!1}),[]),(0,Dt.useEffect)(()=>{(!c||x===null||!Fn(e))&&(d.current||n())},[c,e,x,g,n]);let h=async()=>{if(d.current||s.current.scope!==o.current)return;let b=s.current.snapshot;if(!(b.remote===null||!Fn(b))){d.current=!0,f(null),k(!0),i?.(!0);try{let v=await t({kind:"publish",remote:b.remote.name});if(!l.current)return;v.ok?n():s.current.scope===o.current&&f(v.error??r("error.generic"))}catch(v){l.current&&s.current.scope===o.current&&f(v instanceof Error?v.message:r("error.generic"))}finally{d.current=!1,l.current&&k(!1),i?.(!1)}}};return c?pt({title:r("status.publishConfirmTitle"),body:r("status.publishConfirmBody",{branch:e.branch??"HEAD",remote:x?.name??"origin"}),confirmLabel:r("status.publishConfirm"),danger:!1,error:p,confirmBusy:g,busyLabel:r("status.publishing"),onConfirm:()=>void h(),onClose:()=>{d.current||n()},t:r}):null}var hi=new Set,No=22,Mo=24,Go=[["","overview.allTime"],["1 day ago","overview.today"],["7 days ago","overview.last7d"],["30 days ago","overview.last30d"]],Ml=30;function Gl(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].kind!==t[n].kind||e[n].name!==t[n].name||e[n].head!==t[n].head)return!1;return!0}var Pl=46,Rl=260;function Ll(e,t){let[n,r]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let i=()=>r(e.clientWidth>0&&e.clientWidth<t);i();let a=new ResizeObserver(i);return a.observe(e),()=>a.disconnect()},[e,t]),n}function Po({remote:e,sessionId:t,visible:n=!0,defaultDiffView:r,snapshot:i,onAction:a,onResync:o,compact:s,t:l}){let{signal:d,queryVisible:p,queryKey:f}=lr(t,n,i.root),[g,k]=(0,u.useState)({ref:null,search:"",author:"",since:""}),[c,x]=(0,u.useState)(""),[h,b]=(0,u.useState)(!1),[v,C]=(0,u.useState)(!1),[E,B]=(0,u.useState)(null),H=Ll(E,Rl),[F,ee]=(0,u.useState)(!1),q=(0,u.useId)(),[W,j]=(0,u.useState)(new Set(["tags","remote"])),[Q,te]=(0,u.useState)(0),re=[...f,Q],de=()=>te(_=>_+1),[N,se]=(0,u.useState)(null),[ce,ie]=(0,u.useState)(null),[le,D]=(0,u.useState)(null),[M,V]=(0,u.useState)(null),[O,z]=(0,u.useState)(null),[Y,G]=(0,u.useState)(!1),[S,R]=(0,u.useState)(!1),[oe,ke]=(0,u.useState)(null),[Qe,dt]=(0,u.useState)(!1),[vt,rt]=(0,u.useState)(!1),[De,wt]=(0,u.useState)(!1),[it,Gt]=(0,u.useState)(!1),[gt,Ke]=(0,u.useState)(!1),[Ye,ft]=(0,u.useState)(!1),[at,ge]=(0,u.useState)(null),[ve,ze]=(0,u.useState)("list"),[He,Ie]=(0,u.useState)(null),[Ze,Je]=(0,u.useState)(!1),[ot,Ne]=(0,u.useState)(!1);(0,u.useEffect)(()=>{if(!ot)return;let _=$=>{$.key==="Escape"&&Ne(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[ot]),(0,u.useEffect)(()=>{!s&&ot&&Ne(!1)},[s,ot]),(0,u.useEffect)(()=>{if(!vt){ge(null);return}let _=!0;return ge("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then($=>{if(!_)return;let be=_e($,"pull-preview");ge(be!==null&&be.hasUpstream?{commits:be.commits,files:be.files,insertions:be.insertions,deletions:be.deletions}:null)}),()=>{_=!1}},[vt,e,t]);let{tree:Me,treeError:xt,authors:kt,reload:Fe}=go(e,t,re,p),Pt=(0,u.useMemo)(()=>{let _=new Map;if(Me===null)return _;for(let $ of ko(Me))_o($,Me.current)&&_.set($.key,$);return _},[Me]),mt=i.remote?.name??null,Ee=(0,u.useMemo)(()=>{let _=Me?.local??[],$=Me?.remote??[],be=Me?.defaultBranch??null,cn=Ra(_,be),zi=Aa($,mt,be),Hi=Da(_,Me?.current??null,cn);return{local:Hi.nodes,localPinned:Hi.pinned,localPrimary:cn,remotePrimary:zi,remote:br(La($,zi)),tags:br(Me?.tags??[])}},[Me,mt]),_t=_=>{z(null),Ie(_)},ae=mo(e,t,r,p),{commits:et,topology:tt,appliedFilter:Rt,loading:St,listError:zt,hasMore:Z,listRef:X,loadMore:he}=fo(e,t,g,re,ae.clearSelection,p);(0,u.useEffect)(()=>{let _=setTimeout(()=>k($=>$.search===c?$:{...$,search:c}),300);return()=>clearTimeout(_)},[c]);let je=tt!==void 0||li(Rt),Ve=(0,u.useMemo)(()=>je?Ma(et,tt??[],i.graphStyle):fr(et,i.graphStyle),[et,tt,je,i.graphStyle]),qe=(0,u.useMemo)(()=>Ea(Ve),[Ve]),st=Math.max(fn,qe*fn),nt=s?Pl:Ml,lt=s?`${st}px minmax(0,1fr)`:`${st}px minmax(120px,1fr) 72px 120px 96px`,Jt=()=>{let _=X.current;_===null||!Z||_.scrollTop+_.clientHeight>=_.scrollHeight-240&&he()},Yt=_=>{ae.select(_),s&&ze("detail")},w=(0,u.useMemo)(()=>Date.now(),[et,d.sampledAt]),Ce=(0,u.useMemo)(()=>ae.detail===null?[]:Fa(ae.detail.stats.map(_=>({path:_.path,meta:_.status}))),[ae.detail]),pe=ae.selected,Oe=pe?.hash??null,[Ht,Bt]=(0,u.useState)({hash:null,dirs:hi}),Lt=Ht.hash===Oe?Ht.dirs:hi,jt=(0,u.useCallback)(_=>{Bt($=>{let be=$.hash===Oe?$.dirs:hi,cn=new Set(be);return cn.has(_)?cn.delete(_):cn.add(_),{hash:Oe,dirs:cn}})},[Oe]);(0,u.useEffect)(()=>{if(pe===null)return;let _=et.find($=>$.hash===pe.hash);_!==void 0&&_!==pe&&!Gl(_.refs,pe.refs)&&ae.resyncSelected(_)},[et,pe]);let I=bn({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),Ge=bn({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),we=_=>k($=>({...$,ref:_})),Be=async(_,$)=>{if(!(N===null||Y)){z(null),G(!0);try{let be=await e.run({sessionId:t,action:{kind:"tag-create",name:_,commit:N.hash,...$.trim()!==""?{message:$}:{}}});be.ok?(se(null),de()):z(vn(be.error.code,be.error.message,l))}finally{G(!1)}}},ye=async _=>{if(!Y){z(null),G(!0);try{let $=await e.run({sessionId:t,action:{kind:"tag-delete",name:_}});$.ok?(ie(null),de()):z(vn($.error.code,$.error.message,l))}finally{G(!1)}}},Re=async()=>{if(!(le===null||Y)){z(null),G(!0);try{let _=await a({kind:"revert",commit:le.hash});_.ok?D(null):z(_.error??l("error.generic"))}finally{G(!1)}}},ct=async _=>{if(!(M===null||Y)){z(null),G(!0);try{let $=await a({kind:"reset",commit:M.hash,mode:_});$.ok?V(null):z($.error??l("error.generic"))}finally{G(!1)}}},Zt=async _=>{if(!(He===null||Ze)){z(null),Je(!0);try{let $=await a({kind:"branch-checkout",name:He.name,...He.createFrom===void 0?{}:{createFrom:He.createFrom},..._?{stashMessage:l("switch.stashMessage",{branch:He.name})}:{}});$.ok?(Ie(null),en(!0)):z($.error??l("error.generic"))}finally{Je(!1)}}},en=async(_=!1)=>{if(!(S||i.remote===null)){_||ke(null),R(!0);try{let $=await a({kind:"fetch"});$.ok?ke(null):_||ke($.error??l("error.generic"))}catch($){_||ke($ instanceof Error?$.message:l("error.generic"))}finally{R(!1)}}},xn=async()=>{if(!Qe){z(null),dt(!0);try{let _=await a({kind:"pull-ff"});_.ok?rt(!1):z(_.error??l("error.generic"))}finally{dt(!1)}}},kn={syncBusy:S,syncError:oe,pullBusy:Qe,pushBusy:De,publishBusy:gt,onCheck:()=>void en(),onPull:()=>{z(null),rt(!0)},onPush:()=>{Dn(i)&&!De&&Gt(!0)},onPublish:()=>{z(null),ft(!0)},t:l},nr=Hl(ae.fileDiff,{visible:p,data:ae.fileDiffData,error:ae.fileDiffError,mode:ae.fileDiffMode,onMode:ae.setFileDiffMode,expanded:ae.fileDiffExpanded,onExpand:_=>{ae.fileDiff!==null&&ae.openFileDiff(ae.fileDiff.path,ae.fileDiff.hash,ae.fileDiff.shortHash,_)},onClose:ae.closeFileDiff,remote:e,sessionId:t,compact:s,t:l}),On=(0,u.useMemo)(()=>[...new Set(i.changes.filter(_=>_.status!=="untracked").map(_=>_.path))],[i.changes]),Xn=[N!==null?vo(N,{onClose:()=>se(null),onCreate:Be,error:O,compact:s,t:l}):null,ce!==null?pt({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:ce}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:O,confirmBusy:Y,onConfirm:()=>void ye(ce),onClose:()=>ie(null),t:l}):null,le!==null?pt({title:l("revert.title"),body:l("revert.body",{ref:`${le.shortHash} ${le.subject}`})+(i.dirty?`
|
|
910
|
+
|
|
911
|
+
${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:O,confirmBusy:Y,onConfirm:()=>void Re(),onClose:()=>D(null),t:l}):null,M!==null?wo(M,{from:i.head??M.shortHash,dirty:i.dirty,lostFiles:On,lostTotal:On.length,lostTruncated:i.truncated,busy:Y,error:O,onReset:ct,onClose:()=>V(null),t:l}):null,vt?pt({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:i.branch??"HEAD",behind:i.behind}),extra:To(at,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:O,confirmBusy:Qe,busyLabel:l("status.pulling"),onConfirm:()=>void xn(),onClose:()=>rt(!1),t:l}):null,it?(0,u.createElement)(Fr,{key:"push",remote:e,sessionId:t,snapshot:i,onAction:a,onClose:()=>Gt(!1),onBusyChange:wt,t:l}):null,Ye?(0,u.createElement)(zr,{key:"publish",snapshot:i,onAction:a,onClose:()=>ft(!1),onBusyChange:Ke,t:l}):null,He!==null?xo(He,{from:i.branch,dirty:i.dirty?Math.max(1,i.stats.fileCount):0,busy:Ze,error:O,onConfirm:_=>void Zt(_),onClose:()=>Ie(null),t:l}):null],Qr=[{id:"",label:l("overview.allUsers")},...kt.map(_=>({id:_,label:_}))],Yr=Go.map(([_,$])=>({id:_,label:l($)})),Zr=l(Go.find(([_])=>_===g.since)?.[1]??"overview.allTime"),$n=g.author===""?l("overview.allUsers"):g.author,_n=s?(0,u.createElement)("button",{key:"more",type:"button",className:`gp-btn gp-toolbar__more-toggle${g.author!==""||g.since!==""?" gp-btn--primary":""}`,title:l("overview.moreFilters"),"aria-label":l("overview.moreFilters"),"aria-expanded":F,...F?{"aria-controls":q}:{},onClick:()=>ee(_=>!_)},(0,u.createElement)("span",{key:"c",className:`gp-toolbar__chev${F?" gp-toolbar__chev--up":""}`},(0,u.createElement)(qt,{size:14,open:!0}))):null,rr=(0,u.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),disabled:S,onClick:()=>void en()},(0,u.createElement)(nn,{size:14})),ir=(0,u.createElement)(yi.Menu,{key:"author",open:h,onClose:()=>b(!1),items:Qr,selectedId:g.author,onSelect:_=>{b(!1),k($=>({...$,author:_}))},align:"start",portal:!0,className:"gp-filter",anchor:qn(h,$n,()=>b(_=>!_))}),ar=(0,u.createElement)(yi.Menu,{key:"since",open:v,onClose:()=>C(!1),items:Yr,selectedId:g.since,onSelect:_=>{C(!1),k($=>({...$,since:_}))},align:"start",portal:!0,className:"gp-filter",anchor:qn(v,Zr,()=>C(_=>!_))}),T=(0,u.createElement)("input",{key:"search",className:"gp-search",placeholder:l(H||s?"overview.searchShort":"overview.search"),value:c,onChange:_=>x(_.target.value)}),J=[ir,ar,rr],ue=s?[(0,u.createElement)("button",{key:"filter",type:"button",className:`gp-btn${g.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>Ne(!0)},[(0,u.createElement)(pa,{key:"ic",size:13}),(0,u.createElement)("span",{key:"l",className:"gp-btn__label"},g.ref??l("overview.filterBranch"))]),T,..._n===null?[]:[_n],...F?[(0,u.createElement)("div",{key:"more",id:q,className:"gp-toolbar__more"},J)]:[]]:[T,...J],Le=(0,u.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,u.createElement)("div",{key:"tb",className:"gp-toolbar",ref:B},ue),(0,u.createElement)("div",{key:"list",className:"gp-history__list",ref:X,onScroll:Jt},et.length===0?(0,u.createElement)("div",{className:"gp-empty"},l(St?"common.loading":zt?"overview.loadFailed":"overview.noResults")):Ve.map(_=>Fl(_,{selected:pe?.hash===_.commit.hash,current:!i.unborn&&i.head!==null&&i.head!==""&&_.commit.hash.startsWith(i.head),gridTpl:lt,laneCount:qe,now:w,compact:s,rowH:nt,onSelect:()=>Yt(_.commit),onHoverEnter:ae.onHoverEnter,onHoverLeave:ae.onHoverLeave,t:l})))]),Xe=_=>ae.detail!==null&&ae.detail.stats.length>0?(0,u.createElement)("div",{className:_},[(0,u.createElement)("span",{key:"f"},l("overview.changeSummary",{files:ae.detail.stats.length})),(0,u.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,u.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ae.detail.insertions}`),(0,u.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ae.detail.deletions}`)]):null,dn=pe===null?[(0,u.createElement)("div",{key:"empty",className:"gp-empty"},[(0,u.createElement)(pr,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,u.createElement)("div",{key:"files",className:"gp-detail__files"},ae.detail===null?(0,u.createElement)("div",{className:"gp-empty"},ae.detailError?l("overview.detailFailed"):l("common.loading")):[s?null:Xe("gp-detail__summary"),zl(Ce,{activePath:ae.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:_=>{pe!==null&&ae.openFileDiff(_,pe.hash,pe.shortHash)},collapsed:Lt,onToggleDir:jt,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,u.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,u.createElement)("div",{key:"subj",className:"gp-detail__subject"},pe.subject),(0,u.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,u.createElement)("span",{key:"h",className:"gp-commit-hash"},pe.shortHash),(0,u.createElement)("span",{key:"a"},pe.author),(0,u.createElement)("span",{key:"t"},Yn(pe.dateIso))]),(0,u.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let _=pe.refs.filter($=>$.kind==="tag");return[_.length>0?(0,u.createElement)("div",{key:"tags",className:"gp-detail__tags"},_.map($=>(0,u.createElement)("span",{key:`tag-${$.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:$.name},[(0,u.createElement)(Cn,{key:"i",size:11}),(0,u.createElement)("span",{key:"n",className:"gp-detail__tagname"},$.name),(0,u.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:$.name}),onClick:()=>{z(null),ie($.name)}},(0,u.createElement)(yt,{size:11}))]))):null,(0,u.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,u.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{z(null),D({hash:pe.hash,shortHash:pe.shortHash,subject:pe.subject})}},[(0,u.createElement)(ya,{key:"i",size:12}),l("overview.revert")]),(0,u.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{z(null),o(),V({hash:pe.hash,shortHash:pe.shortHash,subject:pe.subject})}},[(0,u.createElement)(gr,{key:"i",size:12}),l("overview.reset")]),(0,u.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{z(null),se({hash:pe.hash,shortHash:pe.shortHash})}},[(0,u.createElement)(Cn,{key:"i",size:12}),l("overview.createTag")])])]})()),ae.detail!==null&&ae.detail.body!==""?(0,u.createElement)("pre",{key:"body",className:"gp-detail__body"},ae.detail.body):(0,u.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return s?(0,u.createElement)("div",{className:"gp-overview gp-overview--compact"},[nr,...Xn,ve==="detail"?(0,u.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,u.createElement)("div",{key:"back",className:"gp-subhead"},[(0,u.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>ze("list")},[(0,u.createElement)(Tn,{key:"i",size:14}),l("overview.backToList")]),Xe("gp-detail__summary gp-detail__summary--inline")]),...dn]):Le,mi(i,kn),ot?Dl(Me,xt,g.ref,W,{onFilter:_=>{we(_),Ne(!1)},switchOptions:Pt,onSwitch:_=>{Ne(!1),_t(_)},onToggle:_=>j($=>{let be=new Set($);return be.has(_)?be.delete(_):be.add(_),be}),onRetry:Fe,onClose:()=>Ne(!1),t:l},Ee):null]):(0,u.createElement)("div",{className:"gp-overview"},[nr,...Xn,(0,u.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${I.width}px`}},[(0,u.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},Ro(Me,xt,g.ref,W,{onFilter:_=>we(_),switchOptions:Pt,onSwitch:_t,onToggle:_=>j($=>{let be=new Set($);return be.has(_)?be.delete(_):be.add(_),be}),onRetry:Fe,t:l},Ee)),mi(i,kn)]),I.divider,Le,Ge.divider,(0,u.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${Ge.width}px`}},dn),Al(ae.hover,ae.hoverBody,l)])}function Al(e,t,n){if(e===null||typeof document>"u")return null;let r=460,i=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-r-12),a=e.y+14,o=(0,u.createElement)("div",{className:"gp-hovercard",style:{left:i,top:a,maxWidth:r}},[(0,u.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,u.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,u.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,u.createElement)("span",{key:"a"},e.commit.author),(0,u.createElement)("span",{key:"t"},Yn(e.commit.dateIso))]),t===null?(0,u.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,u.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,u.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,Hr.createPortal)(o,document.body,"commit-hovercard")}function Ro(e,t,n,r,i,a){if(t)return(0,u.createElement)("div",{className:"gp-empty"},[(0,u.createElement)("span",{key:"m"},i.t("overview.branchesError")),(0,u.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:i.onRetry},i.t("common.retry"))]);if(e===null)return(0,u.createElement)("div",{className:"gp-empty"},i.t("common.loading"));let o=(d,p,f,g,k)=>{let c=d.name,x=g==="local"&&e.current===d.name,h=g==="local"&&a.localPrimary===d.name||g==="remote"&&a.remotePrimary===d.name,b=`gp-branch-row${n===c?" gp-branch-row--active":""}${x?" gp-branch-row--current":""}${h?" gp-branch-row--primary":""}`,v=i.switchOptions.get(`${g}:${d.name}`),C=[x?i.t("overview.currentBranch"):"",h?i.t("overview.primaryBranch"):""].filter(Boolean).join(" \xB7 "),E=x?(0,u.createElement)(Sa,{size:14}):h?(0,u.createElement)(Ca,{size:14}):k,B=(H,F)=>F&&F>0?(0,u.createElement)("span",{key:H,className:"gp-branch-row__sync",title:i.t(H==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:F}),"aria-label":i.t(H==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:F})},[(0,u.createElement)(Ta,{key:"icon",size:12,direction:H}),(0,u.createElement)("span",{key:"count"},F)]):null;return(0,u.createElement)("div",{key:d.name,className:b,style:{paddingLeft:No+f*Mo},title:d.name,"data-current":x?"true":void 0,"data-primary":h?"true":void 0,onClick:()=>i.onFilter(n===c?null:c)},[(0,u.createElement)("span",{key:"i",className:`gp-branch-row__ic${x?" gp-branch-row__ic--current":h?" gp-branch-row__ic--primary":""}`,title:C||void 0,"aria-label":C||void 0},E),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},p),d.ahead||d.behind?(0,u.createElement)("span",{key:"t",className:"gp-branch-row__track"},[B("ahead",d.ahead),B("behind",d.behind)]):null,v===void 0?null:(0,u.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:i.t(v.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:v.name,ref:v.label}),onClick:H=>{H.stopPropagation(),i.onSwitch(v)}},i.t("switch.action"))])},s=(d,p,f,g,k)=>{for(let c of d){if(c.kind==="leaf"){k.push(o(c.branch,c.label,p,f,g));continue}let x=`${f}:${c.path}`,h=p===0,b=r.has(x)?!h:h;k.push((0,u.createElement)("div",{key:x,className:"gp-branch-row gp-branch-row--dir",style:{paddingLeft:No+p*Mo},title:c.path,role:"button",tabIndex:0,"aria-expanded":b,onClick:()=>i.onToggle(x),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),i.onToggle(x))}},[(0,u.createElement)("span",{key:"c",className:"gp-branch-row__chev"},(0,u.createElement)(qt,{size:11,open:b})),(0,u.createElement)("span",{key:"i",className:"gp-branch-row__ic gp-branch-row__ic--folder"},(0,u.createElement)(ma,{size:13})),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},c.label)])),b&&(c.self!==null&&k.push(o(c.self,c.path,p+1,f,g)),s(c.children,p+1,f,g,k))}},l=(d,p,f,g,k,c=[])=>{let x=[];if(!r.has(d)){for(let h of c)x.push(o(h,h.name,0,d,g));s(k,0,d,g,x)}return(0,u.createElement)("div",{key:d,className:"gp-branch-group"},[(0,u.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>i.onToggle(d)},[(0,u.createElement)(qt,{key:"c",size:11,open:!r.has(d)}),`${i.t(p)} (${f})`]),...x])};return(0,u.createElement)("div",{},[(0,u.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>i.onFilter(null)},i.t("overview.head")),l("local","overview.local",e.local.length,(0,u.createElement)(ai,{size:13}),a.local,a.localPinned),l("remote","overview.remote",e.remote.length,(0,u.createElement)(ai,{size:13}),a.remote),l("tags","overview.tags",e.tags.length,(0,u.createElement)(Cn,{size:13}),a.tags)])}function Dl(e,t,n,r,i,a){if(typeof document>"u")return null;let o=(0,u.createElement)("div",{className:"gp-sheet-backdrop",onClick:s=>{s.target===s.currentTarget&&i.onClose()}},(0,u.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,u.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,u.createElement)("span",{key:"title",className:"gp-sheet__title"},i.t("overview.filterBranch")),(0,u.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:i.t("common.close"),onClick:i.onClose},(0,u.createElement)(yt,{size:15}))]),(0,u.createElement)("div",{key:"body",className:"gp-sheet__body"},Ro(e,t,n,r,i,a))]));return(0,Hr.createPortal)(o,document.body,"branch-filter-sheet")}function Fl(e,t){let n=e.commit,r=n.refs.map(a=>(0,u.createElement)("span",{key:a.name,className:`gp-ref-chip${a.head?" gp-ref-chip--head":""}${a.kind==="remote"?" gp-ref-chip--remote":""}${a.kind==="tag"?" gp-ref-chip--tag":""}`},a.name)),i=(0,u.createElement)("div",{key:"g",className:"gp-graph-cell"},(0,u.createElement)(Ga,{row:e,laneCount:t.laneCount,rowH:t.rowH,current:t.current}));return t.compact?(0,u.createElement)("div",{key:n.hash,className:`gp-commit-row gp-commit-row--compact${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl,height:`${t.rowH}px`},onClick:t.onSelect},[i,(0,u.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,u.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,u.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,u.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,u.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,u.createElement)("span",{key:"d",className:"gp-commit-date"},rn(n.dateIso,t.now,t.t))])])]):(0,u.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:a=>t.onHoverEnter(n,a.clientX,a.clientY),onMouseLeave:t.onHoverLeave},[i,(0,u.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,u.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,u.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,u.createElement)("div",{key:"d",className:"gp-commit-date",title:Qn(n.dateIso)},rn(n.dateIso,t.now,t.t))])}function zl(e,t){let n=[],r=(i,a)=>{for(let o of i)if(o.dir){let s=t.collapsed.has(o.path);n.push((0,u.createElement)("div",{key:o.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+a*14},title:s?t.expandLabel:t.collapseLabel,role:"button",tabIndex:0,"aria-expanded":!s,onClick:()=>t.onToggleDir(o.path),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onToggleDir(o.path))}},[(0,u.createElement)(qt,{key:"c",size:11,open:!s}),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)])),s||r(o.children,a+1)}else{let s=String(o.meta??"modified"),l=t.activePath===o.path;n.push((0,u.createElement)("div",{key:o.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+a*14},title:t.openTitle,onClick:()=>t.onOpen(o.path)},[(0,u.createElement)("span",{key:"st",className:`gp-status-badge ${Nn(s)}`},(vr[s]??s[0]??"M").toUpperCase()),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)]))}};return r(e,0),(0,u.createElement)("div",{},n)}function Hl(e,t){if(e===null||typeof document>"u")return null;let{visible:n,data:r,error:i,mode:a,onMode:o,expanded:s,onExpand:l,onClose:d,remote:p,sessionId:f,compact:g,t:k}=t,c=g?["unified","before","after"]:["unified","split","before","after"],x=g&&a==="split"?"unified":a,h=r!==null&&r.text!==""?(()=>{let F=Ar(r.text);return(0,u.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,u.createElement)("span",{key:"a",className:"gp-stats__add"},`+${F.add}`),(0,u.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${F.del}`)])})():null,b=(0,u.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${s?" gp-seg__btn--active":""}`,disabled:x!=="split"&&x!=="unified",title:k(s?"diff.collapse":"diff.expandAll"),onClick:()=>l(!s)},k(s?"diff.collapse":"diff.expandAll")),v=(0,u.createElement)("div",{key:"seg",className:"gp-seg"},Qt(c,x,o,F=>k(`diff.${F}`))),C=(0,u.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:k("common.close"),onClick:d},(0,u.createElement)(yt,{size:15})),E=[(0,u.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,u.createElement)(fa,{size:15})),(0,u.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},Bl(e.path)),(0,u.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),h,b],B=g?[(0,u.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},E),(0,u.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[v,C])]:[...E,v,C],H=(0,u.createElement)("div",{className:"gp-modal-backdrop",onClick:F=>{F.target===F.currentTarget&&d()}},(0,u.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,u.createElement)("div",{key:"bar",className:"gp-modal__bar"},B),(0,u.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},r===null?(0,u.createElement)("div",{className:"gp-empty"},k(i?"overview.diffFailed":"common.loading")):(0,u.createElement)(Lr,{key:"diff",visible:n,text:r.text,mode:x,path:e.path,remote:p,sessionId:f,base:"commit",commit:e.hash,expanded:s,truncated:r.truncated===!0,newLines:r.newLines,t:k}))]));return(0,Hr.createPortal)(H,document.body,"file-diff-modal")}function Bl(e){let t=e.lastIndexOf("/");return t<0?[(0,u.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,u.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,u.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var y=require("react"),Xo=require("@deepseek-ai/dsh-client-ui-primitives");var Ft=require("react");function Lo(e,t,n,r,i,a){let[o,s]=(0,Ft.useState)([]),[l,d]=(0,Ft.useState)(null),[p,f]=(0,Ft.useState)(null),g=(0,Ft.useRef)(null),k=(0,Ft.useRef)(0);on([t,...a],r,async b=>{let v=await e.query({sessionId:t,query:{kind:"stash-list"}});if(!b())return;let C=_e(v,"stash-list");C!==null?s(C.entries):i()},i);let c=l!==null&&n.changes.some(b=>b.path===l.path);(0,Ft.useEffect)(()=>{l===null||c||(g.current=null,d(null),f(null))},[l,c]);let x=[t,...a,l?.path,l?.base,l?.expand,l?.version];on(x,r&&c,async b=>{if(l===null)return;let v=l,C=await e.query({sessionId:t,query:{kind:"diff",path:v.path,base:v.base,...v.expand?{context:2e3}:{}}});if(!b()||g.current!==v)return;let E=_e(C,"diff");f(E!==null?{text:E.text,newLines:E.newLines,truncated:E.truncated}:{text:"",newLines:0})},()=>f({text:"",newLines:0}));let h=(0,Ft.useCallback)((b,v,C=!1)=>{let E={path:b,base:v,expand:C,version:++k.current};g.current=E,d(E),f(null)},[]);return{stashes:o,diffPath:l,diffData:p,expanded:l?.expand??!1,showDiff:h}}var ut=require("react");function Ao({stats:e,compact:t=!1,showTimes:n=!0,t:r}){let i=Date.now(),{tipProps:a,tipNode:o}=$t({placement:"below",maxWidth:280}),s=[(0,ut.createElement)("span",{key:"files",className:"gp-stats__item"},r("stats.files",{n:e.fileCount})),(0,ut.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,ut.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,ut.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&s.push((0,ut.createElement)("span",{key:"st",className:"gp-stats__item"},r("stats.staged",{n:e.staged}))),e.modified>0&&s.push((0,ut.createElement)("span",{key:"mo",className:"gp-stats__item"},r("stats.modified",{n:e.modified}))),e.untracked>0&&s.push((0,ut.createElement)("span",{key:"un",className:"gp-stats__item"},r("stats.untracked",{n:e.untracked}))),e.partial&&s.push((0,ut.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial","aria-label":r("stats.partial"),...a(r("stats.partialHint"))},r("stats.partial")));let l=[];e.lastChangeAt!==null&&l.push((0,ut.createElement)("span",{key:"lc",className:"gp-stats__item",title:Qn(e.lastChangeAt)},r("stats.lastChange",{time:rn(e.lastChangeAt,i,r)}))),e.headCommittedAt!==null&&l.push((0,ut.createElement)("span",{key:"hc",className:"gp-stats__item",title:Qn(e.headCommittedAt)},r("stats.lastCommit",{time:rn(e.headCommittedAt,i,r)})));let d=l.length>0?(0,ut.createElement)("span",{key:"times",className:"gp-stats__times"},l):null;if(!t)return(0,ut.createElement)("div",{className:"gp-stats"},[...d===null?s:[...s,d],o]);let p=n&&d!==null;return(0,ut.createElement)("div",{className:`gp-stats gp-stats--compact${p?" gp-stats--timed":""}`},[(0,ut.createElement)("div",{key:"main",className:"gp-stats__main"},s),p?d:null,o])}function wn(e){return e.path+(e.staged?":s":":w")}function Do(e){return e.endsWith(":s")?"s":e.endsWith(":w")?"w":null}function Br(e){return Do(e)===null?e:e.slice(0,-2)}function Fo(e){let t=new Set,n=new Set,r={w:t,s:n};for(let i of e){let a=Do(i);a!==null&&r[a].add(Br(i))}return{paths:[...t].sort(),stagedOnly:[...n].filter(i=>!t.has(i)).sort()}}function zo(e,t){if(t.length===0)return"none";let n=0;for(let r of t)e.has(wn(r))&&n++;return n===0?"none":n===t.length?"all":"partial"}function Ho(e,t){let n=new Set(e),r=t.length>0&&t.every(i=>n.has(wn(i)));for(let i of t){let a=wn(i);r?n.delete(a):n.add(a)}return n}var zn=require("react");function Bo({paths:e,stagedOnly:t,snapshot:n,busy:r,error:i,onConfirm:a,onClose:o,t:s}){let l=(0,zn.useMemo)(()=>{let p=new Set(e);return n.changes.filter(f=>f.status==="untracked"&&p.has(f.path)).length},[e,n]),d=t.length>0||l>0?(0,zn.createElement)("div",{key:"notes"},[t.length>0?(0,zn.createElement)("div",{key:"staged",className:"gp-modal__confirmtext"},s("changes.discardPickedStaged",{count:t.length})):null,l>0?(0,zn.createElement)("div",{key:"untracked",className:"gp-modal__confirmtext"},s("changes.discardPickedUntracked",{count:l})):null]):null;return pt({title:s("changes.discardPickedTitle"),body:s("changes.discardPickedBody",{count:e.length}),extra:d,confirmLabel:s("changes.discard"),danger:!0,error:i,confirmBusy:r,busyLabel:s("changes.discarding"),onConfirm:a,onClose:o,t:s})}var Ue=require("react");function Io(e){let{snapshot:t,busy:n,t:r}=e,[i,a]=(0,Ue.useState)(!1),o=(0,Ue.useRef)(!1),{tipProps:s,tipNode:l,hideTip:d}=$t({placement:"below"});(0,Ue.useEffect)(()=>{d()},[t,d]);let p=async()=>{if(!o.current){o.current=!0,a(!0);try{await e.onRefresh()}finally{o.current=!1,a(!1)}}},f=n||i,g=Dr(t),k=g==="publish"?"status.publishTitle":"status.pushTitle",c=g===null?"changes.noRemoteTarget":k,x=()=>{g==="publish"?e.onPublish():g==="push"&&e.onPush()},h=(b,v,C,E,B,H="",F)=>(0,Ue.createElement)(Kt,{key:b,tipProps:s(r(F??v))},(0,Ue.createElement)("button",{type:"button",className:`gp-icon-btn gp-changes__${b}${H}`,"aria-label":r(v),disabled:f||E,...b==="refresh"?{"aria-busy":i}:{},onClick:()=>{d(),B()}},(0,Ue.createElement)("span",{"aria-hidden":!0},C)));return(0,Ue.createElement)("div",{className:"gp-toolbar gp-changes__toolbar",role:"group","aria-label":r("changes.actions")},[h("stage-all","changes.stageAll",(0,Ue.createElement)(ua,{size:16}),t.changes.length===0,e.onStageAll),h("unstage-all","changes.unstageAll",(0,Ue.createElement)(ga,{size:16}),t.staged===0,e.onUnstageAll),h("discard-picked","changes.discardPicked",(0,Ue.createElement)(Un,{size:16}),!e.hasDiscardTargets,e.onDiscard),h("discard-all","changes.discardAll",(0,Ue.createElement)(ha,{size:16}),t.modified===0&&t.untracked===0,e.onDiscardAll),h("stash","changes.stash",(0,Ue.createElement)(ur,{size:16}),t.staged===0&&t.modified===0,e.onStash),h("push",k,(0,Ue.createElement)(gn,{size:16}),g===null,x,"",c),h("refresh","changes.refresh",(0,Ue.createElement)(nn,{size:16}),!1,()=>void p(),i?" gp-changes__refresh--busy":""),l])}var bi=28,Oo=26,Il=8,Ol=600;function $o({remote:e,sessionId:t,visible:n=!0,snapshot:r,onAction:i,onRefresh:a,onSetFullChanges:o,compact:s,cramped:l,t:d}){let{queryVisible:p,queryKey:f}=lr(t,n,r.root),[g,k]=(0,y.useState)(new Set),[c,x]=(0,y.useState)(""),[h,b]=(0,y.useState)(!1),[v,C]=(0,y.useState)(!1),[E,B]=(0,y.useState)(!1),[H,F]=(0,y.useState)(!1),[ee,q]=(0,y.useState)(!1),[W,j]=(0,y.useState)(!1),[Q,te]=(0,y.useState)(!1),re=v||H||W||Q,[de,N]=(0,y.useState)(null),[se,ce]=(0,y.useState)(new Set),[ie,le]=(0,y.useState)(null),[D,M]=(0,y.useState)(!1),[V,O]=(0,y.useState)(!1),[z,Y]=(0,y.useState)(!1),{stashes:G,diffPath:S,diffData:R,expanded:oe,showDiff:ke}=Lo(e,t,r,p,()=>N(d("error.generic")),f),[Qe,dt]=(0,y.useState)(()=>r.defaultDiffView),[vt,rt]=(0,y.useState)(!1),[De,wt]=(0,y.useState)(!1),[it,Gt]=(0,y.useState)(!1),[gt,Ke]=(0,y.useState)(null),Ye=Mr(),[ft,at]=(0,y.useState)("list"),[ge,ve]=(0,y.useState)(!1),[ze,He]=(0,y.useState)(!0),[Ie,Ze]=(0,y.useState)(!1),[Je,ot]=(0,y.useState)(null),Ne=(0,y.useRef)(null),Me=(0,y.useRef)(null),xt=(0,y.useCallback)(T=>{Ne.current=T,T!==null&&l&&ge&&T.focus()},[l,ge]),{setEl:kt,viewport:Fe}=Pn(),{tipProps:Pt,tipNode:mt,hideTip:Ee,showTipNow:_t}=$t({placement:"above",maxWidth:300}),ae=(0,y.useMemo)(()=>r.changes.filter(T=>T.staged).sort(vi),[r]),et=(0,y.useMemo)(()=>r.changes.filter(T=>!T.staged&&T.status!=="untracked").sort(vi),[r]),tt=(0,y.useMemo)(()=>r.changes.filter(T=>T.status==="untracked").sort(vi),[r]),Rt=[{key:"staged",labelKey:"changes.groupStaged",items:ae},{key:"unstaged",labelKey:"changes.groupUnstaged",items:et},{key:"untracked",labelKey:"changes.groupUntracked",items:tt}],St={staged:r.stats.staged,unstaged:r.stats.modified,untracked:r.stats.untracked},zt=Rt.filter(T=>T.items.length>0||r.truncated&&St[T.key]>0),{items:Z,tops:X,totalH:he}=(0,y.useMemo)(()=>{let T=[];for(let ue of zt){let Le=r.truncated?St[ue.key]:ue.items.length;if(T.push({kind:"head",g:{key:ue.key,labelKey:ue.labelKey,count:Le,collapsible:ue.items.length>0},items:ue.items}),!se.has(ue.key))for(let Xe of ue.items)T.push({kind:"row",c:Xe})}let J=Mn(T.map(ue=>ue.kind==="head"?Oo:bi));return{items:T,tops:J,totalH:J[T.length]}},[ae,et,tt,se,r.truncated,r.stats]),je=Fe.height>0?Fe.height:Ol,{first:Ve,last:qe}=Gn(X,Fe.top,je,Il*bi);(0,y.useEffect)(()=>{Ee()},[Ve,qe,r,Ee]),(0,y.useEffect)(()=>{k(T=>{if(T.size===0)return T;let J=new Set(r.changes.map(Xe=>wn(Xe))),ue=new Set,Le=!1;for(let Xe of T)J.has(Xe)?ue.add(Xe):Le=!0;return Le?ue:T})},[r]),(0,y.useEffect)(()=>{if(!p||!ht.isVisible()||!h||vt||c.trim()!=="")return;let T=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(J=>{let ue=_e(J,"last-commit-message");T&&ue!==null&&(x(ue.message),rt(!0))}),()=>{T=!1}},[h,vt,c,e,t,p]),(0,y.useEffect)(()=>{S===null&&at("list")},[S]),(0,y.useEffect)(()=>{ft==="diff"&&ve(!1)},[ft]),(0,y.useEffect)(()=>{if(!l||!ge||typeof document>"u")return;let T=J=>{if(De)return;let ue=Me.current;ue!==null&&J.target instanceof Node&&ue.contains(J.target)||J.target instanceof Element&&J.target.closest(".gp-notice")!==null||ve(!1)};return document.addEventListener("pointerdown",T),()=>document.removeEventListener("pointerdown",T)},[l,ge,De]);let st=(0,y.useRef)(null),nt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{let T=nt.current;nt.current=l&&ge,l&&T&&!ge&&st.current?.focus({preventScroll:!0})},[l,ge]),(0,y.useEffect)(()=>{le(null)},[r]),(0,y.useEffect)(()=>{Gt(!1)},[r]);let lt=(0,y.useMemo)(()=>Fo(g),[g]);(0,y.useEffect)(()=>{D&<.paths.length===0&&M(!1)},[D,lt]);let Jt=T=>{k(J=>{let ue=new Set(J);return ue.has(T)?ue.delete(T):ue.add(T),ue})},Yt=T=>{k(J=>Ho(J,T))},w=async T=>{if(re)return!1;C(!0),N(null),Ke(null);try{let J=await i(T);return J.ok?!0:(N(J.error??d("error.generic")),!1)}catch(J){return N(J instanceof Error?J.message:d("error.generic")),!1}finally{C(!1)}},Ce=async()=>{let T=c.trim();if(T===""&&!h){N(d("error.emptyMessage"));return}let J=g.size>0?[...new Set([...g].map(Le=>Br(Le)))]:void 0;await w({kind:"commit",message:T,...J?{paths:J}:{},...h?{amend:!0}:{}})&&(x(""),k(new Set),b(!1),rt(!1),ve(!1))},pe=async T=>{await w({kind:"stash-push",...T.trim()!==""?{message:T}:{}})&&Ze(!1)},Oe=(T,J)=>{w({kind:"stash-apply",index:T,sha:J})},Ht=(T,J)=>{w({kind:"stash-pop",index:T,sha:J})},Bt=async(T,J)=>{await w({kind:"stash-drop",index:T,sha:J})&&ot(null)},Lt=async()=>{let T=[...lt.paths];if(T.length===0){M(!1);return}await w({kind:"discard",paths:T})&&M(!1)},jt=async()=>{if(!Q){te(!0),N(null);try{await o(!0)}finally{te(!1)}}},I=async()=>{if(!Q){te(!0);try{await o(!1)}finally{te(!1)}}},Ge=async()=>{await w({kind:"discard-all"})&&O(!1)},we=(T,J)=>{switch(T){case"empty-diff":return d("error.emptyDiff");case"llm-unavailable":return d("error.llmUnavailable");case"suggest-disabled":return d("error.suggestDisabled");case"llm-error":case"llm-output":return J===void 0?d("error.llmFailed"):`${d("error.llmFailed")}: ${J}`;default:return J??d("error.generic")}},Be=async()=>{if(De)return;if(h&&!it&&c.trim()!==""){Gt(!0),N(null),Ke(d("commit.suggestOverwrite"));return}Gt(!1);let T=g.size>0?[...new Set([...g].map(J=>Br(J)))]:void 0;wt(!0),N(null),Ke(null);try{let J=await e.suggest({sessionId:t,...T&&T.length>0?{paths:T}:{}});J.ok?(x(J.value.message),J.value.truncated===!0&&Ke(d("commit.suggestTruncated")),Ne.current?.focus()):N(we(J.error.code,J.error.message))}catch(J){N(J instanceof Error?J.message:d("error.generic"))}finally{wt(!1)}},ye=T=>{ce(J=>{let ue=new Set(J);return ue.has(T)?ue.delete(T):ue.add(T),ue})},Re=R!==null&&R.text!==""?Ar(R.text):null,ct=bn({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),Zt=(T,J)=>{ke(T,J),s&&at("diff")},en=s?["unified","before","after"]:["unified","split","before","after"],xn=s&&Qe==="split"?"unified":Qe,kn=c.trim(),nr=kn.split(`
|
|
912
|
+
`)[0]??"",On=re||De||kn==="",Xn=re||De||r.changes.length===0,Qr=(0,y.createElement)("div",{key:"box",className:"gp-commitbox",ref:Me},[(0,y.createElement)("div",{key:"msg",className:`gp-commitbox__msg-wrap${De?" gp-commitbox__msg-wrap--busy":""}`},[(0,y.createElement)("textarea",{key:"ta",className:"gp-commitbox__msg",placeholder:d("commit.placeholder"),value:c,ref:xt,readOnly:De,"aria-busy":De,onChange:T=>x(T.target.value)}),De?(0,y.createElement)("span",{key:"spin",className:"gp-commitbox__spin","aria-hidden":"true"},(0,y.createElement)(Xo.StateDot,{state:"ongoing",size:13})):null]),(0,y.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,y.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,y.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:h,disabled:De,onChange:()=>{b(T=>!T),rt(!1)}}),d("commit.amend")]),(0,y.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[r.suggestEnabled!==!1?(0,y.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:Xn,onClick:()=>void Be(),title:d("commit.suggest")},[(0,y.createElement)(si,{key:"ic",size:13}),d(De?"commit.suggesting":"commit.suggest")]):null,(0,y.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:On,onClick:()=>void Ce()},d("commit.commit")),l?(0,y.createElement)("button",{key:"fold",type:"button",className:"gp-icon-btn gp-commitbox__fold",disabled:De,title:d("commit.collapse"),"aria-label":d("commit.collapse"),onClick:()=>ve(!1)},(0,y.createElement)(qt,{key:"i",size:13,open:!0})):null])])]),Yr=!l||ge?Qr:(0,y.createElement)("div",{key:"box",className:"gp-commitbar"},[(0,y.createElement)("button",{key:"open",type:"button",className:"gp-commitbar__open",ref:st,title:d("commit.edit"),"aria-label":d("commit.edit"),onClick:()=>ve(!0)},kn===""?(0,y.createElement)("span",{key:"ph",className:"gp-commitbar__ph"},d("commit.placeholder")):(0,y.createElement)("span",{key:"draft",className:"gp-commitbar__draft"},nr)),r.suggestEnabled!==!1?(0,y.createElement)("button",{key:"ai",type:"button",className:"gp-btn gp-commitbar__ai",disabled:Xn,title:d("commit.suggest"),"aria-label":d("commit.suggest"),onClick:()=>{ve(!0),Be()}},[(0,y.createElement)(si,{key:"ic",size:13}),d("commit.ai")]):null,(0,y.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary gp-commitbar__commit",disabled:On,onClick:()=>void Ce()},d("commit.commit"))]),Zr=Fn(r)?(0,y.createElement)("div",{key:"publishbar",className:"gp-publishbar"},(0,y.createElement)("button",{type:"button",className:"gp-btn gp-btn--primary gp-publishbar__btn",disabled:re,title:d("commit.publishTitle"),onClick:()=>{Ee(),q(!0)}},[(0,y.createElement)(gn,{key:"ic",size:13}),d("commit.publish")])):null,$n=d("changes.untrackedCollapsed"),_n=d(r.truncatedReason==="lossy"?"changes.truncatedLossy":r.truncatedReason==="cap"?"changes.truncatedCap":"changes.truncatedUnknown",{n:r.changes.length}),rr=[(0,y.createElement)(Ao,{key:"stats",stats:r.stats,compact:s,showTimes:!l,t:d}),(0,y.createElement)(Io,{key:"toolbar",snapshot:r,busy:re,hasDiscardTargets:lt.paths.length>0,onStageAll:()=>void w({kind:"stage-all"}),onUnstageAll:()=>void w({kind:"unstage-all"}),onDiscard:()=>{N(null),M(!0)},onDiscardAll:()=>{N(null),O(!0)},onStash:()=>{N(null),Ze(!0)},onPush:()=>{Ee(),B(!0)},onPublish:()=>{Ee(),q(!0)},onRefresh:a,t:d}),de!==null?(0,y.createElement)("div",{key:"err",className:"gp-feedback gp-feedback--dismissible"},[(0,y.createElement)("span",{key:"txt",className:"gp-feedback__text"},de),(0,y.createElement)("button",{key:"close",type:"button",className:"gp-feedback__close",title:d("common.close"),"aria-label":d("common.close"),onClick:()=>N(null)},(0,y.createElement)(yt,{key:"i",size:12}))]):null,gt!==null?(0,y.createElement)(Wt,{key:"notice",text:gt,closeLabel:d("common.close"),onClose:()=>Ke(null)}):null,r.untrackedCollapsed===!0&&!Ye.isDismissed($n)?(0,y.createElement)(Wt,{key:"collapsed",status:!0,text:$n,closeLabel:d("common.close"),onClose:()=>Ye.dismiss($n)}):null,r.truncated&&!Ye.isDismissed(_n)?(0,y.createElement)(Wt,{key:"truncated",status:!0,text:_n,closeLabel:d("common.close"),onClose:()=>Ye.dismiss(_n)}):null,(0,y.createElement)("div",{key:"list",className:"gp-changes__list",ref:kt},r.changes.length===0?(0,y.createElement)("div",{className:"gp-empty"},d("changes.noChanges")):(0,y.createElement)("div",{className:"gp-changes__vlist",style:{height:he}},Z.slice(Ve,qe).map((T,J)=>{let ue=Ve+J;if(T.kind==="head"){let _=T.g,$=zo(g,T.items);return(0,y.createElement)("div",{key:`h:${_.key}`,className:"gp-changes__vrow",style:{top:X[ue],height:Oo}},(0,y.createElement)("div",{className:`gp-group-head${_.collapsible?"":" gp-group-head--static"}`,..._.collapsible?{onClick:()=>ye(_.key)}:{}},[_.collapsible?(0,y.createElement)(qt,{key:"chev",size:12,open:!se.has(_.key)}):(0,y.createElement)("span",{key:"chev",className:"gp-group-head__chev-spacer"}),T.items.length>0&&T.items.length>=_.count?(0,y.createElement)("span",{key:"pick",className:"gp-group-head__pick",onClick:be=>be.stopPropagation()},(0,y.createElement)("input",{type:"checkbox",className:"gp-check",checked:$==="all",ref:be=>{be!==null&&(be.indeterminate=$==="partial")},disabled:re,"aria-label":d("changes.selectAllGroup",{group:d(_.labelKey)}),onChange:()=>Yt(T.items)})):null,`${d(_.labelKey)} (${_.count})`]))}let Le=T.c,Xe=wn(Le),dn=Le.staged?"staged":"worktree";return(0,y.createElement)("div",{key:Xe,className:"gp-changes__vrow",style:{top:X[ue],height:bi}},Kl(Le,{selected:g.has(Xe),active:S?.path===Le.path&&S.base===dn,busy:re,armed:ie===Xe,onToggle:()=>Jt(Xe),onOpen:()=>Zt(Le.path,dn),onStage:()=>void w(Le.staged?{kind:"unstage",paths:[Le.path]}:{kind:"stage",paths:[Le.path]}),onDiscard:()=>{ie===Xe?(w({kind:"discard",paths:[Le.path]}),le(null)):le(Xe)},tipProps:Pt,hideTip:Ee,showTipNow:_t,t:d}))}))),r.truncated||z?(0,y.createElement)("div",{key:"expandbar",className:"gp-changes__expandbar"},[(0,y.createElement)("span",{key:"txt",className:"gp-changes__expandbar__text"},Q?d("changes.expanding"):z?d("changes.expandedAll",{n:r.changes.length}):d("changes.truncatedCap",{n:r.changes.length})),Q?null:(0,y.createElement)("button",{key:"btn",type:"button",className:"gp-btn gp-btn--sm",disabled:re,onClick:()=>{let T=!z;(T?jt():I()).then(()=>Y(T))}},d(z?"changes.collapseList":"changes.expandAll"))]):null,G.length>0?(0,y.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,y.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>He(T=>!T)},[(0,y.createElement)(qt,{key:"chev",size:12,open:!ze}),`${d("stash.section")} (${G.length})`]),ze?null:(0,y.createElement)("div",{key:"items"},G.map(T=>$l(T,{busy:re,onApply:()=>Oe(T.index,T.sha),onPop:()=>Ht(T.index,T.sha),onDrop:()=>{N(null),ot(T)},t:d})))]):null,Zr,Yr],ir=S===null?(0,y.createElement)("div",{className:"gp-empty"},d("changes.selectFile")):(0,y.createElement)("div",{className:"gp-diff"},[(0,y.createElement)("div",{key:"tb",className:`gp-diff__toolbar${s?" gp-diff__toolbar--compact":""}`},(()=>{let T=s?(0,y.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>at("list")},[(0,y.createElement)(Tn,{key:"i",size:14}),d("changes.backToList")]):null,J=(0,y.createElement)("span",{key:"path",className:"gp-diff__path"},S.path),ue=Re?(0,y.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,y.createElement)("span",{key:"a",className:"gp-stats__add"},`+${Re.add}`)," ",(0,y.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${Re.del}`)]):null,Le=(0,y.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${oe?" gp-seg__btn--active":""}`,style:Re||s?{}:{marginLeft:"auto"},disabled:xn!=="split"&&xn!=="unified",title:d(oe?"diff.collapse":"diff.expandAll"),onClick:()=>void ke(S.path,S.base,!oe)},d(oe?"diff.collapse":"diff.expandAll")),Xe=(0,y.createElement)("div",{key:"seg",className:"gp-seg"},Qt(en,xn,dt,dn=>d(`diff.${dn}`)));return s?[(0,y.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[T,J,ue]),(0,y.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[Le,Xe])]:[T,J,ue,Le,Xe]})()),R===null?(0,y.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,y.createElement)("div",{className:"gp-empty"},d("common.loading"))):(0,y.createElement)(Lr,{key:"diff",visible:p,text:R.text,mode:xn,path:S.path,remote:e,sessionId:t,base:S.base,expanded:oe,truncated:R.truncated===!0,newLines:R.newLines,t:d})]),ar=[E?(0,y.createElement)(Fr,{key:"remote-push",remote:e,sessionId:t,snapshot:r,onAction:i,onClose:()=>B(!1),onBusyChange:F,t:d}):null,ee?(0,y.createElement)(zr,{key:"remote-publish",snapshot:r,onAction:i,onClose:()=>q(!1),onBusyChange:j,t:d}):null,Ie?(0,y.createElement)(Xl,{key:"push",onClose:()=>Ze(!1),onStash:pe,error:de,t:d}):null,Je!==null?pt({title:d("stash.dropTitle"),body:d("stash.dropConfirm",{name:Je.message}),confirmLabel:d("stash.drop"),danger:!0,error:de,onConfirm:()=>void Bt(Je.index,Je.sha),onClose:()=>ot(null),t:d}):null,D&<.paths.length>0?(0,y.createElement)(Bo,{key:"discard-picked",paths:lt.paths,stagedOnly:lt.stagedOnly,snapshot:r,busy:re,error:de,onConfirm:()=>void Lt(),onClose:()=>M(!1),t:d}):null,V?pt({title:d("changes.discardAllTitle"),body:d("changes.discardAllBody",{count:r.stats.modified+r.stats.untracked}),extra:(()=>{let T=[];return r.stats.untracked>0&&T.push((0,y.createElement)("div",{key:"untracked",className:"gp-modal__confirmtext"},d("changes.discardAllUntracked",{count:r.stats.untracked}))),r.stats.staged>0&&T.push((0,y.createElement)("div",{key:"staged",className:"gp-modal__confirmtext"},d("changes.discardAllStaged",{count:r.stats.staged}))),T.length>0?(0,y.createElement)("div",{key:"notes"},T):null})(),confirmLabel:d("changes.discard"),danger:!0,error:de,confirmBusy:re,busyLabel:d("changes.discarding"),onConfirm:()=>void Ge(),onClose:()=>O(!1),t:d}):null];return s?(0,y.createElement)("div",{className:"gp-changes gp-changes--compact"},[...ar,mt,ft==="diff"?(0,y.createElement)("div",{key:"right",className:"gp-changes__right"},ir):(0,y.createElement)("div",{key:"left",className:"gp-changes__left"},rr)]):(0,y.createElement)("div",{className:"gp-changes"},[...ar,mt,(0,y.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${ct.width}px`}},rr),ct.divider,(0,y.createElement)("div",{key:"right",className:"gp-changes__right"},ir)])}function Xl({onClose:e,onStash:t,error:n,t:r}){let[i,a]=(0,y.useState)("");return Xt({onClose:e,title:r("stash.title"),icon:(0,y.createElement)(ur,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,y.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:i,autoFocus:!0,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&t(i)}}),Ln(r),n!==null?(0,y.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:An({onClose:e,onConfirm:()=>void t(i),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function $l(e,t){return(0,y.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,y.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,y.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,y.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,y.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,y.createElement)("span",{key:"t"},e.relTime):null])]),(0,y.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,y.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,y.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,y.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,y.createElement)(Un,{size:14}))])])}function vi(e,t){return e.path.localeCompare(t.path)}function Kl(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,y.createElement)("div",{key:wn(e),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,y.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,disabled:t.busy,onClick:i=>i.stopPropagation(),onChange:t.onToggle}),(0,y.createElement)("span",{key:"st",className:`gp-status-badge ${Nn(e.status)}`},vr[e.status]??"?"),(0,y.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,y.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,y.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,y.createElement)(Kt,{key:"stg",tipProps:t.tipProps(e.staged?t.t("changes.unstageTip"):t.t("changes.stageTip"))},(0,y.createElement)("button",{type:"button",className:"gp-icon-btn","aria-label":e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,onClick:i=>{i.stopPropagation(),t.hideTip(),t.onStage()}},e.staged?"\u2212":"+")),e.staged?null:(0,y.createElement)(Kt,{key:"dis",tipProps:t.tipProps(t.armed?t.t("changes.discardTipArmed"):t.t("changes.discardTip"))},(0,y.createElement)("button",{type:"button",className:"gp-icon-btn","aria-label":t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,onClick:i=>{if(i.stopPropagation(),t.armed){t.hideTip(),t.onDiscard();return}t.onDiscard(),t.showTipNow(i.currentTarget,t.t("changes.discardTipArmed"))}},(0,y.createElement)("span",{"aria-hidden":!0},(0,y.createElement)(Un,{size:14}))))])])}var m=require("react");var We=require("@deepseek-ai/dsh-client-ui-primitives");var me=require("react");function er(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],n=e/1024,r=0;for(;(n>=1024||Number(n.toFixed(1))>=1024)&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}var Jl={bash:"Bash",c:"C",cpp:"C++",csharp:"C#",css:"CSS",dockerfile:"Dockerfile",go:"Go",html:"HTML",java:"Java",javascript:"JavaScript",json:"JSON",jsx:"JSX",kotlin:"Kotlin",markdown:"Markdown",php:"PHP",python:"Python",ruby:"Ruby",rust:"Rust",scss:"SCSS",shellscript:"Shell",sql:"SQL",swift:"Swift",toml:"TOML",tsx:"TSX",typescript:"TypeScript",vue:"Vue",xml:"XML",yaml:"YAML"};function Ko(e){return Jl[e]??jl(e)}function jl(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Hn=require("@deepseek-ai/dsh-client-ui-primitives");function Vl(e,t){let n=ql(e.path);if(e.kind==="binary")return t("files.propsTypeBinary");let r=Wn(e.path);if((e.kind==="image"||e.kind==="tooLarge")&&r!==null){let s=r.slice(6).toUpperCase();return t("files.propsTypeFmt",{label:t("files.propsTypeImage",{fmt:s}),ext:n})}let i=(0,Hn.languageForPath)(e.path),o=i!==void 0&&i!==""?Ko(i):e.kind==="tooLarge"?t("files.propsTypeUnread"):t("files.propsTypeText");return n===""?o:t("files.propsTypeFmt",{label:o,ext:n})}function ql(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1):""}function sn(e,t,n){return{label:e,value:typeof t=="string"?(0,me.createElement)("span",{},t):t,key:n}}function wi(e,t,n){return(0,me.createElement)("div",{key:n,className:"gp-props__group"},[e!==null?(0,me.createElement)("div",{key:"t",className:"gp-props__group-title"},e):null,...t.map(r=>(0,me.createElement)("div",{key:r.key,className:"gp-props__row"},[(0,me.createElement)("span",{key:"l",className:"gp-props__label"},r.label),(0,me.createElement)("span",{key:"v",className:"gp-props__value"},r.value)]))])}function Jo(e,t,n){return(0,me.createElement)("button",{type:"button",className:"gp-props__copy",title:t,"aria-label":t,onClick:n},(0,me.createElement)("code",{className:"gp-props__mono"},e))}function Ul(e,t,n){let r=[],i=e.filter(a=>a.path===t&&!a.isDirectory);i.some(a=>a.staged)&&r.push((0,me.createElement)("span",{key:"staged",className:"gp-props__badge gp-status--added"},n("files.propsStaged")));for(let a of i)a.staged||a.status==="untracked"||r.push((0,me.createElement)("span",{key:a.status,className:`gp-props__badge ${Nn(a.status)}`},Wl(a.status,n)));return r}function Wl(e,t){switch(e){case"added":return t("files.stAdded");case"modified":return t("files.stModified");case"deleted":return t("files.stDeleted");case"renamed":return t("files.stRenamed");case"untracked":return t("files.propsUntracked");case"conflicted":return t("files.stConflicted");case"typechange":return t("files.stTypechange")}}function jo({input:e,snapshot:t,onClose:n,t:r}){let[i,a]=(0,me.useState)(null);(0,me.useEffect)(()=>{if(e.kind!=="image"||e.dataUrl===void 0)return;let v=!0,C=new Image;return C.onload=()=>{v&&a({w:C.naturalWidth,h:C.naturalHeight})},C.src=e.dataUrl,()=>{v=!1}},[e.kind,e.dataUrl]);let[o,s]=(0,me.useState)(null),l=(0,me.useRef)(void 0);(0,me.useEffect)(()=>{s(null)},[e.path]),(0,me.useEffect)(()=>()=>{l.current!==void 0&&clearTimeout(l.current)},[]);let d=v=>{(0,Hn.writeClipboard)(v).then(C=>{s(C?"copied":"error"),l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>s(null),1600)})},p=e.path.lastIndexOf("/"),f=p<0?e.path:e.path.slice(p+1),g=[sn(r("files.propsName"),(0,me.createElement)("span",{className:"gp-props__strong"},f),"name"),sn(r("files.propsType"),Vl(e,r),"type"),sn(r("files.propsRelPath"),Jo(e.path,r("files.propsCopyHint"),()=>d(e.path)),"rel")];if(t!==null){let v=`${t.root}/${e.path}`;g.push(sn(r("files.propsAbsPath"),Jo(v,r("files.propsCopyHint"),()=>d(v)),"abs"))}let k=[];if(e.size!==void 0){let v=e.size>=1024?(0,me.createElement)("span",{},[(0,me.createElement)("span",{key:"h",className:"gp-props__strong"},er(e.size)),(0,me.createElement)("span",{key:"b",className:"gp-props__sub"},r("files.propsSizeBytes",{bytes:e.size.toLocaleString("en-US")}))]):(0,me.createElement)("span",{className:"gp-props__strong"},er(e.size));k.push(sn(r("files.propsSize"),v,"size"))}e.kind==="text"&&e.lines!==void 0&&k.push(sn(r("files.propsLines"),(0,me.createElement)("span",{className:"gp-props__strong"},String(e.lines)),"lines")),i!==null&&k.push(sn(r("files.propsImageSize"),(0,me.createElement)("span",{className:"gp-props__strong"},r("files.propsImageSizeFmt",i)),"dims"));let c=[];e.mtimeMs!==void 0&&c.push(sn(r("files.propsMtime"),(0,me.createElement)("span",{title:rn(e.mtimeMs,Date.now(),r)},Yn(e.mtimeMs)),"mtime"));let x=[wi(null,g,"g-basic"),k.length>0?wi(r("files.propsGroupStats"),k,"g-stats"):null,c.length>0?wi(r("files.propsGroupTime"),c,"g-time"):null],h=[];t!==null&&(h.push(e.ignored?(0,me.createElement)("span",{key:"ig",className:"gp-props__badge gp-props__badge--muted"},r("files.ignored")):Ba(t.changes,e.path)?(0,me.createElement)("span",{key:"un",className:"gp-props__badge gp-props__badge--muted"},r("files.propsUntracked")):(0,me.createElement)("span",{key:"tr",className:"gp-props__badge gp-props__badge--ok"},r("files.propsTrackedYes"))),h.push(...Ul(t.changes,e.path,r)));let b=(0,me.createElement)("div",{key:"status",className:"gp-modal__footer gp-props__statusbar","aria-live":"polite"},[h.length>0?(0,me.createElement)("span",{key:"chips",className:"gp-props__footer-chips"},h):null,o!==null?(0,me.createElement)("span",{key:"fb",className:`gp-props__copied${o==="error"?" gp-props__copied--err":""}`},r(o==="copied"?"files.pathCopied":"files.pathCopyFailed")):null]);return Xt({onClose:n,title:r("files.propsTitle"),icon:(0,me.createElement)(Hn.FileTypeIcon,{path:e.path,size:15}),body:x,footer:b,portalKey:"file-props",t:r})}function xi(e){return e.kind!=="text"?!1:e.size!==void 0?e.size<hr:new TextEncoder().encode(e.content??"").length<hr}function Vo(e){return e.startsWith("/")||/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")}function Ql(e){let t=e.replace(/[/\\]+$/,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"))+1;return t.slice(0,n)}function Yl(e,t){if(!(!/^https?:/.test(e)&&!e.startsWith("dsh-app://app/"))&&Vo(t)&&!/^[/\\]{2}/.test(t)&&!/[\x00-\x1f\x7f]/.test(t))return new URL(`api/file?path=${encodeURIComponent(t)}`,e).href}function Zl(e,t,n){let r=n.search(/[?#]/),i;try{i=decodeURIComponent(r===-1?n:n.slice(0,r))}catch{return}if(i.length!==0&&!(!/^[a-z]:[/\\]/i.test(i)&&/^[a-z][a-z\d+.-]*:/i.test(i))){if(!Vo(i)){if(t===void 0)return;i=Ql(t)+i}return Yl(e,i)}}function qo(e,t){return{resolve:n=>Zl(e,t,n)}}function _i(e){let t=e.endsWith("\r")?e.slice(0,-1):e,n=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(t);if(n===null)return null;let r=n[1][0],i=n[2].trim();return r==="`"&&i.includes("`")?null:{marker:r,length:n[1].length,info:i}}function ki(e,t){let n=_i(e);return n!==null&&n.marker===t.marker&&n.length>=t.length&&n.info===""}function ed(e){return/^mermaid(\s|$)/i.test(e)}function Uo(e){let t=e.split(`
|
|
913
|
+
`),n=[],r=[],i=null,a=null,o=!1,s=()=>{if(r.length===0)return;let l=r.join(`
|
|
914
|
+
`);r=[],l!==""&&n.push({kind:"markdown",text:l})};for(let l of t){if(i!==null&&a!==null){ki(l,a)?(n.push({kind:"mermaid",source:i.join(`
|
|
915
|
+
`)}),i=null,a=null):i.push(l);continue}if(a!==null){r.push(l),ki(l,a)&&(a=null);continue}let d=_i(l);if(d!==null&&ed(d.info)){s(),o=!0,i=[],a=d;continue}r.push(l),d!==null&&(a=d)}return i!==null&&n.push({kind:"mermaid",source:i.join(`
|
|
916
|
+
`)}),s(),o?n:[{kind:"markdown",text:e}]}function Wo(e){let t=e.split(`
|
|
917
|
+
`),n=null;return t.map(r=>{if(n!==null)return ki(r,n)&&(n=null),r;let i=_i(r);return i!==null?(n=i,r):td(r)}).join(`
|
|
918
|
+
`)}function td(e){let t=/(`+)[\s\S]*?\1/g,n=/<kbd>([\s\S]*?)<\/kbd>/gi,r=(s,l)=>nd(l),i="",a=0,o;for(;(o=t.exec(e))!==null;)i+=e.slice(a,o.index).replace(n,r),i+=o[0],a=o.index+o[0].length;return i+e.slice(a).replace(n,r)}function nd(e){let t=0;for(let i of e.match(/`+/g)??[])t=Math.max(t,i.length);let n="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${r}${e}${r}${n}`}var Si="dsh-html-ready";function Yo(e){let t=0,n=/<script\b[^>]*>/gi,r;for(;(r=n.exec(e))!==null;){let i=r[0];if(/\bsrc\s*=/i.test(i))continue;let a=/\btype\s*=\s*["']?([^"'\s>]+)/i.exec(i)?.[1]?.toLowerCase();if(a!==void 0&&a!==""&&a!=="module"&&a!=="text/javascript"&&a!=="application/javascript")continue;let o=e.indexOf("<\/script",r.index+i.length);if(o===-1)break;t+=o-(r.index+i.length),n.lastIndex=o}return t}function Zo(e){return`${e}<script>addEventListener("load",function(){requestAnimationFrame(function(){requestAnimationFrame(function(){try{parent.postMessage("${Si}","*")}catch(e){}})})})<\/script>`}var rd="default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; media-src data:; connect-src 'none'; frame-src 'none'; form-action 'none'; base-uri 'none'";function es(e){let t=`<meta http-equiv="Content-Security-Policy" content="${rd}">`,n=/<head(?:\s[^>]*)?>/i.exec(e);if(n!==null&&!Qo(e,n.index)){let o=n.index+n[0].length;return e.slice(0,o)+t+e.slice(o)}let r=/<html(?:\s[^>]*)?>/i.exec(e);if(r!==null&&!Qo(e,r.index)){let o=r.index+r[0].length;return e.slice(0,o)+`<head>${t}</head>`+e.slice(o)}let i=/^\s*<!doctype[^>]*>/i.exec(e),a=i===null?0:i[0].length;return e.slice(0,a)+t+e.slice(a)}function Qo(e,t){let n=e.slice(0,t).toLowerCase();if(n.lastIndexOf("<!--")>n.lastIndexOf("-->"))return!0;let r=n.lastIndexOf("<script");return r===-1?!1:n.indexOf("<\/script",r)===-1}function id(e){return e.length>0&&!/^(?:[a-z][a-z\d+.-]*:|[/\\#?])/i.test(e)&&!e.includes("\0")}function ad(e,t){let n=t.search(/[?#]/),r;try{r=decodeURIComponent(n===-1?t:t.slice(0,n))}catch{return}if(r.length===0||r.includes("\0")||r.includes("\\")||/^(?:[a-z][a-z\d+.-]*:|[/\\])/i.test(r))return;let i=e.lastIndexOf("/"),a=i<0?"":e.slice(0,i+1),o=[];for(let s of(a+r).split("/"))if(!(s===""||s===".")){if(s===".."){if(o.length===0)return;o.pop();continue}o.push(s)}return o.join("/")}async function od(e,t,n,r){if(e.length>64)return null;let i=r,a=[];for(let o of e){let s=ad(t,o.reference);if(s===void 0)return null;let l=await n(s);if(l===null)return null;let d=new TextEncoder().encode(l).byteLength;if(d>4194304||(i+=d,i>33554432))return null;a.push({kind:o.kind,reference:o.reference,text:l})}return a}function sd(e){let t=new TextEncoder().encode(e),n=[];for(let r=0;r<t.length;r+=32768)n.push(String.fromCharCode(...t.subarray(r,r+32768)));return btoa(n.join(""))}function ts(e){return(/<body[^>]*>([\s\S]*)<\/body>/i.exec(e)?.[1]??e).replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<template[\s\S]*?<\/template>/gi," ").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().length<200}function ld(e,t){return`data:${e==="script"?"text/javascript":"text/css"};base64,${sd(t)}`}function dd(e){if(e.querySelector("base[href]")!==null)return"skip";let t=[],n=new Map;for(let r of e.querySelectorAll("script[src], link[href]")){let i=r.localName==="script",a=r.getAttribute("type")?.trim().toLowerCase()??"";if(i&&!["","text/javascript","application/javascript"].includes(a)||!i&&!(r.getAttribute("rel")??"").toLowerCase().split(/\s+/).includes("stylesheet"))continue;let o=r.getAttribute(i?"src":"href")??"",s=o.search(/[?#]/),l=s===-1?o:o.slice(0,s);if(!id(o)||!(i?/\.js$/i:/\.css$/i).test(l))continue;let d=`${i?"script":"stylesheet"}:${o}`,p=n.get(d);if(p!==void 0){t[p].elements.push(r);continue}if(t.length>=64)return"skip";n.set(d,t.length),t.push({ref:{kind:i?"script":"stylesheet",reference:o},elements:[r]})}return t}function cd(e){return/\s(?:src|href)\s*=/i.test(e)}async function ns(e,t,n){if(typeof DOMParser>"u")return null;let r=new TextEncoder().encode(e).byteLength;if(r>=2097152||!cd(e))return null;let i=new DOMParser().parseFromString(e,"text/html"),a=dd(i);if(a==="skip"||a.length===0)return null;let o=await od(a.map(s=>s.ref),t,n,r);if(o===null)return null;for(let s=0;s<o.length;s+=1){let l=o[s],d=l.kind==="script"?"src":"href",p=ld(l.kind,l.text);for(let f of a[s].elements)f.setAttribute(d,p)}return`<!doctype html>${i.documentElement.outerHTML}`}function pd(e){let t=e.trim().toLowerCase(),n=t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t;return n==="localhost"||n==="::1"?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)}function rs(e,t=!0){return t&&pd(e)}function Ir(e){return e?{inert:""}:{}}var Te=require("react"),is=require("@deepseek-ai/dsh-client-ui-primitives");function ud(e){return e.kind==="interactive"?{sandbox:"allow-scripts",masked:!0}:{sandbox:"",masked:!1}}var gd=4e3,fd=1500,md=2e4,hd=1e3;function as(e){let{frame:t,title:n,t:r,onStop:i}=e,{sandbox:a,masked:o}=ud(t),[s,l]=(0,Te.useState)(o?"loading":"ready"),d=(0,Te.useRef)(null),p=(0,Te.useRef)(null),[f,g]=(0,Te.useState)(""),[k,c]=(0,Te.useState)(0),x=(0,Te.useRef)(null),h=(0,Te.useCallback)(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null),l("ready")},[]);(0,Te.useEffect)(()=>{if(!o)return;let v=setTimeout(()=>l(E=>E==="ready"?E:"slow"),gd),C=setTimeout(h,md);return()=>{clearTimeout(v),clearTimeout(C)}},[o,h]),(0,Te.useEffect)(()=>{if(!o){x.current=null;return}x.current===null&&(x.current=Date.now());let v=x.current,C=setInterval(()=>c(Math.floor((Date.now()-v)/1e3)),hd);return()=>clearInterval(C)},[o]),(0,Te.useEffect)(()=>{if(!o||s==="ready"){g("");return}let v=r(s==="slow"?"files.htmlRenderingSlow":"files.htmlRendering"),C=requestAnimationFrame(()=>g(v));return()=>cancelAnimationFrame(C)},[o,s,r]),(0,Te.useEffect)(()=>{if(!o)return;let v=C=>{let E=d.current?.contentWindow;E==null||C.source!==E||C.data===Si&&h()};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[o,h]),(0,Te.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);let b=(0,Te.useCallback)(()=>{p.current!==null&&clearTimeout(p.current),p.current=setTimeout(h,fd)},[h]);return(0,Te.createElement)("div",{className:"gp-files__html-stage"},[(0,Te.createElement)("iframe",{key:"frame",ref:d,className:"gp-files__html",title:n,sandbox:a,...t.kind==="interactive"?{src:t.src}:{srcDoc:t.srcdoc},referrerPolicy:"no-referrer",...o?{onLoad:b,...Ir(s!=="ready")}:{}}),o?(0,Te.createElement)("div",{key:"mask",className:"gp-files__html-mask","data-state":s,...s==="ready"?{"aria-hidden":"true"}:{}},[(0,Te.createElement)("span",{key:"spin",className:"gp-files__html-mask-spin"},(0,Te.createElement)(is.StateDot,{state:"ongoing",size:20})),(0,Te.createElement)("span",{key:"label",className:"gp-files__html-mask-label",role:"status"},f),s==="slow"?(0,Te.createElement)("span",{key:"elapsed",className:"gp-files__html-mask-elapsed"},r("files.htmlRenderingSeconds",{seconds:k})):null,s==="slow"&&i!==void 0?(0,Te.createElement)("button",{key:"stop",type:"button",className:"gp-files__html-mask-stop",onClick:i},r("files.htmlStopRendering")):null]):null])}var Mt=require("react"),yd=require.async,Ci;function bd(){return Ci??=yd("./client.mermaid.js").then(e=>e,e=>{throw Ci=void 0,e}),Ci}function os(){return typeof document<"u"&&document.body.hasAttribute("data-ds-dark-theme")?"dark":"default"}function ss({source:e,t}){let[n,r]=(0,Mt.useState)(null),[i,a]=(0,Mt.useState)(!1),[o,s]=(0,Mt.useState)(os);return(0,Mt.useEffect)(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;let l=new MutationObserver(()=>s(os()));return l.observe(document.body,{attributes:!0,attributeFilter:["data-ds-dark-theme"]}),()=>l.disconnect()},[]),(0,Mt.useEffect)(()=>{let l=!0;return r(null),a(!1),bd().then(d=>d.renderMermaid(e,o)).then(d=>{l&&r(d)}).catch(()=>{l&&a(!0)}),()=>{l=!1}},[e,o]),n!==null?(0,Mt.createElement)("div",{className:"gp-mermaid","data-mermaid":"",dangerouslySetInnerHTML:{__html:n}}):i?(0,Mt.createElement)("pre",{className:"gp-mermaid__fallback","data-mermaid-fallback":""},(0,Mt.createElement)("code",null,e)):(0,Mt.createElement)("div",{className:"gp-mermaid gp-mermaid--loading","data-mermaid":"loading",role:"status"},(0,Mt.createElement)("span",{className:"gp-mermaid__loading-text"},t("files.mermaidLoading")))}function ps(e){return/\.(?:md|markdown)$/i.test(e)}function ln(e){return/\.(?:html?|xhtml)$/i.test(e)}function wd(e){return ps(e)||ln(e)}var xd=256*1024,kd=5e3,ls=5e3,Or=20,ds=12,_d=600,Sd=2e3,Cd=1024*1024;function us(e,t){return t<=Sd&&e.length<=Cd}var Ni=6e4,Bn=new Map,Ti=new Map;function Td(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;Bn.set(e,{state:{...t,file:n},leftAt:Date.now()});let r=Ti.get(e);r!==void 0&&clearTimeout(r),Ti.set(e,setTimeout(()=>{Ti.delete(e);let i=Bn.get(e);i!==void 0&&Date.now()-i.leftAt>=Ni&&Bn.delete(e)},Ni+1e3))}function Ed(e){let t=Bn.get(e);return t===void 0?null:Date.now()-t.leftAt>Ni?(Bn.delete(e),null):t.state}function Mi({remote:e,sessionId:t,compact:n,worktreeGen:r,snapshot:i,t:a}){let o=(0,m.useRef)(void 0);o.current===void 0&&(o.current=Ed(t));let s=o.current,[l,d]=(0,m.useState)(()=>s?.dirs??new Map),[p,f]=(0,m.useState)(()=>s?.open??new Set([""])),[g,k]=(0,m.useState)(()=>s?.selected??null),[c,x]=(0,m.useState)(()=>s?.file??{kind:"idle"}),[h,b]=(0,m.useState)(()=>s?.renderMarkdown??!0),[v,C]=(0,m.useState)(!0),[E,B]=(0,m.useState)(()=>s?.wrap??!0),[H,F]=(0,m.useState)("idle"),[ee,q]=(0,m.useState)("idle"),[W,j]=(0,m.useState)(!1),[Q,te]=(0,m.useState)(!1),[re,de]=(0,m.useState)(!1),N=(0,m.useRef)(null),se=(0,m.useRef)(null),ce=(0,m.useRef)(null),[ie,le]=(0,m.useState)(()=>s?.pane??"tree"),[D,M]=(0,m.useState)(!1),V=(0,m.useRef)(!1),O=(0,m.useRef)(0),z=(0,m.useRef)(new Map),Y=(0,m.useId)(),G=(0,m.useMemo)(()=>({code:{copyLabel:a("files.copy"),copiedLabel:a("files.copied")},footnotes:a("files.footnotes")}),[a]),S=(0,m.useMemo)(()=>c.kind==="text"&&c.absolutePath!==void 0?qo(document.baseURI,c.absolutePath):void 0,[c]),R=(0,m.useMemo)(()=>{if(c.kind==="text")return Uo(c.content).map(I=>I.kind==="mermaid"?I:{kind:"markdown",text:Wo(I.text)})},[c]),oe=(0,m.useRef)(0),ke=v?"interactive":"static",Qe=(0,m.useMemo)(()=>c.kind!=="text"||!ln(c.path)?0:Yo(c.content),[c]),dt=Qe>=524288,[vt,rt]=(0,m.useState)(null),De=(0,m.useMemo)(()=>rs(typeof location>"u"?"":location.hostname),[]),[wt,it]=(0,m.useState)({busy:!1,error:null}),Gt=(0,m.useCallback)(async()=>{if(c.kind!=="text")return;if(it({busy:!0,error:null}),(await e.openFile({sessionId:t,path:c.path})).ok){it({busy:!1,error:null}),b(!1);return}it({busy:!1,error:a("files.htmlOpenFailed")})},[c,e,t,a]),gt=c.kind==="idle"?null:c.path,Ke=dt&&h&&ke==="interactive"&>!==null&&vt!==gt,[Ye,ft]=(0,m.useState)(null),[at,ge]=(0,m.useState)({status:"idle"});(0,m.useEffect)(()=>{if(c.kind!=="text"||!ln(c.path)||!h||ke!=="interactive"||Ke||Ye===c.path){ge(we=>we.status==="idle"?we:{status:"idle"});return}let I=!1;ge({status:"loading",file:c});let Ge=async we=>{let Be=await e.query({sessionId:t,query:{kind:"file-content",path:we}}),ye=_e(Be,"file-content");return ye===null||ye.variant!=="text"||ye.content===void 0||ye.tooLarge===!0?null:ye.content};return ns(c.content,c.path,Ge).then(we=>{I||ge(we===null?{status:"plain",file:c}:{status:"ready",file:c,srcdoc:we})}).catch(()=>{I||ge({status:"plain",file:c})}),()=>{I=!0}},[c,h,ke,e,t,Ke,Ye]);let ve=(0,m.useMemo)(()=>{if(!(c.kind!=="text"||!ln(c.path)||!h||ke!=="interactive")&&!(at.status==="idle"||at.file!==c))return at.status==="ready"?at.srcdoc:at.status==="plain"?c.content:void 0},[c,h,ke,at]),[ze,He]=(0,m.useState)(void 0);(0,m.useEffect)(()=>{if(ve===void 0){He(void 0);return}let I=URL.createObjectURL(new Blob([Zo(ve)],{type:"text/html"}));return He({doc:ve,url:I}),()=>{URL.revokeObjectURL(I)}},[ve]);let Ie=(0,m.useMemo)(()=>{if(!(c.kind!=="text"||!ln(c.path)||!h)){if(ke==="static")return{kind:"static",srcdoc:es(c.content)};if(!(Ke||Ye===c.path))return ze!==void 0&&ze.doc===ve?{kind:"interactive",src:ze.url}:null}},[c,h,ke,ze,ve,Ke,Ye]),Ze=(0,m.useMemo)(()=>ke==="static"&&c.kind==="text"&&ln(c.path)&&h&&ts(c.content),[c,h,ke]),Je=(0,m.useMemo)(()=>!Ze||Ie?.kind!=="static"?void 0:{run:()=>C(!0)},[Ze,Ie]),ot=(0,m.useCallback)(()=>{c.kind==="text"&&(ft(c.path),b(!1))},[c]),Ne=Ie?.kind==="interactive"?ot:void 0;(0,m.useEffect)(()=>{let I=()=>de(document.fullscreenElement===N.current);return document.addEventListener("fullscreenchange",I),()=>document.removeEventListener("fullscreenchange",I)},[]);let Me=(0,m.useCallback)(()=>{document.fullscreenElement!==null&&document.fullscreenElement===N.current&&document.exitFullscreen().catch(()=>{}),te(!1)},[]),xt=(0,m.useCallback)(()=>{let I=N.current;if(I!==null){if(document.fullscreenElement===I){document.exitFullscreen().catch(()=>{});return}I.requestFullscreen().catch(Ge=>{console.warn("git-panel: full screen was refused",Ge)})}},[]),kt=bn({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),Fe=(0,m.useCallback)((I,Ge=!1)=>{let we=O.current,Be=(z.current.get(I)??0)+1;z.current.set(I,Be);let ye=()=>we===O.current&&z.current.get(I)===Be;return d(Re=>{let ct=Re.get(I);if(ct!==void 0&&(Ge?ct.status==="ready":ct.status!=="error"))return Re;let Zt=new Map(Re);return Zt.set(I,{status:"loading"}),Zt}),e.query({sessionId:t,query:{kind:"dir-list",path:I}}).then(Re=>{if(!ye())return;let ct=_e(Re,"dir-list");d(Zt=>{let en=new Map(Zt);return en.set(I,ct===null?{status:"error"}:{status:"ready",entries:ct.entries,truncated:ct.truncated}),en})}).catch(()=>{ye()&&d(Re=>{let ct=new Map(Re);return ct.set(I,{status:"error"}),ct})})},[e,t]);(0,m.useEffect)(()=>{Fe("")},[Fe]);let Pt=(0,m.useRef)(r);(0,m.useEffect)(()=>{Pt.current!==r&&(Pt.current=r,O.current+=1,z.current.clear(),oe.current+=1,Bn.delete(t),d(new Map),f(new Set([""])),k(null),x({kind:"idle"}),le("tree"),Fe(""))},[r,t,Fe]);let mt=(0,m.useCallback)(I=>{f(Ge=>{let we=new Set(Ge);return we.has(I)?(we.delete(I),we):(we.add(I),l.get(I)===void 0&&Fe(I),we)})},[l,Fe]),Ee=(0,m.useCallback)((I,Ge)=>{let we=++oe.current;return Ge&&x({kind:"loading",path:I}),e.query({sessionId:t,query:{kind:"file-content",path:I}}).then(Be=>{if(we!==oe.current)return;let ye=_e(Be,"file-content");if(ye===null){x({kind:"error",path:I,...Be.ok?{}:{code:Be.error.code}});return}let Re={...ye.size!==void 0?{size:ye.size}:{},...ye.mtimeMs!==void 0?{mtimeMs:ye.mtimeMs}:{}};if(ye.tooLarge===!0){x({kind:"tooLarge",path:I,...Re});return}if(ye.variant==="image"&&ye.dataUrl!==void 0){x({kind:"image",path:I,dataUrl:ye.dataUrl,...Re});return}if(ye.variant==="text"){x({kind:"text",path:I,content:ye.content??"",lines:ye.lines??0,...Re,...ye.absolutePath!==void 0?{absolutePath:ye.absolutePath}:{}});return}x({kind:"binary",path:I,...Re})}).catch(()=>{we===oe.current&&x({kind:"error",path:I})})},[e,t]),_t=(0,m.useCallback)(I=>{k(I),n&&le("preview"),b(!ln(I)),C(!0),F("idle"),q("idle"),j(!1),ft(null),rt(null),Ee(I,!0)},[n,Ee]),ae=(0,m.useCallback)(()=>{if(V.current)return;V.current=!0,M(!0);let I=p;d(Be=>new Map([...Be].filter(([ye])=>I.has(ye))));let Ge=[...I].map(Be=>Fe(Be,!0));g!==null&&Ge.push(Ee(g,!1));let we=()=>{V.current=!1,M(!1)};Promise.all(Ge).then(we,we)},[p,g,Fe,Ee]),et=(0,m.useRef)({dirs:l,open:p,selected:g,file:c,renderMarkdown:h,wrap:E,pane:ie});et.current={dirs:l,open:p,selected:g,file:c,renderMarkdown:h,wrap:E,pane:ie},(0,m.useEffect)(()=>()=>{Td(t,et.current)},[t]);let tt=(0,m.useRef)(!1);(0,m.useEffect)(()=>{tt.current||(tt.current=!0,s!==null&&s.selected!==null&&c.kind==="idle"&&_t(s.selected))},[s,c.kind,_t]);let Rt=(0,m.useMemo)(()=>gs("",0,{dirs:l,open:p,selected:g,toggleDir:mt,selectFile:_t,t:a}),[l,p,g,mt,_t,a]),St=async()=>{if(g===null)return;let I=oe.current,Ge=await(0,We.writeClipboard)(g);I===oe.current&&F(Ge?"copied":"error")},zt=async()=>{if(c.kind!=="text"||!xi(c))return;let I=oe.current,Ge=await(0,We.writeClipboard)(c.content);I===oe.current&&q(Ge?"copied":"error")},Z=(()=>{if(g===null||c.kind!=="text"&&c.kind!=="image"&&c.kind!=="binary"&&c.kind!=="tooLarge")return null;let I=g.lastIndexOf("/"),Ge=I<0?"":g.slice(0,I),we=I<0?g:g.slice(I+1),Be=l.get(Ge),ye=Be?.status==="ready"?Be.entries.find(Re=>!Re.dir&&Re.name===we):void 0;return{path:g,kind:c.kind,...c.size!==void 0?{size:c.size}:{},...c.mtimeMs!==void 0?{mtimeMs:c.mtimeMs}:{},...c.kind==="text"?{lines:c.lines}:{},...c.kind==="image"?{dataUrl:c.dataUrl}:{},ignored:ye?.ignored===!0}})(),X=Q&&g!==null&&c.kind==="text",he=(0,m.createElement)("button",{key:"refresh",type:"button",className:`gp-files__refresh${D?" gp-files__refresh--busy":""}`,title:a("files.refresh"),"aria-label":a("files.refresh"),"aria-busy":D,disabled:D,onClick:()=>ae()},(0,m.createElement)(nn,{size:14})),je=(0,m.createElement)("div",{key:"left",className:"gp-files__tree-wrap",style:n?void 0:{flex:`0 0 ${kt.width}px`},...Ir(X)},[he,(0,m.createElement)("div",{key:"tree",className:"gp-files__tree"},Rt)]),Ve=c.kind==="text"&&wd(c.path),qe=Ve?(0,m.createElement)(We.SegmentedControl,{key:"mode",className:"gp-files__mode-seg",id:Y,label:a("files.previewMode"),value:h?"render":"source",options:[{value:"source",label:a("files.source")},{value:"render",label:a("files.render")}],onChange:I=>{I==="render"&&Ye!==null&&ft(null),b(I==="render")}}):null,st=c.kind==="text"?(0,m.createElement)("button",{key:"full",ref:ce,type:"button",className:"gp-files__props",title:a("files.fullscreen"),"aria-label":a("files.fullscreen"),onClick:()=>te(!0)},(0,m.createElement)(oi,{size:14})):null,nt=c.kind==="text"&&ln(c.path)&&h?(0,m.createElement)("button",{key:"scripts",type:"button",className:"gp-files__props gp-files__scripts",title:a(ke==="interactive"?"files.scriptsOn":"files.scriptsOff"),"aria-label":a("files.runScripts"),"aria-pressed":ke==="interactive",onClick:()=>C(ke!=="interactive")},"JS"):null,lt=c.kind==="text"&&(Ve?!h:!0),Jt=c.kind==="text"?us(c.content,c.lines):!1,Yt=lt?(0,m.createElement)("button",{key:"wrap",type:"button",className:"gp-files__props",title:a(Jt?"files.wrap":"files.wrapDisabled"),"aria-label":a("files.wrap"),"aria-pressed":Jt&&E,disabled:!Jt,onClick:()=>B(I=>!I)},(0,m.createElement)(ca,{size:14})):null,w=(0,m.createElement)("button",{key:"props",type:"button",className:"gp-files__props",title:a("files.propsTitle"),"aria-label":a("files.propsTitle"),disabled:Z===null,onClick:()=>j(!0)},(0,m.createElement)(ka,{size:14})),Ce=n?(0,m.createElement)("div",{key:"bar",className:"gp-files__bar gp-files__bar--compact"},[(0,m.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>le("tree")},[(0,m.createElement)(Tn,{key:"i",size:14}),a("files.backToTree")]),qe,(0,m.createElement)("div",{key:"end",className:"gp-files__bar-end"},[nt,Yt,st,w])]):null,pe=n?null:(0,m.createElement)("div",{key:"bar",className:"gp-files__bar"},[(0,m.createElement)("code",{key:"path",className:"gp-files__path",title:g??""},g??""),qe,(0,m.createElement)("div",{key:"copy",className:"gp-files__copy-group"},[(0,m.createElement)("button",{key:"copy-path",type:"button",className:`gp-files__copy-path${H==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{St()}},a(H==="copied"?"files.pathCopied":H==="error"?"files.pathCopyFailed":"files.copyPath")),xi(c)?(0,m.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${ee==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{zt()}},a(ee==="copied"?"files.contentCopied":ee==="error"?"files.contentCopyFailed":"files.copyContent")):null]),nt,Yt,st,w]),Oe=I=>X?{id:`${Y}-${I}-panel`}:{id:`${Y}-${I}-panel`,role:"tabpanel","aria-labelledby":`${Y}-${I}`},Ht=Ve?[(0,m.createElement)("div",{key:"src",...Oe("source"),style:h?{display:"none"}:{display:"contents"}},h?null:Ei(c,!1,E,G,S,R,Ie,Je,Ne,a)),(0,m.createElement)("div",{key:"rnd",...Oe("render"),style:h?{display:"contents"}:{display:"none"}},h?Ei(c,!0,E,G,S,R,Ie,Je,Ne,a):null)]:Ei(c,h,E,G,S,R,Ie,Je,Ne,a),Bt=Ke&&c.kind==="text"?(0,m.createElement)(Nd,{key:"heavy",path:c.path,bytes:Qe,canOpen:De,opening:wt.busy,error:wt.error,onOpen:()=>{Gt()},onRender:()=>{rt(c.path),it({busy:!1,error:null})},onCancel:()=>{b(!1),it({busy:!1,error:null})},t:a}):null,Lt=(0,m.createElement)("div",{key:"right",className:`gp-files__preview${X?" gp-files__preview--full":""}`,...X?{ref:N,role:"dialog","aria-modal":!0,"aria-label":c.kind==="text"?c.path:""}:{}},[X?(0,m.createElement)("div",{key:"fsbar",className:"gp-modal__bar gp-files__fsbar"},[(0,m.createElement)("code",{key:"path",className:"gp-modal__path",title:c.path},c.path),(0,m.createElement)("button",{key:"screen",type:"button",className:"gp-icon-btn gp-files__fs-screen",title:a(re?"files.exitFullscreen":"files.enterFullscreen"),"aria-label":a("files.screenFull"),"aria-pressed":re,onClick:xt},(0,m.createElement)(re?da:oi,{size:15})),(0,m.createElement)("button",{key:"close",ref:se,type:"button",className:"gp-icon-btn gp-modal__close",title:a("common.close"),"aria-label":a("common.close"),onClick:Me},(0,m.createElement)(yt,{size:15}))]):null,X?(0,m.createElement)(Md,{key:"fsfocus",cardRef:N,initialRef:se,restoreRef:ce,onClose:Me}):null,g!==null&&!X?n?Ce:pe:null,Bt,(0,m.createElement)("div",{key:"content",className:"gp-files__preview-content"},Ht),Z!==null&&W?(0,m.createElement)(jo,{key:"props-modal",input:Z,snapshot:i,onClose:()=>j(!1),t:a}):null]),jt=X?(0,m.createElement)("div",{key:"fs-desk",className:"gp-files__fs-backdrop","aria-hidden":"true",onClick:Me}):null;return n?(0,m.createElement)("div",{className:"gp-files gp-files--compact"},[ie==="preview"?Lt:je,jt]):(0,m.createElement)("div",{className:"gp-files"},[je,kt.divider,Lt,jt])}function Ei(e,t,n,r,i,a,o,s,l,d){if(e.kind==="text"&&t&&ps(e.path)&&a!==void 0){let p={labels:r,variant:"body",...i!==void 0?{pathImages:i}:{}};return a.length===1&&a[0].kind==="markdown"?(0,m.createElement)("div",{className:"gp-files__markdown"},(0,m.createElement)(We.MarkdownText,{text:a[0].text,...p})):(0,m.createElement)("div",{className:"gp-files__markdown"},a.map((f,g)=>f.kind==="mermaid"?(0,m.createElement)(ss,{key:g,source:f.source,t:d}):(0,m.createElement)(We.MarkdownText,{key:g,text:f.text,...p})))}return e.kind==="text"&&o!==void 0?o===null?cs(e,n,d):(0,m.createElement)("div",{className:"gp-files__html-wrap"},[s!==void 0?(0,m.createElement)("div",{key:"hint",className:"gp-files__html-note"},[(0,m.createElement)("span",{key:"text",className:"gp-files__html-note-text"},d("files.scriptsSkipped")),(0,m.createElement)("button",{key:"run",type:"button",className:"gp-files__html-note-run",title:d("files.scriptsOff"),onClick:s.run},d("files.runScripts"))]):null,(0,m.createElement)(as,{key:`frame:${o.kind}:${o.kind==="interactive"?o.src:""}`,frame:o,title:e.path,t:d,...l!==void 0?{onStop:l}:{}})]):cs(e,n,d)}function Nd(e){let{t}=e,n=[(0,m.createElement)("div",{key:"wrap","data-gp-heavy-modal":""},[(0,m.createElement)("p",{key:"why",className:"gp-modal__confirmtext"},t("files.htmlHeavyWhy",{size:er(e.bytes)})),(0,m.createElement)("p",{key:"inline",className:"gp-modal__confirmtext"},t("files.htmlHeavyInline")),e.canOpen?null:(0,m.createElement)("p",{key:"remote",className:"gp-modal__confirmtext"},t("files.htmlHeavyRemote")),e.error!==null?(0,m.createElement)("p",{key:"err",className:"gp-feedback",role:"alert"},e.error):null])],r=(0,m.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,m.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",disabled:e.opening,onClick:e.onCancel},t("common.cancel")),e.canOpen?(0,m.createElement)("button",{key:"open",type:"button",className:"gp-btn",disabled:e.opening,onClick:e.onOpen},t(e.opening?"files.htmlOpening":"files.htmlOpenInBrowser")):null,(0,m.createElement)("button",{key:"render",type:"button",className:"gp-btn gp-btn--primary",disabled:e.opening,onClick:e.onRender},t("files.htmlHeavyRun"))]);return Xt({onClose:e.onCancel,title:e.path,portalKey:"file-heavy-preview",body:n,footer:r,t})}function Md(e){return Er(e.cardRef,e.onClose,e.initialRef,e.restoreRef),null}function gs(e,t,n){let r=n.dirs.get(e);if(r===void 0||r.status==="loading")return t===0?[(0,m.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,m.createElement)("div",{key:`l${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("common.loading"))];if(r.status==="error")return[(0,m.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.loadFailed"))];let i=[];for(let a of r.entries){let o=e===""?a.name:`${e}/${a.name}`;if(a.dir){let s=n.open.has(o);i.push((0,m.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${a.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-expanded":s,"aria-label":a.ignored?`${a.name} (${n.t("files.ignored")})`:a.name,onClick:()=>n.toggleDir(o)},[(0,m.createElement)("span",{key:"i",className:"gp-tree-ic"},s?(0,m.createElement)(We.IconFolderOpenRegular,{size:16}):(0,m.createElement)(We.IconFolderCloseRegular,{size:16})),(0,m.createElement)("span",{key:"n",className:"gp-tree-name"},a.name)])),s&&i.push(...gs(o,t+1,n))}else{let s=n.selected===o;i.push((0,m.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry${s?" gp-tree-row--active":""}${a.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-current":s?"true":void 0,"aria-label":a.ignored?`${a.name} (${n.t("files.ignored")})`:a.name,onClick:()=>n.selectFile(o)},[(0,m.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,m.createElement)(We.FileTypeIcon,{path:o,size:16})),(0,m.createElement)("span",{key:"n",className:"gp-tree-name"},a.name)]))}}return r.truncated&&i.push((0,m.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.truncated"))),i}function cs(e,t,n){switch(e.kind){case"idle":return(0,m.createElement)("div",{className:"gp-empty"},n("files.selectFile"));case"loading":return(0,m.createElement)("div",{className:"gp-empty"},n("common.loading"));case"error":return(0,m.createElement)("div",{className:"gp-empty"},e.code==="file-not-found"?n("files.notFound"):n("files.loadFailed"));case"tooLarge":return(0,m.createElement)("div",{className:"gp-empty"},n("files.tooLarge"));case"binary":return(0,m.createElement)("div",{className:"gp-empty"},n("files.binary"));case"image":return(0,m.createElement)(Zn,{src:e.dataUrl,alt:e.path,t:n,viewportClass:"gp-files__image"});case"text":return(0,m.createElement)(Pd,{content:e.content,path:e.path,wrap:t,t:n})}}function Gd(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[i,a]of Sr(e[r],t))if(n.push({line:r,start:i,end:a}),n.length>=xr)return n;return n}function Pd({content:e,path:t,wrap:n,t:r}){let i=(0,m.useMemo)(()=>{let G=e.split(`
|
|
919
|
+
`);return G.length>0&&G[G.length-1]===""&&G.pop(),G},[e]),a=e.length>xd||i.length>kd,o=a?void 0:(0,We.languageForPath)(t),s=(0,We.useCodeHighlighter)(o),l=(0,m.useMemo)(()=>a?void 0:s(i.join(`
|
|
920
|
+
`)),[a,s,i]),[d,p]=(0,m.useState)(!1),[f,g]=(0,m.useState)(""),[k,c]=(0,m.useState)(!1),[x,h]=(0,m.useState)(0),{setEl:b,viewport:v,elRef:C}=Pn(),E=(0,m.useRef)(null),B=(0,m.useRef)(null);(0,m.useEffect)(()=>{p(!1),g(""),h(0)},[t]);let H=_r(f,kr),F=(0,m.useMemo)(()=>i.map(G=>G.toLowerCase()),[i]),ee=k?H:H.toLowerCase(),q=k?i:F,W=(0,m.useMemo)(()=>Gd(q,ee),[q,ee]);(0,m.useEffect)(()=>{h(0)},[ee]);let j=W.length===0?0:Math.min(x,W.length-1),Q=(0,m.useMemo)(()=>{let G=new Map;for(let S of W){let R=G.get(S.line)??[];R.push([S.start,S.end]),G.set(S.line,R)}return G},[W]);(0,m.useEffect)(()=>{let G=S=>{if(!((S.ctrlKey||S.metaKey)&&(S.key==="f"||S.key==="F")))return;let R=C.current;R===null||R.offsetParent===null||(S.preventDefault(),p(!0),requestAnimationFrame(()=>E.current?.select()))};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[C]);let te=i.length,re=n&&us(e,te),de=(0,m.useMemo)(()=>Mn(new Array(te).fill(Or)),[te]),N=v.height>0?v.height:_d,{first:se,last:ce}=Gn(de,v.top,N,ds*Or),ie=W.length>0?W[j].line:-1,{first:le,last:D}=re?{first:0,last:te}:wr({first:se,last:ce},ie,te,ds);(0,m.useEffect)(()=>{if(ie<0)return;let G=requestAnimationFrame(()=>B.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(G)},[j,W,ie]);let M=(0,m.useCallback)(G=>{h(S=>W.length===0?0:(S+G+W.length)%W.length)},[W.length]),V=W.length>0?W[j]:null,O=d?(0,m.createElement)(Tr,{inputRef:E,query:f,matches:W.length,active:j,caseSensitive:k,onChange:g,onToggleCase:()=>c(G=>!G),onStep:M,onClose:()=>p(!1),t:r}):null,z=a||d?(0,m.createElement)("div",{key:"hd",className:"gp-files__header"},[a?(0,m.createElement)("div",{key:"note",className:"gp-files__note"},r("files.highlightOff")):null,O]):null,Y=[];for(let G=le;G<D;G++)Y.push((0,m.createElement)("div",{key:G,className:"gp-files__row",style:re?void 0:{top:G*Or}},[(0,m.createElement)("div",{key:"n",className:"gp-diff-no"},G+1),Rd(i[G],G,l?.[G],Q.get(G),V,B,r)]));return(0,m.createElement)("div",{className:`gp-files__code gp-diff__scroll${re?" gp-files__code--wrap":" gp-files__code--nowrap"}`,ref:b},[z,(0,m.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",...re?{}:{style:{height:te*Or}}},Y)])}function Rd(e,t,n,r,i,a,o){if(e==="")return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>ls)return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,ls),(0,m.createElement)("span",{key:"trunc",className:"gp-files__trunc"},o("files.lineTruncated"))]);if(r===void 0||r.length===0)return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,m.createElement)("span",{key:d,style:l.style},l.text)):e);let s=i!==null&&i.line===t?[i.start,i.end]:null;return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},Cr(e,r,n,`c${t}`,s,a))}var Xr=require("react");function fs(e){return e.compact&&e.short}var Dd={compact:!1,short:!1};function ms(e){let[t,n]=(0,Xr.useState)(Dd);return(0,Xr.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(a=>{let o=e.clientWidth,s=e.clientHeight,l={compact:o>0&&o<=620,short:s>0&&s<=520};return a.compact===l.compact&&a.short===l.short?a:l});r();let i=new ResizeObserver(r);return i.observe(e),()=>i.disconnect()},[e]),t}function Gi(e){for(let t of e){let n=t.schema?.dict;if(n!==void 0&&"showInputPill"in n||JSON.stringify(t.schema).includes("showInputPill"))return t.ns}}function $r(){Jn(),setTimeout(()=>{Jn()},1e3)}async function Fd(e,t,n){let r=e.describe();await r.ensure();let i=r.getSnapshot().view;if(i===void 0)return!1;let a=Gi(i.namespaces);if(a===void 0)return!1;let o=await e.get(a).set(t,n);return o&&$r(),o}async function Pi(e,t,n){let r=e.get("configForms");if(r===void 0)return!1;try{return await Fd(r,t,n)}catch{return!1}}function hs(e){return e.get("configForms")!==void 0}var Kr=require("react");function ys(){let[e,t]=(0,Kr.useState)(()=>ht.isVisible());return(0,Kr.useEffect)(()=>{let n=()=>t(ht.isVisible()),r=ht.subscribe(n);return n(),r},[]),e}function bs(e){return e===-1||e===1?e:0}var vs="gp.panel.fontDelta";function xs({ctx:e,sessionId:t,t:n}){let r=ys(),[i,a]=(0,K.useState)(null),o=(0,K.useRef)(0),[s,l]=(0,K.useState)(null),[d,p]=(0,K.useState)(null),f=ms(d),g=f.compact,k=fs(f),c=dr(t),x=pn(e),h=hs(e),b=c.state==="error"&&c.error.code==="git-unavailable",v=c.state==="error"&&(c.error.code==="not-a-git-repo"||c.error.code==="git-unavailable"),C=b&&c.state==="error"&&c.error.isGitRepo===!0,E=v?"files":s!==null&&s.sessionId===t?s.tab:null,B=(0,K.useRef)({tabs:new Set});B.current.sessionId!==t&&(B.current={sessionId:t,tabs:new Set}),E!==null&&B.current.tabs.add(E);let H=B.current.tabs.has("files");(0,K.useEffect)(()=>{if(!It(t))return;if(v){l(null);return}if(s?.sessionId===t)return;let S=Yi(t);if(S!==null){l({sessionId:t,tab:S});return}let R=ta(t);if(R!==null){l({sessionId:t,tab:R});return}c.state==="ready"&&l({sessionId:t,tab:c.snapshot.dirty?"changes":"overview"})},[t,c,v,s?.sessionId]),(0,K.useEffect)(()=>{if(It(t))return Zi(t,S=>l({sessionId:t,tab:S}))},[t]);let F=(0,K.useRef)({tab:null});F.current={sessionId:t,tab:E},(0,K.useEffect)(()=>()=>{let{sessionId:S,tab:R}=F.current;S!==void 0&&R!==null&&ea(S,R)},[]);let ee=r&&It(t),[q,W]=(0,K.useState)(0),[j,Q]=(0,K.useState)(!1),te=async S=>{if(!It(t))return{ok:!1,error:n("error.noCwd")};let R=await x.run({sessionId:t,action:S});return R.ok?(tn(t).accept(R.snapshot),S.kind==="branch-checkout"&&W(oe=>oe+1),{ok:!0}):(S.kind==="branch-checkout"&&S.stashMessage!==void 0&&W(oe=>oe+1),tn(t).resync(),{ok:!1,error:vn(R.error.code,R.error.message,n)})},re=S=>{if(S===N)return;let R=++o.current;a(S),Pi(e,"fontDelta",S).then(oe=>{o.current===R&&(oe||a(null))})},de=c.state==="ready"?bs(c.snapshot.fontDelta):0,N=i??de;(0,K.useEffect)(()=>{i!==null&&de===i&&a(null)},[de,i]);let se=(0,K.useRef)(!1);(0,K.useEffect)(()=>{if(se.current||c.state!=="ready"||de!==0||typeof localStorage>"u")return;let S=localStorage.getItem(vs);if(S===null)return;let R=bs(Number(S));localStorage.removeItem(vs),R!==0&&(se.current=!0,Pi(e,"fontDelta",R))},[e,c,de]);let ce={overview:{full:"tab.overview",short:"tab.overviewShort"},changes:{full:"tab.changes",short:"tab.changesShort"},files:{full:"tab.files",short:"tab.filesShort"}},ie=[{key:"overview",label:n(g?ce.overview.short:ce.overview.full),icon:(0,K.createElement)(pr,{size:14})},{key:"changes",label:n(g?ce.changes.short:ce.changes.full),icon:(0,K.createElement)(sa,{size:14})},{key:"files",label:n(g?ce.files.short:ce.files.full),icon:(0,K.createElement)(ba,{size:14})}],le=v?ie.filter(S=>S.key==="files"):ie,D=(0,K.useId)(),M=le.map(S=>({value:S.key,label:[(0,K.createElement)("span",{key:"i",className:"gp-tab__icon"},S.icon),(0,K.createElement)("span",{key:"l",className:"gp-tab__label"},S.label)],id:`${D}-${S.key}`,panelId:`${D}-${S.key}-panel`})),V=E??le[0]?.key??"overview",O=!It(t)||c.state==="no-cwd"?(0,K.createElement)("div",{className:"gp-empty"},n("error.noCwd")):v?null:c.state==="error"?(0,K.createElement)("div",{className:"gp-empty"},n("pill.unavailable")):c.state==="cold"||c.state==="loading"||E===null?(0,K.createElement)("div",{className:"gp-empty"},n("common.loading")):null,z=S=>{if(O!==null)return S===V?O:null;if(!It(t))return null;if(v)return H?(0,K.createElement)(Mi,{key:t,remote:x,sessionId:t,compact:g,worktreeGen:q,snapshot:null,t:n}):null;if(c.state!=="ready")return null;let R=c.snapshot;return S==="overview"?B.current.tabs.has("overview")?(0,K.createElement)(Po,{key:t,remote:x,sessionId:t,visible:ee&&E==="overview",defaultDiffView:R.defaultDiffView,snapshot:R,onAction:te,onResync:()=>tn(t).resync(),compact:g,t:n}):null:S==="changes"?B.current.tabs.has("changes")?(0,K.createElement)($o,{key:t,remote:x,sessionId:t,visible:ee&&E==="changes",snapshot:R,onAction:te,onRefresh:()=>tn(t).refresh(),onSetFullChanges:oe=>tn(t).setFullChanges(oe),compact:g,cramped:k,t:n}):null:H?(0,K.createElement)(Mi,{key:t,remote:x,sessionId:t,compact:g,worktreeGen:q,snapshot:R,t:n}):null},Y=le.map(S=>(0,K.createElement)("div",{key:S.key,id:`${D}-${S.key}-panel`,role:"tabpanel","aria-labelledby":`${D}-${S.key}`,style:V===S.key?{display:"contents"}:{display:"none"}},z(S.key))),G=C?(0,K.createElement)("div",{className:"gp-files-wrap"},[j?null:(0,K.createElement)(Wt,{key:"notice",text:n("files.gitNotInstalled"),closeLabel:n("common.close"),onClose:()=>Q(!0)}),...Y]):(0,K.createElement)("div",{style:{display:"contents"}},Y);return(0,K.createElement)("div",{className:"gp-panel",ref:p,"data-conversation-composer-overlay":"","data-font-delta":N,"data-layout":g?"compact":"wide"},[(0,K.createElement)("div",{key:"tabs",className:"gp-tabbar"},[(0,K.createElement)(ws.SegmentedTabs,{key:"switcher",className:`gp-tabbar__tabs${le.length===1?" gp-tabbar__tabs--single":""}`,label:n("panel.tabs"),items:M,value:V,onChange:S=>{let R=le.find(oe=>oe.key===S);R!==void 0&&It(t)&&l({sessionId:t,tab:R.key})}}),(0,K.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[g||!h?null:(0,K.createElement)("div",{key:"font",className:"gp-font",role:"group","aria-label":n("panel.fontSize")},[(0,K.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease","aria-pressed":N===-1,onClick:()=>re(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,K.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset","aria-pressed":N===0,onClick:()=>re(0),"aria-label":n("panel.fontReset")},"A"),(0,K.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase","aria-pressed":N===1,onClick:()=>re(1),"aria-label":n("panel.fontIncrease")},"A+")]),g?null:(0,K.createElement)(zd,{key:"ver",remote:x,t:n})])]),(0,K.createElement)("div",{key:"body",className:"gp-body"},G)])}function zd({remote:e,t}){let[n,r]=(0,K.useState)({kind:"idle"}),{tipProps:i,tipNode:a}=$t({placement:"below",maxWidth:300});(0,K.useEffect)(()=>{let d=!0;return e.version({}).then(p=>{d&&"current"in p&&r(f=>({...f,info:p}))}),()=>{d=!1}},[e]);let o=async()=>{r(p=>({kind:"checking",info:p.info}));let d=await e.version({check:!0});r({kind:"idle",info:"current"in d?d:void 0})},s=n.info,l=n.kind==="checking"?(0,K.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):s===void 0||!s.checkedRemote?null:s.error!==void 0?(0,K.createElement)("span",{className:"gp-verbar__status gp-verbar__status--err",title:s.error},s.error==="repository is not configured"?t("version.noRepo"):t("version.error")):s.updateAvailable&&s.latest!==void 0?(0,K.createElement)("span",{},[(0,K.createElement)("span",{key:"s",className:"gp-verbar__status gp-verbar__status--new"},t("version.updateAvailable",{latest:s.latest,current:s.current})),s.releaseUrl!==void 0?(0,K.createElement)("a",{key:"l",className:"gp-verbar__link",href:s.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,K.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:s.current}));return(0,K.createElement)("div",{className:"gp-verbar"},[s!==void 0?(0,K.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${s.current}`):null,l,(0,K.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void o()},[(0,K.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,K.createElement)(nn,{size:12})),t("version.check")]),s?.repositoryUrl!==void 0?(0,K.createElement)("a",{key:"gh",className:"gp-icon-btn gp-verbar__gh gp-verbar__gh--starred",href:s.repositoryUrl,target:"_blank",rel:"noreferrer","aria-label":t("version.openRepo"),...i(t("version.openRepo"))},(0,K.createElement)(_a,{size:15})):null,a])}var Pe=require("react"),Cs=require("react-dom");var ks="data-gp-tab-dot",In,Ri=null,_s="",jr=null,Jr;function Hd(e){if(typeof document>"u")return null;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function Li(){let e=Hd(_s);if(e===null)return;let t=e.querySelector(`[${ks}]`);if(jr===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${jr}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(ks,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function Bd(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(Wi);if(e!==Ri){if(In?.disconnect(),Ri=e,e===null){In=void 0;return}In=new MutationObserver(()=>Li()),In.observe(e,{childList:!0,subtree:!0})}}function Id(){In?.disconnect(),In=void 0,Ri=null}function Ss(e,t,n){if(!(typeof document>"u")){if(n===null){Ai(e);return}Jr=e,_s=t,jr=n,Bd(),Li()}}function Ai(e){Jr!==void 0&&Jr!==e||(Jr=void 0,jr=null,Li(),Id())}function Od(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function Xd(){let[e,t]=(0,Pe.useState)(!1),[n,r]=(0,Pe.useState)(null),i=(0,Pe.useRef)(null);return(0,Pe.useLayoutEffect)(()=>{if(!e||i.current===null){r(null);return}let s=i.current.getBoundingClientRect();r({left:s.left,bottom:window.innerHeight-s.top+8})},[e]),{bind:{ref:s=>{i.current=s},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:s=>!e||n===null||typeof document>"u"?null:(0,Cs.createPortal)((0,Pe.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},s.map((l,d)=>(0,Pe.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function $d(e){let[t,n]=(0,Pe.useState)(!1);return(0,Pe.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let i=e.closest("[data-conversation-region]")??document.body,a=()=>n(i.clientWidth>0&&i.clientWidth<Kd);a();let o=new ResizeObserver(a);return o.observe(i),()=>o.disconnect()},[e]),t}var Kd=620;function Ts({sessionId:e,t}){let n=dr(e),r=Xd(),[i,a]=(0,Pe.useState)(null),o=$d(i),s=(0,Pe.useRef)(Symbol("gp-tab-dot")),l=n.state==="ready"&&n.snapshot.showInputPill===!1?n.snapshot.dirty?"dirty":"synced":null,d=t("panel.tab");if((0,Pe.useEffect)(()=>{Ss(s.current,d,l);let h=s.current;return()=>{Ai(h)}},[d,l]),n.state==="cold"||n.state==="loading"||n.state==="no-cwd")return null;if(n.state==="error")return n.error.code==="not-a-git-repo"||n.error.code==="git-unavailable"||n.error.showInputPill===!1?null:(0,Pe.createElement)("span",{className:"gp-pill gp-pill--degraded",title:n.error.detail??t("pill.unavailable")},t("pill.unavailable"));let p=n.snapshot;if(p.showInputPill===!1)return null;let f=Od(p.root),g=p.branch??`(${t("pill.detached")})`,k=p.dirty,c=k?"gp-pill--dirty":"gp-pill--synced",x=()=>{if(ra(d)){ia(d);return}It(e)&&Qi(e,k?"changes":"overview"),na(d)};return(0,Pe.createElement)("span",{className:"gp-pill-wrap",ref:a},[(0,Pe.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${c}${o?" gp-pill--compact":""}`,onClick:x,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,Pe.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,Pe.createElement)("span",{key:"repo",className:"gp-pill__repo"},f),(0,Pe.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,Pe.createElement)("span",{key:"b",className:"gp-pill__branch"},g),")"])]),r.render([p.root,t(k?"pill.dirty":"pill.synced")])])}var A=require("react"),Ur=require("@deepseek-ai/dsh-client-ui-primitives");function Es(e,t,n){return t===""?"":e.find(i=>i.id===t)?.models.some(i=>i.id===n)===!0?n:""}function Di(e,t,n,r){if(n==="")return"";let a=e.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.efforts;return a!==void 0&&a.some(o=>o.id===r)?r:""}var Jd="",Vr={min:Tt.maxBytes.min/1024,max:Tt.maxBytes.max/1024},qr={min:Tt.timeoutMs.min/1e3,max:Tt.timeoutMs.max/1e3};function Fi(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function jd(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Ns({ctx:e,t}){let[,n]=(0,A.useState)(0),[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)(!1),[s,l]=(0,A.useState)(null),[d,p]=(0,A.useState)(null),[f,g]=(0,A.useState)(null),[k,c]=(0,A.useState)(null),[x,h]=(0,A.useState)(null),[b,v]=(0,A.useState)(null),[C,E]=(0,A.useState)(null),[B,H]=(0,A.useState)(null),[F,ee]=(0,A.useState)(null),[q,W]=(0,A.useState)([]),[j,Q]=(0,A.useState)([]),[te,re]=(0,A.useState)("idle"),[de,N]=(0,A.useState)(null),[se,ce]=(0,A.useState)(!1),[ie,le]=(0,A.useState)(!1),[D,M]=(0,A.useState)(!1),V=()=>{n(w=>w+1)},O=e.get("configForms"),z=(0,A.useMemo)(()=>O?.describe(),[O]);(0,A.useEffect)(()=>{if(z!==void 0)return z.ensure(),z.subscribe(V)},[z]);let Y=z?.getSnapshot().view,G=(0,A.useMemo)(()=>Y===void 0?void 0:Gi(Y.namespaces),[Y]),S=(0,A.useMemo)(()=>O!==void 0&&G!==void 0?O.get(G):void 0,[O,G]);(0,A.useEffect)(()=>{if(S!==void 0)return S.subscribe(V)},[S]);let R=S?.getSnapshot(),oe=S!==void 0&&R!==void 0&&R.status==="ready",ke=z?.getSnapshot().status,Qe=s??(typeof R?.value?.showInputPill=="boolean"?R.value.showInputPill:!0),dt=d??(R?.value?.defaultDiffView==="split"?"split":"unified"),vt=f??(R?.value?.graphStyle==="compact"?"compact":"parallel"),rt=k??(R?.value?.fontDelta===-1||R?.value?.fontDelta===1?R.value.fontDelta:0),De=x??(typeof R?.value?.suggestEnabled=="boolean"?R.value.suggestEnabled:!0),wt=R?.value?.suggestLanguage,it=b??(typeof wt=="string"&&yr.includes(wt)?wt:di),Gt=Fi(typeof R?.value?.suggestMaxBytes=="number"?R.value.suggestMaxBytes/1024:Tt.maxBytes.default/1024,Vr),gt=Fi(typeof R?.value?.suggestMaxOutputTokens=="number"?R.value.suggestMaxOutputTokens:Tt.maxOutputTokens.default,Tt.maxOutputTokens),Ke=Fi(typeof R?.value?.suggestTimeoutMs=="number"?R.value.suggestTimeoutMs/1e3:Tt.timeoutMs.default/1e3,qr),Ye=typeof R?.value?.suggestProvider=="string"?R.value.suggestProvider:"",ft=typeof R?.value?.suggestModel=="string"?R.value.suggestModel:"",at=typeof R?.value?.suggestReasoningEffort=="string"?R.value.suggestReasoningEffort:"",ge=de?.provider??Ye,ve=de!==null?de.model:Ye!==""?ft:"",ze=de!==null?de.effort:at,He=ge!==""&&ve!==""?ze:"",Ie=q.find(w=>w.id===ge),Ze=Ie?.models.find(w=>w.id===ve),Je=Ze?.reasoning?.efforts,ot=()=>{re("loading"),pn(e).query({sessionId:Jd,query:{kind:"model-catalog"}}).then(w=>{let Ce=_e(w,"model-catalog");if(Ce===null){re("error");return}W(Ce.groups),Q(Ce.failures),re("ready")}).catch(()=>{re("error")})};(0,A.useEffect)(()=>{oe&&te==="idle"&&ot()},[oe]);let Ne=async(w,Ce,pe)=>{if(S!==void 0){o(!1),i(!0);try{let Oe=await S.set(w,Ce);pe(),Oe?$r():o(!0)}catch{pe(),o(!0)}finally{i(!1)}}},Me=w=>(l(w),Ne("showInputPill",w,()=>l(null))),xt=w=>w===dt?Promise.resolve():(p(w),Ne("defaultDiffView",w,()=>p(null))),kt=w=>w===vt?Promise.resolve():(g(w),Ne("graphStyle",w,()=>g(null))),Fe=w=>w===rt?Promise.resolve():(c(w),Ne("fontDelta",w,()=>c(null))),Pt=w=>(h(w),Ne("suggestEnabled",w,()=>h(null))),mt=w=>w===it?Promise.resolve():(v(w),Ne("suggestLanguage",w,()=>v(null))),Ee=async(w,Ce,pe)=>{if(S===void 0)return;o(!1),i(!0),N({provider:w,model:Ce,effort:pe});let Oe=!1;try{let Ht=await S.set("suggestProvider",w),Bt=await S.set("suggestModel",Ce),Lt=await S.set("suggestReasoningEffort",pe);Oe=Ht&&Bt&&Lt,Oe?$r():o(!0)}catch{o(!0)}finally{i(!1),(w===""||Ce!==""||!Oe)&&N(null)}},_t=w=>{if(w==="")return Ee("","","");let Ce=Es(q,w,ve),pe=Di(q,w,Ce,ze);return Ee(w,Ce,pe)},ae=w=>{if(w==="")return Ee(ge,"","");let Ce=Di(q,ge,w,ze);return Ee(ge,w,Ce)},et=w=>Ee(ge,ve,w),tt=(w,Ce,pe,Oe,Ht,Bt)=>{let Lt=w===null?null:jd(w);if(Lt===null)return Bt(),Promise.resolve();let jt=Math.min(Ce.max,Math.max(Ce.min,Math.floor(Lt)));return Ht(String(jt)),Ne(Oe,jt*pe,Bt)},Rt=w=>tt(w,Vr,1024,"suggestMaxBytes",E,()=>E(null)),St=w=>tt(w,Tt.maxOutputTokens,1,"suggestMaxOutputTokens",H,()=>H(null)),zt=w=>tt(w,qr,1e3,"suggestTimeoutMs",ee,()=>ee(null)),Z=[{id:"",label:t("cfg.suggestModelSession")},...q.map(w=>({id:w.id,label:w.name}))],X=[{id:"",label:t("cfg.suggestModelPick")},...(Ie?.models??[]).map(w=>({id:w.id,label:w.name}))],he=[{id:"",label:t("cfg.suggestEffortUnset")},...(Je??[]).map(w=>({id:w.id,label:w.name}))],je=(w,Ce,pe,Oe)=>qn(w,Ce,pe,{disabled:Oe,extraClass:"gp-cfg__select-trigger"}),Ve=r||R?.writable===!1,qe=ge===""?t("cfg.suggestModelSession"):q.find(w=>w.id===ge)?.name??ge,st=ve===""?t("cfg.suggestModelPick"):Ze?.name??ve,nt=He===""?t("cfg.suggestEffortUnset"):Je?.find(w=>w.id===He)?.name??He,lt=(0,A.createElement)(Ur.Menu,{key:"provider",open:se,onClose:()=>ce(!1),items:Z,selectedId:ge,onSelect:w=>{ce(!1),_t(w)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:je(se,qe,()=>ce(w=>!w),Ve||te==="loading")}),Jt=(0,A.createElement)(Ur.Menu,{key:"model",open:ie,onClose:()=>le(!1),items:X,selectedId:ve,onSelect:w=>{le(!1),ae(w)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:je(ie,st,()=>le(w=>!w),Ve||Ie===void 0)}),Yt=(0,A.createElement)(Ur.Menu,{key:"effort",open:D,onClose:()=>M(!1),items:he,selectedId:He,onSelect:w=>{M(!1),et(w)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:je(D,nt,()=>M(w=>!w),Ve)});return O===void 0?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):oe?(0,A.createElement)("div",{className:"gp-cfg"},[(0,A.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,A.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,A.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:Qe,disabled:r||R?.writable===!1,onChange:w=>{Me(w.currentTarget.checked)}}),(0,A.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,A.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,A.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,A.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},Qt(["unified","split"],dt,w=>{xt(w)},w=>t(w==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||R?.writable===!1)),(0,A.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,A.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,A.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},Qt(["parallel","compact"],vt,w=>{kt(w)},w=>t(w==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||R?.writable===!1)),(0,A.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,A.createElement)("h3",{key:"fonttitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.fontTitle")),(0,A.createElement)("div",{key:"fontseg",className:"gp-seg gp-cfg__seg"},Qt(["smaller","default","larger"],rt===-1?"smaller":rt===1?"larger":"default",w=>{Fe(w==="smaller"?-1:w==="larger"?1:0)},w=>t(w==="smaller"?"cfg.fontSmaller":w==="larger"?"cfg.fontLarger":"cfg.fontDefault"),r||R?.writable===!1)),(0,A.createElement)("p",{key:"fonthint",className:"gp-cfg__hint"},t("cfg.fontHint")),(0,A.createElement)("h3",{key:"sgtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.suggestTitle")),(0,A.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,A.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:De,disabled:r||R?.writable===!1,onChange:w=>{Pt(w.currentTarget.checked)}}),(0,A.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,A.createElement)("p",{key:"sglangtitle",className:"gp-cfg__seglabel"},t("cfg.suggestLangLabel")),(0,A.createElement)("div",{key:"sglang",className:"gp-seg gp-cfg__seg",role:"group","aria-label":t("cfg.suggestLangLabel")},Qt([...yr],it,w=>{mt(w)},w=>t(w==="auto"?"cfg.suggestLangAuto":w==="zh"?"cfg.suggestLangZh":"cfg.suggestLangEn"),r||R?.writable===!1)),(0,A.createElement)("p",{key:"sglanghint",className:"gp-cfg__rangehint"},t("cfg.suggestLangHint")),(0,A.createElement)("div",{key:"numax",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-maxkib"},t("cfg.suggestMaxBytesLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-maxkib",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:Vr.min,max:Vr.max,"aria-describedby":"gp-cfg-maxkib-hint",value:C??String(Gt),disabled:r||R?.writable===!1,onChange:w=>{E(w.currentTarget.value)},onBlur:()=>{Rt(C)},onKeyDown:w=>{w.key==="Enter"&&w.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestMaxBytesUnit"))]),(0,A.createElement)("p",{key:"numaxhint",id:"gp-cfg-maxkib-hint",className:"gp-cfg__rangehint"},t("cfg.suggestMaxBytesHint")),(0,A.createElement)("div",{key:"nuout",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-outtok"},t("cfg.suggestOutputLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-outtok",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:Tt.maxOutputTokens.min,max:Tt.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:B??String(gt),disabled:r||R?.writable===!1,onChange:w=>{H(w.currentTarget.value)},onBlur:()=>{St(B)},onKeyDown:w=>{w.key==="Enter"&&w.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestOutputUnit"))]),(0,A.createElement)("p",{key:"nuouthint",id:"gp-cfg-outtok-hint",className:"gp-cfg__rangehint"},t("cfg.suggestOutputHint")),(0,A.createElement)("div",{key:"nuto",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-timeout"},t("cfg.suggestTimeoutLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-timeout",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:qr.min,max:qr.max,"aria-describedby":"gp-cfg-timeout-hint",value:F??String(Ke),disabled:r||R?.writable===!1,onChange:w=>{ee(w.currentTarget.value)},onBlur:()=>{zt(F)},onKeyDown:w=>{w.key==="Enter"&&w.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestTimeoutUnit"))]),(0,A.createElement)("p",{key:"nutohint",id:"gp-cfg-timeout-hint",className:"gp-cfg__rangehint"},t("cfg.suggestTimeoutHint")),(0,A.createElement)("div",{key:"sgmodel",className:"gp-cfg__menur"},[(0,A.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestModelLabel")),lt]),ge!==""?(0,A.createElement)("div",{key:"sgmodel2",className:"gp-cfg__menur"},[(0,A.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestProviderLabel")),Jt]):null,ge!==""&&ve!==""&&Je!==void 0&&Je.length>0?(0,A.createElement)("div",{key:"sgeffort",className:"gp-cfg__menur"},[(0,A.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestEffortLabel")),Yt]):null,te==="loading"?(0,A.createElement)("p",{key:"sgload",className:"gp-cfg__rangehint"},t("cfg.suggestModelLoading")):te==="error"?(0,A.createElement)("p",{key:"sgerr",className:"gp-cfg__err",role:"alert"},[t("cfg.suggestModelFailed")," ",(0,A.createElement)("button",{key:"retry",type:"button",className:"gp-cfg__retry",onClick:()=>{ot()}},t("cfg.suggestModelRetry"))]):j.length>0?(0,A.createElement)("p",{key:"sgfail",className:"gp-cfg__rangehint"},`${t("cfg.suggestModelFailed")}: ${j.map(w=>w.name).join(", ")}`):q.length===0?(0,A.createElement)("p",{key:"sgempty",className:"gp-cfg__rangehint"},t("cfg.suggestModelEmpty")):null,(0,A.createElement)("p",{key:"sghint2",className:"gp-cfg__hint"},t("cfg.suggestHint")),a?(0,A.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):ke==="idle"||ke==="loading"?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var tr="gitPanel",Vd=["dsh-git-panel","@xbzbing/dsh-git-panel"],qd=["slots","locale","connection"],Ud="dsh-git-panel";function Wd(e){Bi(),ji(e),e.effect(()=>e.locale.register(tr,{zh:Ii,en:Oi})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(tr),n=[],r=i=>{typeof i=="function"&&n.push(i)};r(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:tr,label:()=>t("panel.tab")},i=>(0,Wr.createElement)(xs,{ctx:e,sessionId:i.sessionId,t})))),r(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:tr},i=>(0,Wr.createElement)(Ts,{sessionId:i.sessionId,t}))));for(let i of Vd)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:i,locale:tr},a=>a.view==="summary"?t("cfg.title"):(0,Wr.createElement)(Ns,{ctx:e,t}))));e.effect(()=>{let i=e.on("connection/reset",()=>Jn());return()=>{typeof i=="function"&&i();for(let a of n.splice(0))try{a()}catch{}Ui()}},"dsh-git-panel: lifecycle")}module.exports={name:Ud,inject:qd,apply:Wd};
|
|
827
921
|
return module.exports;
|
|
828
922
|
} });
|