@vantran-se/openchamber-web 2.4.0 → 2.4.2

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.
Files changed (80) hide show
  1. package/dist/assets/{AboutDialog-Dh2Z6Rpo.js → AboutDialog-Dz_8z7Rq.js} +1 -1
  2. package/dist/assets/{ArchiveView-31PVMzC2.js → ArchiveView-BoMjLD0N.js} +1 -1
  3. package/dist/assets/{ChangedPathLabel-CbXts83B.js → ChangedPathLabel-BirEUxH2.js} +1 -1
  4. package/dist/assets/{CommandPalette-DzOIUvyX.js → CommandPalette-DkLX-AKB.js} +1 -1
  5. package/dist/assets/{DiffView-C6UN20mH.js → DiffView-DwyXDHsF.js} +1 -1
  6. package/dist/assets/{FilesView-V9SCRZ9-.js → FilesView-BFi9HBg1.js} +1 -1
  7. package/dist/assets/{GitView-RJHLEROE.js → GitView-BzWRNg_F.js} +1 -1
  8. package/dist/assets/{GuestSurfacePane-C9dmI3Di.js → GuestSurfacePane-zDcKyz78.js} +1 -1
  9. package/dist/assets/{HelpDialog-DyGX9_8h.js → HelpDialog-DZVlv3x2.js} +1 -1
  10. package/dist/assets/{InProgressOperationBanner-B3oEOw3O.js → InProgressOperationBanner-BiEntIfh.js} +1 -1
  11. package/dist/assets/{IntegrationsCatalogView-CwBk0nb-.js → IntegrationsCatalogView-CCHFMcZP.js} +1 -1
  12. package/dist/assets/{JsonTreeView-BnV3bUfi.js → JsonTreeView-BwELoub1.js} +1 -1
  13. package/dist/assets/{MarkdownRendererImpl-DwFPVpAe.js → MarkdownRendererImpl-DxBYkSKd.js} +1 -1
  14. package/dist/assets/{MemoryDebugPanel-DwNkGEQI.js → MemoryDebugPanel-C9zpPXVo.js} +1 -1
  15. package/dist/assets/{OnboardingScreen-CLGQ5tGv.js → OnboardingScreen-Cnzzs_TQ.js} +1 -1
  16. package/dist/assets/{OpenCodeStatusDialog-D7ZnJOuR.js → OpenCodeStatusDialog-DizE9xAy.js} +1 -1
  17. package/dist/assets/{PatchDiff-BriSysUP.js → PatchDiff-Cz_UxB-k.js} +1 -1
  18. package/dist/assets/{PierreDiffViewer-ToKfUZsI.js → PierreDiffViewer-BT3MrXwN.js} +1 -1
  19. package/dist/assets/{PlanView-YOnwcP8k.js → PlanView-B-SCCd7M.js} +1 -1
  20. package/dist/assets/{ProjectActionsDialog-C3u320eT.js → ProjectActionsDialog-4OSNuzpG.js} +1 -1
  21. package/dist/assets/{PullRequestComparisonSelector-Cvng5foj.js → PullRequestComparisonSelector-lp98DrYm.js} +1 -1
  22. package/dist/assets/{RunOverview-CX4EWbX4.js → RunOverview-DJhjR9uR.js} +1 -1
  23. package/dist/assets/{ScheduledTasksDialog-Cg0llpjw.js → ScheduledTasksDialog-Dwil7zsx.js} +1 -1
  24. package/dist/assets/{SettingsView-C5MS7v4D.js → SettingsView-DVcV2Rk9.js} +1 -1
  25. package/dist/assets/{SettingsWindow-ZCLlBZBD.js → SettingsWindow-DbbAS4Se.js} +1 -1
  26. package/dist/assets/{SourceBoardView-DeQ_gjii.js → SourceBoardView-BVcmYpvE.js} +1 -1
  27. package/dist/assets/{SpaceAccessDialog-MzV-zdo9.js → SpaceAccessDialog-DxjFUcHZ.js} +1 -1
  28. package/dist/assets/{SpaceApplyDialog-DDxyMT0_.js → SpaceApplyDialog-Dbrbh-j4.js} +1 -1
  29. package/dist/assets/{SpaceRow-sK_fpiHu.js → SpaceRow-Cwam4mHh.js} +1 -1
  30. package/dist/assets/{SpaceSetupOutput-DXkmiL2Y.js → SpaceSetupOutput-B_w02jDi.js} +1 -1
  31. package/dist/assets/{SpacesView-DZNEvbJ7.js → SpacesView-CGrFWnO-.js} +1 -1
  32. package/dist/assets/{SubmoduleDiffSummary-E0GcoYiO.js → SubmoduleDiffSummary-DFL-m_eu.js} +1 -1
  33. package/dist/assets/{ToolOutputDialog-CKl9iGaM.js → ToolOutputDialog-Co0VXa0y.js} +1 -1
  34. package/dist/assets/{ToolPartDiffPreview-CRANc7sQ.js → ToolPartDiffPreview-CBSzwkat.js} +1 -1
  35. package/dist/assets/{UsageStatsView-np-Qgyn0.js → UsageStatsView-BjtTNSt8.js} +1 -1
  36. package/dist/assets/{Virtualizer-CgLU97RO.js → Virtualizer-Cmng0Q1E.js} +1 -1
  37. package/dist/assets/{WalkthroughView-oJlQ42QA.js → WalkthroughView-C7AkVuHQ.js} +1 -1
  38. package/dist/assets/{WorktreesView-XC8e1Gxk.js → WorktreesView-CYU2KJ6E.js} +1 -1
  39. package/dist/assets/{appThemeRegistry-DsBAd3cG.js → appThemeRegistry-CDGE1wtP.js} +1 -1
  40. package/dist/assets/{computeVirtualFileMetrics-tFBUWYu1.js → computeVirtualFileMetrics-BgqasG86.js} +1 -1
  41. package/dist/assets/{decorate-N1FIdwTF.js → decorate-CpxLqoVw.js} +1 -1
  42. package/dist/assets/{flexokiTheme-qbTuJgIP.js → flexokiTheme-BG4cSAMb.js} +1 -1
  43. package/dist/assets/{index-DppcIt7q.js → index-BrL960j-.js} +1 -1
  44. package/dist/assets/{initializeSharedPreferences-Cfgz92Al.js → initializeSharedPreferences-CrnmmfFs.js} +1 -1
  45. package/dist/assets/{install-iZ64WEBd.js → install-DvRQsTjX.js} +1 -1
  46. package/dist/assets/{isDiffPlainText-DxiX2X7Q.js → isDiffPlainText-KGYbp86N.js} +1 -1
  47. package/dist/assets/{isFilePlainText-y0Pch-hF.js → isFilePlainText-D7rclQrA.js} +1 -1
  48. package/dist/assets/{main-BggWUmia.js → main-Cmc8m6dZ.js} +4 -4
  49. package/dist/assets/{main-CcAbEyCv.js → main-D4-y6PQ0.js} +2 -2
  50. package/dist/assets/{markdownCore-P3Pd8JpY.js → markdownCore-D_5e0Wl7.js} +1 -1
  51. package/dist/assets/{miniChat-iJHNCDmk.js → miniChat-CjJ77DDL.js} +2 -2
  52. package/dist/assets/{mobile-C1tleU1e.js → mobile-DlFdLxjR.js} +2 -2
  53. package/dist/assets/{moveWorkspacePath-CUn1SV66.js → moveWorkspacePath-CVdEBQ6v.js} +1 -1
  54. package/dist/assets/{parseDiffFromFile-Phw3Q2Mh.js → parseDiffFromFile-DWemyyqU.js} +1 -1
  55. package/dist/assets/{pierreDiffTint-J7FoDbyq.js → pierreDiffTint-B7qPTZmL.js} +1 -1
  56. package/dist/assets/{relocateRestoredSession-Ch0D1a0g.js → relocateRestoredSession-cOuWlgWB.js} +1 -1
  57. package/dist/assets/{renderElectronMiniChatApp-QPvTS_hc.js → renderElectronMiniChatApp-DFnEi5Tr.js} +2 -2
  58. package/dist/assets/{renderMobileApp-Ci_S1TJm.js → renderMobileApp-C2TYqVOV.js} +3 -3
  59. package/dist/assets/{restartOpenCode-BE2HLPm1.js → restartOpenCode-Dvk4CWW7.js} +1 -1
  60. package/dist/assets/{runtimeEndpointReset-DcZoNIpr.js → runtimeEndpointReset-D7viEboD.js} +3 -3
  61. package/dist/assets/{selectionMarkdown-Dw3ME6dV.js → selectionMarkdown-CCursbAw.js} +1 -1
  62. package/dist/assets/{shikiHighlight-3Hs_1ia3.js → shikiHighlight-CLj7Oan9.js} +1 -1
  63. package/dist/assets/{space-apply-CvoK3fqX.js → space-apply-DdhqZWNy.js} +1 -1
  64. package/dist/assets/{space-close-B_kflt9L.js → space-close-KXdazynX.js} +1 -1
  65. package/dist/assets/{spaceNetwork-ClSGQtiE.js → spaceNetwork-DzU3SK9K.js} +1 -1
  66. package/dist/assets/{textMateThemeFromAppTheme-kAREvDjp.js → textMateThemeFromAppTheme-C-jxkZJj.js} +1 -1
  67. package/dist/assets/{useAppFontEffects-BZrjCfFw.js → useAppFontEffects-DAUhSLPu.js} +13 -13
  68. package/dist/assets/{useCallableModelProviders-CpxZpJTR.js → useCallableModelProviders-B-UCRuyn.js} +1 -1
  69. package/dist/assets/{useDiffFindSurface-D6svD0Z1.js → useDiffFindSurface-CU_63uoI.js} +1 -1
  70. package/dist/assets/{useInlineCommentController-CV8dwlO7.js → useInlineCommentController-bYCeqE6r.js} +1 -1
  71. package/dist/assets/{useMarkdownLocalAssets-D0S_fJEu.js → useMarkdownLocalAssets-CnMxnDdI.js} +1 -1
  72. package/dist/assets/{useRootScrollLock-5OfQ_8IH.js → useRootScrollLock-DNYaZ34X.js} +2 -2
  73. package/dist/assets/{useWalkthroughReview-CxCd3Z0I.js → useWalkthroughReview-DGPyQ634.js} +1 -1
  74. package/dist/assets/{vendor-codemirror-language-data-DsRKCbVv.js → vendor-codemirror-language-data-KulAIuMz.js} +2 -2
  75. package/dist/index.html +1 -1
  76. package/dist/mini-chat.html +1 -1
  77. package/dist/mobile.html +1 -1
  78. package/package.json +1 -1
  79. package/server/index.js +6 -3
  80. package/server/lib/guests/service-registry.js +3 -0
