@openchamber/web 2.7.0 → 2.7.1-canary.20261108.12

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 (115) hide show
  1. package/dist/assets/{AboutDialog-Bbu8cDW8.js → AboutDialog-uNKjHvzl.js} +1 -1
  2. package/dist/assets/{AboutLogo-sAyRFbrm.js → AboutLogo-BhyG0ENm.js} +1 -1
  3. package/dist/assets/{ArchiveView-DvLmQllR.js → ArchiveView-Jt6Qj8Ry.js} +1 -1
  4. package/dist/assets/{ChangeRequestDiffUnavailable-Ctc-P6zi.js → ChangeRequestDiffUnavailable-CNIWdYRx.js} +1 -1
  5. package/dist/assets/{ChangedPathLabel-CQOXgkIF.js → ChangedPathLabel-CCsE-8p4.js} +1 -1
  6. package/dist/assets/{CommandPalette-DHk0MqYi.js → CommandPalette-DrsFSbmk.js} +1 -1
  7. package/dist/assets/{DiffView-DPpu52DA.js → DiffView-DwaJOPUe.js} +1 -1
  8. package/dist/assets/{FilesView-CPrroDyU.js → FilesView-Hvxe_KqA.js} +4 -4
  9. package/dist/assets/{GitView-wWoZ95Yt.js → GitView-ZI_EafL9.js} +1 -1
  10. package/dist/assets/{GuestSurfacePane-BsMH8QjU.js → GuestSurfacePane-Ds8luSO0.js} +1 -1
  11. package/dist/assets/{HelpDialog-BZtzVj6Z.js → HelpDialog-DtZKoPZE.js} +1 -1
  12. package/dist/assets/{IntegrationsCatalogView-DJAOTlcc.js → IntegrationsCatalogView-DgdYlI3Z.js} +1 -1
  13. package/dist/assets/{JsonTreeView-BXv2HzlC.js → JsonTreeView-zAv-pn0X.js} +1 -1
  14. package/dist/assets/{MarkdownDiffPreview-CseaChSt.js → MarkdownDiffPreview-Bf9-WPy9.js} +1 -1
  15. package/dist/assets/{MarkdownRendererImpl-CyXOMsMS.js → MarkdownRendererImpl-w7LnAwp_.js} +4 -4
  16. package/dist/assets/{MemoryDebugPanel-xYvjTjLG.js → MemoryDebugPanel-ylQytlyw.js} +1 -1
  17. package/dist/assets/{NoteEditor-Bbrtl8rq.js → NoteEditor-0HEW8KrY.js} +1 -1
  18. package/dist/assets/{OfficeDocumentDiff-DXsfJnFq.js → OfficeDocumentDiff-BFr4rAHy.js} +1 -1
  19. package/dist/assets/{OnboardingScreen-DuWvo16v.js → OnboardingScreen-Bpj6hpDe.js} +1 -1
  20. package/dist/assets/{OpenCodeStatusDialog-9WRgjgWL.js → OpenCodeStatusDialog-CX3oxFSb.js} +1 -1
  21. package/dist/assets/{OverviewView-BzA9rGEs.js → OverviewView-UfIFJ3mf.js} +1 -1
  22. package/dist/assets/{PatchDiff-DVcyjZVm.js → PatchDiff-DC4ydsOW.js} +1 -1
  23. package/dist/assets/{PlanView-BGdba90K.js → PlanView-CgoTn3HJ.js} +1 -1
  24. package/dist/assets/{ProjectActionsDialog-ByPMdwFG.js → ProjectActionsDialog-B16N4lqs.js} +1 -1
  25. package/dist/assets/{ReplyCommand-pviKPDT8.js → ReplyCommand-CnDNvFmd.js} +1 -1
  26. package/dist/assets/{ReplyUiBlock-D7HPBgmq.js → ReplyUiBlock-BsOTgv8M.js} +1 -1
  27. package/dist/assets/{ReviewCards-CU1YHZkQ.js → ReviewCards-BkpTYy_a.js} +1 -1
  28. package/dist/assets/{RunOverview-uFEfusCK.js → RunOverview-DsffX3fI.js} +1 -1
  29. package/dist/assets/{ScheduledTasksDialog-J8i_b433.js → ScheduledTasksDialog-DgrAfpeX.js} +1 -1
  30. package/dist/assets/{SettingsView-CaUgulkI.js → SettingsView-B804XZvl.js} +1 -1
  31. package/dist/assets/{SettingsWindow-BVEVntuV.js → SettingsWindow-k5FSMAzV.js} +1 -1
  32. package/dist/assets/{SidebarSectionsManager-CIXOcE0-.js → SidebarSectionsManager-DH61-mRe.js} +1 -1
  33. package/dist/assets/{SourceBoardView-BW1OSOo1.js → SourceBoardView-BvGoSNer.js} +1 -1
  34. package/dist/assets/{SpaceAccessDialog-6GhzlMD8.js → SpaceAccessDialog-DHNqUzKD.js} +1 -1
  35. package/dist/assets/{SpaceApplyDialog-zB4jAExK.js → SpaceApplyDialog-DEOTeEjy.js} +1 -1
  36. package/dist/assets/{SpaceRow-C6QD41XF.js → SpaceRow-CBva6ofM.js} +1 -1
  37. package/dist/assets/{SpaceSetupOutput-6GuKiRed.js → SpaceSetupOutput-C4NhRkjl.js} +1 -1
  38. package/dist/assets/{SpacesView-BgncMV45.js → SpacesView-BGevrpQp.js} +1 -1
  39. package/dist/assets/{SubmoduleDiffSummary-BwVdGw0c.js → SubmoduleDiffSummary-Bebhaz7n.js} +1 -1
  40. package/dist/assets/{ToolOutputDialog-CC9hcX2C.js → ToolOutputDialog-B1gU22Tz.js} +1 -1
  41. package/dist/assets/{ToolPartDiffPreview-D15Ja459.js → ToolPartDiffPreview-CVy_zn_m.js} +1 -1
  42. package/dist/assets/{UiBlock-pyLxOJr6.js → UiBlock-C11qZK5T.js} +2 -2
  43. package/dist/assets/{UsageStatsView-CMf29PeL.js → UsageStatsView-CNm8WPSk.js} +1 -1
  44. package/dist/assets/{WalkthroughView-DeuNxpZ7.js → WalkthroughView-Bbwyk6rg.js} +1 -1
  45. package/dist/assets/{WorktreesView-jHcQwWBH.js → WorktreesView-BGIfERNs.js} +1 -1
  46. package/dist/assets/{appThemeRegistry-BwyM6n38.js → appThemeRegistry-DYzVI9tX.js} +1 -1
  47. package/dist/assets/{ar-DnPStsLU.js → ar-CT3AuXVj.js} +1 -1
  48. package/dist/assets/{codeHighlight-C7ZRQ5-2.js → codeHighlight-BcDjh6yS.js} +1 -1
  49. package/dist/assets/{columnWidthMemory-Cbfh5HD5.js → columnWidthMemory-BA6h4J11.js} +1 -1
  50. package/dist/assets/{computeVirtualFileMetrics-DVynfSBh.js → computeVirtualFileMetrics-DVfKKHny.js} +2 -2
  51. package/dist/assets/{contextFileOpenGuard-CKnYjgFC.js → contextFileOpenGuard-BC79wuu1.js} +1 -1
  52. package/dist/assets/{date-time-qS8d5iiz.js → date-time-DhfjtTnp.js} +1 -1
  53. package/dist/assets/{de-SUU4F7Nt.js → de-BdVTH897.js} +1 -1
  54. package/dist/assets/{documentClient-B0iRikhq.js → documentClient-JcxJ7vyh.js} +2 -2
  55. package/dist/assets/{documentExport-Cf0gMwM0.js → documentExport-C830mU4N.js} +1 -1
  56. package/dist/assets/{documentHost-cOykm7qf.js → documentHost-DKm0U_q_.js} +1 -1
  57. package/dist/assets/{es-BWlkhnKy.js → es-BFk4dosu.js} +1 -1
  58. package/dist/assets/{fileContentPoller-CKcqqhzG.js → fileContentPoller-BmcApnk-.js} +1 -1
  59. package/dist/assets/{flexokiTheme-deI9tWCZ.js → flexokiTheme-BMYGLHbL.js} +1 -1
  60. package/dist/assets/{fr-DN3Tx1EV.js → fr-CeExWqT9.js} +1 -1
  61. package/dist/assets/{he-B-7jIB_R.js → he-C_O5IfNH.js} +1 -1
  62. package/dist/assets/{highlights-B2Re-VTM.js → highlights-CIuWBj_n.js} +1 -1
  63. package/dist/assets/{index-D5Ed7hon.js → index-bD6u6GDm.js} +1 -1
  64. package/dist/assets/{initializeSharedPreferences-D5FLPdpI.js → initializeSharedPreferences-BcnhlF3e.js} +1 -1
  65. package/dist/assets/{install-sOrZWWGd.js → install-CSoRI5iX.js} +1 -1
  66. package/dist/assets/{install-request-C-zhz88k.js → install-request-EHX4ORhb.js} +1 -1
  67. package/dist/assets/{isDiffPlainText-DpcjRlB-.js → isDiffPlainText-saKoOWJx.js} +1 -1
  68. package/dist/assets/{isFilePlainText-DJ_bXU7C.js → isFilePlainText-DOjSDWo3.js} +1 -1
  69. package/dist/assets/{ja-DE4Yf-rX.js → ja-BlUqUBMY.js} +1 -1
  70. package/dist/assets/{katex.min-g52ii4Gs.js → katex.min-Bs5OLoA1.js} +4 -4
  71. package/dist/assets/{ko-CETaCyB8.js → ko-CGv47dWq.js} +1 -1
  72. package/dist/assets/{main-QRYvDkRZ.js → main-064y5MQB.js} +4 -4
  73. package/dist/assets/{main-89VT8Kff.js → main-D8yzv2tL.js} +2 -2
  74. package/dist/assets/{miniChat-CgHPqY7Z.js → miniChat-X7g2IHQj.js} +2 -2
  75. package/dist/assets/{mobile-BQrjPA_e.js → mobile-B5efB3tI.js} +2 -2
  76. package/dist/assets/{moveWorkspacePath-C4_JgpNC.js → moveWorkspacePath-BaEfuU4S.js} +1 -1
  77. package/dist/assets/{nl-CL94_9kf.js → nl-CavtTtNf.js} +1 -1
  78. package/dist/assets/{officeDocument-COfYG-XF.js → officeDocument-CQScRmC1.js} +1 -1
  79. package/dist/assets/{parseDiffFromFile-CD1h9Yf5.js → parseDiffFromFile-By5H8w4y.js} +1 -1
  80. package/dist/assets/{pierreDiffTint-Cg024Eeg.js → pierreDiffTint-CVm_qZm-.js} +1 -1
  81. package/dist/assets/{pl-Bk1GuZBm.js → pl-BQZVI44N.js} +1 -1
  82. package/dist/assets/{pt-BR-Bfrsw-GS.js → pt-BR-iqkU-MRA.js} +1 -1
  83. package/dist/assets/{relocateRestoredSession-C79EVzC-.js → relocateRestoredSession-CsK2RUM_.js} +2 -2
  84. package/dist/assets/{renderElectronMiniChatApp-lMVP5gEt.js → renderElectronMiniChatApp-DzVezwky.js} +2 -2
  85. package/dist/assets/{renderMarkdownForExport-DTutihQz.js → renderMarkdownForExport-BM19JOji.js} +1 -1
  86. package/dist/assets/{renderMobileApp-CmYW0oos.js → renderMobileApp-CiTrtu6R.js} +3 -3
  87. package/dist/assets/{resolveLanguages-lTTkQHer.js → resolveLanguages-DQXSOQcc.js} +1 -1
  88. package/dist/assets/{runtimeEndpointReset-BJm_77m2.js → runtimeEndpointReset-DiTyBUwe.js} +5 -5
  89. package/dist/assets/{scheduledTasksApi-CKPLiwD-.js → scheduledTasksApi-Z7dc8sXS.js} +1 -1
  90. package/dist/assets/{shiki-CQYsk6Az.js → shiki-DW-V1SDr.js} +1 -1
  91. package/dist/assets/{space-apply-BT-PjBF5.js → space-apply-8YUOtYvk.js} +1 -1
  92. package/dist/assets/{space-close-C1Qs6EK6.js → space-close-D7zK_obq.js} +1 -1
  93. package/dist/assets/{spaceNetwork-C14OnxrT.js → spaceNetwork-XStNVwJo.js} +1 -1
  94. package/dist/assets/{stream-tokenizer-xdyY_PEd.js → stream-tokenizer-BfPOSMyw.js} +1 -1
  95. package/dist/assets/{textMateThemeFromAppTheme-CRhUx8P-.js → textMateThemeFromAppTheme-CVOJt2hL.js} +1 -1
  96. package/dist/assets/{tr-Cgg3eQb7.js → tr-CYfLfxAg.js} +1 -1
  97. package/dist/assets/{uk-zPAKOL1d.js → uk-Bm__l5YX.js} +1 -1
  98. package/dist/assets/{useAppFontEffects-D9nf8G19.js → useAppFontEffects-3RimJo4B.js} +15 -15
  99. package/dist/assets/{useBranchPullRequestRequest-CaGsp4wW.js → useBranchPullRequestRequest-CMvepZei.js} +1 -1
  100. package/dist/assets/{useCallableModelProviders-B1YBs2FN.js → useCallableModelProviders-DpMos2Hl.js} +1 -1
  101. package/dist/assets/{useDiffFindSurface-DiINVOLu.js → useDiffFindSurface-Dy5ZvPrH.js} +1 -1
  102. package/dist/assets/{useGitCleanLine-BK-o3SG6.js → useGitCleanLine-COG7MPwc.js} +1 -1
  103. package/dist/assets/{useInlineCommentController-CzeMiLCm.js → useInlineCommentController-_L6_JHZ6.js} +1 -1
  104. package/dist/assets/{useMarkdownLocalAssets-wPn7MXUN.js → useMarkdownLocalAssets-CH5Ekvbl.js} +1 -1
  105. package/dist/assets/{useRootScrollLock-BvsNFl90.js → useRootScrollLock-DdknBCBa.js} +2 -2
  106. package/dist/assets/{useWalkthroughReview-CEo_4ZLc.js → useWalkthroughReview-Bi8eB9_G.js} +1 -1
  107. package/dist/assets/{useWholeFileComment-BexRzYws.js → useWholeFileComment-CqHAJ2YU.js} +1 -1
  108. package/dist/assets/{useWorktreeArchiveActions-DaRx6tMV.js → useWorktreeArchiveActions-D1kaQEP9.js} +1 -1
  109. package/dist/assets/{vendor-codemirror-language-data-z3n6zAAT.js → vendor-codemirror-language-data-DRsX0PKK.js} +2 -2
  110. package/dist/assets/{zh-CN-BPcuR4-K.js → zh-CN-Db0Y0Ij-.js} +1 -1
  111. package/dist/assets/{zh-TW-CmPAjna9.js → zh-TW-CuzqmROB.js} +1 -1
  112. package/dist/index.html +2 -2
  113. package/dist/mini-chat.html +2 -2
  114. package/dist/mobile.html +2 -2
  115. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import{R as i,f as He,j as t}from"./vendor-react--VO_rL_p.js";import{u as ue,m as De,b5 as Oi,c0 as Ii,n as vs,b0 as ks,c1 as cn,aX as Se}from"./katex.min-g52ii4Gs.js";import{a as qi,u as Wi,B as zi,C as $i,P as Gi,R as Hi,h as Ki,e as Ui,g as Xi,W as Ji,i as Qi,d as Yi,b as Zi}from"./ChangeRequestDiffUnavailable-Ctc-P6zi.js";import{u as qe,bT as fn,bV as Tt,I as X,a5 as _s,cb as er,a6 as Os,bY as tr,a4 as Is,ac as mt,ad as pt,B as Xe,Q as Ie,ae as ht,aM as nr,gB as sr,gC as ir,bR as dn,aO as rr,aN as Te,bM as or,bS as ar,bO as lr,aP as cr,bU as fr,bP as dr,gD as ur,a0 as qs,gE as Pn,bg as Ws,gF as mr,bm as zs,gG as Ns,gH as pr,gI as hr,fE as gr,gJ as Je,b0 as xr,bW as yr,df as rn,d7 as $s,gK as br,a7 as wr,gL as jr,A as Wt,gM as un,K as vr,fq as mn,Z as kr,d8 as Nr,bD as Sr,n as On,gN as Rr,gO as Ss,gP as Cr,gQ as Rs,gR as Fr,gS as Dr,dg as Cs}from"./useAppFontEffects-D9nf8G19.js";import{u as Tr,a as Vr,i as Er,b as Ar,c as Lr,d as Pr,e as Mr,s as Br,f as _r,S as Or}from"./SubmoduleDiffSummary-BwVdGw0c.js";import{u as Ir,ak as Fs,w as Ds,x as qr,y as Wr,C as zr,al as $r,G as Gr,am as Hr}from"./runtimeEndpointReset-BJm_77m2.js";import{b as Kr,c as Ur,a as An,u as Xr,P as Jr}from"./useBranchPullRequestRequest-CaGsp4wW.js";import{i as Gs,O as Qr}from"./OfficeDocumentDiff-DXsfJnFq.js";import{u as Yr}from"./moveWorkspacePath-C4_JgpNC.js";import{b as Zr}from"./ReviewCards-CU1YHZkQ.js";import{v as eo,t as to}from"./contextFileOpenGuard-CKnYjgFC.js";import{p as Hs}from"./parseDiffFromFile-CD1h9Yf5.js";import{r as It,u as no,a as so,D as io}from"./useDiffFindSurface-DiINVOLu.js";import{u as ro}from"./useWholeFileComment-BexRzYws.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-zustand-C9tWdk0j.js";import"./vendor-zod--raI7LhK.js";import"./vendor-opencode-client-CeybcDBQ.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./vendor-streamdown-BbSYZ3NF.js";import"./vendor-markdown-BTUqNk6W.js";import"./vendor-mdast-util-from-markdown-CZHjOE75.js";import"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import"./vendor-micromark-util-decode-string-fHsnqYdj.js";import"./vendor-decode-named-character-reference-C3-224fz.js";import"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import"./vendor-micromark-AWM-NZXP.js";import"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import"./vendor-micromark-util-chunked-DrRIdSP-.js";import"./vendor-micromark-factory-space-PzSHLgmq.js";import"./vendor-micromark-util-character-CW3Cu1MS.js";import"./vendor-micromark-core-commonmark-kzTLNXAm.js";import"./vendor-micromark-util-classify-character-tcLuZZwM.js";import"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import"./vendor-micromark-util-subtokenize-BF1Jf29a.js";import"./vendor-micromark-factory-destination-Sj0xfi0V.js";import"./vendor-micromark-factory-label-amyP0HdC.js";import"./vendor-micromark-factory-title-khnLkZK6.js";import"./vendor-micromark-factory-whitespace-eIB00uTl.js";import"./vendor-micromark-util-html-tag-name-DbKNfynz.js";import"./vendor-unist-util-stringify-position-Ch_qCilz.js";import"./vendor-mdast-util-to-string-C_aolqmU.js";import"./vendor-unist-util-visit-DhPeCsfG.js";import"./vendor-unist-util-visit-parents-DlviEg7Z.js";import"./vendor-unist-util-is-BPZGFiMU.js";import"./vendor-hast-util-raw-DvvLJg15.js";import"./vendor-ungap-structured-clone--gfxRhYI.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-parse5-DwmzEj2o.js";import"./vendor-entities-wUUgTZDW.js";import"./vendor-web-namespaces-bsVAaBS1.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-unist-util-position-60F3QETU.js";import"./vendor-hast-util-from-parse5-Ba3T6RJI.js";import"./vendor-devlop-0Dp3JUBc.js";import"./vendor-property-information-Boo8Xpef.js";import"./vendor-hastscript-BrPNioaz.js";import"./vendor-comma-separated-tokens-CRUGqg4f.js";import"./vendor-space-separated-tokens-D7QSIrTI.js";import"./vendor-hast-util-parse-selector-TXfch5wI.js";import"./vendor-vfile-location-LfEFwJ2h.js";import"./vendor-hast-util-to-parse5-BoysVIPW.js";import"./vendor-hast-util-sanitize-2aGO5ay8.js";import"./vendor-micromark-extension-gfm-CsfPlnlB.js";import"./vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js";import"./vendor-micromark-extension-gfm-footnote-OFl1FCH2.js";import"./vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js";import"./vendor-micromark-extension-gfm-table-dgw4LfUw.js";import"./vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js";import"./vendor-mdast-util-gfm-CroMDYLM.js";import"./vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-mdast-util-find-and-replace-DB9iC-bx.js";import"./vendor-escape-string-regexp-BaJN9MlJ.js";import"./vendor-mdast-util-gfm-footnote-C-csI7OF.js";import"./vendor-mdast-util-gfm-strikethrough-BcskTdio.js";import"./vendor-mdast-util-gfm-table-DhPwQIyj.js";import"./vendor-markdown-table-DvhhVmnL.js";import"./vendor-mdast-util-to-markdown-Cl3qaiyc.js";import"./vendor-longest-streak-CtXnX3Xp.js";import"./vendor-mdast-util-phrasing-4oVbNLC3.js";import"./vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js";import"./vendor-mdast-util-to-hast-CWnLaQSO.js";import"./vendor-micromark-util-sanitize-uri-BbwQ7CLk.js";import"./vendor-trim-lines-D8znQY54.js";import"./vendor-micromark-extension-cjk-friendly-BzZDGrF5.js";import"./vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js";import"./vendor-get-east-asian-width-CPhS2cOv.js";import"./vendor-micromark-util-symbol-JJPacVTp.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js";import"./vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js";import"./vendor-hast-util-from-html-isomorphic-B0Kn01s9.js";import"./vendor-hast-util-from-dom-DeNf9aYW.js";import"./vendor-katex-DBqql0K7.js";import"./vendor-hast-util-to-text-0GXLnBvt.js";import"./vendor-hast-util-is-element-CuOmiqQi.js";import"./vendor-unist-util-find-after-CMaZmLxc.js";import"./vendor-micromark-extension-math-BRFoDziv.js";import"./vendor-mdast-util-math-wB-IJCL0.js";import"./vendor-remend-r8cP_t-e.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tailwind-merge-BKkUfl9q.js";import"./vendor-marked-DN3zOnEe.js";import"./vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js";import"./vendor-style-to-js-CI2G4dgu.js";import"./vendor-style-to-object-BAv4SQXc.js";import"./vendor-inline-style-parser-BlqBsVO4.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-estree-util-is-identifier-name-BgBfM8ME.js";import"./vendor-vfile-message-DqhD22jI.js";import"./vendor-unified-1CQKw2_w.js";import"./vendor-bail-FqpXQuLt.js";import"./vendor-extend-B94qxKr5.js";import"./vendor-is-plain-obj-C1gvLhAf.js";import"./vendor-trough-B_b8ryxu.js";import"./vendor-vfile-BCWrK60u.js";import"./vendor-html-url-attributes-D46m5wfe.js";import"./vendor-capacitor-core-B4EWRrHz.js";import"./computeVirtualFileMetrics-DVynfSBh.js";import"./themeResolver-DXizngAV.js";import"./vendor-pierre-theming-D_TRfu0q.js";import"./vendor-base-ui-CqKCZJyd.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-dom-WyXykhNi.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-floating-ui-react-dom-Cy8dRGoy.js";import"./vendor-use-sync-external-store-CfLJGVyr.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-dnd-kit-core-Br1Cs7RV.js";import"./vendor-dnd-kit-utilities-DZ9KbT5S.js";import"./vendor-dnd-kit-accessibility-CYclfhtC.js";import"./vendor-dnd-kit-sortable-DpfLEOLv.js";import"./vendor-tanstack-react-virtual-CqfECoM0.js";import"./vendor-tanstack-virtual-core-BdFnkr_2.js";import"./vendor-framer-motion-C_wK4GIM.js";import"./vendor-motion-dom-HXPOMxb7.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-codemirror-commands-CjjsURR-.js";import"./vendor-codemirror-state-Cd8udR5z.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-Ciie9ey-.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-codemirror-language-8HZTPOnt.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-lezer-highlight-CZEcqU6G.js";import"./vendor-codemirror-streamparser-CmlTsbN2.js";import"./vendor-codemirror-lang-javascript-DmqaSK_j.js";import"./vendor-lezer-javascript-CWSwshuO.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-BGedy2gC.js";import"./vendor-codemirror-lang-json-DVAYKmoO.js";import"./vendor-lezer-json-Cn1mncjr.js";import"./vendor-codemirror-lang-css-BLpgXfL2.js";import"./vendor-lezer-css-B2Hx_Nps.js";import"./vendor-codemirror-lang-html-S3jxr3Mo.js";import"./vendor-lezer-html-Cr8K5DGw.js";import"./vendor-codemirror-lang-markdown-D1jveRI5.js";import"./vendor-lezer-markdown-TQKzBB8i.js";import"./vendor-codemirror-language-data-z3n6zAAT.js";import"./vendor-codemirror-lang-python-B-5UC9Ui.js";import"./vendor-lezer-python-BUoImtUb.js";import"./vendor-sonner-Dw26OnzC.js";import"./vendor-cmdk-BtSpU-Io.js";import"./vendor-radix-ui-react-dialog-OIW6VLWw.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D4RvEbuR.js";import"./vendor-radix-ui-react-context-BbFoxCHu.js";import"./vendor-radix-ui-react-id-aGag8i_5.js";import"./vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js";import"./vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js";import"./vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js";import"./vendor-radix-ui-react-primitive-CrN9dRDb.js";import"./vendor-radix-ui-react-slot-BjbalUfz.js";import"./vendor-radix-ui-react-use-callback-ref-CcC_buIU.js";import"./vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js";import"./vendor-radix-ui-react-focus-scope-D1noLHmd.js";import"./vendor-radix-ui-react-portal-BlUEzfrF.js";import"./vendor-radix-ui-react-presence-BGqFfiW4.js";import"./vendor-radix-ui-react-focus-guards-CSS2IbZC.js";import"./vendor-react-remove-scroll-Der_cv-1.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-Clwl9llp.js";import"./vendor-react-style-singleton-D_xJlTqU.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-BdLl6ZIw.js";import"./vendor-use-callback-ref-CXJF1lEr.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-legendapp-list-CEhBoV5L.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./space-apply-BT-PjBF5.js";import"./isDiffPlainText-DpcjRlB-.js";import"./getFiletypeFromFileName-BgI9McTw.js";import"./vendor-diff-C3JhlQdm.js";import"./pierreDiffTint-Cg024Eeg.js";import"./hastToHtml-BHV14OWE.js";import"./vendor-hast-util-to-html-Jw3IXh58.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./useInlineCommentController-CzeMiLCm.js";import"./appThemeRegistry-BwyM6n38.js";import"./textMateThemeFromAppTheme-CRhUx8P-.js";import"./diffsHighlighter-BsxkaI3Q.js";import"./document-attachments-CIZjaOGe.js";import"./vendor-fflate-DB4_FQr-.js";import"./documentClient-B0iRikhq.js";const oo=i.memo(a=>{const e=He.c(75),{scope:s,workingCount:r,stagedCount:x,turnCount:m,branchCount:b,commitCount:k,prCount:w,showCommitOption:y,showBranchOption:d,changeRequestTerm:N,onScopeChange:h}=a,{t:u}=qe(),[C,S]=i.useState(!1),j=s==="pr"?w:s==="staged"?x:s==="turn"?m:s==="branch"?b:s==="commit"?k:r;let F;e[0]!==N||e[1]!==s||e[2]!==u?(F=u(s==="pr"?fn("session.githubIntegration.tabs.pullRequests",N):s==="staged"?"diffView.scope.staged":s==="turn"?"diffView.scope.lastTurn":s==="branch"?"diffView.scope.branch":s==="commit"?"commitComparison.mode":"diffView.scope.changed"),e[0]=N,e[1]=s,e[2]=u,e[3]=F):F=e[3];const P=F;let g;e[4]!==u?(g=u("contextTooltips.diff.scope"),e[4]=u,e[5]=g):g=e[5];let I;e[6]!==u?(I=u("diffView.scope.selectorAria"),e[6]=u,e[7]=I):I=e[7];let R;e[8]!==j?(R=j!==null&&t.jsxs("span",{className:"diff-toolbar__scope-count",children:[": ",j]}),e[8]=j,e[9]=R):R=e[9];let le;e[10]!==P||e[11]!==R?(le=t.jsxs("span",{className:"whitespace-nowrap",children:[P,R]}),e[10]=P,e[11]=R,e[12]=le):le=e[12];let ye;e[13]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(X,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"}),e[13]=ye):ye=e[13];let Y;e[14]!==I||e[15]!==le?(Y=t.jsx(_s,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex h-7 flex-shrink-0 items-center gap-1.5 rounded-md px-2 typography-ui-label font-semibold text-foreground outline-none hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-ring","aria-label":I,children:[le,ye]})}),e[14]=I,e[15]=le,e[16]=Y):Y=e[16];let ee;e[17]!==g||e[18]!==Y?(ee=t.jsx(er,{label:g,side:"bottom",children:Y}),e[17]=g,e[18]=Y,e[19]=ee):ee=e[19];let ne;e[20]!==h?(ne=J=>{(J==="working"||J==="staged"||J==="turn"||J==="branch"||J==="commit"||J==="pr")&&(h?.(J),S(!1))},e[20]=h,e[21]=ne):ne=e[21];let W;e[22]!==u?(W=u("diffView.scope.lastTurn"),e[22]=u,e[23]=W):W=e[23];let p;e[24]!==W?(p=t.jsx("span",{children:W}),e[24]=W,e[25]=p):p=e[25];const D=m??"…";let z;e[26]!==D?(z=t.jsx("span",{className:"typography-meta text-muted-foreground",children:D}),e[26]=D,e[27]=z):z=e[27];let Z;e[28]!==p||e[29]!==z?(Z=t.jsx(Tt,{value:"turn",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[p,z]})}),e[28]=p,e[29]=z,e[30]=Z):Z=e[30];let A;e[31]!==u?(A=u("diffView.scope.changed"),e[31]=u,e[32]=A):A=e[32];let B;e[33]!==A?(B=t.jsx("span",{children:A}),e[33]=A,e[34]=B):B=e[34];let q;e[35]!==r?(q=t.jsx("span",{className:"typography-meta text-muted-foreground",children:r}),e[35]=r,e[36]=q):q=e[36];let M;e[37]!==B||e[38]!==q?(M=t.jsx(Tt,{value:"working",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[B,q]})}),e[37]=B,e[38]=q,e[39]=M):M=e[39];let L;e[40]!==u?(L=u("diffView.scope.staged"),e[40]=u,e[41]=L):L=e[41];let se;e[42]!==L?(se=t.jsx("span",{children:L}),e[42]=L,e[43]=se):se=e[43];let fe;e[44]!==x?(fe=t.jsx("span",{className:"typography-meta text-muted-foreground",children:x}),e[44]=x,e[45]=fe):fe=e[45];let ie;e[46]!==se||e[47]!==fe?(ie=t.jsx(Tt,{value:"staged",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[se,fe]})}),e[46]=se,e[47]=fe,e[48]=ie):ie=e[48];let he;e[49]!==k||e[50]!==y||e[51]!==u?(he=y&&t.jsx(Tt,{value:"commit",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:u("commitComparison.mode")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:k??"…"})]})}),e[49]=k,e[50]=y,e[51]=u,e[52]=he):he=e[52];let re;e[53]!==b||e[54]!==d||e[55]!==u?(re=d?t.jsx(Tt,{value:"branch",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:u("diffView.scope.branch")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:b??"…"})]})}):null,e[53]=b,e[54]=d,e[55]=u,e[56]=re):re=e[56];let ce;e[57]!==N||e[58]!==w||e[59]!==y||e[60]!==u?(ce=y&&t.jsx(Tt,{value:"pr",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:u(fn("session.githubIntegration.tabs.pullRequests",N))}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:w??"…"})]})}),e[57]=N,e[58]=w,e[59]=y,e[60]=u,e[61]=ce):ce=e[61];let be;e[62]!==s||e[63]!==Z||e[64]!==M||e[65]!==ie||e[66]!==he||e[67]!==re||e[68]!==ce||e[69]!==ne?(be=t.jsx(Os,{align:"start",className:"w-40",children:t.jsxs(tr,{value:s,onValueChange:ne,children:[Z,M,ie,he,re,ce]})}),e[62]=s,e[63]=Z,e[64]=M,e[65]=ie,e[66]=he,e[67]=re,e[68]=ce,e[69]=ne,e[70]=be):be=e[70];let H;return e[71]!==C||e[72]!==be||e[73]!==ee?(H=t.jsxs(Is,{open:C,onOpenChange:S,children:[ee,be]}),e[71]=C,e[72]=be,e[73]=ee,e[74]=H):H=e[74],H}),ao=i.memo(function(e){const s=He.c(13),{index:r,staged:x,busyHunk:m,disabled:b,onAction:k}=e,{t:w}=qe();let y;s[0]!==x?(y=x?["unstage"]:["discard","stage"],s[0]=x,s[1]=y):y=s[1];const d=y;let N;s[2]===Symbol.for("react.memo_cache_sentinel")?(N={top:"var(--oc-hunk-action-offset, 0.25rem)"},s[2]=N):N=s[2];let h;s[3]!==d||s[4]!==m||s[5]!==b||s[6]!==r||s[7]!==k||s[8]!==w?(h=t.jsx("div",{className:"pointer-events-auto flex items-center gap-0.5 rounded-full border border-[var(--interactive-border)]/45 bg-[var(--surface-background)]/95 px-1 py-0.5 shadow-sm backdrop-blur-md",children:d.map(C=>{const S=w(C==="stage"?"diffView.hunk.stageTitle":C==="unstage"?"diffView.hunk.unstageTitle":"diffView.hunk.discardTitle",{index:r+1}),j=w(C==="stage"?"contextTooltips.diff.hunkStage":C==="unstage"?"contextTooltips.diff.hunkUnstage":"contextTooltips.diff.hunkDiscard"),F=m?.index===r&&m.action===C;return t.jsxs(mt,{children:[t.jsx(pt,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(Xe,{variant:"ghost",size:"xs",className:Ie("rounded-full bg-transparent text-muted-foreground hover:bg-transparent hover:text-foreground",C==="discard"&&"text-[var(--status-error)] hover:text-[var(--status-error)]",C==="stage"&&"text-[var(--status-success)] hover:text-[var(--status-success)]"),disabled:b||m!==null,"aria-label":S,onPointerDown:lo,onClick:P=>{P.stopPropagation(),k(r,C)},children:t.jsx(X,{name:F?"loader-4":C==="stage"?"add":"arrow-go-back",className:Ie(C==="stage"?"size-4":"size-3.5",F&&"animate-spin")})})})}),t.jsx(ht,{sideOffset:6,children:j})]},C)})}),s[3]=d,s[4]=m,s[5]=b,s[6]=r,s[7]=k,s[8]=w,s[9]=h):h=s[9];let u;return s[10]!==r||s[11]!==h?(u=t.jsx("div",{className:"pointer-events-none absolute inset-e-3 z-20",style:N,"data-hunk-actions":r,children:h}),s[10]=r,s[11]=h,s[12]=u):u=s[12],u});function lo(a){return a.stopPropagation()}const co=3,Ks=a=>{const e=He.c(14),{path:s}=a,{t:r}=qe(),x=Ir();let m,b;if(e[0]!==s||e[1]!==x?.state?.draft?.comments||e[2]!==x?.state?.threads||e[3]!==r){b=Symbol.for("react.early_return_sentinel");e:{let k;e[6]!==s?(k=j=>j.path===s&&!j.resolved,e[6]=s,e[7]=k):k=e[7];const w=(x?.state?.threads??[]).filter(k);let y;e[8]!==s?(y=j=>j.path===s,e[8]=s,e[9]=y):y=e[9];const d=(x?.state?.draft?.comments??[]).filter(y),N=w.length+d.length;if(N===0){b=null;break e}const h=new Map;for(const{author:j}of d)h.set(j?.login??"",j);for(const{comments:j}of w)h.set(j[0]?.author?.login??"",j[0]?.author??null);const u=N===1?"review.fileMark.one":"review.fileMark.other";let C;e[10]!==N||e[11]!==r||e[12]!==u?(C=r(u,{count:N}),e[10]=N,e[11]=r,e[12]=u,e[13]=C):C=e[13];const S=C;m=t.jsx("span",{className:"flex shrink-0 items-center -space-x-1 rtl:space-x-reverse",role:"img","aria-label":S,title:S,children:[...h.entries()].slice(0,co).map(fo)})}e[0]=s,e[1]=x?.state?.draft?.comments,e[2]=x?.state?.threads,e[3]=r,e[4]=m,e[5]=b}else m=e[4],b=e[5];return b!==Symbol.for("react.early_return_sentinel")?b:m};function fo(a){const[e,s]=a;return t.jsx(Zr,{person:s},e)}const Ts=(a,e)=>{if(e.length===0)return null;let s=null,r=null;for(const m of e)m.top<=a?(!s||m.top>s.top)&&(s=m):(!r||m.top<r.top)&&(r=m);const x=s??r;return x?{path:x.path,topOffset:x.top-a}:null},uo=(a,e,s,r)=>Math.min(Math.max(0,r),Math.max(0,a+s-e)),Us=(a,e)=>{const s=[],r=(x,m)=>{const b=Array.from(x.children.values()).sort((w,y)=>w.name.localeCompare(y.name));for(const w of b){const{node:y,label:d}=Ur(w),N=!e.has(y.path);s.push({kind:"directory",key:`dir:${y.path}`,depth:m,path:y.path,label:d,fileCount:y.files.length,expanded:N}),N&&r(y,m+1)}const k=[...x.directFiles].sort((w,y)=>An(w.path).localeCompare(An(y.path)));for(const w of k)s.push({kind:"file",key:`file:${w.path}`,depth:m,name:An(w.path),file:w})};return r(Kr(a),0),s},Vs=a=>{if(!a)return null;const e=a.split(`
1
+ import{R as i,f as He,j as t}from"./vendor-react--VO_rL_p.js";import{u as ue,m as De,b5 as Oi,c0 as Ii,n as vs,b0 as ks,c1 as cn,aX as Se}from"./katex.min-Bs5OLoA1.js";import{a as qi,u as Wi,B as zi,C as $i,P as Gi,R as Hi,h as Ki,e as Ui,g as Xi,W as Ji,i as Qi,d as Yi,b as Zi}from"./ChangeRequestDiffUnavailable-CNIWdYRx.js";import{u as qe,bT as fn,bV as Tt,I as X,a5 as _s,cb as er,a6 as Os,bY as tr,a4 as Is,ac as mt,ad as pt,B as Xe,Q as Ie,ae as ht,aM as nr,gB as sr,gC as ir,bR as dn,aO as rr,aN as Te,bM as or,bS as ar,bO as lr,aP as cr,bU as fr,bP as dr,gD as ur,a0 as qs,gE as Pn,bg as Ws,gF as mr,bm as zs,gG as Ns,gH as pr,gI as hr,fE as gr,gJ as Je,b0 as xr,bW as yr,df as rn,d7 as $s,gK as br,a7 as wr,gL as jr,A as Wt,gM as un,K as vr,fq as mn,Z as kr,d8 as Nr,bD as Sr,n as On,gN as Rr,gO as Ss,gP as Cr,gQ as Rs,gR as Fr,gS as Dr,dg as Cs}from"./useAppFontEffects-3RimJo4B.js";import{u as Tr,a as Vr,i as Er,b as Ar,c as Lr,d as Pr,e as Mr,s as Br,f as _r,S as Or}from"./SubmoduleDiffSummary-Bebhaz7n.js";import{u as Ir,ak as Fs,w as Ds,x as qr,y as Wr,C as zr,al as $r,G as Gr,am as Hr}from"./runtimeEndpointReset-DiTyBUwe.js";import{b as Kr,c as Ur,a as An,u as Xr,P as Jr}from"./useBranchPullRequestRequest-CMvepZei.js";import{i as Gs,O as Qr}from"./OfficeDocumentDiff-BFr4rAHy.js";import{u as Yr}from"./moveWorkspacePath-BaEfuU4S.js";import{b as Zr}from"./ReviewCards-BkpTYy_a.js";import{v as eo,t as to}from"./contextFileOpenGuard-BC79wuu1.js";import{p as Hs}from"./parseDiffFromFile-By5H8w4y.js";import{r as It,u as no,a as so,D as io}from"./useDiffFindSurface-Dy5ZvPrH.js";import{u as ro}from"./useWholeFileComment-CqHAJ2YU.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-zustand-C9tWdk0j.js";import"./vendor-zod--raI7LhK.js";import"./vendor-opencode-client-CeybcDBQ.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./vendor-streamdown-BbSYZ3NF.js";import"./vendor-markdown-BTUqNk6W.js";import"./vendor-mdast-util-from-markdown-CZHjOE75.js";import"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import"./vendor-micromark-util-decode-string-fHsnqYdj.js";import"./vendor-decode-named-character-reference-C3-224fz.js";import"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import"./vendor-micromark-AWM-NZXP.js";import"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import"./vendor-micromark-util-chunked-DrRIdSP-.js";import"./vendor-micromark-factory-space-PzSHLgmq.js";import"./vendor-micromark-util-character-CW3Cu1MS.js";import"./vendor-micromark-core-commonmark-kzTLNXAm.js";import"./vendor-micromark-util-classify-character-tcLuZZwM.js";import"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import"./vendor-micromark-util-subtokenize-BF1Jf29a.js";import"./vendor-micromark-factory-destination-Sj0xfi0V.js";import"./vendor-micromark-factory-label-amyP0HdC.js";import"./vendor-micromark-factory-title-khnLkZK6.js";import"./vendor-micromark-factory-whitespace-eIB00uTl.js";import"./vendor-micromark-util-html-tag-name-DbKNfynz.js";import"./vendor-unist-util-stringify-position-Ch_qCilz.js";import"./vendor-mdast-util-to-string-C_aolqmU.js";import"./vendor-unist-util-visit-DhPeCsfG.js";import"./vendor-unist-util-visit-parents-DlviEg7Z.js";import"./vendor-unist-util-is-BPZGFiMU.js";import"./vendor-hast-util-raw-DvvLJg15.js";import"./vendor-ungap-structured-clone--gfxRhYI.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-parse5-DwmzEj2o.js";import"./vendor-entities-wUUgTZDW.js";import"./vendor-web-namespaces-bsVAaBS1.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-unist-util-position-60F3QETU.js";import"./vendor-hast-util-from-parse5-Ba3T6RJI.js";import"./vendor-devlop-0Dp3JUBc.js";import"./vendor-property-information-Boo8Xpef.js";import"./vendor-hastscript-BrPNioaz.js";import"./vendor-comma-separated-tokens-CRUGqg4f.js";import"./vendor-space-separated-tokens-D7QSIrTI.js";import"./vendor-hast-util-parse-selector-TXfch5wI.js";import"./vendor-vfile-location-LfEFwJ2h.js";import"./vendor-hast-util-to-parse5-BoysVIPW.js";import"./vendor-hast-util-sanitize-2aGO5ay8.js";import"./vendor-micromark-extension-gfm-CsfPlnlB.js";import"./vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js";import"./vendor-micromark-extension-gfm-footnote-OFl1FCH2.js";import"./vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js";import"./vendor-micromark-extension-gfm-table-dgw4LfUw.js";import"./vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js";import"./vendor-mdast-util-gfm-CroMDYLM.js";import"./vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-mdast-util-find-and-replace-DB9iC-bx.js";import"./vendor-escape-string-regexp-BaJN9MlJ.js";import"./vendor-mdast-util-gfm-footnote-C-csI7OF.js";import"./vendor-mdast-util-gfm-strikethrough-BcskTdio.js";import"./vendor-mdast-util-gfm-table-DhPwQIyj.js";import"./vendor-markdown-table-DvhhVmnL.js";import"./vendor-mdast-util-to-markdown-Cl3qaiyc.js";import"./vendor-longest-streak-CtXnX3Xp.js";import"./vendor-mdast-util-phrasing-4oVbNLC3.js";import"./vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js";import"./vendor-mdast-util-to-hast-CWnLaQSO.js";import"./vendor-micromark-util-sanitize-uri-BbwQ7CLk.js";import"./vendor-trim-lines-D8znQY54.js";import"./vendor-micromark-extension-cjk-friendly-BzZDGrF5.js";import"./vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js";import"./vendor-get-east-asian-width-CPhS2cOv.js";import"./vendor-micromark-util-symbol-JJPacVTp.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js";import"./vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js";import"./vendor-hast-util-from-html-isomorphic-B0Kn01s9.js";import"./vendor-hast-util-from-dom-DeNf9aYW.js";import"./vendor-katex-DBqql0K7.js";import"./vendor-hast-util-to-text-0GXLnBvt.js";import"./vendor-hast-util-is-element-CuOmiqQi.js";import"./vendor-unist-util-find-after-CMaZmLxc.js";import"./vendor-micromark-extension-math-BRFoDziv.js";import"./vendor-mdast-util-math-wB-IJCL0.js";import"./vendor-remend-r8cP_t-e.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tailwind-merge-BKkUfl9q.js";import"./vendor-marked-DN3zOnEe.js";import"./vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js";import"./vendor-style-to-js-CI2G4dgu.js";import"./vendor-style-to-object-BAv4SQXc.js";import"./vendor-inline-style-parser-BlqBsVO4.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-estree-util-is-identifier-name-BgBfM8ME.js";import"./vendor-vfile-message-DqhD22jI.js";import"./vendor-unified-1CQKw2_w.js";import"./vendor-bail-FqpXQuLt.js";import"./vendor-extend-B94qxKr5.js";import"./vendor-is-plain-obj-C1gvLhAf.js";import"./vendor-trough-B_b8ryxu.js";import"./vendor-vfile-BCWrK60u.js";import"./vendor-html-url-attributes-D46m5wfe.js";import"./vendor-capacitor-core-B4EWRrHz.js";import"./computeVirtualFileMetrics-DVfKKHny.js";import"./themeResolver-DXizngAV.js";import"./vendor-pierre-theming-D_TRfu0q.js";import"./vendor-base-ui-CqKCZJyd.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-dom-WyXykhNi.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-floating-ui-react-dom-Cy8dRGoy.js";import"./vendor-use-sync-external-store-CfLJGVyr.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-dnd-kit-core-Br1Cs7RV.js";import"./vendor-dnd-kit-utilities-DZ9KbT5S.js";import"./vendor-dnd-kit-accessibility-CYclfhtC.js";import"./vendor-dnd-kit-sortable-DpfLEOLv.js";import"./vendor-tanstack-react-virtual-CqfECoM0.js";import"./vendor-tanstack-virtual-core-BdFnkr_2.js";import"./vendor-framer-motion-C_wK4GIM.js";import"./vendor-motion-dom-HXPOMxb7.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-codemirror-commands-CjjsURR-.js";import"./vendor-codemirror-state-Cd8udR5z.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-Ciie9ey-.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-codemirror-language-8HZTPOnt.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-lezer-highlight-CZEcqU6G.js";import"./vendor-codemirror-streamparser-CmlTsbN2.js";import"./vendor-codemirror-lang-javascript-DmqaSK_j.js";import"./vendor-lezer-javascript-CWSwshuO.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-BGedy2gC.js";import"./vendor-codemirror-lang-json-DVAYKmoO.js";import"./vendor-lezer-json-Cn1mncjr.js";import"./vendor-codemirror-lang-css-BLpgXfL2.js";import"./vendor-lezer-css-B2Hx_Nps.js";import"./vendor-codemirror-lang-html-S3jxr3Mo.js";import"./vendor-lezer-html-Cr8K5DGw.js";import"./vendor-codemirror-lang-markdown-D1jveRI5.js";import"./vendor-lezer-markdown-TQKzBB8i.js";import"./vendor-codemirror-language-data-DRsX0PKK.js";import"./vendor-codemirror-lang-python-B-5UC9Ui.js";import"./vendor-lezer-python-BUoImtUb.js";import"./vendor-sonner-Dw26OnzC.js";import"./vendor-cmdk-BtSpU-Io.js";import"./vendor-radix-ui-react-dialog-OIW6VLWw.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D4RvEbuR.js";import"./vendor-radix-ui-react-context-BbFoxCHu.js";import"./vendor-radix-ui-react-id-aGag8i_5.js";import"./vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js";import"./vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js";import"./vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js";import"./vendor-radix-ui-react-primitive-CrN9dRDb.js";import"./vendor-radix-ui-react-slot-BjbalUfz.js";import"./vendor-radix-ui-react-use-callback-ref-CcC_buIU.js";import"./vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js";import"./vendor-radix-ui-react-focus-scope-D1noLHmd.js";import"./vendor-radix-ui-react-portal-BlUEzfrF.js";import"./vendor-radix-ui-react-presence-BGqFfiW4.js";import"./vendor-radix-ui-react-focus-guards-CSS2IbZC.js";import"./vendor-react-remove-scroll-Der_cv-1.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-Clwl9llp.js";import"./vendor-react-style-singleton-D_xJlTqU.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-BdLl6ZIw.js";import"./vendor-use-callback-ref-CXJF1lEr.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-legendapp-list-CEhBoV5L.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./space-apply-8YUOtYvk.js";import"./isDiffPlainText-saKoOWJx.js";import"./getFiletypeFromFileName-BgI9McTw.js";import"./vendor-diff-C3JhlQdm.js";import"./pierreDiffTint-CVm_qZm-.js";import"./hastToHtml-BHV14OWE.js";import"./vendor-hast-util-to-html-Jw3IXh58.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./useInlineCommentController-_L6_JHZ6.js";import"./appThemeRegistry-DYzVI9tX.js";import"./textMateThemeFromAppTheme-CVOJt2hL.js";import"./diffsHighlighter-BsxkaI3Q.js";import"./document-attachments-CIZjaOGe.js";import"./vendor-fflate-DB4_FQr-.js";import"./documentClient-JcxJ7vyh.js";const oo=i.memo(a=>{const e=He.c(75),{scope:s,workingCount:r,stagedCount:x,turnCount:m,branchCount:b,commitCount:k,prCount:w,showCommitOption:y,showBranchOption:d,changeRequestTerm:N,onScopeChange:h}=a,{t:u}=qe(),[C,S]=i.useState(!1),j=s==="pr"?w:s==="staged"?x:s==="turn"?m:s==="branch"?b:s==="commit"?k:r;let F;e[0]!==N||e[1]!==s||e[2]!==u?(F=u(s==="pr"?fn("session.githubIntegration.tabs.pullRequests",N):s==="staged"?"diffView.scope.staged":s==="turn"?"diffView.scope.lastTurn":s==="branch"?"diffView.scope.branch":s==="commit"?"commitComparison.mode":"diffView.scope.changed"),e[0]=N,e[1]=s,e[2]=u,e[3]=F):F=e[3];const P=F;let g;e[4]!==u?(g=u("contextTooltips.diff.scope"),e[4]=u,e[5]=g):g=e[5];let I;e[6]!==u?(I=u("diffView.scope.selectorAria"),e[6]=u,e[7]=I):I=e[7];let R;e[8]!==j?(R=j!==null&&t.jsxs("span",{className:"diff-toolbar__scope-count",children:[": ",j]}),e[8]=j,e[9]=R):R=e[9];let le;e[10]!==P||e[11]!==R?(le=t.jsxs("span",{className:"whitespace-nowrap",children:[P,R]}),e[10]=P,e[11]=R,e[12]=le):le=e[12];let ye;e[13]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(X,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"}),e[13]=ye):ye=e[13];let Y;e[14]!==I||e[15]!==le?(Y=t.jsx(_s,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex h-7 flex-shrink-0 items-center gap-1.5 rounded-md px-2 typography-ui-label font-semibold text-foreground outline-none hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-ring","aria-label":I,children:[le,ye]})}),e[14]=I,e[15]=le,e[16]=Y):Y=e[16];let ee;e[17]!==g||e[18]!==Y?(ee=t.jsx(er,{label:g,side:"bottom",children:Y}),e[17]=g,e[18]=Y,e[19]=ee):ee=e[19];let ne;e[20]!==h?(ne=J=>{(J==="working"||J==="staged"||J==="turn"||J==="branch"||J==="commit"||J==="pr")&&(h?.(J),S(!1))},e[20]=h,e[21]=ne):ne=e[21];let W;e[22]!==u?(W=u("diffView.scope.lastTurn"),e[22]=u,e[23]=W):W=e[23];let p;e[24]!==W?(p=t.jsx("span",{children:W}),e[24]=W,e[25]=p):p=e[25];const D=m??"…";let z;e[26]!==D?(z=t.jsx("span",{className:"typography-meta text-muted-foreground",children:D}),e[26]=D,e[27]=z):z=e[27];let Z;e[28]!==p||e[29]!==z?(Z=t.jsx(Tt,{value:"turn",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[p,z]})}),e[28]=p,e[29]=z,e[30]=Z):Z=e[30];let A;e[31]!==u?(A=u("diffView.scope.changed"),e[31]=u,e[32]=A):A=e[32];let B;e[33]!==A?(B=t.jsx("span",{children:A}),e[33]=A,e[34]=B):B=e[34];let q;e[35]!==r?(q=t.jsx("span",{className:"typography-meta text-muted-foreground",children:r}),e[35]=r,e[36]=q):q=e[36];let M;e[37]!==B||e[38]!==q?(M=t.jsx(Tt,{value:"working",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[B,q]})}),e[37]=B,e[38]=q,e[39]=M):M=e[39];let L;e[40]!==u?(L=u("diffView.scope.staged"),e[40]=u,e[41]=L):L=e[41];let se;e[42]!==L?(se=t.jsx("span",{children:L}),e[42]=L,e[43]=se):se=e[43];let fe;e[44]!==x?(fe=t.jsx("span",{className:"typography-meta text-muted-foreground",children:x}),e[44]=x,e[45]=fe):fe=e[45];let ie;e[46]!==se||e[47]!==fe?(ie=t.jsx(Tt,{value:"staged",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[se,fe]})}),e[46]=se,e[47]=fe,e[48]=ie):ie=e[48];let he;e[49]!==k||e[50]!==y||e[51]!==u?(he=y&&t.jsx(Tt,{value:"commit",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:u("commitComparison.mode")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:k??"…"})]})}),e[49]=k,e[50]=y,e[51]=u,e[52]=he):he=e[52];let re;e[53]!==b||e[54]!==d||e[55]!==u?(re=d?t.jsx(Tt,{value:"branch",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:u("diffView.scope.branch")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:b??"…"})]})}):null,e[53]=b,e[54]=d,e[55]=u,e[56]=re):re=e[56];let ce;e[57]!==N||e[58]!==w||e[59]!==y||e[60]!==u?(ce=y&&t.jsx(Tt,{value:"pr",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:u(fn("session.githubIntegration.tabs.pullRequests",N))}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:w??"…"})]})}),e[57]=N,e[58]=w,e[59]=y,e[60]=u,e[61]=ce):ce=e[61];let be;e[62]!==s||e[63]!==Z||e[64]!==M||e[65]!==ie||e[66]!==he||e[67]!==re||e[68]!==ce||e[69]!==ne?(be=t.jsx(Os,{align:"start",className:"w-40",children:t.jsxs(tr,{value:s,onValueChange:ne,children:[Z,M,ie,he,re,ce]})}),e[62]=s,e[63]=Z,e[64]=M,e[65]=ie,e[66]=he,e[67]=re,e[68]=ce,e[69]=ne,e[70]=be):be=e[70];let H;return e[71]!==C||e[72]!==be||e[73]!==ee?(H=t.jsxs(Is,{open:C,onOpenChange:S,children:[ee,be]}),e[71]=C,e[72]=be,e[73]=ee,e[74]=H):H=e[74],H}),ao=i.memo(function(e){const s=He.c(13),{index:r,staged:x,busyHunk:m,disabled:b,onAction:k}=e,{t:w}=qe();let y;s[0]!==x?(y=x?["unstage"]:["discard","stage"],s[0]=x,s[1]=y):y=s[1];const d=y;let N;s[2]===Symbol.for("react.memo_cache_sentinel")?(N={top:"var(--oc-hunk-action-offset, 0.25rem)"},s[2]=N):N=s[2];let h;s[3]!==d||s[4]!==m||s[5]!==b||s[6]!==r||s[7]!==k||s[8]!==w?(h=t.jsx("div",{className:"pointer-events-auto flex items-center gap-0.5 rounded-full border border-[var(--interactive-border)]/45 bg-[var(--surface-background)]/95 px-1 py-0.5 shadow-sm backdrop-blur-md",children:d.map(C=>{const S=w(C==="stage"?"diffView.hunk.stageTitle":C==="unstage"?"diffView.hunk.unstageTitle":"diffView.hunk.discardTitle",{index:r+1}),j=w(C==="stage"?"contextTooltips.diff.hunkStage":C==="unstage"?"contextTooltips.diff.hunkUnstage":"contextTooltips.diff.hunkDiscard"),F=m?.index===r&&m.action===C;return t.jsxs(mt,{children:[t.jsx(pt,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(Xe,{variant:"ghost",size:"xs",className:Ie("rounded-full bg-transparent text-muted-foreground hover:bg-transparent hover:text-foreground",C==="discard"&&"text-[var(--status-error)] hover:text-[var(--status-error)]",C==="stage"&&"text-[var(--status-success)] hover:text-[var(--status-success)]"),disabled:b||m!==null,"aria-label":S,onPointerDown:lo,onClick:P=>{P.stopPropagation(),k(r,C)},children:t.jsx(X,{name:F?"loader-4":C==="stage"?"add":"arrow-go-back",className:Ie(C==="stage"?"size-4":"size-3.5",F&&"animate-spin")})})})}),t.jsx(ht,{sideOffset:6,children:j})]},C)})}),s[3]=d,s[4]=m,s[5]=b,s[6]=r,s[7]=k,s[8]=w,s[9]=h):h=s[9];let u;return s[10]!==r||s[11]!==h?(u=t.jsx("div",{className:"pointer-events-none absolute inset-e-3 z-20",style:N,"data-hunk-actions":r,children:h}),s[10]=r,s[11]=h,s[12]=u):u=s[12],u});function lo(a){return a.stopPropagation()}const co=3,Ks=a=>{const e=He.c(14),{path:s}=a,{t:r}=qe(),x=Ir();let m,b;if(e[0]!==s||e[1]!==x?.state?.draft?.comments||e[2]!==x?.state?.threads||e[3]!==r){b=Symbol.for("react.early_return_sentinel");e:{let k;e[6]!==s?(k=j=>j.path===s&&!j.resolved,e[6]=s,e[7]=k):k=e[7];const w=(x?.state?.threads??[]).filter(k);let y;e[8]!==s?(y=j=>j.path===s,e[8]=s,e[9]=y):y=e[9];const d=(x?.state?.draft?.comments??[]).filter(y),N=w.length+d.length;if(N===0){b=null;break e}const h=new Map;for(const{author:j}of d)h.set(j?.login??"",j);for(const{comments:j}of w)h.set(j[0]?.author?.login??"",j[0]?.author??null);const u=N===1?"review.fileMark.one":"review.fileMark.other";let C;e[10]!==N||e[11]!==r||e[12]!==u?(C=r(u,{count:N}),e[10]=N,e[11]=r,e[12]=u,e[13]=C):C=e[13];const S=C;m=t.jsx("span",{className:"flex shrink-0 items-center -space-x-1 rtl:space-x-reverse",role:"img","aria-label":S,title:S,children:[...h.entries()].slice(0,co).map(fo)})}e[0]=s,e[1]=x?.state?.draft?.comments,e[2]=x?.state?.threads,e[3]=r,e[4]=m,e[5]=b}else m=e[4],b=e[5];return b!==Symbol.for("react.early_return_sentinel")?b:m};function fo(a){const[e,s]=a;return t.jsx(Zr,{person:s},e)}const Ts=(a,e)=>{if(e.length===0)return null;let s=null,r=null;for(const m of e)m.top<=a?(!s||m.top>s.top)&&(s=m):(!r||m.top<r.top)&&(r=m);const x=s??r;return x?{path:x.path,topOffset:x.top-a}:null},uo=(a,e,s,r)=>Math.min(Math.max(0,r),Math.max(0,a+s-e)),Us=(a,e)=>{const s=[],r=(x,m)=>{const b=Array.from(x.children.values()).sort((w,y)=>w.name.localeCompare(y.name));for(const w of b){const{node:y,label:d}=Ur(w),N=!e.has(y.path);s.push({kind:"directory",key:`dir:${y.path}`,depth:m,path:y.path,label:d,fileCount:y.files.length,expanded:N}),N&&r(y,m+1)}const k=[...x.directFiles].sort((w,y)=>An(w.path).localeCompare(An(y.path)));for(const w of k)s.push({kind:"file",key:`file:${w.path}`,depth:m,name:An(w.path),file:w})};return r(Kr(a),0),s},Vs=a=>{if(!a)return null;const e=a.split(`
2
2
  `);let s=null;for(const r of e){const x=r.match(/^@@\s*-\d+(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s*@@/);if(x){const m=Number.parseInt(x[1]??"",10);s=Number.isFinite(m)&&m>=1?m:null;continue}if(s!==null){if(r.startsWith(" ")){s+=1;continue}if(r.startsWith("+"))return s;if(r.startsWith("-"))return Math.max(1,s)}}return null};function mo(){const a=new Map;return({directory:e,filePath:s,revision:r,staged:x,contextLines:m,peers:b,getGitDiffs:k})=>{const w=(h,u)=>{const C=a.get(h);return C!==void 0&&C.directory===e&&C.revision===u},y=a.get(s);if(y&&w(s,r))return y.read;const d=new Map([[s,r]]);for(const h of b)!d.has(h.filePath)&&!w(h.filePath,h.revision)&&d.set(h.filePath,h.revision);const N=k(e,{paths:[...d.keys()],staged:x,contextLines:m}).then(h=>new Map(h.map(u=>[u.path,u])));for(const[h,u]of d){const C=N.then(S=>S.get(h)??null,()=>(a.get(h)?.read===C&&a.delete(h),null));a.set(h,{directory:e,revision:u,read:C})}return a.get(s)?.read??Promise.resolve(null)}}const po=1100,ho=15e3,Mn=500,Es=300,on=1e6,gt=3,go=a=>a<=6?a:a<=12?6:a<=25?4:2,Bn={status:"loading"},xo=3,yo=i.memo(()=>{const a=He.c(4),{t:e}=qe();let s;a[0]!==e?(s=e("diffView.binary.unavailable"),a[0]=e,a[1]=s):s=a[1];let r;return a[2]!==s?(r=t.jsx("div",{className:"rounded-lg border border-edge bg-background px-3 py-2",children:t.jsx("div",{className:"typography-meta text-muted-foreground",children:s})}),a[2]=s,a[3]=r):r=a[3],r}),Xs=a=>{const{index:e,working_dir:s}=a;return e==="A"||s==="A"||e==="?"||s==="?"},an=a=>{const e=a.index?.trim();return!!(e&&e!=="?")},ln=a=>!!a.working_dir?.trim()||a.index==="?",_n=(a,e)=>zs(a,e),As=(a,e)=>{const s=a.split(`
3
3
  `),r=e.split(`
4
4
  `),x=Math.min(s.length,r.length);for(let m=0;m<x;m+=1)if(s[m]!==r[m])return m+1;return r.length>s.length?s.length+1:s.length>r.length?Math.max(1,r.length):1},Vt=(a,e,s)=>Qi(e)?{original:"",modified:"",isBinary:!0,patch:e,contextMode:s}:{original:"",modified:"",patch:e,fileDiff:Yi(a,e),contextMode:s},qt=(a,e)=>e.isBinary||e.submodule?null:e.fileDiff?e.fileDiff:!e.original&&!e.modified?null:Hs({name:a,contents:e.original},{name:a,contents:e.modified}),Ls=new WeakMap;let Ps=0;const Ms=a=>{if(!a)return"absent";let e=Ls.get(a);return e===void 0&&(Ps+=1,e=Ps,Ls.set(a,e)),String(e)},Bs=(a,e)=>e===a||a.endsWith("/")&&e.startsWith(a),In=(a,e,s)=>{const r=a??0,x=e??0;return!r&&!x?null:t.jsxs("span",{className:Ie("typography-meta flex items-center gap-1 text-xs whitespace-nowrap","flex-shrink-0",s?.className),children:[r?t.jsxs("span",{style:{color:"var(--status-success)"},children:["+",r]}):null,x?t.jsxs("span",{style:{color:"var(--status-error)"},children:["-",x]}):null]})},bo=i.memo(a=>{const e=He.c(11),{changedFiles:s,selectedFile:r,onSelectFile:x}=a,{t:m}=qe();if(s.length===0)return null;let b;if(e[0]!==s||e[1]!==x||e[2]!==r||e[3]!==m){let w;e[5]!==x||e[6]!==r||e[7]!==m?(w=y=>{const d=un(y),N=r===y.path;return t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>x(y.path),className:Ie("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start transition-colors",N?"bg-interactive-selection text-interactive-selection-foreground":"text-muted-foreground hover:bg-interactive-hover hover:text-foreground"),children:[t.jsx(mn,{filePath:y.path,className:"h-3.5 w-3.5 flex-shrink-0"}),t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:{color:d.color},title:m(d.descriptionKey),"aria-label":m(d.descriptionKey),children:d.code}),t.jsx("span",{className:"oc-ui-start-align min-w-0 flex-1 truncate typography-meta",style:{direction:"rtl",unicodeBidi:"plaintext"},title:y.path,children:y.path}),In(y.insertions,y.deletions)]})},y.path)},e[5]=x,e[6]=r,e[7]=m,e[8]=w):w=e[8],b=s.map(w),e[0]=s,e[1]=x,e[2]=r,e[3]=m,e[4]=b}else b=e[4];let k;return e[9]!==b?(k=t.jsx(On,{outerClassName:"flex-1 min-h-0",className:"px-2 py-2",children:t.jsx("ul",{className:"flex flex-col gap-1",children:b})}),e[9]=b,e[10]=k):k=e[10],k}),Ln=160,wo=.5,jo=i.memo(a=>{const e=He.c(21),{changedFiles:s,selectedFile:r,onSelectFile:x}=a,{t:m}=qe(),[b,k]=i.useState(Ro);let w;e[0]!==s||e[1]!==b?(w=Us(s,b),e[0]=s,e[1]=b,e[2]=w):w=e[2];const y=w;let d,N;e[3]!==r?(d=()=>{r&&k(P=>{const g=Array.from(P).filter(R=>r.startsWith(`${R}/`));if(g.length===0)return P;const I=new Set(P);return g.forEach(R=>I.delete(R)),I})},N=[r],e[3]=r,e[4]=d,e[5]=N):(d=e[4],N=e[5]),i.useEffect(d,N);const h=i.useRef(null),u=Yr(h);let C;e[6]!==u?(C=(P,g)=>{u(P,g,()=>k(I=>{const R=new Set(I);return R.delete(P)||R.add(P),R}))},e[6]=u,e[7]=C):C=e[7];const S=C;let j;if(e[8]!==x||e[9]!==y||e[10]!==r||e[11]!==m||e[12]!==S){let P;e[14]!==x||e[15]!==r||e[16]!==m||e[17]!==S?(P=g=>{const I=Rr(g.depth);if(g.kind==="directory")return t.jsxs("li",{className:"relative","data-tree-disclosure-path":g.path,children:[t.jsx(Ss,{depth:g.depth}),t.jsxs("button",{type:"button",onClick:()=>S(g.path,g.expanded),"aria-expanded":g.expanded,"aria-label":g.expanded?m("diffView.fileTree.collapseDirectoryAria",{path:g.path}):m("diffView.fileTree.expandDirectoryAria",{path:g.path}),className:"oc-file-tree-row flex w-full items-center gap-1 rounded-md py-1 text-start text-muted-foreground hover:bg-interactive-hover hover:text-foreground hover:[--oc-file-tree-row-fill:var(--interactive-hover)]",style:{paddingInlineStart:I},title:g.path,children:[t.jsx(Cr,{expanded:g.expanded}),t.jsx("span",{className:"oc-file-tree-row-name typography-meta",children:g.label}),t.jsx(Rs,{className:"pe-2"})]})]},g.key);const R=un(g.file),le=r===g.file.path;return t.jsxs("li",{className:"relative","data-tree-disclosure-path":g.file.path,children:[t.jsx(Ss,{depth:g.depth}),t.jsxs("button",{type:"button",onClick:()=>x(g.file.path),"aria-current":le?"true":void 0,className:Ie("oc-file-tree-row flex w-full items-center gap-1.5 rounded-md py-1 text-start",Dr(le)),style:{paddingInlineStart:I},title:g.file.path,children:[t.jsx(mn,{filePath:g.file.path,className:"ms-0.5 size-3.5 flex-shrink-0"}),t.jsx("span",{className:"oc-file-tree-row-name typography-meta",children:g.name}),t.jsxs(Rs,{className:"pe-2",children:[t.jsx(Ks,{path:g.file.path}),t.jsx(Fr,{code:R.code,color:R.color,label:m(R.descriptionKey)})]})]})]},g.key)},e[14]=x,e[15]=r,e[16]=m,e[17]=S,e[18]=P):P=e[18],j=y.map(P),e[8]=x,e[9]=y,e[10]=r,e[11]=m,e[12]=S,e[13]=j}else j=e[13];let F;return e[19]!==j?(F=t.jsx(On,{outerClassName:"flex-1 min-h-0",className:"px-1.5 py-1.5",children:t.jsx("ul",{ref:h,className:"relative flex w-max min-w-full flex-col",children:j})}),e[19]=j,e[20]=F):F=e[20],F}),vo=i.memo(a=>{const e=He.c(20),{filePath:s,diff:r,renderSideBySide:x}=a,{t:m}=qe(),b=r.original.length>0,k=r.modified.length>0,w=x?"flex flex-row gap-6 items-start justify-center":"flex flex-col gap-4 items-center",y=x?"flex flex-col items-center gap-2 flex-1 min-w-0":"flex flex-col items-center gap-2";let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={contain:"layout"},e[0]=d):d=e[0];let N;e[1]!==r.original||e[2]!==s||e[3]!==b||e[4]!==y||e[5]!==x||e[6]!==m?(N=b&&t.jsxs("div",{className:y,children:[t.jsx("span",{className:"typography-meta text-muted-foreground font-medium",children:m("diffView.image.original")}),t.jsx(Cs,{src:r.original,alt:m("diffView.image.originalAlt",{path:s}),variant:"large",className:"flex min-h-40 min-w-40 max-w-full items-center justify-center",imgClassName:x?"max-w-full max-h-[70vh] object-contain":"max-w-full object-contain",imgStyle:{imageRendering:"auto"}})]}),e[1]=r.original,e[2]=s,e[3]=b,e[4]=y,e[5]=x,e[6]=m,e[7]=N):N=e[7];let h;e[8]!==r.modified||e[9]!==s||e[10]!==k||e[11]!==b||e[12]!==y||e[13]!==x||e[14]!==m?(h=k&&t.jsxs("div",{className:y,children:[t.jsx("span",{className:"typography-meta text-muted-foreground font-medium",children:m(b?"diffView.image.modified":"diffView.image.new")}),t.jsx(Cs,{src:r.modified,alt:m("diffView.image.modifiedAlt",{path:s}),variant:"large",className:"flex min-h-40 min-w-40 max-w-full items-center justify-center",imgClassName:x?"max-w-full max-h-[70vh] object-contain":"max-w-full object-contain",imgStyle:{imageRendering:"auto"}})]}),e[8]=r.modified,e[9]=s,e[10]=k,e[11]=b,e[12]=y,e[13]=x,e[14]=m,e[15]=h):h=e[15];let u;return e[16]!==w||e[17]!==N||e[18]!==h?(u=t.jsx("div",{className:"w-full overflow-auto p-4",style:d,children:t.jsxs("div",{className:w,children:[N,h]})}),e[16]=w,e[17]=N,e[18]=h,e[19]=u):u=e[19],u}),qn=i.memo(a=>{const e=He.c(40),{filePath:s,diff:r,commentOrigin:x,staged:m,renderSideBySide:b,wrapLines:k,hideWhitespace:w,hunkActions:y,onExpandContextRequest:d,pendingContextExpansion:N,contextLoading:h,viewerRef:u,onFindWordRequest:C}=a;let S;e[0]!==s?(S=Nr(s)||"text",e[0]=s,e[1]=S):S=e[1];const j=S;if(r.submodule){let g;return e[2]!==r.submodule||e[3]!==m?(g=t.jsx(Or,{state:r.submodule,staged:m}),e[2]=r.submodule,e[3]=m,e[4]=g):g=e[4],g}if(r.isBinary){let g;return e[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(yo,{}),e[5]=g):g=e[5],g}if(Pn(s)&&Gs(r.original,r.modified)){let g;e[6]!==x||e[7]!==r||e[8]!==s||e[9]!==w||e[10]!==b||e[11]!==m||e[12]!==k?(g=R=>t.jsx(qn,{filePath:s,diff:{...r,original:R.original,modified:R.modified},commentOrigin:x,staged:m,renderSideBySide:b,wrapLines:k,hideWhitespace:w}),e[6]=x,e[7]=r,e[8]=s,e[9]=w,e[10]=b,e[11]=m,e[12]=k,e[13]=g):g=e[13];let I;return e[14]!==r.modified||e[15]!==r.original||e[16]!==s||e[17]!==g?(I=t.jsx(Qr,{filePath:s,original:r.original,modified:r.modified,renderText:g}),e[14]=r.modified,e[15]=r.original,e[16]=s,e[17]=g,e[18]=I):I=e[18],I}if(Sr(s)){let g;return e[19]!==r||e[20]!==s||e[21]!==b?(g=t.jsx(vo,{filePath:s,diff:r,renderSideBySide:b}),e[19]=r,e[20]=s,e[21]=b,e[22]=g):g=e[22],g}let F;e[23]===Symbol.for("react.memo_cache_sentinel")?(F={contain:"layout"},e[23]=F):F=e[23];let P;return e[24]!==x||e[25]!==h||e[26]!==r.fileDiff||e[27]!==r.modified||e[28]!==r.original||e[29]!==s||e[30]!==w||e[31]!==y||e[32]!==j||e[33]!==d||e[34]!==C||e[35]!==N||e[36]!==b||e[37]!==u||e[38]!==k?(P=t.jsx("div",{className:"w-full",style:F,children:t.jsx(Jr,{ref:u,original:r.original,modified:r.modified,fileDiff:r.fileDiff,language:j,fileName:s,commentOrigin:x,renderSideBySide:b,wrapLines:k,hideWhitespace:w,layout:"inline",hunkActions:y,onExpandContextRequest:d,pendingContextExpansion:N,contextLoading:h,onFindWordRequest:C})}),e[24]=x,e[25]=h,e[26]=r.fileDiff,e[27]=r.modified,e[28]=r.original,e[29]=s,e[30]=w,e[31]=y,e[32]=j,e[33]=d,e[34]=C,e[35]=N,e[36]=b,e[37]=u,e[38]=k,e[39]=P):P=e[39],P}),Js=a=>a.files.map(e=>{const s=a.diffStats?.staged?.[e.path],r=a.diffStats?.working?.[e.path];return{...e,insertions:(s?.insertions??0)+(r?.insertions??0),deletions:(s?.deletions??0)+(r?.deletions??0),isNew:Xs(e)}}).sort((e,s)=>e.path.localeCompare(s.path)),ko=i.memo(a=>{const e=He.c(55),{directory:s,file:r,revision:x,renderSideBySide:m,wrapLines:b,hideWhitespace:k,findKeyPrefix:w,registerViewerRef:y,onFindWordRequest:d,findReveal:N}=a,h=N===void 0?null:N,{t:u}=qe(),{git:C}=dn(),[S,j]=i.useState(Bn),[F,P]=i.useState(!1),g=w===void 0?null:`${w}${r.path}`;let I;e[0]!==g||e[1]!==h?.key?(I=()=>{g!==null&&h?.key===g&&P(!0)},e[0]=g,e[1]=h?.key,e[2]=I):I=e[2];let R;e[3]!==g||e[4]!==h?(R=[g,h],e[3]=g,e[4]=h,e[5]=R):R=e[5],i.useEffect(I,R);let le;e[6]!==g||e[7]!==y?(le=A=>{g!==null&&y?.(g,A)},e[6]=g,e[7]=y,e[8]=le):le=e[8];const ye=le;let Y;e[9]!==g||e[10]!==d?(Y=A=>{g!==null&&d?.(g,A)},e[9]=g,e[10]=d,e[11]=Y):Y=e[11];const ee=Y;let ne;e[12]!==r?(ne=an(r)&&!ln(r),e[12]=r,e[13]=ne):ne=e[13];const W=ne,p=`${r.index}:${r.working_dir}:${r.insertions}:${r.deletions}`;let D;e[14]!==s||e[15]!==r.path||e[16]!==C||e[17]!==W||e[18]!==u?(D=()=>{let A=!1;const B=Se();return(!C.getGitFileDiff||!C.getGitDiff?Promise.reject(new Error(u("diffView.unavailable.missingTitle"))):Je(r.path)?C.getGitFileDiff(s,{path:r.path,staged:W}).then(Co):C.getGitDiff(s,{path:r.path,staged:W,contextLines:gt}).then(M=>({...Vt(r.path,M.diff,"patch"),submodule:M.submodule}))).then(M=>{A||B!==Se()||j({status:"ready",data:M})},M=>{if(A||B!==Se())return;const L=M instanceof cn?M.reason==="nested_repository"?u("diffView.unavailable.nestedRepositoryTitle"):M.reason==="untracked_directory"?u("diffView.unavailable.untrackedDirectoryTitle"):u("diffView.unavailable.missingTitle"):M instanceof Error?M.message:String(M);j({status:"error",message:L})}),()=>{A=!0}},e[14]=s,e[15]=r.path,e[16]=C,e[17]=W,e[18]=u,e[19]=D):D=e[19];let z;if(e[20]!==s||e[21]!==r.path||e[22]!==p||e[23]!==C||e[24]!==x||e[25]!==W||e[26]!==u?(z=[s,r.path,p,C,x,W,u],e[20]=s,e[21]=r.path,e[22]=p,e[23]=C,e[24]=x,e[25]=W,e[26]=u,e[27]=z):z=e[27],i.useEffect(D,z),S.status==="loading"){let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),e[28]=A):A=e[28];let B;e[29]!==u?(B=u("diffView.state.loadingDiff"),e[29]=u,e[30]=B):B=e[30];let q;return e[31]!==B?(q=t.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 py-4 typography-meta text-muted-foreground",children:[A,B]}),e[31]=B,e[32]=q):q=e[32],q}if(S.status==="error"){let A;return e[33]!==S.message?(A=t.jsx("div",{className:"px-4 py-4 text-center typography-meta text-muted-foreground",children:S.message}),e[33]=S.message,e[34]=A):A=e[34],A}if(!F&&r.insertions+r.deletions>Mn){const A=r.insertions+r.deletions;let B;e[35]!==u||e[36]!==A?(B=u("diffView.state.largeDiff",{count:A}),e[35]=u,e[36]=A,e[37]=B):B=e[37];let q;e[38]===Symbol.for("react.memo_cache_sentinel")?(q=()=>P(!0),e[38]=q):q=e[38];let M;e[39]!==u?(M=u("diffView.actions.renderAnyway"),e[39]=u,e[40]=M):M=e[40];let L;e[41]!==M?(L=t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:q,children:M}),e[41]=M,e[42]=L):L=e[42];let se;return e[43]!==B||e[44]!==L?(se=t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-4 typography-meta text-muted-foreground",children:[B,L]}),e[43]=B,e[44]=L,e[45]=se):se=e[45],se}let Z;return e[46]!==r.path||e[47]!==ee||e[48]!==k||e[49]!==m||e[50]!==S.data||e[51]!==ye||e[52]!==W||e[53]!==b?(Z=t.jsx(qn,{filePath:r.path,diff:S.data,staged:W,renderSideBySide:m,wrapLines:b,hideWhitespace:k,viewerRef:ye,onFindWordRequest:ee}),e[46]=r.path,e[47]=ee,e[48]=k,e[49]=m,e[50]=S.data,e[51]=ye,e[52]=W,e[53]=b,e[54]=Z):Z=e[54],Z}),No=i.memo(a=>{const e=He.c(78),{directory:s,revision:r,renderSideBySide:x,wrapLines:m,hideWhitespace:b,findKeyPrefix:k,registerViewerRef:w,onFindWordRequest:y,findReveal:d}=a,N=d===void 0?null:d,{t:h}=qe(),{git:u}=dn(),C=kr(Fo),S=qs(Do);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={kind:"loading"},e[0]=j):j=e[0];const[F,P]=i.useState(j),[g,I]=i.useState(0),[R,le]=i.useState(To);let ye;e[1]!==s||e[2]!==u?(ye=()=>{let _=!1;const oe=Se();return u.getGitStatus(s,{fresh:!0}).then(Q=>{_||oe!==Se()||P({kind:"ready",files:Js(Q)})},Q=>{_||oe!==Se()||P({kind:"error",message:Q instanceof Error?Q.message:String(Q)})}),()=>{_=!0}},e[1]=s,e[2]=u,e[3]=ye):ye=e[3];let Y;e[4]!==s||e[5]!==u||e[6]!==g||e[7]!==r?(Y=[s,u,r,g],e[4]=s,e[5]=u,e[6]=g,e[7]=r,e[8]=Y):Y=e[8],i.useEffect(ye,Y);let ee,ne;e[9]!==k||e[10]!==N?(ee=()=>{if(!N||k===void 0||!N.key.startsWith(k))return;const _=N.key.slice(k.length);le(oe=>oe.has(_)?oe:new Set(oe).add(_))},ne=[k,N],e[9]=k,e[10]=N,e[11]=ee,e[12]=ne):(ee=e[11],ne=e[12]),i.useEffect(ee,ne);let W;e[13]===Symbol.for("react.memo_cache_sentinel")?(W=_=>{le(oe=>{const Q=new Set(oe);return Q.delete(_)||Q.add(_),Q})},e[13]=W):W=e[13];const p=W;let D;e[14]!==C||e[15]!==s||e[16]!==S||e[17]!==h?(D=async()=>{const _=await C(s);if(!_){Wt.error(h("diffView.nestedRepository.openFailed"));return}S({selectedProjectId:_.id,directoryOverride:_.path})},e[14]=C,e[15]=s,e[16]=S,e[17]=h,e[18]=D):D=e[18];const z=D;let Z;e[19]!==h?(Z=h("diffView.unavailable.nestedRepositoryTitle"),e[19]=h,e[20]=Z):Z=e[20];let A;e[21]!==Z?(A=t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:Z}),e[21]=Z,e[22]=A):A=e[22];let B;e[23]!==h?(B=h("diffView.nestedRepository.description"),e[23]=h,e[24]=B):B=e[24];let q;e[25]!==B?(q=t.jsx("div",{className:"typography-meta text-muted-foreground",children:B}),e[25]=B,e[26]=q):q=e[26];let M;e[27]!==A||e[28]!==q?(M=t.jsxs("div",{className:"min-w-0 flex-1",children:[A,q]}),e[27]=A,e[28]=q,e[29]=M):M=e[29];let L;e[30]!==z?(L=()=>{z()},e[30]=z,e[31]=L):L=e[31];let se;e[32]!==h?(se=h("diffView.nestedRepository.openAsProject"),e[32]=h,e[33]=se):se=e[33];let fe;e[34]!==L||e[35]!==se?(fe=t.jsx(pt,{asChild:!0,children:t.jsx(Xe,{variant:"outline",size:"sm",className:"shrink-0",onClick:L,children:se})}),e[34]=L,e[35]=se,e[36]=fe):fe=e[36];let ie;e[37]!==h?(ie=h("contextTooltips.diff.openAsProject"),e[37]=h,e[38]=ie):ie=e[38];let he;e[39]!==ie?(he=t.jsx(ht,{sideOffset:6,children:ie}),e[39]=ie,e[40]=he):he=e[40];let re;e[41]!==fe||e[42]!==he?(re=t.jsxs(mt,{children:[fe,he]}),e[41]=fe,e[42]=he,e[43]=re):re=e[43];let ce;e[44]!==M||e[45]!==re?(ce=t.jsxs("div",{className:"flex items-center gap-3 px-3",children:[M,re]}),e[44]=M,e[45]=re,e[46]=ce):ce=e[46];let be;e[47]!==F.kind||e[48]!==h?(be=F.kind==="loading"?t.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 py-4 typography-meta text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),h("diffView.nestedRepository.loading")]}):null,e[47]=F.kind,e[48]=h,e[49]=be):be=e[49];let H;e[50]!==F.kind||e[51]!==F.message||e[52]!==h?(H=F.kind==="error"?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-4",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:h("diffView.nestedRepository.loadFailed")}),t.jsx("div",{className:"typography-meta text-muted-foreground max-w-[32rem] text-center",children:F.message}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:()=>I(Vo),children:h("diffView.actions.retry")})]}):null,e[50]=F.kind,e[51]=F.message,e[52]=h,e[53]=H):H=e[53];let J;e[54]!==F.files||e[55]!==F.kind||e[56]!==h?(J=F.kind==="ready"&&F.files.length===0?t.jsx("div",{className:"px-3 typography-meta text-muted-foreground",children:h("diffView.nestedRepository.noChanges")}):null,e[54]=F.files,e[55]=F.kind,e[56]=h,e[57]=J):J=e[57];let $;e[58]!==s||e[59]!==R||e[60]!==k||e[61]!==N||e[62]!==b||e[63]!==y||e[64]!==w||e[65]!==x||e[66]!==r||e[67]!==F.files||e[68]!==F.kind||e[69]!==h||e[70]!==m?($=F.kind==="ready"&&F.files.length>0?t.jsx("ul",{className:"flex flex-col",children:F.files.map(_=>{const oe=R.has(_.path),Q=un(_);return t.jsxs("li",{children:[t.jsxs("button",{type:"button","aria-expanded":oe,onClick:()=>p(_.path),className:"flex w-full items-center gap-2 px-3 py-1 text-start text-foreground/80 transition-colors hover:text-foreground",title:_.path,children:[t.jsx(X,{name:oe?"arrow-down-s":"arrow-right-s",className:"size-4 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"typography-micro font-semibold w-4 shrink-0 text-center uppercase",style:{color:Q.color},title:h(Q.descriptionKey),"aria-label":h(Q.descriptionKey),children:Q.code}),t.jsx(mn,{filePath:_.path,className:"size-3.5 shrink-0"}),t.jsx("span",{className:"oc-ui-start-align min-w-0 flex-1 truncate typography-meta",style:{direction:"rtl",unicodeBidi:"plaintext"},children:_.path}),In(_.insertions,_.deletions)]}),oe?t.jsx(ko,{directory:s,file:_,revision:r,renderSideBySide:x,wrapLines:m,hideWhitespace:b,findKeyPrefix:k,registerViewerRef:w,onFindWordRequest:y,findReveal:N?.key===`${k}${_.path}`?N:null}):null]},_.path)})}):null,e[58]=s,e[59]=R,e[60]=k,e[61]=N,e[62]=b,e[63]=y,e[64]=w,e[65]=x,e[66]=r,e[67]=F.files,e[68]=F.kind,e[69]=h,e[70]=m,e[71]=$):$=e[71];let Re;return e[72]!==ce||e[73]!==be||e[74]!==H||e[75]!==J||e[76]!==$?(Re=t.jsxs("div",{className:"flex flex-col gap-2 py-3",children:[ce,be,H,J,$]}),e[72]=ce,e[73]=be,e[74]=H,e[75]=J,e[76]=$,e[77]=Re):Re=e[77],Re}),So=i.memo(({visible:a=!0,directory:e,file:s,layout:r,wrapLines:x,hideWhitespace:m=!1,isSelected:b,isExpanded:k,isMounted:w,onSelect:y,onExpandedChange:d,registerSectionRef:N,showOpenInEditorAction:h=!1,isOpeningInEditor:u=!1,onOpenInEditor:C,staged:S=!1,loadFullFiles:j=!1,initialDiffData:F=null,comparisonDiff:P,commentOrigin:g,onRetryComparisonDiff:I,loadFullComparisonDiff:R,readOnlyActions:le=!1,hunkActionsEnabled:ye=!1,contentRevision:Y=0,registerViewerRef:ee,onFindWordRequest:ne,onFullContextChange:W,findReveal:p=null})=>{const{t:D}=qe(),{git:z}=dn(),Z=ro({fileLabel:s.path,origin:P?g:void 0}),A=Te(i.useCallback(T=>T.directories.get(e)?.diffCache.get(s.path)??null,[e,s.path])),B=Te(T=>T.setDiff),q=Te(T=>T.fetchStatus),M=ue(T=>T.setDiffFileLayout),[L,se]=i.useState(0),[fe,ie]=i.useState(null),[he,re]=i.useState(!1),[ce,be]=i.useState(null),H=ce!==null&&ce.source===P?ce.result:P,J=!!e&&!F&&(!P||!!R),$=i.useMemo(()=>H?H.status==="error"?{kind:"error",message:H.message}:null:fe,[H,fe]),Re=H?H.status==="loading":he,[_,oe]=i.useState(null),Q=i.useRef(!1),[Qe,Et]=i.useState(null),[xt,Ce]=i.useState(!1),[Ye,yt]=i.useState(null),[et,bt]=i.useState(null),[We,tt]=i.useState(null),Be=j||We!==null;i.useEffect(()=>{if(!(!Be||!W))return W(s.path,!0),()=>W(s.path,!1)},[s.path,Be,W]),i.useEffect(()=>{p?.key===s.path&&Ce(!0)},[s.path,p]),i.useEffect(()=>{if(!We||!R||!P||P.status!=="ready"||ce?.source===P)return;let T=!1;return R(s.path).then(K=>{if(!T){if(K.status==="error"){Wt.error(K.message),tt(null);return}be({source:P,result:K})}}),()=>{T=!0}},[We,s.path,ce,R,P]);const Ve=i.useRef(null),pn=i.useRef(null),wt=i.useMemo(()=>un(s),[s]),nt=r==="side-by-side",l=Be?"full":"patch",Ee=`${s.index}:${s.working_dir}:${s.insertions}:${s.deletions}`,ke=ye&&!le&&!F&&!H&&!Je(s.path),st=JSON.stringify([Se(),e,s.path,S,Ee,L,Y]),ge=Qe?.scope===st?Qe.patch:null,At=Qe?.scope===st?Qe.submodule:null,Ne=i.useMemo(()=>H?H.status==="ready"?H.data:null:F||(S?et:Ye||(A?{original:A.original,modified:A.modified,isBinary:A.isBinary,submodule:A.submodule,contextMode:"full"}:null)),[H,A,F,Ye,S,et]),jt=Ne?.contextMode===l,Lt=i.useCallback(T=>{pn.current=T,N(s.path,T)},[s.path,N]),zt=i.useCallback(T=>{ee?.(s.path,T)},[s.path,ee]),$t=i.useCallback(T=>{ne?.(s.path,T)},[s.path,ne]),vt=i.useCallback(T=>{d(s.path,T)},[s.path,d]),Pt=i.useCallback(()=>{y(s.path)},[s.path,y]),je=i.useRef(S);i.useEffect(()=>{je.current!==S&&(je.current=S,S?bt(null):yt(null),ie(null),Ve.current=null)},[S]);const it=`${Y}:${Ee}`,[rt,Gt]=i.useState(it),ot=rt===it;i.useEffect(()=>{ot||(ie(null),Ve.current=null)},[ot]),i.useEffect(()=>{if(!a||!k||!w||fe)return;if(!e||H||F||Ne&&jt&&ot&&(!ke||ge!==null)){Ve.current=null,re(!1);return}const T=`${e}::${s.path}::${S?"staged":"unstaged"}::${Ee}::${l}::${L}::${Y}`;if(Ve.current===T)return;Ve.current=T,ie(null),re(!0);let K=!1;const _e=Se(),$e=Be?on:gt,de=!z.getGitFileDiff||!z.getGitDiff?Promise.reject(new Error(D("diffView.unavailable.missingTitle"))):Je(s.path)?z.getGitFileDiff(e,{path:s.path,staged:S}):!Be&&ge!==null?Promise.resolve({diff:ge,submodule:At}):z.getGitDiff(e,{path:s.path,staged:S,contextLines:$e}),ve=ke&&Be&&ge===null&&z.getGitDiff?z.getGitDiff(e,{path:s.path,staged:S,contextLines:gt}).then(U=>U.diff):Promise.resolve(ge),Ke=Promise.all([de,ve]),Ue=ho;let Nt;const Mt=new Promise((U,St)=>{Nt=setTimeout(()=>St(new Error(`Timed out after ${Ue}ms`)),Ue)});return Promise.race([Ke,Mt]).then(([U,St])=>{if(K||_e!==Se())return;const Fe="diff"in U&&!Be?U.diff:St;if(ke&&Be&&Fe!==null&&/^@@\s/m.test(Fe)&&"diff"in U&&U.diff!==Fe&&!Ki(U.diff,Fe))throw Et(null),new Error(D("diffView.hunk.unavailable"));if(ke&&Fe!==null&&Et({scope:st,patch:Fe,submodule:U.submodule}),"diff"in U){const me={...Vt(s.path,U.diff,l),submodule:U.submodule};S?bt(me):yt(me)}else{const me={original:U.original??"",modified:U.modified??"",isBinary:U.isBinary,submodule:U.submodule,contextMode:"full"};S?bt(me):(B(e,s.path,me,_e),yt(me))}Gt(it),re(!1)}).catch(U=>{if(!(K||_e!==Se())){if(re(!1),U instanceof cn){ie({kind:"unavailable",reason:U.reason}),U.reason==="path_not_found"&&q(e,z,{force:!0,silent:!0});return}ie({kind:"error",message:U instanceof Error?U.message:String(U)})}}).finally(()=>clearTimeout(Nt)),()=>{K=!0,clearTimeout(Nt),Ve.current===T&&(Ve.current=null)}},[ge,At,Y,it,ke,ot,st,H,l,Ne,jt,L,e,q,s.path,Ee,z,F,k,w,Be,fe,B,S,D,a]);const Ht=i.useCallback(()=>{vt(!k),Pt()},[vt,Pt,k]),Ae=i.useCallback(()=>{ie(null),Et(null),yt(null),bt(null),Ve.current=null,se(T=>T+1)},[]),kt=vr(),{confirm:at}=kt,lt=i.useCallback(async(T,K)=>{if(!e||!ke||Re||$||Q.current||_!==null)return;const _e=ge?Ui(ge,T):null;if(!_e){Wt.error(D("diffView.hunk.unavailable"));return}if(S&&K!=="unstage"||!S&&K==="unstage"||K==="discard"&&!await at({title:D("diffView.hunk.discardDialogTitle"),message:D("diffView.hunk.discardDescription",{path:s.path}),action:D("diffView.hunk.discard"),destructive:!0})||Q.current)return;Q.current=!0;const $e=Se();oe({index:T,action:K});try{const de=K==="stage"?z.stageGitHunk:K==="unstage"?z.unstageGitHunk:z.revertGitHunk;if(!de){Wt.error(D("diffView.hunk.unsupported"));return}if(await de(e,s.path,_e),$e!==Se())return;Ae(),Ws.requestGitRefresh({directory:e,paths:[s.path]}),await q(e,z)}catch(de){if($e!==Se())return;Ae(),Wt.error(de instanceof Error&&de.message?de.message:D("diffView.hunk.unavailable"))}finally{Q.current=!1,oe(de=>de?.index===T&&de.action===K?null:de)}},[ge,at,ke,Re,$,e,q,s.path,z,_,Ae,S,D]),ze=i.useMemo(()=>ke&&ge!==null?Xi(ge):[],[ge,ke]),Kt=i.useCallback(T=>t.jsx(ao,{index:T,staged:S,busyHunk:_,disabled:Re||!!$,onAction:lt}),[$,lt,_,Re,S]),hn=i.useMemo(()=>ze.length>0?{anchors:ze,render:Kt}:void 0,[ze,Kt]);return t.jsxs("div",{ref:Lt,className:"scroll-mt-9 border-b border-[var(--interactive-border)]/40 last:border-b-0",children:[t.jsxs("div",{className:"sticky top-0 z-30 border-b border-[var(--interactive-border)]/35 bg-[var(--surface-elevated)]/90 backdrop-blur-md supports-[backdrop-filter]:bg-[var(--surface-elevated)]/80",children:[t.jsxs("div",{role:"button",tabIndex:0,onClick:Ht,onKeyDown:T=>{T.target===T.currentTarget&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),Ht())},className:Ie("cursor-pointer","group/header relative grid min-h-9 w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 overflow-hidden px-3 py-2","bg-transparent","text-muted-foreground hover:text-foreground",b?"bg-[var(--interactive-selection)]/35":null),children:[t.jsx("div",{className:"absolute inset-0 pointer-events-none group-hover/header:bg-[var(--interactive-hover)]/50"}),t.jsxs("div",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[t.jsx("span",{className:"flex size-5 items-center justify-center opacity-70 group-hover/header:opacity-100",children:k?t.jsx(X,{name:"arrow-down-s",className:"size-4"}):t.jsx(X,{name:"arrow-right-s",className:"size-4"})}),t.jsx("span",{className:"typography-micro font-semibold leading-none w-4 text-center uppercase",style:{color:wt.color},title:D(wt.descriptionKey),"aria-label":D(wt.descriptionKey),children:wt.code}),t.jsx("span",{className:"min-w-0 flex-1 overflow-hidden typography-ui-label",title:s.path,children:t.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(mn,{filePath:s.path,className:"h-3.5 w-3.5 flex-shrink-0 align-middle"}),(()=>{const T=s.path.lastIndexOf("/");if(T===-1)return t.jsx("span",{className:"oc-ui-start-align block min-w-0 truncate typography-ui-label text-foreground",style:{direction:"rtl",unicodeBidi:"plaintext"},children:s.path});const K=s.path.slice(0,T),_e=s.path.slice(T+1);return t.jsxs("span",{dir:"ltr",className:"flex min-w-0 items-baseline overflow-hidden",children:[t.jsx("span",{className:"oc-ui-start-align min-w-0 truncate typography-ui-label text-muted-foreground",style:{direction:"rtl",unicodeBidi:"plaintext"},children:K}),t.jsxs("span",{className:"flex-shrink-0 typography-ui-label",children:[t.jsx("span",{className:"text-muted-foreground",children:"/"}),t.jsx("span",{className:"text-foreground",children:_e})]})]})})()]})})]}),t.jsxs("div",{className:"relative flex shrink-0 items-center justify-self-end gap-2",children:[t.jsx(Ks,{path:s.path}),In(s.insertions,s.deletions),h&&C?t.jsx(rn,{label:D("diffView.actions.openFileInEditorAtChange"),icon:u?"loader-4":"edit",iconClassName:u?"animate-spin":void 0,onClick:T=>{T.stopPropagation(),C(s.path,Ne)},disabled:u}):null,t.jsx(Ji,{onClick:Z.toggle,active:Z.isOpen}),t.jsx($s,{mode:nt?"side-by-side":"unified",onModeChange:T=>{const K=T==="side-by-side"?"side-by-side":"inline";M(s.path,K)}})]})]}),Z.editor]}),Z.cards,k&&t.jsxs("div",{className:"relative bg-background overflow-clip",children:[!w&&!$?t.jsx("div",{className:"h-40 border border-edge-muted bg-background/40"}):null,$?.kind==="unavailable"&&$.reason==="nested_repository"?t.jsx(No,{directory:_n(e,s.path),revision:Y,renderSideBySide:nt,wrapLines:x,hideWhitespace:m,findKeyPrefix:s.path,registerViewerRef:ee,onFindWordRequest:ne,findReveal:p}):null,$?.kind==="unavailable"&&$.reason!=="nested_repository"?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:$.reason==="untracked_directory"?D("diffView.unavailable.untrackedDirectoryTitle"):D("diffView.unavailable.missingTitle")}),t.jsx("div",{className:"typography-meta text-muted-foreground max-w-[32rem] text-center",children:$.reason==="untracked_directory"?D("diffView.unavailable.untrackedDirectoryDescription"):D("diffView.unavailable.missingDescription")}),$.reason==="path_not_found"?t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:Ae,children:D("diffView.actions.retry")}):null]}):null,$?.kind==="error"?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:D("diffView.state.failedToLoadDiff")}),t.jsx("div",{className:"typography-meta text-muted-foreground max-w-[32rem] text-center",children:$.message}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:()=>H?I?.():Ae(),children:D("diffView.actions.retry")})]}):null,w&&Re&&!Ne&&!$?t.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),D("diffView.state.loadingDiff")]}):null,w&&Ne&&!xt&&s.insertions+s.deletions>Mn?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:D("diffView.state.largeDiff",{count:s.insertions+s.deletions})}),t.jsx("div",{className:"typography-meta text-muted-foreground",children:D("diffView.state.largeDiffDescription")}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:()=>Ce(!0),children:D("diffView.actions.renderAnyway")})]}):null,w&&Ne&&(xt||s.insertions+s.deletions<=Mn)?t.jsx(t.Fragment,{children:t.jsx(qn,{filePath:s.path,diff:Ne,commentOrigin:P?g:void 0,staged:S,renderSideBySide:nt,wrapLines:x,hideWhitespace:m,hunkActions:hn,onExpandContextRequest:J?tt:void 0,pendingContextExpansion:We,contextLoading:We!==null&&Ne.contextMode!=="full"&&!$,viewerRef:zt,onFindWordRequest:$t})}):null]}),kt.dialog]})}),Cf=({visible:a=!0,hideStackedFileSidebar:e=!1,stackedDefaultCollapsedAll:s=!1,pinSelectedFileHeaderToTopOnNavigate:r=!1,showOpenInEditorAction:x=!1,diffScope:m="all",onDiffScopeChange:b,targetFilePath:k=null,flushContent:w=!1,directory:y=null})=>{const{t:d}=qe(),N=nr(),h=i.useRef(null);sr(h);const[u,C]=i.useState([]),S=i.useCallback(n=>{if(!n)return;const o=h.current;C(["walkthrough","tree","wrap","whitespace","layout"].filter(c=>o?.hasAttribute(ir[c])??!1))},[]),{git:j,files:F,sourceControl:P}=dn(),g=rr(),I=!!y,R=y??g,le=Te(n=>n.runtimeKey),{gitDirectory:ye,rootIsGitRepo:Y,repositoryOptions:ee,repositoriesKnown:ne,unreadable:W}=or(R??null,{enabled:a,recheckOnOpen:!0}),p=ye??R,D=ar(p,P),z=ue(n=>n.openContextSurface),Z=ue(n=>n.openContextPanelTab),A=lr(n=>n.requestTarget),{screenWidth:B,isMobile:q}=cr(),M=fr(p??null),L=dr(p??null),se=ur(p??null),fe=Te(n=>n.setActiveDirectory),ie=Te(n=>n.ensureStatus),he=Te(n=>n.selectNestedRepo),re=Te(n=>n.fetchStatus),ce=Te(n=>n.fetchBranches),be=Te(n=>n.clearDiffCache),H=Te(n=>n.setDiff),[J,$]=i.useState(null),[Re,_]=i.useState(!1),[oe,Q]=i.useState(null),Qe=i.useRef(null),[Et,xt]=i.useState(null),[Ce,Ye]=i.useState(()=>new Set),[yt,et]=i.useState(()=>new Set),[bt,We]=i.useState(0),[tt,Be]=i.useState(()=>new Map),[Ve,pn]=i.useState(0),[wt,nt]=i.useState(!1),[l,Ee]=i.useState(m===null&&!De()?"branch":m??"working");i.useEffect(()=>{m!==null&&Ee(m)},[m]);const ke=ue(n=>n.pendingDiffFile),st=ue(n=>n.pendingDiffStaged),ge=ue(n=>n.pendingDiffScope),At=ue(n=>n.setPendingDiffFile),Ne=ue(n=>n.pendingTurnDiffFile),jt=ue(n=>n.setPendingTurnDiffFile),Lt=ue(n=>n.diffLayoutPreference),zt=ue(n=>n.diffFileLayout),$t=ue(n=>n.setDiffLayoutForAllFiles),vt=ue(n=>n.diffWrapLines),Pt=ue(n=>n.setDiffWrapLines),je=ue(n=>n.diffHideWhitespace),it=ue(n=>n.setDiffHideWhitespace),rt=ue(n=>n.diffFileListMode),Gt=ue(n=>n.setDiffFileListMode),ot=ue(n=>n.openContextFileAtLine),Ht=qs(n=>n.currentSessionId),Ae=I?null:Ht,kt=vt,at=l==="staged"?!0:l==="working"?!1:null,lt=at??Re,ze=q||B<=768,Kt=!!Ae&&l!=="turn"&&l!=="commit"&&l!=="pr"&&!ze&&!De(),hn=l!=="turn"&&!ze&&!De(),T=!e&&!ze&&B>=1024,K=i.useRef(null),_e=i.useRef(null),$e=i.useRef(new Map),de=i.useRef(null),ve=i.useRef(null),Ke=i.useRef(!1),Ue=i.useRef(null),Nt=i.useRef(null),Mt=i.useRef(null),U=i.useRef(null),St=i.useCallback(()=>{const n=K.current;if(!n)return null;const o=n.getBoundingClientRect().top,c=[];for(const[f,v]of $e.current)v&&c.push({path:f,top:v.getBoundingClientRect().top});return Ts(o,c)},[]),Fe=i.useCallback(()=>{de.current=null,Ke.current=!1,xt(null),ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null)},[]),me=i.useCallback(n=>{Ye(o=>{if(o.has(n))return o;const c=new Set(o);return c.add(n),c})},[]),{diffs:Rt,count:Qs,loaded:Ys,settled:Wn,error:zn,retry:Zs}=Tr(Ae,R??void 0,{enabled:a,live:l==="turn"}),Ut=i.useMemo(()=>{const n=new Map;for(const o of Rt)if(o.file){if(typeof o.patch=="string"){n.set(o.file,Vt(o.file,o.patch,"patch"));continue}n.set(o.file,{original:o.before??"",modified:o.after??"",contextMode:"full"})}return n},[Rt]),ei=i.useMemo(()=>L?.files?L.files.filter(ln).length:0,[L]),ti=i.useMemo(()=>L?.files?L.files.filter(an).length:0,[L]),xe=L?.current??null,Bt=Fs(n=>p?n.diffRequests.get(p):void 0),pe=qi(p??null,xe,D.contexts[0]??null,a&&l==="pr"&&!De(),Bt),gn=pe.readContext,Le=pe.selectedSource,xn=Oi(pe.provider);i.useEffect(()=>{!p||!Bt||!L||Le!==Bt||Fs.getState().settleDiffRequest(p,Bt)},[p,Bt,Le,L]);const Ze=Wi(p??null,xe,a&&l==="commit"&&!De()),ct=Ze.selectedCommit?.hash??null;i.useEffect(()=>{(l==="commit"||l==="pr")&&De()&&(Ee("working"),b?.("working"))},[l,b]);const yn=Te(n=>p?n.directories.get(p)?.branches??null:null),ni=Te(n=>p?n.directories.get(p)?.isLoadingBranches??!1:!1),si=i.useCallback(()=>{p&&ce(p,j)},[p,ce,j]),ii=Vr(p??null,a&&M!==!1,ni,!!yn,si,xo),ri=Ds(n=>n.setOverride),oi=Ds(n=>n.clearOverride),ai=i.useMemo(()=>new Set(D.read?.repository.remotes.map(n=>n.name)??[]),[D.read]),{base:Pe,source:li,resolved:$n,revision:bn}=qr(p??null,xe,a&&!De()&&M!==!1,{branches:yn,remoteNames:ai,primaryRemote:D.contexts[0]?.primaryRemote,readContext:D.contexts[0]??null}),Gn=a&&!De()&&M!==!1;Xr(Gn?p??null:null,Gn?xe:null,D);const wn=!De()&&Er(xe,Pe);i.useEffect(()=>{m===null&&wn&&Ee("branch")},[m,wn]);const ci=L!==null,Hn=De()||M===!1||ii||Ar(xe,Pe,ci,$n&&D.status==="ready"),[fi,di]=i.useState(0);i.useEffect(()=>{const n=_r(l,!Hn);n!==l&&(Ee(n),n==="working"&&m!==null&&b?.("working"))},[l,Hn,m,b]);const jn=i.useMemo(()=>l==="pr"?pe.diffUnavailable?null:Le:l==="commit"&&ct?{kind:"commit",hash:ct}:l==="branch"&&Pe&&xe?{kind:"branch",baseRef:Pe,headRef:xe}:null,[l,Pe,xe,ct,Le,pe.diffUnavailable]),Kn=Le?pe.prs.find(n=>n.number===Le.number)?.headSha:void 0,ui=i.useMemo(()=>Ii(jn,{provider:pe.provider,revision:Kn}),[jn,pe.provider,Kn]),{review:vn,provider:Un}=Wr(pe,p,a&&l==="pr"&&!De()),ae=Lr(p??null,jn,a&&!De(),l==="branch"?bn:"",pe.readContext,pe.provider),{fetchDiff:Xn,fetchFullFile:Jn,fetchVersions:Qn}=ae,Yn=l==="commit"?ae.files:null,Zn=l==="commit"?ae.error:null,Ct=l==="branch"?ae.files:null,es=l==="branch"?ae.error:null,ts=ae.files?l==="pr"?JSON.stringify([ae.key,ae.revision]):ae.key:null,mi=i.useMemo(()=>l==="branch"||l==="commit"||l==="pr"?Array.from(Ce).sort().join("\0"):"",[l,Ce]),ft=i.useCallback(async(n,o=!1)=>{try{if(Pn(n)){const f=await Qn(n);return{status:"ready",data:Gs(f.original,f.modified)?{...f,contextMode:"full"}:{original:"",modified:"",isBinary:!0,contextMode:"full"}}}const c=await Xn(n,o?on:gt);return{status:"ready",data:Vt(n,c.diff,o?"full":"patch")}}catch(c){return{status:"error",message:c instanceof Error?c.message:d("diffView.state.failedToLoadDiff")}}},[Xn,Qn,d]),ns=i.useCallback(async n=>{try{if(Pn(n))return await ft(n);const{original:o,modified:c}=await Jn(n),f=Hs({name:n,contents:o},{name:n,contents:c});return{status:"ready",data:{original:o,modified:c,fileDiff:f,contextMode:"full"}}}catch(o){return{status:"error",message:o instanceof Error?o.message:d("diffView.state.failedToLoadDiff")}}},[ft,Jn,d]),Xt=i.useMemo(()=>l==="branch"||l==="commit"?n=>ft(n,!0):l==="pr"?ns:void 0,[l,ft,ns]),pi=i.useMemo(()=>l==="branch"?Pr(Ct,bn):void 0,[l,Ct,bn]),Jt=Mr(ts,a?mi:"",ts?ft:null,Bn,JSON.stringify([l==="pr"?ae.revision:0,fi]),pi),hi=Ct?.length??null,O=i.useMemo(()=>{if(l==="commit"||l==="pr")return(ae.files??[]).map(f=>({path:f.path,index:"",working_dir:f.status,insertions:f.insertions,deletions:f.deletions,isNew:f.status==="A"}));if(l==="branch")return(Ct??[]).map(f=>({path:f.path,index:"",working_dir:f.status,insertions:0,deletions:0,isNew:f.status==="A"})).sort((f,v)=>f.path.localeCompare(v.path));if(l==="turn")return Rt.map(f=>({path:f.file??"",index:"",working_dir:Br(f.status),insertions:f.additions??0,deletions:f.deletions??0,isNew:f.status==="added"})).filter(f=>f.path).sort((f,v)=>f.path.localeCompare(v.path));if(!L?.files)return[];const n=L.diffStats,o=l==="staged"?an:l==="working"?ln:()=>!0,c=f=>{const v=n?.staged?.[f],E=n?.working?.[f];return l==="staged"?{insertions:v?.insertions??0,deletions:v?.deletions??0}:l==="working"?{insertions:E?.insertions??0,deletions:E?.deletions??0}:{insertions:(v?.insertions??0)+(E?.insertions??0),deletions:(v?.deletions??0)+(E?.deletions??0)}};return L.files.filter(o).map(f=>{const v=c(f.path);return{...f,insertions:v.insertions,deletions:v.deletions,isNew:Xs(f)}}).sort((f,v)=>f.path.localeCompare(v.path))},[l,Ct,ae.files,Rt,L]),kn=i.useMemo(()=>O.map(n=>n.path).join("\0"),[O]);i.useEffect(()=>{const n=kn?kn.split("\0"):[],o=new Set(n),c=`${p??""}:${l}:${s?"collapsed":"default"}`,f=Nt.current!==c;Nt.current=c,Ye(v=>{if(f){const G=s?0:go(n.length);return new Set(n.slice(0,G))}let E=!1;const V=new Set;for(const G of v){if(!o.has(G)){E=!0;continue}V.add(G)}return E?V:v}),et(v=>{if(f)return new Set;let E=!1;const V=new Set;for(const G of v){if(!o.has(G)){E=!0;continue}V.add(G)}return E?V:v})},[l,kn,p,s]);const ss=i.useCallback(()=>{if(Ue.current=null,!a)return;const n=K.current;if(!n)return;const o=n.getBoundingClientRect(),c=o.top-Es,f=o.bottom+Es,v={},E=[];for(const[V,G]of $e.current){if(!G)continue;const we=G.getBoundingClientRect();E.push({path:V,top:we.top}),Ce.has(V)&&(we.bottom<c||we.top>f||(v[V]=!0))}Mt.current=Ts(o.top,E),et(V=>{let G=!1;const we=new Set(V);for(const te of Object.keys(v))we.has(te)||(we.add(te),G=!0);return G?we:V})},[Ce,a]),Ge=i.useCallback(()=>{a&&(typeof window>"u"||Ue.current===null&&(Ue.current=window.requestAnimationFrame(ss)))},[ss,a]),Nn=i.useRef(Ge);Nn.current=Ge,i.useEffect(()=>{const n=K.current;if(!(!a||!n))return Ge(),n.addEventListener("scroll",Ge,{passive:!0}),window.addEventListener("resize",Ge),()=>{n.removeEventListener("scroll",Ge),window.removeEventListener("resize",Ge),Ue.current!==null&&(window.cancelAnimationFrame(Ue.current),Ue.current=null)}},[O,Ce,Ge,a]);const dt=i.useCallback(n=>{const o=zt[n.path];if(o)return o;if(Lt==="inline")return"inline";if(Lt==="side-by-side")return"side-by-side";const c=B<po;return n.isNew||c?"inline":"side-by-side"},[zt,Lt,B]),Sn=i.useMemo(()=>O.length===0?null:O.every(n=>dt(n)==="side-by-side")?"side-by-side":"inline",[O,dt]);i.useEffect(()=>{a&&p&&(fe(p),ie(p,j))},[p,fe,ie,j,a]);const Qt=JSON.stringify([le,p]),Rn=i.useRef({scope:Qt,paths:new Set,dirty:!1,unscoped:!1}),is=i.useRef(a);i.useEffect(()=>{const n=a&&!is.current;if(is.current=a,Rn.current.scope!==Qt&&(Rn.current={scope:Qt,paths:new Set,dirty:!1,unscoped:!1}),!p)return;const o=(f,v)=>{f.length&&(U.current=St()??Mt.current,be(p,f),Be(E=>{const V=new Map(E);for(const G of f)V.set(G,(V.get(G)??0)+1);return V})),v&&pn(E=>E+1),re(p,j,{silent:!0})},c=Rn.current;return a&&(n||c.dirty)&&(o([...c.paths],c.unscoped),c.paths.clear(),c.dirty=!1,c.unscoped=!1),Ws.onGitRefreshHint(f=>{if(vs(f.directory)!==vs(p))return;const v=f.paths??[],E=v.length===0;if(!a){c.dirty=!0,c.unscoped||=E;for(const V of v)c.paths.add(V);return}o(v,E)})},[St,be,p,re,j,Qt,a]),i.useLayoutEffect(()=>{const n=U.current;if(!n)return;U.current=null;const o=K.current,c=$e.current.get(n.path);if(!o||!c)return;const f=o.getBoundingClientRect().top,v=c.getBoundingClientRect().top-f;o.scrollTop=uo(o.scrollTop,n.topOffset,v,o.scrollHeight-o.clientHeight),Mt.current=n},[tt]),i.useEffect(()=>{!a||l!=="all"&&!ge||ke&&(ge&&Ee(ge),$(ke),_(ge==="staged"||!ge&&st),At(null),Ke.current=!0,de.current=ke,me(ke),We(n=>n+1))},[l,me,ke,ge,st,At,a]),i.useEffect(()=>{if(l==="all")return;const n=k?.trim();!n||mr(n)||($(n),_(l==="staged"),Ke.current=!0,de.current=n,me(n),We(o=>o+1))},[l,me,k]);const Yt=i.useCallback(n=>{$(n),_(!1),Ke.current=!0,de.current=n,me(n),We(o=>o+1)},[me]);i.useEffect(()=>{if(!Ne||!a)return;if(m!=="turn"||Ne.sessionId!==Ae){jt(null);return}if(!Wn||l!=="turn")return;jt(null);const n=zs(R,Ne.file),o=Ns(n,R,Rt.flatMap(c=>c.file??[]));if(o){Yt(o);return}Qe.current=null,Q({file:n,picked:!1,statusReadFor:null}),Ee("working"),b?.("working")},[l,Ae,m,Rt,b,Ne,Yt,R,jt,Wn,a]),i.useEffect(()=>{if(!oe||!a||!p)return;if(l!=="working"){Q(null);return}if(!ne)return;const n=pr(oe.file,[...Y&&R?[R]:[],...ee??[]]);if(n&&n!==p&&R){if(oe.picked){Q(null);return}Q({...oe,picked:!0}),he(R,n);return}if(oe.statusReadFor!==p){if(Qe.current===p)return;Qe.current=p,re(p,j,{silent:!0}).finally(()=>{Q(c=>c&&{...c,statusReadFor:p})});return}Q(null);const o=Ns(oe.file,p,O.map(c=>c.path));o&&Yt(o)},[l,oe,O,p,re,j,ne,ee,Yt,R,Y,he,a]),i.useEffect(()=>{if(!J)return;O.some(o=>o.path===J)||($(null),_(!1))},[O,J]);const gi=i.useCallback((n,o)=>{const c=$e.current;o?c.set(n,o):c.delete(n),Nn.current()},[]),xi=i.useCallback((n,o)=>{Fe(),Ye(c=>{const f=c.has(n);if(o===f)return c;const v=new Set(c);return o?v.add(n):v.delete(n),v}),o||et(c=>{if(!c.has(n))return c;const f=new Set(c);return f.delete(n),f}),Nn.current()},[Fe]),yi=i.useCallback(()=>{Fe(),Ye(n=>n.size>0?new Set:new Set(O.map(o=>o.path))),et(new Set),Ge()},[Fe,O,Ge]),bi=i.useCallback(()=>nt(!1),[]),{submitting:Cn,start:wi}=hr(Ae,R,bi),Ft=i.useCallback(n=>{const o=$e.current.get(n),c=K.current;if(!o||!c)return!1;const f=o.getBoundingClientRect().top-c.getBoundingClientRect().top;return c.scrollTo({top:c.scrollTop+f,behavior:"auto"}),!0},[]),ut=i.useCallback(n=>at!==null?at:Re&&n===J,[J,Re,at]);i.useEffect(()=>{const n=de.current;if(!a||!n)return;let o=0;const c=20;let f=!1;const v=(V=!0)=>{f||(f=!0,de.current=null,Ke.current=!1,V&&xt(null),ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null))},E=()=>{if(f){ve.current=null;return}const V=de.current;if(!V){v(),ve.current=null;return}if(!Ft(V)){o+=1,o<c?ve.current=window.requestAnimationFrame(E):(v(),ve.current=null);return}if(r&&Ke.current){xt(V),v(!1);return}v()};return ve.current=window.requestAnimationFrame(E),()=>{f=!0,ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null)}},[r,bt,Ft,a]);const ji=i.useCallback(n=>{},[]),Me=rt==="tree"&&!ze,vi=ue(n=>n.diffFileTreeWidth),Zt=ue(n=>n.setDiffFileTreeWidth),rs=i.useRef(null),[ki,os]=i.useState(!1),_t=Math.max(vi,Ln),en=i.useCallback(n=>{const o=Math.max(Ln,(rs.current?.clientWidth??0)*wo);return Math.min(o,Math.max(Ln,n))},[]),Ni=i.useCallback(n=>{n.preventDefault();const o=n.clientX,c=_t,f=ks(n.currentTarget)?-1:1;os(!0);const v=V=>{Zt(en(c+(V.clientX-o)*f))},E=()=>{os(!1),window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E)},[en,_t,Zt]),Si=i.useCallback(n=>{const o=n.shiftKey?40:10,c=ks(n.currentTarget)?-1:1,f=(n.key==="ArrowLeft"?-o:n.key==="ArrowRight"?o:0)*c;f!==0&&(n.preventDefault(),Zt(en(_t+f)))},[en,_t,Zt]),Fn=i.useMemo(()=>Me?Us(O,new Set).flatMap(n=>n.kind==="file"?[n.file]:[]):[],[O,Me]),tn=Me?Fn:O,Ot=Me?Fn.find(n=>n.path===J)??Fn[0]??null:null,nn=Ot?.path??null;i.useEffect(()=>{nn&&!Ce.has(nn)&&me(nn)},[me,Ce,nn]);const Dn=i.useCallback(n=>{if(Fe(),Me){$(n),_(!1),me(n),K.current?.scrollTo({top:0});return}$(n),_(!1),Ke.current=!0,de.current=n,me(n),We(o=>o+1),Ft(n)},[Fe,me,Me,Ft]),as=(n,o)=>{if(!a)return!1;const c=n.target;if(c instanceof HTMLElement&&(c.isContentEditable||c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.closest('[role="dialog"]')))return!1;if(tn.length===0)return;const f=Me?Ot?.path:J,v=f?tn.findIndex(G=>G.path===f):-1,E=v===-1?o>0?0:tn.length-1:v+o,V=tn[E];V&&Dn(V.path)};gr({diff_next_file:n=>as(n,1),diff_previous_file:n=>as(n,-1)});const[Dt,Ri]=i.useState(()=>new Set),Ci=i.useCallback((n,o)=>{Ri(c=>{if(c.has(n)===o)return c;const f=new Set(c);return o?f.add(n):f.delete(n),f})},[]),ls=i.useCallback(async(n,o,c)=>{if(!p)return null;const f=_n(p,n),v=await j.getGitStatus(f,{fresh:!0});return{nestedSources:Js(v).map(E=>({filePath:`${n}${E.path}`,layout:o,revision:c,load:async()=>{if(Je(E.path)||!j.getGitDiff)return null;const V=an(E)&&!ln(E),G=await j.getGitDiff(f,{path:E.path,staged:V,contextLines:gt}),we={...Vt(E.path,G.diff,"patch"),submodule:G.submodule};return It(qt(E.path,we),je)}}))}},[je,p,j]),[cs]=i.useState(mo),fs=i.useRef([]),ds=i.useCallback((n,o,c,f,v)=>{if(!j.getGitDiffs)return Promise.resolve(null);const E=fs.current.filter(V=>!Je(V.filePath)&&ut(V.filePath)===f&&Dt.has(V.filePath)===v).map(V=>({filePath:V.filePath,revision:V.revision??""}));return cs({directory:n,filePath:o,revision:c,staged:f,contextLines:v?on:gt,peers:E,getGitDiffs:(V,G)=>j.getGitDiffs?.(V,G)??Promise.resolve([])})},[Dt,ut,j,cs]),us=i.useCallback(async(n,o)=>{const c=n.path,f=Dt.has(c);if(l==="turn"){const te=Ut.get(c);return It(te?qt(c,te):null,je)}if(l==="branch"||l==="commit"||l==="pr"){const te=Jt.get(c);if(!f&&te?.status==="ready")return It(qt(c,te.data),je);if(!f&&te?.status==="loading")return null;const sn=f&&Xt?await Xt(c):await ft(c);if(sn.status!=="ready")throw new Error(sn.status==="error"?sn.message:"Diff not loaded");return It(qt(c,sn.data),je)}if(!p||Je(c)||!j.getGitDiff)return null;const v=j.getGitDiff,E=ut(c),V=f?on:gt;let G;try{const te=await ds(p,c,o,E,f);if(te&&!te.ok&&te.reason)throw new cn(te.error,te.reason);G=te?.ok?te.diff:await v(p,{path:c,staged:E,contextLines:V})}catch(te){if(!(te instanceof cn))throw te;return te.reason==="nested_repository"?ls(c,dt(n),o):null}const we={...Vt(c,G.diff,f?"full":"patch"),submodule:G.submodule};return It(qt(c,we),je)},[l,Jt,je,p,ft,Dt,ut,dt,j,Ut,Xt,ds,ls]),ms=i.useRef(us);ms.current=us;const Tn=l==="branch"||l==="commit"||l==="pr"?Jt:null,Vn=l==="turn"?Ut:null,ps=l==="all"||l==="working"||l==="staged",hs=i.useMemo(()=>O.map(n=>{const o=Tn?.get(n.path),c=Tn?`${o?.status??"absent"}:${Ms(o)}`:Vn?Ms(Vn.get(n.path)):ps?`${ut(n.path)?"staged":"unstaged"}:${Ve+(tt.get(n.path)??0)}`:"local",f=`${je?"hide":"show"}|${Dt.has(n.path)?"full":"patch"}|${c}`;return{filePath:n.path,layout:dt(n),revision:f,load:()=>ms.current(n,f)}}),[O,je,tt,Dt,Tn,Vn,ps,ut,dt,Ve]);fs.current=hs;const Oe=no({sources:hs}),[En,Fi]=i.useState(null),gs=i.useRef(O);gs.current=O;const Di=i.useCallback(n=>{const o=gs.current.find(c=>Bs(c.path,n.filePath))?.path??n.filePath;Fi(c=>({key:n.filePath,nonce:(c?.nonce??0)+1})),Me&&o!==J&&($(o),_(l==="staged")),me(o),Ft(o)},[l,J,me,Me,Ft]),{registerViewer:Ti,openOnWord:Vi,focusNonce:Ei}=so({find:Oe,visible:a,rootRef:_e,reveal:Di}),xs=i.useCallback(n=>{$t(n==="side-by-side"?"side-by-side":"inline")},[$t]),[Ai,ys]=i.useState(null),bs=i.useCallback(async(n,o)=>{if(!R||!p||!n)return;ys(n);const c=Se();try{let f=null;if(o?.patch&&!o.isBinary&&!Je(n)?f=Vs(o.patch):o&&o.contextMode==="full"&&!o.isBinary&&!Je(n)&&(f=As(o.original,o.modified)),f===null&&j.getGitDiff)try{const we=await j.getGitDiff(p,{path:n,staged:lt,contextLines:3});f=Vs(we.diff)}catch{f=null}let v=o;if((f===null||!v)&&j.getGitFileDiff){const we=await j.getGitFileDiff(p,{path:n,staged:lt}),te={original:we.original??"",modified:we.modified??"",isBinary:we.isBinary,submodule:we.submodule};v=te,lt||H(p,n,te,c)}const E=f??(v&&!v.isBinary&&!Je(n)?As(v.original,v.modified):1),V=_n(p,n),G=await eo(F,V,{directory:p});if(!G.ok){to(V,G);return}ot(R,V,E,1)}finally{ys(f=>f===n?null:f)}},[lt,p,F,j,ot,R,H]),Li=i.useCallback((n,o)=>{bs(n,o)},[bs]),Pi=i.useCallback(()=>di(n=>n+1),[]),Mi=()=>{if(!p)return null;const n=(o,c=!1)=>{const f=c||Ce.has(o.path);return t.jsx(So,{visible:a&&f,directory:p,file:o,layout:dt(o),wrapLines:kt,hideWhitespace:je,isSelected:!1,isExpanded:f,isMounted:c||yt.has(o.path)||o.path===Et,onSelect:ji,onExpandedChange:xi,registerSectionRef:gi,registerViewerRef:Ti,onFindWordRequest:Vi,onFullContextChange:Ci,findReveal:En&&Bs(o.path,En.key)?En:null,showOpenInEditorAction:x&&l!=="turn"&&!I&&!(l==="pr"&&Le?.linked),isOpeningInEditor:Ai===o.path,onOpenInEditor:Li,staged:ut(o.path),readOnlyActions:l==="branch"||l==="commit"||l==="pr",hunkActionsEnabled:l==="all"||l==="working"||l==="staged",contentRevision:Ve+(tt.get(o.path)??0),comparisonDiff:l==="branch"||l==="commit"||l==="pr"?Jt.get(o.path)??Bn:void 0,commentOrigin:ui,onRetryComparisonDiff:Pi,loadFullComparisonDiff:Xt,initialDiffData:l==="turn"?Ut.get(o.path)??null:null},`${Se()}:${p}:${o.path}`)};return t.jsxs("div",{ref:rs,className:Ie("flex min-w-0 flex-1 min-h-0 h-full",w?"gap-0":"gap-3 px-3 pb-3 pt-2"),children:[Me&&t.jsxs(t.Fragment,{children:[t.jsx("section",{className:"flex max-w-[50%] flex-shrink-0 flex-col",style:{width:`${_t}px`},children:t.jsx(jo,{changedFiles:O,selectedFile:Ot?.path??null,onSelectFile:Dn})}),t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":d("diffView.fileTree.resize"),tabIndex:0,onPointerDown:Ni,onKeyDown:Si,className:Ie("relative w-px shrink-0 cursor-col-resize bg-[var(--interactive-border)]/40","before:absolute before:inset-y-0 before:-inset-s-1 before:-inset-e-1 before:content-['']","hover:bg-interactive-selection focus-visible:bg-interactive-selection focus-visible:outline-none",ki&&"bg-interactive-selection")})]}),T&&!Me&&t.jsxs("section",{className:"hidden lg:flex w-72 flex-col rounded-xl border border-edge bg-background/70 overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-edge-muted",children:[t.jsx("span",{className:"typography-ui-header font-semibold text-foreground",children:d("diffView.section.files")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:O.length})]}),t.jsx(bo,{changedFiles:O,selectedFile:null,onSelectFile:Dn})]}),t.jsxs("div",{className:"relative flex-1 min-w-0 min-h-0 h-full",children:[Oe.isOpen&&t.jsx(io,{query:Oe.query,onQueryChange:Oe.setQuery,total:Oe.matches.length,currentIndex:Oe.currentIndex,isSearching:Oe.isSearching,failedCount:Oe.failedCount,onNext:Oe.next,onPrevious:Oe.previous,onClose:Oe.close,focusNonce:Ei}),t.jsx(On,{ref:K,outerClassName:"min-h-0 h-full",className:"[overflow-anchor:none]",disableHorizontal:!0,observeMutations:!1,preventOverscroll:!0,"data-diff-virtual-root":!0,children:t.jsx("div",{className:"flex flex-col [overflow-anchor:none] pb-16","data-diff-virtual-content":!0,children:Me?Ot&&n(Ot,!0):O.map(o=>n(o))})})]})]})},Bi=()=>{if(!p)return t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:d("diffView.state.selectSessionDirectory")});if(l!=="turn"&&W)return t.jsx(Gr,{directory:W.directory,message:W.message});if(l!=="turn"&&se&&!L)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),d("diffView.state.loadingRepositoryStatus")]});if(l!=="turn"&&M===!1)return t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:d("diffView.state.notGitRepository")});if(l==="pr"){if(pe.diffUnavailable)return t.jsx(Zi,{provider:pe.provider});if(!Le||ae.error)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[!ae.error&&!pe.error&&!pe.loading&&t.jsx(X,{name:"git-pull-request",className:"size-6 text-muted-foreground"}),t.jsx("p",{className:"typography-meta text-muted-foreground",children:ae.error??pe.error??(pe.loading?d(fn("session.githubPrPicker.loading.pullRequests",xn)):d(fn("pullRequestComparison.pickAbove",xn)))}),(ae.error||pe.error)&&t.jsx(Xe,{variant:"outline",size:"sm",onClick:()=>{Le?ae.refresh():pe.refresh()},children:d("diffView.actions.retry")})]});if(!ae.files)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 typography-meta text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),d("diffView.state.loadingDiff")]})}if(l==="commit"){if(Zn)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:Zn}),t.jsx(Xe,{variant:"outline",size:"sm",onClick:()=>{ae.refresh()},children:d("diffView.actions.retry")})]});if(!ct&&!Ze.loading)return t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:Ze.error??d("commitComparison.noCommits")});if(!Yn)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),d("diffView.state.loadingDiff")]})}if(l==="branch"){const n=L===null||D.status==="idle"||D.status==="loading";if(!$n||!Pe&&n)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),d("diffView.branch.resolvingBase")]});if(!Pe)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center",children:[t.jsx(X,{name:"git-branch",className:"size-6 text-muted-foreground"}),t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:d("diffView.branch.noBaseTitle")}),t.jsx("div",{className:"max-w-sm typography-micro text-muted-foreground",children:d("gitView.pr.toast.baseBranchRequired")})]});if(es)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:d("diffView.branch.loadError")}),t.jsx("div",{className:"max-w-sm typography-micro text-muted-foreground",children:es}),t.jsx(Xe,{variant:"outline",size:"sm",onClick:()=>{ae.refresh()},children:d("diffView.actions.retry")})]});if(Ct===null)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),d("diffView.branch.loadingFiles")]})}return l==="turn"&&zn?t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-4 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:d("diffView.state.failedToLoadDiff")}),t.jsx("div",{className:"typography-meta max-w-[32rem] text-center",children:zn}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:Zs,children:d("diffView.actions.retry")})]}):l==="turn"&&(!Ys||Ne)&&Ae?t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}),d("diffView.state.loadingChanges")]}):O.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:l==="turn"?d("diffView.state.noLastTurnChanges"):l==="pr"?d("walkthrough.blocked.emptyDiff.description"):l==="commit"?d("commitComparison.emptyDiff"):l==="branch"&&Pe?d("diffView.branch.empty",{base:Hr(Pe)}):d("diffView.state.cleanWorkingTree")}):Mi()},ws=O.length>0&&hn&&(l!=="pr"||!!gn),js=()=>{const n=p??"";A(n,l==="pr"&&Le&&gn?{source:Le,context:gn}:{source:l==="commit"&&ct?{kind:"commit",hash:ct}:l==="branch"&&Pe&&xe?{kind:"branch",baseRef:Pe,headRef:xe}:{kind:"working-tree",scope:l==="staged"||l==="working"?l:"all"}}),I&&g?Z(g,{mode:"walkthrough",targetDirectory:R}):z(R??n,"walkthrough")},_i=n=>{switch(n){case"walkthrough":return ws?{label:d("walkthrough.action.open"),icon:t.jsx(X,{name:"route",className:"size-4"}),on:!1,select:js}:null;case"tree":return ze?null:{label:d("diffView.fileTree.showAsTree"),icon:t.jsx(X,{name:"node-tree",className:"size-4"}),on:rt==="tree",select:()=>Gt(rt==="tree"?"flat":"tree")};case"wrap":return{label:d("diffView.actions.wrapLines"),icon:t.jsx(X,{name:"text-wrap",className:"size-4"}),on:kt,select:()=>Pt(!vt)};case"whitespace":return{label:d("diffView.actions.hideWhitespace"),icon:t.jsx(X,{name:"space",className:"size-4"}),on:je,select:()=>it(!je)};case"layout":{const o=Sn==="side-by-side";return{label:d("diffView.layout.sideBySide"),icon:t.jsx(X,{name:"layout-column",className:"size-4"}),on:o,select:()=>xs(o?"unified":"side-by-side")}}}};return t.jsx(zr.Provider,{value:vn,children:t.jsxs("div",{ref:_e,"data-find-surface":"",className:"flex h-full flex-col overflow-hidden bg-background",children:[t.jsx(xr,{children:t.jsxs("div",{ref:h,className:Ie("flex min-w-0 items-center gap-2",N?"flex-1 py-1 pe-1":"px-3 py-2 bg-background"),children:[ee?t.jsx(yr,{repositories:ee,selectedRepository:ye??null,onSelectRepository:n=>{R&&he(R,n)},repositoryRoot:R??void 0}):null,!q&&!I&&(l!=="all"?t.jsx(oo,{scope:l,workingCount:ei,stagedCount:ti,turnCount:Qs,branchCount:hi,commitCount:l==="commit"?Yn?.length??null:null,prCount:l==="pr"?ae.files?.length??null:null,showCommitOption:!De(),showBranchOption:wn,changeRequestTerm:xn,onScopeChange:n=>{Ee(n),b?.(n)}}):t.jsx("div",{className:"flex items-center gap-1 rounded-md px-2 py-1 text-muted-foreground shrink-0",children:t.jsx("span",{className:"typography-ui-label font-semibold text-foreground",children:se&&!L?d("diffView.state.loadingChanges"):O.length===1?d("diffView.summary.changedFilesSingle",{count:O.length}):d("diffView.summary.changedFilesPlural",{count:O.length})})})),l==="branch"&&t.jsx(zi,{branches:yn?.all??[],currentBranch:xe,base:Pe,automatic:li!=="chosen",onSelect:n=>{p&&xe&&ri(p,xe,n)},onSelectAutomatic:()=>{p&&xe&&oi(p,xe)}},JSON.stringify([p,xe])),l==="commit"&&t.jsx($i,{commits:Ze.commits,selectedHash:ct,loading:Ze.loading,error:Ze.error,onSelect:Ze.select,onRefresh:()=>{Ze.refresh()}},JSON.stringify([p,xe])),l==="pr"&&t.jsxs(t.Fragment,{children:[t.jsx(Gi,{comparison:pe},JSON.stringify([le,p,xe])),Le&&t.jsxs(mt,{children:[t.jsx(pt,{asChild:!0,children:t.jsx("span",{className:"inline-flex flex-shrink-0",children:t.jsx(Xe,{variant:"ghost",size:"sm",disabled:ae.loading,"aria-label":d("session.githubIssuePicker.actions.refresh"),onClick:()=>{ae.refresh()},children:t.jsx(X,{name:"refresh",className:"size-4"})})})}),t.jsx(ht,{side:"bottom",sideOffset:6,children:d("session.githubIssuePicker.actions.refresh")})]})]}),O.length>0&&t.jsxs(mt,{children:[t.jsx(pt,{asChild:!0,children:t.jsxs(Xe,{variant:"ghost",size:"sm",onClick:yi,className:Ie("diff-toolbar__expand-button h-7 flex-shrink-0 gap-1 px-1.5 text-muted-foreground hover:text-foreground","ms-auto"),children:[t.jsx(X,{name:"expand-up-down",className:"size-4"}),t.jsx("span",{className:"diff-toolbar__expand-label typography-ui-label",children:Ce.size>0?d("diffView.actions.collapseAll"):d("diffView.actions.expandAll")})]})}),t.jsx(ht,{side:"bottom",sideOffset:6,children:Ce.size>0?d("contextTooltips.diff.collapseAll"):d("contextTooltips.diff.expandAll")})]}),vn&&Un?t.jsx(Hi,{review:vn,provider:Un,className:"diff-toolbar__review-button",labelClassName:"diff-toolbar__review-label"}):null,O.length>0&&Kt&&t.jsxs(mt,{children:[t.jsx(pt,{asChild:!0,children:t.jsx("span",{className:"inline-flex flex-shrink-0",children:t.jsxs(Xe,{variant:"default",size:"sm",onClick:()=>nt(!0),disabled:Cn,className:"diff-toolbar__review-button h-7 flex-shrink-0 gap-1.5 px-2","aria-label":d("diffView.actions.reviewAria"),children:[Cn?t.jsx(X,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(X,{name:"search-eye",className:"size-4"}),t.jsx("span",{className:"diff-toolbar__review-label typography-ui-label",children:d("chat.work.reviewHint.aiReview")})]})})}),t.jsx(ht,{side:"bottom",sideOffset:6,children:d("contextTooltips.diff.review")})]}),ws&&t.jsxs(mt,{children:[t.jsx(pt,{asChild:!0,children:t.jsxs(Xe,{variant:"outline",size:"sm",onClick:js,className:Ie("diff-toolbar__walkthrough-button h-7 flex-shrink-0 gap-1.5 px-2",$r),"aria-label":d("walkthrough.action.open"),children:[t.jsx(X,{name:"route",className:"size-4"}),t.jsx("span",{className:"diff-toolbar__walkthrough-label typography-ui-label",children:d("walkthrough.action.open")})]})}),t.jsx(ht,{side:"bottom",sideOffset:6,children:d("contextTooltips.diff.walkthrough")})]}),O.length>0&&!ze&&t.jsx("span",{className:"diff-toolbar__tree-toggle flex flex-shrink-0",children:t.jsx(rn,{label:d("diffView.fileTree.showAsTree"),icon:"node-tree",pressed:rt==="tree",onClick:()=>Gt(rt==="tree"?"flat":"tree")})}),O.length>0&&t.jsx("span",{className:"diff-toolbar__wrap-toggle flex flex-shrink-0",children:t.jsx(rn,{label:d("diffView.actions.wrapLines"),icon:"text-wrap",pressed:kt,onClick:()=>Pt(!vt)})}),O.length>0&&t.jsx("span",{className:"diff-toolbar__whitespace-toggle flex flex-shrink-0",children:t.jsx(rn,{label:d("diffView.actions.hideWhitespace"),icon:"space",pressed:je,onClick:()=>it(!je)})}),Sn&&t.jsx("span",{className:"diff-toolbar__layout-toggle flex flex-shrink-0",children:t.jsx($s,{mode:Sn==="side-by-side"?"side-by-side":"unified",onModeChange:xs})}),O.length>0&&t.jsxs(Is,{onOpenChange:S,children:[t.jsxs(mt,{children:[t.jsx(pt,{asChild:!0,children:t.jsx("span",{className:"diff-toolbar__more flex-shrink-0",children:t.jsx(_s,{asChild:!0,children:t.jsx(br,{label:d("diffView.actions.moreActions"),icon:"more"})})})}),t.jsx(ht,{side:"bottom",sideOffset:6,children:d("diffView.actions.moreActions")})]}),t.jsx(Os,{align:"end",className:"min-w-56",children:u.map(n=>{const o=_i(n);return o?t.jsxs(wr,{className:"flex items-center gap-2",onClick:o.select,children:[o.icon,t.jsx("span",{className:"min-w-0 truncate typography-ui-label text-foreground",children:o.label}),o.on?t.jsx(X,{name:"check",className:"ms-auto size-4 text-foreground"}):null]},n):null})})]})]})}),t.jsx(jr,{open:wt,onOpenChange:nt,projectDirectory:p??null,submitting:Cn,onConfirm:wi}),Bi()]})})};function Ro(){return new Set}function Co(a){return{original:a.original??"",modified:a.modified??"",isBinary:a.isBinary,submodule:a.submodule,contextMode:"full"}}function Fo(a){return a.addProject}function Do(a){return a.openNewSessionDraft}function To(){return new Set}function Vo(a){return a+1}export{Cf as DiffView,So as MultiFileDiffEntry};