@vellumai/web 0.11.1-dev.202608041735.8f969f7 → 0.11.1-dev.202608041836.2a522b8

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 (257) hide show
  1. package/dist/assets/{BundleConfirmPage-j6ko1Z2E.js → BundleConfirmPage-ChrDljWY.js} +1 -1
  2. package/dist/assets/{Combination-TPH8qx8I.js → Combination-r1T8bzRv.js} +1 -1
  3. package/dist/assets/{about-page-BBS2ZLwu.js → about-page-D71rzc_l.js} +1 -1
  4. package/dist/assets/access-Bj1jggPa.js +1 -0
  5. package/dist/assets/{account-page-7dAsY1-1.js → account-page-CoEBRBYw.js} +1 -1
  6. package/dist/assets/{account-shell-yukrEgVI.js → account-shell-667tAnz7.js} +1 -1
  7. package/dist/assets/{acp-run-detail-panel-NV1ZO730.js → acp-run-detail-panel-DM5Bhk6n.js} +1 -1
  8. package/dist/assets/{activity-steps-panel-DodRUss6.js → activity-steps-panel-BCMjPosR.js} +1 -1
  9. package/dist/assets/{add-credential-modal-BbvTHJmF.js → add-credential-modal-gbivp7Mj.js} +1 -1
  10. package/dist/assets/{add-credits-modal-C5d63VSi.js → add-credits-modal-BMqsHPmG.js} +1 -1
  11. package/dist/assets/ai-page-ozkkJwbn.js +1 -0
  12. package/dist/assets/{api-key-screen-B5zgGiwa.js → api-key-screen-BKAwcjjc.js} +1 -1
  13. package/dist/assets/{app-card-DNZYapLM.js → app-card-ClwFu1LN.js} +1 -1
  14. package/dist/assets/{assistant-feature-flag-store-BojuHxUH.js → assistant-feature-flag-store-Czv-BYTG.js} +1 -1
  15. package/dist/assets/{assistant-status-panel-DPWhj2K3.js → assistant-status-panel-DrUd5-3y.js} +1 -1
  16. package/dist/assets/{auth-store-C9aYqB9U.js → auth-store-s7Pi2EMi.js} +2 -2
  17. package/dist/assets/{avatar-random-BR8w4F35.js → avatar-random-DPJJy0NQ.js} +1 -1
  18. package/dist/assets/{background-task-detail-panel-BLH2k8ia.js → background-task-detail-panel-BmpQdq-y.js} +1 -1
  19. package/dist/assets/{billing-page-lonwI8JU.js → billing-page-DXzpxKdv.js} +3 -3
  20. package/dist/assets/{bookmarks-page-CfdJFa3P.js → bookmarks-page-DvMPEZmy.js} +1 -1
  21. package/dist/assets/{browser-CcdNg0HN.js → browser-QH7RKn0h.js} +2 -2
  22. package/dist/assets/{build-state-9uUe0jN5.js → build-state-CfHGlPEn.js} +1 -1
  23. package/dist/assets/{button-BwFudwM5.js → button-fyWSnR9X.js} +1 -1
  24. package/dist/assets/{channels-page-route-CIcAw0o3.js → channels-page-route-BNXoujCx.js} +1 -1
  25. package/dist/assets/{chat-markdown-message-BpChYXss.js → chat-markdown-message-CiJp6NwX.js} +1 -1
  26. package/dist/assets/{checkbox-fzrjTRTI.js → checkbox-B-CErUSe.js} +1 -1
  27. package/dist/assets/{checkout-page-lDrK4V11.js → checkout-page-Bss0L8HB.js} +1 -1
  28. package/dist/assets/{command-palette-V30NUM8u.js → command-palette-CiEw1ZGw.js} +1 -1
  29. package/dist/assets/{command-palette-window-page-Cr5tiCvt.js → command-palette-window-page-CezgHgv5.js} +1 -1
  30. package/dist/assets/{community-page-CktLEQl7.js → community-page--xu7DZR4.js} +1 -1
  31. package/dist/assets/{confirm-dialog-B7WBNDbT.js → confirm-dialog-CQpZ7dEA.js} +1 -1
  32. package/dist/assets/{connect-page-hrIJuX_v.js → connect-page-Nz41_I_a.js} +1 -1
  33. package/dist/assets/{consent-controls-HYcVhQZ2.js → consent-controls-9eh0UMDQ.js} +1 -1
  34. package/dist/assets/{contacts-page-route-BITdf0t0.js → contacts-page-route-BntmoT1q.js} +1 -1
  35. package/dist/assets/{conversation-navigation-CJVgHZfE.js → conversation-navigation-Cx_JZlxF.js} +1 -1
  36. package/dist/assets/{conversation-queries-BBj4FfQn.js → conversation-queries-Df--Jv1D.js} +1 -1
  37. package/dist/assets/{copy-to-clipboard-Y0mxY68V.js → copy-to-clipboard-BHe9c3V_.js} +1 -1
  38. package/dist/assets/{credential-entry-page-DQOv-Jyx.js → credential-entry-page-DpfOz24Z.js} +1 -1
  39. package/dist/assets/{credentials-page-wfmOMbAu.js → credentials-page-ywJ9Ou3G.js} +1 -1
  40. package/dist/assets/{csv-preview-rroiuul9.js → csv-preview-DoM5i4gS.js} +1 -1
  41. package/dist/assets/{debug-page-BWfj5Ydw.js → debug-page-KbZ23yRm.js} +2 -2
  42. package/dist/assets/{deploy-dialogs-aVhKcmLt.js → deploy-dialogs-XhAy3CXE.js} +1 -1
  43. package/dist/assets/{deploy-store-DflTwb11.js → deploy-store-tWn5k9jV.js} +1 -1
  44. package/dist/assets/{detail-card-DlHLrDlU.js → detail-card-BDKgf01y.js} +1 -1
  45. package/dist/assets/{detail-drawer-BK1PFzcW.js → detail-drawer-msVZ98YK.js} +1 -1
  46. package/dist/assets/{detail-panel-stop-button-gzBqJldy.js → detail-panel-stop-button-DcvovJPI.js} +1 -1
  47. package/dist/assets/{detail-shell-B9ebX6Fv.js → detail-shell-DJukbBUI.js} +1 -1
  48. package/dist/assets/{developer-page-CVjovxhb.js → developer-page-CtshToNF.js} +1 -1
  49. package/dist/assets/{dist-DWcXIgDR.js → dist-CjmKdBoV.js} +1 -1
  50. package/dist/assets/{dist-BrrL0-_M.js → dist-Ir4ISn-W.js} +1 -1
  51. package/dist/assets/{dist-B5IUaBWa.js → dist-O0VP-1jJ.js} +1 -1
  52. package/dist/assets/{document-viewer-container-G9hOlKEO.js → document-viewer-container-D3VHpObq.js} +2 -2
  53. package/dist/assets/{document-viewer-page-9l2e8SRU.js → document-viewer-page-BiIrX_Id.js} +1 -1
  54. package/dist/assets/{dropdown-CJVkL1Yp.js → dropdown-CFMXaweg.js} +1 -1
  55. package/dist/assets/{emails-page-DrXBASm_.js → emails-page-CHvC5ZLE.js} +1 -1
  56. package/dist/assets/esm-2ad8rRoK.js +2 -0
  57. package/dist/assets/{esm-Jw5qNk7q.js → esm-B-n5_bCs.js} +2 -2
  58. package/dist/assets/{esm-DjeyDwcY.js → esm-BBQFYykW.js} +2 -2
  59. package/dist/assets/{esm-Tsd0irpJ.js → esm-BUNDrvHf.js} +2 -2
  60. package/dist/assets/{esm-CMkpCv1_.js → esm-BtJBT7Rp.js} +2 -2
  61. package/dist/assets/{esm-UxVM8v-Z.js → esm-DWP1Sm4Y.js} +2 -2
  62. package/dist/assets/{esm-Bek1ps3d.js → esm-D_FY5uG-.js} +2 -2
  63. package/dist/assets/{file-editor-DWCkfg5v.js → file-editor-BNU-lJoy.js} +1 -1
  64. package/dist/assets/{file-markdown-Dx_exCii.js → file-markdown-B_8FkKff.js} +1 -1
  65. package/dist/assets/first-run-scope-BaNgebhs.js +1 -0
  66. package/dist/assets/{general-page-C0SCFFsI.js → general-page-DIAtPh2b.js} +1 -1
  67. package/dist/assets/{haptics-C4p_Rjba.js → haptics-C4TWR9vG.js} +2 -2
  68. package/dist/assets/{hatching-screen-CWZvcZVI.js → hatching-screen-Cx7v8Eb5.js} +1 -1
  69. package/dist/assets/{home-page-route-D_mTYDuf.js → home-page-route-CZCY0nEA.js} +1 -1
  70. package/dist/assets/{hosting-screen-lGuLVQVG.js → hosting-screen-DBtmxFyl.js} +1 -1
  71. package/dist/assets/{identity-page-route-B_3riciF.js → identity-page-route-AA6gv_H4.js} +1 -1
  72. package/dist/assets/index-BSM1Vpxy.css +2 -0
  73. package/dist/assets/{index-znrnClJR.js → index-Dhip4b6y.js} +3 -3
  74. package/dist/assets/{input-CgGeKtja.js → input-B_e9sgY6.js} +1 -1
  75. package/dist/assets/{inspect-page-vuF8iIwF.js → inspect-page-D0p9B0vZ.js} +3 -3
  76. package/dist/assets/{integrations-page--kCX0wgv.js → integrations-page-DXorhDgJ.js} +1 -1
  77. package/dist/assets/{intelligence-layout-cXx1jW9n.js → intelligence-layout-D91G6Myk.js} +1 -1
  78. package/dist/assets/{library-detail-page-CW3QgBZ0.js → library-detail-page-C8s5b0ug.js} +1 -1
  79. package/dist/assets/{library-page-CPJNUePx.js → library-page-BZTrg8rP.js} +1 -1
  80. package/dist/assets/{local-runtime-upgrade-CnY-6TiF.js → local-runtime-upgrade-Dqt9Pj2x.js} +1 -1
  81. package/dist/assets/{login-flow-CQhvCbQQ.js → login-flow-BnBc1SFW.js} +1 -1
  82. package/dist/assets/{login-page-B91Q_4fY.js → login-page-CQGP3hkb.js} +1 -1
  83. package/dist/assets/{logout-page-B5HlqqRv.js → logout-page-BIJgH9iy.js} +1 -1
  84. package/dist/assets/{logs-layout-CSQktGls.js → logs-layout-CgmMrscK.js} +1 -1
  85. package/dist/assets/{memory-page-route-C55mC9ni.js → memory-page-route-D7DsI72U.js} +1 -1
  86. package/dist/assets/{memory-router-playground-page-B0rI82E1.js → memory-router-playground-page-Jr0cu19-.js} +1 -1
  87. package/dist/assets/{menu-Cfi4A3sw.js → menu-D7gzADvH.js} +1 -1
  88. package/dist/assets/{message-files-panel-CpjhECmU.js → message-files-panel-CSWUz3fN.js} +1 -1
  89. package/dist/assets/{messages-BkH6zFL8.js → messages-CW87Dtd_.js} +1 -1
  90. package/dist/assets/{metric-card-_e9KrTgx.js → metric-card-Bfjw6z9N.js} +1 -1
  91. package/dist/assets/{mobile-sidebar-drawer-CoTIm9Fa.js → mobile-sidebar-drawer-DN4dy9DA.js} +1 -1
  92. package/dist/assets/{modal-DagTZ8xj.js → modal-D5t4FWFB.js} +1 -1
  93. package/dist/assets/mutation-error-B8-TPshd.js +1 -0
  94. package/dist/assets/native-anchor-CU0CNzyj.js +1 -0
  95. package/dist/assets/{native-file-B71h3csB.js → native-file-DuYDoSmQ.js} +2 -2
  96. package/dist/assets/{not-found-C1zvwDkh.js → not-found-84srgonu.js} +1 -1
  97. package/dist/assets/{notifications-BTG4cTbF.js → notifications-DVvkfSJp.js} +1 -1
  98. package/dist/assets/{notifications-page-BzoWNM1e.js → notifications-page-CyCY0bHs.js} +1 -1
  99. package/dist/assets/{onboarding-layout-CNKJRWfe.js → onboarding-layout-Q6fY5uKC.js} +1 -1
  100. package/dist/assets/open-workspace-file-B7_lXQau.js +2 -0
  101. package/dist/assets/{page-empty-state-D-y7eP1V.js → page-empty-state-Co6KGxZs.js} +1 -1
  102. package/dist/assets/{page-shell-Baj1D7km.js → page-shell-BUZg56AQ.js} +1 -1
  103. package/dist/assets/{pairing-page-BqjYohpZ.js → pairing-page-Y2n7oCfD.js} +1 -1
  104. package/dist/assets/{panel-item-5YQ3jbso.js → panel-item-DKyA_s0w.js} +1 -1
  105. package/dist/assets/{pdf-file-preview-Dj8vmmw-.js → pdf-file-preview-CycKWwFO.js} +1 -1
  106. package/dist/assets/{pdf-preview-pscVmtvX.js → pdf-preview-j8vnExmw.js} +2 -2
  107. package/dist/assets/{personality-page-D7BYqKDz.js → personality-page-BQ991fWk.js} +1 -1
  108. package/dist/assets/{plans-page-BcR_kjJL.js → plans-page-C-V88KBa.js} +1 -1
  109. package/dist/assets/{platform-login-notice-DvWjpI2S.js → platform-login-notice-4FgaONRu.js} +1 -1
  110. package/dist/assets/{platform-loopback-page-BGF_H8f_.js → platform-loopback-page-BGqhBEye.js} +1 -1
  111. package/dist/assets/{popover-CBYgK7Wt.js → popover-2EzQYOOf.js} +1 -1
  112. package/dist/assets/{preview-error-68qNVjgu.js → preview-error-CT0AbdAk.js} +1 -1
  113. package/dist/assets/{privacy-page-DLVavfek.js → privacy-page-DresDgId.js} +1 -1
  114. package/dist/assets/{privacy-screen-Btqk8OjG.js → privacy-screen-ne0rxN0c.js} +1 -1
  115. package/dist/assets/{provider-callback-page-DtAertAu.js → provider-callback-page-ekdCNQgp.js} +1 -1
  116. package/dist/assets/{provider-signup-page-DdWSN-QA.js → provider-signup-page-7ihXBpPj.js} +1 -1
  117. package/dist/assets/{provisioning-targets-Cah9jNBe.js → provisioning-targets-Bmrry6Wb.js} +1 -1
  118. package/dist/assets/{research-mock-page-DthnGXhi.js → research-mock-page-CtO4fvdq.js} +1 -1
  119. package/dist/assets/research-onboarding-route-aYybZo60.js +50 -0
  120. package/dist/assets/{research-results-view-BYpW36E0.js → research-results-view-7EiA49Mr.js} +1 -1
  121. package/dist/assets/{retire-confirm-dialog-PvFzzHrQ.js → retire-confirm-dialog-CAqUxI_J.js} +1 -1
  122. package/dist/assets/{review-terms-screen-BpE_z8HY.js → review-terms-screen-_1O2byRG.js} +1 -1
  123. package/dist/assets/{routes-Butl7JYB.js → routes-Flf73W7-.js} +13 -13
  124. package/dist/assets/{runtime-upgrade-banner-Blp8EyfL.js → runtime-upgrade-banner-DzVusp1i.js} +2 -2
  125. package/dist/assets/{schedules-page-DriWtsx_.js → schedules-page-gJTkpWvU.js} +1 -1
  126. package/dist/assets/{select-assistant-screen-DH6QRKdk.js → select-assistant-screen-CHNOMC4b.js} +1 -1
  127. package/dist/assets/{settings-divider-CdhSCMGU.js → settings-divider-DjO4oxH4.js} +1 -1
  128. package/dist/assets/{settings-layout-DPT63mf3.js → settings-layout-Dris-jry.js} +1 -1
  129. package/dist/assets/{settings-navigation-CyH-twYD.js → settings-navigation-B_oQK_my.js} +1 -1
  130. package/dist/assets/{share-feedback-modal-NfuDPoEg.js → share-feedback-modal-CfOfVYuC.js} +2 -2
  131. package/dist/assets/{sidebar-tree-BdT51b1c.js → sidebar-tree-Bc8j0WYa.js} +1 -1
  132. package/dist/assets/{signup-page-BAEo45pt.js → signup-page-bUuIrs58.js} +1 -1
  133. package/dist/assets/{site-favicon-B8wPUf2t.js → site-favicon-3HjgSU3Y.js} +1 -1
  134. package/dist/assets/{skill-detail-page-BsMvKLKa.js → skill-detail-page-wzM7dFk2.js} +1 -1
  135. package/dist/assets/{skill-detail-panel-BP5tnWo7.js → skill-detail-panel-CJvVIRpZ.js} +1 -1
  136. package/dist/assets/{skills-BKmB9dMC.js → skills-DWu3YPsk.js} +1 -1
  137. package/dist/assets/{slack-setup-wizard-DBKhEv6k.js → slack-setup-wizard-DSpS_H5F.js} +1 -1
  138. package/dist/assets/{sounds-page-Bpeq0MQn.js → sounds-page-lOsCN5Ts.js} +1 -1
  139. package/dist/assets/{src-BRrY4KrY.js → src-Co3nj9N_.js} +1 -1
  140. package/dist/assets/{start-screen-wyemTUjV.js → start-screen-sG7NA3TA.js} +1 -1
  141. package/dist/assets/{subagent-detail-panel-CQYnZIMe.js → subagent-detail-panel-DGT3JpGj.js} +1 -1
  142. package/dist/assets/{superpowers-page-DH-rLWe5.js → superpowers-page-ApVS6EcN.js} +1 -1
  143. package/dist/assets/{system-events-page-Co33SC-H.js → system-events-page-BtyYaQ8U.js} +1 -1
  144. package/dist/assets/{tag-G0ELn_cq.js → tag-Bz-I4QwU.js} +1 -1
  145. package/dist/assets/{text-preview-sKcUlRXn.js → text-preview-BE48-nE-.js} +1 -1
  146. package/dist/assets/{theme-stage-page-CHw3rzG_.js → theme-stage-page-4iYn60VC.js} +1 -1
  147. package/dist/assets/{tiptap-document-editor-BKBv1D4P.js → tiptap-document-editor-DYRDchgE.js} +1 -1
  148. package/dist/assets/{toast-BHjG1kP8.js → toast-elfTwkN2.js} +1 -1
  149. package/dist/assets/{tool-detail-panel-BetSJXpD.js → tool-detail-panel-C0l0SwkG.js} +1 -1
  150. package/dist/assets/{transcript-message-body-shared-3KAvJfHk.js → transcript-message-body-shared-a-m7amCu.js} +1 -1
  151. package/dist/assets/{upgrade-cancel-page-isK2Rvv6.js → upgrade-cancel-page-DIYCzXIJ.js} +1 -1
  152. package/dist/assets/{upgrade-success-page-B7ZaoDsy.js → upgrade-success-page-BKPHWiJQ.js} +1 -1
  153. package/dist/assets/{use-assistant-identity-details-WR0BO_du.js → use-assistant-identity-details-B90DC4R-.js} +1 -1
  154. package/dist/assets/{use-attachment-preview-BQdAb4s0.js → use-attachment-preview-BoxwFwUx.js} +2 -2
  155. package/dist/assets/{use-attachment-squares-Cyd4hgCW.js → use-attachment-squares-DEkxhoxy.js} +1 -1
  156. package/dist/assets/{use-bookmarks-DFzNQFx9.js → use-bookmarks-Bp8GKUVj.js} +1 -1
  157. package/dist/assets/{use-checkout-dismiss-refresh-ChquCG4n.js → use-checkout-dismiss-refresh-BetN1Niz.js} +1 -1
  158. package/dist/assets/{use-command-palette-sections-BshFMe0w.js → use-command-palette-sections-DE_p5cN6.js} +1 -1
  159. package/dist/assets/{use-edge-swipe-CRkrRNLg.js → use-edge-swipe-Op6VwvRV.js} +1 -1
  160. package/dist/assets/{use-edge-swipe-back-Dk2xXjh4.js → use-edge-swipe-back-D7PkQk6c.js} +1 -1
  161. package/dist/assets/{use-edit-app-KAVaVuoA.js → use-edit-app-3dKcJKAP.js} +1 -1
  162. package/dist/assets/{use-invite-link-dialog-CAYf5tUe.js → use-invite-link-dialog-BN8C6Ekg.js} +1 -1
  163. package/dist/assets/{use-ios-app-nudge-DJ26h_e5.js → use-ios-app-nudge-W4MeO1Lq.js} +1 -1
  164. package/dist/assets/{use-is-org-ready-3vHDbj4G.js → use-is-org-ready-BPJ9-NlG.js} +1 -1
  165. package/dist/assets/{use-onboarding-login-CiQyxJLM.js → use-onboarding-login-DNIsmKeu.js} +1 -1
  166. package/dist/assets/{use-platform-assistant-id-DgrNmSy2.js → use-platform-assistant-id-D3e4rU3P.js} +1 -1
  167. package/dist/assets/{use-platform-gate-C5bNA5Pn.js → use-platform-gate-uoj00vJy.js} +1 -1
  168. package/dist/assets/{use-return-to-short-circuit-g88hMnN8.js → use-return-to-short-circuit-BXzGsDe7.js} +1 -1
  169. package/dist/assets/{use-skill-actions-CIgj77Bi.js → use-skill-actions-B0eu3d9i.js} +1 -1
  170. package/dist/assets/{use-sticky-profiles-7hK33BM-.js → use-sticky-profiles-BE6Ra9oG.js} +1 -1
  171. package/dist/assets/{use-subagent-card-data-1PrbuRbe.js → use-subagent-card-data-MH8Ipd2J.js} +1 -1
  172. package/dist/assets/use-transcript-message-by-id-Bmzp4W6P.js +1 -0
  173. package/dist/assets/{use-transcript-messages-CF4s55rx.js → use-transcript-messages-Bs3EjduJ.js} +1 -1
  174. package/dist/assets/use-voice-sample-preview-o-likPVK.js +1 -0
  175. package/dist/assets/{utils-CH7I45gn.js → utils-BdGu_Ar7.js} +1 -1
  176. package/dist/assets/{viewer-store-DqSkyuY9.js → viewer-store-Dc5epEgj.js} +1 -1
  177. package/dist/assets/voice-list-BQrWU8fa.js +1 -0
  178. package/dist/assets/{voice-page-C91TM6UR.js → voice-page--wVZMkbP.js} +1 -1
  179. package/dist/assets/{voice-providers-note-CPHrc2IT.js → voice-providers-note-C9dDD7ll.js} +1 -1
  180. package/dist/assets/{web-vlqDFmAp.js → web-BZ9IycDq.js} +1 -1
  181. package/dist/assets/{web-Ccq6YqQk.js → web-BqvUZqPs.js} +1 -1
  182. package/dist/assets/{welcome-screen-B6BjQt9n.js → welcome-screen-Bb52fojA.js} +1 -1
  183. package/dist/assets/{workflow-detail-panel-BzKUOcZ4.js → workflow-detail-panel-W8-1moGL.js} +1 -1
  184. package/dist/assets/{workspace-page-BnL6MV66.js → workspace-page-D-oWBNC_.js} +1 -1
  185. package/dist/assets/{workspace-tree-query-Dfkrp_rV.js → workspace-tree-query-CDN8y7ot.js} +1 -1
  186. package/dist/index.html +78 -77
  187. package/package.json +1 -1
  188. package/dist/assets/access-PKx6h0AJ.js +0 -1
  189. package/dist/assets/ai-page-p0k-NyJN.js +0 -1
  190. package/dist/assets/esm-754moU0G.js +0 -2
  191. package/dist/assets/first-run-scope-DqdWmMO-.js +0 -1
  192. package/dist/assets/index-CPXuynxD.css +0 -2
  193. package/dist/assets/mutation-error-Cp0Jaqnt.js +0 -1
  194. package/dist/assets/native-anchor-D1Sy2PbD.js +0 -1
  195. package/dist/assets/open-workspace-file-DGq646L6.js +0 -2
  196. package/dist/assets/research-onboarding-route-DzSdaojs.js +0 -50
  197. package/dist/assets/use-transcript-message-by-id-K6toZVPd.js +0 -1
  198. package/dist/assets/voice-list-CbI6E0hu.js +0 -1
  199. /package/dist/assets/{a2a-invite-Bld7VHkJ.js → a2a-invite-v2VfXgsj.js} +0 -0
  200. /package/dist/assets/{app-info-BDq_9VB8.js → app-info-B9sGcuDe.js} +0 -0
  201. /package/dist/assets/{app-types-BGJfNjSJ.js → app-types-DnqYXEN2.js} +0 -0
  202. /package/dist/assets/{archive-redirect-page-Cxcg7zGt.js → archive-redirect-page-y6dqz7Kr.js} +0 -0
  203. /package/dist/assets/{billing-redirect-page-QFlD3jYy.js → billing-redirect-page-C2i7csXi.js} +0 -0
  204. /package/dist/assets/{build.umd-CaLt9YHe.js → build.umd-DZxj_MjF.js} +0 -0
  205. /package/dist/assets/{checkout-continuation-CYDyrqci.js → checkout-continuation-xsBniK2f.js} +0 -0
  206. /package/dist/assets/{checkout-return-target-BStfEab4.js → checkout-return-target-UisopoaS.js} +0 -0
  207. /package/dist/assets/{contacts-gateway-DRzp5PC6.js → contacts-gateway-DgAvY_WA.js} +0 -0
  208. /package/dist/assets/{danger-zone-redirect-page-CIt8Y6Rf.js → danger-zone-redirect-page-C7HeJcHE.js} +0 -0
  209. /package/dist/assets/{definitions-Rm_PEX9e.js → definitions-Di6vg-3l.js} +0 -0
  210. /package/dist/assets/{definitions-BfdxiZ6b.js → definitions-d_pjtKuX.js} +0 -0
  211. /package/dist/assets/{devices-redirect-page-DePzNUvG.js → devices-redirect-page-CEAqXKvU.js} +0 -0
  212. /package/dist/assets/{dictation-overlay-page-C9yp3YUN.js → dictation-overlay-page-CRTxFG0X.js} +0 -0
  213. /package/dist/assets/{emoji-catalog-data-Cjooln6g.js → emoji-catalog-data-Da8Yok8c.js} +0 -0
  214. /package/dist/assets/{environment-store-DxX3xxt2.js → environment-store-TW2YS-DK.js} +0 -0
  215. /package/dist/assets/{esm-ChJ8E5v0.js → esm-CdrvjbRG.js} +0 -0
  216. /package/dist/assets/{esm-S7iZcDlp.js → esm-nSrPrF5p.js} +0 -0
  217. /package/dist/assets/{external-urls-BL9qY0s8.js → external-urls-BlTWka3k.js} +0 -0
  218. /package/dist/assets/{format-date-CQUMvfqf.js → format-date-DwQ9n33H.js} +0 -0
  219. /package/dist/assets/{format-file-size-C5XdzvvA.js → format-file-size-DYgn6X39.js} +0 -0
  220. /package/dist/assets/{keyboard-shortcuts-redirect-page-DTabmI62.js → keyboard-shortcuts-redirect-page-DNgfpdAY.js} +0 -0
  221. /package/dist/assets/{latest-assistant-text-CwHBWP6s.js → latest-assistant-text-yzZ5l9Cu.js} +0 -0
  222. /package/dist/assets/{link-click-aVk_YdAp.js → link-click-DJhTPLlb.js} +0 -0
  223. /package/dist/assets/{machine-sizes-B9nt_h-U.js → machine-sizes-CKKFKjqV.js} +0 -0
  224. /package/dist/assets/{media-preview-D9t2Q84i.js → media-preview-rvxFIaaJ.js} +0 -0
  225. /package/dist/assets/{oauth-complete-page-3xYlafpb.js → oauth-complete-page-CJ6Z0HxS.js} +0 -0
  226. /package/dist/assets/{oauth-popup-complete-page-BtwDCi5P.js → oauth-popup-complete-page-C1TeVl9-.js} +0 -0
  227. /package/dist/assets/{onboarding-step-layout-Bsc_5btV.js → onboarding-step-layout-SPx-6i03.js} +0 -0
  228. /package/dist/assets/{password-reset-page-SsfAE_J-.js → password-reset-page-Cs0a3hoX.js} +0 -0
  229. /package/dist/assets/{pdf-OYDWiYl0.js → pdf-BYSqISKL.js} +0 -0
  230. /package/dist/assets/{plugin-attribution-DAf_69AU.js → plugin-attribution-DfFynIl6.js} +0 -0
  231. /package/dist/assets/{plugin-detail-page-UUM9vxvV.js → plugin-detail-page-DAHuEspQ.js} +0 -0
  232. /package/dist/assets/{plugins-page-Dae3rghA.js → plugins-page-DMeNswtI.js} +0 -0
  233. /package/dist/assets/{profile-metadata-CA6wxcVJ.js → profile-metadata-BgXB6JPv.js} +0 -0
  234. /package/dist/assets/{provider-key-BZOwvE14.js → provider-key-CDZ6oRMw.js} +0 -0
  235. /package/dist/assets/{quick-input-page-BYf7UWY4.js → quick-input-page-BJnl38tp.js} +0 -0
  236. /package/dist/assets/{radio-card-nav-C_pSc4PD.js → radio-card-nav-DDAZzfEc.js} +0 -0
  237. /package/dist/assets/{schedules-_ofAwdnr.js → schedules-BcyU9gXh.js} +0 -0
  238. /package/dist/assets/{security-redirect-page-B9T_2mcB.js → security-redirect-page-rVVph6rf.js} +0 -0
  239. /package/dist/assets/{setting-row-C4jX7c_4.js → setting-row-8Bm9OhJJ.js} +0 -0
  240. /package/dist/assets/{signup-shell-Dwuv81sx.js → signup-shell-BElCqBgh.js} +0 -0
  241. /package/dist/assets/{skills-page-CNYM3Qsj.js → skills-page-D31lY-DJ.js} +0 -0
  242. /package/dist/assets/{status-badge-pill-CFoeNqKo.js → status-badge-pill-CAzzPqQG.js} +0 -0
  243. /package/dist/assets/{system-events-redirect-page-CKNhBiUK.js → system-events-redirect-page-CSuVc-DF.js} +0 -0
  244. /package/dist/assets/{usage-redirect-page-Cd58Bed0.js → usage-redirect-page-D07wP_nS.js} +0 -0
  245. /package/dist/assets/{use-active-assistant-id-JLsAfn3e.js → use-active-assistant-id-BK7MNTh-.js} +0 -0
  246. /package/dist/assets/{use-copy-to-clipboard-RUBxQIiE.js → use-copy-to-clipboard-BLj4DsJk.js} +0 -0
  247. /package/dist/assets/{use-skill-detail-files-DdWFIu5-.js → use-skill-detail-files-C8ynidM6.js} +0 -0
  248. /package/dist/assets/{use-supports-credentials-settings-3jGHR8fw.js → use-supports-credentials-settings-DhHAj5ua.js} +0 -0
  249. /package/dist/assets/{weather-forecast-display-DrJp8zrP.js → weather-forecast-display-Did3OpJ5.js} +0 -0
  250. /package/dist/assets/{web-PODqCw-i.js → web-Bs9nq_yj.js} +0 -0
  251. /package/dist/assets/{web-KS3MoLo7.js → web-D3-252db.js} +0 -0
  252. /package/dist/assets/{web-Cw8N9FBf.js → web-DkriT70g.js} +0 -0
  253. /package/dist/assets/{web-Cwkvk3kH.js → web-JRRpdQH1.js} +0 -0
  254. /package/dist/assets/{web-aKLBqXiN.js → web-KfHaStjy.js} +0 -0
  255. /package/dist/assets/{web-CDfRXQwd.js → web-OG_jn2dK.js} +0 -0
  256. /package/dist/assets/{xterm-DARAJ0SV.js → xterm-Cbwqpsic.js} +0 -0
  257. /package/dist/assets/{xterm-addon-fit-BDf8Eu9n.js → xterm-addon-fit-C5ZZ66tM.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./misc-BBsGq1IU.js";import{t as i}from"./format-file-size-C5XdzvvA.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./misc-BBsGq1IU.js";import{t as i}from"./format-file-size-DYgn6X39.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{I as n,L as r,V as i}from"./button-BwFudwM5.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";var o=e(t(),1),s=0,c=null;function l(){o.useEffect(()=>{c||={start:u(),end:u()};let{start:e,end:t}=c;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),s++,()=>{s===1&&(c?.start.remove(),c?.end.remove(),c=null),s=Math.max(0,s-1)}},[])}function u(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var d=a(),f=`focusScope.autoFocusOnMount`,p=`focusScope.autoFocusOnUnmount`,m={bubbles:!1,cancelable:!0},h=`FocusScope`,g=o.forwardRef((e,t)=>{let{loop:a=!1,trapped:s=!1,onMountAutoFocus:c,onUnmountAutoFocus:l,...u}=e,[h,g]=o.useState(null),b=n(c),x=n(l),S=o.useRef(null),T=i(t,g),E=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(s){let e=function(e){if(E.paused||!h)return;let t=e.target;h.contains(t)?S.current=t:C(S.current,{select:!0})},t=function(e){if(E.paused||!h)return;let t=e.relatedTarget;t!==null&&(h.contains(t)||C(S.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&C(h)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return h&&r.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[s,h,E.paused]),o.useEffect(()=>{if(h){w.add(E);let e=document.activeElement;if(!h.contains(e)){let t=new CustomEvent(f,m);h.addEventListener(f,b),h.dispatchEvent(t),t.defaultPrevented||(_(ee(y(h)),{select:!0}),document.activeElement===e&&C(h))}return()=>{h.removeEventListener(f,b),setTimeout(()=>{let t=new CustomEvent(p,m);h.addEventListener(p,x),h.dispatchEvent(t),t.defaultPrevented||C(e??document.body,{select:!0}),h.removeEventListener(p,x),w.remove(E)},0)}}},[h,b,x,E]);let D=o.useCallback(e=>{if(!a&&!s||E.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[r,i]=v(t);r&&i?!e.shiftKey&&n===i?(e.preventDefault(),a&&C(r,{select:!0})):e.shiftKey&&n===r&&(e.preventDefault(),a&&C(i,{select:!0})):n===t&&e.preventDefault()}},[a,s,E.paused]);return(0,d.jsx)(r.div,{tabIndex:-1,...u,ref:T,onKeyDown:D})});g.displayName=h;function _(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(C(r,{select:t}),document.activeElement!==n)return}function v(e){let t=y(e);return[b(t,e),b(t.reverse(),e)]}function y(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function b(e,t){for(let n of e)if(!x(n,{upTo:t}))return n}function x(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function S(e){return e instanceof HTMLInputElement&&`select`in e}function C(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&S(e)&&t&&e.select()}}var w=T();function T(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=E(e,t),e.unshift(t)},remove(t){e=E(e,t),e[0]?.resume()}}}function E(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ee(e){return e.filter(e=>e.tagName!==`A`)}var D=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},O=new WeakMap,k=new WeakMap,A={},j=0,M=function(e){return e&&(e.host||M(e.parentNode))},te=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=M(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ne=function(e,t,n,r){var i=te(t,Array.isArray(e)?e:[e]);A[n]||(A[n]=new WeakMap);var a=A[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(O.get(e)||0)+1,l=(a.get(e)||0)+1;O.set(e,c),a.set(e,l),o.push(e),c===1&&i&&k.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),j++,function(){o.forEach(function(e){var t=O.get(e)-1,i=a.get(e)-1;O.set(e,t),a.set(e,i),t||(k.has(e)||e.removeAttribute(r),k.delete(e)),i||e.removeAttribute(n)}),j--,j||(O=new WeakMap,O=new WeakMap,k=new WeakMap,A={})}},re=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||D(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ne(r,i,n,`aria-hidden`)):function(){return null}},N=function(){return N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},N.apply(this,arguments)};function P(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ie(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var F=`right-scroll-bar-position`,I=`width-before-scroll-bar`,ae=`with-scroll-bars-hidden`,oe=`--removed-body-scroll-bar-size`;function L(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function se(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ce=typeof window<`u`?o.useLayoutEffect:o.useEffect,R=new WeakMap;function le(e,t){var n=se(t||null,function(t){return e.forEach(function(e){return L(e,t)})});return ce(function(){var t=R.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||L(e,null)}),i.forEach(function(e){r.has(e)||L(e,a)})}R.set(n,e)},[e]),n}function ue(e){return e}function de(e,t){t===void 0&&(t=ue);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function fe(e){e===void 0&&(e={});var t=de(null);return t.options=N({async:!0,ssr:!1},e),t}var z=function(e){var t=e.sideCar,n=P(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,N({},n))};z.isSideCarExport=!0;function pe(e,t){return e.useMedium(t),z}var B=fe(),V=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:V,onWheelCapture:V,onTouchMoveCapture:V}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=P(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=le([n,t]),w=N(N({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:B,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),N(N({},w),{ref:C})):o.createElement(y,N({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:I,zeroRight:F};var U,me=function(){if(U)return U;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function he(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=me();return t&&e.setAttribute(`nonce`,t),e}function ge(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _e(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ve=function(){var e=0,t=null;return{add:function(n){e==0&&(t=he())&&(ge(t,n),_e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ye=function(){var e=ve();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},W=function(){var e=ye();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},be={left:0,top:0,right:0,gap:0},G=function(e){return parseInt(e||``,10)||0},xe=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[G(n),G(r),G(i)]},Se=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return be;var t=xe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ce=W(),K=`data-scroll-locked`,we=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{I as n,L as r,V as i}from"./button-fyWSnR9X.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";var o=e(t(),1),s=0,c=null;function l(){o.useEffect(()=>{c||={start:u(),end:u()};let{start:e,end:t}=c;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),s++,()=>{s===1&&(c?.start.remove(),c?.end.remove(),c=null),s=Math.max(0,s-1)}},[])}function u(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var d=a(),f=`focusScope.autoFocusOnMount`,p=`focusScope.autoFocusOnUnmount`,m={bubbles:!1,cancelable:!0},h=`FocusScope`,g=o.forwardRef((e,t)=>{let{loop:a=!1,trapped:s=!1,onMountAutoFocus:c,onUnmountAutoFocus:l,...u}=e,[h,g]=o.useState(null),b=n(c),x=n(l),S=o.useRef(null),T=i(t,g),E=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(s){let e=function(e){if(E.paused||!h)return;let t=e.target;h.contains(t)?S.current=t:C(S.current,{select:!0})},t=function(e){if(E.paused||!h)return;let t=e.relatedTarget;t!==null&&(h.contains(t)||C(S.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&C(h)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return h&&r.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[s,h,E.paused]),o.useEffect(()=>{if(h){w.add(E);let e=document.activeElement;if(!h.contains(e)){let t=new CustomEvent(f,m);h.addEventListener(f,b),h.dispatchEvent(t),t.defaultPrevented||(_(ee(y(h)),{select:!0}),document.activeElement===e&&C(h))}return()=>{h.removeEventListener(f,b),setTimeout(()=>{let t=new CustomEvent(p,m);h.addEventListener(p,x),h.dispatchEvent(t),t.defaultPrevented||C(e??document.body,{select:!0}),h.removeEventListener(p,x),w.remove(E)},0)}}},[h,b,x,E]);let D=o.useCallback(e=>{if(!a&&!s||E.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[r,i]=v(t);r&&i?!e.shiftKey&&n===i?(e.preventDefault(),a&&C(r,{select:!0})):e.shiftKey&&n===r&&(e.preventDefault(),a&&C(i,{select:!0})):n===t&&e.preventDefault()}},[a,s,E.paused]);return(0,d.jsx)(r.div,{tabIndex:-1,...u,ref:T,onKeyDown:D})});g.displayName=h;function _(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(C(r,{select:t}),document.activeElement!==n)return}function v(e){let t=y(e);return[b(t,e),b(t.reverse(),e)]}function y(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function b(e,t){for(let n of e)if(!x(n,{upTo:t}))return n}function x(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function S(e){return e instanceof HTMLInputElement&&`select`in e}function C(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&S(e)&&t&&e.select()}}var w=T();function T(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=E(e,t),e.unshift(t)},remove(t){e=E(e,t),e[0]?.resume()}}}function E(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ee(e){return e.filter(e=>e.tagName!==`A`)}var D=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},O=new WeakMap,k=new WeakMap,A={},j=0,M=function(e){return e&&(e.host||M(e.parentNode))},te=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=M(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ne=function(e,t,n,r){var i=te(t,Array.isArray(e)?e:[e]);A[n]||(A[n]=new WeakMap);var a=A[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(O.get(e)||0)+1,l=(a.get(e)||0)+1;O.set(e,c),a.set(e,l),o.push(e),c===1&&i&&k.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),j++,function(){o.forEach(function(e){var t=O.get(e)-1,i=a.get(e)-1;O.set(e,t),a.set(e,i),t||(k.has(e)||e.removeAttribute(r),k.delete(e)),i||e.removeAttribute(n)}),j--,j||(O=new WeakMap,O=new WeakMap,k=new WeakMap,A={})}},re=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||D(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ne(r,i,n,`aria-hidden`)):function(){return null}},N=function(){return N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},N.apply(this,arguments)};function P(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ie(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var F=`right-scroll-bar-position`,I=`width-before-scroll-bar`,ae=`with-scroll-bars-hidden`,oe=`--removed-body-scroll-bar-size`;function L(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function se(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ce=typeof window<`u`?o.useLayoutEffect:o.useEffect,R=new WeakMap;function le(e,t){var n=se(t||null,function(t){return e.forEach(function(e){return L(e,t)})});return ce(function(){var t=R.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||L(e,null)}),i.forEach(function(e){r.has(e)||L(e,a)})}R.set(n,e)},[e]),n}function ue(e){return e}function de(e,t){t===void 0&&(t=ue);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function fe(e){e===void 0&&(e={});var t=de(null);return t.options=N({async:!0,ssr:!1},e),t}var z=function(e){var t=e.sideCar,n=P(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,N({},n))};z.isSideCarExport=!0;function pe(e,t){return e.useMedium(t),z}var B=fe(),V=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:V,onWheelCapture:V,onTouchMoveCapture:V}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=P(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=le([n,t]),w=N(N({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:B,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),N(N({},w),{ref:C})):o.createElement(y,N({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:I,zeroRight:F};var U,me=function(){if(U)return U;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function he(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=me();return t&&e.setAttribute(`nonce`,t),e}function ge(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _e(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ve=function(){var e=0,t=null;return{add:function(n){e==0&&(t=he())&&(ge(t,n),_e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ye=function(){var e=ve();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},W=function(){var e=ye();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},be={left:0,top:0,right:0,gap:0},G=function(e){return parseInt(e||``,10)||0},xe=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[G(n),G(r),G(i)]},Se=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return be;var t=xe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ce=W(),K=`data-scroll-locked`,we=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${ae} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./is-electron-DIlIrdJX.js";import{n as i,t as a}from"./app-info-BDq_9VB8.js";var o=e(t(),1),s=n();function c(){let[e,t]=(0,o.useState)(null);(0,o.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),i())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./is-electron-DIlIrdJX.js";import{n as i,t as a}from"./app-info-B9sGcuDe.js";var o=e(t(),1),s=n();function c(){let[e,t]=(0,o.useState)(null);(0,o.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),i())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
@@ -0,0 +1 @@
1
+ import{n as e}from"./auth-store-s7Pi2EMi.js";import{t}from"./assistant-feature-flag-store-Czv-BYTG.js";function n(e,t){return t||e?.isStaff===!0||e?.email?.toLowerCase().endsWith(`@vellum.ai`)===!0}function r(){return n(e.use.user(),t.use.settingsDeveloperNav()===!0)}export{r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{a as i,n as a,s as o}from"./auth-store-C9aYqB9U.js";import{f as s}from"./native-biometric-DetUqtjl.js";import{d as c}from"./routes-DrfnNoYS.js";import{t as l}from"./hard-navigate-BYoBFmE4.js";import{n as u,t as d}from"./login-flow-CQhvCbQQ.js";import{r as f,t as p}from"./account-shell-yukrEgVI.js";var m=e(t(),1),h=r();function g(){let e=i(),t=o(),r=a.use.user(),g=a.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(u,d)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(p,{children:(0,h.jsx)(f,{title:`Loading...`})}):e?(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),l(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:`Sign out`})]})]}):(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{a as i,n as a,s as o}from"./auth-store-s7Pi2EMi.js";import{f as s}from"./native-biometric-DetUqtjl.js";import{d as c}from"./routes-DrfnNoYS.js";import{t as l}from"./hard-navigate-BYoBFmE4.js";import{n as u,t as d}from"./login-flow-BnBc1SFW.js";import{r as f,t as p}from"./account-shell-667tAnz7.js";var m=e(t(),1),h=r();function g(){let e=i(),t=o(),r=a.use.user(),g=a.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(u,d)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(p,{children:(0,h.jsx)(f,{title:`Loading...`})}):e?(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),l(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:`Sign out`})]})]}):(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import"./src-BRrY4KrY.js";import{t}from"./notice-Dslxs3H6.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
1
+ import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import"./src-Co3nj9N_.js";import{t}from"./notice-Dslxs3H6.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-BwFudwM5.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./typography-DEI9Ra9z.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./acp-run-actions-zSUs8U3N.js";import{t as p}from"./arrow-left-W84B6oJL.js";import{t as m}from"./brain-CN4zzNgU.js";import{t as h}from"./chevron-down-BNidRDh1.js";import{t as g}from"./chevron-right-CANAtgGn.js";import{t as _}from"./circle-check-DvrCdroD.js";import{t as v}from"./circle-minus-BBDKV6k6.js";import{w as y}from"./menu-Cfi4A3sw.js";import{t as b}from"./code-D6SOwRrI.js";import"./src-BRrY4KrY.js";import{t as x}from"./file-text-CwGsMgaa.js";import{t as S}from"./globe-CdLn4IX7.js";import{t as C}from"./chat-markdown-message-BpChYXss.js";import{t as ee}from"./repeat-CP_vsQPN.js";import{t as te}from"./search-DL-2uX3K.js";import{t as ne}from"./send-Bdmy_GSE.js";import{t as w}from"./square-DTFrgbZb.js";import{t as T}from"./terminal-BucMVaPU.js";import{t as re}from"./trash-2-DfVRfykB.js";import{t as ie}from"./triangle-alert-D6bAGtMw.js";import{t as ae}from"./x-D4O9yIS7.js";import{t as oe}from"./tag-G0ELn_cq.js";import{a as E,i as se,n as D,r as O}from"./acp-run-store-DdzY8U9Y.js";import{t as k}from"./three-dot-indicator-CeTxs9-J.js";import{t as ce}from"./status-badge-pill-CFoeNqKo.js";var le=o(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=e(n(),1),j=``;function M(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function ue(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function N(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(D.length):t}function P(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function F(e,t){if(t.updateType===`agent_message_chunk`&&ue(t)){P(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:N(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??j,r=N(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(P(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==j&&r&&r.kind===`agent`&&r.messageId===j&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}P(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}P(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;P(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:M(t.toolStatus,`running`),content:t.content,locations:I(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=I(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:M(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=de(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(P(e),e.push(i)):e[r]=i;return}}}function I(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function de(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function fe(e){let t=[];for(let n of e)F(t,n);return t}function pe(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function me(){let e=null,t=[];function n(n){return t=fe(n),e=n,t}function r(r){let i=pe(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)F(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,A.useRef)(null);return t.current??=me(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-fyWSnR9X.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./typography-DEI9Ra9z.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./acp-run-actions-zSUs8U3N.js";import{t as p}from"./arrow-left-W84B6oJL.js";import{t as m}from"./brain-CN4zzNgU.js";import{t as h}from"./chevron-down-BNidRDh1.js";import{t as g}from"./chevron-right-CANAtgGn.js";import{t as _}from"./circle-check-DvrCdroD.js";import{t as v}from"./circle-minus-BBDKV6k6.js";import{w as y}from"./menu-D7gzADvH.js";import{t as b}from"./code-D6SOwRrI.js";import"./src-Co3nj9N_.js";import{t as x}from"./file-text-CwGsMgaa.js";import{t as S}from"./globe-CdLn4IX7.js";import{t as C}from"./chat-markdown-message-CiJp6NwX.js";import{t as ee}from"./repeat-CP_vsQPN.js";import{t as te}from"./search-DL-2uX3K.js";import{t as ne}from"./send-Bdmy_GSE.js";import{t as w}from"./square-DTFrgbZb.js";import{t as T}from"./terminal-BucMVaPU.js";import{t as re}from"./trash-2-DfVRfykB.js";import{t as ie}from"./triangle-alert-D6bAGtMw.js";import{t as ae}from"./x-D4O9yIS7.js";import{t as oe}from"./tag-Bz-I4QwU.js";import{a as E,i as se,n as D,r as O}from"./acp-run-store-DdzY8U9Y.js";import{t as k}from"./three-dot-indicator-CeTxs9-J.js";import{t as ce}from"./status-badge-pill-CAzzPqQG.js";var le=o(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=e(n(),1),j=``;function M(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function ue(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function N(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(D.length):t}function P(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function F(e,t){if(t.updateType===`agent_message_chunk`&&ue(t)){P(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:N(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??j,r=N(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(P(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==j&&r&&r.kind===`agent`&&r.messageId===j&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}P(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}P(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;P(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:M(t.toolStatus,`running`),content:t.content,locations:I(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=I(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:M(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=de(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(P(e),e.push(i)):e[r]=i;return}}}function I(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function de(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function fe(e){let t=[];for(let n of e)F(t,n);return t}function pe(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function me(){let e=null,t=[];function n(n){return t=fe(n),e=n,t}function r(r){let i=pe(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)F(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,A.useRef)(null);return t.current??=me(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
2
2
  `)}function H(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}}function U(e,t){let n=new Map;for(let t of e)t.type===`diff`&&n.set(t.path,{path:t.path,newText:t.newText,...t.oldText===void 0?{}:{oldText:t.oldText}});for(let e of t??[])n.has(e.path)||n.set(e.path,{path:e.path});return Array.from(n.values())}var W=i();function _e({content:e,isComplete:t,assistantId:n}){return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-agent-message`,className:`flex w-full flex-col items-start text-chat text-[var(--content-default)]`,children:[(0,W.jsx)(C,{content:e,assistantId:n}),!t&&(0,W.jsx)(k,{className:`mt-1`,"data-testid":`acp-chat-agent-streaming`})]})}function ve({entries:e}){return e.length===0?null:(0,W.jsxs)(`div`,{"data-testid":`acp-chat-plan-block`,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 text-[var(--content-tertiary)]`,children:[(0,W.jsx)(c,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`text-inherit`,children:`Plan`})]}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map((e,t)=>(0,W.jsxs)(`li`,{"data-testid":`acp-chat-plan-entry`,"data-checked":e.checked,className:`flex items-start gap-2`,children:[e.checked?(0,W.jsx)(_,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,W.jsx)(y,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`}),(0,W.jsx)(`span`,{className:e.checked?`text-body-small-default text-[var(--content-tertiary)] line-through`:`text-body-small-default text-[var(--content-default)]`,children:e.label})]},t))})]})}function ye(e){switch(e){case`max_tokens`:case`max_turn_requests`:return`Stopped: limit reached`;case`refusal`:return`Refused`;case`cancelled`:return`Cancelled`;default:return`Completed`}}function be(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function G({completedAt:e}){return e===void 0?null:(0,W.jsxs)(`span`,{"data-testid":`acp-chat-terminal-time`,children:[`at `,be(e)]})}function xe({status:e,stopReason:t,error:n,completedAt:r}){if(E(e))return null;if(e===`failed`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`failed`,className:`flex items-start gap-2 rounded-lg bg-[var(--system-negative-weak)] px-3 py-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-terminal-failed-icon`,className:`flex h-[12px] w-4 shrink-0 items-center justify-center`,children:(0,W.jsx)(ie,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{children:n??`Run failed`})]});if(e===`cancelled`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`cancelled`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(v,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{children:`Cancelled`}),(0,W.jsx)(G,{completedAt:r})]});let i=ye(t);return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`completed`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(_,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,W.jsx)(`span`,{children:i}),(0,W.jsx)(G,{completedAt:r})]})}function Se({showDot:e,isLast:t,children:n}){return(0,W.jsxs)(`div`,{className:`relative flex items-start gap-2${t?``:` pb-4`}`,children:[!t&&(0,W.jsx)(`div`,{"aria-hidden":!0,className:`absolute bottom-0 left-[6.5px] w-px bg-[var(--border-element)] ${e?`top-[16px]`:`top-0`}`}),e?(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-timeline-dot`,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,W.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}):(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-[14px] w-[14px] shrink-0`}),(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:n})]})}function Ce({content:e,isComplete:t,assistantId:n}){let[r,i]=(0,A.useState)(null),a=r??!t,o=e.trim().length>0,s=t?`Thought process`:`Thinking`,c=t?(0,W.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(k,{dotSize:5,className:`shrink-0`,"data-testid":`acp-chat-thinking-streaming`});return o?(0,W.jsxs)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>i(!a),"data-testid":`acp-chat-thinking-toggle`,className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,children:[a?(0,W.jsx)(h,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(g,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),c,(0,W.jsx)(`span`,{children:s})]}),a&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-body`,className:`mt-1.5 border-l-2 border-[var(--border-base)] pl-3 text-body-small-default text-[var(--content-tertiary)]`,children:(0,W.jsx)(C,{content:e,assistantId:n})})]}):(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:(0,W.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:[c,(0,W.jsx)(`span`,{children:s})]})})}var we={running:`neutral`,completed:`positive`,error:`negative`,ended:`neutral`},Te={running:`Running`,completed:`Completed`,error:`Failed`,ended:`Ended`},Ee={read:`Read file`,edit:`Edit file`,delete:`Delete file`,move:`Move file`,search:`Search`,execute:`Run command`,think:`Thinking`,fetch:`Fetch`,switch_mode:`Switch mode`},De=`Tool call`,Oe={read:x,edit:le,delete:re,move:s,search:te,execute:T,think:m,fetch:S,switch_mode:ee},ke=new Set([`read`,`edit`,`delete`,`move`]);function Ae({toolKind:e}){return(0,W.jsx)(e&&Oe[e]||b,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`})}function K({label:e,value:t,testId:n}){return(0,W.jsxs)(`div`,{"data-testid":n,children:[(0,W.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(`pre`,{className:`max-h-60 overflow-auto rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] p-2.5 font-mono text-body-small-default text-[var(--content-secondary)]`,children:t})]})}function je({block:e,isTerminal:t=!1,onOpenDiff:n,onOpenOutput:r}){let[i,o]=(0,A.useState)(!1),s=(0,A.useMemo)(()=>R(e.content),[e.content]),c=(0,A.useMemo)(()=>V(e.content),[e.content]),l=(0,A.useMemo)(()=>c.split(`
3
3
  `).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith("```"))||`View output`,[c]),u=(0,A.useMemo)(()=>U(s,e.locations),[s,e.locations]),d=t&&e.status===`running`?`ended`:e.status,f=d===`running`,p=e.toolKind&&Ee[e.toolKind]||De,m=B(e.rawInput)??e.title,_=m&&m!==p&&(!ke.has(e.toolKind??``)||u.length===0)?m:null,v=H(e.rawInput),y=H(e.rawOutput),b=v!==void 0||y!==void 0;return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-tool-card`,"data-status":e.status,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Ae,{toolKind:e.toolKind}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,title:e.title,children:p}),(0,W.jsx)(oe,{tone:we[d],"data-testid":`acp-chat-tool-status`,children:Te[d]}),f&&(0,W.jsx)(k,{className:`shrink-0`,"data-testid":`acp-chat-tool-running`})]}),_&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-tool-detail`,className:`mt-1.5 font-mono text-body-small-default whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:_}),u.length>0&&(0,W.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:u.map(t=>{let r=t.oldText!==void 0||t.newText!==void 0,i=`flex max-w-full items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-1 text-body-small-default text-[var(--content-secondary)]`;return r?(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-file-chip`,onClick:()=>n(e.toolCallId,t),title:t.path,className:`${i} cursor-pointer transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(x,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path):(0,W.jsxs)(`span`,{"data-testid":`acp-chat-tool-file-ref`,title:t.path,className:i,children:[(0,W.jsx)(x,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path)})}),c.length>0&&(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-output-open`,onClick:()=>r?.(e.toolCallId),className:`mt-2 flex w-full items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-2.5 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(T,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:l}),(0,W.jsx)(g,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`})]}),b&&(0,W.jsxs)(`div`,{className:`mt-2`,"data-testid":`acp-chat-tool-raw`,children:[(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-raw-toggle`,"aria-expanded":i,onClick:()=>o(e=>!e),className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-default)]`,children:[i?(0,W.jsx)(h,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(g,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:i?`Hide raw input/output`:`Show raw input/output`})]}),i&&(0,W.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-2`,children:[v!==void 0&&(0,W.jsx)(K,{label:`Raw input`,value:v,testId:`acp-chat-tool-raw-input`}),y!==void 0&&(0,W.jsx)(K,{label:`Raw output`,value:y,testId:`acp-chat-tool-raw-output`})]})]})]})}function Me({content:e}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-user-turn`,className:`flex w-full justify-end`,children:(0,W.jsx)(`div`,{className:`max-w-[80%] rounded-lg bg-[var(--surface-lift)] px-4 py-3 whitespace-pre-wrap text-chat text-[var(--content-default)]`,children:e})})}function Ne(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e);return e>0&&e<.01?`<${n(.01)}`:n(e)}var q=new Intl.NumberFormat(`en-US`);function J({label:e,value:t}){return(0,W.jsxs)(`div`,{className:`flex items-baseline gap-1`,"data-usage-stat":e.toLowerCase(),children:[(0,W.jsx)(a,{variant:`label-small-default`,className:`text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(a,{variant:`body-small-default`,className:`text-[var(--content-secondary)] tabular-nums`,children:t})]})}function Pe({entry:e}){let{inputTokens:t,outputTokens:n,costAmount:r,costCurrency:i}=e;if(t===void 0&&n===void 0)return null;let a=t??0,o=n??0,s=r!=null&&i!=null;return(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,"data-testid":`acp-usage-meter`,children:[(0,W.jsx)(J,{label:`Input`,value:q.format(a)}),(0,W.jsx)(J,{label:`Output`,value:q.format(o)}),s&&(0,W.jsx)(J,{label:`Cost`,value:Ne(r,i)})]})}function Fe({content:e,assistantId:t}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-command-output`,className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 [&_pre]:!max-h-none`,children:(0,W.jsx)(C,{content:V(e),hardLineBreaks:!0,assistantId:t})})}var Y=2e3;function X(e){if(e===``)return[];let t=e.split(`
4
4
  `);return e.endsWith(`
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BwFudwM5.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{m as a,n as o,t as s}from"./message-content-B6_GZQl9.js";import{_ as c,a as l,f as u,g as d,i as f,r as p,v as m,y as h}from"./transcript-message-body-shared-3KAvJfHk.js";import{t as g}from"./chevron-left-CrxnPze-.js";import"./src-BRrY4KrY.js";import{t as _}from"./chat-markdown-message-BpChYXss.js";import{t as v}from"./workflow-store-zCcRcvi8.js";import{t as y}from"./background-task-store-DpOSZFT8.js";import{r as b}from"./acp-run-store-DdzY8U9Y.js";import{a as x,g as S,i as C,n as w,r as T,s as E,w as D,x as O}from"./site-favicon-B8wPUf2t.js";import{t as k}from"./detail-shell-B9ebX6Fv.js";import{t as A}from"./use-transcript-message-by-id-K6toZVPd.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-BetSJXpD.js";var N=e(t(),1);function P(e,t,n){let r=f(t,n.workflow),i=e=>{let t=u(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=p(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=l(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=A(e),r=v.use.byId(),i=v.use.byToolUseId(),a=v.use.notFoundRunIds(),c=v.use.hydrationFailedRunIds(),l=b.use.byId(),u=b.use.byToolUseId(),d=y.use.byId();return(0,N.useMemo)(()=>{if(!n||t==null)return null;let e=o(n.contentBlocks??[],{splitInlineThinking:n.role!==`user`})[t];if(!e||e.type!==`activity`)return null;let{cardItems:f,toolCalls:p}=s(e.items);return P(f,p,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:a,hydrationFailedRunIds:c},acpById:l,acpByToolUseId:u,backgroundTaskById:d})},[n,t,r,i,a,c,l,u,d])}var I=r(),L=60;function R({payload:e,onClose:t,assistantId:r}){let[a,o]=(0,N.useState)(null),s=F(e.messageId,e.groupIndex),l=s?.items??e.items,u=s?.toolCalls??e.toolCalls,f=h(l),p=c(f.steps),_=m(f.state,f.steps),v=_===`loading`,y=d(_,f.totalDurationLabel??``,p.failed),b=v&&f.currentStepTitle||y,x=new Map(u.map(e=>[e.id,e])),C=a?a.kind===`thinking`?`Thinking`:a.activity||a.title:``;return(0,I.jsx)(k,{titleNode:a?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(g,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>o(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:C})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:v?(0,I.jsx)(S,{children:b}):b}),f.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:f.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:a?(0,I.jsx)(B,{detail:a,assistantId:r}):(0,I.jsx)(E,{steps:f.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:a,onOpenDetail:o,lookupToolCall:e=>x.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:o}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:o,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(C,{iconName:`brain`,label:a(D(e.text),L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(T,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(w,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(x,{step:e});let s=r(e.toolCallId);return(0,I.jsx)(C,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{s&&n(O(s))}})}function B({detail:e,assistantId:t}){let n=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(_,{content:n??e.thinkingText??``,hardLineBreaks:!0,assistantId:t}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-fyWSnR9X.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{m as a,n as o,t as s}from"./message-content-B6_GZQl9.js";import{_ as c,a as l,f as u,g as d,i as f,r as p,v as m,y as h}from"./transcript-message-body-shared-a-m7amCu.js";import{t as g}from"./chevron-left-CrxnPze-.js";import"./src-Co3nj9N_.js";import{t as _}from"./chat-markdown-message-CiJp6NwX.js";import{t as v}from"./workflow-store-zCcRcvi8.js";import{t as y}from"./background-task-store-DpOSZFT8.js";import{r as b}from"./acp-run-store-DdzY8U9Y.js";import{a as x,g as S,i as C,n as w,r as T,s as E,w as D,x as O}from"./site-favicon-3HjgSU3Y.js";import{t as k}from"./detail-shell-DJukbBUI.js";import{t as A}from"./use-transcript-message-by-id-Bmzp4W6P.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-C0l0SwkG.js";var N=e(t(),1);function P(e,t,n){let r=f(t,n.workflow),i=e=>{let t=u(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=p(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=l(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=A(e),r=v.use.byId(),i=v.use.byToolUseId(),a=v.use.notFoundRunIds(),c=v.use.hydrationFailedRunIds(),l=b.use.byId(),u=b.use.byToolUseId(),d=y.use.byId();return(0,N.useMemo)(()=>{if(!n||t==null)return null;let e=o(n.contentBlocks??[],{splitInlineThinking:n.role!==`user`})[t];if(!e||e.type!==`activity`)return null;let{cardItems:f,toolCalls:p}=s(e.items);return P(f,p,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:a,hydrationFailedRunIds:c},acpById:l,acpByToolUseId:u,backgroundTaskById:d})},[n,t,r,i,a,c,l,u,d])}var I=r(),L=60;function R({payload:e,onClose:t,assistantId:r}){let[a,o]=(0,N.useState)(null),s=F(e.messageId,e.groupIndex),l=s?.items??e.items,u=s?.toolCalls??e.toolCalls,f=h(l),p=c(f.steps),_=m(f.state,f.steps),v=_===`loading`,y=d(_,f.totalDurationLabel??``,p.failed),b=v&&f.currentStepTitle||y,x=new Map(u.map(e=>[e.id,e])),C=a?a.kind===`thinking`?`Thinking`:a.activity||a.title:``;return(0,I.jsx)(k,{titleNode:a?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(g,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>o(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:C})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:v?(0,I.jsx)(S,{children:b}):b}),f.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:f.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:a?(0,I.jsx)(B,{detail:a,assistantId:r}):(0,I.jsx)(E,{steps:f.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:a,onOpenDetail:o,lookupToolCall:e=>x.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:o}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:o,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(C,{iconName:`brain`,label:a(D(e.text),L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(T,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(w,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(x,{step:e});let s=r(e.toolCallId);return(0,I.jsx)(C,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{s&&n(O(s))}})}function B({detail:e,assistantId:t}){let n=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(_,{content:n??e.thinkingText??``,hardLineBreaks:!0,assistantId:t}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BwFudwM5.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./key-round-BFkuiQGH.js";import{t as o}from"./loader-circle-DWWXcfTQ.js";import{t as s}from"./input-CgGeKtja.js";import{t as c}from"./modal-DagTZ8xj.js";import{n as l}from"./toast-BHjG1kP8.js";import{Jt as u}from"./react-query.gen-C7om930f.js";import{t as d}from"./use-active-assistant-id-JLsAfn3e.js";var f=e(t(),1),p=i();function m(e){return[`credentials-list`,e]}function h({open:e,onClose:t,onSaved:i,initialValues:h,successToastMessage:g=`Credential saved.`}){let _=d(),v=r(),[y,b]=(0,f.useState)(h?.service??``),[x,S]=(0,f.useState)(h?.field??``),[C,w]=(0,f.useState)(h?.value??``),[T,E]=(0,f.useState)(h?.label??``),D=(0,f.useRef)(h);(0,f.useLayoutEffect)(()=>{D.current=h},[h]),(0,f.useEffect)(()=>{if(e){let e=D.current;b(e?.service??``),S(e?.field??``),w(e?.value??``),E(e?.label??``)}},[e]);let O=u({onError:e=>{l.error(e.message||`Failed to save credential`)}}),k=O.isPending,A=()=>{b(``),S(``),w(``),E(``),t()};return(0,p.jsx)(c.Root,{open:e,onOpenChange:e=>{!e&&!k&&A()},children:(0,p.jsx)(c.Content,{size:`sm`,children:(0,p.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=y.trim(),n=x.trim();if(!t||!n||!C.trim())return;let r=T.trim()||void 0;O.mutate({path:{assistant_id:_},body:{service:t,field:n,value:C,label:r}},{onSuccess:()=>{v.invalidateQueries({queryKey:m(_)}),l.success(g),i?.({service:t,field:n,label:r}),A()}})},children:[(0,p.jsxs)(c.Header,{children:[(0,p.jsx)(c.Title,{icon:a,children:`Add credential`}),(0,p.jsx)(c.Description,{children:`Add an API key or token to let tools and integrations use it.`})]}),(0,p.jsxs)(c.Body,{className:`flex flex-col gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,p.jsx)(s,{label:`Service`,type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`e.g. github`,autoFocus:!0,fullWidth:!0}),(0,p.jsx)(s,{label:`Field`,type:`text`,value:x,onChange:e=>S(e.target.value),placeholder:`e.g. api_token`,fullWidth:!0})]}),(0,p.jsx)(s,{label:`Value`,type:`password`,value:C,onChange:e=>w(e.target.value),placeholder:`Enter the secret value`,fullWidth:!0}),(0,p.jsx)(s,{label:`Label (optional)`,type:`text`,value:T,onChange:e=>E(e.target.value),placeholder:`e.g. GitHub personal access token`,fullWidth:!0})]}),(0,p.jsxs)(c.Footer,{children:[(0,p.jsx)(n,{type:`button`,variant:`outlined`,onClick:A,disabled:k,children:`Cancel`}),(0,p.jsx)(n,{type:`submit`,variant:`primary`,disabled:k||!y.trim()||!x.trim()||!C.trim(),leftIcon:k?(0,p.jsx)(o,{className:`animate-spin`,"aria-hidden":!0}):void 0,children:`Save`})]})]})})})}export{m as n,h as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-fyWSnR9X.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./key-round-BFkuiQGH.js";import{t as o}from"./loader-circle-DWWXcfTQ.js";import{t as s}from"./input-B_e9sgY6.js";import{t as c}from"./modal-D5t4FWFB.js";import{n as l}from"./toast-elfTwkN2.js";import{Jt as u}from"./react-query.gen-C7om930f.js";import{t as d}from"./use-active-assistant-id-BK7MNTh-.js";var f=e(t(),1),p=i();function m(e){return[`credentials-list`,e]}function h({open:e,onClose:t,onSaved:i,initialValues:h,successToastMessage:g=`Credential saved.`}){let _=d(),v=r(),[y,b]=(0,f.useState)(h?.service??``),[x,S]=(0,f.useState)(h?.field??``),[C,w]=(0,f.useState)(h?.value??``),[T,E]=(0,f.useState)(h?.label??``),D=(0,f.useRef)(h);(0,f.useLayoutEffect)(()=>{D.current=h},[h]),(0,f.useEffect)(()=>{if(e){let e=D.current;b(e?.service??``),S(e?.field??``),w(e?.value??``),E(e?.label??``)}},[e]);let O=u({onError:e=>{l.error(e.message||`Failed to save credential`)}}),k=O.isPending,A=()=>{b(``),S(``),w(``),E(``),t()};return(0,p.jsx)(c.Root,{open:e,onOpenChange:e=>{!e&&!k&&A()},children:(0,p.jsx)(c.Content,{size:`sm`,children:(0,p.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=y.trim(),n=x.trim();if(!t||!n||!C.trim())return;let r=T.trim()||void 0;O.mutate({path:{assistant_id:_},body:{service:t,field:n,value:C,label:r}},{onSuccess:()=>{v.invalidateQueries({queryKey:m(_)}),l.success(g),i?.({service:t,field:n,label:r}),A()}})},children:[(0,p.jsxs)(c.Header,{children:[(0,p.jsx)(c.Title,{icon:a,children:`Add credential`}),(0,p.jsx)(c.Description,{children:`Add an API key or token to let tools and integrations use it.`})]}),(0,p.jsxs)(c.Body,{className:`flex flex-col gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,p.jsx)(s,{label:`Service`,type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`e.g. github`,autoFocus:!0,fullWidth:!0}),(0,p.jsx)(s,{label:`Field`,type:`text`,value:x,onChange:e=>S(e.target.value),placeholder:`e.g. api_token`,fullWidth:!0})]}),(0,p.jsx)(s,{label:`Value`,type:`password`,value:C,onChange:e=>w(e.target.value),placeholder:`Enter the secret value`,fullWidth:!0}),(0,p.jsx)(s,{label:`Label (optional)`,type:`text`,value:T,onChange:e=>E(e.target.value),placeholder:`e.g. GitHub personal access token`,fullWidth:!0})]}),(0,p.jsxs)(c.Footer,{children:[(0,p.jsx)(n,{type:`button`,variant:`outlined`,onClick:A,disabled:k,children:`Cancel`}),(0,p.jsx)(n,{type:`submit`,variant:`primary`,disabled:k||!y.trim()||!x.trim()||!C.trim(),leftIcon:k?(0,p.jsx)(o,{className:`animate-spin`,"aria-hidden":!0}):void 0,children:`Save`})]})]})})})}export{m as n,h as t};
@@ -1 +1 @@
1
- import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-BwFudwM5.js";import{l as i,m as a,t as o}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as s}from"./QueryClientProvider-CMu7CkQU.js";import{t as c}from"./useQuery-Bz-fbQ-m.js";import{t as l}from"./useMutation-CXGTrp4W.js";import{t as u}from"./jsx-runtime-D3ZM-ToX.js";import{t as d}from"./chevron-right-CANAtgGn.js";import{t as f}from"./circle-alert-DQMH8VJH.js";import{t as p}from"./loader-circle-DWWXcfTQ.js";import{t as m}from"./modal-DagTZ8xj.js";import{t as h}from"./dropdown-CJVkL1Yp.js";import{d as g}from"./routes-DrfnNoYS.js";import{d as _}from"./platform-detection-AHYibqOx.js";import{n as v,r as y}from"./browser-CcdNg0HN.js";import{ft as b,mt as x}from"./react-query.gen-BtYBixpk.js";import{t as S}from"./android-consumption-only-D3L1Nc41.js";var C=t({AddCreditsModal:()=>A}),w=e(n(),1),T=u(),E=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function D(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function O(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function k({open:e,onOpenChange:t}){let n=s(),{pathname:u}=i(),[_]=a(),S=_.toString()?`${u}?${_.toString()}`:u,{data:C,isLoading:k}=c(b()),A=C?.allowed_top_up_amounts?.length?C.allowed_top_up_amounts:E,[j,M]=(0,w.useState)(null),N=j&&A.includes(j)?j:A[0]??E[0],P=l(x());return(0,w.useEffect)(()=>y(()=>{t(!1),n.invalidateQueries(b())}),[t,n]),(0,T.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Add Credits`}),(0,T.jsx)(m.Description,{children:`You'll be redirected to Stripe to complete the payment.`})]}),(0,T.jsx)(m.Body,{children:(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,T.jsx)(h,{id:`add-credits-amount`,value:N,onChange:e=>{M(e),P.isError&&P.reset()},disabled:k||!C,options:A.map(e=>({value:e,label:D(e)}))})]}),P.isError&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,T.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),O(P.error)]}),(0,T.jsxs)(o,{to:g.settings.usageBillingConfigureTopUps,className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:[`Configure Automatic Top-Ups`,(0,T.jsx)(d,{className:`size-4`})]}),(0,T.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,T.jsxs)(m.Footer,{children:[(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,T.jsx)(r,{variant:`primary`,leftIcon:P.isPending?(0,T.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{P.isPending||P.mutate({body:{amount:N,return_path:S}},{onSuccess:e=>{v(e.checkout_url)}})},disabled:P.isPending||k||!C,children:`Continue`})]})]})})}function A(e){return _()?(0,T.jsx)(m.Root,{open:e.open,onOpenChange:e.onOpenChange,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Billing`}),(0,T.jsx)(m.Description,{children:S})]}),(0,T.jsx)(m.Footer,{children:(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Close`})})})]})}):(0,T.jsx)(k,{...e})}export{C as n,A as t};
1
+ import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-fyWSnR9X.js";import{l as i,m as a,t as o}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as s}from"./QueryClientProvider-CMu7CkQU.js";import{t as c}from"./useQuery-Bz-fbQ-m.js";import{t as l}from"./useMutation-CXGTrp4W.js";import{t as u}from"./jsx-runtime-D3ZM-ToX.js";import{t as d}from"./chevron-right-CANAtgGn.js";import{t as f}from"./circle-alert-DQMH8VJH.js";import{t as p}from"./loader-circle-DWWXcfTQ.js";import{t as m}from"./modal-D5t4FWFB.js";import{t as h}from"./dropdown-CFMXaweg.js";import{d as g}from"./routes-DrfnNoYS.js";import{d as _}from"./platform-detection-AHYibqOx.js";import{n as v,r as y}from"./browser-QH7RKn0h.js";import{ft as b,mt as x}from"./react-query.gen-BtYBixpk.js";import{t as S}from"./android-consumption-only-D3L1Nc41.js";var C=t({AddCreditsModal:()=>A}),w=e(n(),1),T=u(),E=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function D(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function O(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function k({open:e,onOpenChange:t}){let n=s(),{pathname:u}=i(),[_]=a(),S=_.toString()?`${u}?${_.toString()}`:u,{data:C,isLoading:k}=c(b()),A=C?.allowed_top_up_amounts?.length?C.allowed_top_up_amounts:E,[j,M]=(0,w.useState)(null),N=j&&A.includes(j)?j:A[0]??E[0],P=l(x());return(0,w.useEffect)(()=>y(()=>{t(!1),n.invalidateQueries(b())}),[t,n]),(0,T.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Add Credits`}),(0,T.jsx)(m.Description,{children:`You'll be redirected to Stripe to complete the payment.`})]}),(0,T.jsx)(m.Body,{children:(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,T.jsx)(h,{id:`add-credits-amount`,value:N,onChange:e=>{M(e),P.isError&&P.reset()},disabled:k||!C,options:A.map(e=>({value:e,label:D(e)}))})]}),P.isError&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,T.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),O(P.error)]}),(0,T.jsxs)(o,{to:g.settings.usageBillingConfigureTopUps,className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:[`Configure Automatic Top-Ups`,(0,T.jsx)(d,{className:`size-4`})]}),(0,T.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,T.jsxs)(m.Footer,{children:[(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,T.jsx)(r,{variant:`primary`,leftIcon:P.isPending?(0,T.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{P.isPending||P.mutate({body:{amount:N,return_path:S}},{onSuccess:e=>{v(e.checkout_url)}})},disabled:P.isPending||k||!C,children:`Continue`})]})]})})}function A(e){return _()?(0,T.jsx)(m.Root,{open:e.open,onOpenChange:e.onOpenChange,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Billing`}),(0,T.jsx)(m.Description,{children:S})]}),(0,T.jsx)(m.Footer,{children:(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Close`})})})]})}):(0,T.jsx)(k,{...e})}export{C as n,A as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,l as n,o as r}from"./local-settings-Bx7FsNo5.js";import{r as i,t as a}from"./capture-error-CqtAGHQu.js";import{t as o}from"./react-BFJW0bSv.js";import{t as s}from"./button-fyWSnR9X.js";import{m as c,u as l}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as u}from"./QueryClientProvider-CMu7CkQU.js";import{t as d}from"./useQuery-Bz-fbQ-m.js";import{t as f}from"./useMutation-CXGTrp4W.js";import{t as p}from"./jsx-runtime-D3ZM-ToX.js";import{t as m}from"./typography-DEI9Ra9z.js";import{t as h}from"./check-Dt2rQhdg.js";import{t as g}from"./circle-alert-DQMH8VJH.js";import{t as _}from"./circle-check-DvrCdroD.js";import{t as v}from"./menu-D7gzADvH.js";import{t as y}from"./clock-DeynsyYL.js";import{F as b,r as x}from"./src-Co3nj9N_.js";import{t as S}from"./ellipsis-vertical-qQRDY5dB.js";import{t as C}from"./external-link-GPGZ1LGU.js";import{t as w}from"./info-DkhVkzmK.js";import{t as T}from"./list-D2LnQ7lS.js";import{t as E}from"./loader-circle-DWWXcfTQ.js";import{t as D}from"./mail-DyUf40pu.js";import{t as O}from"./plus-EJu6s6xR.js";import{t as k}from"./search-DL-2uX3K.js";import{t as A}from"./trash-2-DfVRfykB.js";import{t as j}from"./triangle-alert-D6bAGtMw.js";import{t as M}from"./notice-Dslxs3H6.js";import{t as N}from"./tag-Bz-I4QwU.js";import{t as P}from"./popover-2EzQYOOf.js";import{t as F}from"./input-B_e9sgY6.js";import{t as I}from"./toggle-BEPV0rQM.js";import{t as L}from"./modal-D5t4FWFB.js";import{n as R}from"./toast-elfTwkN2.js";import{t as z}from"./confirm-dialog-CQpZ7dEA.js";import{t as B}from"./dropdown-CFMXaweg.js";import{$ as V,A as H,B as ee,C as U,D as W,G,H as K,J as q,K as J,L as te,O as ne,Q as Y,R as X,S as Z,T as re,U as ie,V as ae,W as oe,X as se,Y as ce,Z as le,_ as ue,_t as de,a as fe,at as pe,b as me,c as he,ct as ge,d as _e,dt as ve,et as ye,f as be,ft as xe,g as Se,gt as Ce,h as we,ht as Te,i as Ee,it as De,j as Oe,k as ke,lt as Ae,m as je,mt as Me,n as Ne,nt as Pe,o as Fe,ot as Ie,p as Le,pt as Re,q as ze,r as Be,rt as Ve,st as He,t as Ue,tt as We,u as Ge,ut as Ke,v as qe,w as Je,x as Ye,y as Xe,z as Ze}from"./use-sticky-profiles-BE6Ra9oG.js";import{t as Qe}from"./assistant-identity-store-B51BX78j.js";import{i as $e,n as et,o as tt,r as nt}from"./utils-DtVy-_pB.js";import{r as rt}from"./api-errors-BRGPPSWw.js";import{En as it,Gt as at,Kt as ot,ft as st,j as ct,lt,sr as ut}from"./sdk.gen-CjtCuSlS.js";import{d as dt}from"./routes-DrfnNoYS.js";import{d as ft}from"./platform-detection-AHYibqOx.js";import{i as pt}from"./use-platform-gate-uoj00vJy.js";import{r as mt}from"./use-is-org-ready-BPJ9-NlG.js";import{H as ht,Rt as gt,U as _t,Ut as vt,V as yt,W as bt,c as xt,d as St,f as Ct,l as wt,m as Tt,p as Et,u as Dt,yt as Ot}from"./react-query.gen-C7om930f.js";import{n as kt}from"./use-is-mobile-MmHo-OM6.js";import{c as At,d as jt,f as Mt,g as Nt,h as Pt,l as Ft,lt as It,m as Lt,o as Rt,p as zt,s as Bt,u as Vt,v as Ht,y as Ut}from"./react-query.gen-BtYBixpk.js";import{t as Wt}from"./platform-login-notice-4FgaONRu.js";import{t as Gt}from"./android-consumption-only-D3L1Nc41.js";import{n as Kt}from"./use-voice-sample-preview-o-likPVK.js";import{a as qt,i as Jt,n as Yt}from"./voice-list-BQrWU8fa.js";import{t as Xt}from"./use-active-assistant-id-BK7MNTh-.js";import{t as Zt}from"./detail-shell-DJukbBUI.js";import{t as Qt}from"./detail-card-BDKgf01y.js";import{n as $t,t as en}from"./detail-drawer-msVZ98YK.js";import{t as tn}from"./use-platform-assistant-id-D3e4rU3P.js";import{t as nn}from"./environment-store-TW2YS-DK.js";var Q=e(o(),1),$=p();function rn({mode:e,onChange:t}){return(0,$.jsx)(`div`,{className:`max-w-[280px]`,children:(0,$.jsx)(b,{ariaLabel:`Service mode`,value:e,onChange:t,items:[{value:`managed`,label:`Managed`},{value:`your-own`,label:`Your Own`}]})})}function an({id:e,title:t,subtitle:n,mode:r,onModeChange:i,children:a}){return(0,$.jsxs)(Qt,{id:e,title:t,subtitle:n,accessory:(0,$.jsx)(rn,{mode:r,onChange:i}),children:[(0,$.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,$.jsx)(`div`,{className:`mt-4`,children:a})]})}function on({id:e,title:t,subtitle:n,children:r}){return(0,$.jsxs)(Qt,{id:e,title:t,subtitle:n,children:[(0,$.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,$.jsx)(`div`,{className:`mt-4`,children:r})]})}function sn(){return(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-4 py-2.5`,children:[(0,$.jsx)(w,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,$.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:[`Managed services are metered and deducted from your Vellum account balance.`,` `,(0,$.jsxs)(`a`,{href:`https://www.vellum.ai/docs/pricing`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--primary-base)] hover:underline`,children:[`View pricing`,(0,$.jsx)(C,{className:`h-3.5 w-3.5`})]})]})]})}function cn({status:e,message:t,isLoading:n}){return n?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,children:[(0,$.jsx)(E,{className:`h-3 w-3 animate-spin`}),`Checking domain…`]}):e?e===`verified`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-positive-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,title:`DNS records have been verified. Your domain is ready to send and receive email.`,children:[(0,$.jsx)(h,{className:`h-3 w-3`}),`Domain verified`]}):e===`pending`||e===`not_started`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-mid-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-mid-strong)]`,title:`DNS records have been provisioned. Waiting for the email provider to verify them — this usually takes a few minutes.`,children:[(0,$.jsx)(y,{className:`h-3 w-3`}),`Verifying domain…`]}):(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-negative-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,title:`Domain verification failed. DNS records may not have propagated correctly. You could try releasing and re-registering the domain.`,children:[(0,$.jsx)(g,{className:`h-3 w-3`}),`Verification failed`]}):(0,$.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,title:`Unable to retrieve domain verification status.`,children:`Unknown status`})}function ln({onClick:e,disabled:t}){return(0,$.jsx)(s,{onClick:e,disabled:t,children:`Save`})}function un({onClick:e,filled:t=!1}){return(0,$.jsx)(s,{variant:t?`danger`:`dangerGhost`,onClick:e,children:`Reset`})}function dn({guide:e}){return(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(w,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{children:e.description}),(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,$.jsx)(C,{className:`h-3 w-3`})]})]})]})}function fn({subdomain:e,onSubdomainChange:t,domainSuffix:n,subdomainPlaceholder:r=`my-assistant`,disabled:i,autoFocus:a,prefix:o,error:s,locked:c,lockedMessage:l}){return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex h-9 w-full items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${s?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[o,(0,$.jsx)(`input`,{value:e,onChange:e=>t(e.target.value.toLowerCase().trim()),disabled:i||c,readOnly:c,autoFocus:a,placeholder:r,"aria-label":`Subdomain`,"aria-invalid":!!s,className:`h-full min-w-0 flex-1 bg-transparent ${o?`pl-1.5`:`pl-3`} pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none disabled:cursor-not-allowed disabled:opacity-60`}),(0,$.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`.`,n]})]}),s&&(0,$.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--system-negative-strong)]`,children:s}),c&&l&&(0,$.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:l})]})}function pn({assistantId:e,assistantHandle:t,emailRootDomain:n}){let r=u(),i=l(),o=ft(),[p,m]=c(),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(null),[T,O]=(0,Q.useState)(!1),[k,j]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{_||!t||h||(g(t),v(!0))},[t,_,h]);let F=d({...It(),enabled:!0}),I=F.data,L=I?.entitlements,B=L?.managed_email===!0,V=!!L&&!B,H=!I&&F.isError&&!F.isFetching,ee=d({...At({path:{assistant_id:e}}),enabled:!V}),U=d({...zt({path:{assistant_id:e}}),enabled:!V}),W=ee.data?.results?.[0],G=U.data?.results?.[0],K=W?`${W.subdomain}.${n}`:null,q=d({...Pt({path:{assistant_id:e,id:G?.id??``}}),enabled:!!G?.id,refetchOnWindowFocus:!1}),J=d({...Vt({path:{assistant_id:e,id:W?.id??``}}),enabled:!!W?.id,refetchInterval:e=>{let t=e.state.data?.status;return t===`verified`||t===`failed`?!1:1e4},refetchOnWindowFocus:!0});(0,Q.useEffect)(()=>{p.get(`release`)!==`1`||!W||G||(j(!0),m(e=>{let t=new URLSearchParams(e);return t.delete(`release`),t},{replace:!0}))},[G,W,p,m]);let te=f(Rt()),ne=f(Bt()),Y=f(jt()),X=f(Mt()),Z=(0,Q.useCallback)(()=>{let t={assistant_id:e};r.invalidateQueries({queryKey:Ft({path:t})}),r.invalidateQueries({queryKey:Lt({path:t})}),G?.id&&r.invalidateQueries({queryKey:Nt({path:{...t,id:G.id}})}),r.invalidateQueries({queryKey:Ut()})},[G?.id,e,r]),re=(0,Q.useCallback)(async()=>{let t=h.trim().toLowerCase();if(!t){b(`Enter a subdomain.`);return}O(!1);try{await te.mutateAsync({path:{assistant_id:e},body:{subdomain:t}}),g(``),b(null),Z(),R.success(`Domain ${t}.${n} registered.`)}catch(e){b(rt(e,void 0,`Failed to register domain.`))}},[e,n,Z,te,h]),ie=(0,Q.useCallback)(async()=>{let t=x.trim().toLowerCase();if(!t){w(`Enter an email username.`);return}try{await Y.mutateAsync({path:{assistant_id:e},body:{username:t}}),S(``),w(null),Z(),R.success(`Email address created.`)}catch(e){w(rt(e,void 0,`Failed to create email address.`))}},[e,Z,Y,x]),ae=(0,Q.useCallback)(async()=>{if(G?.id){P(!1);try{await X.mutateAsync({path:{assistant_id:e,id:G.id}}),Z(),R.success(`Email address removed.`)}catch(e){a(e,{context:`email_address_delete`}),R.error(`Failed to remove email address.`)}}},[G?.id,e,X,Z]),oe=(0,Q.useCallback)(async()=>{if(!W?.id)return;if(G){R.error(`Remove the email address first.`);return}j(!1);let t=W.subdomain;try{await ne.mutateAsync({path:{assistant_id:e,id:W.id}}),g(t),Z(),R.success(`Domain released.`)}catch(e){a(e,{context:`email_domain_release`}),R.error(`Failed to release domain.`)}},[G,e,ne,W?.id,W?.subdomain,Z]);if(F.isLoading)return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(E,{className:`h-4 w-4 animate-spin`}),`Checking subscription…`]});if(V)return(0,$.jsx)(M,{tone:`info`,icon:(0,$.jsx)(D,{className:`h-4 w-4`,"aria-hidden":!0}),title:`Give your assistant its own email address`,actions:o?void 0:(0,$.jsx)(s,{size:`compact`,onClick:()=>i(dt.plans),children:`Upgrade`}),children:o?Gt:(0,$.jsx)($.Fragment,{children:`Upgrade to a plan that includes an email address for your assistant. No provider setup required.`})});let se=H?(0,$.jsx)(M,{tone:`warning`,title:`Couldn't verify subscription status`,actions:(0,$.jsx)(s,{size:`compact`,variant:`outlined`,onClick:()=>F.refetch(),children:`Retry`}),children:`We couldn't reach the billing service. The form below assumes managed email is enabled for your org — if it isn't, registering a domain will fail.`}):null;return W?G?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[se,(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Address`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:G.address}),(0,$.jsx)(cn,{status:J.data?.status,message:J.data?.message,isLoading:J.isLoading}),(0,$.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,$.jsx)(A,{}),onClick:()=>P(!0),disabled:X.isPending,"aria-label":`Remove email address`})]}),(0,$.jsx)(z,{open:N,title:`Remove Email Address`,message:(0,$.jsxs)($.Fragment,{children:[`Are you sure you want to remove`,` `,(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:G.address}),`? Your assistant will no longer be able to send or receive email at this address.`]}),confirmLabel:`Remove`,destructive:!0,onConfirm:ae,onCancel:()=>P(!1)})]}),q.data?.usage&&(0,$.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[q.data.usage.sent_today,` /`,` `,q.data.usage.daily_limit,` sent today ·`,` `,q.data.usage.received_today,` received`]})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[se,(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Domain`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:[W.subdomain,`.`,n]}),(0,$.jsx)(cn,{status:J.data?.status,message:J.data?.message,isLoading:J.isLoading}),(0,$.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,$.jsx)(A,{}),onClick:()=>j(!0),disabled:ne.isPending,"aria-label":`Release domain`})]}),(0,$.jsx)(z,{open:k,title:`Release Domain`,message:(0,$.jsxs)($.Fragment,{children:[`Are you sure you want to release`,` `,(0,$.jsxs)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:[W.subdomain,`.`,n]}),`? The subdomain will become available for others to claim.`]}),confirmLabel:`Release`,destructive:!0,onConfirm:oe,onCancel:()=>j(!1)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Email address`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex h-9 min-w-0 flex-1 items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${C?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[(0,$.jsx)(`input`,{value:x,onChange:e=>{S(e.target.value.toLowerCase()),C&&w(null)},placeholder:`hi`,"aria-label":`Email username`,"aria-invalid":!!C,className:`h-full min-w-0 flex-1 bg-transparent pl-3 pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,$.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`@`,K]})]}),(0,$.jsx)(s,{onClick:ie,disabled:Y.isPending||!x.trim(),children:Y.isPending?`Creating…`:`Create`})]}),C&&(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:C})]})]}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[se,(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Subdomain`}),(0,$.jsx)(fn,{subdomain:h,onSubdomainChange:e=>{g(e),y&&b(null)},domainSuffix:n,subdomainPlaceholder:`my-assistant`,error:y}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Each assistant gets its own subdomain. Lowercase letters, numbers, and hyphens only.`}),(0,$.jsx)(s,{onClick:()=>O(!0),disabled:te.isPending||!h.trim(),children:te.isPending?`Registering…`:`Register`}),(0,$.jsx)(z,{open:T,title:`Set Subdomain`,message:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:h.trim().toLowerCase()||`subdomain`}),` `,`will also become your assistant's public handle. You won't be able to change it once set.`]}),confirmLabel:`Confirm`,onConfirm:re,onCancel:()=>O(!1)})]})}function mn(){let e=Xt(),r=mt(),{data:o}=d({...Ht(),enabled:r}),s=o?.results?.[0]?.handle,c=nn.use.emailRootDomain(),l=pt(),[u,f]=(0,Q.useState)(()=>l===`gated`?`your-own`:De(t(be,`managed`),`managed`)),[p,m]=(0,Q.useState)(()=>{let e=t(_e,`resend`);return e===`mailgun`||e===`resend`?e:`resend`}),{platformAssistantId:h,error:g}=tn(e,l===`full`&&u===`managed`),v=h??(g?e:null),y=d({queryKey:[`byoEmailCredential`,e,p],queryFn:async()=>{let{data:t}=await lt({path:{assistant_id:e},body:{service:p,field:`api_key`},throwOnError:!0});return t},enabled:u===`your-own`||l===`gated`,staleTime:6e4,retry:i,meta:{errorContext:`byo_email_credential_check`}});(0,Q.useEffect)(()=>{y.error&&a(y.error,{context:`byo_email_credential_check`,bestEffort:!0})},[y.error]);let b=y.data?.hasSecret===!0,x=(0,Q.useCallback)(e=>{f(e),n(be,e)},[]),S=(0,Q.useCallback)(()=>{n(_e,p),R.success(`Email settings saved.`)},[p]),T=(0,Q.useMemo)(()=>Z.find(e=>e.id===p)??Z[0],[p]),D=(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(w,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`span`,{children:[`Configure `,T.displayName,` via the assistant CLI: ask the assistant to run the`,` `,(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:T.setupSkill}),` `,`skill. It walks you through storing the API key, detecting the domain, and (optionally) wiring up an inbound webhook.`]}),(0,$.jsxs)(`a`,{href:T.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,T.displayName,(0,$.jsx)(C,{className:`h-3 w-3`})]})]})]}),O=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(B,{value:p,onChange:e=>{(e===`mailgun`||e===`resend`)&&m(e)},options:Z.map(e=>({value:e.id,label:e.displayName}))})]}),b?(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--system-positive-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-default)]`,children:[(0,$.jsx)(_,{className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,$.jsxs)(`span`,{children:[T.displayName,` API key configured. To reconfigure, run the`,` `,(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:T.setupSkill}),` `,`skill.`]})]}),(0,$.jsxs)(`a`,{href:T.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-body-small-default text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,T.displayName,(0,$.jsx)(C,{className:`h-3 w-3`})]})]}):D,(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(ln,{onClick:S,disabled:!1})})]});return l===`gated`?(0,$.jsx)(on,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,children:O}):(0,$.jsx)(an,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,mode:u,onModeChange:x,children:u===`managed`?(0,$.jsx)(`div`,{className:`space-y-4`,children:l===`disabled`?(0,$.jsx)(Wt,{children:`Log in to the Vellum platform to manage email settings.`}):v===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(E,{className:`h-4 w-4 animate-spin`}),`Connecting to the Vellum platform…`]}):(0,$.jsx)(pn,{assistantId:v,assistantHandle:s,emailRootDomain:c})}):O})}function hn(){let e=Xt();return(0,Q.useCallback)(async(t,n)=>{try{let{data:r}=await ut({path:{assistant_id:e},body:{value:n,type:`api_key`,name:t},throwOnError:!0});ye(r)}catch(e){throw e instanceof Error&&e.message===`No assistant found`?R.error(`Assistant not ready. Please try again.`):R.error(`Failed to save ${t} API key. Please try again.`),a(e,{context:`provision_provider_key`}),e}},[e])}function gn(e){let[t,n]=(0,Q.useState)(void 0);return(0,Q.useEffect)(()=>{t!==void 0&&e===t.value&&n(void 0)},[e,t]),[t===void 0?e:t.value,(0,Q.useCallback)(e=>n(e===void 0?void 0:{value:e}),[])]}var _n=`0.11.0`;function vn(){return et(_n)}var yn=`gemini-3.1-flash-image-preview`;function bn(){let e=Xt(),r=u(),i=mt(),{data:o}=d({...xt({path:{assistant_id:e}}),enabled:i,staleTime:3e4}),s=vt({onSuccess:t=>{Dt(r,{path:{assistant_id:e}},t)}}),c=hn(),[l,f]=gn((0,Q.useMemo)(()=>{if(!o)return t(je,`gemini`);let e=o.services?.[`image-generation`];return e?.mode===`managed`?`vellum`:e?.provider||t(`vellum:ai:imageGenProvider`,`gemini`)},[o])),[p,m]=(0,Q.useState)(()=>t(Le,yn)),h=ke(l),g=h.includes(p)?p:h[0]??yn,[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(!1),x=Je.map(e=>({value:e,label:re[e]??e})),S=(0,Q.useMemo)(()=>ke(l).map(e=>({value:e,label:U[e]??e})),[l]),C=l===`gemini`||l===`openai`,{hasStoredCredential:w}=q({assistantId:e,credentialKind:`api_key`,credentialName:l,enabled:C}),T=f,D=(0,Q.useCallback)(async()=>{b(!0);let t=_.trim(),i=C&&t.length>0;try{i&&await c(H(g),t),await tt();let n=l===`vellum`&&!vn()?{mode:`managed`}:{provider:l,mode:l===`vellum`?`managed`:`your-own`};await s.mutateAsync({path:{assistant_id:e},body:{services:{"image-generation":n}}}).catch(e=>{throw R.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e});try{await it({path:{assistant_id:e},body:{modelId:g},throwOnError:!0})}catch(e){throw R.error(`Failed to update image generation model. Please try again.`),a(e,{context:`set_image_gen_model`}),e}finally{r.invalidateQueries({queryKey:wt({path:{assistant_id:e}})})}}catch{b(!1);return}b(!1);try{if(n(je,l),n(Le,g),i){let t=ze(e,`api_key`,l);r.setQueryData(t,!0),r.invalidateQueries({queryKey:t}),v(``)}R.success(`Image generation settings saved.`)}catch(e){a(e,{context:`settings-ai-image-gen-persist-local`}),R.error(`Saved, but local preferences could not be written.`)}},[_,l,C,g,e,s,c,r]),O=(0,Q.useCallback)(()=>{v(``),m(yn),n(Le,yn)},[]);return(0,$.jsx)(on,{title:`Image Generation`,subtitle:`Configure which model your assistant uses to generate images`,children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(B,{"aria-label":`Image generation provider`,value:l,onChange:T,options:x})]}),l===`vellum`&&(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Image generation runs through your Vellum account.`}),C&&(0,$.jsx)(F,{label:`API Key`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:K(l===`openai`?`Enter your OpenAI API key`:`Enter your Gemini API key`,w),fullWidth:!0}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,$.jsx)(B,{"aria-label":`Image generation model`,value:g,onChange:m,options:S})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(ln,{onClick:D,disabled:y}),y&&(0,$.jsx)(E,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),C&&(0,$.jsx)(un,{onClick:O})]})]})})}function xn({title:e,count:t,action:n,children:r}){return(0,$.jsxs)(`section`,{className:`rounded-xl border border-[var(--border-hover)] bg-[var(--surface-overlay)] px-3 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,$.jsx)(m,{variant:`body-large-default`,as:`h3`,className:`text-[var(--content-secondary)]`,children:e}),t==null?null:(0,$.jsxs)(m,{variant:`body-large-default`,as:`span`,"aria-label":`${t} ${e.toLowerCase()}`,className:`text-[var(--content-disabled)]`,children:[`·`,` `,t]})]}),n]}),r==null?null:(0,$.jsx)(`div`,{className:`mt-4 border-t border-[var(--border-base)]`,children:r})]})}function Sn({blocked:e,availableReplacements:t,replacement:n,onReplacementChange:r,error:i,saving:a,onClose:o,onConfirm:c}){let l=``;if(e){let t=e.label||e.name;l=e.isActive&&e.callSiteIds.length>0?`"${t}" is the active profile and is used by ${e.callSiteIds.length} call site(s). Pick a replacement profile.`:e.isActive?`"${t}" is the active profile. Pick a different active profile before deleting, or select a replacement below.`:`"${t}" is used by ${e.callSiteIds.length} call site(s). Select a replacement profile to reassign them before deleting.`}return(0,$.jsx)(L.Root,{open:e!==null,onOpenChange:e=>{e||o()},children:(0,$.jsxs)(L.Content,{size:`sm`,children:[(0,$.jsx)(L.Header,{children:(0,$.jsx)(L.Title,{children:`Can't Delete Profile`})}),(0,$.jsxs)(L.Body,{className:`space-y-4`,children:[(0,$.jsx)(m,{variant:`body-medium-default`,as:`p`,children:l}),e&&e.callSiteIds.length>0&&(0,$.jsx)(`ul`,{className:`space-y-1 pl-1`,children:e.callSiteIds.map(e=>(0,$.jsxs)(`li`,{className:`text-body-small-default text-(--content-secondary)`,children:[`• `,(0,$.jsx)(`code`,{children:e})]},e))}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Replacement profile`}),(0,$.jsx)(B,{"aria-label":`Replacement profile`,value:n,onChange:r,options:[{value:``,label:`Select a replacement…`},...t.map(e=>({value:e.name,label:e.label??e.name}))]})]}),i&&(0,$.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:i})]}),(0,$.jsxs)(L.Footer,{children:[(0,$.jsx)(s,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,$.jsx)(s,{variant:`primary`,size:`compact`,disabled:!n||a,onClick:c,children:a?`Saving…`:`Reassign and Delete`})]})]})})}function Cn({profile:e,isActiveProfile:t,selected:n,connections:r,onOpen:i,onMakeActive:a,onSetStatus:o,onDelete:c}){let l=e.source===`managed`,u=e.status===`disabled`,d=e.label??e.name,f=[];e.model&&f.push(X(e.provider??void 0,e.model,r)),l&&f.push(`Managed by Vellum`);let p=e.availability,m=p!=null&&p.status!==`ok`?p.message??`This profile's provider is not available.`:null;return(0,$.jsx)(x,{title:(0,$.jsx)(`span`,{className:u?`opacity-55`:void 0,children:d}),subtitle:f.length>0?f.join(` • `):void 0,onClick:i,showChevron:!1,selected:n,contentAriaLabel:`Open profile ${d}`,trailingInteractive:!0,trailing:(0,$.jsxs)($.Fragment,{children:[m==null?null:(0,$.jsx)(`span`,{title:m,className:`inline-flex`,children:(0,$.jsx)(g,{className:`h-4 w-4 text-[var(--system-mid-strong)]`,"aria-label":m,role:`img`})}),u?(0,$.jsx)(N,{tone:`neutral`,children:`Disabled`}):null,t?(0,$.jsx)(N,{tone:`positive`,children:`Default`}):null,(0,$.jsxs)(v.Root,{children:[(0,$.jsx)(v.Trigger,{asChild:!0,children:(0,$.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,$.jsx)(S,{}),"aria-label":`Actions for ${d}`})}),(0,$.jsxs)(v.Content,{align:`end`,sideOffset:4,children:[(0,$.jsx)(v.Item,{onSelect:i,children:l?`View`:`Edit`}),!t&&!u?(0,$.jsx)(v.Item,{onSelect:a,children:`Make Default`}):null,u?(0,$.jsx)(v.Item,{onSelect:()=>o(!0),children:`Enable`}):l?null:(0,$.jsx)(v.Item,{onSelect:()=>o(!1),children:`Disable`}),l?null:(0,$.jsx)(v.Item,{onSelect:c,className:`text-[var(--system-negative-strong)] data-[highlighted]:text-[var(--system-negative-strong)]`,children:`Delete`})]})]})]})})}var wn=`0.11.0`;function Tn(){return $e(wn)}function En(e,t){let n=Tn(),{data:r}=d({...yt({path:{assistant_id:e}}),enabled:n,staleTime:3e4}),{profiles:i,profileOrder:a}=Ue(t?.llm,e);return(0,Q.useMemo)(()=>r==null?{entries:We(i,a).map(e=>({name:e.name,label:e.label??null,provider:e.provider??null,model:e.model??null,status:e.status===`disabled`?`disabled`:`active`,source:e.source===`managed`?`managed`:`user`,provider_connection:e.provider_connection,availability:null})),isEffectiveCatalog:!1}:{entries:r.profiles,isEffectiveCatalog:!0},[r,i,a])}function Dn(e){let t=u();return vt({onSuccess:n=>{Dt(t,{path:{assistant_id:e}},n),t.invalidateQueries({queryKey:ht({path:{assistant_id:e}})})}})}function On(e){let t=Dn(e);async function n(n,r,i){try{await t.mutateAsync({path:{assistant_id:e},body:{llm:n}})}catch(e){throw a(e,{context:r}),R.error(i),e}}return{makeActive:e=>n({activeProfile:e},`settings-ai-profile-make-active`,`Failed to set the active profile. Please try again.`),setStatus:(e,t)=>n({profiles:{[e]:{status:t?`active`:`disabled`}}},`settings-ai-profile-toggle`,`Failed to update the profile. Please try again.`),deleteProfile:(e,t,r)=>n({profiles:{[e]:null},profileOrder:t.filter(t=>t!==e),...r?.isAdvisor?{advisorProfile:null}:{}},`settings-ai-profile-delete`,`Failed to delete the profile. Please try again.`),patchLlm:n,isPending:t.isPending}}function kn(e,t,n){let r=On(e),i=t?.llm?.activeProfile??null,a=t?.llm?.advisorProfile??null,o=t?.llm?.callSites??{},s=(0,Q.useMemo)(()=>t?.llm?.profiles??{},[t?.llm?.profiles]),c=(0,Q.useMemo)(()=>t?.llm?.profileOrder??[],[t?.llm?.profileOrder]),l=(0,Q.useMemo)(()=>We(s,c),[s,c]),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(!1);async function v(e){try{await r.deleteProfile(e,c,{isAdvisor:e===a}),n?.onDeleted?.(e)}catch{}}function y(e){if(t==null)return;let n=s[e]?.label??e,r=e===i,a=Object.entries(o).filter(([t,n])=>t!==`mainAgent`&&n?.profile===e).map(([e])=>e);if(r||a.length>0){d({name:e,label:n,isActive:r,callSiteIds:a}),h(``),p(null);return}v(e)}async function b(){if(!u||!m)return;_(!0),p(null);let e={};if(u.isActive&&(e.activeProfile=m),u.callSiteIds.length>0){let t={};for(let e of u.callSiteIds)t[e]={profile:m};e.callSites=t}if(Object.keys(e).length>0)try{await r.patchLlm(e,`settings-ai-profile-reassign-delete`,`Failed to reassign references. Please try again.`)}catch{p(`Failed to reassign references. Please try again.`),_(!1);return}let t=u.name;d(null),_(!1),v(t)}let x=l.filter(e=>e.name!==u?.name&&e.source!==`managed`);return{requestDelete:y,blockedDeleteModalProps:{blocked:u,availableReplacements:x.length>0?x:l.filter(e=>e.name!==u?.name),replacement:m,onReplacementChange:h,error:f,saving:g,onClose:()=>{d(null),p(null)},onConfirm:()=>void b()}}}function An({assistantId:e,config:t,connections:n,selectedProfileName:r,onOpenProfile:i,onCreateProfile:a,onProfileDeleted:o}){let{entries:c}=En(e,t),l=On(e),u=kn(e,t,{onDeleted:o}),d=t?.llm?.activeProfile??null;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(xn,{title:`Profiles`,action:(0,$.jsx)(s,{variant:`primary`,size:`compact`,onClick:a,leftIcon:(0,$.jsx)(O,{}),disabled:t==null,children:`Create Profile`}),children:t==null?(0,$.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`Loading profiles…`}):c.length===0?(0,$.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No profiles yet. Create one to get started.`}):c.map(e=>(0,$.jsx)(Cn,{profile:e,isActiveProfile:e.name===d,selected:e.name===r,connections:n,onOpen:()=>i(e.name),onMakeActive:()=>void l.makeActive(e.name),onSetStatus:t=>void l.setStatus(e.name,t),onDelete:()=>u.requestDelete(e.name)},e.name))}),(0,$.jsx)(Sn,{...u.blockedDeleteModalProps})]})}var jn={anthropic:!0,openai:!0,gemini:!0,fireworks:!0,openrouter:!0,vellum:!0,together:!0,"vercel-ai-gateway":!0,minimax:!0,atlascloud:!0,baseten:!0,poolside:!0};function Mn(e){return e in jn}function Nn(e){let t=e.baseUrl??``;try{e.baseUrl&&(t=new URL(e.baseUrl).host)}catch{}let n=[];t&&n.push(t);let r=e.models?.length??0;return r>0&&n.push(`${r} ${r===1?`model`:`models`}`),e.auth.type===`none`&&n.push(`keyless`),n.join(` · `)}function Pn(e){switch(e.auth.type){case`api_key`:return`Own API key`;case`oauth_subscription`:return`ChatGPT subscription`;case`none`:return`No API key needed`;default:return null}}function Fn(e){if(e.provider===`vellum`)return`Included with your plan`;if(e.provider===`openai-compatible`)return Nn(e);let t=[],n=e.models?.length??de(e.provider).length;n>0&&t.push(`${n} ${n===1?`model`:`models`}`);let r=Pn(e);return r&&t.push(r),t.join(` • `)}function In({connection:e,isDefault:t,supportsDefaultProvider:n,selected:r,isSettingDefault:i,onOpen:a,onSetDefault:o,onDelete:c}){let l=e.isManaged??!1,u=Y(e),d=Mn(e.provider),f=Fn(e),p=n&&!t&&d,m=!l&&a!=null,h=!l&&!t,g=p||m||h;return(0,$.jsx)(x,{title:u,subtitle:f.length>0?f:void 0,onClick:a,showChevron:!1,selected:r,contentAriaLabel:a?`Open provider ${u}`:void 0,trailingInteractive:!0,trailing:(0,$.jsxs)($.Fragment,{children:[l?(0,$.jsx)(N,{tone:`neutral`,title:`Runs on Vellum's managed credentials.`,children:`Managed`}):null,t?(0,$.jsx)(N,{tone:`info`,title:`Built-in profiles (Balanced, Quality, Cost, Speed) use this provider.`,children:`Default`}):null,e.provider===`ollama`?(0,$.jsx)(N,{tone:`neutral`,title:`Runs models on this machine.`,children:`Local`}):null,e.provider===`openai-compatible`?(0,$.jsx)(N,{tone:`neutral`,title:`A provider you created, served by an OpenAI-compatible endpoint.`,children:`Custom`}):null,g?(0,$.jsxs)(v.Root,{children:[(0,$.jsx)(v.Trigger,{asChild:!0,children:(0,$.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,$.jsx)(S,{}),"aria-label":`Actions for ${u}`})}),(0,$.jsxs)(v.Content,{align:`end`,sideOffset:4,children:[m?(0,$.jsx)(v.Item,{onSelect:a,children:`Edit`}):null,p?(0,$.jsx)(v.Item,{disabled:i,onSelect:o,children:`Set as default`}):null,h?(0,$.jsx)(v.Item,{onSelect:c,className:`text-[var(--system-negative-strong)] data-[highlighted]:text-[var(--system-negative-strong)]`,children:`Delete`}):null]})]}):(0,$.jsx)(`span`,{className:`inline-block w-8`,"aria-hidden":!0})]})})}function Ln(e,t){let n=u(),r={path:{assistant_id:e}},i=f({...Tt(),onSuccess:()=>{n.invalidateQueries({queryKey:Et(r)}),n.invalidateQueries({queryKey:wt(r)}),n.invalidateQueries({queryKey:ht(r)})},onError:e=>{a(e,{context:`settings-ai-set-default-provider`}),R.error(`Failed to set the default provider. Please try again.`)}});function o(t){Mn(t.provider)&&i.mutate({path:{assistant_id:e},body:{provider:t.provider,connectionName:t.name}})}function s(e){return i.isPending&&i.variables?.body?.connectionName===e}async function c(i){try{let{response:a}=await at({path:{assistant_id:e,name:i}});a?.ok||a?.status===404?(n.invalidateQueries({queryKey:bt(r)}),t?.onDeleted?.(i)):a?.status===409?R.error(`This provider is in use by a profile or as the default provider. Update those settings before deleting it.`):R.error(`Failed to delete the provider. Please try again.`)}catch(e){a(e,{context:`settings-ai-provider-delete`}),R.error(`Failed to delete the provider. Please try again.`)}}return{setDefault:o,isSettingDefault:s,deleteConnection:c}}var Rn=`0.10.8`;function zn(){return $e(Rn)}function Bn({assistantId:e,selectedConnectionName:t,onOpenConnection:n,onAddProvider:r,onConnectionDeleted:i}){let{data:a,isLoading:o,isError:c}=d(_t({path:{assistant_id:e}})),l=zn(),{data:u}=d({...Ct({path:{assistant_id:e}}),enabled:l}),f=l?u?.resolvedConnectionName??null:null,p=Ln(e,{onDeleted:i}),h=(0,Q.useMemo)(()=>{let e=a?.connections??[];return[...e.filter(e=>e.provider===Me),...e.filter(e=>e.provider!==Me)]},[a]);return(0,$.jsx)(xn,{title:`Providers`,action:(0,$.jsx)(s,{variant:`outlined`,size:`compact`,onClick:r,leftIcon:(0,$.jsx)(O,{}),children:`Add Provider`}),children:o?(0,$.jsx)(`div`,{className:`space-y-2 py-2`,children:[1,2,3].map(e=>(0,$.jsx)(`div`,{className:`h-10 animate-pulse rounded-lg bg-[var(--surface-active)]`},e))}):c?(0,$.jsx)(m,{variant:`body-medium-default`,as:`p`,className:`py-4 text-center text-(--system-negative-strong)`,children:`Failed to load providers. Please try again.`}):h.length===0?(0,$.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No providers yet. Add one to get started.`}):h.map(e=>(0,$.jsx)(In,{connection:e,isDefault:e.name===f,supportsDefaultProvider:l,selected:e.name===t,isSettingDefault:p.isSettingDefault(e.name),onOpen:e.isManaged??!1?void 0:()=>n(e.name),onSetDefault:()=>p.setDefault(e),onDelete:()=>void p.deleteConnection(e.name)},e.name))})}function Vn({panel:e,onOpenPanel:t,onClosePanel:n}){let r=Xt(),{data:i}=d({...xt({path:{assistant_id:r}}),staleTime:3e4}),a=zn(),{data:o}=d({...Ct({path:{assistant_id:r}}),enabled:a}),c=o?.availability,{data:l}=d({..._t({path:{assistant_id:r}})}),u=l?.connections,f=i?.llm?.callSites??{},p=Object.entries(f).filter(([e,t])=>e!==`mainAgent`&&(t?.profile!=null||t?.provider!=null||t?.model!=null)).length;return(0,$.jsx)(on,{title:`Language Model`,subtitle:`Profiles choose which model answers. Providers supply access to it`,children:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[c&&c.status!==`ok`&&(0,$.jsx)(M,{tone:c.status===`unknown`?`warning`:`error`,children:c.message??`Your default provider is not available.`}),r&&(0,$.jsx)(An,{assistantId:r,config:i,connections:u,selectedProfileName:e?.kind===`profile`?e.name:null,onOpenProfile:e=>t({kind:`profile`,name:e}),onCreateProfile:()=>t({kind:`create-profile`}),onProfileDeleted:t=>{e?.kind===`profile`&&e.name===t&&n()}}),r&&(0,$.jsx)(Bn,{assistantId:r,selectedConnectionName:e?.kind===`provider`?e.name:null,onOpenConnection:e=>t({kind:`provider`,name:e}),onAddProvider:()=>t({kind:`add-provider`}),onConnectionDeleted:t=>{e?.kind===`provider`&&e.name===t&&n()}}),(0,$.jsx)(xn,{title:`Overrides`,count:p,action:(0,$.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>t({kind:`overrides`}),children:`Manage`})})]})})}function Hn(e,{onSaved:t}={}){let n=Dn(e),{data:r}=d({...xt({path:{assistant_id:e}}),staleTime:3e4}),i=(0,Q.useMemo)(()=>r?.llm?.profiles??{},[r?.llm?.profiles]),o=r?.llm?.profileOrder??[];async function s(r,s,c){let l=c?.mode??`replace`,u=!(r in i);if(l===`merge`&&!u){await n.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[r]:s}}}}),t?.();return}let d={profiles:{[r]:s}};if(u&&(d.profileOrder=o.includes(r)?o:[...o,r]),u)await n.mutateAsync({path:{assistant_id:e},body:{llm:d}});else{let t=i[r];await n.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[r]:null}}}});try{await n.mutateAsync({path:{assistant_id:e},body:{llm:d}})}catch(i){throw a(i,{context:`settings-ai-profile-edit-recreate`}),t!=null&&await n.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[r]:t}}}}).catch(()=>{}),i}}u&&R.success(`Profile "${s.label??r}" created`),t?.()}return{saveProfile:s,isPending:n.isPending}}function Un({assistantId:e,profileName:t,onClose:n}){let{data:r}=d({...xt({path:{assistant_id:e}}),staleTime:3e4}),{data:i}=d({..._t({path:{assistant_id:e}})}),a=i?.connections,o=(0,Q.useMemo)(()=>r?.llm?.profiles??{},[r?.llm?.profiles]),c=Object.keys(o),l=(0,Q.useMemo)(()=>{if(t==null)return;let e=o[t];return e?{name:t,...e}:void 0},[t,o]),u=t==null?`create`:l?.source===`managed`||l?.invariant===!0?`view`:`edit`,{saveProfile:f,isPending:p}=Hn(e,{onSaved:n}),m=te({mode:u,profileName:t??void 0,initialValues:l,existingNames:c,connections:a,assistantId:e,onSave:f}),h=kn(e,r,{onDeleted:()=>n()}),g=t!=null&&r!=null&&!(t in o);(0,Q.useEffect)(()=>{g&&!m.saving&&!p&&n()},[g,m.saving,p,n]);let _=u===`view`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Zt,{title:m.effectiveMode===`create`?`New Profile`:l?.label??t??`Profile`,closeVariant:`outlined`,onClose:n,headerTrailing:_&&m.effectiveMode!==`create`?(0,$.jsx)(N,{tone:`neutral`,children:`Managed by Vellum`}):null,headerActions:m.effectiveMode!==`create`&&!m.isReadOnly?(0,$.jsx)(s,{variant:`outlined`,size:`compact`,leftIcon:(0,$.jsx)(A,{}),tintColor:`var(--system-negative-strong)`,onClick:()=>{t!=null&&h.requestDelete(t)},disabled:m.saving,children:`Delete`}):null,footer:m.isReadOnly?(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(s,{variant:`outlined`,onClick:m.switchToSaveAsNew,disabled:m.saving,children:`Save As New`}),m.hasViewModeChanges?(0,$.jsx)(s,{variant:`primary`,onClick:()=>void m.handleSave(),disabled:m.saving,children:m.saving?`Saving…`:`Save`}):null]}):(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(s,{variant:`primary`,onClick:()=>void m.handleSave(),disabled:m.isInvalid||m.saving,children:m.saving?`Saving…`:m.effectiveMode===`create`?`Create Profile`:`Save Changes`})}),children:(0,$.jsx)(Ze,{editor:m,assistantId:e,connections:a,variant:`panel`})}),(0,$.jsx)(Sn,{...h.blockedDeleteModalProps})]})}function Wn({value:e,profileOptions:t,disabled:n,onChange:r}){return(0,$.jsx)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:`Advisor`}),(0,$.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`The profile your assistant consults for a second opinion when it wants to check a plan or review its own work.`})]}),(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:(0,$.jsx)(B,{value:e,onChange:r,options:t,placeholder:`Choose profile…`,className:`w-44`,menuMinWidth:280,menuAlign:`end`,disabled:n})})]})})}var Gn=`__custom__`;function Kn(e){return e?!!(e.profile||e.provider||e.model):!1}function qn(e,t){let n=Kn(e);return n===Kn(t)?n?(e?.profile??null)===(t?.profile??null)&&(e?.provider??null)===(t?.provider??null)&&(e?.model??null)===(t?.model??null):!0:!1}function Jn({id:e,displayName:t,description:n,defaultProfileLabel:r,draft:i,profileOptions:a,onDraftChange:o,onToggle:s}){let c=Kn(i),l=!i||!c?``:i.provider||i.model?Gn:i.profile??``,u=l===Gn,d=ce(),f=d[0]??Re[0],p=d.find(e=>e===i?.provider)??f,m=de(p).map(e=>({value:e.id,label:e.displayName})),h=!!i?.provider&&!i?.model;function g(t){t===`__custom__`?o(e,{profile:null,provider:f,model:Ce(f)??``}):t===``?o(e,null):o(e,{profile:t,provider:null,model:null})}function _(t){let n=Ce(t)??``;o(e,{...i??{},profile:null,provider:t,model:n})}function v(t){o(e,{...i??{},model:t})}return(0,$.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:t}),n&&(0,$.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[n,r&&(0,$.jsxs)(`span`,{className:`ml-1.5 text-body-small-default text-[var(--content-tertiary)] opacity-60`,children:[`· Default: `,r]})]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c&&(0,$.jsx)(B,{value:l,onChange:g,options:a,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,$.jsx)(I,{checked:c,onChange:t=>s(e,t),"aria-label":`Override ${t}`})]})]}),c&&u&&(0,$.jsxs)(`div`,{className:`mt-3 space-y-2 border-t border-[var(--border-base)] pt-3`,children:[(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex-1`,children:[(0,$.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(B,{value:p??``,onChange:_,options:d.map(e=>({value:e,label:Te[e]??e}))})]}),(0,$.jsxs)(`div`,{className:`flex-1`,children:[(0,$.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,$.jsx)(B,{value:i?.model??``,onChange:v,options:m})]})]}),h&&(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:`Pick a model`})]})]})}var Yn=`0.11.1`;function Xn(e){return nt(Yn,e)}function Zn({assistantId:e,onClose:t}){let n=u(),{data:r}=d({...xt({path:{assistant_id:e}}),staleTime:3e4}),i=(0,Q.useMemo)(()=>r?.llm?.profiles??{},[r?.llm?.profiles]),o=(0,Q.useMemo)(()=>r?.llm?.profileOrder??[],[r?.llm?.profileOrder]),c=(0,Q.useMemo)(()=>r?.llm?.callSites??{},[r?.llm?.callSites]),l=(0,Q.useMemo)(()=>r?.llm?.defaultProfileOverrides??{},[r?.llm?.defaultProfileOverrides]),f=(0,Q.useMemo)(()=>We(i,o),[i,o]),p=ce(),m=vt({onSuccess:t=>{Dt(n,{path:{assistant_id:e}},t)}}),h=Xn(e),g=Qe.use.assistantId(),_=Qe.use.version()!=null&&g===e,[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(``),[S,C]=(0,Q.useState)({}),[w,T]=(0,Q.useState)({}),[D,O]=(0,Q.useState)(void 0),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(!1),{data:P,isLoading:I,isError:L,refetch:V}=d({...St({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1}),H=(0,Q.useMemo)(()=>(P?.callSites??[]).filter(e=>e.id!==`mainAgent`),[P]),ee=!I&&!L&&!!P,U=!!r,W=ee&&U,G=(0,Q.useMemo)(()=>H.map(e=>e.id),[H]),K=(0,Q.useMemo)(()=>{if(!W)return{};let e={};for(let t of G)if(t in w)e[t]=w[t];else{let n=c[t];e[t]=n?{...n}:{}}return e},[W,G,c,w]),q=(0,Q.useMemo)(()=>new Set(G),[G]),J=(0,Q.useCallback)(e=>f.find(t=>t.name===e)?.label??e,[f]),te=(0,Q.useMemo)(()=>{let e=new Map;for(let t of H)t.shippedDefaultProfile&&e.set(t.shippedDefaultProfile,(e.get(t.shippedDefaultProfile)??0)+1);let t=new Map(f.map((e,t)=>[e.name,t]));return[...e.entries()].map(([e,t])=>({tier:e,count:t})).sort((e,n)=>(t.get(e.tier)??2**53-1)-(t.get(n.tier)??2**53-1))},[H,f]),ne=(0,Q.useCallback)(e=>e in S?S[e]??null:l[e]??null,[S,l]),Y=(0,Q.useMemo)(()=>Object.entries(S).some(([e,t])=>(t??null)!==(l[e]??null)),[S,l]),X=r?.llm?.advisorProfile??``,Z=D??X,re=Z!==X,ie=(0,Q.useMemo)(()=>Ee(f,[X]).map(e=>({value:e.name,label:Ne(e)})),[f,X]),ae=(0,Q.useMemo)(()=>{let e=v.trim().toLowerCase();return e===``||`advisor`.includes(e)||`second opinion`.includes(e)},[v]),oe=(0,Q.useMemo)(()=>Object.entries(c).some(([e,t])=>q.has(e)&&(t?.profile!=null||t?.provider!=null||t?.model!=null)),[c,q]),se=(0,Q.useMemo)(()=>{if(!W)return!1;for(let e of Object.keys(K))if(!qn(K[e],c[e]))return!0;return!1},[W,K,c]),le=re||se||Y,ue=(0,Q.useMemo)(()=>Object.values(K).some(e=>Kn(e)&&!!e?.provider&&!e?.model),[K]),de=(0,Q.useMemo)(()=>Ee(f,[]).map(e=>({value:e.name,label:Ne(e)})),[f]),fe=(0,Q.useCallback)(()=>{if(!b)return;let e={};for(let t of G)e[t]={profile:b};T(e)},[b,G]),pe=(0,Q.useCallback)(e=>[...Ee(f,[e]).map(e=>({value:e.name,label:Ne(e)})),{value:Gn,label:`Custom`}],[f]),me=(0,Q.useMemo)(()=>{if(!v.trim())return H;let e=v.toLowerCase();return H.filter(t=>(t.displayName??``).toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e)||(t.domain??``).toLowerCase().includes(e))},[H,v]),he=(0,Q.useMemo)(()=>{if(!P)return[];let e=P.domains.map(e=>e.id),t=new Map(P.domains.map(e=>[e.id,e])),n=[];for(let r of e){let e=me.filter(e=>e.domain===r);e.length>0&&n.push({domain:t.get(r),sites:e})}let r=new Set(e),i=me.filter(e=>!r.has(e.domain));return i.length>0&&n.push({domain:{id:`other`,displayName:`Other`},sites:i}),n},[P,me]),ge=(0,Q.useCallback)((e,t)=>{T(n=>({...n,[e]:t}))},[]),_e=(0,Q.useCallback)((e,t)=>{if(!t){T(t=>({...t,[e]:null}));return}let n=Be(f,H.find(t=>t.id===e)?.defaultProfile);if(n)T(t=>({...t,[e]:{profile:n}}));else{let t=p[0]??Re[0],n=Ce(t)??``;T(r=>({...r,[e]:{provider:t,model:n}}))}},[H,f,p]),ve=(0,Q.useCallback)(async()=>{j(!0);try{let n={};for(let e of Object.keys(K)){let t=K[e]??null;Kn(t)?n[e]={profile:t?.profile??null,provider:t?.provider??null,model:t?.model??null}:e in w&&w[e]===null&&(n[e]=null)}let r={};for(let[e,t]of Object.entries(S))(t??null)!==(l[e]??null)&&(r[e]=t??null);await m.mutateAsync({path:{assistant_id:e},body:{llm:{...se?{callSites:n}:{},...re?{advisorProfile:Z}:{},...h&&Y?{defaultProfileOverrides:r}:{}}}}),t(),R.success(`Overrides saved.`)}catch(e){R.error(`Failed to save overrides. Please try again.`),a(e,{context:`call_site_overrides_save`})}finally{j(!1)}},[K,w,se,re,Z,S,l,Y,h,t,m,e]),ye=(0,Q.useCallback)(async()=>{j(!0);try{let n={};for(let e of Object.keys(K))n[e]=null;await m.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),R.success(`Overrides reset.`)}catch(e){R.error(`Failed to reset overrides. Please try again.`),a(e,{context:`call_site_overrides_reset`})}finally{j(!1)}},[K,t,m,e]);return(0,$.jsxs)(Zt,{title:`Action Overrides`,closeVariant:`outlined`,onClose:t,footer:(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[oe&&(0,$.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>N(!0),disabled:A||!W,tintColor:`var(--system-negative-strong)`,className:`mr-auto`,children:`Reset to Defaults`}),(0,$.jsx)(s,{variant:`primary`,size:`compact`,onClick:()=>void ve(),disabled:!le||ue||A,children:A?(0,$.jsx)(E,{className:`h-4 w-4 animate-spin`}):`Save`})]}),children:[(0,$.jsx)(`p`,{className:`mb-4 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Customize which model profile specific actions should use. Uses your default profile if no override is set.`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`mb-4`,children:(0,$.jsx)(F,{type:`search`,value:v,onChange:e=>y(e.target.value),placeholder:`Search actions…`,leftIcon:(0,$.jsx)(k,{className:`h-4 w-4`}),fullWidth:!0})}),h&&!v.trim()&&te.length>0&&(0,$.jsxs)(`div`,{className:`mb-4`,children:[(0,$.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:`Defaults`}),(0,$.jsx)(`div`,{className:`space-y-1`,children:te.map(({tier:e,count:t})=>{let n=J(e),r=ne(e),i=[{value:``,label:`${n} (default)`},...Ee(f,[r]).filter(t=>t.name!==e).map(e=>({value:e.name,label:Ne(e)}))];return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t===1?`1 action`:`${t} actions`})]}),(0,$.jsx)(B,{value:r??``,onChange:t=>C(n=>({...n,[e]:t===``?null:t})),options:i,className:`w-44`,menuMinWidth:280,menuAlign:`end`,disabled:A})]},e)})})]}),!h&&de.length>0&&(0,$.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-body-medium-default text-[var(--content-default)]`,children:`Use one profile for all actions`}),(0,$.jsx)(B,{value:b,onChange:x,options:de,placeholder:`Choose profile…`,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,$.jsx)(s,{variant:`outlined`,size:`compact`,onClick:fe,disabled:!b||!W||A||!_,children:`Apply to all`})]}),U&&ae&&(0,$.jsxs)(`div`,{className:`mb-4`,children:[(0,$.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:`Advisor`}),(0,$.jsx)(Wn,{value:Z,profileOptions:ie,disabled:A,onChange:O})]}),I&&(0,$.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,$.jsx)(E,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}),L&&(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Couldn't load actions`}),(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Make sure your assistant is running`}),(0,$.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>void V(),children:`Retry`})]}),!I&&!L&&P&&(0,$.jsx)(`div`,{className:`space-y-4`,children:he.length===0?ae?null:(0,$.jsx)(`p`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No actions match your search.`}):he.map(({domain:e,sites:t})=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:e.displayName}),(0,$.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>{let t=(()=>{let t=K[e.id]??null;return!t||!Kn(t)?``:t.provider||t.model?`__custom__`:t.profile??``})(),n=Kn(K[e.id]??null),r=e.shippedDefaultProfile,i=null;if(h&&r&&!n){let e=ne(r);i=J(r)+(e?` → ${J(e)}`:``)}else e.defaultProfile&&(i=J(e.defaultProfile));return(0,$.jsx)(Jn,{id:e.id,displayName:e.displayName,description:e.description,defaultProfileLabel:i,draft:K[e.id]??null,profileOptions:pe(t===``||t===`__custom__`?null:t),onDraftChange:ge,onToggle:_e},e.id)})})]},e.id))})]}),(0,$.jsx)(z,{open:M,title:`Reset to Defaults`,message:h?`Every action override will be reset and will follow its tier default above. Your tier choices are kept. This cannot be undone.`:`Every task override will be reset and will follow your active profile. This cannot be undone.`,confirmLabel:`Reset to Defaults`,destructive:!0,onConfirm:()=>{N(!1),ye()},onCancel:()=>N(!1)})]})}function Qn({mode:e,connection:t,assistantId:n,existingNames:r,connections:i,variant:a=`modal`,onSave:o,onCancel:c}){let[l,d]=(0,Q.useState)(t?.label??``),f=t?.name??``,p=t?.provider??`anthropic`,h=t?.auth.type??`api_key`,[g,_]=(0,Q.useState)(()=>t?.auth.type===`api_key`?t.auth.credential:t?``:`credential/anthropic/api_key`),[v,y]=(0,Q.useState)(t?.baseUrl??``),[b,x]=(0,Q.useState)(()=>t?.models?t.models.map(e=>e.id).join(`, `):``),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(null),E=p===`openai-compatible`,[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(!1),j=u(),M=(0,Q.useMemo)(()=>le(g),[g]),N=h===`api_key`&&M!==null,{hasStoredCredential:P,isLoading:I}=q({assistantId:n,credentialKind:`credential`,credentialName:M?`${M.service}:${M.field}`:``,enabled:N}),{credentials:R}=ae({assistantId:n,enabled:h===`api_key`});(0,Q.useEffect)(()=>{let e=t?.provider??`anthropic`;d(t?.label??``),t?.auth.type===`api_key`?_(t.auth.credential):_(t?``:`credential/${e}/api_key`),T(null),y(t?.baseUrl??``),x(t?.models?t.models.map(e=>e.id).join(`, `):``),O(``),A(!1)},[t]);let z=l.trim()!==(t?.label??``).trim(),B=E&&z?G(l,i,t?.name):null,H=f.trim().length>0&&B===null;async function U(){if(H){C(!0),T(null);try{let e;if(h===`api_key`){let t=g.trim()||`credential/${p}/api_key`,r=D.trim();if(r){A(!0);try{let e=le(t);await ut({path:{assistant_id:n},body:e?{type:`credential`,name:`${e.service}:${e.field}`,value:r}:{type:`api_key`,name:p,value:r},throwOnError:!0});let i=ze(n,`credential`,e?`${e.service}:${e.field}`:``);j.setQueryData(i,!0),j.invalidateQueries({queryKey:Ot({path:{assistant_id:n}})})}catch{T(`Failed to save API key. Please try again.`);return}finally{A(!1)}}e={type:`api_key`,credential:t}}else if(t)e=t.auth;else{T(`Nothing to edit. Close and try again.`);return}let r=l.trim()||null,i={auth:e,label:r,...E&&{base_url:v.trim()||null,models:b.trim()?b.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):null}},{data:a,error:s,response:c}=await ot({path:{assistant_id:n,name:t?.name??f.trim()},body:i});if(!c?.ok){T(V(c?.status,s)??se(c?.status));return}if(!a){T(`Server returned an empty response. Please try again.`);return}o(a)}catch{T(`Failed to save provider. Please try again.`)}finally{C(!1)}}}let W=R.filter(e=>e.service===p),te=e!==`create`&&t?.auth.type===`api_key`,ne=W.length>0||te,X=K(`Enter your API key`,P);if(e===`create`)return(0,$.jsx)(ee,{variant:a===`panel`?`inline`:`modal`,assistantId:n,existingNames:r,connections:i,defaultProviderType:p,onCreated:o,onCancel:c});let Z=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[`Display Name`,` `,(0,$.jsx)(`span`,{className:`text-[var(--content-disabled)]`,children:`(optional)`})]}),(0,$.jsx)(F,{value:l,onChange:e=>d(e.target.value),placeholder:`e.g. My Anthropic Key`,fullWidth:!0}),B?(0,$.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:oe[B]}):null]}),E&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,$.jsx)(F,{value:v,onChange:e=>y(e.target.value),placeholder:`https://api.example.com/v1`,fullWidth:!0})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,$.jsx)(F,{value:b,onChange:e=>x(e.target.value),placeholder:`model-1, model-2`,fullWidth:!0}),(0,$.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),h===`api_key`&&(0,$.jsx)(ie,{apiKeyValue:D,onApiKeyChange:O,credential:g,onCredentialChange:_,isLoadingCredential:I,apiKeyPlaceholder:X,provider:p,providerCredentials:W,showAdvancedSection:ne,onError:T}),h===`oauth_subscription`&&(0,$.jsx)(J,{assistantId:n,onConnected:o}),w&&(0,$.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:w})]}),re=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{variant:`ghost`,size:`compact`,onClick:c,children:`Cancel`}),(0,$.jsx)(s,{variant:`primary`,size:`compact`,disabled:!H||S||k,onClick:()=>void U(),children:S?`Saving…`:`Save Changes`})]});return a===`panel`?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[Z,(0,$.jsx)(`div`,{className:`flex justify-end gap-2`,children:re})]}):(0,$.jsxs)(L.Content,{size:`md`,children:[(0,$.jsxs)(L.Header,{children:[(0,$.jsx)(L.Title,{children:`Edit Provider`}),(0,$.jsx)(L.Description,{children:t?`Editing ${Y(t)}.`:`Edit provider settings.`})]}),(0,$.jsx)(L.Body,{children:Z}),(0,$.jsx)(L.Footer,{children:re})]})}function $n({assistantId:e,connectionName:t,onClose:n}){let r=u(),{data:i}=d(_t({path:{assistant_id:e}})),a=(0,Q.useMemo)(()=>i?.connections??[],[i]),o=(0,Q.useMemo)(()=>t==null?void 0:a.find(e=>e.name===t),[t,a]),s=t!=null&&i!=null&&o==null;(0,Q.useEffect)(()=>{s&&n()},[s,n]);function c(){r.invalidateQueries({queryKey:bt({path:{assistant_id:e}})}),r.invalidateQueries({queryKey:Et({path:{assistant_id:e}})}),n()}return(0,$.jsx)(Zt,{title:o?Y(o):`Add Provider`,closeVariant:`outlined`,onClose:n,children:t==null||o!=null?(0,$.jsx)(Qn,{mode:o?`edit`:`create`,connection:o,variant:`panel`,assistantId:e,existingNames:a.map(e=>e.name),connections:a,onSave:c,onCancel:n}):null})}function er({open:e,onOpenChange:t,title:n,currentCode:r,configuredProviderId:i,suggestedCode:a,selectLanguage:o,selecting:s}){return(0,$.jsx)(L.Root,{open:e,onOpenChange:t,children:(0,$.jsxs)(L.Content,{size:`sm`,onOpenAutoFocus:e=>{e.preventDefault(),e.target?.querySelector(`input[role="combobox"]`)?.focus()},children:[(0,$.jsxs)(L.Header,{children:[(0,$.jsx)(L.Title,{children:n}),(0,$.jsx)(L.Description,{children:`Applies from your next spoken turn.`})]}),(0,$.jsx)(L.Body,{children:(0,$.jsx)(Fe,{currentCode:r,configuredProviderId:i,suggestedCode:a,selectLanguage:o,selecting:s,onDone:()=>t(!1)})})]})})}var tr={vellum:{provider:`vellum`},deepgram:{provider:`deepgram`,credentialService:`deepgram`},openai:{provider:`openai-whisper`,credentialService:`openai`}},nr={vellum:`vellum`,deepgram:`deepgram`,"openai-whisper":`openai`},rr=`deepgram`;function ir({assistantId:e,hideSaveButton:r=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=Xt(),s=e??o,c=mt(),l=u(),[f]=(0,Q.useState)(()=>W.filter(e=>!e.requiresNativeDictation||Oe())),p=rr,{data:m}=d({...xt({path:{assistant_id:s}}),enabled:c,staleTime:3e4}),h=m?.services?.stt,g=h?.mode===`managed`?`vellum`:h?.provider,_=(0,Q.useMemo)(()=>{let e=g?nr[g]:void 0;if(e&&f.some(t=>t.id===e))return e;let n=t(Se,p);return f.some(e=>e.id===n)?n:p},[g,f,p]),v=!!g,[y,b]=gn(_),{available:x,currentCode:S,configuredProviderId:C,selectLanguage:w,selecting:T}=fe(s),[E,D]=(0,Q.useState)(!1),O=x&&y===_&&(tr[y]?.provider===C||!!g&&!nr[g]),[k,A]=(0,Q.useState)(``),[M,N]=(0,Q.useState)(!1),[P,I]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{let e=t(Se,p);e===`macos-native`&&!f.some(t=>t.id===e)&&n(Se,p)},[f,p]);let L=(0,Q.useMemo)(()=>f.find(e=>e.id===y)??f[0],[f,y]),z=L.apiKeyPlaceholder!==void 0;(0,Q.useEffect)(()=>{N(t(we+y,``).length>0),A(``)},[y]);let V=(0,Q.useMemo)(()=>{let e=y!==_,t=k.trim().length>0;return e||t},[y,_,k]),H=(0,Q.useCallback)(async()=>{let e=k.trim();n(Se,y),e.length>0&&n(we+y,e);let r=tr[y];I(!0);try{if(r?.credentialService){let n=e.length>0?e:t(we+y,``);if(n.length>0){let{response:e}=await st({path:{assistant_id:s},body:{service:r.credentialService,field:`api_key`,value:n,label:`${L.displayName} API Key`},throwOnError:!1});if(!e?.ok)throw Error(`Failed to store API key (HTTP ${e?.status??`?`})`)}}if(r&&(y!==_||!v)||g===`vellum`&&y!==`vellum`){let e=r?.provider??rr,{response:t}=await ct({path:{assistant_id:s},body:{services:{stt:{provider:e,mode:e===`vellum`?`managed`:`your-own`}}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`)}return e.length>0&&N(!0),A(``),l.invalidateQueries({queryKey:wt({path:{assistant_id:s}})}),R.success(`Speech-to-text settings saved`),!0}catch(e){return R.error(e instanceof Error?e.message:`Failed to save speech-to-text settings`),!1}finally{I(!1)}},[s,y,k,L,_,v,g,l]);(0,Q.useEffect)(()=>{a?.({hasChanges:V,saving:P,save:H})},[a,V,P,H]);let ee=(0,Q.useCallback)(()=>{n(we+y,``),N(!1),A(``)},[y]),U=M?`•••••••• (Enter a new key to replace)`:L.apiKeyPlaceholder;return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(B,{value:y,onChange:b,options:f.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),O&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Spoken language`}),(0,$.jsx)(Ge,{"aria-label":`Spoken language`,"aria-haspopup":`dialog`,onClick:()=>D(!0),value:he(S,C)}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Applies from your next spoken turn.`}),(0,$.jsx)(er,{open:E,onOpenChange:D,title:`Spoken language`,currentCode:S,configuredProviderId:C,selectLanguage:w,selecting:T})]}),z&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,$.jsx)(F,{type:`password`,value:k,onChange:e=>A(e.target.value),placeholder:U,fullWidth:!0})]}),L.setupWarning&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(j,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-mid-strong)]`}),(0,$.jsx)(`span`,{children:L.setupWarning})]}),!i&&L.credentialsGuide&&(0,$.jsx)(dn,{guide:L.credentialsGuide}),y===`vellum`&&(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Transcription runs through your Vellum account.`}),(!r||M)&&(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[!r&&(0,$.jsx)(ln,{onClick:H,disabled:!V||P}),M&&(0,$.jsx)(un,{onClick:ee})]})]})}function ar(){return(0,$.jsx)(on,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,children:(0,$.jsx)(ir,{})})}async function or(e){let{provider:t,apiKey:n,voiceId:r,text:i}=e;if(n.trim().length===0)return{kind:`error`,message:`Save an API key for this provider first.`};try{return t===`elevenlabs`?await sr(n,r,i):t===`deepgram`?await cr(n,i):t===`fish-audio`?{kind:`unsupported`,message:`Fish Audio TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:t===`xai`?{kind:`unsupported`,message:`xAI TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:{kind:`unsupported`,message:`TTS testing for "${t}" is not supported from the browser yet.`}}catch(e){return{kind:`error`,message:e instanceof Error?e.message:`Failed to reach the TTS provider.`}}}async function sr(e,t,n){let r=t.trim();if(r.length===0)return{kind:`error`,message:`Enter and save a Voice ID before testing ElevenLabs.`};let i=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(r)}?output_format=mp3_44100_128`,{method:`POST`,headers:{"xi-api-key":e,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:n,model_id:`eleven_turbo_v2_5`})});return i.ok?{kind:`audio`,blob:await i.blob()}:{kind:`error`,message:await lr(i,`ElevenLabs rejected the request.`)}}async function cr(e,t){let n=await fetch(`https://api.deepgram.com/v1/speak?model=aura-2-thalia-en`,{method:`POST`,headers:{Authorization:`Token ${e}`,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:t})});return n.ok?{kind:`audio`,blob:await n.blob()}:{kind:`error`,message:await lr(n,`Deepgram rejected the request.`)}}async function lr(e,t){try{let n=await e.text();if(n.length===0)return`${t} (HTTP ${e.status})`;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`detail`in e&&typeof e.detail==`string`)return e.detail;if(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`)return e.message}catch{}return n.slice(0,200)}catch{return`${t} (HTTP ${e.status})`}}function ur({assistantId:e,value:t,onChange:n,className:r}){let[i,a]=(0,Q.useState)(!1),{voices:o}=qt(e);if(o.length===0)return null;let s=o.find(e=>e.model===t)??o[0];return(0,$.jsxs)(P.Root,{open:i,onOpenChange:a,children:[(0,$.jsx)(P.Trigger,{asChild:!0,children:(0,$.jsx)(Ge,{"aria-label":`Voice`,value:s?Jt(s.description):`Select a voice`,className:r})}),(0,$.jsx)(P.Content,{side:`bottom`,align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,children:(0,$.jsx)(Yt,{assistantId:e,value:t,onChange:n,onSelect:()=>a(!1),showSource:!0})})]})}var dr={elevenlabs:`voiceId`,"fish-audio":`referenceId`,xai:`voiceId`};function fr({assistantId:e,hideSaveButton:r=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=Xt(),c=e??o,l=Qe.use.name()??`your assistant`,f=mt(),p=u(),{data:m}=d({...gt({path:{assistant_id:c}}),enabled:f,staleTime:1/0}),h=(0,Q.useMemo)(()=>{let e=m?.providers;if(!e)return ne;if(e.some(e=>e.id===`vellum`))return e;let t=ne.find(e=>e.id===`vellum`);return t?[t,...e]:e},[m]),{data:g}=d({...xt({path:{assistant_id:c}}),enabled:f,staleTime:3e4}),_=g?.services?.tts,v=_?.mode===`managed`?`vellum`:_?.provider,y=`elevenlabs`,b=(0,Q.useMemo)(()=>v??t(`vellum:voice:ttsProvider`,y),[v,y]),x=!!v,[S,C]=gn(b),[w,E]=(0,Q.useState)(``),[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(``),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(!1),[I,L]=(0,Q.useState)(!1),{voices:z,defaultModel:V,fetched:H}=Kt(c,{enabled:S===`vellum`}),ee=_?.providers?.vellum?.model??V??``,[U,W]=gn(ee),G=z.find(e=>e.model===U)??z[0],[K,q]=(0,Q.useState)(null),J=z.some(e=>e.model===ee),te=K??(H&&ee!==``&&!J),Y=(0,Q.useMemo)(()=>h.find(e=>e.id===S)??h[0],[S,h]),X=S===`vellum`&&Y.supportsVoiceSelection&&U.trim()!==``&&U.trim()!==ee,Z=(0,Q.useCallback)(e=>{let n=t(ue+e,``),r=t(Xe+e,``);M(n.length>0),O(r),A(r),E(``)},[]);(0,Q.useEffect)(()=>{Z(S)},[S,Z]);let re=(0,Q.useMemo)(()=>{let e=S!==b,t=w.trim().length>0,n=D.trim()!==k;return e||t||n||X},[S,b,w,D,k,X]),ie=(0,Q.useCallback)(async()=>{let e=w.trim(),r=D.trim(),i=Y.id;n(qe,i),e.length>0&&n(ue+i,e),n(Xe+i,r);let a=e.length>0?e:t(ue+i,``),o=dr[i];L(!0);try{if(a.length>0){let{response:e}=await st({path:{assistant_id:c},body:{service:i,field:`api_key`,value:a,label:`${Y.displayName} API Key`},throwOnError:!1});if(!e?.ok)throw Error(`Failed to store API key (HTTP ${e?.status??`?`})`)}let e={...S!==b||!x?{provider:i,mode:i===`vellum`?`managed`:`your-own`}:{},...o?{providers:{[i]:{[o]:r}}}:{},...X?{providers:{vellum:{model:U.trim()}}}:{}};if(Object.keys(e).length>0){let{response:t}=await ct({path:{assistant_id:c},body:{services:{tts:e}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`)}return M(a.length>0),A(r),E(``),p.invalidateQueries({queryKey:wt({path:{assistant_id:c}})}),R.success(`Text-to-speech settings saved`),!0}catch(e){return R.error(e instanceof Error?e.message:`Failed to save text-to-speech settings`),!1}finally{L(!1)}},[c,S,U,X,w,D,Y,b,x,p]);(0,Q.useEffect)(()=>{a?.({hasChanges:re,saving:I,save:ie})},[a,re,I,ie]);let ae=(0,Q.useCallback)(()=>{n(ue+S,``),M(!1),E(``)},[S]),oe=(0,Q.useCallback)(async()=>{P(!0);try{let e=t(ue+S,``),n=w.trim(),r=n.length>0?n:e;if(r.length===0){R.error(`Save an API key for this provider before testing.`);return}let i=t(Xe+S,``),a=D.trim(),o=await or({provider:S,apiKey:r,voiceId:a.length>0?a:i,text:`Hey! It's ${l}. How does this sound?`});if(o.kind!==`audio`){R.error(o.message);return}let s=URL.createObjectURL(o.blob);try{let e=new Audio(s);await e.play(),await new Promise(t=>{e.onended=()=>t(),e.onerror=()=>t()})}finally{URL.revokeObjectURL(s)}}finally{P(!1)}},[l,w,S,D]),se=j?`•••••••• (Enter a new key to replace)`:Y.apiKeyPlaceholder,ce=S===`vellum`,le=ce&&Y.supportsVoiceSelection,de=(0,$.jsxs)(s,{variant:`link`,size:`compact`,className:`inline-flex h-auto items-center gap-1 px-0 underline [--vbtn-fg:var(--content-tertiary)]`,onClick:()=>{q(!1),z.some(e=>e.model===U)||W(V||z[0]?.model||``)},children:[(0,$.jsx)(T,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Choose from catalog`]}),fe=le&&te&&z.length>0?de:null;return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(B,{value:S,onChange:C,options:h.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),!ce&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,$.jsx)(F,{type:`password`,value:w,onChange:e=>E(e.target.value),placeholder:se,fullWidth:!0})]}),le&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice`}),te?(0,$.jsx)(F,{type:`text`,value:U,onChange:e=>W(e.target.value),placeholder:`Enter a voice ID`,"aria-label":`Custom voice ID`,fullWidth:!0}):G?(0,$.jsx)(ur,{assistantId:c,value:U,onChange:W}):H&&(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`No managed voices are currently available.`})]}),Y.supportsVoiceSelection&&!ce&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,$.jsx)(F,{type:`text`,value:D,onChange:e=>O(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),!i&&!ce&&(0,$.jsx)(dn,{guide:Y.credentialsGuide}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!ce&&(0,$.jsx)(s,{variant:`outlined`,onClick:oe,disabled:N,children:N?`Testing…`:`Test`}),(0,$.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[fe,!r&&(0,$.jsx)(ln,{onClick:ie,disabled:!re||I}),j&&!ce&&(0,$.jsx)(un,{onClick:ae})]})]})]})}function pr(){return(0,$.jsx)(on,{id:`text-to-speech`,title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,children:(0,$.jsx)(fr,{})})}var mr=`default`;function hr(){let e=Xt(),i=u(),{data:o}=d({...xt({path:{assistant_id:e}}),staleTime:3e4}),s=vt({onSuccess:t=>{Dt(i,{path:{assistant_id:e}},t)}}),c=hn(),l=(0,Q.useMemo)(()=>o?o.services?.[`web-fetch`]?.provider||t(`vellum:ai:webFetchProvider`,mr):t(me,mr),[o]),[f,p]=(0,Q.useState)(!1),[m,h]=gn(l),[g,_]=(0,Q.useState)(``),v=Ae.has(m),{hasStoredCredential:y}=q({assistantId:e,credentialKind:`api_key`,credentialName:m,enabled:v}),b=g.trim().length>0,x=f||v&&!y&&!b||m===l&&!b,S=K(xe[m]??`Enter your API key`,y),C=(0,Q.useCallback)(async()=>{p(!0);let t=g.trim(),r=v&&t.length>0;try{r&&await c(m,t),await s.mutateAsync({path:{assistant_id:e},body:{services:{"web-fetch":{provider:m}}}}).catch(e=>{throw R.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{p(!1);return}p(!1);try{if(n(me,m),r){let r=Pe(m);r&&n(r,t);let a=ze(e,`api_key`,m);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),_(``)}R.success(`Web fetch settings saved.`)}catch(e){a(e,{context:`settings-ai-web-fetch-persist-local`}),R.error(`Saved, but local preferences could not be written.`)}},[v,s,c,i,e,g,m]),w=(0,Q.useCallback)(()=>{let e=Pe(m);e&&r(e),_(``),h(mr),n(me,mr)},[m,h]);return(0,$.jsx)(on,{id:`web-fetch`,title:`Web Fetch`,subtitle:`Configure how your assistant reads individual web pages`,children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(B,{value:m,onChange:h,options:ve.map(e=>({value:e,label:Ke[e]??e}))})]}),v&&(0,$.jsx)(F,{label:`API Key`,type:`password`,value:g,onChange:e=>_(e.target.value),placeholder:S,fullWidth:!0}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(ln,{onClick:C,disabled:x}),f&&(0,$.jsx)(E,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),v&&(0,$.jsx)(un,{onClick:w,filled:!0})]})]})})}var gr=`0.10.12`;function _r(){return et(gr)}function vr(){let e=Xt(),i=u(),o=mt(),{data:s}=d({...xt({path:{assistant_id:e}}),enabled:o,staleTime:3e4}),c=vt({onSuccess:t=>{Dt(i,{path:{assistant_id:e}},t)}}),l=hn(),f=(0,Q.useMemo)(()=>{if(!s)return t(Ye,`inference-provider-native`);let e=s.services?.[`web-search`];return(e?.mode===`managed`&&e?.provider!==`inference-provider-native`?`vellum`:e?.provider)||t(`vellum:ai:webSearchProvider`,`inference-provider-native`)},[s]),[p,m]=(0,Q.useState)(!1),[h,g]=gn(f),[_,v]=(0,Q.useState)(``),y=pe.has(h),{hasStoredCredential:b}=q({assistantId:e,credentialKind:`api_key`,credentialName:h,enabled:y}),x=_.trim().length>0,S=p||y&&!b&&!x||h===f&&!x,C=K(ge[h]??`Enter your API key`,b),w=(0,Q.useCallback)(async()=>{m(!0);let t=_.trim(),r=Ve(h),o=y&&t.length>0;try{o&&await l(h,t),await tt();let n=h===`vellum`?_r()?{provider:`vellum`,mode:`managed`}:{mode:`managed`}:{provider:h,mode:`your-own`};await c.mutateAsync({path:{assistant_id:e},body:{services:{"web-search":n}}}).catch(e=>{throw R.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{m(!1);return}m(!1);try{if(n(Ye,h),o){r&&n(r,t);let a=ze(e,`api_key`,h);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),v(``)}R.success(`Web search settings saved.`)}catch(e){a(e,{context:`settings-ai-web-search-persist-local`}),R.error(`Saved, but local preferences could not be written.`)}},[y,c,l,i,e,_,h]),T=(0,Q.useCallback)(()=>{let e=Ve(h);e&&r(e),v(``),g(`inference-provider-native`),n(Ye,`inference-provider-native`)},[h,g]);return(0,$.jsx)(on,{title:`Web Search`,subtitle:`Configure how your assistant should search the web`,children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(B,{"aria-label":`Web search provider`,value:h,onChange:g,options:He.map(e=>({value:e,label:Ie[e]??e}))})]}),h===`vellum`&&(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Search runs through your Vellum account.`}),y&&(0,$.jsx)(F,{label:`API Key`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:C,fullWidth:!0}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(ln,{onClick:w,disabled:S}),p&&(0,$.jsx)(E,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),y&&(0,$.jsx)(un,{onClick:T,filled:!0})]})]})})}function yr(){let e=Xt(),t=kt(),[n,r]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{let e=window.location.hash.slice(1);e&&requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:`start`})})},[]);let i=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto`,children:[(0,$.jsx)(sn,{}),(0,$.jsx)(Vn,{panel:n,onOpenPanel:r,onClosePanel:()=>r(null)}),(0,$.jsx)(vr,{}),(0,$.jsx)(hr,{}),(0,$.jsx)(mn,{}),(0,$.jsx)(bn,{}),(0,$.jsx)(pr,{}),(0,$.jsx)(ar,{})]}),a=`${e??`none`}:${n?.kind===`profile`?`profile:${n.name}`:n?.kind===`provider`?`provider:${n.name}`:n?.kind??`closed`}`,o=n?.kind===`provider`||n?.kind===`add-provider`,s=n!=null&&e?n.kind===`overrides`?(0,$.jsx)(Zn,{assistantId:e,onClose:()=>r(null)},a):o?(0,$.jsx)($n,{assistantId:e,connectionName:n.kind===`provider`?n.name:null,onClose:()=>r(null)},a):(0,$.jsx)(Un,{assistantId:e,profileName:n.kind===`profile`?n.name:null,onClose:()=>r(null)},a):null;return s&&t?(0,$.jsx)($t,{children:s}):s?(0,$.jsx)(en,{storageKey:`aiSettingsDetailDrawerWidth`,detailKey:a,section:i,detail:s}):i}export{yr as AiPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BwFudwM5.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./input-CgGeKtja.js";import{t as s}from"./dropdown-CJVkL1Yp.js";import{t as c}from"./is-electron-DIlIrdJX.js";import{d as l}from"./routes-DrfnNoYS.js";import{t as u}from"./onboarding-layout-CNKJRWfe.js";import{a as d,c as f,i as p,o as m,r as h,s as g}from"./provider-key-BZOwvE14.js";import"./onboarding-step-layout-Bsc_5btV.js";var _=e(t(),1),v=a();function y(){let e=i(),[t]=r(),a=t.get(`hosting`),y=c(),b=h(),[x,S]=(0,_.useState)(()=>b?.provider??d.id),[C,w]=(0,_.useState)(()=>b?.key??``),[T,E]=(0,_.useState)(()=>b?.model??g(b?.provider??d.id)??``),[D,O]=(0,_.useState)(()=>b?.baseUrl??``),[k,A]=(0,_.useState)(()=>b?.customModels??``),j=f(x)??d,M=j.models??[],N=j.requiresKey,P=M.length>0,F=x===`openai-compatible`,I=(!(N&&!F)||C.trim().length>0)&&(!P||T.trim().length>0)&&(!F||D.trim().length>0&&k.trim().length>0);return(0,v.jsx)(u,{children:(0,v.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${y?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,v.jsx)(`h1`,{className:y?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,v.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${y?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose the model provider your assistant should use.`}),(0,v.jsxs)(`div`,{className:`flex w-full flex-col gap-4 ${y?`mt-8`:`mt-10`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,v.jsx)(s,{"aria-label":`Provider`,value:x,onChange:e=>{let t=f(e);t&&(S(t.id),w(``),E(g(t.id)??``))},options:m.map(e=>({value:e.id,label:e.displayName}))})]}),M.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,v.jsx)(s,{"aria-label":`Model`,value:T,onChange:E,options:M.map(e=>({value:e.id,label:e.displayName}))})]}),F&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,v.jsx)(o,{type:`text`,placeholder:`http://localhost:1234/v1`,value:D,onChange:e=>O(e.target.value),fullWidth:!0})]}),(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,v.jsx)(o,{type:`text`,placeholder:`model-1, model-2`,value:k,onChange:e=>A(e.target.value),fullWidth:!0}),(0,v.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),N&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(o,{type:`password`,label:`${j.displayName} API Key`,placeholder:j.apiKeyPlaceholder??`Enter your API key`,value:C,onChange:e=>w(e.target.value),className:`touch-mobile:text-[16px]`,fullWidth:!0}),j.docsUrl&&(0,v.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,v.jsx)(`a`,{href:j.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,v.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${y?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,v.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!I,onClick:()=>{if(!I)return;let t=T.trim()||g(x);p({provider:x,key:C.trim(),...t?{model:t}:{},...F?{baseUrl:D.trim(),customModels:k.trim()}:{}}),e(a?`${l.onboarding.privacy}?hosting=${a}`:l.onboarding.privacy)},className:y?void 0:`h-11 text-base`,children:`Continue`}),(0,v.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(l.onboarding.hosting)},className:y?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{y as ApiKeyScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-fyWSnR9X.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./input-B_e9sgY6.js";import{t as s}from"./dropdown-CFMXaweg.js";import{t as c}from"./is-electron-DIlIrdJX.js";import{d as l}from"./routes-DrfnNoYS.js";import{t as u}from"./onboarding-layout-Q6fY5uKC.js";import{a as d,c as f,i as p,o as m,r as h,s as g}from"./provider-key-CDZ6oRMw.js";import"./onboarding-step-layout-SPx-6i03.js";var _=e(t(),1),v=a();function y(){let e=i(),[t]=r(),a=t.get(`hosting`),y=c(),b=h(),[x,S]=(0,_.useState)(()=>b?.provider??d.id),[C,w]=(0,_.useState)(()=>b?.key??``),[T,E]=(0,_.useState)(()=>b?.model??g(b?.provider??d.id)??``),[D,O]=(0,_.useState)(()=>b?.baseUrl??``),[k,A]=(0,_.useState)(()=>b?.customModels??``),j=f(x)??d,M=j.models??[],N=j.requiresKey,P=M.length>0,F=x===`openai-compatible`,I=(!(N&&!F)||C.trim().length>0)&&(!P||T.trim().length>0)&&(!F||D.trim().length>0&&k.trim().length>0);return(0,v.jsx)(u,{children:(0,v.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${y?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,v.jsx)(`h1`,{className:y?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,v.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${y?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose the model provider your assistant should use.`}),(0,v.jsxs)(`div`,{className:`flex w-full flex-col gap-4 ${y?`mt-8`:`mt-10`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,v.jsx)(s,{"aria-label":`Provider`,value:x,onChange:e=>{let t=f(e);t&&(S(t.id),w(``),E(g(t.id)??``))},options:m.map(e=>({value:e.id,label:e.displayName}))})]}),M.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,v.jsx)(s,{"aria-label":`Model`,value:T,onChange:E,options:M.map(e=>({value:e.id,label:e.displayName}))})]}),F&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,v.jsx)(o,{type:`text`,placeholder:`http://localhost:1234/v1`,value:D,onChange:e=>O(e.target.value),fullWidth:!0})]}),(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,v.jsx)(o,{type:`text`,placeholder:`model-1, model-2`,value:k,onChange:e=>A(e.target.value),fullWidth:!0}),(0,v.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),N&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(o,{type:`password`,label:`${j.displayName} API Key`,placeholder:j.apiKeyPlaceholder??`Enter your API key`,value:C,onChange:e=>w(e.target.value),className:`touch-mobile:text-[16px]`,fullWidth:!0}),j.docsUrl&&(0,v.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,v.jsx)(`a`,{href:j.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,v.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${y?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,v.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!I,onClick:()=>{if(!I)return;let t=T.trim()||g(x);p({provider:x,key:C.trim(),...t?{model:t}:{},...F?{baseUrl:D.trim(),customModels:k.trim()}:{}}),e(a?`${l.onboarding.privacy}?hosting=${a}`:l.onboarding.privacy)},className:y?void 0:`h-11 text-base`,children:`Continue`}),(0,v.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(l.onboarding.hosting)},className:y?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{y as ApiKeyScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BwFudwM5.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./cn-CJf7MmLX.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import"./src-BRrY4KrY.js";import{t as s}from"./external-link-GPGZ1LGU.js";import{t as c}from"./puzzle-4NgH5snP.js";import{n as l}from"./toast-BHjG1kP8.js";import{t as u}from"./confirm-dialog-B7WBNDbT.js";import{n as d,t as f}from"./create-selectors-BfxF8Sx_.js";import{t as p}from"./sdk.gen-CjtCuSlS.js";import{i as m}from"./typed-storage-OO7emDaU.js";import{n as h}from"./react-query.gen-C7om930f.js";import{a as g}from"./viewer-store-DqSkyuY9.js";import{t as _}from"./haptics-C4p_Rjba.js";import{t as v}from"./pointer-CQ4DXHXb.js";import{t as y}from"./misc-BBsGq1IU.js";import{t as b}from"./edge-swipe-arbiter-store-BwC23ScO.js";import{i as x}from"./sandbox-bridge-B5H4c27m.js";var S=o(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),C=o(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),w=e(t(),1),T=36,E=.8,D=8,O=.35;function k({enabled:e,leadingActions:t,trailingActions:n}){let r=(t?.length??0)*72,i=(n?.length??0)*72,[a,o]=(0,w.useState)(0),[s,c]=(0,w.useState)(!1),[l,u]=(0,w.useState)(`none`),d=b.use.registerOpenRow(),f=b.use.unregisterOpenRow();(0,w.useEffect)(()=>{if(l!==`none`)return d(),f},[l,d,f]);let p=(0,w.useRef)(null),m=(0,w.useCallback)(()=>{p.current=null,c(!1),o(0)},[]),h=(0,w.useCallback)(()=>{o(0),u(`none`)},[]);return{offset:a,isDragging:s,revealedSide:l,leadingWidth:r,trailingWidth:i,onTouchStart:(0,w.useCallback)(r=>{if(!e||!t&&!n)return;if(r.touches.length!==1){m();return}let i=r.touches[0];p.current={touchId:i.identifier,startX:i.clientX,startY:i.clientY,axis:`undecided`,lastDx:0,startOffset:a}},[e,t,n,a,m]),onTouchMove:(0,w.useCallback)(e=>{let t=p.current;if(!t)return;if(e.touches.length!==1){m();return}let n=e.touches[0];if(n.identifier!==t.touchId)return;let a=n.clientX-t.startX,s=n.clientY-t.startY;if(t.lastDx=a,t.axis===`undecided`){if(Math.abs(a)<D&&Math.abs(s)<D)return;if(Math.abs(s)>Math.abs(a)*E){p.current=null;return}t.axis=`horizontal`,c(!0)}if(t.axis!==`horizontal`)return;if(Math.abs(a)<T&&Math.abs(s)>Math.abs(a)*E){m(),o(t.startOffset);return}let l=t.startOffset+a,u=r,d=-i;l>u?l=u+(l-u)*O:l<d&&(l=d+(l-d)*O),(t.startOffset>0&&l<0&&i===0||t.startOffset<0&&l>0&&r===0)&&(l*=O),o(l)},[r,i,m]),onTouchEnd:(0,w.useCallback)(e=>{let t=p.current;if(!t){m();return}if(t.axis===`undecided`){p.current=null,c(!1);return}if(t.axis!==`horizontal`){m();return}if(e.touches.length>0){m();return}let n=Array.from(e.changedTouches).find(e=>e.identifier===t.touchId),a=n?n.clientX-t.startX:t.lastDx,s=t.startOffset+a;s<=-T&&i>0?(_.light(),o(-i),u(`trailing`)):s>=T&&r>0?(_.light(),o(r),u(`leading`)):(o(0),u(`none`)),p.current=null,c(!1)},[r,i,m]),onTouchCancel:(0,w.useCallback)(()=>{h(),m()},[h,m]),close:h}}var A=i();function j({action:e,onAfterSelect:t,hidden:n=!1}){let r=(0,w.useCallback)(()=>{e.onSelect(),t()},[e,t]),i=e.icon;return(0,A.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-hidden":n,tabIndex:n?-1:0,onClick:r,className:a(`flex shrink-0 flex-col items-center justify-center gap-1`,`touch-mobile:transition-none`),style:{width:72,color:e.variant===`destructive`?`var(--aux-white)`:`var(--content-inset)`,background:e.variant===`destructive`?`var(--system-negative-strong)`:`var(--primary-base)`},children:[(0,A.jsx)(i,{size:18}),(0,A.jsx)(`span`,{className:`text-[10px] font-medium leading-none`,children:e.label})]})}var M=(0,w.forwardRef)(function({children:e,leadingActions:t,trailingActions:n,enabled:r=v(),className:i,style:o,...s},c){let l=r&&((t?.length??0)>0||(n?.length??0)>0),{offset:u,isDragging:d,onTouchStart:f,onTouchMove:p,onTouchEnd:m,onTouchCancel:h,close:g}=k({enabled:l,leadingActions:t,trailingActions:n});return l?(0,A.jsxs)(`div`,{ref:c,className:a(`relative overflow-hidden`,i),...s,style:{...o,touchAction:`pan-y`},onTouchStart:f,onTouchMove:p,onTouchEnd:m,onTouchCancel:h,children:[n&&n.length>0?(0,A.jsx)(`div`,{className:`absolute inset-y-0 right-0 flex`,"aria-hidden":u>=0,style:u>=0?{pointerEvents:`none`}:void 0,children:n.map(e=>(0,A.jsx)(j,{action:e,onAfterSelect:g,hidden:u>=0},e.id))}):null,t&&t.length>0?(0,A.jsx)(`div`,{className:`absolute inset-y-0 left-0 flex`,"aria-hidden":u<=0,style:u<=0?{pointerEvents:`none`}:void 0,children:t.map(e=>(0,A.jsx)(j,{action:e,onAfterSelect:g,hidden:u<=0},e.id))}):null,(0,A.jsx)(`div`,{className:a(`relative bg-[var(--surface-overlay)] transition-transform`,d&&`transition-none`),style:{transform:`translateX(${u}px)`,zIndex:1},children:e})]}):(0,A.jsx)(`div`,{ref:c,className:i,style:o,...s,children:e})});function N(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.appId==`string`&&typeof t.pinnedOrder==`number`&&Number.isFinite(t.pinnedOrder)&&typeof t.name==`string`&&(t.icon===void 0||typeof t.icon==`string`)}function P(e){let t=JSON.parse(e);return Array.isArray(t)?t.filter(N):null}var F=m({key:`vellum:pinnedApps`,scope:`user`,parse:P,serialize:JSON.stringify,fallback:[]}),I=F.load;F.save;function L(e){let t=F.load();if(t.some(t=>t.appId===e.id))return;let n=t.reduce((e,t)=>Math.max(e,t.pinnedOrder),0);F.save([...t,{appId:e.id,pinnedOrder:n+1,name:e.name,icon:e.icon}])}function R(e){let t=F.load().filter(t=>t.appId!==e);t=t.sort((e,t)=>e.pinnedOrder-t.pinnedOrder).map((e,t)=>({...e,pinnedOrder:t+1})),F.save(t)}var z=new Set;function B(){let e=I();return{pinnedApps:e,pinnedAppIds:new Set(e.map(e=>e.appId))}}var V=f(d()((e,t)=>({...B(),togglePin:n=>{t().pinnedAppIds.has(n.id)?t().unpin(n.id):(L(n),e(B()))},unpin:n=>{if(t().pinnedAppIds.has(n)){R(n),e(B());for(let e of z)e(n)}},isPinned:e=>t().pinnedAppIds.has(e),onUnpin:e=>(z.add(e),()=>{z.delete(e)})})));function H({app:e,isDeleting:t,onConfirm:n,onCancel:r}){return(0,A.jsx)(u,{open:e!==null,title:`Delete app`,message:e?`"${e.name}" will be permanently removed.`:``,confirmLabel:t?`Deleting…`:`Delete`,destructive:!0,onConfirm:n,onCancel:r})}function U(e){let t=r(),n=V.use.togglePin(),i=V.use.pinnedAppIds(),[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(!1);return{pendingDelete:a,isDeleting:s,requestDelete:o,confirmDelete:(0,w.useCallback)(async()=>{if(!(!a||s)){c(!0);try{await p({path:{assistant_id:e,id:a.id},throwOnError:!0}),g(e,a.id),t.invalidateQueries({queryKey:h({path:{assistant_id:e}})}),i.has(a.id)&&n(a),o(null)}catch(e){l.error(e instanceof Error?e.message:`Failed to delete app`)}finally{c(!1)}}},[a,s,e,i,n,t]),cancelDelete:(0,w.useCallback)(()=>{s||o(null)},[s])}}function W({name:e,description:t,icon:r,loadHtml:i,isPinned:a=!1,isLoading:o=!1,isOpenDisabled:c=!1,isPreviewPending:l=!1,onOpen:u,onPin:d}){return(0,A.jsxs)(`div`,{className:y(`flex flex-col gap-2 rounded-xl border border-[var(--border-base)]`,`bg-[var(--surface-lift)] p-3`),children:[(0,A.jsx)(G,{name:e,icon:r,loadHtml:l?void 0:i,isLoading:o,isPreviewPending:l}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-0.5`,children:[(0,A.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:[r?(0,A.jsx)(`span`,{"aria-hidden":!0,className:`leading-none`,children:r}):null,(0,A.jsx)(`span`,{className:`truncate`,children:e})]}),t?(0,A.jsx)(`span`,{className:`truncate text-body-medium-default text-[color:var(--content-secondary)]`,children:t}):null]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 px-0.5`,children:[(0,A.jsx)(n,{variant:`primary`,leftIcon:(0,A.jsx)(s,{}),onClick:u,disabled:c||u==null,children:`Open App`}),(0,A.jsx)(n,{variant:`outlined`,leftIcon:a?(0,A.jsx)(S,{}):(0,A.jsx)(C,{}),onClick:d,disabled:d==null,children:a?`Unpin`:`Pin`})]})]})}function G({name:e,icon:t,loadHtml:n,isLoading:r=!1,isPreviewPending:i=!1,className:a}){let o=(0,w.useRef)(null),[s,l]=(0,w.useState)(null),[u,d]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{if(n==null)return;let e=o.current;if(!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(([e])=>{e?.isIntersecting&&(d(!0),t.disconnect())},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[n]),(0,w.useEffect)(()=>{if(!u||n==null)return;let e=!1;return n().then(t=>{e||l(t)}).catch(()=>{}),()=>{e=!0}},[u,n]),(0,A.jsxs)(`div`,{ref:o,className:y(`relative aspect-[16/10] w-full overflow-hidden rounded-lg`,`border border-[var(--border-base)] bg-[var(--surface-base)]`,a),children:[(0,A.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:i?null:t?(0,A.jsx)(`span`,{className:`text-4xl`,children:t}):(0,A.jsx)(c,{size:32,className:`text-[var(--content-tertiary)]`})}),s!=null&&(0,A.jsx)(`iframe`,{srcDoc:x(s),sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,title:`${e} preview`,"aria-hidden":`true`,tabIndex:-1,loading:`lazy`,scrolling:`no`,className:`absolute left-0 top-0 border-none bg-[var(--surface-base)]`,style:{width:`200%`,height:`200%`,transform:`scale(0.5)`,transformOrigin:`top left`,pointerEvents:`none`}}),r&&(0,A.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-[var(--surface-base)]/60 backdrop-blur-sm`,children:(0,A.jsx)(`div`,{className:`h-5 w-5 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--primary-base)]`})})]})}export{V as a,S as c,H as i,G as n,M as o,U as r,C as s,W as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-fyWSnR9X.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./cn-CJf7MmLX.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import"./src-Co3nj9N_.js";import{t as s}from"./external-link-GPGZ1LGU.js";import{t as c}from"./puzzle-4NgH5snP.js";import{n as l}from"./toast-elfTwkN2.js";import{t as u}from"./confirm-dialog-CQpZ7dEA.js";import{n as d,t as f}from"./create-selectors-BfxF8Sx_.js";import{t as p}from"./sdk.gen-CjtCuSlS.js";import{i as m}from"./typed-storage-OO7emDaU.js";import{n as h}from"./react-query.gen-C7om930f.js";import{a as g}from"./viewer-store-Dc5epEgj.js";import{t as _}from"./haptics-C4TWR9vG.js";import{t as v}from"./pointer-CQ4DXHXb.js";import{t as y}from"./misc-BBsGq1IU.js";import{t as b}from"./edge-swipe-arbiter-store-BwC23ScO.js";import{i as x}from"./sandbox-bridge-B5H4c27m.js";var S=o(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),C=o(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),w=e(t(),1),T=36,E=.8,D=8,O=.35;function k({enabled:e,leadingActions:t,trailingActions:n}){let r=(t?.length??0)*72,i=(n?.length??0)*72,[a,o]=(0,w.useState)(0),[s,c]=(0,w.useState)(!1),[l,u]=(0,w.useState)(`none`),d=b.use.registerOpenRow(),f=b.use.unregisterOpenRow();(0,w.useEffect)(()=>{if(l!==`none`)return d(),f},[l,d,f]);let p=(0,w.useRef)(null),m=(0,w.useCallback)(()=>{p.current=null,c(!1),o(0)},[]),h=(0,w.useCallback)(()=>{o(0),u(`none`)},[]);return{offset:a,isDragging:s,revealedSide:l,leadingWidth:r,trailingWidth:i,onTouchStart:(0,w.useCallback)(r=>{if(!e||!t&&!n)return;if(r.touches.length!==1){m();return}let i=r.touches[0];p.current={touchId:i.identifier,startX:i.clientX,startY:i.clientY,axis:`undecided`,lastDx:0,startOffset:a}},[e,t,n,a,m]),onTouchMove:(0,w.useCallback)(e=>{let t=p.current;if(!t)return;if(e.touches.length!==1){m();return}let n=e.touches[0];if(n.identifier!==t.touchId)return;let a=n.clientX-t.startX,s=n.clientY-t.startY;if(t.lastDx=a,t.axis===`undecided`){if(Math.abs(a)<D&&Math.abs(s)<D)return;if(Math.abs(s)>Math.abs(a)*E){p.current=null;return}t.axis=`horizontal`,c(!0)}if(t.axis!==`horizontal`)return;if(Math.abs(a)<T&&Math.abs(s)>Math.abs(a)*E){m(),o(t.startOffset);return}let l=t.startOffset+a,u=r,d=-i;l>u?l=u+(l-u)*O:l<d&&(l=d+(l-d)*O),(t.startOffset>0&&l<0&&i===0||t.startOffset<0&&l>0&&r===0)&&(l*=O),o(l)},[r,i,m]),onTouchEnd:(0,w.useCallback)(e=>{let t=p.current;if(!t){m();return}if(t.axis===`undecided`){p.current=null,c(!1);return}if(t.axis!==`horizontal`){m();return}if(e.touches.length>0){m();return}let n=Array.from(e.changedTouches).find(e=>e.identifier===t.touchId),a=n?n.clientX-t.startX:t.lastDx,s=t.startOffset+a;s<=-T&&i>0?(_.light(),o(-i),u(`trailing`)):s>=T&&r>0?(_.light(),o(r),u(`leading`)):(o(0),u(`none`)),p.current=null,c(!1)},[r,i,m]),onTouchCancel:(0,w.useCallback)(()=>{h(),m()},[h,m]),close:h}}var A=i();function j({action:e,onAfterSelect:t,hidden:n=!1}){let r=(0,w.useCallback)(()=>{e.onSelect(),t()},[e,t]),i=e.icon;return(0,A.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-hidden":n,tabIndex:n?-1:0,onClick:r,className:a(`flex shrink-0 flex-col items-center justify-center gap-1`,`touch-mobile:transition-none`),style:{width:72,color:e.variant===`destructive`?`var(--aux-white)`:`var(--content-inset)`,background:e.variant===`destructive`?`var(--system-negative-strong)`:`var(--primary-base)`},children:[(0,A.jsx)(i,{size:18}),(0,A.jsx)(`span`,{className:`text-[10px] font-medium leading-none`,children:e.label})]})}var M=(0,w.forwardRef)(function({children:e,leadingActions:t,trailingActions:n,enabled:r=v(),className:i,style:o,...s},c){let l=r&&((t?.length??0)>0||(n?.length??0)>0),{offset:u,isDragging:d,onTouchStart:f,onTouchMove:p,onTouchEnd:m,onTouchCancel:h,close:g}=k({enabled:l,leadingActions:t,trailingActions:n});return l?(0,A.jsxs)(`div`,{ref:c,className:a(`relative overflow-hidden`,i),...s,style:{...o,touchAction:`pan-y`},onTouchStart:f,onTouchMove:p,onTouchEnd:m,onTouchCancel:h,children:[n&&n.length>0?(0,A.jsx)(`div`,{className:`absolute inset-y-0 right-0 flex`,"aria-hidden":u>=0,style:u>=0?{pointerEvents:`none`}:void 0,children:n.map(e=>(0,A.jsx)(j,{action:e,onAfterSelect:g,hidden:u>=0},e.id))}):null,t&&t.length>0?(0,A.jsx)(`div`,{className:`absolute inset-y-0 left-0 flex`,"aria-hidden":u<=0,style:u<=0?{pointerEvents:`none`}:void 0,children:t.map(e=>(0,A.jsx)(j,{action:e,onAfterSelect:g,hidden:u<=0},e.id))}):null,(0,A.jsx)(`div`,{className:a(`relative bg-[var(--surface-overlay)] transition-transform`,d&&`transition-none`),style:{transform:`translateX(${u}px)`,zIndex:1},children:e})]}):(0,A.jsx)(`div`,{ref:c,className:i,style:o,...s,children:e})});function N(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.appId==`string`&&typeof t.pinnedOrder==`number`&&Number.isFinite(t.pinnedOrder)&&typeof t.name==`string`&&(t.icon===void 0||typeof t.icon==`string`)}function P(e){let t=JSON.parse(e);return Array.isArray(t)?t.filter(N):null}var F=m({key:`vellum:pinnedApps`,scope:`user`,parse:P,serialize:JSON.stringify,fallback:[]}),I=F.load;F.save;function L(e){let t=F.load();if(t.some(t=>t.appId===e.id))return;let n=t.reduce((e,t)=>Math.max(e,t.pinnedOrder),0);F.save([...t,{appId:e.id,pinnedOrder:n+1,name:e.name,icon:e.icon}])}function R(e){let t=F.load().filter(t=>t.appId!==e);t=t.sort((e,t)=>e.pinnedOrder-t.pinnedOrder).map((e,t)=>({...e,pinnedOrder:t+1})),F.save(t)}var z=new Set;function B(){let e=I();return{pinnedApps:e,pinnedAppIds:new Set(e.map(e=>e.appId))}}var V=f(d()((e,t)=>({...B(),togglePin:n=>{t().pinnedAppIds.has(n.id)?t().unpin(n.id):(L(n),e(B()))},unpin:n=>{if(t().pinnedAppIds.has(n)){R(n),e(B());for(let e of z)e(n)}},isPinned:e=>t().pinnedAppIds.has(e),onUnpin:e=>(z.add(e),()=>{z.delete(e)})})));function H({app:e,isDeleting:t,onConfirm:n,onCancel:r}){return(0,A.jsx)(u,{open:e!==null,title:`Delete app`,message:e?`"${e.name}" will be permanently removed.`:``,confirmLabel:t?`Deleting…`:`Delete`,destructive:!0,onConfirm:n,onCancel:r})}function U(e){let t=r(),n=V.use.togglePin(),i=V.use.pinnedAppIds(),[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(!1);return{pendingDelete:a,isDeleting:s,requestDelete:o,confirmDelete:(0,w.useCallback)(async()=>{if(!(!a||s)){c(!0);try{await p({path:{assistant_id:e,id:a.id},throwOnError:!0}),g(e,a.id),t.invalidateQueries({queryKey:h({path:{assistant_id:e}})}),i.has(a.id)&&n(a),o(null)}catch(e){l.error(e instanceof Error?e.message:`Failed to delete app`)}finally{c(!1)}}},[a,s,e,i,n,t]),cancelDelete:(0,w.useCallback)(()=>{s||o(null)},[s])}}function W({name:e,description:t,icon:r,loadHtml:i,isPinned:a=!1,isLoading:o=!1,isOpenDisabled:c=!1,isPreviewPending:l=!1,onOpen:u,onPin:d}){return(0,A.jsxs)(`div`,{className:y(`flex flex-col gap-2 rounded-xl border border-[var(--border-base)]`,`bg-[var(--surface-lift)] p-3`),children:[(0,A.jsx)(G,{name:e,icon:r,loadHtml:l?void 0:i,isLoading:o,isPreviewPending:l}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-0.5`,children:[(0,A.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:[r?(0,A.jsx)(`span`,{"aria-hidden":!0,className:`leading-none`,children:r}):null,(0,A.jsx)(`span`,{className:`truncate`,children:e})]}),t?(0,A.jsx)(`span`,{className:`truncate text-body-medium-default text-[color:var(--content-secondary)]`,children:t}):null]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 px-0.5`,children:[(0,A.jsx)(n,{variant:`primary`,leftIcon:(0,A.jsx)(s,{}),onClick:u,disabled:c||u==null,children:`Open App`}),(0,A.jsx)(n,{variant:`outlined`,leftIcon:a?(0,A.jsx)(S,{}):(0,A.jsx)(C,{}),onClick:d,disabled:d==null,children:a?`Unpin`:`Pin`})]})]})}function G({name:e,icon:t,loadHtml:n,isLoading:r=!1,isPreviewPending:i=!1,className:a}){let o=(0,w.useRef)(null),[s,l]=(0,w.useState)(null),[u,d]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{if(n==null)return;let e=o.current;if(!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(([e])=>{e?.isIntersecting&&(d(!0),t.disconnect())},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[n]),(0,w.useEffect)(()=>{if(!u||n==null)return;let e=!1;return n().then(t=>{e||l(t)}).catch(()=>{}),()=>{e=!0}},[u,n]),(0,A.jsxs)(`div`,{ref:o,className:y(`relative aspect-[16/10] w-full overflow-hidden rounded-lg`,`border border-[var(--border-base)] bg-[var(--surface-base)]`,a),children:[(0,A.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:i?null:t?(0,A.jsx)(`span`,{className:`text-4xl`,children:t}):(0,A.jsx)(c,{size:32,className:`text-[var(--content-tertiary)]`})}),s!=null&&(0,A.jsx)(`iframe`,{srcDoc:x(s),sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,title:`${e} preview`,"aria-hidden":`true`,tabIndex:-1,loading:`lazy`,scrolling:`no`,className:`absolute left-0 top-0 border-none bg-[var(--surface-base)]`,style:{width:`200%`,height:`200%`,transform:`scale(0.5)`,transformOrigin:`top left`,pointerEvents:`none`}}),r&&(0,A.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-[var(--surface-base)]/60 backdrop-blur-sm`,children:(0,A.jsx)(`div`,{className:`h-5 w-5 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--primary-base)]`})})]})}export{V as a,S as c,H as i,G as n,M as o,U as r,C as s,W as t};
@@ -1 +1 @@
1
- import{n as e}from"./toast-BHjG1kP8.js";import{n as t,t as n}from"./create-selectors-BfxF8Sx_.js";import{c as r,n as i,s as a,t as o,u as s}from"./feature-flag-catalog-CpyCubJW.js";import{h as c}from"./sdk.gen-BpJ1vF7l.js";var l={...o},u={...i},d=0,f={};function p(e={}){l={...o,...e};for(let e of Object.keys(f))delete f[e]}function m(e={}){u={...i,...e}}function h(){p(),m()}var g=a(`assistant`);function _(e){return l[e]??o[e]??!1}function v(e){return u[e]??i[e]??``}var y=n(t()(t=>{let n=t;return{...o,...g.bool,hasHydrated:!1,stringFlags:{...i,...g.str},setFlags:e=>t(t=>{p(e);let n={...e,...g.bool};return Object.keys(n).some(e=>n[e]!==t[e])?n:t}),setFlag:(n,i,a)=>{let o=++d,u=()=>{if(f[n]!==o)return;delete f[n];let a=_(n);t(e=>e[n]===i?{[n]:a}:e),e.error(`Couldn't update "${r(n)?.label??n}" — change reverted.`)},p=s(n);!a||!p||(f[n]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(l[n]=i,f[n]===o&&delete f[n]):u()}).catch(u),t({[n]:g.bool[n]??i}))},markHydrated:()=>t({hasHydrated:!0}),resetForAssistantSwitch:()=>{h(),t({...o,...g.bool,hasHydrated:!1}),n({stringFlags:{...i,...g.str}})},setStringFlags:e=>n(t=>{m(e);let n={...e,...g.str},r=t.stringFlags;return Object.keys(n).some(e=>n[e]!==r[e])?{stringFlags:n}:t}),setStringFlag:(t,i,a)=>{let o=++d,l=()=>{if(f[t]!==o)return;delete f[t];let a=v(t);n(e=>e.stringFlags[t]===i?{stringFlags:{...e.stringFlags,[t]:a}}:e),e.error(`Couldn't update "${r(t)?.label??t}" — change reverted.`)},p=s(t);!a||!p||(f[t]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(u[t]=i,f[t]===o&&delete f[t]):l()}).catch(l),n(e=>({stringFlags:{...e.stringFlags,[t]:g.str[t]??i}})))}}}));export{y as t};
1
+ import{n as e}from"./toast-elfTwkN2.js";import{n as t,t as n}from"./create-selectors-BfxF8Sx_.js";import{c as r,n as i,s as a,t as o,u as s}from"./feature-flag-catalog-CpyCubJW.js";import{h as c}from"./sdk.gen-BpJ1vF7l.js";var l={...o},u={...i},d=0,f={};function p(e={}){l={...o,...e};for(let e of Object.keys(f))delete f[e]}function m(e={}){u={...i,...e}}function h(){p(),m()}var g=a(`assistant`);function _(e){return l[e]??o[e]??!1}function v(e){return u[e]??i[e]??``}var y=n(t()(t=>{let n=t;return{...o,...g.bool,hasHydrated:!1,stringFlags:{...i,...g.str},setFlags:e=>t(t=>{p(e);let n={...e,...g.bool};return Object.keys(n).some(e=>n[e]!==t[e])?n:t}),setFlag:(n,i,a)=>{let o=++d,u=()=>{if(f[n]!==o)return;delete f[n];let a=_(n);t(e=>e[n]===i?{[n]:a}:e),e.error(`Couldn't update "${r(n)?.label??n}" — change reverted.`)},p=s(n);!a||!p||(f[n]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(l[n]=i,f[n]===o&&delete f[n]):u()}).catch(u),t({[n]:g.bool[n]??i}))},markHydrated:()=>t({hasHydrated:!0}),resetForAssistantSwitch:()=>{h(),t({...o,...g.bool,hasHydrated:!1}),n({stringFlags:{...i,...g.str}})},setStringFlags:e=>n(t=>{m(e);let n={...e,...g.str},r=t.stringFlags;return Object.keys(n).some(e=>n[e]!==r[e])?{stringFlags:n}:t}),setStringFlag:(t,i,a)=>{let o=++d,l=()=>{if(f[t]!==o)return;delete f[t];let a=v(t);n(e=>e.stringFlags[t]===i?{stringFlags:{...e.stringFlags,[t]:a}}:e),e.error(`Couldn't update "${r(t)?.label??t}" — change reverted.`)},p=s(t);!a||!p||(f[t]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(u[t]=i,f[t]===o&&delete f[t]):l()}).catch(l),n(e=>({stringFlags:{...e.stringFlags,[t]:g.str[t]??i}})))}}}));export{y as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{n as t,t as n}from"./capture-error-CqtAGHQu.js";import{t as r}from"./react-BFJW0bSv.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import"./src-BRrY4KrY.js";import{t as o}from"./loader-circle-DWWXcfTQ.js";import"./tag-G0ELn_cq.js";import{n as s}from"./toast-BHjG1kP8.js";import"./auth-store-C9aYqB9U.js";import{a as c,r as l}from"./api-CGsj1Pig.js";import{t as u}from"./assistant-feature-flag-store-BojuHxUH.js";import{t as d}from"./use-active-assistant-id-JLsAfn3e.js";import"./environment-store-DxX3xxt2.js";var f=e(r(),1),p=a();function m({value:e,max:t,caption:n}){let r=t>0?Math.max(0,Math.min(e/t*100,100)):0,i=r>90;return(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-[var(--surface-active)]`,children:(0,p.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-200`,style:{width:`${r}%`,backgroundColor:i?`var(--system-negative-strong)`:`var(--system-positive-strong)`}})}),n&&(0,p.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:n})]})}var h=7,g=2e3;function _(e){let t=(0,f.useRef)(0),n=(0,f.useRef)(null),[r,i]=(0,f.useState)(null),a=(0,f.useCallback)(()=>{if(t.current+=1,t.current>=h){t.current=0;let r=u.getState(),a=!r.settingsDeveloperNav;r.setFlag(`settingsDeveloperNav`,a,e),i(a?`Developer mode enabled`:`Developer mode disabled`),n.current!==null&&clearTimeout(n.current),n.current=setTimeout(()=>{i(null),n.current=null},g)}},[e]);return(0,f.useEffect)(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{onTap:a,message:r}}function v({version:e,loading:t,assistantId:n}){let{onTap:r,message:i}=_(n);return t?(0,p.jsxs)(`span`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,p.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading version...`]}):e?(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`button`,{type:`button`,className:`break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:r,children:e}),i&&(0,p.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:i})]}):(0,p.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`—`})}var y=`currentAssistant`,b=4e3,x=9e4;function S(e,t){return(e.memory?.maxMb??null)!==(t.memory?.maxMb??null)||(e.cpu?.maxCores??null)!==(t.cpu?.maxCores??null)}function C(){let e=d(),{data:r=null,isLoading:a,refetch:o}=i({queryKey:[y,e],queryFn:async()=>{let t=await l(e);return t.ok?t.data:null},retry:!1}),u=r?.id,[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),C=(0,f.useRef)(0),w=(0,f.useRef)(0),T=(0,f.useCallback)(async e=>{if(!u)return m(null),g(!1),null;C.current+=1;let r=C.current;g(!0);try{let t=await c(u);return r===C.current?t.ok?(m(t.data),t.data):(e?.keepStaleOnError||m(null),null):null}catch(i){return r===C.current?(e?.keepStaleOnError||m(null),!t(i)&&!e?.keepStaleOnError&&(n(i,{context:`fetch_assistant_healthz`}),s.error(`Failed to load assistant info`)),null):null}finally{r===C.current&&g(!1)}},[u]);return(0,f.useEffect)(()=>{T()},[T]),(0,f.useEffect)(()=>()=>{w.current+=1,v(!1),m(null)},[u]),{assistant:r,assistantLoading:a,healthz:p,healthzLoading:h,healthzPolling:_,refetch:(0,f.useCallback)(async()=>{await o(),await T()},[o,T]),refetchUntilResized:(0,f.useCallback)(async e=>{let t=++w.current,n=Date.now()+x;v(!0);let r=e;try{for(o();Date.now()<n&&t===w.current;){if(await new Promise(e=>setTimeout(e,b)),t!==w.current)return;let e=await T({keepStaleOnError:!0});if(t!==w.current)return;if(e){if(r==null){r=e;continue}if(S(e,r))return}}}finally{t===w.current&&v(!1)}},[T,o])}}function w(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${e.toFixed(0)} MB`}export{m as a,_ as i,C as n,v as r,w as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{n as t,t as n}from"./capture-error-CqtAGHQu.js";import{t as r}from"./react-BFJW0bSv.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import"./src-Co3nj9N_.js";import{t as o}from"./loader-circle-DWWXcfTQ.js";import"./tag-Bz-I4QwU.js";import{n as s}from"./toast-elfTwkN2.js";import"./auth-store-s7Pi2EMi.js";import{a as c,r as l}from"./api-CGsj1Pig.js";import{t as u}from"./assistant-feature-flag-store-Czv-BYTG.js";import{t as d}from"./use-active-assistant-id-BK7MNTh-.js";import"./environment-store-TW2YS-DK.js";var f=e(r(),1),p=a();function m({value:e,max:t,caption:n}){let r=t>0?Math.max(0,Math.min(e/t*100,100)):0,i=r>90;return(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-[var(--surface-active)]`,children:(0,p.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-200`,style:{width:`${r}%`,backgroundColor:i?`var(--system-negative-strong)`:`var(--system-positive-strong)`}})}),n&&(0,p.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:n})]})}var h=7,g=2e3;function _(e){let t=(0,f.useRef)(0),n=(0,f.useRef)(null),[r,i]=(0,f.useState)(null),a=(0,f.useCallback)(()=>{if(t.current+=1,t.current>=h){t.current=0;let r=u.getState(),a=!r.settingsDeveloperNav;r.setFlag(`settingsDeveloperNav`,a,e),i(a?`Developer mode enabled`:`Developer mode disabled`),n.current!==null&&clearTimeout(n.current),n.current=setTimeout(()=>{i(null),n.current=null},g)}},[e]);return(0,f.useEffect)(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{onTap:a,message:r}}function v({version:e,loading:t,assistantId:n}){let{onTap:r,message:i}=_(n);return t?(0,p.jsxs)(`span`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,p.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading version...`]}):e?(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`button`,{type:`button`,className:`break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:r,children:e}),i&&(0,p.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:i})]}):(0,p.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`—`})}var y=`currentAssistant`,b=4e3,x=9e4;function S(e,t){return(e.memory?.maxMb??null)!==(t.memory?.maxMb??null)||(e.cpu?.maxCores??null)!==(t.cpu?.maxCores??null)}function C(){let e=d(),{data:r=null,isLoading:a,refetch:o}=i({queryKey:[y,e],queryFn:async()=>{let t=await l(e);return t.ok?t.data:null},retry:!1}),u=r?.id,[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),C=(0,f.useRef)(0),w=(0,f.useRef)(0),T=(0,f.useCallback)(async e=>{if(!u)return m(null),g(!1),null;C.current+=1;let r=C.current;g(!0);try{let t=await c(u);return r===C.current?t.ok?(m(t.data),t.data):(e?.keepStaleOnError||m(null),null):null}catch(i){return r===C.current?(e?.keepStaleOnError||m(null),!t(i)&&!e?.keepStaleOnError&&(n(i,{context:`fetch_assistant_healthz`}),s.error(`Failed to load assistant info`)),null):null}finally{r===C.current&&g(!1)}},[u]);return(0,f.useEffect)(()=>{T()},[T]),(0,f.useEffect)(()=>()=>{w.current+=1,v(!1),m(null)},[u]),{assistant:r,assistantLoading:a,healthz:p,healthzLoading:h,healthzPolling:_,refetch:(0,f.useCallback)(async()=>{await o(),await T()},[o,T]),refetchUntilResized:(0,f.useCallback)(async e=>{let t=++w.current,n=Date.now()+x;v(!0);let r=e;try{for(o();Date.now()<n&&t===w.current;){if(await new Promise(e=>setTimeout(e,b)),t!==w.current)return;let e=await T({keepStaleOnError:!0});if(t!==w.current)return;if(e){if(r==null){r=e;continue}if(S(e,r))return}}}finally{t===w.current&&v(!1)}},[T,o])}}function w(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${e.toFixed(0)} MB`}export{m as a,_ as i,C as n,v as r,w as t};