ryco-cli 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/dist/bin.cjs +1 -1
  2. package/dist/bin.mjs +1 -1
  3. package/dist/client/assets/AccountSettings-C3v2klAG.js +1 -0
  4. package/dist/client/assets/AiFocusSettings-BquKjnWf.js +1 -0
  5. package/dist/client/assets/AnimatedHeight-BIsV_Z3J.js +1 -0
  6. package/dist/client/assets/AppearanceSettings-CYbSApl4.js +1 -0
  7. package/dist/client/assets/{BranchToolbar.logic-C1Dh4xQW.js → BranchToolbar.logic-CmvD76Cw.js} +1 -1
  8. package/dist/client/assets/ChatRightPanel-DVxRdZWT.js +27 -0
  9. package/dist/client/assets/ChatThreadRouteView-DlgAAOCp.js +1 -0
  10. package/dist/client/assets/CommandPaletteDialog-BnJURcy7.js +1 -0
  11. package/dist/client/assets/{CompositeItem-D-K93PI3.js → CompositeItem-F3NGn6aG.js} +1 -1
  12. package/dist/client/assets/CompositeRoot-CmJGfRtc.js +1 -0
  13. package/dist/client/assets/ConnectionsSettings-Ccn8q4fG.js +7 -0
  14. package/dist/client/assets/DiagnosticsSettings-QXpjXOrH.js +2 -0
  15. package/dist/client/assets/{DialogHandle-pL0RAsXa.js → DialogHandle-C4uSr9wX.js} +1 -1
  16. package/dist/client/assets/DialogPopup-Dck8r8Hn.js +1 -0
  17. package/dist/client/assets/DialogRoot-BpIvUdm7.js +1 -0
  18. package/dist/client/assets/{DialogTitle-BamZsRNz.js → DialogTitle-CCedPAjV.js} +1 -1
  19. package/dist/client/assets/{DialogTrigger-DR3vtVpa.js → DialogTrigger-CYJ7_YcV.js} +1 -1
  20. package/dist/client/assets/DialogViewport-D-CrTM-P.js +1 -0
  21. package/dist/client/assets/DraftChatThreadRouteView-DFMY6O91.js +1 -0
  22. package/dist/client/assets/{GlassSurface-DTmaROoR.js → GlassSurface-C3IIWMu9.js} +1 -1
  23. package/dist/client/assets/HostedConnectionControls-BC4kVWTa.js +1 -0
  24. package/dist/client/assets/HostedHubRoot-pBGVub10.js +1 -0
  25. package/dist/client/assets/HostedNativeAuthorizationRoute-Df0oSrLR.js +1 -0
  26. package/dist/client/assets/HostedRelayTrustNotice-ffS_O2AX.js +1 -0
  27. package/dist/client/assets/Icons-CT3nd2MA.js +1 -0
  28. package/dist/client/assets/IntegrationsSettingsPanel-BHyy-VM0.js +1 -0
  29. package/dist/client/assets/KeybindingsSettings-BfkONqmZ.js +7 -0
  30. package/dist/client/assets/McpServersSettings-UthT1T80.js +6 -0
  31. package/dist/client/assets/MobileSheet-CkeG6_SP.js +1 -0
  32. package/dist/client/assets/NewWorktreeDialog-DTZnArOC.js +4 -0
  33. package/dist/client/assets/NoActiveThreadState-jcEAWu7N.js +1 -0
  34. package/dist/client/assets/NodeSecuritySettings-DPqjRphc.js +1 -0
  35. package/dist/client/assets/OpinionatedPluginsSettings-BSy3F4v6.js +1 -0
  36. package/dist/client/assets/PhoneGetAppInterstitial-B2mrJtgM.js +1 -0
  37. package/dist/client/assets/PhoneGetAppInterstitialBackdrop-B8vfJdZd.js +1 -0
  38. package/dist/client/assets/PhoneHome-C-ttaKuE.js +1 -0
  39. package/dist/client/assets/PhoneSettingsSurface-CJddundi.js +1 -0
  40. package/dist/client/assets/ProjectFavicon-BhQnkxbx.js +1 -0
  41. package/dist/client/assets/ProviderModelPicker-COg6CGM4.js +1 -0
  42. package/dist/client/assets/ProvidersSettingsPanel-C3aPyCrN.js +1 -0
  43. package/dist/client/assets/RedactedSensitiveText-CxtaUiKH.js +1 -0
  44. package/dist/client/assets/RootAppShell-3T2sBtpP.js +6 -0
  45. package/dist/client/assets/RycoLetterMark-Bk0kvGJ_.js +1 -0
  46. package/dist/client/assets/SettingsDialog-krsStFrf.js +1 -0
  47. package/dist/client/assets/SettingsPanels-D8Xy3pPC.js +3 -0
  48. package/dist/client/assets/SettingsPanels.editor-B2x4U4rW.js +1 -0
  49. package/dist/client/assets/SourceControlSettings-KIx9EfEZ.js +1 -0
  50. package/dist/client/assets/StatisticsPage-C38pI2_b.js +1 -0
  51. package/dist/client/assets/StatisticsPanel-6sINT28-.js +1 -0
  52. package/dist/client/assets/StatisticsSettingsLink-Cx43bOeo.js +1 -0
  53. package/dist/client/assets/ThreadStatusIndicators-CL0KGLlj.js +0 -0
  54. package/dist/client/assets/{ThreadTerminalDrawer-BYQ6EMgr.js → ThreadTerminalDrawer-C4NJu8Qs.js} +3 -3
  55. package/dist/client/assets/{ThreadWorkspacePanel-DuaQ9DMj.js → ThreadWorkspacePanel-D9qlHXCA.js} +18 -18
  56. package/dist/client/assets/{ToolbarRootContext-Cp1bgmpz.js → ToolbarRootContext-BgqqXVly.js} +1 -1
  57. package/dist/client/assets/{WorkItemsTab-BDfun24H.js → WorkItemsTab-BDAeQe4D.js} +8 -8
  58. package/dist/client/assets/alert-LqMhbdE9.js +1 -0
  59. package/dist/client/assets/alert-dialog-DxoA6ky8.js +1 -0
  60. package/dist/client/assets/badge-CXw6fWrB.js +1 -0
  61. package/dist/client/assets/{branding-yW_ACj9l.js → branding-DeKsIp6g.js} +1 -1
  62. package/dist/client/assets/button-BAbJxRzt.js +1 -0
  63. package/dist/client/assets/{capabilities-j43xmCXg.js → capabilities-BkVqeGLQ.js} +1 -1
  64. package/dist/client/assets/collapsible-dxy6kc2k.js +1 -0
  65. package/dist/client/assets/command-CGNKG_Oe.js +1 -0
  66. package/dist/client/assets/composerDraftStore-CdJJZe42.js +11 -0
  67. package/dist/client/assets/data-list-CYKBxN62.js +1 -0
  68. package/dist/client/assets/{desktopUpdateAtoms-Cy06xm8M.js → desktopUpdateAtoms-B9iJXSdW.js} +1 -1
  69. package/dist/client/assets/{desktopWorkspace-Cw4Fu0Dd.js → desktopWorkspace-B-cSBe8H.js} +1 -1
  70. package/dist/client/assets/{device-hx7RX9fI.js → device-DfIh5pQV.js} +12 -12
  71. package/dist/client/assets/dialog-DQsYchqu.js +1 -0
  72. package/dist/client/assets/draft-input-CkzOk8BY.js +1 -0
  73. package/dist/client/assets/{editorPreferences-C3i2Nkh2.js → editorPreferences-0DWMgcci.js} +1 -1
  74. package/dist/client/assets/empty-DwzqNgCP.js +1 -0
  75. package/dist/client/assets/{getPseudoElementBounds-NLvUMZyQ.js → getPseudoElementBounds-X62ElHN8.js} +1 -1
  76. package/dist/client/assets/group-D9ER9giz.js +1 -0
  77. package/dist/client/assets/{index-COc-h_V9.js → index-Bntnmu6O.js} +1 -1
  78. package/dist/client/assets/input-CHEwW3oH.js +1 -0
  79. package/dist/client/assets/kbd-DCGQZk18.js +1 -0
  80. package/dist/client/assets/{keybindings-BCns_TPr.js → keybindings-CWJ7E9ZI.js} +1 -1
  81. package/dist/client/assets/label-CVFHsLFO.js +1 -0
  82. package/dist/client/assets/{lib-BBbQoz14.js → lib-qiiNMGgU.js} +1 -1
  83. package/dist/client/assets/{main-9Wu8G64Y.js → main-BjVnVob0.js} +3 -3
  84. package/dist/client/assets/menu-Dvxh8sD5.js +1 -0
  85. package/dist/client/assets/popover-CuH9Yrj3.js +1 -0
  86. package/dist/client/assets/{projectPaths-DSRhOXwD.js → projectPaths-SSsIvt0g.js} +1 -1
  87. package/dist/client/assets/{providerDriverMeta-DcAmgw5o.js → providerDriverMeta-I0TSo-QI.js} +1 -1
  88. package/dist/client/assets/providerIconUtils-CzSa_16f.js +1 -0
  89. package/dist/client/assets/providerInstances-BJcfB_9E.js +1 -0
  90. package/dist/client/assets/providerModels-BJcfB_9E.js +1 -0
  91. package/dist/client/assets/qr-code-Bddq6K7S.js +1 -0
  92. package/dist/client/assets/radio-group-CBZFr4C8.js +2 -0
  93. package/dist/client/assets/resolveAriaLabelledBy-CD_ugzhJ.js +1 -0
  94. package/dist/client/assets/{rightPanelRouteSearch-DE_7uWlN.js → rightPanelRouteSearch-DB5gQGHK.js} +1 -1
  95. package/dist/client/assets/runtime-DfGHeCnR.js +1 -0
  96. package/dist/client/assets/scroll-area-Drsa8bNB.js +1 -0
  97. package/dist/client/assets/scrollEdges-B-cqxY4l.js +1 -0
  98. package/dist/client/assets/select-BYbVr-yg.js +1 -0
  99. package/dist/client/assets/separator-CdS5bi4Z.js +1 -0
  100. package/dist/client/assets/{session-logic-DOQPF0oN.js → session-logic-wxhvMgEN.js} +1 -1
  101. package/dist/client/assets/settingsDialogStore-ygYoScKe.js +1 -0
  102. package/dist/client/assets/settingsLayout-D8glO7f1.js +1 -0
  103. package/dist/client/assets/sheet-BO78gIKZ.js +1 -0
  104. package/dist/client/assets/sidebar-Dm6l2GA6.js +1 -0
  105. package/dist/client/assets/sidebarProjectFolders-CGVDJ0ZT.js +4 -0
  106. package/dist/client/assets/{sidebarStatusText-DaNVnBiR.js → sidebarStatusText-D0HT0fek.js} +1 -1
  107. package/dist/client/assets/skeleton-CvQSeJbw.js +1 -0
  108. package/dist/client/assets/spinner-ClF0jOcX.js +1 -0
  109. package/dist/client/assets/storeSelectors-Bpr2pdhU.js +1 -0
  110. package/dist/client/assets/switch-BTGo9Yip.js +1 -0
  111. package/dist/client/assets/{terminal-links-BaX-ICJT.js → terminal-links-CZ3c9AbA.js} +1 -1
  112. package/dist/client/assets/textarea-RFPODxWW.js +1 -0
  113. package/dist/client/assets/{threadPriorityRefreshRuntime-DqqfcbZE.js → threadPriorityRefreshRuntime-tRDgvBzr.js} +1 -1
  114. package/dist/client/assets/toast-CcSCAm4B.js +1 -0
  115. package/dist/client/assets/toggle-I6h33Cu5.js +1 -0
  116. package/dist/client/assets/toggle-group-mLIkiJtU.js +1 -0
  117. package/dist/client/assets/tooltip-C8sAONBj.js +1 -0
  118. package/dist/client/assets/types-Bpr2pdhU.js +1 -0
  119. package/dist/client/assets/{uiStateStore-VVodpTkG.js → uiStateStore-B6pjzSjj.js} +1 -1
  120. package/dist/client/assets/{useAtlassian-DzQhYzCz.js → useAtlassian-DC0XOw4u.js} +0 -0
  121. package/dist/client/assets/{useButton-CQaIys_r.js → useButton-D__1LqCF.js} +1 -1
  122. package/dist/client/assets/useCompositeListItem-Cmr_nuuG.js +1 -0
  123. package/dist/client/assets/{useDebouncedValue-Dl2JtWSe.js → useDebouncedValue-DHjoudTq.js} +1 -1
  124. package/dist/client/assets/{useFloatingRootContext-DKAeq7FI.js → useFloatingRootContext-D5EZmrCa.js} +1 -1
  125. package/dist/client/assets/{useHandleNewThread-CzfIpG9Y.js → useHandleNewThread-Bvz-DKgn.js} +1 -1
  126. package/dist/client/assets/{useLabelableId-C7EOshps.js → useLabelableId-DnQJ7amm.js} +1 -1
  127. package/dist/client/assets/useLocation-CDeYzWW6.js +1 -0
  128. package/dist/client/assets/{useOpenInteractionType-D9ngong8.js → useOpenInteractionType-CjtpACKR.js} +1 -1
  129. package/dist/client/assets/usePhoneThreadActions-CAgIq9aZ.js +1 -0
  130. package/dist/client/assets/usePopupViewport-BuhsNdVy.js +1 -0
  131. package/dist/client/assets/useScrollLock-D3tMGsRk.js +1 -0
  132. package/dist/client/assets/{useStatistics-CP8uxvx6.js → useStatistics-CiLROMJP.js} +14 -14
  133. package/dist/client/assets/{useSwipeDismiss-DESLmDpT.js → useSwipeDismiss-CbgDJvw1.js} +1 -1
  134. package/dist/client/assets/{useThreadActions-fOb3ApmL.js → useThreadActions-Vew3ScxG.js} +1 -1
  135. package/dist/client/assets/{useTriggerFocusGuards-DkAmJBLw.js → useTriggerFocusGuards-CrugmkhX.js} +1 -1
  136. package/dist/client/assets/{useValueChanged-CSGMZCwN.js → useValueChanged-MQtIzPIU.js} +1 -1
  137. package/dist/client/assets/utils-BofFIn5Y.js +1 -0
  138. package/dist/client/index.html +1 -1
  139. package/package.json +1 -1
  140. package/dist/client/assets/AccountSettings-CxbiGHT-.js +0 -1
  141. package/dist/client/assets/AiFocusSettings-Cx2vpGdu.js +0 -1
  142. package/dist/client/assets/AnimatedHeight-D5lUTPRn.js +0 -1
  143. package/dist/client/assets/AppearanceSettings-eWri4YVm.js +0 -1
  144. package/dist/client/assets/ChatRightPanel-DAVHrLN_.js +0 -27
  145. package/dist/client/assets/ChatThreadRouteView-D11uiGPL.js +0 -1
  146. package/dist/client/assets/CommandPaletteDialog-DDXuLFyX.js +0 -1
  147. package/dist/client/assets/CompositeRoot-Cee5L4T9.js +0 -1
  148. package/dist/client/assets/ConnectionsSettings-Cf1RRkcn.js +0 -7
  149. package/dist/client/assets/DiagnosticsSettings-R00QjM1b.js +0 -2
  150. package/dist/client/assets/DialogPopup-DqvvwMxX.js +0 -1
  151. package/dist/client/assets/DialogRoot-BZCu6XdB.js +0 -1
  152. package/dist/client/assets/DialogViewport-CuRGvCfw.js +0 -1
  153. package/dist/client/assets/DraftChatThreadRouteView-CGMtPPGt.js +0 -1
  154. package/dist/client/assets/HostedConnectionControls-CXiER4OL.js +0 -1
  155. package/dist/client/assets/HostedHubRoot-MbaWk1RQ.js +0 -1
  156. package/dist/client/assets/HostedNativeAuthorizationRoute-DQ71L_yc.js +0 -1
  157. package/dist/client/assets/HostedRelayTrustNotice-Cv7T3mW5.js +0 -1
  158. package/dist/client/assets/Icons-DjUJVKIP.js +0 -1
  159. package/dist/client/assets/IntegrationsSettingsPanel-BUDT_BAr.js +0 -1
  160. package/dist/client/assets/KeybindingsSettings-DpU1kPiV.js +0 -7
  161. package/dist/client/assets/McpServersSettings-DQqM_vIq.js +0 -6
  162. package/dist/client/assets/MobileSheet-PksVmYO6.js +0 -1
  163. package/dist/client/assets/NewWorktreeDialog-CAe3UUk5.js +0 -4
  164. package/dist/client/assets/NoActiveThreadState-B020r2KX.js +0 -1
  165. package/dist/client/assets/NodeSecuritySettings-DlVOOlej.js +0 -1
  166. package/dist/client/assets/OpinionatedPluginsSettings-DMshW6cD.js +0 -1
  167. package/dist/client/assets/PhoneGetAppInterstitial-BCO-RNVk.js +0 -1
  168. package/dist/client/assets/PhoneGetAppInterstitialBackdrop-CkHNzjRm.js +0 -1
  169. package/dist/client/assets/PhoneHome-DY2ItxYl.js +0 -1
  170. package/dist/client/assets/PhoneSettingsSurface-DTP9FXLL.js +0 -1
  171. package/dist/client/assets/ProjectFavicon-Dopa4Rxy.js +0 -1
  172. package/dist/client/assets/ProviderModelPicker-ChoxerzY.js +0 -1
  173. package/dist/client/assets/ProvidersSettingsPanel-Ubea3yAA.js +0 -1
  174. package/dist/client/assets/RedactedSensitiveText-CdVeknPX.js +0 -1
  175. package/dist/client/assets/RootAppShell-BkUPk443.js +0 -6
  176. package/dist/client/assets/RycoLetterMark-GW-n9UxM.js +0 -1
  177. package/dist/client/assets/SettingsDialog-DMPrhOeR.js +0 -1
  178. package/dist/client/assets/SettingsPanels-ChP1z6Bu.js +0 -3
  179. package/dist/client/assets/SettingsPanels.editor-CiyAxlms.js +0 -1
  180. package/dist/client/assets/SourceControlSettings-8w3XlkuZ.js +0 -1
  181. package/dist/client/assets/StatisticsPage-D4lU63rD.js +0 -1
  182. package/dist/client/assets/StatisticsPanel-C2yBieuM.js +0 -1
  183. package/dist/client/assets/StatisticsSettingsLink-DZwvRI-Y.js +0 -1
  184. package/dist/client/assets/ThreadStatusIndicators-B43wkv-s.js +0 -0
  185. package/dist/client/assets/alert-DdU9OGtC.js +0 -1
  186. package/dist/client/assets/alert-dialog-zAmnOpaF.js +0 -1
  187. package/dist/client/assets/badge-CNPL77i3.js +0 -1
  188. package/dist/client/assets/button-CXfaxtRp.js +0 -1
  189. package/dist/client/assets/collapsible-oJfDmFRs.js +0 -1
  190. package/dist/client/assets/command-DK1D8p4-.js +0 -1
  191. package/dist/client/assets/composerDraftStore-BaAeiPHc.js +0 -11
  192. package/dist/client/assets/data-list-BpzwKa1z.js +0 -1
  193. package/dist/client/assets/dialog-JVv-MNDj.js +0 -1
  194. package/dist/client/assets/draft-input-CxoGkZxM.js +0 -1
  195. package/dist/client/assets/empty-DhkXzm1N.js +0 -1
  196. package/dist/client/assets/group-CafmSbGU.js +0 -1
  197. package/dist/client/assets/input-Bz9pd_f3.js +0 -1
  198. package/dist/client/assets/kbd-qh5s29Yp.js +0 -1
  199. package/dist/client/assets/label-Ct6uH6qL.js +0 -1
  200. package/dist/client/assets/menu-DL-18Hfn.js +0 -1
  201. package/dist/client/assets/popover-C9y_0-ZN.js +0 -1
  202. package/dist/client/assets/providerIconUtils-DSXSWHwg.js +0 -1
  203. package/dist/client/assets/providerInstances-D5NRn-MS.js +0 -1
  204. package/dist/client/assets/providerModels-D5NRn-MS.js +0 -1
  205. package/dist/client/assets/qr-code-DsN9sWfN.js +0 -1
  206. package/dist/client/assets/radio-group-DGUZYMAN.js +0 -2
  207. package/dist/client/assets/resolveAriaLabelledBy-l3Wj7Mso.js +0 -1
  208. package/dist/client/assets/runtime-CqhG6EOG.js +0 -1
  209. package/dist/client/assets/scroll-area-gtur6NxN.js +0 -1
  210. package/dist/client/assets/scrollEdges-Ccq9Jqpk.js +0 -1
  211. package/dist/client/assets/select-BB7zCkpA.js +0 -1
  212. package/dist/client/assets/separator-DOGIr29S.js +0 -1
  213. package/dist/client/assets/settingsDialogStore-DM98Sea0.js +0 -1
  214. package/dist/client/assets/settingsLayout-CS7P71tz.js +0 -1
  215. package/dist/client/assets/sheet-DVALF6mw.js +0 -1
  216. package/dist/client/assets/sidebar-Dft4bIEi.js +0 -1
  217. package/dist/client/assets/sidebarProjectFolders-BOfJCYjK.js +0 -4
  218. package/dist/client/assets/skeleton-CBHDWLDX.js +0 -1
  219. package/dist/client/assets/spinner-JhkVC8d7.js +0 -1
  220. package/dist/client/assets/storeSelectors-CP3vrsGY.js +0 -1
  221. package/dist/client/assets/switch-vkC1QGDn.js +0 -1
  222. package/dist/client/assets/textarea-Cz_x76EQ.js +0 -1
  223. package/dist/client/assets/toast-Bnfw8LOb.js +0 -1
  224. package/dist/client/assets/toggle-DNtHlm45.js +0 -1
  225. package/dist/client/assets/toggle-group-BNtjyirT.js +0 -1
  226. package/dist/client/assets/tooltip-lYatfjuN.js +0 -1
  227. package/dist/client/assets/types-CP3vrsGY.js +0 -1
  228. package/dist/client/assets/useCompositeListItem-D_u_nlWz.js +0 -1
  229. package/dist/client/assets/useLocation-CvhfNIUj.js +0 -1
  230. package/dist/client/assets/usePhoneThreadActions-CiFBnOHD.js +0 -1
  231. package/dist/client/assets/usePopupViewport-CQTeg5Y-.js +0 -1
  232. package/dist/client/assets/useScrollLock-TdF-Iq8H.js +0 -1
  233. package/dist/client/assets/utils-BPUctpTG.js +0 -1