@@ -1,2 +1,2 @@
1
- import{R as w,f as pe,j as t}from"./vendor-react-BUCujlKS.js";import{u as Nt}from"./vendor-tanstack-react-virtual-Bmi0tTrf.js";import{u as de,V as Qe,W as Ze,I as $,X as et,dp as Ct,N as ae,en as St,B as X,cQ as Vt,fa as kt,t as De,q as Ee,D as Te,l as ze,F as Re,o as Ye,aF as At,G as tt,fb as it,fc as It,aL as st,A as ge,C as Dt,b7 as dt,b8 as mt,fd as ut,b9 as ft,fe as ht,ff as Et,fg as pt,fh as $e,fi as Tt,fj as gt,fk as zt,fl as Rt,fm as xt,fn as yt,cH as Be,cc as nt,ca as at,c9 as lt,cb as ot,c3 as rt,fo as Ot,fp as Pt,fq as Pe,fr as Ft}from"./useAppFontEffects-BZrjCfFw.js";import{u as Me,a_ as bt,a$ as Lt,a5 as He}from"./katex.min-u4DtE8E5.js";import{L as $t,R as Ae,U as vt,V as wt,X as Mt,h as Ht,f as Gt,g as _t,Y as Bt,Z as Kt,_ as Ut}from"./runtimeEndpointReset-DcZoNIpr.js";import{a as qt,b as Wt,c as Xt,f as Jt,T as Ke}from"./PierreDiffViewer-ToKfUZsI.js";import{C as Yt}from"./ChangedPathLabel-CbXts83B.js";const Qt=w.memo(function(e){const i=pe.c(66),{file:a,actionLabel:h,actionSymbol:u,onAction:m,onViewDiff:d,onRevert:c,isReverting:p,stats:k,rowPaddingClassName:v,indentPx:r,actionAtStart:A,nameOnly:V,showRevert:T}=e,N=r===void 0?0:r,b=A===void 0?!1:A,l=V===void 0?!1:V,g=T===void 0?!0:T;let F;i[0]!==a?(F=$t(a),i[0]=a,i[1]=F):F=i[1];const D=F,{t:M}=de();let B;i[2]!==D.descriptionKey||i[3]!==M?(B=M(D.descriptionKey),i[2]=D.descriptionKey,i[3]=M,i[4]=B):B=i[4];const z=B,O=k?.insertions??0,C=k?.deletions??0;let y;i[5]!==m||i[6]!==d?(y=te=>{te.key===" "?(te.preventDefault(),m()):te.key==="Enter"&&(te.preventDefault(),d())},i[5]=m,i[6]=d,i[7]=y):y=i[7];const P=y;let j;i[8]!==m?(j=te=>{te.preventDefault(),te.stopPropagation(),m()},i[8]=m,i[9]=j):j=i[9];const E=j;let H;i[10]!==c?(H=te=>{te.preventDefault(),te.stopPropagation(),c()},i[10]=c,i[11]=H):H=i[11];const G=H;let q;i[12]!==h||i[13]!==u||i[14]!==E?(q=t.jsx("button",{type:"button",onClick:E,className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":h,title:h,children:u}),i[12]=h,i[13]=u,i[14]=E,i[15]=q):q=i[15];const W=q;let _;i[16]===Symbol.for("react.memo_cache_sentinel")?(_={color:"var(--status-success)"},i[16]=_):_=i[16];let S;i[17]!==O?(S=t.jsxs("span",{style:_,children:["+",O]}),i[17]=O,i[18]=S):S=i[18];let K,R;i[19]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx("span",{className:"text-muted-foreground mx-0.5",children:"/"}),R={color:"var(--status-error)"},i[19]=K,i[20]=R):(K=i[19],R=i[20]);let U;i[21]!==C?(U=t.jsxs("span",{style:R,children:["-",C]}),i[21]=C,i[22]=U):U=i[22];let J;i[23]!==S||i[24]!==U?(J=t.jsxs("span",{className:"shrink-0 typography-micro",children:[S,K,U]}),i[23]=S,i[24]=U,i[25]=J):J=i[25];const Z=J;let ee;i[26]!==a.path||i[27]!==G||i[28]!==p||i[29]!==g||i[30]!==M?(ee=g?t.jsxs(Qe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsx("button",{type:"button",onClick:G,disabled:p,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","aria-label":M("gitView.changes.revertFileAria",{path:a.path}),children:p?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})})}),t.jsx(et,{sideOffset:8,children:M("gitView.changes.revertFileTooltip")})]}):null,i[26]=a.path,i[27]=G,i[28]=p,i[29]=g,i[30]=M,i[31]=ee):ee=i[31];const Y=ee,n=`group flex items-center gap-2 py-1.5 cursor-pointer ${v??"px-3"}`;let o;i[32]!==N?(o=N>0?{paddingInlineStart:`${N}px`}:void 0,i[32]=N,i[33]=o):o=i[33];const s=b?W:null;let x;i[34]!==D.color?(x={color:D.color},i[34]=D.color,i[35]=x):x=i[35];let I;i[36]!==D.code||i[37]!==z||i[38]!==x?(I=t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:x,title:z,"aria-label":z,children:D.code}),i[36]=D.code,i[37]=z,i[38]=x,i[39]=I):I=i[39];let L;i[40]!==a.path?(L=t.jsx(Ct,{filePath:a.path,className:"h-3.5 w-3.5 shrink-0"}),i[40]=a.path,i[41]=L):L=i[41];let ie;e:{if(a.path.lastIndexOf("/")===-1||l){let re;i[42]===Symbol.for("react.memo_cache_sentinel")?(re={direction:"rtl",unicodeBidi:"plaintext"},i[42]=re):re=i[42];const ue=a.path;let le;i[43]!==a.path?(le=qt(a.path),i[43]=a.path,i[44]=le):le=i[44];let ce;i[45]!==a.path||i[46]!==le?(ce=t.jsx("span",{className:"oc-ui-start-align flex-1 min-w-0 truncate typography-ui-label text-foreground",style:re,title:ue,children:le}),i[45]=a.path,i[46]=le,i[47]=ce):ce=i[47],ie=ce;break e}let oe;i[48]!==a.path?(oe=t.jsx(Yt,{path:a.path,className:"flex-1 typography-ui-label"}),i[48]=a.path,i[49]=oe):oe=i[49],ie=oe}let Q;i[50]!==b||i[51]!==W||i[52]!==p||i[53]!==Y||i[54]!==Z?(Q=b?t.jsxs(t.Fragment,{children:[Z,Y]}):t.jsxs("span",{className:"flex shrink-0 items-center justify-items-end gap-2 md:grid",children:[t.jsx("span",{className:ae("md:col-start-1 md:row-start-1",p?"md:invisible":"md:group-hover:invisible md:group-focus-within:invisible"),children:Z}),t.jsxs("span",{className:ae("flex items-center gap-2 md:col-start-1 md:row-start-1",!p&&"md:invisible md:group-hover:visible md:group-focus-within:visible"),children:[Y,W]})]}),i[50]=b,i[51]=W,i[52]=p,i[53]=Y,i[54]=Z,i[55]=Q):Q=i[55];let ne;return i[56]!==P||i[57]!==d||i[58]!==n||i[59]!==o||i[60]!==s||i[61]!==I||i[62]!==L||i[63]!==ie||i[64]!==Q?(ne=t.jsxs("div",{className:n,role:"button",tabIndex:0,onClick:d,onKeyDown:P,style:o,children:[s,I,L,ie,Q]}),i[56]=P,i[57]=d,i[58]=n,i[59]=o,i[60]=s,i[61]=I,i[62]=L,i[63]=ie,i[64]=Q,i[65]=ne):ne=i[65],ne}),Zt=1e3,ct=34,Ue=30,Fe="ps-0 pe-2",qe=(f,e)=>`${f} ${e}`,Vi=({groups:f,diffStats:e,revertingPaths:i,isRevertingAll:a=!1,headerBackgroundClassName:h="bg-sidebar",onVisiblePathsChange:u,onRevertAll:m,onRevertDirectory:d})=>{const{t:c}=de(),p=w.useRef(null),v=Me(n=>n.gitChangesViewMode)==="tree",r=w.useMemo(()=>f.filter(n=>n.entries.length>0),[f]),[A,V]=w.useState(new Set),[T,N]=w.useState(new Set),[b,l]=w.useState(!1),[g,F]=w.useState(null),D=St(),{confirm:M}=D,B=w.useCallback(async(n,o)=>{await M({title:c("gitView.changes.revertFileDialogTitle"),message:c("gitView.changes.revertFileDescription",{path:o}),action:c("gitView.changes.revertFileConfirm"),destructive:!0})&&n.onRevertFile(o)},[M,c]),z=w.useMemo(()=>r.map(n=>Wt(n.entries)),[r]),O=w.useMemo(()=>{const n=[];return r.forEach((o,s)=>{Array.from(z[s]?.children.values()??[]).forEach(x=>{n.push(qe(o.id,Xt(x).node.path))})}),n},[z,r]);w.useEffect(()=>{v&&N(n=>{const o=new Set,s=new Set(O);return n.forEach(x=>{(x.slice(x.indexOf(" ")+1).includes("/")||s.has(x))&&o.add(x)}),O.forEach(x=>o.add(x)),o})},[v,O]);const C=w.useMemo(()=>{const n=[];return r.forEach((o,s)=>{if(n.push({type:"header",key:`header:${o.id}`,groupIndex:s}),!A.has(o.id)){if(v){const x=new Set;T.forEach(L=>{L.startsWith(`${o.id} `)&&x.add(L.slice(o.id.length+1))}),Jt(z[s],x).forEach(L=>{L.kind==="file"?n.push({type:"file",key:`${o.id}:${L.key}`,groupIndex:s,file:L.file,depth:L.depth}):n.push({type:"directory",key:`${o.id}:${L.key}`,groupIndex:s,directory:L.directory,label:L.label,depth:L.depth})});return}o.entries.forEach(x=>{n.push({type:"file",key:`${o.id}:file:${x.path}`,groupIndex:s,file:x,depth:0})})}}),m&&r.length>0&&n.push({type:"revert-all",key:"revert-all"}),n},[A,T,v,m,z,r]),y=C.length,P=y>=Zt,j=Nt({count:y,enabled:P,getScrollElement:()=>p.current,estimateSize:()=>ct,overscan:12,getItemKey:n=>C[n]?.key??n}),E=j.getVirtualItems(),H=w.useMemo(()=>{if(!P)return 0;const n=p.current?.scrollTop??0;return E.find(s=>s.end>n)?.index??0},[P,E,p]);w.useEffect(()=>{if(!u)return;const n=o=>o&&o.type==="file"?o.file.path:null;if(y===0){u([]);return}if(!P){const o=[];for(const s of C)if(s.type==="file"&&(o.push(s.file.path),o.length>=Ue))break;u(o);return}u(C.slice(H,H+Math.ceil((p.current?.clientHeight??0)/ct)+Ue).map(o=>n(o)).filter(o=>!!o).slice(0,Ue))},[u,y,C,P,H]);const G=w.useCallback(n=>{V(o=>{const s=new Set(o);return s.has(n)?s.delete(n):s.add(n),s})},[]),q=w.useCallback((n,o)=>{N(s=>{const x=new Set(s),I=qe(n,o);return x.has(I)?x.delete(I):x.add(I),x})},[]),W=w.useMemo(()=>{const n=new Set;return r.forEach(o=>o.entries.forEach(s=>n.add(s.path))),Array.from(n)},[r]),_=W.length,S=g?a||g.paths.some(n=>i.has(n)):!1,K=w.useCallback(async()=>{!m||a||W.length===0||(await m(W),l(!1))},[W,a,m]),R=w.useCallback(async()=>{!d||!g||S||(await d(g.paths),F(null))},[S,d,g]),U=w.useCallback((n,o)=>{const s=A.has(n.id),x=n.entries.length;return t.jsxs("div",{className:ae("sticky top-0 z-10 flex items-center gap-2 py-2",h,Fe,!o&&"mt-1 border-t border-border/40"),children:[t.jsx("button",{type:"button",onClick:()=>n.onActionAll(n.entries.map(I=>I.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":n.actionAllLabel,title:n.actionAllLabel,children:n.actionSymbol}),t.jsxs("button",{type:"button",onClick:()=>G(n.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-expanded":!s,children:[t.jsx("h3",{className:"truncate typography-ui-header font-semibold text-foreground",children:n.title}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:x}),t.jsx($,{name:"arrow-down-s",className:ae("size-3.5 shrink-0 text-muted-foreground transition-transform",s&&"-rotate-90 rtl:rotate-90")})]})]})},[A,h,G]),J=w.useCallback((n,o,s,x)=>{const I=T.has(qe(n.id,o.path)),L=o.files.map(Q=>Q.path),ie=a||L.some(Q=>i.has(Q));return t.jsxs("div",{className:ae("group flex items-center gap-2 py-1.5 text-muted-foreground hover:text-foreground",Fe),style:{paddingInlineStart:`${x*Ke}px`},children:[t.jsxs("button",{type:"button",onClick:()=>q(n.id,o.path),"aria-expanded":I,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":I?c("gitView.changes.collapseDirectoryAria",{path:o.path}):c("gitView.changes.expandDirectoryAria",{path:o.path}),children:[t.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center",children:t.jsx($,{name:"arrow-right-s",className:ae("size-3.5 transition-transform",I&&"rotate-90 rtl:-rotate-90")})}),t.jsx("span",{className:"min-w-0 truncate typography-ui-label",title:o.path,children:s}),I?null:t.jsx("span",{className:"shrink-0 typography-micro tabular-nums text-muted-foreground/70",children:o.files.length})]}),t.jsxs("span",{className:ae("flex shrink-0 items-center gap-2 transition-opacity",!ie&&"md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),children:[n.showRevertActions!==!1&&d?t.jsx("button",{type:"button",onClick:()=>F({path:o.path,paths:L,count:L.length}),disabled:ie,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50","aria-label":c("gitView.changes.revertDirectoryAria",{path:o.path}),title:c("gitView.changes.revertDirectoryTooltip"),children:ie?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})}):null,t.jsx("button",{type:"button",onClick:()=>n.onActionAll(o.files.map(Q=>Q.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":c(n.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:o.path}),title:c(n.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:o.path}),children:n.actionSymbol})]})]})},[T,a,d,i,c,q]),Z=w.useCallback((n,o)=>{if(n.type==="revert-all")return t.jsx("div",{className:ae("flex justify-end py-2",Fe),children:t.jsxs(X,{variant:"ghost",size:"sm",onClick:()=>l(!0),disabled:a,className:"gap-1.5 text-[var(--status-error)] hover:bg-[var(--status-error)]/10 hover:text-[var(--status-error)]",children:[t.jsx($,{name:"arrow-go-back",className:"size-3.5"}),c("gitView.changes.revertAll")]})});const s=r[n.groupIndex];if(!s)return null;if(n.type==="header")return U(s,o);if(n.type==="directory")return J(s,n.directory,n.label,n.depth);const x=n.file;return t.jsx(Qt,{file:x,actionLabel:s.getActionLabel(x.path),actionSymbol:s.actionSymbol,onAction:()=>s.onActionFile(x.path),stats:e?.[s.statsScope]?.[x.path],onViewDiff:()=>s.onViewDiff(x.path),onRevert:()=>{B(s,x.path)},isReverting:i.has(x.path)||a,rowPaddingClassName:Fe,indentPx:n.depth*Ke,actionAtStart:!v,nameOnly:v,showRevert:s.showRevertActions!==!1})},[e,a,v,J,U,B,i,c,r]),ee=n=>n.type!=="file"&&n.type!=="directory"?null:Array.from({length:n.depth},(o,s)=>t.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 w-px bg-border/50",style:{insetInlineStart:`${s*Ke+8}px`}},s)),Y=w.useCallback(n=>{if(v)return!1;const o=C[n],s=C[n-1];return!o||!s||o.type!=="file"&&o.type!=="directory"||s.type!=="file"&&s.type!=="directory"?!1:s.groupIndex===o.groupIndex},[v,C]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[t.jsx(Vt,{ref:p,className:"overlay-scrollbar-target overlay-scrollbar-container min-h-0 w-full flex-1 overflow-x-hidden overflow-y-auto",children:P?t.jsx("div",{style:{height:j.getTotalSize(),position:"relative"},children:E.map(n=>{const o=C[n.index];return o?t.jsxs("div",{"data-index":n.index,ref:j.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},className:ae(Y(n.index)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-border/60"),children:[ee(o),Z(o,n.index===0)]},o.key):null})}):t.jsx("div",{role:"list","aria-label":c("gitView.changes.changedFilesAria"),children:C.map((n,o)=>t.jsxs("div",{className:ae("relative",Y(o)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-border/60"),children:[ee(n),Z(n,o===0)]},n.key))})}),t.jsx(kt,{containerRef:p,disableHorizontal:!0})]}),D.dialog,t.jsx(De,{open:b,onOpenChange:n=>{!a&&!n&&l(!1)},children:t.jsxs(Ee,{className:"max-w-md",children:[t.jsxs(Te,{children:[t.jsx(ze,{children:c("gitView.changes.revertAllDialogTitle")}),t.jsx(Re,{children:_===1?c("gitView.changes.revertAllDescriptionSingle",{count:_}):c("gitView.changes.revertAllDescriptionPlural",{count:_})})]}),t.jsxs(Ye,{children:[t.jsx(X,{variant:"outline",size:"sm",onClick:()=>l(!1),disabled:a,children:c("gitView.common.cancel")}),t.jsx(X,{variant:"destructive",size:"sm",onClick:()=>{K()},disabled:a,children:c(a?"gitView.changes.reverting":"gitView.changes.revertAll")})]})]})}),t.jsx(De,{open:!!g,onOpenChange:n=>{!S&&!n&&F(null)},children:t.jsxs(Ee,{className:"max-w-md",children:[t.jsxs(Te,{children:[t.jsx(ze,{children:c("gitView.changes.revertDirectoryDialogTitle")}),t.jsx(Re,{children:g?g.count===1?c("gitView.changes.revertDirectoryDescriptionSingle",{count:g.count,path:g.path}):c("gitView.changes.revertDirectoryDescriptionPlural",{count:g.count,path:g.path}):null})]}),t.jsxs(Ye,{children:[t.jsx(X,{variant:"outline",size:"sm",onClick:()=>F(null),disabled:S,children:c("gitView.common.cancel")}),t.jsx(X,{variant:"destructive",size:"sm",onClick:()=>{R()},disabled:S||!g,children:c(S?"gitView.changes.reverting":"gitView.changes.revertDirectory")})]})]})})]})},We=38,Le=200,ei=f=>{const e=pe.c(23),{value:i,onChange:a,onSubmit:h,placeholder:u,disabled:m,hasTouchInput:d,isMobile:c}=f,p=m===void 0?!1:m,k=d===void 0?!1:d,v=c===void 0?!1:c,{t:r}=de(),A=w.useRef(null),V=Me(ti);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{const y=A.current;if(!y)return;const P=document.activeElement===y,j=()=>{y.style.height=`${We}px`;const H=y.scrollHeight,G=Math.min(Math.max(H,We),Le);y.style.height=`${G}px`,y.style.overflowY=H>Le?"auto":"hidden",H>Le&&!P&&(y.scrollTop=y.scrollHeight)};j();const E=window.requestAnimationFrame(j);return()=>{window.cancelAnimationFrame(E)}},e[0]=T):T=e[0];let N;e[1]!==i?(N=[i],e[1]=i,e[2]=N):N=e[2],w.useLayoutEffect(T,N);let b;e[3]!==a?(b=y=>a(y.target.value),e[3]=a,e[4]=b):b=e[4];let l;e[5]!==h?(l=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&!y.shiftKey&&!y.altKey&&(y.preventDefault(),h?.())},e[5]=h,e[6]=l):l=e[6];let g;e[7]!==u||e[8]!==r?(g=u??r("gitView.commit.messagePlaceholder"),e[7]=u,e[8]=r,e[9]=g):g=e[9];const F=k?"on":"off",D=k?"sentences":"off",M=v||V,B=p&&"opacity-50";let z;e[10]!==B?(z=ae("oc-raised oc-field w-full rounded-lg bg-surface-elevated px-3 py-2 typography-ui-label text-foreground placeholder:text-muted-foreground","resize-none outline-none",B),e[10]=B,e[11]=z):z=e[11];let O;e[12]===Symbol.for("react.memo_cache_sentinel")?(O={minHeight:We,maxHeight:Le},e[12]=O):O=e[12];let C;return e[13]!==p||e[14]!==D||e[15]!==M||e[16]!==z||e[17]!==b||e[18]!==l||e[19]!==g||e[20]!==F||e[21]!==i?(C=t.jsx("textarea",{ref:A,value:i,onChange:b,onKeyDown:l,placeholder:g,rows:1,disabled:p,autoCorrect:F,autoCapitalize:D,spellCheck:M,className:z,style:O}),e[13]=p,e[14]=D,e[15]=M,e[16]=z,e[17]=b,e[18]=l,e[19]=g,e[20]=F,e[21]=i,e[22]=C):C=e[22],C};function ti(f){return f.inputSpellcheckEnabled}const ii=f=>{const e=pe.c(30),{highlights:i,onInsert:a}=f,{t:h}=de();if(i.length===0)return null;let u;e[0]!==i||e[1]!==a?(u=()=>{a(i)},e[0]=i,e[1]=a,e[2]=u):u=e[2];const m=u;let d;e[3]!==h?(d=h("gitView.commit.aiHighlights.title"),e[3]=h,e[4]=d):d=e[4];let c;e[5]!==d?(c=t.jsx("p",{className:"typography-micro text-muted-foreground",children:d}),e[5]=d,e[6]=c):c=e[6];let p;e[7]!==h?(p=h("gitView.commit.aiHighlights.insertAria"),e[7]=h,e[8]=p):p=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx($,{name:"arrow-down",className:"size-4"}),e[9]=k):k=e[9];let v;e[10]!==m||e[11]!==p?(v=t.jsx(Ze,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"size-6",onClick:m,"aria-label":p,children:k})}),e[10]=m,e[11]=p,e[12]=v):v=e[12];let r;e[13]!==h?(r=h("gitView.commit.aiHighlights.insertTooltip"),e[13]=h,e[14]=r):r=e[14];let A;e[15]!==r?(A=t.jsx(et,{sideOffset:8,children:r}),e[15]=r,e[16]=A):A=e[16];let V;e[17]!==v||e[18]!==A?(V=t.jsxs(Qe,{children:[v,A]}),e[17]=v,e[18]=A,e[19]=V):V=e[19];let T;e[20]!==c||e[21]!==V?(T=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c,V]}),e[20]=c,e[21]=V,e[22]=T):T=e[22];let N;e[23]!==i?(N=i.map(si),e[23]=i,e[24]=N):N=e[24];let b;e[25]!==N?(b=t.jsx("ul",{className:"space-y-1",children:N}),e[25]=N,e[26]=b):b=e[26];let l;return e[27]!==T||e[28]!==b?(l=t.jsxs("div",{className:"space-y-2 rounded-xl oc-tile px-3 py-2",children:[T,b]}),e[27]=T,e[28]=b,e[29]=l):l=e[29],l};function si(f,e){return t.jsx("li",{className:"typography-meta text-foreground",children:f},`${f}-${e}`)}const ki=f=>{const e=pe.c(81),{stagedCount:i,commitMessage:a,onCommitMessageChange:h,generatedHighlights:u,onInsertHighlights:m,onGenerateMessage:d,isGeneratingMessage:c,onCommit:p,onCommitAndPush:k,commitAction:v,networkOperationBlocked:r,hasPendingIndexMutation:A,gitmojiEnabled:V,onOpenGitmojiPicker:T}=f,N=r===void 0?!1:r,b=A===void 0?!1:A,{t:l}=de(),g=i>0;let F;e[0]!==v||e[1]!==a||e[2]!==b||e[3]!==g?(F=a.trim()&&g&&v===null&&!b,e[0]=v,e[1]=a,e[2]=b,e[3]=g,e[4]=F):F=e[4];const D=F,{isMobile:M,hasTouchInput:B}=At();let z;e[5]!==l?(z=l("gitView.commit.title"),e[5]=l,e[6]=z):z=e[6];let O;e[7]!==z?(O=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:z}),e[7]=z,e[8]=O):O=e[8];let C;e[9]!==g||e[10]!==l?(C=g?null:t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:l("gitView.commit.stageFilesHint")}),e[9]=g,e[10]=l,e[11]=C):C=e[11];let y;e[12]!==O||e[13]!==C?(y=t.jsxs("div",{className:"flex w-full items-baseline gap-2 px-0 pt-2 pb-1",children:[O,C]}),e[12]=O,e[13]=C,e[14]=y):y=e[14];let P;e[15]!==u||e[16]!==m?(P=t.jsx(ii,{highlights:u,onInsert:m}),e[15]=u,e[16]=m,e[17]=P):P=e[17];let j;e[18]!==D||e[19]!==c||e[20]!==p?(j=()=>{D&&!c&&p()},e[18]=D,e[19]=c,e[20]=p,e[21]=j):j=e[21];let E;e[22]!==l?(E=l("gitView.commit.messagePlaceholder"),e[22]=l,e[23]=E):E=e[23];const H=v!==null;let G;e[24]!==a||e[25]!==B||e[26]!==M||e[27]!==h||e[28]!==E||e[29]!==H||e[30]!==j?(G=t.jsx(ei,{value:a,onChange:h,onSubmit:j,placeholder:E,disabled:H,hasTouchInput:B,isMobile:M}),e[24]=a,e[25]=B,e[26]=M,e[27]=h,e[28]=E,e[29]=H,e[30]=j,e[31]=G):G=e[31];let q;e[32]!==V||e[33]!==T||e[34]!==l?(q=V&&t.jsxs(X,{variant:"outline",size:"sm",onClick:T,className:"w-fit",type:"button",children:[t.jsx($,{name:"emotion-happy",className:"size-4"}),l("gitView.commit.addGitmoji")]}),e[32]=V,e[33]=T,e[34]=l,e[35]=q):q=e[35];const W=c||v!==null||b||i===0;let _;e[36]!==l?(_=l("gitView.commit.generateAria"),e[36]=l,e[37]=_):_=e[37];let S;e[38]!==c?(S=c?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"ai-generate-2",className:"size-4 text-primary"}),e[38]=c,e[39]=S):S=e[39];let K;e[40]!==l?(K=l("gitView.commit.generate"),e[40]=l,e[41]=K):K=e[41];let R;e[42]!==K?(R=t.jsx("span",{className:"commit-actions__label",children:K}),e[42]=K,e[43]=R):R=e[43];let U;e[44]!==d||e[45]!==W||e[46]!==_||e[47]!==S||e[48]!==R?(U=t.jsxs(X,{variant:"outline",size:"sm",onClick:d,disabled:W,type:"button","aria-label":_,className:"commit-actions__btn",children:[S,R]}),e[44]=d,e[45]=W,e[46]=_,e[47]=S,e[48]=R,e[49]=U):U=e[49];let J;e[50]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx("div",{className:"flex-1"}),e[50]=J):J=e[50];const Z=!D||c;let ee;e[51]!==l?(ee=l("gitView.commit.commitAria"),e[51]=l,e[52]=ee):ee=e[52];let Y;e[53]!==v||e[54]!==l?(Y=v==="commit"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label",children:l("gitView.commit.committing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"git-commit",className:"size-4"}),t.jsx("span",{className:"commit-actions__label",children:l("gitView.commit.commit")})]}),e[53]=v,e[54]=l,e[55]=Y):Y=e[55];let n;e[56]!==p||e[57]!==Z||e[58]!==ee||e[59]!==Y?(n=t.jsx(X,{size:"sm",variant:"outline",onClick:p,disabled:Z,className:"commit-actions__btn whitespace-nowrap","aria-label":ee,children:Y}),e[56]=p,e[57]=Z,e[58]=ee,e[59]=Y,e[60]=n):n=e[60];let o;e[61]!==D||e[62]!==v||e[63]!==c||e[64]!==M||e[65]!==N||e[66]!==k||e[67]!==l?(o=M?t.jsxs(Qe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsx(X,{variant:"default",size:"sm",onClick:()=>k(),disabled:!D||c||N,className:"h-7 w-7 p-0","aria-label":l("gitView.commit.pushAria"),children:v==="commitAndPush"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"arrow-up",className:"size-3.5"})})}),t.jsx(et,{side:"top",children:t.jsx("p",{children:l("gitView.commit.push")})})]}):t.jsx(X,{size:"sm",variant:"default",onClick:()=>k(),disabled:!D||c||N,className:"commit-actions__btn","aria-label":l("gitView.commit.pushAria"),children:v==="commitAndPush"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:l("gitView.commit.pushing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"arrow-up",className:"size-3.5"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:l("gitView.commit.push")})]})}),e[61]=D,e[62]=v,e[63]=c,e[64]=M,e[65]=N,e[66]=k,e[67]=l,e[68]=o):o=e[68];let s;e[69]!==U||e[70]!==n||e[71]!==o?(s=t.jsxs("div",{className:"@container/commit-actions flex items-center gap-2 min-w-0",children:[U,J,n,o]}),e[69]=U,e[70]=n,e[71]=o,e[72]=s):s=e[72];let x;e[73]!==G||e[74]!==q||e[75]!==s||e[76]!==P?(x=t.jsxs("div",{className:"flex flex-col gap-3 px-0 pt-1 pb-3",children:[P,G,q,s]}),e[73]=G,e[74]=q,e[75]=s,e[76]=P,e[77]=x):x=e[77];let I;return e[78]!==x||e[79]!==y?(I=t.jsxs("section",{className:"border-0 bg-transparent rounded-none",children:[y,x]}),e[78]=x,e[79]=y,e[80]=I):I=e[80],I},Ai=f=>{const e=pe.c(150),{open:i,onOpenChange:a,conflictFiles:h,directory:u,operation:m,onAbort:d,onClearState:c,onNavigatedToChat:p}=f;let k;e[0]!==h?(k=h===void 0?[]:h,e[0]=h,e[1]=k):k=e[1];const v=k,{t:r}=de(),A=tt(ni),V=tt(ai),T=it(li),N=it(oi),[b,l]=w.useState(!1),[g,F]=w.useState(null),[D,M]=w.useState(null);let B,z;e[2]!==u||e[3]!==i||e[4]!==r?(B=()=>{!i||!u||(l(!0),M(null),F(null),It(u).then(se=>{F(se)}).catch(se=>{const me=se instanceof Error?se.message:r("gitView.conflict.loadFailed");M(me)}).finally(()=>{l(!1)}))},z=[i,u,r],e[2]=u,e[3]=i,e[4]=r,e[5]=B,e[6]=z):(B=e[5],z=e[6]),w.useEffect(B,z);let O;e[7]!==g||e[8]!==u||e[9]!==m?(O=async()=>{if(!g)return null;const se=m==="merge"?"merge":"rebase",me=g.headInfo||(m==="merge"?"MERGE_HEAD":"REBASE_HEAD"),ve=m==="merge"?"git commit --no-edit":"git rebase --continue",Ie=await st("git.conflict.resolve.visible",{operation_label:se,head_ref:me}),fe=await st("git.conflict.resolve.instructions",{operation_label:se,directory:u,operation:m,head_info:g.headInfo||"N/A",continue_cmd:ve}),he=`${se} conflict context (JSON)
1
+ import{R as w,f as pe,j as t}from"./vendor-react-BUCujlKS.js";import{u as Nt}from"./vendor-tanstack-react-virtual-Bmi0tTrf.js";import{u as de,V as Qe,W as Ze,I as $,X as et,dp as Ct,N as ae,en as St,B as X,cQ as Vt,fa as kt,t as De,q as Ee,D as Te,l as ze,F as Re,o as Ye,aF as At,G as tt,fb as it,fc as It,aL as st,A as ge,C as Dt,b7 as dt,b8 as mt,fd as ut,b9 as ft,fe as ht,ff as Et,fg as pt,fh as $e,fi as Tt,fj as gt,fk as zt,fl as Rt,fm as xt,fn as yt,cH as Be,cc as nt,ca as at,c9 as lt,cb as ot,c3 as rt,fo as Ot,fp as Pt,fq as Pe,fr as Ft}from"./useAppFontEffects-DAUhSLPu.js";import{u as Me,a_ as bt,a$ as Lt,a5 as He}from"./katex.min-u4DtE8E5.js";import{L as $t,R as Ae,U as vt,V as wt,X as Mt,h as Ht,f as Gt,g as _t,Y as Bt,Z as Kt,_ as Ut}from"./runtimeEndpointReset-D7viEboD.js";import{a as qt,b as Wt,c as Xt,f as Jt,T as Ke}from"./PierreDiffViewer-BT3MrXwN.js";import{C as Yt}from"./ChangedPathLabel-BirEUxH2.js";const Qt=w.memo(function(e){const i=pe.c(66),{file:a,actionLabel:h,actionSymbol:u,onAction:m,onViewDiff:d,onRevert:c,isReverting:p,stats:k,rowPaddingClassName:v,indentPx:r,actionAtStart:A,nameOnly:V,showRevert:T}=e,N=r===void 0?0:r,b=A===void 0?!1:A,l=V===void 0?!1:V,g=T===void 0?!0:T;let F;i[0]!==a?(F=$t(a),i[0]=a,i[1]=F):F=i[1];const D=F,{t:M}=de();let B;i[2]!==D.descriptionKey||i[3]!==M?(B=M(D.descriptionKey),i[2]=D.descriptionKey,i[3]=M,i[4]=B):B=i[4];const z=B,O=k?.insertions??0,C=k?.deletions??0;let y;i[5]!==m||i[6]!==d?(y=te=>{te.key===" "?(te.preventDefault(),m()):te.key==="Enter"&&(te.preventDefault(),d())},i[5]=m,i[6]=d,i[7]=y):y=i[7];const P=y;let j;i[8]!==m?(j=te=>{te.preventDefault(),te.stopPropagation(),m()},i[8]=m,i[9]=j):j=i[9];const E=j;let H;i[10]!==c?(H=te=>{te.preventDefault(),te.stopPropagation(),c()},i[10]=c,i[11]=H):H=i[11];const G=H;let q;i[12]!==h||i[13]!==u||i[14]!==E?(q=t.jsx("button",{type:"button",onClick:E,className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":h,title:h,children:u}),i[12]=h,i[13]=u,i[14]=E,i[15]=q):q=i[15];const W=q;let _;i[16]===Symbol.for("react.memo_cache_sentinel")?(_={color:"var(--status-success)"},i[16]=_):_=i[16];let S;i[17]!==O?(S=t.jsxs("span",{style:_,children:["+",O]}),i[17]=O,i[18]=S):S=i[18];let K,R;i[19]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx("span",{className:"text-muted-foreground mx-0.5",children:"/"}),R={color:"var(--status-error)"},i[19]=K,i[20]=R):(K=i[19],R=i[20]);let U;i[21]!==C?(U=t.jsxs("span",{style:R,children:["-",C]}),i[21]=C,i[22]=U):U=i[22];let J;i[23]!==S||i[24]!==U?(J=t.jsxs("span",{className:"shrink-0 typography-micro",children:[S,K,U]}),i[23]=S,i[24]=U,i[25]=J):J=i[25];const Z=J;let ee;i[26]!==a.path||i[27]!==G||i[28]!==p||i[29]!==g||i[30]!==M?(ee=g?t.jsxs(Qe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsx("button",{type:"button",onClick:G,disabled:p,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","aria-label":M("gitView.changes.revertFileAria",{path:a.path}),children:p?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})})}),t.jsx(et,{sideOffset:8,children:M("gitView.changes.revertFileTooltip")})]}):null,i[26]=a.path,i[27]=G,i[28]=p,i[29]=g,i[30]=M,i[31]=ee):ee=i[31];const Y=ee,n=`group flex items-center gap-2 py-1.5 cursor-pointer ${v??"px-3"}`;let o;i[32]!==N?(o=N>0?{paddingInlineStart:`${N}px`}:void 0,i[32]=N,i[33]=o):o=i[33];const s=b?W:null;let x;i[34]!==D.color?(x={color:D.color},i[34]=D.color,i[35]=x):x=i[35];let I;i[36]!==D.code||i[37]!==z||i[38]!==x?(I=t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:x,title:z,"aria-label":z,children:D.code}),i[36]=D.code,i[37]=z,i[38]=x,i[39]=I):I=i[39];let L;i[40]!==a.path?(L=t.jsx(Ct,{filePath:a.path,className:"h-3.5 w-3.5 shrink-0"}),i[40]=a.path,i[41]=L):L=i[41];let ie;e:{if(a.path.lastIndexOf("/")===-1||l){let re;i[42]===Symbol.for("react.memo_cache_sentinel")?(re={direction:"rtl",unicodeBidi:"plaintext"},i[42]=re):re=i[42];const ue=a.path;let le;i[43]!==a.path?(le=qt(a.path),i[43]=a.path,i[44]=le):le=i[44];let ce;i[45]!==a.path||i[46]!==le?(ce=t.jsx("span",{className:"oc-ui-start-align flex-1 min-w-0 truncate typography-ui-label text-foreground",style:re,title:ue,children:le}),i[45]=a.path,i[46]=le,i[47]=ce):ce=i[47],ie=ce;break e}let oe;i[48]!==a.path?(oe=t.jsx(Yt,{path:a.path,className:"flex-1 typography-ui-label"}),i[48]=a.path,i[49]=oe):oe=i[49],ie=oe}let Q;i[50]!==b||i[51]!==W||i[52]!==p||i[53]!==Y||i[54]!==Z?(Q=b?t.jsxs(t.Fragment,{children:[Z,Y]}):t.jsxs("span",{className:"flex shrink-0 items-center justify-items-end gap-2 md:grid",children:[t.jsx("span",{className:ae("md:col-start-1 md:row-start-1",p?"md:invisible":"md:group-hover:invisible md:group-focus-within:invisible"),children:Z}),t.jsxs("span",{className:ae("flex items-center gap-2 md:col-start-1 md:row-start-1",!p&&"md:invisible md:group-hover:visible md:group-focus-within:visible"),children:[Y,W]})]}),i[50]=b,i[51]=W,i[52]=p,i[53]=Y,i[54]=Z,i[55]=Q):Q=i[55];let ne;return i[56]!==P||i[57]!==d||i[58]!==n||i[59]!==o||i[60]!==s||i[61]!==I||i[62]!==L||i[63]!==ie||i[64]!==Q?(ne=t.jsxs("div",{className:n,role:"button",tabIndex:0,onClick:d,onKeyDown:P,style:o,children:[s,I,L,ie,Q]}),i[56]=P,i[57]=d,i[58]=n,i[59]=o,i[60]=s,i[61]=I,i[62]=L,i[63]=ie,i[64]=Q,i[65]=ne):ne=i[65],ne}),Zt=1e3,ct=34,Ue=30,Fe="ps-0 pe-2",qe=(f,e)=>`${f} ${e}`,Vi=({groups:f,diffStats:e,revertingPaths:i,isRevertingAll:a=!1,headerBackgroundClassName:h="bg-sidebar",onVisiblePathsChange:u,onRevertAll:m,onRevertDirectory:d})=>{const{t:c}=de(),p=w.useRef(null),v=Me(n=>n.gitChangesViewMode)==="tree",r=w.useMemo(()=>f.filter(n=>n.entries.length>0),[f]),[A,V]=w.useState(new Set),[T,N]=w.useState(new Set),[b,l]=w.useState(!1),[g,F]=w.useState(null),D=St(),{confirm:M}=D,B=w.useCallback(async(n,o)=>{await M({title:c("gitView.changes.revertFileDialogTitle"),message:c("gitView.changes.revertFileDescription",{path:o}),action:c("gitView.changes.revertFileConfirm"),destructive:!0})&&n.onRevertFile(o)},[M,c]),z=w.useMemo(()=>r.map(n=>Wt(n.entries)),[r]),O=w.useMemo(()=>{const n=[];return r.forEach((o,s)=>{Array.from(z[s]?.children.values()??[]).forEach(x=>{n.push(qe(o.id,Xt(x).node.path))})}),n},[z,r]);w.useEffect(()=>{v&&N(n=>{const o=new Set,s=new Set(O);return n.forEach(x=>{(x.slice(x.indexOf(" ")+1).includes("/")||s.has(x))&&o.add(x)}),O.forEach(x=>o.add(x)),o})},[v,O]);const C=w.useMemo(()=>{const n=[];return r.forEach((o,s)=>{if(n.push({type:"header",key:`header:${o.id}`,groupIndex:s}),!A.has(o.id)){if(v){const x=new Set;T.forEach(L=>{L.startsWith(`${o.id} `)&&x.add(L.slice(o.id.length+1))}),Jt(z[s],x).forEach(L=>{L.kind==="file"?n.push({type:"file",key:`${o.id}:${L.key}`,groupIndex:s,file:L.file,depth:L.depth}):n.push({type:"directory",key:`${o.id}:${L.key}`,groupIndex:s,directory:L.directory,label:L.label,depth:L.depth})});return}o.entries.forEach(x=>{n.push({type:"file",key:`${o.id}:file:${x.path}`,groupIndex:s,file:x,depth:0})})}}),m&&r.length>0&&n.push({type:"revert-all",key:"revert-all"}),n},[A,T,v,m,z,r]),y=C.length,P=y>=Zt,j=Nt({count:y,enabled:P,getScrollElement:()=>p.current,estimateSize:()=>ct,overscan:12,getItemKey:n=>C[n]?.key??n}),E=j.getVirtualItems(),H=w.useMemo(()=>{if(!P)return 0;const n=p.current?.scrollTop??0;return E.find(s=>s.end>n)?.index??0},[P,E,p]);w.useEffect(()=>{if(!u)return;const n=o=>o&&o.type==="file"?o.file.path:null;if(y===0){u([]);return}if(!P){const o=[];for(const s of C)if(s.type==="file"&&(o.push(s.file.path),o.length>=Ue))break;u(o);return}u(C.slice(H,H+Math.ceil((p.current?.clientHeight??0)/ct)+Ue).map(o=>n(o)).filter(o=>!!o).slice(0,Ue))},[u,y,C,P,H]);const G=w.useCallback(n=>{V(o=>{const s=new Set(o);return s.has(n)?s.delete(n):s.add(n),s})},[]),q=w.useCallback((n,o)=>{N(s=>{const x=new Set(s),I=qe(n,o);return x.has(I)?x.delete(I):x.add(I),x})},[]),W=w.useMemo(()=>{const n=new Set;return r.forEach(o=>o.entries.forEach(s=>n.add(s.path))),Array.from(n)},[r]),_=W.length,S=g?a||g.paths.some(n=>i.has(n)):!1,K=w.useCallback(async()=>{!m||a||W.length===0||(await m(W),l(!1))},[W,a,m]),R=w.useCallback(async()=>{!d||!g||S||(await d(g.paths),F(null))},[S,d,g]),U=w.useCallback((n,o)=>{const s=A.has(n.id),x=n.entries.length;return t.jsxs("div",{className:ae("sticky top-0 z-10 flex items-center gap-2 py-2",h,Fe,!o&&"mt-1 border-t border-border/40"),children:[t.jsx("button",{type:"button",onClick:()=>n.onActionAll(n.entries.map(I=>I.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":n.actionAllLabel,title:n.actionAllLabel,children:n.actionSymbol}),t.jsxs("button",{type:"button",onClick:()=>G(n.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-expanded":!s,children:[t.jsx("h3",{className:"truncate typography-ui-header font-semibold text-foreground",children:n.title}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:x}),t.jsx($,{name:"arrow-down-s",className:ae("size-3.5 shrink-0 text-muted-foreground transition-transform",s&&"-rotate-90 rtl:rotate-90")})]})]})},[A,h,G]),J=w.useCallback((n,o,s,x)=>{const I=T.has(qe(n.id,o.path)),L=o.files.map(Q=>Q.path),ie=a||L.some(Q=>i.has(Q));return t.jsxs("div",{className:ae("group flex items-center gap-2 py-1.5 text-muted-foreground hover:text-foreground",Fe),style:{paddingInlineStart:`${x*Ke}px`},children:[t.jsxs("button",{type:"button",onClick:()=>q(n.id,o.path),"aria-expanded":I,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":I?c("gitView.changes.collapseDirectoryAria",{path:o.path}):c("gitView.changes.expandDirectoryAria",{path:o.path}),children:[t.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center",children:t.jsx($,{name:"arrow-right-s",className:ae("size-3.5 transition-transform",I&&"rotate-90 rtl:-rotate-90")})}),t.jsx("span",{className:"min-w-0 truncate typography-ui-label",title:o.path,children:s}),I?null:t.jsx("span",{className:"shrink-0 typography-micro tabular-nums text-muted-foreground/70",children:o.files.length})]}),t.jsxs("span",{className:ae("flex shrink-0 items-center gap-2 transition-opacity",!ie&&"md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),children:[n.showRevertActions!==!1&&d?t.jsx("button",{type:"button",onClick:()=>F({path:o.path,paths:L,count:L.length}),disabled:ie,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50","aria-label":c("gitView.changes.revertDirectoryAria",{path:o.path}),title:c("gitView.changes.revertDirectoryTooltip"),children:ie?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})}):null,t.jsx("button",{type:"button",onClick:()=>n.onActionAll(o.files.map(Q=>Q.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":c(n.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:o.path}),title:c(n.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:o.path}),children:n.actionSymbol})]})]})},[T,a,d,i,c,q]),Z=w.useCallback((n,o)=>{if(n.type==="revert-all")return t.jsx("div",{className:ae("flex justify-end py-2",Fe),children:t.jsxs(X,{variant:"ghost",size:"sm",onClick:()=>l(!0),disabled:a,className:"gap-1.5 text-[var(--status-error)] hover:bg-[var(--status-error)]/10 hover:text-[var(--status-error)]",children:[t.jsx($,{name:"arrow-go-back",className:"size-3.5"}),c("gitView.changes.revertAll")]})});const s=r[n.groupIndex];if(!s)return null;if(n.type==="header")return U(s,o);if(n.type==="directory")return J(s,n.directory,n.label,n.depth);const x=n.file;return t.jsx(Qt,{file:x,actionLabel:s.getActionLabel(x.path),actionSymbol:s.actionSymbol,onAction:()=>s.onActionFile(x.path),stats:e?.[s.statsScope]?.[x.path],onViewDiff:()=>s.onViewDiff(x.path),onRevert:()=>{B(s,x.path)},isReverting:i.has(x.path)||a,rowPaddingClassName:Fe,indentPx:n.depth*Ke,actionAtStart:!v,nameOnly:v,showRevert:s.showRevertActions!==!1})},[e,a,v,J,U,B,i,c,r]),ee=n=>n.type!=="file"&&n.type!=="directory"?null:Array.from({length:n.depth},(o,s)=>t.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 w-px bg-border/50",style:{insetInlineStart:`${s*Ke+8}px`}},s)),Y=w.useCallback(n=>{if(v)return!1;const o=C[n],s=C[n-1];return!o||!s||o.type!=="file"&&o.type!=="directory"||s.type!=="file"&&s.type!=="directory"?!1:s.groupIndex===o.groupIndex},[v,C]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[t.jsx(Vt,{ref:p,className:"overlay-scrollbar-target overlay-scrollbar-container min-h-0 w-full flex-1 overflow-x-hidden overflow-y-auto",children:P?t.jsx("div",{style:{height:j.getTotalSize(),position:"relative"},children:E.map(n=>{const o=C[n.index];return o?t.jsxs("div",{"data-index":n.index,ref:j.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},className:ae(Y(n.index)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-border/60"),children:[ee(o),Z(o,n.index===0)]},o.key):null})}):t.jsx("div",{role:"list","aria-label":c("gitView.changes.changedFilesAria"),children:C.map((n,o)=>t.jsxs("div",{className:ae("relative",Y(o)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-border/60"),children:[ee(n),Z(n,o===0)]},n.key))})}),t.jsx(kt,{containerRef:p,disableHorizontal:!0})]}),D.dialog,t.jsx(De,{open:b,onOpenChange:n=>{!a&&!n&&l(!1)},children:t.jsxs(Ee,{className:"max-w-md",children:[t.jsxs(Te,{children:[t.jsx(ze,{children:c("gitView.changes.revertAllDialogTitle")}),t.jsx(Re,{children:_===1?c("gitView.changes.revertAllDescriptionSingle",{count:_}):c("gitView.changes.revertAllDescriptionPlural",{count:_})})]}),t.jsxs(Ye,{children:[t.jsx(X,{variant:"outline",size:"sm",onClick:()=>l(!1),disabled:a,children:c("gitView.common.cancel")}),t.jsx(X,{variant:"destructive",size:"sm",onClick:()=>{K()},disabled:a,children:c(a?"gitView.changes.reverting":"gitView.changes.revertAll")})]})]})}),t.jsx(De,{open:!!g,onOpenChange:n=>{!S&&!n&&F(null)},children:t.jsxs(Ee,{className:"max-w-md",children:[t.jsxs(Te,{children:[t.jsx(ze,{children:c("gitView.changes.revertDirectoryDialogTitle")}),t.jsx(Re,{children:g?g.count===1?c("gitView.changes.revertDirectoryDescriptionSingle",{count:g.count,path:g.path}):c("gitView.changes.revertDirectoryDescriptionPlural",{count:g.count,path:g.path}):null})]}),t.jsxs(Ye,{children:[t.jsx(X,{variant:"outline",size:"sm",onClick:()=>F(null),disabled:S,children:c("gitView.common.cancel")}),t.jsx(X,{variant:"destructive",size:"sm",onClick:()=>{R()},disabled:S||!g,children:c(S?"gitView.changes.reverting":"gitView.changes.revertDirectory")})]})]})})]})},We=38,Le=200,ei=f=>{const e=pe.c(23),{value:i,onChange:a,onSubmit:h,placeholder:u,disabled:m,hasTouchInput:d,isMobile:c}=f,p=m===void 0?!1:m,k=d===void 0?!1:d,v=c===void 0?!1:c,{t:r}=de(),A=w.useRef(null),V=Me(ti);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{const y=A.current;if(!y)return;const P=document.activeElement===y,j=()=>{y.style.height=`${We}px`;const H=y.scrollHeight,G=Math.min(Math.max(H,We),Le);y.style.height=`${G}px`,y.style.overflowY=H>Le?"auto":"hidden",H>Le&&!P&&(y.scrollTop=y.scrollHeight)};j();const E=window.requestAnimationFrame(j);return()=>{window.cancelAnimationFrame(E)}},e[0]=T):T=e[0];let N;e[1]!==i?(N=[i],e[1]=i,e[2]=N):N=e[2],w.useLayoutEffect(T,N);let b;e[3]!==a?(b=y=>a(y.target.value),e[3]=a,e[4]=b):b=e[4];let l;e[5]!==h?(l=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&!y.shiftKey&&!y.altKey&&(y.preventDefault(),h?.())},e[5]=h,e[6]=l):l=e[6];let g;e[7]!==u||e[8]!==r?(g=u??r("gitView.commit.messagePlaceholder"),e[7]=u,e[8]=r,e[9]=g):g=e[9];const F=k?"on":"off",D=k?"sentences":"off",M=v||V,B=p&&"opacity-50";let z;e[10]!==B?(z=ae("oc-raised oc-field w-full rounded-lg bg-surface-elevated px-3 py-2 typography-ui-label text-foreground placeholder:text-muted-foreground","resize-none outline-none",B),e[10]=B,e[11]=z):z=e[11];let O;e[12]===Symbol.for("react.memo_cache_sentinel")?(O={minHeight:We,maxHeight:Le},e[12]=O):O=e[12];let C;return e[13]!==p||e[14]!==D||e[15]!==M||e[16]!==z||e[17]!==b||e[18]!==l||e[19]!==g||e[20]!==F||e[21]!==i?(C=t.jsx("textarea",{ref:A,value:i,onChange:b,onKeyDown:l,placeholder:g,rows:1,disabled:p,autoCorrect:F,autoCapitalize:D,spellCheck:M,className:z,style:O}),e[13]=p,e[14]=D,e[15]=M,e[16]=z,e[17]=b,e[18]=l,e[19]=g,e[20]=F,e[21]=i,e[22]=C):C=e[22],C};function ti(f){return f.inputSpellcheckEnabled}const ii=f=>{const e=pe.c(30),{highlights:i,onInsert:a}=f,{t:h}=de();if(i.length===0)return null;let u;e[0]!==i||e[1]!==a?(u=()=>{a(i)},e[0]=i,e[1]=a,e[2]=u):u=e[2];const m=u;let d;e[3]!==h?(d=h("gitView.commit.aiHighlights.title"),e[3]=h,e[4]=d):d=e[4];let c;e[5]!==d?(c=t.jsx("p",{className:"typography-micro text-muted-foreground",children:d}),e[5]=d,e[6]=c):c=e[6];let p;e[7]!==h?(p=h("gitView.commit.aiHighlights.insertAria"),e[7]=h,e[8]=p):p=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx($,{name:"arrow-down",className:"size-4"}),e[9]=k):k=e[9];let v;e[10]!==m||e[11]!==p?(v=t.jsx(Ze,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"icon",className:"size-6",onClick:m,"aria-label":p,children:k})}),e[10]=m,e[11]=p,e[12]=v):v=e[12];let r;e[13]!==h?(r=h("gitView.commit.aiHighlights.insertTooltip"),e[13]=h,e[14]=r):r=e[14];let A;e[15]!==r?(A=t.jsx(et,{sideOffset:8,children:r}),e[15]=r,e[16]=A):A=e[16];let V;e[17]!==v||e[18]!==A?(V=t.jsxs(Qe,{children:[v,A]}),e[17]=v,e[18]=A,e[19]=V):V=e[19];let T;e[20]!==c||e[21]!==V?(T=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c,V]}),e[20]=c,e[21]=V,e[22]=T):T=e[22];let N;e[23]!==i?(N=i.map(si),e[23]=i,e[24]=N):N=e[24];let b;e[25]!==N?(b=t.jsx("ul",{className:"space-y-1",children:N}),e[25]=N,e[26]=b):b=e[26];let l;return e[27]!==T||e[28]!==b?(l=t.jsxs("div",{className:"space-y-2 rounded-xl oc-tile px-3 py-2",children:[T,b]}),e[27]=T,e[28]=b,e[29]=l):l=e[29],l};function si(f,e){return t.jsx("li",{className:"typography-meta text-foreground",children:f},`${f}-${e}`)}const ki=f=>{const e=pe.c(81),{stagedCount:i,commitMessage:a,onCommitMessageChange:h,generatedHighlights:u,onInsertHighlights:m,onGenerateMessage:d,isGeneratingMessage:c,onCommit:p,onCommitAndPush:k,commitAction:v,networkOperationBlocked:r,hasPendingIndexMutation:A,gitmojiEnabled:V,onOpenGitmojiPicker:T}=f,N=r===void 0?!1:r,b=A===void 0?!1:A,{t:l}=de(),g=i>0;let F;e[0]!==v||e[1]!==a||e[2]!==b||e[3]!==g?(F=a.trim()&&g&&v===null&&!b,e[0]=v,e[1]=a,e[2]=b,e[3]=g,e[4]=F):F=e[4];const D=F,{isMobile:M,hasTouchInput:B}=At();let z;e[5]!==l?(z=l("gitView.commit.title"),e[5]=l,e[6]=z):z=e[6];let O;e[7]!==z?(O=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:z}),e[7]=z,e[8]=O):O=e[8];let C;e[9]!==g||e[10]!==l?(C=g?null:t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:l("gitView.commit.stageFilesHint")}),e[9]=g,e[10]=l,e[11]=C):C=e[11];let y;e[12]!==O||e[13]!==C?(y=t.jsxs("div",{className:"flex w-full items-baseline gap-2 px-0 pt-2 pb-1",children:[O,C]}),e[12]=O,e[13]=C,e[14]=y):y=e[14];let P;e[15]!==u||e[16]!==m?(P=t.jsx(ii,{highlights:u,onInsert:m}),e[15]=u,e[16]=m,e[17]=P):P=e[17];let j;e[18]!==D||e[19]!==c||e[20]!==p?(j=()=>{D&&!c&&p()},e[18]=D,e[19]=c,e[20]=p,e[21]=j):j=e[21];let E;e[22]!==l?(E=l("gitView.commit.messagePlaceholder"),e[22]=l,e[23]=E):E=e[23];const H=v!==null;let G;e[24]!==a||e[25]!==B||e[26]!==M||e[27]!==h||e[28]!==E||e[29]!==H||e[30]!==j?(G=t.jsx(ei,{value:a,onChange:h,onSubmit:j,placeholder:E,disabled:H,hasTouchInput:B,isMobile:M}),e[24]=a,e[25]=B,e[26]=M,e[27]=h,e[28]=E,e[29]=H,e[30]=j,e[31]=G):G=e[31];let q;e[32]!==V||e[33]!==T||e[34]!==l?(q=V&&t.jsxs(X,{variant:"outline",size:"sm",onClick:T,className:"w-fit",type:"button",children:[t.jsx($,{name:"emotion-happy",className:"size-4"}),l("gitView.commit.addGitmoji")]}),e[32]=V,e[33]=T,e[34]=l,e[35]=q):q=e[35];const W=c||v!==null||b||i===0;let _;e[36]!==l?(_=l("gitView.commit.generateAria"),e[36]=l,e[37]=_):_=e[37];let S;e[38]!==c?(S=c?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"ai-generate-2",className:"size-4 text-primary"}),e[38]=c,e[39]=S):S=e[39];let K;e[40]!==l?(K=l("gitView.commit.generate"),e[40]=l,e[41]=K):K=e[41];let R;e[42]!==K?(R=t.jsx("span",{className:"commit-actions__label",children:K}),e[42]=K,e[43]=R):R=e[43];let U;e[44]!==d||e[45]!==W||e[46]!==_||e[47]!==S||e[48]!==R?(U=t.jsxs(X,{variant:"outline",size:"sm",onClick:d,disabled:W,type:"button","aria-label":_,className:"commit-actions__btn",children:[S,R]}),e[44]=d,e[45]=W,e[46]=_,e[47]=S,e[48]=R,e[49]=U):U=e[49];let J;e[50]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx("div",{className:"flex-1"}),e[50]=J):J=e[50];const Z=!D||c;let ee;e[51]!==l?(ee=l("gitView.commit.commitAria"),e[51]=l,e[52]=ee):ee=e[52];let Y;e[53]!==v||e[54]!==l?(Y=v==="commit"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label",children:l("gitView.commit.committing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"git-commit",className:"size-4"}),t.jsx("span",{className:"commit-actions__label",children:l("gitView.commit.commit")})]}),e[53]=v,e[54]=l,e[55]=Y):Y=e[55];let n;e[56]!==p||e[57]!==Z||e[58]!==ee||e[59]!==Y?(n=t.jsx(X,{size:"sm",variant:"outline",onClick:p,disabled:Z,className:"commit-actions__btn whitespace-nowrap","aria-label":ee,children:Y}),e[56]=p,e[57]=Z,e[58]=ee,e[59]=Y,e[60]=n):n=e[60];let o;e[61]!==D||e[62]!==v||e[63]!==c||e[64]!==M||e[65]!==N||e[66]!==k||e[67]!==l?(o=M?t.jsxs(Qe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsx(X,{variant:"default",size:"sm",onClick:()=>k(),disabled:!D||c||N,className:"h-7 w-7 p-0","aria-label":l("gitView.commit.pushAria"),children:v==="commitAndPush"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"arrow-up",className:"size-3.5"})})}),t.jsx(et,{side:"top",children:t.jsx("p",{children:l("gitView.commit.push")})})]}):t.jsx(X,{size:"sm",variant:"default",onClick:()=>k(),disabled:!D||c||N,className:"commit-actions__btn","aria-label":l("gitView.commit.pushAria"),children:v==="commitAndPush"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:l("gitView.commit.pushing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"arrow-up",className:"size-3.5"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:l("gitView.commit.push")})]})}),e[61]=D,e[62]=v,e[63]=c,e[64]=M,e[65]=N,e[66]=k,e[67]=l,e[68]=o):o=e[68];let s;e[69]!==U||e[70]!==n||e[71]!==o?(s=t.jsxs("div",{className:"@container/commit-actions flex items-center gap-2 min-w-0",children:[U,J,n,o]}),e[69]=U,e[70]=n,e[71]=o,e[72]=s):s=e[72];let x;e[73]!==G||e[74]!==q||e[75]!==s||e[76]!==P?(x=t.jsxs("div",{className:"flex flex-col gap-3 px-0 pt-1 pb-3",children:[P,G,q,s]}),e[73]=G,e[74]=q,e[75]=s,e[76]=P,e[77]=x):x=e[77];let I;return e[78]!==x||e[79]!==y?(I=t.jsxs("section",{className:"border-0 bg-transparent rounded-none",children:[y,x]}),e[78]=x,e[79]=y,e[80]=I):I=e[80],I},Ai=f=>{const e=pe.c(150),{open:i,onOpenChange:a,conflictFiles:h,directory:u,operation:m,onAbort:d,onClearState:c,onNavigatedToChat:p}=f;let k;e[0]!==h?(k=h===void 0?[]:h,e[0]=h,e[1]=k):k=e[1];const v=k,{t:r}=de(),A=tt(ni),V=tt(ai),T=it(li),N=it(oi),[b,l]=w.useState(!1),[g,F]=w.useState(null),[D,M]=w.useState(null);let B,z;e[2]!==u||e[3]!==i||e[4]!==r?(B=()=>{!i||!u||(l(!0),M(null),F(null),It(u).then(se=>{F(se)}).catch(se=>{const me=se instanceof Error?se.message:r("gitView.conflict.loadFailed");M(me)}).finally(()=>{l(!1)}))},z=[i,u,r],e[2]=u,e[3]=i,e[4]=r,e[5]=B,e[6]=z):(B=e[5],z=e[6]),w.useEffect(B,z);let O;e[7]!==g||e[8]!==u||e[9]!==m?(O=async()=>{if(!g)return null;const se=m==="merge"?"merge":"rebase",me=g.headInfo||(m==="merge"?"MERGE_HEAD":"REBASE_HEAD"),ve=m==="merge"?"git commit --no-edit":"git rebase --continue",Ie=await st("git.conflict.resolve.visible",{operation_label:se,head_ref:me}),fe=await st("git.conflict.resolve.instructions",{operation_label:se,directory:u,operation:m,head_info:g.headInfo||"N/A",continue_cmd:ve}),he=`${se} conflict context (JSON)
2
2
  ${JSON.stringify({directory:u,operation:g.operation,headInfo:g.headInfo,statusPorcelain:g.statusPorcelain,unmergedFiles:g.unmergedFiles,diff:g.diff},null,2)}`;return{visibleText:Ie,instructionsText:fe,payloadText:he}},e[7]=g,e[8]=u,e[9]=m,e[10]=O):O=e[10];const C=O;let y;e[11]!==d||e[12]!==a?(y=()=>{d(),a(!1)},e[11]=d,e[12]=a,e[13]=y):y=e[13];const P=y;let j;e[14]!==c||e[15]!==a?(j=()=>{c?.(),a(!1)},e[14]=c,e[15]=a,e[16]=j):j=e[16];const E=j;let H;e[17]!==C||e[18]!==V||e[19]!==c||e[20]!==p||e[21]!==a||e[22]!==T||e[23]!==N||e[24]!==r?(H=async()=>{const se=await C();if(!se){ge.error(r("gitView.conflict.noDetailsAvailable"));return}if(!V){ge.error(r("gitView.conflict.noActiveSession"),{description:r("gitView.conflict.noActiveSessionDescription")});return}T(se.visibleText,"replace"),N([{text:se.instructionsText,synthetic:!0},{text:se.payloadText,synthetic:!0}]),c?.(),a(!1),p?.()},e[17]=C,e[18]=V,e[19]=c,e[20]=p,e[21]=a,e[22]=T,e[23]=N,e[24]=r,e[25]=H):H=e[25];const G=H;let q;e[26]!==C||e[27]!==u||e[28]!==c||e[29]!==p||e[30]!==a||e[31]!==A||e[32]!==r?(q=async()=>{const se=await C();if(!se){ge.error(r("gitView.conflict.noDetailsAvailable"));return}A({directoryOverride:u,initialPrompt:se.visibleText,syntheticParts:[{text:se.instructionsText,synthetic:!0},{text:se.payloadText,synthetic:!0}]}),c?.(),a(!1),p?.()},e[26]=C,e[27]=u,e[28]=c,e[29]=p,e[30]=a,e[31]=A,e[32]=r,e[33]=q):q=e[33];const W=q;let _,S,K,R,U,J,Z,ee,Y,n,o,s,x,I,L,ie,Q,ne,te,oe,re,ue;if(e[34]!==g||e[35]!==v||e[36]!==V||e[37]!==P||e[38]!==E||e[39]!==G||e[40]!==W||e[41]!==b||e[42]!==D||e[43]!==a||e[44]!==i||e[45]!==m||e[46]!==r){const se=r(m==="merge"?"gitView.operation.merge":"gitView.operation.rebase"),me=g?.unmergedFiles||v;K=De,re=i,ue=a,S=Ee,oe="max-w-md w-[calc(100vw-2rem)]",I="flex flex-col gap-4 overflow-hidden";let ve;e[69]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx($,{name:"alert",className:"size-5 shrink-0 text-[var(--status-warning)]"}),e[69]=ve):ve=e[69];const Ie=t.jsxs("div",{className:"flex items-center gap-2",children:[ve,t.jsx(ze,{children:r("gitView.conflict.detectedTitle",{operation:se})})]});let fe;e[70]!==m||e[71]!==r?(fe=r("gitView.conflict.detectedDescription",{operation:m}),e[70]=m,e[71]=r,e[72]=fe):fe=e[72];let he;e[73]!==fe?(he=t.jsx(Re,{children:fe}),e[73]=fe,e[74]=he):he=e[74],e[75]!==Ie||e[76]!==he?(L=t.jsxs(Te,{children:[Ie,he]}),e[75]=Ie,e[76]=he,e[77]=L):L=e[77],e[78]!==b||e[79]!==r?(ie=b&&t.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-muted-foreground",children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"typography-meta",children:r("gitView.conflict.loading")})]}),e[78]=b,e[79]=r,e[80]=ie):ie=e[80],e[81]!==D||e[82]!==r?(Q=D&&t.jsx("div",{className:"rounded-lg bg-[var(--status-error-bg)] p-3 text-[var(--status-error)] typography-meta break-words",children:r("gitView.conflict.errorLoadingDetails",{message:D})}),e[81]=D,e[82]=r,e[83]=Q):Q=e[83],e[84]!==me||e[85]!==r?(ne=me.length>0&&t.jsxs("div",{className:"space-y-2 overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:r("gitView.conflict.conflictedFiles")}),t.jsx("span",{className:"typography-micro px-1.5 py-0.5 rounded bg-[var(--surface-elevated)] text-muted-foreground",children:me.length})]}),t.jsx("div",{className:"bg-[var(--surface-elevated)] rounded-lg p-3 max-h-40 overflow-y-auto overflow-x-hidden",children:t.jsx("ul",{className:"space-y-1",children:me.map(ri)})})]}),e[84]=me,e[85]=r,e[86]=ne):ne=e[86],e[87]!==g||e[88]!==r?(te=g?.headInfo&&t.jsxs("div",{className:"space-y-1 overflow-hidden",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:r("gitView.conflict.headInfo")}),t.jsx("div",{className:"typography-micro text-foreground font-mono bg-[var(--surface-elevated)] rounded-lg p-3 max-h-24 overflow-y-auto break-words whitespace-pre-wrap",children:g.headInfo})]}),e[87]=g,e[88]=r,e[89]=te):te=e[89],o="flex flex-col gap-2 pt-2";let we;e[90]!==W?(we=()=>{W()},e[90]=W,e[91]=we):we=e[91];const Ge=b||!g;let je;e[92]!==b?(je=b?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"add",className:"size-4"}),e[92]=b,e[93]=je):je=e[93];let Ne;e[94]!==r?(Ne=r("gitView.conflict.resolveNewSession"),e[94]=r,e[95]=Ne):Ne=e[95],e[96]!==we||e[97]!==Ge||e[98]!==je||e[99]!==Ne?(s=t.jsxs(X,{variant:"default",onClick:we,disabled:Ge,className:"w-full gap-2",children:[je,Ne]}),e[96]=we,e[97]=Ge,e[98]=je,e[99]=Ne,e[100]=s):s=e[100];let Ce;e[101]!==G?(Ce=()=>{G()},e[101]=G,e[102]=Ce):Ce=e[102];const _e=b||!g||!V;let Se;e[103]!==b?(Se=b?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"chat-1",className:"size-4"}),e[103]=b,e[104]=Se):Se=e[104];let Ve;e[105]!==r?(Ve=r("gitView.conflict.resolveCurrentSession"),e[105]=r,e[106]=Ve):Ve=e[106],e[107]!==Ce||e[108]!==_e||e[109]!==Se||e[110]!==Ve?(x=t.jsxs(X,{variant:"outline",onClick:Ce,disabled:_e,className:"w-full gap-2",children:[Se,Ve]}),e[107]=Ce,e[108]=_e,e[109]=Se,e[110]=Ve,e[111]=x):x=e[111],Y="flex gap-2 pt-1";let ke;e[112]!==r?(ke=r("gitView.conflict.continueLater"),e[112]=r,e[113]=ke):ke=e[113],e[114]!==E||e[115]!==ke?(n=t.jsx(X,{variant:"ghost",size:"sm",onClick:E,className:"flex-1",children:ke}),e[114]=E,e[115]=ke,e[116]=n):n=e[116],_=X,R="destructive",U="sm",J=P,Z="flex-1",ee=r("gitView.conflict.abortOperation",{operation:se}),e[34]=g,e[35]=v,e[36]=V,e[37]=P,e[38]=E,e[39]=G,e[40]=W,e[41]=b,e[42]=D,e[43]=a,e[44]=i,e[45]=m,e[46]=r,e[47]=_,e[48]=S,e[49]=K,e[50]=R,e[51]=U,e[52]=J,e[53]=Z,e[54]=ee,e[55]=Y,e[56]=n,e[57]=o,e[58]=s,e[59]=x,e[60]=I,e[61]=L,e[62]=ie,e[63]=Q,e[64]=ne,e[65]=te,e[66]=oe,e[67]=re,e[68]=ue}else _=e[47],S=e[48],K=e[49],R=e[50],U=e[51],J=e[52],Z=e[53],ee=e[54],Y=e[55],n=e[56],o=e[57],s=e[58],x=e[59],I=e[60],L=e[61],ie=e[62],Q=e[63],ne=e[64],te=e[65],oe=e[66],re=e[67],ue=e[68];let le;e[117]!==_||e[118]!==R||e[119]!==U||e[120]!==J||e[121]!==Z||e[122]!==ee?(le=t.jsx(_,{variant:R,size:U,onClick:J,className:Z,children:ee}),e[117]=_,e[118]=R,e[119]=U,e[120]=J,e[121]=Z,e[122]=ee,e[123]=le):le=e[123];let ce;e[124]!==Y||e[125]!==n||e[126]!==le?(ce=t.jsxs("div",{className:Y,children:[n,le]}),e[124]=Y,e[125]=n,e[126]=le,e[127]=ce):ce=e[127];let xe;e[128]!==o||e[129]!==s||e[130]!==x||e[131]!==ce?(xe=t.jsxs("div",{className:o,children:[s,x,ce]}),e[128]=o,e[129]=s,e[130]=x,e[131]=ce,e[132]=xe):xe=e[132];let ye;e[133]!==I||e[134]!==L||e[135]!==ie||e[136]!==Q||e[137]!==ne||e[138]!==te||e[139]!==xe?(ye=t.jsxs("div",{className:I,children:[L,ie,Q,ne,te,xe]}),e[133]=I,e[134]=L,e[135]=ie,e[136]=Q,e[137]=ne,e[138]=te,e[139]=xe,e[140]=ye):ye=e[140];let be;e[141]!==S||e[142]!==oe||e[143]!==ye?(be=t.jsx(S,{className:oe,children:ye}),e[141]=S,e[142]=oe,e[143]=ye,e[144]=be):be=e[144];let Oe;return e[145]!==K||e[146]!==re||e[147]!==ue||e[148]!==be?(Oe=t.jsx(K,{open:re,onOpenChange:ue,children:be}),e[145]=K,e[146]=re,e[147]=ue,e[148]=be,e[149]=Oe):Oe=e[149],Oe};function ni(f){return f.openNewSessionDraft}function ai(f){return f.currentSessionId}function li(f){return f.setPendingInputText}function oi(f){return f.setPendingSyntheticParts}function ri(f){return t.jsx("li",{className:"typography-micro text-foreground font-mono truncate block",title:f,children:f},f)}const Ii=({open:f,onOpenChange:e,targetBranch:i,changedFileCount:a,onCommitAndSwitch:h,onGenerateMessage:u,onRevertAndSwitch:m})=>{const{t:d}=de(),[c,p]=w.useState(""),[k,v]=w.useState(null),[r,A]=w.useState(!1),V=k!==null;w.useEffect(()=>{f||(p(""),A(!1))},[f]);const T=async()=>{v("generate");try{const l=await u();l&&p(l)}catch(l){ge.error(l instanceof Error?l.message:d("gitView.dirtySwitch.actionFailed"))}finally{v(null)}},N=async()=>{v("commit");try{let l=c.trim();if(!l){if(l=(await u()).trim(),!l){ge.error(d("gitView.toast.enterCommitMessage"));return}p(l)}await h(l,r)}catch(l){ge.error(l instanceof Error?l.message:d("gitView.dirtySwitch.actionFailed"))}finally{v(null)}},b=async()=>{v("revert");try{await m()}catch(l){ge.error(l instanceof Error?l.message:d("gitView.dirtySwitch.actionFailed"))}finally{v(null)}};return t.jsx(De,{open:f,onOpenChange:l=>{V||e(l)},children:t.jsx(Ee,{className:"max-w-md w-[calc(100vw-2rem)]",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs(Te,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($,{name:"alert",className:"size-5 shrink-0 text-[var(--status-warning)]"}),t.jsx(ze,{children:d("gitView.dirtySwitch.title")})]}),t.jsx(Re,{children:a===1?d("gitView.dirtySwitch.descriptionSingle",{branch:i}):d("gitView.dirtySwitch.descriptionPlural",{branch:i,count:a})})]}),t.jsxs("div",{className:"oc-raised oc-field flex items-center gap-2 rounded-lg px-3 py-2",children:[t.jsx("input",{value:c,onChange:l=>p(l.target.value),placeholder:d("gitView.commit.messagePlaceholder"),disabled:V,onKeyDown:l=>{l.key==="Enter"&&!V&&(l.preventDefault(),N())},className:"min-w-0 flex-1 bg-transparent typography-meta text-foreground outline-none placeholder:text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>{T()},disabled:V,"aria-label":d("gitView.commit.generate"),title:d("gitView.commit.generate"),className:"shrink-0 text-muted-foreground hover:text-foreground disabled:opacity-50",children:k==="generate"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"ai-generate-2",className:"size-4 text-primary"})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Dt,{checked:r,onChange:A,disabled:V,ariaLabel:d("gitView.dirtySwitch.pushAfterCommit")}),t.jsx("span",{className:"typography-ui-label text-foreground cursor-pointer select-none",onClick:()=>!V&&A(!r),children:d("gitView.dirtySwitch.pushAfterCommit")})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(X,{variant:"destructive",size:"sm",onClick:()=>{b()},disabled:V,className:"gap-2",children:[k==="revert"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):null,d("gitView.dirtySwitch.revertAndSwitch")]}),t.jsxs(X,{variant:"default",size:"sm",onClick:()=>{N()},disabled:V,className:"gap-2",children:[k==="commit"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):null,d("gitView.dirtySwitch.commitAndSwitch")]})]})]})})})},Xe="max-w-none",ci="flex flex-wrap items-center gap-2",jt=f=>{const e=pe.c(6),{error:i,children:a}=f,h=i?"alert":void 0,u=i&&"text-[var(--status-error)]";let m;e[0]!==u?(m=ae($e,u),e[0]=u,e[1]=m):m=e[1];let d;return e[2]!==a||e[3]!==h||e[4]!==m?(d=t.jsx("p",{role:h,className:m,children:a}),e[2]=a,e[3]=h,e[4]=m,e[5]=d):d=e[5],d},di=f=>{if(!f||f.target.operation!=="checkout-hydration")return[];const e=[...f.target.requirements],i=[...(f.hydration?.submodules??[]).map(a=>({kind:"submodule",item:a})),...(f.hydration?.lfs??[]).map(a=>({kind:"lfs",item:a}))];for(const{kind:a,item:h}of i){const u=h.endpoint;u&&(e.some(m=>m.kind===a&&m.path===h.path&&m.endpoint.fingerprint===u.fingerprint)||e.push({kind:a,path:h.path,endpoint:u}))}return e},mi=f=>{const e=pe.c(45),{directory:i,className:a}=f,{t:h}=de(),{git:u,sourceControl:m}=dt(),d=mt(i,m),c=Ae(fi),p=Ae(hi),k=ut(),v=ft(pi),[r,A]=w.useState(""),[V,T]=w.useState(!1),N=w.useRef(0);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>(N.current=N.current+1,A(""),T(!1),()=>{N.current=N.current+1}),e[0]=b):b=e[0];let l;e[1]!==d.scope||e[2]!==u||e[3]!==m?(l=[d.scope,u,m],e[1]=d.scope,e[2]=u,e[3]=m,e[4]=l):l=e[4],w.useLayoutEffect(b,l);const g=d.read;let F;e[5]!==k?(F=G=>bt(G)&&gt(G,k),e[5]=k,e[6]=F):F=e[6];let D;e[7]!==c||e[8]!==p||e[9]!==F?(D=ht(c,p,F),e[7]=c,e[8]=p,e[9]=F,e[10]=D):D=e[10];const M=D;let B,z,O,C,y,P,j;if(e[11]!==a||e[12]!==i||e[13]!==u||e[14]!==c||e[15]!==M||e[16]!==r||e[17]!==g||e[18]!==v||e[19]!==m||e[20]!==h){z=Symbol.for("react.early_return_sentinel");e:{const G=g?Et(g):null,q=G?.providers[0]?.primaryRemote??G?.remotes[0]?.name??"origin",W=(g?.repository.remotes??[]).filter(S=>S.name!==q&&G?.remotes.find(K=>K.name===S.name)?.readiness!=="ready"),_=async(S,K)=>{if(r)return;const R=N.current,U=He(),J=()=>N.current===R&&U===He();A(S),T(!1);const Z=await Kt({directory:i,identity:K,remoteName:S},{git:u,sourceControl:m});J()&&(Z.status!=="applied"&&T(!0),A(""))};if(!W.length||!u.configureTransportBinding){z=null;break e}B=xt,e[28]!==h?(O=h("gitView.remotes.title"),e[28]=h,e[29]=O):O=e[29],e[30]!==h?(C=h("gitView.remotes.description"),e[30]=h,e[31]=C):C=e[31],e[32]!==a?(y=ae("min-w-0",a),e[32]=a,e[33]=y):y=e[33],P=yt,j=W.map(S=>{const K=pt(S.fetch.displayUrl);return t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate typography-ui-label text-foreground",children:S.name}),t.jsx("p",{className:ae($e,"truncate"),title:S.fetch.displayUrl,children:S.fetch.displayUrl})]}),t.jsx(vt,{activeProfile:null,identities:M,onSelect:R=>{_(S.name,R)},isApplying:r===S.name,applicability:R=>wt(R,K),triggerClassName:"shrink-0 border border-border",onOpen:()=>{v(m,c.map(gi))}})]},S.name)})}e[11]=a,e[12]=i,e[13]=u,e[14]=c,e[15]=M,e[16]=r,e[17]=g,e[18]=v,e[19]=m,e[20]=h,e[21]=B,e[22]=z,e[23]=O,e[24]=C,e[25]=y,e[26]=P,e[27]=j}else B=e[21],z=e[22],O=e[23],C=e[24],y=e[25],P=e[26],j=e[27];if(z!==Symbol.for("react.early_return_sentinel"))return z;let E;e[34]!==V||e[35]!==h?(E=V?t.jsx(jt,{error:!0,children:h("settings.gitlab.status.operationFailed")}):null,e[34]=V,e[35]=h,e[36]=E):E=e[36];let H;return e[37]!==B||e[38]!==E||e[39]!==O||e[40]!==C||e[41]!==y||e[42]!==P||e[43]!==j?(H=t.jsxs(B,{title:O,description:C,className:y,contentClassName:P,children:[j,E]}),e[37]=B,e[38]=E,e[39]=O,e[40]=C,e[41]=y,e[42]=P,e[43]=j,e[44]=H):H=e[44],H},ui=({directory:f,className:e})=>{const{t:i}=de(),{git:a,sourceControl:h}=dt(),u=mt(f,h),m=Mt(f,a,h),[d,c]=w.useState(""),[p,k]=w.useState(""),[v,r]=w.useState(null),[A,V]=w.useState(!1),[T,N]=w.useState(!1),[b,l]=w.useState(!1),g=w.useRef(0),F=Ae(s=>s.profiles),D=Ae(s=>s.globalIdentity),M=Ae(s=>s.loadProfiles),B=Ae(s=>s.loadGlobalIdentity),z=ut(),O=ft(s=>s.refreshIdentityAccounts),C=Tt(f),y=m.entry?.reads.at(-1)?.operation,P=y?.target.operation==="checkout-hydration"&&y.target.remote.name===d?di(y):[],j=P.find(s=>JSON.stringify([s.kind,s.path,s.endpoint.fingerprint])===p),E=u.read,H=E?.repository.remotes.find(s=>s.name===d),G=j&&E?.binding?.auxiliary.find(s=>s.kind===j.kind&&s.endpoint.fingerprint===j.endpoint.fingerprint);w.useLayoutEffect(()=>(g.current+=1,c(""),k(""),r(null),V(!1),N(!1),l(!1),()=>{g.current+=1}),[u.scope,a,h]),w.useLayoutEffect(()=>{},[j?.endpoint.fingerprint]),w.useEffect(()=>{b&&(M(),B())},[M,B,b]);const q=w.useMemo(()=>ht(F,D,s=>bt(s)&&gt(s,z)),[z,F,D]),W=j?.endpoint.displayUrl??"",_=w.useMemo(()=>W?pt(W):null,[W]),S=w.useCallback(s=>_?wt(s,_):{applicable:!0},[_]),K=w.useMemo(()=>{const s=q.filter(I=>S(I).applicable);return(C?.userName&&C.userEmail?s.find(I=>I.userName===C.userName&&I.userEmail===C.userEmail):void 0)??s.find(I=>I.account&&_?.host&&zt(I.account.instance)===_.host)??null},[S,q,_,C]),R=(v?.endpoint===j?.endpoint.fingerprint?q.find(s=>s.id===v?.id):null)??K,U=R?Lt(R):null,J=!!(u.status==="ready"&&E?.binding&&H&&j&&a.configureAuxiliaryBinding&&!A&&R&&S(R).applicable&&(U!=="account"||R?.account)&&(U!=="ssh"||R?.sshCredentialId)),Z=!!(u.status==="ready"&&G&&H&&a.configureAuxiliaryBinding&&!A),ee=async()=>{if(!d||m.blocked)return;const s=m.start();if(s){N(!1);try{await Ot({directory:f,git:a,sourceControl:h,parentRemoteName:d,onOperation:s.onOperation})}catch(x){x instanceof Pt||N(!0)}finally{s.finish()}}},Y=async s=>{if(s==="configure"&&!J||s==="remove"&&!Z||!u.isCurrent()||!E?.binding||!H||!j||!a.configureAuxiliaryBinding)return;const x=g.current,I=He(),L=()=>g.current===x&&I===He(),ie={directory:f,expectedRepositoryId:E.repository.repositoryId,expectedRevision:E.revision,expectedConfigRevision:E.repository.configRevision,parentRemote:d,expectedParentFingerprint:H.fetch.fingerprint,kind:j.kind,path:j.path,expectedEndpointFingerprint:j.endpoint.fingerprint},Q=s==="remove"?{...ie,operation:s}:R&&Ut(R,ie);if(!Q)return;const ne=Pe.captureMutation(u.scope,E);V(!0),N(!1);try{const te=await a.configureAuxiliaryBinding(Q);Pe.setMutationResult(ne,te.binding)||await Pe.reconcile(ne,h)}catch{L()&&N(!0),await Pe.reconcile(ne,h)}finally{ne.release(),L()&&V(!1)}},n=!!(P.length&&y&&"error"in y&&y.error.code==="AUTHENTICATION_REQUIRED"),o=s=>i(s==="submodule"?"gitView.hydration.kind.submodule":"gitView.hydration.kind.lfs");return t.jsxs(Ht,{open:b,onOpenChange:l,className:ae("min-w-0",e),children:[t.jsxs(Gt,{className:"w-auto justify-start gap-1.5",children:[t.jsx(Rt,{children:i("gitView.hydration.title")}),t.jsx($,{name:b?"arrow-up-s":"arrow-down-s",className:"h-4 w-4 text-muted-foreground"})]}),t.jsx(_t,{children:t.jsxs(xt,{description:i("gitView.hydration.description"),className:"min-w-0 pt-2",contentClassName:yt,children:[t.jsx(Be,{label:i("gitView.hydration.parentRemote"),controlClassName:Xe,children:t.jsxs(nt,{value:d,onValueChange:s=>{c(s),k(""),r(null)},disabled:!E?.binding||A||m.blocked,children:[t.jsx(at,{className:"w-fit max-w-[28ch]","aria-label":i("gitView.hydration.parentRemote"),children:t.jsx(lt,{placeholder:i("settings.sourceControl.transport.remoteLabel")})}),t.jsx(ot,{children:E?.binding?.remotes.filter(s=>s.readiness==="ready").map(s=>t.jsx(rt,{value:s.name,children:s.name},s.name))})]})}),t.jsx(Bt,{entry:m.entry,onRefresh:()=>{m.refresh()},onCancel:()=>{m.cancel()}}),n?t.jsx("p",{className:$e,children:i("gitView.hydration.authorizationNeeded")}):null,P.length?t.jsx(Be,{label:i("gitView.hydration.endpoint"),controlClassName:Xe,children:t.jsxs(nt,{value:p,onValueChange:k,disabled:A,children:[t.jsx(at,{className:"w-fit max-w-[28ch]","aria-label":i("gitView.hydration.endpoint"),children:t.jsx(lt,{placeholder:i("gitView.hydration.chooseEndpoint"),children:j?`${j.path} · ${o(j.kind)} · ${j.endpoint.displayUrl}`:void 0})}),t.jsx(ot,{children:P.map(s=>{const x=JSON.stringify([s.kind,s.path,s.endpoint.fingerprint]);return t.jsxs(rt,{value:x,children:[s.path," · ",o(s.kind)," · ",s.endpoint.displayUrl]},x)})})]})}):null,j?t.jsx(t.Fragment,{children:t.jsx(Be,{label:i("gitView.hydration.identity"),controlClassName:Xe,children:t.jsx(vt,{activeProfile:R,identities:q,onSelect:s=>r({endpoint:j.endpoint.fingerprint,id:s.id}),isApplying:A,applicability:S,triggerClassName:"w-full max-w-none border border-border",menuAlign:"start",onOpen:()=>{O(h,F.map(s=>s.account))}})})}):null,y?.hydration?.status==="client-missing"?t.jsx("p",{role:"alert",className:ae($e,"text-[var(--status-warning)]"),children:i("gitView.hydration.lfsMissing")}):null,T?t.jsx(jt,{error:!0,children:i("settings.gitlab.status.operationFailed")}):null,t.jsxs("div",{className:ci,children:[t.jsx(X,{size:"sm",variant:"outline",disabled:!d||m.blocked||A,onClick:()=>{ee()},children:i("gitView.hydration.retry")}),j?t.jsxs(t.Fragment,{children:[t.jsx(X,{size:"sm",disabled:!J,onClick:()=>{Y("configure")},children:i("settings.common.actions.saveChanges")}),G?t.jsx(X,{size:"sm",variant:"ghost",disabled:!Z,onClick:()=>{Y("remove")},children:i("settings.common.actions.delete")}):null]}):null]})]})})]})};function fi(f){return f.profiles}function hi(f){return f.globalIdentity}function pi(f){return f.refreshIdentityAccounts}function gi(f){return f.account}const Je="border-t border-border/60 pt-4",Di=f=>{const e=pe.c(12),{open:i,onOpenChange:a,directory:h}=f,{t:u}=de(),m=Ft(),d=Me(xi),c=Me(yi);let p;e[0]!==h||e[1]!==m||e[2]!==a||e[3]!==i||e[4]!==c||e[5]!==d||e[6]!==u?(p=i?t.jsxs(Ee,{className:"@container min-w-0 max-h-[85dvh] overflow-y-auto",children:[t.jsxs(Te,{children:[t.jsx(ze,{children:u("gitView.context.configure")}),t.jsx(Re,{children:u("gitView.context.description")})]}),t.jsx(mi,{directory:h,className:Je}),t.jsx(ui,{directory:h,className:Je}),t.jsxs(Ye,{className:Je,children:[t.jsx(X,{size:"sm",variant:"ghost",onClick:()=>{a(!1),d("git"),m?m.openSettings():c(!0)},children:u("gitView.context.settings")}),t.jsx(X,{size:"sm",variant:"outline",onClick:()=>a(!1),children:u("dialog.common.actions.close")})]})]}):null,e[0]=h,e[1]=m,e[2]=a,e[3]=i,e[4]=c,e[5]=d,e[6]=u,e[7]=p):p=e[7];let k;return e[8]!==a||e[9]!==i||e[10]!==p?(k=t.jsx(De,{open:i,onOpenChange:a,children:p}),e[8]=a,e[9]=i,e[10]=p,e[11]=k):k=e[11],k};function xi(f){return f.setSettingsPage}function yi(f){return f.setSettingsDialogOpen}const Ei=({mergeInProgress:f,rebaseInProgress:e,onContinue:i,onAbort:a,onResolveWithAI:h,conflictCount:u=0,isLoading:m=!1})=>{const{t:d}=de(),[c,p]=w.useState(null),k=f&&f.head,v=e&&(e.headName||e.onto),r=k?"merge":v?"rebase":null;if(!r)return null;const A=async()=>{p("continue");try{await i()}finally{p(null)}},V=async()=>{p("abort");try{await a()}finally{p(null)}},T=c!==null,N=u>0,b=d(r==="merge"?"gitView.operation.merge":"gitView.operation.rebase");let l="";f?l=f.message?d("gitView.operation.mergingMessage",{message:f.message}):d("gitView.operation.mergeInProgressWithHead",{head:f.head}):e&&(l=e.headName?d("gitView.operation.rebasingOnto",{headName:e.headName,onto:e.onto||""}):d("gitView.operation.rebaseInProgress"));const g=N?u===1?d("gitView.operation.inProgressTitleOneConflict",{operation:b,count:u}):d("gitView.operation.inProgressTitleManyConflicts",{operation:b,count:u}):d("gitView.operation.inProgressTitle",{operation:b}),F=d(N?"gitView.operation.resolveConflictsHint":"gitView.operation.readyToContinueHint");return t.jsx("div",{className:"mx-4 mt-3 overflow-hidden rounded-lg bg-[var(--status-warning-background)]",children:t.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"typography-label text-[var(--status-warning)]",children:g}),l&&t.jsx("p",{className:"typography-micro break-words text-muted-foreground",children:l})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("p",{className:"typography-micro min-w-[12rem] flex-1 text-muted-foreground",children:F}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t.jsxs(X,{variant:"ghost",size:"sm",onClick:V,disabled:T||m,className:"gap-1.5",children:[c==="abort"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"close",className:"size-4"}),d("gitView.operation.abort")]}),N?h&&t.jsx(X,{variant:"default",size:"sm",onClick:h,disabled:T||m,children:d("gitView.operation.resolveWithAi")}):t.jsxs(X,{variant:"default",size:"sm",onClick:A,disabled:T||m,className:"gap-1.5",children:[c==="continue"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"check",className:"size-4"}),d("gitView.operation.continue")]})]})]})]})})};export{Vi as C,Ii as D,Ei as I,Di as R,ki as a,Ai as b};