@p4code/cli 0.8.16 → 0.8.17

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 (290) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CI34F60b.mjs → binCli-C2OtBl3_.mjs} +2 -2
  3. package/dist/client/.vite/manifest.json +2143 -2143
  4. package/dist/client/assets/AlertDialogRoot-C4_VBb4J.js +2 -0
  5. package/dist/client/assets/{AnimatedHeight-CzFc8xri.js → AnimatedHeight-CROd_m0y.js} +2 -2
  6. package/dist/client/assets/{AuthSurfaceShell-BIM2_E9K.js → AuthSurfaceShell-BFqgU6Cf.js} +2 -2
  7. package/dist/client/assets/{CSPContext-DcW0os5z.js → CSPContext-BUFNSYww.js} +2 -2
  8. package/dist/client/assets/{ChatGptUsageButton-D6bmo65C.js → ChatGptUsageButton-CAkbdzVa.js} +2 -2
  9. package/dist/client/assets/{ChatMarkdown-CjusdpPE.js → ChatMarkdown-DRdUETgB.js} +4 -4
  10. package/dist/client/assets/{CheckboxIndicator-DRAilQdq.js → CheckboxIndicator-DS1cy5Y6.js} +2 -2
  11. package/dist/client/assets/{CodexSetupSection.logic-CSXvl05k.js → CodexSetupSection.logic-B-Gs8BS6.js} +2 -2
  12. package/dist/client/assets/{CollapsiblePanel-DMH4QH0_.js → CollapsiblePanel-DzlAN8vm.js} +2 -2
  13. package/dist/client/assets/{ComboboxClear-DV4ygCOL.js → ComboboxClear-D3w2fM_m.js} +2 -2
  14. package/dist/client/assets/{CommandBlock-DVrmnpxz.js → CommandBlock-BaaPOUD7.js} +2 -2
  15. package/dist/client/assets/{ComposerPromptEditor-CvJcJEtN.js → ComposerPromptEditor-jeEkR9fy.js} +4 -4
  16. package/dist/client/assets/{CompositeRoot-CsrLt1o5.js → CompositeRoot-r9p4LoiQ.js} +2 -2
  17. package/dist/client/assets/{ConnectionStatusDot-uWbIqk3l.js → ConnectionStatusDot-C8T3Smus.js} +2 -2
  18. package/dist/client/assets/{DevicePanel-Bf1rvcrw.js → DevicePanel-BG2hk0i3.js} +2 -2
  19. package/dist/client/assets/{DeviceSetup-CX-B4Xfz.js → DeviceSetup-CKZmblju.js} +2 -2
  20. package/dist/client/assets/{DialogTitle-BgclXafx.js → DialogTitle-Bs5Povma.js} +2 -2
  21. package/dist/client/assets/{DiffCommentAnnotation-CKRC0OaV.js → DiffCommentAnnotation-CX8scC3B.js} +2 -2
  22. package/dist/client/assets/{DiffFileTree-xeoOBCTn.js → DiffFileTree-BnizHv7v.js} +2 -2
  23. package/dist/client/assets/{DiffPanel-CzkU9nAC.js → DiffPanel-DxnHaLb1.js} +2 -2
  24. package/dist/client/assets/{DiffWorkerPoolProvider-NaKmpbcL.js → DiffWorkerPoolProvider-Bn4H-Zao.js} +2 -2
  25. package/dist/client/assets/{EmbeddedDesign-hjnHhasg.js → EmbeddedDesign-BiW8ewmO.js} +2 -2
  26. package/dist/client/assets/{EnvironmentMachineIcon-Czk_PJpp.js → EnvironmentMachineIcon-DKzRVCQ4.js} +2 -2
  27. package/dist/client/assets/{ExpandableText-Ggw0uVXl.js → ExpandableText-BanCMyot.js} +2 -2
  28. package/dist/client/assets/{FieldControl-Bw2_eFMa.js → FieldControl-s_wzlnCP.js} +2 -2
  29. package/dist/client/assets/{FileDiff-VvQl3KAm.js → FileDiff-BTx35t8y.js} +2 -2
  30. package/dist/client/assets/{FilePreviewPanel-DpzZ6qxm.js → FilePreviewPanel-Cii41zwQ.js} +2 -2
  31. package/dist/client/assets/{FoldedSettingsSection-BFkFGK44.js → FoldedSettingsSection-BW3s8OMk.js} +2 -2
  32. package/dist/client/assets/{FormContext-7fCTOXXA.js → FormContext-CUlgAi-q.js} +2 -2
  33. package/dist/client/assets/{Icons-CSAp87pJ.js → Icons-3I0QXv0W.js} +2 -2
  34. package/dist/client/assets/Input-D-VEMFtp.js +2 -0
  35. package/dist/client/assets/{KeybindingsSettings.logic-CsSjvH9c.js → KeybindingsSettings.logic-CSyJIpFu.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero--g3-0FUP.js → NoProjectsHero-Cbnk6tn0.js} +2 -2
  37. package/dist/client/assets/{PanelLayoutControls-BxdDsUL3.js → PanelLayoutControls-Cyag4Tur.js} +4 -4
  38. package/dist/client/assets/{PierreEntryIcon-B-E3YaL1.js → PierreEntryIcon-C5vp6j29.js} +2 -2
  39. package/dist/client/assets/{PopoverHandle-BkhR-kKK.js → PopoverHandle-CgOyoBVs.js} +2 -2
  40. package/dist/client/assets/{PreviewPanel-VoVAdWRz.js → PreviewPanel-CZ_Qxxvo.js} +2 -2
  41. package/dist/client/assets/{ProjectDefaultsSettings-DtvFnrMn.js → ProjectDefaultsSettings-BIEY8BOO.js} +2 -2
  42. package/dist/client/assets/{ProjectFavicon-CeJHd7lY.js → ProjectFavicon-DU8VbXX4.js} +3 -3
  43. package/dist/client/assets/{ProjectIconPickerDialog-DBo5zoxF.js → ProjectIconPickerDialog-CK8qpgyz.js} +2 -2
  44. package/dist/client/assets/{ProjectMonogram-CWdfC9NP.js → ProjectMonogram-BaA9dKQy.js} +2 -2
  45. package/dist/client/assets/{ProviderAuthTerminal-BPUxIxWE.js → ProviderAuthTerminal-AH-Cy_pb.js} +2 -2
  46. package/dist/client/assets/{ProviderModelPicker-JUsjo9GU.js → ProviderModelPicker-wOdtIBVW.js} +2 -2
  47. package/dist/client/assets/{ProviderSettingsForm-VoB8oygt.js → ProviderSettingsForm-DXzJoQR9.js} +2 -2
  48. package/dist/client/assets/{PullRequestCodeTab-CbKTE6Jz.js → PullRequestCodeTab-CkE2ul9K.js} +2 -2
  49. package/dist/client/assets/{ReadOnlySourcePreview-DlWlnYoW.js → ReadOnlySourcePreview-CBGeBLfB.js} +2 -2
  50. package/dist/client/assets/{RenderErrorBoundary-DpI8Ovyx.js → RenderErrorBoundary-CgWfZhV9.js} +2 -2
  51. package/dist/client/assets/{ScheduledTasksSettings-Cc15ado1.js → ScheduledTasksSettings-CykPbEbT.js} +2 -2
  52. package/dist/client/assets/{ScopedSwitch-CaVh740d.js → ScopedSwitch-Bk5kVayQ.js} +2 -2
  53. package/dist/client/assets/{ScrollAreaCorner-DXYr9Xbu.js → ScrollAreaCorner-CxSOla7S.js} +2 -2
  54. package/dist/client/assets/{SecretInput-WUih9JDs.js → SecretInput-6K6o0z_j.js} +2 -2
  55. package/dist/client/assets/{SelectScrollUpArrow-BIdW5z3c.js → SelectScrollUpArrow-DKwyzFlM.js} +2 -2
  56. package/dist/client/assets/{SettingsPanels-CSUZtGSF.js → SettingsPanels-CzHOdmoE.js} +2 -2
  57. package/dist/client/assets/{SettingsPanels.logic-Ce6a_3Zx.js → SettingsPanels.logic-B9MzQwrf.js} +2 -2
  58. package/dist/client/assets/{SettingsScopeNotice-RvGwRluQ.js → SettingsScopeNotice-ml10Xbs_.js} +2 -2
  59. package/dist/client/assets/{T3ConnectAccountPages-Dltl5esW.js → T3ConnectAccountPages-DORAp_V3.js} +2 -2
  60. package/dist/client/assets/{T3ConnectSidebarSignIn-qx3Qtdnf.js → T3ConnectSidebarSignIn-D4iDcrjK.js} +2 -2
  61. package/dist/client/assets/{ThemeEditorPanel-DspojrU_.js → ThemeEditorPanel-BiB-1tTU.js} +2 -2
  62. package/dist/client/assets/{ThreadTerminalDrawer-mE2aj0U7.js → ThreadTerminalDrawer-E3tgtH2-.js} +2 -2
  63. package/dist/client/assets/{TooltipViewport-Daddx30c.js → TooltipViewport-A4hJLsA1.js} +2 -2
  64. package/dist/client/assets/{Virtualizer-DySKW4Qd.js → Virtualizer-YZrA28xX.js} +2 -2
  65. package/dist/client/assets/{WorkspaceBreadcrumb-B3WecLwo.js → WorkspaceBreadcrumb-DRyODQoe.js} +2 -2
  66. package/dist/client/assets/{WorkspacePageContainer-rn16R8Ps.js → WorkspacePageContainer-C9d1CC0F.js} +2 -2
  67. package/dist/client/assets/{WorkspacePageHeader-B2wsiKGJ.js → WorkspacePageHeader-cjFWAiFR.js} +2 -2
  68. package/dist/client/assets/{_chat-D4KQBrU-.js → _chat-DcFCVkrG.js} +5 -5
  69. package/dist/client/assets/{_chat.index-DYOE3ChI.js → _chat.index-D1edR5Y7.js} +2 -2
  70. package/dist/client/assets/{_chat.new-BTckKJwz.js → _chat.new-CNtY6xfX.js} +2 -2
  71. package/dist/client/assets/{_chat.pull-requests-BYdISBjt.js → _chat.pull-requests-B9gYbv3C.js} +2 -2
  72. package/dist/client/assets/{abnfDiagram-VCTEODGH-CiK3BBs3.js → abnfDiagram-VCTEODGH-Bg9Y0ptm.js} +2 -2
  73. package/dist/client/assets/{alert-CvIEaZOb.js → alert-C9G2MwuB.js} +2 -2
  74. package/dist/client/assets/architecture-7GRP2DOG-B_DOBvMT.js +1 -0
  75. package/dist/client/assets/{architectureDiagram-5GKGNRK7-wAHn9Lrj.js → architectureDiagram-5GKGNRK7-DaFWEoVm.js} +2 -2
  76. package/dist/client/assets/{assets-B17ISP56.js → assets-BngUvpba.js} +2 -2
  77. package/dist/client/assets/{blockDiagram-I7D4REHJ-Cp3-BNSr.js → blockDiagram-I7D4REHJ-BLFoCG7i.js} +2 -2
  78. package/dist/client/assets/{browserHistoryStore-DWdy6V_l.js → browserHistoryStore-D3jg6lW0.js} +2 -2
  79. package/dist/client/assets/{browserLinkTarget-BEJDPOgD.js → browserLinkTarget-BTsZgYV0.js} +2 -2
  80. package/dist/client/assets/{c4Diagram-7LVT6UL2-NaJ4CkHK.js → c4Diagram-7LVT6UL2-DI-I8wOH.js} +2 -2
  81. package/dist/client/assets/channel-D77117oc.js +2 -0
  82. package/dist/client/assets/{checkbox-EHQPSidC.js → checkbox-BMrBwYAj.js} +2 -2
  83. package/dist/client/assets/{chunk-4HAMMTFA-qa80OHyq.js → chunk-4HAMMTFA-DJYGf4Ym.js} +2 -2
  84. package/dist/client/assets/{chunk-75Z2AOVW-BQGpvZ-z.js → chunk-75Z2AOVW-BHc4yRCt.js} +2 -2
  85. package/dist/client/assets/{chunk-DU6HZSFF-D2KfUzzn.js → chunk-DU6HZSFF-CxeiyFio.js} +2 -2
  86. package/dist/client/assets/{chunk-F27PBJKO-DWzMfgh0.js → chunk-F27PBJKO-CoBuXptu.js} +2 -2
  87. package/dist/client/assets/{chunk-GMAD6QVW-C20gX9zS.js → chunk-GMAD6QVW-Djtqr7wA.js} +2 -2
  88. package/dist/client/assets/{chunk-GVQU2GXP-CkUVHa35.js → chunk-GVQU2GXP-B_dZvf-D.js} +2 -2
  89. package/dist/client/assets/{chunk-IMKFNOWR-Dnxgnf8H.js → chunk-IMKFNOWR-CIZUn2vm.js} +2 -2
  90. package/dist/client/assets/{chunk-L3NEJ4N5-DUqnqYMY.js → chunk-L3NEJ4N5-DMIPUTzl.js} +2 -2
  91. package/dist/client/assets/{chunk-OSK3NFVY-DEacs3_i.js → chunk-OSK3NFVY-8kOFeAYp.js} +2 -2
  92. package/dist/client/assets/{chunk-P2QGCYS3-ZwThzrs-.js → chunk-P2QGCYS3-CRs2CVdk.js} +2 -2
  93. package/dist/client/assets/{chunk-POPQ4Y6H-BFIplCZ4.js → chunk-POPQ4Y6H-BF0zVulS.js} +2 -2
  94. package/dist/client/assets/{chunk-PWAF6VOD-CV049Zsa.js → chunk-PWAF6VOD-pAkrbks5.js} +2 -2
  95. package/dist/client/assets/{chunk-SHT3W25Y-BE3qAxKX.js → chunk-SHT3W25Y-XA9rgPJk.js} +2 -2
  96. package/dist/client/assets/{chunk-SVP7TREG-DWTRXiC1.js → chunk-SVP7TREG-BLPEkz6O.js} +2 -2
  97. package/dist/client/assets/{chunk-TICWLB2K-D7wrITi8.js → chunk-TICWLB2K-BDX6zFln.js} +2 -2
  98. package/dist/client/assets/classDiagram-ZZMXUADV-BOfzjSR1.js +2 -0
  99. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BOfzjSR1.js +2 -0
  100. package/dist/client/assets/{color-picker-Dd1K-QRk.js → color-picker-CHpDpF1q.js} +2 -2
  101. package/dist/client/assets/{combobox-BqpUmoio.js → combobox-DsEnX06q.js} +2 -2
  102. package/dist/client/assets/{command-D1peviZr.js → command-7JZ4jreB.js} +2 -2
  103. package/dist/client/assets/{connect-BJSxZzk6.js → connect-CrLJN7lo.js} +2 -2
  104. package/dist/client/assets/{connect-agent-DfhS_H4b.js → connect-agent-iD4mBU_q.js} +2 -2
  105. package/dist/client/assets/{cynefin-OW5HDTMX-dVUNi-Eg.js → cynefin-OW5HDTMX-BPbkuuD0.js} +1 -1
  106. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Djkby1yV.js → cynefinDiagram-5FMLGOSQ-Tg7_4aNX.js} +2 -2
  107. package/dist/client/assets/{dagre-GXQ25YYZ-By44EUZw.js → dagre-GXQ25YYZ-BO8vBn--.js} +2 -2
  108. package/dist/client/assets/{device-Dk2NULhB.js → device-D7crohVQ.js} +2 -2
  109. package/dist/client/assets/{diagram-S7CK7UJ4-C0o6sI0g.js → diagram-S7CK7UJ4-Cw7tf93w.js} +2 -2
  110. package/dist/client/assets/{diagram-UQ7AKVKN-s2vz22qd.js → diagram-UQ7AKVKN-CWCxivXY.js} +2 -2
  111. package/dist/client/assets/{diagram-VSXAHHWV-CylpbhVy.js → diagram-VSXAHHWV-obA2VrFx.js} +2 -2
  112. package/dist/client/assets/{diagram-VX7I27RA-Bz50mxAk.js → diagram-VX7I27RA-BZZX0tDC.js} +2 -2
  113. package/dist/client/assets/{diagram-Z3DM3KII-BwwAXl7S.js → diagram-Z3DM3KII-BXgCa2au.js} +2 -2
  114. package/dist/client/assets/{dialog-BfenC7sz.js → dialog-DWCEeJ2c.js} +2 -2
  115. package/dist/client/assets/{diffRendering-4kDIxoRz.js → diffRendering-BAlsKvkZ.js} +2 -2
  116. package/dist/client/assets/{discovery-list-NHMaJPrr.js → discovery-list-BaMSF62J.js} +2 -2
  117. package/dist/client/assets/{dist-DPoczA-G.js → dist-CtlrzKKg.js} +3 -3
  118. package/dist/client/assets/{draft-input-rVkOduh_.js → draft-input-DZZB4KBb.js} +2 -2
  119. package/dist/client/assets/{duoViewer-CYEmwhMX.js → duoViewer-BDT5Pw1R.js} +2 -2
  120. package/dist/client/assets/{dynamic-DO1Y_hZw.js → dynamic-B_1SDXVm.js} +2 -2
  121. package/dist/client/assets/{ebnfDiagram-PWID7BFC-CZWDrYgP.js → ebnfDiagram-PWID7BFC-C79a3o-h.js} +2 -2
  122. package/dist/client/assets/{embeddedScripts-gw0IVEit.js → embeddedScripts-DWtZjYSD.js} +2 -2
  123. package/dist/client/assets/{empty-xf3NEL4p.js → empty-CdigxFIr.js} +2 -2
  124. package/dist/client/assets/{entities-D1h9ACDa.js → entities-Cri9JXzU.js} +2 -2
  125. package/dist/client/assets/{environments-CShRJEmR.js → environments-CXLCfPlP.js} +2 -2
  126. package/dist/client/assets/{erDiagram-RLTQ6QDP-nQAwXpMH.js → erDiagram-RLTQ6QDP-C_C_xUYl.js} +2 -2
  127. package/dist/client/assets/eventmodeling-NTZA5JFV-BBNrMOto.js +1 -0
  128. package/dist/client/assets/{fileLinks-hdHZBPGX.js → fileLinks-gi8wmjAc.js} +2 -2
  129. package/dist/client/assets/{fileTreeExpansion-VkvCaw5c.js → fileTreeExpansion-By588Tlp.js} +2 -2
  130. package/dist/client/assets/flowDiagram-HODETNUW-DE4e8-KT.js +1 -0
  131. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DWYM0gWT.js → ganttDiagram-EL5Y4UJY-vDMTogcH.js} +2 -2
  132. package/dist/client/assets/{getDiffFileInput-D107eiKt.js → getDiffFileInput-B20LTLvK.js} +2 -2
  133. package/dist/client/assets/{gitGraph-4MIJSDKK-COMcQtZ6.js → gitGraph-4MIJSDKK-CP2HybJj.js} +1 -1
  134. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BQoQgnaf.js → gitGraphDiagram-WWUBYQGX-okkWrJG2.js} +2 -2
  135. package/dist/client/assets/{guideRunStore-U-mQ5TrH.js → guideRunStore-BuNfL9zT.js} +2 -2
  136. package/dist/client/assets/{htmlRender-CDbYs9Mi.js → htmlRender-B0nsPoF5.js} +2 -2
  137. package/dist/client/assets/{index-B3Ar6SfQ.js → index-C4eY-csp.js} +3 -3
  138. package/dist/client/assets/{info-A6RAGUB7-DztiJcIo.js → info-A6RAGUB7-RHhd5N_M.js} +1 -1
  139. package/dist/client/assets/{infoDiagram-27XIBGKW-4UkpJDZ8.js → infoDiagram-27XIBGKW-YzE38gXg.js} +2 -2
  140. package/dist/client/assets/{input-CF-egQtG.js → input-RCV7-UKX.js} +2 -2
  141. package/dist/client/assets/{input-group-CifPZlNg.js → input-group-Bcuxz_AQ.js} +2 -2
  142. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DhRs1gS_.js → ishikawaDiagram-5VMMS53U-Sz6NR02e.js} +2 -2
  143. package/dist/client/assets/{journeyDiagram-3NMN7TZE-CkzLNTms.js → journeyDiagram-3NMN7TZE-BQjnHIg3.js} +2 -2
  144. package/dist/client/assets/{kanban-definition-UXKFOSKX-DnnZRuwk.js → kanban-definition-UXKFOSKX-DZUIDXIB.js} +2 -2
  145. package/dist/client/assets/{kbd-DN9MXWor.js → kbd-CIJ2_Q5W.js} +2 -2
  146. package/dist/client/assets/{keybindings-BlEA4Dlt.js → keybindings-BpKkzV__.js} +2 -2
  147. package/dist/client/assets/{lazyRouteComponent-b9hpLjZB.js → lazyRouteComponent-BRNgDsba.js} +2 -2
  148. package/dist/client/assets/{line-BQc8Tfxv.js → line-D2YW2WaY.js} +2 -2
  149. package/dist/client/assets/{link-BIudTto8.js → link-D4TtDnqi.js} +2 -2
  150. package/dist/client/assets/{linkedPrompt-DhAklUFf.js → linkedPrompt-1QsAG0gO.js} +2 -2
  151. package/dist/client/assets/{main-CqNzdsfA.js → main-Co3JeKTg.js} +7 -7
  152. package/dist/client/assets/{mediaReference-Cnqpj8T4.js → mediaReference-BUHO9ICD.js} +2 -2
  153. package/dist/client/assets/{mediaSource-DoFgutG9.js → mediaSource-CHFugA8_.js} +2 -2
  154. package/dist/client/assets/{mermaid-parser.core-DkdUKkht.js → mermaid-parser.core-Ch6yrkIv.js} +4 -4
  155. package/dist/client/assets/{mermaid.core-Bq1JlzgL.js → mermaid.core-CDUpMNay.js} +5 -5
  156. package/dist/client/assets/{mindmap-definition-YA3MSWOX-D8mmtbMo.js → mindmap-definition-YA3MSWOX-J5u85Ham.js} +2 -2
  157. package/dist/client/assets/{number-field-CydqGM9B.js → number-field-Osl5PZkX.js} +2 -2
  158. package/dist/client/assets/{observeResize-BxVCxCXG.js → observeResize-BeeOdDdQ.js} +2 -2
  159. package/dist/client/assets/{onboarding-DeRMOHIy.js → onboarding-BF9yT3Xi.js} +2 -2
  160. package/dist/client/assets/{openFileInPreview-yiAUHSWv.js → openFileInPreview-C15eoyYZ.js} +2 -2
  161. package/dist/client/assets/{p4ProjectFile-CN1m1U7N.js → p4ProjectFile-CAKJOMUN.js} +2 -2
  162. package/dist/client/assets/{packet-AYTQ26CC-BWg_Iaga.js → packet-AYTQ26CC-Cs25hnS9.js} +1 -1
  163. package/dist/client/assets/{pair-DzpeGOSy.js → pair-BA6LcmsK.js} +2 -2
  164. package/dist/client/assets/{pegDiagram-XKGWAZYB-CAzHwR2-.js → pegDiagram-XKGWAZYB-BMn57iOd.js} +2 -2
  165. package/dist/client/assets/{phoneViewer-FlyoV9qT.js → phoneViewer-C-9G9sMe.js} +2 -2
  166. package/dist/client/assets/{pie-WAS4IAKB-DcySclOi.js → pie-WAS4IAKB-DSKy_d1u.js} +1 -1
  167. package/dist/client/assets/{pieDiagram-E7YTZNPT-B00nxfti.js → pieDiagram-E7YTZNPT-DJxOVDr9.js} +2 -2
  168. package/dist/client/assets/{pierre-icons-u_a0tCKH.js → pierre-icons-Cp8tJJSF.js} +2 -2
  169. package/dist/client/assets/{popover-BunL7s_L.js → popover-B70_-gBS.js} +2 -2
  170. package/dist/client/assets/{preview-DJTsHJUF.js → preview-BHYM-_BL.js} +2 -2
  171. package/dist/client/assets/{preview-B_wcdd8X.js → preview-Dj_ac_jZ.js} +2 -2
  172. package/dist/client/assets/{previewMiniPlayerStore-gZV-IkW-.js → previewMiniPlayerStore-DX9IKNL3.js} +2 -2
  173. package/dist/client/assets/{primary-BqinBW4U.js → primary-DHlSwiw_.js} +2 -2
  174. package/dist/client/assets/{primaryCloudLinkState-hwg0TXVd.js → primaryCloudLinkState-LOtU3kc-.js} +2 -2
  175. package/dist/client/assets/{projectFilesQueryState-DVWHpzC3.js → projectFilesQueryState-DPo8i5yD.js} +2 -2
  176. package/dist/client/assets/{projectScriptEditor-RRQopHne.js → projectScriptEditor-By8EdSYw.js} +2 -2
  177. package/dist/client/assets/{providerSkills-BmchYM4E.js → providerSkills-mKD6o1i5.js} +2 -2
  178. package/dist/client/assets/{pullRequestDetail.logic-CjznZ6xd.js → pullRequestDetail.logic-B2AL8Xka.js} +2 -2
  179. package/dist/client/assets/{pullRequestIcons-BZCS4C5B.js → pullRequestIcons-B2-CZ5Ci.js} +2 -2
  180. package/dist/client/assets/{pullRequestReviewStore-BqvYYzmT.js → pullRequestReviewStore-CxOHaJ2U.js} +2 -2
  181. package/dist/client/assets/{pullRequests-iwguXcJ4.js → pullRequests-DDmSd4bP.js} +2 -2
  182. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DXb-ZTK9.js → quadrantDiagram-AXDQQJYC-DE0d6o0C.js} +2 -2
  183. package/dist/client/assets/{queries-D53cjqgz.js → queries-DqFudp6N.js} +2 -2
  184. package/dist/client/assets/{query-CRswjQ7f.js → query-1tRB9OB0.js} +2 -2
  185. package/dist/client/assets/{radar-RG4KPBEZ-BeXZggD1.js → radar-RG4KPBEZ-DveMwSB8.js} +1 -1
  186. package/dist/client/assets/{radio-group-DzD2uI5x.js → radio-group-BDPDnH4m.js} +2 -2
  187. package/dist/client/assets/{railroad-74A4TZTK-DGDA4rny.js → railroad-74A4TZTK-7mru9krG.js} +1 -1
  188. package/dist/client/assets/railroad-abnf-HS5TGJTU-Ch23A2t1.js +1 -0
  189. package/dist/client/assets/railroad-ebnf-LZEXJU2U-D0diYlkX.js +1 -0
  190. package/dist/client/assets/railroad-peg-WCYAUIDC-CnUWPGXT.js +1 -0
  191. package/dist/client/assets/{railroadDiagram-O6MQD6OU-2U2BGUTN.js → railroadDiagram-O6MQD6OU-bAzEpkUJ.js} +2 -2
  192. package/dist/client/assets/{renderScheduler-Bwwdk-oE.js → renderScheduler-DM1wgh78.js} +2 -2
  193. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BpZZUYPx.js → requirementDiagram-BXWQKSXE-ClHxFUNg.js} +2 -2
  194. package/dist/client/assets/{rightPanelStore-CcmIdfDA.js → rightPanelStore-DNohe5X6.js} +2 -2
  195. package/dist/client/assets/{runtime-D1cxRUzP.js → runtime-B75ae48c.js} +2 -2
  196. package/dist/client/assets/{runtime-Dz1hyHmq.js → runtime-B7jXrsPs.js} +3 -3
  197. package/dist/client/assets/{runtimeModeConfig-CGosfJJ5.js → runtimeModeConfig-D044rsFH.js} +2 -2
  198. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DC4ft80C.js → sankeyDiagram-P5KCCOFB-BwX1Wn_u.js} +2 -2
  199. package/dist/client/assets/{scheduledTasksSettings.logic-Bmbv-9DS.js → scheduledTasksSettings.logic-Bw_obRa9.js} +2 -2
  200. package/dist/client/assets/{scroll-area-OkcD8f0Y.js → scroll-area-Ckz2bO0L.js} +2 -2
  201. package/dist/client/assets/{select-BUFUt6O3.js → select-DWT2vKJH.js} +2 -2
  202. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-COMPHZuQ.js → sequenceDiagram-WJ2MYXX4-BSpw0E5m.js} +2 -2
  203. package/dist/client/assets/{server-BSKDpYuc.js → server-B0y-CZn0.js} +2 -2
  204. package/dist/client/assets/{session-BaKBc24W.js → session-eKfJi_Kx.js} +2 -2
  205. package/dist/client/assets/{session-logic-DOC4SSh-.js → session-logic-BAndUZwA.js} +2 -2
  206. package/dist/client/assets/{settings-Ce3HYftt.js → settings-D_eUqlLu.js} +2 -2
  207. package/dist/client/assets/{settings.appearance-BELQs8GW.js → settings.appearance-kTWXGfao.js} +2 -2
  208. package/dist/client/assets/settings.archived-By7wX_fc.js +2 -0
  209. package/dist/client/assets/{settings.computer-use-BjiS8S48.js → settings.computer-use-BuDMoYe7.js} +2 -2
  210. package/dist/client/assets/{settings.connections-CL91uyd1.js → settings.connections-DwruajVk.js} +2 -2
  211. package/dist/client/assets/{settings.data-controls-AB6ME8V3.js → settings.data-controls-Ew7ogbgL.js} +2 -2
  212. package/dist/client/assets/{settings.decisions-DEFo-Pd2.js → settings.decisions-rppoMBkE.js} +2 -2
  213. package/dist/client/assets/{settings.diagnostics-DgncclwX.js → settings.diagnostics-BcNTndhm.js} +2 -2
  214. package/dist/client/assets/{settings.general-BHYFN8uF.js → settings.general-D1vnEzQa.js} +2 -2
  215. package/dist/client/assets/{settings.integrations-BxqEAKSC.js → settings.integrations-DKEJMS6o.js} +2 -2
  216. package/dist/client/assets/{settings.keybindings-DQ8svgeo.js → settings.keybindings-BstDnaeV.js} +2 -2
  217. package/dist/client/assets/{settings.open-source-licenses-DX92vMDE.js → settings.open-source-licenses-s96NzjdF.js} +2 -2
  218. package/dist/client/assets/{settings.plugins-DZqUpuLK.js → settings.plugins--hNL0lcF.js} +2 -2
  219. package/dist/client/assets/{settings.projects-C8uYKsz6.js → settings.projects-BQBJ0eQ0.js} +3 -3
  220. package/dist/client/assets/settings.providers-C-R4_ra0.js +3 -0
  221. package/dist/client/assets/{settings.scheduled-tasks-B2CT-4iw.js → settings.scheduled-tasks-WuxBbfP4.js} +2 -2
  222. package/dist/client/assets/{settings.snap-shot-FpIHq57J.js → settings.snap-shot-D-GpjQxg.js} +2 -2
  223. package/dist/client/assets/{settings.source-control-Cgg8tzrr.js → settings.source-control-D_Ipwyto.js} +2 -2
  224. package/dist/client/assets/{settings.storage-gQMFfL_2.js → settings.storage-DHtjVWHK.js} +2 -2
  225. package/dist/client/assets/{settingsLayout-DUyA66EK.js → settingsLayout-B_Bq9Cq9.js} +2 -2
  226. package/dist/client/assets/{sidebar-CNP67lTi.js → sidebar-m0COIl9s.js} +2 -2
  227. package/dist/client/assets/{sidebarProjectGrouping-lWfRDsCI.js → sidebarProjectGrouping-BpwyF0h8.js} +2 -2
  228. package/dist/client/assets/{skeleton-DDh76jpd.js → skeleton-DxoA_uLH.js} +2 -2
  229. package/dist/client/assets/{sortable.esm-Bc--TVlq.js → sortable.esm-DAcHa5SQ.js} +2 -2
  230. package/dist/client/assets/{sourceControl-BppF1prF.js → sourceControl-C-R8wmTp.js} +2 -2
  231. package/dist/client/assets/{spinner-DYnZ-Bpa.js → spinner-B1oJASgu.js} +2 -2
  232. package/dist/client/assets/{standalone-page-DUgQaNPq.js → standalone-page-OuNLgPqS.js} +2 -2
  233. package/dist/client/assets/{stateDiagram-D77RDMKH-Dk5dNGVk.js → stateDiagram-D77RDMKH-DjLNu-aO.js} +2 -2
  234. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Cx2Qu8wY.js +2 -0
  235. package/dist/client/assets/{swimlanes-42K2YHIH-D6oOm69V.js → swimlanes-42K2YHIH-BAlKsUJH.js} +2 -2
  236. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-euVkUgFA.js +9 -0
  237. package/dist/client/assets/{terminal-links-CV_3r1U3.js → terminal-links-B7jzSUaR.js} +2 -2
  238. package/dist/client/assets/{terminalSessions-DCMAHO3E.js → terminalSessions-CHAAF5wF.js} +2 -2
  239. package/dist/client/assets/{textarea-Dt0w6mtc.js → textarea-B86ZyXzK.js} +2 -2
  240. package/dist/client/assets/{themePalette-9CODTNe7.js → themePalette-BAR7Sc97.js} +2 -2
  241. package/dist/client/assets/{threadSort-DJdKuCKp.js → threadSort-Dnq059Z5.js} +2 -2
  242. package/dist/client/assets/{timeline-definition-24CTP7MA-Dd3smJPR.js → timeline-definition-24CTP7MA-YXaIoqb6.js} +2 -2
  243. package/dist/client/assets/{toast-BeM8bZbF.js → toast-e2DHftFl.js} +2 -2
  244. package/dist/client/assets/{toggle-C3pF5hng.js → toggle-D4IMx5jG.js} +2 -2
  245. package/dist/client/assets/{toggle-group-C4V_4iet.js → toggle-group-BWnqiNcg.js} +2 -2
  246. package/dist/client/assets/{tooltip-Cco13jKX.js → tooltip-DRGG_vM1.js} +2 -2
  247. package/dist/client/assets/{treeView-Q6P3EWNA-Dbb-EyFc.js → treeView-Q6P3EWNA-BKHL242s.js} +1 -1
  248. package/dist/client/assets/{treemap-WGGIJYW6-C4Asv2we.js → treemap-WGGIJYW6-DKZHfhNz.js} +1 -1
  249. package/dist/client/assets/{usage-C5gCqDEF.js → usage-DZw1xQLa.js} +2 -2
  250. package/dist/client/assets/{usageAccess-CeCsk7TS.js → usageAccess-DLbz2bdv.js} +2 -2
  251. package/dist/client/assets/{usageFormat-CQXspPhL.js → usageFormat-CzWB9UsH.js} +2 -2
  252. package/dist/client/assets/{usageShortcuts-DaMuOxo1.js → usageShortcuts-DAEm4s6Q.js} +2 -2
  253. package/dist/client/assets/{use-atom-command-CMd4xAvF.js → use-atom-command-BEpD82FZ.js} +2 -2
  254. package/dist/client/assets/{useAriaLabelledBy-BinWYOc0.js → useAriaLabelledBy-D6y1qpkp.js} +2 -2
  255. package/dist/client/assets/{useHandleNewThread-2sRVaQar.js → useHandleNewThread-6AAzzJsA.js} +2 -2
  256. package/dist/client/assets/{useLocation-BQwksr61.js → useLocation-X2uUveT9.js} +2 -2
  257. package/dist/client/assets/useNavigate-B7cVsvjL.js +2 -0
  258. package/dist/client/assets/{useNavigateBack-D2S1CDHR.js → useNavigateBack-DoGrCk85.js} +2 -2
  259. package/dist/client/assets/{useParams-D_8gJiai.js → useParams-Bschqkhl.js} +2 -2
  260. package/dist/client/assets/{usePermissionStatus-Bl_cAihc.js → usePermissionStatus-DFa5P3Vr.js} +2 -2
  261. package/dist/client/assets/{usePullRequestActions-BcGz_qON.js → usePullRequestActions-FCnq9KIj.js} +2 -2
  262. package/dist/client/assets/{useRegisterFieldControl-Bp078Il-.js → useRegisterFieldControl-BgyE4_OV.js} +2 -2
  263. package/dist/client/assets/{useScopedModelAvailability-DAU9OPOv.js → useScopedModelAvailability-B8VSCR9i.js} +2 -2
  264. package/dist/client/assets/{useSettings-DpVy22yc.js → useSettings-CUN8qNLl.js} +2 -2
  265. package/dist/client/assets/{useT3ConnectAuthPrompt-BsnsXdaF.js → useT3ConnectAuthPrompt-BgqISbBe.js} +2 -2
  266. package/dist/client/assets/{utils-Dx_TSvdC.js → utils-BgVDKR83.js} +2 -2
  267. package/dist/client/assets/{vcsRefInvalidation--2K54DE9.js → vcsRefInvalidation-BWvsbPLB.js} +2 -2
  268. package/dist/client/assets/{vennDiagram-4TSXK5OY-V_3xLf5G.js → vennDiagram-4TSXK5OY-BN0NlVtY.js} +2 -2
  269. package/dist/client/assets/{wardley-WFR3VGLG-CDlEm4As.js → wardley-WFR3VGLG-DWpJUQkf.js} +1 -1
  270. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-CBqbrzOI.js → wardleyDiagram-VM6X3IG4-C_2_0OtT.js} +2 -2
  271. package/dist/client/assets/{welcome-DdV5o2sn.js → welcome-CT583VDG.js} +2 -2
  272. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BBAHFXyY.js → xychartDiagram-S5SC5T6Z-gSixBfkr.js} +2 -2
  273. package/dist/client/index.html +1 -1
  274. package/package.json +1 -1
  275. package/dist/client/assets/AlertDialogRoot-DYtW2IF3.js +0 -2
  276. package/dist/client/assets/Input-Cr3X6dPy.js +0 -2
  277. package/dist/client/assets/architecture-7GRP2DOG-I5ogqlvV.js +0 -1
  278. package/dist/client/assets/channel-3VrneojD.js +0 -2
  279. package/dist/client/assets/classDiagram-ZZMXUADV-cGz3NSHA.js +0 -2
  280. package/dist/client/assets/classDiagram-v2-VYDZK3BY-cGz3NSHA.js +0 -2
  281. package/dist/client/assets/eventmodeling-NTZA5JFV-CCbbQaex.js +0 -1
  282. package/dist/client/assets/flowDiagram-HODETNUW-BwO_EBwI.js +0 -1
  283. package/dist/client/assets/railroad-abnf-HS5TGJTU-BszadkTZ.js +0 -1
  284. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Cs2gjnvT.js +0 -1
  285. package/dist/client/assets/railroad-peg-WCYAUIDC-mvB_-15Z.js +0 -1
  286. package/dist/client/assets/settings.archived-_xyYN0XB.js +0 -2
  287. package/dist/client/assets/settings.providers-CDPVCtiM.js +0 -3
  288. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BqI4Wri4.js +0 -2
  289. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Des4AqSq.js +0 -9
  290. package/dist/client/assets/useNavigate-LjcLtV_e.js +0 -2
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{C_ as n,NE as r,hd as i,lE as a,sr as o,t as s}from"./utils-Dx_TSvdC.js";import{t as c}from"./spinner-DYnZ-Bpa.js";import{c as l,g as u,l as d}from"./tooltip-Cco13jKX.js";import{i as f,n as p}from"./session-BaKBc24W.js";import{t as m}from"./use-atom-command-CMd4xAvF.js";import{n as h}from"./dialog-BfenC7sz.js";import{t as g}from"./device-Dk2NULhB.js";import{Aa as _,La as v,Na as y,ja as b,ka as x}from"./main-CqNzdsfA.js";var S=r(),C=e(t(),1),w=e(a(),1);function T(e){let t=(0,S.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[a,s]=(0,C.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==a||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==a||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,w.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,w.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,w.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,w.jsx)(o,{size:`compact`,variant:`outline`,disabled:a!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:a===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=a,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=a,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,w.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var E=e=>e===`ios`?`iOS`:`Android`,D=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,O=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`;function k(e,t){let n=e.hosts.flatMap(e=>e.platforms).find(e=>e.platform===t);return n?.available?e.hostStatus===`ready`&&!e.devices.some(e=>e.platform===t)?{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`}:{ready:!0,message:t===`ios`?`Xcode and iOS Simulator are available.`:`The Android SDK and Emulator are available.`}:{ready:!1,message:n?.reason??`${E(t)} support was not detected.`}}function A(e){let t=f(e.environmentId,n),r=m(g.configure),i=m(g.list,{reportFailure:!1}),[a,c]=(0,C.useState)(null),[l,u]=(0,C.useState)(0),d=e.state.hostStatus!==`disabled`,S=e.state.hostStatus===`installing`||e.state.hostStatus===`starting`,E=e.state.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),k=async(t,n)=>{if(p(e.environmentId,`settings:write`)){c(t);try{let i=await r({environmentId:e.environmentId,input:n});t===`complete`&&i._tag===`Success`&&e.onComplete?.()}finally{c(null)}}};return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(_,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,w.jsx)(y,{steps:[`Device hub`,`Simulators`,`Agent access`],currentStep:l,onStepChange:u,isStepDisabled:e=>S||a!==null||e>l})}),(0,w.jsxs)(b,{children:[(0,w.jsx)(T,{state:e.state,environmentId:e.environmentId}),l===0?(0,w.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:D}),(0,w.jsx)(v,{checked:d,disabled:!t||S||a!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void k(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,w.jsx)(j,{state:e.state,pending:a===`hub`||S&&a!==`agent`})]}):null,l===1||l===0&&d&&E?(0,w.jsxs)(`section`,{className:s(`space-y-3 text-sm`,l===0&&`mt-4`),children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,w.jsx)(M,{state:e.state,checking:a===`check`,disabled:!d||S||a!==null,onCheck:()=>{c(`check`),i({environmentId:e.environmentId,input:{}}).finally(()=>c(null))}})]}):null,l===2?(0,w.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:O}),(0,w.jsx)(v,{checked:e.state.agentAccessEnabled,disabled:!t||!d||S||a!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void k(`agent`,{agentAccessEnabled:!!e})})]}),(0,w.jsx)(N,{state:e.state,pending:a===`agent`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,w.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null]}),(0,w.jsxs)(x,{children:[l===0?(0,w.jsx)(h,{render:(0,w.jsx)(o,{variant:`outline`}),children:`Cancel`}):(0,w.jsx)(o,{variant:`outline`,disabled:S||a!==null,onClick:()=>u(l-1),children:`Back`}),l<2?(0,w.jsx)(o,{disabled:e.state.hostStatus!==`ready`||a!==null,onClick:()=>u(l+1),children:`Continue`}):(0,w.jsx)(o,{disabled:!t||e.state.hostStatus!==`ready`||a!==null,onClick:()=>void k(`complete`,{onboardingCompleted:!0}),children:a===`complete`?`Saving…`:`Done`})]})]})}function j(e){let t=(0,S.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&n.hostStatus!==`ready`)return null;let s;t[0]===r?s=t[1]:(s=r?(0,w.jsx)(c,{size:`xs`}):(0,w.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let l=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,u;return t[2]!==s||t[3]!==l?(u=(0,w.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,l]}),t[2]=s,t[3]=l,t[4]=u):u=t[4],u}function M(e){let t=(0,S.c)(20),n;t[0]===e.state?n=t[1]:(n=k(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,w.jsx)(F,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=k(e.state,`android`),t[4]=e.state,t[5]=i);let a;t[6]===i?a=t[7]:(a=(0,w.jsx)(F,{platform:`Android`,status:i}),t[6]=i,t[7]=a);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let l;t[9]===e.checking?l=t[10]:(l=e.checking?(0,w.jsx)(c,{size:`xs`}):null,t[9]=e.checking,t[10]=l);let u=e.checking?`Checking…`:`Check again`,d;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==l||t[14]!==u?(d=(0,w.jsxs)(o,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[l,u]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=l,t[14]=u,t[15]=d):d=t[15];let f;return t[16]!==r||t[17]!==a||t[18]!==d?(f=(0,w.jsxs)(`div`,{className:`space-y-3`,children:[r,a,s,d]}),t[16]=r,t[17]=a,t[18]=d,t[19]=f):f=t[19],f}function N(e){let t=(0,S.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,w.jsx)(c,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,w.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&e.state.hostStatus===`ready`&&e.state.hosts.some(P)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,w.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function P(e){return e.agentDeviceInstalled}function F(e){let t=(0,S.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=s(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=s(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let o=e.status.ready?d:u,c;t[4]!==a||t[5]!==o?(c=(0,w.jsx)(l,{className:a,icon:o}),t[4]=a,t[5]=o,t[6]=c):c=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=s(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,w.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,w.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==c?(v=(0,w.jsxs)(`div`,{className:r,children:[c,_]}),t[17]=r,t[18]=_,t[19]=c,t[20]=v):v=t[20],v}export{O as a,T as c,F as i,j as n,D as o,A as r,k as s,N as t};
2
- //# sourceMappingURL=DeviceSetup-CX-B4Xfz.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{C_ as n,NE as r,hd as i,lE as a,sr as o,t as s}from"./utils-BgVDKR83.js";import{t as c}from"./spinner-B1oJASgu.js";import{c as l,g as u,l as d}from"./tooltip-DRGG_vM1.js";import{i as f,n as p}from"./session-eKfJi_Kx.js";import{t as m}from"./use-atom-command-BEpD82FZ.js";import{n as h}from"./dialog-DWCEeJ2c.js";import{t as g}from"./device-D7crohVQ.js";import{Aa as _,La as v,Na as y,ja as b,ka as x}from"./main-Co3JeKTg.js";var S=r(),C=e(t(),1),w=e(a(),1);function T(e){let t=(0,S.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[a,s]=(0,C.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==a||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==a||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,w.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,w.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,w.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,w.jsx)(o,{size:`compact`,variant:`outline`,disabled:a!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:a===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=a,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=a,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,w.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var E=e=>e===`ios`?`iOS`:`Android`,D=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,O=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`;function k(e,t){let n=e.hosts.flatMap(e=>e.platforms).find(e=>e.platform===t);return n?.available?e.hostStatus===`ready`&&!e.devices.some(e=>e.platform===t)?{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`}:{ready:!0,message:t===`ios`?`Xcode and iOS Simulator are available.`:`The Android SDK and Emulator are available.`}:{ready:!1,message:n?.reason??`${E(t)} support was not detected.`}}function A(e){let t=f(e.environmentId,n),r=m(g.configure),i=m(g.list,{reportFailure:!1}),[a,c]=(0,C.useState)(null),[l,u]=(0,C.useState)(0),d=e.state.hostStatus!==`disabled`,S=e.state.hostStatus===`installing`||e.state.hostStatus===`starting`,E=e.state.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),k=async(t,n)=>{if(p(e.environmentId,`settings:write`)){c(t);try{let i=await r({environmentId:e.environmentId,input:n});t===`complete`&&i._tag===`Success`&&e.onComplete?.()}finally{c(null)}}};return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(_,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,w.jsx)(y,{steps:[`Device hub`,`Simulators`,`Agent access`],currentStep:l,onStepChange:u,isStepDisabled:e=>S||a!==null||e>l})}),(0,w.jsxs)(b,{children:[(0,w.jsx)(T,{state:e.state,environmentId:e.environmentId}),l===0?(0,w.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:D}),(0,w.jsx)(v,{checked:d,disabled:!t||S||a!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void k(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,w.jsx)(j,{state:e.state,pending:a===`hub`||S&&a!==`agent`})]}):null,l===1||l===0&&d&&E?(0,w.jsxs)(`section`,{className:s(`space-y-3 text-sm`,l===0&&`mt-4`),children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,w.jsx)(M,{state:e.state,checking:a===`check`,disabled:!d||S||a!==null,onCheck:()=>{c(`check`),i({environmentId:e.environmentId,input:{}}).finally(()=>c(null))}})]}):null,l===2?(0,w.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:O}),(0,w.jsx)(v,{checked:e.state.agentAccessEnabled,disabled:!t||!d||S||a!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void k(`agent`,{agentAccessEnabled:!!e})})]}),(0,w.jsx)(N,{state:e.state,pending:a===`agent`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,w.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null]}),(0,w.jsxs)(x,{children:[l===0?(0,w.jsx)(h,{render:(0,w.jsx)(o,{variant:`outline`}),children:`Cancel`}):(0,w.jsx)(o,{variant:`outline`,disabled:S||a!==null,onClick:()=>u(l-1),children:`Back`}),l<2?(0,w.jsx)(o,{disabled:e.state.hostStatus!==`ready`||a!==null,onClick:()=>u(l+1),children:`Continue`}):(0,w.jsx)(o,{disabled:!t||e.state.hostStatus!==`ready`||a!==null,onClick:()=>void k(`complete`,{onboardingCompleted:!0}),children:a===`complete`?`Saving…`:`Done`})]})]})}function j(e){let t=(0,S.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&n.hostStatus!==`ready`)return null;let s;t[0]===r?s=t[1]:(s=r?(0,w.jsx)(c,{size:`xs`}):(0,w.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let l=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,u;return t[2]!==s||t[3]!==l?(u=(0,w.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,l]}),t[2]=s,t[3]=l,t[4]=u):u=t[4],u}function M(e){let t=(0,S.c)(20),n;t[0]===e.state?n=t[1]:(n=k(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,w.jsx)(F,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=k(e.state,`android`),t[4]=e.state,t[5]=i);let a;t[6]===i?a=t[7]:(a=(0,w.jsx)(F,{platform:`Android`,status:i}),t[6]=i,t[7]=a);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let l;t[9]===e.checking?l=t[10]:(l=e.checking?(0,w.jsx)(c,{size:`xs`}):null,t[9]=e.checking,t[10]=l);let u=e.checking?`Checking…`:`Check again`,d;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==l||t[14]!==u?(d=(0,w.jsxs)(o,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[l,u]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=l,t[14]=u,t[15]=d):d=t[15];let f;return t[16]!==r||t[17]!==a||t[18]!==d?(f=(0,w.jsxs)(`div`,{className:`space-y-3`,children:[r,a,s,d]}),t[16]=r,t[17]=a,t[18]=d,t[19]=f):f=t[19],f}function N(e){let t=(0,S.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,w.jsx)(c,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,w.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&e.state.hostStatus===`ready`&&e.state.hosts.some(P)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,w.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function P(e){return e.agentDeviceInstalled}function F(e){let t=(0,S.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=s(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=s(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let o=e.status.ready?d:u,c;t[4]!==a||t[5]!==o?(c=(0,w.jsx)(l,{className:a,icon:o}),t[4]=a,t[5]=o,t[6]=c):c=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=s(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,w.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,w.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==c?(v=(0,w.jsxs)(`div`,{className:r,children:[c,_]}),t[17]=r,t[18]=_,t[19]=c,t[20]=v):v=t[20],v}export{O as a,T as c,F as i,j as n,D as o,A as r,k as s,N as t};
2
+ //# sourceMappingURL=DeviceSetup-CKZmblju.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Br as n,Ca as r,Di as i,Eo as a,Er as o,Ja as s,Na as c,Pi as l,So as u,Ta as d,Ti as f,Ua as p,_o as m,ca as h,ci as g,di as _,do as v,fi as y,ga as b,gi as x,hi as S,jr as C,ki as w,lE as T,la as E,li as D,mi as O,oi as k,pi as A,po as j,si as M,ui as N,vi as P,vo as F,wr as ee,xr as te,yo as I}from"./utils-Dx_TSvdC.js";var L=e(t()),R=L.createContext(!1),z=L.createContext(void 0);function B(e){let t=L.useContext(z);if(e===!1&&t===void 0)throw Error(a(27));return t}var ne={...j,...m},re=L.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=B(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return F(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:ne,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),V=L.forwardRef(function(e,t){let{render:n,className:i,style:a,disabled:o=!1,nativeButton:s=!0,...l}=e,{store:u}=B(),d=u.useState(`open`),{getButtonProps:f,buttonRef:m}=c({disabled:o,native:s}),h={disabled:o};function g(e){d&&u.setOpen(!1,r(p,e.nativeEvent))}return F(`button`,e,{state:h,ref:[t,m],props:[{onClick:g},l,f]})}),H=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=B(),c=d(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),F(`p`,e,{ref:t,props:[{id:c},o]})}),U=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),W=function(e){return e[e.open=v.open]=`open`,e[e.closed=v.closed]=`closed`,e[e.startingStyle=v.startingStyle]=`startingStyle`,e[e.endingStyle=v.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),G=L.createContext(void 0);function K(){let e=L.useContext(G);if(e===void 0)throw Error(a(26));return e}var q=e(T()),J={...j,...m,nestedDialogOpen(e){return e?{[W.nestedDialogOpen]:``}:null}},Y=L.forwardRef(function(e,t){let{render:r,className:i,style:a,finalFocus:o,initialFocus:s,...c}=e,{store:l}=B(),u=l.useState(`descriptionElementId`),d=l.useState(`disablePointerDismissal`),f=l.useState(`floatingRootContext`),p=l.useState(`popupProps`),m=l.useState(`modal`),h=l.useState(`mounted`),g=l.useState(`nested`),_=l.useState(`nestedOpenDialogCount`),v=l.useState(`open`),y=l.useState(`openMethod`),x=l.useState(`titleElementId`),S=l.useState(`transitionStatus`),C=l.useState(`role`),T=f.useState(`floatingId`),E=c.id??T;K(),b({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}});function D(e){return e!==`touch`||l.context.popupRef.current}let O=s===void 0?D:s,k=_>0,A=l.useStateSetter(`popupElement`),j=F(`div`,e,{state:{open:v,nested:g,transitionStatus:S,nestedDialogOpen:k},props:[p,{id:E,"aria-labelledby":x??void 0,"aria-describedby":u??void 0,role:C,...N,hidden:!h,onKeyDown(e){n.has(e.key)&&e.stopPropagation()},style:{[U.nestedDialogs]:_}},c],ref:[t,l.context.popupRef,A],stateAttributesMapping:J});return(0,q.jsx)(w,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!d,initialFocus:O,returnFocus:o,modal:m!==!1,restoreFocus:`popup`,children:j})}),ie=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=B(),a=i.useState(`mounted`),s=i.useState(`modal`),c=i.useState(`open`);return a||n?(0,q.jsx)(G.Provider,{value:n,children:(0,q.jsxs)(l,{ref:t,...r,children:[a&&s===!0&&(0,q.jsx)(o,{ref:i.context.internalBackdropRef,inert:C(!c)}),e.children]})}):null});function ae(e){let{store:t,parentContext:n,actionsRef:i,isDrawer:a}=e,o=t.useState(`open`);S(t,o),y(t);let{forceUnmount:c}=A(o,t),l=L.useCallback(()=>{t.setOpen(!1,r(s))},[t]);return L.useImperativeHandle(i,()=>({unmount:c,close:l}),[c,l]),{parentContext:n,isDrawer:a}}function oe({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,a=e.useState(`open`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[d,f]=L.useState(0),[p,m]=L.useState(0),g=d===0,_=i(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=E(t);if(g&&!o){let t=n;return s&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||h(t,c)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:g});ee(a&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{f(e),m(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{f(0),m(0)}),L.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(d+1,p+ +!!r),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[r,a,d,p,n]);let v=_.reference??u,y=_.trigger??u,b=L.useMemo(()=>I(N,_.floating),[_.floating]);return O(e,{activeTriggerProps:v,inactiveTriggerProps:y,popupProps:b,nestedOpenDialogCount:d,nestedOpenDrawerCount:p}),null}var se={...g,modal:f(e=>e.modal),nested:f(e=>e.nested),nestedOpenDialogCount:f(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:f(e=>e.nestedOpenDrawerCount),disablePointerDismissal:f(e=>e.disablePointerDismissal),openMethod:f(e=>e.openMethod),descriptionElementId:f(e=>e.descriptionElementId),titleElementId:f(e=>e.titleElementId),viewportElement:f(e=>e.viewportElement),role:f(e=>e.role)},X=class e extends P{constructor(e,t,n=!1){let r=new D,i=ce(e);i.floatingRootContext=M(r,t,n),super(i,{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},se)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};_(n,e,t.trigger),this.update(n)};static useStore(t,n){return x(t,(t,r)=>new e(n,t,r),!0).store}};function ce(e={}){return{...k(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Z(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=B(!0),y={modal:h,disablePointerDismissal:g,nested:!!v,role:_},b=X.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y});te(()=>{let e=r===void 0&&b.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?b.update(e?{...y,...e}:y):e&&b.update(e)}),b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`),w=ae({store:b,actionsRef:l,parentContext:v?.store.context,isDrawer:p}),T=x||S,E=L.useMemo(()=>({store:b}),[b]);return(0,q.jsx)(R.Provider,{value:!1,children:(0,q.jsxs)(z.Provider,{value:E,children:[T&&(0,q.jsx)(oe,{store:b,dialogRoot:w}),typeof n==`function`?n({payload:C}):n]})})}function le(e){return Z(e,L.useContext(R)?`drawer`:`dialog`)}var Q=function(e){return e[e.open=v.open]=`open`,e[e.closed=v.closed]=`closed`,e[e.startingStyle=v.startingStyle]=`startingStyle`,e[e.endingStyle=v.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),$={...j,...m,nested(e){return e?{[Q.nested]:``}:null},nestedDialogOpen(e){return e?{[Q.nestedDialogOpen]:``}:null}},ue=L.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=K(),{store:c}=B(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return F(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:$,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),de=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=B(),c=d(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),F(`h2`,e,{ref:t,props:[{id:c},o]})});export{X as a,H as c,B as d,Z as i,V as l,ue as n,ie as o,le as r,Y as s,de as t,re as u};
2
- //# sourceMappingURL=DialogTitle-BgclXafx.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Br as n,Ca as r,Di as i,Eo as a,Er as o,Ja as s,Na as c,Pi as l,So as u,Ta as d,Ti as f,Ua as p,_o as m,ca as h,ci as g,di as _,do as v,fi as y,ga as b,gi as x,hi as S,jr as C,ki as w,lE as T,la as E,li as D,mi as O,oi as k,pi as A,po as j,si as M,ui as N,vi as P,vo as F,wr as ee,xr as te,yo as I}from"./utils-BgVDKR83.js";var L=e(t()),R=L.createContext(!1),z=L.createContext(void 0);function B(e){let t=L.useContext(z);if(e===!1&&t===void 0)throw Error(a(27));return t}var ne={...j,...m},re=L.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=B(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return F(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:ne,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),V=L.forwardRef(function(e,t){let{render:n,className:i,style:a,disabled:o=!1,nativeButton:s=!0,...l}=e,{store:u}=B(),d=u.useState(`open`),{getButtonProps:f,buttonRef:m}=c({disabled:o,native:s}),h={disabled:o};function g(e){d&&u.setOpen(!1,r(p,e.nativeEvent))}return F(`button`,e,{state:h,ref:[t,m],props:[{onClick:g},l,f]})}),H=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=B(),c=d(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),F(`p`,e,{ref:t,props:[{id:c},o]})}),U=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),W=function(e){return e[e.open=v.open]=`open`,e[e.closed=v.closed]=`closed`,e[e.startingStyle=v.startingStyle]=`startingStyle`,e[e.endingStyle=v.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),G=L.createContext(void 0);function K(){let e=L.useContext(G);if(e===void 0)throw Error(a(26));return e}var q=e(T()),J={...j,...m,nestedDialogOpen(e){return e?{[W.nestedDialogOpen]:``}:null}},Y=L.forwardRef(function(e,t){let{render:r,className:i,style:a,finalFocus:o,initialFocus:s,...c}=e,{store:l}=B(),u=l.useState(`descriptionElementId`),d=l.useState(`disablePointerDismissal`),f=l.useState(`floatingRootContext`),p=l.useState(`popupProps`),m=l.useState(`modal`),h=l.useState(`mounted`),g=l.useState(`nested`),_=l.useState(`nestedOpenDialogCount`),v=l.useState(`open`),y=l.useState(`openMethod`),x=l.useState(`titleElementId`),S=l.useState(`transitionStatus`),C=l.useState(`role`),T=f.useState(`floatingId`),E=c.id??T;K(),b({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}});function D(e){return e!==`touch`||l.context.popupRef.current}let O=s===void 0?D:s,k=_>0,A=l.useStateSetter(`popupElement`),j=F(`div`,e,{state:{open:v,nested:g,transitionStatus:S,nestedDialogOpen:k},props:[p,{id:E,"aria-labelledby":x??void 0,"aria-describedby":u??void 0,role:C,...N,hidden:!h,onKeyDown(e){n.has(e.key)&&e.stopPropagation()},style:{[U.nestedDialogs]:_}},c],ref:[t,l.context.popupRef,A],stateAttributesMapping:J});return(0,q.jsx)(w,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!d,initialFocus:O,returnFocus:o,modal:m!==!1,restoreFocus:`popup`,children:j})}),ie=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=B(),a=i.useState(`mounted`),s=i.useState(`modal`),c=i.useState(`open`);return a||n?(0,q.jsx)(G.Provider,{value:n,children:(0,q.jsxs)(l,{ref:t,...r,children:[a&&s===!0&&(0,q.jsx)(o,{ref:i.context.internalBackdropRef,inert:C(!c)}),e.children]})}):null});function ae(e){let{store:t,parentContext:n,actionsRef:i,isDrawer:a}=e,o=t.useState(`open`);S(t,o),y(t);let{forceUnmount:c}=A(o,t),l=L.useCallback(()=>{t.setOpen(!1,r(s))},[t]);return L.useImperativeHandle(i,()=>({unmount:c,close:l}),[c,l]),{parentContext:n,isDrawer:a}}function oe({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,a=e.useState(`open`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[d,f]=L.useState(0),[p,m]=L.useState(0),g=d===0,_=i(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=E(t);if(g&&!o){let t=n;return s&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||h(t,c)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:g});ee(a&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{f(e),m(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{f(0),m(0)}),L.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(d+1,p+ +!!r),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[r,a,d,p,n]);let v=_.reference??u,y=_.trigger??u,b=L.useMemo(()=>I(N,_.floating),[_.floating]);return O(e,{activeTriggerProps:v,inactiveTriggerProps:y,popupProps:b,nestedOpenDialogCount:d,nestedOpenDrawerCount:p}),null}var se={...g,modal:f(e=>e.modal),nested:f(e=>e.nested),nestedOpenDialogCount:f(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:f(e=>e.nestedOpenDrawerCount),disablePointerDismissal:f(e=>e.disablePointerDismissal),openMethod:f(e=>e.openMethod),descriptionElementId:f(e=>e.descriptionElementId),titleElementId:f(e=>e.titleElementId),viewportElement:f(e=>e.viewportElement),role:f(e=>e.role)},X=class e extends P{constructor(e,t,n=!1){let r=new D,i=ce(e);i.floatingRootContext=M(r,t,n),super(i,{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},se)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};_(n,e,t.trigger),this.update(n)};static useStore(t,n){return x(t,(t,r)=>new e(n,t,r),!0).store}};function ce(e={}){return{...k(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Z(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=B(!0),y={modal:h,disablePointerDismissal:g,nested:!!v,role:_},b=X.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y});te(()=>{let e=r===void 0&&b.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?b.update(e?{...y,...e}:y):e&&b.update(e)}),b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`),w=ae({store:b,actionsRef:l,parentContext:v?.store.context,isDrawer:p}),T=x||S,E=L.useMemo(()=>({store:b}),[b]);return(0,q.jsx)(R.Provider,{value:!1,children:(0,q.jsxs)(z.Provider,{value:E,children:[T&&(0,q.jsx)(oe,{store:b,dialogRoot:w}),typeof n==`function`?n({payload:C}):n]})})}function le(e){return Z(e,L.useContext(R)?`drawer`:`dialog`)}var Q=function(e){return e[e.open=v.open]=`open`,e[e.closed=v.closed]=`closed`,e[e.startingStyle=v.startingStyle]=`startingStyle`,e[e.endingStyle=v.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),$={...j,...m,nested(e){return e?{[Q.nested]:``}:null},nestedDialogOpen(e){return e?{[Q.nestedDialogOpen]:``}:null}},ue=L.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=K(),{store:c}=B(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return F(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:$,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),de=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=B(),c=d(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),F(`h2`,e,{ref:t,props:[{id:c},o]})});export{X as a,H as c,B as d,Z as i,V as l,ue as n,ie as o,le as r,Y as s,de as t,re as u};
2
+ //# sourceMappingURL=DialogTitle-Bs5Povma.js.map
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cm as n,NE as r,Qf as i,lE as a,sr as o}from"./utils-Dx_TSvdC.js";import{w as s}from"./Virtualizer-DySKW4Qd.js";import{o as c}from"./DiffWorkerPoolProvider-NaKmpbcL.js";import{t as l}from"./textarea-Dt0w6mtc.js";function u({metaKey:e,ctrlKey:t},n=s()){return n?e&&!t:t&&!e}function d(e){if(s()&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`;if(e.key===`Home`)return`start`;if(e.key===`End`)return`end`}if(u(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}var f=new WeakMap,p=h([{bindings:{Tab:`indent`,"shift+Tab":`outdent`,"cmdOrCtrl+[":`indentLess`,"cmdOrCtrl+]":`indentMore`,"cmdOrCtrl+z":`undo`,"cmdOrCtrl+shift+z":`redo`,"cmdOrCtrl+a":`selectAll`,"cmdOrCtrl+d":`findNextMatch`,"cmdOrCtrl+f":`openSearchPanel`,"cmdOrCtrl+alt+f":`openSearchReplacePanel`,"alt+ArrowUp":`moveLineUp`,"alt+ArrowDown":`moveLineDown`,"shift+alt+ArrowUp":`copyLineUp`,"shift+alt+ArrowDown":`copyLineDown`,Escape:`simplifySelection`,"cmdOrCtrl+Enter":`insertBlankLine`,"cmdOrCtrl+/":`toggleComment`,"shift+alt+a":`toggleBlockComment`,"cmdOrCtrl+Home":`moveCursorToDocStart`,"cmdOrCtrl+End":`moveCursorToDocEnd`,"cmdOrCtrl+shift+Home":`expandSelectionDocStart`,"cmdOrCtrl+shift+End":`expandSelectionDocEnd`}},{platform:`mac`,bindings:{"ctrl+k":`deleteHardLineForward`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`,"cmd+ArrowUp":`moveCursorToDocStart`,"cmd+ArrowDown":`moveCursorToDocEnd`,"cmd+shift+ArrowUp":`expandSelectionDocStart`,"cmd+shift+ArrowDown":`expandSelectionDocEnd`}},{platform:`windows`,bindings:{"ctrl+y":`redo`}},{platform:`linux`,bindings:{"ctrl+y":`redo`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`}}]),m={Backquote:"`",Minus:`-`,Equal:`=`,Comma:`,`,Period:`.`,Slash:`/`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Space:`Space`};function h(e){let t=f.get(e);if(t===void 0){t={mac:new Map,windows:new Map,linux:new Map};for(let n of e)for(let e of Object.keys(n.bindings)){let r=n.bindings[e];if(r===void 0)continue;let i=e.split(`+`),a=i.pop();for(let e of[`mac`,`windows`,`linux`]){if(n.platform!==void 0&&n.platform!==e)continue;let o=0;for(let t of i)t===`alt`?o|=1:t===`ctrl`?o|=2:t===`cmd`?o|=4:t===`shift`?o|=8:t===`cmdOrCtrl`&&(o|=e===`mac`?4:2);let s=t[e].get(o);s===void 0&&(s=new Map,t[e].set(o,s)),s.set(a,r)}}f.set(e,t)}return t}function g(e,t,n=s()){let r=e.key===` `?`Space`:e.key.length===1?e.key.toLowerCase():e.key,i=e.code??``,a=i.startsWith(`Key`)&&i.length===4?i.slice(3).toLowerCase():i.startsWith(`Digit`)&&i.length===6?i.slice(5):m[i],o=n?`mac`:globalThis.navigator?.platform.includes(`Linux`)===!0?`linux`:`windows`,c=+!!e.altKey|(e.ctrlKey?2:0)|(e.metaKey?4:0)|(e.shiftKey?8:0);if(t!==void 0){let e=h(t)[o].get(c),n=e?.get(r)??(a===void 0?void 0:e?.get(a));if(n!==void 0)return n}let l=p[o].get(c);return l?.get(r)??(a===void 0?void 0:l?.get(a))}function _(e,t=s()){if(!e.altKey&&u(e,t)&&((e.key.length===1?e.key.toLowerCase():e.key)===`g`||e.code===`KeyG`))return e.shiftKey?`previous`:`next`}var v=1e5,y=10,b=13,x=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,S=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+ +!!this.hasVirtualTrailingCRBreak}},C=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=c(e)}append(e){let t=this.text.length;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===y||r===b)&&(r===b&&e.charCodeAt(n+1)===y&&n++,this.lineOffsets.push(t+n+1))}return this.text+=e,t}},w=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-+!!N(this.left?.subtreeLastCharCode,this.piece.firstCharCode)-!!N(this.piece.lastCharCode,this.right?.subtreeFirstCharCode),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},T=class{#e;#t=new C(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=null;#c=2654435769;constructor(e){this.#e=new C(e);let t=this.#y(S.Original,0,e.length);this.#n=t.length>0?this.#C(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#g();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#f(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#f(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&E(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=D(e,0,this.#r),i=D(t,r,this.#r);if(r>=i)return``;let a=this.#u(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#v(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&E(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#d(s)}return o.join(``)}charAt(e){let t=this.#u(e);if(t===void 0)return``;let[n,r]=t;return this.#v(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=O(e),n=0,r=!1;return this.#_(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=k(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=O(e),a=0,o=0,s,c;return this.#_(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!A(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cm as n,NE as r,Qf as i,lE as a,sr as o}from"./utils-BgVDKR83.js";import{w as s}from"./Virtualizer-YZrA28xX.js";import{o as c}from"./DiffWorkerPoolProvider-Bn4H-Zao.js";import{t as l}from"./textarea-B86ZyXzK.js";function u({metaKey:e,ctrlKey:t},n=s()){return n?e&&!t:t&&!e}function d(e){if(s()&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`;if(e.key===`Home`)return`start`;if(e.key===`End`)return`end`}if(u(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}var f=new WeakMap,p=h([{bindings:{Tab:`indent`,"shift+Tab":`outdent`,"cmdOrCtrl+[":`indentLess`,"cmdOrCtrl+]":`indentMore`,"cmdOrCtrl+z":`undo`,"cmdOrCtrl+shift+z":`redo`,"cmdOrCtrl+a":`selectAll`,"cmdOrCtrl+d":`findNextMatch`,"cmdOrCtrl+f":`openSearchPanel`,"cmdOrCtrl+alt+f":`openSearchReplacePanel`,"alt+ArrowUp":`moveLineUp`,"alt+ArrowDown":`moveLineDown`,"shift+alt+ArrowUp":`copyLineUp`,"shift+alt+ArrowDown":`copyLineDown`,Escape:`simplifySelection`,"cmdOrCtrl+Enter":`insertBlankLine`,"cmdOrCtrl+/":`toggleComment`,"shift+alt+a":`toggleBlockComment`,"cmdOrCtrl+Home":`moveCursorToDocStart`,"cmdOrCtrl+End":`moveCursorToDocEnd`,"cmdOrCtrl+shift+Home":`expandSelectionDocStart`,"cmdOrCtrl+shift+End":`expandSelectionDocEnd`}},{platform:`mac`,bindings:{"ctrl+k":`deleteHardLineForward`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`,"cmd+ArrowUp":`moveCursorToDocStart`,"cmd+ArrowDown":`moveCursorToDocEnd`,"cmd+shift+ArrowUp":`expandSelectionDocStart`,"cmd+shift+ArrowDown":`expandSelectionDocEnd`}},{platform:`windows`,bindings:{"ctrl+y":`redo`}},{platform:`linux`,bindings:{"ctrl+y":`redo`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`}}]),m={Backquote:"`",Minus:`-`,Equal:`=`,Comma:`,`,Period:`.`,Slash:`/`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Space:`Space`};function h(e){let t=f.get(e);if(t===void 0){t={mac:new Map,windows:new Map,linux:new Map};for(let n of e)for(let e of Object.keys(n.bindings)){let r=n.bindings[e];if(r===void 0)continue;let i=e.split(`+`),a=i.pop();for(let e of[`mac`,`windows`,`linux`]){if(n.platform!==void 0&&n.platform!==e)continue;let o=0;for(let t of i)t===`alt`?o|=1:t===`ctrl`?o|=2:t===`cmd`?o|=4:t===`shift`?o|=8:t===`cmdOrCtrl`&&(o|=e===`mac`?4:2);let s=t[e].get(o);s===void 0&&(s=new Map,t[e].set(o,s)),s.set(a,r)}}f.set(e,t)}return t}function g(e,t,n=s()){let r=e.key===` `?`Space`:e.key.length===1?e.key.toLowerCase():e.key,i=e.code??``,a=i.startsWith(`Key`)&&i.length===4?i.slice(3).toLowerCase():i.startsWith(`Digit`)&&i.length===6?i.slice(5):m[i],o=n?`mac`:globalThis.navigator?.platform.includes(`Linux`)===!0?`linux`:`windows`,c=+!!e.altKey|(e.ctrlKey?2:0)|(e.metaKey?4:0)|(e.shiftKey?8:0);if(t!==void 0){let e=h(t)[o].get(c),n=e?.get(r)??(a===void 0?void 0:e?.get(a));if(n!==void 0)return n}let l=p[o].get(c);return l?.get(r)??(a===void 0?void 0:l?.get(a))}function _(e,t=s()){if(!e.altKey&&u(e,t)&&((e.key.length===1?e.key.toLowerCase():e.key)===`g`||e.code===`KeyG`))return e.shiftKey?`previous`:`next`}var v=1e5,y=10,b=13,x=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,S=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+ +!!this.hasVirtualTrailingCRBreak}},C=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=c(e)}append(e){let t=this.text.length;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===y||r===b)&&(r===b&&e.charCodeAt(n+1)===y&&n++,this.lineOffsets.push(t+n+1))}return this.text+=e,t}},w=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-+!!N(this.left?.subtreeLastCharCode,this.piece.firstCharCode)-!!N(this.piece.lastCharCode,this.right?.subtreeFirstCharCode),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},T=class{#e;#t=new C(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=null;#c=2654435769;constructor(e){this.#e=new C(e);let t=this.#y(S.Original,0,e.length);this.#n=t.length>0?this.#C(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#g();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#f(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#f(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&E(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=D(e,0,this.#r),i=D(t,r,this.#r);if(r>=i)return``;let a=this.#u(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#v(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&E(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#d(s)}return o.join(``)}charAt(e){let t=this.#u(e);if(t===void 0)return``;let[n,r]=t;return this.#v(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=O(e),n=0,r=!1;return this.#_(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=k(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=O(e),a=0,o=0,s,c;return this.#_(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!A(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
2
2
  `)||e.text.includes(`\r`)||e.regex&&(e.text.includes(`\\n`)||e.text.includes(`\\r`)))return[];let t;try{t=R(e.text,e.regex,e.caseSensitive)}catch{return[]}return this.#l(t,e.wholeWord,v)}#l(e,t,n){let r=[],i=this.#g(),a=i.length,o=c(i);for(let s=0;s<o.length;s++){let c=o[s],l=o[s+1]??a;for(;l>c&&E(i.charCodeAt(l-1));)l--;let u=i.slice(c,l);e.lastIndex=0;let d;for(;(d=e.exec(u))!==null;){let a=d.index,o=d[0];if(o.length===0){e.lastIndex=V(u,a);continue}let s=c+a;if((!t||L(i,s,o.length))&&(r.push([s,s+o.length]),r.length>=n))return r;a===e.lastIndex&&(e.lastIndex=V(u,a))}}return r}insert(e,t){if(e.length===0)return;let n=D(t,0,this.#r);this.#b(n,n,e),this.#x()}delete(e,t){if(t<=0||this.#r===0)return;let n=D(e,0,this.#r),r=D(n+t,n,this.#r);n!==r&&(this.#b(n,r,``),this.#x())}applyEdits(e){if(e.length!==0){for(let t=e.length-1;t>=0;t--){let n=e[t],r=D(n.start,0,this.#r),i=D(n.end,r,this.#r);this.#b(r,i,n.text)}this.#x()}}positionAt(e){let t=D(e,0,this.#r);if(this.#r===0)return{line:0,character:0};let n=this.#p(t),r=t-(n===0?0:this.#m(n-1));return this.#s=[n,r,t],{line:n,character:r}}positionsAt(e){let t=Array.from({length:e.length});if(e.length===0)return t;if(this.#r===0)return t.fill({line:0,character:0});for(let n=0;n<e.length;n++)t[n]=this.positionAt(e[n]);return t}offsetAt(e){if(e.line<0||this.#r===0)return 0;if(e.line>=this.#i)throw Error(`Line index out of range: ${e.line}`);let t=this.#s;if(t!==null&&t[0]===e.line&&t[1]===e.character)return t[2];let n=this.#f(e.line);if(n===void 0)throw Error(`Line index out of range: ${e.line}`);let r=D(e.character,0,n[1]-n[0]);return n[0]+r}#u(e){if(e<0||e>=this.#r)return;let t=this.#n,n=e;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(n-=e,n<t.piece.length)return[t,n];n-=t.piece.length,t=t.right}}#d(e){if(e.right!==null){let t=e.right;for(;t.left!==null;)t=t.left;return t}let t=e;for(;t.parent!==null&&t===t.parent.right;)t=t.parent;return t.parent}#f(e){if(e<0)throw Error(`Line index out of range: ${e}`);if(this.#r===0){if(e===0)return[0,0];throw Error(`Line index out of range: ${e}`)}if(e>=this.#i)throw Error(`Line index out of range: ${e}`);return[e===0?0:this.#m(e-1),e<this.#i-1?this.#m(e):this.#r]}#p(e){let t=this.#n,n=D(e,0,this.#r),r=0;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(r+=(t.left?.subtreeLineBreakCount??0)-+!!N(t.left?.subtreeLastCharCode,t.piece.firstCharCode),n-=e,n<=t.piece.length){let e=this.#v(t.piece.source),i=Math.min(P(e.lineOffsets,t.piece.offset+n),t.piece.lineOffsetEnd);return r+=i-t.piece.lineOffsetStart,n===t.piece.length&&t.piece.hasVirtualTrailingCRBreak&&r++,n===t.piece.length&&N(t.piece.lastCharCode,this.#d(t)?.piece.firstCharCode)&&r--,r}r+=t.piece.lineBreakCount-+!!N(t.piece.lastCharCode,t.right?.subtreeFirstCharCode),n-=t.piece.length,t=t.right}return this.#i-1}#m(e){let t=this.#n,n=e,r=0,i;for(;t!==null;){let e=(t.left?.subtreeLineBreakCount??0)-+!!N(t.left?.subtreeLastCharCode,t.piece.firstCharCode);if(n<e){i=t.piece.firstCharCode,t=t.left;continue}let a=t.left?.subtreeLength??0;r+=a,n-=e;let o=t.right?.subtreeFirstCharCode??i,s=t.piece.lineBreakCount-+!!N(t.piece.lastCharCode,o);if(n<s)return r+this.#h(t.piece,n);r+=t.piece.length,n-=s,t=t.right}return this.#r}#h(e,t){return t<e.lineOffsetEnd-e.lineOffsetStart?this.#v(e.source).lineOffsets[e.lineOffsetStart+t]-e.offset:e.length}#g(){let e=[];return this.#_(t=>{e.push(t.text.slice(t.start,t.end))}),e.join(``)}#_(e){this.#j(this.#n,t=>{let n=this.#v(t.piece.source);return e({text:n.text,lineOffsets:n.lineOffsets,lineOffsetStart:t.piece.lineOffsetStart,lineOffsetEnd:t.piece.lineOffsetEnd,start:t.piece.offset,end:t.piece.offset+t.piece.length})})}#v(e){return e===S.Original?this.#e:this.#t}#y(e,t,n){let r=this.#v(e),i=t+n,a=P(r.lineOffsets,t),o=P(r.lineOffsets,i),s=r.text.charCodeAt(i-1);return new S(e,t,n,a,o,s===b&&r.lineOffsets[o-1]!==i,r.text.charCodeAt(t),s)}#b(e,t,n){if(e===t&&n.length===0)return;let[r,i]=this.#E(this.#n,e),a=this.#D(i,t-e),o;if(n.length>0){let e=this.#y(S.Added,this.#t.append(n),n.length);o=this.#O(this.#k(r,e),a)}else{let[e,t]=this.#A(a);o=e===void 0?r:this.#O(this.#k(r,e),t)}o!==null&&(o.parent=null),this.#n=o,this.#r=o?.subtreeLength??0,this.#i=(o?.subtreeLineBreakCount??0)+1}#x(){this.#a=null,this.#o=null,this.#s=null}#S(){return this.#c=Math.imul(this.#c,1664525)+1013904223>>>0,this.#c}#C(e){let t=new w(e);return t.priority=this.#S(),t}#w(e,t){e.left=t,t!==null&&(t.parent=e)}#T(e,t){e.right=t,t!==null&&(t.parent=e)}#E(e,t){if(e===null)return[null,null];if(t<=0)return[null,e];if(t>=e.subtreeLength)return[e,null];let n=e.left?.subtreeLength??0;if(t<=n){let[n,r]=this.#E(e.left,t);return this.#w(e,r),e.updateSubtreeLength(),[n,e]}let r=e.piece.length;if(t>=n+r){let[i,a]=this.#E(e.right,t-n-r);return this.#T(e,i),e.updateSubtreeLength(),[e,a]}let i=t-n,a=new w(this.#y(e.piece.source,e.piece.offset,i)),o=new w(this.#y(e.piece.source,e.piece.offset+i,r-i));return a.priority=e.priority,o.priority=e.priority,this.#w(a,e.left),this.#T(o,e.right),a.updateSubtreeLength(),o.updateSubtreeLength(),[a,o]}#D(e,t){if(e===null||t>=e.subtreeLength)return null;if(t<=0)return e;let n=e.left?.subtreeLength??0;if(t<=n)return this.#w(e,this.#D(e.left,t)),e.updateSubtreeLength(),e;let r=n+e.piece.length;if(t>=r)return this.#D(e.right,t-r);let i=t-n,a=new w(this.#y(e.piece.source,e.piece.offset+i,e.piece.length-i));return a.priority=e.priority,this.#T(a,e.right),a.updateSubtreeLength(),a}#O(e,t){return e===null?t:t===null?e:e.priority>=t.priority?(this.#T(e,this.#O(e.right,t)),e.updateSubtreeLength(),e):(this.#w(t,this.#O(e,t.left)),t.updateSubtreeLength(),t)}#k(e,t){if(e===null)return this.#C(t);let n=e;for(;n.right!==null;)n=n.right;if(j(n.piece,t)){n.piece=M(n.piece,t);for(let t=n;t!==null&&(t.updateSubtreeLength(),t!==e);)t=t.parent;return e}return this.#O(e,this.#C(t))}#A(e){if(e===null)return[void 0,null];if(e.left===null)return[e.piece,e.right];let[t,n]=this.#A(e.left);return this.#w(e,n),e.updateSubtreeLength(),[t,e]}#j(e,t){return e===null?!0:!this.#j(e.left,t)||t(e)===!1?!1:this.#j(e.right,t)}};function E(e){return e===10||e===13}function D(e,t,n){return Math.min(Math.max(e,t),n)}function O(e){let t=Array.from({length:e.length}).fill(0),n=0;for(let r=1;r<e.length;r++){let i=e.charCodeAt(r);for(;n>0&&i!==e.charCodeAt(n);)n=t[n-1];i===e.charCodeAt(n)&&n++,t[r]=n}return t}function k(e,t){let n=[];for(let[r,i]of e){let e=D(r,0,t),a=D(i,e,t);e<a&&n.push([e,a])}n.sort((e,t)=>e[0]-t[0]);let r=[];for(let e of n){let t=r[r.length-1];if(t!==void 0&&e[0]<=t[1]){t[1]=Math.max(t[1],e[1]);continue}r.push(e)}return r}function A(e,t,n){let r=0,i=e.length;for(;r<i;){let n=r+Math.floor((i-r)/2);e[n][1]<=t?r=n+1:i=n}let a=e[r];return a!==void 0&&a[0]<n}function j(e,t){return e.source===t.source&&e.offset+e.length===t.offset&&!N(e.lastCharCode,t.firstCharCode)}function M(e,t){return new S(e.source,e.offset,e.length+t.length,e.lineOffsetStart,t.lineOffsetEnd,t.hasVirtualTrailingCRBreak,e.firstCharCode,t.lastCharCode)}function N(e,t){return e===b&&t===y}function P(e,t){let n=0,r=e.length;for(;n<r;){let i=n+Math.floor((r-n)/2);e[i]<=t?n=i+1:r=i}return n}function F(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function I(e){if(e<=32||e===127)return!0;let t=String.fromCharCode(e);return x.includes(t)}function L(e,t,n){let r=t<=0||I(e.charCodeAt(t-1)),i=t+n>=e.length||I(e.charCodeAt(t+n));return r&&i}function R(e,t,n){let r=t?e:F(e);return new RegExp(r,`g${n?``:`i`}${t?`m`:``}`)}function z(e,t){return e.replace(/\$([$&]|\d+)/g,(e,n)=>n===`$`?`$`:n===`&`?t[0]??``:t[Number(n)]??``)}function B(e,t,n,r,i,a){if(!r.regex)return r.replaceText;let o=e(i),s=n(o.line),c=i-t({line:o.line,character:0}),l;try{l=R(r.text,!0,r.caseSensitive)}catch{return r.replaceText}l.lastIndex=c;let u=l.exec(s);return u===null||u.index!==c||u[0].length!==a-i?r.replaceText:z(r.replaceText,u)}function V(e,t){if(t+1<e.length){let n=e.charCodeAt(t),r=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&r>=56320&&r<=57343)return t+2}return t+1}function H(e,t,n){let{style:r,dataset:i,children:a,...o}=t??{},s=document.createElement(e);return Object.assign(s,o),r!==void 0&&(typeof r==`string`?s.style.cssText=r:Object.assign(s.style,r)),i!==void 0&&(typeof i==`string`?s.dataset[i]=``:Array.isArray(i)?i.forEach(e=>{s.dataset[e]=``}):Object.assign(s.dataset,i)),a!==void 0&&s.replaceChildren(...a),n!==void 0&&n.appendChild(s),s}function U(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function W(e,t=`line`){let n=e.dataset[t];if(n===void 0)return;let r=parseInt(n,10);if(!Number.isNaN(r))return r}function ee(e,t){if(e.nodeType===3){let n=e.textContent?.length??0;return Math.max(0,Math.min(t,n))}return e.nodeType===1?Math.max(0,Math.min(t,e.childNodes.length)):0}function te(e,t){return Object.assign(e,t)}function ne(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function re(e,t=1e3){return Math.round(e*t)/t}function ie(e){return e.endsWith(`
3
3
  `)||e.endsWith(`\r`)}function G(e){if(typeof Intl<`u`&&typeof Intl.Segmenter==`function`)return new Intl.Segmenter(void 0,e)}var K,q=!1;function J(){return q||=(K=G({granularity:`grapheme`}),!0),K}function ae(e){let t=e.ownerDocument,n=e.parentElement;for(;n!=null&&n!==t.body&&n!==t.documentElement;){let e=n.ownerDocument.defaultView?.getComputedStyle(n).overflowY;if(e===`auto`||e===`scroll`||e===`overlay`)return n;n=n.parentElement}return t}var Y=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
4
4
  <symbol id="diffs-editor-icon-close" viewBox="0 0 16 16">
@@ -33,4 +33,4 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19
33
33
  <use href="#diffs-editor-icon-${e}"></use>
34
34
  </svg>`,se=class{#e;#t;#n;#r;#i;#a;constructor(e){let{textDocument:t,containerElement:n,defaultQuery:r,mode:i=`find`,allowReplace:a=!0,initialMatch:o,scrollToMatch:s,applyReplace:c,onUpdate:l,onClose:d}=e,f={text:r,replaceText:``,caseSensitive:!1,wholeWord:!1,regex:!1},p={all:[],current:void 0},m=H(`div`,{dataset:{matches:``,noMatches:``},textContent:`No results`}),h=e=>{p.all=f.text===``?[]:t.search(f);let n=p.all.length===0;if(P.disabled=n,F.disabled=n,n){m.textContent=`No results`,m.dataset.noMatches=``,p.current=void 0,l([]);return}if(delete m.dataset.noMatches,e?.syncSelection===!1){let e=l(p.all,{syncSelection:!1});g(e);return}g(l(p.all))};this.#n=h;let g=e=>{if(e===void 0)m.textContent=`${p.all.length} results`;else{let[t,n]=e,r=p.all.findIndex(e=>e[0]===t&&e[1]===n);m.textContent=`${r+1} of ${p.all.length}`}p.current=e},v=(e,t)=>{f[e]=t,h()},y=(e=!1,t=!1)=>{let n=p.all,r=n[0];if(n.length>0){if(e){let e=p.current?.[0]??0;r=n.at(-1);for(let t of n)if(t[1]<=e)r=t;else break}else{let e=p.current?.[1]??0;for(let t of n)if(t[0]>=e){r=t;break}}}r!==void 0&&(g(r),s(r,t)),p.current=r};this.#i=e=>y(e,!0);let b=(e,n)=>({start:e,end:n,text:B(e=>t.positionAt(e),e=>t.offsetAt(e),e=>t.getLineText(e),f,e,n)}),x=()=>{if(f.text===``||p.all.length===0)return;let e=p.current;if(e===void 0&&(y(!1,!0),e=p.current,e===void 0))return;let[t,n]=e,r=b(t,n);c([r]),s([t+r.text.length,t+r.text.length],!0),p.current=void 0,h()},S=()=>{f.text!==``&&p.all.length!==0&&(c(p.all.map(([e,t])=>b(e,t))),p.current=void 0,h())},C=()=>{this.cleanup(),d()};this.#a=C;let w=e=>H(`button`,{type:`button`,title:e.label,ariaLabel:e.label,dataset:{searchIcon:``,...e.dataset},innerHTML:X(e.icon,e.size??16),onclick:e.onClick}),T=(e,t,n)=>{let r=w({icon:e,label:t,size:14,onClick:()=>{let e=!f[n];r.ariaPressed=String(e),v(n,e)}});return r.ariaPressed=String(f[n]),r},E=T(`case`,`Match Case`,`caseSensitive`),D=T(`whole-word`,`Whole Word`,`wholeWord`),O=T(`regex`,`Regexp`,`regex`),k=H(`input`,{type:`text`,placeholder:`Replace`,dataset:`replace`,value:``,oninput:e=>{f.replaceText=e.target.value},onkeydown:e=>{if(e.isComposing||e.keyCode===229)return;let t=_(e);e.key===`Escape`?(e.preventDefault(),C()):e.key===`Enter`?(e.preventDefault(),x()):t!==void 0&&(e.preventDefault(),y(t===`previous`,!0))}});this.#t=H(`input`,{type:`text`,placeholder:`Search`,dataset:`search`,value:r,oninput:e=>{f.text=e.target.value,p.current=void 0,h()},onkeydown:e=>{if(e.isComposing||e.keyCode===229)return;let t=_(e);e.key===`Escape`?(e.preventDefault(),C()):e.key===`Enter`?(e.preventDefault(),y(e.shiftKey,!0)):t===void 0?u(e)&&(e.key===`f`||e.code===`KeyF`)&&(e.preventDefault(),z(e.altKey?`replace`:`find`)):(e.preventDefault(),y(t===`previous`,!0))}});let A=H(`div`,{dataset:`searchToggles`,children:[E,D,O]}),j=H(`div`,{dataset:{inputBox:``,find:``},children:[this.#t,A]}),M=H(`div`,{dataset:{inputBox:``,replace:``,replaceCell:``},children:[k]}),N=H(`div`,{dataset:{replaceActions:``,replaceCell:``},children:[w({icon:`replace`,label:`Replace`,onClick:x}),w({icon:`replace-all`,label:`Replace All`,onClick:S})]}),P=w({icon:`arrow-up`,label:`Previous`,onClick:()=>{y(!0)}}),F=w({icon:`arrow-down`,label:`Next`,onClick:()=>{y()}});P.disabled=!0,F.disabled=!0;let I=H(`div`,{dataset:`searchNav`,children:[P,F]}),L=w({icon:`close`,label:`Close`,onClick:C,dataset:{searchClose:``}}),R=H(`div`,{dataset:{searchGrid:``,mode:i},children:[j,M,N,m,I,L]}),z=e=>{R.dataset.mode=a?e:`find`,this.#t.focus(),this.#t.select()};this.#r=z,this.#e=H(`div`,{dataset:`searchPanel`,children:[H(`div`,{dataset:`editorWidget`,children:[R]})]}),p.current=o,n.before(this.#e),requestAnimationFrame(()=>{o===void 0?l([]):h(),this.#t.select()})}focus(){this.#t.focus()}navigate(e){this.#i?.(e)}updateMatches(e){this.#n?.(e)}setMode(e){this.#r?.(e)}close(){this.#a?.()}cleanup(){this.#e.remove()}},ce=`@layer base,theme,rendered,unsafe;::selection{background-color:#0000}[data-deleted-text-selection] [data-deletions] ::selection,[data-deleted-text-selection] [data-line-type=change-deletion] ::selection{background-color:var(--diffs-editor-selection-bg)}@keyframes blinking{0%{opacity:1}50%{opacity:0}to{opacity:1}}:host,[data-code],[data-content],[data-diff-type=split][data-overflow=wrap]{position:relative}[data-code]{container-type:inline-size}[data-content]{cursor:text;caret-color:var(--diffs-bg-caret);background-color:#0000;outline:none}[data-line]{cursor:text;background-color:#0000}[data-line]:after{content:"";z-index:-20;background-color:var(--diffs-line-bg);pointer-events:none;position:absolute;inset:0}[data-line][data-editor-active-line]:after{box-shadow:inset 0 0 0 1px var(--diffs-editor-line-highlight-border)}[data-editor-overlay]{display:contents}[data-caret],[data-edit-prediction],[data-selection-range],[data-match-range],[data-bracket-match-range],[data-edit-prediction-deletion-range],[data-edit-prediction-insertion-range],[data-edit-prediction-replacement-range],[data-marker-range],[data-remote-caret],[data-caret-highlight-range]{height:1lh;line-height:var(--diffs-line-height);pointer-events:none;position:absolute;top:0;left:0}[data-edit-prediction]{z-index:1;user-select:none;width:max-content;height:auto;color:var(--diffs-editor-edit-prediction-fg,color-mix(in lab, var(--diffs-fg) 45%, transparent));overflow:visible}[data-edit-prediction-line]{box-sizing:border-box;white-space:pre;width:max-content;min-height:1lh;display:block}[data-edit-prediction][data-replacement] [data-edit-prediction-line],[data-edit-prediction-insertion-range],[data-edit-prediction-replacement-range]{background-color:var(--diffs-edit-prediction-bg,var(--diffs-bg))}[data-edit-prediction-suffix]{color:var(--diffs-fg)}[data-edit-prediction][data-wrap] [data-edit-prediction-line]{overflow-wrap:anywhere;white-space:pre-wrap;max-width:100%}[data-edit-prediction-line][data-empty]:after{content:"↵"}[data-edit-prediction-spacer]{margin-block-end:var(--diffs-edit-prediction-spacer-height)}[data-code][data-deletions] [data-edit-prediction-spacer]{box-sizing:content-box;margin-block-end:0;padding-block-end:var(--diffs-edit-prediction-spacer-height)}[data-edit-prediction-deletion-range]{--diffs-edit-prediction-deletion-color:var(--diffs-editor-edit-prediction-deletion-fg,color-mix(in lab, var(--diffs-deletion-base) 70%, transparent));z-index:1;background:linear-gradient(to bottom, transparent calc(50% - .5px), var(--diffs-edit-prediction-deletion-color) calc(50% - .5px), var(--diffs-edit-prediction-deletion-color) calc(50% + .5px), transparent calc(50% + .5px))}[data-edit-prediction-insertion-range]{z-index:0}[data-edit-prediction-replacement-range]{z-index:1}[data-caret]{z-index:2;background-color:var(--diffs-bg-caret-override,var(--diffs-editor-cursor-fg,light-dark(color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg)),color-mix(in lab, var(--diffs-fg) 75%, var(--diffs-bg)))));visibility:hidden;width:2px}@media (prefers-reduced-motion:no-preference){[data-caret]{animation:1.2s .8s infinite blinking}}[data-selection-range]{z-index:-10;background-color:var(--diffs-editor-selection-bg)}[data-caret-highlight-range]{z-index:-10;background-color:var(--diffs-caret-highlight-bg,var(--diffs-editor-selection-bg))}[data-selection-corner]{background-color:var(--diffs-selection-corner-bg,var(--diffs-bg));width:100%;height:100%}[data-match-range]{z-index:-10;background-color:var(--diffs-editor-match-bg,var(--diffs-editor-selection-bg))}[data-match-range]:not([data-focus]){background-color:var(--diffs-editor-match-highlight-bg,light-dark(#ff963288,#ff963266))}[data-bracket-match-range]{z-index:-9;box-sizing:border-box;border-bottom:1px solid var(--diffs-editor-bracket-match-border,color-mix(in lab, var(--diffs-fg) 60%, transparent));background-color:var(--diffs-editor-bracket-match-bg,color-mix(in lab, var(--diffs-fg) 5%, transparent))}[data-rtl]{border-top-left-radius:3px}[data-rtr]{border-top-right-radius:3px}[data-rbl]{border-bottom-left-radius:3px}[data-rbr]{border-bottom-right-radius:3px}[data-marker-range]{z-index:1;background-color:var(--diffs-marker-bg);mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2IiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0wIDIuNSBsMiAtMS41IGwxIDAgbDIgMS41IGwxIDAiIHN0cm9rZT0iI2ZmZiIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9zdmc+);mask-position:0 100%;mask-size:6px 3px;mask-repeat:repeat-x}[data-marker-error]{--diffs-marker-contrast:light-dark(#fff,#000);--diffs-marker-bg:var(--diffs-editor-error-fg,var(--diffs-deletion-base))}[data-marker-warning]{--diffs-marker-contrast:#000;--diffs-marker-bg:var(--diffs-editor-warning-fg,light-dark(var(--diffs-warning-light),var(--diffs-warning-dark)))}[data-marker-info]{--diffs-marker-contrast:#000;--diffs-marker-bg:var(--diffs-editor-info-fg,var(--diffs-modified-base))}[data-marker-hint]{--diffs-marker-contrast:light-dark(#fff,#000);--diffs-marker-bg:var(--diffs-editor-hint-fg,var(--diffs-fg-number))}@media (width>=480px){[data-content]{caret-color:#0000}[data-content]:focus~[data-editor-overlay] [data-caret]{visibility:visible}}[data-editor-widget]{--diffs-widget-fg:var(--diffs-fg);--diffs-widget-bg:color-mix(in lab, var(--diffs-fg) 4%, var(--diffs-bg));--diffs-widget-border:color-mix(in lab, var(--diffs-fg) 20%, transparent);--diffs-widget-shadow:inset 0 0 0 1px var(--diffs-bg), 0 4px 8px #00000013, 0 6px 18px #00000013;z-index:100;width:fit-content;max-width:calc(100% - 24px);font:14px/20px var(--diffs-header-font-fallback);border:1px solid var(--diffs-widget-border);background-color:var(--diffs-widget-bg);box-shadow:var(--diffs-widget-shadow);background-clip:padding-box;border-radius:9px;position:absolute;top:0;left:0}[data-marker-popover],[data-selection-action-popover]{--popover-gap:var(--diffs-popover-gap,var(--diffs-gap-fallback,8px));--popover-viewport-left:0px;--popover-viewport-right:100cqw;--popover-viewport-top:-99999px;--popover-viewport-bottom:99999px;--popover-min-left:calc(var(--popover-viewport-left) + var(--gutter-width,0px) + var(--popover-gap));--popover-available-width:max(0px, calc(var(--popover-viewport-right) - var(--popover-min-left) - var(--popover-gap)));max-width:min(640px, var(--popover-available-width));translate:clamp(var(--popover-min-left), var(--popover-x,var(--popover-min-left)), calc(var(--popover-viewport-right) - var(--popover-gap) - 100%)) clamp(var(--popover-viewport-top), calc(var(--popover-y,0px) + var(--popover-y-shift,0px)), calc(var(--popover-viewport-bottom) - var(--popover-gap) - 100%))}[data-marker-popover]{--diffs-widget-bg:var(--diffs-marker-bg);--diffs-widget-shadow:0 4px 8px #00000026, 0 6px 18px #00000026;min-width:min(180px, var(--popover-available-width));overflow-wrap:anywhere;color:var(--diffs-marker-contrast);white-space:normal;pointer-events:auto;border:0;padding:8px 12px;@supports (color:contrast-color(red)){color:contrast-color(var(--diffs-marker-bg,var(--diffs-bg)))}& [data-marker-message]{white-space:normal;overflow-wrap:anywhere;& code{white-space:normal;color:inherit;background-color:#0000;display:inline}}}[data-selection-action-popover]{pointer-events:auto;flex-wrap:wrap;align-items:center;gap:4px;width:max-content;padding:4px;display:flex}[data-search-panel]{z-index:100;flex-direction:column;justify-content:right;width:100%;height:0;display:flex;position:sticky;top:16px;right:16px;container:search-panel/inline-size;& [data-editor-widget]{z-index:100;flex-shrink:0;align-items:stretch;gap:8px;min-width:260px;max-width:100%;margin-inline:auto 16px;padding:4px;display:flex;position:relative}& svg{fill:currentColor;width:12px;height:12px;display:block}}[data-search-grid]{grid-template-columns:auto auto auto;grid-template-areas:"find matches nav""replace actions.";align-items:center;gap:4px 6px;width:100%;display:grid}[data-input-box][data-find]{grid-area:find}[data-search-nav]{grid-area:nav}[data-input-box][data-replace]{grid-area:replace}[data-replace-actions]{grid-area:actions}[data-search-grid][data-mode=find]{grid-template-areas:"find matches nav"}[data-search-grid][data-mode=find] [data-replace-cell]{display:none}@container search-panel (width<400px){[data-search-panel] [data-editor-widget]{padding:10px}[data-search-grid][data-mode=replace]{grid-template-columns:auto 1fr auto;grid-template-areas:"find find find""replace replace replace""nav matches actions"}[data-search-grid][data-mode=find]{grid-template-columns:auto 1fr auto;grid-template-areas:"find find find""nav matches matches"}[data-replace-actions]{justify-self:end}[data-search-grid] [data-input-box]{width:auto}}[data-input-box]{align-items:center;width:200px;display:flex;position:relative;& input{width:100%;min-width:0;color:var(--diffs-fg);background-color:var(--diffs-bg);border:1px solid color-mix(in lab, var(--diffs-fg) 12%, var(--diffs-bg));border-radius:6px;outline:none;flex-grow:1;padding-inline:6px;font-size:13px;line-height:24px;&::selection{background-color:color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg))}&:focus-visible{outline:1px solid var(--diffs-modified-base)}}&[data-find] input{padding-inline-end:72px}& [data-search-icon]{--diffs-search-icon-size:20px}}[data-search-toggles]{align-items:center;gap:1px;display:flex;position:absolute;top:50%;right:4px;transform:translateY(-50%)}[data-matches]{white-space:nowrap;min-width:50px;color:color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg));flex-shrink:0;grid-area:matches;font-size:12px;font-weight:500;line-height:20px;&[data-no-matches]{color:color-mix(in lab, var(--diffs-fg) 35%, var(--diffs-bg))}}[data-replace-actions],[data-search-nav]{align-items:center;display:flex}[data-search-icon]{appearance:none;width:var(--diffs-search-icon-size,24px);height:var(--diffs-search-icon-size,24px);color:color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg));border-radius:var(--diffs-search-icon-radius,4px);cursor:pointer;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;margin:0;padding:0;transition:background-color .1s ease-in-out,color .1s ease-in-out;display:flex;&:disabled{opacity:.25;cursor:default}&:not(:disabled):hover{color:var(--diffs-fg)}&:focus-visible{outline:1px solid var(--diffs-modified-base)}&[aria-pressed=true]{color:var(--diffs-modified-base)}}[data-search-close]{--diffs-search-icon-size:20px;--diffs-search-icon-radius:50%;color:var(--diffs-widget-bg);background-color:color-mix(in lab, var(--diffs-widget-fg) 50%, var(--diffs-bg));position:absolute;top:0;right:0;transform:translate(50%,-50%);&:not(:disabled):hover{opacity:1;color:var(--diffs-widget-bg);background-color:var(--diffs-widget-fg)}}
35
35
  `,Z=e(t(),1),le=r();function Q(e,t,n){return!n&&(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&t.trim().length>0}var $=e(a(),1);function ue(e){let t=(0,le.c)(48),{kind:r,rangeLabel:a,text:s,onTextChange:c,onCancel:u,onComment:d,onDelete:f,placeholder:p,submitLabel:m,pending:h,secondaryAction:g,focusOnMount:_}=e,v=p===void 0?`Add a comment…`:p,y=m===void 0?`Comment`:m,b=h!==void 0&&h,x=_===void 0||_,[S,C]=(0,Z.useState)(``),w=r===`draft`&&!c?S:s,T;t[0]===w?T=t[1]:(T=w.trim(),t[0]=w,t[1]=T);let E=T,D=(0,Z.useRef)(null),O,k;if(t[2]!==x||t[3]!==r?(O=()=>{if(r!==`draft`||!x)return;let e=window.requestAnimationFrame(()=>{D.current?.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(e)},k=[x,r],t[2]=x,t[3]=r,t[4]=O,t[5]=k):(O=t[4],k=t[5]),(0,Z.useLayoutEffect)(O,k),r===`comment`){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(i,{className:`mt-0.5 size-3.5 shrink-0 text-primary/70`,"aria-hidden":`true`}),t[6]=e):e=t[6];let r;t[7]===w?r=t[8]:(r=(0,$.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap text-sm leading-5`,children:w}),t[7]=w,t[8]=r);let a;t[9]===f?a=t[10]:(a=f?(0,$.jsx)(`span`,{className:`-my-1 -mr-1 flex shrink-0 opacity-0 transition-opacity group-hover/comment:opacity-100 focus-within:opacity-100 max-sm:opacity-100`,children:(0,$.jsx)(o,{variant:`ghost-muted`,size:`icon-xs`,"aria-label":`Delete comment`,onClick:f,children:(0,$.jsx)(n,{className:`size-3`})})}):null,t[9]=f,t[10]=a);let s;return t[11]!==a||t[12]!==r?(s=(0,$.jsxs)(`div`,{"data-diff-comment-annotation":!0,className:`group/comment flex min-w-0 items-start gap-2.5 border-s-2 border-primary/55 bg-primary/[0.045] px-3 py-2.5 font-sans text-foreground`,contentEditable:!1,onPointerDown:pe,children:[e,r,a]}),t[11]=a,t[12]=r,t[13]=s):s=t[13],s}let A=`Comment on lines ${a}`,j;t[14]===c?j=t[15]:(j=e=>(c??C)(e.target.value),t[14]=c,t[15]=j);let M;t[16]!==u||t[17]!==d||t[18]!==b||t[19]!==E?(M=e=>{e.key===`Escape`&&(e.preventDefault(),u()),Q(e,E,b)&&(e.preventDefault(),d(E))},t[16]=u,t[17]=d,t[18]=b,t[19]=E,t[20]=M):M=t[20];let N;t[21]!==w||t[22]!==x||t[23]!==v||t[24]!==M||t[25]!==A||t[26]!==j?(N=(0,$.jsx)(l,{ref:D,autoFocus:x,size:`sm`,value:w,placeholder:v,"aria-label":A,onChange:j,onFocus:de,onKeyDown:M}),t[21]=w,t[22]=x,t[23]=v,t[24]=M,t[25]=A,t[26]=j,t[27]=N):N=t[27];let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(`span`,{className:`mr-auto text-3xs text-muted-foreground/70`,children:`⌘/Ctrl Enter to send`}),t[28]=P):P=t[28];let F;t[29]===u?F=t[30]:(F=(0,$.jsx)(o,{variant:`ghost-muted`,size:`xs`,onClick:u,children:`Cancel`}),t[29]=u,t[30]=F);let I;t[31]!==g||t[32]!==E?(I=g?(0,$.jsxs)(o,{size:`xs`,variant:`outline`,disabled:!g.allowEmpty&&!E,onClick:()=>g.onAction(E),children:[g.icon,g.label]}):null,t[31]=g,t[32]=E,t[33]=I):I=t[33];let L=b||!E,R;t[34]!==d||t[35]!==E?(R=()=>d(E),t[34]=d,t[35]=E,t[36]=R):R=t[36];let z;t[37]!==y||t[38]!==L||t[39]!==R?(z=(0,$.jsx)(o,{size:`xs`,disabled:L,onClick:R,children:y}),t[37]=y,t[38]=L,t[39]=R,t[40]=z):z=t[40];let B;t[41]!==F||t[42]!==I||t[43]!==z?(B=(0,$.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1`,children:[P,F,I,z]}),t[41]=F,t[42]=I,t[43]=z,t[44]=B):B=t[44];let V;return t[45]!==N||t[46]!==B?(V=(0,$.jsxs)(`div`,{"data-diff-comment-annotation":!0,className:`px-3 py-2 font-sans text-foreground`,contentEditable:!1,onPointerDown:fe,children:[N,B]}),t[45]=N,t[46]=B,t[47]=V):V=t[47],V}function de(e){let t=e.currentTarget.value.length;e.currentTarget.setSelectionRange(t,t)}function fe(e){return e.stopPropagation()}function pe(e){return e.stopPropagation()}export{u as S,re as _,Y as a,_ as b,ee as c,ie as d,te as f,ae as g,H as h,se as i,G as l,W as m,Q as n,oe as o,J as p,ce as r,U as s,ue as t,ne as u,T as v,d as x,g as y};
36
- //# sourceMappingURL=DiffCommentAnnotation-CKRC0OaV.js.map
36
+ //# sourceMappingURL=DiffCommentAnnotation-CX8scC3B.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{NE as n,lE as r,sr as i,t as a}from"./utils-Dx_TSvdC.js";import{c as o,m as s,p as c}from"./tooltip-Cco13jKX.js";import{I as l}from"./useSettings-DpVy22yc.js";import{u as ee}from"./diffRendering-4kDIxoRz.js";import{c as te,i as ne,n as re,o as ie,r as ae,s as oe,t as se}from"./fileTreeExpansion-VkvCaw5c.js";import{t as ce}from"./pierre-icons-u_a0tCKH.js";var le=n(),u=e(t(),1);function d(e,t,n){let r=(0,le.c)(8),[i,a]=(0,u.useState)(null),o=(0,u.useRef)(null),s,c;r[0]!==n||r[1]!==i||r[2]!==t||r[3]!==e?(s=()=>{if(i!==null&&o.current!==i){if(i.scope!==t){o.current=i;return}!e?.getInstance()||n&&!n.includes(i.fileKey)||(e.scrollTo({type:`item`,id:i.fileKey,align:`start`}),o.current=i)}},c=[i,t,e,n],r[0]=n,r[1]=i,r[2]=t,r[3]=e,r[4]=s,r[5]=c):(s=r[4],c=r[5]),(0,u.useEffect)(s,c);let l;return r[6]===t?l=r[7]:(l=e=>a({fileKey:e,scope:t}),r[6]=t,r[7]=l),l}function f(e,t){return e.length>0&&e.every(e=>t.has(e))}function p(e,t){return f(e,t)?new Set:new Set(e)}function m(e){switch(e.type){case`new`:return`added`;case`deleted`:return`deleted`;case`rename-pure`:case`rename-changed`:return`renamed`;case`change`:return`modified`}}function h(e){let t=new Map;for(let n of e){let e=ee(n),r=m(n),i=t.get(e);t.set(e,i===void 0||i===r?r:`modified`)}return[...t].map(([e,t])=>({path:e,status:t}))}function ue(e){let t=new Set;for(let n of e){let e=n.split(`/`),r=``;for(let n of e.slice(0,-1))r+=`${n}/`,t.add(r)}return[...t]}function de(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n);let r=``;for(let i of e.split(`/`).slice(0,-1))r+=`${i}/`,t.has(r)||t.set(r,n)}),t}function g(e){return(t,n)=>{let r=e();return(r.get(t.path)??2**53-1)-(r.get(n.path)??2**53-1)||t.depth-n.depth||t.path.localeCompare(n.path)}}function _(e){return e.split(`/`).filter(Boolean).length}function fe(e,t){let n=new Set(ue(e)),r=new Set(ue(t)),i=new Set(e),a=new Set(t),o=[];for(let t of e)a.has(t)||o.push({type:`remove`,path:t});let s=[...n].filter(e=>!r.has(e)).toSorted((e,t)=>_(t)-_(e));for(let e of s)o.push({type:`remove`,path:e,recursive:!0});let c=[...r].filter(e=>!n.has(e)).toSorted((e,t)=>_(e)-_(t));for(let e of c)o.push({type:`add`,path:e});for(let e of t)i.has(e)||o.push({type:`add`,path:e});return o}var v=e(r(),1);function y(e){let t=(0,le.c)(64),{entries:n,onSelectFile:r,selectedPath:ee,revealRequestId:d,ariaLabel:f,headerAccessory:p,footer:m,className:h}=e,g=ee===void 0?null:ee,_=d===void 0?0:d,{resolvedTheme:y}=l(),b;t[0]===n?b=t[1]:(b=n.map(he),t[0]=n,t[1]=b);let x=b,S;t[2]===x?S=t[3]:(S=ue(x),t[2]=x,t[3]=S);let C=S,w;t[4]===x?w=t[5]:(w=de(x),t[4]=x,t[5]=w);let T=w,[E]=(0,u.useState)(me),D;t[6]===n?D=t[7]:(D=n.map(pe),t[6]=n,t[7]=D);let O=D,k;t[8]===x?k=t[9]:(k=new Set(x),t[8]=x,t[9]=k);let A=(0,u.useRef)(k),j=(0,u.useRef)(r),ge=(0,u.useRef)(!1),M=(0,u.useRef)(null),_e=(0,u.useRef)(null),N,P;t[10]!==r||t[11]!==x?(N=()=>{A.current=new Set(x),j.current=r},P=[r,x],t[10]=r,t[11]=x,t[12]=N,t[13]=P):(N=t[12],P=t[13]),(0,u.useEffect)(N,P);let F,I;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{if(ge.current)return;let t=e.at(-1)?.replace(/\/$/,``);t&&A.current.has(t)&&j.current(t)},I=[],t[14]=F,t[15]=I):(F=t[14],I=t[15]);let L;t[16]===E.sort?L=t[17]:(L={density:`compact`,flattenEmptyDirectories:!0,initialExpansion:`open`,icons:ce,onSelectionChange:F,paths:I,search:!1,sort:E.sort,unsafeCSS:ae},t[16]=E.sort,t[17]=L);let{model:R}=oe(L),z;t[18]===C?z=t[19]:(z=e=>se(e,C),t[18]=C,t[19]=z);let B=ie(R,z),V,H;t[20]!==C||t[21]!==O||t[22]!==R||t[23]!==E||t[24]!==x||t[25]!==T?(V=()=>{E.update(T);let e=_e.current;if(e!==x){if(_e.current=x,e===null)R.resetPaths(x);else if(e.every((e,t)=>x[t]===e)){let t=fe(e,x);t.length>0&&R.batch(t)}else{let e=C.filter(e=>{let t=R.getItem(e);return t!==null&&`isExpanded`in t&&!t.isExpanded()});R.resetPaths(x);for(let t of e){let e=R.getItem(t);e!==null&&`collapse`in e&&e.collapse()}}R.setGitStatus(O)}},H=[C,O,R,E,x,T],t[20]=C,t[21]=O,t[22]=R,t[23]=E,t[24]=x,t[25]=T,t[26]=V,t[27]=H):(V=t[26],H=t[27]),(0,u.useEffect)(V,H);let U;t[28]!==R||t[29]!==_||t[30]!==g?(U=()=>{if(g===null){M.current=null;return}let e=R.getItem(g);if(e===null||e.isDirectory()){M.current=null;return}let t=M.current;if(t?.path===g&&t.revealRequestId===_)return;M.current={path:g,revealRequestId:_},ge.current=!0;for(let e of R.getSelectedPaths())e!==g&&R.getItem(e)?.deselect();let n=``;for(let e of g.split(`/`).slice(0,-1)){n+=`${e}/`;let t=R.getItem(n);t!==null&&`expand`in t&&t.expand()}e.select(),R.scrollToPath(g,{offset:`nearest`}),queueMicrotask(()=>{ge.current=!1})},t[28]=R,t[29]=_,t[30]=g,t[31]=U):U=t[31];let W;t[32]!==R||t[33]!==x||t[34]!==_||t[35]!==g?(W=[R,x,_,g],t[32]=R,t[33]=x,t[34]=_,t[35]=g,t[36]=W):W=t[36],(0,u.useEffect)(U,W);let G;t[37]===h?G=t[38]:(G=a(`flex min-h-0 flex-1 flex-col bg-background`,h),t[37]=h,t[38]=G);let K;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,v.jsx)(`span`,{className:`px-1 font-medium text-foreground`,children:`Files`}),t[39]=K):K=t[39];let q;t[40]===n.length?q=t[41]:(q=(0,v.jsx)(`span`,{className:`ml-auto tabular-nums`,children:n.length}),t[40]=n.length,t[41]=q);let J;t[42]!==B||t[43]!==C||t[44]!==R?(J=C.length>0?(0,v.jsx)(i,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":B?`Collapse all folders`:`Expand all folders`,onClick:()=>re(R,C,!B),children:(0,v.jsx)(o,{className:`size-3.5`,icon:B?c:s})}):null,t[42]=B,t[43]=C,t[44]=R,t[45]=J):J=t[45];let Y;t[46]!==p||t[47]!==q||t[48]!==J?(Y=(0,v.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 text-xs text-muted-foreground in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[K,q,p,J]}),t[46]=p,t[47]=q,t[48]=J,t[49]=Y):Y=t[49];let X;t[50]===R?X=t[51]:(X=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=R.getSelectedPaths(),n=t.length===1?t[0]:void 0;n&&A.current.has(n)&&e.nativeEvent.composedPath().some(e=>e instanceof HTMLElement&&e.getAttribute(`data-item-path`)===n)&&j.current(n)},t[50]=R,t[51]=X);let Z;t[52]===y?Z=t[53]:(Z=ne(y),t[52]=y,t[53]=Z);let Q;t[54]!==f||t[55]!==R||t[56]!==X||t[57]!==Z?(Q=(0,v.jsx)(te,{model:R,"aria-label":f,onClickCapture:X,className:`min-h-0 flex-1 overflow-hidden`,style:Z}),t[54]=f,t[55]=R,t[56]=X,t[57]=Z,t[58]=Q):Q=t[58];let $;return t[59]!==m||t[60]!==G||t[61]!==Y||t[62]!==Q?($=(0,v.jsxs)(`div`,{className:G,children:[Y,Q,m]}),t[59]=m,t[60]=G,t[61]=Y,t[62]=Q,t[63]=$):$=t[63],$}function pe(e){return{path:e.path,status:e.status}}function me(){let e=new Map;return{sort:g(()=>e),update:t=>{e=t}}}function he(e){return e.path}export{d as a,p as i,h as n,f as r,y as t};
2
- //# sourceMappingURL=DiffFileTree-xeoOBCTn.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{NE as n,lE as r,sr as i,t as a}from"./utils-BgVDKR83.js";import{c as o,m as s,p as c}from"./tooltip-DRGG_vM1.js";import{I as l}from"./useSettings-CUN8qNLl.js";import{u as ee}from"./diffRendering-BAlsKvkZ.js";import{c as te,i as ne,n as re,o as ie,r as ae,s as oe,t as se}from"./fileTreeExpansion-By588Tlp.js";import{t as ce}from"./pierre-icons-Cp8tJJSF.js";var le=n(),u=e(t(),1);function d(e,t,n){let r=(0,le.c)(8),[i,a]=(0,u.useState)(null),o=(0,u.useRef)(null),s,c;r[0]!==n||r[1]!==i||r[2]!==t||r[3]!==e?(s=()=>{if(i!==null&&o.current!==i){if(i.scope!==t){o.current=i;return}!e?.getInstance()||n&&!n.includes(i.fileKey)||(e.scrollTo({type:`item`,id:i.fileKey,align:`start`}),o.current=i)}},c=[i,t,e,n],r[0]=n,r[1]=i,r[2]=t,r[3]=e,r[4]=s,r[5]=c):(s=r[4],c=r[5]),(0,u.useEffect)(s,c);let l;return r[6]===t?l=r[7]:(l=e=>a({fileKey:e,scope:t}),r[6]=t,r[7]=l),l}function f(e,t){return e.length>0&&e.every(e=>t.has(e))}function p(e,t){return f(e,t)?new Set:new Set(e)}function m(e){switch(e.type){case`new`:return`added`;case`deleted`:return`deleted`;case`rename-pure`:case`rename-changed`:return`renamed`;case`change`:return`modified`}}function h(e){let t=new Map;for(let n of e){let e=ee(n),r=m(n),i=t.get(e);t.set(e,i===void 0||i===r?r:`modified`)}return[...t].map(([e,t])=>({path:e,status:t}))}function ue(e){let t=new Set;for(let n of e){let e=n.split(`/`),r=``;for(let n of e.slice(0,-1))r+=`${n}/`,t.add(r)}return[...t]}function de(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n);let r=``;for(let i of e.split(`/`).slice(0,-1))r+=`${i}/`,t.has(r)||t.set(r,n)}),t}function g(e){return(t,n)=>{let r=e();return(r.get(t.path)??2**53-1)-(r.get(n.path)??2**53-1)||t.depth-n.depth||t.path.localeCompare(n.path)}}function _(e){return e.split(`/`).filter(Boolean).length}function fe(e,t){let n=new Set(ue(e)),r=new Set(ue(t)),i=new Set(e),a=new Set(t),o=[];for(let t of e)a.has(t)||o.push({type:`remove`,path:t});let s=[...n].filter(e=>!r.has(e)).toSorted((e,t)=>_(t)-_(e));for(let e of s)o.push({type:`remove`,path:e,recursive:!0});let c=[...r].filter(e=>!n.has(e)).toSorted((e,t)=>_(e)-_(t));for(let e of c)o.push({type:`add`,path:e});for(let e of t)i.has(e)||o.push({type:`add`,path:e});return o}var v=e(r(),1);function y(e){let t=(0,le.c)(64),{entries:n,onSelectFile:r,selectedPath:ee,revealRequestId:d,ariaLabel:f,headerAccessory:p,footer:m,className:h}=e,g=ee===void 0?null:ee,_=d===void 0?0:d,{resolvedTheme:y}=l(),b;t[0]===n?b=t[1]:(b=n.map(he),t[0]=n,t[1]=b);let x=b,S;t[2]===x?S=t[3]:(S=ue(x),t[2]=x,t[3]=S);let C=S,w;t[4]===x?w=t[5]:(w=de(x),t[4]=x,t[5]=w);let T=w,[E]=(0,u.useState)(me),D;t[6]===n?D=t[7]:(D=n.map(pe),t[6]=n,t[7]=D);let O=D,k;t[8]===x?k=t[9]:(k=new Set(x),t[8]=x,t[9]=k);let A=(0,u.useRef)(k),j=(0,u.useRef)(r),ge=(0,u.useRef)(!1),M=(0,u.useRef)(null),_e=(0,u.useRef)(null),N,P;t[10]!==r||t[11]!==x?(N=()=>{A.current=new Set(x),j.current=r},P=[r,x],t[10]=r,t[11]=x,t[12]=N,t[13]=P):(N=t[12],P=t[13]),(0,u.useEffect)(N,P);let F,I;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{if(ge.current)return;let t=e.at(-1)?.replace(/\/$/,``);t&&A.current.has(t)&&j.current(t)},I=[],t[14]=F,t[15]=I):(F=t[14],I=t[15]);let L;t[16]===E.sort?L=t[17]:(L={density:`compact`,flattenEmptyDirectories:!0,initialExpansion:`open`,icons:ce,onSelectionChange:F,paths:I,search:!1,sort:E.sort,unsafeCSS:ae},t[16]=E.sort,t[17]=L);let{model:R}=oe(L),z;t[18]===C?z=t[19]:(z=e=>se(e,C),t[18]=C,t[19]=z);let B=ie(R,z),V,H;t[20]!==C||t[21]!==O||t[22]!==R||t[23]!==E||t[24]!==x||t[25]!==T?(V=()=>{E.update(T);let e=_e.current;if(e!==x){if(_e.current=x,e===null)R.resetPaths(x);else if(e.every((e,t)=>x[t]===e)){let t=fe(e,x);t.length>0&&R.batch(t)}else{let e=C.filter(e=>{let t=R.getItem(e);return t!==null&&`isExpanded`in t&&!t.isExpanded()});R.resetPaths(x);for(let t of e){let e=R.getItem(t);e!==null&&`collapse`in e&&e.collapse()}}R.setGitStatus(O)}},H=[C,O,R,E,x,T],t[20]=C,t[21]=O,t[22]=R,t[23]=E,t[24]=x,t[25]=T,t[26]=V,t[27]=H):(V=t[26],H=t[27]),(0,u.useEffect)(V,H);let U;t[28]!==R||t[29]!==_||t[30]!==g?(U=()=>{if(g===null){M.current=null;return}let e=R.getItem(g);if(e===null||e.isDirectory()){M.current=null;return}let t=M.current;if(t?.path===g&&t.revealRequestId===_)return;M.current={path:g,revealRequestId:_},ge.current=!0;for(let e of R.getSelectedPaths())e!==g&&R.getItem(e)?.deselect();let n=``;for(let e of g.split(`/`).slice(0,-1)){n+=`${e}/`;let t=R.getItem(n);t!==null&&`expand`in t&&t.expand()}e.select(),R.scrollToPath(g,{offset:`nearest`}),queueMicrotask(()=>{ge.current=!1})},t[28]=R,t[29]=_,t[30]=g,t[31]=U):U=t[31];let W;t[32]!==R||t[33]!==x||t[34]!==_||t[35]!==g?(W=[R,x,_,g],t[32]=R,t[33]=x,t[34]=_,t[35]=g,t[36]=W):W=t[36],(0,u.useEffect)(U,W);let G;t[37]===h?G=t[38]:(G=a(`flex min-h-0 flex-1 flex-col bg-background`,h),t[37]=h,t[38]=G);let K;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,v.jsx)(`span`,{className:`px-1 font-medium text-foreground`,children:`Files`}),t[39]=K):K=t[39];let q;t[40]===n.length?q=t[41]:(q=(0,v.jsx)(`span`,{className:`ml-auto tabular-nums`,children:n.length}),t[40]=n.length,t[41]=q);let J;t[42]!==B||t[43]!==C||t[44]!==R?(J=C.length>0?(0,v.jsx)(i,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":B?`Collapse all folders`:`Expand all folders`,onClick:()=>re(R,C,!B),children:(0,v.jsx)(o,{className:`size-3.5`,icon:B?c:s})}):null,t[42]=B,t[43]=C,t[44]=R,t[45]=J):J=t[45];let Y;t[46]!==p||t[47]!==q||t[48]!==J?(Y=(0,v.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 text-xs text-muted-foreground in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[K,q,p,J]}),t[46]=p,t[47]=q,t[48]=J,t[49]=Y):Y=t[49];let X;t[50]===R?X=t[51]:(X=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=R.getSelectedPaths(),n=t.length===1?t[0]:void 0;n&&A.current.has(n)&&e.nativeEvent.composedPath().some(e=>e instanceof HTMLElement&&e.getAttribute(`data-item-path`)===n)&&j.current(n)},t[50]=R,t[51]=X);let Z;t[52]===y?Z=t[53]:(Z=ne(y),t[52]=y,t[53]=Z);let Q;t[54]!==f||t[55]!==R||t[56]!==X||t[57]!==Z?(Q=(0,v.jsx)(te,{model:R,"aria-label":f,onClickCapture:X,className:`min-h-0 flex-1 overflow-hidden`,style:Z}),t[54]=f,t[55]=R,t[56]=X,t[57]=Z,t[58]=Q):Q=t[58];let $;return t[59]!==m||t[60]!==G||t[61]!==Y||t[62]!==Q?($=(0,v.jsxs)(`div`,{className:G,children:[Y,Q,m]}),t[59]=m,t[60]=G,t[61]=Y,t[62]=Q,t[63]=$):$=t[63],$}function pe(e){return{path:e.path,status:e.status}}function me(){let e=new Map;return{sort:g(()=>e),update:t=>{e=t}}}function he(e){return e.path}export{d as a,p as i,h as n,f as r,y as t};
2
+ //# sourceMappingURL=DiffFileTree-BnizHv7v.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,$o as r,A as i,Cx as a,D as o,Es as s,Gn as c,I as l,Kp as u,Lc as d,Mf as f,NE as p,Nv as m,Ox as h,Qn as g,Rd as _,Ub as v,Wp as ee,Xo as y,Yo as te,Zh as b,Zn as ne,Zo as re,ar as x,bs as ie,ff as ae,gd as S,hd as C,ir as oe,kp as se,lE as ce,or as le,qu as ue,rr as de,sr as w,t as T,ts as fe,xm as pe,xy as E,zS as D}from"./utils-Dx_TSvdC.js";import{M as O,N as k,R as A,W as j,Z as M,_t as me,j as N,k as P}from"./runtime-Dz1hyHmq.js";import{s as F}from"./vcsRefInvalidation--2K54DE9.js";import{E as I,O as L,S as he}from"./entities-D1h9ACDa.js";import{t as ge}from"./runtime-D1cxRUzP.js";import{t as _e}from"./useParams-D_8gJiai.js";import{l as ve,p as ye}from"./toast-BeM8bZbF.js";import{a as R,c as be,d as xe,l as Se,m as Ce,n as z,p as we,t as B,u as V,y as Te}from"./tooltip-Cco13jKX.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./DiffFileTree-xeoOBCTn.js";import{f as je}from"./server-BSKDpYuc.js";import{n as Me}from"./query-CRswjQ7f.js";import{t as Ne}from"./use-atom-command-CMd4xAvF.js";import{d as Pe,f as Fe}from"./providerSkills-BmchYM4E.js";import{I as Ie,s as Le,v as Re}from"./useSettings-DpVy22yc.js";import{t as ze,u as Be}from"./queries-D53cjqgz.js";import{a as Ve,c as He,l as Ue,n as We,o as Ge,r as Ke,s as qe,u as H}from"./diffRendering-4kDIxoRz.js";import{F as Je,I as Ye,L as Xe,M as Ze,P as U}from"./PanelLayoutControls-BxdDsUL3.js";import{t as Qe}from"./DiffCommentAnnotation-CKRC0OaV.js";import{c as $e}from"./timestampFormat-wac2e_Jz.js";import{n as et}from"./fileCommentAnnotations-BgdL_7u9.js";import{n as tt,t as nt}from"./toggle-group-C4V_4iet.js";import{i as rt,l as it,n as at,o as ot,r as st,s as ct,t as lt}from"./combobox-BqpUmoio.js";import{La as ut,Ra as dt,Wa as ft,qa as pt}from"./main-CqNzdsfA.js";import{A as mt,D as ht,E as W,O as gt,T as G,j as _t,k as vt,w as yt}from"./_chat-D4KQBrU-.js";var K=e(t(),1),q=p();function bt(e,t){let n=(0,q.c)(4),r=ze(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var J=e(ce(),1);function xt(e){let t=(0,q.c)(17),{filePath:n}=e,r=(0,K.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={onCopy:()=>ht(r),onError:e=>W(r,e),timeout:G},t[0]=i):i=t[0];let{copyToClipboard:a,isCopied:o}=ye(i),s;t[1]!==a||t[2]!==n?(s=(0,J.jsx)(w,{ref:r,size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Copy file path`,onClick:()=>a(n,void 0)}),t[1]=a,t[2]=n,t[3]=s):s=t[3];let c=o&&`text-success`,l;t[4]===c?l=t[5]:(l=T(`size-3`,c),t[4]=c,t[5]=l);let u=o?Se:Te,d;t[6]!==l||t[7]!==u?(d=(0,J.jsx)(be,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]!==s||t[10]!==d?(f=(0,J.jsx)(R,{render:s,children:d}),t[9]=s,t[10]=d,t[11]=f):f=t[11];let p=o?`Copied`:`Copy path`,m;t[12]===p?m=t[13]:(m=(0,J.jsx)(z,{children:(0,J.jsx)(`p`,{children:p})}),t[12]=p,t[13]=m);let h;return t[14]!==f||t[15]!==m?(h=(0,J.jsxs)(B,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var St=[];function Ct(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function Y(e,t,n){let r=Ct(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function wt(e){let t=(0,q.c)(66),{codeViewKey:n,files:r,sectionId:a,sectionTitle:s,composerDraftTarget:c,options:u,viewerRef:d,className:f,renderCodeViewFooter:p,unsafeCSSExtra:m,renderHeaderMetadata:h,renderHeaderFilenameSuffix:g,renderHeaderPrefix:_,onRevealSearchMatch:v}=e,ee=o(kt),y=o(X),te;t[0]===c?te=t[1]:(te=e=>e.getComposerDraft(c)?.reviewComments??St,t[0]=c,t[1]=te);let b=o(te),[ne,re]=(0,K.useState)(null),[x,ie]=(0,K.useState)(null),[ae,S]=(0,K.useState)(``),C;t[2]===r?C=t[3]:(C=new Map(r.map(Ot)),t[2]=r,t[3]=C);let oe=C,se;if(t[4]!==x||t[5]!==r||t[6]!==b||t[7]!==a){let e;t[9]!==x||t[10]!==b||t[11]!==a?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,fileVersion:i,collapsed:o}=e,s=b.filter(e=>e.sectionId===a&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=l(t,n);return r?Y(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),c=x?.fileKey===r?[...s,x.annotation]:s;return{id:r,type:`diff`,fileDiff:t,annotations:c,collapsed:o,version:Ve(`${i}:${o?`1`:`0`}:${c.flatMap(Et).join(`:`)}`)}},t[9]=x,t[10]=b,t[11]=a,t[12]=e):e=t[12],se=r.map(e),t[4]=x,t[5]=r,t[6]=b,t[7]=a,t[8]=se}else se=t[8];let ce=se,le;t[13]!==c||t[14]!==x?.annotation||t[15]!==y?(le=e=>{re(null),x?.annotation.metadata.entries.some(t=>t.id===e)?(ie(null),S(``)):y(c,e)},t[13]=c,t[14]=x?.annotation,t[15]=y,t[16]=le):le=t[16];let ue=le,de;t[17]!==ee||t[18]!==c||t[19]!==x||t[20]!==oe||t[21]!==a||t[22]!==s?(de=(e,t)=>{let n=x?.annotation.metadata.entries.find(t=>t.id===e),r=x?oe.get(x.fileKey):void 0;if(!n||!r)return;let o=i({id:n.id,sectionId:a,sectionTitle:s,filePath:r.filePath,fileDiff:r.fileDiff,range:n.range,text:t});o&&ee(c,o),re(null),ie(null),S(``)},t[17]=ee,t[18]=c,t[19]=x,t[20]=oe,t[21]=a,t[22]=s,t[23]=de):de=t[23];let w=de,T;t[24]!==a||t[25]!==s?(T=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let r=et(),o=i({id:r,sectionId:a,sectionTitle:s,filePath:H(n.fileDiff),fileDiff:n.fileDiff,range:e,text:``});o&&(S(``),ie({fileKey:n.id,annotation:{side:Ct(e),lineNumber:e.end,metadata:{entries:[{id:r,kind:`draft`,range:e,rangeLabel:o.rangeLabel,text:``}]}}}))},t[24]=a,t[25]=s,t[26]=T):T=t[26];let fe=T,pe=x!==null,E;t[27]===d?E=t[28]:(E=d?{viewerRef:d}:{},t[27]=d,t[28]=E);let D;t[29]===f?D=t[30]:(D=f?{className:f}:{},t[29]=f,t[30]=D);let O;t[31]===m?O=t[32]:(O=m?{unsafeCSSExtra:m}:{},t[31]=m,t[32]=O);let k;t[33]===h?k=t[34]:(k=h?{renderHeaderMetadata:e=>e.type===`diff`?h(e.fileDiff):null}:{},t[33]=h,t[34]=k);let A;t[35]===p?A=t[36]:(A=p?{renderCodeViewFooter:p}:{},t[35]=p,t[36]=A);let j;t[37]===v?j=t[38]:(j=e=>v(e.id),t[37]=v,t[38]=j);let M=!pe,me=!pe,N;t[39]!==fe||t[40]!==u||t[41]!==M||t[42]!==me?(N={...u,enableGutterUtility:M,enableLineSelection:me,onGutterUtilityClick:fe},t[39]=fe,t[40]=u,t[41]=M,t[42]=me,t[43]=N):N=t[43];let P;t[44]===g?P=t[45]:(P=e=>e.type===`diff`?g(e.fileDiff):null,t[44]=g,t[45]=P);let F;t[46]===_?F=t[47]:(F=e=>e.type===`diff`?_(e.fileDiff,e.id,e.collapsed===!0):null,t[46]=_,t[47]=F);let I;t[48]!==ae||t[49]!==ue||t[50]!==w?(I=e=>{let t=e.metadata.entries.some(Tt);return(0,J.jsx)(`div`,{className:t?`py-1`:`divide-y divide-border/30 border-y border-border/30`,children:e.metadata.entries.map(e=>(0,J.jsx)(Qe,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.kind===`draft`?ae:e.text,onTextChange:S,onCancel:()=>ue(e.id),onComment:t=>w(e.id,t),onDelete:()=>ue(e.id)},e.id))})},t[48]=ae,t[49]=ue,t[50]=w,t[51]=I):I=t[51];let L;return t[52]!==n||t[53]!==ce||t[54]!==ne||t[55]!==k||t[56]!==A||t[57]!==j||t[58]!==N||t[59]!==P||t[60]!==F||t[61]!==I||t[62]!==E||t[63]!==D||t[64]!==O?(L=(0,J.jsx)(U,{...E,...D,...O,...k,...A,items:ce,selectedLines:ne,onSelectedLinesChange:re,onRevealSearchMatch:j,options:N,renderHeaderFilenameSuffix:P,renderHeaderPrefix:F,renderAnnotation:I},n),t[52]=n,t[53]=ce,t[54]=ne,t[55]=k,t[56]=A,t[57]=j,t[58]=N,t[59]=P,t[60]=F,t[61]=I,t[62]=E,t[63]=D,t[64]=O,t[65]=L):L=t[65],L}function Tt(e){return e.kind===`draft`}function Et(e){return e.metadata.entries.map(Dt)}function Dt(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function Ot(e){return[e.fileKey,e]}function X(e){return e.removeReviewComment}function kt(e){return e.addReviewComment}function At(e){let t=m(4),n=P();return{diffPreview:k(e,{label:`environment-data:review:diff-preview`,tag:d.reviewGetDiffPreview,staleTimeMs:5e3}),diffFilePatch:N(e,{label:`environment-data:review:diff-file-patch`,staleTimeMs:3e5,execute:e=>M(d.reviewGetDiffPreview,e.request).pipe(t.withPermit,h(t=>{let n=t.sources.find(t=>t.kind===e.request.file.sourceKind);return n?D(n):a(new b({operation:`review.diffFilePatch`,kind:`git`,detail:`Diff no longer available. Refresh the comparison.`}))}))}),diffFileContents:O(e,{label:`environment-data:review:diff-file-contents`,tag:d.reviewGetDiffFileContents,scheduler:n,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.sourceKind,t.baseRef,t.headRef,t.oldPath,t.newPath,t.changeType])}})}}var jt=At(ge);function Mt(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function Nt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&Mt(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function Pt(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var Ft=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function It(e){let t=(0,q.c)(86),{environmentId:n,cwd:i,source:a,baseRef:o,ignoreWhitespace:s,theme:c,revision:l,preview:u}=e,d=(0,K.useContext)(y),f;t[0]!==o||t[1]!==i||t[2]!==n||t[3]!==s||t[4]!==a?.diffHash||t[5]!==a?.kind?(f=JSON.stringify([n,i,a?.kind,a?.diffHash,o,s]),t[0]=o,t[1]=i,t[2]=n,t[3]=s,t[4]=a?.diffHash,t[5]=a?.kind,t[6]=f):f=t[6];let p=f,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=[0,1,2,3],t[7]=m):m=t[7];let h;t[8]===p?h=t[9]:(h={scope:p,indices:m},t[8]=p,t[9]=h);let[g,_]=(0,K.useState)(h),v;t[10]!==g.indices||t[11]!==g.scope||t[12]!==p?(v=g.scope===p?g.indices:[0,1,2,3],t[10]=g.indices,t[11]=g.scope,t[12]=p,t[13]=v):v=t[13];let ee=v,b;t[14]===a?.files?b=t[15]:(b=()=>a?.files?.toSorted(Q)??[],t[14]=a?.files,t[15]=b),a?.files;let ne;t[16]===b?ne=t[17]:(ne=b(),t[16]=b,t[17]=ne);let x=ne,ae;t[18]!==o||t[19]!==i||t[20]!==n||t[21]!==x||t[22]!==s||t[23]!==ee||t[24]!==p||t[25]!==a?(ae=!n||!i||!a?[]:ee.filter(e=>e<x.length).map(e=>{let t=x[e];return{index:e,query:jt.diffFilePatch({environmentId:n,input:{cacheKey:p,request:{cwd:i,...o?{baseRef:o}:{},ignoreWhitespace:s,file:{path:t.path,previousPath:t.previousPath,sourceKind:a.kind}}}})}}),t[18]=o,t[19]=i,t[20]=n,t[21]=x,t[22]=s,t[23]=ee,t[24]=p,t[25]=a,t[26]=ae):ae=t[26];let S=ae,C;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[27]=C):C=t[27];let oe;t[28]!==l||t[29]!==p?(oe={scope:p,revision:l,queries:C},t[28]=l,t[29]=p,t[30]=oe):oe=t[30];let se=(0,K.useRef)(oe),ce,le;t[31]!==S||t[32]!==d||t[33]!==l||t[34]!==p?(ce=()=>{let e=se.current;se.current={scope:p,revision:l,queries:S};for(let{query:t}of S){let n=e.scope===p&&e.revision!==l,r=!e.queries.some(e=>e.query===t)&&d.get(t)._tag!==`Initial`&&!d.get(t).waiting;(n||r)&&d.refresh(t)}},le=[p,l,S,d],t[31]=S,t[32]=d,t[33]=l,t[34]=p,t[35]=ce,t[36]=le):(ce=t[35],le=t[36]),(0,K.useEffect)(ce,le);let ue;t[37]===c?ue=t[38]:(ue=re(e=>fe(e,e=>ie(e,e=>{let t=He(e.diff,`diff-panel:${c}`,{compactPartialHunkOffsets:!0});if(t?.kind===`files`&&t.files.length===1&&e.files?.length===1){let n=e.files[0],r={...t.files[0],name:n.path};n.previousPath===null?delete r.prevName:r.prevName=n.previousPath,t={...t,files:[r]}}return{source:e,patch:t}}))),t[37]=c,t[38]=ue);let de=ue,w;t[39]!==de||t[40]!==S?(w=r(e=>new Map(S.map(t=>{let{index:n,query:r}=t;return[n,e(de(r))]}))),t[39]=de,t[40]=S,t[41]=w):w=t[41];let T=te(w),pe;t[42]===T?pe=t[43]:(pe=(e,t)=>{let n=T.get(t);return!n||n._tag===`Initial`},t[42]=T,t[43]=pe);let E=x.findIndex(pe),D=a?E<0?x.length:E:u?.kind===`files`?u.files.length:0,O;t[44]===p?O=t[45]:(O=e=>_(t=>{let n=t.scope===p?t.indices:[0,1,2,3],r=e.filter(e=>!n.includes(e));return r.length===0?t:{scope:p,indices:[...n,...r]}}),t[44]=p,t[45]=O);let k=O,A;t[46]!==k||t[47]!==D?(A=()=>k(Array.from({length:4},(e,t)=>D+t)),t[46]=k,t[47]=D,t[48]=A):A=t[48];let j=A,M;t[49]===k?M=t[50]:(M=e=>k([e]),t[49]=k,t[50]=M);let me=M,N;t[51]!==x||t[52]!==S?(N={queries:S,files:x},t[51]=x,t[52]=S,t[53]=N):N=t[53];let P=(0,K.useRef)(N),F,I;t[54]!==x||t[55]!==S?(F=()=>{P.current={queries:S,files:x}},I=[S,x],t[54]=x,t[55]=S,t[56]=F,t[57]=I):(F=t[56],I=t[57]),(0,K.useLayoutEffect)(F,I);let L;t[58]===d?L=t[59]:(L=e=>{let{queries:t,files:n}=P.current,r=t.find(t=>{let{index:r}=t;return n[r]?.path===e})?.query;r&&d.refresh(r)},t[58]=d,t[59]=L);let he=L,ge;t[60]!==x||t[61]!==T||t[62]!==u||t[63]!==p||t[64]!==a?(ge=a?x.map((e,t)=>{let n=T.get(t);if(n?._tag===`Success`&&n.value.patch?.kind===`files`){let t=n.value.patch.files.find(t=>H(t)===e.path);if(t)return t}return{name:e.path,...e.previousPath?{prevName:e.previousPath}:{},type:e.previousPath?`rename-changed`:`change`,hunks:[],additionLines:[],deletionLines:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,cacheKey:`${p}:${e.path}:pending`}}):(u?.kind===`files`?u.files:[]).toSorted(Rt),t[60]=x,t[61]=T,t[62]=u,t[63]=p,t[64]=a,t[65]=ge):ge=t[65];let _e=ge,ve;if(t[66]!==x||t[67]!==T){let e;t[69]===T?e=t[70]:(e=(e,t)=>{let n=T.get(t);return[e.path,{error:n?._tag===`Failure`||n?._tag===`Success`&&(n.value.patch?.kind!==`files`||!n.value.patch.files.some(t=>H(t)===e.path)),truncated:n?._tag===`Success`&&n.value.source.truncated}]},t[69]=T,t[70]=e),ve=new Map(x.map(e)),t[66]=x,t[67]=T,t[68]=ve}else ve=t[68];let ye=ve,R;if(t[71]!==x||t[72]!==T){let e;t[74]===T?e=t[75]:(e=(e,t)=>{let n=T.get(t);return n&&n._tag!==`Initial`},t[74]=T,t[75]=e),R=new Set(x.filter(e).map(Lt)),t[71]=x,t[72]=T,t[73]=R}else R=t[73];let be=R,xe=[...T.values()].some(Z),Se;return t[76]!==ye||t[77]!==j||t[78]!==be||t[79]!==_e||t[80]!==me||t[81]!==he||t[82]!==p||t[83]!==D||t[84]!==xe?(Se={scope:p,fileStates:ye,isPending:xe,retry:he,requestFile:me,readyFilePaths:be,renderableFiles:_e,settledFileCount:D,loadNextFiles:j},t[76]=ye,t[77]=j,t[78]=be,t[79]=_e,t[80]=me,t[81]=he,t[82]=p,t[83]=D,t[84]=xe,t[85]=Se):Se=t[85],Se}function Z(e){return e._tag===`Initial`||e.waiting}function Lt(e){return e.path}function Rt(e,t){return Ft.compare(H(e),H(t))}function Q(e,t){return Ft.compare(e.path,t.path)}function zt(e){let t=(0,q.c)(5),{load:n,count:r}=e,i=(0,K.useRef)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{if(!i.current)return;let e=new IntersectionObserver(e=>{e.some(Vt)&&n()},{rootMargin:`600px`});return e.observe(i.current),()=>e.disconnect()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,K.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=(0,J.jsx)(`div`,{ref:i,role:`status`,"aria-label":`Loading diff…`,children:Array.from({length:Math.min(r,4)},Bt)}),t[3]=r,t[4]=s),s}function Bt(e,t){return(0,J.jsx)(`div`,{"aria-hidden":!0,className:`border-b border-border/40`,children:(0,J.jsx)(Je,{titleWidth:`medium`})},t)}function Vt(e){return e.isIntersecting}function Ht(e){let t=(0,q.c)(16),{error:n,truncated:r,retry:i}=e;if(!n&&!r)return null;let a=n?`Retry loading diff`:`Partial diff preview`,o;t[0]!==n||t[1]!==i?(o=e=>{e.stopPropagation(),n&&i()},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,J.jsx)(w,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":a,onClick:o}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=n?(0,J.jsx)(ee,{className:`size-3`}):(0,J.jsx)(f,{className:`size-3`}),t[6]=n,t[7]=c);let l;t[8]!==s||t[9]!==c?(l=(0,J.jsx)(R,{render:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u=n?`Retry loading diff`:`This file is too large to show in full. Counts include all changes.`,d;t[11]===u?d=t[12]:(d=(0,J.jsx)(z,{children:u}),t[11]=u,t[12]=d);let p;return t[13]!==l||t[14]!==d?(p=(0,J.jsxs)(B,{children:[l,d]}),t[13]=l,t[14]=d,t[15]=p):p=t[15],p}var Ut=`__automatic_base_ref__`,Wt=`t3code.diffFileTreeOpen`,Gt=new WeakMap;function Kt(e){let t=Gt.get(e);if(t)return t;let n={fileDiff:e,fileKey:Ke(e),fileVersion:We(e)};return Gt.set(e,n),n}var qt=new Set;function Jt(e){let t=(0,q.c)(21),{filePath:n,fileKey:r,collapsed:i,unavailable:a,iconClassName:o,onToggle:s}=e,c=i?`Expand ${n}`:`Collapse ${n}`,l=!i,u;t[0]!==r||t[1]!==s?(u=e=>{e.stopPropagation(),s(r)},t[0]=r,t[1]=s,t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==l||t[5]!==u||t[6]!==a?(d=(0,J.jsx)(w,{size:`icon-micro`,variant:`ghost`,className:`-ms-0.5`,"aria-label":c,"aria-expanded":l,disabled:a,onClick:u}),t[3]=c,t[4]=l,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=T(`size-4`,o),t[8]=o,t[9]=f);let p=i?xe:V,m;t[10]!==f||t[11]!==p?(m=(0,J.jsx)(be,{className:f,icon:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,J.jsx)(R,{render:d,children:m}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let g=i?`Expand diff`:`Collapse diff`,_;t[16]===g?_=t[17]:(_=(0,J.jsx)(z,{side:`top`,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==h?(v=(0,J.jsxs)(B,{children:[h,_]}),t[18]=_,t[19]=h,t[20]=v):v=t[20],v}function Yt(e){let t=(0,q.c)(11),{filePath:n,hasStat:r,error:i,truncated:a,onRetry:o}=e,s;t[0]===n?s=t[1]:(s=(0,J.jsx)(xt,{filePath:n}),t[0]=n,t[1]=s);let c;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a?(c=r?(0,J.jsx)(Ht,{error:i,truncated:a,retry:()=>o(n)}):null,t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsxs)(J.Fragment,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Xt({mode:e=`inline`,composerDraftTarget:t,workspaceMutationId:r}){let{resolvedTheme:i}=Ie(),a=Le(),o=a.diffLayout,l=Re(),[d,f]=(0,K.useState)(a.wordWrap),[p,m]=(0,K.useState)(a.diffIgnoreWhitespace),[h,ee]=s(Wt,!1,E),[y,b]=(0,K.useState)(``),[re,ie]=(0,K.useState)(()=>({scopeKey:null,fileKeys:qt})),[ce,fe]=(0,K.useState)(0),[D,O]=(0,K.useState)(null),k=_e({strict:!1,select:e=>ve(e)}),M=k?.threadId??null,N=L(k),P=I(k)?.projection??null,ge=F(N?.environmentId??null),{canReadFiles:ye}=ge,xe=N?.projectId??null,Se=he(N&&xe?{environmentId:N.environmentId,projectId:xe}:null),V=N?.worktreePath??Se?.workspaceRoot,Te=N?.worktreePath?void 0:Se?.repositoryIdentity?.rootPath,ze=te(je.configValueAtom(N?.environmentId??null)),Ve=Pe(N?.environmentId??null),We=ft(N?.environmentId??null,ze?.availableEditors??[]),Ke=Ne(jt.diffFileContents),Je=Me(N!=null&&V!=null?Be.status({environmentId:N.environmentId,input:{cwd:V}}):null),U=_t(e=>mt(e.byThreadKey,k)),Qe=Je.data?.isRepo??!0,{turnDiffSummaries:et,inferredCheckpointTurnCountByRunId:ht}=vt(P),W=(0,K.useMemo)(()=>[...et].toSorted((e,t)=>{let n=e.checkpointTurnCount??ht[e.runId]??0,r=t.checkpointTurnCount??ht[t.runId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[ht,et]);(0,K.useEffect)(()=>{k&&U.kind===`turn`&&_t.getState().reconcileTurnSelection(k,W.map(e=>e.runId))},[U,W,k]);let G=U.kind===`turn`?U.turnId:null,q=U.kind===`unstaged`?`unstaged`:`branch`,xt=U.kind===`branch`?U.baseRef:null,St=U.kind===`turn`?U.filePath:null,Ct=U.kind===`turn`?U.revealRequestId:0,Y=G===null?void 0:W.find(e=>e.runId===G)??W[0],Tt=Y&&(Y.checkpointTurnCount??ht[Y.runId]),Et=W[0],Dt=G===null?q===`unstaged`?`Uncommitted`:`Changes`:Y?.runId===Et?.runId?`Latest turn`:`Turn ${Tt??`?`}`,Ot=Y?`turn:${Y.runId}`:q,X=k?`${k.environmentId}:${k.threadId}:${Ot}`:null,kt=`${X??Ot}:${ce}`,At=Y?`Turn ${Tt??`?`}`:q===`unstaged`?`Uncommitted`:`Changes`,Mt=(0,K.useMemo)(()=>typeof Tt==`number`?{fromTurnCount:Math.max(0,Tt-1),toTurnCount:Tt}:null,[Tt]),Ft=bt({environmentId:N?.environmentId??null,threadId:M,fromTurnCount:Mt?.fromTurnCount??null,toTurnCount:Mt?.toTurnCount??null,ignoreWhitespace:p,cacheScope:Y?`turn:${Y.runId}`:null},{enabled:Qe&&Y!==void 0}),Z=Me(ye&&G===null&&N&&V?jt.diffPreview({environmentId:N.environmentId,input:{cwd:V,...xt?{baseRef:xt}:{},ignoreWhitespace:p}}):null),Lt=Qe&&G===null&&N!=null&&V!=null,Rt=k?`${k.environmentId}:${k.threadId}`:null,Q=Z.data?.sources.find(e=>e.kind===(q===`unstaged`?`working-tree`:`branch-range`)),Bt=Z.refresh,Vt=Bt,Ht=(0,K.useMemo)(()=>{let e=Z.data;if(G===null&&N&&e&&Q&&ye)return Ze(Ke,{environmentId:N.environmentId,cwd:e.cwd,sourceKind:Q.kind,baseRef:Q.baseRef,headRef:Q.headRef,cacheKey:Q.diffHash})},[N,Z.data,Ke,ye,Q,G]),Gt=(0,K.useRef)(Ht);Gt.current=Ht;let Xt=(0,K.useCallback)(async e=>{let t=Gt.current;if(!t)throw Error(`Diff file contents are unavailable for this selection.`);return t(e)},[]),Zt=Me(G===null&&q===`branch`&&N&&Z.data?.cwd?Be.listRefs({environmentId:N.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`local`,...y.trim().length>0?{query:y.trim()}:{},limit:100}}):null),Qt=Me(G===null&&q===`branch`&&N&&Z.data?.cwd?Be.listRefs({environmentId:N.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`remote`,...y.trim().length>0?{query:y.trim()}:{},limit:100}}):null),$t=Nt(Zt.data?.refs.filter(e=>e.name!==Q?.headRef)??[],Qt.data?.refs??[]),en=Pt($t,y),tn=e=>xt&&xt===e.remote?.name?xt:e.local?.name??e.remote?.name??e.id,nn=[Ut,...$t.map(tn)],rn=[...y.trim().length===0?[Ut]:[],...en.map(tn)],an=Q?.diff,on=Y?Ft.data?.diff:an,sn=!Y&&Q?.truncated===!0,cn=Y?Ft.isPending:Z.isPending,ln=Y?Ft.error:Z.error,un=typeof on==`string`&&on.trim().length===0,$=!Y&&Q?.truncated&&Q.files?Q:null,dn=(0,K.useMemo)(()=>$?null:He(on,`diff-panel:${i}`,{compactPartialHunkOffsets:G===null}),[$,i,on,G]),fn=(0,K.useMemo)(()=>new Map($?.files?.map(e=>[e.path,e])),[$?.files]),{scope:pn,isPending:mn,fileStates:hn,retry:gn,requestFile:_n,readyFilePaths:vn,renderableFiles:yn,settledFileCount:bn,loadNextFiles:xn}=It({environmentId:N?.environmentId,cwd:Z.data?.cwd,source:$,baseRef:$?.baseRef??xt,ignoreWhitespace:p,theme:i,revision:Z.data?v(Z.data.generatedAt):void 0,preview:dn}),Sn=Bt;(0,K.useEffect)(()=>{if(!Lt)return;let e=()=>Sn();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Lt,Sn]),gt({enabled:Lt,mutationId:r,refresh:Sn,resourceKey:`diff:${Rt??``}`});let Cn=Z.isPending||mn,wn=(0,K.useMemo)(()=>yn.map(Kt),[yn]),Tn=(0,K.useMemo)(()=>a.diffFilesCollapsed?new Set(wn.map(e=>e.fileKey)):qt,[wn,a.diffFilesCollapsed]),En=re.scopeKey===X?re.fileKeys:Tn,Dn=(0,K.useCallback)(()=>bn<yn.length?(0,J.jsx)(zt,{load:xn,count:yn.length-bn}):null,[bn,yn.length,xn]),On=(0,K.useMemo)(()=>wn.filter(({fileDiff:e})=>!$||vn.has(H(e))).map(({fileDiff:e,fileKey:t,fileVersion:n})=>({fileDiff:e,filePath:H(e),fileKey:t,fileVersion:n,collapsed:En.has(t)||e.cacheKey?.endsWith(`:pending`)===!0})),[En,wn,$,vn]),kn=(0,K.useMemo)(()=>wn.map(e=>e.fileKey),[wn]),An=ke(kn,En),jn=(0,K.useMemo)(()=>!Y&&Q?.files?Q.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}):qe(yn),[yn,Q,Y]),Mn=(0,K.useMemo)(()=>Oe(yn),[yn]),Nn=St?On.find(e=>e.filePath===St)?.fileKey??null:null;(0,K.useEffect)(()=>{Nn&&D?.getInstance()&&D.scrollTo({type:`item`,id:Nn,align:`start`})},[D,kt,Nn,Ct]);let Pn=(0,K.useMemo)(()=>({collapseScopeKey:X,diffSelection:U}),[X,U]),Fn=Ee(D,Pn,On.map(e=>e.fileKey)),In=(0,K.useCallback)(e=>{let t=wn.findIndex(t=>H(t.fileDiff)===e),n=wn[t];n&&(ie(e=>{let t=new Set(e.scopeKey===X?e.fileKeys:Tn);return t.delete(n.fileKey),{scopeKey:X,fileKeys:t}}),$&&t>=bn&&_n(t),Fn(n.fileKey))},[wn,X,Tn,Fn,$,bn,_n]),Ln=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!$||!St)return;let e=`${St}:${Ct}`;(Ln.current?.cache!==pn||Ln.current.key!==e)&&(Ln.current={cache:pn,key:e},In(St))},[$,St,Ct,pn,In]);let Rn=(0,K.useCallback)(e=>{Fe({threadRef:k,filePath:e,activeCwd:V,repositoryRoot:Te,openInEditor:e=>{(async()=>{let t=await We(e);t._tag===`Failure`&&!A(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...k?{environmentId:k.environmentId,threadId:k.threadId}:{},...me(j(t))})})()}})},[V,Te,We,k]),zn=(0,K.useRef)({collapseScopeKey:X,defaultCollapsedDiffFileKeys:Tn});(0,K.useLayoutEffect)(()=>{zn.current={collapseScopeKey:X,defaultCollapsedDiffFileKeys:Tn}},[X,Tn]);let Bn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=zn.current;ie(r=>{let i=new Set(r.scopeKey===t?r.fileKeys:n);return i.has(e)?i.delete(e):i.add(e),{scopeKey:t,fileKeys:i}})},[]),Vn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=zn.current;ie(r=>{let i=r.scopeKey===t?r.fileKeys:n;if(!i.has(e))return r;let a=new Set(i);return a.delete(e),{scopeKey:t,fileKeys:a}})},[]),Hn=(0,K.useCallback)(()=>{fe(e=>e+1),ie(e=>{let t=e.scopeKey===X?e.fileKeys:Tn;return{scopeKey:X,fileKeys:De(kn,t)}})},[X,Tn,kn]),Un=e=>{k&&_t.getState().selectTurn(k,e)},Wn=e=>{k&&_t.getState().selectGitScope(k,e)},Gn=e=>{k&&_t.getState().selectBranchBaseRef(k,e)},Kn=Y?`turn:${Y.runId}`:``,qn=G===null?q:Y?.runId===Et?.runId?`latest`:Kn,Jn=e=>{if(e===`unstaged`||e===`branch`)Wn(e);else if(e===`latest`)Et&&Un(Et.runId);else{let t=W.find(t=>`turn:${t.runId}`===e);t&&Un(t.runId)}},Yn=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,J.jsxs)(c,{children:[(0,J.jsxs)(le,{render:(0,J.jsx)(w,{size:`xs`,variant:`secondary`}),className:`max-w-full`,"aria-label":`Diff scope: ${Dt}`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:Dt}),(0,J.jsx)(S,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(ne,{align:`start`,children:[(0,J.jsxs)(g,{value:qn,onValueChange:Jn,children:[(0,J.jsx)(n,{value:`branch`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Changes`})}),(0,J.jsx)(n,{value:`unstaged`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Uncommitted`})}),(0,J.jsx)(n,{value:`latest`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Latest turn`})})]}),(0,J.jsxs)(de,{children:[(0,J.jsx)(x,{children:`Turn`}),(0,J.jsx)(oe,{children:(0,J.jsx)(g,{value:Kn,onValueChange:Jn,children:W.map(e=>{let t=e.checkpointTurnCount??ht[e.runId]??`?`;return(0,J.jsx)(n,{value:`turn:${e.runId}`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{children:[`Turn `,t]}),(0,J.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:$e(e.completedAt,a.timestampFormat)})]})},e.runId)})})})]})]})]}),G===null&&q===`branch`&&Q?.baseRef&&(0,J.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,"aria-label":`Comparing ${Q.headRef??`HEAD`} against ${Q.baseRef}`,children:[(0,J.jsxs)(B,{children:[(0,J.jsxs)(R,{render:(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`}),children:[(0,J.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Q.headRef??`HEAD`}),(0,J.jsx)(ue,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsx)(z,{side:`top`,children:`${Q.headRef??`HEAD`} → ${Q.baseRef}`})]}),(0,J.jsxs)(lt,{items:nn,filteredItems:rn,value:xt??Ut,onOpenChange:e=>{e||b(``)},onValueChange:e=>{e&&Gn(e===Ut?null:e)},children:[(0,J.jsxs)(it,{render:(0,J.jsx)(w,{variant:`ghost-muted`,size:`xs`}),className:`min-w-0 max-w-48`,"aria-label":`Change comparison target. Currently ${Q.baseRef}`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:Q.baseRef}),(0,J.jsx)(S,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(ot,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden`,children:[(0,J.jsx)(ct,{placeholder:`Search refs...`,value:y,onChange:e=>b(e.target.value)}),(0,J.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-3xs text-muted-foreground uppercase tracking-wide`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,J.jsx)(`span`,{children:`Branch`}),(0,J.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,J.jsx)(at,{children:`No matching refs.`}),(0,J.jsxs)(rt,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,J.jsx)(st,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:Ut,children:(0,J.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),$t.map(e=>{let t=tn(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,J.jsx)(st,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:t,children:(0,J.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,J.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,J.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,J.jsx)(ut,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Gn(n)}})}):e.remote?(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,children:(0,J.jsx)(C,{role:`img`,"aria-label":`Remote only`,className:`size-3`})})}),(0,J.jsx)(z,{side:`top`,children:`Remote only`})]}):null]})},e.id)})]})]})]})]})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[On.length>0||!Y&&Q?.files?.length?(0,J.jsx)(yt,{additions:jn.additions,deletions:jn.deletions,className:`mr-1 text-2xs`,layout:`inline`}):null,Lt&&(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Cn?`Refreshing diff`:`Refresh diff`,onClick:Vt}),children:(0,J.jsx)(pt,{size:`sm`,refreshing:Cn})}),(0,J.jsx)(z,{side:`top`,children:Cn?`Refreshing diff…`:`Refresh diff`})]}),kn.length>0&&(0,J.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":An?`Expand all files`:`Collapse all files`,onClick:Hn,children:(0,J.jsx)(be,{className:`size-3.5`,icon:An?Ce:we})}),(0,J.jsxs)(tt,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[o],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&l({diffLayout:t})},children:[(0,J.jsx)(nt,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,J.jsx)(u,{className:`size-3.5`})}),(0,J.jsx)(nt,{"aria-label":`Split diff view`,value:`split`,children:(0,J.jsx)(_,{className:`size-3.5`})})]}),(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(nt,{"aria-label":d?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:d,onPressedChange:e=>{f(!!e)}}),children:(0,J.jsx)(pe,{className:`size-3.5`})}),(0,J.jsx)(z,{side:`top`,children:d?`Disable line wrapping`:`Enable line wrapping`})]}),(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(nt,{"aria-label":p?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:p,onPressedChange:e=>{m(!!e)}}),children:(0,J.jsx)(se,{className:`size-3.5`})}),(0,J.jsx)(z,{side:`top`,children:p?`Show whitespace changes`:`Hide whitespace changes`})]}),kn.length>0&&(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(nt,{"aria-label":h?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:h,onPressedChange:e=>ee(!!e)}),children:(0,J.jsx)(ae,{className:`size-3.5`})}),(0,J.jsx)(z,{side:`top`,children:h?`Hide file tree`:`Show file tree`})]})]})]});return(0,J.jsx)(Xe,{mode:e,header:Yn,children:N?Qe?G!==null&&W.length===0?(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):G===null&&!ye?ge.isPending?(0,J.jsx)(Ye,{label:`Checking file access...`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:ge.error??`This connection cannot read local diffs.`}):(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[sn&&!$&&(0,J.jsxs)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-2xs text-muted-foreground`,children:[`This preview exceeds the size limit. Changes shown are incomplete.`,Q?.files?` Totals include all changes.`:``]}),ln&&!dn&&(0,J.jsx)(`div`,{className:`px-3`,children:(0,J.jsx)(`p`,{className:`mb-2 text-2xs text-error/80`,children:ln})}),!dn&&!$?cn?(0,J.jsx)(Ye,{label:Y?`Loading checkpoint diff...`:q===`unstaged`?`Loading uncommitted changes...`:`Loading changes...`}):(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,J.jsx)(`p`,{children:un?`No net changes in this selection.`:`No patch available for this selection.`})}):$||dn?.kind===`files`?(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement&&(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent;if(n){Rn(n);return}let r=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-diffs-header`))?.querySelector(`[data-title]`)?.textContent;if(!r)return;let i=On.find(e=>e.filePath===r);i&&Bn(i.fileKey)},onContextMenuCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&(e.preventDefault(),Ve({environmentId:N?.environmentId??null,filePath:t,workspaceRoot:V,repositoryRoot:Te},e))},children:(0,J.jsx)(wt,{viewerRef:O,codeViewKey:`${kt}:${$?pn:`preview`}`,className:`h-full min-h-0 overflow-auto`,files:On,renderCodeViewFooter:Dn,sectionId:Ot,sectionTitle:At,composerDraftTarget:t,renderHeaderFilenameSuffix:e=>{let t=H(e),n=hn.get(t);return(0,J.jsx)(Yt,{filePath:t,hasStat:fn.has(t),error:n?.error??!1,truncated:n?.truncated??!1,onRetry:gn})},...$?{unsafeCSSExtra:`[data-additions-count], [data-deletions-count] { display: none; }`,renderHeaderMetadata:e=>{let t=fn.get(H(e));return t?(0,J.jsx)(yt,{additions:t.additions,deletions:t.deletions}):null}}:{},onRevealSearchMatch:Vn,renderHeaderPrefix:(e,t)=>{let n=e.cacheKey?.endsWith(`:pending`)===!0;return(0,J.jsx)(Jt,{filePath:H(e),fileKey:t,collapsed:n||En.has(t),unavailable:n,iconClassName:Ge(e),onToggle:Bn})},options:{diffStyle:o===`split`?`split`:`unified`,lineDiffType:`none`,overflow:d?`wrap`:`scroll`,theme:Ue(i),preferredHighlighter:dt,themeType:i,stickyHeaders:!0,...Ht?{loadDiffFiles:Xt}:{}}},X??Ot)}),h?(0,J.jsx)(`aside`,{className:`flex w-[min(16rem,40%)] min-w-40 shrink-0 border-l border-border/60`,children:(0,J.jsx)(Ae,{ariaLabel:`${At} files`,entries:Mn,selectedPath:St,revealRequestId:Ct,onSelectFile:In})}):null]}):(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-2xs text-muted-foreground/75`,children:dn?.kind===`raw`?dn.reason:null}),(0,J.jsx)(`pre`,{className:T(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-2xs leading-relaxed text-muted-foreground/90`,d?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:dn?.kind===`raw`?dn.text:null})]})})]})}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{Xt as default};
2
- //# sourceMappingURL=DiffPanel-CzkU9nAC.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,$o as r,A as i,Cx as a,D as o,Es as s,Gn as c,I as l,Kp as u,Lc as d,Mf as f,NE as p,Nv as m,Ox as h,Qn as g,Rd as _,Ub as v,Wp as ee,Xo as y,Yo as te,Zh as b,Zn as ne,Zo as re,ar as x,bs as ie,ff as ae,gd as S,hd as C,ir as oe,kp as se,lE as ce,or as le,qu as ue,rr as de,sr as w,t as T,ts as fe,xm as pe,xy as E,zS as D}from"./utils-BgVDKR83.js";import{M as O,N as k,R as A,W as j,Z as M,_t as me,j as N,k as P}from"./runtime-B7jXrsPs.js";import{s as F}from"./vcsRefInvalidation-BWvsbPLB.js";import{E as I,O as L,S as he}from"./entities-Cri9JXzU.js";import{t as ge}from"./runtime-B75ae48c.js";import{t as _e}from"./useParams-Bschqkhl.js";import{l as ve,p as ye}from"./toast-e2DHftFl.js";import{a as R,c as be,d as xe,l as Se,m as Ce,n as z,p as we,t as B,u as V,y as Te}from"./tooltip-DRGG_vM1.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./DiffFileTree-BnizHv7v.js";import{f as je}from"./server-B0y-CZn0.js";import{n as Me}from"./query-1tRB9OB0.js";import{t as Ne}from"./use-atom-command-BEpD82FZ.js";import{d as Pe,f as Fe}from"./providerSkills-mKD6o1i5.js";import{I as Ie,s as Le,v as Re}from"./useSettings-CUN8qNLl.js";import{t as ze,u as Be}from"./queries-DqFudp6N.js";import{a as Ve,c as He,l as Ue,n as We,o as Ge,r as Ke,s as qe,u as H}from"./diffRendering-BAlsKvkZ.js";import{F as Je,I as Ye,L as Xe,M as Ze,P as U}from"./PanelLayoutControls-Cyag4Tur.js";import{t as Qe}from"./DiffCommentAnnotation-CX8scC3B.js";import{c as $e}from"./timestampFormat-wac2e_Jz.js";import{n as et}from"./fileCommentAnnotations-BgdL_7u9.js";import{n as tt,t as nt}from"./toggle-group-BWnqiNcg.js";import{i as rt,l as it,n as at,o as ot,r as st,s as ct,t as lt}from"./combobox-DsEnX06q.js";import{La as ut,Ra as dt,Wa as ft,qa as pt}from"./main-Co3JeKTg.js";import{A as mt,D as ht,E as W,O as gt,T as G,j as _t,k as vt,w as yt}from"./_chat-DcFCVkrG.js";var K=e(t(),1),q=p();function bt(e,t){let n=(0,q.c)(4),r=ze(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var J=e(ce(),1);function xt(e){let t=(0,q.c)(17),{filePath:n}=e,r=(0,K.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={onCopy:()=>ht(r),onError:e=>W(r,e),timeout:G},t[0]=i):i=t[0];let{copyToClipboard:a,isCopied:o}=ye(i),s;t[1]!==a||t[2]!==n?(s=(0,J.jsx)(w,{ref:r,size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Copy file path`,onClick:()=>a(n,void 0)}),t[1]=a,t[2]=n,t[3]=s):s=t[3];let c=o&&`text-success`,l;t[4]===c?l=t[5]:(l=T(`size-3`,c),t[4]=c,t[5]=l);let u=o?Se:Te,d;t[6]!==l||t[7]!==u?(d=(0,J.jsx)(be,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]!==s||t[10]!==d?(f=(0,J.jsx)(R,{render:s,children:d}),t[9]=s,t[10]=d,t[11]=f):f=t[11];let p=o?`Copied`:`Copy path`,m;t[12]===p?m=t[13]:(m=(0,J.jsx)(z,{children:(0,J.jsx)(`p`,{children:p})}),t[12]=p,t[13]=m);let h;return t[14]!==f||t[15]!==m?(h=(0,J.jsxs)(B,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var St=[];function Ct(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function Y(e,t,n){let r=Ct(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function wt(e){let t=(0,q.c)(66),{codeViewKey:n,files:r,sectionId:a,sectionTitle:s,composerDraftTarget:c,options:u,viewerRef:d,className:f,renderCodeViewFooter:p,unsafeCSSExtra:m,renderHeaderMetadata:h,renderHeaderFilenameSuffix:g,renderHeaderPrefix:_,onRevealSearchMatch:v}=e,ee=o(kt),y=o(X),te;t[0]===c?te=t[1]:(te=e=>e.getComposerDraft(c)?.reviewComments??St,t[0]=c,t[1]=te);let b=o(te),[ne,re]=(0,K.useState)(null),[x,ie]=(0,K.useState)(null),[ae,S]=(0,K.useState)(``),C;t[2]===r?C=t[3]:(C=new Map(r.map(Ot)),t[2]=r,t[3]=C);let oe=C,se;if(t[4]!==x||t[5]!==r||t[6]!==b||t[7]!==a){let e;t[9]!==x||t[10]!==b||t[11]!==a?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,fileVersion:i,collapsed:o}=e,s=b.filter(e=>e.sectionId===a&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=l(t,n);return r?Y(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),c=x?.fileKey===r?[...s,x.annotation]:s;return{id:r,type:`diff`,fileDiff:t,annotations:c,collapsed:o,version:Ve(`${i}:${o?`1`:`0`}:${c.flatMap(Et).join(`:`)}`)}},t[9]=x,t[10]=b,t[11]=a,t[12]=e):e=t[12],se=r.map(e),t[4]=x,t[5]=r,t[6]=b,t[7]=a,t[8]=se}else se=t[8];let ce=se,le;t[13]!==c||t[14]!==x?.annotation||t[15]!==y?(le=e=>{re(null),x?.annotation.metadata.entries.some(t=>t.id===e)?(ie(null),S(``)):y(c,e)},t[13]=c,t[14]=x?.annotation,t[15]=y,t[16]=le):le=t[16];let ue=le,de;t[17]!==ee||t[18]!==c||t[19]!==x||t[20]!==oe||t[21]!==a||t[22]!==s?(de=(e,t)=>{let n=x?.annotation.metadata.entries.find(t=>t.id===e),r=x?oe.get(x.fileKey):void 0;if(!n||!r)return;let o=i({id:n.id,sectionId:a,sectionTitle:s,filePath:r.filePath,fileDiff:r.fileDiff,range:n.range,text:t});o&&ee(c,o),re(null),ie(null),S(``)},t[17]=ee,t[18]=c,t[19]=x,t[20]=oe,t[21]=a,t[22]=s,t[23]=de):de=t[23];let w=de,T;t[24]!==a||t[25]!==s?(T=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let r=et(),o=i({id:r,sectionId:a,sectionTitle:s,filePath:H(n.fileDiff),fileDiff:n.fileDiff,range:e,text:``});o&&(S(``),ie({fileKey:n.id,annotation:{side:Ct(e),lineNumber:e.end,metadata:{entries:[{id:r,kind:`draft`,range:e,rangeLabel:o.rangeLabel,text:``}]}}}))},t[24]=a,t[25]=s,t[26]=T):T=t[26];let fe=T,pe=x!==null,E;t[27]===d?E=t[28]:(E=d?{viewerRef:d}:{},t[27]=d,t[28]=E);let D;t[29]===f?D=t[30]:(D=f?{className:f}:{},t[29]=f,t[30]=D);let O;t[31]===m?O=t[32]:(O=m?{unsafeCSSExtra:m}:{},t[31]=m,t[32]=O);let k;t[33]===h?k=t[34]:(k=h?{renderHeaderMetadata:e=>e.type===`diff`?h(e.fileDiff):null}:{},t[33]=h,t[34]=k);let A;t[35]===p?A=t[36]:(A=p?{renderCodeViewFooter:p}:{},t[35]=p,t[36]=A);let j;t[37]===v?j=t[38]:(j=e=>v(e.id),t[37]=v,t[38]=j);let M=!pe,me=!pe,N;t[39]!==fe||t[40]!==u||t[41]!==M||t[42]!==me?(N={...u,enableGutterUtility:M,enableLineSelection:me,onGutterUtilityClick:fe},t[39]=fe,t[40]=u,t[41]=M,t[42]=me,t[43]=N):N=t[43];let P;t[44]===g?P=t[45]:(P=e=>e.type===`diff`?g(e.fileDiff):null,t[44]=g,t[45]=P);let F;t[46]===_?F=t[47]:(F=e=>e.type===`diff`?_(e.fileDiff,e.id,e.collapsed===!0):null,t[46]=_,t[47]=F);let I;t[48]!==ae||t[49]!==ue||t[50]!==w?(I=e=>{let t=e.metadata.entries.some(Tt);return(0,J.jsx)(`div`,{className:t?`py-1`:`divide-y divide-border/30 border-y border-border/30`,children:e.metadata.entries.map(e=>(0,J.jsx)(Qe,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.kind===`draft`?ae:e.text,onTextChange:S,onCancel:()=>ue(e.id),onComment:t=>w(e.id,t),onDelete:()=>ue(e.id)},e.id))})},t[48]=ae,t[49]=ue,t[50]=w,t[51]=I):I=t[51];let L;return t[52]!==n||t[53]!==ce||t[54]!==ne||t[55]!==k||t[56]!==A||t[57]!==j||t[58]!==N||t[59]!==P||t[60]!==F||t[61]!==I||t[62]!==E||t[63]!==D||t[64]!==O?(L=(0,J.jsx)(U,{...E,...D,...O,...k,...A,items:ce,selectedLines:ne,onSelectedLinesChange:re,onRevealSearchMatch:j,options:N,renderHeaderFilenameSuffix:P,renderHeaderPrefix:F,renderAnnotation:I},n),t[52]=n,t[53]=ce,t[54]=ne,t[55]=k,t[56]=A,t[57]=j,t[58]=N,t[59]=P,t[60]=F,t[61]=I,t[62]=E,t[63]=D,t[64]=O,t[65]=L):L=t[65],L}function Tt(e){return e.kind===`draft`}function Et(e){return e.metadata.entries.map(Dt)}function Dt(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function Ot(e){return[e.fileKey,e]}function X(e){return e.removeReviewComment}function kt(e){return e.addReviewComment}function At(e){let t=m(4),n=P();return{diffPreview:k(e,{label:`environment-data:review:diff-preview`,tag:d.reviewGetDiffPreview,staleTimeMs:5e3}),diffFilePatch:N(e,{label:`environment-data:review:diff-file-patch`,staleTimeMs:3e5,execute:e=>M(d.reviewGetDiffPreview,e.request).pipe(t.withPermit,h(t=>{let n=t.sources.find(t=>t.kind===e.request.file.sourceKind);return n?D(n):a(new b({operation:`review.diffFilePatch`,kind:`git`,detail:`Diff no longer available. Refresh the comparison.`}))}))}),diffFileContents:O(e,{label:`environment-data:review:diff-file-contents`,tag:d.reviewGetDiffFileContents,scheduler:n,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.sourceKind,t.baseRef,t.headRef,t.oldPath,t.newPath,t.changeType])}})}}var jt=At(ge);function Mt(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function Nt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&Mt(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function Pt(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var Ft=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function It(e){let t=(0,q.c)(86),{environmentId:n,cwd:i,source:a,baseRef:o,ignoreWhitespace:s,theme:c,revision:l,preview:u}=e,d=(0,K.useContext)(y),f;t[0]!==o||t[1]!==i||t[2]!==n||t[3]!==s||t[4]!==a?.diffHash||t[5]!==a?.kind?(f=JSON.stringify([n,i,a?.kind,a?.diffHash,o,s]),t[0]=o,t[1]=i,t[2]=n,t[3]=s,t[4]=a?.diffHash,t[5]=a?.kind,t[6]=f):f=t[6];let p=f,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=[0,1,2,3],t[7]=m):m=t[7];let h;t[8]===p?h=t[9]:(h={scope:p,indices:m},t[8]=p,t[9]=h);let[g,_]=(0,K.useState)(h),v;t[10]!==g.indices||t[11]!==g.scope||t[12]!==p?(v=g.scope===p?g.indices:[0,1,2,3],t[10]=g.indices,t[11]=g.scope,t[12]=p,t[13]=v):v=t[13];let ee=v,b;t[14]===a?.files?b=t[15]:(b=()=>a?.files?.toSorted(Q)??[],t[14]=a?.files,t[15]=b),a?.files;let ne;t[16]===b?ne=t[17]:(ne=b(),t[16]=b,t[17]=ne);let x=ne,ae;t[18]!==o||t[19]!==i||t[20]!==n||t[21]!==x||t[22]!==s||t[23]!==ee||t[24]!==p||t[25]!==a?(ae=!n||!i||!a?[]:ee.filter(e=>e<x.length).map(e=>{let t=x[e];return{index:e,query:jt.diffFilePatch({environmentId:n,input:{cacheKey:p,request:{cwd:i,...o?{baseRef:o}:{},ignoreWhitespace:s,file:{path:t.path,previousPath:t.previousPath,sourceKind:a.kind}}}})}}),t[18]=o,t[19]=i,t[20]=n,t[21]=x,t[22]=s,t[23]=ee,t[24]=p,t[25]=a,t[26]=ae):ae=t[26];let S=ae,C;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[27]=C):C=t[27];let oe;t[28]!==l||t[29]!==p?(oe={scope:p,revision:l,queries:C},t[28]=l,t[29]=p,t[30]=oe):oe=t[30];let se=(0,K.useRef)(oe),ce,le;t[31]!==S||t[32]!==d||t[33]!==l||t[34]!==p?(ce=()=>{let e=se.current;se.current={scope:p,revision:l,queries:S};for(let{query:t}of S){let n=e.scope===p&&e.revision!==l,r=!e.queries.some(e=>e.query===t)&&d.get(t)._tag!==`Initial`&&!d.get(t).waiting;(n||r)&&d.refresh(t)}},le=[p,l,S,d],t[31]=S,t[32]=d,t[33]=l,t[34]=p,t[35]=ce,t[36]=le):(ce=t[35],le=t[36]),(0,K.useEffect)(ce,le);let ue;t[37]===c?ue=t[38]:(ue=re(e=>fe(e,e=>ie(e,e=>{let t=He(e.diff,`diff-panel:${c}`,{compactPartialHunkOffsets:!0});if(t?.kind===`files`&&t.files.length===1&&e.files?.length===1){let n=e.files[0],r={...t.files[0],name:n.path};n.previousPath===null?delete r.prevName:r.prevName=n.previousPath,t={...t,files:[r]}}return{source:e,patch:t}}))),t[37]=c,t[38]=ue);let de=ue,w;t[39]!==de||t[40]!==S?(w=r(e=>new Map(S.map(t=>{let{index:n,query:r}=t;return[n,e(de(r))]}))),t[39]=de,t[40]=S,t[41]=w):w=t[41];let T=te(w),pe;t[42]===T?pe=t[43]:(pe=(e,t)=>{let n=T.get(t);return!n||n._tag===`Initial`},t[42]=T,t[43]=pe);let E=x.findIndex(pe),D=a?E<0?x.length:E:u?.kind===`files`?u.files.length:0,O;t[44]===p?O=t[45]:(O=e=>_(t=>{let n=t.scope===p?t.indices:[0,1,2,3],r=e.filter(e=>!n.includes(e));return r.length===0?t:{scope:p,indices:[...n,...r]}}),t[44]=p,t[45]=O);let k=O,A;t[46]!==k||t[47]!==D?(A=()=>k(Array.from({length:4},(e,t)=>D+t)),t[46]=k,t[47]=D,t[48]=A):A=t[48];let j=A,M;t[49]===k?M=t[50]:(M=e=>k([e]),t[49]=k,t[50]=M);let me=M,N;t[51]!==x||t[52]!==S?(N={queries:S,files:x},t[51]=x,t[52]=S,t[53]=N):N=t[53];let P=(0,K.useRef)(N),F,I;t[54]!==x||t[55]!==S?(F=()=>{P.current={queries:S,files:x}},I=[S,x],t[54]=x,t[55]=S,t[56]=F,t[57]=I):(F=t[56],I=t[57]),(0,K.useLayoutEffect)(F,I);let L;t[58]===d?L=t[59]:(L=e=>{let{queries:t,files:n}=P.current,r=t.find(t=>{let{index:r}=t;return n[r]?.path===e})?.query;r&&d.refresh(r)},t[58]=d,t[59]=L);let he=L,ge;t[60]!==x||t[61]!==T||t[62]!==u||t[63]!==p||t[64]!==a?(ge=a?x.map((e,t)=>{let n=T.get(t);if(n?._tag===`Success`&&n.value.patch?.kind===`files`){let t=n.value.patch.files.find(t=>H(t)===e.path);if(t)return t}return{name:e.path,...e.previousPath?{prevName:e.previousPath}:{},type:e.previousPath?`rename-changed`:`change`,hunks:[],additionLines:[],deletionLines:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,cacheKey:`${p}:${e.path}:pending`}}):(u?.kind===`files`?u.files:[]).toSorted(Rt),t[60]=x,t[61]=T,t[62]=u,t[63]=p,t[64]=a,t[65]=ge):ge=t[65];let _e=ge,ve;if(t[66]!==x||t[67]!==T){let e;t[69]===T?e=t[70]:(e=(e,t)=>{let n=T.get(t);return[e.path,{error:n?._tag===`Failure`||n?._tag===`Success`&&(n.value.patch?.kind!==`files`||!n.value.patch.files.some(t=>H(t)===e.path)),truncated:n?._tag===`Success`&&n.value.source.truncated}]},t[69]=T,t[70]=e),ve=new Map(x.map(e)),t[66]=x,t[67]=T,t[68]=ve}else ve=t[68];let ye=ve,R;if(t[71]!==x||t[72]!==T){let e;t[74]===T?e=t[75]:(e=(e,t)=>{let n=T.get(t);return n&&n._tag!==`Initial`},t[74]=T,t[75]=e),R=new Set(x.filter(e).map(Lt)),t[71]=x,t[72]=T,t[73]=R}else R=t[73];let be=R,xe=[...T.values()].some(Z),Se;return t[76]!==ye||t[77]!==j||t[78]!==be||t[79]!==_e||t[80]!==me||t[81]!==he||t[82]!==p||t[83]!==D||t[84]!==xe?(Se={scope:p,fileStates:ye,isPending:xe,retry:he,requestFile:me,readyFilePaths:be,renderableFiles:_e,settledFileCount:D,loadNextFiles:j},t[76]=ye,t[77]=j,t[78]=be,t[79]=_e,t[80]=me,t[81]=he,t[82]=p,t[83]=D,t[84]=xe,t[85]=Se):Se=t[85],Se}function Z(e){return e._tag===`Initial`||e.waiting}function Lt(e){return e.path}function Rt(e,t){return Ft.compare(H(e),H(t))}function Q(e,t){return Ft.compare(e.path,t.path)}function zt(e){let t=(0,q.c)(5),{load:n,count:r}=e,i=(0,K.useRef)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{if(!i.current)return;let e=new IntersectionObserver(e=>{e.some(Vt)&&n()},{rootMargin:`600px`});return e.observe(i.current),()=>e.disconnect()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,K.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=(0,J.jsx)(`div`,{ref:i,role:`status`,"aria-label":`Loading diff…`,children:Array.from({length:Math.min(r,4)},Bt)}),t[3]=r,t[4]=s),s}function Bt(e,t){return(0,J.jsx)(`div`,{"aria-hidden":!0,className:`border-b border-border/40`,children:(0,J.jsx)(Je,{titleWidth:`medium`})},t)}function Vt(e){return e.isIntersecting}function Ht(e){let t=(0,q.c)(16),{error:n,truncated:r,retry:i}=e;if(!n&&!r)return null;let a=n?`Retry loading diff`:`Partial diff preview`,o;t[0]!==n||t[1]!==i?(o=e=>{e.stopPropagation(),n&&i()},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,J.jsx)(w,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":a,onClick:o}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=n?(0,J.jsx)(ee,{className:`size-3`}):(0,J.jsx)(f,{className:`size-3`}),t[6]=n,t[7]=c);let l;t[8]!==s||t[9]!==c?(l=(0,J.jsx)(R,{render:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u=n?`Retry loading diff`:`This file is too large to show in full. Counts include all changes.`,d;t[11]===u?d=t[12]:(d=(0,J.jsx)(z,{children:u}),t[11]=u,t[12]=d);let p;return t[13]!==l||t[14]!==d?(p=(0,J.jsxs)(B,{children:[l,d]}),t[13]=l,t[14]=d,t[15]=p):p=t[15],p}var Ut=`__automatic_base_ref__`,Wt=`t3code.diffFileTreeOpen`,Gt=new WeakMap;function Kt(e){let t=Gt.get(e);if(t)return t;let n={fileDiff:e,fileKey:Ke(e),fileVersion:We(e)};return Gt.set(e,n),n}var qt=new Set;function Jt(e){let t=(0,q.c)(21),{filePath:n,fileKey:r,collapsed:i,unavailable:a,iconClassName:o,onToggle:s}=e,c=i?`Expand ${n}`:`Collapse ${n}`,l=!i,u;t[0]!==r||t[1]!==s?(u=e=>{e.stopPropagation(),s(r)},t[0]=r,t[1]=s,t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==l||t[5]!==u||t[6]!==a?(d=(0,J.jsx)(w,{size:`icon-micro`,variant:`ghost`,className:`-ms-0.5`,"aria-label":c,"aria-expanded":l,disabled:a,onClick:u}),t[3]=c,t[4]=l,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=T(`size-4`,o),t[8]=o,t[9]=f);let p=i?xe:V,m;t[10]!==f||t[11]!==p?(m=(0,J.jsx)(be,{className:f,icon:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,J.jsx)(R,{render:d,children:m}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let g=i?`Expand diff`:`Collapse diff`,_;t[16]===g?_=t[17]:(_=(0,J.jsx)(z,{side:`top`,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==h?(v=(0,J.jsxs)(B,{children:[h,_]}),t[18]=_,t[19]=h,t[20]=v):v=t[20],v}function Yt(e){let t=(0,q.c)(11),{filePath:n,hasStat:r,error:i,truncated:a,onRetry:o}=e,s;t[0]===n?s=t[1]:(s=(0,J.jsx)(xt,{filePath:n}),t[0]=n,t[1]=s);let c;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a?(c=r?(0,J.jsx)(Ht,{error:i,truncated:a,retry:()=>o(n)}):null,t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsxs)(J.Fragment,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Xt({mode:e=`inline`,composerDraftTarget:t,workspaceMutationId:r}){let{resolvedTheme:i}=Ie(),a=Le(),o=a.diffLayout,l=Re(),[d,f]=(0,K.useState)(a.wordWrap),[p,m]=(0,K.useState)(a.diffIgnoreWhitespace),[h,ee]=s(Wt,!1,E),[y,b]=(0,K.useState)(``),[re,ie]=(0,K.useState)(()=>({scopeKey:null,fileKeys:qt})),[ce,fe]=(0,K.useState)(0),[D,O]=(0,K.useState)(null),k=_e({strict:!1,select:e=>ve(e)}),M=k?.threadId??null,N=L(k),P=I(k)?.projection??null,ge=F(N?.environmentId??null),{canReadFiles:ye}=ge,xe=N?.projectId??null,Se=he(N&&xe?{environmentId:N.environmentId,projectId:xe}:null),V=N?.worktreePath??Se?.workspaceRoot,Te=N?.worktreePath?void 0:Se?.repositoryIdentity?.rootPath,ze=te(je.configValueAtom(N?.environmentId??null)),Ve=Pe(N?.environmentId??null),We=ft(N?.environmentId??null,ze?.availableEditors??[]),Ke=Ne(jt.diffFileContents),Je=Me(N!=null&&V!=null?Be.status({environmentId:N.environmentId,input:{cwd:V}}):null),U=_t(e=>mt(e.byThreadKey,k)),Qe=Je.data?.isRepo??!0,{turnDiffSummaries:et,inferredCheckpointTurnCountByRunId:ht}=vt(P),W=(0,K.useMemo)(()=>[...et].toSorted((e,t)=>{let n=e.checkpointTurnCount??ht[e.runId]??0,r=t.checkpointTurnCount??ht[t.runId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[ht,et]);(0,K.useEffect)(()=>{k&&U.kind===`turn`&&_t.getState().reconcileTurnSelection(k,W.map(e=>e.runId))},[U,W,k]);let G=U.kind===`turn`?U.turnId:null,q=U.kind===`unstaged`?`unstaged`:`branch`,xt=U.kind===`branch`?U.baseRef:null,St=U.kind===`turn`?U.filePath:null,Ct=U.kind===`turn`?U.revealRequestId:0,Y=G===null?void 0:W.find(e=>e.runId===G)??W[0],Tt=Y&&(Y.checkpointTurnCount??ht[Y.runId]),Et=W[0],Dt=G===null?q===`unstaged`?`Uncommitted`:`Changes`:Y?.runId===Et?.runId?`Latest turn`:`Turn ${Tt??`?`}`,Ot=Y?`turn:${Y.runId}`:q,X=k?`${k.environmentId}:${k.threadId}:${Ot}`:null,kt=`${X??Ot}:${ce}`,At=Y?`Turn ${Tt??`?`}`:q===`unstaged`?`Uncommitted`:`Changes`,Mt=(0,K.useMemo)(()=>typeof Tt==`number`?{fromTurnCount:Math.max(0,Tt-1),toTurnCount:Tt}:null,[Tt]),Ft=bt({environmentId:N?.environmentId??null,threadId:M,fromTurnCount:Mt?.fromTurnCount??null,toTurnCount:Mt?.toTurnCount??null,ignoreWhitespace:p,cacheScope:Y?`turn:${Y.runId}`:null},{enabled:Qe&&Y!==void 0}),Z=Me(ye&&G===null&&N&&V?jt.diffPreview({environmentId:N.environmentId,input:{cwd:V,...xt?{baseRef:xt}:{},ignoreWhitespace:p}}):null),Lt=Qe&&G===null&&N!=null&&V!=null,Rt=k?`${k.environmentId}:${k.threadId}`:null,Q=Z.data?.sources.find(e=>e.kind===(q===`unstaged`?`working-tree`:`branch-range`)),Bt=Z.refresh,Vt=Bt,Ht=(0,K.useMemo)(()=>{let e=Z.data;if(G===null&&N&&e&&Q&&ye)return Ze(Ke,{environmentId:N.environmentId,cwd:e.cwd,sourceKind:Q.kind,baseRef:Q.baseRef,headRef:Q.headRef,cacheKey:Q.diffHash})},[N,Z.data,Ke,ye,Q,G]),Gt=(0,K.useRef)(Ht);Gt.current=Ht;let Xt=(0,K.useCallback)(async e=>{let t=Gt.current;if(!t)throw Error(`Diff file contents are unavailable for this selection.`);return t(e)},[]),Zt=Me(G===null&&q===`branch`&&N&&Z.data?.cwd?Be.listRefs({environmentId:N.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`local`,...y.trim().length>0?{query:y.trim()}:{},limit:100}}):null),Qt=Me(G===null&&q===`branch`&&N&&Z.data?.cwd?Be.listRefs({environmentId:N.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`remote`,...y.trim().length>0?{query:y.trim()}:{},limit:100}}):null),$t=Nt(Zt.data?.refs.filter(e=>e.name!==Q?.headRef)??[],Qt.data?.refs??[]),en=Pt($t,y),tn=e=>xt&&xt===e.remote?.name?xt:e.local?.name??e.remote?.name??e.id,nn=[Ut,...$t.map(tn)],rn=[...y.trim().length===0?[Ut]:[],...en.map(tn)],an=Q?.diff,on=Y?Ft.data?.diff:an,sn=!Y&&Q?.truncated===!0,cn=Y?Ft.isPending:Z.isPending,ln=Y?Ft.error:Z.error,un=typeof on==`string`&&on.trim().length===0,$=!Y&&Q?.truncated&&Q.files?Q:null,dn=(0,K.useMemo)(()=>$?null:He(on,`diff-panel:${i}`,{compactPartialHunkOffsets:G===null}),[$,i,on,G]),fn=(0,K.useMemo)(()=>new Map($?.files?.map(e=>[e.path,e])),[$?.files]),{scope:pn,isPending:mn,fileStates:hn,retry:gn,requestFile:_n,readyFilePaths:vn,renderableFiles:yn,settledFileCount:bn,loadNextFiles:xn}=It({environmentId:N?.environmentId,cwd:Z.data?.cwd,source:$,baseRef:$?.baseRef??xt,ignoreWhitespace:p,theme:i,revision:Z.data?v(Z.data.generatedAt):void 0,preview:dn}),Sn=Bt;(0,K.useEffect)(()=>{if(!Lt)return;let e=()=>Sn();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Lt,Sn]),gt({enabled:Lt,mutationId:r,refresh:Sn,resourceKey:`diff:${Rt??``}`});let Cn=Z.isPending||mn,wn=(0,K.useMemo)(()=>yn.map(Kt),[yn]),Tn=(0,K.useMemo)(()=>a.diffFilesCollapsed?new Set(wn.map(e=>e.fileKey)):qt,[wn,a.diffFilesCollapsed]),En=re.scopeKey===X?re.fileKeys:Tn,Dn=(0,K.useCallback)(()=>bn<yn.length?(0,J.jsx)(zt,{load:xn,count:yn.length-bn}):null,[bn,yn.length,xn]),On=(0,K.useMemo)(()=>wn.filter(({fileDiff:e})=>!$||vn.has(H(e))).map(({fileDiff:e,fileKey:t,fileVersion:n})=>({fileDiff:e,filePath:H(e),fileKey:t,fileVersion:n,collapsed:En.has(t)||e.cacheKey?.endsWith(`:pending`)===!0})),[En,wn,$,vn]),kn=(0,K.useMemo)(()=>wn.map(e=>e.fileKey),[wn]),An=ke(kn,En),jn=(0,K.useMemo)(()=>!Y&&Q?.files?Q.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}):qe(yn),[yn,Q,Y]),Mn=(0,K.useMemo)(()=>Oe(yn),[yn]),Nn=St?On.find(e=>e.filePath===St)?.fileKey??null:null;(0,K.useEffect)(()=>{Nn&&D?.getInstance()&&D.scrollTo({type:`item`,id:Nn,align:`start`})},[D,kt,Nn,Ct]);let Pn=(0,K.useMemo)(()=>({collapseScopeKey:X,diffSelection:U}),[X,U]),Fn=Ee(D,Pn,On.map(e=>e.fileKey)),In=(0,K.useCallback)(e=>{let t=wn.findIndex(t=>H(t.fileDiff)===e),n=wn[t];n&&(ie(e=>{let t=new Set(e.scopeKey===X?e.fileKeys:Tn);return t.delete(n.fileKey),{scopeKey:X,fileKeys:t}}),$&&t>=bn&&_n(t),Fn(n.fileKey))},[wn,X,Tn,Fn,$,bn,_n]),Ln=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!$||!St)return;let e=`${St}:${Ct}`;(Ln.current?.cache!==pn||Ln.current.key!==e)&&(Ln.current={cache:pn,key:e},In(St))},[$,St,Ct,pn,In]);let Rn=(0,K.useCallback)(e=>{Fe({threadRef:k,filePath:e,activeCwd:V,repositoryRoot:Te,openInEditor:e=>{(async()=>{let t=await We(e);t._tag===`Failure`&&!A(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...k?{environmentId:k.environmentId,threadId:k.threadId}:{},...me(j(t))})})()}})},[V,Te,We,k]),zn=(0,K.useRef)({collapseScopeKey:X,defaultCollapsedDiffFileKeys:Tn});(0,K.useLayoutEffect)(()=>{zn.current={collapseScopeKey:X,defaultCollapsedDiffFileKeys:Tn}},[X,Tn]);let Bn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=zn.current;ie(r=>{let i=new Set(r.scopeKey===t?r.fileKeys:n);return i.has(e)?i.delete(e):i.add(e),{scopeKey:t,fileKeys:i}})},[]),Vn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=zn.current;ie(r=>{let i=r.scopeKey===t?r.fileKeys:n;if(!i.has(e))return r;let a=new Set(i);return a.delete(e),{scopeKey:t,fileKeys:a}})},[]),Hn=(0,K.useCallback)(()=>{fe(e=>e+1),ie(e=>{let t=e.scopeKey===X?e.fileKeys:Tn;return{scopeKey:X,fileKeys:De(kn,t)}})},[X,Tn,kn]),Un=e=>{k&&_t.getState().selectTurn(k,e)},Wn=e=>{k&&_t.getState().selectGitScope(k,e)},Gn=e=>{k&&_t.getState().selectBranchBaseRef(k,e)},Kn=Y?`turn:${Y.runId}`:``,qn=G===null?q:Y?.runId===Et?.runId?`latest`:Kn,Jn=e=>{if(e===`unstaged`||e===`branch`)Wn(e);else if(e===`latest`)Et&&Un(Et.runId);else{let t=W.find(t=>`turn:${t.runId}`===e);t&&Un(t.runId)}},Yn=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,J.jsxs)(c,{children:[(0,J.jsxs)(le,{render:(0,J.jsx)(w,{size:`xs`,variant:`secondary`}),className:`max-w-full`,"aria-label":`Diff scope: ${Dt}`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:Dt}),(0,J.jsx)(S,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(ne,{align:`start`,children:[(0,J.jsxs)(g,{value:qn,onValueChange:Jn,children:[(0,J.jsx)(n,{value:`branch`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Changes`})}),(0,J.jsx)(n,{value:`unstaged`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Uncommitted`})}),(0,J.jsx)(n,{value:`latest`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Latest turn`})})]}),(0,J.jsxs)(de,{children:[(0,J.jsx)(x,{children:`Turn`}),(0,J.jsx)(oe,{children:(0,J.jsx)(g,{value:Kn,onValueChange:Jn,children:W.map(e=>{let t=e.checkpointTurnCount??ht[e.runId]??`?`;return(0,J.jsx)(n,{value:`turn:${e.runId}`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{children:[`Turn `,t]}),(0,J.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:$e(e.completedAt,a.timestampFormat)})]})},e.runId)})})})]})]})]}),G===null&&q===`branch`&&Q?.baseRef&&(0,J.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,"aria-label":`Comparing ${Q.headRef??`HEAD`} against ${Q.baseRef}`,children:[(0,J.jsxs)(B,{children:[(0,J.jsxs)(R,{render:(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`}),children:[(0,J.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Q.headRef??`HEAD`}),(0,J.jsx)(ue,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsx)(z,{side:`top`,children:`${Q.headRef??`HEAD`} → ${Q.baseRef}`})]}),(0,J.jsxs)(lt,{items:nn,filteredItems:rn,value:xt??Ut,onOpenChange:e=>{e||b(``)},onValueChange:e=>{e&&Gn(e===Ut?null:e)},children:[(0,J.jsxs)(it,{render:(0,J.jsx)(w,{variant:`ghost-muted`,size:`xs`}),className:`min-w-0 max-w-48`,"aria-label":`Change comparison target. Currently ${Q.baseRef}`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:Q.baseRef}),(0,J.jsx)(S,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(ot,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden`,children:[(0,J.jsx)(ct,{placeholder:`Search refs...`,value:y,onChange:e=>b(e.target.value)}),(0,J.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-3xs text-muted-foreground uppercase tracking-wide`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,J.jsx)(`span`,{children:`Branch`}),(0,J.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,J.jsx)(at,{children:`No matching refs.`}),(0,J.jsxs)(rt,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,J.jsx)(st,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:Ut,children:(0,J.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),$t.map(e=>{let t=tn(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,J.jsx)(st,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:t,children:(0,J.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,J.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,J.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,J.jsx)(ut,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Gn(n)}})}):e.remote?(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,children:(0,J.jsx)(C,{role:`img`,"aria-label":`Remote only`,className:`size-3`})})}),(0,J.jsx)(z,{side:`top`,children:`Remote only`})]}):null]})},e.id)})]})]})]})]})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[On.length>0||!Y&&Q?.files?.length?(0,J.jsx)(yt,{additions:jn.additions,deletions:jn.deletions,className:`mr-1 text-2xs`,layout:`inline`}):null,Lt&&(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Cn?`Refreshing diff`:`Refresh diff`,onClick:Vt}),children:(0,J.jsx)(pt,{size:`sm`,refreshing:Cn})}),(0,J.jsx)(z,{side:`top`,children:Cn?`Refreshing diff…`:`Refresh diff`})]}),kn.length>0&&(0,J.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":An?`Expand all files`:`Collapse all files`,onClick:Hn,children:(0,J.jsx)(be,{className:`size-3.5`,icon:An?Ce:we})}),(0,J.jsxs)(tt,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[o],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&l({diffLayout:t})},children:[(0,J.jsx)(nt,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,J.jsx)(u,{className:`size-3.5`})}),(0,J.jsx)(nt,{"aria-label":`Split diff view`,value:`split`,children:(0,J.jsx)(_,{className:`size-3.5`})})]}),(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(nt,{"aria-label":d?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:d,onPressedChange:e=>{f(!!e)}}),children:(0,J.jsx)(pe,{className:`size-3.5`})}),(0,J.jsx)(z,{side:`top`,children:d?`Disable line wrapping`:`Enable line wrapping`})]}),(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(nt,{"aria-label":p?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:p,onPressedChange:e=>{m(!!e)}}),children:(0,J.jsx)(se,{className:`size-3.5`})}),(0,J.jsx)(z,{side:`top`,children:p?`Show whitespace changes`:`Hide whitespace changes`})]}),kn.length>0&&(0,J.jsxs)(B,{children:[(0,J.jsx)(R,{render:(0,J.jsx)(nt,{"aria-label":h?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:h,onPressedChange:e=>ee(!!e)}),children:(0,J.jsx)(ae,{className:`size-3.5`})}),(0,J.jsx)(z,{side:`top`,children:h?`Hide file tree`:`Show file tree`})]})]})]});return(0,J.jsx)(Xe,{mode:e,header:Yn,children:N?Qe?G!==null&&W.length===0?(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):G===null&&!ye?ge.isPending?(0,J.jsx)(Ye,{label:`Checking file access...`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:ge.error??`This connection cannot read local diffs.`}):(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[sn&&!$&&(0,J.jsxs)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-2xs text-muted-foreground`,children:[`This preview exceeds the size limit. Changes shown are incomplete.`,Q?.files?` Totals include all changes.`:``]}),ln&&!dn&&(0,J.jsx)(`div`,{className:`px-3`,children:(0,J.jsx)(`p`,{className:`mb-2 text-2xs text-error/80`,children:ln})}),!dn&&!$?cn?(0,J.jsx)(Ye,{label:Y?`Loading checkpoint diff...`:q===`unstaged`?`Loading uncommitted changes...`:`Loading changes...`}):(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,J.jsx)(`p`,{children:un?`No net changes in this selection.`:`No patch available for this selection.`})}):$||dn?.kind===`files`?(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement&&(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent;if(n){Rn(n);return}let r=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-diffs-header`))?.querySelector(`[data-title]`)?.textContent;if(!r)return;let i=On.find(e=>e.filePath===r);i&&Bn(i.fileKey)},onContextMenuCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&(e.preventDefault(),Ve({environmentId:N?.environmentId??null,filePath:t,workspaceRoot:V,repositoryRoot:Te},e))},children:(0,J.jsx)(wt,{viewerRef:O,codeViewKey:`${kt}:${$?pn:`preview`}`,className:`h-full min-h-0 overflow-auto`,files:On,renderCodeViewFooter:Dn,sectionId:Ot,sectionTitle:At,composerDraftTarget:t,renderHeaderFilenameSuffix:e=>{let t=H(e),n=hn.get(t);return(0,J.jsx)(Yt,{filePath:t,hasStat:fn.has(t),error:n?.error??!1,truncated:n?.truncated??!1,onRetry:gn})},...$?{unsafeCSSExtra:`[data-additions-count], [data-deletions-count] { display: none; }`,renderHeaderMetadata:e=>{let t=fn.get(H(e));return t?(0,J.jsx)(yt,{additions:t.additions,deletions:t.deletions}):null}}:{},onRevealSearchMatch:Vn,renderHeaderPrefix:(e,t)=>{let n=e.cacheKey?.endsWith(`:pending`)===!0;return(0,J.jsx)(Jt,{filePath:H(e),fileKey:t,collapsed:n||En.has(t),unavailable:n,iconClassName:Ge(e),onToggle:Bn})},options:{diffStyle:o===`split`?`split`:`unified`,lineDiffType:`none`,overflow:d?`wrap`:`scroll`,theme:Ue(i),preferredHighlighter:dt,themeType:i,stickyHeaders:!0,...Ht?{loadDiffFiles:Xt}:{}}},X??Ot)}),h?(0,J.jsx)(`aside`,{className:`flex w-[min(16rem,40%)] min-w-40 shrink-0 border-l border-border/60`,children:(0,J.jsx)(Ae,{ariaLabel:`${At} files`,entries:Mn,selectedPath:St,revealRequestId:Ct,onSelectFile:In})}):null]}):(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-2xs text-muted-foreground/75`,children:dn?.kind===`raw`?dn.reason:null}),(0,J.jsx)(`pre`,{className:T(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-2xs leading-relaxed text-muted-foreground/90`,d?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:dn?.kind===`raw`?dn.text:null})]})})]})}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{Xt as default};
2
+ //# sourceMappingURL=DiffPanel-DxnHaLb1.js.map