@xbzbing/dsh-git-panel 1.5.3 → 1.6.0

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/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 en=require("react");var ma=`
3
+ "use strict";var bn=require("react");var Xa=`
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. */
@@ -88,6 +88,11 @@ var module = { exports: {} }; var exports = module.exports;
88
88
  .gp-branch-row--active,.gp-branch-row--active:hover{color:var(--dsw-alias-state-business-primary);background:var(--gp-select-bg);box-shadow:var(--gp-select-bar)}
89
89
  .gp-branch-row--current{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-business-primary))}
90
90
  .gp-branch-row__track{margin-left:auto;font-size:10px;color:var(--dsw-alias-label-tertiary)}
91
+ .gp-branch-row__switch{display:none;flex:none;margin:-2px 0 -2px auto;padding:0 7px;height:18px;border:1px solid var(--dsw-alias-border-l2);border-radius:5px;background:var(--dsw-alias-bg-layer-1);font:inherit;font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary);cursor:pointer}
92
+ .gp-branch-row__track+.gp-branch-row__switch{margin-left:0}
93
+ .gp-branch-row:hover .gp-branch-row__switch{display:inline-block}
94
+ .gp-branch-row__switch:hover{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary)}
95
+ .gp-branch-row__switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}
91
96
 
92
97
  /* left-column footer status bar: repo icon (left) + branch sync (right) */
93
98
  .gp-statusbar{flex:none;display:flex;align-items:center;gap:8px;min-height:30px;padding:4px 8px;border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);font-size:11px}
@@ -212,7 +217,7 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
212
217
  /* Fixed row height needs non-wrapping cells; a long line scrolls horizontally
213
218
  * on the container instead of growing the row past ROW_HEIGHT. */
214
219
  .gp-files__row .gp-diff-cell{white-space:pre;overflow:hidden;text-overflow:clip}
215
- .gp-files__image{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:center;justify-content:center;padding:16px;background-color:var(--dsw-alias-bg-layer-1);background-image:linear-gradient(45deg,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 75%,transparent 75%);background-size:16px 16px}
220
+ .gp-files__image{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:flex-start;padding:16px;background-color:var(--dsw-alias-bg-layer-1);background-image:linear-gradient(45deg,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 75%,transparent 75%);background-size:16px 16px}
216
221
  .gp-files__image img{max-width:100%;max-height:100%;object-fit:contain}
217
222
  .gp-changes__list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 0}
218
223
  /* Virtualized change list: a fixed-height relative spacer owns the scrollbar;
@@ -247,6 +252,7 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
247
252
  /* commit box */
248
253
  .gp-commitbox{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:8px 10px;display:flex;flex-direction:column;gap:8px}
249
254
  .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}
255
+ .gp-commitbox__msg[readonly]{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);cursor:progress}
250
256
  .gp-commitbox__msg:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
251
257
  .gp-commitbox__row{display:flex;align-items:center;gap:10px}
252
258
  .gp-commitbox__amend{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer}
@@ -255,6 +261,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
255
261
  /* diff view */
256
262
  .gp-diff{flex:1;min-height:0;display:flex;flex-direction:column}
257
263
  .gp-diff__toolbar{display:flex;align-items:center;gap:8px;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none}
264
+ /* Compact diff pane: controls (expand-all + mode seg) live on their own
265
+ * second row \u2014 one row cannot fit them at phone widths without the seg
266
+ * buttons wrapping into a squeezed stack. */
267
+ .gp-diff__toolbar--compact{flex-wrap:wrap;row-gap:6px}
268
+ .gp-diff__toolbar-row{display:flex;align-items:center;gap:8px;min-width:0}
269
+ .gp-diff__toolbar-row:first-child{flex:1 1 100%}
270
+ .gp-diff__toolbar-row--controls{flex:1 1 100%}
271
+ .gp-diff__toolbar-row--controls .gp-diff__expand{flex:none}
272
+ .gp-diff__toolbar-row--controls .gp-seg{flex:1}
273
+ .gp-diff__toolbar-row--controls .gp-seg__btn{flex:1;min-width:0}
258
274
  .gp-diff__path{font-size:12px;color:var(--dsw-alias-label-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
259
275
  .gp-diff__expand{border:1px solid var(--dsw-alias-border-l2);border-radius:7px}
260
276
  .gp-diff__expand:disabled{opacity:.45;cursor:not-allowed}
@@ -264,9 +280,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
264
280
  .gp-seg__btn--active{background:var(--dsw-alias-state-business-primary);color:#fff}
265
281
  .gp-seg__btn--active:hover{background:var(--dsw-alias-state-business-primary)}
266
282
  .gp-diff__scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;font-family:var(--dsw-font-mono,monospace);font-size:12px}
267
- /* DiffView wraps its Find bar + body so the bar can stick to the scroll top. */
268
- .gp-diff__wrap{display:flex;flex-direction:column;min-height:100%}
269
- .gp-diff__wrap .gp-find{position:sticky;top:0;z-index:2}
283
+ /* DiffView owns its scroller (the wrap fills the pane, the Find bar sits above
284
+ * the scrolling body) so the row window knows its viewport height on the first
285
+ * paint. */
286
+ .gp-diff__wrap{flex:1;min-height:0;display:flex;flex-direction:column}
287
+ .gp-diff__wrap .gp-find{flex:none}
288
+ /* Height band reserving the rows outside the mounted window; spans every grid
289
+ * column, so it takes a grid row of its own. */
290
+ .gp-diff__spacer{pointer-events:none}
270
291
  .gp-diff__side{display:grid;grid-template-columns:38px 1fr 38px 1fr}
271
292
  /* unified (inline) layout: old|new line-number gutters + a sign column + one
272
293
  * shared code column; add/del tint the whole code cell, not one side. */
@@ -300,13 +321,13 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
300
321
  .gp-imgcmp--single{grid-template-columns:1fr}
301
322
  .gp-imgcmp__pane{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--dsw-alias-bg-layer-2)}
302
323
  .gp-imgcmp__head{flex:none;padding:4px 10px;font-size:11px;color:var(--dsw-alias-label-tertiary);border-bottom:1px solid var(--dsw-alias-border-l2)}
303
- .gp-imgcmp__img{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:center;justify-content:center;padding:10px;background-color:var(--dsw-alias-bg-layer-1);background-image:linear-gradient(45deg,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 75%,transparent 75%);background-size:16px 16px}
324
+ .gp-imgcmp__img{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:flex-start;padding:10px;background-color:var(--dsw-alias-bg-layer-1);background-image:linear-gradient(45deg,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 75%,transparent 75%);background-size:16px 16px}
304
325
  .gp-imgcmp__img img{max-width:100%;max-height:100%;object-fit:contain;image-rendering:auto}
305
326
  .gp-imgcmp__missing{flex:1;display:flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary);font-size:12px;background:var(--dsw-alias-bg-layer-1)}
306
327
  /* SVG diff: render/source toggle bar above the rendered comparison or source diff */
307
328
  .gp-svgdiff{display:flex;flex-direction:column;height:100%;min-height:0}
308
329
  .gp-svgdiff__bar{flex:none;display:flex;justify-content:flex-end;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}
309
- .gp-svgdiff__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain}
330
+ .gp-svgdiff__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
310
331
  .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}
311
332
  .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}
312
333
 
@@ -324,7 +345,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
324
345
  .gp-modal__hash{font-family:var(--dsw-font-mono,ui-monospace,monospace);font-size:11px;color:var(--dsw-alias-label-tertiary);padding:2px 7px;border-radius:6px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-1));flex:none}
325
346
  .gp-modal__sum{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-family:var(--dsw-font-mono,ui-monospace,monospace);flex:none}
326
347
  .gp-modal__close{flex:none}
327
- .gp-modal__scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;font-family:var(--dsw-font-mono,monospace);font-size:12px;background:var(--dsw-alias-bg-layer-2)}
348
+ /* Compact modal bar: two rows (header / mode seg + close), mirroring the
349
+ * changes-pane toolbar. The seg stretches evenly and the bordered close
350
+ * button pins to the row's far right. */
351
+ .gp-modal__bar-row{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 100%}
352
+ .gp-modal__bar-row--controls .gp-seg{flex:1}
353
+ .gp-modal__bar-row--controls .gp-seg__btn{flex:1;min-width:0}
354
+ .gp-modal__bar-row--controls .gp-modal__close{margin-left:auto;border:1px solid var(--dsw-alias-border-l2);border-radius:7px}
355
+ .gp-modal__scroll{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;font-family:var(--dsw-font-mono,monospace);font-size:12px;background:var(--dsw-alias-bg-layer-2)}
328
356
 
329
357
  /* small dialog (tag create/delete, stash push/drop): auto-height form modal */
330
358
  .gp-modal--sm{width:min(460px,92vw);height:auto;max-height:min(560px,86vh)}
@@ -368,6 +396,18 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
368
396
  .gp-reset__ack{color:var(--dsw-alias-state-error-primary)}