package/dist/bin.cjs CHANGED
@@ -33751,7 +33751,7 @@ const scopedSafeTeardown = (label) => (effect$28) => effect.Effect.gen(function*
33751
33751
  });
33752
33752
  //#endregion
33753
33753
  //#region package.json
33754
- var version$1 = "0.1.10";
33754
+ var version$1 = "0.1.12";
33755
33755
  //#endregion
33756
33756
  //#region src/provider/Layers/CodexProvider.ts
33757
33757
  const PROVIDER_PROBE_TIMEOUT_MS = 8e3;
package/dist/bin.mjs CHANGED
@@ -33726,7 +33726,7 @@ const scopedSafeTeardown = (label) => (effect) => Effect.gen(function* () {
33726
33726
  });
33727
33727
  //#endregion
33728
33728
  //#region package.json
33729
- var version$1 = "0.1.10";
33729
+ var version$1 = "0.1.12";
33730
33730
  //#endregion
33731
33731
  //#region src/provider/Layers/CodexProvider.ts
33732
33732
  const PROVIDER_PROBE_TIMEOUT_MS = 8e3;
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{F as r,M as i,N as a}from"./runtime-DfGHeCnR.js";import{It as o}from"./composerDraftStore-CdJJZe42.js";import{_ as s,o as c}from"./authorization-mIJKV2yp.js";import{n as l}from"./loader-circle-CrtHFAvM.js";import{t as u}from"./copy-UQjKGt7t.js";import{t as d}from"./key-round-CacMputS.js";import{t as f}from"./refresh-cw-DopCMrtR.js";import{t as p}from"./shield-check-dQ-4cMKk.js";import{t as m}from"./trash-2-CM1zXPGb.js";import{t as h}from"./triangle-alert-RL_T3KLo.js";import{t as g}from"./user-round-Cpzx8pSw.js";import{n as _,t as v}from"./input-CHEwW3oH.js";import{u as y}from"./Icons-CT3nd2MA.js";import{t as b}from"./button-BAbJxRzt.js";import{t as x}from"./useCopyToClipboard-BTpWxumf.js";import{i as S,n as C,r as w,t as T}from"./alert-LqMhbdE9.js";import{a as E,c as D,i as ee,o as O,r as te,s as ne,t as k}from"./dialog-DQsYchqu.js";import{t as A}from"./spinner-ClF0jOcX.js";import{a as j,i as M,n as N,o as re,r as ie,s as ae,t as oe}from"./alert-dialog-DxoA6ky8.js";import{t as P}from"./badge-CXw6fWrB.js";import{t as se}from"./label-CVFHsLFO.js";import{C as F,S as I,_ as L,a as R,b as z,c as ce,d as le,f as B,g as V,h as H,i as U,l as W,m as G,n as K,o as q,p as ue,r as de,s as J,t as fe,u as pe,v as Y,x as X,y as me}from"./ExternalIdentityWeb.logic-D64j70NH.js";import{i as he,n as ge,r as _e}from"./settingsLayout-D8glO7f1.js";import{t as ve}from"./qr-code-Bddq6K7S.js";var ye=n(),Z=e(t(),1),Q=o(),be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function xe(e){return e===null||!Number.isFinite(e)?null:be.format(new Date(e))}function Se(){let e=(0,ye.c)(15),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(0),[a,o]=(0,Z.useState)(``),[s,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(0),d;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{n(null),i(0),o(``)},e[0]=d):d=e[0];let f=d,p;e[1]===t?.options?p=e[2]:(p=()=>{u.current+=1,c.cancelAccountAction(),t?.options?.onAbandoned?.(),l(!1),f()},e[1]=t?.options,e[2]=p);let m=p,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=async(e,t,r)=>{let a=u.current+=1;l(!1);let s=await t({});if(u.current===a){if(B(s)){o(``),i(0),n({action:e,run:t,options:r,inferred:s.inferredErrorCode===!0});return}s.status===`committed`&&r?.onCommitted?.()}},e[3]=h):h=e[3];let g=h,_;e[4]!==t||e[5]!==a||e[6]!==r?(_=async()=>{if(!t)return;let e=H(a);if(e.length===0)return;let n=u.current+=1,s=await t.run({totpCode:e});if(u.current===n){if(B(s)){let e=r+1;if(z(s,e)){i(e),o(``);return}l(!0),t.options?.onAbandoned?.(),f();return}s.status===`committed`&&t.options?.onCommitted?.(),f()}},e[4]=t,e[5]=a,e[6]=r,e[7]=_):_=e[7];let v=_,y;return e[8]!==m||e[9]!==t||e[10]!==a||e[11]!==r||e[12]!==s||e[13]!==v?(y={run:g,cancel:m,stepUp:t,stepUpAttempts:r,stepUpCode:a,stepUpUnresolved:s,setStepUpCode:o,submitStepUp:v},e[8]=m,e[9]=t,e[10]=a,e[11]=r,e[12]=s,e[13]=v,e[14]=y):y=e[14],y}function Ce(){let e=(0,ye.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Z.useEffect)(we,t)}function we(){return c.leaseRecoveryCodeDisplay()}function $(e){let t=(0,ye.c)(3),{busy:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{className:`size-3.5`}),r]}):(0,Q.jsx)(Q.Fragment,{children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Te(){let e=(0,ye.c)(99),t=a(We),n=a(Ue),[o,c]=(0,Z.useState)(!1),l=i(He),u=i(Ve),d=i(Be),f=i(ze),m=i(Re),_=i(Le),v=i(Ie),y=i(Fe),x=a(Pe),E=a(Ne),[D,ee]=(0,Z.useState)(!1),[O,te]=(0,Z.useState)(null),ne=(0,Z.useRef)(!1),k=Se(),A=k.run;Ce();let j=_!==`idle`,M;e[0]===m?M=e[1]:(M=de(m),e[0]=m,e[1]=M);let N=M,re;e[2]===d?.externalIdentities?re=e[3]:(re=d?.externalIdentities.find(Me)??null,e[2]=d?.externalIdentities,e[3]=re);let ie=re,ae;e[4]===D?ae=e[5]:(ae=async()=>{if(!D){ee(!0),te(null);try{await fe({intent:`link`,returnTo:`/account/security`,start:je,navigate:Ae})}catch(e){let t=e;te(t instanceof s?t.message:`GitHub connection is temporarily unavailable.`),ee(!1)}}},e[4]=D,e[5]=ae);let oe=ae,P;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(P=[],e[6]=P):P=e[6],(0,Z.useEffect)(ke,P);let se,F;if(e[7]!==t||e[8]!==A?(se=()=>{if(t!==`authenticated`||ne.current)return;ne.current=!0;let e=new AbortController;return r.getPendingExternalIdentity(e.signal).then(e=>{if(e.status===`link`)return A(`connect-github`,Oe);e.status===`error`&&te(K(e.code))}).catch(De),()=>e.abort()},F=[t,A],e[7]=t,e[8]=A,e[9]=se,e[10]=F):(se=e[9],F=e[10]),(0,Z.useEffect)(se,F),t!==`authenticated`){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(ge,{children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Not signed in`}),(0,Q.jsx)(w,{children:`Sign in to the Hub to manage passkeys, two-factor authentication, and recovery codes.`})]})}),e[11]=t):t=e[11],t}let I;e[12]!==k.stepUp||e[13]!==k.stepUpUnresolved||e[14]!==y||e[15]!==v?(I=k.stepUpUnresolved?U:W(v,y,k.stepUp!==null),e[12]=k.stepUp,e[13]=k.stepUpUnresolved,e[14]=y,e[15]=v,e[16]=I):I=e[16];let L=I,z;e[17]!==k.stepUpUnresolved||e[18]!==y?(z=!k.stepUpUnresolved&&le(y),e[17]=k.stepUpUnresolved,e[18]=y,e[19]=z):z=e[19];let ce=z,B;e[20]!==l||e[21]!==u?(B=R(l,u),e[20]=l,e[21]=u,e[22]=B):B=e[22];let V=B,H;e[23]!==L||e[24]!==ce?(H=L?(0,Q.jsxs)(T,{variant:ce?`info`:`error`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:ce?`Passkey needed`:`That did not work`}),(0,Q.jsx)(w,{children:L})]}):null,e[23]=L,e[24]=ce,e[25]=H):H=e[25];let G;e[26]===O?G=e[27]:(G=O?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`GitHub connection did not complete`}),(0,Q.jsx)(w,{children:O})]}):null,e[26]=O,e[27]=G);let q;e[28]!==d||e[29]!==f?(q=d===null&&f!==`stale`?(0,Q.jsxs)(T,{variant:`info`,"aria-live":`polite`,children:[(0,Q.jsx)(p,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Checking account security`}),(0,Q.jsx)(w,{children:`Reading which fallback sign-in methods are configured on this Hub.`})]}):null,e[28]=d,e[29]=f,e[30]=q):q=e[30];let ue;e[31]!==j||e[32]!==d||e[33]!==f?(ue=f===`stale`?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:d===null?`Account security unavailable`:`Account security may be outdated`}),(0,Q.jsx)(w,{children:d===null?`Ryco could not read the current password, authenticator, and email state.`:`These controls use the last state Ryco successfully read from the Hub.`}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:Ee,children:`Retry`})})]}):null,e[31]=j,e[32]=d,e[33]=f,e[34]=ue):ue=e[34];let J;e[35]!==j||e[36]!==V?(J=V?(0,Q.jsxs)(T,{variant:V.variant,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:V.title}),(0,Q.jsx)(w,{children:V.description}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:()=>c(!0),children:V.actionLabel})})]}):null,e[35]=j,e[36]=V,e[37]=J):J=e[37];let pe;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(g,{"aria-hidden":!0,className:`size-3.5`}),e[38]=pe):pe=e[38];let Y=n?.displayName??`Signed in`,X;e[39]===n?X=e[40]:(X=n?`${n.role} · joined ${xe(n.createdAt)??`unknown`}`:null,e[39]=n,e[40]=X);let me;e[41]!==Y||e[42]!==X?(me=(0,Q.jsx)(he,{title:`Account`,icon:pe,children:(0,Q.jsx)(_e,{title:Y,description:`The Hub account these credentials belong to.`,status:X})}),e[41]=Y,e[42]=X,e[43]=me):me=e[43];let ve;e[44]!==_||e[45]!==j||e[46]!==D||e[47]!==ie||e[48]!==N?.link||e[49]!==A||e[50]!==oe?(ve=ie||N?.link?(0,Q.jsx)(Ge,{identity:ie,actionsAvailable:N?.link===!0,busy:j||D,actionStatus:_,onConnect:()=>void oe(),run:A}):null,e[44]=_,e[45]=j,e[46]=D,e[47]=ie,e[48]=N?.link,e[49]=A,e[50]=oe,e[51]=ve):ve=e[51];let be=u===`loading`,we=u===`stale`,$;e[52]!==k.cancel||e[53]!==k.run||e[54]!==_||e[55]!==o||e[56]!==j||e[57]!==l||e[58]!==be||e[59]!==we?($=(0,Q.jsx)(qe,{passkeys:l,loading:be,stale:we,busy:j,actionStatus:_,addOpen:o,setAddOpen:c,run:k.run,cancel:k.cancel}),e[52]=k.cancel,e[53]=k.run,e[54]=_,e[55]=o,e[56]=j,e[57]=l,e[58]=be,e[59]=we,e[60]=$):$=e[60];let Te=d?.totpEnrolled??null,Ke;e[61]!==k.run||e[62]!==_||e[63]!==j||e[64]!==Te||e[65]!==E?(Ke=(0,Q.jsx)(Je,{busy:j,actionStatus:_,enrollment:E,enrolled:Te,run:k.run}),e[61]=k.run,e[62]=_,e[63]=j,e[64]=Te,e[65]=E,e[66]=Ke):Ke=e[66];let Ye;e[67]!==k.run||e[68]!==_||e[69]!==j||e[70]!==x?(Ye=(0,Q.jsx)(et,{busy:j,actionStatus:_,recoveryCodes:x,run:k.run}),e[67]=k.run,e[68]=_,e[69]=j,e[70]=x,e[71]=Ye):Ye=e[71];let Xe;e[72]!==k.cancel||e[73]!==k.run||e[74]!==_||e[75]!==j||e[76]!==d?(Xe=(0,Q.jsx)(Ze,{busy:j,actionStatus:_,security:d,run:k.run,cancel:k.cancel}),e[72]=k.cancel,e[73]=k.run,e[74]=_,e[75]=j,e[76]=d,e[77]=Xe):Xe=e[77];let Qe;e[78]!==k.cancel||e[79]!==k.setStepUpCode||e[80]!==k.stepUp||e[81]!==k.stepUpAttempts||e[82]!==k.stepUpCode||e[83]!==k.submitStepUp||e[84]!==j?(Qe=(0,Q.jsx)(at,{pending:k.stepUp,attempts:k.stepUpAttempts,code:k.stepUpCode,onCodeChange:k.setStepUpCode,onSubmit:k.submitStepUp,onCancel:k.cancel,busy:j}),e[78]=k.cancel,e[79]=k.setStepUpCode,e[80]=k.stepUp,e[81]=k.stepUpAttempts,e[82]=k.stepUpCode,e[83]=k.submitStepUp,e[84]=j,e[85]=Qe):Qe=e[85];let $e;return e[86]!==G||e[87]!==q||e[88]!==ue||e[89]!==J||e[90]!==me||e[91]!==ve||e[92]!==$||e[93]!==Ke||e[94]!==Ye||e[95]!==Xe||e[96]!==Qe||e[97]!==H?($e=(0,Q.jsxs)(ge,{children:[H,G,q,ue,J,me,ve,$,Ke,Ye,Xe,Qe]}),e[86]=G,e[87]=q,e[88]=ue,e[89]=J,e[90]=me,e[91]=ve,e[92]=$,e[93]=Ke,e[94]=Ye,e[95]=Xe,e[96]=Qe,e[97]=H,e[98]=$e):$e=e[98],$e}function Ee(){c.refreshAccountSecurity({force:!0})}function De(){}function Oe(e){return c.finishBrowserExternalIdentityConnection(`github`,e)}function ke(){c.refreshPasskeys(),c.refreshAccountSecurity(),c.refreshExternalIdentityConfiguration()}function Ae(e){return window.location.assign(e)}function je(e){return r.startExternalIdentityAuthorization(e)}function Me(e){return e.provider===`github`}function Ne(e){return e.totpEnrollment??null}function Pe(e){return e.recoveryCodes}function Fe(e){return e.errorCode??null}function Ie(e){return e.errorMessage}function Le(e){return e.actionStatus}function Re(e){return e.externalIdentityConfiguration}function ze(e){return e.securityStatus}function Be(e){return e.security}function Ve(e){return e.passkeysStatus}function He(e){return e.passkeys}function Ue(e){return e.account}function We(e){return e.accountStatus}function Ge(e){let t=(0,ye.c)(33),{identity:n,actionsAvailable:r,busy:i,actionStatus:a,onConnect:o,run:s}=e,[c,l]=(0,Z.useState)(!1),u=a===`connecting-external-identity`,d=a===`disconnecting-external-identity`,f;t[0]===s?f=t[1]:(f=async()=>{await s(`disconnect-github`,Ke,{onCommitted:()=>l(!1)})},t[0]=s,t[1]=f);let p=f,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(y,{"aria-hidden":!0,className:`size-3.5`}),t[2]=m):m=t[2];let h=n?`GitHub · @${n.login}`:`GitHub`,g=n?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,_;t[3]===n?_=t[4]:(_=n?`Connected ${xe(n.connectedAt)??`at an unknown time`}${n.lastUsedAt===null?``:` · last used ${xe(n.lastUsedAt)??`at an unknown time`}`}`:null,t[3]=n,t[4]=_);let v;t[5]!==r||t[6]!==i||t[7]!==u||t[8]!==d||t[9]!==n||t[10]!==o?(v=r?n?(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:d,children:`Disconnect`})}):(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:o,children:(0,Q.jsx)($,{busy:u,children:`Connect GitHub`})}):null,t[5]=r,t[6]=i,t[7]=u,t[8]=d,t[9]=n,t[10]=o,t[11]=v):v=t[11];let x;t[12]!==h||t[13]!==g||t[14]!==_||t[15]!==v?(x=(0,Q.jsx)(_e,{title:h,description:g,status:_,control:v}),t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=x):x=t[16];let S;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Disconnect GitHub?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with GitHub. Ryco refuses this change if GitHub is your only remaining sign-in method.`})]}),t[17]=S):S=t[17];let C;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[18]=C):C=t[18];let w;t[19]===p?w=t[20]:(w=()=>void p(),t[19]=p,t[20]=w);let T;t[21]===d?T=t[22]:(T=(0,Q.jsx)($,{busy:d,children:`Disconnect GitHub`}),t[21]=d,t[22]=T);let E;t[23]!==i||t[24]!==w||t[25]!==T?(E=(0,Q.jsxs)(re,{children:[S,(0,Q.jsxs)(M,{children:[C,(0,Q.jsx)(b,{disabled:i,onClick:w,children:T})]})]}),t[23]=i,t[24]=w,t[25]=T,t[26]=E):E=t[26];let D;t[27]!==c||t[28]!==E?(D=(0,Q.jsx)(oe,{open:c,onOpenChange:l,children:E}),t[27]=c,t[28]=E,t[29]=D):D=t[29];let ee;return t[30]!==D||t[31]!==x?(ee=(0,Q.jsxs)(he,{title:`Connected accounts`,icon:m,children:[x,D]}),t[30]=D,t[31]=x,t[32]=ee):ee=t[32],ee}function Ke(e){return c.disconnectExternalIdentity(`github`,e)}function qe({passkeys:e,loading:t,stale:n,busy:r,actionStatus:i,addOpen:a,setAddOpen:o,run:s,cancel:l}){let[u,f]=(0,Z.useState)(``),[p,h]=(0,Z.useState)(null),[g,y]=(0,Z.useState)(null),x=i===`adding-passkey`,S=i===`revoking-passkey`,C=q(e),w=F(e),T=V(e),A=(0,Z.useCallback)(()=>{f(``),o(!1)},[o]),I=async e=>{e.preventDefault();let t=G(u);await s(`add-passkey`,e=>c.addPasskey({passkeyLabel:t,...e}),{onCommitted:A,onAbandoned:A})},R=async()=>{let e=p;if(e){h(null),y(e.id);try{await c.revokePasskey(e.id)}finally{y(null)}}};return(0,Q.jsxs)(he,{title:`Passkeys`,icon:(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),headerAction:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(!0),children:`Add passkey`}),children:[(0,Q.jsx)(_e,{title:`Passkeys on this account`,description:`A passkey is the strongest way in. Add one for every device you sign in from, and keep at least two so losing a device does not lock you out.`,status:n?`This list could not be refreshed and may be out of date.`:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`${String(C.length)} usable ${C.length===1?`passkey`:`passkeys`}`}),w>0?(0,Q.jsx)(`span`,{children:` · ${String(w)} synced to a password manager`}):null]})}),t&&e.length===0?(0,Q.jsx)(_e,{title:`Loading passkeys…`,description:`Reading the credentials on file.`}):null,!t&&e.length===0?(0,Q.jsx)(_e,{title:`No passkeys yet`,description:`Add one now — without a passkey you can only get back in through a fallback credential.`}):null,T.map(e=>{let t=pe(e),n=L(e),i=xe(e.createdAt),a=xe(e.lastUsedAt);return(0,Q.jsx)(_e,{title:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[Y(e),t?(0,Q.jsx)(P,{variant:`error`,size:`sm`,children:`Revoked`}):null]}),description:t?`Revoked${e.revocationReasonCode?` — ${e.revocationReasonCode}`:``}. This credential can no longer sign in.`:n??`The Hub did not report whether this credential is backed up.`,status:[i?`Added ${i}`:null,a?`Last used ${a}`:`Never used`].filter(e=>e!==null).join(` · `),control:t?null:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Revoke ${Y(e)}`,disabled:r,onClick:()=>h(e),children:(0,Q.jsxs)($,{busy:S&&g===e.id,children:[(0,Q.jsx)(m,{"aria-hidden":!0}),`Revoke`]})})},e.id)}),(0,Q.jsx)(k,{open:a,onOpenChange:e=>{if(e){o(!0);return}r||A()},children:(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:e=>void I(e),children:[(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Add a passkey`}),(0,Q.jsx)(te,{children:`Your browser will ask you to create a passkey for this account. Adding one replaces the current Hub session with a fresh one.`})]}),(0,Q.jsxs)(O,{className:`space-y-3`,children:[(0,Q.jsx)(se,{htmlFor:`account-passkey-label`,children:`Name (optional)`}),(0,Q.jsx)(v,{id:`account-passkey-label`,value:u,autoComplete:`off`,placeholder:`Work laptop`,disabled:x,className:_,onChange:e=>f(e.target.value)})]}),(0,Q.jsxs)(ee,{children:[(0,Q.jsx)(b,{variant:`outline`,onClick:()=>{l(),A()},children:`Cancel`}),(0,Q.jsx)(b,{type:`submit`,disabled:r,children:(0,Q.jsx)($,{busy:x,children:`Create passkey`})})]})]})})}),(0,Q.jsx)(oe,{open:p!==null,onOpenChange:e=>{r||e||h(null)},children:(0,Q.jsxs)(re,{children:[(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Revoke this passkey?`}),(0,Q.jsxs)(ie,{children:[C.length===1?`This is the only usable passkey on this account. `:``,p?Y(p):``,` will stop working immediately, on every device it is stored on. This cannot be undone — you would have to enrol the device again.`]})]}),(0,Q.jsxs)(M,{children:[(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),(0,Q.jsx)(b,{variant:`destructive`,disabled:r,onClick:()=>void R(),children:`Revoke passkey`})]})]})})]})}function Je(e){let t=(0,ye.c)(61),{busy:n,actionStatus:r,enrollment:i,enrolled:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),f=r===`enrolling-totp`,m=r===`confirming-totp`,h=r===`revoking-totp`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{l(``),c.dismissTotpEnrollment()},t[0]=g):g=t[0];let y=g,x;t[1]===s?x=t[2]:(x=async e=>{e.preventDefault();let t=H(s);t.length!==0&&(await c.confirmTotpEnrollment({code:t}),l(``))},t[1]=s,t[2]=x);let S=x,C;t[3]===o?C=t[4]:(C=async()=>{d(!1),await o(`revoke-totp`,Xe)},t[3]=o,t[4]=C);let w=C,T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(p,{"aria-hidden":!0,className:`size-3.5`}),t[5]=T):T=t[5];let A=a===null?`Checking current state…`:a?`On`:`Off`,P;t[6]!==n||t[7]!==a||t[8]!==f||t[9]!==h?(P=a===null?null:a?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Turn off two-factor authentication`,disabled:n,onClick:()=>d(!0),children:(0,Q.jsx)($,{busy:h,children:`Turn off`})}):(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:Ye,children:(0,Q.jsx)($,{busy:f,children:`Set up`})}),t[6]=n,t[7]=a,t[8]=f,t[9]=h,t[10]=P):P=t[10];let F;t[11]!==A||t[12]!==P?(F=(0,Q.jsx)(_e,{title:`Authenticator app`,description:`A six-digit code from an authenticator app, required whenever you change credentials from a session that was not started with a passkey. Signing in with a passkey never asks for one.`,status:A,control:P}),t[11]=A,t[12]=P,t[13]=F):F=t[13];let I=i!==null,L;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{e||y()},t[14]=L):L=t[14];let R;t[15]===S?R=t[16]:(R=e=>void S(e),t[15]=S,t[16]=R);let z;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set up two-factor authentication`}),(0,Q.jsx)(te,{children:`Scan this with your authenticator app, then enter the code it shows. This is the only time the key is displayed.`})]}),t[17]=z):z=t[17];let ce;t[18]===i?ce=t[19]:(ce=i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border bg-white p-4`,children:(0,Q.jsx)(ve,{value:i.provisioningUri,size:168,level:`M`,marginSize:1,title:`Two-factor setup code`})}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Can't scan? Enter this key manually:`}),(0,Q.jsx)(`p`,{"aria-label":`Two-factor setup key`,className:`rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm break-all`,children:i.secretBase32})]})]}):null,t[18]=i,t[19]=ce);let le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Q.jsx)(se,{htmlFor:`account-totp-confirm`,children:`Code from your app`}),t[20]=le):le=t[20];let B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>l(H(e.target.value)),t[21]=B):B=t[21];let V;t[22]!==s||t[23]!==m?(V=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[le,(0,Q.jsx)(v,{id:`account-totp-confirm`,value:s,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:m,className:_,onChange:B})]}),t[22]=s,t[23]=m,t[24]=V):V=t[24];let U;t[25]!==ce||t[26]!==V?(U=(0,Q.jsxs)(O,{className:`space-y-4`,children:[ce,V]}),t[25]=ce,t[26]=V,t[27]=U):U=t[27];let W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(b,{variant:`outline`,onClick:y,children:`Cancel`}),t[28]=W):W=t[28];let G;t[29]!==n||t[30]!==s?(G=n||!ue(s),t[29]=n,t[30]=s,t[31]=G):G=t[31];let K;t[32]===m?K=t[33]:(K=(0,Q.jsx)($,{busy:m,children:`Turn on`}),t[32]=m,t[33]=K);let q;t[34]!==G||t[35]!==K?(q=(0,Q.jsxs)(ee,{children:[W,(0,Q.jsx)(b,{type:`submit`,disabled:G,children:K})]}),t[34]=G,t[35]=K,t[36]=q):q=t[36];let de;t[37]!==R||t[38]!==U||t[39]!==q?(de=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:R,children:[z,U,q]})}),t[37]=R,t[38]=U,t[39]=q,t[40]=de):de=t[40];let J;t[41]!==de||t[42]!==I?(J=(0,Q.jsx)(k,{open:I,onOpenChange:L,children:de}),t[41]=de,t[42]=I,t[43]=J):J=t[43];let fe;t[44]===n?fe=t[45]:(fe=e=>{n||d(e)},t[44]=n,t[45]=fe);let pe;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove two-factor authentication?`}),(0,Q.jsx)(ie,{children:`Password, recovery-code, and emailed-link sign-ins will no longer need a code from your authenticator app. You can set it up again at any time.`})]}),t[46]=pe):pe=t[46];let Y;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it on`}),t[47]=Y):Y=t[47];let X;t[48]===w?X=t[49]:(X=()=>void w(),t[48]=w,t[49]=X);let me;t[50]!==n||t[51]!==X?(me=(0,Q.jsxs)(re,{children:[pe,(0,Q.jsxs)(M,{children:[Y,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:X,children:`Remove two-factor`})]})]}),t[50]=n,t[51]=X,t[52]=me):me=t[52];let ge;t[53]!==u||t[54]!==fe||t[55]!==me?(ge=(0,Q.jsx)(oe,{open:u,onOpenChange:fe,children:me}),t[53]=u,t[54]=fe,t[55]=me,t[56]=ge):ge=t[56];let be;return t[57]!==J||t[58]!==ge||t[59]!==F?(be=(0,Q.jsxs)(he,{title:`Two-factor authentication`,icon:T,children:[F,J,ge]}),t[57]=J,t[58]=ge,t[59]=F,t[60]=be):be=t[60],be}function Ye(){c.beginTotpEnrollment()}function Xe(e){return c.revokeTotp(e)}function Ze(e){let t=(0,ye.c)(86),{busy:n,actionStatus:r,security:i,run:a,cancel:o}=e,[s,l]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(!1),[y,x]=(0,Z.useState)(!1),S=r===`setting-password`,C=r===`removing-password`,w;t[0]!==p||t[1]!==u?(w=me(u,p),t[0]=p,t[1]=u,t[2]=w):w=t[2];let T=w,A;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{f(``),m(``),g(!1)},t[3]=A):A=t[3];let P=A,F;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>{P(),l(!1)},t[4]=F):F=t[4];let I=F,L;t[5]===o?L=t[6]:(L=()=>{o(),I()},t[5]=o,t[6]=L);let R=L,z;t[7]!==T||t[8]!==u||t[9]!==a?(z=async e=>{e.preventDefault(),g(!0),!T&&await a(`set-password`,e=>c.setPassword({password:u,...e}),{onCommitted:I,onAbandoned:I})},t[7]=T,t[8]=u,t[9]=a,t[10]=z):z=t[10];let ce=z,le;t[11]===a?le=t[12]:(le=async()=>{x(!1),await a(`remove-password`,Qe)},t[11]=a,t[12]=le);let B=le,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),t[13]=V):V=t[13];let H=i===null?`Checking current state…`:i.passwordConfigured?`Set`:`Not set`,U;t[14]!==n||t[15]!==C||t[16]!==i||t[17]!==S?(U=i===null?null:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:S,children:i.passwordConfigured?`Change`:`Set password`})}),i.passwordConfigured?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Delete the fallback password`,disabled:n,onClick:()=>x(!0),children:(0,Q.jsx)($,{busy:C,children:`Remove`})}):null]}),t[14]=n,t[15]=C,t[16]=i,t[17]=S,t[18]=U):U=t[18];let W;t[19]!==H||t[20]!==U?(W=(0,Q.jsx)(_e,{title:`Fallback password`,description:`A password is a fallback, not an equal of a passkey: it can be phished and reused, and a session started with one has to prove itself again before changing credentials. Keep a passkey as your normal way in.`,status:H,control:U}),t[19]=H,t[20]=U,t[21]=W):W=t[21];let G=i===null?void 0:i.email,K=i?.emailDeliveryConfigured,q;t[22]!==r||t[23]!==n||t[24]!==a||t[25]!==G||t[26]!==K?(q=(0,Q.jsx)($e,{busy:n,actionStatus:r,email:G,deliveryConfigured:K,run:a}),t[22]=r,t[23]=n,t[24]=a,t[25]=G,t[26]=K,t[27]=q):q=t[27];let ue;t[28]===R?ue=t[29]:(ue=e=>{if(e){l(!0);return}R()},t[28]=R,t[29]=ue);let de;t[30]===ce?de=t[31]:(de=e=>void ce(e),t[30]=ce,t[31]=de);let J;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set a fallback password`}),(0,Q.jsx)(te,{children:`This replaces any password already on the account. The Hub rejects passwords that have appeared in a known breach.`})]}),t[32]=J):J=t[32];let fe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Q.jsx)(se,{htmlFor:`account-password`,children:`New password`}),t[33]=fe):fe=t[33];let pe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>f(e.target.value),t[34]=pe):pe=t[34];let Y;t[35]!==u||t[36]!==S?(Y=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[fe,(0,Q.jsx)(v,{id:`account-password`,type:`password`,value:u,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:pe})]}),t[35]=u,t[36]=S,t[37]=Y):Y=t[37];let X;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(se,{htmlFor:`account-password-confirm`,children:`Confirm password`}),t[38]=X):X=t[38];let ge;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ge=e=>m(e.target.value),t[39]=ge):ge=t[39];let ve;t[40]!==p||t[41]!==S?(ve=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[X,(0,Q.jsx)(v,{id:`account-password-confirm`,type:`password`,value:p,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:ge})]}),t[40]=p,t[41]=S,t[42]=ve):ve=t[42];let be;t[43]!==T||t[44]!==h?(be=h&&T?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:T}):null,t[43]=T,t[44]=h,t[45]=be):be=t[45];let xe;t[46]!==Y||t[47]!==ve||t[48]!==be?(xe=(0,Q.jsxs)(O,{className:`space-y-3`,children:[Y,ve,be]}),t[46]=Y,t[47]=ve,t[48]=be,t[49]=xe):xe=t[49];let Se;t[50]===R?Se=t[51]:(Se=(0,Q.jsx)(b,{variant:`outline`,onClick:R,children:`Cancel`}),t[50]=R,t[51]=Se);let Ce;t[52]===S?Ce=t[53]:(Ce=(0,Q.jsx)($,{busy:S,children:`Save password`}),t[52]=S,t[53]=Ce);let we;t[54]!==n||t[55]!==Ce?(we=(0,Q.jsx)(b,{type:`submit`,disabled:n,children:Ce}),t[54]=n,t[55]=Ce,t[56]=we):we=t[56];let Te;t[57]!==Se||t[58]!==we?(Te=(0,Q.jsxs)(ee,{children:[Se,we]}),t[57]=Se,t[58]=we,t[59]=Te):Te=t[59];let Ee;t[60]!==de||t[61]!==xe||t[62]!==Te?(Ee=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:de,children:[J,xe,Te]})}),t[60]=de,t[61]=xe,t[62]=Te,t[63]=Ee):Ee=t[63];let De;t[64]!==s||t[65]!==ue||t[66]!==Ee?(De=(0,Q.jsx)(k,{open:s,onOpenChange:ue,children:Ee}),t[64]=s,t[65]=ue,t[66]=Ee,t[67]=De):De=t[67];let Oe;t[68]===n?Oe=t[69]:(Oe=e=>{n||x(e)},t[68]=n,t[69]=Oe);let ke;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove the password?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with a password. Make sure you still have a passkey, or recovery codes you have saved.`})]}),t[70]=ke):ke=t[70];let Ae;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),t[71]=Ae):Ae=t[71];let je;t[72]===B?je=t[73]:(je=()=>void B(),t[72]=B,t[73]=je);let Me;t[74]!==n||t[75]!==je?(Me=(0,Q.jsxs)(re,{children:[ke,(0,Q.jsxs)(M,{children:[Ae,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:je,children:`Remove password`})]})]}),t[74]=n,t[75]=je,t[76]=Me):Me=t[76];let Ne;t[77]!==y||t[78]!==Oe||t[79]!==Me?(Ne=(0,Q.jsx)(oe,{open:y,onOpenChange:Oe,children:Me}),t[77]=y,t[78]=Oe,t[79]=Me,t[80]=Ne):Ne=t[80];let Pe;return t[81]!==W||t[82]!==q||t[83]!==De||t[84]!==Ne?(Pe=(0,Q.jsxs)(he,{title:`Fallback sign-in`,icon:V,children:[W,q,De,Ne]}),t[81]=W,t[82]=q,t[83]=De,t[84]=Ne,t[85]=Pe):Pe=t[85],Pe}function Qe(e){return c.removePassword(e)}function $e(e){let t=(0,ye.c)(25),{busy:n,actionStatus:r,email:i,deliveryConfigured:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=r===`requesting-email-verification`,g;t[0]===s?g=t[1]:(g=J(s),t[0]=s,t[1]=g);let y=g,x;t[2]!==s||t[3]!==y||t[4]!==o?(x=async e=>{e.preventDefault(),d(!0),p(!1),!y&&await o(`request-email-verification`,e=>c.requestEmailVerification({email:s.trim(),...e}),{onCommitted:()=>{p(!0),l(``),d(!1)}})},t[2]=s,t[3]=y,t[4]=o,t[5]=x):x=t[5];let C=x,E;t[6]===a?E=t[7]:(E=a===!1?(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 pt-3.5 sm:px-5`,children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`No mail will arrive yet`}),(0,Q.jsx)(w,{children:`This Hub has no mail transport configured, so verification messages are generated and discarded. The request below will be accepted and nothing will be delivered until an operator wires one up. Do not rely on email as your way back into the account.`})]})}):null,t[6]=a,t[7]=E);let D=a?`Used for account recovery after verification. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`:`Used for account recovery once mail delivery is switched on. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`,ee=i===void 0?`Checking current state…`:i===null?`Not set`:`${i.verified?`Verified`:`Verification pending`} · ${i.address}`,O;t[8]!==f||t[9]!==n||t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==y||t[14]!==m||t[15]!==C||t[16]!==u?(O=i===void 0?null:(0,Q.jsxs)(`form`,{className:`pt-3 pb-3.5`,onSubmit:e=>void C(e),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,Q.jsx)(v,{"aria-label":`Email address`,type:`email`,value:s,autoComplete:`email`,placeholder:`you@example.com`,maxLength:254,disabled:m,className:_,onChange:e=>{l(e.target.value),p(!1)}}),(0,Q.jsx)(b,{type:`submit`,size:`sm`,variant:`outline`,disabled:n,className:`shrink-0`,children:(0,Q.jsx)($,{busy:m,children:i===null?`Send verification`:i.verified?`Change email`:`Resend or change`})})]}),u&&y?(0,Q.jsx)(`p`,{role:`alert`,className:`pt-2 text-xs text-destructive-foreground`,children:y}):null,f?(0,Q.jsx)(`p`,{role:`status`,className:`pt-2 text-xs text-muted-foreground`,children:a?`Verification email requested. Check your inbox and spam folder; delivery may take a moment.`:`Request accepted by the Hub. No message will be delivered until a mail transport is configured.`}):null]}),t[8]=f,t[9]=n,t[10]=i,t[11]=a,t[12]=s,t[13]=y,t[14]=m,t[15]=C,t[16]=u,t[17]=O):O=t[17];let te;t[18]!==D||t[19]!==ee||t[20]!==O?(te=(0,Q.jsx)(_e,{title:`Recovery email`,description:D,status:ee,children:O}),t[18]=D,t[19]=ee,t[20]=O,t[21]=te):te=t[21];let ne;return t[22]!==E||t[23]!==te?(ne=(0,Q.jsxs)(Q.Fragment,{children:[E,te]}),t[22]=E,t[23]=te,t[24]=ne):ne=t[24],ne}function et(e){let t=(0,ye.c)(52),{busy:n,actionStatus:r,recoveryCodes:i,run:a}=e,[o,s]=(0,Z.useState)(!1),c=r===`regenerating-recovery-codes`,{copyToClipboard:d,isCopied:p}=x(),m;t[0]===a?m=t[1]:(m=async()=>{s(!1),await a(`regenerate-recovery-codes`,it)},t[0]=a,t[1]=m);let h=m,g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(f,{"aria-hidden":!0,className:`size-3.5`}),t[2]=g):g=t[2];let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>s(!0),t[3]=_):_=t[3];let v;t[4]===c?v=t[5]:(v=(0,Q.jsx)($,{busy:c,children:`Generate new codes`}),t[4]=c,t[5]=v);let y;t[6]!==n||t[7]!==v?(y=(0,Q.jsx)(_e,{title:`One-time recovery codes`,description:`Single-use codes that get you back in when you have lost every passkey. They are a last resort, not a substitute for one — anyone holding a code can sign in as you.`,status:`Ryco shows them once and never writes them to browser storage.`,control:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:n,onClick:_,children:v})}),t[6]=n,t[7]=v,t[8]=y):y=t[8];let S;t[9]===n?S=t[10]:(S=e=>{n||s(e)},t[9]=n,t[10]=S);let C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Replace your recovery codes?`}),(0,Q.jsx)(ie,{children:`Every code you have already saved stops working immediately. You will get a new set, shown once — if you lose them you will have to generate another set from a session you can still sign in to.`})]}),t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[12]=w):w=t[12];let T;t[13]===h?T=t[14]:(T=()=>void h(),t[13]=h,t[14]=T);let A;t[15]!==n||t[16]!==T?(A=(0,Q.jsxs)(re,{children:[C,(0,Q.jsxs)(M,{children:[w,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:T,children:`Replace codes`})]})]}),t[15]=n,t[16]=T,t[17]=A):A=t[17];let P;t[18]!==o||t[19]!==A||t[20]!==S?(P=(0,Q.jsx)(oe,{open:o,onOpenChange:S,children:A}),t[18]=o,t[19]=A,t[20]=S,t[21]=P):P=t[21];let se=i.length>0,F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(D,{children:`Save your recovery codes`}),t[22]=F):F=t[22];let I=String(i.length),L;t[23]===I?L=t[24]:(L=(0,Q.jsxs)(E,{children:[F,(0,Q.jsxs)(te,{children:[`Save all `,I,` codes — they are shown once and cannot be retrieved later. Store them somewhere only you can reach — a password manager, or paper somewhere safe.`]})]}),t[23]=I,t[24]=L);let R;t[25]===i?R=t[26]:(R=i.map(nt),t[25]=i,t[26]=R);let z;t[27]===R?z=t[28]:(z=(0,Q.jsx)(O,{children:(0,Q.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:R})}),t[27]=R,t[28]=z);let le;t[29]!==d||t[30]!==i?(le=()=>d(ce(i),void 0),t[29]=d,t[30]=i,t[31]=le):le=t[31];let B;t[32]===p?B=t[33]:(B=p?(0,Q.jsx)(l,{"aria-hidden":!0}):(0,Q.jsx)(u,{"aria-hidden":!0}),t[32]=p,t[33]=B);let V=p?`Copied`:`Copy codes`,H;t[34]!==le||t[35]!==B||t[36]!==V?(H=(0,Q.jsxs)(b,{variant:`outline`,onClick:le,children:[B,V]}),t[34]=le,t[35]=B,t[36]=V,t[37]=H):H=t[37];let U;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(b,{onClick:tt,children:`I saved the codes`}),t[38]=U):U=t[38];let W;t[39]===H?W=t[40]:(W=(0,Q.jsxs)(ee,{children:[H,U]}),t[39]=H,t[40]=W);let G;t[41]!==L||t[42]!==z||t[43]!==W?(G=(0,Q.jsxs)(ne,{className:`max-w-md`,showCloseButton:!1,children:[L,z,W]}),t[41]=L,t[42]=z,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==se||t[46]!==G?(K=(0,Q.jsx)(k,{open:se,disablePointerDismissal:!0,onOpenChange:rt,children:G}),t[45]=se,t[46]=G,t[47]=K):K=t[47];let q;return t[48]!==P||t[49]!==K||t[50]!==y?(q=(0,Q.jsxs)(he,{title:`Recovery codes`,icon:g,children:[y,P,K]}),t[48]=P,t[49]=K,t[50]=y,t[51]=q):q=t[51],q}function tt(){return c.dismissRecoveryCodes()}function nt(e){return(0,Q.jsx)(`li`,{children:e},e)}function rt(e,t){e||t.cancel()}function it(e){return c.regenerateRecoveryCodes(e)}function at(e){let t=(0,ye.c)(45),{pending:n,attempts:r,code:i,onCodeChange:a,onSubmit:o,onCancel:s,busy:c}=e,l=n!==null,u;t[0]===s?u=t[1]:(u=e=>{e||s()},t[0]=s,t[1]=u);let d;t[2]===o?d=t[3]:(d=e=>{e.preventDefault(),o()},t[2]=o,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?I(n.action):``,t[4]=n,t[5]=f);let p;t[6]===f?p=t[7]:(p=(0,Q.jsx)(D,{children:f}),t[6]=f,t[7]=p);let m=n?.inferred??!1,h;t[8]!==r||t[9]!==m?(h=X(r,m),t[8]=r,t[9]=m,t[10]=h):h=t[10];let g;t[11]===h?g=t[12]:(g=(0,Q.jsx)(te,{children:h}),t[11]=h,t[12]=g);let y;t[13]!==p||t[14]!==g?(y=(0,Q.jsxs)(E,{children:[p,g]}),t[13]=p,t[14]=g,t[15]=y):y=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(se,{htmlFor:`account-step-up-code`,children:`Authenticator code`}),t[16]=x):x=t[16];let S;t[17]===a?S=t[18]:(S=e=>a(H(e.target.value)),t[17]=a,t[18]=S);let C;t[19]!==c||t[20]!==i||t[21]!==S?(C=(0,Q.jsxs)(O,{className:`space-y-2`,children:[x,(0,Q.jsx)(v,{id:`account-step-up-code`,value:i,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:c,className:_,onChange:S})]}),t[19]=c,t[20]=i,t[21]=S,t[22]=C):C=t[22];let w;t[23]===s?w=t[24]:(w=(0,Q.jsx)(b,{variant:`outline`,onClick:s,children:`Cancel`}),t[23]=s,t[24]=w);let T;t[25]!==c||t[26]!==i?(T=c||!ue(i),t[25]=c,t[26]=i,t[27]=T):T=t[27];let A;t[28]===c?A=t[29]:(A=(0,Q.jsx)($,{busy:c,children:`Confirm code`}),t[28]=c,t[29]=A);let j;t[30]!==T||t[31]!==A?(j=(0,Q.jsx)(b,{type:`submit`,disabled:T,children:A}),t[30]=T,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==w||t[34]!==j?(M=(0,Q.jsxs)(ee,{children:[w,j]}),t[33]=w,t[34]=j,t[35]=M):M=t[35];let N;t[36]!==C||t[37]!==M||t[38]!==d||t[39]!==y?(N=(0,Q.jsx)(ne,{className:`max-w-sm`,children:(0,Q.jsxs)(`form`,{onSubmit:d,children:[y,C,M]})}),t[36]=C,t[37]=M,t[38]=d,t[39]=y,t[40]=N):N=t[40];let re;return t[41]!==l||t[42]!==N||t[43]!==u?(re=(0,Q.jsx)(k,{open:l,onOpenChange:u,children:N}),t[41]=l,t[42]=N,t[43]=u,t[44]=re):re=t[44],re}export{Te as AccountSettingsPanel};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{C as r,Nr as i}from"./src-Vf4LVnMX.js";import{Rn as a,Vn as o,bn as s,f as c,l,v as u,y as d,zn as f}from"./runtime-DfGHeCnR.js";import{Dt as p,n as ee}from"./primary-OskAInOO.js";import{Ct as m,It as h,U as g,V as _,X as v,q as y}from"./composerDraftStore-CdJJZe42.js";import{i as te}from"./threadPriorityRefreshRuntime-tRDgvBzr.js";import{a as ne,i as b}from"./toast-CcSCAm4B.js";import{t as x}from"./refresh-cw-DopCMrtR.js";import{t as S}from"./sparkles-CAf3oJ5S.js";import{t as C}from"./ProviderModelPicker-COg6CGM4.js";import{t as re}from"./switch-BTGo9Yip.js";import{t as w}from"./button-BAbJxRzt.js";import{t as T}from"./toastHelpers-CSQRKo4F.js";import{a as ie,i as E,o as ae,s as oe,t as se}from"./select-BYbVr-yg.js";import"./providerInstances-BJcfB_9E.js";import{i as D,n as ce,r as O}from"./settingsLayout-D8glO7f1.js";var le=[`Thread titles`,`Project or repository names`,`Branch names`,`Bucketed creation and activity age`,`Running, approval, input, queue, failure, and delivery state`,`Pull request or linked issue title and state`,`Up to 600 characters from the latest user request`],k=[{value:0,label:`Manual only`},{value:3e5,label:`Every 5 minutes`},{value:6e5,label:`Every 10 minutes`},{value:18e5,label:`Every 30 minutes`},{value:36e5,label:`Every hour`},{value:216e5,label:`Every 6 hours`},{value:864e5,label:`Every 24 hours`}];function A(e){return{...e.enabled===void 0?{}:{aiFocusEnabled:e.enabled},...e.refreshIntervalMs===void 0?{}:{aiFocusRefreshIntervalMs:e.refreshIntervalMs}}}function j(e){return e.map(e=>{let t=e.serverConfig,n=t?.environment.capabilities.threadPriorityRanking===!0,r=t?.settings.inboxPriorityModelSelection??null,i=t?r??t.settings.textGenerationModelSelection:null,a=i===null?null:t?.providers.find(e=>e.instanceId===i.instanceId)??null;return{...e,supported:n,inherited:r===null,effectiveModelSelection:i,effectiveProvider:a}})}function M(e,t){let n=e.find(e=>e.instanceId===t);return!!(n&&n.enabled&&n.installed&&n.availability!==`unavailable`&&n.status!==`disabled`&&n.status!==`error`)}function N(e){if(e.selection!==null&&!M(e.serverConfig.providers,e.selection.instanceId))throw Error(`That provider instance is not available on this environment.`);return{inboxPriorityModelSelection:e.selection}}var P=n(),F=e(t(),1),I=h();function L(e){return e instanceof Error?e.message:`An unexpected error occurred.`}function ue(){let e=(0,P.c)(2),[t,n]=(0,F.useState)(R),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>u(()=>{n(l())}),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,F.useEffect)(r,i),t}function R(){return l()}function z({row:e}){let[t,n]=(0,F.useState)(!1),i=e.serverConfig;if(!i||!e.effectiveModelSelection)return null;let a={...i.settings,...r},o=e.effectiveModelSelection,s=v(y(i.providers)),c=_(a,i.providers,o.instanceId,o.model),l=async t=>{n(!0);try{let n=N({serverConfig:i,selection:t});await d(e.environmentId,n)}catch(t){b.add(T({type:`error`,title:`Could not update ${e.label}`,description:L(t)}))}finally{n(!1)}};return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,I.jsx)(C,{activeInstanceId:o.instanceId,model:o.model,lockedProvider:null,instanceEntries:s,modelOptionsByInstance:c,compact:!0,disabled:t||!e.connected,...e.connected?{}:{disabledReason:`Connect this environment to change its model.`},onInstanceModelChange:(e,t)=>{l(g({...a,textGenerationModelSelection:m(e,t)},i.providers))}}),e.inherited?null:(0,I.jsx)(w,{size:`xs`,variant:`ghost`,disabled:t||!e.connected,onClick:()=>void l(null),children:`Use text model`})]})}function B(e){let t=(0,P.c)(6),{row:n}=e,r=n.effectiveProvider?.displayName??n.effectiveProvider?.driver??null,i=n.connected?n.supported?n.inherited?`Inherits the text-generation model${r?` (${r})`:``}.`:`Uses a separate model for Inbox ranking.`:`This node version does not support AI Focus ranking. Other supported nodes still work.`:`Offline — ranking waits for an existing connection.`,a;t[0]===n?a=t[1]:(a=n.supported?(0,I.jsx)(z,{row:n}):void 0,t[0]=n,t[1]=a);let o;return t[2]!==n.label||t[3]!==i||t[4]!==a?(o=(0,I.jsx)(O,{title:n.label,description:i,control:a}),t[2]=n.label,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function V(){let e=(0,P.c)(48),t=a(),{updateSettings:n}=f(),r=o(),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=ee(),e[0]=c):c=e[0];let l=c,u=s(he),d=ue(),[p,m]=(0,F.useState)(!1);l?.environmentId,l?.label;let h;if(e[1]!==d||e[2]!==r||e[3]!==u){let t=new Map;l?.environmentId&&t.set(l.environmentId,{label:l.label,config:r});for(let e of d){if(t.has(e.environmentId))continue;let n=u[e.environmentId];t.set(e.environmentId,{label:n?.descriptor?.label??e.knownEnvironment.label,config:n?.serverConfig??null})}for(let[e,n]of Object.entries(u)){let r=i.make(e);t.has(r)||t.set(r,{label:n.descriptor?.label??`Saved environment`,config:n.serverConfig})}h=j([...t].map(me)),e[1]=d,e[2]=r,e[3]=u,e[4]=h}else h=e[4];let g=h,_;e[5]===g?_=e[6]:(_=async()=>{m(!0);let e=await te(),t=e.failures;t.length>0?b.add(T({type:`error`,title:`AI Focus refresh failed`,description:t.map(e=>{let{environmentId:t,error:n}=e;return`${g.find(e=>e.environmentId===t)?.label??`Environment`}: ${L(n)}`}).join(` · `)})):b.add(T({type:`success`,title:e.attempted.length>0?`AI Focus refreshed`:`No connected supported nodes`,description:e.attempted.length>0?`Updated ${e.succeeded.length} environment${e.succeeded.length===1?``:`s`}.`:`Connect a supported node to rank its Inbox.`})),m(!1)},e[5]=g,e[6]=_);let v=_,y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(S,{className:`size-3.5`}),e[7]=y):y=e[7];let C;e[8]===n?C=e[9]:(C=e=>n(A({enabled:e})),e[8]=n,e[9]=C);let E;e[10]!==t.aiFocusEnabled||e[11]!==C?(E=(0,I.jsx)(O,{title:`Prioritize the Inbox`,description:`Create a Focus section from pinned, actionable, and model-ranked threads. Focused threads are removed from Active, never duplicated.`,control:(0,I.jsx)(re,{"aria-label":`Enable AI Focus`,checked:t.aiFocusEnabled,onCheckedChange:C})}),e[10]=t.aiFocusEnabled,e[11]=C,e[12]=E):E=e[12];let M=String(t.aiFocusRefreshIntervalMs),N;e[13]===n?N=e[14]:(N=e=>{let t=Number(e);n(A({refreshIntervalMs:t}))},e[13]=n,e[14]=N);let R;e[15]===t.aiFocusRefreshIntervalMs?R=e[16]:(R=k.find(e=>e.value===t.aiFocusRefreshIntervalMs)?.label??`Every 10 minutes`,e[15]=t.aiFocusRefreshIntervalMs,e[16]=R);let z;e[17]===R?z=e[18]:(z=(0,I.jsx)(ae,{className:`w-48`,"aria-label":`AI Focus refresh interval`,children:(0,I.jsx)(oe,{children:R})}),e[17]=R,e[18]=z);let B;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,I.jsx)(ie,{align:`end`,alignItemWithTrigger:!1,children:k.map(pe)}),e[19]=B):B=e[19];let V;e[20]!==M||e[21]!==N||e[22]!==z?(V=(0,I.jsxs)(se,{value:M,onValueChange:N,children:[z,B]}),e[20]=M,e[21]=N,e[22]=z,e[23]=V):V=e[23];let H;e[24]===v?H=e[25]:(H=()=>void v(),e[24]=v,e[25]=H);let U=p?`size-4 animate-spin`:`size-4`,W;e[26]===U?W=e[27]:(W=(0,I.jsx)(x,{className:U}),e[26]=U,e[27]=W);let G;e[28]!==p||e[29]!==H||e[30]!==W?(G=(0,I.jsx)(w,{size:`icon-sm`,variant:`outline`,"aria-label":`Refresh AI Focus now`,disabled:p,onClick:H,children:W}),e[28]=p,e[29]=H,e[30]=W,e[31]=G):G=e[31];let K;e[32]!==V||e[33]!==G?(K=(0,I.jsx)(O,{title:`Refresh rankings`,description:`Automatic checks use only nodes that are already connected. Manual-only never starts a connection.`,control:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,G]})}),e[32]=V,e[33]=G,e[34]=K):K=e[34];let q;e[35]!==K||e[36]!==E?(q=(0,I.jsxs)(D,{title:`AI Focus`,icon:y,children:[E,K]}),e[35]=K,e[36]=E,e[37]=q):q=e[37];let J;e[38]===g?J=e[39]:(J=g.length>0?g.map(fe):(0,I.jsx)(O,{title:`No environments available`,description:`Connect a node to configure its Inbox ranking model.`}),e[38]=g,e[39]=J);let Y;e[40]===J?Y=e[41]:(Y=(0,I.jsx)(D,{title:`Models`,children:J}),e[40]=J,e[41]=Y);let X;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,I.jsx)(ne,{className:`size-3.5`}),e[42]=X):X=e[42];let Z;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,I.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Ranking sends only this bounded metadata from each environment. It does not send full chat history, file contents, or message responses.`}),e[43]=Z):Z=e[43];let Q;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,I.jsx)(D,{title:`Data sent to the selected model`,icon:X,children:(0,I.jsxs)(`div`,{className:`px-5 py-4`,children:[Z,(0,I.jsx)(`ul`,{className:`grid gap-1.5 text-xs text-foreground/80 sm:grid-cols-2`,children:le.map(de)})]})}),e[44]=Q):Q=e[44];let $;return e[45]!==q||e[46]!==Y?($=(0,I.jsxs)(ce,{children:[q,Y,Q]}),e[45]=q,e[46]=Y,e[47]=$):$=e[47],$}function de(e){return(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`•`}),(0,I.jsx)(`span`,{children:e})]},e)}function fe(e){return(0,I.jsx)(B,{row:e},e.environmentId)}function pe(e){return(0,I.jsx)(E,{hideIndicator:!0,value:String(e.value),children:e.label},e.value)}function me(e){let[t,n]=e;return{environmentId:t,label:n.label,connected:c(t)!==null&&p(t).phase===`connected`,serverConfig:n.config}}function he(e){return e.byId}export{V as AiFocusSettings};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-CdJJZe42.js";var i=n(),a=e(t(),1),o=r(),s=250;function c(e){let t=(0,i.c)(17),{children:n}=e,r=(0,a.useRef)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={height:null,isClipping:!1},t[0]=c):c=t[0];let[d,f]=(0,a.useState)(c),p;t[1]===d.isClipping?p=t[2]:(p=()=>{if(!d.isClipping)return;let e=window.setTimeout(()=>{f(u)},s);return()=>window.clearTimeout(e)},t[1]=d.isClipping,t[2]=p);let m;t[3]!==d.height||t[4]!==d.isClipping?(m=[d.height,d.isClipping],t[3]=d.height,t[4]=d.isClipping,t[5]=m):m=t[5],(0,a.useEffect)(p,m);let h,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{let e=r.current;if(!e)return;let t=null,n=null,i=()=>{let t=Math.ceil(e.scrollHeight||e.getBoundingClientRect().height);f(e=>e.height===t?e:{height:t,isClipping:e.height!==null})},a=()=>{t!==null&&(window.cancelAnimationFrame(t),t=null),n!==null&&(window.cancelAnimationFrame(n),n=null)},o=()=>{a(),i(),t=window.requestAnimationFrame(()=>{t=null,i(),n=window.requestAnimationFrame(()=>{n=null,i()})})};o();let s=new ResizeObserver(o);return s.observe(e),()=>{s.disconnect(),a()}},g=[],t[6]=h,t[7]=g):(h=t[6],g=t[7]),(0,a.useLayoutEffect)(h,g);let _;t[8]!==d.height||t[9]!==d.isClipping?(_=d.height===null?void 0:{height:d.height,overflow:d.isClipping?`hidden`:`visible`},t[8]=d.height,t[9]=d.isClipping,t[10]=_):_=t[10];let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&f(l)},t[11]=v):v=t[11];let y;t[12]===n?y=t[13]:(y=(0,o.jsx)(`div`,{ref:r,children:n}),t[12]=n,t[13]=y);let b;return t[14]!==_||t[15]!==y?(b=(0,o.jsx)(`div`,{"data-slot":`animated-height`,className:`transition-[height] duration-200 ease-out motion-reduce:transition-none`,style:_,onTransitionEnd:v,children:y}),t[14]=_,t[15]=y,t[16]=b):b=t[16],b}function l(e){return e.isClipping?{...e,isClipping:!1}:e}function u(e){return e.isClipping?{...e,isClipping:!1}:e}export{c as t};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-CdJJZe42.js";import{i}from"./uiStateStore-B6pjzSjj.js";import{f as a}from"./useRenderElement-DchFnsR8.js";import{i as o}from"./toast-CcSCAm4B.js";import{t as s}from"./clipboard-copy-C4VV20QR.js";import{t as c}from"./copy-UQjKGt7t.js";import{t as l}from"./download-CQZ-m4zW.js";import{t as u}from"./palette-BSD_aJZg.js";import{t as d}from"./panel-right-BodNpkM9.js";import{t as f}from"./pencil-B69ERoVM.js";import{t as p}from"./plus-B2h-VEqh.js";import{t as m}from"./trash-2-CM1zXPGb.js";import{t as h}from"./x-C1Cemsov.js";import{t as g}from"./utils-BofFIn5Y.js";import{t as _}from"./switch-BTGo9Yip.js";import{t as v}from"./input-CHEwW3oH.js";import{t as y}from"./button-BAbJxRzt.js";import{t as b}from"./textarea-RFPODxWW.js";import{a as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./alert-dialog-DxoA6ky8.js";import{a as O,i as k,o as A,s as j,t as M}from"./select-BYbVr-yg.js";import{n as ee,r as te,t as N}from"./popover-CuH9Yrj3.js";import{t as P}from"./badge-CXw6fWrB.js";import{a as F,b as ne,c as re,d as ie,h as I,i as ae,m as oe,o as se,p as ce,u as L,v as R,x as z}from"./appearancePreferences-COvj0WMT.js";import{_ as le,a as ue,b as de,c as fe,d as pe,f as B,g as V,h as me,i as he,l as ge,m as H,o as _e,p as U,r as W,s as G,t as ve,u as ye,v as be,x as xe,y as Se}from"./useTheme-DiC-5xCb.js";import{n as Ce,t as K}from"./toggle-group-mLIkiJtU.js";import{i as q,n as we,r as J,t as Y}from"./settingsLayout-D8glO7f1.js";var Te=a(`baseline`,[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Ee=a(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),De=a(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Oe=a(`radius`,[[`path`,{d:`M20.34 17.52a10 10 0 1 0-2.82 2.82`,key:`fydyku`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`path`,{d:`m13.41 13.41 4.18 4.18`,key:`1gqbwc`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ke=a(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Ae=a(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),X=e(t(),1),Z=n(),Q=`.rycotheme.json`,je=/[^a-z0-9-_]+/gi;function Me(e){let t=(e.name||e.id).trim().replace(je,`-`).replace(/^-+|-+$/g,``);return`${t.length>0?t:e.id||`theme`}${Q}`}function Ne(e){let t={id:e.id,name:e.name};return e.description&&(t.description=e.description),e.light&&(t.light={...e.light}),e.dark&&(t.dark={...e.dark}),JSON.stringify(t,null,2)}function Pe(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`Could not parse theme JSON: ${e instanceof Error?e.message:`invalid JSON`}`,{cause:e})}if(!U(t))throw Error(`Theme JSON does not match the schema (need string id/name and string-only light/dark tokens).`);let n={id:t.id,name:t.name,builtIn:!1};return t.description&&(n.description=t.description),t.light&&(n.light={...t.light}),t.dark&&(n.dark={...t.dark}),n}function Fe(e,t=`rename`){let n=Pe(e);if(!ye().find(e=>e.id===n.id))return he(n),{theme:n,action:`added`};if(pe(n.id)||t===`rename`){let e={...n,id:ge(n.id)};return he(e),{theme:e,action:`renamed`}}return be(n.id,n),{theme:n,action:`replaced`}}typeof TextEncoder>`u`||new TextEncoder,typeof TextDecoder>`u`||new TextDecoder;async function Ie(e){let t=Ne(e);if(typeof navigator>`u`||!navigator.clipboard)throw Error(`Clipboard API not available in this environment.`);await navigator.clipboard.writeText(t)}function Le(e){if(typeof document>`u`||typeof URL>`u`||typeof Blob>`u`)throw Error(`Download not supported in this environment.`);let t=new Blob([Ne(e)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=Me(e),r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function Re(e,t={}){let n=Fe(await e.text(),t.collision??`rename`);return t.activate&&(le(n.theme.id),ue(n.theme)),n}var $=r();function ze(e,t,n){return e<t?t:e>n?n:e}function Be(e){let t=e.trim().replace(/^#/,``),n;if(t.length===3)n=t.split(``).map(e=>`${e}${e}`).join(``);else if(t.length===6)n=t;else return null;return/^[0-9a-fA-F]{6}$/.test(n)?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null}function Ve({r:e,g:t,b:n}){let r=e=>ze(Math.round(e),0,255).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}function He({r:e,g:t,b:n}){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=o-Math.min(r,i,a),c=0;s!==0&&(c=o===r?60*((i-a)/s%6):o===i?60*((a-r)/s+2):60*((r-i)/s+4)),c<0&&(c+=360);let l=o===0?0:s/o;return{h:c,s:l,v:o}}function Ue({h:e,s:t,v:n}){let r=n*t,i=(e%360+360)%360/60,a=r*(1-Math.abs(i%2-1)),o=0,s=0,c=0;i<1?[o,s,c]=[r,a,0]:i<2?[o,s,c]=[a,r,0]:i<3?[o,s,c]=[0,r,a]:i<4?[o,s,c]=[0,a,r]:i<5?[o,s,c]=[a,0,r]:[o,s,c]=[r,0,a];let l=n-r;return{r:(o+l)*255,g:(s+l)*255,b:(c+l)*255}}function We(e){let t=(0,Z.c)(71),{value:n,onChange:r,children:i,side:a,align:o,ariaLabel:s,triggerClassName:c}=e,l=a===void 0?`bottom`:a,u=o===void 0?`start`:o,d;t[0]===n?d=t[1]:(d=()=>{let e=Be(n);return e?He(e):{h:0,s:0,v:0}},t[0]=n,t[1]=d);let[f,p]=(0,X.useState)(d),[m,h]=(0,X.useState)(n),[_,y]=(0,X.useState)(!1),b=(0,X.useRef)(null),x=(0,X.useRef)(null),S=(0,X.useRef)(r),C=(0,X.useRef)(f.h),w;t[2]===r?w=t[3]:(w=()=>{S.current=r},t[2]=r,t[3]=w),(0,X.useEffect)(w);let T,E;t[4]===f.h?(T=t[5],E=t[6]):(T=()=>{C.current=f.h},E=[f.h],t[4]=f.h,t[5]=T,t[6]=E),(0,X.useEffect)(T,E);let D;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{if(b.current=null,x.current===null)return;let e=x.current;x.current=null,S.current(e)},t[7]=D):D=t[7];let O=D,k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>{x.current=e,b.current===null&&(b.current=requestAnimationFrame(O))},t[8]=k):k=t[8];let A=k,j,M;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>{if(b.current!==null&&(cancelAnimationFrame(b.current),b.current=null),x.current!==null){let e=x.current;x.current=null,S.current(e)}},j=[],t[9]=j,t[10]=M):(j=t[9],M=t[10]),(0,X.useEffect)(M,j);let P;t[11]===f?P=t[12]:(P=Ve(Ue(f)),t[11]=f,t[12]=P);let F=P,ne,re;t[13]!==F||t[14]!==n?(ne=()=>{if(n.toLowerCase()===F.toLowerCase())return;let e=Be(n);if(!e)return;let t=He(e);p(e=>({h:t.s===0?e.h:t.h,s:t.s,v:t.v})),h(n)},re=[n,F],t[13]=F,t[14]=n,t[15]=ne,t[16]=re):(ne=t[15],re=t[16]),(0,X.useEffect)(ne,re);let ie=(0,X.useRef)(null),I;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{let t=ie.current;if(!t)return;let n=t.getBoundingClientRect(),r=ze(e.clientX-n.left,0,n.width),i=ze(e.clientY-n.top,0,n.height),a=n.width===0?0:r/n.width,o=n.height===0?0:1-i/n.height;p(e=>{let t={h:e.h,s:a,v:o},n=Ve(Ue(t));return h(n),x.current=n,b.current===null&&(b.current=requestAnimationFrame(O)),t})},t[17]=I):I=t[17];let ae=I,oe;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(oe=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ae(e)},t[18]=oe):oe=t[18];let se=oe,ce;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(ce=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ae(e)},t[19]=ce):ce=t[19];let L=ce,R=(0,X.useRef)(null),z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{let t=R.current;if(!t)return;let n=t.getBoundingClientRect(),r=ze(e.clientX-n.left,0,n.width),i=n.width===0?0:r/n.width*360;p(e=>{let t={h:i,s:e.s,v:e.v},n=Ve(Ue(t));return h(n),x.current=n,b.current===null&&(b.current=requestAnimationFrame(O)),t})},t[20]=z):z=t[20];let le=z,ue;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),le(e)},t[21]=ue):ue=t[21];let de=ue,fe;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&le(e)},t[22]=fe):fe=t[22];let pe=fe,B;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{h(e);let t=Be(e.startsWith(`#`)?e:`#${e}`);if(!t)return;let n=He(t),r={h:n.s===0?C.current:n.h,s:n.s,v:n.v};p(r),A(Ve(t))},t[23]=B):B=t[23];let V=B,me=`${f.h/360*100}%`,he=`${f.s*100}%`,ge=`${(1-f.v)*100}%`,H=`hsl(${f.h} 100% 50%)`,_e;t[24]===c?_e=t[25]:(_e=g(`relative size-5 shrink-0 cursor-pointer overflow-hidden rounded-sm border border-border/80 outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,c),t[24]=c,t[25]=_e);let U;t[26]!==s||t[27]!==i||t[28]!==_e?(U=(0,$.jsx)(te,{"aria-label":s,className:_e,children:i}),t[26]=s,t[27]=i,t[28]=_e,t[29]=U):U=t[29];let W;t[30]===f.s?W=t[31]:(W=Math.round(f.s*100),t[30]=f.s,t[31]=W);let G;t[32]===H?G=t[33]:(G={backgroundColor:H},t[32]=H,t[33]=G);let ve;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0))`}}),t[34]=ve):ve=t[34];let ye;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0))`}}),t[35]=ye):ye=t[35];let be;t[36]!==he||t[37]!==ge?(be=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:he,top:ge}}),t[36]=he,t[37]=ge,t[38]=be):be=t[38];let xe;t[39]!==W||t[40]!==G||t[41]!==be?(xe=(0,$.jsxs)(`div`,{ref:ie,role:`slider`,"aria-label":`Saturation and value`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":W,tabIndex:0,className:`relative h-36 w-full cursor-crosshair touch-none select-none overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:G,onPointerDown:se,onPointerMove:L,children:[ve,ye,be]}),t[39]=W,t[40]=G,t[41]=be,t[42]=xe):xe=t[42];let Se;t[43]===f.h?Se=t[44]:(Se=Math.round(f.h),t[43]=f.h,t[44]=Se);let Ce;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Ce={background:`linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%))`},t[45]=Ce):Ce=t[45];let K;t[46]===me?K=t[47]:(K=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:me}}),t[46]=me,t[47]=K);let q;t[48]!==Se||t[49]!==K?(q=(0,$.jsx)(`div`,{ref:R,role:`slider`,"aria-label":`Hue`,"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Se,tabIndex:0,className:`relative h-3 w-full cursor-ew-resize touch-none select-none overflow-hidden rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:Ce,onPointerDown:de,onPointerMove:pe,children:K}),t[48]=Se,t[49]=K,t[50]=q):q=t[50];let we;t[51]===F?we=t[52]:(we=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-7 shrink-0 rounded-md border border-border/60`,style:{backgroundColor:F}}),t[51]=F,t[52]=we);let J;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>V(e.currentTarget.value),t[53]=J):J=t[53];let Y;t[54]===m?Y=t[55]:(Y=(0,$.jsx)(v,{value:m,size:`sm`,nativeInput:!0,onChange:J,spellCheck:!1,className:`font-mono text-xs`,"aria-label":`Hex value`}),t[54]=m,t[55]=Y);let Te;t[56]!==we||t[57]!==Y?(Te=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[we,Y]}),t[56]=we,t[57]=Y,t[58]=Te):Te=t[58];let Ee;t[59]!==xe||t[60]!==q||t[61]!==Te?(Ee=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[xe,q,Te]}),t[59]=xe,t[60]=q,t[61]=Te,t[62]=Ee):Ee=t[62];let De;t[63]!==u||t[64]!==l||t[65]!==Ee?(De=(0,$.jsx)(ee,{side:l,align:u,className:`w-64`,children:Ee}),t[63]=u,t[64]=l,t[65]=Ee,t[66]=De):De=t[66];let Oe;return t[67]!==_||t[68]!==U||t[69]!==De?(Oe=(0,$.jsxs)(N,{open:_,onOpenChange:y,children:[U,De]}),t[67]=_,t[68]=U,t[69]=De,t[70]=Oe):Oe=t[70],Oe}var Ge=[{title:`Surfaces`,tokens:[`background`,`app-chrome-background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`]},{title:`Brand & focus`,tokens:[`primary`,`primary-foreground`,`ring`]},{title:`Neutrals`,tokens:[`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`]},{title:`Status`,tokens:[`destructive`,`destructive-foreground`,`info`,`info-foreground`,`success`,`success-foreground`,`warning`,`warning-foreground`]},{title:`Borders & inputs`,tokens:[`border`,`input`]},{title:`Scrollbars`,tokens:[`scrollbar-thumb`,`scrollbar-thumb-hover`,`scrollbar-thumb-thin`,`scrollbar-thumb-thin-hover`]}],Ke=new Set(Se),qe=null,Je=null;function Ye(e){if(typeof document>`u`||document.body===void 0||!e)return`#000000`;qe||(qe=document.createElement(`div`),qe.style.position=`absolute`,qe.style.visibility=`hidden`,qe.style.pointerEvents=`none`,document.body.append(qe)),qe.style.color=``,qe.style.color=e;let t=getComputedStyle(qe).color;Je||=document.createElement(`canvas`),Je.width=1,Je.height=1;let n=Je.getContext(`2d`,{willReadFrequently:!0});if(!n)return`#000000`;n.clearRect(0,0,1,1);try{n.fillStyle=t}catch{return`#000000`}n.fillRect(0,0,1,1);let r=n.getImageData(0,0,1,1).data;return`#${[r[0],r[1],r[2]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}function Xe(e,t,n,r){let i={...e[t]};return r.length===0?delete i[n]:i[n]=r,t===`light`?{...e,light:i}:{...e,dark:i}}function Ze(e,t){return{...e,name:t}}function Qe(e,t){let n={...e};return t.length===0?delete n.description:n.description=t,n}function $e(e){return W.includes(e)}function et(e){let t=(0,Z.c)(124),{source:n,draft:r,onDraftChange:i,onSave:a,onCancel:o,resolvedVariant:s}=e,[c,l]=(0,X.useState)(`form`),[u,d]=(0,X.useState)(s),f;t[0]===r?f=t[1]:(f=()=>JSON.stringify(r,null,2),t[0]=r,t[1]=f);let[p,m]=(0,X.useState)(f),[h,g]=(0,X.useState)(null),[_,O]=(0,X.useState)(!1),k;t[2]===n?k=t[3]:(k=JSON.stringify(n),t[2]=n,t[3]=k);let A;t[4]===r?A=t[5]:(A=JSON.stringify(r),t[4]=r,t[5]=A);let j=k!==A,M;t[6]===r?M=t[7]:(M=()=>{ue(r)},t[6]=r,t[7]=M);let ee;t[8]!==r||t[9]!==s?(ee=[r,s],t[8]=r,t[9]=s,t[10]=ee):ee=t[10],(0,X.useEffect)(M,ee);let te,N;t[11]!==r||t[12]!==c?(te=()=>{c===`form`&&m(JSON.stringify(r,null,2))},N=[r,c],t[11]=r,t[12]=c,t[13]=te,t[14]=N):(te=t[13],N=t[14]),(0,X.useEffect)(te,N);let P;t[15]!==r||t[16]!==i?(P=e=>{i(Ze(r,e))},t[15]=r,t[16]=i,t[17]=P):P=t[17];let F=P,ne;t[18]!==r||t[19]!==i?(ne=e=>{i(Qe(r,e))},t[18]=r,t[19]=i,t[20]=ne):ne=t[20];let re=ne,ie;t[21]!==r||t[22]!==i||t[23]!==u?(ie=(e,t)=>{i(Xe(r,u,e,t))},t[21]=r,t[22]=i,t[23]=u,t[24]=ie):ie=t[24];let I=ie,ae;t[25]===i?ae=t[26]:(ae=e=>{m(e);let t;try{t=JSON.parse(e)}catch(e){let t=e;g(t instanceof Error?t.message:`Invalid JSON`);return}if(!U(t)){g(`Invalid theme schema. Need string id/name and string-only light/dark tokens.`);return}g(null),i(t)},t[25]=i,t[26]=ae);let oe=ae,se;t[27]!==j||t[28]!==o?(se=()=>{if(j){O(!0);return}o()},t[27]=j,t[28]=o,t[29]=se):se=t[29];let ce=se,L,R,z;if(t[30]!==r.dark||t[31]!==r.light||t[32]!==u){z=(u===`dark`?r.dark:r.light)??{};let e;t[36]===u?e=t[37]:(e=(u===`dark`?xe.dark:xe.light)??{},t[36]=u,t[37]=e),L=e,R=Object.entries(z).filter(rt),t[30]=r.dark,t[31]=r.light,t[32]=u,t[33]=L,t[34]=R,t[35]=z}else L=t[33],R=t[34],z=t[35];let le=R,fe=tt,pe=fe(r.light)||fe(r.dark),B;t[38]!==r.name||t[39]!==pe||t[40]!==h?(B=h!==null||r.name.trim().length===0||pe,t[38]=r.name,t[39]=pe,t[40]=h,t[41]=B):B=t[41];let V=B,me;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Editing`}),t[42]=me):me=t[42];let he=r.name||`Untitled`,ge;t[43]!==r.name||t[44]!==he?(ge=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:r.name,children:he}),t[43]=r.name,t[44]=he,t[45]=ge):ge=t[45];let H;t[46]===j?H=t[47]:(H=j?(0,$.jsx)(`span`,{className:`rounded-sm bg-warning/16 px-1.5 py-0.5 text-[10px] font-medium text-warning-foreground`,children:`Unsaved`}):null,t[46]=j,t[47]=H);let _e;t[48]===ce?_e=t[49]:(_e=(0,$.jsx)(y,{size:`sm`,variant:`outline`,onClick:ce,children:`Cancel`}),t[48]=ce,t[49]=_e);let W;t[50]!==a||t[51]!==V?(W=(0,$.jsx)(y,{size:`sm`,onClick:a,disabled:V,children:`Save`}),t[50]=a,t[51]=V,t[52]=W):W=t[52];let G;t[53]!==_e||t[54]!==W?(G=(0,$.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[_e,W]}),t[53]=_e,t[54]=W,t[55]=G):G=t[55];let ve;t[56]!==ge||t[57]!==H||t[58]!==G?(ve=(0,$.jsxs)(`div`,{className:`sticky top-0 z-10 flex flex-wrap items-center gap-2 border-b border-border/60 bg-muted/72 px-4 py-2 backdrop-blur-sm sm:px-5`,children:[me,ge,H,G]}),t[56]=ge,t[57]=H,t[58]=G,t[59]=ve):ve=t[59];let ye;t[60]===c?ye=t[61]:(ye=[c],t[60]=c,t[61]=ye);let be,Se,q;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(be=e=>{let t=e[0];(t===`form`||t===`json`)&&l(t)},Se=(0,$.jsx)(K,{value:`form`,"aria-label":`Form editor`,className:`px-3 sm:px-3`,children:`Form`}),q=(0,$.jsx)(K,{value:`json`,"aria-label":`JSON editor`,className:`px-3 sm:px-3`,children:`JSON`}),t[62]=be,t[63]=Se,t[64]=q):(be=t[62],Se=t[63],q=t[64]);let we;t[65]===ye?we=t[66]:(we=(0,$.jsxs)(Ce,{value:ye,variant:`outline`,size:`sm`,onValueChange:be,children:[Se,q]}),t[65]=ye,t[66]=we);let J;t[67]===u?J=t[68]:(J=[u],t[67]=u,t[68]=J);let Y,Te,Ee;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{let t=e[0];(t===`light`||t===`dark`)&&d(t)},Te=(0,$.jsx)(K,{value:`light`,"aria-label":`Light variant`,className:`px-3 sm:px-3`,children:`Light`}),Ee=(0,$.jsx)(K,{value:`dark`,"aria-label":`Dark variant`,className:`px-3 sm:px-3`,children:`Dark`}),t[69]=Y,t[70]=Te,t[71]=Ee):(Y=t[69],Te=t[70],Ee=t[71]);let De;t[72]===J?De=t[73]:(De=(0,$.jsxs)(Ce,{value:J,variant:`outline`,size:`sm`,onValueChange:Y,children:[Te,Ee]}),t[72]=J,t[73]=De);let Oe;t[74]!==we||t[75]!==De?(Oe=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[we,De]}),t[74]=we,t[75]=De,t[76]=Oe):Oe=t[76];let ke;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name`}),t[77]=ke):ke=t[77];let Ae;t[78]===F?Ae=t[79]:(Ae=e=>F(e.currentTarget.value),t[78]=F,t[79]=Ae);let Q;t[80]===r.name?Q=t[81]:(Q=r.name.trim().length===0||void 0,t[80]=r.name,t[81]=Q);let je;t[82]!==r.name||t[83]!==Ae||t[84]!==Q?(je=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[ke,(0,$.jsx)(v,{value:r.name,nativeInput:!0,onChange:Ae,"aria-invalid":Q})]}),t[82]=r.name,t[83]=Ae,t[84]=Q,t[85]=je):je=t[85];let Me;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Description`}),t[86]=Me):Me=t[86];let Ne=r.description??``,Pe;t[87]===re?Pe=t[88]:(Pe=e=>re(e.currentTarget.value),t[87]=re,t[88]=Pe);let Fe;t[89]!==Ne||t[90]!==Pe?(Fe=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Me,(0,$.jsx)(v,{value:Ne,nativeInput:!0,onChange:Pe,placeholder:`Optional, shown under the picker.`})]}),t[89]=Ne,t[90]=Pe,t[91]=Fe):Fe=t[91];let Ie;t[92]!==je||t[93]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[je,Fe]}),t[92]=je,t[93]=Fe,t[94]=Ie):Ie=t[94];let Le;t[95]!==oe||t[96]!==I||t[97]!==L||t[98]!==h||t[99]!==p||t[100]!==c||t[101]!==le||t[102]!==z?(Le=c===`form`?(0,$.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[Ge.map(e=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e.title}),(0,$.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.tokens.map(e=>{let t=z[e]??``,n=L[e]??``,r=de(e);return r?(0,$.jsx)(it,{token:e,kind:r,value:t,inherited:n,onChange:t=>I(e,t)},e):null})})]},e.title)),le.length>0?(0,$.jsxs)(`p`,{className:`text-xs text-warning-foreground`,children:[le.length,` token`,le.length===1?``:`s`,` not in the allow-list will be ignored on save.`]}):null]}):(0,$.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(b,{value:p,size:`sm`,className:`font-mono text-xs`,spellCheck:!1,rows:18,onChange:e=>oe(e.currentTarget.value),"aria-invalid":h!==null||void 0}),h?(0,$.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:h}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`Edit the JSON directly. Save is disabled while the schema is invalid.`})]}),t[95]=oe,t[96]=I,t[97]=L,t[98]=h,t[99]=p,t[100]=c,t[101]=le,t[102]=z,t[103]=Le):Le=t[103];let Re;t[104]!==Oe||t[105]!==Ie||t[106]!==Le?(Re=(0,$.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[Oe,Ie,Le]}),t[104]=Oe,t[105]=Ie,t[106]=Le,t[107]=Re):Re=t[107];let ze;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,$.jsx)(E,{children:`Discard your changes?`}),t[108]=ze):ze=t[108];let Be;t[109]===n.name?Be=t[110]:(Be=(0,$.jsxs)(x,{children:[ze,(0,$.jsxs)(T,{children:[`You have unsaved edits to `,n.name,`. Discarding will revert any token changes you made.`]})]}),t[109]=n.name,t[110]=Be);let Ve;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(C,{render:(0,$.jsx)(y,{variant:`outline`}),children:`Keep editing`}),t[111]=Ve):Ve=t[111];let He;t[112]===o?He=t[113]:(He=(0,$.jsxs)(S,{children:[Ve,(0,$.jsx)(y,{variant:`destructive`,onClick:()=>{O(!1),o()},children:`Discard changes`})]}),t[112]=o,t[113]=He);let Ue;t[114]!==Be||t[115]!==He?(Ue=(0,$.jsxs)(w,{children:[Be,He]}),t[114]=Be,t[115]=He,t[116]=Ue):Ue=t[116];let We;t[117]!==_||t[118]!==Ue?(We=(0,$.jsx)(D,{open:_,onOpenChange:O,children:Ue}),t[117]=_,t[118]=Ue,t[119]=We):We=t[119];let Ke;return t[120]!==ve||t[121]!==Re||t[122]!==We?(Ke=(0,$.jsxs)(`div`,{className:`border-t border-border/60 bg-muted/24`,children:[ve,Re,We]}),t[120]=ve,t[121]=Re,t[122]=We,t[123]=Ke):Ke=t[123],Ke}function tt(e){return Object.entries(e??{}).some(nt)}function nt(e){let[t,n]=e;if(typeof n!=`string`||n.length===0)return!1;let r=de(t);return r?!H(r,n):!1}function rt(e){let[t]=e;return!Ke.has(t)}function it(e){let t=(0,Z.c)(12),{token:n,kind:r,value:i,inherited:a,onChange:o}=e,s=i.length>0,c=r===`font-family`&&`sm:col-span-2`,l;t[0]===c?l=t[1]:(l=g(`rounded-md border border-border/60 bg-background px-2 py-1.5`,c),t[0]=c,t[1]=l);let u;t[2]!==a||t[3]!==r||t[4]!==o||t[5]!==s||t[6]!==n||t[7]!==i?(u=r===`color`?(0,$.jsx)(st,{token:n,value:i,inherited:a,overridden:s,onChange:o}):r===`opacity`?(0,$.jsx)(ct,{token:n,value:i,inherited:a,overridden:s,onChange:o}):r===`length`?(0,$.jsx)(lt,{token:n,value:i,inherited:a,overridden:s,onChange:o}):(0,$.jsx)(dt,{token:n,value:i,inherited:a,overridden:s,onChange:o}),t[2]=a,t[3]=r,t[4]=o,t[5]=s,t[6]=n,t[7]=i,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsx)(`div`,{className:l,children:u}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}function at(e){let t=(0,Z.c)(6),{token:n,onChange:r}=e,i=`Reset --${n}`,a;t[0]===r?a=t[1]:(a=()=>r(``),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(h,{className:`size-3.5`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;return t[3]!==i||t[4]!==a?(s=(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":i,onClick:a,className:`text-muted-foreground`,children:o}),t[3]=i,t[4]=a,t[5]=s):s=t[5],s}function ot(e){let t=(0,Z.c)(6),{token:n,overridden:r}=e,i=r?`text-foreground`:`text-muted-foreground/70`,a;t[0]===i?a=t[1]:(a=g(`truncate font-mono text-[11px]`,i),t[0]=i,t[1]=a);let o=`--${n}`,s;return t[2]!==a||t[3]!==o||t[4]!==n?(s=(0,$.jsxs)(`span`,{className:a,title:o,children:[`--`,n]}),t[2]=a,t[3]=o,t[4]=n,t[5]=s):s=t[5],s}function st(e){let t=(0,Z.c)(41),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c,l,u,d,f;if(t[0]!==s||t[1]!==r){u=me(s);let e;t[7]===r?e=t[8]:(e=r.length>0&&!B(r),t[7]=r,t[8]=e),l=e,f=`flex items-center gap-2`,c=We,d=Ye(u),t[0]=s,t[1]=r,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f}else c=t[2],l=t[3],u=t[4],d=t[5],f=t[6];let p;t[9]===o?p=t[10]:(p=e=>o(e),t[9]=o,t[10]=p);let m=`Pick a color for --${n}`,h=l?`transparent`:u||`transparent`,g;t[11]===h?g=t[12]:(g=(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-0`,style:{backgroundColor:h},"aria-hidden":!0}),t[11]=h,t[12]=g);let _;t[13]!==c||t[14]!==d||t[15]!==p||t[16]!==m||t[17]!==g?(_=(0,$.jsx)(c,{value:d,onChange:p,ariaLabel:m,children:g}),t[13]=c,t[14]=d,t[15]=p,t[16]=m,t[17]=g,t[18]=_):_=t[18];let y;t[19]!==a||t[20]!==n?(y=(0,$.jsx)(ot,{token:n,overridden:a}),t[19]=a,t[20]=n,t[21]=y):y=t[21];let b=i||`inherit default`,x=l||void 0,S;t[22]===o?S=t[23]:(S=e=>o(e.currentTarget.value),t[22]=o,t[23]=S);let C;t[24]!==x||t[25]!==S||t[26]!==b||t[27]!==r?(C=(0,$.jsx)(v,{value:r,nativeInput:!0,unstyled:!0,size:`sm`,className:`border-0 bg-transparent p-0 shadow-none focus-within:shadow-none`,placeholder:b,"aria-invalid":x,onChange:S}),t[24]=x,t[25]=S,t[26]=b,t[27]=r,t[28]=C):C=t[28];let w;t[29]!==C||t[30]!==y?(w=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[y,C]}),t[29]=C,t[30]=y,t[31]=w):w=t[31];let T;t[32]!==o||t[33]!==a||t[34]!==n?(T=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[32]=o,t[33]=a,t[34]=n,t[35]=T):T=t[35];let E;return t[36]!==w||t[37]!==T||t[38]!==f||t[39]!==_?(E=(0,$.jsxs)(`div`,{className:f,children:[_,w,T]}),t[36]=w,t[37]=T,t[38]=f,t[39]=_,t[40]=E):E=t[40],E}function ct(e){let t=(0,Z.c)(31),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=Number(r||i),c;t[0]===s?c=t[1]:(c=Number.isFinite(s)?Math.min(1,Math.max(0,s)):0,t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.length>0&&!H(`opacity`,r),t[2]=r,t[3]=u);let d=u,f;t[4]!==a||t[5]!==n?(f=(0,$.jsx)(ot,{token:n,overridden:a}),t[4]=a,t[5]=n,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=e=>o(e.currentTarget.value),t[7]=o,t[8]=p);let m=`--${n} value`,h;t[9]!==l||t[10]!==p||t[11]!==m?(h=(0,$.jsx)(`input`,{type:`range`,min:0,max:1,step:.005,value:l,onChange:p,"aria-label":m,className:`h-7.5 flex-1 accent-primary cursor-pointer`}),t[9]=l,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=i||`0`,_=d||void 0,y;t[13]===o?y=t[14]:(y=e=>o(e.currentTarget.value),t[13]=o,t[14]=y);let b;t[15]!==g||t[16]!==_||t[17]!==y||t[18]!==r?(b=(0,$.jsx)(`div`,{className:`w-20 shrink-0`,children:(0,$.jsx)(v,{value:r,nativeInput:!0,type:`number`,min:0,max:1,step:.005,size:`sm`,placeholder:g,"aria-invalid":_,onChange:y})}),t[15]=g,t[16]=_,t[17]=y,t[18]=r,t[19]=b):b=t[19];let x;t[20]!==o||t[21]!==a||t[22]!==n?(x=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[20]=o,t[21]=a,t[22]=n,t[23]=x):x=t[23];let S;t[24]!==b||t[25]!==x||t[26]!==h?(S=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,b,x]}),t[24]=b,t[25]=x,t[26]=h,t[27]=S):S=t[27];let C;return t[28]!==S||t[29]!==f?(C=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f,S]}),t[28]=S,t[29]=f,t[30]=C):C=t[30],C}function lt(e){let t=(0,Z.c)(67),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s,c,l,u,d;if(t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==n||t[4]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{l=V(r),c=V(i);let e=c?$e(c.unit):!1,f=l?$e(l.unit):!1;if(r.length>0&&!f||r.length===0&&i.length>0&&!e){let e;t[10]===r?e=t[11]:(e=r.length>0&&!H(`length`,r),t[10]=r,t[11]=e);let s=e,c;t[12]!==a||t[13]!==n?(c=(0,$.jsx)(ot,{token:n,overridden:a}),t[12]=a,t[13]=n,t[14]=c):c=t[14];let l=i||`e.g. 1rem`,u=s||void 0,f;t[15]===o?f=t[16]:(f=e=>o(e.currentTarget.value),t[15]=o,t[16]=f);let p;t[17]!==l||t[18]!==u||t[19]!==f||t[20]!==r?(p=(0,$.jsx)(v,{value:r,nativeInput:!0,size:`sm`,placeholder:l,"aria-invalid":u,onChange:f}),t[17]=l,t[18]=u,t[19]=f,t[20]=r,t[21]=p):p=t[21];let m;t[22]!==o||t[23]!==a||t[24]!==n?(m=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[22]=o,t[23]=a,t[24]=n,t[25]=m):m=t[25];let h;t[26]!==p||t[27]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,m]}),t[26]=p,t[27]=m,t[28]=h):h=t[28];let g;t[29]!==h||t[30]!==c?(g=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,h]}),t[29]=h,t[30]=c,t[31]=g):g=t[31],d=g;break bb0}s=l?String(l.number):``,u=l&&$e(l.unit)?l.unit:c&&$e(c.unit)?c.unit:`rem`}t[0]=i,t[1]=o,t[2]=a,t[3]=n,t[4]=r,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f=u,p=c?String(c.number):``,m;t[32]!==o||t[33]!==f?(m=e=>{let t=e.trim();if(t.length===0){o(``);return}let n=Number(t);Number.isFinite(n)&&o(`${n}${f}`)},t[32]=o,t[33]=f,t[34]=m):m=t[34];let h=m,g;t[35]!==o||t[36]!==c||t[37]!==l?(g=e=>{if(l){o(`${l.number}${e}`);return}c&&o(`${c.number}${e}`)},t[35]=o,t[36]=c,t[37]=l,t[38]=g):g=t[38];let _=g,y;t[39]!==a||t[40]!==n?(y=(0,$.jsx)(ot,{token:n,overridden:a}),t[39]=a,t[40]=n,t[41]=y):y=t[41];let b=n===`font-size-base`?1:.05,x;t[42]===h?x=t[43]:(x=e=>h(e.currentTarget.value),t[42]=h,t[43]=x);let S;t[44]!==p||t[45]!==s||t[46]!==b||t[47]!==x?(S=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(v,{value:s,nativeInput:!0,type:`number`,step:b,size:`sm`,placeholder:p,onChange:x})}),t[44]=p,t[45]=s,t[46]=b,t[47]=x,t[48]=S):S=t[48];let C;t[49]===_?C=t[50]:(C=e=>_(e.currentTarget.value),t[49]=_,t[50]=C);let w=`--${n} unit`,T;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(T=W.map(ut),t[51]=T):T=t[51];let E;t[52]!==w||t[53]!==C||t[54]!==f?(E=(0,$.jsx)(`select`,{value:f,onChange:C,"aria-label":w,className:`h-7.5 rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/24 sm:h-6.5 sm:text-xs`,children:T}),t[52]=w,t[53]=C,t[54]=f,t[55]=E):E=t[55];let D;t[56]!==o||t[57]!==a||t[58]!==n?(D=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[56]=o,t[57]=a,t[58]=n,t[59]=D):D=t[59];let O;t[60]!==E||t[61]!==D||t[62]!==S?(O=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[S,E,D]}),t[60]=E,t[61]=D,t[62]=S,t[63]=O):O=t[63];let k;return t[64]!==O||t[65]!==y?(k=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[y,O]}),t[64]=O,t[65]=y,t[66]=k):k=t[66],k}function ut(e){return(0,$.jsx)(`option`,{value:e,children:e},e)}function dt(e){let t=(0,Z.c)(25),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c;t[0]===r?c=t[1]:(c=r.length>0&&!H(`font-family`,r),t[0]=r,t[1]=c);let l=c,u;t[2]!==a||t[3]!==n?(u=(0,$.jsx)(ot,{token:n,overridden:a}),t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=i||`system-ui, sans-serif`,f=s||void 0,p;t[5]===f?p=t[6]:(p={fontFamily:f},t[5]=f,t[6]=p);let m=l||void 0,h;t[7]===o?h=t[8]:(h=e=>o(e.currentTarget.value),t[7]=o,t[8]=h);let g;t[9]!==d||t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==r?(g=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(v,{value:r,nativeInput:!0,size:`sm`,placeholder:d,style:p,"aria-invalid":m,onChange:h})}),t[9]=d,t[10]=p,t[11]=m,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]!==o||t[16]!==a||t[17]!==n?(_=a?(0,$.jsx)(at,{token:n,onChange:o}):null,t[15]=o,t[16]=a,t[17]=n,t[18]=_):_=t[18];let y;t[19]!==g||t[20]!==_?(y=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,_]}),t[19]=g,t[20]=_,t[21]=y):y=t[21];let b;return t[22]!==y||t[23]!==u?(b=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[u,y]}),t[22]=y,t[23]=u,t[24]=b):b=t[24],b}var ft=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],pt={default:1,light:.92,medium:.84,high:.78,glass:.72};function mt({surface:e=`node`}={}){let t=e===`hub`,{theme:n,setTheme:r,resolvedTheme:a,activeThemeId:u,setActiveTheme:h}=ve(),v=i(e=>e.wideComposerControlsAutoCollapse),b=i(e=>e.setWideComposerControlsAutoCollapse),ee=i(e=>e.alwaysUseBuildMode),te=i(e=>e.setAlwaysUseBuildMode),[N,L]=(0,X.useState)(null),[de,B]=(0,X.useState)(null),[V,me]=(0,X.useState)(null),[H,U]=(0,X.useState)(()=>I()),[W,xe]=(0,X.useState)(0),Se=(0,X.useRef)(null),Ce=ye(),K=(0,X.useMemo)(()=>N!==null&&de!==null?{source:fe(N),draft:de}:null,[de,N,W]),Z=V?fe(V):null,Q=(0,X.useCallback)(()=>xe(e=>e+1),[]);(0,X.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`ryco:appearance-preferences`&&U(I())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let je=(0,X.useCallback)((e,t)=>{z(e,t),oe(),U(I())},[]),Me=(0,X.useCallback)(e=>{ne(e),oe(),U(I())},[]),Ne=(0,X.useCallback)(()=>{ne(`primaryColorMode`),ne(`primaryColor`),oe(),U(I())},[]),Pe=(0,X.useCallback)(e=>{z(`primaryColorMode`,e?`custom`:`theme`),oe(),U(I())},[]),Fe=(0,X.useCallback)(e=>{z(`primaryColor`,e),z(`primaryColorMode`,`custom`),oe(),U(I())},[]),ze=(0,X.useCallback)(e=>{if(pe(e.id)){let t=G(e);he(t),le(t.id),h(t.id),L(t.id),B(t),Q();return}h(e.id),L(e.id),B(e)},[Q,h]),Be=(0,X.useCallback)(e=>{let t=G(e);he(t),h(t.id),L(t.id),B(t),Q()},[Q,h]),Ve=(0,X.useCallback)(()=>{let e={id:ge(`new`),name:`New theme`,builtIn:!1};he(e),h(e.id),L(e.id),B(e),Q()},[Q,h]),He=(0,X.useCallback)(()=>{K&&(be(K.source.id,K.draft),K.source.id===K.draft.id?ue(K.draft):h(K.draft.id),L(null),B(null),Q())},[K,Q,h]),Ue=(0,X.useCallback)(()=>{K&&ue(K.source),L(null),B(null)},[K]),We=(0,X.useCallback)(()=>{V&&(N===V&&(L(null),B(null)),_e(V),me(null),Q())},[N,V,Q]),Ge=(0,X.useCallback)(e=>{try{Le(e)}catch(e){o.add({type:`error`,title:`Could not export theme`,description:e instanceof Error?e.message:`Download failed.`})}},[]),Ke=(0,X.useCallback)(async e=>{try{await Ie(e),o.add({type:`success`,title:`Copied theme JSON`,description:`${e.name} is ready to paste.`})}catch(e){o.add({type:`error`,title:`Could not copy theme`,description:e instanceof Error?e.message:`Clipboard write failed.`})}},[]),qe=(0,X.useCallback)(()=>{Se.current?.click()},[]),Je=(0,X.useCallback)(async e=>{let t=e.target.files?.[0];if(e.target.value=``,t)try{let e=await Re(t,{collision:`rename`,activate:!0});h(e.theme.id),Q(),o.add({type:`success`,title:`Imported "${e.theme.name}"`,description:e.action===`renamed`?`An existing theme used the same id, so it was imported as "${e.theme.id}".`:`Theme imported and activated.`})}catch(e){o.add({type:`error`,title:`Could not import theme`,description:e instanceof Error?e.message:`Invalid theme file.`})}},[Q,h]);return(0,$.jsxs)(we,{children:[(0,$.jsxs)(q,{title:`Interface controls`,children:[(0,$.jsx)(J,{title:`Interface font`,description:`Normal app text, navigation, dialogs, and controls.`,resetAction:R(`fontFamilySans`)?(0,$.jsx)(Y,{label:`interface font`,onClick:()=>Me(`fontFamilySans`)}):null,control:(0,$.jsx)(ht,{ariaLabel:`Interface font`,icon:(0,$.jsx)(ke,{className:`size-3.5`}),options:F,value:H.fontFamilySans,sample:`The quick brown fox`,onChange:e=>je(`fontFamilySans`,e)})}),t?null:(0,$.jsx)(J,{title:`Code font`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,resetAction:R(`fontFamilyMono`)?(0,$.jsx)(Y,{label:`code font`,onClick:()=>Me(`fontFamilyMono`)}):null,control:(0,$.jsx)(ht,{ariaLabel:`Code font`,icon:(0,$.jsx)(Ee,{className:`size-3.5`}),options:ae,value:H.fontFamilyMono,sample:`const answer = 42`,onChange:e=>je(`fontFamilyMono`,e)})}),(0,$.jsx)(J,{title:`Text size`,description:`Scale the interface independently from the active theme.`,resetAction:R(`fontSizeBase`)?(0,$.jsx)(Y,{label:`text size`,onClick:()=>Me(`fontSizeBase`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Text size`,icon:(0,$.jsx)(Te,{className:`size-3.5`}),options:se,value:H.fontSizeBase,onChange:e=>je(`fontSizeBase`,e),preview:(0,$.jsx)(`span`,{className:`flex h-9 min-w-14 items-center justify-center rounded-md border border-border/70 bg-background px-2 font-semibold text-foreground shadow-xs/5`,children:(0,$.jsx)(`span`,{style:{fontSize:H.fontSizeBase},children:`Aa`})})})}),t?null:(0,$.jsx)(J,{title:`Corner radius`,description:`Adjust rounding for panels, buttons, inputs, and menus globally.`,resetAction:R(`radius`)?(0,$.jsx)(Y,{label:`corner radius`,onClick:()=>Me(`radius`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Corner radius`,icon:(0,$.jsx)(Oe,{className:`size-3.5`}),options:ie,value:H.radius,onChange:e=>je(`radius`,e),preview:(0,$.jsxs)(`span`,{className:`grid h-9 min-w-14 grid-cols-2 gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`border border-primary/55 bg-primary/15`,style:{borderRadius:H.radius}}),(0,$.jsx)(`span`,{className:`border border-muted-foreground/30 bg-muted`,style:{borderRadius:H.radius}})]})})}),(0,$.jsx)(J,{title:`Primary color`,description:`Theme palettes control buttons by default; enable a custom color to pin one app accent.`,resetAction:R(`primaryColorMode`)||R(`primaryColor`)?(0,$.jsx)(Y,{label:`primary color`,onClick:Ne}):null,control:(0,$.jsx)(gt,{mode:H.primaryColorMode,value:H.primaryColor,onModeChange:Pe,onColorChange:Fe})}),(0,$.jsx)(J,{title:`Transparency`,description:`Adjust glass and floating surfaces like dialogs, menus, popups, and toasts.`,resetAction:R(`surfaceTransparency`)?(0,$.jsx)(Y,{label:`transparency`,onClick:()=>Me(`surfaceTransparency`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Transparency`,icon:(0,$.jsx)(De,{className:`size-3.5`}),options:ce,value:H.surfaceTransparency,onChange:e=>je(`surfaceTransparency`,e),preview:(0,$.jsx)(`span`,{className:`relative h-9 min-w-14 overflow-hidden rounded-md border border-border/70 bg-[linear-gradient(135deg,var(--color-sky-500)_0_20%,var(--color-emerald-500)_20%_40%,var(--color-amber-500)_40%_60%,var(--color-fuchsia-500)_60%_80%,var(--color-slate-500)_80%_100%)] p-1.5 shadow-xs/5`,children:(0,$.jsx)(`span`,{className:`block h-full rounded border border-border/70 bg-popover`,style:{opacity:pt[H.surfaceTransparency]??pt.default}})})})}),t?null:(0,$.jsx)(J,{title:`Panel layout`,description:`Choose how the overview panel arranges source control, status, plan, subagents, and the pull request.`,resetAction:R(`panelLayout`)?(0,$.jsx)(Y,{label:`panel layout`,onClick:()=>Me(`panelLayout`)}):null,control:(0,$.jsx)(_t,{ariaLabel:`Panel layout`,icon:(0,$.jsx)(d,{className:`size-3.5`}),options:re,value:H.panelLayout,onChange:e=>je(`panelLayout`,e),preview:(0,$.jsxs)(`span`,{className:`flex h-9 min-w-14 flex-col justify-center gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`h-1 rounded-full bg-primary/45`}),(0,$.jsx)(`span`,{className:`h-1 w-2/3 rounded-full bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 rounded-full bg-muted-foreground/30`})]})})})]}),(0,$.jsx)(q,{title:`Theme palette`,headerAction:(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`input`,{ref:Se,type:`file`,accept:`.json,application/json`,className:`sr-only`,onChange:Je,"aria-hidden":!0,tabIndex:-1}),(0,$.jsxs)(y,{size:`xs`,variant:`ghost`,onClick:Ve,"aria-label":`Create a new theme`,title:`Create a new theme`,className:`text-muted-foreground`,children:[(0,$.jsx)(p,{className:`size-3.5`}),`New`]}),(0,$.jsxs)(y,{size:`xs`,variant:`ghost`,onClick:qe,"aria-label":`Import a theme from file`,title:`Import a theme from disk`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ae,{className:`size-3.5`}),`Import`]})]}),children:(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Theme palette`,children:Ce.map((e,t)=>{let n=e.id===u,r=N===e.id;return(0,$.jsxs)(X.Fragment,{children:[(0,$.jsxs)(`div`,{role:`radio`,"aria-checked":n,tabIndex:n?0:-1,onClick:()=>h(e.id),onKeyDown:t=>{(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),h(e.id))},className:g(`flex cursor-pointer flex-wrap items-center gap-3 px-4 py-3 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:px-5`,t>0?`border-t border-border/60`:``,n?`bg-muted/40`:`hover:bg-muted/24`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:g(`relative flex size-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,n?`border-primary`:`border-muted-foreground/40`),children:n?(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,"aria-hidden":!0}):null}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:e.name,children:e.name}),(0,$.jsx)(P,{variant:`outline`,size:`sm`,children:e.builtIn?`Built-in`:`Custom`})]}),e.description?(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,title:e.description,children:e.description}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[e.builtIn?null:(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Edit ${e.name}`,title:`Edit`,onClick:()=>ze(e),className:`text-muted-foreground`,children:(0,$.jsx)(f,{className:`size-3.5`})}),(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Duplicate ${e.name}`,title:`Duplicate`,onClick:()=>Be(e),className:`text-muted-foreground`,children:(0,$.jsx)(c,{className:`size-3.5`})}),(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Export ${e.name}`,title:`Export`,onClick:()=>Ge(e),className:`text-muted-foreground`,children:(0,$.jsx)(l,{className:`size-3.5`})}),(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy ${e.name} JSON`,title:`Copy JSON`,onClick:()=>void Ke(e),className:`text-muted-foreground`,children:(0,$.jsx)(s,{className:`size-3.5`})}),e.builtIn?null:(0,$.jsx)(y,{size:`icon-xs`,variant:`ghost`,"aria-label":`Delete ${e.name}`,title:`Delete`,onClick:()=>me(e.id),className:`text-destructive-foreground`,children:(0,$.jsx)(m,{className:`size-3.5`})})]})]}),r&&K?(0,$.jsx)(et,{source:K.source,draft:K.draft,onDraftChange:e=>B(e),onSave:He,onCancel:Ue,resolvedVariant:a}):null]},e.id)})})}),t?null:(0,$.jsxs)(q,{title:`Composer controls`,children:[(0,$.jsx)(J,{title:`Auto-collapse wide composer labels`,description:`Show long composer mode labels only on hover or focus.`,resetAction:v?null:(0,$.jsx)(Y,{label:`wide composer labels`,onClick:()=>b(!0)}),control:(0,$.jsx)(_,{checked:v,onCheckedChange:e=>b(!!e),"aria-label":`Auto-collapse wide composer labels`})}),(0,$.jsx)(J,{title:`Always use Build mode`,description:`Hide the mode selector in the composer and send every turn in Build mode.`,resetAction:ee?(0,$.jsx)(Y,{label:`always use Build mode`,onClick:()=>te(!1)}):null,control:(0,$.jsx)(_,{checked:ee,onCheckedChange:e=>te(!!e),"aria-label":`Always use Build mode`})})]}),(0,$.jsx)(q,{title:`Color mode`,children:(0,$.jsx)(J,{title:`Theme variant`,description:`Choose between light, dark, or following the system preference.`,resetAction:n===`system`?null:(0,$.jsx)(Y,{label:`color mode`,onClick:()=>r(`system`)}),control:(0,$.jsxs)(M,{value:n,onValueChange:e=>{(e===`system`||e===`light`||e===`dark`)&&r(e)},children:[(0,$.jsx)(A,{className:`w-full sm:w-40`,"aria-label":`Color mode`,children:(0,$.jsx)(j,{children:ft.find(e=>e.value===n)?.label??`System`})}),(0,$.jsx)(O,{align:`end`,alignItemWithTrigger:!1,children:ft.map(e=>(0,$.jsx)(k,{hideIndicator:!0,value:e.value,children:e.label},e.value))})]})})}),(0,$.jsx)(D,{open:V!==null,onOpenChange:e=>{e||me(null)},children:(0,$.jsxs)(w,{children:[(0,$.jsxs)(x,{children:[(0,$.jsx)(E,{children:`Delete custom theme?`}),(0,$.jsx)(T,{children:Z?`"${Z.name}" will be removed permanently. This action cannot be undone.`:`This action cannot be undone.`})]}),(0,$.jsxs)(S,{children:[(0,$.jsx)(C,{render:(0,$.jsx)(y,{variant:`outline`}),children:`Cancel`}),(0,$.jsx)(y,{variant:`destructive`,onClick:We,children:`Delete theme`})]})]})})]})}function ht(e){let t=(0,Z.c)(43),{ariaLabel:n,icon:r,options:i,value:a,sample:o,onChange:s}=e,c;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>e.value===a,t[3]=a,t[4]=e),c=i.findIndex(e),t[0]=i,t[1]=a,t[2]=c}else c=t[2];let l=Math.max(0,c),u=i[l]??i[0],d;t[5]===r?d=t[6]:(d=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f=u?.value??a,p;t[7]===f?p=t[8]:(p={fontFamily:f},t[7]=f,t[8]=p);let m=u?.label??a,h;t[9]!==p||t[10]!==m?(h=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,style:p,children:m}),t[9]=p,t[10]=m,t[11]=h):h=t[11];let _=u?.description??`Custom`,v;t[12]===_?v=t[13]:(v=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:_}),t[12]=_,t[13]=v);let y;t[14]!==h||t[15]!==v?(y=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[h,v]}),t[14]=h,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==d||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[d,y]}),t[17]=d,t[18]=y,t[19]=b):b=t[19];let x=u?.value??a,S;t[20]===x?S=t[21]:(S={fontFamily:x},t[20]=x,t[21]=S);let C;t[22]!==o||t[23]!==S?(C=(0,$.jsx)(`span`,{className:`flex h-9 min-w-30 max-w-44 items-center justify-start truncate rounded-md border border-border/70 bg-background px-2 text-xs text-foreground shadow-xs/5`,style:S,title:o,children:o}),t[22]=o,t[23]=S,t[24]=C):C=t[24];let w;t[25]!==b||t[26]!==C?(w=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[b,C]}),t[25]=b,t[26]=C,t[27]=w):w=t[27];let T;if(t[28]!==n||t[29]!==s||t[30]!==i||t[31]!==l){let e;t[33]!==n||t[34]!==s||t[35]!==l?(e=(e,t)=>{let r=t===l;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":`Use ${e.label} for ${n.toLowerCase()}`,title:`${e.label} (${e.description})`,onClick:()=>s(e.value),className:g(`min-h-12 min-w-0 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`),children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,style:{fontFamily:e.value},children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]},e.value)},t[33]=n,t[34]=s,t[35]=l,t[36]=e):e=t[36],T=i.map(e),t[28]=n,t[29]=s,t[30]=i,t[31]=l,t[32]=T}else T=t[32];let E;t[37]!==n||t[38]!==T?(E=(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":n,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-3`,children:T}),t[37]=n,t[38]=T,t[39]=E):E=t[39];let D;return t[40]!==w||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[w,E]}),t[40]=w,t[41]=E,t[42]=D):D=t[42],D}function gt(e){let t=(0,Z.c)(48),{mode:n,value:r,onModeChange:i,onColorChange:a}=e,o=n===`custom`,s;t[0]===r?s=t[1]:(s=/^#[0-9a-f]{6}$/i.test(r)?r.toLowerCase():L[0].value,t[0]=r,t[1]=s);let c=s,l;t[2]===c?l=t[3]:(l=L.find(e=>e.value===c),t[2]=c,t[3]=l);let d=l,f=o&&!d?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,p=!o&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`,m;t[4]!==f||t[5]!==p?(m=g(`h-12 w-full rounded-md border px-2 py-1.5 text-left shadow-none`,f,p),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h=m,v;t[7]===c?v=t[8]:(v=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:c}}),t[7]=c,t[8]=v);let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:`Custom`}),t[9]=y):y=t[9];let b;t[10]===c?b=t[11]:(b=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[y,(0,$.jsx)(`span`,{className:`block truncate font-mono text-[10px] leading-3 opacity-75`,children:c})]}),t[10]=c,t[11]=b);let x;t[12]!==v||t[13]!==b?(x=(0,$.jsxs)(`span`,{className:`flex size-full min-w-0 items-center gap-2`,children:[v,b]}),t[12]=v,t[13]=b,t[14]=x):x=t[14];let S=x,C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:(0,$.jsx)(u,{className:`size-3.5`})}),t[15]=C):C=t[15];let w=o?d?.label??`Custom`:`Theme color`,T;t[16]===w?T=t[17]:(T=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:w}),t[16]=w,t[17]=T);let E=o?c:`Active palette`,D;t[18]===E?D=t[19]:(D=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:E}),t[18]=E,t[19]=D);let O;t[20]!==T||t[21]!==D?(O=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[C,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[T,D]})]}),t[20]=T,t[21]=D,t[22]=O):O=t[22];let k;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(`span`,{children:`Use theme`}),t[23]=k):k=t[23];let A=!o,j;t[24]===i?j=t[25]:(j=e=>i(!e),t[24]=i,t[25]=j);let M;t[26]!==A||t[27]!==j?(M=(0,$.jsxs)(`label`,{className:`flex h-9 shrink-0 items-center gap-2 rounded-md border border-border/70 bg-background px-2 text-xs text-muted-foreground shadow-xs/5`,children:[k,(0,$.jsx)(_,{checked:A,onCheckedChange:j,"aria-label":`Use theme primary color`})]}),t[26]=A,t[27]=j,t[28]=M):M=t[28];let ee;t[29]!==O||t[30]!==M?(ee=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[O,M]}),t[29]=O,t[30]=M,t[31]=ee):ee=t[31];let te;t[32]!==o||t[33]!==c||t[34]!==a?(te=L.map(e=>{let t=c===e.value;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o&&t,"aria-label":`Use ${e.label} as primary color`,title:`${e.label} (${e.value})`,onClick:()=>a(e.value),disabled:!o,className:g(`flex min-h-12 min-w-0 items-center gap-2 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,o&&t?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,!o&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:e.value}}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]})]},e.value)}),t[32]=o,t[33]=c,t[34]=a,t[35]=te):te=t[35];let N;t[36]!==o||t[37]!==h||t[38]!==S||t[39]!==c||t[40]!==a?(N=o?(0,$.jsx)(We,{value:c,onChange:a,ariaLabel:`Pick custom primary color`,triggerClassName:h,children:S}):(0,$.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`Pick custom primary color`,className:h,children:S}),t[36]=o,t[37]=h,t[38]=S,t[39]=c,t[40]=a,t[41]=N):N=t[41];let P;t[42]!==te||t[43]!==N?(P=(0,$.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Primary color`,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-4`,children:[te,N]}),t[42]=te,t[43]=N,t[44]=P):P=t[44];let F;return t[45]!==ee||t[46]!==P?(F=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[ee,P]}),t[45]=ee,t[46]=P,t[47]=F):F=t[47],F}function _t(e){let t=(0,Z.c)(50),{ariaLabel:n,icon:r,options:i,value:a,onChange:o,preview:s}=e,c;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>e.value===a,t[3]=a,t[4]=e),c=i.findIndex(e),t[0]=i,t[1]=a,t[2]=c}else c=t[2];let l=Math.max(0,c),u=i[l]??i[0],d=i.length>1?l/(i.length-1)*100:0,f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=f);let p=u?.label??a,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:p}),t[7]=p,t[8]=m);let h=u?.description??a,_;t[9]===h?_=t[10]:(_=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:h}),t[9]=h,t[10]=_);let v;t[11]!==m||t[12]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[m,_]}),t[11]=m,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==f||t[15]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f,v]}),t[14]=f,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==s||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[y,s]}),t[17]=s,t[18]=y,t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=g(`h-5 w-full cursor-pointer appearance-none bg-transparent outline-none`,`[&::-webkit-slider-runnable-track]:h-1.5 [&::-webkit-slider-runnable-track]:rounded-full`,`[&::-webkit-slider-thumb]:mt-[-5px] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm`,`[&::-moz-range-track]:h-1.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:border-0`,`[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm`,`focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-ring focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-ring`),t[20]=x):x=t[20];let S=Math.max(0,i.length-1),C=`linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) ${d}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) ${d}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) 100%)`,w;t[21]===C?w=t[22]:(w={background:C,borderRadius:`999px`},t[21]=C,t[22]=w);let T;t[23]!==o||t[24]!==i?(T=e=>{let t=i[Number(e.currentTarget.value)];t&&o(t.value)},t[23]=o,t[24]=i,t[25]=T):T=t[25];let E;t[26]!==n||t[27]!==l||t[28]!==S||t[29]!==w||t[30]!==T?(E=(0,$.jsx)(`input`,{"aria-label":n,className:x,max:S,min:0,step:1,type:`range`,value:l,style:w,onChange:T}),t[26]=n,t[27]=l,t[28]=S,t[29]=w,t[30]=T,t[31]=E):E=t[31];let D=`repeat(${i.length}, minmax(0, 1fr))`,O;t[32]===D?O=t[33]:(O={gridTemplateColumns:D},t[32]=D,t[33]=O);let k;if(t[34]!==n||t[35]!==o||t[36]!==i||t[37]!==l){let e;t[39]!==n||t[40]!==o||t[41]!==l?(e=(e,t)=>{let r=t===l;return(0,$.jsxs)(`button`,{type:`button`,"aria-label":`Set ${n.toLowerCase()} to ${e.label}`,title:`${e.label} (${e.description})`,onClick:()=>o(e.value),className:g(`flex min-h-7 min-w-0 flex-col items-center justify-start gap-1 rounded-md px-1 py-1 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,$.jsx)(`span`,{className:g(`size-1.5 rounded-full`,r?`bg-primary`:`bg-muted-foreground/35`),"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-full truncate text-[10px] leading-none`,children:e.label})]},e.value)},t[39]=n,t[40]=o,t[41]=l,t[42]=e):e=t[42],k=i.map(e),t[34]=n,t[35]=o,t[36]=i,t[37]=l,t[38]=k}else k=t[38];let A;t[43]!==O||t[44]!==k?(A=(0,$.jsx)(`div`,{className:`mt-1.5 grid gap-1`,style:O,children:k}),t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;return t[46]!==E||t[47]!==A||t[48]!==b?(j=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[b,E,A]}),t[46]=E,t[47]=A,t[48]=b,t[49]=j):j=t[49],j}export{mt as AppearanceSettingsPanel};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import"./env-B4arEvJg.js";import{si as r}from"./src-Vf4LVnMX.js";import{Jn as i,an as a,cn as o,dn as s,f as c,fn as l,gn as u,in as d,ln as f,on as p,pn as m,rn as h,un as g,v as _}from"./runtime-CqhG6EOG.js";import{d as v,f as y}from"./ThreadStatusIndicators-B43wkv-s.js";var b=n(),x=e(t(),1);function S(e){let t=(0,b.c)(13),n=s(e),{environmentId:r,cwd:a,query:c,enabled:u,limit:m,staleTime:h}=e,g,_;t[0]!==a||t[1]!==r||t[2]!==m?(g=()=>{if(r===null||a===null)return;let e={environmentId:r,cwd:a,...m===void 0?{}:{limit:m}};return l(e),()=>o(e)},_=[r,a,m],t[0]=a,t[1]=r,t[2]=m,t[3]=g,t[4]=_):(g=t[3],_=t[4]),(0,x.useEffect)(g,_);let v,y;t[5]!==a||t[6]!==u||t[7]!==r||t[8]!==m||t[9]!==c||t[10]!==h?(v=()=>{f({environmentId:r,cwd:a,query:c,...u===void 0?{}:{enabled:u},...m===void 0?{}:{limit:m},...h===void 0?{}:{staleTime:h}})},y=[r,a,c,u,m,h],t[5]=a,t[6]=u,t[7]=r,t[8]=m,t[9]=c,t[10]=h,t[11]=v,t[12]=y):(v=t[11],y=t[12]),(0,x.useEffect)(v,y);let S=i(p(n));return n===null?d:S}function C(e){let t=g(e),n=(0,x.useSyncExternalStore)(_,()=>e.environmentId===null?null:c(e.environmentId),()=>null),r=(0,x.useRef)(e);r.current=e,(0,x.useEffect)(()=>{let e=r.current,t=e.environmentId===null?void 0:u(e.environmentId,n?.client??null);return m(e,t??null)},[t,n]);let o=i(a(t));return t===null?h:o}function w(e){let t=e.trim().replace(/\.git$/i,``).replace(/\/+$/,``);if(!t||/^[a-z]:[\\/]/i.test(t)||t.startsWith(`\\\\`))return null;if(!t.includes(`://`)){let e=/^(?:[^@/]+@)?([^:/]+):(.+)$/.exec(t);return e?.[1]&&e[2]?`https://${e[1]}/${e[2].replace(/^\/+/,``)}`:null}try{let e=new URL(t.replace(/^(ssh|git|http):\/\//i,`https://`).replace(/^ssh:/i,`https:`));return!e.hostname||e.pathname===`/`||e.pathname===``?null:`https://${e.hostname}${e.pathname}`}catch{return null}}function T(e){if(!e)return null;let t=[e.locator?.remoteUrl,...(e.remotes??[]).map(e=>e.url)];for(let e of t){if(!e)continue;let t=w(e);if(t)return t}return null}r([`local`,`worktree`]);function E(e){let t=y(e.runtimeLabel),n=y(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!v(e):!1)??`This device`:t??n??e.environmentId}function D(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r}=e;return n?t?`worktree`:`local`:t?`local`:r===`worktree`?`worktree`:`local`}function O(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t||r===`worktree`&&!n?`worktree`:`local`}function k(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t===`worktree`&&!n?r??i:i??r}function A(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function j(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=e.searchTextByItemValue?.get(t);return a===void 0?t.toLowerCase().includes(n):a.toLowerCase().includes(n)}export{D as a,C as c,O as i,S as l,A as n,E as o,k as r,j as s,T as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import"./env-B4arEvJg.js";import{si as r}from"./src-Vf4LVnMX.js";import{Zn as i,an as a,cn as o,dn as s,f as c,fn as l,gn as u,in as d,ln as f,on as p,pn as m,rn as h,un as g,v as _}from"./runtime-DfGHeCnR.js";import{d as v,f as y}from"./ThreadStatusIndicators-CL0KGLlj.js";var b=n(),x=e(t(),1);function S(e){let t=(0,b.c)(13),n=s(e),{environmentId:r,cwd:a,query:c,enabled:u,limit:m,staleTime:h}=e,g,_;t[0]!==a||t[1]!==r||t[2]!==m?(g=()=>{if(r===null||a===null)return;let e={environmentId:r,cwd:a,...m===void 0?{}:{limit:m}};return l(e),()=>o(e)},_=[r,a,m],t[0]=a,t[1]=r,t[2]=m,t[3]=g,t[4]=_):(g=t[3],_=t[4]),(0,x.useEffect)(g,_);let v,y;t[5]!==a||t[6]!==u||t[7]!==r||t[8]!==m||t[9]!==c||t[10]!==h?(v=()=>{f({environmentId:r,cwd:a,query:c,...u===void 0?{}:{enabled:u},...m===void 0?{}:{limit:m},...h===void 0?{}:{staleTime:h}})},y=[r,a,c,u,m,h],t[5]=a,t[6]=u,t[7]=r,t[8]=m,t[9]=c,t[10]=h,t[11]=v,t[12]=y):(v=t[11],y=t[12]),(0,x.useEffect)(v,y);let S=i(p(n));return n===null?d:S}function C(e){let t=g(e),n=(0,x.useSyncExternalStore)(_,()=>e.environmentId===null?null:c(e.environmentId),()=>null),r=(0,x.useRef)(e);r.current=e,(0,x.useEffect)(()=>{let e=r.current,t=e.environmentId===null?void 0:u(e.environmentId,n?.client??null);return m(e,t??null)},[t,n]);let o=i(a(t));return t===null?h:o}function w(e){let t=e.trim().replace(/\.git$/i,``).replace(/\/+$/,``);if(!t||/^[a-z]:[\\/]/i.test(t)||t.startsWith(`\\\\`))return null;if(!t.includes(`://`)){let e=/^(?:[^@/]+@)?([^:/]+):(.+)$/.exec(t);return e?.[1]&&e[2]?`https://${e[1]}/${e[2].replace(/^\/+/,``)}`:null}try{let e=new URL(t.replace(/^(ssh|git|http):\/\//i,`https://`).replace(/^ssh:/i,`https:`));return!e.hostname||e.pathname===`/`||e.pathname===``?null:`https://${e.hostname}${e.pathname}`}catch{return null}}function T(e){if(!e)return null;let t=[e.locator?.remoteUrl,...(e.remotes??[]).map(e=>e.url)];for(let e of t){if(!e)continue;let t=w(e);if(t)return t}return null}r([`local`,`worktree`]);function E(e){let t=y(e.runtimeLabel),n=y(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!v(e):!1)??`This device`:t??n??e.environmentId}function D(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r}=e;return n?t?`worktree`:`local`:t?`local`:r===`worktree`?`worktree`:`local`}function O(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t||r===`worktree`&&!n?`worktree`:`local`}function k(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t===`worktree`&&!n?r??i:i??r}function A(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function j(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=e.searchTextByItemValue?.get(t);return a===void 0?t.toLowerCase().includes(n):a.toLowerCase().includes(n)}export{D as a,C as c,O as i,S as l,A as n,E as o,k as r,j as s,T as t};