@p4code/cli 0.9.7 → 0.9.9

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 (298) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-BDhIHi_h.mjs → binCli-CQsXscQ2.mjs} +1318 -1718
  3. package/dist/client/.vite/manifest.json +2020 -2003
  4. package/dist/client/assets/{2NI2N5EU-sFO2CLlt.js → 2NI2N5EU-aTesTRUs.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-CcT8Zfhc.js → 4UO7MD6I-fOcXoLqw.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-Bd_wcJLx.js → 5B3SVYGG-CVlBycCk.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-Cp0eFbVE.js → 5GK6JWQ2-UdJh1ROk.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-Czpp-hnK.js → 5N7A7DKN-LpXLPis9.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-C6OEDFC6.js → 5OC2THR4-pX1yQcrA.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-DUo-T0Pv.js → 5S6HY5KT-CTBX-e9M.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-ZY7dYS3y.js → 6IMQ5BUJ-DL11cDPG.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-KMXuFNsu.js → 6OLKWJ4F-TXqcGdqI.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-aJ6kvSey.js → 74OO7NKP-DNrMi93b.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-DIHv8J29.js → 75O6YZUN-CwCbVMzG.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-JuMUaReb.js → 77XECAW3-BuuKvNS0.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-2Yn9PEzm.js → ABYRPUBD-BxNthVYO.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-BDlDnUeW.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-Cd_V66Dq.js → AnimatedHeight-Baj5Pa60.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-z6JhHCp1.js → AuthSurfaceShell-DCBmguf9.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-D5xDmPxh.js → BB2UYUI2-Bg3EJQg5.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-B9FvXzqk.js → BUM34MOA-CgVaLfn6.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-Dx_FGvDv.js → CEQABKGZ-BpDmef7u.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-DGpvh6KQ.js → CXAC5362-uHOdbo6J.js} +2 -2
  24. package/dist/client/assets/{ChatGptUsageButton-hgahwAd8.js → ChatGptUsageButton-CcLiWo0d.js} +2 -2
  25. package/dist/client/assets/{ChatMarkdown-DzBQ6o2z.js → ChatMarkdown-DQk9NI7y.js} +9 -9
  26. package/dist/client/assets/{CheckboxIndicator-mFuXoA30.js → CheckboxIndicator-CvUY7aCo.js} +2 -2
  27. package/dist/client/assets/{ClippedText-3QYVxO0t.js → ClippedText-Bz4usJaN.js} +2 -2
  28. package/dist/client/assets/{CodexSetupSection.logic-BBoRdk5p.js → CodexSetupSection.logic-fnotucae.js} +2 -2
  29. package/dist/client/assets/{ComboboxClear-BNtFgSHF.js → ComboboxClear-BWxvz8Y9.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-sq7Mhle4.js → ComboboxGroupLabel-B9uepPCe.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-DHXlU5C7.js → CommandBlock-ConSzQ7T.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-qOyyjScc.js → ComposerPromptEditor-Dh9Y0crA.js} +10 -10
  33. package/dist/client/assets/{CompositeRoot-DY7iUA_s.js → CompositeRoot-XnJ7Nzli.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-xhfXplsX.js → ConnectionDiagnosisDetails-DIM-B35q.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-BBmbajLh.js → ConnectionStatusDot-CpPwqzkK.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-v1NbOvdX.js → DRLTVNUE-9tvJLXhF.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-Dgv-rkDR.js → DYY6UVD2-CXR9o7Qv.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-Cyg1Yk9F.js → DevicePanel-Oy_RHjOo.js} +2 -2
  39. package/dist/client/assets/DeviceSetup-ct6xlJYm.js +2 -0
  40. package/dist/client/assets/{DialogTitle-9BKGozK3.js → DialogTitle-DdTujj5B.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-shKWlLXb.js → DiffCommentAnnotation-C-L5yt6X.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-Cw3IoBPF.js → DiffFileTree-C5oMLRG9.js} +2 -2
  43. package/dist/client/assets/{DiffPanel-DhYILwt4.js → DiffPanel-CE2e4NYA.js} +2 -2
  44. package/dist/client/assets/{DiffWorkerPoolProvider-DwAxcJ_J.js → DiffWorkerPoolProvider-K9JsvPrH.js} +2 -2
  45. package/dist/client/assets/{EmbeddedDesign-BwBy_4w8.js → EmbeddedDesign-xOusO8oo.js} +5 -5
  46. package/dist/client/assets/{EnvironmentMachineIcon-KqncPHh8.js → EnvironmentMachineIcon-BrGxJPP_.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-CEDcsLah.js → ExpandableText-auxbX5_6.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-D_GK0hHx.js → FNOVOB4O-BmZ9pVZx.js} +2 -2
  49. package/dist/client/assets/{FieldControl-CVCCrg1T.js → FieldControl-DfaF5AW8.js} +2 -2
  50. package/dist/client/assets/{FileDiff-CkTyrHs_.js → FileDiff-BTNP8QcY.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-pD3XdWFT.js → FilePreviewPanel-m6c5KXjS.js} +5 -5
  52. package/dist/client/assets/{FoldedSettingsSection-VcaJg5wH.js → FoldedSettingsSection-BTB3Pbv2.js} +2 -2
  53. package/dist/client/assets/{FormContext-CbLQYizu.js → FormContext-B_ZMFN7l.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-B_87CdVQ.js → HDGCDEEZ-JiOhjq7U.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-BWrZ2oua.js → HSJLKHB7-Bd0iumEG.js} +2 -2
  56. package/dist/client/assets/{Icons-CQY6Z_tn.js → Icons-BP6jlahF.js} +2 -2
  57. package/dist/client/assets/Input-B9nob0l2.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-0AVwCd1G.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-Dl_xvRh8.js → K3MD6TGW-B2s2l_Ok.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-CMEWK15T.js → K7RP3OMA-DEvHDTPu.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-6SIFjdPx.js → KeybindingsSettings.logic-CkmobJKX.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-BYodQH-L.js → LHDIQX7Q-D06sm2YF.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-qRQxfpo6.js → LUXOKEGN-A74rm75g.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-DEu7ewh2.js → MathTypeset-Vm1FBYDj.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-D39dZXbh.js → N3JZAHOW-BCbSRiUS.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-DesFcM7Z.js → NUIALGQ3-DmGUeCU6.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-DR2kWrZ4.js → NoProjectsHero-BBiWXq8t.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-xGzNLFO_.js → O65XPQGZ-859wHUVg.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-D_A5CSzR.js → O7XIQ6OM-BSsC7pLO.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-wUDkF0Vl.js → OFQON5FD-BjECyhxL.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-CCDq5J6P.js → P4ConnectAccountPages-Cqk-Frva.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-CX9WTYV1.js → P4ConnectSidebarSignIn-wL7BP9rR.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-CDUmALBZ.js → PJQHF43J-CuSzd3x-.js} +2 -2
  74. package/dist/client/assets/PanelLayoutControls-DXgwWyzK.js +216 -0
  75. package/dist/client/assets/{PierreEntryIcon-Cuq8Bvxz.js → PierreEntryIcon-CDSrlZTw.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-CaIeAISC.js → PopoverHandle-Bf0PlJ6j.js} +2 -2
  77. package/dist/client/assets/PreviewPanel-B7EzPl1x.js +2 -0
  78. package/dist/client/assets/{ProjectDefaultsSettings-Bxz5MdOY.js → ProjectDefaultsSettings-BRi9-O_X.js} +2 -2
  79. package/dist/client/assets/{ProjectFavicon-DCKipqYA.js → ProjectFavicon-Cf1XjP8U.js} +3 -3
  80. package/dist/client/assets/{ProjectIconPickerDialog-DqEEBoMA.js → ProjectIconPickerDialog-DSRXK7Zv.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-CjI4Va2u.js → ProjectMonogram-BJooqIM-.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-UctA57cb.js → ProviderAuthTerminal-8VrYkUNI.js} +2 -2
  83. package/dist/client/assets/{ProviderModelPicker-QRPUsruj.js → ProviderModelPicker-mxdF5wUN.js} +2 -2
  84. package/dist/client/assets/{ProviderSettingsForm-BEq2pSXW.js → ProviderSettingsForm-ByFYLn1K.js} +2 -2
  85. package/dist/client/assets/{PullRequestCodeTab-DQDQ2-AY.js → PullRequestCodeTab-DCUJxgcQ.js} +3 -3
  86. package/dist/client/assets/{RHNBAITX-C7xWa0v8.js → RHNBAITX-Z04dR_uf.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-BzoQdNnt.js → ReadOnlySourcePreview-CiVudVcz.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-BQJlFG3C.js → RenderErrorBoundary-C8jlNO8Q.js} +3 -3
  89. package/dist/client/assets/{SLD4V6NK-DmuNvRiU.js → SLD4V6NK-CTh_lt_F.js} +2 -2
  90. package/dist/client/assets/{ScheduledTasksSettings-BslOTNM_.js → ScheduledTasksSettings-DfwR9Auj.js} +4 -4
  91. package/dist/client/assets/{ScopedSwitch-B93s5VHZ.js → ScopedSwitch-6K10bTo0.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-Dhc-TjWb.js → ScrollAreaCorner-Bstf_gNQ.js} +2 -2
  93. package/dist/client/assets/{SecretInput-B2ihrOsq.js → SecretInput-BTBcl8SC.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-krk2Fk-_.js → SelectScrollUpArrow-BAwxXUi-.js} +2 -2
  95. package/dist/client/assets/SelfImproveSettingsSection-DwtwZ9He.js +2 -0
  96. package/dist/client/assets/SettingsPanels-BnfeCIPg.js +46 -0
  97. package/dist/client/assets/{SettingsPanels.logic-Bl4RFuAy.js → SettingsPanels.logic-BM52qF-a.js} +2 -2
  98. package/dist/client/assets/{SettingsScopeNotice-LfKqlEQx.js → SettingsScopeNotice-CPP-_wXt.js} +2 -2
  99. package/dist/client/assets/{SidebarStageBackdrop-6e7hvpNA.js → SidebarStageBackdrop-ClK_nT_C.js} +2 -2
  100. package/dist/client/assets/{T3PCR2KE-CiK8lMNJ.js → T3PCR2KE-O2OwSAZh.js} +2 -2
  101. package/dist/client/assets/{TKWO2OVW-BdJsjYHm.js → TKWO2OVW-BxZ4r_GJ.js} +2 -2
  102. package/dist/client/assets/{TSHNXIZL-CRJjDWez.js → TSHNXIZL-6843lSfx.js} +2 -2
  103. package/dist/client/assets/{ThemeEditorPanel-D8zwe2Nv.js → ThemeEditorPanel-B_Mpp-fO.js} +2 -2
  104. package/dist/client/assets/{ThreadTerminalDrawer-Dscicgos.js → ThreadTerminalDrawer-3sb2Ksna.js} +4 -4
  105. package/dist/client/assets/{TooltipViewport-MMBPNW3u.js → TooltipViewport-CEOeTVyb.js} +2 -2
  106. package/dist/client/assets/{UQJE5E4I-V8ZBwQ4s.js → UQJE5E4I-DIek-a8V.js} +2 -2
  107. package/dist/client/assets/{USNYFO5S-B5nY9-j7.js → USNYFO5S-l_vgf0I4.js} +2 -2
  108. package/dist/client/assets/{Virtualizer-CzVPu6W0.js → Virtualizer-CttujTBW.js} +2 -2
  109. package/dist/client/assets/{WEVWDWVA-roZxnVYX.js → WEVWDWVA-DASU9Cts.js} +2 -2
  110. package/dist/client/assets/{WorkspaceBreadcrumb-DHwNjJoP.js → WorkspaceBreadcrumb-CQH9TmFi.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageContainer-BEL6F4GP.js → WorkspacePageContainer-E5ZuTsSl.js} +2 -2
  112. package/dist/client/assets/{WorkspacePageHeader-eTadd7tx.js → WorkspacePageHeader-DGopnQZ2.js} +2 -2
  113. package/dist/client/assets/{X5RFHQXM-3waZyk5u.js → X5RFHQXM-B52DJ-qb.js} +2 -2
  114. package/dist/client/assets/{X62E3GBT-B2f7sUz7.js → X62E3GBT-Ccgsn5Dj.js} +2 -2
  115. package/dist/client/assets/{XBNEOJTC-C4ImOubv.js → XBNEOJTC-BRptYPNn.js} +2 -2
  116. package/dist/client/assets/{YHV2MVVZ-D1HZySVT.js → YHV2MVVZ-D_wcLZ-W.js} +2 -2
  117. package/dist/client/assets/{YURCZMG2-B95ZHwnq.js → YURCZMG2-DP6lArrr.js} +2 -2
  118. package/dist/client/assets/{YVG2LODB-Ba9ElJXR.js → YVG2LODB-CgFYuKDa.js} +2 -2
  119. package/dist/client/assets/_chat-Vh73A6rC.js +45 -0
  120. package/dist/client/assets/_chat.design-_0R3HMjq.js +2 -0
  121. package/dist/client/assets/_chat.index-DhmrbSHU.js +2 -0
  122. package/dist/client/assets/_chat.new-Byb4mhMY.js +4 -0
  123. package/dist/client/assets/_chat.pull-requests-BNzVcYEB.js +2 -0
  124. package/dist/client/assets/{alert-BeaSxmEt.js → alert-CqueYfb9.js} +2 -2
  125. package/dist/client/assets/{assetUrls-DSRw9lrZ.js → assetUrls-d3y14MLX.js} +2 -2
  126. package/dist/client/assets/{assets-DhuueFtK.js → assets-FbkZMhUb.js} +2 -2
  127. package/dist/client/assets/{browserHistoryStore-Cb-pQxvb.js → browserHistoryStore-CjWZgU2Q.js} +2 -2
  128. package/dist/client/assets/{browserLinkTarget-DnEgq1JN.js → browserLinkTarget-IsSd9GTV.js} +2 -2
  129. package/dist/client/assets/{checkbox-BwnKO_BU.js → checkbox-BPr09F_k.js} +2 -2
  130. package/dist/client/assets/{color-picker-D8AK_9SM.js → color-picker-roKqOkuS.js} +2 -2
  131. package/dist/client/assets/{combobox-CXEo8oot.js → combobox-CEzOq8mg.js} +2 -2
  132. package/dist/client/assets/{command-BAykm7lf.js → command-i_eKJj3B.js} +2 -2
  133. package/dist/client/assets/{connect-DsnzdYd-.js → connect-DyZ-pjcy.js} +2 -2
  134. package/dist/client/assets/{connect-agent-BHUM9uJ5.js → connect-agent-dJ-CRJsT.js} +2 -2
  135. package/dist/client/assets/{design-BugojS6P.js → design-CXl7HVrT.js} +2 -2
  136. package/dist/client/assets/{device-CH53vde0.js → device-MyE56wi2.js} +2 -2
  137. package/dist/client/assets/{dialog-CsGXTrQp.js → dialog-CKG1aUT3.js} +2 -2
  138. package/dist/client/assets/{diffRendering-WBaaL1Hw.js → diffRendering-COA7wG72.js} +2 -2
  139. package/dist/client/assets/{dist-CEhsFKQt.js → dist-CYq41icZ.js} +3 -3
  140. package/dist/client/assets/{draft-input-DSO1M98X.js → draft-input-DvNQZghL.js} +2 -2
  141. package/dist/client/assets/{duoViewer-DWTF6ZzH.js → duoViewer-CjvM1rB0.js} +2 -2
  142. package/dist/client/assets/{dynamic-cm3g4l5C.js → dynamic-BZ3kW5ih.js} +2 -2
  143. package/dist/client/assets/{embeddedScripts-CCEJSzbY.js → embeddedScripts-BLmMNkyP.js} +2 -2
  144. package/dist/client/assets/{empty-D39LEkAH.js → empty-D6SdnsPw.js} +2 -2
  145. package/dist/client/assets/{entities-BjGK6yEY.js → entities-D8ZKPC2e.js} +2 -2
  146. package/dist/client/assets/{fileLinks-BGiaZuCI.js → fileLinks-CNAL-7G6.js} +2 -2
  147. package/dist/client/assets/{fileTreeExpansion-B5-rhZPf.js → fileTreeExpansion-B_6v-e30.js} +2 -2
  148. package/dist/client/assets/{getDiffFileInput-BVsGumGL.js → getDiffFileInput-DovUC0XJ.js} +2 -2
  149. package/dist/client/assets/{guideRunStore-CIC0I9tc.js → guideRunStore-7uPQQ44U.js} +2 -2
  150. package/dist/client/assets/{htmlRender-CuZDEfr_.js → htmlRender-hlYiIm7u.js} +2 -2
  151. package/dist/client/assets/{index-DFvDwgHR.js → index-DD6u-vDm.js} +3 -3
  152. package/dist/client/assets/{input-group-ZnG52HFh.js → input-group-APyqVexM.js} +2 -2
  153. package/dist/client/assets/{input-DTnuNfU_.js → input-yNgBXsRj.js} +2 -2
  154. package/dist/client/assets/{kbd-NONAAU_c.js → kbd-Cr4XEhSh.js} +2 -2
  155. package/dist/client/assets/keybindings-hzk4_Sgu.js +2 -0
  156. package/dist/client/assets/{lazy-BGLv0LoM.js → lazy-CXsQYM2D.js} +4 -4
  157. package/dist/client/assets/{lazyRouteComponent-D02c00C-.js → lazyRouteComponent-tnhWsSYX.js} +2 -2
  158. package/dist/client/assets/{link-oQzJ7nu3.js → link-CmpZDWcG.js} +2 -2
  159. package/dist/client/assets/{linkedPrompt-C_XIR4Xr.js → linkedPrompt-DgAytF6c.js} +2 -2
  160. package/dist/client/assets/{main-DsXJbQH-.css → main-B-tAk2zT.css} +1 -1
  161. package/dist/client/assets/main-CNcsYwUg.js +37 -0
  162. package/dist/client/assets/{mediaReference-DKoeCSSJ.js → mediaReference-DNNV5BY5.js} +2 -2
  163. package/dist/client/assets/{mediaSource-CENz-NYA.js → mediaSource-DI8dP4uu.js} +2 -2
  164. package/dist/client/assets/{number-field-D1mdZQVp.js → number-field-DcRWl9B0.js} +2 -2
  165. package/dist/client/assets/{observeResize-BNf0FASw.js → observeResize-DjqKtKLK.js} +2 -2
  166. package/dist/client/assets/{onboarding-B-b2hpCr.js → onboarding-CyFz37eL.js} +2 -2
  167. package/dist/client/assets/{openFileInPreview-CLTNM-qs.js → openFileInPreview-rYwhIeVk.js} +2 -2
  168. package/dist/client/assets/{p4ProjectFile-BQUacEue.js → p4ProjectFile-CT0gLoXX.js} +2 -2
  169. package/dist/client/assets/{pair-DTrJC971.js → pair-BOq1UYDI.js} +2 -2
  170. package/dist/client/assets/{pendingSendStore-BsAQrtOv.js → pendingSendStore-BoFRcmy5.js} +2 -2
  171. package/dist/client/assets/{phoneViewer-D64KFma1.js → phoneViewer-BtDABBh2.js} +2 -2
  172. package/dist/client/assets/{pierre-icons-CtTUePAY.js → pierre-icons-LoH9zCdH.js} +2 -2
  173. package/dist/client/assets/{popover-Cr0R7gdF.js → popover-DVeZET9D.js} +2 -2
  174. package/dist/client/assets/{preview-C1PD_g9k.js → preview-D9IkIo7q.js} +2 -2
  175. package/dist/client/assets/{preview-BuuE-gMP.js → preview-oweHYD4S.js} +2 -2
  176. package/dist/client/assets/{previewMiniPlayerStore-v5xBLM6_.js → previewMiniPlayerStore-DrP4x3Ce.js} +2 -2
  177. package/dist/client/assets/primary-DXTkE8Z6.js +2 -0
  178. package/dist/client/assets/primaryCloudLinkState-CZVS0Wwo.js +2 -0
  179. package/dist/client/assets/{projectFilesQueryState-CZkTtV37.js → projectFilesQueryState-Cl_MU7SH.js} +2 -2
  180. package/dist/client/assets/projectScriptEditor-CfiaAaXj.js +2 -0
  181. package/dist/client/assets/{providerSkills-CK0_chtE.js → providerSkills-CCJGD2Js.js} +2 -2
  182. package/dist/client/assets/{pullRequestDetail.logic-BmPSn0PA.js → pullRequestDetail.logic-4EhxvJSo.js} +2 -2
  183. package/dist/client/assets/{pullRequestIcons-CfKXhDuO.js → pullRequestIcons-DyEIFm1n.js} +2 -2
  184. package/dist/client/assets/{pullRequestReviewStore-CrDUhUKX.js → pullRequestReviewStore-B55CEHY9.js} +2 -2
  185. package/dist/client/assets/{pullRequests-D-lKKR28.js → pullRequests-DRm4lwgc.js} +2 -2
  186. package/dist/client/assets/{queries-CEdylITb.js → queries-BGbR-fUx.js} +2 -2
  187. package/dist/client/assets/{query-DM1uxcKV.js → query-D-IVadFI.js} +2 -2
  188. package/dist/client/assets/{radio-group-CkR7fabD.js → radio-group-DIOJb--u.js} +2 -2
  189. package/dist/client/assets/{renderScheduler-BJowI8SS.js → renderScheduler-3p9xZuHR.js} +2 -2
  190. package/dist/client/assets/{rightPanelStore-DUtuG_mq.js → rightPanelStore-CRQRe1Cp.js} +2 -2
  191. package/dist/client/assets/runtime-CdX0UBlL.js +3 -0
  192. package/dist/client/assets/runtime-S0tnrkvE.js +6 -0
  193. package/dist/client/assets/{runtimeModeConfig-CZ3ZrCmY.js → runtimeModeConfig-BAFMgMrE.js} +2 -2
  194. package/dist/client/assets/{scheduledTasksSettings.logic-YVexB6ub.js → scheduledTasksSettings.logic-CrhQwOvr.js} +3 -3
  195. package/dist/client/assets/{scroll-area-D1ITiKsD.js → scroll-area-DTOm0CbX.js} +2 -2
  196. package/dist/client/assets/{select-CT4O76xq.js → select-CML8G0wN.js} +2 -2
  197. package/dist/client/assets/{selfImproveFindings-wLxnhAIe.js → selfImproveFindings-DuRaHmql.js} +2 -2
  198. package/dist/client/assets/{server-BRIc5okw.js → server-ELSEsqtb.js} +2 -2
  199. package/dist/client/assets/{session-wmJod3Hf.js → session-DCntd6Nl.js} +2 -2
  200. package/dist/client/assets/{session-logic-BiU6P8DR.js → session-logic-CbKDK1qZ.js} +5 -5
  201. package/dist/client/assets/settings-CbkRsZQ6.js +2 -0
  202. package/dist/client/assets/{settings.appearance-CJCZI-Xj.js → settings.appearance-BGbKeD2q.js} +2 -2
  203. package/dist/client/assets/settings.archived-DNDOvbYT.js +2 -0
  204. package/dist/client/assets/{settings.computer-use-CijjzsIQ.js → settings.computer-use-Cl0y_o-b.js} +2 -2
  205. package/dist/client/assets/settings.connections-xy7hhFa0.js +2 -0
  206. package/dist/client/assets/{settings.data-controls-DkLkW74X.js → settings.data-controls-Boy0foov.js} +2 -2
  207. package/dist/client/assets/settings.decisions-DUCJDJZC.js +2 -0
  208. package/dist/client/assets/{settings.designs-DS1WBGjv.js → settings.designs-DYuankA7.js} +2 -2
  209. package/dist/client/assets/settings.diagnostics-DgYvj0_x.js +2 -0
  210. package/dist/client/assets/{settings.general-BWHDfXfO.js → settings.general-CrvvO6VU.js} +2 -2
  211. package/dist/client/assets/settings.integrations-Do9x2dXf.js +2 -0
  212. package/dist/client/assets/{settings.keybindings-tc_MLaPn.js → settings.keybindings-Q_21VUQP.js} +2 -2
  213. package/dist/client/assets/{settings.open-source-licenses-ucPvq0ML.js → settings.open-source-licenses-Cnz72Gu0.js} +2 -2
  214. package/dist/client/assets/settings.plugins-C9-DUFnM.js +5 -0
  215. package/dist/client/assets/settings.projects-BKMazKl9.js +4 -0
  216. package/dist/client/assets/settings.providers-ouat2Ci1.js +3 -0
  217. package/dist/client/assets/{settings.scheduled-tasks-BTioGx2i.js → settings.scheduled-tasks-DOmtQjNH.js} +2 -2
  218. package/dist/client/assets/settings.snap-shot-609BnJ2S.js +2 -0
  219. package/dist/client/assets/settings.source-control-D1LmFmrq.js +2 -0
  220. package/dist/client/assets/settings.storage-CXdZfPhF.js +2 -0
  221. package/dist/client/assets/settingsLayout-aLGl3ZXu.js +3 -0
  222. package/dist/client/assets/{sidebar-DRWJdn3r.js → sidebar-DMJE0zUg.js} +2 -2
  223. package/dist/client/assets/{sidebarProjectGrouping-BRZt_Xqk.js → sidebarProjectGrouping-BAN1mSDk.js} +2 -2
  224. package/dist/client/assets/{skeleton-DOfA4sjN.js → skeleton-eiJFH0l9.js} +2 -2
  225. package/dist/client/assets/{sourceControl-CKZL-8Mu.js → sourceControl-ChrSdv6h.js} +2 -2
  226. package/dist/client/assets/{sourceControlClients-D-frc1l_.js → sourceControlClients-BDwX0klQ.js} +2 -2
  227. package/dist/client/assets/{spinner-DMCmqCAh.js → spinner-H4tz4lLc.js} +2 -2
  228. package/dist/client/assets/{terminal-links-Cdw7HYhQ.js → terminal-links-D7Hzce_h.js} +2 -2
  229. package/dist/client/assets/{terminalSessions-DGp0Zt7-.js → terminalSessions-DdR_bXtX.js} +2 -2
  230. package/dist/client/assets/{textarea-B2ogIlGU.js → textarea-CkmpNgx5.js} +2 -2
  231. package/dist/client/assets/{themePalette-CiLEjm0l.js → themePalette-pZ7Ys_kT.js} +2 -2
  232. package/dist/client/assets/toast-BNQWmVQ-.js +2 -0
  233. package/dist/client/assets/{toggle-BrZqohX5.js → toggle-BDixfqRe.js} +2 -2
  234. package/dist/client/assets/{toggle-group-DpO88ac2.js → toggle-group-DV__8G6T.js} +2 -2
  235. package/dist/client/assets/{tooltip-QdplMyeY.js → tooltip-DsRaXpYk.js} +2 -2
  236. package/dist/client/assets/{uiStateStore-vt_JyvTj.js → uiStateStore-Bo1Umjei.js} +2 -2
  237. package/dist/client/assets/{usage-CHD3cyvN.js → usage-BPmOvYDv.js} +2 -2
  238. package/dist/client/assets/{usageAccess-DVnjHuB7.js → usageAccess-BXUmTDe1.js} +2 -2
  239. package/dist/client/assets/{usageFormat-tjRl8Hbq.js → usageFormat-xrTYBhxI.js} +2 -2
  240. package/dist/client/assets/{usageShortcuts-DMKWst47.js → usageShortcuts-CQcKqXkw.js} +2 -2
  241. package/dist/client/assets/{use-atom-command-BfhNaUIU.js → use-atom-command-REOTdDAa.js} +2 -2
  242. package/dist/client/assets/{useAriaLabelledBy-BlIdXeWO.js → useAriaLabelledBy-DVTboZ71.js} +2 -2
  243. package/dist/client/assets/useHandleNewThread-DYBNXS8y.js +2 -0
  244. package/dist/client/assets/{useLocation-jsSq4KCV.js → useLocation--dLSTvwv.js} +2 -2
  245. package/dist/client/assets/{useNavigate-ut7tie8O.js → useNavigate-DAhzXpNZ.js} +2 -2
  246. package/dist/client/assets/{useNavigateBack-DQAO81KK.js → useNavigateBack-ClmMPFha.js} +2 -2
  247. package/dist/client/assets/{useP4ConnectAuthPrompt-IuajGXvV.js → useP4ConnectAuthPrompt-CGiX3TE7.js} +2 -2
  248. package/dist/client/assets/{useParams-2ErCyxxB.js → useParams-D_0yPfYl.js} +2 -2
  249. package/dist/client/assets/{usePermissionStatus-BlueIAuh.js → usePermissionStatus-BGxDZxHH.js} +2 -2
  250. package/dist/client/assets/{usePullRequestActions-VZpGy8dq.js → usePullRequestActions-BOUPI3Y5.js} +2 -2
  251. package/dist/client/assets/{useRegisterFieldControl-BTyFUE5E.js → useRegisterFieldControl-DnspXZl4.js} +2 -2
  252. package/dist/client/assets/{useScopedModelAvailability-CH6hfrU_.js → useScopedModelAvailability-DD6NdaS0.js} +2 -2
  253. package/dist/client/assets/useSettings-BNjvPVd5.js +3 -0
  254. package/dist/client/assets/utils-D19Exirm.js +37 -0
  255. package/dist/client/assets/vcsRefInvalidation-BSyEzs8X.js +2 -0
  256. package/dist/client/assets/welcome-CJLDvQwx.js +2 -0
  257. package/dist/client/index.html +1 -1
  258. package/dist/{renderer-DKZZL6cd.mjs → renderer-DNRW9Bfa.mjs} +2 -2
  259. package/dist/{runtime-Bbjyj8bt.mjs → runtime-KPwu-Er9.mjs} +92 -40
  260. package/package.json +1 -1
  261. package/dist/client/assets/AlertDialogRoot-CW_9Mq9o.js +0 -2
  262. package/dist/client/assets/DeviceSetup-C2Zve35j.js +0 -2
  263. package/dist/client/assets/Input-Bple6iXe.js +0 -2
  264. package/dist/client/assets/JZOYTAAL-BMx5dMBx.js +0 -1
  265. package/dist/client/assets/PanelLayoutControls-C34I_7ba.js +0 -216
  266. package/dist/client/assets/PreviewPanel-CG-MeUjw.js +0 -2
  267. package/dist/client/assets/SettingsPanels-DxAtLrQJ.js +0 -46
  268. package/dist/client/assets/_chat-CAKiqq8Z.js +0 -45
  269. package/dist/client/assets/_chat.design-xDdLq2Pm.js +0 -2
  270. package/dist/client/assets/_chat.index-DZFF0AGm.js +0 -2
  271. package/dist/client/assets/_chat.new-UcQULkDl.js +0 -4
  272. package/dist/client/assets/_chat.pull-requests-wqTxTIsj.js +0 -2
  273. package/dist/client/assets/keybindings-CCgj9REF.js +0 -2
  274. package/dist/client/assets/main-BqFaDMNs.js +0 -37
  275. package/dist/client/assets/primary-BMTtrcja.js +0 -2
  276. package/dist/client/assets/primaryCloudLinkState-CJaRG6QK.js +0 -2
  277. package/dist/client/assets/projectScriptEditor-BApTdMa4.js +0 -2
  278. package/dist/client/assets/runtime-Du_4upLP.js +0 -6
  279. package/dist/client/assets/runtime-mXszmljC.js +0 -3
  280. package/dist/client/assets/settings-NLDl4Bmy.js +0 -2
  281. package/dist/client/assets/settings.archived-CLWZylu3.js +0 -2
  282. package/dist/client/assets/settings.connections-Cf7-ZN_h.js +0 -2
  283. package/dist/client/assets/settings.decisions-JeevVBZt.js +0 -2
  284. package/dist/client/assets/settings.diagnostics-lQ8O62tl.js +0 -2
  285. package/dist/client/assets/settings.integrations-DEdu9gwQ.js +0 -2
  286. package/dist/client/assets/settings.plugins-M2Rc23zw.js +0 -5
  287. package/dist/client/assets/settings.projects-tykSh6-D.js +0 -4
  288. package/dist/client/assets/settings.providers--RJFEbkT.js +0 -3
  289. package/dist/client/assets/settings.snap-shot-BUehYnKo.js +0 -2
  290. package/dist/client/assets/settings.source-control-Dxm6Jir5.js +0 -2
  291. package/dist/client/assets/settings.storage-CrdP11yD.js +0 -2
  292. package/dist/client/assets/settingsLayout-7rl00kQL.js +0 -3
  293. package/dist/client/assets/toast-NSvYVPhH.js +0 -2
  294. package/dist/client/assets/useHandleNewThread-Bv9hl6Vv.js +0 -2
  295. package/dist/client/assets/useSettings-FRbaNpbg.js +0 -3
  296. package/dist/client/assets/utils-CxCThU1r.js +0 -37
  297. package/dist/client/assets/vcsRefInvalidation-CiJ0pwCz.js +0 -2
  298. package/dist/client/assets/welcome-CBJlRbzG.js +0 -2
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{t as i}from"./cloud-BhcSs4Ie.js";import{t as a}from"./plus-B2sOrZDk.js";import{t as o}from"./x-C35beONT.js";import{$g as s,$n as c,$w as l,Ad as u,Ay as d,Ch as f,Cp as p,Dp as m,Hf as h,Jn as g,Lg as _,Mg as v,Ng as y,Qg as b,Qn as x,Tb as S,Th as C,Xg as w,Xp as T,Yn as E,Zn as D,ad as O,af as k,al as A,ar as j,cd as M,dr as N,e_ as P,fr as F,gh as I,ih as L,ky as R,l as ee,lE as te,mh as z,nT as B,ol as ne,ph as re,rv as V,t as H,tr as ie,ur as ae,wh as U,wp as oe,zg as se}from"./utils-CxCThU1r.js";import{W as ce}from"./runtime-Du_4upLP.js";import{T as le}from"./entities-BjGK6yEY.js";import{a as W,r as ue,t as G}from"./number-field-D1mdZQVp.js";import{a as K,c as de,i as fe,o as pe,r as me,s as he,t as ge}from"./select-CT4O76xq.js";import{t as _e}from"./spinner-DMCmqCAh.js";import{i as q}from"./toast-NSvYVPhH.js";import{E as ve,T as ye,b as J,c as be,o as xe,q as Se,r as Ce,s as Y}from"./useSettings-FRbaNpbg.js";import{f as we}from"./server-BRIc5okw.js";import{i as Te,n as Ee}from"./session-wmJod3Hf.js";import{t as De}from"./query-DM1uxcKV.js";import{t as Oe}from"./use-atom-command-BfhNaUIU.js";import{t as ke}from"./env-wK1YYxA8.js";import{a as Ae,n as je,t as Me}from"./tooltip-QdplMyeY.js";import{t as Ne}from"./input-DTnuNfU_.js";import{a as Pe,c as Fe,i as Ie,n as Le,o as Re,r as ze,s as Be,t as Ve}from"./dialog-CsGXTrQp.js";import{i as He,t as Ue}from"./device-CH53vde0.js";import{a as We,i as Ge,l as Ke,n as qe,o as Je,t as Ye,u as Xe}from"./DeviceSetup-C2Zve35j.js";import{t as Ze}from"./AnimatedHeight-Cd_V66Dq.js";import{i as Qe,n as $e}from"./Icons-CQY6Z_tn.js";import{t as et}from"./preview-C1PD_g9k.js";import{n as tt}from"./preview-BuuE-gMP.js";import{a as nt,i as rt,o as it,t as at}from"./popover-Cr0R7gdF.js";import{F as ot,R as st,V as ct,a as X,c as lt,i as ut,r as dt,s as ft,w as pt}from"./settingsLayout-7rl00kQL.js";import{Ba as mt,Gr as ht,Jr as gt,Kr as _t,Ma as vt,Na as yt,Xr as bt,Yr as xt,Zr as St,do as Ct,qr as wt,xo as Tt,yr as Et}from"./main-BqFaDMNs.js";import{t as Dt}from"./ProjectDefaultsSettings-Bxz5MdOY.js";import{t as Ot}from"./draft-input-DSO1M98X.js";import{t as kt}from"./ScopedSwitch-B93s5VHZ.js";import{t as At}from"./SecretInput-B2ihrOsq.js";import{n as jt,r as Mt,t as Nt}from"./usePermissionStatus-BlueIAuh.js";var Z=n(),Q=e(r(),1);function Pt(e){let t=(0,Z.c)(27),{tools:n,action:r,kind:i,owner:a,error:o}=e,s=i?n?.[i]:void 0,c;t[0]===s?c=t[1]:(c=s?.runningVersion??(s?.installedVersions.includes(s.requiredVersion)?s.requiredVersion:s?.installedVersions.toSorted(Ft).at(-1)),t[0]=s,t[1]=c);let l=c,u=i===`hub`?`Device hub`:`Agent device`,d=i?`${u}: ${l?`version ${l}`:s?`not installed`:`version unknown`}. Show details`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(F,{tone:`muted`}),t[2]=f):f=t[2];let p=i?l?`v${l}`:s?`Not installed`:`Version unknown`:o?`Versions unavailable`:`Versions`,m;t[3]!==d||t[4]!==p?(m=(0,Q.jsx)(it,{"aria-label":d,render:f,children:p}),t[3]=d,t[4]=p,t[5]=m):m=t[5];let h=i?u:`Device tools`,g;t[6]===h?g=t[7]:(g=(0,Q.jsx)(nt,{children:h}),t[6]=h,t[7]=g);let _;t[8]!==i||t[9]!==u||t[10]!==n?(_=n?(0,Q.jsx)(`div`,{className:`mt-4 divide-y divide-border/50`,children:[[`Device hub`,n.hub],[`Agent device`,n.agent]].filter(e=>{let[t]=e;return!i||t===u}).map(e=>{let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3 first:pt-0 last:pb-0`,children:[i?null:(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:t}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Running`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.runningVersion??`Not running`}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Required`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.requiredVersion}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Installed`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono break-words`,children:n.installedVersions.join(`, `)||`None`})]})]},t)})}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Versions have not been checked.`}),t[8]=i,t[9]=u,t[10]=n,t[11]=_):_=t[11];let v=a?`Managed by ${a}. `:``,y;t[12]===v?y=t[13]:(y=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[v,`Tools update automatically on this host when needed.`]}),t[12]=v,t[13]=y);let b;t[14]===o?b=t[15]:(b=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=b);let x;t[16]===r?x=t[17]:(x=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=x);let S;t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==g||t[22]!==_?(S=(0,Q.jsxs)(rt,{align:`end`,width:`md`,children:[g,_,y,b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=g,t[22]=_,t[23]=S):S=t[23];let C;return t[24]!==S||t[25]!==m?(C=(0,Q.jsxs)(at,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=C):C=t[26],C}function Ft(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function It(e,t,n,r=t){let i=(e,t)=>e.target===t.target&&e.port===t.port&&e.identityFile===t.identityFile,a=t=>{let n=e.filter(e=>i(e,t));if(n.length>1)throw Error(`Multiple hosts match this SSH destination. Select the environment to edit its hosts.`);return n[0]},o=e.find(e=>e.id===r.id)??a(r)??(n?void 0:a(t));return n?e.filter(e=>e.id!==o?.id):o?e.map(e=>e.id===o.id?{...t,id:o.id}:e):[...e,t]}function Lt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Rt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i}function Rt(e){return(0,Q.jsxs)(Me,{children:[(0,Q.jsxs)(Ae,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(u,{className:`size-3`}):(0,Q.jsx)(p,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(je,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var zt=S(d);function Bt(e){let{identityFile:t,...n}=e;return zt({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Vt(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function Ht(e,t,n,r){await Promise.all(e.map(async e=>{r(e.environmentId,{status:`pending`});try{if(!e.connected)throw Error(`Environment disconnected`);let i=await n(e.environmentId,t);r(e.environmentId,i.kind===`local`?{status:`local`}:{status:`connected`,platforms:i.platforms,...i.tools?{tools:i.tools}:{}})}catch(t){r(e.environmentId,{status:`failed`,error:t instanceof Error?t.message:String(t)})}}))}function Ut(e){let t=Oe(Ue.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let a=Vt(n);if(i.current.has(a))return;i.current.add(a),r(e=>({...e,[a]:{}}));let o={};try{return await Ht(e,n,async(e,n)=>{if(!Ee(e,`settings:write`))throw Error(`This connection cannot test device hosts.`);let r=await t({environmentId:e,input:n});if(r._tag===`Failure`)throw Error(l(r.cause));return r.value},(e,t)=>{o[e]=t,r(n=>({...n,[a]:{...n[a],[e]:t}}))}),o}finally{i.current.delete(a)}}}}function Wt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[c,l]=(0,$.useState)(n),{checks:d,testConnection:f}=Ut(i),p=d[Vt(c)],m=Object.values(p??{}).some(Kt),h,g;t[0]===c?(h=t[1],g=t[2]):(h=Bt({...c,label:c.label.trim()||c.target}),g=te(h),t[0]=c,t[1]=h,t[2]=g);let _=g,v;t[3]===p?v=t[4]:(v=Object.values(p??{}).filter(Gt),t[3]=p,t[4]=v);let y=v.length,b;t[5]!==a||t[6]!==s?(b=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=b):b=t[7];let x=!a,S;t[8]!==a||t[9]!==m||t[10]!==c.label||t[11]!==h||t[12]!==o?(S=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),te(h)&&c.label.trim()&&!a&&!m&&o(h.value)}}),t[8]=a,t[9]=m,t[10]=c.label,t[11]=h,t[12]=o,t[13]=S):S=t[13];let C=r?`Add device host`:`Edit device host`,w;t[14]===C?w=t[15]:(w=(0,Q.jsx)(Fe,{children:C}),t[14]=C,t[15]=w);let T=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,E;t[16]===T?E=t[17]:(E=(0,Q.jsxs)(ze,{children:[T,` `,`Hosts on the same machine are skipped.`]}),t[16]=T,t[17]=E);let D;t[18]!==w||t[19]!==E?(D=(0,Q.jsxs)(Pe,{children:[w,E]}),t[18]=w,t[19]=E,t[20]=D):D=t[20];let O;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=O):O=t[21];let k;t[22]===c?k=t[23]:(k=e=>l({...c,label:e.target.value}),t[22]=c,t[23]=k);let A;t[24]!==a||t[25]!==c.label||t[26]!==k?(A=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[O,(0,Q.jsx)(Ne,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:k,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=k,t[27]=A):A=t[27];let j;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=j):j=t[28];let M;t[29]===c?M=t[30]:(M=e=>l({...c,target:e.target.value}),t[29]=c,t[30]=M);let P;t[31]!==a||t[32]!==c.target||t[33]!==M?(P=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[j,(0,Q.jsx)(Ne,{required:!0,value:c.target,disabled:a,onChange:M,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=c.target,t[33]=M,t[34]=P):P=t[34];let F=n.port!==void 0||n.identityFile!==void 0||void 0,I;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=I):I=t[35];let R;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=R):R=t[36];let ee=c.identityFile??``,z;t[37]===c?z=t[38]:(z=e=>{let{identityFile:t,...n}=c;l(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=z);let B;t[39]!==a||t[40]!==ee||t[41]!==z?(B=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[R,(0,Q.jsx)(Ne,{value:ee,disabled:a,onChange:z,placeholder:`SSH config default`})]}),t[39]=a,t[40]=ee,t[41]=z,t[42]=B):B=t[42];let ne;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ne):ne=t[43];let re=c.port??``,V;t[44]===c?V=t[45]:(V=e=>{let{port:t,...n}=c;l(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=V);let H;t[46]!==a||t[47]!==re||t[48]!==V?(H=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ne,(0,Q.jsx)(Ne,{type:`number`,min:1,max:65535,value:re,disabled:a,onChange:V,placeholder:`Default`})]}),t[46]=a,t[47]=re,t[48]=V,t[49]=H):H=t[49];let ie;t[50]!==B||t[51]!==H?(ie=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[B,H]}),t[50]=B,t[51]=H,t[52]=ie):ie=t[52];let ae;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=ae):ae=t[53];let U;t[54]!==F||t[55]!==ie?(U=(0,Q.jsxs)(`details`,{open:F,className:`text-sm`,children:[I,ie,ae]}),t[54]=F,t[55]=ie,t[56]=U):U=t[56];let se=m?`Checking environments…`:p?y?`${y} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,ce;t[57]===se?ce=t[58]:(ce=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:se}),t[57]=se,t[58]=ce);let le=a||m||!_,W;t[59]!==h||t[60]!==f?(W=()=>{te(h)&&f(h.value)},t[59]=h,t[60]=f,t[61]=W):W=t[61];let ue;t[62]===m?ue=t[63]:(ue=m?(0,Q.jsx)(_e,{size:`xs`}):null,t[62]=m,t[63]=ue);let G;t[64]!==le||t[65]!==W||t[66]!==ue?(G=(0,Q.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:le,onClick:W,children:[ue,` Test connection`]}),t[64]=le,t[65]=W,t[66]=ue,t[67]=G):G=t[67];let K;t[68]!==ce||t[69]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[ce,G]}),t[68]=ce,t[69]=G,t[70]=K):K=t[70];let de;t[71]!==p||t[72]!==i?(de=p?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=p[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_e,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(oe,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(L,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(u,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(Lt,{platforms:t.platforms})}):null,t.status===`failed`?(0,Q.jsxs)(`details`,{className:`mt-1.5 text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show error`}),(0,Q.jsx)(`p`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words`,children:t.error})]}):null]},e.environmentId):null})}):null,t[71]=p,t[72]=i,t[73]=de):de=t[73];let fe;t[74]!==K||t[75]!==de?(fe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[K,de]}),t[74]=K,t[75]=de,t[76]=fe):fe=t[76];let pe;t[77]!==A||t[78]!==P||t[79]!==U||t[80]!==fe?(pe=(0,Q.jsxs)(Re,{children:[A,P,U,fe]}),t[77]=A,t[78]=P,t[79]=U,t[80]=fe,t[81]=pe):pe=t[81];let me;t[82]!==a||t[83]!==s?(me=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=me):me=t[84];let he;t[85]!==a||t[86]!==m||t[87]!==c.label||t[88]!==_?(he=a||m||!_||!c.label.trim(),t[85]=a,t[86]=m,t[87]=c.label,t[88]=_,t[89]=he):he=t[89];let ge;t[90]===a?ge=t[91]:(ge=a?(0,Q.jsx)(_e,{size:`xs`}):null,t[90]=a,t[91]=ge);let q;t[92]!==he||t[93]!==ge?(q=(0,Q.jsxs)(N,{type:`submit`,disabled:he,children:[ge,` Save host`]}),t[92]=he,t[93]=ge,t[94]=q):q=t[94];let ve;t[95]!==me||t[96]!==q?(ve=(0,Q.jsxs)(Ie,{children:[me,q]}),t[95]=me,t[96]=q,t[97]=ve):ve=t[97];let ye;t[98]!==D||t[99]!==pe||t[100]!==x||t[101]!==ve||t[102]!==S?(ye=(0,Q.jsxs)(Be,{showCloseButton:x,render:S,children:[D,pe,ve]}),t[98]=D,t[99]=pe,t[100]=x,t[101]=ve,t[102]=S,t[103]=ye):ye=t[103];let J;return t[104]!==b||t[105]!==ye?(J=(0,Q.jsx)(Ve,{open:!0,onOpenChange:b,children:ye}),t[104]=b,t[105]=ye,t[106]=J):J=t[106],J}function Gt(e){return e.status===`failed`}function Kt(e){return e.status===`pending`}function qt(e){let{scope:t,environments:n,connectedEnvironments:r}=ct(),i=Te(e.environmentId,V),a=t.kind===`project`||t.kind===`checkout`,o=Oe(we.updateSettings,{reportFailure:!1}),[s,c]=(0,$.useState)(null),[l,u]=(0,$.useState)(null),[d,f]=(0,$.useState)(!1),p=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:m,testConnection:h}=Ut(p),g=async(t,r=!1,i=t)=>{if(e.environmentId&&!a){f(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!Ee(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return o({environmentId:e.environmentId,input:{patch:{deviceHosts:It(e.serverConfig.settings.deviceHosts,t,r,i)}}})})),a=n.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?c(null):q.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{f(!1)}}};return(0,Q.jsx)(X,{id:`device-hosts`,title:`Device hosts`,serverScoped:!0,settingKeys:[`deviceHosts`],description:`Add remote machines with simulator or emulator runtimes installed, and the selected environments will connect over SSH and set up device tools automatically.`,control:(0,Q.jsxs)(N,{size:`sm`,variant:`outline`,disabled:!i||a||d||!e.environmentId||s!==null,onClick:()=>{u(null),c({kind:`ssh`,id:ee(),label:``,target:``})},children:[(0,Q.jsx)(T,{className:`size-3.5`}),` Add host`]}),children:(0,Q.jsx)(`div`,{className:`pt-3 pb-2`,children:e.environmentId?(0,Q.jsxs)(Q.Fragment,{children:[r.map(e=>(0,Q.jsxs)(`div`,{children:[r.length>1?(0,Q.jsx)(`p`,{className:`pt-3 pb-1 text-xs font-medium text-muted-foreground`,children:e.label}):null,(0,Q.jsx)(Jt,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!i||a||d,checks:m,testConnection:async e=>{let t=await h(e);if(!t)return;let n=p.filter(e=>t[e.environmentId]?.status===`failed`);return q.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${p.length} environments failed`:`${e.label}: connection checks passed`,description:n.length?`Could not connect from ${n.map(e=>e.label).join(`, `)}.`:`Connected or already available locally on each selected environment.`}),t},onEdit:e=>{u(e),c(e)},onRemove:e=>void g(e,!0)})]},e.environmentId)),s?(0,Q.jsx)(Wt,{host:s,isNew:l===null,targets:p,busy:d,onSave:e=>void g(e,!1,l??e),onClose:()=>c(null)},s.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Jt(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:o,onRemove:s,checks:l,testConnection:u}=e,{state:d}=He(r),f=Oe(Ue.list),[p,h]=(0,$.useState)(null),g;t[0]===i.length?g=t[1]:(g=i.length===0?(0,Q.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No device hosts.`}):null,t[0]=i.length,t[1]=g);let _;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==s||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==s||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Vt(e)]?.[r],g=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],_=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,v=i?.status===`failed`?i.error:i?.status===`local`?void 0:t?.status===`failed`?t.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/50 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.label}),g.filter(Xt).map(Yt)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(Pt,{owner:n,error:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,v?(0,Q.jsx)(`div`,{className:`mt-1`,role:`status`,children:(0,Q.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,Q.jsx)(`summary`,{children:`Connection failed`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:v})]})}):null]}),_?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(_e,{size:`xs`}),_]}):null,(0,Q.jsxs)(E,{children:[(0,Q.jsx)(ae,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(m,{})}),(0,Q.jsxs)(ie,{align:`end`,children:[(0,Q.jsx)(c,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(c,{variant:`destructive`,onClick:()=>s(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{h(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>h(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||_!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=o,t[19]=s,t[20]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],_=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=o,t[8]=s,t[9]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=_}else _=t[13];let v;return t[25]!==g||t[26]!==_?(v=(0,Q.jsxs)(Q.Fragment,{children:[g,_]}),t[25]=g,t[26]=_,t[27]=v):v=t[27],v}function Yt(e){return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{render:(0,Q.jsx)(`span`,{tabIndex:0,role:`img`,"aria-label":e.platform===`ios`?`iOS available`:`Android available`,className:`shrink-0 text-muted-foreground`}),children:e.platform===`ios`?(0,Q.jsx)(Qe,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)($e,{className:`size-3.5`})}),(0,Q.jsx)(je,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Xt(e){return e.available}var Zt=S(R),Qt=e=>({kind:`eas`,id:e,label:`EAS Simulator`,accessToken:``,maxSessionMinutes:30,idleMinutes:10,maxConcurrentSessions:2});function $t(e,t,n){return n?e.filter(e=>e.id!==t.id):e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t]}function en(e){return`Up to ${e.maxConcurrentSessions===1?`1 session`:`${e.maxConcurrentSessions} sessions`} at once, each stopped after ${e.maxSessionMinutes} min or ${e.idleMinutes} idle min`}var tn=`thread-project`,nn={settings:`the access token saved here`,env:`EXPO_TOKEN on the server`,"eas-login":`the server's eas login`},rn=e=>{let t=B(e);return t instanceof Error?t.message:String(t)};function an(e){let t=(0,Z.c)(24),{scope:n,connectedEnvironments:r}=ct(),o=Te(e.environmentId,V),s=n.kind===`project`||n.kind===`checkout`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=Oe(we.updateSettings,c),u;t[1]===e.environmentId?u=t[2]:(u=t=>t.environmentId===e.environmentId,t[1]=e.environmentId,t[2]=u);let d=r.find(u)?.serverConfig?.settings.easDeviceHosts??[],[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(!1),g=!o||s||m||!e.environmentId,_=async(t,n)=>{if(!e.environmentId||!Ee(e.environmentId,`settings:write`))return;h(!0);let r=await l({environmentId:e.environmentId,input:{patch:{easDeviceHosts:$t(d,t,n)}}});h(!1),r._tag===`Success`?p(null):q.add({type:`error`,title:n?`EAS host not removed`:`EAS host not saved`,description:rn(r.cause)})},v=X,y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=[`easDeviceHosts`],t[3]=y):y=t[3];let b=g||f!==null,x;t[4]===p?x=t[5]:(x=()=>p({host:Qt(ee()),isNew:!0}),t[4]=p,t[5]=x);let S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(a,{className:`size-3.5`}),t[6]=S):S=t[6];let C;t[7]!==b||t[8]!==x?(C=(0,Q.jsxs)(N,{size:`sm`,variant:`outline`,disabled:b,onClick:x,children:[S,` Add EAS host`]}),t[7]=b,t[8]=x,t[9]=C):C=t[9];let w=d.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No EAS hosts.`}):(0,Q.jsx)(`ul`,{className:`divide-y divide-border/40`,children:d.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 truncate font-medium`,children:[(0,Q.jsx)(i,{className:`size-3.5 shrink-0`}),` `,e.label]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:en(e)})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,Q.jsx)(N,{size:`sm`,variant:`ghost`,disabled:g,onClick:()=>p({host:e,isNew:!1}),children:`Edit`}),(0,Q.jsx)(N,{size:`sm`,variant:`ghost-destructive`,disabled:g,onClick:()=>void _(e,!0),children:`Remove`})]})]},e.id))}),T;t[10]!==m||t[11]!==f||t[12]!==e.environmentId||t[13]!==_||t[14]!==p?(T=f&&e.environmentId?(0,Q.jsx)(on,{environmentId:e.environmentId,host:f.host,isNew:f.isNew,busy:m,onSave:e=>void _(e,!1),onClose:()=>p(null)},f.host.id):null,t[10]=m,t[11]=f,t[12]=e.environmentId,t[13]=_,t[14]=p,t[15]=T):T=t[15];let E;t[16]!==w||t[17]!==T?(E=(0,Q.jsxs)(`div`,{className:`pt-3 pb-2`,children:[w,T]}),t[16]=w,t[17]=T,t[18]=E):E=t[18];let D;return t[19]!==v||t[20]!==C||t[21]!==E||t[22]!==y?(D=(0,Q.jsx)(v,{id:`eas-device-hosts`,title:`EAS Simulator`,serverScoped:!0,settingKeys:y,description:`Run iOS Simulators in Expo's cloud from this environment. Sessions bill the Expo account until they stop, so each host limits how many run and for how long. Editing or removing a host stops its running sessions.`,control:C,children:E}),t[19]=v,t[20]=C,t[21]=E,t[22]=y,t[23]=D):D=t[23],D}function on(e){let t=(0,Z.c)(135),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=Oe(Ue.easAccount,n),[i,a]=(0,$.useState)(e.host),s=(0,$.useId)(),c;t[1]===e.host.accessToken?c=t[2]:(c=e.host.accessToken?{kind:`saved`}:{kind:`cleared`},t[1]=e.host.accessToken,t[2]=c);let[l,u]=(0,$.useState)(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`checking`},t[3]=d):d=t[3];let[f,p]=(0,$.useState)(d),m,h;t[4]!==i||t[5]!==e.host.accessToken||t[6]!==l.kind||t[7]!==l.value?(m={...i,label:i.label.trim(),accessToken:l.kind===`saved`?e.host.accessToken:l.kind===`new`?l.value:``},h=te(Zt(m)),t[4]=i,t[5]=e.host.accessToken,t[6]=l.kind,t[7]=l.value,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g=h,_=g?null:i.maxSessionMinutes>0&&i.idleMinutes>=i.maxSessionMinutes?`Idle minutes must be smaller than session minutes.`:`Give the host a label and limits within the ranges shown.`,v;t[10]!==f.account||t[11]!==f.status?(v=f.status===`signed-in`?f.account.apps:[],t[10]=f.account,t[11]=f.status,t[12]=v):v=t[12];let y=v,b=(0,$.useRef)(0),x;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{b.current+=1,p({status:`idle`})},t[13]=x):x=t[13];let S=x,C;t[14]!==r||t[15]!==e.environmentId||t[16]!==e.host.id||t[17]!==e.isNew||t[18]!==l.kind||t[19]!==l.value?(C=async()=>{let t=b.current+=1,n=await r({environmentId:e.environmentId,input:{...l.kind===`saved`&&!e.isNew?{hostId:e.host.id}:{},...l.kind===`new`?{accessToken:l.value}:l.kind===`cleared`?{accessToken:``}:{}}});t===b.current&&p(n._tag===`Success`?{status:`signed-in`,account:n.value}:{status:`failed`,error:rn(n.cause)})},t[14]=r,t[15]=e.environmentId,t[16]=e.host.id,t[17]=e.isNew,t[18]=l.kind,t[19]=l.value,t[20]=C):C=t[20];let w=C,T;t[21]===w?T=t[22]:(T=()=>{p({status:`checking`}),w()},t[21]=w,t[22]=T);let E=T,D;t[23]===w?D=t[24]:(D=()=>void w(),t[23]=w,t[24]=D);let O=(0,$.useEffectEvent)(D),k;t[25]===O?k=t[26]:(k=()=>{O()},t[25]=O,t[26]=k);let A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(A=[],t[27]=A):A=t[27],(0,$.useEffect)(k,A);let j;t[28]!==i||t[29]!==e.busy?(j=(t,n,r)=>(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,Q.jsx)(`span`,{children:n}),(0,Q.jsx)(Ne,{type:`number`,min:1,max:r,value:i[t],disabled:e.busy,onChange:e=>{let n=Number(e.target.value);a(e=>({...e,[t]:n}))}})]}),t[28]=i,t[29]=e.busy,t[30]=j):j=t[30];let M=j,P;t[31]===e?P=t[32]:(P=t=>{!t&&!e.busy&&e.onClose()},t[31]=e,t[32]=P);let F=!e.busy,I;t[33]!==m||t[34]!==e||t[35]!==g?(I=t=>{t.preventDefault(),g&&!e.busy&&e.onSave(m)},t[33]=m,t[34]=e,t[35]=g,t[36]=I):I=t[36];let L=e.isNew?`Add EAS host`:`Edit EAS host`,R;t[37]===L?R=t[38]:(R=(0,Q.jsx)(Fe,{children:L}),t[37]=L,t[38]=R);let ee;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(ze,{children:`The environment's server signs in to Expo and starts the sessions. Without a token here it uses EXPO_TOKEN, then its eas login.`}),t[39]=ee):ee=t[39];let z;t[40]===R?z=t[41]:(z=(0,Q.jsxs)(Pe,{children:[R,ee]}),t[40]=R,t[41]=z);let B;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(`span`,{children:`Name`}),t[42]=B):B=t[42];let ne;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>{let t=e.target.value;a(e=>({...e,label:t}))},t[43]=ne):ne=t[43];let re;t[44]!==i.label||t[45]!==e.busy?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[B,(0,Q.jsx)(Ne,{autoFocus:!0,required:!0,value:i.label,disabled:e.busy,onChange:ne})]}),t[44]=i.label,t[45]=e.busy,t[46]=re):re=t[46];let V;t[47]===s?V=t[48]:(V=(0,Q.jsx)(`label`,{htmlFor:s,className:`block`,children:`Expo access token`}),t[47]=s,t[48]=V);let H=l.kind===`saved`,ie=l.kind===`new`?l.value:``,ae;t[49]===e.host.accessToken?ae=t[50]:(ae=t=>{let n=t.target.value;u(n?{kind:`new`,value:n}:e.host.accessToken?{kind:`saved`}:{kind:`cleared`}),S()},t[49]=e.host.accessToken,t[50]=ae);let U;t[51]!==e.busy||t[52]!==H||t[53]!==ie||t[54]!==ae||t[55]!==s?(U=(0,Q.jsx)(At,{id:s,className:`min-w-0 flex-1`,configured:H,value:ie,disabled:e.busy,placeholder:`Optional`,onChange:ae}),t[51]=e.busy,t[52]=H,t[53]=ie,t[54]=ae,t[55]=s,t[56]=U):U=t[56];let oe;t[57]===l.kind?oe=t[58]:(oe=l.kind===`cleared`?null:(0,Q.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost-destructive`,"aria-label":`Clear access token`,onClick:()=>{u({kind:`cleared`}),S()},children:(0,Q.jsx)(o,{className:`size-3.5`})}),t[57]=l.kind,t[58]=oe);let se;t[59]!==U||t[60]!==oe?(se=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[U,oe]}),t[59]=U,t[60]=oe,t[61]=se):se=t[61];let ce;t[62]!==V||t[63]!==se?(ce=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[V,se]}),t[62]=V,t[63]=se,t[64]=ce):ce=t[64];let le=f.status===`signed-in`?`Signed in as ${f.account.signedInAs} with ${nn[f.account.credentialSource]}.`:f.status===`failed`?f.error:f.status===`checking`?`Checking the Expo account…`:`Check the Expo account before choosing a project.`,W;t[65]===le?W=t[66]:(W=(0,Q.jsx)(`p`,{role:`status`,className:`min-w-0 text-xs text-muted-foreground`,children:le}),t[65]=le,t[66]=W);let ue=e.busy||f.status===`checking`,G;t[67]===E?G=t[68]:(G=()=>void E(),t[67]=E,t[68]=G);let fe;t[69]===f.status?fe=t[70]:(fe=f.status===`checking`?(0,Q.jsx)(_e,{size:`xs`}):null,t[69]=f.status,t[70]=fe);let me;t[71]!==ue||t[72]!==G||t[73]!==fe?(me=(0,Q.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:ue,onClick:G,children:[fe,` Check account`]}),t[71]=ue,t[72]=G,t[73]=fe,t[74]=me):me=t[74];let q;t[75]!==W||t[76]!==me?(q=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5`,children:[W,me]}),t[75]=W,t[76]=me,t[77]=q):q=t[77];let ve;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Q.jsx)(`span`,{children:`EAS project`}),t[78]=ve):ve=t[78];let ye=i.appId??tn,J=e.busy,be;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(be=e=>{typeof e==`string`&&a(t=>{let{appId:n,...r}=t;return e===tn?r:{...r,appId:e}})},t[79]=be):be=t[79];let xe;t[80]===y?xe=t[81]:(xe=(0,Q.jsx)(he,{size:`sm`,"aria-label":`EAS project`,children:(0,Q.jsx)(de,{children:e=>e===tn?`From the thread's project`:y.find(t=>t.id===e)?.fullName??e})}),t[80]=y,t[81]=xe);let Se;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Q.jsx)(K,{value:tn,children:`From the thread's project`}),t[82]=Se):Se=t[82];let Ce;t[83]!==y||t[84]!==i.appId?(Ce=i.appId&&!y.some(e=>e.id===i.appId)?(0,Q.jsx)(K,{value:i.appId,children:i.appId}):null,t[83]=y,t[84]=i.appId,t[85]=Ce):Ce=t[85];let Y;t[86]===y?Y=t[87]:(Y=y.map(sn),t[86]=y,t[87]=Y);let we;t[88]!==Ce||t[89]!==Y?(we=(0,Q.jsxs)(pe,{children:[Se,Ce,Y]}),t[88]=Ce,t[89]=Y,t[90]=we):we=t[90];let Te;t[91]!==e.busy||t[92]!==ye||t[93]!==xe||t[94]!==we?(Te=(0,Q.jsxs)(ge,{value:ye,disabled:J,onValueChange:be,children:[xe,we]}),t[91]=e.busy,t[92]=ye,t[93]=xe,t[94]=we,t[95]=Te):Te=t[95];let Ee;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Sessions bill the project's Expo account. "From the thread's project" reads extra.eas.projectId from the project's app config.`}),t[96]=Ee):Ee=t[96];let De;t[97]===Te?De=t[98]:(De=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ve,Te,Ee]}),t[97]=Te,t[98]=De);let ke;t[99]===M?ke=t[100]:(ke=(0,Q.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 text-sm`,children:[M(`maxConcurrentSessions`,`Sessions at once`,20),M(`maxSessionMinutes`,`Session minutes`,115),M(`idleMinutes`,`Idle minutes`,60)]}),t[99]=M,t[100]=ke);let Ae=e.isNew?null:` Saving restarts this host, which stops its running sessions.`,je;t[101]===Ae?je=t[102]:(je=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Expo allows sessions of up to 40 minutes on free accounts and 115 on paid ones, and ends one after the idle minutes without activity, so idle minutes must be smaller than session minutes.`,Ae]}),t[101]=Ae,t[102]=je);let Me;t[103]===_?Me=t[104]:(Me=_===null?null:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:_}),t[103]=_,t[104]=Me);let Le;t[105]!==re||t[106]!==ce||t[107]!==q||t[108]!==De||t[109]!==ke||t[110]!==je||t[111]!==Me?(Le=(0,Q.jsxs)(Re,{children:[re,ce,q,De,ke,je,Me]}),t[105]=re,t[106]=ce,t[107]=q,t[108]=De,t[109]=ke,t[110]=je,t[111]=Me,t[112]=Le):Le=t[112];let He;t[113]!==e.busy||t[114]!==e.onClose?(He=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:e.busy,onClick:e.onClose,children:`Cancel`}),t[113]=e.busy,t[114]=e.onClose,t[115]=He):He=t[115];let We=e.busy||!g,Ge;t[116]===e.busy?Ge=t[117]:(Ge=e.busy?(0,Q.jsx)(_e,{size:`xs`}):null,t[116]=e.busy,t[117]=Ge);let Ke;t[118]!==We||t[119]!==Ge?(Ke=(0,Q.jsxs)(N,{type:`submit`,disabled:We,children:[Ge,` Save host`]}),t[118]=We,t[119]=Ge,t[120]=Ke):Ke=t[120];let qe;t[121]!==He||t[122]!==Ke?(qe=(0,Q.jsxs)(Ie,{children:[He,Ke]}),t[121]=He,t[122]=Ke,t[123]=qe):qe=t[123];let Je;t[124]!==I||t[125]!==z||t[126]!==Le||t[127]!==qe?(Je=(0,Q.jsxs)(`form`,{className:`flex min-h-0 flex-col`,onSubmit:I,children:[z,Le,qe]}),t[124]=I,t[125]=z,t[126]=Le,t[127]=qe,t[128]=Je):Je=t[128];let Ye;t[129]!==F||t[130]!==Je?(Ye=(0,Q.jsx)(Be,{showCloseButton:F,children:Je}),t[129]=F,t[130]=Je,t[131]=Ye):Ye=t[131];let Xe;return t[132]!==P||t[133]!==Ye?(Xe=(0,Q.jsx)(Ve,{open:!0,onOpenChange:P,children:Ye}),t[132]=P,t[133]=Ye,t[134]=Xe):Xe=t[134],Xe}function sn(e){return(0,Q.jsx)(K,{value:e.id,children:e.fullName},e.id)}function cn(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function ln(e,t,n){if(e.kind===`new`)return{kind:`new`,profileId:t};let r=n.find(t=>t.id===e.profileId);if(r!==void 0)return{kind:`existing`,profileId:e.profileId,name:r.name}}function un(e){return e.step!==`importing`}function dn(e){return e.unavailable===`browserRunning`?{step:`quit`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`configure`}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function fn(e){return e.kind===`imported`?{step:`done`,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains,targetName:e.targetName}:e.reason===`browserRunning`?{step:`quit`}:e.reason===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`import`,checked:!0}:{step:`blocked`,reason:e.reason}}function pn(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:dn(e)}function mn(e){let t=pn(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function hn(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function gn(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function _n(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function vn(e){let t=(0,Z.c)(46),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,onImport:o,onRefreshSource:s,onOpenFullDiskAccessSettings:c,onCheckFullDiskAccess:l,onClose:u}=e,[d,f]=(0,$.useState)(n),p;t[0]===n?p=t[1]:(p=()=>dn(n),t[0]=n,t[1]=p);let[m,h]=(0,$.useState)(p),g;t[2]===n.profiles[0]?.directory?g=t[3]:(g=()=>n.profiles[0]?.directory??``,t[2]=n.profiles[0]?.directory,t[3]=g);let[_,v]=(0,$.useState)(g),y;t[4]!==a||t[5]!==i?(y=()=>cn(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[b,x]=(0,$.useState)(y),[S,C]=(0,$.useState)(),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=ee(),t[7]=w):w=t[7];let T=(0,$.useRef)(`profile-${w}`),E=(0,$.useRef)(!1),D;t[8]!==o||t[9]!==_||t[10]!==b||t[11]!==i?(D=()=>{if(E.current)return;let e=ln(b,T.current,i);e===void 0?(C(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`})):(C(void 0),E.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(fn(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{E.current=!1}))},t[8]=o,t[9]=_,t[10]=b,t[11]=i,t[12]=D):D=t[12];let O=D,k;t[13]===s?k=t[14]:(k=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>hn(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=k);let A=k,j;t[15]===A?j=t[16]:(j=()=>A(`browser`,pn),t[15]=A,t[16]=j);let M=j,N;t[17]===A?N=t[18]:(N=()=>A(`fullDiskAccess`,mn),t[17]=A,t[18]=N);let P=N,F;t[19]!==u||t[20]!==m?(F=e=>e||!un(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=F):F=t[21];let I;t[22]===m?I=t[23]:(I=un(m),t[22]=m,t[23]=I);let L;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==M||t[31]!==P||t[32]!==O||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(L=m.step===`quit`?(0,Q.jsx)(yn,{source:d,onCancel:u,onRechecked:M}):m.step===`fullDiskAccess`?(0,Q.jsx)(Sn,{source:d,onCancel:u,onOpenSettings:c,onCheck:l??(async()=>{let e=await s();return e!==void 0&&e.unavailable===void 0}),onGranted:m.resume===`import`?O:P,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(Tn,{}):m.step===`checking`?(0,Q.jsx)(En,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(Dn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(On,{source:d,reason:m.reason,onClose:u,onRetry:gn(m.reason)?O:void 0}):(0,Q.jsx)(Cn,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:b,onTargetChange:e=>{x(e),C(void 0)},targetError:S,onCancel:u,onImport:O}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=M,t[31]=P,t[32]=O,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=L):L=t[39];let R;t[40]!==I||t[41]!==L?(R=(0,Q.jsx)(Be,{className:`max-w-lg`,showCloseButton:I,children:L}),t[40]=I,t[41]=L,t[42]=R):R=t[42];let te;return t[43]!==R||t[44]!==F?(te=(0,Q.jsx)(Ve,{open:!0,onOpenChange:F,children:R}),t[43]=R,t[44]=F,t[45]=te):te=t[45],te}function yn(e){let t=(0,Z.c)(12),{source:n,onCancel:r,onRechecked:i}=e,a;t[0]===n.name?a=t[1]:(a=(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(Fe,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(ze,{children:[n.name,` is open, so its cookies can’t be read yet. Quit it, then continue.`]})]}),t[0]=n.name,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(N,{onClick:i,children:`I’ve quit it`}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(Ie,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function bn(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function xn(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Sn(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:i,onGranted:a,stillRequired:o,onCheck:s}=e,[c,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(null),f;t[0]===s?f=t[1]:(f=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={fullDiskAccess:!1},t[2]=p):p=t[2];let m=Nt(f,p),g;t[3]!==i||t[4]!==c?(g=()=>{c||(l(!0),d(null),Promise.resolve().then(i).catch(()=>d(`Could not open System Settings. Try Allow again.`)).finally(()=>l(!1)))},t[3]=i,t[4]=c,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(Fe,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(ze,{children:[`To import cookies from `,n.name,`, P4 Code needs Full Disk Access. Turn it on in System Settings, then come back to finish the import — you can revoke it again once the import is done.`]})]}),t[6]=n.name,t[7]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(h,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let b=`Read ${n.name}'s cookies for this import.`,x;t[9]===_?x=t[10]:(x=()=>void _(),t[9]=_,t[10]=x);let S;t[11]!==m.status.fullDiskAccess||t[12]!==b||t[13]!==x?(S=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:b,granted:m.status.fullDiskAccess,onAllow:x}],t[11]=m.status.fullDiskAccess,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==c||t[16]!==S?(C=(0,Q.jsx)(jt,{busy:c,permissions:S}),t[15]=c,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==u||t[19]!==m.error?(w=u||m.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:u??m.error}):null,t[18]=u,t[19]=m.error,t[20]=w):w=t[20];let T;t[21]!==m||t[22]!==o?(T=m.isReady([`fullDiskAccess`])?null:(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:o?`Access is still required. Quit and reopen P4 Code if you just allowed it, then retry the import.`:`If access doesn't update after you allow it, quit and reopen P4 Code, then retry the import.`}),t[21]=m,t[22]=o,t[23]=T):T=t[23];let E;t[24]!==w||t[25]!==T||t[26]!==C?(E=(0,Q.jsxs)(Re,{children:[C,w,T]}),t[24]=w,t[25]=T,t[26]=C,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===m?O=t[31]:(O=m.isReady([`fullDiskAccess`]),t[30]=m,t[31]=O);let k;t[32]!==a||t[33]!==c||t[34]!==O?(k=(0,Q.jsx)(Mt,{ready:O,busy:c,onClick:a,children:`Continue`}),t[32]=a,t[33]=c,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(Ie,{children:[D,k]}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==E||t[40]!==A||t[41]!==v?(j=(0,Q.jsxs)(Q.Fragment,{children:[v,E,A]}),t[39]=E,t[40]=A,t[41]=v,t[42]=j):j=t[42],j}function Cn(e){let t=(0,Z.c)(59),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:o,onSourceProfileChange:s,target:c,targetError:l,onTargetChange:u,onCancel:d,onImport:f}=e,p;t[0]!==c.kind||t[1]!==c.profileId||t[2]!==i?(p=c.kind===`existing`&&!i.some(e=>e.id===c.profileId),t[0]=c.kind,t[1]=c.profileId,t[2]=i,t[3]=p):p=t[3];let m=p,h=c.kind===`new`&&!a,g=l??(m?`That profile is no longer available. Choose where to import these cookies.`:h?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),_;t[4]===n.name?_=t[5]:(_=(0,Q.jsxs)(Fe,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(ze,{children:[`Choose which cookies to import for `,r,`.`]}),t[6]=r,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,Q.jsxs)(Pe,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=b):b=t[11];let x;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(wn,{selected:o===e.directory,title:e.name,subtitle:bn(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],x=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=x}else x=t[15];let S;t[19]===x?S=t[20]:(S=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[b,x]}),t[19]=x,t[20]=S);let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(O,{className:`size-4 sm:hidden`}),(0,Q.jsx)(M,{className:`hidden size-4 sm:block`})]}),t[21]=C):C=t[21];let w;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=w):w=t[22];let T;t[23]!==a||t[24]!==u||t[25]!==c.kind?(T=a?(0,Q.jsx)(wn,{selected:c.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>u({kind:`new`})}):null,t[23]=a,t[24]=u,t[25]=c.kind,t[26]=T):T=t[26];let E;if(t[27]!==u||t[28]!==c.kind||t[29]!==c.profileId||t[30]!==i){let e;t[32]!==u||t[33]!==c.kind||t[34]!==c.profileId?(e=e=>(0,Q.jsx)(wn,{selected:c.kind===`existing`&&c.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>u({kind:`existing`,profileId:e.id})},e.id),t[32]=u,t[33]=c.kind,t[34]=c.profileId,t[35]=e):e=t[35],E=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=E}else E=t[31];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[w,T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let k;t[39]!==D||t[40]!==S?(k=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[S,C,D]}),t[39]=D,t[40]=S,t[41]=k):k=t[41];let A;t[42]===g?A=t[43]:(A=g?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:g}):null,t[42]=g,t[43]=A);let j;t[44]!==k||t[45]!==A?(j=(0,Q.jsxs)(Re,{children:[k,A]}),t[44]=k,t[45]=A,t[46]=j):j=t[46];let P;t[47]===d?P=t[48]:(P=(0,Q.jsx)(N,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=P);let F=o===``||m||h,I;t[49]!==f||t[50]!==F?(I=(0,Q.jsx)(N,{disabled:F,onClick:f,children:`Import`}),t[49]=f,t[50]=F,t[51]=I):I=t[51];let L;t[52]!==P||t[53]!==I?(L=(0,Q.jsxs)(Ie,{children:[P,I]}),t[52]=P,t[53]=I,t[54]=L):L=t[54];let R;return t[55]!==j||t[56]!==L||t[57]!==y?(R=(0,Q.jsxs)(Q.Fragment,{children:[y,j,L]}),t[55]=j,t[56]=L,t[57]=y,t[58]=R):R=t[58],R}function wn(e){let t=(0,Z.c)(22),{selected:n,title:r,subtitle:i,onSelect:a}=e,o=n?`border-primary bg-primary/8`:`border-border/60 hover:border-border hover:bg-muted/40`,s;t[0]===o?s=t[1]:(s=H(`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o),t[0]=o,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,Q.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:r}),t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=i?(0,Q.jsx)(`span`,{className:`block truncate text-xs tabular-nums text-muted-foreground`,children:i}):null,t[4]=i,t[5]=l);let d;t[6]!==c||t[7]!==l?(d=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=d):d=t[8];let f=n?`border-primary bg-primary text-primary-foreground`:`border-input`,p;t[9]===f?p=t[10]:(p=H(`grid size-4 shrink-0 place-items-center rounded-full border`,f),t[9]=f,t[10]=p);let m;t[11]===n?m=t[12]:(m=n?(0,Q.jsx)(u,{className:`size-2.5`}):null,t[11]=n,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,Q.jsx)(`span`,{className:p,children:m}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==d||t[20]!==h?(g=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[d,h]}),t[16]=a,t[17]=n,t[18]=s,t[19]=d,t[20]=h,t[21]=g):g=t[21],g}function Tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Pe,{children:[(0,Q.jsx)(Fe,{children:`Importing cookies`}),(0,Q.jsx)(ze,{children:`This may take a moment.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(Re,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(_e,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function En(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Fe,{children:[`Checking `,n]}),t[0]=n,t[1]=i);let a=r===`fullDiskAccess`?`Checking Full Disk Access.`:`Checking whether the browser has closed.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(ze,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Pe,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(_e,{size:`md`,tone:`muted`}),t[7]=c):c=t[7];let l=r===`fullDiskAccess`?`Checking access…`:`Checking…`,u;t[8]===l?u=t[9]:(u=(0,Q.jsx)(Re,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[c,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:l})]})}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function Dn(e){let t=(0,Z.c)(24),{imported:n,skipped:r,skippedDomains:i,targetName:a,destinationEnvironmentName:o,onClose:s}=e,c;t[0]!==n||t[1]!==r?(c=n>0?`Imported ${xn(n)}`:r>0?`Skipped ${xn(r)}`:`No cookies found`,t[0]=n,t[1]=r,t[2]=c):c=t[2];let l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(Fe,{children:c}),t[3]=c,t[4]=l);let u;t[5]!==o||t[6]!==n||t[7]!==r||t[8]!==a?(u=n>0?`Added to ${a} for ${o}.${r>0?` ${xn(r)} skipped.`:``}`:r>0?`No cookies were imported for ${o}.`:`There were no cookies to import for ${o}.`,t[5]=o,t[6]=n,t[7]=r,t[8]=a,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,Q.jsx)(ze,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Pe,{children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i.length>0?(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Skipped`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:_n(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(N,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(Ie,{children:(0,Q.jsx)(Le,{render:m,onClick:s,children:`Done`})}),t[18]=s,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,h]}),t[20]=f,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function On(e){let t=(0,Z.c)(17),{source:n,reason:r,onClose:i,onRetry:a}=e,o;t[0]===n.name?o=t[1]:(o=(0,Q.jsxs)(Fe,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=A[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(ze,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Pe,{children:[o,c]}),t[4]=o,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(N,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=u);let d;t[9]===a?d=t[10]:(d=a?(0,Q.jsx)(N,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(Ie,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var kn=`fill`,An=`responsive`;async function jn(e,t,n,r){let i=e===null?[]:t,a=r?.environmentIds??[];if(i.length===0&&a.length===0)throw Error(`Browser profile data is not available to clear.`);await Promise.all([...i.flatMap(t=>[e.clearCookies(t,n),e.clearCache(t,n)]),...a.map(e=>r.clear(e,n))])}function Mn(e,t,n,r=0){return(e||r>0)&&t&&n>0}var Nn={width:1280,height:800},Pn={useGrouping:!1},Fn={system:`System`,light:`Light`,dark:`Dark`},In=e=>`${Math.round(e*100)}%`,Ln=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},Rn=e=>{let t=String(e?.message??``);return ne.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},zn=e=>e._tag===`fill`?kn:e._tag===`preset`&&yt.some(t=>t.id===e.presetId)?e.presetId:An,Bn=e=>{let t=zn(e);return t===kn?`Fill panel`:t===An?`Responsive`:yt.find(e=>e.id===t)?.label??`Responsive`},Vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,Hn=e=>({...e,width:e.height,height:e.width});function Un(e){let t=(0,Z.c)(42),{disabled:n}=e,r=Y(Gn),i=J(),a=r._tag===`fill`?null:r,o=a?.width??Nn.width,s=a?.height??Nn.height,c;t[0]!==o||t[1]!==s?(c={width:o,height:s},t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(u=e=>{if(e===kn){i({browserDefaultViewport:y});return}if(e===An){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??Nn.width,height:a?.height??Nn.height}});return}let t=yt.find(t=>t.id===e);t&&i({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=a?.height,t[4]=a?.width,t[5]=i,t[6]=u):u=t[6];let d=u,f;t[7]!==l||t[8]!==a||t[9]!==i?(f=(e,t)=>{if(t===null||!Vn(t))return;let n={...l,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=l,t[8]=a,t[9]=i,t[10]=f):f=t[10];let p=f,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=Et(`browser-default-viewport`),t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==i||t[14]!==r._tag?(h=!n&&r._tag!==C._tag?(0,Q.jsx)(dt,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:C})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=h):h=t[15];let g;t[16]===r?g=t[17]:(g=zn(r),t[16]=r,t[17]=g);let v;t[18]===r?v=t[19]:(v=Bn(r),t[18]=r,t[19]=v);let b;t[20]===v?b=t[21]:(b=(0,Q.jsx)(he,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(de,{children:v})}),t[20]=v,t[21]=b);let x,S;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(K,{value:kn,children:`Fill panel`}),S=(0,Q.jsx)(K,{value:An,children:`Responsive`}),t[22]=x,t[23]=S):(x=t[22],S=t[23]);let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(pe,{align:`end`,alignItemWithTrigger:!1,children:[x,S,(0,Q.jsxs)(me,{children:[(0,Q.jsx)(fe,{children:`Standard`}),yt.map(Wn)]})]}),t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==d||t[27]!==b||t[28]!==g?(T=(0,Q.jsxs)(ge,{value:g,onValueChange:d,disabled:n,children:[b,w]}),t[25]=n,t[26]=d,t[27]=b,t[28]=g,t[29]=T):T=t[29];let E;t[30]!==p||t[31]!==n||t[32]!==l||t[33]!==a||t[34]!==i?(E=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(G,{value:l.width,min:240,max:_,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`width`,e),children:(0,Q.jsx)(ue,{children:(0,Q.jsx)(W,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(G,{value:l.height,min:240,max:_,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`height`,e),children:(0,Q.jsx)(ue,{children:(0,Q.jsx)(W,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${l.height>=l.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:Hn(a)}),children:(0,Q.jsx)(vt,{})})}),(0,Q.jsx)(je,{side:`top`,children:`Rotate`})]})]}):null,t[30]=p,t[31]=n,t[32]=l,t[33]=a,t[34]=i,t[35]=E):E=t[35];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let O;return t[39]!==D||t[40]!==h?(O=(0,Q.jsx)(X,{...m,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:h,control:D}),t[39]=D,t[40]=h,t[41]=O):O=t[41],O}function Wn(e){return(0,Q.jsx)(K,{value:e.id,children:(0,Q.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-5`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e.detail})]})},e.id)}function Gn(e){return e.browserDefaultViewport}function Kn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=Y(Jn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Et(`browser-default-zoom`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=!n&&r!==1?(0,Q.jsx)(dt,{label:`default browser zoom`,onClick:()=>i({browserDefaultZoomFactor:1})}):null,t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=se.find(t=>String(t)===e);t!==void 0&&i({browserDefaultZoomFactor:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=In(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(de,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:se.map(qn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(ge,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(X,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function qn(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:String(e),children:In(e)},e)}function Jn(e){return e.browserDefaultZoomFactor}function Yn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=Y(Zn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Et(`browser-default-appearance`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(dt,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:v})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`light`||e===`dark`)&&i({browserDefaultAppearance:e})},t[5]=i,t[6]=s);let c=Fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(de,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Fn).map(Xn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(ge,{disabled:n,value:r,onValueChange:s,children:[l,u]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(X,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Xn(e){let[t,n]=e;return(0,Q.jsx)(K,{hideIndicator:!0,value:t,children:n},t)}function Zn(e){return e.browserDefaultAppearance}function Qn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=Y(er),i=Y($n),a=J(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=Et(`browser-recording-key-presses`),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>a({browserRecordingShowKeyPresses:!!e}),t[1]=a,t[2]=s);let c;t[3]!==n||t[4]!==r||t[5]!==s?(c=(0,Q.jsx)(X,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(Ct,{disabled:n,checked:r,"aria-label":`Show key presses in recordings`,onCheckedChange:s})}),t[3]=n,t[4]=r,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=Et(`browser-recording-mouse-presses`),t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=e=>a({browserRecordingShowMousePresses:!!e}),t[8]=a,t[9]=u);let d;t[10]!==n||t[11]!==i||t[12]!==u?(d=(0,Q.jsx)(X,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(Ct,{disabled:n,checked:i,"aria-label":`Show mouse presses in recordings`,onCheckedChange:u})}),t[10]=n,t[11]=i,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==c||t[15]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function $n(e){return e.browserRecordingShowMousePresses}function er(e){return e.browserRecordingShowKeyPresses}function tr(e){let t=(0,Z.c)(18),{disabled:n}=e,r=Y(rr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Et(`browser-recording-frame-rate`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==30?(0,Q.jsx)(dt,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=z.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(de,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:z.map(nr)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(ge,{disabled:n,value:s,onValueChange:c,children:[l,u]}),t[10]=n,t[11]=s,t[12]=c,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(X,{...a,description:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function nr(e){return(0,Q.jsxs)(K,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function rr(e){return e.browserRecordingFrameRate}var ir={system:`Your default browser`,app:`P4 Code`};function ar(e){let t=(0,Z.c)(19),{disabled:n}=e,r=Y(sr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Et(`browser-link-target`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(dt,{label:`link target`,onClick:()=>i({browserLinkTarget:f})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=s);let c=ir[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(de,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(ir),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:u.map(or)}),t[10]=d):d=t[10];let p;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(p=(0,Q.jsxs)(ge,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=p):p=t[15];let m;return t[16]!==o||t[17]!==p?(m=(0,Q.jsx)(X,{...a,description:`Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way.`,resetAction:o,control:p}),t[16]=o,t[17]=p,t[18]=m):m=t[18],m}function or(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:e,children:ir[e]},e)}function sr(e){return e.browserLinkTarget}var cr={duckduckgo:`DuckDuckGo`,google:`Google`,bing:`Bing`,brave:`Brave Search`,kagi:`Kagi`,ecosia:`Ecosia`,custom:`Custom`};function lr(){let e=(0,Z.c)(24),t=Y(fr),n=Y(dr),r=J(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=Et(`browser-search-engine`),e[0]=i):i=e[0];let a;e[1]!==n||e[2]!==t||e[3]!==r?(a=t!==`duckduckgo`||n!==``?(0,Q.jsx)(dt,{label:`search engine`,onClick:()=>r({browserSearchEngine:U,browserCustomSearchUrl:``})}):null,e[1]=n,e[2]=t,e[3]=r,e[4]=a):a=e[4];let o;e[5]===r?o=e[6]:(o=e=>{let t=I.literals.find(t=>t===e);t!==void 0&&r({browserSearchEngine:t})},e[5]=r,e[6]=o);let s=cr[t],c;e[7]===s?c=e[8]:(c=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Search engine`,children:(0,Q.jsx)(de,{children:s})}),e[7]=s,e[8]=c);let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:I.literals.map(ur)}),e[9]=l):l=e[9];let u;e[10]!==t||e[11]!==o||e[12]!==c?(u=(0,Q.jsxs)(ge,{value:t,onValueChange:o,children:[c,l]}),e[10]=t,e[11]=o,e[12]=c,e[13]=u):u=e[13];let d;e[14]!==a||e[15]!==u?(d=(0,Q.jsx)(X,{...i,description:`What the address bar searches when you type something that isn't a URL.`,resetAction:a,control:u}),e[14]=a,e[15]=u,e[16]=d):d=e[16];let f;e[17]!==n||e[18]!==t||e[19]!==r?(f=t===`custom`?(0,Q.jsx)(X,{title:`Custom search URL`,description:`Use %s where the search terms go.`,status:tt(n)?void 0:`Enter an http or https URL containing %s. Searches use DuckDuckGo until then.`,control:(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full sm:w-64`,"aria-label":`Custom search URL`,placeholder:`https://example.com/search?q=%s`,autoCapitalize:`none`,spellCheck:!1,maxLength:re,value:n,onCommit:e=>r({browserCustomSearchUrl:e.trim()})})}):null,e[17]=n,e[18]=t,e[19]=r,e[20]=f):f=e[20];let p;return e[21]!==d||e[22]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function ur(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:e,children:cr[e]},e)}function dr(e){return e.browserCustomSearchUrl}function fr(e){return e.browserSearchEngine}function pr(){let e=(0,Z.c)(12),t=Y(mr),n=J(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Et(`pull-request-links-open-in-app`),e[0]=r):r=e[0];let i;e[1]!==t||e[2]!==n?(i=t?null:(0,Q.jsx)(dt,{label:`open pull requests in P4 Code`,onClick:()=>n({pullRequestLinksOpenInApp:!0})}),e[1]=t,e[2]=n,e[3]=i):i=e[3];let a;e[4]===n?a=e[5]:(a=e=>n({pullRequestLinksOpenInApp:!!e}),e[4]=n,e[5]=a);let o;e[6]!==t||e[7]!==a?(o=(0,Q.jsx)(Ct,{checked:t,onCheckedChange:a,"aria-label":`Open pull requests in P4 Code`}),e[6]=t,e[7]=a,e[8]=o):o=e[8];let s;return e[9]!==i||e[10]!==o?(s=(0,Q.jsx)(X,{...r,description:`Clicking a pull request link opens it in P4 Code. Turn off to open pull request links like any other link, on GitHub or your git host.`,resetAction:i,control:o}),e[9]=i,e[10]=o,e[11]=s):s=e[11],s}function mr(e){return e.pullRequestLinksOpenInApp}function hr(){let e=(0,Z.c)(7),{search:t,environment:n}=ct(),r=ot(),i=n?.connection.phase===`connected`&&n.serverConfig!==null?n.environmentId:null,a;e[0]===t?a=e[1]:(a=JSON.stringify(t),e[0]=t,e[1]=a);let o=`${i}:${a}`,s;return e[2]!==i||e[3]!==r.enableAgentDeviceAccess||e[4]!==r.enableDeviceSupport||e[5]!==o?(s=(0,Q.jsx)(ft,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(gr,{environmentId:i,enabled:r.enableDeviceSupport,agentAccessEnabled:r.enableAgentDeviceAccess},o)}),e[2]=i,e[3]=r.enableAgentDeviceAccess,e[4]=r.enableDeviceSupport,e[5]=o,e[6]=s):s=e[6],s}function gr({environmentId:e,enabled:t,agentAccessEnabled:n}){let r=Te(e,V),{state:i,loaded:a}=He(e),{scope:o,environments:s,connectedEnvironments:c}=ct(),l=st(),u=o.kind===`project`||o.kind===`checkout`,d=c.some(e=>e.serverConfig?.settings.enableDeviceSupport),f=Oe(Ue.configure,{reportFailure:!1}),p=Oe(Ue.list,{reportFailure:!1}),[m,h]=(0,$.useState)(null),g=i.hostStatus===`installing`||i.hostStatus===`starting`,_=i.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[v,y]=(0,$.useState)(!1);v&&!t&&y(!1),t&&!v&&(i.hostStatus===`ready`||_)&&m!==`hub`&&y(!0);let b=async(t,n)=>{if(e&&Ee(e,`settings:write`)){h(t);try{let e=await Promise.allSettled(s.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!Ee(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return f({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=s.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&q.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{h(null)}}},[x,S]=(0,$.useState)(null),C=i.hosts.find(e=>e.kind===`local`)?.tools,w=e=>{let t=C?.[e];return i.supportsToolUpdate&&t?!t.installedVersions.includes(t.requiredVersion):!1},T=(t,n=!1)=>{e&&(S(null),h(`update-${t}`),p({environmentId:e,input:{updateTool:t}}).then(e=>{if(e._tag===`Failure`){let r=De(e.cause);S({tool:t,message:r}),n&&q.add({type:`error`,title:r})}}).finally(()=>h(null)))},E=t=>{e&&(h(t),p({environmentId:e,input:{inspectOnly:!0}}).finally(()=>h(null)))},D=t=>{let n=w(t);if(!n&&!i.supportsToolInspection)return null;let r=m===`update-${t}`||m===`check-${t}`,a=n?`Update to v${C?.[t].requiredVersion}`:`Check ${t===`hub`?`device hub`:`agent device`} version`;return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:!e||m!==null||g,"aria-label":a,onClick:()=>n?T(t,!0):E(`check-${t}`)}),children:(0,Q.jsxs)(`span`,{className:`grid *:col-start-1 *:row-start-1 *:transition-[opacity,scale] *:duration-150 *:ease-out motion-reduce:*:transition-none`,children:[(0,Q.jsx)(`span`,{className:n&&!r?void 0:`scale-75 opacity-0`,children:(0,Q.jsx)(k,{"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:n&&!r?`scale-75 opacity-0`:void 0,children:(0,Q.jsx)(Tt,{refreshing:r})})]})}),(0,Q.jsx)(je,{side:`top`,children:a})]})},O=t=>{let n=C?.[t];return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&w(t)?(0,Q.jsx)(N,{size:`sm`,disabled:!e||m!==null||g,onClick:()=>T(t),children:m===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:!e||m!==null||g,onClick:()=>E(`check`),children:m===`check`?`Checking…`:`Check versions`}):null]}),x?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:x.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{...Et(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Je,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:O(`hub`),kind:`hub`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),D(`hub`),m===`hub`?(0,Q.jsx)(qe,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!r||u||!a||!e||g||m!==null,"aria-label":`Device hub`,onCheckedChange:e=>void b(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(Ze,{children:v?(0,Q.jsx)(X,{...Et(`device-platform-support`),description:c.length>1?`Status for ${c.find(t=>t.environmentId===e)?.label}. Select an environment to inspect its simulator support.`:void 0,status:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2`,children:[(0,Q.jsx)(Ge,{compact:!0,platform:`iOS`,status:Ke(i,`ios`)}),(0,Q.jsx)(Ge,{compact:!0,platform:`Android`,status:Ke(i,`android`)})]}),control:(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:!e||!t||g||m!==null,onClick:()=>{e&&(h(`check`),p({environmentId:e,input:{}}).finally(()=>h(null)))},children:m===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(X,{...Et(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:We,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:O(`agent`),kind:`agent`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),D(`agent`),m===`agent`?(0,Q.jsx)(Ye,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!r||c.length===0||!u&&(!a||!d||g)||m!==null,"aria-label":`Agent device access`,onCheckedChange:e=>u?l({enableAgentDeviceAccess:!!e}):void b(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Xe,{state:{...i,hosts:i.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(qt,{environmentId:e}),i.supportsEasHosts?(0,Q.jsx)(an,{environmentId:e}):null]})}function _r(e){let t=(0,Z.c)(14),{disabled:n}=e,r=Y(vr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Et(`browser-auto-show-floating-preview`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==!0?(0,Q.jsx)(dt,{label:`auto-show floating preview`,onClick:()=>i({browserAutoShowFloatingPreview:!0})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>i({browserAutoShowFloatingPreview:!!e}),t[5]=i,t[6]=s);let c;t[7]!==r||t[8]!==n||t[9]!==s?(c=(0,Q.jsx)(Ct,{disabled:n,checked:r,onCheckedChange:s,"aria-label":`Auto-show floating preview`}),t[7]=r,t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;return t[11]!==o||t[12]!==c?(l=(0,Q.jsx)(X,{...a,description:`Show the floating preview when an agent opens a browser or device unless the agent says otherwise.`,resetAction:o,control:c}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function vr(e){return e.browserAutoShowFloatingPreview}function yr({disabled:e}){let t=Y(e=>e.browserProfiles),n=Y(e=>e.browserDefaultProfileId),r=be(),i=J(),{environments:a,isReady:o}=ye(),l=ve(),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(null),[h,_]=(0,$.useState)(null),[v,y]=(0,$.useState)(null),[S,C]=(0,$.useState)(null),[O,k]=(0,$.useState)(!1),A=le(),M=Oe(et.clearProfile,{reportFailure:!1}),F={environmentIds:a.map(e=>e.environmentId).filter(e=>A.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await M({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw ce(n)}},I=Mn(mt!==null,o,a.length,F.environmentIds.length),L=(0,$.useRef)(!1),[R,te]=(0,$.useState)(!1),z=e||!r,B=P(t).filter(e=>e.kind!==`incognito`),ne=b(B,n)?.id??`default`,re=e=>{if(!r||L.current)return;let t=Ce().browserProfiles;if(t.length>=24)return;let n=P(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let s={id:`profile-${ee()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},V=(e,t)=>{if(!r||L.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=Ce().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},U=(e,t)=>{r&&!L.current&&(I?jn(mt,a.map(e=>e.environmentId),e,F).then(()=>{q.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{q.add({type:`error`,title:`Could not clear ${t}'s data`})}):q.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`}))},oe=async e=>{if(!r||L.current)return;if(!I){C(`Connect to an environment before removing this profile.`);return}C(null),k(!0);try{await jn(mt,o?a.map(e=>e.environmentId):[],e,F)}catch{C(`Profile data could not be deleted. Try again.`),k(!1);return}let t=Ce();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:w}:{}}),k(!1),_(null)},se=(u??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),W=(0,$.useCallback)(()=>{mt&&mt.listBrowserImportSources().then(d).catch(()=>d(e=>e??[]))},[]),ue=async(e,t,n)=>{if(!mt||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!P(Ce().browserProfiles).some(e=>e.id===n.target.profileId)||L.current)return{kind:`blocked`,reason:`readFailed`};L.current=!0,te(!0);try{let r=await mt.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!P(Ce().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let i;if(n.target.kind===`new`){if(r.imported>0)try{i=(await xe(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new Ln;let r=new Set(P(t.browserProfiles).map(e=>e.name)),i=e.name;for(let t=2;r.has(i);t+=1)i=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:i,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await jn(mt,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof Ln?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else i=e.name}else i=n.target.name;return{kind:`imported`,imported:r.imported,skipped:r.skipped,skippedDomains:r.skippedDomains,targetName:i}}catch(e){return{kind:`blocked`,reason:Rn(e)}}finally{L.current=!1,te(!1)}},G=async e=>{if(mt)try{let t=await mt.listBrowserImportSources();return d(t),t.find(t=>t.id===e)}catch{return}},K=t.length>=24;return(0,Q.jsxs)(X,{...Et(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(E,{onOpenChange:e=>e&&W(),children:[(0,Q.jsxs)(ae,{render:(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:z||R}),children:[(0,Q.jsx)(T,{}),`Add profile`]}),(0,Q.jsxs)(ie,{align:`end`,children:[(0,Q.jsx)(c,{disabled:!r||K,onClick:()=>re(`New profile`),children:`Blank profile`}),K?(0,Q.jsx)(c,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(j,{}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(x,{children:`Import from`}),u===null?(0,Q.jsx)(c,{disabled:!0,children:`Looking for browsers…`}):se.length===0?(0,Q.jsx)(c,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[se.map(e=>(0,Q.jsx)(c,{disabled:!r||l==null,onClick:()=>{r&&l!=null&&p({source:e,environmentId:l.environmentId,environmentName:pt({isPrimary:!0,environmentId:l.environmentId,runtimeLabel:l.label})})},children:e.name},e.id)),l==null?(0,Q.jsx)(c,{disabled:!0,children:`Connect to an environment to import cookies`}):null]})]})]})]}),children:[(0,Q.jsx)(`div`,{className:`mt-2 mb-2 overflow-hidden rounded-lg border border-border/60`,children:B.map((e,t)=>{let n=s(e.id),a=e.id===ne;return(0,Q.jsxs)(`div`,{className:H(`flex items-center gap-3 px-3 py-2`,t>0&&`border-t border-border/60`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n?(0,Q.jsx)(`span`,{className:H(`truncate text-sm text-foreground`,z&&`opacity-64`),children:e.name}):(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:z||R,maxLength:48,value:e.name,onCommit:t=>V(e.id,t)}),a?(0,Q.jsx)(`span`,{className:H(`flex`,z&&`opacity-64`),children:(0,Q.jsx)(g,{children:`Default`})}):null]}),(0,Q.jsxs)(E,{children:[(0,Q.jsx)(ae,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:z||R,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(m,{})}),(0,Q.jsxs)(ie,{align:`end`,children:[(0,Q.jsx)(c,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(c,{disabled:!r||!I,onClick:()=>{F.environmentIds.length>0?y(e):U(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(c,{variant:`destructive`,disabled:!r||!I,onClick:()=>{r&&_(e)},children:`Remove profile and data`}),I?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{}),(0,Q.jsx)(c,{disabled:!0,children:o?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(ht,{open:h!==null,onOpenChange:e=>{!e&&!O&&(_(null),C(null))},children:(0,Q.jsxs)(bt,{children:[(0,Q.jsxs)(xt,{children:[(0,Q.jsxs)(St,{children:[`Remove “`,h?.name,`”?`]}),(0,Q.jsx)(wt,{children:`Its cookies and logins are deleted. Desktop tabs already open in this profile stay open until you close them; server browser tabs close now.`}),S?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:S}):null,I?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect to an environment to remove this profile and its data.`})]}),(0,Q.jsxs)(gt,{children:[(0,Q.jsx)(_t,{disabled:O,render:(0,Q.jsx)(N,{variant:`outline`,disabled:O}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,disabled:O||!r||!I,onClick:()=>{h&&r&&I&&oe(h.id)},children:O?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(ht,{open:v!==null,onOpenChange:e=>{e||y(null)},children:(0,Q.jsxs)(bt,{children:[(0,Q.jsxs)(xt,{children:[(0,Q.jsxs)(St,{children:[`Clear “`,v?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(wt,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(gt,{children:[(0,Q.jsx)(_t,{render:(0,Q.jsx)(N,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,onClick:()=>{v&&U(v.id,v.name),y(null)},children:`Clear data`})]})]})}),f?(0,Q.jsx)(vn,{source:f.source,destinationEnvironmentName:f.environmentName,targetProfiles:B.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!K,onImport:e=>ue(f.source,f.environmentId,e),onRefreshSource:()=>G(f.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await Se()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{q.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>p(null)}):null]})}function br(){let e=(0,Z.c)(3),t=!ke,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(yr,{disabled:t}),(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(Kn,{disabled:t}),(0,Q.jsx)(Yn,{disabled:t}),(0,Q.jsx)(tr,{disabled:t}),(0,Q.jsx)(Qn,{disabled:t}),(0,Q.jsx)(ar,{disabled:t}),(0,Q.jsx)(_r,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Dt,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(ut,{children:[i,(0,Q.jsxs)(ft,{id:`browser`,title:`Browser`,children:[t?(0,Q.jsx)(lt,{message:`Only available in the desktop app.`,children:r}):r,(0,Q.jsx)(lr,{}),(0,Q.jsx)(pr,{})]}),(0,Q.jsx)(hr,{})]}),e[2]=a):a=e[2],a}var xr=br;export{xr as component};
2
- //# sourceMappingURL=settings.integrations-DEdu9gwQ.js.map
@@ -1,5 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$n as i,$p as a,A_ as o,Ab as s,Ep as c,F_ as l,I_ as u,Jn as d,M_ as f,N_ as p,Os as m,P_ as h,Rm as g,Xp as _,Yn as v,Yp as y,aE as b,dr as x,im as S,j_ as C,jd as w,k_ as T,l as E,mm as D,nT as O,sd as k,t as A,tr as j,ts as M,um as N,ur as P,xd as F}from"./utils-CxCThU1r.js";import{n as I}from"./ChatMarkdown-DzBQ6o2z.js";import{a as L,c as R,o as z,s as B,t as V}from"./select-CT4O76xq.js";import{t as H}from"./useLocation-jsSq4KCV.js";import{p as U}from"./toast-NSvYVPhH.js";import{S as W}from"./useSettings-FRbaNpbg.js";import{f as G}from"./server-BRIc5okw.js";import{t as K}from"./use-atom-command-BfhNaUIU.js";import{s as q,u as ee}from"./providerSkills-CK0_chtE.js";import{a as J,n as te,t as ne}from"./tooltip-QdplMyeY.js";import{t as re}from"./skeleton-DOfA4sjN.js";import{t as ie}from"./textarea-B2ogIlGU.js";import{n as ae,t as oe}from"./toggle-group-DpO88ac2.js";import{t as se}from"./input-DTnuNfU_.js";import{c as ce,r as le,s as ue,t as de}from"./dialog-CsGXTrQp.js";import{i as fe,o as pe,r as me,t as he}from"./empty-D39LEkAH.js";import{n as ge,r as _e,t as ve}from"./input-group-ZnG52HFh.js";import{a as ye}from"./projectFilesQueryState-CZkTtV37.js";import{F as be,G as xe,V as Se,a as Ce,i as we,s as Te}from"./settingsLayout-7rl00kQL.js";import{Gr as Ee,Jr as De,Kr as Oe,Xr as ke,Yr as Ae,Zr as je,do as Me,qr as Ne,sa as Pe,yr as Fe}from"./main-BqFaDMNs.js";import{t as Ie}from"./SecretInput-B2ihrOsq.js";var Y=n(),Le={spawn:`Failed to start`,timeout:`Timed out`,protocol:`Not an MCP server`,http:`Can't connect`,auth:`Credentials rejected`};function Re(e,t,n){if(!e.enabled)return{tone:`muted`,label:`Off`,needsSignIn:!1};if(n)return{tone:`muted`,label:`Checking…`,needsSignIn:!1};if(e.transport.type===`http`&&e.transport.auth===`oauth`&&t?.auth===`signed-out`)return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};let r=t?.health;switch(r?.status){case`connected`:return{tone:`success`,label:`Connected · ${r.toolCount} ${r.toolCount===1?`tool`:`tools`}`,needsSignIn:!1};case`needs-auth`:return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};case`error`:return{tone:`error`,label:Le[r.category],detail:r.message,needsSignIn:!1};default:return t?.auth===`signed-in`?{tone:`success`,label:`Signed in`,needsSignIn:!1}:{tone:`muted`,label:`Not checked`,needsSignIn:!1}}}function ze(e){let t=e.transport;if(t.type===`http`)try{let e=new URL(t.url);return`Remote · ${e.host}${e.pathname===`/`?``:e.pathname}`}catch{return`Remote`}return[t.command,...t.args].join(` `)}var X=e(t(),1),Z=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Be=e=>typeof e==`string`&&e.trim()?e:void 0,Ve=e=>{if(e!==null)try{let t=JSON.parse(e);return Z(t)?t:void 0}catch{return}},He=e=>{let t=Be(e)?.replace(/^\.\//,``);if(t!==void 0&&t.toLowerCase().endsWith(`.svg`)&&!(t.startsWith(`/`)||t.split(/[\\/]/).includes(`..`)))return t};function Ue(e,t){let n=Ve(e),r=Ve(t),i=Z(r?.interface)?r.interface:void 0,a=n?.author??r?.author,o={displayName:Be(n?.displayName)??Be(i?.displayName),description:Be(n?.description)??Be(r?.description),publisher:Be(a)??(Z(a)?Be(a.name):void 0),iconPath:He(n?.icon)??He(i?.logo)??He(i?.composerIcon)};return Object.fromEntries(Object.entries(o).filter(([,e])=>e!==void 0))}function We(e){let t=Ve(e)?.userConfig;return Z(t)?Object.entries(t).map(([e,t])=>{let n=Z(t)?t:{},r=Be(n.description);return{key:e,title:Be(n.title)??e,...r===void 0?{}:{description:r},required:n.required===!0}}):[]}var Q=e(r(),1),Ge=e=>{let t=b(m(e));return t&&!t.truncated?t.contents:null};function Ke(e){let t=(0,Y.c)(48),{environmentId:n,plugin:r,enabled:o,disabled:s,onDetails:l,onToggle:u}=e,d;t[0]!==n||t[1]!==r.path?(d=ye(n,r.path,`.claude-plugin/plugin.json`),t[0]=n,t[1]=r.path,t[2]=d):d=t[2];let f=M(d),p;t[3]!==n||t[4]!==r.path?(p=ye(n,r.path,`.codex-plugin/plugin.json`),t[3]=n,t[4]=r.path,t[5]=p):p=t[5];let m=M(p),{displayName:h,description:g,publisher:_,iconPath:y}=Ue(Ge(f),Ge(m)),b=Ge(M(ye(n,r.path,y??null))),S=y&&b?.trimStart().startsWith(`<`)?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(b)}`:null,C=ee(n),w;t[6]===S?w=t[7]:(w=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted`,children:S?(0,Q.jsx)(`img`,{src:S,alt:``,className:`size-6 object-contain`}):(0,Q.jsx)(a,{className:`size-5 text-muted-foreground`})}),t[6]=S,t[7]=w);let T=h??r.name,E;t[8]===T?E=t[9]:(E=(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium`,children:T}),t[8]=T,t[9]=E);let D;t[10]===_?D=t[11]:(D=_?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_}):null,t[10]=_,t[11]=D);let O;t[12]!==E||t[13]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[E,D]}),t[12]=E,t[13]=D,t[14]=O):O=t[14];let k=g??`Local plugin`,A;t[15]===k?A=t[16]:(A=(0,Q.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:k}),t[15]=k,t[16]=A);let N;t[17]!==O||t[18]!==A?(N=(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[O,A]}),t[17]=O,t[18]=A,t[19]=N):N=t[19];let F=`More for ${r.name}`,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(c,{"aria-hidden":!0}),t[20]=I):I=t[20];let L;t[21]===F?L=t[22]:(L=(0,Q.jsx)(J,{render:(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":F,children:I})})}),t[21]=F,t[22]=L);let R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(te,{children:`Plugin actions`}),t[23]=R):R=t[23];let z;t[24]===L?z=t[25]:(z=(0,Q.jsxs)(ne,{children:[L,R]}),t[24]=L,t[25]=z);let B;t[26]!==n||t[27]!==C||t[28]!==r.path?(B=C.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void C.activate(`open`,{environmentId:n,filePath:r.path,workspaceRoot:void 0}),children:`Open`}):null,t[26]=n,t[27]=C,t[28]=r.path,t[29]=B):B=t[29];let V;t[30]===l?V=t[31]:(V=(0,Q.jsx)(i,{onClick:l,children:`Details`}),t[30]=l,t[31]=V);let H;t[32]!==B||t[33]!==V?(H=(0,Q.jsxs)(j,{align:`end`,children:[B,V]}),t[32]=B,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==z||t[36]!==H?(U=(0,Q.jsxs)(v,{children:[z,H]}),t[35]=z,t[36]=H,t[37]=U):U=t[37];let W=`Load ${r.name}`,G;t[38]!==s||t[39]!==o||t[40]!==u||t[41]!==W?(G=(0,Q.jsx)(Me,{"aria-label":W,checked:o,disabled:s,onCheckedChange:u}),t[38]=s,t[39]=o,t[40]=u,t[41]=W,t[42]=G):G=t[42];let K;return t[43]!==N||t[44]!==U||t[45]!==G||t[46]!==w?(K=(0,Q.jsxs)(`li`,{className:`flex items-center gap-4 py-4`,children:[w,N,U,G]}),t[43]=N,t[44]=U,t[45]=G,t[46]=w,t[47]=K):K=t[47],K}var qe=[`Personal`,`Built-in`,`Project`,`Plugins`,`Other`];function Je(e){switch(q(e)){case`personal`:return`Personal`;case`system`:return`Built-in`;case`repo`:case`project`:return`Project`;case`app`:return`Plugins`;default:return`Other`}}var Ye=[[`codex`,`Codex`],[`claudeAgent`,`Claude`],[`cursor`,`Cursor`],[`grok`,`Grok`],[`antigravity`,`Antigravity`],[`opencode`,`OpenCode`],[`muse`,`Muse`],[`pi`,`Pi`]],Xe={remote:`Remote servers aren't supported by this provider`,"working-directory":`Servers with a working directory aren't supported here`,provider:`Not supported by this provider yet`};function Ze(e){return Ye.find(([t])=>t===e)?.[1]??e}function Qe(e){switch(e){case`signed-in`:return`Signed in`;case`signed-out`:return`Not signed in`;case`unavailable`:return`Add this server to the provider's own MCP config to sign in.`;case`unknown`:return`Sign-in status unknown`}}function $e(e,t){if(!h(e))return`unavailable`;let n=t.filter(t=>t.driver===e);if(n.some(e=>e.status===`signed-in`))return`signed-in`;if(n.some(e=>e.status===`signed-out`))return`needs-sign-in`}function et(e){return Ye.map(([t,n])=>{let r=f(t,e.transport),i=u.make(t);return{driver:i,label:n,enabled:r.supported&&!e.disabledProviders.includes(i),...r.supported?{}:{unsupported:Xe[r.reason]}}})}var tt={name:``,type:`stdio`,command:``,args:``,cwd:``,url:``,auth:`none`,values:[]};function nt(e){let t=e.transport;return t.type===`stdio`?{...tt,name:e.name,type:`stdio`,command:t.command,args:t.args.join(`
2
- `),cwd:t.cwd??``,values:Object.entries(t.env).map(([e,t])=>({key:e,value:t}))}:{...tt,name:e.name,type:`http`,url:t.url,auth:t.auth,values:Object.entries(t.headers).map(([e,t])=>({key:e,value:t}))}}var rt=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;function it(e,t){let n=e.name.trim();if(!n)return`Enter a name.`;if(!rt.test(n)||n.length>64)return`Use letters, numbers, dashes, and underscores.`;if(n===`p4-code`)return`That name belongs to P4 Code's own server.`;if(t.has(n))return`Another server already uses that name.`;if(e.type===`stdio`&&!e.command.trim())return`Enter the command that starts it.`;if(e.type===`http`&&!/^https?:\/\/\S+$/i.test(e.url.trim()))return`Enter an http or https URL.`}function at(e,t){let n=Object.fromEntries(e.values.map(e=>[e.key.trim(),e.value]).filter(([e])=>e.length>0)),r=e.type===`stdio`?{type:`stdio`,command:e.command.trim(),args:e.args.split(`
3
- `).map(e=>e.trim()).filter(e=>e.length>0),env:n,...e.cwd.trim()?{cwd:e.cwd.trim()}:{}}:{type:`http`,url:e.url.trim(),headers:n,auth:e.auth};return{name:e.name.trim(),enabled:t?.enabled??!0,transport:r,disabledProviders:t?.disabledProviders??[],...t?.source===void 0?{}:{source:t.source}}}function ot(e){let t=new Map;for(let n of e){let e=n.displayName??n.driver;for(let r of n.skills){let n=`${r.scope??``}\u0000${r.name}`,i=t.get(n);i===void 0?t.set(n,{skill:r,providers:[e]}):i.providers.includes(e)||i.providers.push(e)}}return[...t.values()].toSorted((e,t)=>st(e.skill).localeCompare(st(t.skill)))}var st=e=>e.displayName??e.name.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `);function ct(e){switch(e){case void 0:return;case`user`:return`Personal`;case`project`:case`repo`:return`Project`;case`system`:return`Built-in`;default:return e[0].toUpperCase()+e.slice(1)}}function lt(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(e);return(t===null?e:e.slice(t[0].length)).trimStart()}function ut(e){let t=(0,Y.c)(14),{title:n,onBack:r,onUninstall:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(k,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=(0,Q.jsxs)(x,{size:`xs`,variant:`ghost`,className:`w-fit`,onClick:r,children:[o,`Back`]}),t[1]=r,t[2]=s);let c;t[3]===n?c=t[4]:(c=(0,Q.jsx)(`h2`,{className:`min-w-0 truncate text-xl font-semibold text-foreground`,children:n}),t[3]=n,t[4]=c);let l;t[5]===i?l=t[6]:(l=i?(0,Q.jsxs)(x,{size:`sm`,variant:`destructive-outline`,onClick:i,children:[(0,Q.jsx)(g,{"aria-hidden":!0}),`Uninstall`]}):null,t[5]=i,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==a||t[11]!==s||t[12]!==u?(d=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[s,u,a]}),t[10]=a,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function $(e){let t=(0,Y.c)(6),{label:n,htmlFor:r,children:i}=e,a;t[0]!==r||t[1]!==n?(a=(0,Q.jsx)(Pe,{htmlFor:r,children:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[a,i]}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function dt(e){let t=(0,Y.c)(69),{server:n,takenNames:r,onSave:i}=e,a;t[0]===n?a=t[1]:(a=n===void 0?tt:nt(n),t[0]=n,t[1]=a);let o=a,[s,c]=(0,X.useState)(o),l;t[2]===o?l=t[3]:(l=JSON.stringify(o),t[2]=o,t[3]=l);let u=l,[d,f]=(0,X.useState)(u);u!==d&&(f(u),c(o));let p;t[4]!==s||t[5]!==r?(p=it(s,r),t[4]=s,t[5]=r,t[6]=p):p=t[6];let m=p,h;t[7]===s?h=t[8]:(h=JSON.stringify(s),t[7]=s,t[8]=h);let v=h!==u,y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>c(t=>({...t,...e})),t[9]=y):y=t[9];let b=y,S=s.type===`stdio`?`Environment variables`:`Headers`,C;t[10]===s.values?C=t[11]:(C=(e,t)=>b({values:s.values.map((n,r)=>r===e?{...n,...t}:n)}),t[10]=s.values,t[11]=C);let w=C,T;t[12]!==v||t[13]!==s||t[14]!==i||t[15]!==m||t[16]!==n?(T=e=>{e.preventDefault(),v&&m===void 0&&i(at(s,n))},t[12]=v,t[13]=s,t[14]=i,t[15]=m,t[16]=n,t[17]=T):T=t[17];let E;t[18]===n?E=t[19]:(E=n===void 0?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`To switch between a command and a URL, uninstall the server and add it again.`}),t[18]=n,t[19]=E);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>b({name:e.target.value}),t[20]=D):D=t[20];let O;t[21]===s.name?O=t[22]:(O=(0,Q.jsx)($,{label:`Name`,htmlFor:`mcp-server-name`,children:(0,Q.jsx)(se,{id:`mcp-server-name`,placeholder:`github`,value:s.name,onChange:D})}),t[21]=s.name,t[22]=O);let k;t[23]!==s.type||t[24]!==n?(k=n===void 0?(0,Q.jsx)($,{label:`Type`,children:(0,Q.jsxs)(ae,{"aria-label":`How P4 Code reaches the server`,value:[s.type],onValueChange:e=>{let t=e[0];(t===`stdio`||t===`http`)&&b({type:t,values:[]})},children:[(0,Q.jsx)(oe,{value:`stdio`,children:`Command`}),(0,Q.jsx)(oe,{value:`http`,children:`URL`})]})}):null,t[23]=s.type,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==s.args||t[27]!==s.auth||t[28]!==s.command||t[29]!==s.cwd||t[30]!==s.type||t[31]!==s.url?(A=s.type===`stdio`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`Command`,htmlFor:`mcp-server-command`,children:(0,Q.jsx)(se,{id:`mcp-server-command`,placeholder:`npx`,value:s.command,onChange:e=>b({command:e.target.value})})}),(0,Q.jsx)($,{label:`Arguments, one per line`,htmlFor:`mcp-server-args`,children:(0,Q.jsx)(ie,{id:`mcp-server-args`,placeholder:`-y
4
- @modelcontextprotocol/server-postgres`,value:s.args,onChange:e=>b({args:e.target.value})})}),(0,Q.jsx)($,{label:`Working directory (optional)`,htmlFor:`mcp-server-cwd`,children:(0,Q.jsx)(se,{id:`mcp-server-cwd`,placeholder:`The session's project folder`,value:s.cwd,onChange:e=>b({cwd:e.target.value})})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`URL`,htmlFor:`mcp-server-url`,children:(0,Q.jsx)(se,{id:`mcp-server-url`,placeholder:`https://mcp.example.com/mcp`,value:s.url,onChange:e=>b({url:e.target.value})})}),(0,Q.jsx)($,{label:`Authentication`,children:(0,Q.jsxs)(V,{value:s.auth,onValueChange:e=>{(e===`none`||e===`oauth`)&&b({auth:e})},children:[(0,Q.jsx)(B,{"aria-label":`Authentication`,children:(0,Q.jsx)(R,{children:ft})}),(0,Q.jsxs)(z,{alignItemWithTrigger:!1,children:[(0,Q.jsx)(L,{value:`none`,children:`None or headers`}),(0,Q.jsx)(L,{value:`oauth`,children:`OAuth (sign in after saving)`})]})]})})]}),t[26]=s.args,t[27]=s.auth,t[28]=s.command,t[29]=s.cwd,t[30]=s.type,t[31]=s.url,t[32]=A):A=t[32];let j;t[33]!==s.type||t[34]!==s.values||t[35]!==w||t[36]!==S?(j=s.values.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(se,{"aria-label":`${S} name`,placeholder:s.type===`stdio`?`API_TOKEN`:`Authorization`,value:e.key,onChange:e=>w(t,{key:e.target.value})}),(0,Q.jsx)(Ie,{"aria-label":`${S} value`,placeholder:`Value`,value:e.value,onChange:e=>w(t,{value:e.target.value})}),(0,Q.jsx)(x,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${e.key||`row`}`,onClick:()=>b({values:s.values.filter((e,n)=>n!==t)}),children:(0,Q.jsx)(g,{"aria-hidden":!0})})]},t)),t[33]=s.type,t[34]=s.values,t[35]=w,t[36]=S,t[37]=j):j=t[37];let M;t[38]===s.values?M=t[39]:(M=()=>b({values:[...s.values,{key:``,value:``}]}),t[38]=s.values,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(_,{"aria-hidden":!0}),t[40]=N):N=t[40];let P=s.type===`stdio`?`variable`:`header`,F;t[41]!==M||t[42]!==P?(F=(0,Q.jsxs)(x,{variant:`soft`,onClick:M,children:[N,`Add `,P]}),t[41]=M,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==j||t[45]!==F?(I=(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[j,F]}),t[44]=j,t[45]=F,t[46]=I):I=t[46];let H;t[47]!==I||t[48]!==S?(H=(0,Q.jsx)($,{label:S,children:I}),t[47]=I,t[48]=S,t[49]=H):H=t[49];let U;t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==H?(U=(0,Q.jsxs)(xe,{children:[O,k,A,H]}),t[50]=O,t[51]=k,t[52]=A,t[53]=H,t[54]=U):U=t[54];let W;t[55]!==v||t[56]!==m?(W=v&&m!==void 0?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:m}):null,t[55]=v,t[56]=m,t[57]=W):W=t[57];let G=!v||m!==void 0,K=n===void 0?`Add server`:`Save`,q;t[58]!==G||t[59]!==K?(q=(0,Q.jsx)(x,{type:`submit`,disabled:G,children:K}),t[58]=G,t[59]=K,t[60]=q):q=t[60];let ee;t[61]!==W||t[62]!==q?(ee=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[W,q]}),t[61]=W,t[62]=q,t[63]=ee):ee=t[63];let J;return t[64]!==U||t[65]!==ee||t[66]!==T||t[67]!==E?(J=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:T,children:[E,U,ee]}),t[64]=U,t[65]=ee,t[66]=T,t[67]=E,t[68]=J):J=t[68],J}function ft(e){return e===`oauth`?`OAuth (sign in after saving)`:`None or headers`}function pt(e){let t=(0,Y.c)(55),{environmentId:n,plugin:r,environmentLabel:i,onSave:a}=e,o=r?.path??``,s=r===void 0?null:`.claude-plugin/plugin.json`,c;t[0]!==n||t[1]!==o||t[2]!==s?(c=ye(n,o,s),t[0]=n,t[1]=o,t[2]=s,t[3]=c):c=t[3];let l=b(m(M(c))),u=We(r!==void 0&&l!==null&&!l.truncated?l.contents:null),d;t[4]===r?.options?d=t[5]:(d=r?.options??{},t[4]=r?.options,t[5]=d);let f=d,p=[...u,...Object.keys(f).filter(e=>!u.some(t=>t.key===e)).map(ht)],[h,g]=(0,X.useState)(r?.name??``),[_,v]=(0,X.useState)(r?.path??``),[y,S]=(0,X.useState)(f),C;t[6]!==r?.name||t[7]!==r?.path||t[8]!==f?(C=JSON.stringify([r?.name??``,r?.path??``,f]),t[6]=r?.name,t[7]=r?.path,t[8]=f,t[9]=C):C=t[9];let w=C,[T,E]=(0,X.useState)(w);w!==T&&(E(w),g(r?.name??``),v(r?.path??``),S(f));let D,O;t[10]!==h||t[11]!==y||t[12]!==_||t[13]!==r?.name||t[14]!==r?.path||t[15]!==f?(D=Object.fromEntries(Object.entries(y).filter(mt)),O=h!==(r?.name??``)||_!==(r?.path??``)||JSON.stringify(D)!==JSON.stringify(f),t[10]=h,t[11]=y,t[12]=_,t[13]=r?.name,t[14]=r?.path,t[15]=f,t[16]=D,t[17]=O):(D=t[16],O=t[17]);let k=O,A;t[18]!==h||t[19]!==_?(A=h.trim().length>0&&_.trim().startsWith(`/`),t[18]=h,t[19]=_,t[20]=A):A=t[20];let j=A,N;t[21]!==k||t[22]!==h||t[23]!==D||t[24]!==a||t[25]!==_||t[26]!==r?.enabled||t[27]!==j?(N=e=>{e.preventDefault(),k&&j&&a({name:h.trim(),path:_.trim(),enabled:r?.enabled??!0,options:D})},t[21]=k,t[22]=h,t[23]=D,t[24]=a,t[25]=_,t[26]=r?.enabled,t[27]=j,t[28]=N):N=t[28];let P;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>g(e.target.value),t[29]=P):P=t[29];let F;t[30]===h?F=t[31]:(F=(0,Q.jsx)($,{label:`Name`,htmlFor:`plugin-name`,children:(0,Q.jsx)(se,{id:`plugin-name`,value:h,onChange:P})}),t[30]=h,t[31]=F);let I=`Folder on ${i}`,L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>v(e.target.value),t[32]=L):L=t[32];let R;t[33]===_?R=t[34]:(R=(0,Q.jsx)(se,{id:`plugin-path`,placeholder:`/Users/me/plugins/my-plugin`,value:_,onChange:L}),t[33]=_,t[34]=R);let z;t[35]!==I||t[36]!==R?(z=(0,Q.jsx)($,{label:I,htmlFor:`plugin-path`,children:R}),t[35]=I,t[36]=R,t[37]=z):z=t[37];let B=p.map(e=>(0,Q.jsx)($,{label:e.required?e.title:`${e.title} (optional)`,htmlFor:`plugin-option-${e.key}`,children:(0,Q.jsx)(Ie,{id:`plugin-option-${e.key}`,placeholder:`description`in e?e.description:void 0,value:y[e.key]??``,onChange:t=>S(n=>({...n,[e.key]:t.target.value}))})},e.key)),V;t[38]!==F||t[39]!==z||t[40]!==B?(V=(0,Q.jsxs)(xe,{children:[F,z,B]}),t[38]=F,t[39]=z,t[40]=B,t[41]=V):V=t[41];let H;t[42]!==k||t[43]!==j?(H=k&&!j?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:`Enter a name and the plugin folder's full path.`}):null,t[42]=k,t[43]=j,t[44]=H):H=t[44];let U=!k||!j,W=r===void 0?`Add plugin`:`Save`,G;t[45]!==U||t[46]!==W?(G=(0,Q.jsx)(x,{type:`submit`,disabled:U,children:W}),t[45]=U,t[46]=W,t[47]=G):G=t[47];let K;t[48]!==H||t[49]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[H,G]}),t[48]=H,t[49]=G,t[50]=K):K=t[50];let q;return t[51]!==V||t[52]!==K||t[53]!==N?(q=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:N,children:[V,K]}),t[51]=V,t[52]=K,t[53]=N,t[54]=q):q=t[54],q}function mt(e){let[,t]=e;return t}function ht(e){return{key:e,title:e,required:!1}}var gt=e=>e.replace(/[\\/][^\\/]*$/,``)||`/`;function _t(e){let t=(0,Y.c)(69),{entry:n,environmentId:r,onClose:a}=e,{skill:o,providers:s}=n,l,u,d;t[0]!==r||t[1]!==o.path?(l=gt(o.path),u=M,d=ye(r,l,o.path),t[0]=r,t[1]=o.path,t[2]=l,t[3]=u,t[4]=d):(l=t[2],u=t[3],d=t[4]);let f=u(d),p;t[5]===f?p=t[6]:(p=b(m(f)),t[5]=f,t[6]=p);let h=p,g=ee(r),{copyToClipboard:_}=U(),y;t[7]!==r||t[8]!==o.path?(y={environmentId:r,filePath:o.path,workspaceRoot:void 0},t[7]=r,t[8]=o.path,t[9]=y):y=t[9];let S=y,C=o.shortDescription??o.description,w;t[10]===o.scope?w=t[11]:(w=ct(o.scope),t[10]=o.scope,t[11]=w);let T=w,E;t[12]===a?E=t[13]:(E=e=>!e&&a(),t[12]=a,t[13]=E);let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-12 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(F,{className:`size-5`})}),t[14]=D):D=t[14];let O;t[15]===o?O=t[16]:(O=st(o),t[15]=o,t[16]=O);let k=`More for ${O}`,A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(c,{"aria-hidden":!0}),t[17]=A):A=t[17];let N;t[18]===k?N=t[19]:(N=(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{size:`icon-sm`,variant:`ghost`,"aria-label":k,children:A})}),t[18]=k,t[19]=N);let L;t[20]!==g||t[21]!==S?(L=g.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void g.activate(`open`,S),children:`Open`}):null,t[20]=g,t[21]=S,t[22]=L):L=t[22];let R;t[23]!==g||t[24]!==S?(R=g.capabilities.revealLabel?(0,Q.jsx)(i,{onClick:()=>void g.activate(`reveal-in-folder`,S),children:g.capabilities.revealLabel}):null,t[23]=g,t[24]=S,t[25]=R):R=t[25];let z=h===null,B;t[26]!==_||t[27]!==h?(B=()=>h&&_(h.contents,void 0),t[26]=_,t[27]=h,t[28]=B):B=t[28];let V;t[29]!==z||t[30]!==B?(V=(0,Q.jsx)(i,{disabled:z,onClick:B,children:`Copy Markdown`}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==L||t[33]!==R||t[34]!==V?(H=(0,Q.jsxs)(j,{align:`end`,children:[L,R,V]}),t[32]=L,t[33]=R,t[34]=V,t[35]=H):H=t[35];let W;t[36]!==N||t[37]!==H?(W=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3 pe-8`,children:[D,(0,Q.jsxs)(v,{children:[N,H]})]}),t[36]=N,t[37]=H,t[38]=W):W=t[38];let G;t[39]===o?G=t[40]:(G=st(o),t[39]=o,t[40]=G);let K;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Skill`}),t[41]=K):K=t[41];let q;t[42]===G?q=t[43]:(q=(0,Q.jsxs)(ce,{children:[G,` `,K]}),t[42]=G,t[43]=q);let J;t[44]===C?J=t[45]:(J=C?(0,Q.jsx)(le,{children:C}):null,t[44]=C,t[45]=J);let te;t[46]!==q||t[47]!==J?(te=(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[q,J]}),t[46]=q,t[47]=J,t[48]=te):te=t[48];let ne;t[49]!==l||t[50]!==r||t[51]!==h||t[52]!==f?(ne=(0,Q.jsx)(`div`,{className:`max-h-[50vh] min-h-24 overflow-y-auto rounded-xl border border-border/60 bg-card/40 px-5 py-4`,children:h===null?f._tag===`Failure`?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This skill's file could not be read. It may have moved since the provider last scanned it.`}):(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Q.jsx)(re,{className:`h-4 w-3/4`}),(0,Q.jsx)(re,{className:`h-4 w-full`}),(0,Q.jsx)(re,{className:`h-4 w-2/3`})]}):(0,Q.jsx)(I,{text:lt(h.contents),cwd:l,environmentId:r})}),t[49]=l,t[50]=r,t[51]=h,t[52]=f,t[53]=ne):ne=t[53];let ie;t[54]===s?ie=t[55]:(ie=s.join(`, `),t[54]=s,t[55]=ie);let ae=`Loaded by ${ie}`,oe;t[56]!==T||t[57]!==ae?(oe=[T,ae].filter(Boolean),t[56]=T,t[57]=ae,t[58]=oe):oe=t[58];let se=oe.join(` · `),fe;t[59]===se?fe=t[60]:(fe=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:se}),t[59]=se,t[60]=fe);let pe;t[61]!==W||t[62]!==te||t[63]!==ne||t[64]!==fe?(pe=(0,Q.jsx)(ue,{className:`max-w-2xl`,children:(0,Q.jsxs)(`div`,{className:`grid min-h-0 gap-4 p-6`,children:[W,te,ne,fe]})}),t[61]=W,t[62]=te,t[63]=ne,t[64]=fe,t[65]=pe):pe=t[65];let me;return t[66]!==pe||t[67]!==E?(me=(0,Q.jsx)(de,{open:!0,onOpenChange:E,children:pe}),t[66]=pe,t[67]=E,t[68]=me):me=t[68],me}var vt={claude:`Claude`,codex:`Codex`,cursor:`Cursor`},yt={success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,muted:`bg-muted-foreground/40`},bt={success:`text-success-foreground`,warning:`text-warning-foreground`,error:`text-destructive-foreground`,muted:`text-muted-foreground`},xt=s(T);function St(e){let t=O(e);return xt(t)&&t.reason===`rejected`?`This server only lets apps it has approved sign in, and it refused P4 Code. Sign in with a provider below instead.`:`Sign-in could not start. Check the server URL, then try again.`}function Ct(e,t,n){return e.transport.type===`http`&&(e.transport.auth===`oauth`||n?.auth===`signed-in`||t.needsSignIn)}function wt(e){let t=(0,Y.c)(13),{status:n,className:r}=e,i=bt[n.tone],a;t[0]!==r||t[1]!==i?(a=A(`flex min-w-0 items-center gap-1.5 text-xs`,i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=yt[n.tone],s;t[3]===o?s=t[4]:(s=A(`size-1.5 shrink-0 rounded-full`,o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:s}),t[5]=s,t[6]=c);let l;t[7]===n.label?l=t[8]:(l=(0,Q.jsx)(`span`,{className:`truncate`,children:n.label}),t[7]=n.label,t[8]=l);let u;return t[9]!==a||t[10]!==c||t[11]!==l?(u=(0,Q.jsxs)(`span`,{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Tt(){let e=(0,Y.c)(6),{environment:t,scope:n}=Se(),r=t?.connection.phase===`connected`&&t.serverConfig!==null,i=r?t.environmentId:null,a=r&&t.serverConfig?.environment.capabilities.mcpRegistry===!0,o;return e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==n||e[4]!==a?(o=(0,Q.jsx)(we,{width:`wide`,children:t===null||!r?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(pe,{children:`Connect to manage plugins and MCP servers`}),(0,Q.jsx)(me,{children:`They live on each environment. Choose a connected one above.`})]})}):!a||i===null?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(pe,{children:[`Update `,t.label,` to manage plugins and MCP servers`]}),(0,Q.jsx)(me,{children:`This environment runs a version without them.`})]})}):(0,Q.jsx)(kt,{environmentId:i,environmentLabel:t.label,projectId:n.kind===`checkout`?n.checkout.id:n.kind===`project`?n.members.find(e=>e.environmentId===i)?.id:void 0,projectLabel:n.kind===`project`||n.kind===`checkout`?n.label:void 0},i)}),e[0]=r,e[1]=t,e[2]=i,e[3]=n,e[4]=a,e[5]=o):o=e[5],o}var Et={plugins:`Search plugins`,mcps:`Search MCP servers`,skills:`Search skills`},Dt=(e,...t)=>e===``||t.some(t=>t.toLowerCase().includes(e));function Ot(e){let t=(0,Y.c)(9),{text:n}=e,r=(0,X.useRef)(null),[i,a]=(0,X.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{let t=r.current;a(e&&t!==null&&t.scrollWidth>t.clientWidth)},t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(`span`,{ref:r,tabIndex:0,className:`block truncate text-xs text-muted-foreground`}),t[1]=s):s=t[1];let c,l;t[2]===n?(c=t[3],l=t[4]):(c=(0,Q.jsx)(J,{render:s,children:n}),l=(0,Q.jsx)(te,{children:n}),t[2]=n,t[3]=c,t[4]=l);let u;return t[5]!==i||t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(ne,{open:i,onOpenChange:o,children:[c,l]}),t[5]=i,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function kt({environmentId:e,environmentLabel:t,projectId:n,projectLabel:r}){let s=H({select:e=>e.hash}),[u,d]=(0,X.useState)(()=>s.replace(/^#/,``)===`mcp-servers`?`mcps`:s.replace(/^#/,``)===`skills`?`skills`:`plugins`),[f,m]=(0,X.useState)(``),[h,g]=(0,X.useState)(`All categories`),_=M(G.configValueAtom(e))?.providers,b=(0,X.useMemo)(()=>ot(_??[]),[_]),[T,O]=(0,X.useState)(null),k=be(e=>e.mcpServers),A=be(e=>e.plugins),I=be(e=>e.projectSettingsOverrides),U=be(e=>e.skillOverrides),q=ee(e),re=M(G.updateSettings.permissionAtom(e)),[ie,se]=(0,X.useState)(null),ce=M(G.mcpRegistryTest.permissionAtom(e)),le=W(e),ue=K(G.updateSettings,{label:`update MCP registry`,reportFailure:!0}),de=K(G.mcpRegistryState,{reportFailure:!1}),fe=K(G.mcpRegistryTest,{label:`check MCP server`,reportFailure:!0}),pe=K(G.mcpRegistryOAuthStart,{label:`start MCP sign-in`,reportFailure:!0}),me=K(G.mcpRegistryOAuthSignOut,{label:`sign out of MCP server`,reportFailure:!0}),he=K(G.mcpRegistryDiscover,{reportFailure:!1}),ye=K(G.mcpRegistryImport,{label:`import MCP servers`,reportFailure:!0}),[xe,Se]=(0,X.useState)({}),[Ce,we]=(0,X.useState)(new Set),[Pe,Ie]=(0,X.useState)([]),[Y,Le]=(0,X.useState)({kind:`list`}),Z=Y.kind!==`list`&&Y.id!==null&&(Y.kind===`server`?k[Y.id]===void 0:A[Y.id]===void 0)?{kind:`list`}:Y,[Be,Ve]=(0,X.useState)(s);if(s!==Be){Ve(s);let e=s.replace(/^#/,``);(e===`mcp-servers`||e===`plugins`||e===`skills`)&&(d(e===`mcp-servers`?`mcps`:e),Le({kind:`list`}))}let[He,Ue]=(0,X.useState)(null),We=(0,X.useRef)(new Map),[Ge,Ye]=(0,X.useState)(null),[Xe,Ze]=(0,X.useState)({}),Qe=(0,X.useMemo)(()=>Object.entries(k).map(([e,t])=>[o.make(e),t]).toSorted(([,e],[,t])=>e.name.localeCompare(t.name)),[k]),$e=(0,X.useMemo)(()=>Object.entries(A).map(([e,t])=>[C.make(e),t]),[A]),et=(0,X.useCallback)(async()=>{let t=await de({environmentId:e,input:{}});t._tag===`Success`&&Se(t.value.servers)},[e,de]),tt=(0,X.useCallback)(async()=>{if(!ce)return;let t=await he({environmentId:e,input:n===void 0?{}:{projectId:n}});t._tag===`Success`&&Ie(t.value.servers)},[ce,he,e,n]);(0,X.useEffect)(()=>{et(),tt()},[et,tt]);let nt=e=>{d(`mcps`),Le({kind:`server`,id:e})},rt=e=>{d(`plugins`),Le({kind:`plugin`,id:e})},it=t=>ue({environmentId:e,input:{patch:t}}),at=async t=>{we(e=>new Set(e).add(t));let n=await fe({environmentId:e,input:{serverId:t}});if(we(e=>{let n=new Set(e);return n.delete(t),n}),n._tag===`Success`)return Se(e=>({...e,[t]:n.value})),n.value},ct=(0,X.useEffectEvent)(async e=>{(await at(e))?.health.status===`connected`&&Ye(null)});(0,X.useEffect)(()=>{if(Ge===null)return;let e=()=>void ct(Ge);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Ge]);let lt=async(e,t,n)=>{(await it({mcpServers:{[e]:t}}))._tag===`Success`&&(n&&Le({kind:`list`}),tt(),t.enabled&&await at(e))},$=async(t,n=!1)=>{let r=We.current.get(t);if(!n&&Ge===t&&r){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=le??window.location.origin;Ze(e=>{let n={...e};return delete n[t],n});let a=await pe({environmentId:e,input:{serverId:t,origin:new URL(i,window.location.href).origin,...n?{reauthenticate:n}:{}}});a._tag===`Success`?a.value.authorizationUrl===null?await at(t):(We.current.set(t,a.value.authorizationUrl),Ye(t),window.open(a.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):a._tag===`Failure`&&Ze(e=>({...e,[t]:St(a.cause)}))},ft=async t=>{let n=await me({environmentId:e,input:{serverId:t}});n._tag===`Success`&&Se(e=>({...e,[t]:n.value}))},mt=(e,t,r)=>{if(n===void 0)return;let i=I[n]??{},a={...i[e]};r===void 0?delete a[t]:a[t]={enabled:r},it({projectSettingsOverrides:{[n]:{...i,[e]:a}}})},ht=async()=>{let t=He;if(Ue(null),t!==null){if(t.kind===`server`){let n=k[t.id];n?.transport.type===`http`&&n.transport.auth===`oauth`&&await me({environmentId:e,input:{serverId:t.id}}),await it({mcpServers:{[t.id]:null}})}else await it({plugins:{[t.id]:null}});Le({kind:`list`})}},gt=Pe.filter(e=>!e.alreadyAdded),yt=new Set(Qe.filter(([e])=>Z.kind!==`server`||e!==Z.id).map(([,e])=>e.name)),bt=f.trim().toLowerCase(),xt=Qe.filter(([,e])=>Dt(bt,e.name,ze(e))),Tt=$e.filter(([,e])=>Dt(bt,e.name,e.path)),kt=gt.filter(e=>Dt(bt,e.name,e.summary)),At=(e,t)=>p({mcpServers:k,plugins:A,projectSettingsOverrides:I},e,n??null,t),Mt=(e,t,r)=>{n===void 0?it(e===`mcpServers`?{mcpServers:{[t]:{...k[t],enabled:r}}}:{plugins:{[t]:{...A[t],enabled:r}}}):mt(e,t,r)},Nt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[(0,Q.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Plugins`}),(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Manage plugins, skills, and MCP servers given to agents on `,t,`.`]})]}),ce?(0,Q.jsxs)(v,{children:[(0,Q.jsx)(P,{render:(0,Q.jsxs)(x,{children:[`Add`,(0,Q.jsx)(w,{"aria-hidden":!0})]})}),(0,Q.jsxs)(j,{align:`end`,children:[(0,Q.jsxs)(i,{onClick:()=>nt(null),children:[(0,Q.jsx)(y,{"aria-hidden":!0}),`Add MCP server`]}),(0,Q.jsxs)(i,{onClick:()=>rt(null),children:[(0,Q.jsx)(a,{"aria-hidden":!0}),`Add plugin`]})]})]}):null]}),Pt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsxs)(ae,{"aria-label":`Show`,variant:`default`,value:[u],onValueChange:e=>{let t=e[0];(t===`plugins`||t===`mcps`||t===`skills`)&&(d(t),Le({kind:`list`}))},children:[(0,Q.jsxs)(oe,{value:`plugins`,...Fe(`plugins`),children:[`Plugins `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:$e.length})]}),(0,Q.jsxs)(oe,{value:`mcps`,...Fe(`mcp-servers`),children:[`MCPs `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:Qe.length})]}),(0,Q.jsxs)(oe,{value:`skills`,...Fe(`skills`),children:[`Skills `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:b.length})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full gap-2 sm:w-auto`,children:[u===`skills`?(0,Q.jsx)(`div`,{className:`w-fit shrink-0`,children:(0,Q.jsxs)(V,{value:h,onValueChange:e=>e&&g(e),children:[(0,Q.jsx)(B,{"aria-label":`Skill category`,children:(0,Q.jsx)(R,{})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(L,{value:`All categories`,children:`All categories`}),qe.filter(e=>e===`Personal`||e===`Built-in`||b.some(({skill:t})=>Je(t)===e)).map(e=>(0,Q.jsx)(L,{value:e,children:e},e))]})]})}):null,(0,Q.jsxs)(ve,{className:`min-w-0 flex-1 sm:w-56`,children:[(0,Q.jsx)(ge,{children:(0,Q.jsx)(N,{"aria-hidden":!0})}),(0,Q.jsx)(_e,{"aria-label":Et[u],placeholder:Et[u],value:f,onChange:e=>m(e.currentTarget.value)})]})]})]}),Ft=(e,t)=>(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(x,{size:`icon-sm`,variant:`ghost`,"aria-label":e,onClick:t,children:(0,Q.jsx)(D,{"aria-hidden":!0})})}),(0,Q.jsx)(te,{children:e})]}),It=Tt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:$e.length===0?`No plugins yet. Add a Claude Code or Codex plugin folder to give its tools to your agents.`:`No plugins match your search.`}):(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Tt.map(([t,n])=>(0,Q.jsx)(Ke,{environmentId:e,plugin:n,enabled:At(`plugins`,t),disabled:!re,onDetails:()=>rt(t),onToggle:e=>Mt(`plugins`,t,e)},t))}),Lt=b.filter(({skill:e})=>(h===`All categories`||Je(e)===h)&&Dt(bt,st(e),e.name,e.shortDescription??``,e.description??``)),Rt=Lt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:b.length===0?`No skills found. Providers report the skills they load when they start.`:`No skills match these filters.`}):(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Switches apply to new Claude and OpenCode sessions.`}),(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Lt.map(t=>{let r=Je(t.skill),a=(_??[]).filter(e=>l(e.driver)&&e.skills.some(e=>e.name===t.skill.name)),o=a.length?a.map(e=>e.displayName??e.driver).join(`, `):`Native settings`;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(F,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>O(t),className:`w-fit break-words text-left text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:st(t.skill)}),(0,Q.jsx)(Ot,{text:t.skill.shortDescription??t.skill.description??t.skill.path}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[r,o].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(v,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${st(t.skill)}`,children:(0,Q.jsx)(c,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Skill actions`})]}),(0,Q.jsxs)(j,{align:`end`,children:[q.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void q.activate(`open`,{environmentId:e,filePath:t.skill.path,workspaceRoot:void 0}),children:`Open`}):null,(0,Q.jsx)(i,{onClick:()=>O(t),children:`Details`}),n!==void 0&&I[n]?.skillOverrides?.[t.skill.name]!==void 0?(0,Q.jsx)(i,{onClick:()=>{let e=I[n]??{},r={...e.skillOverrides};delete r[t.skill.name],it({projectSettingsOverrides:{[n]:{...e,skillOverrides:r}}})},children:`Use environment setting`}):null]})]}),(0,Q.jsx)(Me,{"aria-label":`Enable ${st(t.skill)} for ${o}`,checked:(n===void 0?void 0:I[n]?.skillOverrides?.[t.skill.name])??U[t.skill.name]??t.skill.enabled,disabled:!re||ie!==null||a.length===0,onCheckedChange:e=>{se(t.skill.name),it(n===void 0?{skillOverrides:{[t.skill.name]:e}}:{projectSettingsOverrides:{[n]:{...I[n],skillOverrides:{...I[n]?.skillOverrides,[t.skill.name]:e}}}}).finally(()=>se(null))}})]},t.skill.path)})})]}),Bt=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Qe.length>0?(0,Q.jsx)(Te,{title:`Servers`,children:xt.length===0?(0,Q.jsx)(`p`,{className:`px-3 text-sm text-muted-foreground sm:px-4`,children:`No MCP servers match your search.`}):(0,Q.jsx)(Q.Fragment,{children:xt.map(([e,t])=>{let n=At(`mcpServers`,e),r=Re({...t,enabled:n},xe[e],Ce.has(e)),a=Xe[e],o=Ct(t,r,xe[e]);return(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),r.tone===`error`||o?(0,Q.jsx)(wt,{status:r}):null,a?(0,Q.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:a}):null]}),r.needsSignIn&&ce?(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:()=>void $(e),children:`Authenticate`}):null,o&&!r.needsSignIn&&ce?(0,Q.jsxs)(v,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(P,{render:(0,Q.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${t.name}`,children:(0,Q.jsx)(c,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Sign-in actions`})]}),(0,Q.jsxs)(j,{align:`end`,children:[(0,Q.jsx)(i,{onClick:()=>void $(e,!0),children:`Re-authenticate`}),xe[e]?.auth===`signed-in`?(0,Q.jsx)(i,{onClick:()=>void ft(e),children:`Sign out`}):null]})]}):null,Ft(`Settings for ${t.name}`,()=>nt(e)),(0,Q.jsx)(Me,{"aria-label":`Give ${t.name} to agents`,checked:n,disabled:!ce,onCheckedChange:t=>Mt(`mcpServers`,e,t)})]},e)})})}):null,ce&&kt.length>0?(0,Q.jsx)(Te,{title:`Found in provider configs`,headerAction:(0,Q.jsx)(x,{size:`icon-xs`,variant:`ghost`,"aria-label":`Look again`,onClick:()=>void tt(),children:(0,Q.jsx)(S,{"aria-hidden":!0})}),children:(0,Q.jsx)(Q.Fragment,{children:kt.map(t=>(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),kt.filter(e=>e.name===t.name).length>1?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(t.providers??[t.provider]).map(e=>vt[e]).join(`, `)}):null]}),(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:async()=>{(await ye({environmentId:e,input:{...n===void 0?{}:{projectId:n},servers:[{provider:t.provider,path:t.path,name:t.name}]}}))._tag===`Success`&&(tt(),et())},children:`Import`})]},`${t.provider}:${t.path}:${t.name}`))})}):null]}),Vt=Z.kind===`server`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add MCP server`:`Update ${k[Z.id]?.name??`server`} MCP`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`server`,id:Z.id}):void 0,children:[(0,Q.jsx)(dt,{server:Z.id===null?void 0:k[Z.id],takenNames:yt,onSave:e=>void lt(Z.id??o.make(E()),e,Z.id===null)},Z.id??`new`),Z.id!==null&&k[Z.id]!==void 0?(0,Q.jsx)(jt,{environmentId:e,id:Z.id,server:k[Z.id],runtime:xe[Z.id],checking:Ce.has(Z.id),canManage:ce,projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.mcpServers?.[Z.id],awaitingSignIn:Ge===Z.id,onProviderToggle:(e,t)=>{let n=k[Z.id],r=t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e];it({mcpServers:{[Z.id]:{...n,disabledProviders:r}}})},onProjectOverride:n===void 0?void 0:e=>mt(`mcpServers`,Z.id,e),signInError:Xe[Z.id],onTest:()=>void at(Z.id),onSignIn:()=>void $(Z.id),onReauthenticate:()=>void $(Z.id,!0),onSignOut:()=>void ft(Z.id)},`${e}:${Z.id}`):null]}):null,Ht=Z.kind===`plugin`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add plugin`:`Update ${A[Z.id]?.name??`plugin`}`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`plugin`,id:Z.id}):void 0,children:[(0,Q.jsx)(pt,{environmentId:e,plugin:Z.id===null?void 0:A[Z.id],environmentLabel:t,onSave:async e=>{let t=Z.id??C.make(E());(await it({plugins:{[t]:e}}))._tag===`Success`&&Z.id===null&&Le({kind:`list`})}},Z.id??`new`),Z.id!==null&&A[Z.id]!==void 0?(0,Q.jsx)(zt,{plugin:A[Z.id],projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.plugins?.[Z.id],onProjectOverride:n===void 0?void 0:e=>mt(`plugins`,Z.id,e)}):null]}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Nt,Pt,Vt??Ht??(u===`plugins`?It:u===`mcps`?Bt:Rt)]}),T===null?null:(0,Q.jsx)(_t,{entry:T,environmentId:e,onClose:()=>O(null)}),(0,Q.jsx)(Ee,{open:He!==null,onOpenChange:e=>!e&&Ue(null),children:(0,Q.jsxs)(ke,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsxs)(je,{children:[`Remove`,` `,He?.kind===`server`?k[He.id]?.name??`server`:He?.kind===`plugin`?A[He.id]?.name??`plugin`:``,`?`]}),(0,Q.jsxs)(Ne,{children:[`New sessions on `,t,` stop getting it. Its stored values and sign-in are deleted. Provider config files are not changed.`]})]}),(0,Q.jsxs)(De,{children:[(0,Q.jsx)(Oe,{render:(0,Q.jsx)(x,{variant:`outline`,children:`Cancel`})}),(0,Q.jsx)(x,{variant:`destructive`,onClick:()=>void ht(),children:`Remove`})]})]})})]})}function At(e){let t=(0,Y.c)(16),{projectLabel:n,override:r,inherited:i,onChange:a}=e,o=r?.enabled!==void 0,s=`In ${n}`,c=o?`Set for this project.`:`Follows the environment (${i?`on`:`off`}).`,l;t[0]!==a||t[1]!==o?(l=o?(0,Q.jsx)(x,{size:`xs`,variant:`ghost`,onClick:()=>a(void 0),children:`Reset`}):null,t[0]=a,t[1]=o,t[2]=l):l=t[2];let u=`Use in ${n}`,d=r?.enabled??i,f;t[3]===a?f=t[4]:(f=e=>a(e),t[3]=a,t[4]=f);let p;t[5]!==u||t[6]!==d||t[7]!==f?(p=(0,Q.jsx)(Me,{"aria-label":u,checked:d,onCheckedChange:f}),t[5]=u,t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==l||t[10]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,p]}),t[9]=l,t[10]=p,t[11]=m):m=t[11];let h;return t[12]!==s||t[13]!==c||t[14]!==m?(h=(0,Q.jsx)(Ce,{title:s,description:c,control:m}),t[12]=s,t[13]=c,t[14]=m,t[15]=h):h=t[15],h}function jt(e){let t=(0,Y.c)(108),{environmentId:n,id:r,server:i,runtime:a,checking:o,canManage:s,projectLabel:c,projectOverride:l,awaitingSignIn:u,signInError:f,onProviderToggle:p,onProjectOverride:m,onTest:h,onSignIn:g,onReauthenticate:_,onSignOut:v}=e,y=s&&i.transport.type===`http`&&i.transport.auth===`oauth`&&a?.auth===`signed-out`,b=Ft(n,r,y),S=b.entries,C;t[0]!==o||t[1]!==a||t[2]!==i?(C=Re(i,a,o),t[0]=o,t[1]=a,t[2]=i,t[3]=C):C=t[3];let w=C,T;t[4]===S?T=t[5]:(T=S?.filter(Nt).length??0,t[4]=S,t[5]=T);let E=T,D;t[6]!==w||t[7]!==E||t[8]!==S||t[9]!==y?(D=y?{...w,tone:`muted`,label:S===null?`Checking providers…`:E>0?`Available to ${E} ${E===1?`provider`:`providers`}`:`No providers connected`}:w,t[6]=w,t[7]=E,t[8]=S,t[9]=y,t[10]=D):D=t[10];let O=D,k,A,j,M,N,P,F;if(t[11]!==u||t[12]!==s||t[13]!==o||t[14]!==S||t[15]!==r||t[16]!==p||t[17]!==_||t[18]!==g||t[19]!==v||t[20]!==h||t[21]!==a?.auth||t[22]!==i||t[23]!==f||t[24]!==b||t[25]!==O||t[26]!==y){let e;t[34]===S?e=t[35]:(e=e=>({...e,badge:S===null||e.unsupported!==void 0?void 0:$e(e.driver,S)}),t[34]=S,t[35]=e);let n=et(i).map(e),c=i.transport.type===`http`&&a?.auth===`signed-in`,l=f??O.detail;N=`grid gap-6`,P=r;let m;t[36]===O?m=t[37]:(m=(0,Q.jsx)(wt,{status:O,className:`flex-1 text-sm`}),t[36]=O,t[37]=m);let C;t[38]!==u||t[39]!==s||t[40]!==g||t[41]!==O.needsSignIn||t[42]!==y?(C=O.needsSignIn&&s&&!y?(0,Q.jsx)(x,{size:`xs`,onClick:g,children:u?`Open sign-in again`:`Authenticate`}):null,t[38]=u,t[39]=s,t[40]=g,t[41]=O.needsSignIn,t[42]=y,t[43]=C):C=t[43];let w;t[44]!==s||t[45]!==_||t[46]!==c||t[47]!==O.needsSignIn?(w=c&&!O.needsSignIn&&s?(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:_,children:`Re-authenticate`}):null,t[44]=s,t[45]=_,t[46]=c,t[47]=O.needsSignIn,t[48]=w):w=t[48];let T;t[49]!==s||t[50]!==v||t[51]!==c?(T=c&&s?(0,Q.jsx)(x,{size:`xs`,variant:`ghost`,onClick:v,children:`Sign out`}):null,t[49]=s,t[50]=v,t[51]=c,t[52]=T):T=t[52];let E;t[53]!==s||t[54]!==o||t[55]!==h||t[56]!==i.enabled?(E=s&&i.enabled?(0,Q.jsx)(x,{size:`xs`,variant:`outline`,disabled:o,onClick:h,children:`Test connection`}):null,t[53]=s,t[54]=o,t[55]=h,t[56]=i.enabled,t[57]=E):E=t[57];let D;t[58]!==m||t[59]!==C||t[60]!==w||t[61]!==T||t[62]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[m,C,w,T,E]}),t[58]=m,t[59]=C,t[60]=w,t[61]=T,t[62]=E,t[63]=D):D=t[63];let I;t[64]!==u||t[65]!==O.needsSignIn||t[66]!==y?(I=O.needsSignIn&&!y?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u?`Finish signing in in your browser, then come back here.`:y?`Sign in here to give it to every provider.`:`Agents can't reach this server until you sign in.`}):null,t[64]=u,t[65]=O.needsSignIn,t[66]=y,t[67]=I):I=t[67];let L;t[68]!==l||t[69]!==y?(L=l&&!y?(0,Q.jsx)(`p`,{className:`rounded-md bg-destructive/8 px-2.5 py-1.5 text-xs text-destructive-foreground`,children:l}):null,t[68]=l,t[69]=y,t[70]=L):L=t[70];let R;t[71]!==u||t[72]!==l||t[73]!==g||t[74]!==y?(R=y?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:l?`Shared sign-in unavailable`:`Shared sign-in`}),(0,Q.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[(0,Q.jsx)(`p`,{children:l??`Sign in through P4 Code to share access with every enabled provider.`}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(x,{size:`xs`,variant:`outline`,onClick:g,children:u?`Open browser`:l?`Retry shared sign-in`:`Sign in through P4 Code`})})]})]}):null,t[71]=u,t[72]=l,t[73]=g,t[74]=y,t[75]=R):R=t[75];let z;t[76]===i.source?z=t[77]:(z=i.source?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Import source`}),(0,Q.jsx)(`p`,{className:`break-all pt-2`,children:i.source.path})]}):null,t[76]=i.source,t[77]=z);let B=y?(0,Q.jsx)(Lt,{serverName:i.name,signIns:b,blocked:n.filter(Mt).length}):null;t[78]!==D||t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==z||t[83]!==B?(F=(0,Q.jsx)(Te,{title:`Status`,children:(0,Q.jsx)(xe,{children:(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-3`,children:[D,I,L,R,z,B]})})}),t[78]=D,t[79]=I,t[80]=L,t[81]=R,t[82]=z,t[83]=B,t[84]=F):F=t[84],A=Te,M=`Providers`,k=xe;let V;t[85]!==s||t[86]!==p||t[87]!==i.name?(V=e=>(0,Q.jsx)(Ce,{title:e.label,...e.unsupported===void 0?{}:{description:e.unsupported},control:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.badge===void 0?null:(0,Q.jsx)(d,{variant:Rt[e.badge].variant,children:Rt[e.badge].label}),(0,Q.jsx)(Me,{"aria-label":`Give ${i.name} to ${e.label}`,checked:e.enabled&&e.badge!==`unavailable`,disabled:!s||e.unsupported!==void 0||e.badge===`unavailable`,onCheckedChange:t=>p(e.driver,t)})]})},e.driver),t[85]=s,t[86]=p,t[87]=i.name,t[88]=V):V=t[88],j=n.map(V),t[11]=u,t[12]=s,t[13]=o,t[14]=S,t[15]=r,t[16]=p,t[17]=_,t[18]=g,t[19]=v,t[20]=h,t[21]=a?.auth,t[22]=i,t[23]=f,t[24]=b,t[25]=O,t[26]=y,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F}else k=t[27],A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33];let I;t[89]!==k||t[90]!==j?(I=(0,Q.jsx)(k,{children:j}),t[89]=k,t[90]=j,t[91]=I):I=t[91];let L;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(`p`,{className:`px-3 text-xs text-muted-foreground sm:px-4`,children:`A change reaches a thread when its provider session next starts.`}),t[92]=L):L=t[92];let R;t[93]!==A||t[94]!==M||t[95]!==I?(R=(0,Q.jsxs)(A,{title:M,children:[I,L]}),t[93]=A,t[94]=M,t[95]=I,t[96]=R):R=t[96];let z;t[97]!==m||t[98]!==c||t[99]!==l||t[100]!==i.enabled?(z=c!==void 0&&m!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(xe,{children:(0,Q.jsx)(At,{projectLabel:c,override:l,inherited:i.enabled,onChange:m})})}):null,t[97]=m,t[98]=c,t[99]=l,t[100]=i.enabled,t[101]=z):z=t[101];let B;return t[102]!==R||t[103]!==z||t[104]!==N||t[105]!==P||t[106]!==F?(B=(0,Q.jsxs)(`div`,{className:N,"data-server-id":P,children:[F,R,z]}),t[102]=R,t[103]=z,t[104]=N,t[105]=P,t[106]=F,t[107]=B):B=t[107],B}function Mt(e){return e.enabled&&e.badge===`unavailable`}function Nt(e){return e.status===`signed-in`}function Pt(e){let t=O(e);return xt(t)&&t.detail!==void 0?t.detail:`Sign-in could not start. Try again.`}function Ft(e,t,n){let r=K(G.mcpRegistryProviderSignInState,{reportFailure:!1}),i=K(G.mcpRegistryProviderSignInStart,{reportFailure:!1}),a=K(G.mcpRegistryProviderSignInWait,{reportFailure:!1}),o=K(G.mcpRegistryProviderSignInComplete,{reportFailure:!1}),s=K(G.mcpRegistryProviderSignInCancel,{reportFailure:!1}),c=K(G.mcpRegistryProviderSignOut,{reportFailure:!1}),l=M(G.mcpRegistryProviderSignInComplete.permissionAtom(e)),u=M(G.mcpRegistryProviderSignInCancel.permissionAtom(e)),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)({}),[h,g]=(0,X.useState)(new Set),_=(0,X.useRef)(new Set),v=e=>f(t=>t?.map(t=>t.instanceId===e.instanceId?e:t)??null),y=(e,t)=>m(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r});return(0,X.useEffect)(()=>{if(!n)return;let i=!1;return r({environmentId:e,input:{serverId:t}}).then(e=>{i||f(e._tag===`Success`?e.value.providers:[])}),()=>{i=!0}},[n,e,r,t]),(0,X.useEffect)(()=>{if(!n)return;let r=!1;for(let n of d??[]){let i=n.pending;i&&a({environmentId:e,input:{serverId:t,instanceId:n.instanceId,flowId:i.flowId}}).then(e=>{r||(f(t=>t?.map(t=>{if(t.instanceId!==n.instanceId||t.pending?.flowId!==i.flowId)return t;if(e._tag===`Success`)return e.value;let{pending:r,...a}=t;return a})??null),e._tag===`Failure`?y(n.instanceId,Pt(e.cause)):e._tag===`Success`&&e.value.status!==`signed-in`&&!_.current.has(n.instanceId)&&y(n.instanceId,`Sign-in ended without connecting. Try again.`))})}return()=>{r=!0}},[n,d,e,t,a]),{entries:n?d:null,errors:p,busy:h,run:async(n,r,a)=>{if(!_.current.has(n.instanceId)){_.current.add(n.instanceId),g(new Set(_.current)),y(n.instanceId,void 0);try{let l={serverId:t,instanceId:n.instanceId};if(r===`start`){let t=await i({environmentId:e,input:l});t._tag===`Success`?(v({...n,pending:t.value}),window.open(t.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):t._tag===`Failure`&&y(n.instanceId,Pt(t.cause));return}let u={...l,flowId:n.pending?.flowId??``},d=r===`complete`?await o({environmentId:e,input:{...u,callbackUrl:a.trim()}}):r===`cancel`?await s({environmentId:e,input:u}):await c({environmentId:e,input:l});d._tag===`Success`?v(d.value):d._tag===`Failure`&&y(n.instanceId,Pt(d.cause))}finally{_.current.delete(n.instanceId),g(new Set(_.current))}}},canComplete:l,canCancel:u}}function It(e){let t=(0,Y.c)(39),{entry:n,signIns:r}=e,i;t[0]!==n.displayName||t[1]!==n.driver?(i=n.displayName??Ze(n.driver),t[0]=n.displayName,t[1]=n.driver,t[2]=i):i=t[2];let a=i,[o,s]=(0,X.useState)(``),c=n.pending,l;t[3]!==n.instanceId||t[4]!==r.busy?(l=r.busy.has(n.instanceId),t[3]=n.instanceId,t[4]=r.busy,t[5]=l):l=t[5];let u=l,d=r.errors[n.instanceId],f=`mcp-callback-${n.instanceId}`,p;t[6]===a?p=t[7]:(p=(0,Q.jsx)(`p`,{className:`text-sm font-medium`,children:a}),t[6]=a,t[7]=p);let m=c?`text-warning-foreground`:n.status===`signed-in`?`text-success-foreground`:`text-muted-foreground`,h;t[8]===m?h=t[9]:(h=A(`text-xs`,m),t[8]=m,t[9]=h);let g;t[10]!==n.status||t[11]!==c?(g=c?`Waiting for sign-in`:Qe(n.status),t[10]=n.status,t[11]=c,t[12]=g):g=t[12];let _;t[13]!==h||t[14]!==g?(_=(0,Q.jsx)(`p`,{className:h,role:`status`,children:g}),t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==p||t[17]!==_?(v=(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[p,_]}),t[16]=p,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==u||t[20]!==n||t[21]!==d||t[22]!==c||t[23]!==r?(y=!c&&n.status!==`unavailable`?(0,Q.jsx)(x,{size:`xs`,variant:n.status===`signed-in`?`outline`:`default`,disabled:u,onClick:()=>void r.run(n,n.status===`signed-in`?`signOut`:`start`),children:u?`Please wait…`:n.status===`signed-in`?`Sign out`:d?`Start over`:`Sign in`}):null,t[19]=u,t[20]=n,t[21]=d,t[22]=c,t[23]=r,t[24]=y):y=t[24];let b;t[25]!==v||t[26]!==y?(b=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[v,y]}),t[25]=v,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==u||t[29]!==o||t[30]!==n||t[31]!==d||t[32]!==f||t[33]!==c||t[34]!==r?(S=c?(0,Q.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault(),o.trim()&&!u&&r.canComplete&&r.run(n,`complete`,o)},children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Approve in your browser. If it ends on a callback URL, paste that URL here.`}),(0,Q.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium`,children:`Callback URL`}),(0,Q.jsx)(se,{id:f,value:o,onChange:e=>s(e.target.value),placeholder:`http://localhost:…/callback?code=…&state=…`,autoComplete:`off`,spellCheck:!1,disabled:u||!r.canComplete,"aria-invalid":!!d,"aria-describedby":d?`${f}-error`:void 0}),d?(0,Q.jsx)(`p`,{id:`${f}-error`,role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(x,{type:`submit`,size:`xs`,disabled:u||!o.trim()||!r.canComplete,children:u?`Please wait…`:`Finish sign-in`}),(0,Q.jsx)(x,{type:`button`,size:`xs`,variant:`outline`,disabled:u,onClick:()=>window.open(c.authorizationUrl,`_blank`,`noopener,noreferrer`),children:`Open browser`}),(0,Q.jsx)(x,{type:`button`,size:`xs`,variant:`ghost`,disabled:u||!r.canCancel,onClick:()=>void r.run(n,`cancel`),children:`Cancel`})]})]}):d?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,t[28]=u,t[29]=o,t[30]=n,t[31]=d,t[32]=f,t[33]=c,t[34]=r,t[35]=S):S=t[35];let C;return t[36]!==b||t[37]!==S?(C=(0,Q.jsxs)(`div`,{className:`grid gap-2 border-t border-border pt-3`,children:[b,S]}),t[36]=b,t[37]=S,t[38]=C):C=t[38],C}function Lt(e){let t=(0,Y.c)(8),{serverName:n,signIns:r,blocked:i}=e,a;t[0]===r?a=t[1]:(a=r.entries===null?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Checking providers…`}):r.entries.length===0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No enabled provider here can sign in to MCP servers itself.`}):r.entries.map(e=>(0,Q.jsx)(It,{entry:e,signIns:r},`${e.instanceId}:${e.pending?.flowId??`idle`}`)),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n?(o=i>0?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer`,children:[i,` other `,i===1?`provider`:`providers`,` unavailable`]}),(0,Q.jsxs)(`p`,{className:`pt-2`,children:[`These providers need shared sign-in to use `,n,`.`]})]}):null,t[2]=i,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Rt={"signed-in":{variant:`success`,label:`Signed in`},"needs-sign-in":{variant:`warning`,label:`Sign in needed`},unavailable:{variant:`secondary`,label:`Unavailable`}};function zt(e){let t=(0,Y.c)(7),{plugin:n,projectLabel:r,projectOverride:i,onProjectOverride:a}=e,o;t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==i?(o=r!==void 0&&a!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(xe,{children:(0,Q.jsx)(At,{projectLabel:r,override:i,inherited:n.enabled,onChange:a})})}):null,t[0]=a,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;return t[5]===o?s=t[6]:(s=(0,Q.jsx)(`div`,{className:`grid gap-6`,children:o}),t[5]=o,t[6]=s),s}var Bt=Tt;export{Bt as component};
5
- //# sourceMappingURL=settings.plugins-M2Rc23zw.js.map
@@ -1,4 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-DqEEBoMA.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/utils-CxCThU1r.js","assets/activity-CbqMUSRC.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-down-up-CQvYrirj.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/box-D-FyjNxy.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chevrons-up-down-DakHVkrx.js","assets/chromium-x91nZeen.js","assets/circle-alert-DsKXULDS.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-x-DMkHWcTz.js","assets/circle-Doq0I3MA.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/download-S2u-tXaE.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/ellipsis-Zza4fevQ.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-code-corner-eTofF8xM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/folder-7OwzWKex.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/history-CdIQPf9A.js","assets/house-ClTLFcnB.js","assets/image-Dp6bFTt-.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/layers-DnKM4R7R.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/link-BG0xfm4f.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/lock-CUPWkQFd.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize-2-Ci1M4n4b.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/message-square-HrqKYo9g.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plus-B2sOrZDk.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/refresh-cw-D5OcXJqv.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/search-BXnNiPfE.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/settings-DSIgI7hn.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/square-ekoTCPwL.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/type-CjUvBO4t.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/upload-Cra7ct3V.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/wifi-off-ODm5nCE4.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/x-C35beONT.js","assets/zap-BIb9m3mg.js","assets/toggle-group-DpO88ac2.js","assets/CompositeRoot-DY7iUA_s.js","assets/toggle-BrZqohX5.js","assets/input-DTnuNfU_.js","assets/Input-Bple6iXe.js","assets/FieldControl-CVCCrg1T.js","assets/useRegisterFieldControl-BTyFUE5E.js","assets/scroll-area-D1ITiKsD.js","assets/ScrollAreaCorner-Dhc-TjWb.js","assets/CSPContext-jKZ42W4p.js","assets/dialog-CsGXTrQp.js","assets/DialogTitle-9BKGozK3.js","assets/ProjectMonogram-CjI4Va2u.js","assets/dynamic-cm3g4l5C.js","assets/index-DFvDwgHR.js"])))=>i.map(i=>d[i]);
2
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-DFvDwgHR.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,D as o,Ds as s,Iy as c,Jf as l,Mc as u,Qn as d,Qs as f,Rm as p,Rw as m,Xp as h,Yn as g,Z_ as _,Zn as v,Zs as y,ar as b,bs as x,dr as S,jd as C,lv as w,mm as T,n as E,on as D,r as O,rv as k,tr as ee,ts as A,ur as te}from"./utils-CxCThU1r.js";import{R as ne,U as j,W as re,z as M}from"./runtime-Du_4upLP.js";import{A as N,F as ie,G as P,w as F}from"./entities-BjGK6yEY.js";import{An as I}from"./runtime-mXszmljC.js";import{t as L}from"./useNavigate-ut7tie8O.js";import{t as R}from"./useLocation-jsSq4KCV.js";import{i as z}from"./toast-NSvYVPhH.js";import{D as B,G as V,T as ae,q as oe}from"./useSettings-FRbaNpbg.js";import{f as H,s as U}from"./server-BRIc5okw.js";import{n as W,o as G}from"./session-wmJod3Hf.js";import{t as K}from"./use-atom-command-BfhNaUIU.js";import{t as q}from"./toastHelpers-DxXYm50b.js";import{t as J}from"./input-DTnuNfU_.js";import{n as Y}from"./assetUrls-DSRw9lrZ.js";import{D as X,E as se,O as ce,j as le,y as ue}from"./keybindings-CCgj9REF.js";import{t as de}from"./PierreEntryIcon-Cuq8Bvxz.js";import{t as fe}from"./ProjectFavicon-DCKipqYA.js";import{d as pe}from"./projectFilesQueryState-CZkTtV37.js";import{n as me}from"./p4ProjectFile-BQUacEue.js";import{r as he,t as ge}from"./alert-BeaSxmEt.js";import{L as _e,V as ve,W as ye,a as Z,i as be,r as xe,s as Se}from"./settingsLayout-7rl00kQL.js";import{i as Ce,o as we,r as Te}from"./command-BAykm7lf.js";import{En as Ee,On as De,oa as Oe,qi as ke,yn as Ae}from"./main-BqFaDMNs.js";import{c as je,f as Me,i as Ne,n as Pe,o as Fe,r as Ie,s as Le,t as Re}from"./projectScriptEditor-BApTdMa4.js";import{t as ze}from"./ProjectDefaultsSettings-Bxz5MdOY.js";import{t as Be}from"./SettingsScopeNotice-LfKqlEQx.js";var Ve=r(),Q=e(t(),1),$=e(i(),1);function He(e){let t=(0,Ve.c)(14),n=(0,Q.useRef)(null),[r,i]=(0,Q.useState)(We),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{let e=n.current;if(r||!e)return;let t=new IntersectionObserver(e=>{e.some(Ue)&&i(!0)});return t.observe(e),()=>t.disconnect()},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]!==r||t[4]!==e.cwd||t[5]!==e.path?(d=r?{_tag:`draft-workspace-file`,cwd:e.cwd,path:e.path}:null,t[3]=r,t[4]=e.cwd,t[5]=e.path,t[6]=d):d=t[6];let f=Y(e.environmentId,d),p=f._tag===`Success`?f.url:null,m=p!==null&&s!==p,h=m&&a===p,g=h?null:e.fallback,_;t[7]!==h||t[8]!==m||t[9]!==p?(_=m?(0,$.jsx)(`img`,{alt:``,className:`absolute max-h-8 max-w-8 rounded-sm object-contain${h?``:` invisible`}`,decoding:`async`,loading:`lazy`,onError:()=>c(p),onLoad:()=>o(p),src:p},p):null,t[7]=h,t[8]=m,t[9]=p,t[10]=_):_=t[10];let v;return t[11]!==g||t[12]!==_?(v=(0,$.jsxs)(`span`,{ref:n,className:`relative flex size-8 shrink-0 items-center justify-center`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13],v}function Ue(e){return e.isIntersecting}function We(){return typeof IntersectionObserver>`u`}function Ge(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function Ke(e,t){return!O(t)||I(e)}function qe(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=pe(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=V(),l=A(U),u=e.onPickExternal,d=E(typeof navigator>`u`?``:navigator.platform),f=(0,Q.useMemo)(()=>Ae(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(He,{cwd:e.cwd,environmentId:e.environmentId,fallback:(0,$.jsx)(de,{pathValue:t.path,kind:`file`,theme:c}),path:t.path}),run:async()=>e.onSelect(t.path)})),[e.cwd,e.environmentId,e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(Te,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(Ce,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(De,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(we,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{z.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${d}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(Ee,{groups:f.length>0?[{value:`project-favicon-files`,label:e.projectName,items:f}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ge(t,s.error,s.isPending)})})}):null})}function Je(e){let t=(0,Ve.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let o;if(t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==a?(e=e=>{let t=ue(r,X(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ie,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.runOnSettle?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`on settle`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(S,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(T,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=a,t[9]=e):e=t[9],o=n.map(e),t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o}else o=t[5];return o}function Ye(e){if(e._tag===`Failure`&&!ne(e)){let t=re(e);z.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return M(e,()=>void 0)}function Xe(e){let t=F(),[n,r]=(0,Q.useState)(!1),i=(0,Q.useRef)(!1),a=K(H.updateSettings,`project actions update`),o=K(H.upsertKeybinding,`action shortcut update`),c=K(H.removeKeybinding,`action shortcut removal`);async function l(n,l,u){if(i.current||e.length===0){let e=`No available machine, or another action change is saving.`;return z.add({type:`error`,title:`Actions not saved`,description:e}),x(m(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ye(x(m(new w({requiredScope:k,message:`This connection cannot change environment settings.`}))));i.current=!0,r(!0);try{for(let{environmentId:r,settings:i,keybindings:s,project:d}of e){let e=d?Me(i,d):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await a({environmentId:r,input:{patch:d?{projectSettingsOverrides:{[d.id]:f===null?me(i,d.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[d.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ye(m);let h=l?[l]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=X(e),a=je(s,n),l=a?Le({keybinding:a,command:n}):null,p=Le({keybinding:u,command:n}),m=!f?.some(t=>t.id===e)&&(d&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==d?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==d?.id&&(d?Me(i,t):t.scripts).some(t=>t.id===e))),h=p?await o({environmentId:r,input:l&&l.key!==p.key?{...p,replace:l}:p}):l&&!m?await c({environmentId:r,input:l}):null;if(h?._tag===`Failure`)return Ye(h)}}return s(void 0)}finally{i.current=!1,r(!1)}}function u(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??ce(r.name,i),o=se(a,r);return l(e=>{let t=e.map(e=>e.id===a?o:le(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:l,submit:u}}function Ze(){let e=(0,Ve.c)(67),{scope:t,targets:n,target:r}=ve(),{environments:i}=ae(),o=t.kind===`project`||t.kind===`checkout`,s;e[0]!==i||e[1]!==r?(s=r?i.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=i,e[1]=r,e[2]=s):s=e[2];let l=s,f;e[3]===r?.settings.defaultProjectScripts?f=e[4]:(f=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=f);let p=f,m=l?.keybindings??u,_;if(e[5]!==p||e[6]!==n){let t;e[8]===p?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(p),e[8]=p,e[9]=t),_=n.some(t),e[5]=p,e[6]=n,e[7]=_}else _=e[7];let y=_,x=_e(),[w,T]=(0,Q.useState)(null),E,D,O;e[10]!==i||e[11]!==o||e[12]!==t.members||e[13]!==n?(E=new Map(o?t.members.map($e):[]),D=Xe,O=n.flatMap(e=>{let t=i.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?E.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=i,e[11]=o,e[12]=t.members,e[13]=n,e[14]=E,e[15]=D,e[16]=O):(E=e[14],D=e[15],O=e[16]);let{saving:k,persist:A,submit:j}=D(O),M;e[17]!==E||e[18]!==r?(M=r?.projectId?E.get(r.projectId):void 0,e[17]=E,e[18]=r,e[19]=M):M=e[19];let N=M,ie;e[20]===N?.environmentId?ie=e[21]:(ie=N?.environmentId??c.make(`none`),e[20]=N?.environmentId,e[21]=ie);let P=Fe(ie,N?.workspaceRoot??null),F;if(e[22]!==P.scripts||e[23]!==p){let t;e[25]===p?t=e[26]:(t=e=>!p.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=p,e[26]=t),F=P.scripts.filter(t),e[22]=P.scripts,e[23]=p,e[24]=F}else F=e[24];let I=F,L;e[27]===j?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await j(null,t);if(n._tag===`Failure`&&!ne(n)){let e=re(n);T({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=j,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===A?B=e[31]:(B=()=>void A(Qe),e[30]=A,e[31]=B);let V;e[32]!==x||e[33]!==R||e[34]!==I||e[35]!==k?(V=I.length>0?(0,$.jsxs)(g,{children:[(0,$.jsxs)(te,{render:(0,$.jsx)(S,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:k||!x,type:`button`}),children:[`Import scripts`,(0,$.jsx)(C,{className:`size-3.5`})]}),(0,$.jsxs)(ee,{align:`end`,children:[(0,$.jsxs)(v,{children:[(0,$.jsx)(d,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(b,{}),I.map(e=>(0,$.jsxs)(a,{onClick:()=>void R(e),children:[(0,$.jsx)(Ie,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=x,e[33]=R,e[34]=I,e[35]=k,e[36]=V):V=e[36];let oe=k||!x||n.length===0,H,U;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>T({scriptId:null,initial:Re}),U=(0,$.jsx)(h,{className:`size-3.5`}),e[37]=H,e[38]=U):(H=e[37],U=e[38]);let W;e[39]===oe?W=e[40]:(W=(0,$.jsxs)(S,{size:`xs`,variant:`outline`,disabled:oe,onClick:H,children:[U,`Add action`]}),e[39]=oe,e[40]=W);let G;e[41]!==V||e[42]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,W]}),e[41]=V,e[42]=W,e[43]=G):G=e[43];let K;e[44]!==y||e[45]!==B||e[46]!==G?(K=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:y,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:G}),e[44]=y,e[45]=B,e[46]=G,e[47]=K):K=e[47];let q;e[48]!==x||e[49]!==m||e[50]!==y||e[51]!==k||e[52]!==p?(q=y?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(Je,{scripts:p,keybindings:m,disabled:k||!x,onEdit:e=>T(Ne(e,m))}),e[48]=x,e[49]=m,e[50]=y,e[51]=k,e[52]=p,e[53]=q):q=e[53];let J;e[54]===P.status?J=e[55]:(J=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=J);let Y;e[56]!==A||e[57]!==w||e[58]!==p||e[59]!==j||e[60]!==r?(Y=r&&(0,$.jsx)(Pe,{environmentId:r.environmentId,editScope:`settings:write`,request:w,scripts:p,onSubmit:j,onDelete:e=>void A(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>T(null)}),e[56]=A,e[57]=w,e[58]=p,e[59]=j,e[60]=r,e[61]=Y):Y=e[61];let X;return e[62]!==K||e[63]!==q||e[64]!==J||e[65]!==Y?(X=(0,$.jsxs)(Se,{id:`project-actions`,title:`Actions`,children:[K,q,J,Y]}),e[62]=K,e[63]=q,e[64]=J,e[65]=Y,e[66]=X):X=e[66],X}function Qe(){return null}function $e(e){return[e.id,e]}function et(e,t,n){return n&&e.some(e=>e!==t)}var tt=(0,Q.lazy)(()=>n(()=>import(`./ProjectIconPickerDialog-DqEEBoMA.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233])));function nt(e){return`${e.environmentId}:${e.id}`}function rt(e){let t=(0,Ve.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=ye(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=L(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:at},t[1]=u):u=t[1];let d=R(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(it)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(ot,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function it(e){return e.physicalProjectKey}function at(e){return e.pathname}function ot({group:e,hasOtherMembers:t}){let n=L({from:`/settings`}),r=B(),{environments:i}=ae(),a=(0,Q.useMemo)(()=>new Map(i.map(e=>[e.environmentId,e])),[i]),c=G(e.memberProjects,_),u=e.memberProjects.every(e=>c.has(e.environmentId)),d=e.memberProjects.find(e=>a.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],h=N(),g=Oe(P.update,{reportFailure:!1}),v=Oe(P.delete,{reportFailure:!1}),b=(0,Q.useRef)(!1),C=d.faviconPath??null,w=d.projectIcon??null,T=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&Ke(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,E=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||ne(t))return;let n=re(t);z.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),O=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,_));if(!n)return null;let r=x(m(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return E(t,r),r},[E]),k=(0,Q.useCallback)(async(t,n)=>{let r=O(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=a.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=x(m(e));return E(n,t),t}for(let r of e.memberProjects){let i=O([r],n);if(i)return i;let a=M(await g({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return E(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return s(void 0)},[O,a,e.memberProjects,E,g]),ee=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();r?et(e.memberProjects.map(e=>e.title),r,n)&&await k({title:r},`Failed to rename project`):z.add({type:`warning`,title:`Project title cannot be empty`})},[e.memberProjects,k]),[A,te]=D(!u),[F,I]=D(!u),[R,V]=(0,Q.useState)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useCallback)(async e=>{if(!H.current){H.current=!0,V(!0);try{await k(e,`Failed to update project icon`)}finally{H.current=!1,V(!1)}}},[k]),K=e.memberProjects.length>1,Y=(0,Q.useCallback)(async r=>{if(O(r,`Failed to remove project`))return;let i=oe();if(!i)return;let a=new Set(r.map(nt)),s=h.filter(e=>a.has(`${e.environmentId}:${e.projectId}`)),c=r.length===e.memberProjects.length,l=t||!c?`checkout`:`project`,u=r.length===1?r[0]:null,d=u?.title??e.displayName,p=await j(()=>i.dialogs.confirm([s.length>0?`Remove ${l} "${d}" and delete its ${s.length} thread${s.length===1?``:`s`}?`:`Remove ${l} "${d}"?`,...u?[`Path: ${u.workspaceRoot}`,...u.environmentLabel?[`Environment: ${u.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...s.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],c&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
3
- `),{variant:`destructive`}));if(p._tag===`Failure`||!p.value||O(r,`Failed to remove project`))return;let m=o.getState();for(let e of r){if(O([e],`Failed to remove project`))return;let t=s.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id),n=M(await v({environmentId:e.environmentId,input:{projectId:e.id,force:!0}}),()=>void 0);if(n._tag===`Failure`){E(`Failed to remove "${e.title}"`,n);return}let r=y(e.environmentId,e.id);await ie(r),ke(r,t.map(e=>f(e.environmentId,e.id)));let i=m.getDraftThreadByProjectRef(r);i&&m.clearDraftThread(i.draftId),m.clearProjectDraftThreadId(r)}c&&!t&&n({to:`/`,replace:!0})},[O,v,e.displayName,e.memberProjects.length,t,n,E,h]),X=(0,$.jsx)(Se,{title:`Checkouts`,children:e.memberProjects.map(e=>(0,$.jsx)(Z,{title:e.environmentLabel??`Environment`,description:e.workspaceRoot,control:(0,$.jsx)(S,{size:`sm`,variant:`outline`,disabled:!c.has(e.environmentId),onClick:()=>void Y([e]),"aria-label":`Remove checkout ${e.workspaceRoot}`,children:`Remove`})},e.physicalProjectKey))});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(be,{className:`gap-6`,children:[(0,$.jsxs)(ge,{variant:`info`,children:[(0,$.jsx)(l,{"aria-hidden":!0}),(0,$.jsx)(he,{children:`Can't find a setting? Keep this project picked above and hop to any other settings page.`})]}),(0,$.jsxs)(Se,{id:`project-overview`,title:`Project`,hideTitle:!0,children:[u?null:(0,$.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground sm:px-4`,children:e.memberProjects.length>1?`Shared settings require permission to change every checkout in this group.`:`This connection cannot change this project.`}),(0,$.jsx)(Z,{title:`Name`,description:`The shared name for this project group in the sidebar and thread lists.`,control:(0,$.jsx)(J,{size:`sm`,className:`w-full sm:w-64`,"aria-label":`Project name`,disabled:!u,defaultValue:e.displayName,onChange:()=>{b.current=!0},onBlur:e=>{let t=b.current;b.current=!1,ee(e.currentTarget.value,t)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.projectKey}:${e.displayName}`)}),(0,$.jsx)(Z,{title:`Project icon`,description:w?.kind===`lucide`?`${w.name} · ${w.color}`:w?.kind===`monogram`?`${w.text} · ${w.color}`:w?.kind===`emoji`?w.emoji:C??`Automatic`,resetAction:e.memberProjects.some(e=>e.faviconPath!=null||e.projectIcon!=null)?(0,$.jsx)(xe,{label:`project icon`,disabled:R||!u,onClick:()=>void U({faviconPath:null,projectIcon:null})}):null,control:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(fe,{project:d,className:`size-6`}),(0,$.jsx)(S,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon`,disabled:R||!u,onClick:()=>I(!0),children:`Choose icon`}),(0,$.jsx)(S,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon file`,disabled:R||!u,onClick:()=>te(!0),children:`Choose file`})]})})]}),(0,$.jsx)(ze,{category:`project`}),(0,$.jsx)(Ze,{}),K?X:null,(0,$.jsx)(Se,{title:`Danger`,children:(0,$.jsx)(Z,{title:t?`Remove checkout`:e.memberProjects.length>1?`Remove this project everywhere`:`Remove project`,description:t?`Deletes the selected machine's checkout entries and their threads. Other machines and files on disk are not touched.`:e.memberProjects.length>1?`Deletes all ${e.memberProjects.length} checkout entries and their threads on every machine. Files on disk are not touched.`:`Deletes the project entry and its threads. Files on disk are not touched.`,control:(0,$.jsxs)(S,{size:`sm`,variant:`destructive-outline`,disabled:!u,onClick:()=>void Y(e.memberProjects),children:[(0,$.jsx)(p,{}),t?`Remove checkout`:e.memberProjects.length>1?`Remove all entries`:`Remove project`]})})})]}),(0,$.jsx)(qe,{cwd:d.workspaceRoot,environmentId:d.environmentId,onOpenChange:te,...T?{onPickExternal:()=>T(d.workspaceRoot)}:{},onSelect:e=>void U({faviconPath:e,projectIcon:null}),open:A&&u,projectName:e.displayName},`${d.environmentId}:${d.workspaceRoot}:${A}`),F&&u?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(tt,{current:w,projectName:d.title,open:!0,onOpenChange:I,onSelect:e=>void U({faviconPath:null,projectIcon:e})})}):null]})}function st(){let e=(0,Ve.c)(7),{search:t,scope:n}=ve(),r=n.kind===`project`||n.kind===`checkout`||n.kind===`unavailable`&&(n.reason===`project-missing`||n.reason===`checkout-missing`),i;return e[0]!==r||e[1]!==n.kind||e[2]!==n.message||e[3]!==t.checkout||e[4]!==t.machine||e[5]!==t.project?(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t.project&&r?(0,$.jsx)(rt,{projectKey:t.project,environmentId:t.machine?c.make(t.machine):null,checkoutKey:t.checkout??null}):n.kind===`unavailable`?(0,$.jsx)(be,{children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.message})}):(0,$.jsx)(Be,{target:`project`,children:`Choose a project to manage its name, icon, checkouts and actions.`})}),e[0]=r,e[1]=n.kind,e[2]=n.message,e[3]=t.checkout,e[4]=t.machine,e[5]=t.project,e[6]=i):i=e[6],i}var ct=st;export{ct as component};
4
- //# sourceMappingURL=settings.projects-tykSh6-D.js.map