369
397
  .gp-reset__dirtywarn{font-size:11px;line-height:1.5;color:var(--dsw-alias-state-warn-primary,#e0982e)}
370
398
 
399
+ /* branch-switch confirm: tracking note + dirty-work-tree warning + the switch mode radios */
400
+ .gp-bpick__extra{display:flex;flex-direction:column;gap:8px}
401
+ .gp-bpick__note{font-size:12px;line-height:1.5;color:var(--dsw-alias-label-secondary)}
402
+ .gp-bpick__warn{font-size:11px;line-height:1.5;color:var(--dsw-alias-state-warn-primary,#e0982e)}
403
+ .gp-bpick__modes{display:flex;flex-direction:column;gap:6px}
404
+ .gp-bpick__mode{display:flex;align-items:flex-start;gap:8px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;cursor:pointer}
405
+ .gp-bpick__mode--on{border-color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}
406
+ .gp-bpick__mode .gp-check{margin-top:2px;flex:none}
407
+ .gp-bpick__modetext{display:flex;flex-direction:column;gap:2px;min-width:0}
408
+ .gp-bpick__modelabel{font-size:12px;color:var(--dsw-alias-label-primary)}
409
+ .gp-bpick__modehint{font-size:11px;line-height:1.4;color:var(--dsw-alias-label-tertiary)}
410
+
371
411
  /* commit detail action area: tag chips on their own wrapping row (shown only
372
412
  * when tags exist), action buttons on a second row below */
373
413
  .gp-detail__ops{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:10px}
@@ -401,7 +441,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
401
441
  .gp-pill:hover{background:var(--dsw-alias-interactive-bg-hover)}
402
442
  .gp-pill__dot{display:none;flex:none;width:8px;height:8px;border-radius:50%;background:var(--dsw-alias-label-tertiary)}
403
443
  .gp-pill__repo{color:var(--dsw-alias-state-business-primary,#5ac8fa);flex:none;overflow:hidden;text-overflow:ellipsis}
404
- .gp-pill__git{margin-left:6px;display:inline-flex;align-items:center;min-width:0}
444
+ /* Spacing between the repo name and the branch group comes from the pill's own
445
+ * flex gap \u2014 an extra margin here would double it (12px rendered). */
446
+ .gp-pill__git{display:inline-flex;align-items:center;min-width:0}
405
447
  .gp-pill--synced .gp-pill__git{color:var(--dsw-alias-state-success-primary,#3fb950)}
406
448
  .gp-pill--dirty .gp-pill__git{color:var(--dsw-alias-state-warn-primary,#e0982e)}
407
449
  .gp-pill--synced .gp-pill__dot{background:var(--dsw-alias-state-success-primary,#3fb950)}
@@ -432,6 +474,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
432
474
  .gp-cfg__seg{align-self:flex-start}
433
475
  .gp-cfg__hint{margin:0;font-size:12px;line-height:1.6;color:var(--dsw-alias-label-tertiary)}
434
476
  .gp-cfg__err{margin:0;font-size:12px;color:var(--dsw-alias-state-error-primary)}
477
+ .gp-cfg__card{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2)}
478
+ .gp-cfg__card-title{margin:0;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}
479
+ .gp-cfg__numrow{display:flex;align-items:center;gap:8px}
480
+ .gp-cfg__numlabel{flex:1;min-width:0;font-size:13px;color:var(--dsw-alias-label-primary)}
481
+ .gp-cfg__numinput{flex:none;width:76px;height:26px;padding:0 8px;box-sizing:border-box;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;text-align:right}
482
+ .gp-cfg__numinput:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}
483
+ .gp-cfg__numinput:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}
484
+ .gp-cfg__numinput:disabled{opacity:.5;cursor:default}
485
+ .gp-cfg__numunit{flex:none;width:44px;font-size:11px;color:var(--dsw-alias-label-tertiary)}
486
+ .gp-cfg__rangehint{margin:-4px 0 0;font-size:11px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
435
487
 
436
488
  /* status dot appended to the shell's Git view-tab button \u2014 shown only when the
437
489
  * input-bar marker is hidden; colour mirrors the pill branch (synced/dirty). */
@@ -518,26 +570,64 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
518
570
  .gp-btn{height:36px}
519
571
  .gp-tree-row{padding-top:7px;padding-bottom:7px}
520
572
  .gp-branch-row{padding-top:8px;padding-bottom:8px}
573
+ .gp-branch-row__switch{display:inline-block;height:26px;line-height:24px;padding:0 10px;margin-block:-4px}
521
574
  }
522
575
 
523
576
  /* Diff modal on a small viewport (it is portaled outside .gp-panel, so this is
524
577
  * keyed on the viewport, not the panel attribute): near-fullscreen, wrapping
525
- * toolbar. The base rule already uses vw/vh, so this only tightens the fit. */
578
+ * toolbar. The base rule already uses vw/vh, so this only tightens the fit.
579
+ * The tall height applies to the full-size diff modal only \u2014 small confirm
580
+ * dialogs (.gp-modal--sm) stay content-sized, and the vertical inset leaves a
581
+ * tappable backdrop strip above/below the diff modal. The --sm override states
582
+ * height only: its base max-height:min(560px,86vh) already fits inside
583
+ * viewport-48px at every phone height, and re-declaring it here would raise the
584
+ * content cap to 100dvh-48px (~796px at 390\xD7844). */
526
585
  @media (max-width:640px){
527
- .gp-modal-backdrop{padding:10px}
528
- .gp-modal{width:96vw;height:90vh;border-radius:12px}
586
+ .gp-modal-backdrop{padding:24px 12px}
587
+ .gp-modal{width:96vw;height:min(90dvh,calc(100dvh - 48px));border-radius:12px}
588
+ .gp-modal--sm{height:auto}
529
589
  .gp-modal__bar{flex-wrap:wrap;row-gap:6px}
530
590
  }
531
591
 
592
+ /* Image zoom: relative wrapper + native-scroll viewport (the viewport class
593
+ * supplies background/padding) + a floating zoom bar. Centering runs through
594
+ * margin:auto \u2014 justify-content:center would make the overflow side of an
595
+ * oversized image unreachable. */
596
+ .gp-zoom{position:relative;display:flex;flex:1;min-width:0;min-height:0}
597
+ .gp-zoom__scroll{flex:1;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex}
598
+ /* flex:none is load-bearing: as a flex item a replaced element's automatic
599
+ * minimum size is its natural size, so without it flex-shrink pins the rendered
600
+ * image at max(natural, viewport) and zooming past 100% silently does nothing. */
601
+ .gp-zoom__img{display:block;flex:none;margin:auto;max-width:100%;max-height:100%;object-fit:contain;cursor:zoom-in}
602
+ /* Zoomed content is draggable with the mouse (see ImageZoom's drag-to-pan); the
603
+ * grab cursor replaces the zoom-in hint once a drag can actually pan. */
604
+ .gp-zoom[data-zoomed="true"] .gp-zoom__scroll,.gp-zoom[data-zoomed="true"] .gp-zoom__img{cursor:grab}
605
+ .gp-zoom[data-dragging="true"] .gp-zoom__scroll,.gp-zoom[data-dragging="true"] .gp-zoom__img{cursor:grabbing;user-select:none}
606
+ .gp-zoom__bar{position:absolute;right:10px;bottom:10px;display:flex;align-items:center;gap:2px;padding:4px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-2);box-shadow:0 4px 14px rgba(0,0,0,.18)}
607
+ .gp-zoom__btn{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:24px;padding:0 7px;border:0;border-radius:999px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;line-height:1;cursor:pointer}
608
+ .gp-zoom__btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
609
+ .gp-zoom__btn--text{font-size:11px;padding:0 9px;white-space:nowrap}
610
+ .gp-zoom__btn[aria-pressed="true"]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);color:var(--dsw-alias-state-business-primary)}
611
+ .gp-zoom__pct{min-width:50px;font-family:var(--dsw-font-mono,ui-monospace,monospace);font-size:11px;font-variant-numeric:tabular-nums}
612
+ /* Fullscreen zoom lightbox; mirrors the platform ImageLightbox contract. */
613
+ .gp-zl-backdrop{position:fixed;inset:0;z-index:1000}
614
+ .gp-zl-stage{position:absolute;inset:var(--dsh-frame-chrome-top,0px) 0 0;display:flex;align-items:center;justify-content:center;padding:40px}
615
+ .gp-zl-mask{position:absolute;inset:0;background:color-mix(in srgb,var(--dsw-alias-bg-base,#000) 62%,transparent);backdrop-filter:blur(2px);animation:gp-fade-in .12s ease}
616
+ .gp-zl-frame{position:relative;flex:1;height:100%;max-width:min(100%,1600px);min-width:0;display:flex}
617
+ /* The viewport carries .gp-zoom__scroll too, so only the img frame styling lives here. */
618
+ .gp-zl-viewport img{border-radius:var(--dsw-radius-lg);box-shadow:0 8px 40px rgba(0,0,0,.5)}
619
+ .gp-zl-close{position:absolute;top:20px;right:20px;z-index:1;display:grid;place-items:center;width:36px;height:36px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);cursor:pointer}
620
+ .gp-zl-close:hover{background:var(--dsw-alias-interactive-bg-hover)}
621
+ .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}
532
622
  @media (prefers-reduced-motion:reduce){
533
- .gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop{animation:none}
623
+ .gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop,.gp-zl-mask{animation:none}
534
624
  }
535
- `,cn=!1;function Bn(){if(cn||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){cn=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=ma,document.head.appendChild(t),cn=!0}var Xn={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","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.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.backToList":"\u8FD4\u56DE\u5217\u8868","overview.createTag":"\u521B\u5EFA\u6807\u7B7E","overview.revert":"\u8FD8\u539F\u6B64\u63D0\u4EA4","overview.reset":"\u91CD\u7F6E\u5230\u6B64","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.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.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","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.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.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.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","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":"\u4FEE\u6B63\u4E0A\u6B21\u63D0\u4EA4\uFF08amend\uFF09","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","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\u6807\u7B7E\u6216\u8D2E\u85CF\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\uFF09","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.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\u6700\u8FD1\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u751F\u6210\u7684\u8BF7\u6C42\u4F1A\u4F7F\u7528\u4F60\u5728 DSH \u4E2D\u914D\u7F6E\u7684\u6A21\u578B\uFF0Cdiff \u5185\u5BB9\u4F1A\u53D1\u9001\u7ED9\u6A21\u578B\u4F9B\u5E94\u5546\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"},Jn={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","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.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.backToList":"Back to list","overview.createTag":"Create tag","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.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.backToList":"Back to list","changes.stash":"Stash changes","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.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.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.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","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.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","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 tag or stash may have been removed)","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.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the recent commit style, filled in for you to edit before committing. Generation uses the model configured in DSH; the diff is sent to that model provider. 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 Ct=require("react");var ha=new Set(["cwd-unavailable"]),pn=3e4,ya=6e4,_t=class{constructor(t,n){this.remote=t;this.sessionId=n}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=pn;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}ensure(){this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){return this.inflight!==void 0?(this.pendingRefresh=!0,this.inflight):this.disposed?Promise.resolve():(this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(t=>{if(!this.disposed){if(t.ok)this.pollMs=t.value.refreshIntervalMs||pn,this.setView({state:"ready",snapshot:t.value});else if(t.error.code!=="cancelled")if(ha.has(t.error.code))this.pollMs=ya,this.setView({state:"no-cwd"});else if(t.error.code==="not-a-git-repo"){let n=t.error;this.setView({state:"error",error:{code:"not-a-git-repo",...n.cwd?{cwd:n.cwd}:{},...n.showInputPill!==void 0?{showInputPill:n.showInputPill}:{}}})}else if(t.error.code==="git-unavailable"){let n=t.error;this.setView({state:"error",error:{code:"git-unavailable",...n.detail?{detail:n.detail}:{},...n.cwd?{cwd:n.cwd}:{},...n.isGitRepo!==void 0?{isGitRepo:n.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:t.error.code,..."detail"in t.error?{detail:t.error.detail}:{}}})}}).catch(t=>{this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:t instanceof Error?t.message:String(t)}})}).finally(()=>{this.inflight=void 0,this.pendingRefresh&&!this.disposed?(this.pendingRefresh=!1,this.refresh()):this.schedulePoll()}),this.inflight)}resync(){this.disposed||this.refresh()}accept(t){this.disposed||(this.pollMs=t.refreshIntervalMs||pn,this.setView({state:"ready",snapshot:t}),this.schedulePoll())}schedulePoll(){this.disposed||(this.timer!==void 0&&clearTimeout(this.timer),!(this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.refresh()},this.pollMs)))}setView(t){this.view=t;for(let n of this.listeners)n()}dispose(){this.disposed=!0,this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0,this.listeners.clear()}};var ba="/api",va="gitPanel";function wa(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,a,i)=>n.call(t,ba,r,a,i)}catch{}}function xa(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 de(e,t){return!e.ok||e.value.kind!==t?null:e.value}function Me(e){return e!==void 0&&e!==""}var Kn=new WeakMap;function st(e){let t=Kn.get(e);if(t!==void 0)return t;let n=async(a,i,l)=>{let s=wa(e);if(s===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let o=await s(`${va}/${a}`,{args:{request:i}},l);return xa(o)}catch(o){return{ok:!1,error:{code:"git-unavailable",message:o instanceof Error?o.message:String(o)}}}},r={snapshot:(a,i)=>n("snapshot",a,i),run:(a,i)=>n("run",a,i),query:(a,i)=>n("query",a,i),suggest:(a,i)=>n("suggest",a,i),version:(a,i)=>n("version",a,i)};return Kn.set(e,r),r}var Fe=new Map,Vn,un;function On(e){un=e,Vn=st(e)}function lt(e){let t=Fe.get(e);if(t===void 0){let n=Vn??(un?st(un):void 0);t=new _t(n??Ca(),e),Fe.set(e,t)}return t}var ka=6e4,St=new Map;function _a(e){let t=St.get(e);t!==void 0&&(clearTimeout(t),St.delete(e)),Ve.set(e,(Ve.get(e)??0)+1)}function Sa(e){let t=(Ve.get(e)??1)-1;if(t>0){Ve.set(e,t);return}Ve.delete(e);let n=setTimeout(()=>{St.delete(e),!((Ve.get(e)??0)>0)&&(Fe.get(e)?.dispose(),Fe.delete(e))},ka);St.set(e,n)}var Ve=new Map;function dt(){for(let e of Fe.values())e.resync()}function qn(){for(let e of Fe.values())e.dispose();Fe.clear()}function Ca(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e}}function Tt(e){let[,t]=(0,Ct.useState)(0),n=e?lt(e):void 0;return(0,Ct.useEffect)(()=>{if(n===void 0||e===void 0)return;_a(e);let r=n.subscribe(()=>t(a=>a+1));return n.ensure(),()=>{r(),Sa(e)}},[n,e]),n?n.getSnapshot():{state:"cold"}}var E=require("react");var Wn="[data-conversation-tabs]",pt='[data-conversation-tabs] button[role="tab"]',gn=new Map,ct=new Map;function jn(e,t){let n=ct.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}gn.set(e,t)}function Un(e){let t=gn.get(e);return t===void 0?null:(gn.delete(e),t)}function Qn(e,t){let n=ct.get(e);return n===void 0&&(n=new Set,ct.set(e,n)),n.add(t),()=>{let r=ct.get(e);r!==void 0&&(r.delete(t),r.size===0&&ct.delete(e))}}var Ta=6e4,fn=new Map;function Yn(e,t){fn.set(e,{tab:t,leftAt:Date.now()})}function Zn(e){let t=fn.get(e);return t===void 0?null:Date.now()-t.leftAt>Ta?(fn.delete(e),null):t.tab}function er(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(pt);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function tr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(pt);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function nr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(pt);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var d=require("react"),Ot=require("react-dom");var R=require("react");function ue(e,t=15){return(0,R.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},e)}function Nt({size:e}){return ue([(0,R.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,R.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,R.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function rr({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M4 2v8"}),(0,R.createElement)("path",{key:"b",d:"M2 4h4"}),(0,R.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,R.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,R.createElement)("path",{key:"e",d:"M12 6v4"}),(0,R.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function mn({size:e}){return ue([(0,R.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,R.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,R.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,R.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,R.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function Oe({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M2 7V3h4l8 8-4 4z"}),(0,R.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e)}function Pe({size:e,open:t}){return ue([(0,R.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function qe({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function We({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,R.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function ar({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function Et({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,R.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function ir({size:e}){return ue([(0,R.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,R.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function or({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,R.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function hn({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,R.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,R.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function sr({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,R.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,R.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function lr({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,R.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function Rt({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M13 3v10"}),(0,R.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function dr({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,R.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,R.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function cr({size:e=15}){return(0,R.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,R.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 pr({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,R.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,R.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function yn({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,R.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,R.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function ur({size:e}){return ue([(0,R.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,R.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,R.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,R.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function gr({size:e=15,filled:t}){return(0,R.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,R.createElement)("path",{d:"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 fr(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 mr(e,t){let n=[],r=[],a=[],i=[],l=0,s=()=>{if(i.length===0)return l++;let c=Math.min(...i);return i.splice(i.indexOf(c),1),c},o=c=>{c!==null&&!i.includes(c)&&i.push(c)};for(let c of e){let p=v=>{let L=r.findIndex(P=>P===v);return L===-1&&(L=r.findIndex(P=>P===null),L===-1&&(L=r.length,r.push(null),a.push(null)),r[L]=v,a[L]=s()),L},u=r.some(v=>v===c.hash),f=p(c.hash),w=a[f],b=[...r],k=[...a],_=c.parents,N=_.length>=2;for(let v=0;v<r.length;v++)v!==f&&r[v]===c.hash&&(o(a[v]),r[v]=null,a[v]=null);let A=-1,J=[];if(_.length===0)o(a[f]),r[f]=null,a[f]=null;else{let v=_[0],L=t==="compact"?r.findIndex((P,W)=>P===v&&W!==f):-1;if(L===-1)r[f]=v,A=f;else{let P=Math.min(f,L),W=Math.max(f,L);r[P]=v,o(a[W]),r[W]=null,a[W]=null,A=P}for(let P=1;P<_.length;P++)J.push(p(_[P]))}let M=[];for(let v=0;v<b.length;v++){let L=b[v];if(L!==null)if(L===c.hash){if(v===f&&!u)continue;M.push({fromLane:v,toLane:f,color:k[v],kind:"into"})}else{let P=r[v]===L?v:r.findIndex(W=>W===L);P!==-1&&M.push({fromLane:v,toLane:P,color:k[v],kind:"pass"})}}A!==-1&&M.push({fromLane:f,toLane:A,color:a[A],kind:"out"});for(let v of J)M.push({fromLane:f,toLane:v,color:a[v],kind:"out"});for(n.push({commit:c,lane:f,color:w,edges:M,merge:N});r.length>0&&r[r.length-1]===null;)r=r.slice(0,-1),a=a.slice(0,-1)}return n}function hr(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(l=>l!==""),a=t,i="";for(let l=0;l<r.length;l++){let s=r[l];i=i===""?s:`${i}/${s}`;let o=l===r.length-1,c=a.children.find(p=>p.name===s&&p.dir===!o);c===void 0&&(c={name:s,path:i,dir:!o,children:[],...o?{meta:n.meta}:{}},a.children.push(c)),a=c}}return yr(t),br(t.children)}function yr(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)yr(t)}function br(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:br(n.children)}})}function je(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),i=Math.floor(a/6e4);if(i<1)return n("time.justNow");if(i<60)return n("time.minutesAgo",{n:i});let l=Math.floor(i/60);if(l<24)return n("time.hoursAgo",{n:l});let s=Math.floor(l/24);return n("time.daysAgo",{n:s})}function ut(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 bn(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 Gt={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function Mt(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}var x=require("react");var Na={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 vn(e){let t=e.lastIndexOf(".");return t<0?null:Na[e.slice(t+1).toLowerCase()]??null}function vr(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function wr(e){return vn(e)!==null}function xr(e){return/\.svg$/i.test(e)}function Ea(e){let t=wn(e);return t.length===0?!1:t.every(n=>n.startsWith("+")||n.startsWith(" "))&&t.some(n=>n.startsWith("+"))&&/^\+\+\+ /m.test(e)&&/--- \/dev\/null/m.test(e)}function Ra(e){let t=wn(e);return t.length===0?!1:t.every(n=>n.startsWith("-")||n.startsWith(" "))&&t.some(n=>n.startsWith("-"))&&/^\+\+\+ \/dev\/null/m.test(e)}function wn(e){let t=e.split(`
536
- `),n=[],r=!1;for(let a of t){if(a.startsWith("@@")){r=!0;continue}if(r){if(a.startsWith("diff ")||a.startsWith("index ")){r=!1;continue}a!==""&&n.push(a)}}return n}function kr(e){let t=0,n=0;for(let r of wn(e))r.startsWith("+")?t++:r.startsWith("-")&&n++;return{add:t,del:n}}var Ga=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function _r(e){let t=[],n=e.split(`
537
- `),r=0,a=0,i=!0,l=!1,s=0;for(;s<n.length&&!n[s].startsWith("@@");s++);for(;s<n.length;s++){let o=n[s];if(o.startsWith("@@")){let u=Ga.exec(o);if(u){let f=Number(u[1]),w=Number(u[3]),b=f-w;if(i)w>1&&t.push(Ue({rightStart:1,count:w-1,delta:b,atStart:!0,atEnd:!1}));else{let k=w-a;k>0&&t.push(Ue({rightStart:a,count:k,delta:b,atStart:!1,atEnd:!1}))}r=f,a=w,i=!1}t.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:o});continue}if(o.startsWith("\\"))continue;let c=o[0],p=o.slice(1);c==="+"?(t.push({kind:"add",leftNo:null,rightNo:a,leftText:null,rightText:p}),a++,l=!0):c==="-"?(t.push({kind:"del",leftNo:r,rightNo:null,leftText:p,rightText:null}),r++,l=!0):c===" "&&(t.push({kind:"context",leftNo:r,rightNo:a,leftText:p,rightText:p}),r++,a++,l=!0)}return l&&!i&&!Ea(e)&&!Ra(e)&&t.push(Ue({rightStart:a,count:null,delta:r-a,atStart:!1,atEnd:!0})),Ma(t)}function Ue(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function Ma(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let a=[],i=n;for(;i<e.length&&e[i].kind==="del";)a.push(e[i]),i++;let l=[];for(;i<e.length&&e[i].kind==="add";)l.push(e[i]),i++;let s=Math.max(a.length,l.length);for(let o=0;o<s;o++){let c=a[o],p=l[o];if(c&&p){let u=Pa(c.leftText??"",p.rightText??"");t.push({kind:"mod",leftNo:c.leftNo,rightNo:p.rightNo,leftText:c.leftText,rightText:p.rightText,...u!==null?{leftWord:u.left,rightWord:u.right}:{}})}else c?t.push({kind:"del",leftNo:c.leftNo,rightNo:null,leftText:c.leftText,rightText:null}):p&&t.push({kind:"add",leftNo:null,rightNo:p.rightNo,leftText:null,rightText:p.rightText})}n=i}else t.push(r),n++}return t}function Pa(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 Da(e,t,n){return n.map((r,a)=>{let i=t+a;return{kind:"context",leftNo:i+e,rightNo:i,leftText:r,rightText:r}})}var ke=20;function xn(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 Sr(e,t,n,r,a,i){let l=e.findIndex(u=>u.kind==="gap"&&u.gap?.rightStart===t);if(l<0)return e.slice();let s=e[l].gap,o=Da(s.delta,r,a),c=[];if(s.atEnd)return c.push(...o),!i&&a.length>0&&c.push(Ue({rightStart:r+a.length,count:null,delta:s.delta,atStart:!1,atEnd:!0})),[...e.slice(0,l),...c,...e.slice(l+1)];let p=s.count??a.length;if(n==="all"||a.length>=p)c.push(...o);else if(n==="down"){c.push(...o);let u=p-a.length;c.push(Ue({rightStart:s.rightStart+a.length,count:u,delta:s.delta,atStart:!1,atEnd:!1}))}else{let u=p-a.length;c.push(Ue({rightStart:s.rightStart,count:u,delta:s.delta,atStart:s.atStart,atEnd:!1})),c.push(...o)}return[...e.slice(0,l),...c,...e.slice(l+1)]}var Bt=require("@deepseek-ai/dsh-client-ui-primitives");function Cr(e,t){let n=[[],[],[]],r=0;for(let a of e){let i=r+a.text.length,l=[r,Math.max(r,Math.min(i,t[0])),Math.max(r,Math.min(i,t[1])),i];for(let s=0;s<3;s++){let o=a.text.slice(l[s]-r,l[s+1]-r);o!==""&&n[s].push({text:o,style:a.style})}r=i}return n}var ye=require("react"),Pt=5e3,Dt=120;function At(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 Lt(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 kn(e,t,n,r,a){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let i=[],l=0,s=0;for(let o of e){let c=l+o.text.length,p=Math.max(n,l),u=Math.min(r,c);if(u>p&&i.push((0,ye.createElement)("span",{key:`${a}-${s++}`,style:o.style},o.text.slice(p-l,u-l))),l=c,l>=r)break}return i}function Ht(e,t,n,r,a,i){let l=[],s=0,o=[...t].sort((c,p)=>c[0]-p[0]);for(let[c,p]of o){if(c<s)continue;c>s&&l.push(...kn(n,e,s,c,`${r}b${s}`));let u=a!==null&&a[0]===c&&a[1]===p;l.push((0,ye.createElement)("mark",{key:`mk${r}-${c}`,className:`gp-find-hit${u?" gp-find-hit--active":""}`,...u?{ref:i}:{}},kn(n,e,c,p,`mk${r}-${c}`))),s=p}return s<e.length&&l.push(...kn(n,e,s,e.length,`${r}e`)),l}function Ft(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 Ne=require("react");function zt(e,t,n){let r=n(`diff.${e}`);return(0,Ne.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,Ne.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,Ne.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,Ne.createElement)("div",{key:"img",className:"gp-imgcmp__img"},(0,Ne.createElement)("img",{src:t,alt:r}))])}function Tr({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,Ne.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},zt("before",e,r)):n==="after"?(0,Ne.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},zt("after",t,r)):(0,Ne.createElement)("div",{className:"gp-imgcmp"},[zt("before",e,r),zt("after",t,r)])}var Xt=(0,x.memo)(function({text:t,mode:n,path:r,remote:a,sessionId:i,imageSpec:l,t:s}){let o=(0,x.useMemo)(()=>_r(t),[t]),c=vr(t),p=(0,Bt.useCodeHighlighter)(r===void 0?void 0:(0,Bt.languageForPath)(r)),[u,f]=(0,x.useState)(o);(0,x.useEffect)(()=>{f(o)},[o]);let w=Ha(u,f,a,i,r,l),b=r!==void 0&&xr(r),[k,_]=(0,x.useState)("render");(0,x.useEffect)(()=>{_("render")},[r]);let A=(c||b)&&r!==void 0&&wr(r)&&a!==void 0&&i!==void 0&&l!==void 0&&(!b||k==="render"),J=za(A?a:void 0,A?i:void 0,A?r:void 0,A?l:void 0),[M,v]=(0,x.useState)(!1),[L,P]=(0,x.useState)(""),[W,S]=(0,x.useState)(!1),[$,se]=(0,x.useState)(0),ee=(0,x.useRef)(null),ce=(0,x.useRef)(null),ne=(0,x.useRef)(null);(0,x.useEffect)(()=>{v(!1),P(""),se(0)},[t,r]);let z=(0,x.useMemo)(()=>Aa(n,u),[n,u]),te=(0,x.useMemo)(()=>z.map(Z=>({key:Z.key,text:Z.text.toLowerCase()})),[z]),T=At(L,Dt),pe=W?T:T.toLowerCase(),H=W?z:te,C=(0,x.useMemo)(()=>La(H,pe),[H,pe]);(0,x.useEffect)(()=>{se(0)},[pe]);let I=C.length===0?0:Math.min($,C.length-1),X=C.length>0?C[I]:null,Q=(0,x.useMemo)(()=>{let Z=new Map;for(let Y of C){let he=Z.get(Y.cellKey)??[];he.push([Y.start,Y.end]),Z.set(Y.cellKey,he)}return Z},[C]);(0,x.useEffect)(()=>{let Z=Y=>{if(!((Y.ctrlKey||Y.metaKey)&&(Y.key==="f"||Y.key==="F")))return;let he=ee.current;he===null||he.offsetParent===null||(Y.preventDefault(),v(!0),requestAnimationFrame(()=>ce.current?.select()))};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[]),(0,x.useEffect)(()=>{ne.current?.scrollIntoView({block:"center",inline:"nearest"})},[I,C]);let ge=(0,x.useCallback)(Z=>{se(Y=>C.length===0?0:(Y+Z+C.length)%C.length)},[C.length]),D=M&&pe!==""?{perCell:Q,activeKey:X?.cellKey??null,activeRange:X?[X.start,X.end]:null,activeRef:ne}:null;if(A){let Z=(()=>{if(J.kind==="idle"||J.kind==="loading")return(0,x.createElement)("div",{className:"gp-empty"},s("common.loading"));if(J.kind==="ready"){let Y=J.res;if(Y.tooLarge===!0)return(0,x.createElement)("div",{className:"gp-empty"},s("diff.tooLarge"));if(Y.mime!==null&&(Y.old!==void 0||Y.new!==void 0))return(0,x.createElement)(Tr,{oldUrl:Y.old,newUrl:Y.new,mode:n,t:s})}return(0,x.createElement)("div",{className:"gp-empty"},s("diff.binary"))})();return b?Nr(k,_,Z,s):Z}if(c&&!b)return(0,x.createElement)("div",{className:"gp-empty"},s("diff.binary"));let re=(()=>{if(t.trim()==="")return(0,x.createElement)("div",{className:"gp-empty"},s("diff.empty"));if(n==="before")return Er(Gr(u),p,D);if(n==="after")return Er(Mr(u),p,D);if(n==="unified"){let Z=xn(u);return(0,x.createElement)("div",{className:"gp-diff__unified"},Z.flatMap((Y,he)=>Ia(Y,he,p,w,D,s)))}return(0,x.createElement)("div",{className:"gp-diff__side"},u.flatMap((Z,Y)=>$a(Z,Y,p,w,D,s)))})(),me=M?(0,x.createElement)(Ft,{inputRef:ce,query:L,matches:C.length,active:I,caseSensitive:W,onChange:P,onToggleCase:()=>S(Z=>!Z),onStep:ge,onClose:()=>v(!1),t:s}):null,ve=(0,x.createElement)("div",{className:"gp-diff__wrap",ref:ee},[me,re]);return b?Nr(k,_,ve,s):ve});function Aa(e,t){let n=[];return e==="before"?(Gr(t).forEach((r,a)=>n.push({key:`c${a}`,text:r.text})),n):e==="after"?(Mr(t).forEach((r,a)=>n.push({key:`c${a}`,text:r.text})),n):e==="unified"?(xn(t).forEach((r,a)=>{if(r.kind==="hunk"||r.kind==="gap")return;let i=r.rightText??r.leftText??"";i!==""&&n.push({key:`c${a}`,text:i})}),n):(t.forEach((r,a)=>{r.kind==="hunk"||r.kind==="gap"||(r.leftText!==null&&r.leftText!==""&&n.push({key:`l${a}`,text:r.leftText}),r.rightText!==null&&r.rightText!==""&&n.push({key:`r${a}`,text:r.rightText}))}),n)}function La(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[a,i]of Lt(r.text,t))if(n.push({cellKey:r.key,start:a,end:i}),n.length>=Pt)return n;return n}function Nr(e,t,n,r){let a=(i,l)=>(0,x.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${e===i?" gp-seg__btn--active":""}`,"aria-pressed":e===i,onClick:()=>t(i)},l);return(0,x.createElement)("div",{className:"gp-svgdiff"},[(0,x.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,x.createElement)("div",{className:"gp-seg"},[a("render",r("diff.svgRender")),a("source",r("diff.svgSource"))])),(0,x.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function Ha(e,t,n,r,a,i){let[l,s]=(0,x.useState)(null),o=(0,x.useRef)(0);(0,x.useEffect)(()=>{o.current+=1,s(null)},[e]);let c=(0,x.useCallback)((p,u)=>{if(n===void 0||r===void 0||a===void 0||i===void 0)return;let f=`${p.rightStart}:${u}`;s(f);let w=++o.current,{start:b,end:k}=Fa(p,u),_=i.base==="commit"&&i.commit!==void 0?{kind:"file-lines",path:a,base:"commit",commit:i.commit,start:b,end:k}:i.base==="staged"?{kind:"file-lines",path:a,base:"staged",start:b,end:k}:{kind:"file-lines",path:a,base:"worktree",start:b,end:k};n.query({sessionId:r,query:_}).then(N=>{if(w!==o.current)return;let A=de(N,"file-lines");s(null),A!==null&&t(J=>Sr(J,p.rightStart,u,A.start,A.lines,A.eof))}).catch(()=>{w===o.current&&s(null)})},[n,r,a,i,t]);return{busy:l,run:c}}function Fa(e,t){if(e.atEnd)return{start:e.rightStart,end:e.rightStart+ke-1};let n=e.count??ke;return t==="all"||n<=ke?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+ke-1}:{start:e.rightStart+n-ke,end:e.rightStart+n-1}}function za(e,t,n,r){let[a,i]=(0,x.useState)({kind:"idle"}),l=r?.base,s=r?.commit;return(0,x.useEffect)(()=>{if(e===void 0||t===void 0||n===void 0||l===void 0)return;let o=!0;i({kind:"loading"});let c=l==="commit"&&s!==void 0?{kind:"image-diff",path:n,base:"commit",commit:s}:l==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"};return e.query({sessionId:t,query:c}).then(p=>{if(!o)return;let u=de(p,"image-diff");i(u!==null?{kind:"ready",res:u}:{kind:"failed"})}).catch(()=>{o&&i({kind:"failed"})}),()=>{o=!1}},[e,t,n,l,s]),a}function $t(e,t=""){return e.map((n,r)=>(0,x.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function Rr(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 i=n.activeKey===t?n.activeRange:null;return Ht(e,a,r,t,i,n.activeRef)}function It(e,t,n,r,a=null){if(n==="")return(0,x.createElement)("div",{key:t,className:e},"\xA0");let i=r(n)?.[0],l=Rr(n,t,a,i);return l!==null?(0,x.createElement)("div",{key:t,className:e},l):(0,x.createElement)("div",{key:t,className:e},i===void 0?n:$t(i))}function _n(e,t,n,r,a,i,l=null){let s=i(n)?.[0]??[{text:n,style:{}}],o=Rr(n,t,l,s);if(o!==null)return(0,x.createElement)("div",{key:t,className:e},o);let[c,p,u]=Cr(s,r);return(0,x.createElement)("div",{key:t,className:e},[...$t(c,"p"),(0,x.createElement)("span",{key:"w",className:a},p.length===0?"\xA0":$t(p)),...$t(u,"s")])}function Gr(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function Mr(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function Er(e,t,n=null){return(0,x.createElement)("div",{className:"gp-diff__single"},e.flatMap((r,a)=>[(0,x.createElement)("div",{key:`n${a}`,className:"gp-diff-no"},r.no??""),It("gp-diff-cell",`c${a}`,r.text,t,n)]))}function $a(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,x.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"}},e.text??"")];if(e.kind==="gap")return[Pr(e.gap,t,r,i)];let l=e.kind==="del"||e.kind==="mod"?"gp-diff-row--del":"",s=e.kind==="add"||e.kind==="mod"?"gp-diff-row--add":"",o=e.leftText===null?(0,x.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${l}`}):e.kind==="mod"&&e.leftWord!==void 0?_n(`gp-diff-cell ${l}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,a):It(`gp-diff-cell ${l}`,`l${t}`,e.leftText,n,a),c=e.rightText===null?(0,x.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.rightWord!==void 0?_n(`gp-diff-cell ${s}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,a):It(`gp-diff-cell ${s}`,`r${t}`,e.rightText,n,a);return[(0,x.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),o,(0,x.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),c]}function Ia(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,x.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"}},e.text??"")];if(e.kind==="gap")return[Pr(e.gap,t,r,i)];let l=e.kind==="del",s=e.kind==="add",o=s?"gp-diff-row--add":l?"gp-diff-row--del":"",c=s?"+":l?"\u2212":"\xA0",p=e.rightText??e.leftText??"",u=s?e.rightWord:l?e.leftWord:void 0,f=s?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",w=`gp-diff-cell gp-diff-uni__code ${o}`,b=u!==void 0?_n(w,`c${t}`,p,u,f,n,a):It(w,`c${t}`,p,n,a);return[(0,x.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,x.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,x.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${o}`},c),b]}function Pr(e,t,n,r){let a=n.busy===`${e.rightStart}:all`,i=n.busy===`${e.rightStart}:up`,l=n.busy===`${e.rightStart}:down`,s=(c,p,u)=>(0,x.createElement)("button",{key:c,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:f=>{f.stopPropagation(),n.run(e,c)}},u?r("common.loading"):p),o=[];if(e.atEnd)o.push(s("down",r("diff.expandDown",{n:ke}),l));else{let c=e.count??0;c>0&&c<=ke?o.push(s("all",r("diff.expandGap",{n:c}),a)):(e.atStart||o.push(s("up",r("diff.expandUp",{n:ke}),i)),o.push(s("all",r("diff.expandGap",{n:c}),a)),o.push(s("down",r("diff.expandDown",{n:ke}),l)))}return(0,x.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"}},o)}function Jt(e){return kr(e)}var F=require("react");var Ba=100;function Dr(e,t,n){let[r,a]=(0,F.useState)(null),[i,l]=(0,F.useState)(!1),[s,o]=(0,F.useState)([]),c=(0,F.useCallback)(()=>{l(!1),(async()=>{let[p,u]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]),f=de(p,"branches");if(f===null){l(!0);return}let w=de(u,"tags");a({current:f.current,defaultBranch:f.defaultBranch,local:f.local,remote:f.remote,tags:w?.tags??[]}),e.query({sessionId:t,query:{kind:"authors"}}).then(b=>{o(de(b,"authors")?.authors??[])})})()},[e,t]);return(0,F.useEffect)(()=>{c()},[n]),{tree:r,treeError:i,authors:s,reload:c}}function Ar(e,t,n,r,a){let[i,l]=(0,F.useState)([]),[s,o]=(0,F.useState)(0),[c,p]=(0,F.useState)(!1),[u,f]=(0,F.useState)(!1),w=(0,F.useRef)(0),b=(0,F.useRef)(!1),k=(0,F.useRef)(null),_=(0,F.useCallback)(async(M,v)=>{if(b.current)return;b.current=!0;let L=w.current;p(!0),f(!1);let P=await e.query({sessionId:t,query:{kind:"history",limit:Ba,skip:M,...v.ref?{ref:v.ref}:{},...v.search?{search:v.search}:{},...v.author?{author:v.author}:{},...v.since?{since:v.since}:{}}});if(b.current=!1,L!==w.current)return;p(!1);let W=de(P,"history");if(W===null){f(!0);return}let S=W.commits;l($=>M===0?S:[...$,...S]),o(W.total)},[e,t]),N=(0,F.useRef)(n);(0,F.useEffect)(()=>{w.current+=1,b.current=!1,N.current!==n&&(N.current=n,a(),k.current&&(k.current.scrollTop=0)),_(0,n)},[n,r]);let A=s<0?!0:i.length<s,J=(0,F.useCallback)(()=>{b.current||!A||_(i.length,n)},[_,i.length,n,A]);return{commits:i,total:s,loading:c,listError:u,hasMore:A,listRef:k,loadMore:J}}function Lr(e,t,n){let[r,a]=(0,F.useState)(null),[i,l]=(0,F.useState)(null),[s,o]=(0,F.useState)(!1),[c,p]=(0,F.useState)(null),[u,f]=(0,F.useState)(null),[w,b]=(0,F.useState)(!1),[k,_]=(0,F.useState)(n),[N,A]=(0,F.useState)(!1),J=(0,F.useRef)(0),M=(0,F.useRef)(null),v=(0,F.useRef)(new Map),L=(0,F.useCallback)((C,I)=>{let X=v.current;for(X.set(C,I);X.size>50;){let Q=X.keys().next().value;if(Q===void 0)break;X.delete(Q)}},[]),P=(0,F.useCallback)(()=>{a(null),l(null),M.current=null},[]),W=(0,F.useCallback)(C=>{M.current===C.hash&&a(C)},[]),S=(0,F.useCallback)(async C=>{M.current=C.hash,a(C),o(!1),J.current+=1,p(null),f(null),b(!1);let I=v.current.get(C.hash);if(I!==void 0){l(I);return}l(null);let X=await e.query({sessionId:t,query:{kind:"show",ref:C.hash}});if(M.current!==C.hash)return;let Q=de(X,"show");if(Q!==null){let ge={commit:Q.commit,body:Q.body,stats:Q.stats,insertions:Q.insertions,deletions:Q.deletions};L(C.hash,ge),l(ge)}else o(!0)},[e,t,L]),$=(0,F.useCallback)(async(C,I,X,Q=!1)=>{let ge=++J.current;p({path:C,hash:I,shortHash:X}),f(null),b(!1),A(Q);let D=await e.query({sessionId:t,query:{kind:"diff",path:C,base:"commit",commit:I,...Q?{context:1e5}:{}}});if(ge!==J.current)return;let re=de(D,"diff");re!==null?f(re.text):b(!0)},[e,t]),se=(0,F.useCallback)(()=>{J.current+=1,p(null),f(null),b(!1),A(!1)},[]);(0,F.useEffect)(()=>{if(c===null)return;let C=I=>{I.key==="Escape"&&se()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[c,se]);let[ee,ce]=(0,F.useState)(null),[ne,z]=(0,F.useState)(null),te=(0,F.useRef)(void 0),T=(0,F.useRef)(null),pe=(0,F.useCallback)((C,I,X)=>{te.current!==void 0&&clearTimeout(te.current),te.current=setTimeout(()=>{T.current=C.hash,ce({commit:C,x:I,y:X});let Q=v.current.get(C.hash);if(Q!==void 0){z(Q.body);return}z(null),e.query({sessionId:t,query:{kind:"show",ref:C.hash}}).then(ge=>{if(T.current!==C.hash)return;let D=de(ge,"show");D!==null?(L(C.hash,{commit:D.commit,body:D.body,stats:D.stats,insertions:D.insertions,deletions:D.deletions}),z(D.body)):z("")})},260)},[e,t,L]),H=(0,F.useCallback)(()=>{te.current!==void 0&&clearTimeout(te.current),T.current=null,ce(null),z(null)},[]);return(0,F.useEffect)(()=>()=>{te.current!==void 0&&clearTimeout(te.current)},[]),{selected:r,detail:i,detailError:s,select:S,resyncSelected:W,clearSelection:P,fileDiff:c,fileDiffText:u,fileDiffError:w,fileDiffMode:k,setFileDiffMode:_,fileDiffExpanded:N,openFileDiff:$,closeFileDiff:se,hover:ee,hoverBody:ne,onHoverEnter:pe,onHoverLeave:H}}var xe=require("react"),Xa=(e,t,n)=>Math.max(t,Math.min(n,e));function Ja(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 Ka(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function ze(e){let{storageKey:t,initial:n,min:r,reserve:a,edge:i}=e,[l,s]=(0,xe.useState)(()=>Ja(t,n)),o=(0,xe.useRef)(null),c=(0,xe.useRef)(null),p=(0,xe.useCallback)(f=>{let b=o.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;c.current={x:f.clientX,w:l,max:Math.max(r,b-a)},f.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[l,r,a]);(0,xe.useEffect)(()=>{if(typeof window>"u")return;let f=b=>{let k=c.current;if(k===null)return;let _=b.clientX-k.x;s(Xa(k.w+(i==="end"?_:-_),r,k.max))},w=()=>{c.current!==null&&(c.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),s(b=>(Ka(t,b),b)))};return window.addEventListener("pointermove",f),window.addEventListener("pointerup",w),()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",w)}},[i,r,t]);let u=(0,xe.createElement)("div",{key:`rz-${t}`,ref:o,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:p});return{width:l,divider:u}}var Hr=require("react");function $e(e,t,n,r,a=!1){return e.map(i=>(0,Hr.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${t===i?" gp-seg__btn--active":""}`,...a?{disabled:!0}:{},onClick:()=>n(i)},r(i)))}var le=require("react"),Fr=require("react-dom");function gt(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"invalid-name":case"invalid-index":return n("error.invalidName");default:return t??n("error.generic")}}function Qe(e){return(0,le.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function Ye(e){return(0,le.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,le.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,le.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 Ze(e){return typeof document>"u"?null:(0,le.createElement)(Va,e)}function Va({onClose:e,title:t,icon:n,hash:r,body:a,footer:i,overlay:l,portalKey:s,t:o}){let c=l!=null;(0,le.useEffect)(()=>{let u=f=>{f.key==="Escape"&&!c&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,c]);let p=(0,le.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{!c&&u.target===u.currentTarget&&e()}},(0,le.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,le.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,le.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,le.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,le.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,le.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:o("common.close"),disabled:c,onClick:e},(0,le.createElement)(qe,{size:15}))]),(0,le.createElement)("div",{key:"body",className:"gp-modal__form"},a),i,l??null]));return(0,Fr.createPortal)(p,document.body,s)}function Oa(e){return(0,le.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,le.createElement)("div",{key:"sp",className:"gp-spinner"}),(0,le.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function De(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return Ze({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,le.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,Qe(e.t),e.error!==null?(0,le.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:Ye({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:Oa(e.busyLabel)}:{}})}var q=require("react");function zr(e,t){return typeof document>"u"?null:(0,q.createElement)(qa,{target:e,...t})}function qa({target:e,onClose:t,onCreate:n,error:r,t:a}){let[i,l]=(0,q.useState)(""),[s,o]=(0,q.useState)(!1),[c,p]=(0,q.useState)(""),u=()=>{i.trim()!==""&&n(i.trim(),s?c:"")};return Ze({onClose:t,title:a("tag.createTitle"),icon:(0,q.createElement)(Oe,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:a,body:[(0,q.createElement)("input",{key:"name",className:"gp-input",placeholder:a("tag.namePlaceholder"),value:i,autoFocus:!0,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&u()}}),(0,q.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,q.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:s,onChange:()=>o(f=>!f)}),a("tag.annotated")]),s?(0,q.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:a("tag.messagePlaceholder"),value:c,onChange:f=>p(f.target.value)}):null,Qe(a),r!==null?(0,q.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:Ye({onClose:t,onConfirm:u,confirmLabel:a("tag.create"),confirmDisabled:i.trim()==="",danger:!1,t:a})})}function $r(e,t){return typeof document>"u"?null:(0,q.createElement)(Wa,{target:e,...t})}function Wa({target:e,from:t,dirty:n,lostFiles:r,lostTotal:a,lostTruncated:i,busy:l,error:s,onReset:o,onClose:c,t:p}){let[u,f]=(0,q.useState)("mixed"),[w,b]=(0,q.useState)(!1);(0,q.useEffect)(()=>{u!=="hard"&&b(!1)},[u]);let k=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],_=l||u==="hard"&&!w;return Ze({onClose:c,title:p("reset.title"),icon:(0,q.createElement)(Rt,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:p,body:[(0,q.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},p("reset.body",{from:t,to:e.shortHash})),(0,q.createElement)("div",{key:"modes",className:"gp-reset__modes"},k.map(N=>(0,q.createElement)("label",{key:N.value,className:`gp-reset__mode${u===N.value?" gp-reset__mode--on":""}${N.value==="hard"?" gp-reset__mode--danger":""}`},[(0,q.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:u===N.value,onChange:()=>f(N.value)}),(0,q.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,q.createElement)("span",{key:"l",className:"gp-reset__modelabel"},p(N.label)),(0,q.createElement)("span",{key:"h",className:"gp-reset__modehint"},p(N.hint))])]))),u==="hard"?(0,q.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},p("reset.hardOrphan")):null,u==="hard"&&a>0?(0,q.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,q.createElement)("div",{key:"w",className:"gp-reset__warn"},p("reset.hardWarn")),(0,q.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(N=>(0,q.createElement)("li",{key:N,title:N},N)),i?(0,q.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},p("reset.lostMore")):null])]):null,u==="hard"?(0,q.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,q.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:w,onChange:()=>b(N=>!N)}),p(a>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,q.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},p("ops.dirtyWarn")):null,Qe(p),s!==null?(0,q.createElement)("div",{key:"err",className:"gp-feedback"},s):null],footer:Ye({onClose:c,onConfirm:()=>void o(u),confirmLabel:p("reset.confirm"),confirmDisabled:_,danger:u==="hard",t:p})})}var ie=require("react");var _e=require("react"),Ir=require("react-dom"),ja=140,Ua=260;function Kt(e){let t=e?.placement??"above",n=e?.delayMs??ja,r=e?.maxWidth??Ua,[a,i]=(0,_e.useState)(null),l=(0,_e.useRef)(void 0),s=(0,_e.useCallback)(()=>{l.current!==void 0&&(clearTimeout(l.current),l.current=void 0),i(null)},[]),o=(0,_e.useCallback)((f,w)=>{l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>{let b=f.getBoundingClientRect(),k=Math.max(8,Math.min(b.left,window.innerWidth-r-8));i(t==="below"?{text:w,left:k,top:b.bottom+6}:{text:w,left:k,bottom:Math.max(8,window.innerHeight-b.top+6)})},n)},[t,n,r]),c=(0,_e.useCallback)(f=>({onMouseEnter:w=>o(w.currentTarget,f),onMouseLeave:s,onFocus:w=>o(w.currentTarget,f),onBlur:s}),[o,s]),p={left:a?.left??0,maxWidth:r};a?.top!==void 0&&(p.top=a.top),a?.bottom!==void 0&&(p.bottom=a.bottom);let u=a!==null&&typeof document<"u"?(0,Ir.createPortal)((0,_e.createElement)("div",{className:"gp-tip gp-tip--sb",style:p},a.text),document.body):null;return{tipProps:c,tipNode:u,hideTip:s}}function Br(e,t,n){if(e==="loading"||e===null)return(0,ie.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,ie.createElement)("div",{className:"gp-pullscope"},r);let i=r.indexOf(a[0]);return(0,ie.createElement)("div",{className:"gp-pullscope"},[r.slice(0,i),(0,ie.createElement)("span",{key:"add",className:"gp-pullscope__add"},a[1])," / ",(0,ie.createElement)("span",{key:"del",className:"gp-pullscope__del"},a[2]),r.slice(i+a[0].length)])}function Xr(e,t){return Br(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function Jr(e,t){return Br(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function Qa(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function Sn(e,t){return(0,ie.createElement)(Ya,{snapshot:e,cb:t})}function Ya({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:a,hideTip:i}=Kt({placement:"above"}),l=e.remote??null,s=e.hasUpstream===!0,o=(()=>{if(l===null||l.hostKind!=="github")return null;let N=(0,ie.createElement)(cr,{size:14});if(l.webUrl===null)return(0,ie.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":l.url,...r(l.url)},(0,ie.createElement)("span",{className:"gp-statusbar__ic"},N));let A=l.host!==null?n("status.openRepoOn",{host:l.host}):n("status.openRepo"),J=`${Qa(l.webUrl)} \xB7 ${A}`;return(0,ie.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:l.webUrl,target:"_blank",rel:"noreferrer","aria-label":J,...r(J)},(0,ie.createElement)("span",{className:"gp-statusbar__ic"},N))})(),{ahead:c,behind:p,branch:u}=e,f=s&&p>0&&c===0,w=s&&c>0&&p===0,b=!s&&u!==null&&l!==null,k=(()=>{let N,A="";return u===null?N=n("status.detached"):s?c===0&&p===0?(N=n("status.synced"),A=" gp-statusbar__state--ok"):c>0&&p>0?(N=n("status.diverged",{ahead:c,behind:p}),A=" gp-statusbar__state--warn"):p>0?(N=n("status.behind",{n:p}),A=" gp-statusbar__state--warn"):N=n("status.ahead",{n:c}):N=n("status.noUpstream"),(0,ie.createElement)("span",{key:"s",className:`gp-statusbar__state${A}`},N)})(),_=[l!==null?(0,ie.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:()=>{i(),t.onCheck()}},(0,ie.createElement)(ur,{size:13})):null,f?(0,ie.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:()=>{i(),t.onPull()}},[(0,ie.createElement)(pr,{key:"i",size:12}),n("status.pull")]):null,w?(0,ie.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:()=>{i(),t.onPush()}},[(0,ie.createElement)(yn,{key:"i",size:12}),n("status.push")]):null,b?(0,ie.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:()=>{i(),t.onPublish()}},[(0,ie.createElement)(yn,{key:"i",size:12}),n("status.publish")]):null];return(0,ie.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[o,(0,ie.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[k,..._]),a])}var Cn=new Set,et=14,Kr=30;function Za(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 ei=46,ti=260;function ni(e,t){let[n,r]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=()=>r(e.clientWidth>0&&e.clientWidth<t);a();let i=new ResizeObserver(a);return i.observe(e),()=>i.disconnect()},[e,t]),n}function Vr({remote:e,sessionId:t,refreshKey:n,defaultDiffView:r,snapshot:a,onAction:i,onResync:l,compact:s,t:o}){let[c,p]=(0,d.useState)({ref:null,search:"",author:"",since:""}),[u,f]=(0,d.useState)(""),[w,b]=(0,d.useState)(null),k=ni(w,ti),[_,N]=(0,d.useState)(new Set(["tags","remote"])),[A,J]=(0,d.useState)(0),M=n+A,v=()=>J(h=>h+1),[L,P]=(0,d.useState)(null),[W,S]=(0,d.useState)(null),[$,se]=(0,d.useState)(null),[ee,ce]=(0,d.useState)(null),[ne,z]=(0,d.useState)(null),[te,T]=(0,d.useState)(!1),[pe,H]=(0,d.useState)(!1),[C,I]=(0,d.useState)(!1),[X,Q]=(0,d.useState)(!1),[ge,D]=(0,d.useState)(!1),[re,me]=(0,d.useState)(!1),[ve,Z]=(0,d.useState)(!1),[Y,he]=(0,d.useState)(!1),[tn,Ae]=(0,d.useState)(null),[Re,Be]=(0,d.useState)(null),[mt,nt]=(0,d.useState)("list"),[Xe,Le]=(0,d.useState)(!1);(0,d.useEffect)(()=>{if(!Xe)return;let h=B=>{B.key==="Escape"&&Le(!1)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[Xe]),(0,d.useEffect)(()=>{!s&&Xe&&Le(!1)},[s,Xe]),(0,d.useEffect)(()=>{if(!X){Ae(null);return}let h=!0;return Ae("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then(B=>{if(!h)return;let U=de(B,"pull-preview");Ae(U!==null&&U.hasUpstream?{commits:U.commits,files:U.files,insertions:U.insertions,deletions:U.deletions}:null)}),()=>{h=!1}},[X,e,t]),(0,d.useEffect)(()=>{if(!re){Be(null);return}let h=!0;return Be("loading"),e.query({sessionId:t,query:{kind:"push-preview"}}).then(B=>{if(!h)return;let U=de(B,"push-preview");Be(U!==null&&U.hasUpstream?{commits:U.commits,files:U.files,insertions:U.insertions,deletions:U.deletions}:null)}),()=>{h=!1}},[re,e,t]);let{tree:ht,treeError:Je,authors:nn,reload:Se}=Dr(e,t,M),V=Lr(e,t,r),{commits:Ce,loading:rt,listError:rn,hasMore:we,listRef:yt,loadMore:an}=Ar(e,t,c,M,V.clearSelection);(0,d.useEffect)(()=>{let h=setTimeout(()=>p(B=>B.search===u?B:{...B,search:u}),300);return()=>clearTimeout(h)},[u]);let Ge=c.search!=="",at=(0,d.useMemo)(()=>Ge?Ce.map(h=>({commit:h,lane:0,color:0,edges:[],merge:!1})):mr(Ce,a.graphStyle),[Ce,Ge,a.graphStyle]),bt=(0,d.useMemo)(()=>Ge?0:fr(at),[at,Ge]),it=Ge?12:Math.max(et,bt*et),on=s?ei:Kr,sn=s?`${it}px minmax(0,1fr)`:`${it}px minmax(120px,1fr) 72px 120px 96px`,Ke=()=>{let h=yt.current;h===null||!we||h.scrollTop+h.clientHeight>=h.scrollHeight-240&&an()},vt=h=>{V.select(h),s&&nt("detail")},ln=(0,d.useMemo)(()=>Date.now(),[Ce]),dn=(0,d.useMemo)(()=>V.detail===null?[]:hr(V.detail.stats.map(h=>({path:h.path,meta:h.status}))),[V.detail]),j=V.selected,He=j?.hash??null,[ot,wt]=(0,d.useState)({hash:null,dirs:Cn}),y=ot.hash===He?ot.dirs:Cn,G=(0,d.useCallback)(h=>{wt(B=>{let U=B.hash===He?B.dirs:Cn,kt=new Set(U);return kt.has(h)?kt.delete(h):kt.add(h),{hash:He,dirs:kt}})},[He]);(0,d.useEffect)(()=>{if(j===null)return;let h=Ce.find(B=>B.hash===j.hash);h!==void 0&&h!==j&&!Za(h.refs,j.refs)&&V.resyncSelected(h)},[Ce,j]);let K=ze({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),ae=ze({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),fe=h=>p(B=>({...B,ref:h})),Te=async(h,B)=>{if(!(L===null||te)){z(null),T(!0);try{let U=await e.run({sessionId:t,action:{kind:"tag-create",name:h,commit:L.hash,...B.trim()!==""?{message:B}:{}}});U.ok?(P(null),v()):z(gt(U.error.code,U.error.message,o))}finally{T(!1)}}},xt=async h=>{if(!te){z(null),T(!0);try{let B=await e.run({sessionId:t,action:{kind:"tag-delete",name:h}});B.ok?(S(null),v()):z(gt(B.error.code,B.error.message,o))}finally{T(!1)}}},da=async()=>{if(!($===null||te)){z(null),T(!0);try{let h=await i({kind:"revert",commit:$.hash});h.ok?se(null):z(h.error??o("error.generic"))}finally{T(!1)}}},ca=async h=>{if(!(ee===null||te)){z(null),T(!0);try{let B=await i({kind:"reset",commit:ee.hash,mode:h});B.ok?ce(null):z(B.error??o("error.generic"))}finally{T(!1)}}},pa=async()=>{if(!pe){z(null),H(!0);try{let h=await i({kind:"fetch"});h.ok?Se():z(h.error??o("error.generic"))}finally{H(!1)}}},ua=async()=>{if(!C){z(null),I(!0);try{let h=await i({kind:"pull-ff"});h.ok?(Q(!1),Se()):z(h.error??o("error.generic"))}finally{I(!1)}}},ga=async()=>{if(!ge){z(null),D(!0);try{let h=await i({kind:"push"});h.ok?(me(!1),Se()):z(h.error??o("error.generic"))}finally{D(!1)}}},fa=async()=>{if(!(ve||a.remote===null)){z(null),Z(!0);try{let h=await i({kind:"publish",remote:a.remote.name});h.ok?(he(!1),Se()):z(h.error??o("error.generic"))}finally{Z(!1)}}},Ln={syncBusy:pe,pullBusy:C,pushBusy:ge,publishBusy:ve,onCheck:()=>void pa(),onPull:()=>{z(null),Q(!0)},onPush:()=>{z(null),me(!0)},onPublish:()=>{z(null),he(!0)},t:o},Hn=li(V.fileDiff,{text:V.fileDiffText,error:V.fileDiffError,mode:V.fileDiffMode,onMode:V.setFileDiffMode,expanded:V.fileDiffExpanded,onExpand:h=>{V.fileDiff!==null&&V.openFileDiff(V.fileDiff.path,V.fileDiff.hash,V.fileDiff.shortHash,h)},onClose:V.closeFileDiff,remote:e,sessionId:t,compact:s,t:o}),Fn=(0,d.useMemo)(()=>[...new Set(a.changes.filter(h=>h.status!=="untracked").map(h=>h.path))],[a.changes]),zn=[L!==null?zr(L,{onClose:()=>P(null),onCreate:Te,error:ne,compact:s,t:o}):null,W!==null?De({title:o("tag.deleteTitle"),body:o("tag.deleteConfirm",{name:W}),confirmLabel:o("tag.deleteTitle"),danger:!0,error:ne,confirmBusy:te,onConfirm:()=>void xt(W),onClose:()=>S(null),t:o}):null,$!==null?De({title:o("revert.title"),body:o("revert.body",{ref:`${$.shortHash} ${$.subject}`})+(a.dirty?`
625
+ `,vn=!1;function Zn(){if(vn||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){vn=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=Xa,document.head.appendChild(t),vn=!0}var er={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","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.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.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.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.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","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.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.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.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","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":"\u4FEE\u6B63\u4E0A\u6B21\u63D0\u4EA4\uFF08amend\uFF09","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\uFF0C\u4EE5\u4E0B\u5DEE\u5F02\u88AB\u622A\u65AD\uFF0C\u884C\u53F7\u4E0E\u589E\u5220\u7EDF\u8BA1\u53EF\u80FD\u4E0D\u5B8C\u6574","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.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.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.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\u6700\u8FD1\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u751F\u6210\u7684\u8BF7\u6C42\u4F1A\u4F7F\u7528\u4F60\u5728 DSH \u4E2D\u914D\u7F6E\u7684\u6A21\u578B\uFF0Cdiff \u5185\u5BB9\u4F1A\u53D1\u9001\u7ED9\u6A21\u578B\u4F9B\u5E94\u5546\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"},tr={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","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.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.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.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.backToList":"Back to list","changes.stash":"Stash changes","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.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.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.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","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.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: this diff is truncated, so line numbers and +/- counts past the cut may be wrong","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.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.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.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the recent commit style, filled in for you to edit before committing. Generation uses the model configured in DSH; the diff is sent to that model provider. 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 Ot=require("react");var Ka=new Set(["cwd-unavailable"]),wn=3e4,Ja=6e4,Bt=class{constructor(t,n){this.remote=t;this.sessionId=n}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=wn;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}ensure(){this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){return this.inflight!==void 0?(this.pendingRefresh=!0,this.inflight):this.disposed?Promise.resolve():(this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(t=>{if(!this.disposed){if(t.ok)this.pollMs=t.value.refreshIntervalMs||wn,this.setView({state:"ready",snapshot:t.value});else if(t.error.code!=="cancelled")if(Ka.has(t.error.code))this.pollMs=Ja,this.setView({state:"no-cwd"});else if(t.error.code==="not-a-git-repo"){let n=t.error;this.setView({state:"error",error:{code:"not-a-git-repo",...n.cwd?{cwd:n.cwd}:{},...n.showInputPill!==void 0?{showInputPill:n.showInputPill}:{}}})}else if(t.error.code==="git-unavailable"){let n=t.error;this.setView({state:"error",error:{code:"git-unavailable",...n.detail?{detail:n.detail}:{},...n.cwd?{cwd:n.cwd}:{},...n.isGitRepo!==void 0?{isGitRepo:n.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:t.error.code,..."detail"in t.error?{detail:t.error.detail}:{}}})}}).catch(t=>{this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:t instanceof Error?t.message:String(t)}})}).finally(()=>{this.inflight=void 0,this.pendingRefresh&&!this.disposed?(this.pendingRefresh=!1,this.refresh()):this.schedulePoll()}),this.inflight)}resync(){this.disposed||this.refresh()}accept(t){this.disposed||(this.pollMs=t.refreshIntervalMs||wn,this.setView({state:"ready",snapshot:t}),this.schedulePoll())}schedulePoll(){this.disposed||(this.timer!==void 0&&clearTimeout(this.timer),!(this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.refresh()},this.pollMs)))}setView(t){this.view=t;for(let n of this.listeners)n()}dispose(){this.disposed=!0,this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0,this.listeners.clear()}};var Va="/api",Wa="gitPanel";function qa(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(a,r,i)=>n.call(t,Va,a,r,i)}catch{}}function Ua(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 me(e,t){return!e.ok||e.value.kind!==t?null:e.value}function Ze(e){return e!==void 0&&e!==""}var nr=new WeakMap;function Mt(e){let t=nr.get(e);if(t!==void 0)return t;let n=async(r,i,o)=>{let s=qa(e);if(s===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await s(`${Wa}/${r}`,{args:{request:i}},o);return Ua(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},a={snapshot:(r,i)=>n("snapshot",r,i),run:(r,i)=>n("run",r,i),query:(r,i)=>n("query",r,i),suggest:(r,i)=>n("suggest",r,i),version:(r,i)=>n("version",r,i)};return nr.set(e,a),a}var it=new Map,rr,xn;function ar(e){xn=e,rr=Mt(e)}function Rt(e){let t=it.get(e);if(t===void 0){let n=rr??(xn?Mt(xn):void 0);t=new Bt(n??Za(),e),it.set(e,t)}return t}var ja=6e4,It=new Map;function Qa(e){let t=It.get(e);t!==void 0&&(clearTimeout(t),It.delete(e)),mt.set(e,(mt.get(e)??0)+1)}function Ya(e){let t=(mt.get(e)??1)-1;if(t>0){mt.set(e,t);return}mt.delete(e);let n=setTimeout(()=>{It.delete(e),!((mt.get(e)??0)>0)&&(it.get(e)?.dispose(),it.delete(e))},ja);It.set(e,n)}var mt=new Map;function Gt(){for(let e of it.values())e.resync()}function ir(){for(let e of it.values())e.dispose();it.clear()}function Za(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e}}function $t(e){let[,t]=(0,Ot.useState)(0),n=e?Rt(e):void 0;return(0,Ot.useEffect)(()=>{if(n===void 0||e===void 0)return;Qa(e);let a=n.subscribe(()=>t(r=>r+1));return n.ensure(),()=>{a(),Ya(e)}},[n,e]),n?n.getSnapshot():{state:"cold"}}var L=require("react");var or="[data-conversation-tabs]",Pt='[data-conversation-tabs] button[role="tab"]',kn=new Map,Dt=new Map;function sr(e,t){let n=Dt.get(e);if(n!==void 0&&n.size>0){for(let a of n)a(t);return}kn.set(e,t)}function lr(e){let t=kn.get(e);return t===void 0?null:(kn.delete(e),t)}function dr(e,t){let n=Dt.get(e);return n===void 0&&(n=new Set,Dt.set(e,n)),n.add(t),()=>{let a=Dt.get(e);a!==void 0&&(a.delete(t),a.size===0&&Dt.delete(e))}}var ei=6e4,_n=new Map;function cr(e,t){_n.set(e,{tab:t,leftAt:Date.now()})}function pr(e){let t=_n.get(e);return t===void 0?null:Date.now()-t.leftAt>ei?(_n.delete(e),null):t.tab}function ur(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Pt);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function gr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Pt);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function fr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Pt);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var c=require("react"),cn=require("react-dom");var H=require("react");function be(e,t=15){return(0,H.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},e)}function Xt({size:e}){return be([(0,H.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,H.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,H.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function mr({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M4 2v8"}),(0,H.createElement)("path",{key:"b",d:"M2 4h4"}),(0,H.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,H.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,H.createElement)("path",{key:"e",d:"M12 6v4"}),(0,H.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function Sn({size:e}){return be([(0,H.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,H.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,H.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,H.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,H.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function ht({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M2 7V3h4l8 8-4 4z"}),(0,H.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e)}function et({size:e,open:t}){return be([(0,H.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function tt({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function yt({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,H.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function hr({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function Kt({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,H.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function yr({size:e}){return be([(0,H.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,H.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function br({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,H.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function Cn({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,H.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,H.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function vr({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,H.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,H.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function wr({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,H.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function Jt({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M13 3v10"}),(0,H.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function xr({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,H.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,H.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function kr({size:e=15}){return(0,H.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,H.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 _r({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,H.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,H.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Tn({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,H.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,H.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Sr({size:e}){return be([(0,H.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,H.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,H.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,H.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function Cr({size:e=15,filled:t}){return(0,H.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,H.createElement)("path",{d:"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 Tr(e){let t=0;for(let n of e){t=Math.max(t,n.lane+1);for(let a of n.edges)t=Math.max(t,a.fromLane+1,a.toLane+1)}return t}function Nr(e,t){let n=[],a=[],r=[],i=[],o=0,s=()=>{if(i.length===0)return o++;let d=Math.min(...i);return i.splice(i.indexOf(d),1),d},l=d=>{d!==null&&!i.includes(d)&&i.push(d)};for(let d of e){let p=T=>{let E=a.findIndex(J=>J===T);return E===-1&&(E=a.findIndex(J=>J===null),E===-1&&(E=a.length,a.push(null),r.push(null)),a[E]=T,r[E]=s()),E},u=a.some(T=>T===d.hash),g=p(d.hash),w=r[g],k=[...a],_=[...r],S=d.parents,R=S.length>=2;for(let T=0;T<a.length;T++)T!==g&&a[T]===d.hash&&(l(r[T]),a[T]=null,r[T]=null);let $=-1,q=[];if(S.length===0)l(r[g]),a[g]=null,r[g]=null;else{let T=S[0],E=t==="compact"?a.findIndex((J,O)=>J===T&&O!==g):-1;if(E===-1)a[g]=T,$=g;else{let J=Math.min(g,E),O=Math.max(g,E);a[J]=T,l(r[O]),a[O]=null,r[O]=null,$=J}for(let J=1;J<S.length;J++)q.push(p(S[J]))}let A=[];for(let T=0;T<k.length;T++){let E=k[T];if(E!==null)if(E===d.hash){if(T===g&&!u)continue;A.push({fromLane:T,toLane:g,color:_[T],kind:"into"})}else{let J=a[T]===E?T:a.findIndex(O=>O===E);J!==-1&&A.push({fromLane:T,toLane:J,color:_[T],kind:"pass"})}}$!==-1&&A.push({fromLane:g,toLane:$,color:r[$],kind:"out"});for(let T of q)A.push({fromLane:g,toLane:T,color:r[T],kind:"out"});for(n.push({commit:d,lane:g,color:w,edges:A,merge:R});a.length>0&&a[a.length-1]===null;)a=a.slice(0,-1),r=r.slice(0,-1)}return n}function Er(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let a=n.path.split("/").filter(o=>o!==""),r=t,i="";for(let o=0;o<a.length;o++){let s=a[o];i=i===""?s:`${i}/${s}`;let l=o===a.length-1,d=r.children.find(p=>p.name===s&&p.dir===!l);d===void 0&&(d={name:s,path:i,dir:!l,children:[],...l?{meta:n.meta}:{}},r.children.push(d)),r=d}}return Mr(t),Rr(t.children)}function Mr(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)Mr(t)}function Rr(e){return e.map(t=>{if(!t.dir)return t;let n=t;for(;n.children.length===1&&n.children[0].dir;){let a=n.children[0];n={name:`${n.name}/${a.name}`,path:a.path,dir:!0,children:a.children}}return{...n,children:Rr(n.children)}})}function bt(e,t,n){if(e===null)return"";let a=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(a))return"";let r=Math.max(0,t-a),i=Math.floor(r/6e4);if(i<1)return n("time.justNow");if(i<60)return n("time.minutesAgo",{n:i});let o=Math.floor(i/60);if(o<24)return n("time.hoursAgo",{n:o});let s=Math.floor(o/24);return n("time.daysAgo",{n:s})}function Lt(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=a=>String(a).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Nn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=a=>String(a).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Vt={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function Wt(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}var v=require("react");var Me={maxBytes:{min:16384,max:524288,default:131072},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},ti={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 En(e){let t=e.lastIndexOf(".");return t<0?null:ti[e.slice(t+1).toLowerCase()]??null}function Gr(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function Dr(e){return En(e)!==null}function Pr(e){return/\.svg$/i.test(e)}function ni(e){let t=e.split(`
626
+ `),n=[],a=!1;for(let r of t){if(r.startsWith("@@")){a=!0;continue}if(a){if(r.startsWith("diff ")||r.startsWith("index ")){a=!1;continue}r!==""&&n.push(r)}}return n}function Lr(e){let t=0,n=0;for(let a of ni(e))a.startsWith("+")?t++:a.startsWith("-")&&n++;return{add:t,del:n}}var ri=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function Ar(e,t){let n=[],a=e.split(`
627
+ `),r=Number.isFinite(t)&&t>0?t:0,i=0,o=0,s=!0,l=!1,d=0;for(;d<a.length&&!a[d].startsWith("@@");d++);for(;d<a.length;d++){let u=a[d];if(u.startsWith("@@")){let k=ri.exec(u);if(k){let _=Number(k[1]),S=Number(k[3]),R=_-S;if(s)S>1&&n.push(ot({rightStart:1,count:S-1,delta:R,atStart:!0}));else{let $=S-o;$>0&&n.push(ot({rightStart:o,count:$,delta:R,atStart:!1}))}i=_,o=S,s=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:u});continue}if(u.startsWith("\\"))continue;let g=u[0],w=u.slice(1);g==="+"?(n.push({kind:"add",leftNo:null,rightNo:o,leftText:null,rightText:w}),o++,l=!0):g==="-"?(n.push({kind:"del",leftNo:i,rightNo:null,leftText:w,rightText:null}),i++,l=!0):g===" "&&(n.push({kind:"context",leftNo:i,rightNo:o,leftText:w,rightText:w}),i++,o++,l=!0)}let p=r-o+1;return l&&!s&&o>0&&p>0&&n.push(ot({rightStart:o,count:p,delta:i-o,atStart:!1})),ai(n)}function zr(e,t){let n=e[e.length-1],a=n!==void 0&&n.kind==="gap",r=a?n.gap:void 0,i=a?e[e.length-2]:n,o=i===void 0?null:i.rightNo,s=o!==null&&o>0?o:0,l=Number.isFinite(t)?t-s:0,d=l>0?l:0;if(r===void 0){if(d===0||s===0)return e;let p=i===void 0?null:i.leftNo;return p===null?null:[...e,ot({rightStart:s+1,count:d,delta:p-s,atStart:!1})]}return r.rightStart===s+1&&r.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),ot({rightStart:s+1,count:d,delta:r.delta,atStart:!1})]}function ot(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function ai(e){let t=[],n=0;for(;n<e.length;){let a=e[n];if(a.kind==="del"){let r=[],i=n;for(;i<e.length&&e[i].kind==="del";)r.push(e[i]),i++;let o=[];for(;i<e.length&&e[i].kind==="add";)o.push(e[i]),i++;let s=Math.max(r.length,o.length);for(let l=0;l<s;l++){let d=r[l],p=o[l];if(d&&p){let u=ii(d.leftText??"",p.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:p.rightNo,leftText:d.leftText,rightText:p.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}):p&&t.push({kind:"add",leftNo:null,rightNo:p.rightNo,leftText:null,rightText:p.rightText})}n=i}else t.push(a),n++}return t}function ii(e,t){let n=Math.min(e.length,t.length),a=0;for(;a<n&&e[a]===t[a];)a++;let r=0;for(;r<n-a&&e[e.length-1-r]===t[t.length-1-r];)r++;return a===0&&r===0?null:{left:[a,e.length-r],right:[a,t.length-r]}}function oi(e,t,n){return n.map((a,r)=>{let i=t+r;return{kind:"context",leftNo:i+e,rightNo:i,leftText:a,rightText:a}})}var st=20;function Hr(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 Fr(e,t,n,a,r,i){let o=e.findIndex(u=>u.kind==="gap"&&u.gap?.rightStart===t);if(o<0)return e.slice();let s=e[o].gap,l=oi(s.delta,a,r),d=[],p=s.count;if(n==="all"||r.length>=p)d.push(...l);else if(n==="down")d.push(...l),i||d.push(ot({rightStart:s.rightStart+r.length,count:p-r.length,delta:s.delta,atStart:!1}));else{if(r.length===0)return[...e.slice(0,o),...e.slice(o+1)];let u=p-r.length;d.push(ot({rightStart:s.rightStart,count:u,delta:s.delta,atStart:s.atStart})),d.push(...l)}return[...e.slice(0,o),...d,...e.slice(o+1)]}var an=require("@deepseek-ai/dsh-client-ui-primitives");function Br(e,t){let n=[[],[],[]],a=0;for(let r of e){let i=a+r.text.length,o=[a,Math.max(a,Math.min(i,t[0])),Math.max(a,Math.min(i,t[1])),i];for(let s=0;s<3;s++){let l=r.text.slice(o[s]-a,o[s+1]-a);l!==""&&n[s].push({text:l,style:r.style})}a=i}return n}function Ir(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let a=e(n);return t.size>=8e3&&t.clear(),t.set(n,a),a}}function wt(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 Or(e,t){let n=0,a=e.length-1;for(;n<a;){let r=n+a+1>>1;e[r]<=t?n=r:a=r-1}return n}function xt(e,t,n,a){let r=e.length-1;if(r<=0)return{first:0,last:0};let i=Or(e,t-a),o=Math.min(r,Or(e,t+n+a)+1);return{first:i,last:o}}function qt(e,t,n,a){return t<0?e:t>=e.first&&t<e.last?{first:Math.min(e.first,Math.max(0,t-a)),last:Math.max(e.last,Math.min(n,t+a))}:{first:Math.max(0,t-a),last:Math.min(n,t+a)}}var lt=require("react");function kt(){let[e,t]=(0,lt.useState)({top:0,height:0}),n=(0,lt.useRef)(null),a=(0,lt.useRef)(null);return{setEl:(0,lt.useCallback)(i=>{if(a.current!==null&&(a.current(),a.current=null),n.current=i,i===null)return;let o=()=>t(l=>{let d=i.scrollTop,p=i.clientHeight;return l.top===d&&l.height===p?l:{top:d,height:p}});o(),i.addEventListener("scroll",o,{passive:!0});let s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;s?.observe(i),a.current=()=>{i.removeEventListener("scroll",o),s?.disconnect()}},[]),viewport:e,elRef:n}}var Se=require("react"),Ut=5e3,jt=120;function Qt(e,t){let[n,a]=(0,Se.useState)(e);return(0,Se.useEffect)(()=>{let r=setTimeout(()=>a(e),t);return()=>clearTimeout(r)},[e,t]),n}function Yt(e,t){if(t==="")return[];let n=[],a=0;for(;;){let r=e.indexOf(t,a);if(r<0)break;n.push([r,r+t.length]),a=r+t.length}return n}function Mn(e,t,n,a,r){if(n>=a)return[];if(e===void 0)return[t.slice(n,a)];let i=[],o=0,s=0;for(let l of e){let d=o+l.text.length,p=Math.max(n,o),u=Math.min(a,d);if(u>p&&i.push((0,Se.createElement)("span",{key:`${r}-${s++}`,style:l.style},l.text.slice(p-o,u-o))),o=d,o>=a)break}return i}function Zt(e,t,n,a,r,i){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(...Mn(n,e,s,d,`${a}b${s}`));let u=r!==null&&r[0]===d&&r[1]===p;o.push((0,Se.createElement)("mark",{key:`mk${a}-${d}`,className:`gp-find-hit${u?" gp-find-hit--active":""}`,...u?{ref:i}:{}},Mn(n,e,d,p,`mk${a}-${d}`))),s=p}return s<e.length&&o.push(...Mn(n,e,s,e.length,`${a}e`)),o}function en(e){return(0,Se.createElement)("div",{key:"find",className:"gp-find"},[(0,Se.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,Se.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,Se.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,Se.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,Se.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,Se.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 nt=require("react");var I=require("react"),qr=require("react-dom");function Xr(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 Kr(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 si=.1,li=8,Rn=1.25;function Jr(e){return Number.isFinite(e)?Math.min(li,Math.max(si,e)):1}function Gn(e,t,n){return(e+t)*n-t}var $r=3;function Vr(e,t){return e*e+t*t>=$r*$r}function Wr(e,t,n,a){return{left:e-n,top:t-a}}var di=300;function At({src:e,alt:t,t:n,viewportClass:a,fullscreen:r=!0,onEmptyAreaMouseDown:i}){let o=(0,I.useRef)(null),s=(0,I.useRef)(null),l=(0,I.useRef)(null),[d,p]=(0,I.useState)(null),[u,g]=(0,I.useState)("fit"),[w,k]=(0,I.useState)(null),[_,S]=(0,I.useState)(!1),[R,$]=(0,I.useState)(!1),q=(0,I.useRef)("fit"),A=(0,I.useRef)(null),T=(0,I.useRef)(null),E=(0,I.useRef)(null),J=(0,I.useRef)(0),O=(0,I.useCallback)(()=>{let f=l.current;return f===null||f.naturalWidth===0||f.clientWidth===0?null:f.clientWidth/f.naturalWidth},[]),V=(0,I.useCallback)((f,x,P)=>{let z=s.current,C=l.current;if(z===null||C===null||C.naturalWidth===0||C.clientWidth===0)return;let X=C.clientWidth/C.naturalWidth,te=Jr(f);if(te===X)return;let ee=z.getBoundingClientRect();A.current={x:x-ee.left,y:P-ee.top,ratio:te/X},g(te)},[]),j=(0,I.useCallback)(f=>{let x=s.current,P=O();if(x===null||P===null)return;let z=x.getBoundingClientRect();V(P*f,z.left+z.width/2,z.top+z.height/2)},[O,V]),N=(0,I.useCallback)(()=>{let f=s.current;if(f===null)return;let x=f.getBoundingClientRect();V(1,x.left+x.width/2,x.top+x.height/2)},[V]),Z=(0,I.useCallback)(()=>{g("fit")},[]),ie=(0,I.useCallback)(()=>{let f=l.current;f===null||f.naturalWidth===0||f.clientWidth===0||k(Math.round(f.clientWidth/f.naturalWidth*100))},[]);(0,I.useLayoutEffect)(()=>{q.current=u,u==="fit"&&ie();let f=A.current;A.current=null;let x=s.current;f===null||x===null||(x.scrollLeft=Gn(x.scrollLeft,f.x,f.ratio),x.scrollTop=Gn(x.scrollTop,f.y,f.ratio))},[u,ie]),(0,I.useEffect)(()=>{q.current="fit",A.current=null,T.current=null,g("fit"),p(null),k(null)},[e]),(0,I.useEffect)(()=>{let f=o.current;if(f===null)return;let x=X=>{if(!X.ctrlKey)return;X.cancelable&&X.preventDefault();let te=l.current;if(te===null||!te.complete||te.naturalWidth===0)return;let ee=O();ee!==null&&V(ee*Kr(Xr(X)),X.clientX,X.clientY)},P=X=>{let te=X,ee=O();ee!==null&&(te.cancelable&&te.preventDefault(),T.current={base:ee,x:te.clientX,y:te.clientY})},z=X=>{let te=X,ee=T.current;ee!==null&&(te.cancelable&&te.preventDefault(),V(ee.base*te.scale,ee.x,ee.y))},C=()=>{T.current=null};return f.addEventListener("wheel",x,{passive:!1}),f.addEventListener("gesturestart",P,{passive:!1}),f.addEventListener("gesturechange",z,{passive:!1}),f.addEventListener("gestureend",C),()=>{f.removeEventListener("wheel",x),f.removeEventListener("gesturestart",P),f.removeEventListener("gesturechange",z),f.removeEventListener("gestureend",C)}},[O,V]);let oe=(0,I.useCallback)(f=>{if(f.button!==0||f.pointerType!=="mouse")return;let x=s.current;if(x===null)return;let{offsetX:P,offsetY:z}=f.nativeEvent;f.target===x&&(P>=x.clientWidth||z>=x.clientHeight)||(E.current={id:f.pointerId,x:f.clientX,y:f.clientY,left:x.scrollLeft,top:x.scrollTop,pan:x.scrollWidth>x.clientWidth||x.scrollHeight>x.clientHeight,moved:!1})},[]);(0,I.useEffect)(()=>{let f=z=>{let C=E.current;C===null||z!==C.id||(C.moved&&(J.current=performance.now()),E.current=null,$(!1))},x=z=>{let C=E.current;if(C===null||z.pointerId!==C.id)return;if(z.buttons===0){f(z.pointerId);return}let X=z.clientX-C.x,te=z.clientY-C.y;if(!C.moved){if(!Vr(X,te))return;C.moved=!0,$(!0)}let ee=s.current;if(ee===null||!C.pan)return;let xe=Wr(C.left,C.top,X,te);ee.scrollLeft=xe.left,ee.scrollTop=xe.top},P=z=>{f(z.pointerId)};return window.addEventListener("pointermove",x),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P),()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P)}},[]),(0,I.useEffect)(()=>{let f=s.current;if(f===null||typeof ResizeObserver>"u")return;let x=new ResizeObserver(()=>{q.current==="fit"&&ie()});return x.observe(f),()=>x.disconnect()},[ie]);let W=(0,I.useCallback)(()=>{let f=l.current;f!==null&&(p({w:f.naturalWidth,h:f.naturalHeight}),q.current==="fit"&&ie())},[ie]),de=(0,I.useCallback)(()=>{performance.now()-J.current<di||(u==="fit"?N():Z())},[u,N,Z]),se=(0,I.useCallback)(()=>{S(!1)},[]),he=u==="fit"?w!==null?`${w}%`:"\u2014":`${Math.round(u*100)}%`,fe=u!=="fit"&&d!==null?{width:`${d.w*u}px`,maxWidth:"none",maxHeight:"none"}:void 0,Y=d!==null?(0,I.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,I.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>j(1/Rn)},"\u2212"),(0,I.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${he}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:N},he),(0,I.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>j(Rn)},"+"),(0,I.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":u==="fit",onClick:Z},n("files.zoomFit")),r?(0,I.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>S(!0)},"\u2921"):null]):null;return(0,I.createElement)("div",{className:"gp-zoom",ref:o,"data-zoomed":u==="fit"?void 0:"true","data-dragging":R?"true":void 0},[(0,I.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${a}`,ref:s,onPointerDown:oe,onMouseDown:i===void 0?void 0:f=>{f.target===f.currentTarget&&i()}},(0,I.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:fe,draggable:!1,onLoad:W,onDoubleClick:de})),Y,_?(0,I.createElement)(ci,{key:"lb",src:e,alt:t,t:n,onClose:se}):null])}function ci({src:e,alt:t,t:n,onClose:a}){let r=(0,I.useRef)(null),i=(0,I.useRef)(null),o=(0,I.useRef)(null);return(0,I.useEffect)(()=>{o.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i.current?.focus();let s=()=>{let d=r.current;return d===null?[]:[...d.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(p=>!p.hasAttribute("disabled")&&p.getClientRects().length>0)},l=d=>{if(d.key==="Escape"){d.stopPropagation(),a();return}if(d.key!=="Tab")return;let p=s();if(p.length===0)return;let u=document.activeElement instanceof HTMLElement?document.activeElement:null,g=u===null?-1:p.indexOf(u);d.preventDefault();let w=d.shiftKey?-1:1,k=g===-1?w===-1?p.length-1:0:(g+w+p.length)%p.length;p[k]?.focus()};return window.addEventListener("keydown",l,!0),()=>{window.removeEventListener("keydown",l,!0),o.current?.focus()}},[a]),(0,qr.createPortal)((0,I.createElement)("div",{className:"gp-zl-backdrop",ref:r,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,I.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,I.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:a}),(0,I.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,I.createElement)(At,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:a})),(0,I.createElement)("button",{key:"close",ref:i,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:a},(0,I.createElement)(tt,{size:16}))])]),document.body)}function tn(e,t,n){let a=n(`diff.${e}`);return(0,nt.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,nt.createElement)("div",{key:"head",className:"gp-imgcmp__head"},a),t===void 0?(0,nt.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,nt.createElement)(At,{key:"img",src:t,alt:a,t:n,viewportClass:"gp-imgcmp__img"})])}function Ur({oldUrl:e,newUrl:t,mode:n,t:a}){return n==="before"?(0,nt.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},tn("before",e,a)):n==="after"?(0,nt.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},tn("after",t,a)):(0,nt.createElement)("div",{className:"gp-imgcmp"},[tn("before",e,a),tn("after",t,a)])}var Dn=20,pi=27,ui=29,jr=12,gi=600,on=(0,v.memo)(function({text:t,mode:n,path:a,remote:r,sessionId:i,base:o,commit:s,expanded:l,truncated:d,newLines:p,t:u}){let g=(0,v.useMemo)(()=>Ar(t,p),[t,p]),w=Gr(t),k=(0,an.useCodeHighlighter)(a===void 0?void 0:(0,an.languageForPath)(a)),_=(0,v.useMemo)(()=>Ir(k),[k]),[S,R]=(0,v.useState)(g),$=(0,v.useRef)(t);(0,v.useEffect)(()=>{if($.current!==t){$.current=t,R(g);return}R(Q=>zr(Q,p)??g)},[t,p,g]);let q=yi(S,R,r,i,a,o,s),A=a!==void 0&&Pr(a),[T,E]=(0,v.useState)("render");(0,v.useEffect)(()=>{E("render")},[a]);let O=(w||A)&&a!==void 0&&Dr(a)&&r!==void 0&&i!==void 0&&o!==void 0&&(!A||T==="render"),V=vi(O?r:void 0,O?i:void 0,O?a:void 0,O?o:void 0,O?s:void 0),[j,N]=(0,v.useState)(!1),[Z,ie]=(0,v.useState)(""),[oe,W]=(0,v.useState)(!1),[de,se]=(0,v.useState)(0),he=(0,v.useRef)(null),fe=(0,v.useRef)(null),Y=(0,v.useRef)(null);(0,v.useEffect)(()=>{N(!1),ie(""),se(0)},[t,a]);let f=(0,v.useMemo)(()=>n==="unified"?Hr(S):null,[n,S]),x=(0,v.useMemo)(()=>n==="before"?wi(S):n==="after"?xi(S):null,[n,S]),P=(0,v.useMemo)(()=>mi(S,f,x),[S,f,x]),z=(0,v.useMemo)(()=>P.map(Q=>({key:Q.key,text:Q.text.toLowerCase()})),[P]),C=Qt(Z,jt),X=oe?C:C.toLowerCase(),te=oe?P:z,ee=(0,v.useMemo)(()=>hi(te,X),[te,X]);(0,v.useEffect)(()=>{se(0)},[X]);let xe=ee.length===0?0:Math.min(de,ee.length-1),G=ee.length>0?ee[xe]:null,ve=G?.cellKey??null,Fe=G?.start??-1,Ce=(0,v.useMemo)(()=>{let Q=new Map;for(let B of ee){let h=Q.get(B.cellKey)??[];h.push([B.start,B.end]),Q.set(B.cellKey,h)}return Q},[ee]);(0,v.useEffect)(()=>{if(ve===null)return;let Q=requestAnimationFrame(()=>Y.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(Q)},[xe,ee,ve,Fe]);let De=(0,v.useCallback)(Q=>{se(B=>ee.length===0?0:(B+Q+ee.length)%ee.length)},[ee.length]);(0,v.useEffect)(()=>{let Q=B=>{if(!((B.ctrlKey||B.metaKey)&&(B.key==="f"||B.key==="F")))return;let h=he.current;h===null||h.offsetParent===null||(B.preventDefault(),N(!0),requestAnimationFrame(()=>fe.current?.select()))};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[]);let{setEl:Le,viewport:Ae,elRef:Be}=kt(),Te=(0,v.useRef)(null),[Ve,pt]=(0,v.useState)(0),[We,Ke]=(0,v.useState)(0),Ne=(0,v.useRef)({mode:n,rows:S,heights:[]});(Ne.current.mode!==n||Ne.current.rows!==S)&&(Ne.current={mode:n,rows:S,heights:[]});let _e=Ne.current.heights,Ie=f!==null?f.length:x!==null?x.length:S.length,qe=(0,v.useCallback)(Q=>{let B=f!==null?f[Q]??null:x===null?S[Q]??null:null;return B===null?Dn:B.kind==="hunk"?pi:B.kind==="gap"?ui:Dn},[f,x,S]),Ee=(0,v.useMemo)(()=>{let Q=new Array(Ie);for(let B=0;B<Ie;B++){let h=_e[B];Q[B]=h!==void 0&&h>0?h:qe(B)}return Q},[Ie,_e,qe,We]),we=(0,v.useMemo)(()=>wt(Ee),[Ee]),ut=Ae.height>0?Ae.height:gi,{first:ne,last:ze}=xt(we,Math.max(0,Ae.top-Ve),ut,jr*Dn),Et=ve===null?-1:fi(ve),{first:Ue,last:je}=qt({first:ne,last:ze},Et,Ie,jr);if((0,v.useLayoutEffect)(()=>{let Q=Te.current,B=Be.current;if(Q===null||B===null)return;let h=Q.getBoundingClientRect().top-B.getBoundingClientRect().top+B.scrollTop;Math.abs(h-Ve)>.5&&pt(h);let D=new Map;for(let re of Q.querySelectorAll("[data-r]")){let ce=Number(re.dataset.r),ye=re.getBoundingClientRect().height;if(!Number.isFinite(ye)||ye<=0)continue;let Je=D.get(ce);(Je===void 0||ye>Je)&&D.set(ce,ye)}let M=!1;for(let[re,ce]of D){let ye=_e[re];(ye===void 0||Math.abs(ye-ce)>.5)&&(_e[re]=ce,M=!0)}M&&Ke(re=>re+1)}),O){let Q=(()=>{if(V.kind==="idle"||V.kind==="loading")return(0,v.createElement)("div",{className:"gp-empty"},u("common.loading"));if(V.kind==="ready"){let B=V.res;if(B.tooLarge===!0)return(0,v.createElement)("div",{className:"gp-empty"},u("diff.tooLarge"));if(B.mime!==null&&(B.old!==void 0||B.new!==void 0))return(0,v.createElement)(Ur,{oldUrl:B.old,newUrl:B.new,mode:n,t:u})}return(0,v.createElement)("div",{className:"gp-empty"},u("diff.binary"))})();return A?Qr(T,E,Q,u):Q}if(w&&!A)return(0,v.createElement)("div",{className:"gp-empty"},u("diff.binary"));let Qe=j&&X!==""?{perCell:Ce,activeKey:ve,activeRange:G!==null?[G.start,G.end]:null,activeRef:Y}:null,gt=(Q,B)=>B>.5?(0,v.createElement)("div",{key:Q,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${B}px`}}):null,ke=gt("lead",we[Ue]),Oe=gt("tail",we[Ie]-we[je]),ft=(()=>{if(t.trim()==="")return(0,v.createElement)("div",{className:"gp-empty"},u("diff.empty"));if(x!==null){let B=[ke];for(let h=Ue;h<je;h++){let D=x[h];B.push((0,v.createElement)("div",{key:`n${h}`,className:"gp-diff-no"},D.no??"")),B.push(rn("gp-diff-cell",`c${h}`,D.text,_,Qe,h))}return B.push(Oe),(0,v.createElement)("div",{className:"gp-diff__single",ref:Te},B)}if(f!==null){let B=[ke];for(let h=Ue;h<je;h++)B.push(..._i(f[h],h,_,q,Qe,u));return B.push(Oe),(0,v.createElement)("div",{className:"gp-diff__unified",ref:Te},B)}let Q=[ke];for(let B=Ue;B<je;B++)Q.push(...ki(S[B],B,_,q,Qe,u));return Q.push(Oe),(0,v.createElement)("div",{className:"gp-diff__side",ref:Te},Q)})(),rt=j?(0,v.createElement)(en,{inputRef:fe,query:Z,matches:ee.length,active:xe,caseSensitive:oe,onChange:ie,onToggleCase:()=>W(Q=>!Q),onStep:De,onClose:()=>N(!1),t:u}):null,Ye=l===!0&&S.some(Q=>Q.kind==="gap"),at=(0,v.createElement)("div",{className:"gp-diff__wrap",ref:he},[rt,d===!0?(0,v.createElement)("div",{key:"truncated",className:"gp-notice"},u("diff.truncated")):null,Ye?(0,v.createElement)("div",{key:"capped",className:"gp-notice"},u("diff.expandCapped",{n:2e3})):null,(0,v.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:Le},ft)]);return A?Qr(T,E,at,u):at});function fi(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function mi(e,t,n){let a=[];return n!==null?(n.forEach((r,i)=>a.push({key:`c${i}`,text:r.text})),a):t!==null?(t.forEach((r,i)=>{if(r.kind==="hunk"||r.kind==="gap")return;let o=r.rightText??r.leftText??"";o!==""&&a.push({key:`c${i}`,text:o})}),a):(e.forEach((r,i)=>{r.kind==="hunk"||r.kind==="gap"||(r.leftText!==null&&r.leftText!==""&&a.push({key:`l${i}`,text:r.leftText}),r.rightText!==null&&r.rightText!==""&&a.push({key:`r${i}`,text:r.rightText}))}),a)}function hi(e,t){if(t==="")return[];let n=[];for(let a of e)for(let[r,i]of Yt(a.text,t))if(n.push({cellKey:a.key,start:r,end:i}),n.length>=Ut)return n;return n}function Qr(e,t,n,a){let r=(i,o)=>(0,v.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${e===i?" gp-seg__btn--active":""}`,"aria-pressed":e===i,onClick:()=>t(i)},o);return(0,v.createElement)("div",{className:"gp-svgdiff"},[(0,v.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,v.createElement)("div",{className:"gp-seg"},[r("render",a("diff.svgRender")),r("source",a("diff.svgSource"))])),(0,v.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function yi(e,t,n,a,r,i,o){let[s,l]=(0,v.useState)(null),d=(0,v.useRef)(0);(0,v.useEffect)(()=>{d.current+=1,l(null)},[e]);let p=(0,v.useCallback)((u,g)=>{if(n===void 0||a===void 0||r===void 0||i===void 0)return;let w=`${u.rightStart}:${g}`;l(w);let k=++d.current,{start:_,end:S}=bi(u,g),R=i==="commit"&&o!==void 0?{kind:"file-lines",path:r,base:"commit",commit:o,start:_,end:S}:i==="staged"?{kind:"file-lines",path:r,base:"staged",start:_,end:S}:{kind:"file-lines",path:r,base:"worktree",start:_,end:S};n.query({sessionId:a,query:R}).then($=>{if(k!==d.current)return;let q=me($,"file-lines");l(null),q!==null&&t(A=>Fr(A,u.rightStart,g,q.start,q.lines,q.eof))}).catch(()=>{k===d.current&&l(null)})},[n,a,r,i,o,t]);return{busy:s,run:p}}function bi(e,t){let n=e.count;return t==="all"||n<=st?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+st-1}:{start:e.rightStart+n-st,end:e.rightStart+n-1}}function vi(e,t,n,a,r){let[i,o]=(0,v.useState)({kind:"idle"});return(0,v.useEffect)(()=>{if(e===void 0||t===void 0||n===void 0||a===void 0)return;let s=!0;o({kind:"loading"});let l=a==="commit"&&r!==void 0?{kind:"image-diff",path:n,base:"commit",commit:r}:a==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"};return e.query({sessionId:t,query:l}).then(d=>{if(!s)return;let p=me(d,"image-diff");o(p!==null?{kind:"ready",res:p}:{kind:"failed"})}).catch(()=>{s&&o({kind:"failed"})}),()=>{s=!1}},[e,t,n,a,r]),i}function nn(e,t=""){return e.map((n,a)=>(0,v.createElement)("span",{key:`${t}${a}`,style:n.style},n.text))}function Yr(e,t,n,a){if(n===null)return null;let r=n.perCell.get(t);if(r===void 0||r.length===0)return null;let i=n.activeKey===t?n.activeRange:null;return Zt(e,r,a,t,i,n.activeRef)}function rn(e,t,n,a,r=null,i=-1){let o={key:t,className:e,"data-r":i>=0?i:void 0};if(n==="")return(0,v.createElement)("div",o,"\xA0");let s=a(n)?.[0],l=Yr(n,t,r,s);return l!==null?(0,v.createElement)("div",o,l):(0,v.createElement)("div",o,s===void 0?n:nn(s))}function Pn(e,t,n,a,r,i,o=null,s=-1){let l={key:t,className:e,"data-r":s>=0?s:void 0},d=i(n)?.[0]??[{text:n,style:{}}],p=Yr(n,t,o,d);if(p!==null)return(0,v.createElement)("div",l,p);let[u,g,w]=Br(d,a);return(0,v.createElement)("div",l,[...nn(u,"p"),(0,v.createElement)("span",{key:"w",className:r},g.length===0?"\xA0":nn(g)),...nn(w,"s")])}function wi(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function xi(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function ki(e,t,n,a,r,i){if(e.kind==="hunk")return[(0,v.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[Zr(e.gap,t,a,i)];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,v.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${o}`}):e.kind==="mod"&&e.leftWord!==void 0?Pn(`gp-diff-cell ${o}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,r,t):rn(`gp-diff-cell ${o}`,`l${t}`,e.leftText,n,r,t),d=e.rightText===null?(0,v.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.rightWord!==void 0?Pn(`gp-diff-cell ${s}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,r,t):rn(`gp-diff-cell ${s}`,`r${t}`,e.rightText,n,r,t);return[(0,v.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,v.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function _i(e,t,n,a,r,i){if(e.kind==="hunk")return[(0,v.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[Zr(e.gap,t,a,i)];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??"",u=s?e.rightWord:o?e.leftWord:void 0,g=s?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",w=`gp-diff-cell gp-diff-uni__code ${l}`,k=u!==void 0?Pn(w,`c${t}`,p,u,g,n,r,t):rn(w,`c${t}`,p,n,r,t);return[(0,v.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,v.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,v.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),k]}function Zr(e,t,n,a){let r=n.busy===`${e.rightStart}:all`,i=n.busy===`${e.rightStart}:up`,o=n.busy===`${e.rightStart}:down`,s=(p,u,g)=>(0,v.createElement)("button",{key:p,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:w=>{w.stopPropagation(),n.run(e,p)}},g?a("common.loading"):u),l=[],d=e.count;return d<=st?l.push(s("all",a("diff.expandGap",{n:d}),r)):(e.atStart||l.push(s("up",a("diff.expandUp",{n:st}),i)),l.push(s("all",a("diff.expandGap",{n:d}),r)),l.push(s("down",a("diff.expandDown",{n:st}),o))),(0,v.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function sn(e){return Lr(e)}var U=require("react");var Si=100;function ea(e,t,n){let[a,r]=(0,U.useState)(null),[i,o]=(0,U.useState)(!1),[s,l]=(0,U.useState)([]),d=(0,U.useCallback)(()=>{o(!1),(async()=>{let[p,u]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]),g=me(p,"branches");if(g===null){o(!0);return}let w=me(u,"tags");r({current:g.current,defaultBranch:g.defaultBranch,local:g.local,remote:g.remote,tags:w?.tags??[]}),e.query({sessionId:t,query:{kind:"authors"}}).then(k=>{l(me(k,"authors")?.authors??[])})})()},[e,t]);return(0,U.useEffect)(()=>{d()},[n]),{tree:a,treeError:i,authors:s,reload:d}}function ta(e,t,n,a,r){let[i,o]=(0,U.useState)([]),[s,l]=(0,U.useState)(0),[d,p]=(0,U.useState)(!1),[u,g]=(0,U.useState)(!1),w=(0,U.useRef)(0),k=(0,U.useRef)(!1),_=(0,U.useRef)(null),S=(0,U.useCallback)(async(A,T)=>{if(k.current)return;k.current=!0;let E=w.current;p(!0),g(!1);let J=await e.query({sessionId:t,query:{kind:"history",limit:Si,skip:A,...T.ref?{ref:T.ref}:{},...T.search?{search:T.search}:{},...T.author?{author:T.author}:{},...T.since?{since:T.since}:{}}});if(k.current=!1,E!==w.current)return;p(!1);let O=me(J,"history");if(O===null){g(!0);return}let V=O.commits;o(j=>A===0?V:[...j,...V]),l(O.total)},[e,t]),R=(0,U.useRef)(n);(0,U.useEffect)(()=>{w.current+=1,k.current=!1,R.current!==n&&(R.current=n,r(),_.current&&(_.current.scrollTop=0)),S(0,n)},[n,a]);let $=s<0?!0:i.length<s,q=(0,U.useCallback)(()=>{k.current||!$||S(i.length,n)},[S,i.length,n,$]);return{commits:i,total:s,loading:d,listError:u,hasMore:$,listRef:_,loadMore:q}}function na(e,t,n){let[a,r]=(0,U.useState)(null),[i,o]=(0,U.useState)(null),[s,l]=(0,U.useState)(!1),[d,p]=(0,U.useState)(null),[u,g]=(0,U.useState)(null),[w,k]=(0,U.useState)(!1),[_,S]=(0,U.useState)(n),[R,$]=(0,U.useState)(!1),q=(0,U.useRef)(0),A=(0,U.useRef)(null),T=(0,U.useRef)(new Map),E=(0,U.useCallback)((Y,f)=>{let x=T.current;for(x.set(Y,f);x.size>50;){let P=x.keys().next().value;if(P===void 0)break;x.delete(P)}},[]),J=(0,U.useCallback)(()=>{r(null),o(null),A.current=null},[]),O=(0,U.useCallback)(Y=>{A.current===Y.hash&&r(Y)},[]),V=(0,U.useCallback)(async Y=>{A.current=Y.hash,r(Y),l(!1),q.current+=1,p(null),g(null),k(!1);let f=T.current.get(Y.hash);if(f!==void 0){o(f);return}o(null);let x=await e.query({sessionId:t,query:{kind:"show",ref:Y.hash}});if(A.current!==Y.hash)return;let P=me(x,"show");if(P!==null){let z={commit:P.commit,body:P.body,stats:P.stats,insertions:P.insertions,deletions:P.deletions};E(Y.hash,z),o(z)}else l(!0)},[e,t,E]),j=(0,U.useCallback)(async(Y,f,x,P=!1)=>{let z=++q.current;p({path:Y,hash:f,shortHash:x}),g(null),k(!1),$(P);let C=await e.query({sessionId:t,query:{kind:"diff",path:Y,base:"commit",commit:f,...P?{context:2e3}:{}}});if(z!==q.current)return;let X=me(C,"diff");X!==null?g({text:X.text,newLines:X.newLines,truncated:X.truncated}):k(!0)},[e,t]),N=(0,U.useCallback)(()=>{q.current+=1,p(null),g(null),k(!1),$(!1)},[]);(0,U.useEffect)(()=>{if(d===null)return;let Y=f=>{f.key==="Escape"&&N()};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[d,N]);let[Z,ie]=(0,U.useState)(null),[oe,W]=(0,U.useState)(null),de=(0,U.useRef)(void 0),se=(0,U.useRef)(null),he=(0,U.useCallback)((Y,f,x)=>{de.current!==void 0&&clearTimeout(de.current),de.current=setTimeout(()=>{se.current=Y.hash,ie({commit:Y,x:f,y:x});let P=T.current.get(Y.hash);if(P!==void 0){W(P.body);return}W(null),e.query({sessionId:t,query:{kind:"show",ref:Y.hash}}).then(z=>{if(se.current!==Y.hash)return;let C=me(z,"show");C!==null?(E(Y.hash,{commit:C.commit,body:C.body,stats:C.stats,insertions:C.insertions,deletions:C.deletions}),W(C.body)):W("")})},260)},[e,t,E]),fe=(0,U.useCallback)(()=>{de.current!==void 0&&clearTimeout(de.current),se.current=null,ie(null),W(null)},[]);return(0,U.useEffect)(()=>()=>{de.current!==void 0&&clearTimeout(de.current)},[]),{selected:a,detail:i,detailError:s,select:V,resyncSelected:O,clearSelection:J,fileDiff:d,fileDiffData:u,fileDiffError:w,fileDiffMode:_,setFileDiffMode:S,fileDiffExpanded:R,openFileDiff:j,closeFileDiff:N,hover:Z,hoverBody:oe,onHoverEnter:he,onHoverLeave:fe}}var He=require("react"),Ci=(e,t,n)=>Math.max(t,Math.min(n,e));function Ti(e,t){try{let n=typeof localStorage<"u"?localStorage.getItem(e):null,a=n===null?NaN:Number(n);return Number.isFinite(a)?a:t}catch{return t}}function Ni(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function dt(e){let{storageKey:t,initial:n,min:a,reserve:r,edge:i}=e,[o,s]=(0,He.useState)(()=>Ti(t,n)),l=(0,He.useRef)(null),d=(0,He.useRef)(null),p=(0,He.useCallback)(g=>{let k=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:g.clientX,w:o,max:Math.max(a,k-r)},g.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[o,a,r]);(0,He.useEffect)(()=>{if(typeof window>"u")return;let g=k=>{let _=d.current;if(_===null)return;let S=k.clientX-_.x;s(Ci(_.w+(i==="end"?S:-S),a,_.max))},w=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),s(k=>(Ni(t,k),k)))};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",w),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",w)}},[i,a,t]);let u=(0,He.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:p});return{width:o,divider:u}}var ra=require("react");function ct(e,t,n,a,r=!1){return e.map(i=>(0,ra.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${t===i?" gp-seg__btn--active":""}`,...r?{disabled:!0}:{},onClick:()=>n(i)},a(i)))}var ge=require("react"),aa=require("react-dom");function zt(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"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 _t(e){return(0,ge.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function St(e){return(0,ge.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,ge.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,ge.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 Ct(e){return typeof document>"u"?null:(0,ge.createElement)(Ei,e)}function Ei({onClose:e,title:t,icon:n,hash:a,body:r,footer:i,overlay:o,portalKey:s,t:l}){let d=o!=null;(0,ge.useEffect)(()=>{let u=g=>{g.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,d]);let p=(0,ge.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{!d&&u.target===u.currentTarget&&e()}},(0,ge.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,ge.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,ge.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,ge.createElement)("span",{key:"title",className:"gp-modal__path"},t),a!==void 0?(0,ge.createElement)("span",{key:"hash",className:"gp-modal__hash"},a):null,(0,ge.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,ge.createElement)(tt,{size:15}))]),(0,ge.createElement)("div",{key:"body",className:"gp-modal__form"},r),i,o??null]));return(0,aa.createPortal)(p,document.body,s)}function Mi(e){return(0,ge.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,ge.createElement)("div",{key:"sp",className:"gp-spinner"}),(0,ge.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function $e(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return Ct({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,ge.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,_t(e.t),e.error!==null?(0,ge.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:St({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:Mi(e.busyLabel)}:{}})}var ae=require("react");function ia(e,t){return typeof document>"u"?null:(0,ae.createElement)(Ri,{target:e,...t})}function Ri({target:e,onClose:t,onCreate:n,error:a,t:r}){let[i,o]=(0,ae.useState)(""),[s,l]=(0,ae.useState)(!1),[d,p]=(0,ae.useState)(""),u=()=>{i.trim()!==""&&n(i.trim(),s?d:"")};return Ct({onClose:t,title:r("tag.createTitle"),icon:(0,ae.createElement)(ht,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:r,body:[(0,ae.createElement)("input",{key:"name",className:"gp-input",placeholder:r("tag.namePlaceholder"),value:i,autoFocus:!0,onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&u()}}),(0,ae.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,ae.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:s,onChange:()=>l(g=>!g)}),r("tag.annotated")]),s?(0,ae.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:r("tag.messagePlaceholder"),value:d,onChange:g=>p(g.target.value)}):null,_t(r),a!==null?(0,ae.createElement)("div",{key:"err",className:"gp-feedback"},a):null],footer:St({onClose:t,onConfirm:u,confirmLabel:r("tag.create"),confirmDisabled:i.trim()==="",danger:!1,t:r})})}function oa(e,t){return typeof document>"u"?null:(0,ae.createElement)(Gi,{target:e,...t})}function Gi({target:e,from:t,dirty:n,lostFiles:a,lostTotal:r,lostTruncated:i,busy:o,error:s,onReset:l,onClose:d,t:p}){let[u,g]=(0,ae.useState)("mixed"),[w,k]=(0,ae.useState)(!1);(0,ae.useEffect)(()=>{u!=="hard"&&k(!1)},[u]);let _=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],S=o||u==="hard"&&!w;return Ct({onClose:d,title:p("reset.title"),icon:(0,ae.createElement)(Jt,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:p,body:[(0,ae.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},p("reset.body",{from:t,to:e.shortHash})),(0,ae.createElement)("div",{key:"modes",className:"gp-reset__modes"},_.map(R=>(0,ae.createElement)("label",{key:R.value,className:`gp-reset__mode${u===R.value?" gp-reset__mode--on":""}${R.value==="hard"?" gp-reset__mode--danger":""}`},[(0,ae.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:u===R.value,onChange:()=>g(R.value)}),(0,ae.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,ae.createElement)("span",{key:"l",className:"gp-reset__modelabel"},p(R.label)),(0,ae.createElement)("span",{key:"h",className:"gp-reset__modehint"},p(R.hint))])]))),u==="hard"?(0,ae.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},p("reset.hardOrphan")):null,u==="hard"&&r>0?(0,ae.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,ae.createElement)("div",{key:"w",className:"gp-reset__warn"},p("reset.hardWarn")),(0,ae.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...a.map(R=>(0,ae.createElement)("li",{key:R,title:R},R)),i?(0,ae.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},p("reset.lostMore")):null])]):null,u==="hard"?(0,ae.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,ae.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:w,onChange:()=>k(R=>!R)}),p(r>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,ae.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},p("ops.dirtyWarn")):null,_t(p),s!==null?(0,ae.createElement)("div",{key:"err",className:"gp-feedback"},s):null],footer:St({onClose:d,onConfirm:()=>void l(u),confirmLabel:p("reset.confirm"),confirmDisabled:S,danger:u==="hard",t:p})})}var Re=require("react");function sa(e,t){return typeof document>"u"?null:(0,Re.createElement)(Di,{target:e,...t})}function Di({target:e,from:t,dirty:n,busy:a,error:r,onConfirm:i,onClose:o,t:s}){let[l,d]=(0,Re.useState)(!1),p=(u,g,w,k)=>(0,Re.createElement)("label",{key:g,className:`gp-bpick__mode${l===u?" gp-bpick__mode--on":""}`},[(0,Re.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===u,onChange:()=>d(u)}),(0,Re.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,Re.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},w),(0,Re.createElement)("span",{key:"h",className:"gp-bpick__modehint"},k)])]);return $e({title:s("switch.confirmTitle"),body:s("switch.body",{from:t??s("switch.detached"),to:e.name}),extra:(0,Re.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,Re.createElement)("div",{key:"trk",className:"gp-bpick__note"},s("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,Re.createElement)("div",{key:"dw",className:"gp-bpick__warn"},s("switch.dirtyWarn",{count:n})),n===0?null:(0,Re.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:r,confirmBusy:a,busyLabel:s("switch.switching"),onConfirm:()=>i(l),onClose:o,t:s})}function Pi(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function la(e){let t=new Set(e.local.map(r=>r.name)),n=e.local.map(r=>({key:`local:${r.name}`,group:"local",label:r.name,name:r.name,reused:!1,ahead:r.ahead,behind:r.behind,shortHash:r.shortHash})),a=[];for(let r of e.remote){let i=Pi(r.name);if(i===null)continue;let o=t.has(i.branch);a.push({key:`remote:${r.name}`,group:"remote",label:r.name,name:i.branch,createFrom:o?void 0:r.name,reused:o,ahead:r.ahead,behind:r.behind,shortHash:r.shortHash})}return[...n,...a]}function da(e,t){return e.name!==t}var pe=require("react");var Xe=require("react"),ca=require("react-dom"),Li=140,Ai=260;function ln(e){let t=e?.placement??"above",n=e?.delayMs??Li,a=e?.maxWidth??Ai,[r,i]=(0,Xe.useState)(null),o=(0,Xe.useRef)(void 0),s=(0,Xe.useCallback)(()=>{o.current!==void 0&&(clearTimeout(o.current),o.current=void 0),i(null)},[]),l=(0,Xe.useCallback)((g,w)=>{o.current!==void 0&&clearTimeout(o.current),o.current=setTimeout(()=>{let k=g.getBoundingClientRect(),_=Math.max(8,Math.min(k.left,window.innerWidth-a-8));i(t==="below"?{text:w,left:_,top:k.bottom+6}:{text:w,left:_,bottom:Math.max(8,window.innerHeight-k.top+6)})},n)},[t,n,a]),d=(0,Xe.useCallback)(g=>({onMouseEnter:w=>l(w.currentTarget,g),onMouseLeave:s,onFocus:w=>l(w.currentTarget,g),onBlur:s}),[l,s]),p={left:r?.left??0,maxWidth:a};r?.top!==void 0&&(p.top=r.top),r?.bottom!==void 0&&(p.bottom=r.bottom);let u=r!==null&&typeof document<"u"?(0,ca.createPortal)((0,Xe.createElement)("div",{className:"gp-tip gp-tip--sb",style:p},r.text),document.body):null;return{tipProps:d,tipNode:u,hideTip:s}}function pa(e,t,n){if(e==="loading"||e===null)return(0,pe.createElement)("div",{className:"gp-pullscope gp-pullscope--loading"},t(n.loading));let a=t(n.line,{commits:e.commits,files:e.files,ins:e.insertions,del:e.deletions}),r=a.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(r===null)return(0,pe.createElement)("div",{className:"gp-pullscope"},a);let i=a.indexOf(r[0]);return(0,pe.createElement)("div",{className:"gp-pullscope"},[a.slice(0,i),(0,pe.createElement)("span",{key:"add",className:"gp-pullscope__add"},r[1])," / ",(0,pe.createElement)("span",{key:"del",className:"gp-pullscope__del"},r[2]),a.slice(i+r[0].length)])}function ua(e,t){return pa(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function ga(e,t){return pa(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function zi(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function Ln(e,t){return(0,pe.createElement)(Hi,{snapshot:e,cb:t})}function Hi({snapshot:e,cb:t}){let{t:n}=t,{tipProps:a,tipNode:r,hideTip:i}=ln({placement:"above"}),o=e.remote??null,s=e.hasUpstream===!0,l=(()=>{if(o===null||o.hostKind!=="github")return null;let R=(0,pe.createElement)(kr,{size:14});if(o.webUrl===null)return(0,pe.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":o.url,...a(o.url)},(0,pe.createElement)("span",{className:"gp-statusbar__ic"},R));let $=o.host!==null?n("status.openRepoOn",{host:o.host}):n("status.openRepo"),q=`${zi(o.webUrl)} \xB7 ${$}`;return(0,pe.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:o.webUrl,target:"_blank",rel:"noreferrer","aria-label":q,...a(q)},(0,pe.createElement)("span",{className:"gp-statusbar__ic"},R))})(),{ahead:d,behind:p,branch:u}=e,g=s&&p>0&&d===0,w=s&&d>0&&p===0,k=!s&&u!==null&&o!==null,_=(()=>{let R,$="";return u===null?R=n("status.detached"):s?d===0&&p===0?(R=n("status.synced"),$=" gp-statusbar__state--ok"):d>0&&p>0?(R=n("status.diverged",{ahead:d,behind:p}),$=" gp-statusbar__state--warn"):p>0?(R=n("status.behind",{n:p}),$=" gp-statusbar__state--warn"):R=n("status.ahead",{n:d}):R=n("status.noUpstream"),(0,pe.createElement)("span",{key:"s",className:`gp-statusbar__state${$}`},R)})(),S=[o!==null?(0,pe.createElement)("button",{key:"check",type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),...a(n("status.checkTitle")),onClick:()=>{i(),t.onCheck()}},(0,pe.createElement)(Sr,{size:13})):null,g?(0,pe.createElement)("button",{key:"pull",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),...a(n("status.pullTitle")),onClick:()=>{i(),t.onPull()}},[(0,pe.createElement)(_r,{key:"i",size:12}),n("status.pull")]):null,w?(0,pe.createElement)("button",{key:"push",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),...a(n("status.pushTitle")),onClick:()=>{i(),t.onPush()}},[(0,pe.createElement)(Tn,{key:"i",size:12}),n("status.push")]):null,k?(0,pe.createElement)("button",{key:"publish",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),...a(n("status.publishTitle")),onClick:()=>{i(),t.onPublish()}},[(0,pe.createElement)(Tn,{key:"i",size:12}),n("status.publish")]):null];return(0,pe.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,pe.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[_,...S]),r])}var An=new Set,Tt=14,fa=30;function Fi(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 Bi=46,Ii=260;function Oi(e,t){let[n,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>a(e.clientWidth>0&&e.clientWidth<t);r();let i=new ResizeObserver(r);return i.observe(e),()=>i.disconnect()},[e,t]),n}function ma({remote:e,sessionId:t,refreshKey:n,defaultDiffView:a,snapshot:r,onAction:i,onResync:o,compact:s,t:l}){let[d,p]=(0,c.useState)({ref:null,search:"",author:"",since:""}),[u,g]=(0,c.useState)(""),[w,k]=(0,c.useState)(null),_=Oi(w,Ii),[S,R]=(0,c.useState)(new Set(["tags","remote"])),[$,q]=(0,c.useState)(0),A=n+$,T=()=>q(y=>y+1),[E,J]=(0,c.useState)(null),[O,V]=(0,c.useState)(null),[j,N]=(0,c.useState)(null),[Z,ie]=(0,c.useState)(null),[oe,W]=(0,c.useState)(null),[de,se]=(0,c.useState)(!1),[he,fe]=(0,c.useState)(!1),[Y,f]=(0,c.useState)(!1),[x,P]=(0,c.useState)(!1),[z,C]=(0,c.useState)(!1),[X,te]=(0,c.useState)(!1),[ee,xe]=(0,c.useState)(!1),[G,ve]=(0,c.useState)(!1),[Fe,Ce]=(0,c.useState)(null),[De,Le]=(0,c.useState)(null),[Ae,Be]=(0,c.useState)("list"),[Te,Ve]=(0,c.useState)(null),[pt,We]=(0,c.useState)(!1),[Ke,Ne]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!Ke)return;let y=K=>{K.key==="Escape"&&Ne(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[Ke]),(0,c.useEffect)(()=>{!s&&Ke&&Ne(!1)},[s,Ke]),(0,c.useEffect)(()=>{if(!x){Ce(null);return}let y=!0;return Ce("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then(K=>{if(!y)return;let le=me(K,"pull-preview");Ce(le!==null&&le.hasUpstream?{commits:le.commits,files:le.files,insertions:le.insertions,deletions:le.deletions}:null)}),()=>{y=!1}},[x,e,t]),(0,c.useEffect)(()=>{if(!X){Le(null);return}let y=!0;return Le("loading"),e.query({sessionId:t,query:{kind:"push-preview"}}).then(K=>{if(!y)return;let le=me(K,"push-preview");Le(le!==null&&le.hasUpstream?{commits:le.commits,files:le.files,insertions:le.insertions,deletions:le.deletions}:null)}),()=>{y=!1}},[X,e,t]);let{tree:_e,treeError:Ie,authors:qe,reload:Ee}=ea(e,t,A),we=(0,c.useMemo)(()=>{let y=new Map;if(_e===null)return y;for(let K of la(_e))da(K,_e.current)&&y.set(K.key,K);return y},[_e]),ut=y=>{W(null),Ve(y)},ne=na(e,t,a),{commits:ze,loading:Et,listError:Ue,hasMore:je,listRef:Qe,loadMore:gt}=ta(e,t,d,A,ne.clearSelection);(0,c.useEffect)(()=>{let y=setTimeout(()=>p(K=>K.search===u?K:{...K,search:u}),300);return()=>clearTimeout(y)},[u]);let ke=d.search!=="",Oe=(0,c.useMemo)(()=>ke?ze.map(y=>({commit:y,lane:0,color:0,edges:[],merge:!1})):Nr(ze,r.graphStyle),[ze,ke,r.graphStyle]),ft=(0,c.useMemo)(()=>ke?0:Tr(Oe),[Oe,ke]),rt=ke?12:Math.max(Tt,ft*Tt),Ye=s?Bi:fa,at=s?`${rt}px minmax(0,1fr)`:`${rt}px minmax(120px,1fr) 72px 120px 96px`,Q=()=>{let y=Qe.current;y===null||!je||y.scrollTop+y.clientHeight>=y.scrollHeight-240&&gt()},B=y=>{ne.select(y),s&&Be("detail")},h=(0,c.useMemo)(()=>Date.now(),[ze]),D=(0,c.useMemo)(()=>ne.detail===null?[]:Er(ne.detail.stats.map(y=>({path:y.path,meta:y.status}))),[ne.detail]),M=ne.selected,re=M?.hash??null,[ce,ye]=(0,c.useState)({hash:null,dirs:An}),Je=ce.hash===re?ce.dirs:An,Pa=(0,c.useCallback)(y=>{ye(K=>{let le=K.hash===re?K.dirs:An,Ft=new Set(le);return Ft.has(y)?Ft.delete(y):Ft.add(y),{hash:re,dirs:Ft}})},[re]);(0,c.useEffect)(()=>{if(M===null)return;let y=ze.find(K=>K.hash===M.hash);y!==void 0&&y!==M&&!Fi(y.refs,M.refs)&&ne.resyncSelected(y)},[ze,M]);let Kn=dt({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),Jn=dt({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),Vn=y=>p(K=>({...K,ref:y})),La=async(y,K)=>{if(!(E===null||de)){W(null),se(!0);try{let le=await e.run({sessionId:t,action:{kind:"tag-create",name:y,commit:E.hash,...K.trim()!==""?{message:K}:{}}});le.ok?(J(null),T()):W(zt(le.error.code,le.error.message,l))}finally{se(!1)}}},Aa=async y=>{if(!de){W(null),se(!0);try{let K=await e.run({sessionId:t,action:{kind:"tag-delete",name:y}});K.ok?(V(null),T()):W(zt(K.error.code,K.error.message,l))}finally{se(!1)}}},za=async()=>{if(!(j===null||de)){W(null),se(!0);try{let y=await i({kind:"revert",commit:j.hash});y.ok?N(null):W(y.error??l("error.generic"))}finally{se(!1)}}},Ha=async y=>{if(!(Z===null||de)){W(null),se(!0);try{let K=await i({kind:"reset",commit:Z.hash,mode:y});K.ok?ie(null):W(K.error??l("error.generic"))}finally{se(!1)}}},Fa=async y=>{if(!(Te===null||pt)){W(null),We(!0);try{let K=await i({kind:"branch-checkout",name:Te.name,...Te.createFrom===void 0?{}:{createFrom:Te.createFrom},...y?{stashMessage:l("switch.stashMessage",{branch:Te.name})}:{}});K.ok?(Ve(null),Ee()):W(K.error??l("error.generic"))}finally{We(!1)}}},Ba=async()=>{if(!he){W(null),fe(!0);try{let y=await i({kind:"fetch"});y.ok?Ee():W(y.error??l("error.generic"))}finally{fe(!1)}}},Ia=async()=>{if(!Y){W(null),f(!0);try{let y=await i({kind:"pull-ff"});y.ok?(P(!1),Ee()):W(y.error??l("error.generic"))}finally{f(!1)}}},Oa=async()=>{if(!z){W(null),C(!0);try{let y=await i({kind:"push"});y.ok?(te(!1),Ee()):W(y.error??l("error.generic"))}finally{C(!1)}}},$a=async()=>{if(!(ee||r.remote===null)){W(null),xe(!0);try{let y=await i({kind:"publish",remote:r.remote.name});y.ok?(ve(!1),Ee()):W(y.error??l("error.generic"))}finally{xe(!1)}}},Wn={syncBusy:he,pullBusy:Y,pushBusy:z,publishBusy:ee,onCheck:()=>void Ba(),onPull:()=>{W(null),P(!0)},onPush:()=>{W(null),te(!0)},onPublish:()=>{W(null),ve(!0)},t:l},qn=Wi(ne.fileDiff,{data:ne.fileDiffData,error:ne.fileDiffError,mode:ne.fileDiffMode,onMode:ne.setFileDiffMode,expanded:ne.fileDiffExpanded,onExpand:y=>{ne.fileDiff!==null&&ne.openFileDiff(ne.fileDiff.path,ne.fileDiff.hash,ne.fileDiff.shortHash,y)},onClose:ne.closeFileDiff,remote:e,sessionId:t,compact:s,t:l}),Un=(0,c.useMemo)(()=>[...new Set(r.changes.filter(y=>y.status!=="untracked").map(y=>y.path))],[r.changes]),jn=[E!==null?ia(E,{onClose:()=>J(null),onCreate:La,error:oe,compact:s,t:l}):null,O!==null?$e({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:O}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:oe,confirmBusy:de,onConfirm:()=>void Aa(O),onClose:()=>V(null),t:l}):null,j!==null?$e({title:l("revert.title"),body:l("revert.body",{ref:`${j.shortHash} ${j.subject}`})+(r.dirty?`
538
628
 
539
- ${o("ops.dirtyWarn")}`:""),confirmLabel:o("revert.confirm"),danger:!1,error:ne,confirmBusy:te,onConfirm:()=>void da(),onClose:()=>se(null),t:o}):null,ee!==null?$r(ee,{from:a.head??ee.shortHash,dirty:a.dirty,lostFiles:Fn,lostTotal:Fn.length,lostTruncated:a.truncated,busy:te,error:ne,onReset:ca,onClose:()=>ce(null),t:o}):null,X?De({title:o("status.pullConfirmTitle"),body:o("status.pullConfirmBody",{branch:a.branch??"HEAD",behind:a.behind}),extra:Xr(tn,o),confirmLabel:o("status.pullConfirm"),danger:!1,error:ne,confirmBusy:C,busyLabel:o("status.pulling"),onConfirm:()=>void ua(),onClose:()=>Q(!1),t:o}):null,re?De({title:o("status.pushConfirmTitle"),body:o("status.pushConfirmBody",{branch:a.branch??"HEAD",ahead:a.ahead}),extra:Jr(Re,o),confirmLabel:o("status.pushConfirm"),danger:!1,error:ne,confirmBusy:ge,busyLabel:o("status.pushing"),onConfirm:()=>void ga(),onClose:()=>me(!1),t:o}):null,Y?De({title:o("status.publishConfirmTitle"),body:o("status.publishConfirmBody",{branch:a.branch??"HEAD",remote:a.remote?.name??"origin"}),confirmLabel:o("status.publishConfirm"),danger:!1,error:ne,confirmBusy:ve,busyLabel:o("status.publishing"),onConfirm:()=>void fa(),onClose:()=>he(!1),t:o}):null],$n=(0,d.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,d.createElement)("div",{key:"tb",className:"gp-toolbar",ref:b},[s?(0,d.createElement)("button",{key:"filter",type:"button",className:`gp-btn${c.ref!==null?" gp-btn--primary":""}`,title:o("overview.filterBranch"),onClick:()=>Le(!0)},[(0,d.createElement)(ar,{key:"ic",size:13}),c.ref??o("overview.filterBranch")]):null,(0,d.createElement)("input",{key:"search",className:"gp-search",placeholder:o(k||s?"overview.searchShort":"overview.search"),value:u,onChange:h=>f(h.target.value)}),(0,d.createElement)("select",{key:"author",className:"gp-select",value:c.author,onChange:h=>p(B=>({...B,author:h.target.value}))},[(0,d.createElement)("option",{key:"",value:""},o("overview.allUsers")),...nn.map(h=>(0,d.createElement)("option",{key:h,value:h},h))]),(0,d.createElement)("select",{key:"since",className:"gp-select",value:c.since,onChange:h=>p(B=>({...B,since:h.target.value}))},[(0,d.createElement)("option",{key:"",value:""},o("overview.allTime")),(0,d.createElement)("option",{key:"today",value:"1 day ago"},o("overview.today")),(0,d.createElement)("option",{key:"7d",value:"7 days ago"},o("overview.last7d")),(0,d.createElement)("option",{key:"30d",value:"30 days ago"},o("overview.last30d"))]),(0,d.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:o("overview.fetch"),onClick:()=>{e.run({sessionId:t,action:{kind:"fetch"}}).then(()=>Se())}},(0,d.createElement)(Et,{size:14}))]),(0,d.createElement)("div",{key:"list",className:"gp-history__list",ref:yt,onScroll:Ke},Ce.length===0?(0,d.createElement)("div",{className:"gp-empty"},o(rt?"common.loading":rn?"overview.loadFailed":"overview.noResults")):at.map(h=>ii(h,{selected:j?.hash===h.commit.hash,gridTpl:sn,graphW:it,laneCount:bt,searching:Ge,now:ln,compact:s,rowH:on,onSelect:()=>vt(h.commit),onHoverEnter:V.onHoverEnter,onHoverLeave:V.onHoverLeave,t:o})))]),In=j===null?[(0,d.createElement)("div",{key:"empty",className:"gp-empty"},[(0,d.createElement)(Nt,{key:"i",size:20}),o("overview.selectCommit")])]:[(0,d.createElement)("div",{key:"files",className:"gp-detail__files"},V.detail===null?(0,d.createElement)("div",{className:"gp-empty"},V.detailError?o("overview.detailFailed"):o("common.loading")):[V.detail.stats.length>0?(0,d.createElement)("div",{key:"sum",className:"gp-detail__summary"},[(0,d.createElement)("span",{key:"f"},o("overview.changeSummary",{files:V.detail.stats.length})),(0,d.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,d.createElement)("span",{key:"a",className:"gp-stats__add"},`+${V.detail.insertions}`),(0,d.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${V.detail.deletions}`)]):null,si(dn,{activePath:V.fileDiff?.path??null,openTitle:o("overview.openFileDiff"),onOpen:h=>{j!==null&&V.openFileDiff(h,j.hash,j.shortHash)},collapsed:y,onToggleDir:G,expandLabel:o("overview.expandDir"),collapseLabel:o("overview.collapseDir")})]),(0,d.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,d.createElement)("div",{key:"subj",className:"gp-detail__subject"},j.subject),(0,d.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,d.createElement)("span",{key:"h",className:"gp-commit-hash"},j.shortHash),(0,d.createElement)("span",{key:"a"},j.author),(0,d.createElement)("span",{key:"t"},bn(j.dateIso))]),(0,d.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let h=j.refs.filter(B=>B.kind==="tag");return[h.length>0?(0,d.createElement)("div",{key:"tags",className:"gp-detail__tags"},h.map(B=>(0,d.createElement)("span",{key:`tag-${B.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:B.name},[(0,d.createElement)(Oe,{key:"i",size:11}),(0,d.createElement)("span",{key:"n",className:"gp-detail__tagname"},B.name),(0,d.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:o("tag.deleteOne",{name:B.name}),onClick:()=>{z(null),S(B.name)}},(0,d.createElement)(qe,{size:11}))]))):null,(0,d.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,d.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:o("overview.revert"),onClick:()=>{z(null),se({hash:j.hash,shortHash:j.shortHash,subject:j.subject})}},[(0,d.createElement)(lr,{key:"i",size:12}),o("overview.revert")]),(0,d.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:o("overview.reset"),onClick:()=>{z(null),l(),ce({hash:j.hash,shortHash:j.shortHash,subject:j.subject})}},[(0,d.createElement)(Rt,{key:"i",size:12}),o("overview.reset")]),(0,d.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:o("overview.createTag"),onClick:()=>{z(null),P({hash:j.hash,shortHash:j.shortHash})}},[(0,d.createElement)(Oe,{key:"i",size:12}),o("overview.createTag")])])]})()),V.detail!==null&&V.detail.body!==""?(0,d.createElement)("pre",{key:"body",className:"gp-detail__body"},V.detail.body):(0,d.createElement)("div",{key:"nb",className:"gp-empty"},o("overview.noMessage"))])];return s?(0,d.createElement)("div",{className:"gp-overview gp-overview--compact"},[Hn,...zn,mt==="detail"?(0,d.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,d.createElement)("div",{key:"back",className:"gp-subhead"},[(0,d.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>nt("list")},[(0,d.createElement)(We,{key:"i",size:14}),o("overview.backToList")]),j!==null?(0,d.createElement)("span",{key:"h",className:"gp-subhead__title gp-commit-hash"},j.shortHash):null]),...In]):$n,Sn(a,Ln),Xe?ai(ht,Je,c.ref,_,{onFilter:h=>{fe(h),Le(!1)},onToggle:h=>N(B=>{let U=new Set(B);return U.has(h)?U.delete(h):U.add(h),U}),onRetry:Se,onClose:()=>Le(!1),t:o}):null]):(0,d.createElement)("div",{className:"gp-overview"},[Hn,...zn,(0,d.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${K.width}px`}},[(0,d.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},Or(ht,Je,c.ref,_,{onFilter:h=>fe(h),onToggle:h=>N(B=>{let U=new Set(B);return U.has(h)?U.delete(h):U.add(h),U}),onRetry:Se,t:o})),Sn(a,Ln)]),K.divider,$n,ae.divider,(0,d.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${ae.width}px`}},In),ri(V.hover,V.hoverBody,o)])}function ri(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),i=e.y+14,l=(0,d.createElement)("div",{className:"gp-hovercard",style:{left:a,top:i,maxWidth:r}},[(0,d.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,d.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,d.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,d.createElement)("span",{key:"a"},e.commit.author),(0,d.createElement)("span",{key:"t"},bn(e.commit.dateIso))]),t===null?(0,d.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,d.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,d.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,Ot.createPortal)(l,document.body,"commit-hovercard")}function Or(e,t,n,r,a){if(t)return(0,d.createElement)("div",{className:"gp-empty"},[(0,d.createElement)("span",{key:"m"},a.t("overview.branchesError")),(0,d.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:a.onRetry},a.t("common.retry"))]);if(e===null)return(0,d.createElement)("div",{className:"gp-empty"},a.t("common.loading"));let i=(l,s,o,c,p="")=>(0,d.createElement)("div",{key:l,className:"gp-branch-group"},[(0,d.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>a.onToggle(l)},[(0,d.createElement)(Pe,{key:"c",size:11,open:!r.has(l)}),`${a.t(s)} (${o.length})`]),r.has(l)?null:o.map(u=>{let f=p+u.name,w=e.current===u.name,b=`gp-branch-row${n===f?" gp-branch-row--active":""}${w?" gp-branch-row--current":""}`;return(0,d.createElement)("div",{key:u.name,className:b,title:u.name,onClick:()=>a.onFilter(n===f?null:f)},[(0,d.createElement)("span",{key:"i",style:{display:"inline-flex",width:14}},c),(0,d.createElement)("span",{key:"n",className:"gp-tree-name"},u.name),u.ahead||u.behind?(0,d.createElement)("span",{key:"t",className:"gp-branch-row__track"},`${u.ahead?`\u2191${u.ahead}`:""}${u.behind?`\u2193${u.behind}`:""}`):null])})]);return(0,d.createElement)("div",{},[(0,d.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")),i("local","overview.local",e.local,(0,d.createElement)(mn,{size:13})),i("remote","overview.remote",e.remote,(0,d.createElement)(mn,{size:13})),i("tags","overview.tags",e.tags,(0,d.createElement)(Oe,{size:13}))])}function ai(e,t,n,r,a){if(typeof document>"u")return null;let i=(0,d.createElement)("div",{className:"gp-sheet-backdrop",onClick:l=>{l.target===l.currentTarget&&a.onClose()}},(0,d.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,d.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,d.createElement)("span",{key:"title",className:"gp-sheet__title"},a.t("overview.filterBranch")),(0,d.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:a.t("common.close"),onClick:a.onClose},(0,d.createElement)(qe,{size:15}))]),(0,d.createElement)("div",{key:"body",className:"gp-sheet__body"},Or(e,t,n,r,a))]));return(0,Ot.createPortal)(i,document.body,"branch-filter-sheet")}function ii(e,t){let n=e.commit,r=n.refs.map(i=>(0,d.createElement)("span",{key:i.name,className:`gp-ref-chip${i.head?" gp-ref-chip--head":""}${i.kind==="remote"?" gp-ref-chip--remote":""}${i.kind==="tag"?" gp-ref-chip--tag":""}`},i.name)),a=(0,d.createElement)("div",{key:"g",className:"gp-graph-cell"},t.searching?null:oi(e,t.laneCount,t.rowH));return t.compact?(0,d.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,d.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,d.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,d.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,d.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,d.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,d.createElement)("span",{key:"d",className:"gp-commit-date"},je(n.dateIso,t.now,t.t))])])]):(0,d.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:i=>t.onHoverEnter(n,i.clientX,i.clientY),onMouseLeave:t.onHoverLeave},[a,(0,d.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,d.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,d.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,d.createElement)("div",{key:"d",className:"gp-commit-date",title:ut(n.dateIso)},je(n.dateIso,t.now,t.t))])}var Vt=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function oi(e,t,n=Kr){let r=Math.max(et,t*et),a=s=>s*et+et/2,i=n/2,l=[];for(let s of e.edges){let o=Vt[s.color%Vt.length],c=s.kind==="out"?i:0,p=s.kind==="into"?i:n,u=(c+p)/2;l.push((0,d.createElement)("path",{key:`e${s.kind}-${s.fromLane}-${s.toLane}-${s.color}`,d:`M ${a(s.fromLane)} ${c} C ${a(s.fromLane)} ${u}, ${a(s.toLane)} ${u}, ${a(s.toLane)} ${p}`,stroke:o,strokeWidth:1.6,fill:"none"}))}return l.push((0,d.createElement)("circle",{key:"node",cx:a(e.lane),cy:i,r:e.merge?4:3.2,fill:Vt[e.color%Vt.length],stroke:"var(--dsw-alias-bg-layer-1)",strokeWidth:1})),(0,d.createElement)("svg",{className:"gp-graph-svg",width:r,height:n},l)}function si(e,t){let n=[],r=(a,i)=>{for(let l of a)if(l.dir){let s=t.collapsed.has(l.path);n.push((0,d.createElement)("div",{key:l.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+i*14},title:s?t.expandLabel:t.collapseLabel,role:"button",tabIndex:0,"aria-expanded":!s,onClick:()=>t.onToggleDir(l.path),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t.onToggleDir(l.path))}},[(0,d.createElement)(Pe,{key:"c",size:11,open:!s}),(0,d.createElement)("span",{key:"n",className:"gp-tree-name"},l.name)])),s||r(l.children,i+1)}else{let s=String(l.meta??"modified"),o=t.activePath===l.path;n.push((0,d.createElement)("div",{key:l.path,className:`gp-tree-row${o?" gp-tree-row--active":""}`,style:{paddingLeft:10+i*14},title:t.openTitle,onClick:()=>t.onOpen(l.path)},[(0,d.createElement)("span",{key:"st",className:`gp-status-badge ${Mt(s)}`},(Gt[s]??s[0]??"M").toUpperCase()),(0,d.createElement)("span",{key:"n",className:"gp-tree-name"},l.name)]))}};return r(e,0),(0,d.createElement)("div",{},n)}function li(e,t){if(e===null||typeof document>"u")return null;let{text:n,error:r,mode:a,onMode:i,expanded:l,onExpand:s,onClose:o,remote:c,sessionId:p,compact:u,t:f}=t,w=u?["unified","before","after"]:["unified","split","before","after"],b=u&&a==="split"?"unified":a,k=(0,d.createElement)("div",{className:"gp-modal-backdrop",onClick:_=>{_.target===_.currentTarget&&o()}},(0,d.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,d.createElement)("div",{key:"bar",className:"gp-modal__bar"},[(0,d.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,d.createElement)(or,{size:15})),(0,d.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},di(e.path)),(0,d.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),n!==null&&n!==""?(()=>{let _=Jt(n);return(0,d.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,d.createElement)("span",{key:"a",className:"gp-stats__add"},`+${_.add}`),(0,d.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${_.del}`)])})():null,(0,d.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${l?" gp-seg__btn--active":""}`,disabled:b!=="split"&&b!=="unified",title:f(l?"diff.collapse":"diff.expandAll"),onClick:()=>s(!l)},f(l?"diff.collapse":"diff.expandAll")),(0,d.createElement)("div",{key:"seg",className:"gp-seg"},$e(w,b,i,_=>f(`diff.${_}`))),(0,d.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:f("common.close"),onClick:o},(0,d.createElement)(qe,{size:15}))]),(0,d.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},n===null?(0,d.createElement)("div",{className:"gp-empty"},f(r?"overview.diffFailed":"common.loading")):(0,d.createElement)(Xt,{text:n,mode:b,path:e.path,remote:c,sessionId:p,imageSpec:{base:"commit",commit:e.hash},t:f}))]));return(0,Ot.createPortal)(k,document.body,"file-diff-modal")}function di(e){let t=e.lastIndexOf("/");return t<0?[(0,d.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,d.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,d.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var g=require("react");var be=require("react");function qr({stats:e,t}){let n=Date.now(),r=[(0,be.createElement)("span",{key:"files",className:"gp-stats__item"},t("stats.files",{n:e.fileCount})),(0,be.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,be.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,be.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&r.push((0,be.createElement)("span",{key:"st",className:"gp-stats__item"},t("stats.staged",{n:e.staged}))),e.modified>0&&r.push((0,be.createElement)("span",{key:"mo",className:"gp-stats__item"},t("stats.modified",{n:e.modified}))),e.untracked>0&&r.push((0,be.createElement)("span",{key:"un",className:"gp-stats__item"},t("stats.untracked",{n:e.untracked}))),e.partial&&r.push((0,be.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial",title:t("stats.partialHint")},t("stats.partial")));let a=[];return e.lastChangeAt!==null&&a.push((0,be.createElement)("span",{key:"lc",className:"gp-stats__item",title:ut(e.lastChangeAt)},t("stats.lastChange",{time:je(e.lastChangeAt,n,t)}))),e.headCommittedAt!==null&&a.push((0,be.createElement)("span",{key:"hc",className:"gp-stats__item",title:ut(e.headCommittedAt)},t("stats.lastCommit",{time:je(e.headCommittedAt,n,t)}))),a.length>0&&r.push((0,be.createElement)("span",{key:"times",className:"gp-stats__times"},a)),(0,be.createElement)("div",{className:"gp-stats"},r)}function qt(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 Wr(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 Wt(e,t,n,r){let a=e.length-1;if(a<=0)return{first:0,last:0};let i=Wr(e,t-r),l=Math.min(a,Wr(e,t+n+r)+1);return{first:i,last:l}}var Ie=require("react");function jt(){let[e,t]=(0,Ie.useState)({top:0,height:0}),n=(0,Ie.useRef)(null),r=(0,Ie.useRef)(null);return{setEl:(0,Ie.useCallback)(i=>{if(r.current!==null&&(r.current(),r.current=null),n.current=i,i===null)return;let l=()=>t(o=>{let c=i.scrollTop,p=i.clientHeight;return o.top===c&&o.height===p?o:{top:c,height:p}});l(),i.addEventListener("scroll",l,{passive:!0});let s=typeof ResizeObserver<"u"?new ResizeObserver(l):null;s?.observe(i),r.current=()=>{i.removeEventListener("scroll",l),s?.disconnect()}},[]),viewport:e,elRef:n}}var Tn=28,jr=26,ci=8,pi=600;function Ur({remote:e,sessionId:t,snapshot:n,onAction:r,compact:a,t:i}){let[l,s]=(0,g.useState)(new Set),[o,c]=(0,g.useState)(""),[p,u]=(0,g.useState)(!1),[f,w]=(0,g.useState)(!1),[b,k]=(0,g.useState)(null),[_,N]=(0,g.useState)(new Set),[A,J]=(0,g.useState)(null),[M,v]=(0,g.useState)(null),[L,P]=(0,g.useState)(null),[W,S]=(0,g.useState)(()=>n.defaultDiffView),[$,se]=(0,g.useState)(!1),[ee,ce]=(0,g.useState)(!1),[ne,z]=(0,g.useState)(!1),[te,T]=(0,g.useState)(!1),[pe,H]=(0,g.useState)(null),[C,I]=(0,g.useState)("list"),[X,Q]=(0,g.useState)([]),[ge,D]=(0,g.useState)(!0),[re,me]=(0,g.useState)(!1),[ve,Z]=(0,g.useState)(null),Y=(0,g.useRef)(null),he=(0,g.useRef)(0),{setEl:tn,viewport:Ae}=jt(),Re=(0,g.useCallback)(async()=>{let y=await e.query({sessionId:t,query:{kind:"stash-list"}}),G=de(y,"stash-list");Q(G?.entries??[])},[e,t]);(0,g.useEffect)(()=>{Re()},[Re,n.checkedAt]);let Be=(0,g.useMemo)(()=>n.changes.filter(y=>y.staged).sort(Nn),[n]),mt=(0,g.useMemo)(()=>n.changes.filter(y=>!y.staged&&y.status!=="untracked").sort(Nn),[n]),nt=(0,g.useMemo)(()=>n.changes.filter(y=>y.status==="untracked").sort(Nn),[n]),Le=[{key:"staged",labelKey:"changes.groupStaged",items:Be},{key:"unstaged",labelKey:"changes.groupUnstaged",items:mt},{key:"untracked",labelKey:"changes.groupUntracked",items:nt}].filter(y=>y.items.length>0),{items:ht,tops:Je,totalH:nn}=(0,g.useMemo)(()=>{let y=[];for(let K of Le)if(y.push({kind:"head",g:{key:K.key,labelKey:K.labelKey,count:K.items.length}}),!_.has(K.key))for(let ae of K.items)y.push({kind:"row",c:ae});let G=qt(y.map(K=>K.kind==="head"?jr:Tn));return{items:y,tops:G,totalH:G[y.length]}},[Be,mt,nt,_]),Se=Ae.height>0?Ae.height:pi,{first:V,last:Ce}=Wt(Je,Ae.top,Se,ci*Tn);(0,g.useEffect)(()=>{s(y=>{if(y.size===0)return y;let G=new Set(n.changes.map(fe=>fe.path+(fe.staged?":s":":w"))),K=new Set,ae=!1;for(let fe of y)G.has(fe)?K.add(fe):ae=!0;return ae?K:y})},[n]),(0,g.useEffect)(()=>{if(!p||ee||o.trim()!=="")return;let y=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(G=>{let K=de(G,"last-commit-message");y&&K!==null&&(c(K.message),ce(!0))}),()=>{y=!1}},[p,ee,o,e,t]);let rt=(0,g.useCallback)(async(y,G,K=!1,ae=!1)=>{let fe=++he.current;v({path:y,base:G}),ae||P(null),se(K);let Te=await e.query({sessionId:t,query:{kind:"diff",path:y,base:G,...K?{context:1e5}:{}}});if(fe!==he.current)return;let xt=de(Te,"diff");P(xt!==null?xt.text:"")},[e,t]);(0,g.useEffect)(()=>{if(M===null)return;if(!n.changes.some(G=>G.path===M.path)){v(null),P(null),I("list");return}rt(M.path,M.base,$,!0)},[n]),(0,g.useEffect)(()=>{J(null)},[n]),(0,g.useEffect)(()=>{T(!1)},[n]);let rn=y=>{s(G=>{let K=new Set(G);return K.has(y)?K.delete(y):K.add(y),K})},we=async y=>{if(f)return!1;w(!0),k(null),H(null);try{let G=await r(y);return G.ok?!0:(k(G.error??i("error.generic")),!1)}catch(G){return k(G instanceof Error?G.message:i("error.generic")),!1}finally{w(!1)}},yt=async()=>{let y=o.trim();if(y===""&&!p){k(i("error.emptyMessage"));return}let G=l.size>0?[...new Set([...l].map(ae=>ae.replace(/:[sw]$/,"")))]:void 0;await we({kind:"commit",message:y,...G?{paths:G}:{},...p?{amend:!0}:{}})&&(c(""),s(new Set),u(!1),ce(!1))},an=async y=>{await we({kind:"stash-push",...y.trim()!==""?{message:y}:{}})&&(me(!1),Re())},Ge=(y,G)=>{we({kind:"stash-apply",index:y,sha:G}).then(K=>{K&&Re()})},at=(y,G)=>{we({kind:"stash-pop",index:y,sha:G}).then(K=>{K&&Re()})},bt=async(y,G)=>{await we({kind:"stash-drop",index:y,sha:G})&&(Z(null),Re())},it=(y,G)=>{switch(y){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 G===void 0?i("error.llmFailed"):`${i("error.llmFailed")}: ${G}`;default:return G??i("error.generic")}},on=async()=>{if(ne)return;if(p&&!te&&o.trim()!==""){T(!0),k(null),H(i("commit.suggestOverwrite"));return}T(!1);let y=l.size>0?[...new Set([...l].map(G=>G.replace(/:[sw]$/,"")))]:void 0;z(!0),k(null),H(null);try{let G=await e.suggest({sessionId:t,...y&&y.length>0?{paths:y}:{}});G.ok?(c(G.value.message),G.value.truncated===!0&&H(i("commit.suggestTruncated")),Y.current?.focus()):k(it(G.error.code,G.error.message))}catch(G){k(G instanceof Error?G.message:i("error.generic"))}finally{z(!1)}},sn=y=>{N(G=>{let K=new Set(G);return K.has(y)?K.delete(y):K.add(y),K})},Ke=L!==null&&L!==""?Jt(L):null,vt=ze({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),ln=(y,G)=>{rt(y,G),a&&I("diff")},dn=a?["unified","before","after"]:["unified","split","before","after"],j=a&&W==="split"?"unified":W,He=[(0,g.createElement)(qr,{key:"stats",stats:n.stats,t:i}),(0,g.createElement)("div",{key:"toolbar",className:"gp-toolbar"},[(0,g.createElement)("button",{key:"sa",type:"button",className:"gp-btn",disabled:f||n.changes.length===0,onClick:()=>void we({kind:"stage-all"})},i("changes.stageAll")),(0,g.createElement)("button",{key:"ua",type:"button",className:"gp-btn",disabled:f||n.staged===0,onClick:()=>void we({kind:"unstage-all"})},i("changes.unstageAll")),(0,g.createElement)("button",{key:"stash",type:"button",className:"gp-btn",disabled:f||n.staged===0&&n.modified===0,title:i("changes.stash"),onClick:()=>{k(null),me(!0)}},[(0,g.createElement)(hn,{key:"ic",size:13}),i("changes.stash")])]),b!==null?(0,g.createElement)("div",{key:"err",className:"gp-feedback"},b):null,pe!==null?(0,g.createElement)("div",{key:"notice",className:"gp-notice"},pe):null,(0,g.createElement)("div",{key:"list",className:"gp-changes__list",ref:tn},n.changes.length===0?(0,g.createElement)("div",{className:"gp-empty"},i("changes.noChanges")):(0,g.createElement)("div",{className:"gp-changes__vlist",style:{height:nn}},ht.slice(V,Ce).map((y,G)=>{let K=V+G;if(y.kind==="head"){let Te=y.g;return(0,g.createElement)("div",{key:`h:${Te.key}`,className:"gp-changes__vrow",style:{top:Je[K],height:jr}},(0,g.createElement)("div",{className:"gp-group-head",onClick:()=>sn(Te.key)},[(0,g.createElement)(Pe,{key:"chev",size:12,open:!_.has(Te.key)}),`${i(Te.labelKey)} (${Te.count})`]))}let ae=y.c,fe=ae.path+(ae.staged?":s":":w");return(0,g.createElement)("div",{key:fe,className:"gp-changes__vrow",style:{top:Je[K],height:Tn}},fi(ae,{selected:l.has(fe),active:M?.path===ae.path&&M.base===(ae.staged?"staged":"worktree"),busy:f,armed:A===fe,onToggle:()=>rn(fe),onOpen:()=>ln(ae.path,ae.staged?"staged":"worktree"),onStage:()=>void we(ae.staged?{kind:"unstage",paths:[ae.path]}:{kind:"stage",paths:[ae.path]}),onDiscard:()=>{A===fe?(we({kind:"discard",paths:[ae.path]}),J(null)):J(fe)},t:i}))}))),X.length>0?(0,g.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,g.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>D(y=>!y)},[(0,g.createElement)(Pe,{key:"chev",size:12,open:!ge}),`${i("stash.section")} (${X.length})`]),ge?null:(0,g.createElement)("div",{key:"items"},X.map(y=>gi(y,{busy:f,onApply:()=>Ge(y.index,y.sha),onPop:()=>at(y.index,y.sha),onDrop:()=>{k(null),Z(y)},t:i})))]):null,(0,g.createElement)("div",{key:"box",className:"gp-commitbox"},[(0,g.createElement)("textarea",{key:"msg",className:"gp-commitbox__msg",placeholder:i("commit.placeholder"),value:o,ref:Y,onChange:y=>c(y.target.value)}),(0,g.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,g.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,g.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:p,onChange:()=>{u(y=>!y),ce(!1)}}),i("commit.amend")]),(0,g.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[n.suggestEnabled!==!1?(0,g.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:f||ne||n.changes.length===0,onClick:()=>void on(),title:i("commit.suggest")},[(0,g.createElement)(ir,{key:"ic",size:13}),i(ne?"commit.suggesting":"commit.suggest")]):null,(0,g.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:f||ne||o.trim()==="",onClick:()=>void yt()},i("commit.commit"))])])])],ot=M===null?(0,g.createElement)("div",{className:"gp-empty"},i("changes.selectFile")):(0,g.createElement)("div",{className:"gp-diff"},[(0,g.createElement)("div",{key:"tb",className:"gp-diff__toolbar"},[a?(0,g.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>I("list")},[(0,g.createElement)(We,{key:"i",size:14}),i("changes.backToList")]):null,(0,g.createElement)("span",{key:"path",className:"gp-diff__path"},M.path),Ke?(0,g.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,g.createElement)("span",{key:"a",className:"gp-stats__add"},`+${Ke.add}`)," ",(0,g.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${Ke.del}`)]):null,(0,g.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${$?" gp-seg__btn--active":""}`,style:Ke?{}:{marginLeft:"auto"},disabled:j!=="split"&&j!=="unified",title:i($?"diff.collapse":"diff.expandAll"),onClick:()=>void rt(M.path,M.base,!$)},i($?"diff.collapse":"diff.expandAll")),(0,g.createElement)("div",{key:"seg",className:"gp-seg"},$e(dn,j,S,y=>i(`diff.${y}`)))]),(0,g.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},L===null?(0,g.createElement)("div",{className:"gp-empty"},i("common.loading")):(0,g.createElement)(Xt,{text:L,mode:j,path:M.path,remote:e,sessionId:t,imageSpec:{base:M.base},t:i}))]),wt=[re?(0,g.createElement)(ui,{key:"push",onClose:()=>me(!1),onStash:an,error:b,t:i}):null,ve!==null?De({title:i("stash.dropTitle"),body:i("stash.dropConfirm",{name:ve.message}),confirmLabel:i("stash.drop"),danger:!0,error:b,onConfirm:()=>void bt(ve.index,ve.sha),onClose:()=>Z(null),t:i}):null];return a?(0,g.createElement)("div",{className:"gp-changes gp-changes--compact"},[...wt,C==="diff"?(0,g.createElement)("div",{key:"right",className:"gp-changes__right"},ot):(0,g.createElement)("div",{key:"left",className:"gp-changes__left"},He)]):(0,g.createElement)("div",{className:"gp-changes"},[...wt,(0,g.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${vt.width}px`}},He),vt.divider,(0,g.createElement)("div",{key:"right",className:"gp-changes__right"},ot)])}function ui({onClose:e,onStash:t,error:n,t:r}){let[a,i]=(0,g.useState)("");return Ze({onClose:e,title:r("stash.title"),icon:(0,g.createElement)(hn,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,g.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:a,autoFocus:!0,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&t(a)}}),Qe(r),n!==null?(0,g.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:Ye({onClose:e,onConfirm:()=>void t(a),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function gi(e,t){return(0,g.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,g.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,g.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,g.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,g.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,g.createElement)("span",{key:"t"},e.relTime):null])]),(0,g.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,g.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,g.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,g.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,g.createElement)(sr,{size:14}))])])}function Nn(e,t){return e.path.localeCompare(t.path)}function fi(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,g.createElement)("div",{key:e.path+(e.staged?":s":":w"),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,g.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,onClick:a=>a.stopPropagation(),onChange:t.onToggle}),(0,g.createElement)("span",{key:"st",className:`gp-status-badge ${Mt(e.status)}`},Gt[e.status]??"?"),(0,g.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,g.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,g.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,g.createElement)("button",{key:"stg",type:"button",className:"gp-icon-btn",title:e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,onClick:a=>{a.stopPropagation(),t.onStage()}},e.staged?"\u2212":"+"),(0,g.createElement)("button",{key:"dis",type:"button",className:"gp-icon-btn",title:t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,onClick:a=>{a.stopPropagation(),t.onDiscard()}},"\u21BA")])])}var m=require("react");var Ee=require("@deepseek-ai/dsh-client-ui-primitives");function Yr(e){return/\.(?:md|markdown)$/i.test(e)}function Gn(e){return/\.(?:html?|xhtml)$/i.test(e)}function mi(e){return Yr(e)||Gn(e)}var hi=256*1024,yi=5e3,Qr=5e3,Ut=20,En=12,bi=600,vi=6e4,Rn=new Map;function wi(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;Rn.set(e,{state:{...t,file:n},leftAt:Date.now()})}function xi(e){let t=Rn.get(e);return t===void 0?null:Date.now()-t.leftAt>vi?(Rn.delete(e),null):t.state}function Mn({remote:e,sessionId:t,compact:n,t:r}){let a=(0,m.useRef)(void 0);a.current===void 0&&(a.current=xi(t));let i=a.current,[l,s]=(0,m.useState)(()=>i?.dirs??new Map),[o,c]=(0,m.useState)(()=>i?.open??new Set([""])),[p,u]=(0,m.useState)(()=>i?.selected??null),[f,w]=(0,m.useState)(()=>i?.file??{kind:"idle"}),[b,k]=(0,m.useState)(()=>i?.renderMarkdown??!0),[_,N]=(0,m.useState)("idle"),[A,J]=(0,m.useState)("idle"),[M,v]=(0,m.useState)(()=>i?.pane??"tree"),L=(0,m.useMemo)(()=>({code:{copyLabel:r("files.copy"),copiedLabel:r("files.copied")},footnotes:r("files.footnotes")}),[r]),P=(0,m.useRef)(0),W=ze({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),S=(0,m.useCallback)(H=>{s(C=>{let I=C.get(H);if(I!==void 0&&I.status!=="error")return C;let X=new Map(C);return X.set(H,{status:"loading"}),X}),e.query({sessionId:t,query:{kind:"dir-list",path:H}}).then(C=>{let I=de(C,"dir-list");s(X=>{let Q=new Map(X);return Q.set(H,I===null?{status:"error"}:{status:"ready",entries:I.entries,truncated:I.truncated}),Q})}).catch(()=>{s(C=>{let I=new Map(C);return I.set(H,{status:"error"}),I})})},[e,t]);(0,m.useEffect)(()=>{S("")},[S]);let $=(0,m.useCallback)(H=>{c(C=>{let I=new Set(C);return I.has(H)?(I.delete(H),I):(I.add(H),l.get(H)===void 0&&S(H),I)})},[l,S]),se=(0,m.useCallback)(H=>{u(H),n&&v("preview"),k(!Gn(H)),N("idle"),J("idle");let C=++P.current;w({kind:"loading",path:H}),e.query({sessionId:t,query:{kind:"file-content",path:H}}).then(I=>{if(C!==P.current)return;let X=de(I,"file-content");if(X===null){w({kind:"error",path:H});return}if(X.tooLarge===!0){w({kind:"tooLarge",path:H});return}if(X.variant==="image"&&X.dataUrl!==void 0){w({kind:"image",path:H,dataUrl:X.dataUrl});return}if(X.variant==="text"){w({kind:"text",path:H,content:X.content??"",lines:X.lines??0});return}w({kind:"binary",path:H})}).catch(()=>{C===P.current&&w({kind:"error",path:H})})},[e,t,n]),ee=(0,m.useRef)({dirs:l,open:o,selected:p,file:f,renderMarkdown:b,pane:M});ee.current={dirs:l,open:o,selected:p,file:f,renderMarkdown:b,pane:M},(0,m.useEffect)(()=>()=>{wi(t,ee.current)},[t]);let ce=(0,m.useRef)(!1);(0,m.useEffect)(()=>{ce.current||(ce.current=!0,i!==null&&i.selected!==null&&f.kind==="idle"&&se(i.selected))},[i,f.kind,se]);let ne=(0,m.useMemo)(()=>Zr("",0,{dirs:l,open:o,selected:p,toggleDir:$,selectFile:se,t:r}),[l,o,p,$,se,r]),z=async()=>{if(p===null)return;let H=P.current;try{await navigator.clipboard.writeText(p),H===P.current&&N("copied")}catch{H===P.current&&N("error")}},te=async()=>{if(f.kind!=="text")return;let H=P.current;try{await navigator.clipboard.writeText(f.content),H===P.current&&J("copied")}catch{H===P.current&&J("error")}},T=(0,m.createElement)("div",{key:"left",className:"gp-files__tree",style:n?void 0:{flex:`0 0 ${W.width}px`}},ne),pe=(0,m.createElement)("div",{key:"right",className:"gp-files__preview"},[p!==null?(0,m.createElement)("div",{key:"bar",className:"gp-files__bar"},[n?(0,m.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>v("tree")},[(0,m.createElement)(We,{key:"i",size:14}),r("files.backToTree")]):null,(0,m.createElement)("code",{key:"path",className:"gp-files__path",title:p},p),f.kind==="text"&&mi(f.path)?(0,m.createElement)("div",{key:"mode",className:"gp-files__mode",role:"group","aria-label":r("files.previewMode")},[(0,m.createElement)("button",{key:"source",type:"button",className:`gp-files__mode-btn${b?"":" gp-files__mode-btn--active"}`,"aria-pressed":!b,onClick:()=>k(!1)},r("files.source")),(0,m.createElement)("button",{key:"render",type:"button",className:`gp-files__mode-btn${b?" gp-files__mode-btn--active":""}`,"aria-pressed":b,onClick:()=>k(!0)},r("files.render"))]):null,(0,m.createElement)("button",{key:"copy",type:"button",className:`gp-files__copy-path${_==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{z()}},r(_==="copied"?"files.pathCopied":_==="error"?"files.pathCopyFailed":"files.copyPath")),f.kind==="text"?(0,m.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${A==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{te()}},r(A==="copied"?"files.contentCopied":A==="error"?"files.contentCopyFailed":"files.copyContent")):null]):null,(0,m.createElement)("div",{key:"content",className:"gp-files__preview-content"},ki(f,b,L,r))]);return n?(0,m.createElement)("div",{className:"gp-files gp-files--compact"},M==="preview"?pe:T):(0,m.createElement)("div",{className:"gp-files"},[T,W.divider,pe])}function ki(e,t,n,r){return e.kind==="text"&&t&&Yr(e.path)?(0,m.createElement)("div",{className:"gp-files__markdown"},(0,m.createElement)(Ee.MarkdownText,{text:e.content,labels:n,variant:"body"})):e.kind==="text"&&t&&Gn(e.path)?(0,m.createElement)("iframe",{className:"gp-files__html",title:e.path,srcDoc:e.content,sandbox:"allow-scripts",referrerPolicy:"no-referrer"}):_i(e,r)}function Zr(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:10+t*14}},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:10+t*14}},n.t("files.loadFailed"))];let a=[];for(let i of r.entries){let l=e===""?i.name:`${e}/${i.name}`;if(i.dir){let s=n.open.has(l);a.push((0,m.createElement)("button",{key:l,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-expanded":s,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.toggleDir(l)},[(0,m.createElement)("span",{key:"c",className:"gp-tree-chev"},(0,m.createElement)(Pe,{size:11,open:s})),(0,m.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,m.createElement)(Ee.FileTypeIcon,{kind:"folder",size:18})),(0,m.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)])),s&&a.push(...Zr(l,t+1,n))}else{let s=n.selected===l;a.push((0,m.createElement)("button",{key:l,type:"button",className:`gp-tree-row gp-files__entry${s?" gp-tree-row--active":""}${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-current":s?"true":void 0,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.selectFile(l)},[(0,m.createElement)("span",{key:"c",className:"gp-tree-chev"}),(0,m.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,m.createElement)(Ee.FileTypeIcon,{path:l,size:18})),(0,m.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)]))}}return r.truncated&&a.push((0,m.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("files.truncated"))),a}function _i(e,t){switch(e.kind){case"idle":return(0,m.createElement)("div",{className:"gp-empty"},t("files.selectFile"));case"loading":return(0,m.createElement)("div",{className:"gp-empty"},t("common.loading"));case"error":return(0,m.createElement)("div",{className:"gp-empty"},t("files.loadFailed"));case"tooLarge":return(0,m.createElement)("div",{className:"gp-empty"},t("files.tooLarge"));case"binary":return(0,m.createElement)("div",{className:"gp-empty"},t("files.binary"));case"image":return(0,m.createElement)("div",{className:"gp-files__image"},(0,m.createElement)("img",{src:e.dataUrl,alt:e.path}));case"text":return(0,m.createElement)(Ci,{content:e.content,path:e.path,t})}}function Si(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[a,i]of Lt(e[r],t))if(n.push({line:r,start:a,end:i}),n.length>=Pt)return n;return n}function Ci({content:e,path:t,t:n}){let r=(0,m.useMemo)(()=>{let D=e.split(`
540
- `);return D.length>0&&D[D.length-1]===""&&D.pop(),D},[e]),a=e.length>hi||r.length>yi,i=a?void 0:(0,Ee.languageForPath)(t),l=(0,Ee.useCodeHighlighter)(i),s=(0,m.useMemo)(()=>a?void 0:l(r.join(`
541
- `)),[a,l,r]),[o,c]=(0,m.useState)(!1),[p,u]=(0,m.useState)(""),[f,w]=(0,m.useState)(!1),[b,k]=(0,m.useState)(0),{setEl:_,viewport:N,elRef:A}=jt(),J=(0,m.useRef)(null),M=(0,m.useRef)(null);(0,m.useEffect)(()=>{c(!1),u(""),k(0)},[t]);let v=At(p,Dt),L=(0,m.useMemo)(()=>r.map(D=>D.toLowerCase()),[r]),P=f?v:v.toLowerCase(),W=f?r:L,S=(0,m.useMemo)(()=>Si(W,P),[W,P]);(0,m.useEffect)(()=>{k(0)},[P]);let $=S.length===0?0:Math.min(b,S.length-1),se=(0,m.useMemo)(()=>{let D=new Map;for(let re of S){let me=D.get(re.line)??[];me.push([re.start,re.end]),D.set(re.line,me)}return D},[S]);(0,m.useEffect)(()=>{let D=re=>{if(!((re.ctrlKey||re.metaKey)&&(re.key==="f"||re.key==="F")))return;let me=A.current;me===null||me.offsetParent===null||(re.preventDefault(),c(!0),requestAnimationFrame(()=>J.current?.select()))};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[]);let ee=r.length,ce=(0,m.useMemo)(()=>qt(new Array(ee).fill(Ut)),[ee]),ne=N.height>0?N.height:bi,{first:z,last:te}=Wt(ce,N.top,ne,En*Ut),T=S.length>0?S[$].line:-1,pe=T>=0?Math.min(z,Math.max(0,T-En)):z,H=T>=0?Math.max(te,Math.min(ee,T+En)):te;(0,m.useEffect)(()=>{if(T<0)return;let D=requestAnimationFrame(()=>M.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(D)},[$,S,T]);let C=(0,m.useCallback)(D=>{k(re=>S.length===0?0:(re+D+S.length)%S.length)},[S.length]),I=S.length>0?S[$]:null,X=o?(0,m.createElement)(Ft,{inputRef:J,query:p,matches:S.length,active:$,caseSensitive:f,onChange:u,onToggleCase:()=>w(D=>!D),onStep:C,onClose:()=>c(!1),t:n}):null,Q=a||o?(0,m.createElement)("div",{key:"hd",className:"gp-files__header"},[a?(0,m.createElement)("div",{key:"note",className:"gp-files__note"},n("files.highlightOff")):null,X]):null,ge=[];for(let D=pe;D<H;D++)ge.push((0,m.createElement)("div",{key:D,className:"gp-files__row",style:{top:D*Ut}},[(0,m.createElement)("div",{key:"n",className:"gp-diff-no"},D+1),Ti(r[D],D,s?.[D],se.get(D),I,M,n)]));return(0,m.createElement)("div",{className:"gp-files__code gp-diff__scroll",ref:_},[Q,(0,m.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",style:{height:ee*Ut}},ge)])}function Ti(e,t,n,r,a,i,l){if(e==="")return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>Qr)return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,Qr),(0,m.createElement)("span",{key:"trunc",className:"gp-files__trunc"},l("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((o,c)=>(0,m.createElement)("span",{key:c,style:o.style},o.text)):e);let s=a!==null&&a.line===t?[a.start,a.end]:null;return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},Ht(e,r,n,`c${t}`,s,i))}var Qt=require("react"),Ni=620;function ea(e){let[t,n]=(0,Qt.useState)(!1);return(0,Qt.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(e.clientWidth>0&&e.clientWidth<=Ni);r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}var ta="gp.panel.fontDelta";function Ei(){if(typeof localStorage>"u")return 0;let e=Number(localStorage.getItem(ta));return e===-1||e===1?e:0}function na({ctx:e,sessionId:t,t:n}){let[r,a]=(0,E.useState)(Ei),[i,l]=(0,E.useState)(null),[s,o]=(0,E.useState)(null),c=ea(s),p=Tt(t),u=st(e),f=p.state==="error"&&p.error.code==="git-unavailable",w=p.state==="error"&&(p.error.code==="not-a-git-repo"||p.error.code==="git-unavailable"),b=f&&p.state==="error"&&p.error.isGitRepo===!0,k=w?"files":i!==null&&i.sessionId===t?i.tab:null,_=(0,E.useRef)({tabs:new Set});_.current.sessionId!==t&&(_.current={sessionId:t,tabs:new Set}),k!==null&&_.current.tabs.add(k);let N=_.current.tabs.has("files");(0,E.useEffect)(()=>{if(!Me(t))return;if(w){l(null);return}if(i?.sessionId===t)return;let S=Un(t);if(S!==null){l({sessionId:t,tab:S});return}let $=Zn(t);if($!==null){l({sessionId:t,tab:$});return}p.state==="ready"&&l({sessionId:t,tab:p.snapshot.dirty?"changes":"overview"})},[t,p,w,i?.sessionId]),(0,E.useEffect)(()=>{if(Me(t))return Qn(t,S=>l({sessionId:t,tab:S}))},[t]);let A=(0,E.useRef)({tab:null});A.current={sessionId:t,tab:k},(0,E.useEffect)(()=>()=>{let{sessionId:S,tab:$}=A.current;S!==void 0&&$!==null&&Yn(S,$)},[]);let J=p.state==="ready"?p.snapshot.checkedAt:0,M=async S=>{if(!Me(t))return{ok:!1,error:n("error.noCwd")};let $=await u.run({sessionId:t,action:S});return $.ok?(lt(t).accept($.snapshot),{ok:!0}):(lt(t).resync(),{ok:!1,error:gt($.error.code,$.error.message,n)})},v=S=>{a(S),typeof localStorage<"u"&&localStorage.setItem(ta,String(S))},L=[{key:"overview",label:n("tab.overview"),icon:(0,E.createElement)(Nt,{size:14})},{key:"changes",label:n("tab.changes"),icon:(0,E.createElement)(rr,{size:14})},{key:"files",label:n("tab.files"),icon:(0,E.createElement)(dr,{size:14})}],P=w?L.filter(S=>S.key==="files"):L,W=(()=>{if(!Me(t))return(0,E.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(p.state==="no-cwd")return(0,E.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(w){let $=N?(0,E.createElement)(Mn,{key:t,remote:u,sessionId:t,compact:c,t:n}):null;return b?(0,E.createElement)("div",{className:"gp-files-wrap"},[(0,E.createElement)("div",{key:"notice",className:"gp-notice"},n("files.gitNotInstalled")),$]):(0,E.createElement)("div",{style:{display:"contents"}},$)}if(p.state==="error")return(0,E.createElement)("div",{className:"gp-empty"},n("pill.unavailable"));if(p.state==="cold"||p.state==="loading"||k===null)return(0,E.createElement)("div",{className:"gp-empty"},n("common.loading"));let S=p.snapshot;return(0,E.createElement)("div",{style:{display:"contents"}},[_.current.tabs.has("overview")?(0,E.createElement)("div",{key:"overview",style:k==="overview"?{display:"contents"}:{display:"none"}},(0,E.createElement)(Vr,{key:t,remote:u,sessionId:t,refreshKey:J,defaultDiffView:S.defaultDiffView,snapshot:S,onAction:M,onResync:()=>lt(t).resync(),compact:c,t:n})):null,_.current.tabs.has("changes")?(0,E.createElement)("div",{key:"changes",style:k==="changes"?{display:"contents"}:{display:"none"}},(0,E.createElement)(Ur,{key:t,remote:u,sessionId:t,snapshot:S,onAction:M,compact:c,t:n})):null,N?(0,E.createElement)("div",{key:"files",style:k==="files"?{display:"contents"}:{display:"none"}},(0,E.createElement)(Mn,{key:t,remote:u,sessionId:t,compact:c,t:n})):null])})();return(0,E.createElement)("div",{className:"gp-panel",ref:o,"data-conversation-composer-overlay":"","data-font-delta":r,"data-layout":c?"compact":"wide"},[(0,E.createElement)("div",{key:"tabs",className:"gp-tabbar",role:"tablist"},[...P.map(S=>(0,E.createElement)("button",{key:S.key,type:"button",role:"tab","aria-selected":k===S.key,className:`gp-tab${k===S.key?" gp-tab--active":""}`,onClick:()=>{Me(t)&&l({sessionId:t,tab:S.key})}},[(0,E.createElement)("span",{key:"i",className:"gp-tab__icon"},S.icon),(0,E.createElement)("span",{key:"l",className:"gp-tab__label"},S.label)])),(0,E.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[(0,E.createElement)("div",{key:"font",className:"gp-font"},[(0,E.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease",onClick:()=>v(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,E.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset",onClick:()=>v(0),"aria-label":n("panel.fontReset")},"A"),(0,E.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase",onClick:()=>v(1),"aria-label":n("panel.fontIncrease")},"A+")]),(0,E.createElement)(Ri,{key:"ver",remote:u,t:n})])]),(0,E.createElement)("div",{key:"body",className:"gp-body"},W)])}function Ri({remote:e,t}){let[n,r]=(0,E.useState)({kind:"idle"}),{tipProps:a,tipNode:i}=Kt({placement:"below",maxWidth:300});(0,E.useEffect)(()=>{let c=!0;return e.version({}).then(p=>{c&&"current"in p&&r(u=>({...u,info:p}))}),()=>{c=!1}},[e]);let l=async()=>{r(p=>({kind:"checking",info:p.info}));let c=await e.version({check:!0});r({kind:"idle",info:"current"in c?c:void 0})},s=n.info,o=n.kind==="checking"?(0,E.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):s===void 0||!s.checkedRemote?null:s.error!==void 0?(0,E.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,E.createElement)("span",{},[(0,E.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,E.createElement)("a",{key:"l",className:"gp-verbar__link",href:s.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,E.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:s.current}));return(0,E.createElement)("div",{className:"gp-verbar"},[s!==void 0?(0,E.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${s.current}`):null,o,(0,E.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void l()},[(0,E.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,E.createElement)(Et,{size:12})),t("version.check")]),s?.repositoryUrl!==void 0?(0,E.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"),...a(t("version.openRepo"))},(0,E.createElement)(gr,{size:15})):null,i])}var oe=require("react"),oa=require("react-dom");var ra="data-gp-tab-dot",tt,Pn=null,aa="",Zt=null,Yt;function Gi(e){if(typeof document>"u")return null;let t=document.querySelectorAll(pt);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function Dn(){let e=Gi(aa);if(e===null)return;let t=e.querySelector(`[${ra}]`);if(Zt===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${Zt}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(ra,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function Mi(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(Wn);if(e!==Pn){if(tt?.disconnect(),Pn=e,e===null){tt=void 0;return}tt=new MutationObserver(()=>Dn()),tt.observe(e,{childList:!0,subtree:!0})}}function Pi(){tt?.disconnect(),tt=void 0,Pn=null}function ia(e,t,n){if(!(typeof document>"u")){if(n===null){An(e);return}Yt=e,aa=t,Zt=n,Mi(),Dn()}}function An(e){Yt!==void 0&&Yt!==e||(Yt=void 0,Zt=null,Dn(),Pi())}function Di(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function Ai(){let[e,t]=(0,oe.useState)(!1),[n,r]=(0,oe.useState)(null),a=(0,oe.useRef)(null);return(0,oe.useLayoutEffect)(()=>{if(!e||a.current===null){r(null);return}let s=a.current.getBoundingClientRect();r({left:s.left,bottom:window.innerHeight-s.top+8})},[e]),{bind:{ref:s=>{a.current=s},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:s=>!e||n===null||typeof document>"u"?null:(0,oa.createPortal)((0,oe.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},s.map((o,c)=>(0,oe.createElement)("div",{key:c,className:c===0?"gp-tip__path":"gp-tip__note"},o))),document.body)}}function Li(e){let[t,n]=(0,oe.useState)(!1);return(0,oe.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=e.closest("[data-conversation-region]")??document.body,i=()=>n(a.clientWidth>0&&a.clientWidth<Hi);i();let l=new ResizeObserver(i);return l.observe(a),()=>l.disconnect()},[e]),t}var Hi=620;function sa({sessionId:e,t}){let n=Tt(e),r=Ai(),[a,i]=(0,oe.useState)(null),l=Li(a),s=(0,oe.useRef)(Symbol("gp-tab-dot")),o=n.state==="ready"&&n.snapshot.showInputPill===!1?n.snapshot.dirty?"dirty":"synced":null,c=t("panel.tab");if((0,oe.useEffect)(()=>{ia(s.current,c,o);let _=s.current;return()=>{An(_)}},[c,o]),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,oe.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 u=Di(p.root),f=p.branch??`(${t("pill.detached")})`,w=p.dirty,b=w?"gp-pill--dirty":"gp-pill--synced",k=()=>{if(tr(c)){nr(c);return}Me(e)&&jn(e,w?"changes":"overview"),er(c)};return(0,oe.createElement)("span",{className:"gp-pill-wrap",ref:i},[(0,oe.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${b}${l?" gp-pill--compact":""}`,onClick:k,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,oe.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,oe.createElement)("span",{key:"repo",className:"gp-pill__repo"},u),(0,oe.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,oe.createElement)("span",{key:"b",className:"gp-pill__branch"},f),")"])]),r.render([p.root,t(w?"pill.dirty":"pill.synced")])])}var O=require("react");function Fi(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 la({ctx:e,t}){let[,n]=(0,O.useState)(0),[r,a]=(0,O.useState)(!1),[i,l]=(0,O.useState)(!1),[s,o]=(0,O.useState)(null),[c,p]=(0,O.useState)(null),[u,f]=(0,O.useState)(null),[w,b]=(0,O.useState)(null),k=()=>{n(T=>T+1)},_=e.get("configForms"),N=(0,O.useMemo)(()=>_?.describe(),[_]);(0,O.useEffect)(()=>{if(N!==void 0)return N.ensure(),N.subscribe(k)},[N]);let A=N?.getSnapshot().view,J=(0,O.useMemo)(()=>A===void 0?void 0:Fi(A.namespaces),[A]),M=(0,O.useMemo)(()=>_!==void 0&&J!==void 0?_.get(J):void 0,[_,J]);(0,O.useEffect)(()=>{if(M!==void 0)return M.subscribe(k)},[M]);let v=M?.getSnapshot(),L=M!==void 0&&v!==void 0&&v.status==="ready",P=N?.getSnapshot().status,W=s??(typeof v?.value?.showInputPill=="boolean"?v.value.showInputPill:!0),S=c??(v?.value?.defaultDiffView==="split"?"split":"unified"),$=u??(v?.value?.graphStyle==="compact"?"compact":"parallel"),se=w??(typeof v?.value?.suggestEnabled=="boolean"?v.value.suggestEnabled:!0),ee=async(T,pe,H)=>{if(M!==void 0){l(!1),a(!0);try{let C=await M.set(T,pe);H(),C?(dt(),setTimeout(()=>dt(),1e3)):l(!0)}catch{H(),l(!0)}finally{a(!1)}}},ce=T=>(o(T),ee("showInputPill",T,()=>o(null))),ne=T=>T===S?Promise.resolve():(p(T),ee("defaultDiffView",T,()=>p(null))),z=T=>T===$?Promise.resolve():(f(T),ee("graphStyle",T,()=>f(null))),te=T=>(b(T),ee("suggestEnabled",T,()=>b(null)));return _===void 0?(0,O.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):L?(0,O.createElement)("div",{className:"gp-cfg"},[(0,O.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,O.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,O.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:W,disabled:r||v?.writable===!1,onChange:T=>{ce(T.currentTarget.checked)}}),(0,O.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,O.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,O.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,O.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},$e(["unified","split"],S,T=>{ne(T)},T=>t(T==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||v?.writable===!1)),(0,O.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,O.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,O.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},$e(["parallel","compact"],$,T=>{z(T)},T=>t(T==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||v?.writable===!1)),(0,O.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,O.createElement)("h3",{key:"sgtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.suggestTitle")),(0,O.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,O.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:se,disabled:r||v?.writable===!1,onChange:T=>{te(T.currentTarget.checked)}}),(0,O.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,O.createElement)("p",{key:"sghint",className:"gp-cfg__hint"},t("cfg.suggestHint")),i?(0,O.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):P==="idle"||P==="loading"?(0,O.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,O.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var ft="gitPanel",zi=["dsh-git-panel","@xbzbing/dsh-git-panel"],$i=["slots","locale","connection"],Ii="dsh-git-panel";function Bi(e){Bn(),On(e),e.effect(()=>e.locale.register(ft,{zh:Xn,en:Jn})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(ft),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:ft,label:()=>t("panel.tab")},a=>(0,en.createElement)(na,{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:ft},a=>(0,en.createElement)(sa,{sessionId:a.sessionId,t}))));for(let a of zi)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:a,locale:ft},i=>i.view==="summary"?t("cfg.title"):(0,en.createElement)(la,{ctx:e,t}))));e.effect(()=>{let a=e.on("connection/reset",()=>dt());return()=>{typeof a=="function"&&a();for(let i of n.splice(0))try{i()}catch{}qn()}},"dsh-git-panel: lifecycle")}module.exports={name:Ii,inject:$i,apply:Bi};
629
+ ${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:oe,confirmBusy:de,onConfirm:()=>void za(),onClose:()=>N(null),t:l}):null,Z!==null?oa(Z,{from:r.head??Z.shortHash,dirty:r.dirty,lostFiles:Un,lostTotal:Un.length,lostTruncated:r.truncated,busy:de,error:oe,onReset:Ha,onClose:()=>ie(null),t:l}):null,x?$e({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:r.branch??"HEAD",behind:r.behind}),extra:ua(Fe,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:oe,confirmBusy:Y,busyLabel:l("status.pulling"),onConfirm:()=>void Ia(),onClose:()=>P(!1),t:l}):null,X?$e({title:l("status.pushConfirmTitle"),body:l("status.pushConfirmBody",{branch:r.branch??"HEAD",ahead:r.ahead}),extra:ga(De,l),confirmLabel:l("status.pushConfirm"),danger:!1,error:oe,confirmBusy:z,busyLabel:l("status.pushing"),onConfirm:()=>void Oa(),onClose:()=>te(!1),t:l}):null,G?$e({title:l("status.publishConfirmTitle"),body:l("status.publishConfirmBody",{branch:r.branch??"HEAD",remote:r.remote?.name??"origin"}),confirmLabel:l("status.publishConfirm"),danger:!1,error:oe,confirmBusy:ee,busyLabel:l("status.publishing"),onConfirm:()=>void $a(),onClose:()=>ve(!1),t:l}):null,Te!==null?sa(Te,{from:r.branch,dirty:r.dirty?Math.max(1,r.stats.fileCount):0,busy:pt,error:oe,onConfirm:y=>void Fa(y),onClose:()=>Ve(null),t:l}):null],Qn=(0,c.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,c.createElement)("div",{key:"tb",className:"gp-toolbar",ref:k},[s?(0,c.createElement)("button",{key:"filter",type:"button",className:`gp-btn${d.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>Ne(!0)},[(0,c.createElement)(hr,{key:"ic",size:13}),d.ref??l("overview.filterBranch")]):null,(0,c.createElement)("input",{key:"search",className:"gp-search",placeholder:l(_||s?"overview.searchShort":"overview.search"),value:u,onChange:y=>g(y.target.value)}),(0,c.createElement)("select",{key:"author",className:"gp-select",value:d.author,onChange:y=>p(K=>({...K,author:y.target.value}))},[(0,c.createElement)("option",{key:"",value:""},l("overview.allUsers")),...qe.map(y=>(0,c.createElement)("option",{key:y,value:y},y))]),(0,c.createElement)("select",{key:"since",className:"gp-select",value:d.since,onChange:y=>p(K=>({...K,since:y.target.value}))},[(0,c.createElement)("option",{key:"",value:""},l("overview.allTime")),(0,c.createElement)("option",{key:"today",value:"1 day ago"},l("overview.today")),(0,c.createElement)("option",{key:"7d",value:"7 days ago"},l("overview.last7d")),(0,c.createElement)("option",{key:"30d",value:"30 days ago"},l("overview.last30d"))]),(0,c.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),onClick:()=>{e.run({sessionId:t,action:{kind:"fetch"}}).then(()=>Ee())}},(0,c.createElement)(Kt,{size:14}))]),(0,c.createElement)("div",{key:"list",className:"gp-history__list",ref:Qe,onScroll:Q},ze.length===0?(0,c.createElement)("div",{className:"gp-empty"},l(Et?"common.loading":Ue?"overview.loadFailed":"overview.noResults")):Oe.map(y=>Ki(y,{selected:M?.hash===y.commit.hash,gridTpl:at,graphW:rt,laneCount:ft,searching:ke,now:h,compact:s,rowH:Ye,onSelect:()=>B(y.commit),onHoverEnter:ne.onHoverEnter,onHoverLeave:ne.onHoverLeave,t:l})))]),Yn=M===null?[(0,c.createElement)("div",{key:"empty",className:"gp-empty"},[(0,c.createElement)(Xt,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,c.createElement)("div",{key:"files",className:"gp-detail__files"},ne.detail===null?(0,c.createElement)("div",{className:"gp-empty"},ne.detailError?l("overview.detailFailed"):l("common.loading")):[ne.detail.stats.length>0?(0,c.createElement)("div",{key:"sum",className:"gp-detail__summary"},[(0,c.createElement)("span",{key:"f"},l("overview.changeSummary",{files:ne.detail.stats.length})),(0,c.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,c.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ne.detail.insertions}`),(0,c.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ne.detail.deletions}`)]):null,Vi(D,{activePath:ne.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:y=>{M!==null&&ne.openFileDiff(y,M.hash,M.shortHash)},collapsed:Je,onToggleDir:Pa,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,c.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,c.createElement)("div",{key:"subj",className:"gp-detail__subject"},M.subject),(0,c.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},M.shortHash),(0,c.createElement)("span",{key:"a"},M.author),(0,c.createElement)("span",{key:"t"},Nn(M.dateIso))]),(0,c.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let y=M.refs.filter(K=>K.kind==="tag");return[y.length>0?(0,c.createElement)("div",{key:"tags",className:"gp-detail__tags"},y.map(K=>(0,c.createElement)("span",{key:`tag-${K.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:K.name},[(0,c.createElement)(ht,{key:"i",size:11}),(0,c.createElement)("span",{key:"n",className:"gp-detail__tagname"},K.name),(0,c.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:K.name}),onClick:()=>{W(null),V(K.name)}},(0,c.createElement)(tt,{size:11}))]))):null,(0,c.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,c.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{W(null),N({hash:M.hash,shortHash:M.shortHash,subject:M.subject})}},[(0,c.createElement)(wr,{key:"i",size:12}),l("overview.revert")]),(0,c.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{W(null),o(),ie({hash:M.hash,shortHash:M.shortHash,subject:M.subject})}},[(0,c.createElement)(Jt,{key:"i",size:12}),l("overview.reset")]),(0,c.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{W(null),J({hash:M.hash,shortHash:M.shortHash})}},[(0,c.createElement)(ht,{key:"i",size:12}),l("overview.createTag")])])]})()),ne.detail!==null&&ne.detail.body!==""?(0,c.createElement)("pre",{key:"body",className:"gp-detail__body"},ne.detail.body):(0,c.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return s?(0,c.createElement)("div",{className:"gp-overview gp-overview--compact"},[qn,...jn,Ae==="detail"?(0,c.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,c.createElement)("div",{key:"back",className:"gp-subhead"},[(0,c.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>Be("list")},[(0,c.createElement)(yt,{key:"i",size:14}),l("overview.backToList")]),M!==null?(0,c.createElement)("span",{key:"h",className:"gp-subhead__title gp-commit-hash"},M.shortHash):null]),...Yn]):Qn,Ln(r,Wn),Ke?Xi(_e,Ie,d.ref,S,{onFilter:y=>{Vn(y),Ne(!1)},switchOptions:we,onSwitch:y=>{Ne(!1),ut(y)},onToggle:y=>R(K=>{let le=new Set(K);return le.has(y)?le.delete(y):le.add(y),le}),onRetry:Ee,onClose:()=>Ne(!1),t:l}):null]):(0,c.createElement)("div",{className:"gp-overview"},[qn,...jn,(0,c.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${Kn.width}px`}},[(0,c.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},ha(_e,Ie,d.ref,S,{onFilter:y=>Vn(y),switchOptions:we,onSwitch:ut,onToggle:y=>R(K=>{let le=new Set(K);return le.has(y)?le.delete(y):le.add(y),le}),onRetry:Ee,t:l})),Ln(r,Wn)]),Kn.divider,Qn,Jn.divider,(0,c.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${Jn.width}px`}},Yn),$i(ne.hover,ne.hoverBody,l)])}function $i(e,t,n){if(e===null||typeof document>"u")return null;let a=460,r=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-a-12),i=e.y+14,o=(0,c.createElement)("div",{className:"gp-hovercard",style:{left:r,top:i,maxWidth:a}},[(0,c.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,c.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,c.createElement)("span",{key:"a"},e.commit.author),(0,c.createElement)("span",{key:"t"},Nn(e.commit.dateIso))]),t===null?(0,c.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,c.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,c.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,cn.createPortal)(o,document.body,"commit-hovercard")}function ha(e,t,n,a,r){if(t)return(0,c.createElement)("div",{className:"gp-empty"},[(0,c.createElement)("span",{key:"m"},r.t("overview.branchesError")),(0,c.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:r.onRetry},r.t("common.retry"))]);if(e===null)return(0,c.createElement)("div",{className:"gp-empty"},r.t("common.loading"));let i=(o,s,l,d,p="")=>(0,c.createElement)("div",{key:o,className:"gp-branch-group"},[(0,c.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>r.onToggle(o)},[(0,c.createElement)(et,{key:"c",size:11,open:!a.has(o)}),`${r.t(s)} (${l.length})`]),a.has(o)?null:l.map(u=>{let g=p+u.name,w=e.current===u.name,k=`gp-branch-row${n===g?" gp-branch-row--active":""}${w?" gp-branch-row--current":""}`,_=r.switchOptions.get(`${o}:${u.name}`);return(0,c.createElement)("div",{key:u.name,className:k,title:u.name,onClick:()=>r.onFilter(n===g?null:g)},[(0,c.createElement)("span",{key:"i",style:{display:"inline-flex",width:14}},d),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},u.name),u.ahead||u.behind?(0,c.createElement)("span",{key:"t",className:"gp-branch-row__track"},`${u.ahead?`\u2191${u.ahead}`:""}${u.behind?`\u2193${u.behind}`:""}`):null,_===void 0?null:(0,c.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:r.t(_.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:_.name,ref:_.label}),onClick:S=>{S.stopPropagation(),r.onSwitch(_)}},r.t("switch.action"))])})]);return(0,c.createElement)("div",{},[(0,c.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>r.onFilter(null)},r.t("overview.head")),i("local","overview.local",e.local,(0,c.createElement)(Sn,{size:13})),i("remote","overview.remote",e.remote,(0,c.createElement)(Sn,{size:13})),i("tags","overview.tags",e.tags,(0,c.createElement)(ht,{size:13}))])}function Xi(e,t,n,a,r){if(typeof document>"u")return null;let i=(0,c.createElement)("div",{className:"gp-sheet-backdrop",onClick:o=>{o.target===o.currentTarget&&r.onClose()}},(0,c.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,c.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,c.createElement)("span",{key:"title",className:"gp-sheet__title"},r.t("overview.filterBranch")),(0,c.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:r.t("common.close"),onClick:r.onClose},(0,c.createElement)(tt,{size:15}))]),(0,c.createElement)("div",{key:"body",className:"gp-sheet__body"},ha(e,t,n,a,r))]));return(0,cn.createPortal)(i,document.body,"branch-filter-sheet")}function Ki(e,t){let n=e.commit,a=n.refs.map(i=>(0,c.createElement)("span",{key:i.name,className:`gp-ref-chip${i.head?" gp-ref-chip--head":""}${i.kind==="remote"?" gp-ref-chip--remote":""}${i.kind==="tag"?" gp-ref-chip--tag":""}`},i.name)),r=(0,c.createElement)("div",{key:"g",className:"gp-graph-cell"},t.searching?null:Ji(e,t.laneCount,t.rowH));return t.compact?(0,c.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},[r,(0,c.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,c.createElement)("div",{key:"s",className:"gp-commit-subject"},[...a,n.subject]),(0,c.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,c.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,c.createElement)("span",{key:"d",className:"gp-commit-date"},bt(n.dateIso,t.now,t.t))])])]):(0,c.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:i=>t.onHoverEnter(n,i.clientX,i.clientY),onMouseLeave:t.onHoverLeave},[r,(0,c.createElement)("div",{key:"s",className:"gp-commit-subject"},[...a,n.subject]),(0,c.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,c.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,c.createElement)("div",{key:"d",className:"gp-commit-date",title:Lt(n.dateIso)},bt(n.dateIso,t.now,t.t))])}var dn=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function Ji(e,t,n=fa){let a=Math.max(Tt,t*Tt),r=s=>s*Tt+Tt/2,i=n/2,o=[];for(let s of e.edges){let l=dn[s.color%dn.length],d=s.kind==="out"?i:0,p=s.kind==="into"?i:n,u=(d+p)/2;o.push((0,c.createElement)("path",{key:`e${s.kind}-${s.fromLane}-${s.toLane}-${s.color}`,d:`M ${r(s.fromLane)} ${d} C ${r(s.fromLane)} ${u}, ${r(s.toLane)} ${u}, ${r(s.toLane)} ${p}`,stroke:l,strokeWidth:1.6,fill:"none"}))}return o.push((0,c.createElement)("circle",{key:"node",cx:r(e.lane),cy:i,r:e.merge?4:3.2,fill:dn[e.color%dn.length],stroke:"var(--dsw-alias-bg-layer-1)",strokeWidth:1})),(0,c.createElement)("svg",{className:"gp-graph-svg",width:a,height:n},o)}function Vi(e,t){let n=[],a=(r,i)=>{for(let o of r)if(o.dir){let s=t.collapsed.has(o.path);n.push((0,c.createElement)("div",{key:o.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+i*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,c.createElement)(et,{key:"c",size:11,open:!s}),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)])),s||a(o.children,i+1)}else{let s=String(o.meta??"modified"),l=t.activePath===o.path;n.push((0,c.createElement)("div",{key:o.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+i*14},title:t.openTitle,onClick:()=>t.onOpen(o.path)},[(0,c.createElement)("span",{key:"st",className:`gp-status-badge ${Wt(s)}`},(Vt[s]??s[0]??"M").toUpperCase()),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)]))}};return a(e,0),(0,c.createElement)("div",{},n)}function Wi(e,t){if(e===null||typeof document>"u")return null;let{data:n,error:a,mode:r,onMode:i,expanded:o,onExpand:s,onClose:l,remote:d,sessionId:p,compact:u,t:g}=t,w=u?["unified","before","after"]:["unified","split","before","after"],k=u&&r==="split"?"unified":r,_=n!==null&&n.text!==""?(()=>{let E=sn(n.text);return(0,c.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,c.createElement)("span",{key:"a",className:"gp-stats__add"},`+${E.add}`),(0,c.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${E.del}`)])})():null,S=(0,c.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${o?" gp-seg__btn--active":""}`,disabled:k!=="split"&&k!=="unified",title:g(o?"diff.collapse":"diff.expandAll"),onClick:()=>s(!o)},g(o?"diff.collapse":"diff.expandAll")),R=(0,c.createElement)("div",{key:"seg",className:"gp-seg"},ct(w,k,i,E=>g(`diff.${E}`))),$=(0,c.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:g("common.close"),onClick:l},(0,c.createElement)(tt,{size:15})),q=[(0,c.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,c.createElement)(br,{size:15})),(0,c.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},qi(e.path)),(0,c.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),_,S],A=u?[(0,c.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},q),(0,c.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[R,$])]:[...q,R,$],T=(0,c.createElement)("div",{className:"gp-modal-backdrop",onClick:E=>{E.target===E.currentTarget&&l()}},(0,c.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,c.createElement)("div",{key:"bar",className:"gp-modal__bar"},A),(0,c.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},n===null?(0,c.createElement)("div",{className:"gp-empty"},g(a?"overview.diffFailed":"common.loading")):(0,c.createElement)(on,{key:"diff",text:n.text,mode:k,path:e.path,remote:d,sessionId:p,base:"commit",commit:e.hash,expanded:o,truncated:n.truncated===!0,newLines:n.newLines,t:g}))]));return(0,cn.createPortal)(T,document.body,"file-diff-modal")}function qi(e){let t=e.lastIndexOf("/");return t<0?[(0,c.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,c.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,c.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var m=require("react");var Ge=require("react");function ya({stats:e,t}){let n=Date.now(),a=[(0,Ge.createElement)("span",{key:"files",className:"gp-stats__item"},t("stats.files",{n:e.fileCount})),(0,Ge.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,Ge.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,Ge.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&a.push((0,Ge.createElement)("span",{key:"st",className:"gp-stats__item"},t("stats.staged",{n:e.staged}))),e.modified>0&&a.push((0,Ge.createElement)("span",{key:"mo",className:"gp-stats__item"},t("stats.modified",{n:e.modified}))),e.untracked>0&&a.push((0,Ge.createElement)("span",{key:"un",className:"gp-stats__item"},t("stats.untracked",{n:e.untracked}))),e.partial&&a.push((0,Ge.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial",title:t("stats.partialHint")},t("stats.partial")));let r=[];return e.lastChangeAt!==null&&r.push((0,Ge.createElement)("span",{key:"lc",className:"gp-stats__item",title:Lt(e.lastChangeAt)},t("stats.lastChange",{time:bt(e.lastChangeAt,n,t)}))),e.headCommittedAt!==null&&r.push((0,Ge.createElement)("span",{key:"hc",className:"gp-stats__item",title:Lt(e.headCommittedAt)},t("stats.lastCommit",{time:bt(e.headCommittedAt,n,t)}))),r.length>0&&a.push((0,Ge.createElement)("span",{key:"times",className:"gp-stats__times"},r)),(0,Ge.createElement)("div",{className:"gp-stats"},a)}var zn=28,ba=26,Ui=8,ji=600;function va({remote:e,sessionId:t,snapshot:n,onAction:a,compact:r,t:i}){let[o,s]=(0,m.useState)(new Set),[l,d]=(0,m.useState)(""),[p,u]=(0,m.useState)(!1),[g,w]=(0,m.useState)(!1),[k,_]=(0,m.useState)(null),[S,R]=(0,m.useState)(new Set),[$,q]=(0,m.useState)(null),[A,T]=(0,m.useState)(null),[E,J]=(0,m.useState)(null),[O,V]=(0,m.useState)(()=>n.defaultDiffView),[j,N]=(0,m.useState)(!1),[Z,ie]=(0,m.useState)(!1),[oe,W]=(0,m.useState)(!1),[de,se]=(0,m.useState)(!1),[he,fe]=(0,m.useState)(null),[Y,f]=(0,m.useState)("list"),[x,P]=(0,m.useState)([]),[z,C]=(0,m.useState)(!0),[X,te]=(0,m.useState)(!1),[ee,xe]=(0,m.useState)(null),G=(0,m.useRef)(null),ve=(0,m.useRef)(0),{setEl:Fe,viewport:Ce}=kt(),De=(0,m.useCallback)(async()=>{let h=await e.query({sessionId:t,query:{kind:"stash-list"}}),D=me(h,"stash-list");P(D?.entries??[])},[e,t]);(0,m.useEffect)(()=>{De()},[De,n.checkedAt]);let Le=(0,m.useMemo)(()=>n.changes.filter(h=>h.staged).sort(Hn),[n]),Ae=(0,m.useMemo)(()=>n.changes.filter(h=>!h.staged&&h.status!=="untracked").sort(Hn),[n]),Be=(0,m.useMemo)(()=>n.changes.filter(h=>h.status==="untracked").sort(Hn),[n]),Ve=[{key:"staged",labelKey:"changes.groupStaged",items:Le},{key:"unstaged",labelKey:"changes.groupUnstaged",items:Ae},{key:"untracked",labelKey:"changes.groupUntracked",items:Be}].filter(h=>h.items.length>0),{items:pt,tops:We,totalH:Ke}=(0,m.useMemo)(()=>{let h=[];for(let M of Ve)if(h.push({kind:"head",g:{key:M.key,labelKey:M.labelKey,count:M.items.length}}),!S.has(M.key))for(let re of M.items)h.push({kind:"row",c:re});let D=wt(h.map(M=>M.kind==="head"?ba:zn));return{items:h,tops:D,totalH:D[h.length]}},[Le,Ae,Be,S]),Ne=Ce.height>0?Ce.height:ji,{first:_e,last:Ie}=xt(We,Ce.top,Ne,Ui*zn);(0,m.useEffect)(()=>{s(h=>{if(h.size===0)return h;let D=new Set(n.changes.map(ce=>ce.path+(ce.staged?":s":":w"))),M=new Set,re=!1;for(let ce of h)D.has(ce)?M.add(ce):re=!0;return re?M:h})},[n]),(0,m.useEffect)(()=>{if(!p||Z||l.trim()!=="")return;let h=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(D=>{let M=me(D,"last-commit-message");h&&M!==null&&(d(M.message),ie(!0))}),()=>{h=!1}},[p,Z,l,e,t]);let qe=(0,m.useCallback)(async(h,D,M=!1,re=!1)=>{let ce=++ve.current;T({path:h,base:D}),re||J(null),N(M);let ye=await e.query({sessionId:t,query:{kind:"diff",path:h,base:D,...M?{context:2e3}:{}}});if(ce!==ve.current)return;let Je=me(ye,"diff");J(Je!==null?{text:Je.text,newLines:Je.newLines,truncated:Je.truncated}:{text:"",newLines:0})},[e,t]);(0,m.useEffect)(()=>{if(A===null)return;if(!n.changes.some(D=>D.path===A.path)){T(null),J(null),f("list");return}qe(A.path,A.base,j,!0)},[n]),(0,m.useEffect)(()=>{q(null)},[n]),(0,m.useEffect)(()=>{se(!1)},[n]);let Ee=h=>{s(D=>{let M=new Set(D);return M.has(h)?M.delete(h):M.add(h),M})},we=async h=>{if(g)return!1;w(!0),_(null),fe(null);try{let D=await a(h);return D.ok?!0:(_(D.error??i("error.generic")),!1)}catch(D){return _(D instanceof Error?D.message:i("error.generic")),!1}finally{w(!1)}},ut=async()=>{let h=l.trim();if(h===""&&!p){_(i("error.emptyMessage"));return}let D=o.size>0?[...new Set([...o].map(re=>re.replace(/:[sw]$/,"")))]:void 0;await we({kind:"commit",message:h,...D?{paths:D}:{},...p?{amend:!0}:{}})&&(d(""),s(new Set),u(!1),ie(!1))},ne=async h=>{await we({kind:"stash-push",...h.trim()!==""?{message:h}:{}})&&(te(!1),De())},ze=(h,D)=>{we({kind:"stash-apply",index:h,sha:D}).then(M=>{M&&De()})},Et=(h,D)=>{we({kind:"stash-pop",index:h,sha:D}).then(M=>{M&&De()})},Ue=async(h,D)=>{await we({kind:"stash-drop",index:h,sha:D})&&(xe(null),De())},je=(h,D)=>{switch(h){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 D===void 0?i("error.llmFailed"):`${i("error.llmFailed")}: ${D}`;default:return D??i("error.generic")}},Qe=async()=>{if(oe)return;if(p&&!de&&l.trim()!==""){se(!0),_(null),fe(i("commit.suggestOverwrite"));return}se(!1);let h=o.size>0?[...new Set([...o].map(D=>D.replace(/:[sw]$/,"")))]:void 0;W(!0),_(null),fe(null);try{let D=await e.suggest({sessionId:t,...h&&h.length>0?{paths:h}:{}});D.ok?(d(D.value.message),D.value.truncated===!0&&fe(i("commit.suggestTruncated")),G.current?.focus()):_(je(D.error.code,D.error.message))}catch(D){_(D instanceof Error?D.message:i("error.generic"))}finally{W(!1)}},gt=h=>{R(D=>{let M=new Set(D);return M.has(h)?M.delete(h):M.add(h),M})},ke=E!==null&&E.text!==""?sn(E.text):null,Oe=dt({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),ft=(h,D)=>{qe(h,D),r&&f("diff")},rt=r?["unified","before","after"]:["unified","split","before","after"],Ye=r&&O==="split"?"unified":O,at=[(0,m.createElement)(ya,{key:"stats",stats:n.stats,t:i}),(0,m.createElement)("div",{key:"toolbar",className:"gp-toolbar"},[(0,m.createElement)("button",{key:"sa",type:"button",className:"gp-btn",disabled:g||n.changes.length===0,onClick:()=>void we({kind:"stage-all"})},i("changes.stageAll")),(0,m.createElement)("button",{key:"ua",type:"button",className:"gp-btn",disabled:g||n.staged===0,onClick:()=>void we({kind:"unstage-all"})},i("changes.unstageAll")),(0,m.createElement)("button",{key:"stash",type:"button",className:"gp-btn",disabled:g||n.staged===0&&n.modified===0,title:i("changes.stash"),onClick:()=>{_(null),te(!0)}},[(0,m.createElement)(Cn,{key:"ic",size:13}),i("changes.stash")])]),k!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},k):null,he!==null?(0,m.createElement)("div",{key:"notice",className:"gp-notice"},he):null,(0,m.createElement)("div",{key:"list",className:"gp-changes__list",ref:Fe},n.changes.length===0?(0,m.createElement)("div",{className:"gp-empty"},i("changes.noChanges")):(0,m.createElement)("div",{className:"gp-changes__vlist",style:{height:Ke}},pt.slice(_e,Ie).map((h,D)=>{let M=_e+D;if(h.kind==="head"){let ye=h.g;return(0,m.createElement)("div",{key:`h:${ye.key}`,className:"gp-changes__vrow",style:{top:We[M],height:ba}},(0,m.createElement)("div",{className:"gp-group-head",onClick:()=>gt(ye.key)},[(0,m.createElement)(et,{key:"chev",size:12,open:!S.has(ye.key)}),`${i(ye.labelKey)} (${ye.count})`]))}let re=h.c,ce=re.path+(re.staged?":s":":w");return(0,m.createElement)("div",{key:ce,className:"gp-changes__vrow",style:{top:We[M],height:zn}},Zi(re,{selected:o.has(ce),active:A?.path===re.path&&A.base===(re.staged?"staged":"worktree"),busy:g,armed:$===ce,onToggle:()=>Ee(ce),onOpen:()=>ft(re.path,re.staged?"staged":"worktree"),onStage:()=>void we(re.staged?{kind:"unstage",paths:[re.path]}:{kind:"stage",paths:[re.path]}),onDiscard:()=>{$===ce?(we({kind:"discard",paths:[re.path]}),q(null)):q(ce)},t:i}))}))),x.length>0?(0,m.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,m.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>C(h=>!h)},[(0,m.createElement)(et,{key:"chev",size:12,open:!z}),`${i("stash.section")} (${x.length})`]),z?null:(0,m.createElement)("div",{key:"items"},x.map(h=>Yi(h,{busy:g,onApply:()=>ze(h.index,h.sha),onPop:()=>Et(h.index,h.sha),onDrop:()=>{_(null),xe(h)},t:i})))]):null,(0,m.createElement)("div",{key:"box",className:"gp-commitbox"},[(0,m.createElement)("textarea",{key:"msg",className:"gp-commitbox__msg",placeholder:i("commit.placeholder"),value:l,ref:G,readOnly:oe,"aria-busy":oe,onChange:h=>d(h.target.value)}),(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:p,disabled:oe,onChange:()=>{u(h=>!h),ie(!1)}}),i("commit.amend")]),(0,m.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[n.suggestEnabled!==!1?(0,m.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:g||oe||n.changes.length===0,onClick:()=>void Qe(),title:i("commit.suggest")},[(0,m.createElement)(yr,{key:"ic",size:13}),i(oe?"commit.suggesting":"commit.suggest")]):null,(0,m.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:g||oe||l.trim()==="",onClick:()=>void ut()},i("commit.commit"))])])])],Q=A===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${r?" gp-diff__toolbar--compact":""}`},(()=>{let h=r?(0,m.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>f("list")},[(0,m.createElement)(yt,{key:"i",size:14}),i("changes.backToList")]):null,D=(0,m.createElement)("span",{key:"path",className:"gp-diff__path"},A.path),M=ke?(0,m.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,m.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ke.add}`)," ",(0,m.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ke.del}`)]):null,re=(0,m.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${j?" gp-seg__btn--active":""}`,style:ke||r?{}:{marginLeft:"auto"},disabled:Ye!=="split"&&Ye!=="unified",title:i(j?"diff.collapse":"diff.expandAll"),onClick:()=>void qe(A.path,A.base,!j)},i(j?"diff.collapse":"diff.expandAll")),ce=(0,m.createElement)("div",{key:"seg",className:"gp-seg"},ct(rt,Ye,V,ye=>i(`diff.${ye}`)));return r?[(0,m.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[h,D,M]),(0,m.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[re,ce])]:[h,D,M,re,ce]})()),E===null?(0,m.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,m.createElement)("div",{className:"gp-empty"},i("common.loading"))):(0,m.createElement)(on,{key:"diff",text:E.text,mode:Ye,path:A.path,remote:e,sessionId:t,base:A.base,expanded:j,truncated:E.truncated===!0,newLines:E.newLines,t:i})]),B=[X?(0,m.createElement)(Qi,{key:"push",onClose:()=>te(!1),onStash:ne,error:k,t:i}):null,ee!==null?$e({title:i("stash.dropTitle"),body:i("stash.dropConfirm",{name:ee.message}),confirmLabel:i("stash.drop"),danger:!0,error:k,onConfirm:()=>void Ue(ee.index,ee.sha),onClose:()=>xe(null),t:i}):null];return r?(0,m.createElement)("div",{className:"gp-changes gp-changes--compact"},[...B,Y==="diff"?(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},Q):(0,m.createElement)("div",{key:"left",className:"gp-changes__left"},at)]):(0,m.createElement)("div",{className:"gp-changes"},[...B,(0,m.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${Oe.width}px`}},at),Oe.divider,(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},Q)])}function Qi({onClose:e,onStash:t,error:n,t:a}){let[r,i]=(0,m.useState)("");return Ct({onClose:e,title:a("stash.title"),icon:(0,m.createElement)(Cn,{size:15}),portalKey:"stash-push-modal",t:a,body:[(0,m.createElement)("input",{key:"msg",className:"gp-input",placeholder:a("stash.messagePlaceholder"),value:r,autoFocus:!0,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&t(r)}}),_t(a),n!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:St({onClose:e,onConfirm:()=>void t(r),confirmLabel:a("stash.save"),confirmDisabled:!1,danger:!1,t:a})})}function Yi(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)(vr,{size:14}))])])}function Hn(e,t){return e.path.localeCompare(t.path)}function Zi(e,t){let n=e.path.split("/").pop()??e.path,a=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,m.createElement)("div",{key:e.path+(e.staged?":s":":w"),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:r=>r.stopPropagation(),onChange:t.onToggle}),(0,m.createElement)("span",{key:"st",className:`gp-status-badge ${Wt(e.status)}`},Vt[e.status]??"?"),(0,m.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,a?(0,m.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},a):null]),(0,m.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,m.createElement)("button",{key:"stg",type:"button",className:"gp-icon-btn",title:e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,onClick:r=>{r.stopPropagation(),t.onStage()}},e.staged?"\u2212":"+"),(0,m.createElement)("button",{key:"dis",type:"button",className:"gp-icon-btn",title:t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,onClick:r=>{r.stopPropagation(),t.onDiscard()}},"\u21BA")])])}var b=require("react");var Pe=require("@deepseek-ai/dsh-client-ui-primitives");function ka(e){return/\.(?:md|markdown)$/i.test(e)}function Fn(e){return/\.(?:html?|xhtml)$/i.test(e)}function eo(e){return ka(e)||Fn(e)}var to=256*1024,no=5e3,wa=5e3,pn=20,xa=12,ro=600,ao=6e4,un=new Map;function io(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;un.set(e,{state:{...t,file:n},leftAt:Date.now()})}function oo(e){let t=un.get(e);return t===void 0?null:Date.now()-t.leftAt>ao?(un.delete(e),null):t.state}function Bn({remote:e,sessionId:t,compact:n,worktreeGen:a,t:r}){let i=(0,b.useRef)(void 0);i.current===void 0&&(i.current=oo(t));let o=i.current,[s,l]=(0,b.useState)(()=>o?.dirs??new Map),[d,p]=(0,b.useState)(()=>o?.open??new Set([""])),[u,g]=(0,b.useState)(()=>o?.selected??null),[w,k]=(0,b.useState)(()=>o?.file??{kind:"idle"}),[_,S]=(0,b.useState)(()=>o?.renderMarkdown??!0),[R,$]=(0,b.useState)("idle"),[q,A]=(0,b.useState)("idle"),[T,E]=(0,b.useState)(()=>o?.pane??"tree"),J=(0,b.useMemo)(()=>({code:{copyLabel:r("files.copy"),copiedLabel:r("files.copied")},footnotes:r("files.footnotes")}),[r]),O=(0,b.useRef)(0),V=dt({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),j=(0,b.useCallback)(f=>{l(x=>{let P=x.get(f);if(P!==void 0&&P.status!=="error")return x;let z=new Map(x);return z.set(f,{status:"loading"}),z}),e.query({sessionId:t,query:{kind:"dir-list",path:f}}).then(x=>{let P=me(x,"dir-list");l(z=>{let C=new Map(z);return C.set(f,P===null?{status:"error"}:{status:"ready",entries:P.entries,truncated:P.truncated}),C})}).catch(()=>{l(x=>{let P=new Map(x);return P.set(f,{status:"error"}),P})})},[e,t]);(0,b.useEffect)(()=>{j("")},[j]);let N=(0,b.useRef)(a);(0,b.useEffect)(()=>{N.current!==a&&(N.current=a,un.delete(t),l(new Map),p(new Set([""])),g(null),k({kind:"idle"}),E("tree"),j(""))},[a,t,j]);let Z=(0,b.useCallback)(f=>{p(x=>{let P=new Set(x);return P.has(f)?(P.delete(f),P):(P.add(f),s.get(f)===void 0&&j(f),P)})},[s,j]),ie=(0,b.useCallback)(f=>{g(f),n&&E("preview"),S(!Fn(f)),$("idle"),A("idle");let x=++O.current;k({kind:"loading",path:f}),e.query({sessionId:t,query:{kind:"file-content",path:f}}).then(P=>{if(x!==O.current)return;let z=me(P,"file-content");if(z===null){k({kind:"error",path:f});return}if(z.tooLarge===!0){k({kind:"tooLarge",path:f});return}if(z.variant==="image"&&z.dataUrl!==void 0){k({kind:"image",path:f,dataUrl:z.dataUrl});return}if(z.variant==="text"){k({kind:"text",path:f,content:z.content??"",lines:z.lines??0});return}k({kind:"binary",path:f})}).catch(()=>{x===O.current&&k({kind:"error",path:f})})},[e,t,n]),oe=(0,b.useRef)({dirs:s,open:d,selected:u,file:w,renderMarkdown:_,pane:T});oe.current={dirs:s,open:d,selected:u,file:w,renderMarkdown:_,pane:T},(0,b.useEffect)(()=>()=>{io(t,oe.current)},[t]);let W=(0,b.useRef)(!1);(0,b.useEffect)(()=>{W.current||(W.current=!0,o!==null&&o.selected!==null&&w.kind==="idle"&&ie(o.selected))},[o,w.kind,ie]);let de=(0,b.useMemo)(()=>_a("",0,{dirs:s,open:d,selected:u,toggleDir:Z,selectFile:ie,t:r}),[s,d,u,Z,ie,r]),se=async()=>{if(u===null)return;let f=O.current,x=await(0,Pe.writeClipboard)(u);f===O.current&&$(x?"copied":"error")},he=async()=>{if(w.kind!=="text")return;let f=O.current,x=await(0,Pe.writeClipboard)(w.content);f===O.current&&A(x?"copied":"error")},fe=(0,b.createElement)("div",{key:"left",className:"gp-files__tree",style:n?void 0:{flex:`0 0 ${V.width}px`}},de),Y=(0,b.createElement)("div",{key:"right",className:"gp-files__preview"},[u!==null?(0,b.createElement)("div",{key:"bar",className:"gp-files__bar"},[n?(0,b.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>E("tree")},[(0,b.createElement)(yt,{key:"i",size:14}),r("files.backToTree")]):null,(0,b.createElement)("code",{key:"path",className:"gp-files__path",title:u},u),w.kind==="text"&&eo(w.path)?(0,b.createElement)("div",{key:"mode",className:"gp-files__mode",role:"group","aria-label":r("files.previewMode")},[(0,b.createElement)("button",{key:"source",type:"button",className:`gp-files__mode-btn${_?"":" gp-files__mode-btn--active"}`,"aria-pressed":!_,onClick:()=>S(!1)},r("files.source")),(0,b.createElement)("button",{key:"render",type:"button",className:`gp-files__mode-btn${_?" gp-files__mode-btn--active":""}`,"aria-pressed":_,onClick:()=>S(!0)},r("files.render"))]):null,(0,b.createElement)("button",{key:"copy",type:"button",className:`gp-files__copy-path${R==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{se()}},r(R==="copied"?"files.pathCopied":R==="error"?"files.pathCopyFailed":"files.copyPath")),w.kind==="text"?(0,b.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${q==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{he()}},r(q==="copied"?"files.contentCopied":q==="error"?"files.contentCopyFailed":"files.copyContent")):null]):null,(0,b.createElement)("div",{key:"content",className:"gp-files__preview-content"},so(w,_,J,r))]);return n?(0,b.createElement)("div",{className:"gp-files gp-files--compact"},T==="preview"?Y:fe):(0,b.createElement)("div",{className:"gp-files"},[fe,V.divider,Y])}function so(e,t,n,a){return e.kind==="text"&&t&&ka(e.path)?(0,b.createElement)("div",{className:"gp-files__markdown"},(0,b.createElement)(Pe.MarkdownText,{text:e.content,labels:n,variant:"body"})):e.kind==="text"&&t&&Fn(e.path)?(0,b.createElement)("iframe",{className:"gp-files__html",title:e.path,srcDoc:e.content,sandbox:"allow-scripts",referrerPolicy:"no-referrer"}):lo(e,a)}function _a(e,t,n){let a=n.dirs.get(e);if(a===void 0||a.status==="loading")return t===0?[(0,b.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,b.createElement)("div",{key:`l${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("common.loading"))];if(a.status==="error")return[(0,b.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("files.loadFailed"))];let r=[];for(let i of a.entries){let o=e===""?i.name:`${e}/${i.name}`;if(i.dir){let s=n.open.has(o);r.push((0,b.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-expanded":s,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.toggleDir(o)},[(0,b.createElement)("span",{key:"c",className:"gp-tree-chev"},(0,b.createElement)(et,{size:11,open:s})),(0,b.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,b.createElement)(Pe.FileTypeIcon,{kind:"folder",size:18})),(0,b.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)])),s&&r.push(..._a(o,t+1,n))}else{let s=n.selected===o;r.push((0,b.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry${s?" gp-tree-row--active":""}${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-current":s?"true":void 0,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.selectFile(o)},[(0,b.createElement)("span",{key:"c",className:"gp-tree-chev"}),(0,b.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,b.createElement)(Pe.FileTypeIcon,{path:o,size:18})),(0,b.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)]))}}return a.truncated&&r.push((0,b.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("files.truncated"))),r}function lo(e,t){switch(e.kind){case"idle":return(0,b.createElement)("div",{className:"gp-empty"},t("files.selectFile"));case"loading":return(0,b.createElement)("div",{className:"gp-empty"},t("common.loading"));case"error":return(0,b.createElement)("div",{className:"gp-empty"},t("files.loadFailed"));case"tooLarge":return(0,b.createElement)("div",{className:"gp-empty"},t("files.tooLarge"));case"binary":return(0,b.createElement)("div",{className:"gp-empty"},t("files.binary"));case"image":return(0,b.createElement)(At,{src:e.dataUrl,alt:e.path,t,viewportClass:"gp-files__image"});case"text":return(0,b.createElement)(po,{content:e.content,path:e.path,t})}}function co(e,t){if(t==="")return[];let n=[];for(let a=0;a<e.length;a++)for(let[r,i]of Yt(e[a],t))if(n.push({line:a,start:r,end:i}),n.length>=Ut)return n;return n}function po({content:e,path:t,t:n}){let a=(0,b.useMemo)(()=>{let C=e.split(`
630
+ `);return C.length>0&&C[C.length-1]===""&&C.pop(),C},[e]),r=e.length>to||a.length>no,i=r?void 0:(0,Pe.languageForPath)(t),o=(0,Pe.useCodeHighlighter)(i),s=(0,b.useMemo)(()=>r?void 0:o(a.join(`
631
+ `)),[r,o,a]),[l,d]=(0,b.useState)(!1),[p,u]=(0,b.useState)(""),[g,w]=(0,b.useState)(!1),[k,_]=(0,b.useState)(0),{setEl:S,viewport:R,elRef:$}=kt(),q=(0,b.useRef)(null),A=(0,b.useRef)(null);(0,b.useEffect)(()=>{d(!1),u(""),_(0)},[t]);let T=Qt(p,jt),E=(0,b.useMemo)(()=>a.map(C=>C.toLowerCase()),[a]),J=g?T:T.toLowerCase(),O=g?a:E,V=(0,b.useMemo)(()=>co(O,J),[O,J]);(0,b.useEffect)(()=>{_(0)},[J]);let j=V.length===0?0:Math.min(k,V.length-1),N=(0,b.useMemo)(()=>{let C=new Map;for(let X of V){let te=C.get(X.line)??[];te.push([X.start,X.end]),C.set(X.line,te)}return C},[V]);(0,b.useEffect)(()=>{let C=X=>{if(!((X.ctrlKey||X.metaKey)&&(X.key==="f"||X.key==="F")))return;let te=$.current;te===null||te.offsetParent===null||(X.preventDefault(),d(!0),requestAnimationFrame(()=>q.current?.select()))};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[]);let Z=a.length,ie=(0,b.useMemo)(()=>wt(new Array(Z).fill(pn)),[Z]),oe=R.height>0?R.height:ro,{first:W,last:de}=xt(ie,R.top,oe,xa*pn),se=V.length>0?V[j].line:-1,{first:he,last:fe}=qt({first:W,last:de},se,Z,xa);(0,b.useEffect)(()=>{if(se<0)return;let C=requestAnimationFrame(()=>A.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(C)},[j,V,se]);let Y=(0,b.useCallback)(C=>{_(X=>V.length===0?0:(X+C+V.length)%V.length)},[V.length]),f=V.length>0?V[j]:null,x=l?(0,b.createElement)(en,{inputRef:q,query:p,matches:V.length,active:j,caseSensitive:g,onChange:u,onToggleCase:()=>w(C=>!C),onStep:Y,onClose:()=>d(!1),t:n}):null,P=r||l?(0,b.createElement)("div",{key:"hd",className:"gp-files__header"},[r?(0,b.createElement)("div",{key:"note",className:"gp-files__note"},n("files.highlightOff")):null,x]):null,z=[];for(let C=he;C<fe;C++)z.push((0,b.createElement)("div",{key:C,className:"gp-files__row",style:{top:C*pn}},[(0,b.createElement)("div",{key:"n",className:"gp-diff-no"},C+1),uo(a[C],C,s?.[C],N.get(C),f,A,n)]));return(0,b.createElement)("div",{className:"gp-files__code gp-diff__scroll",ref:S},[P,(0,b.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",style:{height:Z*pn}},z)])}function uo(e,t,n,a,r,i,o){if(e==="")return(0,b.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>wa)return(0,b.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,wa),(0,b.createElement)("span",{key:"trunc",className:"gp-files__trunc"},o("files.lineTruncated"))]);if(a===void 0||a.length===0)return(0,b.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,b.createElement)("span",{key:d,style:l.style},l.text)):e);let s=r!==null&&r.line===t?[r.start,r.end]:null;return(0,b.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},Zt(e,a,n,`c${t}`,s,i))}var gn=require("react"),go=620;function Sa(e){let[t,n]=(0,gn.useState)(!1);return(0,gn.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=()=>n(e.clientWidth>0&&e.clientWidth<=go);a();let r=new ResizeObserver(a);return r.observe(e),()=>r.disconnect()},[e]),t}var Ca="gp.panel.fontDelta";function fo(){if(typeof localStorage>"u")return 0;let e=Number(localStorage.getItem(Ca));return e===-1||e===1?e:0}function Ta({ctx:e,sessionId:t,t:n}){let[a,r]=(0,L.useState)(fo),[i,o]=(0,L.useState)(null),[s,l]=(0,L.useState)(null),d=Sa(s),p=$t(t),u=Mt(e),g=p.state==="error"&&p.error.code==="git-unavailable",w=p.state==="error"&&(p.error.code==="not-a-git-repo"||p.error.code==="git-unavailable"),k=g&&p.state==="error"&&p.error.isGitRepo===!0,_=w?"files":i!==null&&i.sessionId===t?i.tab:null,S=(0,L.useRef)({tabs:new Set});S.current.sessionId!==t&&(S.current={sessionId:t,tabs:new Set}),_!==null&&S.current.tabs.add(_);let R=S.current.tabs.has("files");(0,L.useEffect)(()=>{if(!Ze(t))return;if(w){o(null);return}if(i?.sessionId===t)return;let N=lr(t);if(N!==null){o({sessionId:t,tab:N});return}let Z=pr(t);if(Z!==null){o({sessionId:t,tab:Z});return}p.state==="ready"&&o({sessionId:t,tab:p.snapshot.dirty?"changes":"overview"})},[t,p,w,i?.sessionId]),(0,L.useEffect)(()=>{if(Ze(t))return dr(t,N=>o({sessionId:t,tab:N}))},[t]);let $=(0,L.useRef)({tab:null});$.current={sessionId:t,tab:_},(0,L.useEffect)(()=>()=>{let{sessionId:N,tab:Z}=$.current;N!==void 0&&Z!==null&&cr(N,Z)},[]);let q=p.state==="ready"?p.snapshot.checkedAt:0,[A,T]=(0,L.useState)(0),E=async N=>{if(!Ze(t))return{ok:!1,error:n("error.noCwd")};let Z=await u.run({sessionId:t,action:N});return Z.ok?(Rt(t).accept(Z.snapshot),N.kind==="branch-checkout"&&T(ie=>ie+1),{ok:!0}):(N.kind==="branch-checkout"&&N.stashMessage!==void 0&&T(ie=>ie+1),Rt(t).resync(),{ok:!1,error:zt(Z.error.code,Z.error.message,n)})},J=N=>{r(N),typeof localStorage<"u"&&localStorage.setItem(Ca,String(N))},O=[{key:"overview",label:n("tab.overview"),icon:(0,L.createElement)(Xt,{size:14})},{key:"changes",label:n("tab.changes"),icon:(0,L.createElement)(mr,{size:14})},{key:"files",label:n("tab.files"),icon:(0,L.createElement)(xr,{size:14})}],V=w?O.filter(N=>N.key==="files"):O,j=(()=>{if(!Ze(t))return(0,L.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(p.state==="no-cwd")return(0,L.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(w){let Z=R?(0,L.createElement)(Bn,{key:t,remote:u,sessionId:t,compact:d,worktreeGen:A,t:n}):null;return k?(0,L.createElement)("div",{className:"gp-files-wrap"},[(0,L.createElement)("div",{key:"notice",className:"gp-notice"},n("files.gitNotInstalled")),Z]):(0,L.createElement)("div",{style:{display:"contents"}},Z)}if(p.state==="error")return(0,L.createElement)("div",{className:"gp-empty"},n("pill.unavailable"));if(p.state==="cold"||p.state==="loading"||_===null)return(0,L.createElement)("div",{className:"gp-empty"},n("common.loading"));let N=p.snapshot;return(0,L.createElement)("div",{style:{display:"contents"}},[S.current.tabs.has("overview")?(0,L.createElement)("div",{key:"overview",style:_==="overview"?{display:"contents"}:{display:"none"}},(0,L.createElement)(ma,{key:t,remote:u,sessionId:t,refreshKey:q,defaultDiffView:N.defaultDiffView,snapshot:N,onAction:E,onResync:()=>Rt(t).resync(),compact:d,t:n})):null,S.current.tabs.has("changes")?(0,L.createElement)("div",{key:"changes",style:_==="changes"?{display:"contents"}:{display:"none"}},(0,L.createElement)(va,{key:t,remote:u,sessionId:t,snapshot:N,onAction:E,compact:d,t:n})):null,R?(0,L.createElement)("div",{key:"files",style:_==="files"?{display:"contents"}:{display:"none"}},(0,L.createElement)(Bn,{key:t,remote:u,sessionId:t,compact:d,worktreeGen:A,t:n})):null])})();return(0,L.createElement)("div",{className:"gp-panel",ref:l,"data-conversation-composer-overlay":"","data-font-delta":a,"data-layout":d?"compact":"wide"},[(0,L.createElement)("div",{key:"tabs",className:"gp-tabbar",role:"tablist"},[...V.map(N=>(0,L.createElement)("button",{key:N.key,type:"button",role:"tab","aria-selected":_===N.key,className:`gp-tab${_===N.key?" gp-tab--active":""}`,onClick:()=>{Ze(t)&&o({sessionId:t,tab:N.key})}},[(0,L.createElement)("span",{key:"i",className:"gp-tab__icon"},N.icon),(0,L.createElement)("span",{key:"l",className:"gp-tab__label"},N.label)])),(0,L.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[(0,L.createElement)("div",{key:"font",className:"gp-font"},[(0,L.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease",onClick:()=>J(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,L.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset",onClick:()=>J(0),"aria-label":n("panel.fontReset")},"A"),(0,L.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase",onClick:()=>J(1),"aria-label":n("panel.fontIncrease")},"A+")]),(0,L.createElement)(mo,{key:"ver",remote:u,t:n})])]),(0,L.createElement)("div",{key:"body",className:"gp-body"},j)])}function mo({remote:e,t}){let[n,a]=(0,L.useState)({kind:"idle"}),{tipProps:r,tipNode:i}=ln({placement:"below",maxWidth:300});(0,L.useEffect)(()=>{let d=!0;return e.version({}).then(p=>{d&&"current"in p&&a(u=>({...u,info:p}))}),()=>{d=!1}},[e]);let o=async()=>{a(p=>({kind:"checking",info:p.info}));let d=await e.version({check:!0});a({kind:"idle",info:"current"in d?d:void 0})},s=n.info,l=n.kind==="checking"?(0,L.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):s===void 0||!s.checkedRemote?null:s.error!==void 0?(0,L.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,L.createElement)("span",{},[(0,L.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,L.createElement)("a",{key:"l",className:"gp-verbar__link",href:s.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,L.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:s.current}));return(0,L.createElement)("div",{className:"gp-verbar"},[s!==void 0?(0,L.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${s.current}`):null,l,(0,L.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void o()},[(0,L.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,L.createElement)(Kt,{size:12})),t("version.check")]),s?.repositoryUrl!==void 0?(0,L.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"),...r(t("version.openRepo"))},(0,L.createElement)(Cr,{size:15})):null,i])}var ue=require("react"),Ra=require("react-dom");var Na="data-gp-tab-dot",Nt,In=null,Ea="",mn=null,fn;function ho(e){if(typeof document>"u")return null;let t=document.querySelectorAll(Pt);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function On(){let e=ho(Ea);if(e===null)return;let t=e.querySelector(`[${Na}]`);if(mn===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${mn}`;if(t!==null){t.className!==n&&(t.className=n);return}let a=document.createElement("span");a.className=n,a.setAttribute(Na,""),a.setAttribute("aria-hidden","true"),e.appendChild(a)}function yo(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(or);if(e!==In){if(Nt?.disconnect(),In=e,e===null){Nt=void 0;return}Nt=new MutationObserver(()=>On()),Nt.observe(e,{childList:!0,subtree:!0})}}function bo(){Nt?.disconnect(),Nt=void 0,In=null}function Ma(e,t,n){if(!(typeof document>"u")){if(n===null){$n(e);return}fn=e,Ea=t,mn=n,yo(),On()}}function $n(e){fn!==void 0&&fn!==e||(fn=void 0,mn=null,On(),bo())}function vo(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function wo(){let[e,t]=(0,ue.useState)(!1),[n,a]=(0,ue.useState)(null),r=(0,ue.useRef)(null);return(0,ue.useLayoutEffect)(()=>{if(!e||r.current===null){a(null);return}let s=r.current.getBoundingClientRect();a({left:s.left,bottom:window.innerHeight-s.top+8})},[e]),{bind:{ref:s=>{r.current=s},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:s=>!e||n===null||typeof document>"u"?null:(0,Ra.createPortal)((0,ue.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},s.map((l,d)=>(0,ue.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function xo(e){let[t,n]=(0,ue.useState)(!1);return(0,ue.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=e.closest("[data-conversation-region]")??document.body,i=()=>n(r.clientWidth>0&&r.clientWidth<ko);i();let o=new ResizeObserver(i);return o.observe(r),()=>o.disconnect()},[e]),t}var ko=620;function Ga({sessionId:e,t}){let n=$t(e),a=wo(),[r,i]=(0,ue.useState)(null),o=xo(r),s=(0,ue.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,ue.useEffect)(()=>{Ma(s.current,d,l);let S=s.current;return()=>{$n(S)}},[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,ue.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 u=vo(p.root),g=p.branch??`(${t("pill.detached")})`,w=p.dirty,k=w?"gp-pill--dirty":"gp-pill--synced",_=()=>{if(gr(d)){fr(d);return}Ze(e)&&sr(e,w?"changes":"overview"),ur(d)};return(0,ue.createElement)("span",{className:"gp-pill-wrap",ref:i},[(0,ue.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${k}${o?" gp-pill--compact":""}`,onClick:_,ref:a.bind.ref,onMouseEnter:a.bind.onMouseEnter,onMouseLeave:a.bind.onMouseLeave},[(0,ue.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,ue.createElement)("span",{key:"repo",className:"gp-pill__repo"},u),(0,ue.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,ue.createElement)("span",{key:"b",className:"gp-pill__branch"},g),")"])]),a.render([p.root,t(w?"pill.dirty":"pill.synced")])])}var F=require("react");function _o(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 hn={min:Me.maxBytes.min/1024,max:Me.maxBytes.max/1024},yn={min:Me.timeoutMs.min/1e3,max:Me.timeoutMs.max/1e3};function Xn(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function So(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Da({ctx:e,t}){let[,n]=(0,F.useState)(0),[a,r]=(0,F.useState)(!1),[i,o]=(0,F.useState)(!1),[s,l]=(0,F.useState)(null),[d,p]=(0,F.useState)(null),[u,g]=(0,F.useState)(null),[w,k]=(0,F.useState)(null),[_,S]=(0,F.useState)(null),[R,$]=(0,F.useState)(null),[q,A]=(0,F.useState)(null),T=()=>{n(G=>G+1)},E=e.get("configForms"),J=(0,F.useMemo)(()=>E?.describe(),[E]);(0,F.useEffect)(()=>{if(J!==void 0)return J.ensure(),J.subscribe(T)},[J]);let O=J?.getSnapshot().view,V=(0,F.useMemo)(()=>O===void 0?void 0:_o(O.namespaces),[O]),j=(0,F.useMemo)(()=>E!==void 0&&V!==void 0?E.get(V):void 0,[E,V]);(0,F.useEffect)(()=>{if(j!==void 0)return j.subscribe(T)},[j]);let N=j?.getSnapshot(),Z=j!==void 0&&N!==void 0&&N.status==="ready",ie=J?.getSnapshot().status,oe=s??(typeof N?.value?.showInputPill=="boolean"?N.value.showInputPill:!0),W=d??(N?.value?.defaultDiffView==="split"?"split":"unified"),de=u??(N?.value?.graphStyle==="compact"?"compact":"parallel"),se=w??(typeof N?.value?.suggestEnabled=="boolean"?N.value.suggestEnabled:!0),he=Xn(typeof N?.value?.suggestMaxBytes=="number"?N.value.suggestMaxBytes/1024:Me.maxBytes.default/1024,hn),fe=Xn(typeof N?.value?.suggestMaxOutputTokens=="number"?N.value.suggestMaxOutputTokens:Me.maxOutputTokens.default,Me.maxOutputTokens),Y=Xn(typeof N?.value?.suggestTimeoutMs=="number"?N.value.suggestTimeoutMs/1e3:Me.timeoutMs.default/1e3,yn),f=async(G,ve,Fe)=>{if(j!==void 0){o(!1),r(!0);try{let Ce=await j.set(G,ve);Fe(),Ce?(Gt(),setTimeout(()=>Gt(),1e3)):o(!0)}catch{Fe(),o(!0)}finally{r(!1)}}},x=G=>(l(G),f("showInputPill",G,()=>l(null))),P=G=>G===W?Promise.resolve():(p(G),f("defaultDiffView",G,()=>p(null))),z=G=>G===de?Promise.resolve():(g(G),f("graphStyle",G,()=>g(null))),C=G=>(k(G),f("suggestEnabled",G,()=>k(null))),X=(G,ve,Fe,Ce,De,Le)=>{let Ae=G===null?null:So(G);if(Ae===null)return Le(),Promise.resolve();let Be=Math.min(ve.max,Math.max(ve.min,Math.floor(Ae)));return De(String(Be)),f(Ce,Be*Fe,Le)},te=G=>X(G,hn,1024,"suggestMaxBytes",S,()=>S(null)),ee=G=>X(G,Me.maxOutputTokens,1,"suggestMaxOutputTokens",$,()=>$(null)),xe=G=>X(G,yn,1e3,"suggestTimeoutMs",A,()=>A(null));return E===void 0?(0,F.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):Z?(0,F.createElement)("div",{className:"gp-cfg"},[(0,F.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,F.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,F.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:oe,disabled:a||N?.writable===!1,onChange:G=>{x(G.currentTarget.checked)}}),(0,F.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,F.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,F.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,F.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},ct(["unified","split"],W,G=>{P(G)},G=>t(G==="unified"?"cfg.diffUnified":"cfg.diffSplit"),a||N?.writable===!1)),(0,F.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,F.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,F.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},ct(["parallel","compact"],de,G=>{z(G)},G=>t(G==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),a||N?.writable===!1)),(0,F.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,F.createElement)("div",{key:"suggestcard",className:"gp-cfg__card"},[(0,F.createElement)("h3",{key:"sgtitle",className:"gp-cfg__card-title"},t("cfg.suggestTitle")),(0,F.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,F.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:se,disabled:a||N?.writable===!1,onChange:G=>{C(G.currentTarget.checked)}}),(0,F.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,F.createElement)("div",{key:"numax",className:"gp-cfg__numrow"},[(0,F.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-maxkib"},t("cfg.suggestMaxBytesLabel")),(0,F.createElement)("input",{key:"input",id:"gp-cfg-maxkib",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:hn.min,max:hn.max,"aria-describedby":"gp-cfg-maxkib-hint",value:_??String(he),disabled:a||N?.writable===!1,onChange:G=>{S(G.currentTarget.value)},onBlur:()=>{te(_)},onKeyDown:G=>{G.key==="Enter"&&G.currentTarget.blur()}}),(0,F.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestMaxBytesUnit"))]),(0,F.createElement)("p",{key:"numaxhint",id:"gp-cfg-maxkib-hint",className:"gp-cfg__rangehint"},t("cfg.suggestMaxBytesHint")),(0,F.createElement)("div",{key:"nuout",className:"gp-cfg__numrow"},[(0,F.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-outtok"},t("cfg.suggestOutputLabel")),(0,F.createElement)("input",{key:"input",id:"gp-cfg-outtok",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:Me.maxOutputTokens.min,max:Me.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:R??String(fe),disabled:a||N?.writable===!1,onChange:G=>{$(G.currentTarget.value)},onBlur:()=>{ee(R)},onKeyDown:G=>{G.key==="Enter"&&G.currentTarget.blur()}}),(0,F.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestOutputUnit"))]),(0,F.createElement)("p",{key:"nuouthint",id:"gp-cfg-outtok-hint",className:"gp-cfg__rangehint"},t("cfg.suggestOutputHint")),(0,F.createElement)("div",{key:"nuto",className:"gp-cfg__numrow"},[(0,F.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-timeout"},t("cfg.suggestTimeoutLabel")),(0,F.createElement)("input",{key:"input",id:"gp-cfg-timeout",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:yn.min,max:yn.max,"aria-describedby":"gp-cfg-timeout-hint",value:q??String(Y),disabled:a||N?.writable===!1,onChange:G=>{A(G.currentTarget.value)},onBlur:()=>{xe(q)},onKeyDown:G=>{G.key==="Enter"&&G.currentTarget.blur()}}),(0,F.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestTimeoutUnit"))]),(0,F.createElement)("p",{key:"nutohint",id:"gp-cfg-timeout-hint",className:"gp-cfg__rangehint"},t("cfg.suggestTimeoutHint")),(0,F.createElement)("p",{key:"sghint",className:"gp-cfg__hint"},t("cfg.suggestHint"))]),i?(0,F.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):ie==="idle"||ie==="loading"?(0,F.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,F.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var Ht="gitPanel",Co=["dsh-git-panel","@xbzbing/dsh-git-panel"],To=["slots","locale","connection"],No="dsh-git-panel";function Eo(e){Zn(),ar(e),e.effect(()=>e.locale.register(Ht,{zh:er,en:tr})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(Ht),n=[],a=r=>{typeof r=="function"&&n.push(r)};a(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:Ht,label:()=>t("panel.tab")},r=>(0,bn.createElement)(Ta,{ctx:e,sessionId:r.sessionId,t})))),a(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:Ht},r=>(0,bn.createElement)(Ga,{sessionId:r.sessionId,t}))));for(let r of Co)a(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:r,locale:Ht},i=>i.view==="summary"?t("cfg.title"):(0,bn.createElement)(Da,{ctx:e,t}))));e.effect(()=>{let r=e.on("connection/reset",()=>Gt());return()=>{typeof r=="function"&&r();for(let i of n.splice(0))try{i()}catch{}ir()}},"dsh-git-panel: lifecycle")}module.exports={name:No,inject:To,apply:Eo};
542
632
  return module.exports;
543
633
  } });