@p4code/cli 0.9.21 → 0.9.22

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 (194) hide show
  1. package/dist/{TraceDiagnostics-DEAfnZGb.mjs → TraceDiagnostics-DE0N1Yf6.mjs} +2 -2
  2. package/dist/bin.mjs +1 -1
  3. package/dist/{binCli-IfUU-uWs.mjs → binCli-DC5fHnhS.mjs} +5 -5
  4. package/dist/client/.vite/manifest.json +1101 -1101
  5. package/dist/client/assets/{2NI2N5EU-qP3PpVDC.js → 2NI2N5EU-CgpeJ5KT.js} +2 -2
  6. package/dist/client/assets/{4UO7MD6I-Da5jHHfF.js → 4UO7MD6I-BZfVOqtM.js} +2 -2
  7. package/dist/client/assets/{5B3SVYGG-BGHUtemY.js → 5B3SVYGG-B5V3_tzl.js} +2 -2
  8. package/dist/client/assets/{5GK6JWQ2-DwbHk3MV.js → 5GK6JWQ2-DRzSVTZ0.js} +2 -2
  9. package/dist/client/assets/{5N7A7DKN-B-2quXAp.js → 5N7A7DKN-BX-IFKkJ.js} +2 -2
  10. package/dist/client/assets/{5OC2THR4-DSQWJ0ZQ.js → 5OC2THR4-CGiKcStE.js} +2 -2
  11. package/dist/client/assets/{5S6HY5KT-CAwEcA6I.js → 5S6HY5KT-B5Smgpiz.js} +2 -2
  12. package/dist/client/assets/{6IMQ5BUJ-BABYtiev.js → 6IMQ5BUJ-BSWEueVD.js} +2 -2
  13. package/dist/client/assets/{6OLKWJ4F-CwQRt55E.js → 6OLKWJ4F-0nUReGo5.js} +2 -2
  14. package/dist/client/assets/{74OO7NKP-DZoL_aBI.js → 74OO7NKP-BZ5SCLUX.js} +2 -2
  15. package/dist/client/assets/{75O6YZUN-CoqdPLhF.js → 75O6YZUN-NifBwMlS.js} +2 -2
  16. package/dist/client/assets/{77XECAW3-DM5Itfvk.js → 77XECAW3-_XJOQitm.js} +2 -2
  17. package/dist/client/assets/{ABYRPUBD-C2IaQicJ.js → ABYRPUBD-B5mFmY4q.js} +2 -2
  18. package/dist/client/assets/{AuthSurfaceShell-Dfcdz_aG.js → AuthSurfaceShell-DesOxtee.js} +2 -2
  19. package/dist/client/assets/{BB2UYUI2-DQkTEBDf.js → BB2UYUI2-CxFyfwSJ.js} +2 -2
  20. package/dist/client/assets/{BUM34MOA-DuY83HEN.js → BUM34MOA-Kk83QSsb.js} +2 -2
  21. package/dist/client/assets/{CEQABKGZ-CNAynrzB.js → CEQABKGZ-DLcBenqs.js} +2 -2
  22. package/dist/client/assets/{CXAC5362-B_mhvA6r.js → CXAC5362-BcvLk6NG.js} +2 -2
  23. package/dist/client/assets/{ChatGptUsageButton-DT3CRIhB.js → ChatGptUsageButton-C9D5JFWr.js} +2 -2
  24. package/dist/client/assets/{ChatMarkdown-_SLyl8Hk.js → ChatMarkdown-Ck4FJs_Q.js} +5 -5
  25. package/dist/client/assets/{CodexSetupSection.logic-CqdvWoE6.js → CodexSetupSection.logic-DzEO1qoo.js} +2 -2
  26. package/dist/client/assets/{CommandBlock-DnTIHX5l.js → CommandBlock-C15Q987N.js} +2 -2
  27. package/dist/client/assets/{ConnectAgentSurface-D-Z7Gl3G.js → ConnectAgentSurface-6FVydN17.js} +2 -2
  28. package/dist/client/assets/{DRLTVNUE-Bp-Mh_TD.js → DRLTVNUE-CkNId4Pz.js} +2 -2
  29. package/dist/client/assets/{DYY6UVD2-Dwh9ZkXt.js → DYY6UVD2-B4516qT_.js} +2 -2
  30. package/dist/client/assets/{DevicePanel-MMC7u5qJ.js → DevicePanel-B3CR7kGX.js} +2 -2
  31. package/dist/client/assets/{DeviceSetup-BCrBVLkf.js → DeviceSetup-Lxy9dmqi.js} +2 -2
  32. package/dist/client/assets/{DiffCommentAnnotation-D7iLWjnP.js → DiffCommentAnnotation-CSzNea6G.js} +2 -2
  33. package/dist/client/assets/{DiffFileTree-PCGZGqlB.js → DiffFileTree-CDnFut1y.js} +2 -2
  34. package/dist/client/assets/{DiffPanel-OOedo4tu.js → DiffPanel-KfudIZct.js} +2 -2
  35. package/dist/client/assets/{DiffWorkerPoolProvider-CmorWW2H.js → DiffWorkerPoolProvider-zgaFe3TY.js} +2 -2
  36. package/dist/client/assets/{EmbeddedDesign-CeUGLwuZ.js → EmbeddedDesign-BI3VZqZl.js} +4 -4
  37. package/dist/client/assets/{FNOVOB4O-BJscBtWY.js → FNOVOB4O-Uc8FDPv8.js} +2 -2
  38. package/dist/client/assets/{FileDiff-BMtpmo0v.js → FileDiff-B4Yf4fFg.js} +2 -2
  39. package/dist/client/assets/{FilePreviewPanel-DUqI7pF3.js → FilePreviewPanel-u1jxtxzb.js} +2 -2
  40. package/dist/client/assets/{FoldedSettingsSection-BTMENmDo.js → FoldedSettingsSection-DvzfFn5A.js} +2 -2
  41. package/dist/client/assets/{HDGCDEEZ-BA3H_tu4.js → HDGCDEEZ-DVkQN-82.js} +2 -2
  42. package/dist/client/assets/{HSJLKHB7-BojHXJG0.js → HSJLKHB7-txH19TCj.js} +2 -2
  43. package/dist/client/assets/{IntervalSecondsField-Cpc7UePr.js → IntervalSecondsField-xqmFxAii.js} +2 -2
  44. package/dist/client/assets/JZOYTAAL-BqUoPKcz.js +1 -0
  45. package/dist/client/assets/{K3MD6TGW-hwfRTJ3N.js → K3MD6TGW-4d2yDOzZ.js} +2 -2
  46. package/dist/client/assets/{K7RP3OMA-4mJh9KrG.js → K7RP3OMA-B8vKr81f.js} +2 -2
  47. package/dist/client/assets/{LHDIQX7Q-LIdvhN0m.js → LHDIQX7Q-DAyTfuTY.js} +2 -2
  48. package/dist/client/assets/{LUXOKEGN-B1aHy25-.js → LUXOKEGN-C67XJj3F.js} +2 -2
  49. package/dist/client/assets/{LinkMachineSelect-CM7JZDuM.js → LinkMachineSelect-DoqwB0AR.js} +2 -2
  50. package/dist/client/assets/{MathTypeset-CA2nw_Ej.js → MathTypeset-CMO1aCZc.js} +2 -2
  51. package/dist/client/assets/{ModelLiveLayer-CPk6oSLz.js → ModelLiveLayer-DqW0VhFG.js} +3 -3
  52. package/dist/client/assets/{N3JZAHOW-Dz6QAj1L.js → N3JZAHOW-Bp1sdK_N.js} +2 -2
  53. package/dist/client/assets/{NUIALGQ3-W9kPoZrb.js → NUIALGQ3-D427dlgt.js} +2 -2
  54. package/dist/client/assets/{NoProjectsHero-DrTDAhjM.js → NoProjectsHero-BL0Jsc_V.js} +2 -2
  55. package/dist/client/assets/{O65XPQGZ-CPx16bPB.js → O65XPQGZ-BxqHRP3n.js} +2 -2
  56. package/dist/client/assets/{O7XIQ6OM-CAdGDrqF.js → O7XIQ6OM-CKRD1aP5.js} +2 -2
  57. package/dist/client/assets/{OFQON5FD-DOxYOpsO.js → OFQON5FD-CzS9a25C.js} +2 -2
  58. package/dist/client/assets/{P4ConnectAccountPages-D0qqCxCf.js → P4ConnectAccountPages-Ca1o0JuS.js} +2 -2
  59. package/dist/client/assets/{P4ConnectSidebarSignIn-CtO1hqIS.js → P4ConnectSidebarSignIn-29st82gY.js} +2 -2
  60. package/dist/client/assets/{PJQHF43J-CEic-zJ0.js → PJQHF43J-Ww7-2BqY.js} +2 -2
  61. package/dist/client/assets/{PanelLayoutControls-CPevLAhG.js → PanelLayoutControls-CoWjUmx7.js} +4 -4
  62. package/dist/client/assets/{PierreEntryIcon-oOiSTYpG.js → PierreEntryIcon-UO6zY_i-.js} +2 -2
  63. package/dist/client/assets/{PreviewPanel-BSwObBjW.js → PreviewPanel-BHj7Mvmn.js} +2 -2
  64. package/dist/client/assets/{ProjectDefaultsSettings-BkxL8Xjx.js → ProjectDefaultsSettings-DN1mhFNf.js} +2 -2
  65. package/dist/client/assets/{ProjectFavicon-DYcNXMDQ.js → ProjectFavicon-CyXd4lSF.js} +3 -3
  66. package/dist/client/assets/{ProjectIconPickerDialog-CnlPMGQj.js → ProjectIconPickerDialog-B_D_9SAb.js} +2 -2
  67. package/dist/client/assets/{ProviderAuthTerminal-B1NeqFZE.js → ProviderAuthTerminal-B0GzUrya.js} +2 -2
  68. package/dist/client/assets/{ProviderModelPicker-CLwSFV6Q.js → ProviderModelPicker-DQ3N8RWz.js} +2 -2
  69. package/dist/client/assets/{ProviderSettingsForm-D9GJtzdb.js → ProviderSettingsForm-DefAmKv_.js} +2 -2
  70. package/dist/client/assets/{PullRequestCodeTab-CajEWSe5.js → PullRequestCodeTab-BTwbK3zR.js} +2 -2
  71. package/dist/client/assets/{RHNBAITX-D5lTu0BB.js → RHNBAITX-BsGO-vJB.js} +2 -2
  72. package/dist/client/assets/{ReadOnlySourcePreview-LxG8Br9J.js → ReadOnlySourcePreview-COho36OD.js} +2 -2
  73. package/dist/client/assets/{RenderErrorBoundary-CcI-4Zo3.js → RenderErrorBoundary-CYsCxleQ.js} +2 -2
  74. package/dist/client/assets/{SLD4V6NK-CG_xQFi-.js → SLD4V6NK-BZEKTqDY.js} +2 -2
  75. package/dist/client/assets/{ScheduledTasksSettings-CSygG_5X.js → ScheduledTasksSettings-CpfGXMow.js} +2 -2
  76. package/dist/client/assets/{ScopedSwitch-LzARRHas.js → ScopedSwitch-Cq7B0T7B.js} +2 -2
  77. package/dist/client/assets/{SelfImproveSettingsSection-DjuOvf_q.js → SelfImproveSettingsSection-DZUf-jb0.js} +2 -2
  78. package/dist/client/assets/{SettingsPanels-Ci2h30Aw.js → SettingsPanels-Bk_YhHLm.js} +2 -2
  79. package/dist/client/assets/{SettingsPanels.logic-BkjrmwrI.js → SettingsPanels.logic-UhRGlGN1.js} +2 -2
  80. package/dist/client/assets/{SettingsScopeNotice-96p-bg8p.js → SettingsScopeNotice-Cja-hHOp.js} +2 -2
  81. package/dist/client/assets/{SidebarStageBackdrop-B8YG-M-e.js → SidebarStageBackdrop-DL1ZzaTz.js} +2 -2
  82. package/dist/client/assets/{T3PCR2KE-DyNYo7Zy.js → T3PCR2KE-D049x5K8.js} +2 -2
  83. package/dist/client/assets/{TKWO2OVW-5eCjJCfz.js → TKWO2OVW-Du9gxVgn.js} +2 -2
  84. package/dist/client/assets/{TSHNXIZL-CjI9VTqp.js → TSHNXIZL-pUPHV4Qd.js} +2 -2
  85. package/dist/client/assets/{ThemeEditorPanel-BdfXdTV6.js → ThemeEditorPanel-CcFVvJlQ.js} +2 -2
  86. package/dist/client/assets/{ThreadDetailsItemsMenu-Cgj2yuzU.js → ThreadDetailsItemsMenu-C4wfbepv.js} +4 -4
  87. package/dist/client/assets/{ThreadTerminalDrawer-DBG1eHBS.js → ThreadTerminalDrawer-PkBB7D3Z.js} +2 -2
  88. package/dist/client/assets/{UQJE5E4I-CY9HwTsw.js → UQJE5E4I-BN56DsgT.js} +2 -2
  89. package/dist/client/assets/{USNYFO5S-BW0HcjRg.js → USNYFO5S-DVfAs9Gy.js} +2 -2
  90. package/dist/client/assets/{Virtualizer-NI9bqlwX.js → Virtualizer-Cn_zq3uH.js} +2 -2
  91. package/dist/client/assets/{WEVWDWVA-BF8z-yRH.js → WEVWDWVA-Cz36fo-k.js} +2 -2
  92. package/dist/client/assets/{X5RFHQXM-pdor6bX7.js → X5RFHQXM-CUB_vKAl.js} +2 -2
  93. package/dist/client/assets/{X62E3GBT-C6b2WsLT.js → X62E3GBT-C0wKfqHq.js} +2 -2
  94. package/dist/client/assets/{XBNEOJTC-BxqaKoJL.js → XBNEOJTC-CkYPODhO.js} +2 -2
  95. package/dist/client/assets/{YHV2MVVZ-DO-ICZOV.js → YHV2MVVZ-Cf82W2em.js} +2 -2
  96. package/dist/client/assets/{YURCZMG2-BxKVNupW.js → YURCZMG2-C9tzKn90.js} +2 -2
  97. package/dist/client/assets/{YVG2LODB-BwiP1iS0.js → YVG2LODB-DEZWhxa8.js} +2 -2
  98. package/dist/client/assets/{_chat-DDScEBKF.js → _chat-PsMoIPUC.js} +5 -5
  99. package/dist/client/assets/{_chat.design-360SdjDb.js → _chat.design-CWE-keji.js} +2 -2
  100. package/dist/client/assets/{_chat.index-DsRV2lh0.js → _chat.index-YmI2iiCN.js} +2 -2
  101. package/dist/client/assets/{_chat.new-B_AL_NJ2.js → _chat.new-BQY5ktA8.js} +2 -2
  102. package/dist/client/assets/{_chat.pull-requests-DlL4gjh7.js → _chat.pull-requests-C90JBKAN.js} +2 -2
  103. package/dist/client/assets/{assetUrls-gAudvjhV.js → assetUrls-C78a94Xu.js} +2 -2
  104. package/dist/client/assets/{assets-DaZ46ybf.js → assets-5kUNv3CS.js} +2 -2
  105. package/dist/client/assets/{browserHistoryStore-CIeLvEnV.js → browserHistoryStore-DHI-0j5y.js} +2 -2
  106. package/dist/client/assets/{browserLinkTarget-MQvtO-01.js → browserLinkTarget-D8HUAQg-.js} +2 -2
  107. package/dist/client/assets/{connect-DkCGs4oR.js → connect-Dl6MuR2C.js} +2 -2
  108. package/dist/client/assets/connect-agent-B22xdP4o.js +2 -0
  109. package/dist/client/assets/{design-Djc1_eDF.js → design-BoZx445P.js} +2 -2
  110. package/dist/client/assets/{device-P8L_QiVD.js → device-Ku4cbgo-.js} +2 -2
  111. package/dist/client/assets/{diffRendering-Cb9qJUqp.js → diffRendering-yxIsTMie.js} +2 -2
  112. package/dist/client/assets/{dist-BocOAtMa.js → dist-CkH9xVVz.js} +2 -2
  113. package/dist/client/assets/{duoViewer-Domn2baW.js → duoViewer-_3Xk2sTq.js} +2 -2
  114. package/dist/client/assets/{dynamic-CjS-lEY3.js → dynamic-CwQ-caG2.js} +2 -2
  115. package/dist/client/assets/{embeddedScripts-AO2vzovy.js → embeddedScripts-Cn7aGTAj.js} +2 -2
  116. package/dist/client/assets/{entities-s42SFcbu.js → entities-DOpLfnwX.js} +2 -2
  117. package/dist/client/assets/{fileLinks-BY6FjK66.js → fileLinks-CJ9SYNL6.js} +2 -2
  118. package/dist/client/assets/{fileTreeExpansion-B--IBStv.js → fileTreeExpansion-CdWOFpa-.js} +2 -2
  119. package/dist/client/assets/{getDiffFileInput-B7pCnCeh.js → getDiffFileInput-hLtjvhYr.js} +2 -2
  120. package/dist/client/assets/{index-C5VbGbq-.js → index-etcfxnIt.js} +3 -3
  121. package/dist/client/assets/{lazy-Bpm7QNt6.js → lazy--Qcevr63.js} +4 -4
  122. package/dist/client/assets/{linkedPrompt-DqEOywCR.js → linkedPrompt-D4M9Fbja.js} +2 -2
  123. package/dist/client/assets/{main-BYwnnJ9E.js → main-C04YJQbN.js} +7 -7
  124. package/dist/client/assets/{mediaReference-CW0q8-nM.js → mediaReference-D4rhlY-i.js} +2 -2
  125. package/dist/client/assets/{mediaSource-BgP2sq1w.js → mediaSource-B03Ykm6c.js} +2 -2
  126. package/dist/client/assets/{modelScene-OONljnCt.js → modelScene-CX8s0IGN.js} +2 -2
  127. package/dist/client/assets/{onboarding-DLaBhCVN.js → onboarding-BZ01kUjR.js} +2 -2
  128. package/dist/client/assets/{openFileInPreview-Dpge7x7S.js → openFileInPreview-XKgvCQ1z.js} +2 -2
  129. package/dist/client/assets/{p4ProjectFile-Fd0NSHmZ.js → p4ProjectFile-y2CDxOaL.js} +2 -2
  130. package/dist/client/assets/{pair-BUkFlR8l.js → pair-PXvf9qqC.js} +2 -2
  131. package/dist/client/assets/{phoneViewer-BJj_96At.js → phoneViewer-F9Wt5VkW.js} +2 -2
  132. package/dist/client/assets/{pierre-icons-BptmNFMW.js → pierre-icons-BTVgApcG.js} +2 -2
  133. package/dist/client/assets/{preview-BBssbPEj.js → preview-5pSBET3P.js} +2 -2
  134. package/dist/client/assets/{primary-TNEEuOuT.js → primary-BXI66byW.js} +2 -2
  135. package/dist/client/assets/{primaryCloudLinkState-DbUZbjy4.js → primaryCloudLinkState-DswWb__m.js} +2 -2
  136. package/dist/client/assets/{projectFilesQueryState-CVSEDHhW.js → projectFilesQueryState-B6AeAhgL.js} +2 -2
  137. package/dist/client/assets/{projectScriptEditor-D2C0qPZA.js → projectScriptEditor-DvKvgTs-.js} +2 -2
  138. package/dist/client/assets/{providerSkills-5OBbbZq-.js → providerSkills-D-ytsJU9.js} +2 -2
  139. package/dist/client/assets/{pullRequestDetail.logic-D5hhGj8d.js → pullRequestDetail.logic-DQj9l9DL.js} +2 -2
  140. package/dist/client/assets/{pullRequests-R7416J6H.js → pullRequests-DrQJ8zM2.js} +2 -2
  141. package/dist/client/assets/{queries-Bp7Rbzrz.js → queries-BA_altUI.js} +2 -2
  142. package/dist/client/assets/{relay-V_5ApBIP.js → relay-CTdDIWLg.js} +2 -2
  143. package/dist/client/assets/{renderScheduler-T1-hnpvd.js → renderScheduler-eNIG8tB_.js} +2 -2
  144. package/dist/client/assets/{runtime-B92ivG9b.js → runtime-BvdQMwVb.js} +3 -3
  145. package/dist/client/assets/{scheduledTasksSettings.logic-DOegPD4_.js → scheduledTasksSettings.logic-CKzZuci7.js} +2 -2
  146. package/dist/client/assets/{server-GB5fRm03.js → server-DthHkqkT.js} +2 -2
  147. package/dist/client/assets/{session-CFzb2gMH.js → session-CxeYe0sJ.js} +2 -2
  148. package/dist/client/assets/{session-logic-Cx9524Pd.js → session-logic-2ZMapwqV.js} +2 -2
  149. package/dist/client/assets/{settings-DuV3USCX.js → settings-DAe5Z4UG.js} +2 -2
  150. package/dist/client/assets/{settings.appearance-DtON2De5.js → settings.appearance-wfb5oCmC.js} +2 -2
  151. package/dist/client/assets/settings.archived-BF0zdtbV.js +2 -0
  152. package/dist/client/assets/{settings.computer-use-BuiCBgaZ.js → settings.computer-use-DJQcngZ4.js} +2 -2
  153. package/dist/client/assets/{settings.connections-CTuywqD3.js → settings.connections-CoxujVuf.js} +2 -2
  154. package/dist/client/assets/{settings.data-controls-BTvw7hwA.js → settings.data-controls-DUI06j8l.js} +2 -2
  155. package/dist/client/assets/{settings.decisions-DjyXWkGE.js → settings.decisions-BY4z-aRM.js} +2 -2
  156. package/dist/client/assets/{settings.designs-B7y3Iz_g.js → settings.designs-O0d1vzoU.js} +2 -2
  157. package/dist/client/assets/{settings.diagnostics-muot_u8V.js → settings.diagnostics-CwCeo1mG.js} +2 -2
  158. package/dist/client/assets/{settings.general-CejKrS3r.js → settings.general-CAOwfHEb.js} +2 -2
  159. package/dist/client/assets/{settings.integrations-3B64nKur.js → settings.integrations-2RsLmeUi.js} +2 -2
  160. package/dist/client/assets/{settings.keybindings-DhvXS2QI.js → settings.keybindings-CwvrmKin.js} +2 -2
  161. package/dist/client/assets/{settings.open-source-licenses-nDTYUclU.js → settings.open-source-licenses-DCBCu3U3.js} +2 -2
  162. package/dist/client/assets/{settings.plugins-DJQxiL8Y.js → settings.plugins-8R8eV7IR.js} +2 -2
  163. package/dist/client/assets/{settings.projects-Cf31zLX1.js → settings.projects-Cy_93LuA.js} +3 -3
  164. package/dist/client/assets/{settings.providers-BenYwp5l.js → settings.providers-4HI8om0T.js} +3 -3
  165. package/dist/client/assets/{settings.scheduled-tasks-B0BJtx2Y.js → settings.scheduled-tasks-CHnjcJx8.js} +2 -2
  166. package/dist/client/assets/{settings.secrets-CugtPHky.js → settings.secrets-BgQSmFWY.js} +2 -2
  167. package/dist/client/assets/{settings.snap-shot-9uuaPZ8d.js → settings.snap-shot-C0J6pItQ.js} +2 -2
  168. package/dist/client/assets/{settings.source-control-DECPD9xY.js → settings.source-control-B3kcm55_.js} +2 -2
  169. package/dist/client/assets/{settings.storage-uPkJDu8D.js → settings.storage-Cy6oX7X3.js} +2 -2
  170. package/dist/client/assets/{settingsLayout-BoWaVHvV.js → settingsLayout-YTaL8Lym.js} +2 -2
  171. package/dist/client/assets/{sidebarProjectGrouping-MU2UfzY1.js → sidebarProjectGrouping-BaiZoO-A.js} +2 -2
  172. package/dist/client/assets/{sourceControl-BU6NXFEv.js → sourceControl-j8xaTHat.js} +2 -2
  173. package/dist/client/assets/{sourceControlClients-DBozOkI3.js → sourceControlClients-BxzlzQxJ.js} +2 -2
  174. package/dist/client/assets/{terminal-links-B5f_yaZ1.js → terminal-links-BdsGDJ3O.js} +2 -2
  175. package/dist/client/assets/{terminalSessions-Cg0AQjBU.js → terminalSessions-yZRa64tn.js} +2 -2
  176. package/dist/client/assets/{uiStateStore-u_PaGpa6.js → uiStateStore-CX-sbFiq.js} +2 -2
  177. package/dist/client/assets/{usage-BzExgBit.js → usage-CdxC8YNe.js} +2 -2
  178. package/dist/client/assets/{use-atom-command-Bd7vZxeH.js → use-atom-command-Bsfu4mja.js} +2 -2
  179. package/dist/client/assets/{useHandleNewThread-CA9pnWuC.js → useHandleNewThread-Cv_08eER.js} +2 -2
  180. package/dist/client/assets/{useP4ConnectAuthPrompt-czmNhUqV.js → useP4ConnectAuthPrompt-CW-hut92.js} +2 -2
  181. package/dist/client/assets/{usePullRequestActions-BIPl_xE4.js → usePullRequestActions-BHv9tRFF.js} +2 -2
  182. package/dist/client/assets/{useScopedModelAvailability-UuZvj6HE.js → useScopedModelAvailability-J0i-Sj4p.js} +2 -2
  183. package/dist/client/assets/{useSettings-Dp9RSL-0.js → useSettings-BhGGZc98.js} +2 -2
  184. package/dist/client/assets/{vcsRefInvalidation-CoBKCEWS.js → vcsRefInvalidation-71d-99uY.js} +2 -2
  185. package/dist/client/assets/{welcome-CJjj0VVp.js → welcome-Ytf7jmR7.js} +2 -2
  186. package/dist/client/index.html +1 -1
  187. package/dist/{preview-JlPVV2bV.mjs → preview-CmCyL-Tc.mjs} +2 -2
  188. package/dist/{runtimeLayer-B9K2BVKV.mjs → runtimeLayer-BnJcJFjY.mjs} +2 -2
  189. package/dist/{runtimeLayer-ZFdf4c6R.mjs → runtimeLayer-DnNbGwAf.mjs} +1 -1
  190. package/dist/{server-BnHhGuOc.mjs → server-DXfSgbuj.mjs} +4 -4
  191. package/package.json +1 -1
  192. package/dist/client/assets/JZOYTAAL-Bw2-11fa.js +0 -1
  193. package/dist/client/assets/connect-agent-C4n-OyN3.js +0 -2
  194. package/dist/client/assets/settings.archived-CxxKM6i3.js +0 -2
@@ -1,6 +1,6 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ed as i,Ft as a,Hd as o,Jo as s,Js as c,Ku as l,Ol as u,Ou as d,Ql as f,Rf as p,Ut as m,Wl as h,Wt as g,Xd as _,Xn as v,Xt as y,Zn as b,Zo as x,es as S,fr as C,ls as w,mr as ee,qd as T,rr as E,sr as te,t as D,tr as ne}from"./utils-DkKLB01I.js";import{T as O,V as k,fa as A}from"./src-R7EkrVcv.js";import{Dr as re,Qr as j,Sr as ie,cr as M}from"./runtime-B92ivG9b.js";import{C as N,O as P}from"./entities-s42SFcbu.js";import{a as F,c as I,o as L,s as R,t as z}from"./select-CE2f-g-3.js";import{t as B}from"./link-BHR6GsRr.js";import{a as V,m as H}from"./relay-V_5ApBIP.js";import{C as U,S as ae,et as W,f as G}from"./useSettings-Dp9RSL-0.js";import{f as K,t as q}from"./server-GB5fRm03.js";import{n as oe}from"./session-CFzb2gMH.js";import{n as se}from"./query-CeIgbVxh.js";import{t as ce}from"./use-atom-command-Bd7vZxeH.js";import{t as J}from"./toastHelpers-DxXYm50b.js";import{h as Y,i as le,m as X,u as ue}from"./queries-Bp7Rbzrz.js";import{a as de}from"./timestampFormat-Dq7sHZpd.js";import{a as fe,n as pe,t as me}from"./tooltip-CCYU8XGM.js";import{t as he}from"./textarea-CWbMGhL9.js";import{n as ge,t as _e}from"./toggle-group-B1WN0Pgy.js";import{a as ve,c as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./combobox-D6RfzdE7.js";import{t as Ee}from"./input-CiPGmOLv.js";import{n as De}from"./scroll-area-D2D-AlvC.js";import{a as Oe,c as ke,i as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe}from"./dialog-5OaxRXCC.js";import{a as Ie,i as Le,o as Re,r as ze,t as Be}from"./empty-VkAC9qIO.js";import{n as Ve}from"./EnvironmentMachineIcon-Lz2YGk0G.js";import{V as He,a as Ue,i as We,n as Ge,s as Ke,u as qe,v as Je}from"./settingsLayout-BoWaVHvV.js";import{n as Ye}from"./primaryCloudLinkState-DbUZbjy4.js";import{a as Xe,c as Ze,d as Qe,f as $e,i as et,l as tt,n as nt,p as rt,r as it,s as at,t as ot,u as st}from"./scheduledTasksSettings.logic-DOegPD4_.js";import{Ho as ct,Mo as lt,jn as ut,pa as dt,vn as ft}from"./main-BYwnnJ9E.js";import{t as pt}from"./ProviderModelPicker-CLwSFV6Q.js";var mt=n(),Z=e(t(),1),Q=e(r(),1);function ht(e){let t=(0,mt.c)(69),{items:n,filteredItems:r,value:i,query:a,resultsQuery:o,onQueryChange:s,open:c,onOpenChange:l,onSelectItem:u,hasNextPage:d,isFetchingNextPage:f,onLoadNext:p,statusText:m,originControl:h,popupProps:g,renderItem:_,getItemType:v,children:y}=e,b=(0,Z.useRef)(null),x=(0,Z.useId)(),S=(0,Z.useRef)(null),C=(0,Z.useRef)(null),w;t[0]===l?w=t[1]:(w=e=>{C.current=null,e||(b.current=null),l(e)},t[0]=l,t[1]=w);let ee=w,[T,E]=(0,Z.useState)(!1),[te,ne]=(0,Z.useState)(!1),O;t[2]!==d||t[3]!==f||t[4]!==p?(O=()=>{d&&!f&&p()},t[2]=d,t[3]=f,t[4]=p,t[5]=O):O=t[5];let k=O,A;t[6]!==k||t[7]!==d||t[8]!==f||t[9]!==c?(A=()=>{let e=S.current;if(!e)return;let t=C.current;C.current=e.scrollTop,c&&d&&!f&&Y({previousScrollTop:t,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight})&&k()},t[6]=k,t[7]=d,t[8]=f,t[9]=c,t[10]=A):A=t[10];let re=A,j=(0,Z.useRef)(null),ie;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{let e=j.current?.getScrollableNode?.();if(!(e instanceof HTMLElement))return;S.current=e;let t=Math.max(0,e.scrollHeight-e.clientHeight);E(e.scrollTop>1),ne(t-e.scrollTop>1)},t[11]=ie):ie=t[11];let M=ie,N,P;t[12]===c?(N=t[13],P=t[14]):(N=()=>{if(!c)return;let e=0,t=requestAnimationFrame(()=>{M(),e=requestAnimationFrame(M)});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},P=[c,M],t[12]=c,t[13]=N,t[14]=P),(0,Z.useLayoutEffect)(N,P);let F=(0,Z.useRef)(null),I,L;t[15]!==c||t[16]!==o?(I=()=>{c?F.current!==o&&(F.current=o,j.current?.scrollToOffset?.({offset:0,animated:!1})):F.current=null},L=[o,c],t[15]=c,t[16]=o,t[17]=I,t[18]=L):(I=t[17],L=t[18]),(0,Z.useEffect)(I,L);let R;t[19]===c?R=t[20]:(R=(e,t)=>{b.current=typeof e==`string`?e:null,!(!c||t.index<0||t.reason!==`keyboard`)&&j.current?.scrollIndexIntoView?.({index:t.index,animated:!1})},t[19]=c,t[20]=R);let z;t[21]===s?z=t[22]:(z=e=>s(e.target.value),t[21]=s,t[22]=z);let B;t[23]!==r||t[24]!==u?(B=e=>{if(e.key!==`Enter`||e.nativeEvent.isComposing||e.keyCode===229)return;let t=b.current;t!==null&&r.includes(t)&&(e.preventBaseUIHandler?.(),e.preventDefault(),e.stopPropagation(),b.current=null,u(t))},t[23]=r,t[24]=u,t[25]=B):B=t[25];let V;t[26]!==a||t[27]!==z||t[28]!==B?(V=(0,Q.jsx)(we,{placeholder:`Search refs...`,value:a,onChange:z,onKeyDown:B}),t[26]=a,t[27]=z,t[28]=B,t[29]=V):V=t[29];let H;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Q.jsx)(xe,{children:`No refs found.`}),t[30]=H):H=t[30];let U;t[31]===v?U=t[32]:(U=v?{getItemType:v}:{},t[31]=v,t[32]=U);let ae;t[33]===_?ae=t[34]:(ae=e=>{let{item:t,index:n}=e;return _(t,n)},t[33]=_,t[34]=ae);let W;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>{M(),C.current=S.current?.scrollTop??null},t[35]=W):W=t[35];let G;t[36]===re?G=t[37]:(G=()=>{M(),re()},t[36]=re,t[37]=G);let K;t[38]!==te||t[39]!==T?(K=D(`max-h-56 scrollbar-gutter-stable overflow-x-hidden overscroll-y-contain ps-1 pe-0 pt-2 pb-1`,De({top:T,bottom:te})),t[38]=te,t[39]=T,t[40]=K):K=t[40];let q;t[41]!==r||t[42]!==U||t[43]!==ae||t[44]!==G||t[45]!==K?(q=(0,Q.jsx)(`div`,{className:`relative min-h-0 w-full max-h-56 flex-1 overflow-hidden`,children:(0,Q.jsx)(ve,{className:`size-full min-w-0`,children:(0,Q.jsx)(ut,{ref:j,data:r,keyExtractor:gt,...U,renderItem:ae,estimatedItemSize:28,drawDistance:336,onLayout:W,onScroll:G,className:K})})}),t[41]=r,t[42]=U,t[43]=ae,t[44]=G,t[45]=K,t[46]=q):q=t[46];let oe;t[47]!==h||t[48]!==x?(oe=h?(0,Q.jsxs)(me,{children:[(0,Q.jsx)(fe,{render:(0,Q.jsxs)(`label`,{htmlFor:x,className:`flex cursor-pointer items-center justify-between gap-3 border-t border-border/60 px-3 py-2 text-xs`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-medium text-muted-foreground`,children:[(0,Q.jsx)(ct,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Q.jsx)(`span`,{className:`truncate`,children:`Start from origin`})]}),(0,Q.jsx)(lt,{id:x,checked:h.checked,size:`sm`,"aria-label":`Start worktree from origin`,onCheckedChange:e=>h.onCheckedChange(!!e)})]})}),(0,Q.jsx)(pe,{side:`top`,className:`max-w-72 whitespace-normal`,children:`Creates the worktree from the latest matching branch on origin instead of your local branch.`})]}):null,t[47]=h,t[48]=x,t[49]=oe):oe=t[49];let se;t[50]===m?se=t[51]:(se=m?(0,Q.jsx)(ye,{children:m}):null,t[50]=m,t[51]=se);let ce;t[52]!==q||t[53]!==oe||t[54]!==se?(ce=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[H,q,oe,se]}),t[52]=q,t[53]=oe,t[54]=se,t[55]=ce):ce=t[55];let J;t[56]!==g||t[57]!==V||t[58]!==ce?(J=(0,Q.jsxs)(Se,{...g,children:[V,ce]}),t[56]=g,t[57]=V,t[58]=ce,t[59]=J):J=t[59];let le;return t[60]!==y||t[61]!==r||t[62]!==ee||t[63]!==n||t[64]!==c||t[65]!==J||t[66]!==R||t[67]!==i?(le=(0,Q.jsxs)(Te,{items:n,filteredItems:r,autoHighlight:!0,virtualized:!0,onItemHighlighted:R,onOpenChange:ee,open:c,value:i,children:[y,J]}),t[60]=y,t[61]=r,t[62]=ee,t[63]=n,t[64]=c,t[65]=J,t[66]=R,t[67]=i,t[68]=le):le=t[68],le}function gt(e){return e}function _t(e){let t=(0,mt.c)(15),{branch:n,projectCwd:r,index:i,value:a,disabled:o,onClick:s,onContextMenu:c}=e,l=n.name,u=n.worktreePath&&r&&n.worktreePath!==r,d=n.current?`current`:u?`worktree`:n.isRemote?`remote`:n.isDefault?`default`:null,f=a??l,p;t[0]===l?p=t[1]:(p=(0,Q.jsx)(ft,{value:l,className:`flex-1`}),t[0]=l,t[1]=p);let m;t[2]===d?m=t[3]:(m=d&&(0,Q.jsx)(`span`,{className:`shrink-0 text-3xs text-muted-foreground/45`,children:d}),t[2]=d,t[3]=m);let h;t[4]!==p||t[5]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex w-full min-w-0 items-center justify-between gap-2`,children:[p,m]}),t[4]=p,t[5]=m,t[6]=h):h=t[6];let g;return t[7]!==o||t[8]!==i||t[9]!==l||t[10]!==s||t[11]!==c||t[12]!==f||t[13]!==h?(g=(0,Q.jsx)(Ce,{disabled:o,hideIndicator:!0,index:i,value:f,onClick:s,onContextMenu:c,children:h},l),t[7]=o,t[8]=i,t[9]=l,t[10]=s,t[11]=c,t[12]=f,t[13]=h,t[14]=g):g=t[14],g}function vt(e,t){if(e.url!==null)return{address:e.url,copyable:!0,note:null};if(t===null)return{address:e.path,copyable:!1,note:`Link this environment to P4 Connect for a public URL.`};let n=new URL(e.path,t);return{address:n.href,copyable:!0,note:j(n.hostname)?`Only this computer can call this address. Link P4 Connect for a public URL.`:`Works wherever this environment's address is reachable, for example over Tailscale or your own proxy. Link P4 Connect for a public URL.`}}var yt=e=>e.join(`
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ed as i,Ft as a,Hd as o,Jo as s,Js as c,Ku as l,Ol as u,Ou as d,Ql as f,Rf as p,Ut as m,Wl as h,Wt as g,Xd as _,Xn as v,Xt as y,Zn as b,Zo as x,es as S,fr as C,ls as w,mr as ee,qd as T,rr as E,sr as te,t as D,tr as ne}from"./utils-DkKLB01I.js";import{T as O,V as k,fa as A}from"./src-R7EkrVcv.js";import{Dr as re,Qr as j,Sr as ie,cr as M}from"./runtime-BvdQMwVb.js";import{C as N,O as P}from"./entities-DOpLfnwX.js";import{a as F,c as I,o as L,s as R,t as z}from"./select-CE2f-g-3.js";import{t as B}from"./link-BHR6GsRr.js";import{a as V,m as H}from"./relay-CTdDIWLg.js";import{C as U,S as ae,et as W,f as G}from"./useSettings-BhGGZc98.js";import{f as K,t as q}from"./server-DthHkqkT.js";import{n as oe}from"./session-CxeYe0sJ.js";import{n as se}from"./query-CeIgbVxh.js";import{t as ce}from"./use-atom-command-Bsfu4mja.js";import{t as J}from"./toastHelpers-DxXYm50b.js";import{h as Y,i as le,m as X,u as ue}from"./queries-BA_altUI.js";import{a as de}from"./timestampFormat-Dq7sHZpd.js";import{a as fe,n as pe,t as me}from"./tooltip-CCYU8XGM.js";import{t as he}from"./textarea-CWbMGhL9.js";import{n as ge,t as _e}from"./toggle-group-B1WN0Pgy.js";import{a as ve,c as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./combobox-D6RfzdE7.js";import{t as Ee}from"./input-CiPGmOLv.js";import{n as De}from"./scroll-area-D2D-AlvC.js";import{a as Oe,c as ke,i as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe}from"./dialog-5OaxRXCC.js";import{a as Ie,i as Le,o as Re,r as ze,t as Be}from"./empty-VkAC9qIO.js";import{n as Ve}from"./EnvironmentMachineIcon-Lz2YGk0G.js";import{V as He,a as Ue,i as We,n as Ge,s as Ke,u as qe,v as Je}from"./settingsLayout-YTaL8Lym.js";import{n as Ye}from"./primaryCloudLinkState-DswWb__m.js";import{a as Xe,c as Ze,d as Qe,f as $e,i as et,l as tt,n as nt,p as rt,r as it,s as at,t as ot,u as st}from"./scheduledTasksSettings.logic-CKzZuci7.js";import{Ho as ct,Mo as lt,jn as ut,pa as dt,vn as ft}from"./main-C04YJQbN.js";import{t as pt}from"./ProviderModelPicker-DQ3N8RWz.js";var mt=n(),Z=e(t(),1),Q=e(r(),1);function ht(e){let t=(0,mt.c)(69),{items:n,filteredItems:r,value:i,query:a,resultsQuery:o,onQueryChange:s,open:c,onOpenChange:l,onSelectItem:u,hasNextPage:d,isFetchingNextPage:f,onLoadNext:p,statusText:m,originControl:h,popupProps:g,renderItem:_,getItemType:v,children:y}=e,b=(0,Z.useRef)(null),x=(0,Z.useId)(),S=(0,Z.useRef)(null),C=(0,Z.useRef)(null),w;t[0]===l?w=t[1]:(w=e=>{C.current=null,e||(b.current=null),l(e)},t[0]=l,t[1]=w);let ee=w,[T,E]=(0,Z.useState)(!1),[te,ne]=(0,Z.useState)(!1),O;t[2]!==d||t[3]!==f||t[4]!==p?(O=()=>{d&&!f&&p()},t[2]=d,t[3]=f,t[4]=p,t[5]=O):O=t[5];let k=O,A;t[6]!==k||t[7]!==d||t[8]!==f||t[9]!==c?(A=()=>{let e=S.current;if(!e)return;let t=C.current;C.current=e.scrollTop,c&&d&&!f&&Y({previousScrollTop:t,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight})&&k()},t[6]=k,t[7]=d,t[8]=f,t[9]=c,t[10]=A):A=t[10];let re=A,j=(0,Z.useRef)(null),ie;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{let e=j.current?.getScrollableNode?.();if(!(e instanceof HTMLElement))return;S.current=e;let t=Math.max(0,e.scrollHeight-e.clientHeight);E(e.scrollTop>1),ne(t-e.scrollTop>1)},t[11]=ie):ie=t[11];let M=ie,N,P;t[12]===c?(N=t[13],P=t[14]):(N=()=>{if(!c)return;let e=0,t=requestAnimationFrame(()=>{M(),e=requestAnimationFrame(M)});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},P=[c,M],t[12]=c,t[13]=N,t[14]=P),(0,Z.useLayoutEffect)(N,P);let F=(0,Z.useRef)(null),I,L;t[15]!==c||t[16]!==o?(I=()=>{c?F.current!==o&&(F.current=o,j.current?.scrollToOffset?.({offset:0,animated:!1})):F.current=null},L=[o,c],t[15]=c,t[16]=o,t[17]=I,t[18]=L):(I=t[17],L=t[18]),(0,Z.useEffect)(I,L);let R;t[19]===c?R=t[20]:(R=(e,t)=>{b.current=typeof e==`string`?e:null,!(!c||t.index<0||t.reason!==`keyboard`)&&j.current?.scrollIndexIntoView?.({index:t.index,animated:!1})},t[19]=c,t[20]=R);let z;t[21]===s?z=t[22]:(z=e=>s(e.target.value),t[21]=s,t[22]=z);let B;t[23]!==r||t[24]!==u?(B=e=>{if(e.key!==`Enter`||e.nativeEvent.isComposing||e.keyCode===229)return;let t=b.current;t!==null&&r.includes(t)&&(e.preventBaseUIHandler?.(),e.preventDefault(),e.stopPropagation(),b.current=null,u(t))},t[23]=r,t[24]=u,t[25]=B):B=t[25];let V;t[26]!==a||t[27]!==z||t[28]!==B?(V=(0,Q.jsx)(we,{placeholder:`Search refs...`,value:a,onChange:z,onKeyDown:B}),t[26]=a,t[27]=z,t[28]=B,t[29]=V):V=t[29];let H;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Q.jsx)(xe,{children:`No refs found.`}),t[30]=H):H=t[30];let U;t[31]===v?U=t[32]:(U=v?{getItemType:v}:{},t[31]=v,t[32]=U);let ae;t[33]===_?ae=t[34]:(ae=e=>{let{item:t,index:n}=e;return _(t,n)},t[33]=_,t[34]=ae);let W;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>{M(),C.current=S.current?.scrollTop??null},t[35]=W):W=t[35];let G;t[36]===re?G=t[37]:(G=()=>{M(),re()},t[36]=re,t[37]=G);let K;t[38]!==te||t[39]!==T?(K=D(`max-h-56 scrollbar-gutter-stable overflow-x-hidden overscroll-y-contain ps-1 pe-0 pt-2 pb-1`,De({top:T,bottom:te})),t[38]=te,t[39]=T,t[40]=K):K=t[40];let q;t[41]!==r||t[42]!==U||t[43]!==ae||t[44]!==G||t[45]!==K?(q=(0,Q.jsx)(`div`,{className:`relative min-h-0 w-full max-h-56 flex-1 overflow-hidden`,children:(0,Q.jsx)(ve,{className:`size-full min-w-0`,children:(0,Q.jsx)(ut,{ref:j,data:r,keyExtractor:gt,...U,renderItem:ae,estimatedItemSize:28,drawDistance:336,onLayout:W,onScroll:G,className:K})})}),t[41]=r,t[42]=U,t[43]=ae,t[44]=G,t[45]=K,t[46]=q):q=t[46];let oe;t[47]!==h||t[48]!==x?(oe=h?(0,Q.jsxs)(me,{children:[(0,Q.jsx)(fe,{render:(0,Q.jsxs)(`label`,{htmlFor:x,className:`flex cursor-pointer items-center justify-between gap-3 border-t border-border/60 px-3 py-2 text-xs`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-medium text-muted-foreground`,children:[(0,Q.jsx)(ct,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Q.jsx)(`span`,{className:`truncate`,children:`Start from origin`})]}),(0,Q.jsx)(lt,{id:x,checked:h.checked,size:`sm`,"aria-label":`Start worktree from origin`,onCheckedChange:e=>h.onCheckedChange(!!e)})]})}),(0,Q.jsx)(pe,{side:`top`,className:`max-w-72 whitespace-normal`,children:`Creates the worktree from the latest matching branch on origin instead of your local branch.`})]}):null,t[47]=h,t[48]=x,t[49]=oe):oe=t[49];let se;t[50]===m?se=t[51]:(se=m?(0,Q.jsx)(ye,{children:m}):null,t[50]=m,t[51]=se);let ce;t[52]!==q||t[53]!==oe||t[54]!==se?(ce=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[H,q,oe,se]}),t[52]=q,t[53]=oe,t[54]=se,t[55]=ce):ce=t[55];let J;t[56]!==g||t[57]!==V||t[58]!==ce?(J=(0,Q.jsxs)(Se,{...g,children:[V,ce]}),t[56]=g,t[57]=V,t[58]=ce,t[59]=J):J=t[59];let le;return t[60]!==y||t[61]!==r||t[62]!==ee||t[63]!==n||t[64]!==c||t[65]!==J||t[66]!==R||t[67]!==i?(le=(0,Q.jsxs)(Te,{items:n,filteredItems:r,autoHighlight:!0,virtualized:!0,onItemHighlighted:R,onOpenChange:ee,open:c,value:i,children:[y,J]}),t[60]=y,t[61]=r,t[62]=ee,t[63]=n,t[64]=c,t[65]=J,t[66]=R,t[67]=i,t[68]=le):le=t[68],le}function gt(e){return e}function _t(e){let t=(0,mt.c)(15),{branch:n,projectCwd:r,index:i,value:a,disabled:o,onClick:s,onContextMenu:c}=e,l=n.name,u=n.worktreePath&&r&&n.worktreePath!==r,d=n.current?`current`:u?`worktree`:n.isRemote?`remote`:n.isDefault?`default`:null,f=a??l,p;t[0]===l?p=t[1]:(p=(0,Q.jsx)(ft,{value:l,className:`flex-1`}),t[0]=l,t[1]=p);let m;t[2]===d?m=t[3]:(m=d&&(0,Q.jsx)(`span`,{className:`shrink-0 text-3xs text-muted-foreground/45`,children:d}),t[2]=d,t[3]=m);let h;t[4]!==p||t[5]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex w-full min-w-0 items-center justify-between gap-2`,children:[p,m]}),t[4]=p,t[5]=m,t[6]=h):h=t[6];let g;return t[7]!==o||t[8]!==i||t[9]!==l||t[10]!==s||t[11]!==c||t[12]!==f||t[13]!==h?(g=(0,Q.jsx)(Ce,{disabled:o,hideIndicator:!0,index:i,value:f,onClick:s,onContextMenu:c,children:h},l),t[7]=o,t[8]=i,t[9]=l,t[10]=s,t[11]=c,t[12]=f,t[13]=h,t[14]=g):g=t[14],g}function vt(e,t){if(e.url!==null)return{address:e.url,copyable:!0,note:null};if(t===null)return{address:e.path,copyable:!1,note:`Link this environment to P4 Connect for a public URL.`};let n=new URL(e.path,t);return{address:n.href,copyable:!0,note:j(n.hostname)?`Only this computer can call this address. Link P4 Connect for a public URL.`:`Works wherever this environment's address is reachable, for example over Tailscale or your own proxy. Link P4 Connect for a public URL.`}}var yt=e=>e.join(`
2
2
  `);function bt(e,t){return x(n=>S(e=>n===``?[]:n.split(`
3
3
  `).map(n=>e(t(n)))).pipe(w(`${e}:${n}`)))}function xt(e){let t=(0,mt.c)(62),{environmentId:n,cwd:r,value:i,onValueChange:a,startFromOrigin:o,onStartFromOriginChange:s,disabled:c,id:l}=e,f=c!==void 0&&c,[p,m]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)(``),_,v,y,b,x;t[0]!==r||t[1]!==n||t[2]!==h?(x=h.trim(),b=le,_=n,v=r,y=X(x),t[0]=r,t[1]=n,t[2]=h,t[3]=_,t[4]=v,t[5]=y,t[6]=b,t[7]=x):(_=t[3],v=t[4],y=t[5],b=t[6],x=t[7]);let S;t[8]!==_||t[9]!==v||t[10]!==y?(S={environmentId:_,cwd:v,query:y},t[8]=_,t[9]=v,t[10]=y,t[11]=S):S=t[11];let C=b(S),w;t[12]!==r||t[13]!==n||t[14]!==i?(w=r&&i?ue.listRefs({environmentId:n,input:{cwd:r,query:i,limit:10}}):null,t[12]=r,t[13]=n,t[14]=i,t[15]=w):w=t[15];let T=se(w),E;t[16]!==C.refs||t[17]!==T||t[18]!==i?(E=C.refs.find(e=>e.name===i)??T.data?.refs.find(e=>e.name===i),t[16]=C.refs,t[17]=T,t[18]=i,t[19]=E):E=t[19];let te=E,D=i||null,ne=te?te.isRemote===!0:null,O;t[20]!==o||t[21]!==ne||t[22]!==D?(O=Je({activeWorktreePath:null,effectiveEnvMode:`worktree`,resolvedActiveBranch:D,resolvedActiveBranchIsRemote:ne,startFromOrigin:o}),t[20]=o,t[21]=ne,t[22]=D,t[23]=O):O=t[23];let k=O,A;t[24]===C.refs?A=t[25]:(A=new Map(C.refs.map(St)),t[24]=C.refs,t[25]=A);let re=A,j;t[26]===re?j=t[27]:(j=[...re.keys()],t[26]=re,t[27]=j);let ie=j,M=C.data?.nextCursor!=null,N=C.error??(C.isPending&&C.data===null?`Loading refs...`:C.isFetchingNextPage?`Loading more refs...`:M?`Showing ${C.refs.length} of ${C.data?.totalCount} refs`:null),P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{m(e),e||g(``)},t[28]=P):P=t[28];let F=P,I=i||null,L=p&&!f,R;t[29]===a?R=t[30]:(R=e=>{a(e),F(!1)},t[29]=a,t[30]=R);let z;t[31]!==s||t[32]!==o?(z={checked:o,onCheckedChange:s},t[31]=s,t[32]=o,t[33]=z):z=t[33];let B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B={align:`start`,side:`bottom`,className:`flex w-80 flex-col`},t[34]=B):B=t[34];let V;t[35]!==re||t[36]!==r||t[37]!==a?(V=(e,t)=>{let n=re.get(e);return n?(0,Q.jsx)(_t,{branch:n,projectCwd:r,index:t,onClick:()=>{a(n.name),F(!1)}}):null},t[35]=re,t[36]=r,t[37]=a,t[38]=V):V=t[38];let H=f||!r,U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(ee,{variant:`outline`,size:`sm`}),t[39]=U):U=t[39];let ae;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Q.jsx)(d,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[40]=ae):ae=t[40];let W;t[41]===k?W=t[42]:(W=(0,Q.jsx)(ft,{value:k,className:`flex-1 text-left`}),t[41]=k,t[42]=W);let G;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(u,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[43]=G):G=t[43];let K;t[44]!==l||t[45]!==H||t[46]!==W?(K=(0,Q.jsxs)(be,{id:l,disabled:H,render:U,className:`w-full justify-between `,children:[ae,W,G]}),t[44]=l,t[45]=H,t[46]=W,t[47]=K):K=t[47];let q;return t[48]!==C.isFetchingNextPage||t[49]!==C.loadNext||t[50]!==M||t[51]!==ie||t[52]!==h||t[53]!==N||t[54]!==I||t[55]!==L||t[56]!==R||t[57]!==z||t[58]!==V||t[59]!==K||t[60]!==x?(q=(0,Q.jsx)(ht,{items:ie,filteredItems:ie,value:I,query:h,resultsQuery:x,onQueryChange:g,open:L,onOpenChange:F,onSelectItem:R,hasNextPage:M,isFetchingNextPage:C.isFetchingNextPage,onLoadNext:C.loadNext,statusText:N,originControl:z,popupProps:B,renderItem:V,children:K}),t[48]=C.isFetchingNextPage,t[49]=C.loadNext,t[50]=M,t[51]=ie,t[52]=h,t[53]=N,t[54]=I,t[55]=L,t[56]=R,t[57]=z,t[58]=V,t[59]=K,t[60]=x,t[61]=q):q=t[61],q}function St(e){return[e.name,e]}var Ct=[1,2,3,4,5,6,0],wt=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Tt=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],Et={auto:`Choose automatically`,worktree:`Create a new worktree`,root:`Use the project checkout`,existing_worktree:`Use a specific checkout`},Dt={editingId:null,title:``,prompt:``,enabled:!0,scheduleMode:`fixed`,intervalMinutes:`15`,timeOfDay:`09:00`,weekdays:new Set([1,2,3,4,5]),projectId:``,threadId:``,workspaceMode:`worktree`,baseRef:`main`,startFromOrigin:!0,existingWorktreePath:``,modelKey:``,runtimeMode:`full-access`,interactionMode:`default`,baseModelSelection:null,signatureEnabled:!1,...ot,signatureSecret:``,maxDeliveryAgeMinutes:``,replayKey:``,coalesceKey:``,coalesceWindowSeconds:``,filters:[],savedFilters:[]};function Ot(e){let t=(0,mt.c)(18),{filters:n,onChange:r}=e,i;t[0]!==n||t[1]!==r?(i=(e,t)=>r(n.map((n,r)=>r===e?{...n,...t}:n)),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,Q.jsx)(dt,{children:`Filters`}),(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Run only when every filter matches. Other requests are logged as filtered. Separate “is one of” values with commas; a value can't contain a comma.`})]}),t[3]=o):o=t[3];let s=n.length>=16,c;t[4]!==n||t[5]!==r?(c=()=>r([...n,Qe()]),t[4]=n,t[5]=r,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(_,{}),t[7]=l):l=t[7];let u;t[8]!==s||t[9]!==c?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[o,(0,Q.jsxs)(ee,{className:`shrink-0`,variant:`outline`,size:`sm`,disabled:s,onClick:c,children:[l,`Add filter`]})]}),t[8]=s,t[9]=c,t[10]=u):u=t[10];let d;t[11]!==n||t[12]!==r||t[13]!==a?(d=n.map((e,t)=>(0,Q.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:`grid min-w-0 flex-1 grid-cols-1`,children:(0,Q.jsx)(Ee,{"aria-label":`Filter ${t+1} path`,placeholder:`body.action`,value:e.path,onChange:e=>a(t,{path:e.target.value})})}),(0,Q.jsx)(ee,{variant:`ghost`,size:`icon-sm`,"aria-label":`Remove filter ${t+1}`,onClick:()=>r(rt(n,e.id)),children:(0,Q.jsx)(p,{})})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(z,{value:e.op,onValueChange:e=>{let n=st.find(t=>t.op===e);n&&a(t,{op:n.op})},children:[(0,Q.jsx)(`div`,{className:`grid w-44 shrink-0 grid-cols-1`,children:(0,Q.jsx)(R,{size:`sm`,"aria-label":`Filter ${t+1} test`,children:(0,Q.jsx)(I,{children:st.find(t=>t.op===e.op)?.label})})}),(0,Q.jsx)(L,{children:st.map(kt)})]}),e.op===`exists`?null:(0,Q.jsx)(`div`,{className:`grid min-w-0 flex-1 grid-cols-1`,children:(0,Q.jsx)(Ee,{"aria-label":`Filter ${t+1} value`,placeholder:e.op===`in`?`opened, reopened`:`opened`,value:e.value,onChange:e=>a(t,{value:e.target.value})})})]})]},e.id)),t[11]=n,t[12]=r,t[13]=a,t[14]=d):d=t[14];let f;return t[15]!==u||t[16]!==d?(f=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[u,d]}),t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function kt(e){return(0,Q.jsx)(F,{value:e.op,children:e.label},e.op)}function $(e){let t=(0,mt.c)(11),{label:n,hint:r,htmlFor:i,children:a}=e,o;t[0]===n?o=t[1]:(o=(0,Q.jsx)(`span`,{children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=r?(0,Q.jsx)(`span`,{className:`font-normal text-2xs text-muted-foreground/80`,children:r}):null,t[2]=r,t[3]=s);let c;t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,Q.jsxs)(dt,{className:`flex items-baseline justify-between`,htmlFor:i,children:[o,s]}),t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==a||t[9]!==c?(l=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[c,a]}),t[8]=a,t[9]=c,t[10]=l):l=t[10],l}function At(e){let t=e.indexOf(`:`);return t<=0||t===e.length-1?null:{instanceId:A.make(e.slice(0,t)),model:e.slice(t+1)}}function jt(e){if(e.type===`webhook`)return`On webhook`;if(e.type===`interval`){let t=e.everyMs/6e4;return Number.isInteger(t)?`Every ${t} min`:`Every ${Math.round(e.everyMs/1e3)} sec`}let t=e.weekdays??[];return`${t.length===0?`Daily`:t.length===5&&t.every(e=>e>=1&&e<=5)?`Weekdays`:t.map(e=>wt[e]).join(`, `)} at ${e.timeOfDay}`}function Mt(e){if(!e)return`Not scheduled`;let t=new Date(e).getTime()-Date.now();if(t<=0){let t=de(e);return t?t.suffix?`${t.value} ${t.suffix}`:t.value:`Not scheduled`}let n=Math.ceil(t/6e4);if(n<2)return`in under a minute`;if(n<60)return`in ${n}m`;let r=Math.round(n/60);return r<24?`in ${r}h`:`in ${Math.round(r/24)}d`}function Nt(e){return e===`accepted`?`success`:e===`duplicate`||e===`coalesced`||e===`disabled`||e===`rate_limited`||e===`expired`?`warning`:e===`dispatch_failed`||e===`rejected_signature`?`error`:`outline`}function Pt(e){return e===`failed`?`error`:e===`succeeded`?`success`:e===`running`?`info`:`outline`}function Ft(e){let t=(0,mt.c)(35),{scope:n,environments:r,connectedEnvironments:i,environment:a}=He(),o;t[0]!==e.environmentId||t[1]!==e.threadId?(o=()=>e.threadId&&e.environmentId?{environmentId:e.environmentId,task:null}:null,t[0]=e.environmentId,t[1]=e.threadId,t[2]=o):o=t[2];let[c,l]=(0,Z.useState)(o),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(e,t)=>{l({environmentId:e,task:t})},t[3]=u):u=t[3];let d=u,f=a??i[0],p;t[4]===i?p=t[5]:(p=Lt(yt(i.map(It))),t[4]=i,t[5]=p);let m=s(p),g;if(t[6]!==i||t[7]!==m||t[8]!==f?.environmentId){let e;t[10]===m?e=t[11]:(e=(e,t)=>m[t],t[10]=m,t[11]=e);let n=i.filter(e);g=n.find(e=>e.environmentId===f?.environmentId)??n[0],t[6]=i,t[7]=m,t[8]=f?.environmentId,t[9]=g}else g=t[9];let v=g,y=!v,b;t[12]===v?b=t[13]:(b=()=>v&&l({environmentId:v.environmentId,task:null}),t[12]=v,t[13]=b);let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(_,{className:`size-3`}),t[14]=x):x=t[14];let S;t[15]!==y||t[16]!==b?(S=(0,Q.jsxs)(ee,{size:`xs`,variant:`ghost-muted`,disabled:y,onClick:b,children:[x,`New task`]}),t[15]=y,t[16]=b,t[17]=S):S=t[17];let C;t[18]!==f?.environmentId||t[19]!==r||t[20]!==n.kind||t[21]!==n.message||t[22]!==e.environmentId||t[23]!==e.taskId?(C=n.kind===`unavailable`?(0,Q.jsx)(Ke,{title:`Unavailable selection`,children:(0,Q.jsx)(Ue,{title:n.message})}):r.length===0?(0,Q.jsx)(Be,{children:(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(Ie,{variant:`icon`,children:(0,Q.jsx)(h,{})}),(0,Q.jsx)(Re,{children:`No environments available`}),(0,Q.jsx)(ze,{children:`Connect an environment to manage scheduled tasks.`})]})}):(0,Q.jsx)(`div`,{className:`space-y-8`,children:r.map(t=>(0,Q.jsx)(Rt,{environment:t,showEnvironmentHeading:r.length>1,taskId:(e.environmentId??f?.environmentId)===t.environmentId?e.taskId:void 0,onEdit:d},`${t.environmentId}:${e.taskId??``}`))}),t[18]=f?.environmentId,t[19]=r,t[20]=n.kind,t[21]=n.message,t[22]=e.environmentId,t[23]=e.taskId,t[24]=C):C=t[24];let w;t[25]!==S||t[26]!==C?(w=(0,Q.jsx)(Ke,{title:`Scheduled tasks`,variant:`plain`,headerAction:S,children:C}),t[25]=S,t[26]=C,t[27]=w):w=t[27];let T;t[28]!==c||t[29]!==e.projectId||t[30]!==e.threadId?(T=c?(0,Q.jsx)(qt,{initialThreadId:e.threadId,initialProjectId:e.projectId,initialEnvironmentId:c.environmentId,task:c.task,onClose:()=>l(null)},`${c.environmentId}:${c.task?.id??`new`}`):null,t[28]=c,t[29]=e.projectId,t[30]=e.threadId,t[31]=T):T=t[31];let E;return t[32]!==T||t[33]!==w?(E=(0,Q.jsxs)(We,{children:[w,T]}),t[32]=T,t[33]=w,t[34]=E):E=t[34],E}function It(e){return e.environmentId}var Lt=bt(`web-scheduled-task-create-permissions`,K.upsertScheduledTask.permissionAtom);function Rt(e){let t=(0,mt.c)(13),{environment:n,showEnvironmentHeading:r,taskId:i,onEdit:a}=e,{scope:o}=He(),s=n.connection.phase===`connected`&&n.serverConfig!==null,c;t[0]!==s||t[1]!==n.environmentId?(c=s?K.scheduledTasksLive({environmentId:n.environmentId,input:{}}):null,t[0]=s,t[1]=n.environmentId,t[2]=c):c=t[2];let l=se(c),u=l.data?.tasks.filter(e=>nt(o,n.environmentId,e.projectId)),d=u?.find(e=>e.id===i),f=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{!f.current&&d&&(f.current=!0,a(n.environmentId,d))},[n.environmentId,d,a]),qe(6e4);let p=Ke,m=n.label,h=!r,g;t[3]===n.serverConfig?g=t[4]:(g=k(n.serverConfig),t[3]=n.serverConfig,t[4]=g);let _;t[5]===g?_=t[6]:(_=(0,Q.jsx)(Ve,{kind:g,className:`size-3.5`}),t[5]=g,t[6]=_);let v=s?l.error?(0,Q.jsx)(Ue,{title:`Could not load scheduled tasks`,description:l.error}):u?(0,Q.jsxs)(Q.Fragment,{children:[i&&!d?(0,Q.jsx)(Ue,{title:`Task unavailable`,description:`This task was deleted or belongs to a different project. Check your project filter.`,role:`status`}):null,u.length===0?(0,Q.jsx)(Ue,{title:`No scheduled tasks`,description:`No tasks match this environment and project selection.`}):u.map(e=>(0,Q.jsx)(zt,{environmentId:n.environmentId,task:e,onEdit:()=>a(n.environmentId,e)},e.id))]}):(0,Q.jsx)(Ue,{title:`Loading scheduled tasks…`,role:`status`}):(0,Q.jsx)(Ue,{title:`Environment disconnected`,description:`Reconnect ${n.label} to view its scheduled tasks.`}),y;return t[7]!==p||t[8]!==n.label||t[9]!==h||t[10]!==_||t[11]!==v?(y=(0,Q.jsx)(p,{title:m,hideTitle:h,icon:_,children:v}),t[7]=p,t[8]=n.label,t[9]=h,t[10]=_,t[11]=v,t[12]=y):y=t[12],y}function zt(e){let t=(0,mt.c)(77),{environmentId:n,task:r,onEdit:a}=e,c;t[0]===n?c=t[1]:(c=K.upsertScheduledTask.permissionAtom(n),t[0]=n,t[1]=c);let u=s(c),[d,f]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),g=r.schedule.type===`webhook`,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_={label:`scheduled task enabled`},t[2]=_):_=t[2];let y=ce(K.setScheduledTaskEnabled,_),x;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(x={label:`scheduled task run now`},t[3]=x):x=t[3];let S=ce(K.runScheduledTaskNow,x),w;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w={label:`scheduled task delete`},t[4]=w):w=t[4];let D=ce(K.deleteScheduledTask,w),O;t[5]!==d||t[6]!==n||t[7]!==D||t[8]!==S||t[9]!==r.enabled||t[10]!==r.id||t[11]!==y?(O=async e=>{if(d||!oe(n,`orchestration:operate`))return;f(!0);let t=e===`toggle`?await y({environmentId:n,input:{id:r.id,enabled:!r.enabled}}):e===`run`?await S({environmentId:n,input:{id:r.id}}):await D({environmentId:n,input:{id:r.id}});f(!1),t._tag===`Failure`&&!ie(t)&&V.add(J({type:`error`,title:`Could not update scheduled task`,description:String(re(t))}))},t[5]=d,t[6]=n,t[7]=D,t[8]=S,t[9]=r.enabled,t[10]=r.id,t[11]=y,t[12]=O):O=t[12];let k=O,A=r.title,j;t[13]===r.prompt?j=t[14]:(j=(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:r.prompt}),t[13]=r.prompt,t[14]=j);let M;t[15]===r.schedule?M=t[16]:(M=jt(r.schedule),t[15]=r.schedule,t[16]=M);let N;t[17]!==g||t[18]!==r.enabled||t[19]!==r.nextRunAt?(N=r.enabled?g?`Listening`:r.nextRunAt?`Next run ${Mt(r.nextRunAt)}`:`Not scheduled`:`Paused`,t[17]=g,t[18]=r.enabled,t[19]=r.nextRunAt,t[20]=N):N=t[20];let P;t[21]!==M||t[22]!==N?(P=(0,Q.jsxs)(`span`,{children:[M,` ·`,` `,N]}),t[21]=M,t[22]=N,t[23]=P):P=t[23];let F;t[24]===r.lastRunStatus?F=t[25]:(F=r.lastRunStatus===`never`?null:(0,Q.jsx)(v,{variant:Pt(r.lastRunStatus),children:r.lastRunStatus}),t[24]=r.lastRunStatus,t[25]=F);let I;t[26]===r.lastRunError?I=t[27]:(I=r.lastRunError?(0,Q.jsx)(`span`,{className:`text-destructive`,children:r.lastRunError}):null,t[26]=r.lastRunError,t[27]=I);let L;t[28]!==P||t[29]!==F||t[30]!==I?(L=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[P,F,I]}),t[28]=P,t[29]=F,t[30]=I,t[31]=L):L=t[31];let R=d||!u,z=`Enable ${r.title}`,B;t[32]===k?B=t[33]:(B=()=>void k(`toggle`),t[32]=k,t[33]=B);let H;t[34]!==R||t[35]!==z||t[36]!==B||t[37]!==r.enabled?(H=(0,Q.jsx)(lt,{checked:r.enabled,disabled:R,"aria-label":z,onCheckedChange:B}),t[34]=R,t[35]=z,t[36]=B,t[37]=r.enabled,t[38]=H):H=t[38];let U=d||!u,ae=`Actions for ${r.title}`,W;t[39]!==U||t[40]!==ae?(W=(0,Q.jsx)(ee,{size:`icon-sm`,variant:`ghost`,disabled:U,"aria-label":ae}),t[39]=U,t[40]=ae,t[41]=W):W=t[41];let G;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(i,{className:`size-4`}),t[42]=G):G=t[42];let q;t[43]===W?q=t[44]:(q=(0,Q.jsx)(C,{render:W,children:G}),t[43]=W,t[44]=q);let se;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Q.jsx)(o,{}),t[45]=se):se=t[45];let Y;t[46]===a?Y=t[47]:(Y=(0,Q.jsxs)(ne,{onClick:a,children:[se,`Edit`]}),t[46]=a,t[47]=Y);let le;t[48]!==k||t[49]!==g?(le=g?(0,Q.jsxs)(ne,{onClick:()=>h(!0),children:[(0,Q.jsx)(l,{}),`Deliveries`]}):(0,Q.jsxs)(ne,{onClick:()=>void k(`run`),children:[(0,Q.jsx)(T,{}),`Run now`]}),t[48]=k,t[49]=g,t[50]=le):le=t[50];let X;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(te,{}),t[51]=X):X=t[51];let ue;t[52]===k?ue=t[53]:(ue=()=>void k(`delete`),t[52]=k,t[53]=ue);let de;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Q.jsx)(p,{}),t[54]=de):de=t[54];let fe;t[55]===ue?fe=t[56]:(fe=(0,Q.jsxs)(ne,{onClick:ue,children:[de,`Delete`]}),t[55]=ue,t[56]=fe);let pe;t[57]!==Y||t[58]!==le||t[59]!==fe?(pe=(0,Q.jsxs)(E,{align:`end`,children:[Y,le,X,fe]}),t[57]=Y,t[58]=le,t[59]=fe,t[60]=pe):pe=t[60];let me;t[61]!==q||t[62]!==pe?(me=(0,Q.jsxs)(b,{children:[q,pe]}),t[61]=q,t[62]=pe,t[63]=me):me=t[63];let he;t[64]!==m||t[65]!==n||t[66]!==r?(he=m?(0,Q.jsx)(Bt,{environmentId:n,task:r,onClose:()=>h(!1)}):null,t[64]=m,t[65]=n,t[66]=r,t[67]=he):he=t[67];let ge;t[68]!==H||t[69]!==me||t[70]!==he?(ge=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[H,me,he]}),t[68]=H,t[69]=me,t[70]=he,t[71]=ge):ge=t[71];let _e;return t[72]!==L||t[73]!==ge||t[74]!==j||t[75]!==r.title?(_e=(0,Q.jsx)(Ue,{title:A,description:j,status:L,control:ge}),t[72]=L,t[73]=ge,t[74]=j,t[75]=r.title,t[76]=_e):_e=t[76],_e}function Bt(e){let t=(0,mt.c)(38),{environmentId:n,task:r,onClose:i}=e,a;t[0]!==n||t[1]!==r.id?(a=K.scheduledTaskWebhookDeliveries({environmentId:n,input:{id:r.id,acceptAnyOutcome:!0}}),t[0]=n,t[1]=r.id,t[2]=a):a=t[2];let o=se(a),[s,c]=(0,Z.useState)(null),l;t[3]!==n||t[4]!==s||t[5]!==r.id?(l=s===null?null:K.scheduledTaskWebhookDelivery({environmentId:n,input:{id:r.id,deliveryId:s,acceptAnyOutcome:!0}}),t[3]=n,t[4]=s,t[5]=r.id,t[6]=l):l=t[6];let u=se(l),d=o.data?.deliveries??null,f=u.data?.delivery??null,p=s===null?o.error:u.error,m;t[7]===i?m=t[8]:(m=e=>{e||i()},t[7]=i,t[8]=m);let h;t[9]===r.title?h=t[10]:(h=(0,Q.jsxs)(ke,{children:[`Deliveries · `,r.title]}),t[9]=r.title,t[10]=h);let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(Ne,{children:`Recent requests to this task's webhook URL.`}),t[11]=g):g=t[11];let _;t[12]===h?_=t[13]:(_=(0,Q.jsxs)(Oe,{children:[h,g]}),t[12]=h,t[13]=_);let y;t[14]===p?y=t[15]:(y=p?(0,Q.jsx)(`p`,{className:`text-sm text-destructive`,children:p}):null,t[14]=p,t[15]=y);let b;t[16]!==d||t[17]!==f||t[18]!==s||t[19]!==u.error?(b=s!==null&&f===null&&u.error===null?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Loading delivery…`}):f?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,Q.jsx)(v,{variant:Nt(f.pendingWindow?`coalesced`:f.outcome),children:at(f)}),(0,Q.jsxs)(`span`,{children:[f.method,` · `,Mt(f.receivedAt)]}),f.signatureVerified?(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Signature verified`}):null]}),f.error?(0,Q.jsx)(`p`,{className:f.outcome===`filtered`?`text-sm text-muted-foreground`:`text-sm text-destructive`,children:f.error}):null,(0,Q.jsx)(Ht,{title:f.pendingWindow?`Scheduled run`:`Prompt sent to the agent`,children:f.renderedPrompt??(f.pendingWindow?`Run scheduled when the window closes; no run started yet.`:`No run was started for this request.`)}),f.missingFields.length>0?(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Empty placeholders: `,f.missingFields.join(`, `)]}):null,(0,Q.jsx)(Ht,{title:`Headers`,children:Object.entries(f.headers).map(Vt).join(`
4
4
  `)}),f.query?(0,Q.jsx)(Ht,{title:`Query`,children:f.query}):null,(0,Q.jsx)(Ht,{title:f.bodyTruncated?`Body (truncated)`:`Body`,children:f.body||`(empty)`})]}):s===null?d===null?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Loading deliveries…`}):d.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No requests yet.`}):(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:d.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,className:`flex w-full flex-wrap items-center gap-2 py-2 text-left text-sm hover:bg-accent/40`,onClick:()=>c(e.id),children:[(0,Q.jsx)(v,{variant:Nt(e.pendingWindow?`coalesced`:e.outcome),children:at(e)}),(0,Q.jsx)(`span`,{children:e.method}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:Mt(e.receivedAt)}),e.outcome===`filtered`&&e.error?(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:e.error}):null,e.missingFields.length>0?(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.missingFields.length,` empty placeholder`,e.missingFields.length===1?``:`s`]}):null]})},e.id))}):null,t[16]=d,t[17]=f,t[18]=s,t[19]=u.error,t[20]=b):b=t[20];let x;t[21]!==y||t[22]!==b?(x=(0,Q.jsxs)(Me,{children:[y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23];let S;t[24]!==o.isPending||t[25]!==o.refresh||t[26]!==s?(S=s===null?(0,Q.jsx)(ee,{variant:`outline`,size:`sm`,disabled:o.isPending,onClick:o.refresh,children:`Refresh`}):(0,Q.jsx)(ee,{variant:`outline`,size:`sm`,onClick:()=>c(null),children:`Back`}),t[24]=o.isPending,t[25]=o.refresh,t[26]=s,t[27]=S):S=t[27];let C;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(je,{render:(0,Q.jsx)(ee,{size:`sm`}),children:`Done`}),t[28]=C):C=t[28];let w;t[29]===S?w=t[30]:(w=(0,Q.jsxs)(Ae,{children:[S,C]}),t[29]=S,t[30]=w);let T;t[31]!==w||t[32]!==_||t[33]!==x?(T=(0,Q.jsxs)(Pe,{className:`max-w-2xl`,children:[_,x,w]}),t[31]=w,t[32]=_,t[33]=x,t[34]=T):T=t[34];let E;return t[35]!==T||t[36]!==m?(E=(0,Q.jsx)(Fe,{open:!0,onOpenChange:m,children:T}),t[35]=T,t[36]=m,t[37]=E):E=t[37],E}function Vt(e){let[t,n]=e;return`${t}: ${n}`}function Ht(e){let t=(0,mt.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(dt,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs whitespace-pre-wrap break-all`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ut(e){let t=(0,mt.c)(40),{environmentId:n,task:r}=e,i;t[0]===n?i=t[1]:(i=K.rotateScheduledTaskWebhookToken.permissionAtom(n),t[0]=n,t[1]=i);let a=s(i),o=U(n),c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={target:`webhook URL`},t[2]=c):c=t[2];let{copyToClipboard:l,isCopied:u}=H(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={label:`scheduled task rotate webhook token`},t[3]=d):d=t[3];let p=ce(K.rotateScheduledTaskWebhookToken,d),[m,h]=(0,Z.useState)(!1),g=r?.webhook;if(!r||!g){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The URL appears after you save.`}),t[4]=e):e=t[4],e}let _;t[5]!==g||t[6]!==o?(_=vt(g,o),t[5]=g,t[6]=o,t[7]=_):_=t[7];let{address:v,copyable:y,note:b}=_,x;t[8]!==n||t[9]!==p||t[10]!==r?(x=async()=>{if(!(await W(`Rotate this webhook URL?
5
5
  The current URL stops working.`,{variant:`destructive`})??window.confirm(`Rotate this webhook URL? The current URL stops working.`)))return;h(!0);let e=await p({environmentId:n,input:{id:r.id}});h(!1),e._tag===`Failure`&&!ie(e)&&V.add(J({type:`error`,title:`Could not rotate webhook URL`,description:String(re(e))}))},t[8]=n,t[9]=p,t[10]=r,t[11]=x):x=t[11];let S=x,C;t[12]===v?C=t[13]:(C=(0,Q.jsx)(Ee,{readOnly:!0,"aria-label":`Webhook URL`,value:v,onFocus:Wt}),t[12]=v,t[13]=C);let w=!y,T;t[14]!==l||t[15]!==v?(T=()=>l(v,void 0),t[14]=l,t[15]=v,t[16]=T):T=t[16];let E;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(f,{}),t[17]=E):E=t[17];let te=u?`Copied`:`Copy`,D;t[18]!==te||t[19]!==w||t[20]!==T?(D=(0,Q.jsxs)(ee,{size:`sm`,variant:`outline`,type:`button`,disabled:w,onClick:T,children:[E,te]}),t[18]=te,t[19]=w,t[20]=T,t[21]=D):D=t[21];let ne=m||!a,O;t[22]===S?O=t[23]:(O=()=>void S(),t[22]=S,t[23]=O);let k;t[24]!==ne||t[25]!==O?(k=(0,Q.jsx)(ee,{size:`sm`,variant:`outline`,type:`button`,disabled:ne,onClick:O,children:`Rotate`}),t[24]=ne,t[25]=O,t[26]=k):k=t[26];let A;t[27]!==D||t[28]!==k||t[29]!==C?(A=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,D,k]}),t[27]=D,t[28]=k,t[29]=C,t[30]=A):A=t[30];let j;t[31]===b?j=t[32]:(j=b===null?null:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b}),t[31]=b,t[32]=j);let M;t[33]!==g.url||t[34]!==n?(M=g.url===null?null:(0,Q.jsx)(Gt,{environmentId:n}),t[33]=g.url,t[34]=n,t[35]=M):M=t[35];let N;return t[36]!==A||t[37]!==j||t[38]!==M?(N=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[A,j,M]}),t[36]=A,t[37]=j,t[38]=M,t[39]=N):N=t[39],N}function Wt(e){return e.currentTarget.select()}function Gt(e){let t=(0,mt.c)(3),{environmentId:n}=e,r=Ye();if(r.target?.environmentId!==n||r.data===null)return null;let i=r.data.holdWebhooksWhileOffline?`Held for up to 24 hours while this environment is offline. `:`Forwarded live. Requests fail while this environment is offline. `,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(B,{to:`/settings/connections`,className:`underline underline-offset-2`,children:`Change in Connections`}),t[0]=a):a=t[0];let o;return t[1]===i?o=t[2]:(o=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i,a]}),t[1]=i,t[2]=o),o}function Kt(e){let t=(0,mt.c)(6),{environmentId:n,threadId:r}=e,i;t[0]!==n||t[1]!==r?(i=r===null?null:c(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a=i,o=P(a),s;return t[3]!==a||t[4]!==o?.title?(s=(0,Q.jsx)($,{label:`Destination`,children:a===null?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Each run starts a new thread with the workspace and model below.`}):(0,Q.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,Q.jsx)(`p`,{className:`wrap-anywhere`,children:o?.title.trim()||`Thread ${a.threadId}`}),(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`Each run continues this conversation, in its workspace and with its current model.`})]})}),t[3]=a,t[4]=o?.title,t[5]=s):s=t[5],s}function qt(e){let t=(0,mt.c)(211),{initialEnvironmentId:n,initialThreadId:r,initialProjectId:i,task:o,onClose:c}=e,{scope:l,connectedEnvironments:u}=He(),[d,f]=(0,Z.useState)(n),p=ae(d),h=p?.connection.phase===`connected`&&p.serverConfig!==null,_;t[0]!==h||t[1]!==d?(_=h?K.scheduledTasksLive({environmentId:d,input:{}}):null,t[0]=h,t[1]=d,t[2]=_):_=t[2];let v=se(_),b=N(),x;if(t[3]!==b||t[4]!==d||t[5]!==l){let e;t[7]!==d||t[8]!==l?(e=e=>e.environmentId===d&&nt(l,d,e.id),t[7]=d,t[8]=l,t[9]=e):e=t[9],x=b.filter(e),t[3]=b,t[4]=d,t[5]=l,t[6]=x}else x=t[6];let S=x,C=G(d),w=s(K.providersValueAtom(d))??q,T;t[10]===d?T=t[11]:(T=K.upsertScheduledTask.permissionAtom(d),t[10]=d,t[11]=T);let E=s(T),te;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(te={label:`scheduled task upsert`},t[12]=te):te=t[12];let D=ce(K.upsertScheduledTask,te),ne;t[13]!==i||t[14]!==r||t[15]!==S[0]?.id||t[16]!==o?(ne=()=>o?Xe(o):{...Dt,projectId:i??S[0]?.id??``,threadId:r??``},t[13]=i,t[14]=r,t[15]=S[0]?.id,t[16]=o,t[17]=ne):ne=t[17];let[A,j]=(0,Z.useState)(ne),[P,B]=(0,Z.useState)(!1),V=(0,Z.useRef)(!1),H;t[18]!==A.editingId||t[19]!==v.data?(H=A.editingId!==null&&v.data!==null&&!v.data.tasks.some(e=>e.id===A.editingId),t[18]=A.editingId,t[19]=v.data,t[20]=H):H=t[20];let U=H,W;t[21]!==A.editingId||t[22]!==o||t[23]!==v.data?(W=v.data?v.data.tasks.find(e=>e.id===A.editingId)??null:o,t[21]=A.editingId,t[22]=o,t[23]=v.data,t[24]=W):W=t[24];let J=W,Y=A.projectId||S[0]?.id||``,le;if(t[25]!==S||t[26]!==Y){let e;t[28]===Y?e=t[29]:(e=e=>e.id===Y,t[28]=Y,t[29]=e),le=S.find(e),t[25]=S,t[26]=Y,t[27]=le}else le=t[27];let X=le;X?.id;let ue;t[30]!==w||t[31]!==X?.id||t[32]!==C?(ue=y(m(g(w),C,X?.id??null)),t[30]=w,t[31]=X?.id,t[32]=C,t[33]=ue):ue=t[33];let de=ue,fe=de[0],pe;t[34]===A.modelKey?pe=t[35]:(pe=A.modelKey?At(A.modelKey):null,t[34]=A.modelKey,t[35]=pe);let me=pe,ve;t[36]!==me||t[37]!==de||t[38]!==X||t[39]!==C?(ve=me&&de.some(e=>e.instanceId===me.instanceId&&e.enabled)?me:et(C,X??null,de),t[36]=me,t[37]=de,t[38]=X,t[39]=C,t[40]=ve):ve=t[40];let ye=ve,be=ye?.instanceId??fe?.instanceId??``,xe=ye?.model??``,Se;t[41]!==be||t[42]!==xe||t[43]!==w||t[44]!==C?(Se=a(C,w,be,xe),t[41]=be,t[42]=xe,t[43]=w,t[44]=C,t[45]=Se):Se=t[45];let Ce=Se,we=Qt,Te;t[46]!==ye||t[47]!==h||t[48]!==A||t[49]!==U||t[50]!==d||t[51]!==J||t[52]!==c||t[53]!==S||t[54]!==P||t[55]!==Y||t[56]!==v.data||t[57]!==D?(Te=async()=>{if(!oe(d,`orchestration:operate`)||V.current||P||U||!h||v.data===null)return;let e=ye;if(!A.title.trim()||!A.prompt.trim()||!S.some(e=>e.id===Y)||e===null){we(`Scheduled task is incomplete`,`Add a title, prompt, project, and model.`);return}let t=$e(A.filters);if(A.scheduleMode===`webhook`&&`error`in t){we(`Invalid filter`,t.error);return}let n=it(A);if(n===null){for(let e of Ze(A))we(e.title,e.description);return}if(n.type===`webhook`&&n.signature&&(!n.signature.header||!n.signature.secret&&!(J?.schedule.type===`webhook`&&J.webhook?.hasSecret))){we(`Signing secret is required`,`Enter the signature header and secret.`);return}if(n.type===`interval`&&(!Number.isSafeInteger(n.everyMs)||n.everyMs<6e4)){we(`Invalid interval`,`Enter an interval of at least one minute.`);return}if(A.workspaceMode===`existing_worktree`&&!A.existingWorktreePath.trim()){we(`Checkout path is required`,`Enter the path of the checkout to run in.`);return}let r=A.baseModelSelection!==null&&A.baseModelSelection.instanceId===e.instanceId&&A.baseModelSelection.model===e.model?A.baseModelSelection:e,i=A.workspaceMode===`root`?{type:`root`}:A.workspaceMode===`existing_worktree`?{type:`existing_worktree`,worktreePath:A.existingWorktreePath.trim()}:{type:A.workspaceMode,baseRef:A.baseRef.trim()||`main`,startFromOrigin:A.startFromOrigin},a={...A.editingId?{id:A.editingId,requireExisting:!0}:{},title:A.title.trim(),prompt:A.prompt.trim(),enabled:A.enabled,schedule:n,projectId:Y,threadId:A.threadId?A.threadId:null,workspaceStrategy:i,modelSelection:r,runtimeMode:A.runtimeMode,interactionMode:A.interactionMode,creationSource:`web`};V.current=!0,B(!0);let o=await D({environmentId:d,input:a});B(!1),o._tag===`Failure`?(V.current=!1,ie(o)||we(`Could not save scheduled task`,re(o))):c()},t[46]=ye,t[47]=h,t[48]=A,t[49]=U,t[50]=d,t[51]=J,t[52]=c,t[53]=S,t[54]=P,t[55]=Y,t[56]=v.data,t[57]=D,t[58]=Te):Te=t[58];let De=Te,Ie;t[59]!==c||t[60]!==P?(Ie=e=>{!e&&!P&&c()},t[59]=c,t[60]=P,t[61]=Ie):Ie=t[61];let Le=A.editingId?`Edit task`:`New task`,Re;t[62]===Le?Re=t[63]:(Re=(0,Q.jsx)(ke,{children:Le}),t[62]=Le,t[63]=Re);let ze;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,Q.jsx)(Ne,{children:`Run a prompt automatically — on an interval, at a fixed time, or when a webhook is called.`}),t[64]=ze):ze=t[64];let Be;t[65]===Re?Be=t[66]:(Be=(0,Q.jsxs)(Oe,{children:[Re,ze]}),t[65]=Re,t[66]=Be);let Ue;t[67]===h?Ue=t[68]:(Ue=h?null:(0,Q.jsx)(`p`,{className:`text-sm text-destructive`,children:`Reconnect this environment before saving.`}),t[67]=h,t[68]=Ue);let We=o!==null||P,Ke;t[69]===u?Ke=t[70]:(Ke=e=>{let t=u.find(t=>t.environmentId===e);t&&(f(t.environmentId),j(Zt))},t[69]=u,t[70]=Ke);let qe=p?.serverConfig??null,Je;t[71]===qe?Je=t[72]:(Je=k(qe),t[71]=qe,t[72]=Je);let Ye;t[73]===Je?Ye=t[74]:(Ye=(0,Q.jsx)(Ve,{kind:Je,className:`size-4`}),t[73]=Je,t[74]=Ye);let Qe=p?.label??`Unavailable environment`,rt;t[75]!==Ye||t[76]!==Qe?(rt=(0,Q.jsx)(R,{id:`scheduled-task-environment`,size:`sm`,children:(0,Q.jsx)(I,{children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[Ye,Qe]})})}),t[75]=Ye,t[76]=Qe,t[77]=rt):rt=t[77];let at;t[78]===u?at=t[79]:(at=u.map(Xt),t[78]=u,t[79]=at);let ot;t[80]===at?ot=t[81]:(ot=(0,Q.jsx)(L,{children:at}),t[80]=at,t[81]=ot);let st;t[82]!==d||t[83]!==We||t[84]!==Ke||t[85]!==rt||t[86]!==ot?(st=(0,Q.jsx)($,{label:`Runs on`,htmlFor:`scheduled-task-environment`,children:(0,Q.jsxs)(z,{value:d,disabled:We,onValueChange:Ke,children:[rt,ot]})}),t[82]=d,t[83]=We,t[84]=Ke,t[85]=rt,t[86]=ot,t[87]=st):st=t[87];let ct;t[88]===v.error?ct=t[89]:(ct=v.error?(0,Q.jsx)(`p`,{className:`text-sm text-destructive`,role:`status`,children:v.error}):null,t[88]=v.error,t[89]=ct);let ut;t[90]===U?ut=t[91]:(ut=U?(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,role:`status`,children:`This scheduled task no longer exists.`}):null,t[90]=U,t[91]=ut);let ft;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(ft=e=>j(t=>({...t,title:e.target.value})),t[92]=ft):ft=t[92];let ht;t[93]===A.title?ht=t[94]:(ht=(0,Q.jsx)($,{label:`Name`,htmlFor:`scheduled-task-title`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-title`,placeholder:`e.g. Check for Sentry issues`,value:A.title,onChange:ft})}),t[93]=A.title,t[94]=ht);let gt=A.threadId?A.threadId:null,_t;t[95]!==d||t[96]!==gt?(_t=(0,Q.jsx)(Kt,{environmentId:d,threadId:gt}),t[95]=d,t[96]=gt,t[97]=_t):_t=t[97];let vt;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(vt=e=>j(t=>({...t,projectId:e??``})),t[98]=vt):vt=t[98];let yt=X?.title,bt;t[99]===yt?bt=t[100]:(bt=(0,Q.jsx)(R,{size:`sm`,id:`scheduled-task-project`,children:(0,Q.jsx)(I,{placeholder:`Select a project`,children:yt})}),t[99]=yt,t[100]=bt);let St;t[101]===S?St=t[102]:(St=S.map(Yt),t[101]=S,t[102]=St);let wt;t[103]===St?wt=t[104]:(wt=(0,Q.jsx)(L,{children:St}),t[103]=St,t[104]=wt);let Tt;t[105]!==Y||t[106]!==bt||t[107]!==wt?(Tt=(0,Q.jsx)($,{label:`Project`,htmlFor:`scheduled-task-project`,children:(0,Q.jsxs)(z,{value:Y,onValueChange:vt,children:[bt,wt]})}),t[105]=Y,t[106]=bt,t[107]=wt,t[108]=Tt):Tt=t[108];let kt;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(kt=e=>j(t=>({...t,workspaceMode:e})),t[109]=kt):kt=t[109];let jt=Et[A.workspaceMode],Mt;t[110]===jt?Mt=t[111]:(Mt=(0,Q.jsx)(R,{size:`sm`,id:`scheduled-task-workspace`,children:(0,Q.jsx)(I,{children:jt})}),t[110]=jt,t[111]=Mt);let Nt;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,Q.jsxs)(L,{children:[(0,Q.jsx)(F,{value:`auto`,children:`Choose automatically`}),(0,Q.jsx)(F,{value:`worktree`,children:`Create a new worktree`}),(0,Q.jsx)(F,{value:`root`,children:`Use the project checkout`}),(0,Q.jsx)(F,{value:`existing_worktree`,children:`Use a specific checkout`})]}),t[112]=Nt):Nt=t[112];let Pt;t[113]!==A.workspaceMode||t[114]!==Mt?(Pt=(0,Q.jsx)($,{label:`Workspace`,htmlFor:`scheduled-task-workspace`,children:(0,Q.jsxs)(z,{value:A.workspaceMode,onValueChange:kt,children:[Mt,Nt]})}),t[113]=A.workspaceMode,t[114]=Mt,t[115]=Pt):Pt=t[115];let Ft;t[116]!==Tt||t[117]!==Pt?(Ft=(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Tt,Pt]}),t[116]=Tt,t[117]=Pt,t[118]=Ft):Ft=t[118];let It;t[119]!==h||t[120]!==A.baseRef||t[121]!==A.startFromOrigin||t[122]!==A.workspaceMode||t[123]!==d||t[124]!==P||t[125]!==X?.workspaceRoot||t[126]!==Y?(It=A.workspaceMode===`worktree`||A.workspaceMode===`auto`?(0,Q.jsx)($,{label:`Base branch`,htmlFor:`scheduled-task-base-ref`,children:(0,Q.jsx)(xt,{id:`scheduled-task-base-ref`,environmentId:d,cwd:X?.workspaceRoot??null,value:A.baseRef,onValueChange:e=>j(t=>({...t,baseRef:e})),startFromOrigin:A.startFromOrigin,onStartFromOriginChange:e=>j(t=>({...t,startFromOrigin:e})),disabled:P||!h},`${d}:${Y}`)}):null,t[119]=h,t[120]=A.baseRef,t[121]=A.startFromOrigin,t[122]=A.workspaceMode,t[123]=d,t[124]=P,t[125]=X?.workspaceRoot,t[126]=Y,t[127]=It):It=t[127];let Lt;t[128]!==A.existingWorktreePath||t[129]!==A.workspaceMode?(Lt=A.workspaceMode===`existing_worktree`?(0,Q.jsx)($,{label:`Checkout path`,htmlFor:`scheduled-task-checkout`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-checkout`,value:A.existingWorktreePath,placeholder:`/path/to/checkout`,onChange:e=>j(t=>({...t,existingWorktreePath:M(t.existingWorktreePath,e.target.value)}))})}):null,t[128]=A.existingWorktreePath,t[129]=A.workspaceMode,t[130]=Lt):Lt=t[130];let Rt;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=e=>j(t=>({...t,prompt:e.target.value})),t[131]=Rt):Rt=t[131];let zt;t[132]===A.prompt?zt=t[133]:(zt=(0,Q.jsx)($,{label:`Prompt`,htmlFor:`scheduled-task-prompt`,children:(0,Q.jsx)(he,{id:`scheduled-task-prompt`,className:`max-h-64 overflow-y-auto`,placeholder:`What should the agent do each time this runs?`,value:A.prompt,onChange:Rt})}),t[132]=A.prompt,t[133]=zt);let Bt=P||!h,Vt;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=(e,t)=>j(n=>({...n,modelKey:`${e}:${t}`})),t[134]=Vt):Vt=t[134];let Ht;t[135]!==be||t[136]!==xe||t[137]!==d||t[138]!==de||t[139]!==Ce||t[140]!==Bt?(Ht=(0,Q.jsx)($,{label:`Model`,children:(0,Q.jsx)(`div`,{children:(0,Q.jsx)(pt,{environmentId:d,disabled:Bt,activeInstanceId:be,model:xe,lockedProvider:null,instanceEntries:de,modelOptionsByInstance:Ce,isComposerOwned:!1,triggerClassName:Ge,onInstanceModelChange:Vt})})}),t[135]=be,t[136]=xe,t[137]=d,t[138]=de,t[139]=Ce,t[140]=Bt,t[141]=Ht):Ht=t[141];let Wt;t[142]===o?Wt=t[143]:(Wt=o?.schedule.type===`interval`&&o.schedule.everyMs<6e4?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`This task uses a legacy interval below one minute. Saving updates it to at least one minute.`}):null,t[142]=o,t[143]=Wt);let Gt;t[144]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=(0,Q.jsx)(dt,{children:`Schedule`}),t[144]=Gt):Gt=t[144];let qt;t[145]===A.scheduleMode?qt=t[146]:(qt=[A.scheduleMode],t[145]=A.scheduleMode,t[146]=qt);let $t,en,tn,nn;t[147]===Symbol.for(`react.memo_cache_sentinel`)?($t=e=>{let t=e[0];(t===`fixed`||t===`interval`||t===`webhook`)&&j(e=>({...e,scheduleMode:t,prompt:t===`webhook`&&!e.prompt.trim()?tt:e.prompt}))},en=(0,Q.jsx)(_e,{value:`fixed`,children:`At a time`}),tn=(0,Q.jsx)(_e,{value:`interval`,children:`Every interval`}),nn=(0,Q.jsx)(_e,{value:`webhook`,children:`On webhook`}),t[147]=$t,t[148]=en,t[149]=tn,t[150]=nn):($t=t[147],en=t[148],tn=t[149],nn=t[150]);let rn;t[151]===qt?rn=t[152]:(rn=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[Gt,(0,Q.jsxs)(ge,{"aria-label":`Schedule type`,value:qt,onValueChange:$t,children:[en,tn,nn]})]}),t[151]=qt,t[152]=rn);let an;t[153]!==A.coalesceKey||t[154]!==A.coalesceWindowSeconds||t[155]!==A.filters||t[156]!==A.intervalMinutes||t[157]!==A.maxDeliveryAgeMinutes||t[158]!==A.replayKey||t[159]!==A.scheduleMode||t[160]!==A.signatureEnabled||t[161]!==A.signatureEncoding||t[162]!==A.signatureHeader||t[163]!==A.signaturePrefix||t[164]!==A.signatureSecret||t[165]!==A.timeOfDay||t[166]!==A.weekdays||t[167]!==d||t[168]!==J?(an=A.scheduleMode===`webhook`?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(Ut,{environmentId:d,task:J}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Each request runs the prompt. Use {{body.path}}, {{headers.name}}, {{query.name}}, {{body}} or {{request}} in the prompt; only what it names reaches the agent.`}),(0,Q.jsx)($,{label:`Skip requests older than`,hint:`minutes, optional`,htmlFor:`scheduled-task-max-age`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-max-age`,type:`number`,nativeInput:!0,min:1,max:O,placeholder:`Run every request`,value:A.maxDeliveryAgeMinutes,onChange:e=>j(t=>({...t,maxDeliveryAgeMinutes:e.target.value}))})}),(0,Q.jsx)(Ot,{filters:A.filters,onChange:e=>j(t=>({...t,filters:e}))}),(0,Q.jsx)($,{label:`Duplicate request key`,hint:`template, optional`,htmlFor:`scheduled-task-replay-key`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-replay-key`,placeholder:`{{headers.delivery-id}}`,value:A.replayKey,onChange:e=>j(t=>({...t,replayKey:e.target.value}))})}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Requests with the same key run only once within 7 days.`}),(0,Q.jsx)($,{label:`Coalesce key`,hint:`template, optional`,htmlFor:`scheduled-task-coalesce-key`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-coalesce-key`,placeholder:`{{body.id}}`,value:A.coalesceKey,onChange:e=>j(t=>({...t,coalesceKey:e.target.value}))})}),(0,Q.jsx)($,{label:`Coalesce window`,hint:`seconds, 10–3600`,htmlFor:`scheduled-task-coalesce-window`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-coalesce-window`,type:`number`,nativeInput:!0,min:10,max:3600,placeholder:`120`,value:A.coalesceWindowSeconds,onChange:e=>j(t=>({...t,coalesceWindowSeconds:e.target.value}))})}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Coalescing runs the latest payload once when the window from the first delivery closes. Empty keys run normally.`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,Q.jsx)(dt,{htmlFor:`scheduled-task-signature`,children:`Require signature`}),(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reject requests without a valid HMAC-SHA256 signature of the body.`})]}),(0,Q.jsx)(lt,{id:`scheduled-task-signature`,checked:A.signatureEnabled,onCheckedChange:e=>j(t=>({...t,signatureEnabled:e}))})]}),A.signatureEnabled?(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsx)($,{label:`Header`,htmlFor:`scheduled-task-signature-header`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-signature-header`,value:A.signatureHeader,onChange:e=>j(t=>({...t,signatureHeader:e.target.value}))})}),(0,Q.jsx)($,{label:`Prefix`,htmlFor:`scheduled-task-signature-prefix`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-signature-prefix`,value:A.signaturePrefix,placeholder:`None`,onChange:e=>j(t=>({...t,signaturePrefix:e.target.value}))})}),(0,Q.jsx)($,{label:`Encoding`,htmlFor:`scheduled-task-signature-encoding`,children:(0,Q.jsxs)(z,{value:A.signatureEncoding,onValueChange:e=>j(t=>({...t,signatureEncoding:e===`base64`?`base64`:`hex`})),children:[(0,Q.jsx)(R,{size:`sm`,id:`scheduled-task-signature-encoding`,children:(0,Q.jsx)(I,{children:A.signatureEncoding})}),(0,Q.jsxs)(L,{children:[(0,Q.jsx)(F,{value:`hex`,children:`hex`}),(0,Q.jsx)(F,{value:`base64`,children:`base64`})]})]})}),(0,Q.jsx)($,{label:`Secret`,htmlFor:`scheduled-task-signature-secret`,children:(0,Q.jsx)(Ee,{id:`scheduled-task-signature-secret`,type:`password`,autoComplete:`off`,value:A.signatureSecret,placeholder:J?.schedule.type===`webhook`&&J.webhook?.hasSecret?`Unchanged`:`Shared secret`,onChange:e=>j(t=>({...t,signatureSecret:e.target.value}))})})]}):null]}):A.scheduleMode===`fixed`?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(dt,{htmlFor:`scheduled-task-time`,children:`Run at`}),(0,Q.jsx)(Ee,{type:`time`,id:`scheduled-task-time`,nativeInput:!0,className:`w-32`,value:A.timeOfDay,onChange:e=>j(t=>({...t,timeOfDay:e.target.value}))}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`on`})]}),(0,Q.jsx)(ge,{multiple:!0,variant:`outline`,size:`sm`,"aria-label":`Days to run`,value:[...A.weekdays].map(String),onValueChange:e=>{e.length!==0&&j(t=>({...t,weekdays:new Set(e.map(Number))}))},children:Ct.map(Jt)})]}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(dt,{htmlFor:`scheduled-task-interval`,children:`Run every`}),(0,Q.jsx)(Ee,{type:`number`,id:`scheduled-task-interval`,nativeInput:!0,min:1,step:`any`,className:`w-24`,value:A.intervalMinutes,onChange:e=>j(t=>({...t,intervalMinutes:e.target.value}))}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`minutes`})]}),t[153]=A.coalesceKey,t[154]=A.coalesceWindowSeconds,t[155]=A.filters,t[156]=A.intervalMinutes,t[157]=A.maxDeliveryAgeMinutes,t[158]=A.replayKey,t[159]=A.scheduleMode,t[160]=A.signatureEnabled,t[161]=A.signatureEncoding,t[162]=A.signatureHeader,t[163]=A.signaturePrefix,t[164]=A.signatureSecret,t[165]=A.timeOfDay,t[166]=A.weekdays,t[167]=d,t[168]=J,t[169]=an):an=t[169];let on;t[170]!==Wt||t[171]!==rn||t[172]!==an?(on=(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[Wt,rn,an]}),t[170]=Wt,t[171]=rn,t[172]=an,t[173]=on):on=t[173];let sn;t[174]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,Q.jsx)(dt,{htmlFor:`scheduled-task-enabled`,children:`Enabled`}),(0,Q.jsx)(`p`,{id:`scheduled-task-enabled-description`,className:`text-sm text-muted-foreground`,children:`Disabled tasks stay saved but do not run.`})]}),t[174]=sn):sn=t[174];let cn;t[175]===Symbol.for(`react.memo_cache_sentinel`)?(cn=e=>j(t=>({...t,enabled:e})),t[175]=cn):cn=t[175];let ln;t[176]===A.enabled?ln=t[177]:(ln=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[sn,(0,Q.jsx)(lt,{id:`scheduled-task-enabled`,"aria-describedby":`scheduled-task-enabled-description`,checked:A.enabled,onCheckedChange:cn})]}),t[176]=A.enabled,t[177]=ln);let un;t[178]!==P||t[179]!==Ue||t[180]!==st||t[181]!==ct||t[182]!==ut||t[183]!==ht||t[184]!==_t||t[185]!==Ft||t[186]!==It||t[187]!==Lt||t[188]!==zt||t[189]!==Ht||t[190]!==on||t[191]!==ln?(un=(0,Q.jsx)(Me,{children:(0,Q.jsxs)(`fieldset`,{disabled:P,className:`space-y-5`,children:[Ue,st,ct,ut,ht,_t,Ft,It,Lt,zt,Ht,on,ln]})}),t[178]=P,t[179]=Ue,t[180]=st,t[181]=ct,t[182]=ut,t[183]=ht,t[184]=_t,t[185]=Ft,t[186]=It,t[187]=Lt,t[188]=zt,t[189]=Ht,t[190]=on,t[191]=ln,t[192]=un):un=t[192];let dn;t[193]===P?dn=t[194]:(dn=(0,Q.jsx)(je,{render:(0,Q.jsx)(ee,{variant:`outline`,size:`sm`,disabled:P}),children:`Cancel`}),t[193]=P,t[194]=dn);let fn=!E||P||U||!h||!v.data,pn;t[195]===De?pn=t[196]:(pn=()=>void De(),t[195]=De,t[196]=pn);let mn=A.editingId?`Save task`:`Create task`,hn;t[197]!==fn||t[198]!==pn||t[199]!==mn?(hn=(0,Q.jsx)(ee,{size:`sm`,disabled:fn,onClick:pn,children:mn}),t[197]=fn,t[198]=pn,t[199]=mn,t[200]=hn):hn=t[200];let gn;t[201]!==dn||t[202]!==hn?(gn=(0,Q.jsxs)(Ae,{children:[dn,hn]}),t[201]=dn,t[202]=hn,t[203]=gn):gn=t[203];let _n;t[204]!==Be||t[205]!==un||t[206]!==gn?(_n=(0,Q.jsxs)(Pe,{className:`max-w-xl`,children:[Be,un,gn]}),t[204]=Be,t[205]=un,t[206]=gn,t[207]=_n):_n=t[207];let vn;return t[208]!==Ie||t[209]!==_n?(vn=(0,Q.jsx)(Fe,{open:!0,onOpenChange:Ie,children:_n}),t[208]=Ie,t[209]=_n,t[210]=vn):vn=t[210],vn}function Jt(e){return(0,Q.jsx)(_e,{value:String(e),"aria-label":wt[e],children:Tt[e]},e)}function Yt(e){return(0,Q.jsx)(F,{value:e.id,children:e.title},e.id)}function Xt(e){return(0,Q.jsxs)(F,{value:e.environmentId,children:[(0,Q.jsx)(Ve,{kind:k(e.serverConfig),className:`size-4`}),e.label]},e.environmentId)}function Zt(e){return{...e,projectId:``,modelKey:``,baseModelSelection:null,baseRef:`main`,startFromOrigin:!0,existingWorktreePath:``}}function Qt(e,t){V.add(J({type:`error`,title:e,description:t instanceof Error?t.message:String(t)}))}export{_t as a,ht as i,Mt as n,jt as r,Ft as t};
6
- //# sourceMappingURL=ScheduledTasksSettings-CSygG_5X.js.map
6
+ //# sourceMappingURL=ScheduledTasksSettings-CpfGXMow.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{I as r}from"./settingsLayout-BoWaVHvV.js";import{Mo as i}from"./main-BYwnnJ9E.js";var a=t(),o=e(n(),1);function s(e){let t=(0,a.c)(8),n,s,c;t[0]===e?(n=t[1],s=t[2],c=t[3]):({settingKeys:c,checked:n,...s}=e,t[0]=e,t[1]=n,t[2]=s,t[3]=c);let l=r(c),u=!l&&n,d;return t[4]!==l||t[5]!==s||t[6]!==u?(d=(0,o.jsx)(i,{...s,mixed:l,checked:u}),t[4]=l,t[5]=s,t[6]=u,t[7]=d):d=t[7],d}export{s as t};
2
- //# sourceMappingURL=ScopedSwitch-LzARRHas.js.map
1
+ import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{I as r}from"./settingsLayout-YTaL8Lym.js";import{Mo as i}from"./main-C04YJQbN.js";var a=t(),o=e(n(),1);function s(e){let t=(0,a.c)(8),n,s,c;t[0]===e?(n=t[1],s=t[2],c=t[3]):({settingKeys:c,checked:n,...s}=e,t[0]=e,t[1]=n,t[2]=s,t[3]=c);let l=r(c),u=!l&&n,d;return t[4]!==l||t[5]!==s||t[6]!==u?(d=(0,o.jsx)(i,{...s,mixed:l,checked:u}),t[4]=l,t[5]=s,t[6]=u,t[7]=d):d=t[7],d}export{s as t};
2
+ //# sourceMappingURL=ScopedSwitch-Cq7B0T7B.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ft as i,Jo as a,Ut as o,Wt as s,Xt as c,mr as l,t as u}from"./utils-DkKLB01I.js";import{Uc as d,o as f}from"./src-R7EkrVcv.js";import{a as p,c as m,o as h,s as g,t as _}from"./select-CE2f-g-3.js";import{f as v,t as y}from"./server-GB5fRm03.js";import{n as b}from"./query-CeIgbVxh.js";import{t as x}from"./use-atom-command-Bd7vZxeH.js";import{i as S}from"./usageFormat-CUSzTPTq.js";import{t as C}from"./input-CiPGmOLv.js";import{F as w,V as T,a as E,n as D,s as O}from"./settingsLayout-BoWaVHvV.js";import{t as k}from"./ProviderModelPicker-CLwSFV6Q.js";import{i as A}from"./selfImproveFindings-Bhi6QF1b.js";var j=n(),M={off:`Off`,shadow:`Record decisions only`,dispatch:`Review turns`},N={off:`Finished turns are not checked.`,shadow:`Decisions judges finished turns; nothing is reviewed.`,dispatch:`Reviewers suggest memories from turns Decisions judges worth a review.`};function P(e){return e.checkedTurns===0||e.lastCheckedAt===null?null:`${`${e.checkedTurns} ${e.checkedTurns===1?`turn`:`turns`} checked`} · ${e.reviewTurns} worth a review · last ${S(e.lastCheckedAt)}`}function ee(e){return e.mode===`off`?null:e.hasDecisionKey?e.mode===`dispatch`&&e.reviewerCount===0?`Choose a reviewer below. Without one, no review runs.`:null:`Needs an OpenRouter key above. No turn is judged until one is saved.`}function te(e,t,n){if(n===null)return e.filter((e,n)=>n!==t);let r=e[t],i=r&&r.instanceId===n.instanceId&&r.model===n.model?r:{instanceId:n.instanceId,model:n.model};return t<e.length?e.map((e,n)=>n===t?i:e):[...e,i]}var F=e(t(),1),I=e(r(),1),ne=d(f);function L(e){let t=(0,j.c)(8),n=!e.open,r=e.open?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`,i;t[0]===r?i=t[1]:(i=u(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-opacity`,r),t[0]=r,t[1]=i);let a;t[2]===e.children?a=t[3]:(a=(0,I.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:e.children}),t[2]=e.children,t[3]=a);let o;return t[4]!==n||t[5]!==i||t[6]!==a?(o=(0,I.jsx)(`div`,{inert:n,className:i,children:a}),t[4]=n,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function R(e){let[t,n]=(0,F.useState)(e);return e!==null&&e!==t&&n(e),t}function z(e){let t=(0,j.c)(6),n=R(e.text),r=e.text!==null,i=e.text?`status`:void 0,a;t[0]!==n||t[1]!==i?(a=(0,I.jsx)(`p`,{role:i,className:`pt-0.5 text-xs text-warning`,children:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==a?(o=(0,I.jsx)(L,{open:r,children:a}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function B(){let e=(0,j.c)(3),{scope:t,environment:n}=T(),r=t.environmentIds.length===1?n?.environmentId??null:null,i=n?.connection.phase===`connected`&&n.serverConfig!==null,a;return e[0]!==i||e[1]!==r?(a=(0,I.jsx)(O,{title:`Self-improvement`,children:r&&i?(0,I.jsx)(V,{environmentId:r}):(0,I.jsx)(E,{title:`Review finished turns`,description:`Pick a single connected environment to set up self-improvement for it.`})}),e[0]=i,e[1]=r,e[2]=a):a=e[2],a}function V(e){let t=(0,j.c)(57),{environmentId:n}=e,{environment:r,target:u}=T(),d=w(),p;t[0]===n?p=t[1]:(p=v.selfImproveSettingsLive({environmentId:n,input:{}}),t[0]=n,t[1]=p);let S=b(p),C;t[2]===n?C=t[3]:(C=v.updateSelfImproveSettings.permissionAtom(n),t[2]=n,t[3]=C);let O=a(C),A=x(v.updateSelfImproveSettings),[L,R]=(0,F.useState)(!1),B=S.data,V=r?.serverConfig?.providers??y,U,W,G,K;if(t[4]!==O||t[5]!==n||t[6]!==L||t[7]!==B||t[8]!==S.error||t[9]!==d||t[10]!==V||t[11]!==u?.projectId||t[12]!==A){K=Symbol.for(`react.early_return_sentinel`);bb0:{let e=V.filter(ae),r=c(o(s(e),d,u?.projectId??null)),a=r.find(ie);if(!B){let e=S.error?`Couldn't load self-improvement settings.`:`Loading…`,n;t[17]===e?n=t[18]:(n=(0,I.jsx)(E,{title:`Review finished turns`,status:e}),t[17]=e,t[18]=n),K=n;break bb0}let p=!O||L,v;t[19]!==n||t[20]!==A?(v=async e=>{R(!0),await A({environmentId:n,input:e}),R(!1)},t[19]=n,t[20]=A,t[21]=v):v=t[21];let y=v,b=B.mode===`dispatch`,x=B.mode,C=!!d.decisionOpenRouterKey,w;t[22]!==B.mode||t[23]!==B.reviewers.length||t[24]!==C?(w=ee({mode:x,hasDecisionKey:C,reviewerCount:B.reviewers.length}),t[22]=B.mode,t[23]=B.reviewers.length,t[24]=C,t[25]=w):w=t[25];let T=w,j=t=>{let o=B.reviewers[t],s=t===0||B.reviewers.length>0,c=o?r.find(e=>e.instanceId===o.instanceId):void 0,u=o&&(!c||!c.enabled||!c.isAvailable)?`${c?.displayName??o.instanceId} is unavailable, so this reviewer is skipped.`:null,f=t===0?`First reviewer`:`Second reviewer`;return(0,I.jsx)(E,{title:f,"aria-disabled":!b||!s||void 0,className:`transition-opacity duration-200 ease-out motion-reduce:transition-none`,status:(0,I.jsx)(z,{text:b?u:null}),control:o||a?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,I.jsx)(k,{environmentId:n,activeInstanceId:o?.instanceId??a.instanceId,model:o?.model??``,lockedProvider:null,instanceEntries:r,modelOptionsByInstance:i(d,e,o?.instanceId??null,o?.model??null),triggerClassName:D,triggerAriaLabel:f,...o?{}:{triggerLabel:`Choose model`},disabled:p||!b||!s,onInstanceModelChange:(e,n)=>void y({mode:B.mode,reviewers:te(B.reviewers,t,{instanceId:e,model:n})})}),o?(0,I.jsx)(l,{size:`sm`,variant:`outline`,disabled:p||!b,onClick:()=>void y({mode:B.mode,reviewers:te(B.reviewers,t,null)}),children:`Remove`}):null]}):(0,I.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No reviewer models available.`})},f)},F=N[B.mode],H;t[26]===B?H=t[27]:(H=P(B),t[26]=B,t[27]=H);let q;t[28]===T?q=t[29]:(q=(0,I.jsx)(z,{text:T}),t[28]=T,t[29]=q);let J;t[30]!==H||t[31]!==q?(J=(0,I.jsxs)(I.Fragment,{children:[H,q]}),t[30]=H,t[31]=q,t[32]=J):J=t[32];let Y;t[33]!==B.mode||t[34]!==B.reviewers||t[35]!==y?(Y=e=>{ne(e)&&e!==B.mode&&y({mode:e,reviewers:B.reviewers})},t[33]=B.mode,t[34]=B.reviewers,t[35]=y,t[36]=Y):Y=t[36];let X=M[B.mode],Z;t[37]===X?Z=t[38]:(Z=(0,I.jsx)(g,{"aria-label":`Review finished turns`,children:(0,I.jsx)(m,{children:X})}),t[37]=X,t[38]=Z);let Q;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,I.jsx)(h,{children:f.literals.map(re)}),t[39]=Q):Q=t[39];let $;t[40]!==p||t[41]!==B.mode||t[42]!==Y||t[43]!==Z?($=(0,I.jsxs)(_,{value:B.mode,disabled:p,onValueChange:Y,children:[Z,Q]}),t[40]=p,t[41]=B.mode,t[42]=Y,t[43]=Z,t[44]=$):$=t[44],t[45]!==F||t[46]!==J||t[47]!==$?(U=(0,I.jsx)(E,{id:`self-improve-mode`,title:`Review finished turns`,description:F,status:J,control:$}),t[45]=F,t[46]=J,t[47]=$,t[48]=U):U=t[48],W=j(0),G=j(1)}t[4]=O,t[5]=n,t[6]=L,t[7]=B,t[8]=S.error,t[9]=d,t[10]=V,t[11]=u?.projectId,t[12]=A,t[13]=U,t[14]=W,t[15]=G,t[16]=K}else U=t[13],W=t[14],G=t[15],K=t[16];if(K!==Symbol.for(`react.early_return_sentinel`))return K;let q;t[49]!==n||t[50]!==B.memoryMirror?(q=(0,I.jsx)(H,{environmentId:n,mirror:B.memoryMirror}),t[49]=n,t[50]=B.memoryMirror,t[51]=q):q=t[51];let J;return t[52]!==U||t[53]!==W||t[54]!==G||t[55]!==q?(J=(0,I.jsxs)(I.Fragment,{children:[U,W,G,q]}),t[52]=U,t[53]=W,t[54]=G,t[55]=q,t[56]=J):J=t[56],J}function re(e){return(0,I.jsx)(p,{value:e,children:M[e]},e)}function ie(e){return e.enabled&&e.isAvailable}function ae(e){return e.supportsTextGeneration!==!1}function H(e){let t=(0,j.c)(37),[n,r]=(0,F.useState)(``),[i,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(null),u;t[0]===e.environmentId?u=t[1]:(u=v.setSelfImproveMemoryMirror.permissionAtom(e.environmentId),t[0]=e.environmentId,t[1]=u);let d=a(u),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f={reportFailure:!1},t[2]=f):f=t[2];let p=x(v.setSelfImproveMemoryMirror,f),m=!d||i,h;t[3]!==e.environmentId||t[4]!==p?(h=async t=>{o(!0);let n=A(await p({environmentId:e.environmentId,input:{memoryMirror:t}}),`Couldn't set the mirror.`);c(n.ok?null:n.message),n.ok&&r(``),o(!1)},t[3]=e.environmentId,t[4]=p,t[5]=h):h=t[5];let g=h,_=e.mirror??`Not mirrored`,y;t[6]===s?y=t[7]:(y=(0,I.jsx)(z,{text:s}),t[6]=s,t[7]=y);let b;t[8]!==_||t[9]!==y?(b=(0,I.jsxs)(I.Fragment,{children:[_,y]}),t[8]=_,t[9]=y,t[10]=b):b=t[10];let S;t[11]!==m||t[12]!==g||t[13]!==n?(S=e=>{e.preventDefault(),n.trim()&&!m&&g(n.trim())},t[11]=m,t[12]=g,t[13]=n,t[14]=S):S=t[14];let w=e.mirror?`Replace repository path`:`/path/to/repository`,T;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>r(e.target.value),t[15]=T):T=t[15];let D;t[16]!==m||t[17]!==n||t[18]!==w?(D=(0,I.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,I.jsx)(C,{"aria-label":`Mirror saved memory`,autoComplete:`off`,value:n,disabled:m,placeholder:w,onChange:T})}),t[16]=m,t[17]=n,t[18]=w,t[19]=D):D=t[19];let O;t[20]!==m||t[21]!==n?(O=m||!n.trim(),t[20]=m,t[21]=n,t[22]=O):O=t[22];let k;t[23]===O?k=t[24]:(k=(0,I.jsx)(l,{type:`submit`,size:`sm`,disabled:O,children:`Save`}),t[23]=O,t[24]=k);let M;t[25]!==m||t[26]!==g||t[27]!==e.mirror?(M=e.mirror?(0,I.jsx)(l,{type:`button`,size:`sm`,variant:`outline`,disabled:m,onClick:()=>void g(null),children:`Remove`}):null,t[25]=m,t[26]=g,t[27]=e.mirror,t[28]=M):M=t[28];let N;t[29]!==k||t[30]!==M||t[31]!==S||t[32]!==D?(N=(0,I.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2 pb-2`,onSubmit:S,children:[D,k,M]}),t[29]=k,t[30]=M,t[31]=S,t[32]=D,t[33]=N):N=t[33];let P;return t[34]!==N||t[35]!==b?(P=(0,I.jsx)(E,{title:`Mirror saved memory`,description:`A git checkout. Each save copies the changed files into its memory folder, commits them on the default branch, and pushes.`,status:b,children:N}),t[34]=N,t[35]=b,t[36]=P):P=t[36],P}export{B as n,z as r,L as t};
2
- //# sourceMappingURL=SelfImproveSettingsSection-DjuOvf_q.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ft as i,Jo as a,Ut as o,Wt as s,Xt as c,mr as l,t as u}from"./utils-DkKLB01I.js";import{Uc as d,o as f}from"./src-R7EkrVcv.js";import{a as p,c as m,o as h,s as g,t as _}from"./select-CE2f-g-3.js";import{f as v,t as y}from"./server-DthHkqkT.js";import{n as b}from"./query-CeIgbVxh.js";import{t as x}from"./use-atom-command-Bsfu4mja.js";import{i as S}from"./usageFormat-CUSzTPTq.js";import{t as C}from"./input-CiPGmOLv.js";import{F as w,V as T,a as E,n as D,s as O}from"./settingsLayout-YTaL8Lym.js";import{t as k}from"./ProviderModelPicker-DQ3N8RWz.js";import{i as A}from"./selfImproveFindings-Bhi6QF1b.js";var j=n(),M={off:`Off`,shadow:`Record decisions only`,dispatch:`Review turns`},N={off:`Finished turns are not checked.`,shadow:`Decisions judges finished turns; nothing is reviewed.`,dispatch:`Reviewers suggest memories from turns Decisions judges worth a review.`};function P(e){return e.checkedTurns===0||e.lastCheckedAt===null?null:`${`${e.checkedTurns} ${e.checkedTurns===1?`turn`:`turns`} checked`} · ${e.reviewTurns} worth a review · last ${S(e.lastCheckedAt)}`}function ee(e){return e.mode===`off`?null:e.hasDecisionKey?e.mode===`dispatch`&&e.reviewerCount===0?`Choose a reviewer below. Without one, no review runs.`:null:`Needs an OpenRouter key above. No turn is judged until one is saved.`}function te(e,t,n){if(n===null)return e.filter((e,n)=>n!==t);let r=e[t],i=r&&r.instanceId===n.instanceId&&r.model===n.model?r:{instanceId:n.instanceId,model:n.model};return t<e.length?e.map((e,n)=>n===t?i:e):[...e,i]}var F=e(t(),1),I=e(r(),1),ne=d(f);function L(e){let t=(0,j.c)(8),n=!e.open,r=e.open?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`,i;t[0]===r?i=t[1]:(i=u(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-opacity`,r),t[0]=r,t[1]=i);let a;t[2]===e.children?a=t[3]:(a=(0,I.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:e.children}),t[2]=e.children,t[3]=a);let o;return t[4]!==n||t[5]!==i||t[6]!==a?(o=(0,I.jsx)(`div`,{inert:n,className:i,children:a}),t[4]=n,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function R(e){let[t,n]=(0,F.useState)(e);return e!==null&&e!==t&&n(e),t}function z(e){let t=(0,j.c)(6),n=R(e.text),r=e.text!==null,i=e.text?`status`:void 0,a;t[0]!==n||t[1]!==i?(a=(0,I.jsx)(`p`,{role:i,className:`pt-0.5 text-xs text-warning`,children:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==a?(o=(0,I.jsx)(L,{open:r,children:a}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function B(){let e=(0,j.c)(3),{scope:t,environment:n}=T(),r=t.environmentIds.length===1?n?.environmentId??null:null,i=n?.connection.phase===`connected`&&n.serverConfig!==null,a;return e[0]!==i||e[1]!==r?(a=(0,I.jsx)(O,{title:`Self-improvement`,children:r&&i?(0,I.jsx)(V,{environmentId:r}):(0,I.jsx)(E,{title:`Review finished turns`,description:`Pick a single connected environment to set up self-improvement for it.`})}),e[0]=i,e[1]=r,e[2]=a):a=e[2],a}function V(e){let t=(0,j.c)(57),{environmentId:n}=e,{environment:r,target:u}=T(),d=w(),p;t[0]===n?p=t[1]:(p=v.selfImproveSettingsLive({environmentId:n,input:{}}),t[0]=n,t[1]=p);let S=b(p),C;t[2]===n?C=t[3]:(C=v.updateSelfImproveSettings.permissionAtom(n),t[2]=n,t[3]=C);let O=a(C),A=x(v.updateSelfImproveSettings),[L,R]=(0,F.useState)(!1),B=S.data,V=r?.serverConfig?.providers??y,U,W,G,K;if(t[4]!==O||t[5]!==n||t[6]!==L||t[7]!==B||t[8]!==S.error||t[9]!==d||t[10]!==V||t[11]!==u?.projectId||t[12]!==A){K=Symbol.for(`react.early_return_sentinel`);bb0:{let e=V.filter(ae),r=c(o(s(e),d,u?.projectId??null)),a=r.find(ie);if(!B){let e=S.error?`Couldn't load self-improvement settings.`:`Loading…`,n;t[17]===e?n=t[18]:(n=(0,I.jsx)(E,{title:`Review finished turns`,status:e}),t[17]=e,t[18]=n),K=n;break bb0}let p=!O||L,v;t[19]!==n||t[20]!==A?(v=async e=>{R(!0),await A({environmentId:n,input:e}),R(!1)},t[19]=n,t[20]=A,t[21]=v):v=t[21];let y=v,b=B.mode===`dispatch`,x=B.mode,C=!!d.decisionOpenRouterKey,w;t[22]!==B.mode||t[23]!==B.reviewers.length||t[24]!==C?(w=ee({mode:x,hasDecisionKey:C,reviewerCount:B.reviewers.length}),t[22]=B.mode,t[23]=B.reviewers.length,t[24]=C,t[25]=w):w=t[25];let T=w,j=t=>{let o=B.reviewers[t],s=t===0||B.reviewers.length>0,c=o?r.find(e=>e.instanceId===o.instanceId):void 0,u=o&&(!c||!c.enabled||!c.isAvailable)?`${c?.displayName??o.instanceId} is unavailable, so this reviewer is skipped.`:null,f=t===0?`First reviewer`:`Second reviewer`;return(0,I.jsx)(E,{title:f,"aria-disabled":!b||!s||void 0,className:`transition-opacity duration-200 ease-out motion-reduce:transition-none`,status:(0,I.jsx)(z,{text:b?u:null}),control:o||a?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,I.jsx)(k,{environmentId:n,activeInstanceId:o?.instanceId??a.instanceId,model:o?.model??``,lockedProvider:null,instanceEntries:r,modelOptionsByInstance:i(d,e,o?.instanceId??null,o?.model??null),triggerClassName:D,triggerAriaLabel:f,...o?{}:{triggerLabel:`Choose model`},disabled:p||!b||!s,onInstanceModelChange:(e,n)=>void y({mode:B.mode,reviewers:te(B.reviewers,t,{instanceId:e,model:n})})}),o?(0,I.jsx)(l,{size:`sm`,variant:`outline`,disabled:p||!b,onClick:()=>void y({mode:B.mode,reviewers:te(B.reviewers,t,null)}),children:`Remove`}):null]}):(0,I.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No reviewer models available.`})},f)},F=N[B.mode],H;t[26]===B?H=t[27]:(H=P(B),t[26]=B,t[27]=H);let q;t[28]===T?q=t[29]:(q=(0,I.jsx)(z,{text:T}),t[28]=T,t[29]=q);let J;t[30]!==H||t[31]!==q?(J=(0,I.jsxs)(I.Fragment,{children:[H,q]}),t[30]=H,t[31]=q,t[32]=J):J=t[32];let Y;t[33]!==B.mode||t[34]!==B.reviewers||t[35]!==y?(Y=e=>{ne(e)&&e!==B.mode&&y({mode:e,reviewers:B.reviewers})},t[33]=B.mode,t[34]=B.reviewers,t[35]=y,t[36]=Y):Y=t[36];let X=M[B.mode],Z;t[37]===X?Z=t[38]:(Z=(0,I.jsx)(g,{"aria-label":`Review finished turns`,children:(0,I.jsx)(m,{children:X})}),t[37]=X,t[38]=Z);let Q;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,I.jsx)(h,{children:f.literals.map(re)}),t[39]=Q):Q=t[39];let $;t[40]!==p||t[41]!==B.mode||t[42]!==Y||t[43]!==Z?($=(0,I.jsxs)(_,{value:B.mode,disabled:p,onValueChange:Y,children:[Z,Q]}),t[40]=p,t[41]=B.mode,t[42]=Y,t[43]=Z,t[44]=$):$=t[44],t[45]!==F||t[46]!==J||t[47]!==$?(U=(0,I.jsx)(E,{id:`self-improve-mode`,title:`Review finished turns`,description:F,status:J,control:$}),t[45]=F,t[46]=J,t[47]=$,t[48]=U):U=t[48],W=j(0),G=j(1)}t[4]=O,t[5]=n,t[6]=L,t[7]=B,t[8]=S.error,t[9]=d,t[10]=V,t[11]=u?.projectId,t[12]=A,t[13]=U,t[14]=W,t[15]=G,t[16]=K}else U=t[13],W=t[14],G=t[15],K=t[16];if(K!==Symbol.for(`react.early_return_sentinel`))return K;let q;t[49]!==n||t[50]!==B.memoryMirror?(q=(0,I.jsx)(H,{environmentId:n,mirror:B.memoryMirror}),t[49]=n,t[50]=B.memoryMirror,t[51]=q):q=t[51];let J;return t[52]!==U||t[53]!==W||t[54]!==G||t[55]!==q?(J=(0,I.jsxs)(I.Fragment,{children:[U,W,G,q]}),t[52]=U,t[53]=W,t[54]=G,t[55]=q,t[56]=J):J=t[56],J}function re(e){return(0,I.jsx)(p,{value:e,children:M[e]},e)}function ie(e){return e.enabled&&e.isAvailable}function ae(e){return e.supportsTextGeneration!==!1}function H(e){let t=(0,j.c)(37),[n,r]=(0,F.useState)(``),[i,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(null),u;t[0]===e.environmentId?u=t[1]:(u=v.setSelfImproveMemoryMirror.permissionAtom(e.environmentId),t[0]=e.environmentId,t[1]=u);let d=a(u),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f={reportFailure:!1},t[2]=f):f=t[2];let p=x(v.setSelfImproveMemoryMirror,f),m=!d||i,h;t[3]!==e.environmentId||t[4]!==p?(h=async t=>{o(!0);let n=A(await p({environmentId:e.environmentId,input:{memoryMirror:t}}),`Couldn't set the mirror.`);c(n.ok?null:n.message),n.ok&&r(``),o(!1)},t[3]=e.environmentId,t[4]=p,t[5]=h):h=t[5];let g=h,_=e.mirror??`Not mirrored`,y;t[6]===s?y=t[7]:(y=(0,I.jsx)(z,{text:s}),t[6]=s,t[7]=y);let b;t[8]!==_||t[9]!==y?(b=(0,I.jsxs)(I.Fragment,{children:[_,y]}),t[8]=_,t[9]=y,t[10]=b):b=t[10];let S;t[11]!==m||t[12]!==g||t[13]!==n?(S=e=>{e.preventDefault(),n.trim()&&!m&&g(n.trim())},t[11]=m,t[12]=g,t[13]=n,t[14]=S):S=t[14];let w=e.mirror?`Replace repository path`:`/path/to/repository`,T;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>r(e.target.value),t[15]=T):T=t[15];let D;t[16]!==m||t[17]!==n||t[18]!==w?(D=(0,I.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,I.jsx)(C,{"aria-label":`Mirror saved memory`,autoComplete:`off`,value:n,disabled:m,placeholder:w,onChange:T})}),t[16]=m,t[17]=n,t[18]=w,t[19]=D):D=t[19];let O;t[20]!==m||t[21]!==n?(O=m||!n.trim(),t[20]=m,t[21]=n,t[22]=O):O=t[22];let k;t[23]===O?k=t[24]:(k=(0,I.jsx)(l,{type:`submit`,size:`sm`,disabled:O,children:`Save`}),t[23]=O,t[24]=k);let M;t[25]!==m||t[26]!==g||t[27]!==e.mirror?(M=e.mirror?(0,I.jsx)(l,{type:`button`,size:`sm`,variant:`outline`,disabled:m,onClick:()=>void g(null),children:`Remove`}):null,t[25]=m,t[26]=g,t[27]=e.mirror,t[28]=M):M=t[28];let N;t[29]!==k||t[30]!==M||t[31]!==S||t[32]!==D?(N=(0,I.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2 pb-2`,onSubmit:S,children:[D,k,M]}),t[29]=k,t[30]=M,t[31]=S,t[32]=D,t[33]=N):N=t[33];let P;return t[34]!==N||t[35]!==b?(P=(0,I.jsx)(E,{title:`Mirror saved memory`,description:`A git checkout. Each save copies the changed files into its memory folder, commits them on the default branch, and pushes.`,status:b,children:N}),t[34]=N,t[35]=b,t[36]=P):P=t[36],P}export{B as n,z as r,L as t};
2
+ //# sourceMappingURL=SelfImproveSettingsSection-DZUf-jb0.js.map
@@ -1,4 +1,4 @@
1
- import{a as e,i as t,n,t as r}from"./react-BUfh6y28.js";import{n as i,t as a}from"./jsx-runtime-DJeoFXNw.js";import{Al as o,Dl as s,Fd as c,Ft as l,Js as u,Lt as d,Nc as f,Nd as p,Ol as m,Os as h,Pd as g,Ql as _,Rf as v,Rt as y,Td as b,Ut as x,Vd as S,Wt as C,Xd as w,Xt as T,Zn as E,an as D,au as O,fr as k,hr as A,js as j,kf as M,mf as N,mr as P,qf as F,rr as I,ru as L,t as R,uf as z}from"./utils-DkKLB01I.js";import{Ea as B,Fn as V,Gn as H,Kn as U,Ln as W,Mn as ee,Nh as G,Tn as te,Uc as ne,Zs as re,_m as ie,da as ae}from"./src-R7EkrVcv.js";import{$ as oe,Dr as se,F as ce,I as le,L as ue,cr as de,gn as fe,x as pe}from"./runtime-B92ivG9b.js";import{a as K,c as me,n as he,o as q,s as ge,t as _e}from"./select-CE2f-g-3.js";import{t as ve}from"./spinner-C-qDE4WQ.js";import{t as ye}from"./link-BHR6GsRr.js";import{t as be}from"./useNavigate-DXSBYc-k.js";import{a as xe,m as Se}from"./relay-V_5ApBIP.js";import{H as Ce,J as we,K as Te,U as Ee,V as De,W as Oe,a as ke,q as Ae,s as je,u as Me,z as Ne}from"./useSettings-Dp9RSL-0.js";import{t as Pe}from"./server-GB5fRm03.js";import{o as Fe}from"./session-CFzb2gMH.js";import{t as Ie}from"./toastHelpers-DxXYm50b.js";import{r as Le}from"./queries-Bp7Rbzrz.js";import{A as Re,D as ze,H as Be,I as Ve,J as He,M as Ue,R as We,U as Ge,W as Ke,X as qe,Y as Je,Z as Ye,_ as Xe,j as Ze,k as Qe,l as $e,m as et,p as tt,q as nt,u as rt,v as it,w as at,x as ot}from"./themePalette-B_fGWNEh.js";import{$ as st,D as ct,G as lt,f as ut,l as dt,vt as ft,yt as pt}from"./diffRendering-Cb9qJUqp.js";import{A as mt,C as ht,D as gt,E as _t,T as vt,lt as yt,n as bt,st as xt,t as St}from"./getDiffFileInput-B7pCnCeh.js";import{H as Ct,a as wt,c as Tt,i as Et,n as Dt,o as Ot,r as kt,t as At,x as jt}from"./ThreadDetailsItemsMenu-Cgj2yuzU.js";import{t as Mt}from"./env-BfPir1X4.js";import{a as Nt,n as Pt,r as Ft,t as It}from"./tooltip-CCYU8XGM.js";import{a as Lt,l as Rt,n as zt,o as Bt,r as Vt,s as Ht,t as Ut}from"./combobox-D6RfzdE7.js";import{t as Wt}from"./input-CiPGmOLv.js";import{a as Gt,c as Kt,i as qt,o as Jt,r as Yt,s as Xt,t as Zt}from"./dialog-5OaxRXCC.js";import{h as Qt,p as $t}from"./Icons-DmQwwfAN.js";import{t as en}from"./ProjectFavicon-DYcNXMDQ.js";import{n as tn,r as nn,t as rn}from"./input-group-DOUsG7P-.js";import{c as an,r as on}from"./ThreadTerminalDrawer-DBG1eHBS.js";import{r as sn,t as cn}from"./alert-D6WJ0q4-.js";import{a as ln,i as un,n as dn,o as fn,r as pn,s as mn,t as hn}from"./alert-dialog-DsMTn0ZK.js";import{F as gn,G as _n,I as vn,L as yn,R as bn,U as xn,V as Sn,a as J,d as Cn,f as wn,i as Tn,n as En,r as Y,s as Dn,t as On}from"./settingsLayout-BoWaVHvV.js";import{Ao as kn,C as An,Ci as jn,Co as Mn,D as Nn,E as Pn,Gn as Fn,Ho as In,Jn as Ln,Kn as Rn,Lr as X,Mo as zn,No as Bn,O as Vn,Si as Hn,So as Un,T as Wn,Wn as Gn,Xn as Kn,Yi as qn,Yn as Jn,bi as Yn,bo as Xn,go as Zn,jn as Qn,jo as $n,ko as er,la as tr,qn as nr,vi as rr,vo as ir,w as ar,xi as or,xo as sr,yi as cr,yn as lr,yo as ur}from"./main-BYwnnJ9E.js";import{t as dr}from"./ProviderModelPicker-CLwSFV6Q.js";import{i as fr,n as pr}from"./SidebarStageBackdrop-B8YG-M-e.js";import{t as mr}from"./legalLinks-C4VP5hPh.js";import{t as hr}from"./useScopedModelAvailability-UuZvj6HE.js";import{t as gr}from"./ProjectDefaultsSettings-BkxL8Xjx.js";import{t as _r}from"./draft-input-DM7mC5ty.js";import{t as vr}from"./ScopedSwitch-LzARRHas.js";import{a as yr,c as br,d as xr,f as Sr,i as Cr,n as wr,o as Tr,p as Er,s as Dr,t as Or,u as kr}from"./SettingsPanels.logic-BkjrmwrI.js";import{t as Ar}from"./IntervalSecondsField-Cpc7UePr.js";function jr(e,t=!1){return xt({tagName:`style`,children:[yt(t?vt(e):gt(e))],properties:{[st]:t?``:void 0,[pt]:t?void 0:``}})}function Mr(e){return xt({tagName:`style`,children:[yt(e)],properties:{[ft]:``}})}var Z=i(),Q=e(r(),1),$=e(a(),1);function Nr(){let e=gn(e=>e.notificationMode),t=bn(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1);return(0,$.jsx)(J,{...X(`thread-notifications`),description:n??`System alerts when a thread finishes, fails, or needs input or approval. Applies to this device while P4 Code is open.`,control:(0,$.jsxs)(_e,{value:e,disabled:i,onValueChange:async e=>{if(e===`off`||e===`notifications`||e===`sound`||e===`notifications-and-sound`){if(r(null),Wn(e)&&Pn(),ar(e)){if(typeof Notification>`u`||!window.isSecureContext){r(`Notifications need a supported browser over HTTPS, or the desktop app. Sound only is still available.`);return}a(!0);try{if(await Notification.requestPermission()!==`granted`){r(`Allow notifications in your browser or system settings, then choose this option again. Sound only is still available.`);return}}catch{r(`Notifications are unavailable in this browser. Sound only is still available.`);return}finally{a(!1)}}t({notificationMode:e})}},children:[(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Thread notifications`,children:(0,$.jsx)(me,{children:An[e]})}),(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(An).map(([e,t])=>(0,$.jsx)(K,{hideIndicator:!0,value:e,children:t},e))})]})})}function Pr(){let e=(0,Z.c)(7),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={target:`version`,onCopy:()=>Ct(t),onError:Fr},e[0]=n):n=e[0];let{copyToClipboard:r}=Se(n),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`span`,{children:`Version`}),e[1]=i):i=e[1];let a;e[2]===r?a=e[3]:(a=(0,$.jsx)(Nt,{render:(0,$.jsx)(A,{ref:t,tone:`muted`,"aria-label":`Copy version ${ce}`,onClick:()=>r(ce,void 0),children:ce})}),e[2]=r,e[3]=a);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Pt,{children:`Copy version`}),e[4]=o):o=e[4];let s;return e[5]===a?s=e[6]:(s=(0,$.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[i,(0,$.jsx)(`code`,{className:`text-2xs font-medium`,children:(0,$.jsxs)(It,{children:[a,o]})})]}),e[5]=a,e[6]=s),s}function Fr(e){xe.add(Ie({type:`error`,title:`Could not copy version`,description:e.message}))}function Ir(){let e=(0,Z.c)(15),t=typeof window>`u`?void 0:window.desktopBridge?.cliCommand,[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{if(!t)return;let e=!1;return t.getState().then(t=>{e||r(t)}).catch(Lr),()=>{e=!0}},s=[t],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,Q.useEffect)(o,s);let c;e[2]===i?c=e[3]:(c=e=>{t&&!i&&(a(!0),t[e]().then(r).catch(t=>{xe.add(Ie({type:`error`,title:e===`install`?`Could not install p4c`:`Could not remove p4c`,description:t instanceof Error?t.message:`Something went wrong.`}))}).finally(()=>a(!1)))},e[2]=i,e[3]=c);let l=c;if(!t||!n?.supported)return null;let u=n.installedPath!==null,d=n.shadowedBy?`Another p4c at ${n.shadowedBy} runs first in a new terminal. Remove it to use P4 Code's.`:u?n.onPath?`Installed at ${n.installedPath}. Open a new terminal to use it.`:`Installed at ${n.installedPath}, which is not on your PATH yet. Add its folder to your PATH to run \`p4c\`.`:"Run P4 Code's CLI as `p4c` from any terminal.",f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=X(`cli-command`),e[4]=f):f=e[4];let p=i||!u&&!!n.shadowedBy,m;e[5]!==l||e[6]!==u?(m=()=>l(u?`uninstall`:`install`),e[5]=l,e[6]=u,e[7]=m):m=e[7];let h=u?`Remove`:`Install`,g;e[8]!==p||e[9]!==m||e[10]!==h?(g=(0,$.jsx)(P,{size:`sm`,variant:`outline`,disabled:p,onClick:m,children:h}),e[8]=p,e[9]=m,e[10]=h,e[11]=g):g=e[11];let _;return e[12]!==d||e[13]!==g?(_=(0,$.jsx)(J,{...f,description:d,control:g}),e[12]=d,e[13]=g,e[14]=_):_=e[14],_}function Lr(){}function Rr(e){return`${mt}${ct(e)}`}async function zr({fileDiff:e,oldFile:t,newFile:n,options:r,annotations:i}){let a=St({oldFile:t,newFile:n},`preloadDiffHTML`);if(e==null&&a!=null&&(e=ut(a.oldFile,a.newFile,r?.parseDiffOptions)),e==null)throw Error(`preloadFileDiff: You must pass at least a fileDiff, oldFile, or newFile prop`);let o=new bt(Hr(r));return i!=null&&i.length>0&&o.setLineAnnotations(i),Rr(Vr(await o.asyncRender(e),o,r?.unsafeCSS,r?.themeType??`system`))}async function Br({fileDiff:e,options:t,annotations:n}){return{fileDiff:e,options:t,annotations:n,prerenderedHTML:await zr({fileDiff:e,options:t,annotations:n})}}function Vr(e,t,n,r){let i=[jr(e.css,!0)];i.push(Mr(_t(e.themeStyles,e.baseThemeType??r))),n!=null&&i.push(jr(n)),e.headerElement!=null&&i.push(e.headerElement);let a=t.renderFullAST(e);return a.properties[`data-dehydrated`]=``,i.push(a),i}function Hr(e){return{...e,useTokenTransformer:ht(e),headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators}}async function Ur({patch:e,options:t}){let n=[],r=lt(e);for(let e of r)for(let r of e.files)n.push(Br({fileDiff:r,options:t}));return await Promise.all(n)}var Wr=[],Gr=`Use $frontend-design to fix the flaky test in [surface.test.ts](apps/web/src/terminal/ghostty/surface.test.ts) and align the header with [SettingsPanels.tsx](apps/web/src/components/settings/SettingsPanels.tsx) before shipping.`;function Kr(){}function qr(){let e=(0,Z.c)(4),t=(0,Q.useRef)(null),[n,r]=(0,Q.useState)(Gr),[i,a]=(0,Q.useState)(227),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(e,t)=>{r(e),a(t)},e[0]=o):o=e[0];let s=o,c;return e[1]!==i||e[2]!==n?(c=(0,$.jsx)(`div`,{className:`mt-1 mb-2 rounded-lg border border-border bg-background px-3 py-2`,children:(0,$.jsx)(Ot,{ariaLabel:`Prompt font preview`,editorRef:t,value:n,cursor:i,contextRecords:Tt,skills:Wr,disabled:!1,placeholder:jt,className:`max-h-42 min-h-14`,onChange:s,onPaste:Kr})}),e[1]=i,e[2]=n,e[3]=c):c=e[3],c}var Jr=`diff --git a/src/formatUser.ts b/src/formatUser.ts
1
+ import{a as e,i as t,n,t as r}from"./react-BUfh6y28.js";import{n as i,t as a}from"./jsx-runtime-DJeoFXNw.js";import{Al as o,Dl as s,Fd as c,Ft as l,Js as u,Lt as d,Nc as f,Nd as p,Ol as m,Os as h,Pd as g,Ql as _,Rf as v,Rt as y,Td as b,Ut as x,Vd as S,Wt as C,Xd as w,Xt as T,Zn as E,an as D,au as O,fr as k,hr as A,js as j,kf as M,mf as N,mr as P,qf as F,rr as I,ru as L,t as R,uf as z}from"./utils-DkKLB01I.js";import{Ea as B,Fn as V,Gn as H,Kn as U,Ln as W,Mn as ee,Nh as G,Tn as te,Uc as ne,Zs as re,_m as ie,da as ae}from"./src-R7EkrVcv.js";import{$ as oe,Dr as se,F as ce,I as le,L as ue,cr as de,gn as fe,x as pe}from"./runtime-BvdQMwVb.js";import{a as K,c as me,n as he,o as q,s as ge,t as _e}from"./select-CE2f-g-3.js";import{t as ve}from"./spinner-C-qDE4WQ.js";import{t as ye}from"./link-BHR6GsRr.js";import{t as be}from"./useNavigate-DXSBYc-k.js";import{a as xe,m as Se}from"./relay-CTdDIWLg.js";import{H as Ce,J as we,K as Te,U as Ee,V as De,W as Oe,a as ke,q as Ae,s as je,u as Me,z as Ne}from"./useSettings-BhGGZc98.js";import{t as Pe}from"./server-DthHkqkT.js";import{o as Fe}from"./session-CxeYe0sJ.js";import{t as Ie}from"./toastHelpers-DxXYm50b.js";import{r as Le}from"./queries-BA_altUI.js";import{A as Re,D as ze,H as Be,I as Ve,J as He,M as Ue,R as We,U as Ge,W as Ke,X as qe,Y as Je,Z as Ye,_ as Xe,j as Ze,k as Qe,l as $e,m as et,p as tt,q as nt,u as rt,v as it,w as at,x as ot}from"./themePalette-B_fGWNEh.js";import{$ as st,D as ct,G as lt,f as ut,l as dt,vt as ft,yt as pt}from"./diffRendering-yxIsTMie.js";import{A as mt,C as ht,D as gt,E as _t,T as vt,lt as yt,n as bt,st as xt,t as St}from"./getDiffFileInput-hLtjvhYr.js";import{H as Ct,a as wt,c as Tt,i as Et,n as Dt,o as Ot,r as kt,t as At,x as jt}from"./ThreadDetailsItemsMenu-C4wfbepv.js";import{t as Mt}from"./env-BfPir1X4.js";import{a as Nt,n as Pt,r as Ft,t as It}from"./tooltip-CCYU8XGM.js";import{a as Lt,l as Rt,n as zt,o as Bt,r as Vt,s as Ht,t as Ut}from"./combobox-D6RfzdE7.js";import{t as Wt}from"./input-CiPGmOLv.js";import{a as Gt,c as Kt,i as qt,o as Jt,r as Yt,s as Xt,t as Zt}from"./dialog-5OaxRXCC.js";import{h as Qt,p as $t}from"./Icons-DmQwwfAN.js";import{t as en}from"./ProjectFavicon-CyXd4lSF.js";import{n as tn,r as nn,t as rn}from"./input-group-DOUsG7P-.js";import{c as an,r as on}from"./ThreadTerminalDrawer-PkBB7D3Z.js";import{r as sn,t as cn}from"./alert-D6WJ0q4-.js";import{a as ln,i as un,n as dn,o as fn,r as pn,s as mn,t as hn}from"./alert-dialog-DsMTn0ZK.js";import{F as gn,G as _n,I as vn,L as yn,R as bn,U as xn,V as Sn,a as J,d as Cn,f as wn,i as Tn,n as En,r as Y,s as Dn,t as On}from"./settingsLayout-YTaL8Lym.js";import{Ao as kn,C as An,Ci as jn,Co as Mn,D as Nn,E as Pn,Gn as Fn,Ho as In,Jn as Ln,Kn as Rn,Lr as X,Mo as zn,No as Bn,O as Vn,Si as Hn,So as Un,T as Wn,Wn as Gn,Xn as Kn,Yi as qn,Yn as Jn,bi as Yn,bo as Xn,go as Zn,jn as Qn,jo as $n,ko as er,la as tr,qn as nr,vi as rr,vo as ir,w as ar,xi as or,xo as sr,yi as cr,yn as lr,yo as ur}from"./main-C04YJQbN.js";import{t as dr}from"./ProviderModelPicker-DQ3N8RWz.js";import{i as fr,n as pr}from"./SidebarStageBackdrop-DL1ZzaTz.js";import{t as mr}from"./legalLinks-C4VP5hPh.js";import{t as hr}from"./useScopedModelAvailability-J0i-Sj4p.js";import{t as gr}from"./ProjectDefaultsSettings-DN1mhFNf.js";import{t as _r}from"./draft-input-DM7mC5ty.js";import{t as vr}from"./ScopedSwitch-Cq7B0T7B.js";import{a as yr,c as br,d as xr,f as Sr,i as Cr,n as wr,o as Tr,p as Er,s as Dr,t as Or,u as kr}from"./SettingsPanels.logic-UhRGlGN1.js";import{t as Ar}from"./IntervalSecondsField-xqmFxAii.js";function jr(e,t=!1){return xt({tagName:`style`,children:[yt(t?vt(e):gt(e))],properties:{[st]:t?``:void 0,[pt]:t?void 0:``}})}function Mr(e){return xt({tagName:`style`,children:[yt(e)],properties:{[ft]:``}})}var Z=i(),Q=e(r(),1),$=e(a(),1);function Nr(){let e=gn(e=>e.notificationMode),t=bn(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1);return(0,$.jsx)(J,{...X(`thread-notifications`),description:n??`System alerts when a thread finishes, fails, or needs input or approval. Applies to this device while P4 Code is open.`,control:(0,$.jsxs)(_e,{value:e,disabled:i,onValueChange:async e=>{if(e===`off`||e===`notifications`||e===`sound`||e===`notifications-and-sound`){if(r(null),Wn(e)&&Pn(),ar(e)){if(typeof Notification>`u`||!window.isSecureContext){r(`Notifications need a supported browser over HTTPS, or the desktop app. Sound only is still available.`);return}a(!0);try{if(await Notification.requestPermission()!==`granted`){r(`Allow notifications in your browser or system settings, then choose this option again. Sound only is still available.`);return}}catch{r(`Notifications are unavailable in this browser. Sound only is still available.`);return}finally{a(!1)}}t({notificationMode:e})}},children:[(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Thread notifications`,children:(0,$.jsx)(me,{children:An[e]})}),(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(An).map(([e,t])=>(0,$.jsx)(K,{hideIndicator:!0,value:e,children:t},e))})]})})}function Pr(){let e=(0,Z.c)(7),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={target:`version`,onCopy:()=>Ct(t),onError:Fr},e[0]=n):n=e[0];let{copyToClipboard:r}=Se(n),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`span`,{children:`Version`}),e[1]=i):i=e[1];let a;e[2]===r?a=e[3]:(a=(0,$.jsx)(Nt,{render:(0,$.jsx)(A,{ref:t,tone:`muted`,"aria-label":`Copy version ${ce}`,onClick:()=>r(ce,void 0),children:ce})}),e[2]=r,e[3]=a);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Pt,{children:`Copy version`}),e[4]=o):o=e[4];let s;return e[5]===a?s=e[6]:(s=(0,$.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[i,(0,$.jsx)(`code`,{className:`text-2xs font-medium`,children:(0,$.jsxs)(It,{children:[a,o]})})]}),e[5]=a,e[6]=s),s}function Fr(e){xe.add(Ie({type:`error`,title:`Could not copy version`,description:e.message}))}function Ir(){let e=(0,Z.c)(15),t=typeof window>`u`?void 0:window.desktopBridge?.cliCommand,[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{if(!t)return;let e=!1;return t.getState().then(t=>{e||r(t)}).catch(Lr),()=>{e=!0}},s=[t],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,Q.useEffect)(o,s);let c;e[2]===i?c=e[3]:(c=e=>{t&&!i&&(a(!0),t[e]().then(r).catch(t=>{xe.add(Ie({type:`error`,title:e===`install`?`Could not install p4c`:`Could not remove p4c`,description:t instanceof Error?t.message:`Something went wrong.`}))}).finally(()=>a(!1)))},e[2]=i,e[3]=c);let l=c;if(!t||!n?.supported)return null;let u=n.installedPath!==null,d=n.shadowedBy?`Another p4c at ${n.shadowedBy} runs first in a new terminal. Remove it to use P4 Code's.`:u?n.onPath?`Installed at ${n.installedPath}. Open a new terminal to use it.`:`Installed at ${n.installedPath}, which is not on your PATH yet. Add its folder to your PATH to run \`p4c\`.`:"Run P4 Code's CLI as `p4c` from any terminal.",f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=X(`cli-command`),e[4]=f):f=e[4];let p=i||!u&&!!n.shadowedBy,m;e[5]!==l||e[6]!==u?(m=()=>l(u?`uninstall`:`install`),e[5]=l,e[6]=u,e[7]=m):m=e[7];let h=u?`Remove`:`Install`,g;e[8]!==p||e[9]!==m||e[10]!==h?(g=(0,$.jsx)(P,{size:`sm`,variant:`outline`,disabled:p,onClick:m,children:h}),e[8]=p,e[9]=m,e[10]=h,e[11]=g):g=e[11];let _;return e[12]!==d||e[13]!==g?(_=(0,$.jsx)(J,{...f,description:d,control:g}),e[12]=d,e[13]=g,e[14]=_):_=e[14],_}function Lr(){}function Rr(e){return`${mt}${ct(e)}`}async function zr({fileDiff:e,oldFile:t,newFile:n,options:r,annotations:i}){let a=St({oldFile:t,newFile:n},`preloadDiffHTML`);if(e==null&&a!=null&&(e=ut(a.oldFile,a.newFile,r?.parseDiffOptions)),e==null)throw Error(`preloadFileDiff: You must pass at least a fileDiff, oldFile, or newFile prop`);let o=new bt(Hr(r));return i!=null&&i.length>0&&o.setLineAnnotations(i),Rr(Vr(await o.asyncRender(e),o,r?.unsafeCSS,r?.themeType??`system`))}async function Br({fileDiff:e,options:t,annotations:n}){return{fileDiff:e,options:t,annotations:n,prerenderedHTML:await zr({fileDiff:e,options:t,annotations:n})}}function Vr(e,t,n,r){let i=[jr(e.css,!0)];i.push(Mr(_t(e.themeStyles,e.baseThemeType??r))),n!=null&&i.push(jr(n)),e.headerElement!=null&&i.push(e.headerElement);let a=t.renderFullAST(e);return a.properties[`data-dehydrated`]=``,i.push(a),i}function Hr(e){return{...e,useTokenTransformer:ht(e),headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators}}async function Ur({patch:e,options:t}){let n=[],r=lt(e);for(let e of r)for(let r of e.files)n.push(Br({fileDiff:r,options:t}));return await Promise.all(n)}var Wr=[],Gr=`Use $frontend-design to fix the flaky test in [surface.test.ts](apps/web/src/terminal/ghostty/surface.test.ts) and align the header with [SettingsPanels.tsx](apps/web/src/components/settings/SettingsPanels.tsx) before shipping.`;function Kr(){}function qr(){let e=(0,Z.c)(4),t=(0,Q.useRef)(null),[n,r]=(0,Q.useState)(Gr),[i,a]=(0,Q.useState)(227),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(e,t)=>{r(e),a(t)},e[0]=o):o=e[0];let s=o,c;return e[1]!==i||e[2]!==n?(c=(0,$.jsx)(`div`,{className:`mt-1 mb-2 rounded-lg border border-border bg-background px-3 py-2`,children:(0,$.jsx)(Ot,{ariaLabel:`Prompt font preview`,editorRef:t,value:n,cursor:i,contextRecords:Tt,skills:Wr,disabled:!1,placeholder:jt,className:`max-h-42 min-h-14`,onChange:s,onPaste:Kr})}),e[1]=i,e[2]=n,e[3]=c):c=e[3],c}var Jr=`diff --git a/src/formatUser.ts b/src/formatUser.ts
2
2
  --- a/src/formatUser.ts
3
3
  +++ b/src/formatUser.ts
4
4
  @@ -1,3 +1,3 @@
@@ -43,4 +43,4 @@ import{a as e,i as t,n,t as r}from"./react-BUfh6y28.js";import{n as i,t as a}fro
43
43
  "colors": { ... }
44
44
  }`,spellCheck:!1,value:r}),t[10]=n,t[11]=p,t[12]=m,t[13]=r,t[14]=h):h=t[14];let g;return t[15]!==d||t[16]!==h?(g=(0,$.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border border-input bg-background shadow-xs/5 focus-within:border-ring focus-within:ring-3 focus-within:ring-inset focus-within:ring-ring/24`,children:[d,h]}),t[15]=d,t[16]=h,t[17]=g):g=t[17],g}function Qa({open:e,onOpenChange:t,onImported:n,onImportedMany:r}){let i=(0,Q.useRef)(null),[a,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_=(0,Q.useRef)(0);(0,Q.useEffect)(()=>{_.current+=1,m(!1),e&&(o(``),c(null),u(null),f(!1),g(null))},[e]);let v=(0,Q.useCallback)(async e=>{let t=Ja(e.size);if(t){u(t);return}let n=++_.current;f(!0);try{let t=await e.text();if(n!==_.current)return;o(t),c(e.name),u(null)}catch{if(n!==_.current)return;u(`Could not read that file. Paste the JSON below instead.`)}finally{n===_.current&&f(!1)}},[]),y=(0,Q.useCallback)(async e=>{let n=++_.current;f(!0);let i=[],a=[];try{for(let t of e)if(Ja(t.size))i.push(`${t.name}: too large`);else try{a.push({sourceName:t.name,theme:Wi(await t.text())})}catch(e){i.push(`${t.name}: ${e instanceof Error?e.message:`not a theme file`}`)}if(n!==_.current)return;let o=[],s=[];for(let e of Yi(Xi(a)))if(rt().some(t=>t.id===e.id))s.push(e);else try{o.push(ot(e))}catch(t){i.push(`${e.label}: ${t instanceof Error?t.message:`could not install`}`)}o.length>0&&r(o,{updated:!1}),u(i.length>0?i.join(` — `):null),s.length>0?g(s):o.length>0&&i.length===0&&t(!1)}finally{n===_.current&&f(!1)}},[r,t]),b=(0,Q.useCallback)(e=>{e.length!==0&&(e.length===1?v(e[0]):y(e))},[y,v]),x=(0,Q.useCallback)(()=>{let e=window.desktopBridge;e?.pickThemeFiles?e.pickThemeFiles().then(e=>{e&&e.length!==0&&b(e.map(e=>({name:e.name,size:e.size,text:()=>Promise.resolve(e.text)})))}):i.current?.click()},[b]),S=(0,Q.useCallback)(e=>{let t=[...e.currentTarget.files??[]];e.currentTarget.value=``,b(t)},[b]),C=(0,Q.useCallback)(e=>{e.preventDefault(),m(!1),b([...e.dataTransfer.files])},[b]),T=(e,t)=>{if(t&&t.toLowerCase()!==e.label.toLowerCase()){let n=ze({version:1,name:t.slice(0,48),appearance:e.appearance,colors:e.colors,...e.variants?{variants:e.variants}:{},...e.managed?{managed:!0}:{}});if(!rt().some(e=>e.id===n.id))return n}for(let t=1;t<100;t+=1){let n=ze({version:1,name:`${e.label.slice(0,48-` (${t})`.length)} (${t})`,appearance:e.appearance,colors:e.colors,...e.variants?{variants:e.variants}:{},...e.managed?{managed:!0}:{}});if(!rt().some(e=>e.id===n.id))return n}throw Error(`Too many copies of "${e.label}".`)},E=(0,Q.useCallback)(e=>{if(!h)return;let n=[],i=[],a=h.length===1&&s?Ki(s.replace(/\.[^.]+$/,``)):null;for(let t of h)try{let r=e===`update`?rt().find(e=>e.id===t.id):void 0,i=r?.collection?{...t,collection:r.collection}:t;n.push(e===`update`?Ke(i):ot(T(t,a)))}catch(e){i.push(`${t.label}: ${e instanceof Error?e.message:`failed`}`)}n.length>0&&r(n,{updated:e===`update`}),g(null),i.length>0?u([l,...i].filter(Boolean).join(` — `)):l||t(!1)},[h,l,s,r,t]),D=(0,Q.useCallback)(()=>{let e=Ja(a.length);if(e)u(e);else try{let e=Wi(a);if(rt().some(t=>t.id===e.id)){u(null),g([e]);return}let r=ot(e);if(!n(r)){try{Re(r.id)}catch{}u(`Theme added, but it could not be selected. Try again.`);return}t(!1)}catch(e){u(e instanceof Error?e.message:`That theme file is invalid.`)}},[a,n,t]);return(0,$.jsx)(Zt,{open:e,onOpenChange:e=>{e||u(null),t(e)},children:(0,$.jsxs)(Xt,{className:`max-w-3xl overflow-hidden`,children:[(0,$.jsx)(Gt,{children:(0,$.jsx)(Kt,{children:`Add a theme`})}),(0,$.jsxs)(Jt,{children:[(0,$.jsx)(Ua,{onInstalled:(e,n)=>{r(e,n),t(!1)},open:e}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,"aria-hidden":!0,children:[(0,$.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,$.jsx)(`span`,{className:`text-muted-foreground text-2xs uppercase tracking-wider`,children:`or import a file`}),(0,$.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),(()=>{let e={onDragEnter:e=>{e.preventDefault(),m(!0)},onDragOver:e=>{e.preventDefault(),m(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||m(!1)},onDrop:C},n=(0,$.jsx)(`input`,{ref:i,accept:`.json,application/json`,className:`sr-only`,onChange:S,multiple:!0,type:`file`}),r=(e=`Choose files`)=>(0,$.jsxs)(P,{disabled:d,size:`sm`,variant:`outline`,onClick:x,children:[(0,$.jsx)(L,{}),d?`Reading…`:e]}),c=()=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`div`,{className:`flex items-baseline justify-between gap-3`,children:(0,$.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`theme-json-editor`,children:`Theme JSON`})}),(0,$.jsx)(Za,{id:`theme-json-editor`,onChange:o,value:a})]});return h?(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-muted/20 p-3`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:`Already installed`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:h.map(e=>e.label).join(`, `)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(P,{size:`sm`,onClick:()=>E(`update`),children:`Update existing`}),(0,$.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>E(`copy`),children:`Keep both`}),(0,$.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>g(null),children:`Back`}),(0,$.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>t(!1),children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:R(`flex flex-wrap items-center justify-between gap-3 rounded-xl border border-dashed px-3 py-3 transition-colors`,p?`border-ring bg-accent/20`:`border-border/80 bg-muted/20`),...e,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:`Theme file`}),(0,$.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:s??`Drop P4 Code or VS Code .json files`})]}),r(),n]}),c(),(0,$.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:[(0,$.jsx)(P,{variant:`ghost`,onClick:()=>t(!1),children:`Cancel`}),(0,$.jsxs)(P,{disabled:!a.trim()||d,onClick:D,children:[(0,$.jsx)(w,{}),`Add theme`]})]})]})})(),l?(0,$.jsx)(cn,{"aria-live":`polite`,variant:`error`,children:l}):null]})]})})}function $a(e){let t=(0,Z.c)(45),{colors:n,clip:r}=e,i;t[0]===r?i=t[1]:(i=r===void 0?void 0:{clipPath:r===`left`?`polygon(0 0, calc(50% - 1px) 0, calc(50% - 1px) 100%, 0 100%)`:`polygon(calc(50% + 1px) 0, 100% 0, 100% 100%, calc(50% + 1px) 100%)`},t[0]=r,t[1]=i);let a;t[2]===n.canvas?a=t[3]:(a=(0,$.jsx)(`span`,{className:`absolute inset-0`,style:{backgroundColor:n.canvas}}),t[2]=n.canvas,t[3]=a);let o;t[4]===n.sidebar?o=t[5]:(o=(0,$.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-[22%]`,style:{backgroundColor:n.sidebar,boxShadow:`inset -1px 0 0 rgb(127 127 127 / 0.25)`}}),t[4]=n.sidebar,t[5]=o);let s;t[6]===n.surface?s=t[7]:(s=(0,$.jsx)(`span`,{className:`absolute left-[3%] top-[8%] h-[8%] w-[16%] rounded-md`,style:{backgroundColor:n.surface,boxShadow:`inset 0 0 0 1px rgb(127 127 127 / 0.25)`}}),t[6]=n.surface,t[7]=s);let c;t[8]===n.accentSurface?c=t[9]:(c=(0,$.jsx)(`span`,{className:`absolute left-[3%] top-[22%] h-[7%] w-[16%] rounded-md`,style:{backgroundColor:n.accentSurface}}),t[8]=n.accentSurface,t[9]=c);let l;t[10]===n.messageSurface?l=t[11]:(l=(0,$.jsx)(`span`,{className:`absolute left-[3%] top-[32%] h-[7%] w-[16%] rounded-md`,style:{backgroundColor:n.messageSurface,opacity:.7}}),t[10]=n.messageSurface,t[11]=l);let u;t[12]===n.messageSurface?u=t[13]:(u=(0,$.jsx)(`span`,{className:`absolute left-[3%] top-[42%] h-[7%] w-[16%] rounded-md`,style:{backgroundColor:n.messageSurface,opacity:.5}}),t[12]=n.messageSurface,t[13]=u);let d;t[14]===n.messageSurface?d=t[15]:(d=(0,$.jsx)(`span`,{className:`absolute right-[28%] top-[11%] h-[9%] w-[24%] rounded-lg`,style:{backgroundColor:n.messageSurface}}),t[14]=n.messageSurface,t[15]=d);let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`span`,{className:`absolute left-[27%] top-[28%] h-[5%] w-[34%] rounded-sm`,style:{backgroundColor:`rgb(127 127 127 / 0.25)`}}),t[16]=f):f=t[16];let p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`absolute left-[27%] top-[38%] h-[5%] w-[26%] rounded-sm`,style:{backgroundColor:`rgb(127 127 127 / 0.25)`}}),t[17]=p):p=t[17];let m;t[18]===n.surface?m=t[19]:(m={backgroundColor:n.surface,boxShadow:`inset 0 0 0 1px rgb(127 127 127 / 0.25)`},t[18]=n.surface,t[19]=m);let h;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`span`,{className:`block h-[26%] w-[34%] rounded-full`,style:{backgroundColor:`rgb(127 127 127 / 0.25)`,opacity:.7}}),t[20]=h):h=t[20];let g;t[21]===n.messageAction?g=t[22]:(g=(0,$.jsx)(`span`,{className:`block aspect-square h-[58%] rounded-full`,style:{backgroundColor:n.messageAction}}),t[21]=n.messageAction,t[22]=g);let _;t[23]!==m||t[24]!==g?(_=(0,$.jsxs)(`span`,{className:`absolute bottom-[8%] left-[26%] right-[6%] flex h-[15%] items-center justify-between rounded-md px-1`,style:m,children:[h,g]}),t[23]=m,t[24]=g,t[25]=_):_=t[25];let v;t[26]===n.surface?v=t[27]:(v={backgroundColor:n.surface,boxShadow:`inset 0 0 0 1px rgb(127 127 127 / 0.25), 0 2px 5px rgb(0 0 0 / 0.14)`},t[26]=n.surface,t[27]=v);let y;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(y=[0,1,2],t[28]=y):y=t[28];let b;t[29]===n.messageAction?b=t[30]:(b=y.map(e=>(0,$.jsxs)(`span`,{className:`absolute left-[11%] right-[11%] flex items-center gap-1`,style:{top:`${10+e*30}%`,height:`20%`},children:[(0,$.jsx)(`span`,{className:`block aspect-square h-[26%] rounded-full`,style:{backgroundColor:e===0?`#34d399`:e===1?n.messageAction:`#fbbf24`,opacity:.55}}),(0,$.jsx)(`span`,{className:`block h-[30%] w-[52%] rounded-sm`,style:{backgroundColor:`rgb(127 127 127 / 0.25)`}})]},e)),t[29]=n.messageAction,t[30]=b);let x;t[31]!==v||t[32]!==b?(x=(0,$.jsx)(`span`,{className:`absolute right-[5%] top-[8%] h-[46%] w-[20%] rounded-lg`,style:v,children:b}),t[31]=v,t[32]=b,t[33]=x):x=t[33];let S;return t[34]!==i||t[35]!==_||t[36]!==x||t[37]!==a||t[38]!==o||t[39]!==s||t[40]!==c||t[41]!==l||t[42]!==u||t[43]!==d?(S=(0,$.jsxs)(`span`,{className:`absolute inset-0`,style:i,children:[a,o,s,c,l,u,d,f,p,_,x]}),t[34]=i,t[35]=_,t[36]=x,t[37]=a,t[38]=o,t[39]=s,t[40]=c,t[41]=l,t[42]=u,t[43]=d,t[44]=S):S=t[44],S}function eo(e){let t=(0,Z.c)(7),{className:n,panes:r}=e,i;t[0]===n?i=t[1]:(i=R(`relative block w-full overflow-hidden rounded-lg border border-border/60`,n),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r.map(to),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:i,children:a}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function to(e){return(0,$.jsx)($a,{clip:e.clip,colors:e.colors},e.clip??`pane`)}var no=[Ye,He,qe,nt,Je];function ro(e){if(e.length===0)return[];let t=e.map(e=>e.label.trim().split(/\s+/)),n=t[0],r=n.findIndex((e,n)=>t.some(t=>t[n]?.toLocaleLowerCase()!==e.toLocaleLowerCase())),i=r===-1?n.length-1:r;return e.map((e,n)=>t[n]?.slice(Math.max(0,i)).join(` `).trim()||e.label)}function io(e,t){let n=URL.createObjectURL(new Blob([t],{type:`application/json`})),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),setTimeout(()=>URL.revokeObjectURL(n),3e4)}function ao(e){let t=(0,Z.c)(7),{label:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,$.jsx)(Nt,{render:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,$.jsx)(Pt,{children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(It,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function oo(e){let t=(0,Z.c)(59),{theme:n,isActive:r,onUse:i,onUseMode:a,activeModes:o,onEdit:s,onDuplicate:c,onDownload:l,onRemove:u,variantNavigation:d}=e,f;t[0]===n.previews?f=t[1]:(f=n.previews.map(so),t[0]=n.previews,t[1]=f);let p=f,[m,h]=(0,Q.useState)(null),g,y,x,C,w,T,E,D;if(t[2]!==o||t[3]!==r||t[4]!==i||t[5]!==a||t[6]!==m||t[7]!==n.id||t[8]!==n.label||t[9]!==n.previews||t[10]!==d){let e=[`light`,`dark`].map(e=>{let t=d?.options.flatMap(t=>{let n=t.preview;return n.mode===e?[{option:t,preview:n}]:[]})??[];return{mode:e,options:t,selected:t.find(t=>{let{option:n}=t;return n.activeModes.includes(e)})??t[0]}});y=It,g=Nt;let s=r&&`bg-accent/30`;t[19]===s?w=t[20]:(w=R(`cursor-pointer overflow-hidden rounded-xl border border-border/70 bg-card/60 transition-colors hover:bg-accent/10`,s),t[19]=s,t[20]=w),T=n.id,E=i,t[21]===r?D=t[22]:(D=r?{boxShadow:`inset 0 0 0 1px var(--ring)`}:void 0,t[21]=r,t[22]=D),x=`relative`,C=d?(0,$.jsx)(`div`,{"aria-label":`Light and dark theme variants`,className:`relative h-20`,role:`group`,onBlurCapture:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||h(null)},onKeyDown:e=>{e.key===`Escape`&&h(null)},onMouseLeave:()=>h(null),children:e.map(e=>{let{mode:t,options:n,selected:r}=e;if(!r)return null;let i=t===`light`?-52:52,a=m===t,o=r.option.activeModes.includes(t);return(0,$.jsxs)(`div`,{className:`contents`,children:[(0,$.jsx)(ao,{label:`${t===`light`?`Light`:`Dark`}: ${r.option.label}`,children:(0,$.jsxs)(`button`,{"aria-label":n.length>1?`Choose ${t} variant, ${n.length} options, currently ${r.option.label}`:`Use ${t} variant, currently ${r.option.label}`,"aria-pressed":o,className:`absolute left-1/2 top-2 z-20 flex size-14 items-center justify-center rounded-full outline-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring`,style:{transform:`translateX(calc(-50% + ${i}px))`},type:`button`,onClick:e=>{e.stopPropagation(),d.onSelectAndUse(r.option.themeIndex,t)},onFocus:()=>h(t),onMouseEnter:()=>h(t),children:[(0,$.jsx)(Fn,{colors:r.preview.colors,mode:r.preview.mode}),o?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 rounded-full ring-2 ring-inset ring-ring`}):null,o?(0,$.jsx)(`span`,{className:`pointer-events-none absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full border border-border/70 bg-background text-foreground shadow-sm`,children:t===`light`?(0,$.jsx)(M,{className:`size-2.5`}):(0,$.jsx)(b,{className:`size-2.5`})}):null]})}),(0,$.jsxs)(`span`,{className:`pointer-events-none absolute bottom-0 left-1/2 inline-flex max-w-24 -translate-x-1/2 items-center gap-1 text-2xs font-medium text-foreground`,style:{marginLeft:i},children:[(0,$.jsx)(`span`,{className:`truncate`,children:r.option.label}),n.length>1?(0,$.jsxs)(`span`,{className:`shrink-0 rounded-full bg-muted px-1 text-3xs text-muted-foreground`,children:[`+`,n.length-1]}):null]}),n.length>1?n.map((e,r)=>{let{option:o,preview:s}=e,c=r/(n.length-1)-.5,l=i+c*68,u=Math.abs(c)*10,f=o.activeModes.includes(t);return(0,$.jsx)(ao,{label:`Use ${o.label} for ${t} mode`,children:(0,$.jsx)(`button`,{"aria-label":`Use ${o.label} for ${t} mode${f?`, currently active`:``}`,"aria-pressed":f,className:R(`absolute left-1/2 top-1 z-30 flex size-7 items-center justify-center rounded-full bg-background shadow-sm outline-none transition-[opacity,transform] duration-200 ease-out motion-reduce:transition-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,f?`ring-2 ring-inset ring-ring`:`ring-1 ring-border/70`),style:{opacity:+!!a,pointerEvents:a?`auto`:`none`,transform:`translate(calc(-50% + ${a?l:i}px), ${a?u:28}px) scale(${a?1:.55})`,transitionDelay:a?`${r*35}ms`:`0ms`},type:`button`,onClick:e=>{e.stopPropagation(),d.onSelectAndUse(o.themeIndex,t)},onFocus:()=>h(t),onMouseEnter:()=>h(t),children:(0,$.jsx)(`span`,{className:`pointer-events-none scale-[0.43]`,children:(0,$.jsx)(Fn,{colors:s.colors,mode:s.mode})})})},o.label)}):null]},t)})}):(0,$.jsx)(Rn,{label:n.label,activeModes:o,onSelectMode:a,previews:n.previews}),t[2]=o,t[3]=r,t[4]=i,t[5]=a,t[6]=m,t[7]=n.id,t[8]=n.label,t[9]=n.previews,t[10]=d,t[11]=g,t[12]=y,t[13]=x,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D}else g=t[11],y=t[12],x=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18];let O;t[23]!==x||t[24]!==C?(O=(0,$.jsx)(`div`,{className:x,children:C}),t[23]=x,t[24]=C,t[25]=O):O=t[25];let k=`Use ${d?`${d.collectionLabel}, ${n.label} variant`:`${n.label} theme`}${r?`, currently active`:``}`,A;t[26]===i?A=t[27]:(A=e=>{e.stopPropagation(),i()},t[26]=i,t[27]=A);let j=d?.collectionLabel??n.label,N;t[28]!==r||t[29]!==A||t[30]!==j||t[31]!==k?(N=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,$.jsx)(`button`,{"aria-label":k,"aria-pressed":r,className:`min-w-0 cursor-pointer truncate rounded-sm text-left text-sm font-medium text-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card`,type:`button`,onClick:A,children:j})})}),t[28]=r,t[29]=A,t[30]=j,t[31]=k,t[32]=N):N=t[32];let I;t[33]!==l||t[34]!==c||t[35]!==s||t[36]!==u||t[37]!==n.label||t[38]!==d?(I=s||c||l||u?(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsxs)(It,{children:[(0,$.jsx)(Nt,{render:(0,$.jsx)(P,{"aria-label":`Duplicate ${n.label}`,size:`icon-xs`,variant:`ghost`,onClick:e=>{e.stopPropagation(),c()},children:(0,$.jsx)(_,{})})}),(0,$.jsx)(Pt,{children:`Duplicate theme`})]}):null,s?(0,$.jsxs)(It,{children:[(0,$.jsx)(Nt,{render:(0,$.jsx)(P,{"aria-label":`Edit ${n.label}`,size:`icon-xs`,variant:`ghost`,onClick:e=>{e.stopPropagation(),s()},children:(0,$.jsx)(S,{})})}),(0,$.jsx)(Pt,{children:`Edit theme`})]}):null,l?(0,$.jsxs)(It,{children:[(0,$.jsx)(Nt,{render:(0,$.jsx)(P,{"aria-label":`Export ${n.label}`,size:`icon-xs`,variant:`ghost`,onClick:e=>{e.stopPropagation(),l()},children:(0,$.jsx)(F,{})})}),(0,$.jsx)(Pt,{children:`Export theme file`})]}):null,u?(0,$.jsxs)(It,{children:[(0,$.jsx)(Nt,{render:(0,$.jsx)(P,{"aria-label":d?`Remove themes from ${d.collectionLabel}`:`Remove ${n.label}`,size:`icon-xs`,variant:`ghost-destructive`,onClick:e=>{e.stopPropagation(),u()},children:(0,$.jsx)(v,{})})}),(0,$.jsx)(Pt,{children:d?`Remove themes`:`Remove theme`})]}):null]}):null,t[33]=l,t[34]=c,t[35]=s,t[36]=u,t[37]=n.label,t[38]=d,t[39]=I):I=t[39];let L;t[40]!==N||t[41]!==I?(L=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-3 pt-2`,children:[N,I]}),t[40]=N,t[41]=I,t[42]=L):L=t[42];let z;t[43]!==L||t[44]!==w||t[45]!==T||t[46]!==E||t[47]!==D||t[48]!==O?(z=(0,$.jsxs)(`div`,{className:w,"data-theme-library-card":T,onClick:E,style:D,children:[O,L]}),t[43]=L,t[44]=w,t[45]=T,t[46]=E,t[47]=D,t[48]=O,t[49]=z):z=t[49];let B;t[50]!==g||t[51]!==z?(B=(0,$.jsx)(g,{render:z}),t[50]=g,t[51]=z,t[52]=B):B=t[52];let V=d?`Use the first variants for light and dark`:p.length>1?`Use for both light and dark`:`Use for ${p[0]} mode only`,H;t[53]===V?H=t[54]:(H=(0,$.jsx)(Pt,{children:V}),t[53]=V,t[54]=H);let U;return t[55]!==y||t[56]!==B||t[57]!==H?(U=(0,$.jsxs)(y,{children:[B,H]}),t[55]=y,t[56]=B,t[57]=H,t[58]=U):U=t[58],U}function so(e){return e.mode}function co(e){let t=(0,Z.c)(49),{themes:n,activeModesFor:r,onUse:i,onUseMode:a,onDuplicate:o,onEdit:s,onDownload:c,onRemove:l}=e,u;t[0]!==r||t[1]!==n?(u=()=>{let e=n.findIndex(e=>r(e.id).length>0);return e<0?0:e},t[0]=r,t[1]=n,t[2]=u):u=t[2];let[d,f]=(0,Q.useState)(u),p=Math.min(d,n.length-1),m=n[p],h,g;if(t[3]!==p||t[4]!==d?(h=()=>{d!==p&&f(p)},g=[p,d],t[3]=p,t[4]=d,t[5]=h,t[6]=g):(h=t[5],g=t[6]),(0,Q.useEffect)(h,g),!m)return null;let _=m.collection?.label??m.label,v;if(t[7]!==r||t[8]!==_||t[9]!==c||t[10]!==o||t[11]!==s||t[12]!==l||t[13]!==i||t[14]!==a||t[15]!==m||t[16]!==n){let e=ro(n),u;t[18]===n?u=t[19]:(u=n.find(uo),t[18]=n,t[19]=u);let d=u,p;t[20]===n?p=t[21]:(p=n.find(lo),t[20]=n,t[21]=p);let h=p,g;t[22]!==h||t[23]!==d||t[24]!==i||t[25]!==a||t[26]!==m||t[27]!==n.length?(g=()=>{n.length===1?i(m):(d&&a(d,`light`),h&&a(h,`dark`),f(0))},t[22]=h,t[23]=d,t[24]=i,t[25]=a,t[26]=m,t[27]=n.length,t[28]=g):g=t[28];let y=g,b;t[29]!==r||t[30]!==m.id?(b=r(m.id),t[29]=r,t[30]=m.id,t[31]=b):b=t[31];let x;t[32]!==c||t[33]!==m?(x=()=>c(m),t[32]=c,t[33]=m,t[34]=x):x=t[34];let S;t[35]!==o||t[36]!==m?(S=()=>o(m),t[35]=o,t[36]=m,t[37]=S):S=t[37];let C;t[38]!==s||t[39]!==m?(C=()=>s(m),t[38]=s,t[39]=m,t[40]=C):C=t[40];let w;t[41]!==l||t[42]!==m?(w=()=>l(m),t[41]=l,t[42]=m,t[43]=w):w=t[43];let T;t[44]!==a||t[45]!==m?(T=e=>a(m,e),t[44]=a,t[45]=m,t[46]=T):T=t[46];let E;t[47]===m?E=t[48]:(E=nr(m),t[47]=m,t[48]=E),v=(0,$.jsx)(oo,{activeModes:b,isActive:!1,onDownload:x,onDuplicate:S,onEdit:C,onRemove:w,onUse:y,onUseMode:T,theme:E,...n.length>1?{variantNavigation:{collectionLabel:_,options:n.flatMap((t,n)=>nr(t).previews.map(i=>({themeIndex:n,label:e[n]??t.label,activeModes:r(t.id),preview:i}))),onSelectAndUse:(e,t)=>{let r=n[e];r&&(f(e),a(r,t))}}}:{}}),t[7]=r,t[8]=_,t[9]=c,t[10]=o,t[11]=s,t[12]=l,t[13]=i,t[14]=a,t[15]=m,t[16]=n,t[17]=v}else v=t[17];return v}function lo(e){return it(e).includes(`dark`)}function uo(e){return it(e).includes(`light`)}function fo(e){let t=(0,Z.c)(118),{theme:n,setTheme:r,appearanceMode:i,setAppearanceMode:a,customThemes:o,initialAppearance:c,refreshTheme:l,isImportOpen:u,onImportOpenChange:d,themeHalves:f,setThemeHalf:p}=e,m=lr(bo),h=Jn(),[_,v]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(!1),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[0]=x):x=t[0];let[S,C]=(0,Q.useState)(x),T;t[1]===S?T=t[2]:(T=new Set(S),t[1]=S,t[2]=T);let E=T,D=_?.theme,O;t[3]===_?.collectionThemes?O=t[4]:(O=_?.collectionThemes??[],t[3]=_?.collectionThemes,t[4]=O);let k=O,A=k.length>1,j=D?.collection?.label??D?.label,M=yo,N=vo,F;t[5]===r?F=t[6]:(F=e=>{let t=r(e);return t||M(),t},t[5]=r,t[6]=F);let I=F,L;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(L=(e,t)=>{v({theme:e,collectionThemes:t}),C(t.length>1?[]:[e.id]),b(!0)},t[7]=L):L=t[7];let z=L,B;t[8]!==i||t[9]!==I||t[10]!==p||t[11]!==n||t[12]!==S||t[13]!==_?(B=()=>{if(!_)return;let e=new Set(S);if(e.size===0)return;let t=e.has(Xe(n)?.id??``),r=Ee();if(!t||I(i===`system`?`system`:i)){for(let n of[`light`,`dark`]){let i=r[n];if(i===void 0)continue;let a=i&&e.has(i)?null:t?i:void 0;if(a!==void 0&&!p(n,a)){N();return}}try{Ze([...e])}catch{N();return}b(!1)}},t[8]=i,t[9]=I,t[10]=p,t[11]=n,t[12]=S,t[13]=_,t[14]=B):B=t[14];let V=B,H=Xe(n)?.id??null,U=f?.light??H,W=f?.dark??H,ee;t[15]!==i||t[16]!==H||t[17]!==I||t[18]!==r||t[19]!==p||t[20]!==n?(ee=(e,t)=>{let a=e===`light`?`dark`:`light`;if(t===null&&H!==null){let e=Ee()[a]??H;if(!I(i===`system`?`system`:i))return;p(a,e)||(r(n),M())}else p(e,t)||M()},t[15]=i,t[16]=H,t[17]=I,t[18]=r,t[19]=p,t[20]=n,t[21]=ee):ee=t[21];let G=ee,te;t[22]!==W||t[23]!==c||t[24]!==U?(te=Xe((c===`light`?U:W)??``)??null,t[22]=W,t[23]=c,t[24]=U,t[25]=te):te=t[25];let ne=te,re=_o,ie;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(e,t)=>{let n=re(e);return Ln(n,t)??n.previews[0].colors},t[26]=ie):ie=t[26];let ae=ie,oe;t[27]===a?oe=t[28]:(oe=e=>{a(e)||M()},t[27]=a,t[28]=oe);let se=oe,ce;t[29]===G?ce=t[30]:(ce=e=>t=>{t!==`system`&&G(t,e)},t[29]=G,t[30]=ce);let le=ce,ue;t[31]!==W||t[32]!==U?(ue=e=>{let t=[];return U===e&&t.push(`light`),W===e&&t.push(`dark`),t},t[31]=W,t[32]=U,t[33]=ue):ue=t[33];let de=ue,fe;if(t[34]!==W||t[35]!==U){let e=e=>ae(e===`light`?U:W,e);fe=t=>(0,$.jsx)(eo,{className:`h-[8.75rem]`,panes:t===`system`?[{clip:`left`,colors:e(`light`)},{clip:`right`,colors:e(`dark`)}]:[{colors:e(t===`dark`?`dark`:`light`)}]}),t[34]=W,t[35]=U,t[36]=fe}else fe=t[36];let pe=fe,K;t[37]!==i||t[38]!==pe||t[39]!==se?(K=()=>(0,$.jsx)(`div`,{"aria-label":`Appearance mode`,className:`grid w-full grid-cols-3 gap-3`,role:`group`,children:[`system`,`light`,`dark`].map(e=>{let t=i===e;return(0,$.jsxs)(`button`,{"aria-label":e===`system`?`Follow the system appearance`:`Use ${e} mode`,"aria-pressed":t,className:R(`flex cursor-pointer flex-col items-stretch gap-1.5 rounded-xl border p-2 outline-none transition-colors focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring`,t?`border-transparent bg-accent/30`:`border-border/70 bg-card/60 hover:bg-accent/10`),style:t?{boxShadow:`inset 0 0 0 1px var(--ring)`}:void 0,onClick:()=>se(e),type:`button`,children:[pe(e),(0,$.jsx)(`span`,{className:R(`flex items-center justify-center text-xs font-medium`,t?`text-foreground`:`text-muted-foreground`),children:e===`system`?`System`:e===`light`?`Light`:`Dark`})]},e)})}),t[37]=i,t[38]=pe,t[39]=se,t[40]=K):K=t[40];let me=K,he,q,ge,_e,ve;if(t[41]!==ne?.id||t[42]!==i||t[43]!==G||t[44]!==o||t[45]!==h||t[46]!==le||t[47]!==c||t[48]!==d||t[49]!==m||t[50]!==I||t[51]!==de||t[52]!==me){let e=[...o.reduce(go,new Map).entries()],n=()=>(0,$.jsx)(Ft,{children:(0,$.jsxs)(`div`,{className:`grid w-full gap-2`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(min(100%, 16rem), 1fr))`},children:[Gn.map(e=>(0,$.jsx)(oo,{activeModes:de(null),isActive:!1,onDuplicate:()=>m({editingThemeId:null,seedThemeId:null,seedName:`${e.label} copy`,initialAppearance:c}),onUse:()=>I(i===`system`?`system`:i),onUseMode:le(null),theme:e},e.id)),no.map(e=>{let t=nr(e);return(0,$.jsx)(oo,{activeModes:de(e.id),isActive:!1,onDuplicate:()=>m({editingThemeId:null,seedThemeId:e.id,seedName:`${e.label} copy`,initialAppearance:c}),onUse:()=>I(e.id),onUseMode:le(e.id),theme:t},e.id)}),h.filter(e=>!o.some(t=>t.id===e.id)).map(e=>(0,$.jsx)(oo,{activeModes:de(e.id),isActive:!1,onDuplicate:()=>m({editingThemeId:null,seedThemeId:e.id,seedName:`${e.label} copy`,initialAppearance:c}),onUse:()=>{let t=We(e);t===null?I(e.id):G(t,e.id)},onUseMode:le(e.id),theme:nr(e)},e.id)),e.map(e=>{let[t,n]=e;return(0,$.jsx)(co,{activeModesFor:de,onDownload:ho,onDuplicate:e=>m({editingThemeId:null,seedThemeId:e.id,seedName:`${e.label} copy`,initialAppearance:c}),onEdit:e=>m({editingThemeId:e.id,seedThemeId:null,seedName:null,initialAppearance:c}),onRemove:e=>z(e,n),onUse:e=>{let t=it(e);t.length===1?G(t[0],e.id):I(e.id)},onUseMode:(e,t)=>le(e.id)(t),themes:n},t)})]})});he=`space-y-3`,t[58]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(`h3`,{className:`px-3 text-sm font-normal text-foreground/70 sm:px-4`,children:X(`color-scheme`).title}),t[58]=q):q=t[58],t[59]===me?ge=t[60]:(ge=me(),t[59]=me,t[60]=ge);let r;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`h3`,{className:`text-sm font-normal text-foreground/70`,children:X(`theme`).title}),t[61]=r):r=t[61];let a;t[62]!==ne?.id||t[63]!==c||t[64]!==m?(a=()=>m({editingThemeId:null,seedThemeId:ne?.id??null,seedName:null,initialAppearance:c}),t[62]=ne?.id,t[63]=c,t[64]=m,t[65]=a):a=t[65];let s;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(g,{}),t[66]=s):s=t[66];let l;t[67]===a?l=t[68]:(l=(0,$.jsxs)(P,{size:`xs`,variant:`outline`,onClick:a,children:[s,`Create theme`]}),t[67]=a,t[68]=l);let u;t[69]===d?u=t[70]:(u=()=>d(!0),t[69]=d,t[70]=u);let f;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(w,{}),t[71]=f):f=t[71];let p;t[72]===u?p=t[73]:(p=(0,$.jsxs)(P,{size:`xs`,variant:`outline`,onClick:u,children:[f,`Add theme`]}),t[72]=u,t[73]=p),t[74]!==l||t[75]!==p?(_e=(0,$.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center justify-between gap-3 px-3 pt-2 sm:px-4`,children:[r,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[l,p]})]}),t[74]=l,t[75]=p,t[76]=_e):_e=t[76],ve=n(),t[41]=ne?.id,t[42]=i,t[43]=G,t[44]=o,t[45]=h,t[46]=le,t[47]=c,t[48]=d,t[49]=m,t[50]=I,t[51]=de,t[52]=me,t[53]=he,t[54]=q,t[55]=ge,t[56]=_e,t[57]=ve}else he=t[53],q=t[54],ge=t[55],_e=t[56],ve=t[57];let ye;t[77]===l?ye=t[78]:(ye=(e,t)=>{let{updated:n}=t;n&&l();let r=n?`updated`:`added`;xe.add(Ie({type:`success`,title:e.length===1?`${e[0].label} ${r}`:`${e.length} themes ${r}`,description:e.map(mo).join(`, `)}))},t[77]=l,t[78]=ye);let be;t[79]!==G||t[80]!==I?(be=e=>{let t=it(e);return t.length===1?(G(t[0],e.id),xe.add(Ie({type:`success`,title:`${e.label} added`,description:`It’s now your ${t[0]} theme.`})),!0):I(e.id)?(xe.add(Ie({type:`success`,title:`${e.label} added`,description:`It’s now active.`})),!0):!1},t[79]=G,t[80]=I,t[81]=be):be=t[81];let Se;t[82]!==u||t[83]!==d||t[84]!==ye||t[85]!==be?(Se=(0,$.jsx)(Qa,{onImportedMany:ye,onImported:be,onOpenChange:d,open:u}),t[82]=u,t[83]=d,t[84]=ye,t[85]=be,t[86]=Se):Se=t[86];let Ce=A?`Remove themes from “${j}”?`:`Remove “${D?.label}”?`,we;t[87]===Ce?we=t[88]:(we=(0,$.jsx)(mn,{children:Ce}),t[87]=Ce,t[88]=we);let Te=A?`Select the variants you want to remove. You can restore them by importing the extension again.`:`You can bring it back anytime by importing its JSON file.`,De;t[89]===Te?De=t[90]:(De=(0,$.jsx)(pn,{children:Te}),t[89]=Te,t[90]=De);let Oe;t[91]!==we||t[92]!==De?(Oe=(0,$.jsxs)(ln,{children:[we,De]}),t[91]=we,t[92]=De,t[93]=Oe):Oe=t[93];let ke;t[94]!==A||t[95]!==k||t[96]!==E?(ke=A?(0,$.jsx)(`div`,{className:`grid max-h-72 grid-cols-1 gap-2 overflow-y-auto px-6 pb-6 sm:grid-cols-2`,children:k.map(e=>{let t=E.has(e.id),n=nr(e),r=`remove-theme-${e.id}`;return(0,$.jsxs)(`label`,{className:`group relative flex min-h-28 cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-border/70 bg-muted/25 p-3 has-checked:border-ring has-checked:bg-accent/20 hover:bg-muted/40`,htmlFor:r,children:[(0,$.jsxs)(`span`,{className:`absolute right-2 top-2 inline-grid size-5 grid-cols-1 sm:size-4`,children:[(0,$.jsx)(`input`,{checked:t,className:`col-start-1 row-start-1 size-full appearance-none rounded-sm border border-input bg-background outline-none checked:border-primary checked:bg-primary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring checked:focus-visible:inset-ring-3 checked:focus-visible:inset-ring-background dark:not-checked:bg-input/32 forced-colors:appearance-auto`,id:r,name:`themes-to-remove`,type:`checkbox`,onChange:t=>{let n=t.currentTarget.checked;C(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))}}),(0,$.jsx)(s,{className:`pointer-events-none col-start-1 row-start-1 size-3.5 shrink-0 self-center justify-self-center stroke-primary-foreground opacity-0 group-has-checked:opacity-100 sm:size-3`})]}),(0,$.jsx)(`span`,{className:`flex min-h-12 items-center justify-center gap-1`,children:n.previews.map(po)}),(0,$.jsx)(`p`,{className:`max-w-full truncate text-center text-base font-medium text-foreground sm:text-sm`,children:e.label})]},e.id)})}):null,t[94]=A,t[95]=k,t[96]=E,t[97]=ke):ke=t[97];let Ae;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,$.jsx)(dn,{render:(0,$.jsx)(P,{variant:`outline`}),children:`Cancel`}),t[98]=Ae):Ae=t[98];let je=S.length===0,Me=A?`Remove selected${S.length>0?` (${S.length})`:``}`:`Remove theme`,Ne;t[99]!==V||t[100]!==je||t[101]!==Me?(Ne=(0,$.jsxs)(un,{children:[Ae,(0,$.jsx)(P,{disabled:je,variant:`destructive`,onClick:V,children:Me})]}),t[99]=V,t[100]=je,t[101]=Me,t[102]=Ne):Ne=t[102];let Pe;t[103]!==Oe||t[104]!==ke||t[105]!==Ne?(Pe=(0,$.jsxs)(fn,{children:[Oe,ke,Ne]}),t[103]=Oe,t[104]=ke,t[105]=Ne,t[106]=Pe):Pe=t[106];let Fe;t[107]!==y||t[108]!==Pe?(Fe=(0,$.jsx)(hn,{open:y,onOpenChange:b,children:Pe}),t[107]=y,t[108]=Pe,t[109]=Fe):Fe=t[109];let Le;return t[110]!==he||t[111]!==q||t[112]!==ge||t[113]!==_e||t[114]!==ve||t[115]!==Se||t[116]!==Fe?(Le=(0,$.jsxs)(`div`,{className:he,children:[q,ge,_e,ve,Se,Fe]}),t[110]=he,t[111]=q,t[112]=ge,t[113]=_e,t[114]=ve,t[115]=Se,t[116]=Fe,t[117]=Le):Le=t[117],Le}function po(e){return(0,$.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center`,children:(0,$.jsx)(`span`,{className:`flex scale-75`,children:(0,$.jsx)(Fn,{colors:e.colors,mode:e.mode})})},e.mode)}function mo(e){return e.label}function ho(e){return io(`${e.id}.json`,Ve(e))}function go(e,t){let n=t.collection?`collection:${t.collection.id}`:`theme:${t.id}`,r=e.get(n);return r?r.push(t):e.set(n,[t]),e}function _o(e){if(e===null)return Gn[0];let t=Xe(e);return t?nr(t):Gn[0]}function vo(){xe.add(Ie({type:`error`,title:`Couldn’t remove theme`,description:`Try again.`}))}function yo(){xe.add(Ie({type:`error`,title:`Couldn’t save theme selection`,description:`Try again.`}))}function bo(e){return e.openThemeEditor}function xo(){let e=(0,Z.c)(17),t=je(wt),n;e[0]===t?n=e[1]:(n=kt.filter(e=>t[e.id]),e[0]=t,e[1]=n);let r=n.length,i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=X(`thread-details-items`),e[2]=i):i=e[2];let a;e[3]===t?a=e[4]:(a=Et(t)?null:(0,$.jsx)(Y,{label:`thread details`,onClick:So}),e[3]=t,e[4]=a);let o=`Thread details: ${r} of ${kt.length} on`,s;e[5]===o?s=e[6]:(s=(0,$.jsx)(P,{variant:`outline`,size:`sm`,className:`w-full justify-between sm:w-40`,"aria-label":o}),e[5]=o,e[6]=s);let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(m,{"aria-hidden":!0}),e[7]=c):c=e[7];let l;e[8]!==r||e[9]!==s?(l=(0,$.jsxs)(k,{render:s,children:[r,` of `,kt.length,` on`,c]}),e[8]=r,e[9]=s,e[10]=l):l=e[10];let u;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(I,{align:`end`,children:(0,$.jsx)(At,{})}),e[11]=u):u=e[11];let d;e[12]===l?d=e[13]:(d=(0,$.jsxs)(E,{children:[l,u]}),e[12]=l,e[13]=d);let f;return e[14]!==a||e[15]!==d?(f=(0,$.jsx)(J,{...i,description:`Choose what the thread details card shows. You can also right-click the card.`,resetAction:a,control:d}),e[14]=a,e[15]=d,e[16]=f):f=e[16],f}function So(){return ke(Dt)}function Co(e){let t=(0,Z.c)(22),{durationMs:n}=e,[r,i]=(0,Q.useState)(!0),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>i(wo),t[0]=a):a=t[0];let o=`${n}ms`,s;t[1]===o?s=t[2]:(s={"--preview-duration":o},t[1]=o,t[2]=s);let c=s,l=r?`w-4`:`w-0`,u;t[3]===l?u=t[4]:(u=R(`h-full shrink-0 overflow-hidden rounded-md bg-sidebar`,`transition-[width,height,border-width] duration-(--preview-duration) ease-out motion-reduce:transition-none`,l),t[3]=l,t[4]=u);let d;t[5]===u?d=t[6]:(d=(0,$.jsx)(`span`,{"aria-hidden":!0,className:u}),t[5]=u,t[6]=d);let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(`span`,{className:`flex min-h-0 flex-1 flex-col gap-1 pt-1`,children:[(0,$.jsx)(`span`,{className:`h-0.5 w-full rounded-full bg-muted-foreground/25`}),(0,$.jsx)(`span`,{className:`h-0.5 w-4/5 rounded-full bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-0.5 w-3/5 rounded-full bg-muted-foreground/15`})]}),t[7]=f):f=t[7];let p=r?`h-2 border-t border-border/70`:`h-0 border-t-0`,m;t[8]===p?m=t[9]:(m=R(`flex shrink-0 items-center overflow-hidden bg-foreground/5 px-2`,`transition-[width,height,border-width] duration-(--preview-duration) ease-out motion-reduce:transition-none`,p),t[8]=p,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`span`,{className:`h-px w-2/3 rounded-full bg-muted-foreground/25`}),t[10]=h):h=t[10];let g;t[11]===m?g=t[12]:(g=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`flex min-w-0 flex-1 flex-col px-1`,children:[f,(0,$.jsx)(`span`,{className:m,children:h})]}),t[11]=m,t[12]=g);let _=r?`w-5`:`w-0`,v;t[13]===_?v=t[14]:(v=R(`h-full shrink-0 overflow-hidden rounded-md bg-muted`,`transition-[width,height,border-width] duration-(--preview-duration) ease-out motion-reduce:transition-none`,_),t[13]=_,t[14]=v);let y;t[15]===v?y=t[16]:(y=(0,$.jsx)(`span`,{"aria-hidden":!0,className:v}),t[15]=v,t[16]=y);let b;return t[17]!==g||t[18]!==y||t[19]!==c||t[20]!==d?(b=(0,$.jsxs)(`button`,{type:`button`,"aria-label":`Replay panel animation preview`,className:`flex h-10 w-full cursor-pointer overflow-hidden rounded-lg border border-border bg-background p-1 shadow-xs/5 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,onClick:a,style:c,children:[d,g,y]}),t[17]=g,t[18]=y,t[19]=c,t[20]=d,t[21]=b):b=t[21],b}function wo(e){return!e}function To(){let{scope:e,connectedEnvironments:t}=Sn(),n=qn(),{snapshots:r,error:i,isLoading:a,refresh:o}=tr(e.environmentIds),s=Fe(t,B),[c,l]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(`all`),[p,m]=(0,Q.useState)(`newest`),[h,g]=(0,Q.useState)(!1),_=(0,Q.useRef)(!1),[y,b]=(0,Q.useState)(null),x=(0,Q.useMemo)(()=>{let t=e.kind===`project`||e.kind===`checkout`?new Set(e.members.map(e=>`${e.environmentId}:${e.id}`)):null;return r.flatMap(({environmentId:e,snapshot:n})=>n.projects.flatMap(r=>{let i=`${e}:${r.id}`;if(t!==null&&!t.has(i))return[];let a=n.threads.filter(e=>e.projectId===r.id).map(t=>fe(e,t));return a.length?[{key:i,project:{...r,environmentId:e},threads:a}]:[]}))},[r,e]),S=x.flatMap(e=>e.threads),C=x.some(e=>e.key===d)?d:`all`,w=x.flatMap(e=>{if(C!==`all`&&e.key!==C)return[];let t=e.threads.filter(e=>e.title.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())).toSorted((e,t)=>{if(p===`title`)return e.title.localeCompare(t.title);let n=(t.archivedAt??t.createdAt).localeCompare(e.archivedAt??e.createdAt);return p===`oldest`?-n:n});return t.length?[{...e,threads:t}]:[]}),T=!a&&!i&&e.environmentIds.every(e=>t.some(t=>t.environmentId===e)&&r.some(t=>t.environmentId===e)),E=async(t,r,i=!1)=>{if(!_.current){_.current=!0,g(!0),b(null);try{if(i&&!await Ae().dialogs.confirm(`Permanently delete all ${t.length} archived chats in ${e.label}? Search and project filters do not limit this action. This cannot be undone.`,{variant:`destructive`}))return;for(let e of t){let t=r===`unarchive`?await n.unarchiveThread(e):i?await n.deleteThread(e):await n.confirmAndDeleteThread(e);if(t._tag===`Failure`)throw se(t)}}catch(e){b(e instanceof Error?e.message:`The action could not be completed. Try again.`)}finally{o(),_.current=!1,g(!1)}}};return(0,$.jsxs)(Tn,{width:`wide`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,$.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Archived chats`}),(0,$.jsxs)(P,{variant:`destructive-outline`,size:`sm`,disabled:h||!T||!S.length||S.some(e=>!s.has(e.environmentId)),onClick:()=>void E(S.map(e=>u(e.environmentId,e.id)),`delete`,!0),children:[(0,$.jsx)(v,{"aria-hidden":!0}),` Delete all`]})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-[minmax(0,1fr)_9rem_10rem]`,children:[(0,$.jsx)(`div`,{className:`col-span-2 min-w-0 sm:col-span-1`,children:(0,$.jsxs)(rn,{children:[(0,$.jsx)(tn,{children:(0,$.jsx)(z,{"aria-hidden":!0})}),(0,$.jsx)(nn,{type:`search`,"aria-label":`Search archived chats`,placeholder:`Search archived chats`,value:c,onChange:e=>l(e.currentTarget.value)})]})}),(0,$.jsxs)(_e,{value:p,onValueChange:e=>e&&m(e),children:[(0,$.jsx)(ge,{"aria-label":`Sort archived chats`,children:(0,$.jsx)(me,{children:p===`newest`?`Newest first`:p===`oldest`?`Oldest first`:`By title`})}),(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{value:`newest`,children:`Newest first`}),(0,$.jsx)(K,{value:`oldest`,children:`Oldest first`}),(0,$.jsx)(K,{value:`title`,children:`By title`})]})]}),(0,$.jsxs)(_e,{value:C,onValueChange:e=>e&&f(e),children:[(0,$.jsx)(ge,{"aria-label":`Filter by project`,children:(0,$.jsx)(me,{children:C===`all`?`All projects`:x.find(e=>e.key===d)?.project.title??`All projects`})}),(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{value:`all`,children:`All projects`}),x.map(e=>(0,$.jsx)(K,{value:e.key,children:e.project.title},e.key))]})]})]}),y||i?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 text-sm text-destructive-foreground`,children:[(0,$.jsx)(`p`,{children:y??i}),(0,$.jsx)(P,{variant:`outline`,size:`sm`,onClick:o,children:`Retry`})]}):null,w.map(({key:e,project:t,threads:n},r)=>(0,$.jsx)(Dn,{id:r===0?`archive`:void 0,title:t.title,icon:(0,$.jsx)(en,{project:t}),headerAction:(0,$.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[n.length,` `,n.length===1?`chat`:`chats`]}),children:n.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-4`,onContextMenu:t=>{t.preventDefault(),!h&&s.has(e.environmentId)&&Ae().contextMenu.show([{id:`unarchive`,label:`Unarchive`},{id:`delete`,label:`Delete`,destructive:!0}],{x:t.clientX,y:t.clientY}).then(t=>{if(t===`delete`||t===`unarchive`)return E([u(e.environmentId,e.id)],t)}).catch(e=>b(e instanceof Error?e.message:`Could not open chat actions.`))},children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`break-words text-sm font-medium`,children:e.title||`Untitled chat`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:new Date(e.archivedAt??e.createdAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})})]}),(0,$.jsxs)(It,{children:[(0,$.jsx)(Nt,{render:(0,$.jsx)(P,{variant:`ghost-destructive`,size:`icon-sm`,"aria-label":`Delete ${e.title}`,disabled:h||!s.has(e.environmentId),onClick:()=>void E([u(e.environmentId,e.id)],`delete`),children:(0,$.jsx)(v,{"aria-hidden":!0})})}),(0,$.jsx)(Pt,{children:`Delete chat`})]}),(0,$.jsx)(P,{variant:`soft`,size:`sm`,disabled:h||!s.has(e.environmentId),onClick:()=>void E([u(e.environmentId,e.id)],`unarchive`),children:`Unarchive`})]},e.id))},e)),w.length?null:(0,$.jsx)(`p`,{id:`archive`,role:`status`,className:`py-8 text-center text-sm text-muted-foreground`,children:a?`Loading archived chats…`:i?`Archived chats could not be loaded.`:S.length?`No chats match your filters.`:`No archived chats.`})]})}var Eo={artwork:`Artwork`,pill:`Version pill`,none:`None`},Do={turn:`Wait for the full response`,paragraph:`Show finished paragraphs`},Oo={turn:`Text appears once the agent finishes its turn.`,paragraph:`Each paragraph or code block appears as soon as it is complete.`},ko={updated_at:`Last user message`,created_at:`Created at`,manual:`Manual`},Ao=ne(H),jo={locale:`System default`,"12-hour":`12-hour`,"24-hour":`24-hour`},Mo={comfortable:`Comfortable`,wide:`Wide`,full:`Full`},No={p4:`P4`,lucide:`Lucide`},Po={stacked:`Stacked`,split:`Split`},Fo={direct:`Direct`,hold:`Hold`,"double-click":`Double press`},Io={balanced:`Balanced`,performance:`Performance`,"battery-saver":`Battery saver`},Lo={...Io,advanced:`Advanced`},Ro={balanced:`Pauses probes for idle clients, locked hosts, or low power mode.`,performance:`Allows scoped background probes while any subscribed client remains connected.`,"battery-saver":`Also pauses background probes when the host or client is on battery.`},zo=`Uses custom intervals.`,Bo=ae.make(`codex`),Vo=[{key:`pauseWhenHostLocked`,label:`Pause when host is locked`},{key:`pauseWhenHostLowPower`,label:`Pause on host low power`},{key:`pauseWhenClientLowPower`,label:`Pause on client low power`},{key:`pauseWhenOnBattery`,label:`Pause on battery`}];function Ho(){return{backgroundActivity:V.backgroundActivity}}function Uo(e){return{backgroundActivity:{schemaVersion:1,profile:e,overrides:{}}}}function Wo(){let e=jn(),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(!1),a=typeof window<`u`&&!!window.desktopBridge,o=e?.channel??`latest`,s=a?null:le,c=Nn||a&&o===`nightly`,l=(0,Q.useCallback)(e=>{let t=window.desktopBridge;t&&typeof t.setUpdateChannel==`function`&&e!==o&&(n(!0),t.setUpdateChannel(e).catch(e=>{xe.add(Ie({type:`error`,title:`Could not change update track`,description:e instanceof Error?e.message:`Update track change failed.`}))}).finally(()=>{n(!1)}))},[o]),u=(0,Q.useCallback)(async()=>{let t=window.desktopBridge;if(!t)return;let n=e?Hn(e):`none`;if(n===`download`)t.downloadUpdate().catch(e=>{xe.add(Ie({type:`error`,title:`Could not download update`,description:e instanceof Error?e.message:`Download failed.`}))});else if(n===`install`){if(r)return;i(!0);let n=!1;try{n=await Ae().dialogs.confirm(Yn(e??{availableVersion:null,downloadedVersion:null}))}catch(e){i(!1),xe.add(Ie({type:`error`,title:`Could not confirm update`,description:e instanceof Error?e.message:`Update confirmation failed.`}));return}if(!n){i(!1);return}t.installUpdate().catch(e=>{xe.add(Ie({type:`error`,title:`Could not install update`,description:e instanceof Error?e.message:`Install failed.`}))}).finally(()=>i(!1))}else typeof t.checkForUpdate==`function`&&t.checkForUpdate().then(e=>{e.checked||xe.add(Ie({type:`error`,title:`Could not check for updates`,description:e.state.message??`Automatic updates are not available in this build.`}))}).catch(e=>{xe.add(Ie({type:`error`,title:`Could not check for updates`,description:e instanceof Error?e.message:`Update check failed.`}))})},[r,e]),d=e?Hn(e):`none`,f=e?cr(e):null,p=d===`none`?!rr(e):or(e),m={download:`Download`,install:`Install`}[d]??{checking:`Checking…`,downloading:`Downloading…`,"up-to-date":`Up to Date`}[e?.status??``]??`Check for Updates`,h=d===`download`||d===`install`?`Update available.`:`Current version of the application.`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J,{id:X(`app-version`).id,title:(0,$.jsx)(Pr,{}),description:h,control:(0,$.jsxs)(It,{children:[(0,$.jsx)(Nt,{render:(0,$.jsx)(P,{size:`sm`,variant:`outline`,disabled:p||r,onClick:u,children:m})}),f?(0,$.jsx)(Pt,{children:f}):null]})}),a?(0,$.jsx)(J,{...X(`update-track`),description:`Use stable releases or nightly builds. Switch back anytime.`,control:(0,$.jsxs)(_e,{value:o,onValueChange:e=>{l(e)},children:[(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Update track`,disabled:t,children:(0,$.jsx)(me,{children:o===`nightly`?`Nightly`:`Stable`})}),(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{hideIndicator:!0,value:`latest`,children:`Stable`}),(0,$.jsx)(K,{hideIndicator:!0,value:`nightly`,children:`Nightly`})]})]})}):s?(0,$.jsx)(J,{...X(`update-track`),description:`Switches the hosted app release channel.`,control:(0,$.jsxs)(_e,{value:s,onValueChange:e=>{e!==s&&window.location.assign(pe({channel:e}))},children:[(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Update track`,children:(0,$.jsx)(me,{children:ue})}),(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{hideIndicator:!0,value:`latest`,children:`Latest`}),(0,$.jsx)(K,{hideIndicator:!0,value:`nightly`,children:`Nightly`})]})]})}):null,c?(0,$.jsx)(Vn,{}):null,a?(0,$.jsx)(Ir,{}):null]})}function Go(e){let{theme:t,setTheme:n,followSystem:r,setFollowSystem:i,setThemeHalf:a,clearThemeHalves:o,themeHalves:s}=Te(),c=gn(),l=bn(),u=!G(c.textGenerationModelSelection??null,V.textGenerationModelSelection??null),d=Dr(c),f=(0,Q.useMemo)(()=>[...t===`system`?[]:[`Theme`],...r?[]:[`Follow system`],...s===null?[]:[`Theme mix`],...c.appearanceContrast===V.appearanceContrast?[]:[`Contrast`],...c.glassOpacity===V.glassOpacity?[]:[`Glass opacity`],...c.diffColorScheme===V.diffColorScheme?[]:[`Diff colors`],...c.chatWidth===V.chatWidth?[]:[`Chat width`],...c.iconSet===V.iconSet?[]:[`Icon set`],...c.mathRenderingEnabled===V.mathRenderingEnabled?[]:[`Render math`],...c.panelAnimationDurationMs===V.panelAnimationDurationMs?[]:[`Panel animations`],...c.environmentIdentificationMode===V.environmentIdentificationMode?[]:[`Environment identification`],...c.timestampFormat===V.timestampFormat?[]:[`Time format`],...c.notificationMode===V.notificationMode?[]:[`Thread notifications`],...c.inAppNotificationsEnabled===V.inAppNotificationsEnabled?[]:[`In-app notifications`],...c.wakeScreenOnThreadEvents===V.wakeScreenOnThreadEvents?[]:[`Auto awake`],...c.sidebarThreadPreviewCount===V.sidebarThreadPreviewCount?[]:[`Visible threads`],...c.sidebarProjectGroupingMode===V.sidebarProjectGroupingMode?[]:[`Project Grouping`],...c.sidebarProjectSortOrder===V.sidebarProjectSortOrder?[]:[`Project order`],...c.sidebarWorkingShelfEnabled===V.sidebarWorkingShelfEnabled?[]:[`Working section`],...c.autoResumeLimitedThreads===V.autoResumeLimitedThreads?[]:[`Auto-resume limited threads`],...c.snoozeLimitedThreads===V.snoozeLimitedThreads?[]:[`Snooze limited threads`],...c.wordWrap===V.wordWrap?[]:[`Word wrap`],...c.persistComposerContextStrip===V.persistComposerContextStrip?[]:[`Composer context`],...Tr(c),...c.diffFilesCollapsed===V.diffFilesCollapsed?[]:[`Default diff file state`],...c.diffIgnoreWhitespace===V.diffIgnoreWhitespace?[]:[`Diff whitespace changes`],...c.diffLayout===V.diffLayout?[]:[`Diff layout`],...c.proactivePanelsEnabled===V.proactivePanelsEnabled?[]:[`Open pull requests and changes panels proactively`],...c.showSkillsInSlashMenu===V.showSkillsInSlashMenu?[]:[`Show skills in slash menu`],...c.composerCollapseOnScroll===V.composerCollapseOnScroll?[]:[`Collapse composer on scroll`],...c.composerRichTextEnabled===V.composerRichTextEnabled?[]:[`Rich text composer`],...c.sendShortcut===V.sendShortcut?[]:[`Send shortcut`],...c.followUpBehavior===V.followUpBehavior?[]:[`Follow-up behavior`],...c.contextWindowMeterEnabled===V.contextWindowMeterEnabled?[]:[`Context window indicator`],...c.responseStreamingMode===V.responseStreamingMode?[]:[`Response streaming`],...c.enableProviderUpdateChecks===V.enableProviderUpdateChecks?[]:[`Provider update checks`],...c.continueThreadsAfterServerUpdate===V.continueThreadsAfterServerUpdate?[]:[`Continue threads after restarts`],...d?[`Background activity`]:[],...c.defaultThreadEnvMode===V.defaultThreadEnvMode?[]:[`New thread mode`],...c.newWorktreesStartFromOrigin===V.newWorktreesStartFromOrigin?[]:[`New worktrees start from origin`],...c.addProjectBaseDirectory===V.addProjectBaseDirectory?[]:[`Add project base directory`],...c.confirmThreadUnpin===V.confirmThreadUnpin?[]:[`Unpin confirmation`],...c.confirmThreadArchive===V.confirmThreadArchive?[]:[`Archive confirmation`],...c.confirmThreadDelete===V.confirmThreadDelete?[]:[`Delete confirmation`],...c.confirmQuit===V.confirmQuit?[]:[`Quit shortcut`],...u?[`Text generation model`]:[],...yr(c),...c.enableAgentBrowserAccess===V.enableAgentBrowserAccess?[]:[`Agent browser access`]],[u,d,c.browserDefaultViewport,c.browserDefaultZoomFactor,c.browserDefaultAppearance,c.browserRecordingFrameRate,c.browserRecordingShowKeyPresses,c.browserRecordingShowMousePresses,c.browserLinkTarget,c.browserAutoShowFloatingPreview,c.pullRequestLinksOpenInApp,c.appearanceContrast,c.diffColorScheme,c.chatWidth,c.iconSet,c.mathRenderingEnabled,c.enableAgentBrowserAccess,c.confirmQuit,c.confirmThreadArchive,c.confirmThreadDelete,c.confirmThreadUnpin,c.composerCollapseOnScroll,c.composerRichTextEnabled,c.sendShortcut,c.followUpBehavior,c.addProjectBaseDirectory,c.defaultThreadEnvMode,c.newWorktreesStartFromOrigin,c.diffFilesCollapsed,c.diffIgnoreWhitespace,c.diffLayout,c.proactivePanelsEnabled,c.environmentIdentificationMode,c.contextWindowMeterEnabled,c.fontFamilyCode,c.fontFamilyComposer,c.fontFamilySans,c.fontFamilyTerminal,c.fontSizeCode,c.fontSizeInterface,c.fontSizePrompt,c.fontSizeTerminal,c.glassOpacity,c.panelAnimationDurationMs,c.responseStreamingMode,c.persistComposerContextStrip,c.enableProviderUpdateChecks,c.continueThreadsAfterServerUpdate,c.autoResumeLimitedThreads,c.snoozeLimitedThreads,c.sidebarProjectGroupingMode,c.sidebarProjectSortOrder,c.sidebarWorkingShelfEnabled,c.sidebarThreadPreviewCount,c.showSkillsInSlashMenu,c.timestampFormat,c.notificationMode,c.inAppNotificationsEnabled,c.wakeScreenOnThreadEvents,c.wordWrap,r,t,s]);return{changedSettingLabels:f,restoreDefaults:(0,Q.useCallback)(async()=>{if(f.length===0||!await(we()??Ae()).dialogs.confirm([`Restore default settings?`,`This will reset: ${f.join(`, `)}.`].join(`
45
45
  `),{variant:`destructive`}))return;let r=t;try{r=Oe()}catch{}let s=Ce(),c=r!==`system`,u=s!==null,d=De(r)!==`system`,p=()=>{xe.add(Ie({type:`error`,title:`Couldn’t restore theme settings`,description:`Try again.`}))},m=s;c&&!n(`system`)?p():u&&!o()||d&&!i(!0)?(c&&n(r),m?.light&&a(`light`,m.light),m?.dark&&a(`dark`,m.dark),p()):(l({appearanceContrast:V.appearanceContrast,diffColorScheme:V.diffColorScheme,chatWidth:V.chatWidth,iconSet:V.iconSet,mathRenderingEnabled:V.mathRenderingEnabled,timestampFormat:V.timestampFormat,notificationMode:V.notificationMode,inAppNotificationsEnabled:V.inAppNotificationsEnabled,wakeScreenOnThreadEvents:V.wakeScreenOnThreadEvents,wordWrap:V.wordWrap,persistComposerContextStrip:V.persistComposerContextStrip,diffFilesCollapsed:V.diffFilesCollapsed,diffIgnoreWhitespace:V.diffIgnoreWhitespace,diffLayout:V.diffLayout,proactivePanelsEnabled:V.proactivePanelsEnabled,showSkillsInSlashMenu:V.showSkillsInSlashMenu,composerCollapseOnScroll:V.composerCollapseOnScroll,composerRichTextEnabled:V.composerRichTextEnabled,sendShortcut:V.sendShortcut,followUpBehavior:V.followUpBehavior,contextWindowMeterEnabled:V.contextWindowMeterEnabled,environmentIdentificationMode:V.environmentIdentificationMode,glassOpacity:V.glassOpacity,panelAnimationDurationMs:V.panelAnimationDurationMs,sidebarThreadPreviewCount:V.sidebarThreadPreviewCount,sidebarProjectGroupingMode:V.sidebarProjectGroupingMode,sidebarProjectSortOrder:V.sidebarProjectSortOrder,sidebarWorkingShelfEnabled:V.sidebarWorkingShelfEnabled,autoResumeLimitedThreads:V.autoResumeLimitedThreads,snoozeLimitedThreads:V.snoozeLimitedThreads,responseStreamingMode:V.responseStreamingMode,enableProviderUpdateChecks:V.enableProviderUpdateChecks,continueThreadsAfterServerUpdate:V.continueThreadsAfterServerUpdate,backgroundActivity:V.backgroundActivity,backgroundActivityProfile:V.backgroundActivityProfile,automaticGitFetchInterval:V.automaticGitFetchInterval,providerHealthRefreshInterval:V.providerHealthRefreshInterval,defaultThreadEnvMode:V.defaultThreadEnvMode,newWorktreesStartFromOrigin:V.newWorktreesStartFromOrigin,addProjectBaseDirectory:V.addProjectBaseDirectory,confirmThreadArchive:V.confirmThreadArchive,confirmThreadDelete:V.confirmThreadDelete,confirmThreadUnpin:V.confirmThreadUnpin,confirmQuit:V.confirmQuit,textGenerationModelSelection:V.textGenerationModelSelection,fontFamilySans:V.fontFamilySans,fontFamilyComposer:V.fontFamilyComposer,fontFamilyCode:V.fontFamilyCode,fontFamilyTerminal:V.fontFamilyTerminal,fontSizeInterface:V.fontSizeInterface,fontSizePrompt:V.fontSizePrompt,fontSizeCode:V.fontSizeCode,fontSizeTerminal:V.fontSizeTerminal,browserDefaultViewport:V.browserDefaultViewport,browserDefaultZoomFactor:V.browserDefaultZoomFactor,browserDefaultAppearance:V.browserDefaultAppearance,browserRecordingFrameRate:V.browserRecordingFrameRate,browserRecordingShowKeyPresses:V.browserRecordingShowKeyPresses,browserRecordingShowMousePresses:V.browserRecordingShowMousePresses,browserLinkTarget:V.browserLinkTarget,browserSearchEngine:V.browserSearchEngine,browserCustomSearchUrl:V.browserCustomSearchUrl,browserAutoShowFloatingPreview:V.browserAutoShowFloatingPreview,pullRequestLinksOpenInApp:V.pullRequestLinksOpenInApp,enableAgentBrowserAccess:V.enableAgentBrowserAccess}),e?.())},[f,o,e,i,n,a,t,s,l])}}function Ko(e){let t=(0,Z.c)(94),{open:n,onOpenChange:r}=e,i=yn(),a=gn(),o=bn(),s,c,l,u,d,f;t[0]===a?(s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6]):(d=Ne(a),s=d.profile,c=Cr(d.automaticGitFetchInterval),u=Cr(d.providerHealthRefreshInterval),l=Cr(d.hostPowerMonitorActiveInterval),f=Cr(d.hostPowerMonitorIdleInterval),t[0]=a,t[1]=s,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f);let p=f,m=n&&i,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsxs)(Gt,{children:[(0,$.jsx)(Kt,{children:`Background Activity`}),(0,$.jsx)(Yt,{children:`Tune the shared power policy and the background intervals that feed it.`})]}),t[7]=h):h=t[7];let g=!i,_;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:`Shared policy`}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Controls whether background work may run after a subscribed interval fires.`})]}),t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==o?(v=e=>{(e===`balanced`||e===`performance`||e===`battery-saver`)&&o({backgroundActivity:wr(a,e)})},t[9]=a,t[10]=o,t[11]=v):v=t[11];let y=Io[s],b;t[12]===y?b=t[13]:(b=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Shared background policy`,children:(0,$.jsx)(me,{children:y})}),t[12]=y,t[13]=b);let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{hideIndicator:!0,value:`balanced`,children:Io.balanced}),(0,$.jsx)(K,{hideIndicator:!0,value:`performance`,children:Io.performance}),(0,$.jsx)(K,{hideIndicator:!0,value:`battery-saver`,children:Io[`battery-saver`]})]}),t[14]=x):x=t[14];let S;t[15]!==s||t[16]!==v||t[17]!==b?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[_,(0,$.jsxs)(_e,{value:s,onValueChange:v,children:[b,x]})]}),t[15]=s,t[16]=v,t[17]=b,t[18]=S):S=t[18];let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:X(`git-fetch-interval`).title}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Refresh remote branch status in the background.`})]}),t[19]=C):C=t[19];let w;t[20]!==d||t[21]!==a.backgroundActivity||t[22]!==o?(w=(e,t)=>o(Or(a.backgroundActivity,d,{automaticGitFetchInterval:ie(e)}),t),t[20]=d,t[21]=a.backgroundActivity,t[22]=o,t[23]=w):w=t[23];let T;t[24]!==c||t[25]!==w?(T=(0,$.jsx)(Ar,{label:`Git fetch interval`,value:c,min:0,step:5,onCommit:w}),t[24]=c,t[25]=w,t[26]=T):T=t[26];let E;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),t[27]=E):E=t[27];let D;t[28]===T?D=t[29]:(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[C,(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[T,E]})]}),t[28]=T,t[29]=D);let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:`Provider health interval`}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Refresh provider availability, versions, and auth state. Model catalog updates follow Provider update checks.`})]}),t[30]=O):O=t[30];let k;t[31]!==d||t[32]!==a.backgroundActivity||t[33]!==o?(k=(e,t)=>o(Or(a.backgroundActivity,d,{providerHealthRefreshInterval:ie(e)}),t),t[31]=d,t[32]=a.backgroundActivity,t[33]=o,t[34]=k):k=t[34];let A;t[35]!==u||t[36]!==k?(A=(0,$.jsx)(Ar,{label:`provider health interval`,value:u,min:0,step:30,onCommit:k}),t[35]=u,t[36]=k,t[37]=A):A=t[37];let j;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),t[38]=j):j=t[38];let M;t[39]===A?M=t[40]:(M=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[O,(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[A,j]})]}),t[39]=A,t[40]=M);let N;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:`Host power monitor`}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Poll host power state while clients are active.`})]}),t[41]=N):N=t[41];let F;t[42]!==d||t[43]!==a.backgroundActivity||t[44]!==o?(F=(e,t)=>o(Or(a.backgroundActivity,d,{hostPowerMonitorActiveInterval:ie(e)}),t),t[42]=d,t[43]=a.backgroundActivity,t[44]=o,t[45]=F):F=t[45];let I;t[46]!==l||t[47]!==F?(I=(0,$.jsx)(Ar,{label:`active host power interval`,value:l,min:5,step:5,onCommit:F}),t[46]=l,t[47]=F,t[48]=I):I=t[48];let L;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),t[49]=L):L=t[49];let R;t[50]===I?R=t[51]:(R=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 border-t px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[N,(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[I,L]})]}),t[50]=I,t[51]=R);let z;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:`Idle host monitor`}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Poll host power state when no foreground client is active.`})]}),t[52]=z):z=t[52];let B;t[53]!==d||t[54]!==a.backgroundActivity||t[55]!==o?(B=(e,t)=>o(Or(a.backgroundActivity,d,{hostPowerMonitorIdleInterval:ie(e)}),t),t[53]=d,t[54]=a.backgroundActivity,t[55]=o,t[56]=B):B=t[56];let V;t[57]!==p||t[58]!==B?(V=(0,$.jsx)(Ar,{label:`idle host power interval`,value:p,min:5,step:30,onCommit:B}),t[57]=p,t[58]=B,t[59]=V):V=t[59];let H;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),t[60]=H):H=t[60];let U;t[61]===V?U=t[62]:(U=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 border-t px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[z,(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[V,H]})]}),t[61]=V,t[62]=U);let W;t[63]!==d||t[64]!==a.backgroundActivity||t[65]!==o?(W=Vo.map(e=>{let{key:t,label:n}=e;return(0,$.jsxs)(`label`,{className:`flex items-center justify-between gap-3 border-b px-4 py-3 last:border-b-0 sm:border-r sm:even:border-r-0`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium`,children:n}),(0,$.jsx)(zn,{checked:d[t],onCheckedChange:e=>o(Or(a.backgroundActivity,d,{[t]:!!e})),"aria-label":n})]},t)}),t[63]=d,t[64]=a.backgroundActivity,t[65]=o,t[66]=W):W=t[66];let ee;t[67]===W?ee=t[68]:(ee=(0,$.jsx)(`div`,{className:`grid gap-0 border-t sm:grid-cols-2`,children:W}),t[67]=W,t[68]=ee);let G;t[69]!==S||t[70]!==D||t[71]!==M||t[72]!==R||t[73]!==U||t[74]!==ee||t[75]!==g?(G=(0,$.jsx)(Jt,{children:(0,$.jsxs)(`fieldset`,{disabled:g,className:`min-w-0 overflow-hidden rounded-xl border bg-card text-card-foreground`,children:[S,D,M,R,U,ee]})}),t[69]=S,t[70]=D,t[71]=M,t[72]=R,t[73]=U,t[74]=ee,t[75]=g,t[76]=G):G=t[76];let te=!i,ne;t[77]===o?ne=t[78]:(ne=()=>o(Ho()),t[77]=o,t[78]=ne);let re;t[79]!==te||t[80]!==ne?(re=(0,$.jsx)(P,{variant:`outline`,disabled:te,onClick:ne,children:`Reset all`}),t[79]=te,t[80]=ne,t[81]=re):re=t[81];let ae;t[82]===r?ae=t[83]:(ae=(0,$.jsx)(P,{onClick:()=>r(!1),children:`Done`}),t[82]=r,t[83]=ae);let oe;t[84]!==re||t[85]!==ae?(oe=(0,$.jsxs)(qt,{children:[re,ae]}),t[84]=re,t[85]=ae,t[86]=oe):oe=t[86];let se;t[87]!==G||t[88]!==oe?(se=(0,$.jsxs)(Xt,{className:`max-w-xl`,children:[h,G,oe]}),t[87]=G,t[88]=oe,t[89]=se):se=t[89];let ce;return t[90]!==r||t[91]!==m||t[92]!==se?(ce=(0,$.jsx)(Zt,{open:m,onOpenChange:r,children:se}),t[90]=r,t[91]=m,t[92]=se,t[93]=ce):ce=t[93],ce}function qo(){let e=(0,Z.c)(181),{appearanceMode:t,refreshTheme:n,resolvedTheme:r,setAppearanceMode:i,setTheme:a,setThemeHalf:o,theme:s,themeHalves:c}=Te(),l=Kn(),[u,d]=(0,Q.useState)(!1),f=gn(),p=bn(),m=fr(),h;e[0]===m?h=e[1]:(h=pr(m),e[0]=m,e[1]=h);let g=h!==null,_=Me()===`pill`&&f.environmentIdentificationMode===`artwork`,v=(f.glassOpacity-40)/60,y=`${v*100}%`,b=`${.5-v}rem`,x;e[2]!==y||e[3]!==b?(x={"--settings-slider-progress":y,"--settings-slider-fill-offset":b},e[2]=y,e[3]=b,e[4]=x):x=e[4];let S=x,C=(f.appearanceContrast-50)/150,w=`${C*100}%`,T=`${.5-C}rem`,E;e[5]!==w||e[6]!==T?(E={"--settings-slider-progress":w,"--settings-slider-fill-offset":T},e[5]=w,e[6]=T,e[7]=E):E=e[7];let D=E,O=(f.panelAnimationDurationMs-0)/400,k=`${O*100}%`,A=`${.5-O}rem`,j;e[8]!==k||e[9]!==A?(j={"--settings-slider-progress":k,"--settings-slider-fill-offset":A},e[8]=k,e[9]=A,e[10]=j):j=e[10];let M=j,N;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(N=X(`theme`),e[11]=N):N=e[11];let P;e[12]!==t||e[13]!==l||e[14]!==u||e[15]!==n||e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==o||e[20]!==s||e[21]!==c?(P=(0,$.jsx)(Dn,{id:`appearance`,title:`Colors & themes`,variant:`plain`,hideTitle:!0,children:(0,$.jsx)(`div`,{id:N.id,children:(0,$.jsx)(fo,{appearanceMode:t,customThemes:l,initialAppearance:r,refreshTheme:n,isImportOpen:u,setAppearanceMode:i,setTheme:a,setThemeHalf:o,theme:s,themeHalves:c,onImportOpenChange:d})})}),e[12]=t,e[13]=l,e[14]=u,e[15]=n,e[16]=r,e[17]=i,e[18]=a,e[19]=o,e[20]=s,e[21]=c,e[22]=P):P=e[22];let F;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=X(`setting-appearance-contrast`),e[23]=F):F=e[23];let I;e[24]!==f.appearanceContrast||e[25]!==p?(I=f.appearanceContrast===V.appearanceContrast?null:(0,$.jsx)(Y,{label:`contrast`,onClick:()=>p({appearanceContrast:V.appearanceContrast})}),e[24]=f.appearanceContrast,e[25]=p,e[26]=I):I=e[26];let L;e[27]===f.appearanceContrast?L=e[28]:(L=(0,$.jsxs)(`output`,{className:`min-w-12 rounded-md bg-muted px-2 py-1 text-center font-mono text-xs font-medium tabular-nums text-foreground`,htmlFor:`appearance-contrast`,children:[f.appearanceContrast,`%`]}),e[27]=f.appearanceContrast,e[28]=L);let R;e[29]===p?R=e[30]:(R=e=>{let t=Number(e.currentTarget.value);Number.isInteger(t)&&t>=50&&t<=200&&p({appearanceContrast:t})},e[29]=p,e[30]=R);let z;e[31]!==D||e[32]!==f.appearanceContrast||e[33]!==R?(z=(0,$.jsx)(`input`,{"aria-label":`Contrast`,className:`settings-slider min-w-0 flex-1`,id:`appearance-contrast`,max:200,min:50,onChange:R,step:5,style:D,type:`range`,value:f.appearanceContrast}),e[31]=D,e[32]=f.appearanceContrast,e[33]=R,e[34]=z):z=e[34];let B;e[35]!==L||e[36]!==z?(B=(0,$.jsxs)(`div`,{className:`flex w-full items-center gap-3 sm:w-52`,children:[L,z]}),e[35]=L,e[36]=z,e[37]=B):B=e[37];let H;e[38]!==I||e[39]!==B?(H=(0,$.jsx)(J,{...F,description:`Adjust the contrast of colors and borders across the interface.`,resetAction:I,control:B}),e[38]=I,e[39]=B,e[40]=H):H=e[40];let U;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(U=X(`setting-glass-opacity`),e[41]=U):U=e[41];let W;e[42]!==f.glassOpacity||e[43]!==p?(W=f.glassOpacity===V.glassOpacity?null:(0,$.jsx)(Y,{label:`glass opacity`,onClick:()=>p({glassOpacity:V.glassOpacity})}),e[42]=f.glassOpacity,e[43]=p,e[44]=W):W=e[44];let G;e[45]===f.glassOpacity?G=e[46]:(G=(0,$.jsxs)(`output`,{className:`min-w-12 rounded-md bg-muted px-2 py-1 text-center font-mono text-xs font-medium tabular-nums text-foreground`,htmlFor:`glass-opacity`,children:[f.glassOpacity,`%`]}),e[45]=f.glassOpacity,e[46]=G);let te;e[47]===p?te=e[48]:(te=e=>{let t=Number(e.currentTarget.value);Number.isInteger(t)&&t>=40&&t<=100&&p({glassOpacity:t})},e[47]=p,e[48]=te);let ne;e[49]!==S||e[50]!==f.glassOpacity||e[51]!==te?(ne=(0,$.jsx)(`input`,{"aria-label":`Glass opacity`,className:`settings-slider min-w-0 flex-1`,id:`glass-opacity`,max:100,min:40,onChange:te,step:5,style:S,type:`range`,value:f.glassOpacity}),e[49]=S,e[50]=f.glassOpacity,e[51]=te,e[52]=ne):ne=e[52];let re;e[53]!==G||e[54]!==ne?(re=(0,$.jsxs)(`div`,{className:`flex w-full items-center gap-3 sm:w-52`,children:[G,ne]}),e[53]=G,e[54]=ne,e[55]=re):re=e[55];let ie;e[56]!==W||e[57]!==re?(ie=(0,$.jsx)(J,{...U,description:`Higher values make menus, dialogs, and the composer more solid.`,resetAction:W,control:re}),e[56]=W,e[57]=re,e[58]=ie):ie=e[58];let ae;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(xo,{}),e[59]=ae):ae=e[59];let oe;e[60]!==f.environmentIdentificationMode||e[61]!==g||e[62]!==_||e[63]!==p?(oe=g?(0,$.jsx)(J,{...X(`environment-identification`),description:_?`Only built-in themes show artwork, so this theme shows the version pill.`:`Choose how Dev and Nightly environments are identified.`,resetAction:f.environmentIdentificationMode===`artwork`?null:(0,$.jsx)(Y,{label:`environment identification`,onClick:()=>p({environmentIdentificationMode:ee})}),control:(0,$.jsxs)(_e,{value:f.environmentIdentificationMode,onValueChange:e=>{(e===`artwork`||e===`pill`||e===`none`)&&p({environmentIdentificationMode:e})},children:[(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Environment identification`,children:(0,$.jsx)(me,{children:Eo[f.environmentIdentificationMode]})}),(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Eo).map(Jo)})]})}):null,e[60]=f.environmentIdentificationMode,e[61]=g,e[62]=_,e[63]=p,e[64]=oe):oe=e[64];let se;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(se=X(`diff-color-scheme`),e[65]=se):se=e[65];let ce;e[66]!==f.diffColorScheme||e[67]!==p?(ce=f.diffColorScheme===V.diffColorScheme?null:(0,$.jsx)(Y,{label:`diff colors`,onClick:()=>p({diffColorScheme:V.diffColorScheme})}),e[66]=f.diffColorScheme,e[67]=p,e[68]=ce):ce=e[68];let le;e[69]===p?le=e[70]:(le=e=>{(e===`red-green`||e===`blue-orange`)&&p({diffColorScheme:e})},e[69]=p,e[70]=le);let ue=f.diffColorScheme===`blue-orange`?`flex shrink-0 flex-row-reverse gap-1`:`flex shrink-0 gap-1`,de,fe;e[71]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-diff-deletion`}),fe=(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-diff-addition`}),e[71]=de,e[72]=fe):(de=e[71],fe=e[72]);let pe;e[73]===ue?pe=e[74]:(pe=(0,$.jsxs)(`span`,{"aria-hidden":`true`,className:ue,children:[de,fe]}),e[73]=ue,e[74]=pe);let he=f.diffColorScheme===`blue-orange`?`Blue & orange`:`Red & green`,ve;e[75]===he?ve=e[76]:(ve=(0,$.jsx)(me,{children:he}),e[75]=he,e[76]=ve);let ye;e[77]!==pe||e[78]!==ve?(ye=(0,$.jsxs)(ge,{size:`sm`,className:`w-full min-w-0`,"aria-label":`Diff colors`,children:[pe,ve]}),e[77]=pe,e[78]=ve,e[79]=ye):ye=e[79];let be;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{value:`red-green`,children:`Red & green (default)`}),(0,$.jsx)(K,{value:`blue-orange`,children:`Blue & orange`})]}),e[80]=be):be=e[80];let xe;e[81]!==f.diffColorScheme||e[82]!==le||e[83]!==ye?(xe=(0,$.jsx)(`div`,{className:`w-full sm:w-40`,children:(0,$.jsxs)(_e,{value:f.diffColorScheme,onValueChange:le,children:[ye,be]})}),e[81]=f.diffColorScheme,e[82]=le,e[83]=ye,e[84]=xe):xe=e[84];let Se;e[85]!==ce||e[86]!==xe?(Se=(0,$.jsx)(J,{...se,description:`Choose colors for additions and deletions, including change counts.`,resetAction:ce,control:xe}),e[85]=ce,e[86]=xe,e[87]=Se):Se=e[87];let Ce;e[88]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=X(`composer-context`),e[88]=Ce):Ce=e[88];let we;e[89]!==f.persistComposerContextStrip||e[90]!==p?(we=f.persistComposerContextStrip===V.persistComposerContextStrip?null:(0,$.jsx)(Y,{label:`composer context`,onClick:()=>p({persistComposerContextStrip:V.persistComposerContextStrip})}),e[89]=f.persistComposerContextStrip,e[90]=p,e[91]=we):we=e[91];let Ee;e[92]===p?Ee=e[93]:(Ee=e=>p({persistComposerContextStrip:!!e}),e[92]=p,e[93]=Ee);let De;e[94]!==f.persistComposerContextStrip||e[95]!==Ee?(De=(0,$.jsx)(zn,{checked:f.persistComposerContextStrip,onCheckedChange:Ee,"aria-label":`Keep composer context visible in active threads`}),e[94]=f.persistComposerContextStrip,e[95]=Ee,e[96]=De):De=e[96];let Oe;e[97]!==we||e[98]!==De?(Oe=(0,$.jsx)(J,{...Ce,description:`Keep branch and worktree controls below the composer after a thread starts.`,resetAction:we,control:De}),e[97]=we,e[98]=De,e[99]=Oe):Oe=e[99];let ke;e[100]===Symbol.for(`react.memo_cache_sentinel`)?(ke=X(`chat-width`),e[100]=ke):ke=e[100];let Ae;e[101]!==f.chatWidth||e[102]!==p?(Ae=f.chatWidth===V.chatWidth?null:(0,$.jsx)(Y,{label:`chat width`,onClick:()=>p({chatWidth:V.chatWidth})}),e[101]=f.chatWidth,e[102]=p,e[103]=Ae):Ae=e[103];let je;e[104]===p?je=e[105]:(je=e=>{(e===`comfortable`||e===`wide`||e===`full`)&&p({chatWidth:e})},e[104]=p,e[105]=je);let Ne=Mo[f.chatWidth],Pe;e[106]===Ne?Pe=e[107]:(Pe=(0,$.jsx)(ge,{size:`sm`,className:`w-full min-w-0`,"aria-label":`Chat width`,children:(0,$.jsx)(me,{children:Ne})}),e[106]=Ne,e[107]=Pe);let Fe;e[108]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{value:`comfortable`,children:`Comfortable (default)`}),(0,$.jsx)(K,{value:`wide`,children:`Wide`}),(0,$.jsx)(K,{value:`full`,children:`Full`})]}),e[108]=Fe):Fe=e[108];let Ie;e[109]!==f.chatWidth||e[110]!==je||e[111]!==Pe?(Ie=(0,$.jsx)(`div`,{className:`w-full sm:w-40`,children:(0,$.jsxs)(_e,{value:f.chatWidth,onValueChange:je,children:[Pe,Fe]})}),e[109]=f.chatWidth,e[110]=je,e[111]=Pe,e[112]=Ie):Ie=e[112];let Le;e[113]!==Ae||e[114]!==Ie?(Le=(0,$.jsx)(J,{...ke,description:`Set how wide messages and the composer can grow on large screens.`,resetAction:Ae,control:Ie}),e[113]=Ae,e[114]=Ie,e[115]=Le):Le=e[115];let Re;e[116]===Symbol.for(`react.memo_cache_sentinel`)?(Re=X(`icon-set`),e[116]=Re):Re=e[116];let ze;e[117]!==f.iconSet||e[118]!==p?(ze=f.iconSet===V.iconSet?null:(0,$.jsx)(Y,{label:`icon set`,onClick:()=>p({iconSet:V.iconSet})}),e[117]=f.iconSet,e[118]=p,e[119]=ze):ze=e[119];let Be;e[120]===p?Be=e[121]:(Be=e=>{(e===`p4`||e===`lucide`)&&p({iconSet:e})},e[120]=p,e[121]=Be);let Ve=No[f.iconSet],He;e[122]===Ve?He=e[123]:(He=(0,$.jsx)(ge,{size:`sm`,className:`w-full min-w-0`,"aria-label":`Icon set`,children:(0,$.jsx)(me,{children:Ve})}),e[122]=Ve,e[123]=He);let Ue;e[124]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{value:`p4`,children:`P4 (default)`}),(0,$.jsx)(K,{value:`lucide`,children:`Lucide`})]}),e[124]=Ue):Ue=e[124];let We;e[125]!==f.iconSet||e[126]!==Be||e[127]!==He?(We=(0,$.jsx)(`div`,{className:`w-full sm:w-40`,children:(0,$.jsxs)(_e,{value:f.iconSet,onValueChange:Be,children:[He,Ue]})}),e[125]=f.iconSet,e[126]=Be,e[127]=He,e[128]=We):We=e[128];let Ge;e[129]!==ze||e[130]!==We?(Ge=(0,$.jsx)(J,{...Re,description:`Choose which icon drawings the app uses. An icon missing from one set shows the other set's drawing.`,resetAction:ze,control:We}),e[129]=ze,e[130]=We,e[131]=Ge):Ge=e[131];let Ke;e[132]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=X(`math-rendering`),e[132]=Ke):Ke=e[132];let qe;e[133]!==f.mathRenderingEnabled||e[134]!==p?(qe=f.mathRenderingEnabled===V.mathRenderingEnabled?null:(0,$.jsx)(Y,{label:`math rendering`,onClick:()=>p({mathRenderingEnabled:V.mathRenderingEnabled})}),e[133]=f.mathRenderingEnabled,e[134]=p,e[135]=qe):qe=e[135];let Je;e[136]===p?Je=e[137]:(Je=e=>p({mathRenderingEnabled:!!e}),e[136]=p,e[137]=Je);let Ye;e[138]!==f.mathRenderingEnabled||e[139]!==Je?(Ye=(0,$.jsx)(zn,{checked:f.mathRenderingEnabled,onCheckedChange:Je,"aria-label":`Render math`}),e[138]=f.mathRenderingEnabled,e[139]=Je,e[140]=Ye):Ye=e[140];let Xe;e[141]!==qe||e[142]!==Ye?(Xe=(0,$.jsx)(J,{...Ke,description:`Typeset LaTeX math, such as $x^2$ or \\[x^2\\], in messages and Markdown previews. The composer keeps TeX source editable.`,resetAction:qe,control:Ye}),e[141]=qe,e[142]=Ye,e[143]=Xe):Xe=e[143];let Ze;e[144]!==H||e[145]!==ie||e[146]!==oe||e[147]!==Se||e[148]!==Oe||e[149]!==Le||e[150]!==Ge||e[151]!==Xe?(Ze=(0,$.jsxs)(Dn,{id:`appearance-interface`,title:`Interface`,children:[H,ie,ae,oe,Se,Oe,Le,Ge,Xe]}),e[144]=H,e[145]=ie,e[146]=oe,e[147]=Se,e[148]=Oe,e[149]=Le,e[150]=Ge,e[151]=Xe,e[152]=Ze):Ze=e[152];let Qe;e[153]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=X(`panel-animations`),e[153]=Qe):Qe=e[153];let $e;e[154]===f.panelAnimationDurationMs?$e=e[155]:($e=(0,$.jsx)(Co,{durationMs:f.panelAnimationDurationMs}),e[154]=f.panelAnimationDurationMs,e[155]=$e);let et;e[156]===f.panelAnimationDurationMs?et=e[157]:(et=(0,$.jsxs)(`output`,{className:`min-w-16 rounded-md bg-muted px-2 py-1 text-center font-mono text-xs font-medium tabular-nums text-foreground`,htmlFor:`panel-animation-duration`,children:[f.panelAnimationDurationMs,` ms`]}),e[156]=f.panelAnimationDurationMs,e[157]=et);let tt;e[158]===p?tt=e[159]:(tt=e=>{let t=Number(e.currentTarget.value);Number.isInteger(t)&&t>=0&&t<=400&&p({panelAnimationDurationMs:t})},e[158]=p,e[159]=tt);let nt;e[160]!==M||e[161]!==f.panelAnimationDurationMs||e[162]!==tt?(nt=(0,$.jsx)(`input`,{"aria-label":`Panel animation duration`,className:`settings-slider min-w-0 flex-1`,id:`panel-animation-duration`,max:400,min:0,onChange:tt,step:25,style:M,type:`range`,value:f.panelAnimationDurationMs}),e[160]=M,e[161]=f.panelAnimationDurationMs,e[162]=tt,e[163]=nt):nt=e[163];let rt;e[164]!==et||e[165]!==nt?(rt=(0,$.jsxs)(`div`,{className:`flex w-full items-center gap-3`,children:[et,nt]}),e[164]=et,e[165]=nt,e[166]=rt):rt=e[166];let it;e[167]!==$e||e[168]!==rt?(it=(0,$.jsxs)(`div`,{className:`grid w-full grid-cols-[5rem_minmax(0,1fr)] items-center gap-3 sm:w-auto sm:grid-cols-[7rem_13rem] sm:gap-4`,children:[$e,rt]}),e[167]=$e,e[168]=rt,e[169]=it):it=e[169];let at;e[170]!==f.panelAnimationDurationMs||e[171]!==p?(at=f.panelAnimationDurationMs===V.panelAnimationDurationMs?null:(0,$.jsx)(Y,{label:`panel animations`,onClick:()=>p({panelAnimationDurationMs:V.panelAnimationDurationMs})}),e[170]=f.panelAnimationDurationMs,e[171]=p,e[172]=at):at=e[172];let ot;e[173]!==it||e[174]!==at?(ot=(0,$.jsx)(Dn,{id:`motion`,title:`Motion`,children:(0,$.jsx)(J,{...Qe,description:`Set how fast panels open and close.`,control:it,resetAction:at})}),e[173]=it,e[174]=at,e[175]=ot):ot=e[175];let st;e[176]===Symbol.for(`react.memo_cache_sentinel`)?(st=(0,$.jsx)(as,{}),e[176]=st):st=e[176];let ct;return e[177]!==P||e[178]!==Ze||e[179]!==ot?(ct=(0,$.jsxs)(Tn,{children:[P,Ze,ot,st]}),e[177]=P,e[178]=Ze,e[179]=ot,e[180]=ct):ct=e[180],ct}function Jo(e){let[t,n]=e;return(0,$.jsx)(K,{hideIndicator:!0,value:t,children:n},t)}function Yo(){let e=(0,Z.c)(5),t=gn(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sans:sr(`-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`)??`System default`,code:sr(`"SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace`)??`System monospace`},e[0]=n):n=e[0];let r=n,i;e[1]===t.fontFamilySans?i=e[2]:(i=t.fontFamilySans.trim()||r.sans,e[1]=t.fontFamilySans,e[2]=i);let a;return e[3]===i?a=e[4]:(a={sans:r.sans,code:r.code,interfaceFamily:i},e[3]=i,e[4]=a),a}function Xo(e){let t=(0,Z.c)(18),{preview:n}=e,r=gn(),i=bn(),a=Yo(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`interface-font`),t[0]=o):o=t[0];let s,c;t[1]===i?(s=t[2],c=t[3]):(s=e=>i({fontFamilySans:e}),c=()=>i({fontFamilySans:V.fontFamilySans,fontSizeInterface:V.fontSizeInterface}),t[1]=i,t[2]=s,t[3]=c);let l;t[4]===i?l=t[5]:(l=e=>i({fontSizeInterface:e}),t[4]=i,t[5]=l);let u;t[6]!==r.fontSizeInterface||t[7]!==l?(u={label:`Interface font size`,min:12,max:20,value:r.fontSizeInterface,defaultValue:V.fontSizeInterface,onChange:l},t[6]=r.fontSizeInterface,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n?d=t[10]:(d=n===void 0?{}:{preview:n},t[9]=n,t[10]=d);let f;return t[11]!==a.sans||t[12]!==r.fontFamilySans||t[13]!==s||t[14]!==c||t[15]!==u||t[16]!==d?(f=(0,$.jsx)(os,{...o,description:`Everything outside code blocks and the terminal.`,defaultFamily:a.sans,defaultValue:V.fontFamilySans,value:r.fontFamilySans,onValueChange:s,onReset:c,size:u,...d}),t[11]=a.sans,t[12]=r.fontFamilySans,t[13]=s,t[14]=c,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function Zo(){let e=(0,Z.c)(16),t=gn(),n=bn(),r=Yo(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=X(`prompt-font`),e[0]=i):i=e[0];let a,o;e[1]===n?(a=e[2],o=e[3]):(a=e=>n({fontFamilyComposer:e}),o=()=>n({fontFamilyComposer:V.fontFamilyComposer,fontSizePrompt:V.fontSizePrompt}),e[1]=n,e[2]=a,e[3]=o);let s;e[4]===n?s=e[5]:(s=e=>n({fontSizePrompt:e}),e[4]=n,e[5]=s);let c;e[6]!==t.fontSizePrompt||e[7]!==s?(c={label:`Prompt font size`,min:12,max:20,value:t.fontSizePrompt,defaultValue:V.fontSizePrompt,onChange:s},e[6]=t.fontSizePrompt,e[7]=s,e[8]=c):c=e[8];let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(qr,{}),e[9]=l):l=e[9];let u;return e[10]!==r.interfaceFamily||e[11]!==t.fontFamilyComposer||e[12]!==a||e[13]!==o||e[14]!==c?(u=(0,$.jsx)(os,{...i,description:`Only the box you write prompts in. Mono works well here.`,defaultFamily:r.interfaceFamily,defaultValue:V.fontFamilyComposer,value:t.fontFamilyComposer,onValueChange:a,onReset:o,size:c,preview:l}),e[10]=r.interfaceFamily,e[11]=t.fontFamilyComposer,e[12]=a,e[13]=o,e[14]=c,e[15]=u):u=e[15],u}function Qo(e){let t=(0,Z.c)(22),{title:n,description:r,preview:i}=e,a=r===void 0?`Code blocks, diffs, and file previews.`:r,o=gn(),s=bn(),c=Yo(),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=X(`code-font`),t[0]=l):l=t[0];let u;t[1]===n?u=t[2]:(u=n===void 0?{}:{title:n},t[1]=n,t[2]=u);let d,f;t[3]===s?(d=t[4],f=t[5]):(d=e=>s({fontFamilyCode:e}),f=()=>s({fontFamilyCode:V.fontFamilyCode,fontSizeCode:V.fontSizeCode}),t[3]=s,t[4]=d,t[5]=f);let p;t[6]===s?p=t[7]:(p=e=>s({fontSizeCode:e}),t[6]=s,t[7]=p);let m;t[8]!==o.fontSizeCode||t[9]!==p?(m={label:`Code font size`,min:10,max:18,value:o.fontSizeCode,defaultValue:V.fontSizeCode,onChange:p},t[8]=o.fontSizeCode,t[9]=p,t[10]=m):m=t[10];let h;t[11]===i?h=t[12]:(h=i??(0,$.jsx)($r,{}),t[11]=i,t[12]=h);let g;return t[13]!==c.code||t[14]!==a||t[15]!==o.fontFamilyCode||t[16]!==u||t[17]!==d||t[18]!==f||t[19]!==m||t[20]!==h?(g=(0,$.jsx)(os,{...l,...u,description:a,defaultFamily:c.code,defaultValue:V.fontFamilyCode,value:o.fontFamilyCode,onValueChange:d,onReset:f,requireMonospace:!0,size:m,preview:h}),t[13]=c.code,t[14]=a,t[15]=o.fontFamilyCode,t[16]=u,t[17]=d,t[18]=f,t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function $o(){let e=(0,Z.c)(22),t=gn(),n=bn(),r=Yo(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=X(`terminal-font`),e[0]=i):i=e[0];let a=r.code,o=t.fontFamilyTerminal,s,c;e[1]===n?(s=e[2],c=e[3]):(s=e=>n({fontFamilyTerminal:e}),c=()=>n({fontFamilyTerminal:V.fontFamilyTerminal,fontSizeTerminal:V.fontSizeTerminal}),e[1]=n,e[2]=s,e[3]=c);let l;e[4]===n?l=e[5]:(l=e=>n({fontSizeTerminal:e}),e[4]=n,e[5]=l);let u;e[6]!==t.fontSizeTerminal||e[7]!==l?(u={label:`Terminal font size`,min:8,max:20,value:t.fontSizeTerminal,defaultValue:V.fontSizeTerminal,onChange:l},e[6]=t.fontSizeTerminal,e[7]=l,e[8]=u):u=e[8];let d;e[9]!==t.fontFamilyCode||e[10]!==t.fontFamilyTerminal?(d=Un({advanced:!0,code:t.fontFamilyCode,terminal:t.fontFamilyTerminal}),e[9]=t.fontFamilyCode,e[10]=t.fontFamilyTerminal,e[11]=d):d=e[11];let f;e[12]!==t.fontSizeTerminal||e[13]!==d?(f=(0,$.jsx)(ii,{family:d,size:t.fontSizeTerminal}),e[12]=t.fontSizeTerminal,e[13]=d,e[14]=f):f=e[14];let p;return e[15]!==r.code||e[16]!==t.fontFamilyTerminal||e[17]!==s||e[18]!==c||e[19]!==u||e[20]!==f?(p=(0,$.jsx)(os,{...i,description:`Terminal output, independent from code blocks and diffs.`,defaultFamily:a,defaultValue:V.fontFamilyTerminal,value:o,onValueChange:s,onReset:c,requireMonospace:!0,size:u,preview:f}),e[15]=r.code,e[16]=t.fontFamilyTerminal,e[17]=s,e[18]=c,e[19]=u,e[20]=f,e[21]=p):p=e[21],p}function es(){let e=(0,Z.c)(12),t=gn(),n=bn();if(!f(navigator.platform))return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=X(`font-smoothing`),e[0]=r):r=e[0];let i;e[1]!==t.fontSmoothing||e[2]!==n?(i=t.fontSmoothing===V.fontSmoothing?null:(0,$.jsx)(Y,{label:`font smoothing`,onClick:()=>n({fontSmoothing:V.fontSmoothing})}),e[1]=t.fontSmoothing,e[2]=n,e[3]=i):i=e[3];let a;e[4]===n?a=e[5]:(a=e=>n({fontSmoothing:!!e}),e[4]=n,e[5]=a);let o;e[6]!==t.fontSmoothing||e[7]!==a?(o=(0,$.jsx)(zn,{checked:t.fontSmoothing,onCheckedChange:a,"aria-label":`Font smoothing`}),e[6]=t.fontSmoothing,e[7]=a,e[8]=o):o=e[8];let s;return e[9]!==i||e[10]!==o?(s=(0,$.jsx)(J,{...r,description:`Use thinner grayscale text smoothing instead of the macOS default.`,resetAction:i,control:o}),e[9]=i,e[10]=o,e[11]=s):s=e[11],s}function ts(){let e=(0,Z.c)(12),t=gn(),n=bn(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=X(`word-wrap`),e[0]=r):r=e[0];let i;e[1]!==t.wordWrap||e[2]!==n?(i=t.wordWrap===V.wordWrap?null:(0,$.jsx)(Y,{label:`word wrapping`,onClick:()=>n({wordWrap:V.wordWrap})}),e[1]=t.wordWrap,e[2]=n,e[3]=i):i=e[3];let a;e[4]===n?a=e[5]:(a=e=>n({wordWrap:!!e}),e[4]=n,e[5]=a);let o;e[6]!==t.wordWrap||e[7]!==a?(o=(0,$.jsx)(zn,{checked:t.wordWrap,onCheckedChange:a,"aria-label":`Wrap code, diffs, and file previews by default`}),e[6]=t.wordWrap,e[7]=a,e[8]=o):o=e[8];let s;return e[9]!==i||e[10]!==o?(s=(0,$.jsx)(J,{...r,description:`Wrap long lines in code blocks, diffs, and file previews by default.`,resetAction:i,control:o}),e[9]=i,e[10]=o,e[11]=s):s=e[11],s}function ns(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Xo,{}),(0,$.jsx)(Zo,{}),(0,$.jsx)(Qo,{}),(0,$.jsx)($o,{}),(0,$.jsx)(es,{})]}),e[0]=t):t=e[0],t}function rs(){let e=(0,Z.c)(11),t=gn(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Xo,{preview:(0,$.jsx)(qr,{})}),e[0]=n):n=e[0];let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)($r,{}),e[1]=r):r=e[1];let i;e[2]!==t.fontFamilyCode||e[3]!==t.fontFamilyTerminal?(i=Un({advanced:!1,code:t.fontFamilyCode,terminal:t.fontFamilyTerminal}),e[2]=t.fontFamilyCode,e[3]=t.fontFamilyTerminal,e[4]=i):i=e[4];let a;e[5]!==t.fontSizeCode||e[6]!==t.fontSizeTerminal?(a=Mn({advanced:!1,code:t.fontSizeCode,terminal:t.fontSizeTerminal}),e[5]=t.fontSizeCode,e[6]=t.fontSizeTerminal,e[7]=a):a=e[7];let o;return e[8]!==i||e[9]!==a?(o=(0,$.jsxs)($.Fragment,{children:[n,(0,$.jsx)(Qo,{title:`Monospace font`,description:`Code blocks, diffs, file previews, and the terminal.`,preview:(0,$.jsxs)($.Fragment,{children:[r,(0,$.jsx)(ii,{family:i,size:a})]})})]}),e[8]=i,e[9]=a,e[10]=o):o=e[10],o}var is=new Set([`prompt-font`,`terminal-font`,...typeof navigator<`u`&&f(navigator.platform)?[`font-smoothing`]:[]]);function as(){let e=(0,Z.c)(15),[t,n]=h(Zn,!1,re),r=wn(),i=(0,Q.useRef)(null),a,o;e[0]!==r||e[1]!==n?(a=()=>{r!==null&&is.has(r)&&i.current!==r&&(i.current=r,n(!0))},o=[r,n],e[0]=r,e[1]=n,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,Q.useEffect)(a,o);let s;e[4]===n?s=e[5]:(s=e=>n(!!e),e[4]=n,e[5]=s);let c;e[6]!==t||e[7]!==s?(c=(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-xs font-medium text-muted-foreground`,children:[`Advanced`,(0,$.jsx)(zn,{checked:t,onCheckedChange:s,"aria-label":`Show advanced typography settings`})]}),e[6]=t,e[7]=s,e[8]=c):c=e[8];let l;e[9]===t?l=e[10]:(l=t?(0,$.jsx)(ns,{}):(0,$.jsx)(rs,{}),e[9]=t,e[10]=l);let u;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(ts,{}),e[11]=u):u=e[11];let d;return e[12]!==c||e[13]!==l?(d=(0,$.jsxs)(Dn,{id:`typography`,title:`Typography`,headerAction:c,children:[l,u]}),e[12]=c,e[13]=l,e[14]=d):d=e[14],d}function os({id:e,title:t,description:n,defaultFamily:r,defaultValue:i,preview:a,value:o,onValueChange:s,onReset:c,requireMonospace:l=!1,size:u}){let d=o.trim(),[f,p]=(0,Q.useState)(o),[m,h]=(0,Q.useState)(!0),g=(0,Q.useRef)(null),_=(0,Q.useRef)(o);_.current!==o&&(_.current=o,g.current!==null&&(window.clearTimeout(g.current),g.current=null),p(o),h(!0)),(0,Q.useEffect)(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);let v=e=>ir(e)&&(!l||ur(e)),y=e=>{h(!0),(e.trim().length===0||v(e))&&s(e)},b=()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null,y(f))},x=f.trim(),S=m&&x.length>0&&x!==d,C=o!==i||u.value!==u.defaultValue?(0,$.jsx)(Y,{label:t.toLowerCase(),onClick:()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),p(i),h(!0),c()}}):null,w=_i(),T=(0,Q.useRef)(!1),E=w.status===`granted`?(0,$.jsx)(vi,{ariaLabel:`${t} family`,defaultFamily:r,selectedFamily:d,requireMonospace:l,initialOpen:T.current,onSelect:s}):(0,$.jsx)(Wt,{size:`sm`,"aria-label":`${t} family`,"aria-invalid":S||void 0,autoCapitalize:`off`,autoComplete:`off`,className:`min-w-0 flex-1`,maxLength:200,onFocus:()=>{T.current=!0,mi()},onBlur:()=>{T.current=!1,b()},onChange:e=>{let t=e.currentTarget.value;p(t),h(!1),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null,y(t)},400)},onKeyDown:e=>{e.key===`Enter`&&b(),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),g.current!==null&&(window.clearTimeout(g.current),g.current=null),p(o),h(!0))},placeholder:r,spellCheck:!1,value:f}),D=(0,$.jsxs)(`div`,{className:`flex w-full items-center gap-2 sm:w-auto`,children:[(0,$.jsx)(`div`,{className:`min-w-0 flex-1 sm:w-44 sm:flex-none`,children:E}),(0,$.jsxs)(_e,{value:String(u.value),onValueChange:e=>{if(typeof e!=`string`)return;let t=Number(e);Number.isInteger(t)&&t>=u.min&&t<=u.max&&u.onChange(t)},children:[(0,$.jsx)(ge,{size:`sm`,className:`w-22 shrink-0`,"aria-label":u.label,children:(0,$.jsxs)(me,{children:[u.value,` px`]})}),(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:Array.from({length:u.max-u.min+1},(e,t)=>u.min+t).map(e=>(0,$.jsxs)(K,{hideIndicator:!0,value:String(e),children:[e,` px`]},e))})]})]});return(0,$.jsx)(J,{...e===void 0?{}:{id:e},title:t,description:n,resetAction:C,control:D,children:a})}var ss=new Set([`legacy-plan-mode`,`legacy-context-window-indicator`]);function cs(){let e=(0,Z.c)(25),t=gn(),n=bn(),[r,i]=(0,Q.useState)(!1),a=wn(),s=Cn(`legacy-features`),c=(0,Q.useRef)(null),l,u;e[0]===a?(l=e[1],u=e[2]):(l=()=>{a===null?c.current=null:ss.has(a)&&c.current!==a&&(c.current=a,i(!0))},u=[a],e[0]=a,e[1]=l,e[2]=u),(0,Q.useEffect)(l,u);let d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsxs)($n,{className:`group flex min-h-8 w-full items-center gap-2 px-3 sm:px-4`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-normal text-foreground/70 transition-colors group-hover:text-foreground`,children:`Legacy features`}),(0,$.jsx)(o,{className:`size-4 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`})]}),e[3]=d):d=e[3];let f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=X(`legacy-plan-mode`),e[4]=f):f=e[4];let p;e[5]===n?p=e[6]:(p=e=>{n({planModeEnabled:!!e})},e[5]=n,e[6]=p);let m;e[7]!==t.planModeEnabled||e[8]!==p?(m=(0,$.jsx)(J,{...f,description:`Restore Build/Plan, /plan, /default, and Shift+Tab. Off uses build mode.`,control:(0,$.jsx)(zn,{checked:t.planModeEnabled,onCheckedChange:p,"aria-label":`Plan mode (legacy)`})}),e[7]=t.planModeEnabled,e[8]=p,e[9]=m):m=e[9];let h;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=X(`legacy-context-window-indicator`),e[10]=h):h=e[10];let g;e[11]===n?g=e[12]:(g=e=>n({contextWindowMeterEnabled:!!e}),e[11]=n,e[12]=g);let _;e[13]!==t.contextWindowMeterEnabled||e[14]!==g?(_=(0,$.jsx)(J,{...h,description:`Shows context window usage as a circular indicator in the composer.`,control:(0,$.jsx)(zn,{checked:t.contextWindowMeterEnabled,onCheckedChange:g,"aria-label":`Context window indicator (legacy)`})}),e[13]=t.contextWindowMeterEnabled,e[14]=g,e[15]=_):_=e[15];let v;e[16]!==m||e[17]!==_?(v=(0,$.jsx)(kn,{children:(0,$.jsxs)(_n,{children:[m,_]})}),e[16]=m,e[17]=_,e[18]=v):v=e[18];let y;e[19]!==r||e[20]!==v?(y=(0,$.jsxs)(er,{open:r,onOpenChange:i,children:[d,v]}),e[19]=r,e[20]=v,e[21]=y):y=e[21];let b;return e[22]!==y||e[23]!==s?(b=(0,$.jsx)(`section`,{id:`legacy-features`,ref:s,tabIndex:-1,className:`space-y-2.5`,children:y}),e[22]=y,e[23]=s,e[24]=b):b=e[24],b}function ls(){let e=(0,Z.c)(484),t=f(navigator.platform)?`⌘`:`Ctrl`,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[{value:`enter`,label:`Enter`},{value:`mod-enter-multiline`,label:`${t} + Enter for multiline prompts`},{value:`mod-enter`,label:`${t} + Enter always`}],e[0]=n):n=e[0];let r=n,i=gn(),a=bn(),o=be(),{scope:c,environment:u,connectedEnvironments:p,target:m,targets:h}=Sn(),g;e[1]!==i||e[2]!==h?(g=h.length>0?h:[{settings:i}],e[1]=i,e[2]=h,e[3]=g):g=e[3];let _;e[4]===g?_=e[5]:(_=xn(g),e[4]=g,e[5]=_);let v=_,b=u?.environmentId??null,S=c.environmentIds.length===1&&b!==null,w=p.length>0,[E,O]=(0,Q.useState)(!1),k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=[`compressMode`],e[6]=k):k=e[6];let A=vn(k),M;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(M=[`responseStreamingMode`],e[7]=M):M=e[7];let F=vn(M),I;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=xr(),e[8]=I):I=e[8];let L=(0,Q.useRef)(I),R=u?.serverConfig?.providers??Pe,z;e[9]===p?z=e[10]:(z=p.length>0&&p.every(ys),e[9]=p,e[10]=z);let B=z,ee=R.filter(vs),ne=d(i,ee),re=ne.instanceId,ie=ne.model,ae=ne.options,oe=T(x(C(ee),i,m?.projectId??null)),se=oe.some(_s),ce=oe.find(e=>e.instanceId===re),ue=ce?.driverKind??Bo,fe=l(i,ee,re,ie),pe;e[11]===i.textGenerationModelSelection?pe=e[12]:(pe=G(i.textGenerationModelSelection??null,V.textGenerationModelSelection??null),e[11]=i.textGenerationModelSelection,e[12]=pe);let he=!pe,ve=hr(i,oe),Se=Ne(i),Ce=Se.profile,we;e[13]===i?we=e[14]:(we=Er(i),e[13]=i,e[14]=we);let Te=we,Ee;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=[`backgroundActivity`],e[15]=Ee):Ee=e[15];let De=vn(Ee),Oe;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=[`addProjectBaseDirectory`],e[16]=Oe):Oe=e[16];let ke=vn(Oe),Ae;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=[`textGenerationModelSelection`],e[17]=Ae):Ae=e[17];let je=vn(Ae),Me=Te===`advanced`?`${zo} Shared policy: ${Io[Ce]}.`:Ro[Se.profile],Fe;e[18]===i.backgroundActivity?Fe=e[19]:(Fe=G(i.backgroundActivity,V.backgroundActivity),e[18]=i.backgroundActivity,e[19]=Fe);let Ie=!Fe,Le=Tn,Re;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,$.jsx)(gr,{category:`general`}),e[20]=Re):Re=e[20];let ze;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(ze=X(`project-grouping`),e[21]=ze):ze=e[21];let Be;e[22]!==i.sidebarProjectGroupingMode||e[23]!==a?(Be=i.sidebarProjectGroupingMode===V.sidebarProjectGroupingMode?null:(0,$.jsx)(Y,{label:`project grouping`,onClick:()=>a({sidebarProjectGroupingMode:V.sidebarProjectGroupingMode})}),e[22]=i.sidebarProjectGroupingMode,e[23]=a,e[24]=Be):Be=e[24];let Ve;e[25]===i.sidebarProjectGroupingMode?Ve=e[26]:(Ve=br(i.sidebarProjectGroupingMode),e[25]=i.sidebarProjectGroupingMode,e[26]=Ve);let He;e[27]!==i.sidebarProjectGroupingMode||e[28]!==a?(He=e=>{!e&&i.sidebarProjectGroupingMode!==`separate`&&(L.current=i.sidebarProjectGroupingMode,Sr(i.sidebarProjectGroupingMode)),a({sidebarProjectGroupingMode:kr(e,L.current)})},e[27]=i.sidebarProjectGroupingMode,e[28]=a,e[29]=He):He=e[29];let Ue;e[30]!==Ve||e[31]!==He?(Ue=(0,$.jsx)(zn,{checked:Ve,onCheckedChange:He,"aria-label":`Project grouping`}),e[30]=Ve,e[31]=He,e[32]=Ue):Ue=e[32];let We;e[33]!==Be||e[34]!==Ue?(We=(0,$.jsx)(J,{...ze,description:`Combine matching repositories across environments.`,resetAction:Be,control:Ue}),e[33]=Be,e[34]=Ue,e[35]=We):We=e[35];let Ge;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=X(`project-order`),e[36]=Ge):Ge=e[36];let Ke;e[37]!==i.sidebarProjectSortOrder||e[38]!==a?(Ke=i.sidebarProjectSortOrder===V.sidebarProjectSortOrder?null:(0,$.jsx)(Y,{label:`project order`,onClick:()=>a({sidebarProjectSortOrder:V.sidebarProjectSortOrder})}),e[37]=i.sidebarProjectSortOrder,e[38]=a,e[39]=Ke):Ke=e[39];let qe;e[40]===a?qe=e[41]:(qe=e=>{Ao(e)&&a({sidebarProjectSortOrder:e})},e[40]=a,e[41]=qe);let Je=ko[i.sidebarProjectSortOrder],Ye;e[42]===Je?Ye=e[43]:(Ye=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-44`,"aria-label":`Project order`,children:(0,$.jsx)(me,{children:Je})}),e[42]=Je,e[43]=Ye);let Xe;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:H.literals.map(gs)}),e[44]=Xe):Xe=e[44];let Ze;e[45]!==i.sidebarProjectSortOrder||e[46]!==qe||e[47]!==Ye?(Ze=(0,$.jsxs)(_e,{value:i.sidebarProjectSortOrder,onValueChange:qe,children:[Ye,Xe]}),e[45]=i.sidebarProjectSortOrder,e[46]=qe,e[47]=Ye,e[48]=Ze):Ze=e[48];let Qe;e[49]!==Ke||e[50]!==Ze?(Qe=(0,$.jsx)(J,{...Ge,description:`Order of projects in the sidebar project picker and command palette.`,resetAction:Ke,control:Ze}),e[49]=Ke,e[50]=Ze,e[51]=Qe):Qe=e[51];let $e;e[52]===Symbol.for(`react.memo_cache_sentinel`)?($e=X(`auto-resume-limited-threads`),e[52]=$e):$e=e[52];let et;e[53]===Symbol.for(`react.memo_cache_sentinel`)?(et=[`autoResumeLimitedThreads`],e[53]=et):et=e[53];let tt;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(tt=[`autoResumeLimitedThreads`],e[54]=tt):tt=e[54];let nt;e[55]===a?nt=e[56]:(nt=e=>a({autoResumeLimitedThreads:!!e}),e[55]=a,e[56]=nt);let rt;e[57]!==i.autoResumeLimitedThreads||e[58]!==nt?(rt=(0,$.jsx)(J,{serverScoped:!0,...$e,description:`Automatically resume threads when their usage limits reset. You can cancel auto-resume in each thread.`,settingKeys:et,control:(0,$.jsx)(vr,{settingKeys:tt,checked:i.autoResumeLimitedThreads,onCheckedChange:nt,"aria-label":`Auto-resume limited threads`})}),e[57]=i.autoResumeLimitedThreads,e[58]=nt,e[59]=rt):rt=e[59];let it;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(it=X(`snooze-limited-threads`),e[60]=it):it=e[60];let at;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(at=[`snoozeLimitedThreads`],e[61]=at):at=e[61];let ot;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(ot=[`snoozeLimitedThreads`],e[62]=ot):ot=e[62];let st;e[63]===a?st=e[64]:(st=e=>a({snoozeLimitedThreads:!!e}),e[63]=a,e[64]=st);let ct;e[65]!==i.snoozeLimitedThreads||e[66]!==st?(ct=(0,$.jsx)(J,{serverScoped:!0,...it,description:`Snooze usage-limit stops until the reported reset time. Combine with auto-resume to continue when they wake.`,settingKeys:at,control:(0,$.jsx)(vr,{settingKeys:ot,checked:i.snoozeLimitedThreads,onCheckedChange:st,"aria-label":`Snooze limited threads`})}),e[65]=i.snoozeLimitedThreads,e[66]=st,e[67]=ct):ct=e[67];let lt;e[68]===Symbol.for(`react.memo_cache_sentinel`)?(lt=X(`working-shelf`),e[68]=lt):lt=e[68];let ut;e[69]!==i.sidebarWorkingShelfEnabled||e[70]!==a?(ut=i.sidebarWorkingShelfEnabled===V.sidebarWorkingShelfEnabled?null:(0,$.jsx)(Y,{label:`working section`,onClick:()=>a({sidebarWorkingShelfEnabled:V.sidebarWorkingShelfEnabled})}),e[69]=i.sidebarWorkingShelfEnabled,e[70]=a,e[71]=ut):ut=e[71];let dt;e[72]===a?dt=e[73]:(dt=e=>a({sidebarWorkingShelfEnabled:!!e}),e[72]=a,e[73]=dt);let ft;e[74]!==i.sidebarWorkingShelfEnabled||e[75]!==dt?(ft=(0,$.jsx)(zn,{checked:i.sidebarWorkingShelfEnabled,onCheckedChange:dt,"aria-label":`Working section (beta)`}),e[74]=i.sidebarWorkingShelfEnabled,e[75]=dt,e[76]=ft):ft=e[76];let pt;e[77]!==ut||e[78]!==ft?(pt=(0,$.jsx)(J,{...lt,description:`Fold working and monitoring threads into a Working section. They return to the top of the inbox when they need you.`,resetAction:ut,control:ft}),e[77]=ut,e[78]=ft,e[79]=pt):pt=e[79];let mt;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(mt=[`idleCompaction`,`compactIdleThreads`],e[80]=mt):mt=e[80];let ht=v.mixed,gt;e[81]===Symbol.for(`react.memo_cache_sentinel`)?(gt=X(`compact-idle-threads`),e[81]=gt):gt=e[81];let _t;e[82]!==i||e[83]!==a?(_t=U(i)===U(V)?null:(0,$.jsx)(Y,{label:`compact idle threads`,onClick:()=>a({idleCompaction:U(V)})}),e[82]=i,e[83]=a,e[84]=_t):_t=e[84];let vt;e[85]!==v.mixed||e[86]!==i?(vt=v.mixed?null:U(i),e[85]=v.mixed,e[86]=i,e[87]=vt):vt=e[87];let yt;e[88]===a?yt=e[89]:(yt=e=>{let t=W.find(t=>t.value===e);t&&a({idleCompaction:t.value})},e[88]=a,e[89]=yt);let bt;e[90]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Compact idle threads`,children:(0,$.jsx)(me,{children:hs})}),e[90]=bt):bt=e[90];let xt;e[91]===v.neverAvailable?xt=e[92]:(xt=W.map(e=>(0,$.jsx)(K,{hideIndicator:!0,value:e.value,disabled:e.value===`off`&&!v.neverAvailable,children:e.label},e.value)),e[91]=v.neverAvailable,e[92]=xt);let St;e[93]===xt?St=e[94]:(St=(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:xt}),e[93]=xt,e[94]=St);let Ct;e[95]!==vt||e[96]!==yt||e[97]!==St?(Ct=(0,$.jsxs)(_e,{value:vt,onValueChange:yt,children:[bt,St]}),e[95]=vt,e[96]=yt,e[97]=St,e[98]=Ct):Ct=e[98];let wt;e[99]!==v.mixed||e[100]!==_t||e[101]!==Ct?(wt=(0,$.jsx)(J,{serverScoped:!0,settingKeys:mt,mixed:ht,...gt,description:`When to compact an idle Claude thread over 200,000 tokens: after you return, just before its prompt cache expires, or never. Each Claude provider can override this.`,resetAction:_t,control:Ct}),e[99]=v.mixed,e[100]=_t,e[101]=Ct,e[102]=wt):wt=e[102];let Tt;e[103]!==We||e[104]!==Qe||e[105]!==rt||e[106]!==ct||e[107]!==pt||e[108]!==wt?(Tt=(0,$.jsxs)(Dn,{id:`organization`,title:`Organization`,children:[We,Qe,rt,ct,pt,wt]}),e[103]=We,e[104]=Qe,e[105]=rt,e[106]=ct,e[107]=pt,e[108]=wt,e[109]=Tt):Tt=e[109];let Et;e[110]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,$.jsx)(Nr,{}),e[110]=Et):Et=e[110];let Dt;e[111]===Symbol.for(`react.memo_cache_sentinel`)?(Dt=X(`in-app-notifications`),e[111]=Dt):Dt=e[111];let Ot;e[112]===a?Ot=e[113]:(Ot=e=>a({inAppNotificationsEnabled:e}),e[112]=a,e[113]=Ot);let kt;e[114]!==i.inAppNotificationsEnabled||e[115]!==Ot?(kt=(0,$.jsx)(J,{...Dt,description:`Show a toast when another thread finishes, fails, or needs input or approval while this app has focus.`,control:(0,$.jsx)(zn,{checked:i.inAppNotificationsEnabled,onCheckedChange:Ot,"aria-label":`In-app notifications`})}),e[114]=i.inAppNotificationsEnabled,e[115]=Ot,e[116]=kt):kt=e[116];let At;e[117]!==i.wakeScreenOnThreadEvents||e[118]!==a?(At=window.desktopBridge?.wakeDisplay?(0,$.jsx)(J,{...X(`wake-screen`),description:`Keep the Mac awake while threads run, and wake it when one finishes or needs you.`,control:(0,$.jsx)(zn,{checked:i.wakeScreenOnThreadEvents,onCheckedChange:e=>a({wakeScreenOnThreadEvents:e}),"aria-label":`Auto awake`})}):null,e[117]=i.wakeScreenOnThreadEvents,e[118]=a,e[119]=At):At=e[119];let jt;e[120]===Symbol.for(`react.memo_cache_sentinel`)?(jt=X(`time-format`),e[120]=jt):jt=e[120];let Ft;e[121]!==i.timestampFormat||e[122]!==a?(Ft=i.timestampFormat===V.timestampFormat?null:(0,$.jsx)(Y,{label:`time format`,onClick:()=>a({timestampFormat:V.timestampFormat})}),e[121]=i.timestampFormat,e[122]=a,e[123]=Ft):Ft=e[123];let Lt;e[124]===a?Lt=e[125]:(Lt=e=>{(e===`locale`||e===`12-hour`||e===`24-hour`)&&a({timestampFormat:e})},e[124]=a,e[125]=Lt);let Rt=jo[i.timestampFormat],zt;e[126]===Rt?zt=e[127]:(zt=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Timestamp format`,children:(0,$.jsx)(me,{children:Rt})}),e[126]=Rt,e[127]=zt);let Bt;e[128]===Symbol.for(`react.memo_cache_sentinel`)?(Bt=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{hideIndicator:!0,value:`locale`,children:jo.locale}),(0,$.jsx)(K,{hideIndicator:!0,value:`12-hour`,children:jo[`12-hour`]}),(0,$.jsx)(K,{hideIndicator:!0,value:`24-hour`,children:jo[`24-hour`]})]}),e[128]=Bt):Bt=e[128];let Vt;e[129]!==i.timestampFormat||e[130]!==Lt||e[131]!==zt?(Vt=(0,$.jsxs)(_e,{value:i.timestampFormat,onValueChange:Lt,children:[zt,Bt]}),e[129]=i.timestampFormat,e[130]=Lt,e[131]=zt,e[132]=Vt):Vt=e[132];let Ht;e[133]!==Ft||e[134]!==Vt?(Ht=(0,$.jsx)(J,{...jt,description:`System default follows your browser or OS clock preference.`,resetAction:Ft,control:Vt}),e[133]=Ft,e[134]=Vt,e[135]=Ht):Ht=e[135];let Ut,Wt;e[136]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=[`compressMode`],Wt=X(`response-compression`),e[136]=Ut,e[137]=Wt):(Ut=e[136],Wt=e[137]);let Gt=A?null:i.compressMode,Kt;e[138]===a?Kt=e[139]:(Kt=e=>{te.literals.some(t=>t===e)&&a({compressMode:e})},e[138]=a,e[139]=Kt);let qt;e[140]===Symbol.for(`react.memo_cache_sentinel`)?(qt=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Response compression`,children:(0,$.jsx)(me,{children:ms})}),e[140]=qt):qt=e[140];let Jt;e[141]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:te.literals.map(ps)}),e[141]=Jt):Jt=e[141];let Yt;e[142]!==Gt||e[143]!==Kt?(Yt=(0,$.jsx)(J,{serverScoped:!0,settingKeys:Ut,...Wt,description:`Response style for all threads on this server, starting next turn. Code and saved documents retain normal prose.`,control:(0,$.jsxs)(_e,{value:Gt,onValueChange:Kt,children:[qt,Jt]})}),e[142]=Gt,e[143]=Kt,e[144]=Yt):Yt=e[144];let Xt,Zt;e[145]===Symbol.for(`react.memo_cache_sentinel`)?(Xt=[`responseStreamingMode`],Zt=X(`response-streaming`),e[145]=Xt,e[146]=Zt):(Xt=e[145],Zt=e[146]);let Qt=F?`The selected targets use different streaming modes.`:Oo[i.responseStreamingMode],$t;e[147]!==i.responseStreamingMode||e[148]!==a?($t=i.responseStreamingMode===V.responseStreamingMode?null:(0,$.jsx)(Y,{label:`response streaming`,onClick:()=>a({responseStreamingMode:V.responseStreamingMode})}),e[147]=i.responseStreamingMode,e[148]=a,e[149]=$t):$t=e[149];let en=F?null:i.responseStreamingMode,tn;e[150]===a?tn=e[151]:(tn=e=>{(e===`turn`||e===`paragraph`)&&a({responseStreamingMode:e})},e[150]=a,e[151]=tn);let nn;e[152]===Symbol.for(`react.memo_cache_sentinel`)?(nn=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Response streaming`,children:(0,$.jsx)(me,{children:fs})}),e[152]=nn):nn=e[152];let rn;e[153]===Symbol.for(`react.memo_cache_sentinel`)?(rn=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{hideIndicator:!0,value:`turn`,children:Do.turn}),(0,$.jsx)(K,{hideIndicator:!0,value:`paragraph`,children:Do.paragraph})]}),e[153]=rn):rn=e[153];let an;e[154]!==en||e[155]!==tn?(an=(0,$.jsxs)(_e,{value:en,onValueChange:tn,children:[nn,rn]}),e[154]=en,e[155]=tn,e[156]=an):an=e[156];let on;e[157]!==Qt||e[158]!==$t||e[159]!==an?(on=(0,$.jsx)(J,{serverScoped:!0,settingKeys:Xt,...Zt,description:Qt,resetAction:$t,control:an}),e[157]=Qt,e[158]=$t,e[159]=an,e[160]=on):on=e[160];let sn;e[161]===Symbol.for(`react.memo_cache_sentinel`)?(sn=X(`hide-whitespace-changes`),e[161]=sn):sn=e[161];let cn;e[162]!==i.diffIgnoreWhitespace||e[163]!==a?(cn=i.diffIgnoreWhitespace===V.diffIgnoreWhitespace?null:(0,$.jsx)(Y,{label:`diff whitespace changes`,onClick:()=>a({diffIgnoreWhitespace:V.diffIgnoreWhitespace})}),e[162]=i.diffIgnoreWhitespace,e[163]=a,e[164]=cn):cn=e[164];let ln;e[165]===a?ln=e[166]:(ln=e=>a({diffIgnoreWhitespace:!!e}),e[165]=a,e[166]=ln);let un;e[167]!==i.diffIgnoreWhitespace||e[168]!==ln?(un=(0,$.jsx)(zn,{checked:i.diffIgnoreWhitespace,onCheckedChange:ln,"aria-label":`Hide whitespace changes by default`}),e[167]=i.diffIgnoreWhitespace,e[168]=ln,e[169]=un):un=e[169];let dn;e[170]!==cn||e[171]!==un?(dn=(0,$.jsx)(J,{...sn,description:`Set whether the diff panel ignores whitespace-only edits by default.`,resetAction:cn,control:un}),e[170]=cn,e[171]=un,e[172]=dn):dn=e[172];let fn;e[173]===Symbol.for(`react.memo_cache_sentinel`)?(fn=X(`default-diff-file-state`),e[173]=fn):fn=e[173];let pn;e[174]!==i.diffFilesCollapsed||e[175]!==a?(pn=i.diffFilesCollapsed===V.diffFilesCollapsed?null:(0,$.jsx)(Y,{label:`default diff file state`,onClick:()=>a({diffFilesCollapsed:V.diffFilesCollapsed})}),e[174]=i.diffFilesCollapsed,e[175]=a,e[176]=pn):pn=e[176];let mn=i.diffFilesCollapsed?`collapsed`:`expanded`,hn;e[177]===a?hn=e[178]:(hn=e=>{(e===`expanded`||e===`collapsed`)&&a({diffFilesCollapsed:e===`collapsed`})},e[177]=a,e[178]=hn);let _n=i.diffFilesCollapsed?`Collapsed`:`Expanded`,yn;e[179]===_n?yn=e[180]:(yn=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default diff file state`,children:(0,$.jsx)(me,{children:_n})}),e[179]=_n,e[180]=yn);let Cn;e[181]===Symbol.for(`react.memo_cache_sentinel`)?(Cn=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{hideIndicator:!0,value:`expanded`,children:`Expanded`}),(0,$.jsx)(K,{hideIndicator:!0,value:`collapsed`,children:`Collapsed`})]}),e[181]=Cn):Cn=e[181];let wn;e[182]!==mn||e[183]!==hn||e[184]!==yn?(wn=(0,$.jsxs)(_e,{value:mn,onValueChange:hn,children:[yn,Cn]}),e[182]=mn,e[183]=hn,e[184]=yn,e[185]=wn):wn=e[185];let kn;e[186]!==pn||e[187]!==wn?(kn=(0,$.jsx)(J,{...fn,description:`Start with files expanded or collapsed when opening diffs or a pull request's Code tab.`,resetAction:pn,control:wn}),e[186]=pn,e[187]=wn,e[188]=kn):kn=e[188];let An;e[189]===Symbol.for(`react.memo_cache_sentinel`)?(An=X(`diff-layout`),e[189]=An):An=e[189];let jn;e[190]!==i.diffLayout||e[191]!==a?(jn=i.diffLayout===V.diffLayout?null:(0,$.jsx)(Y,{label:`diff layout`,onClick:()=>a({diffLayout:V.diffLayout})}),e[190]=i.diffLayout,e[191]=a,e[192]=jn):jn=e[192];let Mn;e[193]===a?Mn=e[194]:(Mn=e=>{(e===`stacked`||e===`split`)&&a({diffLayout:e})},e[193]=a,e[194]=Mn);let Pn=Po[i.diffLayout],Fn;e[195]===Pn?Fn=e[196]:(Fn=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Diff layout`,children:(0,$.jsx)(me,{children:Pn})}),e[195]=Pn,e[196]=Fn);let In;e[197]===Symbol.for(`react.memo_cache_sentinel`)?(In=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{hideIndicator:!0,value:`stacked`,children:Po.stacked}),(0,$.jsx)(K,{hideIndicator:!0,value:`split`,children:Po.split})]}),e[197]=In):In=e[197];let Ln;e[198]!==i.diffLayout||e[199]!==Mn||e[200]!==Fn?(Ln=(0,$.jsxs)(_e,{value:i.diffLayout,onValueChange:Mn,children:[Fn,In]}),e[198]=i.diffLayout,e[199]=Mn,e[200]=Fn,e[201]=Ln):Ln=e[201];let Rn;e[202]!==jn||e[203]!==Ln?(Rn=(0,$.jsx)(J,{...An,description:`Show diffs stacked or side by side. The toggle in the diff toolbar changes this too.`,resetAction:jn,control:Ln}),e[202]=jn,e[203]=Ln,e[204]=Rn):Rn=e[204];let Bn;e[205]===Symbol.for(`react.memo_cache_sentinel`)?(Bn=X(`proactive-panels`),e[205]=Bn):Bn=e[205];let Hn;e[206]!==i.proactivePanelsEnabled||e[207]!==a?(Hn=i.proactivePanelsEnabled===V.proactivePanelsEnabled?null:(0,$.jsx)(Y,{label:`proactive panels`,onClick:()=>a({proactivePanelsEnabled:V.proactivePanelsEnabled})}),e[206]=i.proactivePanelsEnabled,e[207]=a,e[208]=Hn):Hn=e[208];let Un;e[209]===a?Un=e[210]:(Un=e=>a({proactivePanelsEnabled:!!e}),e[209]=a,e[210]=Un);let Wn;e[211]!==i.proactivePanelsEnabled||e[212]!==Un?(Wn=(0,$.jsx)(zn,{checked:i.proactivePanelsEnabled,onCheckedChange:Un,"aria-label":`Open pull requests and changes panels proactively`}),e[211]=i.proactivePanelsEnabled,e[212]=Un,e[213]=Wn):Wn=e[213];let Gn;e[214]!==Hn||e[215]!==Wn?(Gn=(0,$.jsx)(J,{...Bn,description:`Open linked pull requests first. Otherwise, open Changes for edits to at least 3 files or 50 lines.`,resetAction:Hn,control:Wn}),e[214]=Hn,e[215]=Wn,e[216]=Gn):Gn=e[216];let Kn;e[217]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=X(`skills-in-slash-menu`),e[217]=Kn):Kn=e[217];let qn;e[218]!==i.showSkillsInSlashMenu||e[219]!==a?(qn=i.showSkillsInSlashMenu===V.showSkillsInSlashMenu?null:(0,$.jsx)(Y,{label:`skills in slash menu`,onClick:()=>a({showSkillsInSlashMenu:V.showSkillsInSlashMenu})}),e[218]=i.showSkillsInSlashMenu,e[219]=a,e[220]=qn):qn=e[220];let Jn;e[221]===a?Jn=e[222]:(Jn=e=>a({showSkillsInSlashMenu:!!e}),e[221]=a,e[222]=Jn);let Yn;e[223]!==i.showSkillsInSlashMenu||e[224]!==Jn?(Yn=(0,$.jsx)(zn,{checked:i.showSkillsInSlashMenu,onCheckedChange:Jn,"aria-label":`Show skills in slash menu`}),e[223]=i.showSkillsInSlashMenu,e[224]=Jn,e[225]=Yn):Yn=e[225];let Xn;e[226]!==qn||e[227]!==Yn?(Xn=(0,$.jsx)(J,{...Kn,description:`Also include skills in the / command menu. Skills always appear when you type $.`,resetAction:qn,control:Yn}),e[226]=qn,e[227]=Yn,e[228]=Xn):Xn=e[228];let Zn;e[229]===Symbol.for(`react.memo_cache_sentinel`)?(Zn=X(`composer-rich-text`),e[229]=Zn):Zn=e[229];let Qn;e[230]!==i.composerRichTextEnabled||e[231]!==a?(Qn=i.composerRichTextEnabled===V.composerRichTextEnabled?null:(0,$.jsx)(Y,{label:`rich text composer`,onClick:()=>a({composerRichTextEnabled:V.composerRichTextEnabled})}),e[230]=i.composerRichTextEnabled,e[231]=a,e[232]=Qn):Qn=e[232];let $n;e[233]===a?$n=e[234]:($n=e=>a({composerRichTextEnabled:!!e}),e[233]=a,e[234]=$n);let er;e[235]!==i.composerRichTextEnabled||e[236]!==$n?(er=(0,$.jsx)(zn,{checked:i.composerRichTextEnabled,onCheckedChange:$n,"aria-label":`Rich text composer`}),e[235]=i.composerRichTextEnabled,e[236]=$n,e[237]=er):er=e[237];let tr;e[238]!==Qn||e[239]!==er?(tr=(0,$.jsx)(J,{...Zn,description:`Show formatted Markdown as you type.`,resetAction:Qn,control:er}),e[238]=Qn,e[239]=er,e[240]=tr):tr=e[240];let nr;e[241]===Symbol.for(`react.memo_cache_sentinel`)?(nr=X(`composer-collapse`),e[241]=nr):nr=e[241];let rr;e[242]!==i.composerCollapseOnScroll||e[243]!==a?(rr=i.composerCollapseOnScroll===V.composerCollapseOnScroll?null:(0,$.jsx)(Y,{label:`collapse composer on scroll`,onClick:()=>a({composerCollapseOnScroll:V.composerCollapseOnScroll})}),e[242]=i.composerCollapseOnScroll,e[243]=a,e[244]=rr):rr=e[244];let ir;e[245]===a?ir=e[246]:(ir=e=>a({composerCollapseOnScroll:!!e}),e[245]=a,e[246]=ir);let ar;e[247]!==i.composerCollapseOnScroll||e[248]!==ir?(ar=(0,$.jsx)(zn,{checked:i.composerCollapseOnScroll,onCheckedChange:ir,"aria-label":`Collapse composer on scroll`}),e[247]=i.composerCollapseOnScroll,e[248]=ir,e[249]=ar):ar=e[249];let or;e[250]!==rr||e[251]!==ar?(or=(0,$.jsx)(J,{...nr,description:`Rest the composer of an existing thread into a single line when you scroll the conversation. Focus the composer or start typing to expand it again.`,resetAction:rr,control:ar}),e[250]=rr,e[251]=ar,e[252]=or):or=e[252];let sr;e[253]===Symbol.for(`react.memo_cache_sentinel`)?(sr=X(`send-shortcut`),e[253]=sr):sr=e[253];let cr;e[254]!==i.sendShortcut||e[255]!==a?(cr=i.sendShortcut===V.sendShortcut?null:(0,$.jsx)(Y,{label:`send shortcut`,onClick:()=>a({sendShortcut:V.sendShortcut})}),e[254]=i.sendShortcut,e[255]=a,e[256]=cr):cr=e[256];let lr;e[257]===a?lr=e[258]:(lr=e=>{let t=r.find(t=>t.value===e);t&&a({sendShortcut:t.value})},e[257]=a,e[258]=lr);let ur=r.find(e=>e.value===i.sendShortcut)?.label,fr;e[259]===ur?fr=e[260]:(fr=(0,$.jsx)(ge,{size:`sm`,className:`w-auto min-w-0 max-w-full`,"aria-label":`Send shortcut`,children:(0,$.jsx)(me,{children:ur})}),e[259]=ur,e[260]=fr);let pr;e[261]===i.sendShortcut?pr=e[262]:(pr=(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:r.map(e=>(0,$.jsx)(K,{value:e.value,children:(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-4`,children:[e.label,i.sendShortcut===e.value&&(0,$.jsx)(s,{"aria-hidden":`true`})]})},e.value))}),e[261]=i.sendShortcut,e[262]=pr);let yr;e[263]!==i.sendShortcut||e[264]!==lr||e[265]!==fr||e[266]!==pr?(yr=(0,$.jsxs)(_e,{value:i.sendShortcut,onValueChange:lr,children:[fr,pr]}),e[263]=i.sendShortcut,e[264]=lr,e[265]=fr,e[266]=pr,e[267]=yr):yr=e[267];let Cr;e[268]!==cr||e[269]!==yr?(Cr=(0,$.jsx)(J,{...sr,description:`Choose when Enter sends a prompt or inserts a new line`,resetAction:cr,control:yr}),e[268]=cr,e[269]=yr,e[270]=Cr):Cr=e[270];let wr;e[271]===Symbol.for(`react.memo_cache_sentinel`)?(wr=X(`follow-up-behavior`),e[271]=wr):wr=e[271];let Tr=`Queue follow-ups while the agent runs or steer the current run. `+(i.sendShortcut===`mod-enter-multiline`?`Press ${t} + Enter for single-line prompts or ${t} + Shift + Enter for multiline prompts to do the opposite for one message.`:`Press ${t}${i.sendShortcut===`mod-enter`?` + Shift`:``} + Enter to do the opposite for one message.`),Dr;e[272]!==i.followUpBehavior||e[273]!==a?(Dr=i.followUpBehavior===V.followUpBehavior?null:(0,$.jsx)(Y,{label:`follow-up behavior`,onClick:()=>a({followUpBehavior:V.followUpBehavior})}),e[272]=i.followUpBehavior,e[273]=a,e[274]=Dr):Dr=e[274];let Or;e[275]===a?Or=e[276]:(Or=e=>{(e===`queue`||e===`steer`)&&a({followUpBehavior:e})},e[275]=a,e[276]=Or);let Ar=i.followUpBehavior===`queue`?`Queue`:`Steer`,jr;e[277]===Ar?jr=e[278]:(jr=(0,$.jsx)(ge,{size:`sm`,className:`w-auto min-w-0`,"aria-label":`Follow-up behavior`,children:(0,$.jsx)(me,{children:Ar})}),e[277]=Ar,e[278]=jr);let Mr;e[279]===Symbol.for(`react.memo_cache_sentinel`)?(Mr=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(K,{value:`queue`,children:`Queue`}),(0,$.jsx)(K,{value:`steer`,children:`Steer`})]}),e[279]=Mr):Mr=e[279];let Fr;e[280]!==i.followUpBehavior||e[281]!==Or||e[282]!==jr?(Fr=(0,$.jsxs)(_e,{value:i.followUpBehavior,onValueChange:Or,children:[jr,Mr]}),e[280]=i.followUpBehavior,e[281]=Or,e[282]=jr,e[283]=Fr):Fr=e[283];let Ir;e[284]!==Tr||e[285]!==Dr||e[286]!==Fr?(Ir=(0,$.jsx)(J,{...wr,description:Tr,resetAction:Dr,control:Fr}),e[284]=Tr,e[285]=Dr,e[286]=Fr,e[287]=Ir):Ir=e[287];let Lr,Rr;e[288]===Symbol.for(`react.memo_cache_sentinel`)?(Lr=[`enableProviderUpdateChecks`],Rr=X(`provider-update-checks`),e[288]=Lr,e[289]=Rr):(Lr=e[288],Rr=e[289]);let zr;e[290]!==i.enableProviderUpdateChecks||e[291]!==a?(zr=i.enableProviderUpdateChecks===V.enableProviderUpdateChecks?null:(0,$.jsx)(Y,{label:`provider update checks`,onClick:()=>a({enableProviderUpdateChecks:V.enableProviderUpdateChecks})}),e[290]=i.enableProviderUpdateChecks,e[291]=a,e[292]=zr):zr=e[292];let Br;e[293]===Symbol.for(`react.memo_cache_sentinel`)?(Br=[`enableProviderUpdateChecks`],e[293]=Br):Br=e[293];let Vr;e[294]===a?Vr=e[295]:(Vr=e=>a({enableProviderUpdateChecks:!!e}),e[294]=a,e[295]=Vr);let Hr;e[296]!==i.enableProviderUpdateChecks||e[297]!==Vr?(Hr=(0,$.jsx)(vr,{settingKeys:Br,checked:i.enableProviderUpdateChecks,onCheckedChange:Vr,"aria-label":`Check provider versions`}),e[296]=i.enableProviderUpdateChecks,e[297]=Vr,e[298]=Hr):Hr=e[298];let Ur;e[299]!==zr||e[300]!==Hr?(Ur=(0,$.jsx)(J,{serverScoped:!0,settingKeys:Lr,...Rr,description:`Check installed provider CLIs for newer available versions and fetch model catalog updates. When off, new models may not appear.`,resetAction:zr,control:Hr}),e[299]=zr,e[300]=Hr,e[301]=Ur):Ur=e[301];let Wr;e[302]===Symbol.for(`react.memo_cache_sentinel`)?(Wr=X(`continue-threads-after-server-update`),e[302]=Wr):Wr=e[302];let Gr;e[303]===Symbol.for(`react.memo_cache_sentinel`)?(Gr=[`continueThreadsAfterServerUpdate`],e[303]=Gr):Gr=e[303];let Kr=B?void 0:`All selected connected environments must support restart continuation.`,qr;e[304]!==i.continueThreadsAfterServerUpdate||e[305]!==B||e[306]!==a?(qr=B&&i.continueThreadsAfterServerUpdate!==V.continueThreadsAfterServerUpdate?(0,$.jsx)(Y,{label:`continue threads after restarts`,onClick:()=>a({continueThreadsAfterServerUpdate:V.continueThreadsAfterServerUpdate})}):null,e[304]=i.continueThreadsAfterServerUpdate,e[305]=B,e[306]=a,e[307]=qr):qr=e[307];let Jr;e[308]===Symbol.for(`react.memo_cache_sentinel`)?(Jr=[`continueThreadsAfterServerUpdate`],e[308]=Jr):Jr=e[308];let Yr=!B,Xr;e[309]===a?Xr=e[310]:(Xr=e=>a({continueThreadsAfterServerUpdate:!!e}),e[309]=a,e[310]=Xr);let Zr;e[311]!==i.continueThreadsAfterServerUpdate||e[312]!==Yr||e[313]!==Xr?(Zr=(0,$.jsx)(vr,{settingKeys:Jr,checked:i.continueThreadsAfterServerUpdate,disabled:Yr,onCheckedChange:Xr,"aria-label":`Continue threads after restarts`}),e[311]=i.continueThreadsAfterServerUpdate,e[312]=Yr,e[313]=Xr,e[314]=Zr):Zr=e[314];let Qr;e[315]!==Kr||e[316]!==qr||e[317]!==Zr?(Qr=(0,$.jsx)(J,{...Wr,serverScoped:!0,settingKeys:Gr,description:`Automatically resume interrupted threads after an update, crash, or machine restart on the selected environments.`,status:Kr,resetAction:qr,control:Zr}),e[315]=Kr,e[316]=qr,e[317]=Zr,e[318]=Qr):Qr=e[318];let $r,ei;e[319]===Symbol.for(`react.memo_cache_sentinel`)?($r=[`backgroundActivity`],ei=X(`background-activity`),e[319]=$r,e[320]=ei):($r=e[319],ei=e[320]);let ti=ei.id,ni;e[321]===Symbol.for(`react.memo_cache_sentinel`)?(ni=X(`background-activity`),e[321]=ni):ni=e[321];let ri;e[322]===Symbol.for(`react.memo_cache_sentinel`)?(ri=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[ni.title,(0,$.jsx)(On,{children:`This shared policy gates background work such as Git refreshes and provider health probes after their individual intervals elapse.`})]}),e[322]=ri):ri=e[322];let ii;e[323]!==Ie||e[324]!==a?(ii=Ie?(0,$.jsx)(Y,{label:`background activity`,onClick:()=>a(Ho())}):null,e[323]=Ie,e[324]=a,e[325]=ii):ii=e[325];let ai=De?null:Te,oi;e[326]!==S||e[327]!==a?(oi=e=>{e===`advanced`?S&&O(!0):(e===`balanced`||e===`performance`||e===`battery-saver`)&&a(Uo(e))},e[326]=S,e[327]=a,e[328]=oi):oi=e[328];let si;e[329]===Symbol.for(`react.memo_cache_sentinel`)?(si=(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Background activity profile`,children:(0,$.jsx)(me,{children:ds})}),e[329]=si):si=e[329];let ci,li,ui;e[330]===Symbol.for(`react.memo_cache_sentinel`)?(ci=(0,$.jsx)(K,{hideIndicator:!0,value:`balanced`,children:Io.balanced}),li=(0,$.jsx)(K,{hideIndicator:!0,value:`performance`,children:Io.performance}),ui=(0,$.jsx)(K,{hideIndicator:!0,value:`battery-saver`,children:Io[`battery-saver`]}),e[330]=ci,e[331]=li,e[332]=ui):(ci=e[330],li=e[331],ui=e[332]);let di=!S,fi=S?Lo.advanced:`${Lo.advanced} (one environment)`,pi;e[333]!==di||e[334]!==fi?(pi=(0,$.jsxs)(q,{align:`end`,alignItemWithTrigger:!1,children:[ci,li,ui,(0,$.jsx)(K,{hideIndicator:!0,value:`advanced`,disabled:di,children:fi})]}),e[333]=di,e[334]=fi,e[335]=pi):pi=e[335];let mi;e[336]!==ai||e[337]!==oi||e[338]!==pi?(mi=(0,$.jsxs)(_e,{value:ai,onValueChange:oi,children:[si,pi]}),e[336]=ai,e[337]=oi,e[338]=pi,e[339]=mi):mi=e[339];let hi;e[340]!==Te||e[341]!==S?(hi=Te===`advanced`&&S?(0,$.jsxs)(It,{children:[(0,$.jsx)(Nt,{render:(0,$.jsx)(P,{size:`icon-sm`,variant:`outline`,"aria-label":`Configure advanced background activity`,onClick:()=>O(!0),children:(0,$.jsx)(N,{className:`size-4`})})}),(0,$.jsx)(Pt,{side:`top`,children:`Configure background activity`})]}):null,e[340]=Te,e[341]=S,e[342]=hi):hi=e[342];let gi=E&&S,_i;e[343]===gi?_i=e[344]:(_i=(0,$.jsx)(Ko,{open:gi,onOpenChange:O}),e[343]=gi,e[344]=_i);let vi;e[345]!==mi||e[346]!==hi||e[347]!==_i?(vi=(0,$.jsxs)($.Fragment,{children:[mi,hi,_i]}),e[345]=mi,e[346]=hi,e[347]=_i,e[348]=vi):vi=e[348];let yi;e[349]!==Me||e[350]!==ii||e[351]!==vi?(yi=(0,$.jsx)(J,{serverScoped:!0,settingKeys:$r,id:ti,title:ri,description:Me,resetAction:ii,control:vi}),e[349]=Me,e[350]=ii,e[351]=vi,e[352]=yi):yi=e[352];let bi;e[353]!==Rn||e[354]!==Gn||e[355]!==Xn||e[356]!==tr||e[357]!==or||e[358]!==Cr||e[359]!==Ir||e[360]!==Ur||e[361]!==Qr||e[362]!==yi||e[363]!==kt||e[364]!==At||e[365]!==Ht||e[366]!==Yt||e[367]!==on||e[368]!==dn||e[369]!==kn?(bi=(0,$.jsxs)(Dn,{id:`behavior`,title:`Behavior`,children:[Et,kt,At,Ht,Yt,on,dn,kn,Rn,Gn,Xn,tr,or,Cr,Ir,Ur,Qr,yi]}),e[353]=Rn,e[354]=Gn,e[355]=Xn,e[356]=tr,e[357]=or,e[358]=Cr,e[359]=Ir,e[360]=Ur,e[361]=Qr,e[362]=yi,e[363]=kt,e[364]=At,e[365]=Ht,e[366]=Yt,e[367]=on,e[368]=dn,e[369]=kn,e[370]=bi):bi=e[370];let xi,Si;e[371]===Symbol.for(`react.memo_cache_sentinel`)?(xi=[`newWorktreesStartFromOrigin`],Si=X(`start-from-origin`),e[371]=xi,e[372]=Si):(xi=e[371],Si=e[372]);let Ci;e[373]!==i.newWorktreesStartFromOrigin||e[374]!==a?(Ci=i.newWorktreesStartFromOrigin===V.newWorktreesStartFromOrigin?null:(0,$.jsx)(Y,{label:`new worktrees start from origin`,onClick:()=>a({newWorktreesStartFromOrigin:V.newWorktreesStartFromOrigin})}),e[373]=i.newWorktreesStartFromOrigin,e[374]=a,e[375]=Ci):Ci=e[375];let wi;e[376]===Symbol.for(`react.memo_cache_sentinel`)?(wi=[`newWorktreesStartFromOrigin`],e[376]=wi):wi=e[376];let Ti;e[377]===a?Ti=e[378]:(Ti=e=>a({newWorktreesStartFromOrigin:!!e}),e[377]=a,e[378]=Ti);let Ei;e[379]!==i.newWorktreesStartFromOrigin||e[380]!==Ti?(Ei=(0,$.jsx)(vr,{settingKeys:wi,checked:i.newWorktreesStartFromOrigin,onCheckedChange:Ti,"aria-label":`Start new worktrees from origin by default`}),e[379]=i.newWorktreesStartFromOrigin,e[380]=Ti,e[381]=Ei):Ei=e[381];let Di;e[382]!==Ci||e[383]!==Ei?(Di=(0,$.jsx)(J,{serverScoped:!0,settingKeys:xi,...Si,description:`Creates the worktree from the latest matching branch on origin instead of your local branch.`,resetAction:Ci,control:Ei}),e[382]=Ci,e[383]=Ei,e[384]=Di):Di=e[384];let Oi,ki;e[385]===Symbol.for(`react.memo_cache_sentinel`)?(Oi=[`addProjectBaseDirectory`],ki=X(`add-project-starts-in`),e[385]=Oi,e[386]=ki):(Oi=e[385],ki=e[386]);let Ai;e[387]!==i.addProjectBaseDirectory||e[388]!==a?(Ai=i.addProjectBaseDirectory===V.addProjectBaseDirectory?null:(0,$.jsx)(Y,{label:`add project base directory`,onClick:()=>a({addProjectBaseDirectory:V.addProjectBaseDirectory})}),e[387]=i.addProjectBaseDirectory,e[388]=a,e[389]=Ai):Ai=e[389];let ji=ke?``:i.addProjectBaseDirectory,Mi;e[390]===a?Mi=e[391]:(Mi=e=>a({addProjectBaseDirectory:e}),e[390]=a,e[391]=Mi);let Ni=ke?`Mixed`:`~/`,Pi;e[392]!==ji||e[393]!==Mi||e[394]!==Ni?(Pi=(0,$.jsx)(_r,{size:`sm`,className:`w-full sm:w-72`,value:ji,onCommit:Mi,normalizeDraft:de,placeholder:Ni,spellCheck:!1,"aria-label":`Add project base directory`}),e[392]=ji,e[393]=Mi,e[394]=Ni,e[395]=Pi):Pi=e[395];let Fi;e[396]!==Ai||e[397]!==Pi?(Fi=(0,$.jsx)(J,{serverScoped:!0,settingKeys:Oi,...ki,description:`Leave empty to use "~/" when the Add Project browser opens.`,resetAction:Ai,control:Pi}),e[396]=Ai,e[397]=Pi,e[398]=Fi):Fi=e[398];let Ii;e[399]!==Di||e[400]!==Fi?(Ii=(0,$.jsxs)(Dn,{id:`projects-and-threads`,title:`Projects & threads`,children:[Di,Fi]}),e[399]=Di,e[400]=Fi,e[401]=Ii):Ii=e[401];let Li;e[402]===Symbol.for(`react.memo_cache_sentinel`)?(Li=X(`unpin-confirmation`),e[402]=Li):Li=e[402];let Ri;e[403]!==i.confirmThreadUnpin||e[404]!==a?(Ri=i.confirmThreadUnpin===V.confirmThreadUnpin?null:(0,$.jsx)(Y,{label:`unpin confirmation`,onClick:()=>a({confirmThreadUnpin:V.confirmThreadUnpin})}),e[403]=i.confirmThreadUnpin,e[404]=a,e[405]=Ri):Ri=e[405];let zi;e[406]===a?zi=e[407]:(zi=e=>a({confirmThreadUnpin:!!e}),e[406]=a,e[407]=zi);let Bi;e[408]!==i.confirmThreadUnpin||e[409]!==zi?(Bi=(0,$.jsx)(zn,{checked:i.confirmThreadUnpin,onCheckedChange:zi,"aria-label":`Confirm thread unpinning`}),e[408]=i.confirmThreadUnpin,e[409]=zi,e[410]=Bi):Bi=e[410];let Vi;e[411]!==Ri||e[412]!==Bi?(Vi=(0,$.jsx)(J,{...Li,description:`Ask before unpinning a thread from the pinned section.`,resetAction:Ri,control:Bi}),e[411]=Ri,e[412]=Bi,e[413]=Vi):Vi=e[413];let Hi;e[414]===Symbol.for(`react.memo_cache_sentinel`)?(Hi=X(`archive-confirmation`),e[414]=Hi):Hi=e[414];let Ui;e[415]!==i.confirmThreadArchive||e[416]!==a?(Ui=i.confirmThreadArchive===V.confirmThreadArchive?null:(0,$.jsx)(Y,{label:`archive confirmation`,onClick:()=>a({confirmThreadArchive:V.confirmThreadArchive})}),e[415]=i.confirmThreadArchive,e[416]=a,e[417]=Ui):Ui=e[417];let Wi;e[418]===a?Wi=e[419]:(Wi=e=>a({confirmThreadArchive:!!e}),e[418]=a,e[419]=Wi);let Gi;e[420]!==i.confirmThreadArchive||e[421]!==Wi?(Gi=(0,$.jsx)(zn,{checked:i.confirmThreadArchive,onCheckedChange:Wi,"aria-label":`Confirm thread archiving`}),e[420]=i.confirmThreadArchive,e[421]=Wi,e[422]=Gi):Gi=e[422];let Ki;e[423]!==Ui||e[424]!==Gi?(Ki=(0,$.jsx)(J,{...Hi,description:`Require a second click on the inline archive action before a thread is archived.`,resetAction:Ui,control:Gi}),e[423]=Ui,e[424]=Gi,e[425]=Ki):Ki=e[425];let qi;e[426]===Symbol.for(`react.memo_cache_sentinel`)?(qi=X(`delete-confirmation`),e[426]=qi):qi=e[426];let Ji;e[427]!==i.confirmThreadDelete||e[428]!==a?(Ji=i.confirmThreadDelete===V.confirmThreadDelete?null:(0,$.jsx)(Y,{label:`delete confirmation`,onClick:()=>a({confirmThreadDelete:V.confirmThreadDelete})}),e[427]=i.confirmThreadDelete,e[428]=a,e[429]=Ji):Ji=e[429];let Yi;e[430]===a?Yi=e[431]:(Yi=e=>a({confirmThreadDelete:!!e}),e[430]=a,e[431]=Yi);let Xi;e[432]!==i.confirmThreadDelete||e[433]!==Yi?(Xi=(0,$.jsx)(zn,{checked:i.confirmThreadDelete,onCheckedChange:Yi,"aria-label":`Confirm thread deletion`}),e[432]=i.confirmThreadDelete,e[433]=Yi,e[434]=Xi):Xi=e[434];let Zi;e[435]!==Ji||e[436]!==Xi?(Zi=(0,$.jsx)(J,{...qi,description:`Ask before deleting a thread and its chat history.`,resetAction:Ji,control:Xi}),e[435]=Ji,e[436]=Xi,e[437]=Zi):Zi=e[437];let Qi;e[438]!==i.confirmQuit||e[439]!==a?(Qi=Mt?(0,$.jsx)(J,{...X(`quit-confirmation`),description:`Hold mode also quits on two quick presses.`,resetAction:i.confirmQuit===V.confirmQuit?null:(0,$.jsx)(Y,{label:`quit shortcut behavior`,onClick:()=>a({confirmQuit:V.confirmQuit})}),control:(0,$.jsxs)(_e,{value:i.confirmQuit,onValueChange:e=>{(e===`direct`||e===`hold`||e===`double-click`)&&a({confirmQuit:e})},children:[(0,$.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Quit shortcut behavior`,children:(0,$.jsx)(me,{children:Fo[i.confirmQuit]})}),(0,$.jsx)(q,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Fo).map(us)})]})}):null,e[438]=i.confirmQuit,e[439]=a,e[440]=Qi):Qi=e[440];let $i;e[441]!==Vi||e[442]!==Ki||e[443]!==Zi||e[444]!==Qi?($i=(0,$.jsxs)(Dn,{id:`confirmations`,title:`Confirmations`,children:[Vi,Ki,Zi,Qi]}),e[441]=Vi,e[442]=Ki,e[443]=Zi,e[444]=Qi,e[445]=$i):$i=e[445];let ea=Dn,ta=J,na,ra;e[446]===Symbol.for(`react.memo_cache_sentinel`)?(na=[`textGenerationModelSelection`],ra=X(`text-generation-model`),e[446]=na,e[447]=ra):(na=e[446],ra=e[447]);let ia;e[448]!==w||e[449]!==he||e[450]!==a?(ia=w&&he?(0,$.jsx)(Y,{label:`text generation model`,onClick:()=>a({textGenerationModelSelection:V.textGenerationModelSelection})}):null,e[448]=w,e[449]=he,e[450]=a,e[451]=ia):ia=e[451];let aa=w?se?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,$.jsx)(dr,{environmentId:b,activeInstanceId:re,model:ie,lockedProvider:null,instanceEntries:oe,modelOptionsByInstance:fe,triggerClassName:En,...je?{triggerLabel:`Mixed`}:{},getModelDisabledReason:ve,...b?{onOpenProviderSetup:e=>{o({to:`/settings/providers`,search:{environmentId:b,instanceId:e}})}}:{},onInstanceModelChange:(e,t)=>{let n=ve(e,t);n?xe.add({type:`error`,title:`Text generation model not saved`,description:n}):a({textGenerationModelSelection:d({...i,textGenerationModelSelection:j(e,t)},ee)})}}),ce?(0,$.jsx)(D,{provider:ue,models:ce?.models??[],model:ie,modelOptions:ae,allowPromptInjectedEffort:!1,planModeEnabled:i.planModeEnabled||y(ae),triggerClassName:En,onModelOptionsChange:e=>{a({textGenerationModelSelection:d({...i,textGenerationModelSelection:j(re,ie,e)},ee)})}}):null]}):(0,$.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):(0,$.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its text generation model.`}),oa;e[452]!==ta||e[453]!==na||e[454]!==ra||e[455]!==ia||e[456]!==aa?(oa=(0,$.jsx)(ta,{serverScoped:!0,settingKeys:na,...ra,description:`Used for thread titles and other generated text on connected devices with this provider. Source control can override it.`,resetAction:ia,control:aa}),e[452]=ta,e[453]=na,e[454]=ra,e[455]=ia,e[456]=aa,e[457]=oa):oa=e[457];let sa;e[458]!==ea||e[459]!==oa?(sa=(0,$.jsx)(ea,{id:`text-generation`,title:`Text generation`,children:oa}),e[458]=ea,e[459]=oa,e[460]=sa):sa=e[460];let ca;e[461]===Symbol.for(`react.memo_cache_sentinel`)?(ca=Mt||le?(0,$.jsx)(Wo,{}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J,{id:X(`app-version`).id,title:(0,$.jsx)(Pr,{}),description:`Current version of the application.`}),Nn?(0,$.jsx)(Vn,{}):null]}),e[461]=ca):ca=e[461];let la;e[462]===Symbol.for(`react.memo_cache_sentinel`)?(la=X(`privacy-policy`),e[462]=la):la=e[462];let ua;e[463]===Symbol.for(`react.memo_cache_sentinel`)?(ua=(0,$.jsxs)(Dn,{id:`about`,title:`About`,children:[ca,(0,$.jsx)(J,{...la,description:`How we handle your data, including the anonymous usage data P4 Code collects.`,control:(0,$.jsx)(P,{render:(0,$.jsx)(`a`,{href:mr,target:`_blank`,rel:`noreferrer noopener`}),size:`sm`,variant:`outline`,children:`View policy`})})]}),e[463]=ua):ua=e[463];let da;e[464]===Symbol.for(`react.memo_cache_sentinel`)?(da=X(`diagnostics`),e[464]=da):da=e[464];let fa=S?`Inspect processes, resource use, and logs on this environment.`:`Inspect processes, resource use, and logs on one environment at a time.`,pa=b??void 0,ma;e[465]===pa?ma=e[466]:(ma=(0,$.jsx)(P,{render:(0,$.jsx)(ye,{to:`/settings/diagnostics`,search:{machine:pa}}),size:`sm`,variant:`outline`,children:`View diagnostics`}),e[465]=pa,e[466]=ma);let ha;e[467]!==fa||e[468]!==ma?(ha=(0,$.jsx)(J,{...da,description:fa,control:ma}),e[467]=fa,e[468]=ma,e[469]=ha):ha=e[469];let ga;e[470]===Symbol.for(`react.memo_cache_sentinel`)?(ga=X(`open-source-licenses`),e[470]=ga):ga=e[470];let _a;e[471]===Symbol.for(`react.memo_cache_sentinel`)?(_a=(0,$.jsx)(J,{...ga,description:`Notices for dependencies, assets, and optional tools used by P4 Code.`,control:(0,$.jsx)(P,{render:(0,$.jsx)(ye,{to:`/settings/open-source-licenses`}),size:`sm`,variant:`outline`,children:`View licenses`})}),e[471]=_a):_a=e[471];let va;e[472]===ha?va=e[473]:(va=(0,$.jsxs)(Dn,{title:`Diagnostics`,children:[ha,_a]}),e[472]=ha,e[473]=va);let ya;e[474]===Symbol.for(`react.memo_cache_sentinel`)?(ya=(0,$.jsx)(cs,{}),e[474]=ya):ya=e[474];let ba;return e[475]!==Le||e[476]!==Re||e[477]!==bi||e[478]!==Ii||e[479]!==$i||e[480]!==sa||e[481]!==va||e[482]!==Tt?(ba=(0,$.jsxs)(Le,{children:[Re,Tt,bi,Ii,$i,sa,ua,va,ya]}),e[475]=Le,e[476]=Re,e[477]=bi,e[478]=Ii,e[479]=$i,e[480]=sa,e[481]=va,e[482]=Tt,e[483]=ba):ba=e[483],ba}function us(e){let[t,n]=e;return(0,$.jsx)(K,{hideIndicator:!0,value:t,children:n},t)}function ds(e){return e===null?`Mixed`:Lo[e]}function fs(e){return e===null?`Mixed`:Do[e]}function ps(e){return(0,$.jsx)(K,{value:e,children:e===`off`?`Off`:e.charAt(0).toUpperCase()+e.slice(1)},e)}function ms(e){return e===null?`Mixed`:e===`off`?`Off`:e.charAt(0).toUpperCase()+e.slice(1)}function hs(e){return e===null?`Mixed`:W.find(t=>t.value===e)?.label}function gs(e){return(0,$.jsx)(K,{hideIndicator:!0,value:e,children:ko[e]},e)}function _s(e){return e.enabled&&e.isAvailable}function vs(e){return e.supportsTextGeneration!==!1}function ys(e){return e.serverConfig?.environment.capabilities.threadRestartContinuation===!0}export{To as i,ls as n,Go as r,qo as t};
46
- //# sourceMappingURL=SettingsPanels-Ci2h30Aw.js.map
46
+ //# sourceMappingURL=SettingsPanels-Bk_YhHLm.js.map