@vellumai/web 0.12.2-dev.202609170044.9cbb729 → 0.12.2-dev.202609170127.2eef54c

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 (200) hide show
  1. package/dist/assets/{a2a-invite-CPOepgSQ.js → a2a-invite-CGyWwrVb.js} +1 -1
  2. package/dist/assets/{about-page-mvJO6yza.js → about-page-CpXKAK5Z.js} +1 -1
  3. package/dist/assets/{account-page-yyir0M2y.js → account-page-cpDusq21.js} +1 -1
  4. package/dist/assets/{account-shell-B5314FtI.js → account-shell-D1_mSHj9.js} +1 -1
  5. package/dist/assets/{acp-run-detail-panel-BYr2gH9F.js → acp-run-detail-panel-D_bA-uwm.js} +1 -1
  6. package/dist/assets/{activation-list-route-dhx_UhFW.js → activation-list-route-_x10pg_q.js} +1 -1
  7. package/dist/assets/{activity-redirect-page-Cyo877Rg.js → activity-redirect-page-CLc8hSfC.js} +1 -1
  8. package/dist/assets/{activity-steps-panel-DKg15Oc4.js → activity-steps-panel-YPKDTvLp.js} +1 -1
  9. package/dist/assets/{add-credits-modal-CzpgEkT9.js → add-credits-modal-CXIeeHpM.js} +1 -1
  10. package/dist/assets/add-credits-modal-Lw_orElQ.js +1 -0
  11. package/dist/assets/{ai-page-CBX1v1tS.js → ai-page-532485Rg.js} +1 -1
  12. package/dist/assets/{android-billing-handoff-CWqhP_0I.js → android-billing-handoff-BjLOXHzL.js} +1 -1
  13. package/dist/assets/{api-key-screen-DKzLIFst.js → api-key-screen-DBRohhxk.js} +1 -1
  14. package/dist/assets/{app-BffxeWB8.js → app-Bevxq2OH.js} +13 -13
  15. package/dist/assets/{app-info-DsEx-jq_.js → app-info-CLe39i6W.js} +1 -1
  16. package/dist/assets/{archive-redirect-page-BK_dY4v-.js → archive-redirect-page-CrqrZE0I.js} +1 -1
  17. package/dist/assets/{assistant-status-panel-BSioaCpK.js → assistant-status-panel-D0GMw4-F.js} +1 -1
  18. package/dist/assets/auth-store-CpWb7YyB.js +1 -0
  19. package/dist/assets/{auth-welcome-screen-LyL7WDL8.js → auth-welcome-screen-DqyGTmht.js} +1 -1
  20. package/dist/assets/avatar-bundled-components-Dg1tq-xF.js +1 -0
  21. package/dist/assets/{avatar-random-DIn9GmRk.js → avatar-random-Bg-JtW3h.js} +2 -2
  22. package/dist/assets/{await-org-header-settled-DNIo8_Tf.js → await-org-header-settled-CPTObvNn.js} +1 -1
  23. package/dist/assets/{background-task-detail-panel-HleNtRAe.js → background-task-detail-panel-BVlprJsr.js} +1 -1
  24. package/dist/assets/{billing-page-DbEVS2q_.js → billing-page-7AqrZkVw.js} +3 -3
  25. package/dist/assets/{billing-redirect-page-CdcCmEUc.js → billing-redirect-page-CBdGeWQH.js} +1 -1
  26. package/dist/assets/{bookmarks-page-CUi4LhrR.js → bookmarks-page-BlaJ96ej.js} +1 -1
  27. package/dist/assets/{bundle-confirm-page-Tz6RPE2c.js → bundle-confirm-page-C-nGTAWg.js} +1 -1
  28. package/dist/assets/{channel-transcript-panel-gPgCvcoI.js → channel-transcript-panel-C8sNJBUg.js} +1 -1
  29. package/dist/assets/{channels-page-route-D8adodpU.js → channels-page-route-Ccf07m7d.js} +1 -1
  30. package/dist/assets/{chat-info-panel-jeK_s1xx.js → chat-info-panel-Dc7yOSba.js} +1 -1
  31. package/dist/assets/{checkout-continuation-BJuTfVL4.js → checkout-continuation-DndPlOQH.js} +1 -1
  32. package/dist/assets/{checkout-page-BEB-CumM.js → checkout-page-BubQ6HKx.js} +1 -1
  33. package/dist/assets/checkout-return-target-UI7zqK_V.js +1 -0
  34. package/dist/assets/command-palette-C1EnF4gm.js +1 -0
  35. package/dist/assets/{command-palette-CWDqjKuB.js → command-palette-CMP9k9JI.js} +1 -1
  36. package/dist/assets/{command-palette-window-page-C0OorhM_.js → command-palette-window-page-BiTxCLMC.js} +1 -1
  37. package/dist/assets/{community-page-Dp56nq4K.js → community-page-BnK8lv_7.js} +1 -1
  38. package/dist/assets/{companion-accent-BkhXA9n8.js → companion-accent-Cw1QrON6.js} +1 -1
  39. package/dist/assets/{companion-dock-zones-page-BiaNWu9U.js → companion-dock-zones-page-BDH8JnN-.js} +1 -1
  40. package/dist/assets/{companion-layout-CPz7l-4W.js → companion-layout-DY7WNHKB.js} +1 -1
  41. package/dist/assets/{companion-popover-Wr9gfDIe.js → companion-popover-CrjiSDbu.js} +1 -1
  42. package/dist/assets/{companion-popover-page-PVlrSn4w.js → companion-popover-page-CySPinox.js} +1 -1
  43. package/dist/assets/{companion-surface-page-Dp_CShHP.js → companion-surface-page-BOo03Cql.js} +1 -1
  44. package/dist/assets/{companion-watch-frame-page-CVY57Wpn.js → companion-watch-frame-page-D0gmPDdg.js} +1 -1
  45. package/dist/assets/{connect-page-BSje-9ym.js → connect-page-ASh20AlX.js} +1 -1
  46. package/dist/assets/{consent-controls-Bz_IOnmZ.js → consent-controls-CEkwbqJw.js} +1 -1
  47. package/dist/assets/{contacts-gateway-CY5vUfM2.js → contacts-gateway-BFbyNbl_.js} +1 -1
  48. package/dist/assets/{contacts-page-route-JRYP87zz.js → contacts-page-route-Dq0E2ER7.js} +1 -1
  49. package/dist/assets/{copy-button-BuISIxU2.js → copy-button-CpRMm23v.js} +1 -1
  50. package/dist/assets/{credential-entry-page-D2GsP2g5.js → credential-entry-page-7W319fSF.js} +1 -1
  51. package/dist/assets/{credentials-page-B2B50A98.js → credentials-page-CZjpoj-1.js} +1 -1
  52. package/dist/assets/{csv-preview--DFbpKhn.js → csv-preview-BntRaLY3.js} +1 -1
  53. package/dist/assets/{danger-zone-redirect-page-BizWd5Ru.js → danger-zone-redirect-page-BIJ7iH3z.js} +1 -1
  54. package/dist/assets/{debug-page-C5iUTBcy.js → debug-page-5TIa2DWf.js} +1 -1
  55. package/dist/assets/{deploy-dialogs-Cb2DGIT-.js → deploy-dialogs-6ed2FkO5.js} +1 -1
  56. package/dist/assets/deploy-dialogs-Gj5nNCwe.js +1 -0
  57. package/dist/assets/{desktop-preview-content-C-2TO84E.js → desktop-preview-content-C8-eBvWs.js} +2 -2
  58. package/dist/assets/{desktop-status-Cq9tSoVe.js → desktop-status-Bb9_j80h.js} +1 -1
  59. package/dist/assets/{desktop-viewer-BFoFR7Sg.js → desktop-viewer-B1LngIwF.js} +1 -1
  60. package/dist/assets/{detail-card-B3_bSihf.js → detail-card-BwHvhGMs.js} +1 -1
  61. package/dist/assets/{detail-panel-stop-button-DOTn90Cm.js → detail-panel-stop-button-CeSH5ncG.js} +1 -1
  62. package/dist/assets/{detail-primitives-Bc5PDjkl.js → detail-primitives-DscaN9rD.js} +1 -1
  63. package/dist/assets/{developer-page-CWg9QzIf.js → developer-page-BAPxl51t.js} +1 -1
  64. package/dist/assets/{devices-redirect-page-c67PRqw0.js → devices-redirect-page-CL5kygqy.js} +1 -1
  65. package/dist/assets/{dictation-overlay-page-UYCz2T3V.js → dictation-overlay-page-CqBYNqCX.js} +1 -1
  66. package/dist/assets/{document-load-DHCCLogD.js → document-load-D6zwCeMh.js} +1 -1
  67. package/dist/assets/document-load-DwJmiaST.js +1 -0
  68. package/dist/assets/{document-viewer-page-ClJvwnU-.js → document-viewer-page-CgUpLtrR.js} +1 -1
  69. package/dist/assets/{emails-page-2ou2eAkW.js → emails-page-B3KXvdQh.js} +1 -1
  70. package/dist/assets/{environment-store-Dka2FZhs.js → environment-store-gXJzyQ9n.js} +1 -1
  71. package/dist/assets/{file-diff-view-BmdOQaeZ.js → file-diff-view-gj5qz7ac.js} +1 -1
  72. package/dist/assets/{file-editor--nn3ZR0r.js → file-editor-yxcARNDB.js} +1 -1
  73. package/dist/assets/{general-page-uvMmHHyl.js → general-page-Be2OEMQv.js} +1 -1
  74. package/dist/assets/{hatching-screen-C5Hdkxta.js → hatching-screen-Os08fIB7.js} +1 -1
  75. package/dist/assets/{hosting-screen-D3yRf7Vz.js → hosting-screen-KGS2hNnI.js} +1 -1
  76. package/dist/assets/{identity-page-route-CBystW_n.js → identity-page-route-CcWEsb73.js} +1 -1
  77. package/dist/assets/{inspect-page-VMZxgoOP.js → inspect-page-BqwGgtCg.js} +3 -3
  78. package/dist/assets/{integrations-page-_YxXV8LC.js → integrations-page-DxXjeCOU.js} +1 -1
  79. package/dist/assets/{intelligence-layout-COHWei3O.js → intelligence-layout-0GHP1abK.js} +1 -1
  80. package/dist/assets/intelligence-layout-slots-store-DO8r8MbX.js +1 -0
  81. package/dist/assets/{keyboard-shortcuts-redirect-page-CkO8sqRv.js → keyboard-shortcuts-redirect-page-D8Sd0awe.js} +1 -1
  82. package/dist/assets/{latest-assistant-text-px--r87U.js → latest-assistant-text-CFfTfLEE.js} +1 -1
  83. package/dist/assets/{library-detail-page-BROUcqvW.js → library-detail-page-hchQ6i_Z.js} +1 -1
  84. package/dist/assets/{library-page-D8lvqAnn.js → library-page-DCcuCaVz.js} +1 -1
  85. package/dist/assets/local-mode-BF0BHVrs.js +1 -0
  86. package/dist/assets/{login-page-KwB7QV63.js → login-page-CFu2kSt0.js} +1 -1
  87. package/dist/assets/{logout-page-BS_b3wIp.js → logout-page-TdBoJnoW.js} +1 -1
  88. package/dist/assets/{logs-layout-3574H70Q.js → logs-layout-CB0oUcCN.js} +1 -1
  89. package/dist/assets/{markdown-preview-BQBD4nZl.js → markdown-preview-DFx6LTIB.js} +1 -1
  90. package/dist/assets/{media-preview-B8dzo6SD.js → media-preview-s9zPdEVg.js} +1 -1
  91. package/dist/assets/{memory-page-route-lL9WqSlP.js → memory-page-route-BfiwTjz6.js} +1 -1
  92. package/dist/assets/{memory-router-playground-page-Xn90HoK0.js → memory-router-playground-page-BMqYc2PM.js} +1 -1
  93. package/dist/assets/{message-files-panel-BLVYF2bR.js → message-files-panel-DFgNQOkk.js} +1 -1
  94. package/dist/assets/{metric-card-qtWiXfjv.js → metric-card-Cp9VXC7R.js} +1 -1
  95. package/dist/assets/native-attachment-pickers-Da2NEx1r.js +1 -0
  96. package/dist/assets/native-file-BE23yEsJ.js +1 -0
  97. package/dist/assets/{notifications-page-Butll45i.js → notifications-page-B9YszO_J.js} +1 -1
  98. package/dist/assets/{oauth-complete-page-CEcHbwIV.js → oauth-complete-page-BNh9-xUX.js} +1 -1
  99. package/dist/assets/{oauth-popup-complete-page-D3zQC3el.js → oauth-popup-complete-page-IDBMA6bj.js} +1 -1
  100. package/dist/assets/paired-platform-identity-CV09bF6L.js +1 -0
  101. package/dist/assets/{pairing-page-BfAzRCkh.js → pairing-page-BiagkAmV.js} +1 -1
  102. package/dist/assets/password-reset-page-BnC4ZtAH.js +1 -0
  103. package/dist/assets/{pdf-file-preview-BNNzH1Lj.js → pdf-file-preview-DyZKuW6K.js} +1 -1
  104. package/dist/assets/{personality-page-pYkfDoiT.js → personality-page-CaVp-IFA.js} +1 -1
  105. package/dist/assets/{personality-page-C9g8m-ZV.js → personality-page-D9S6ceuR.js} +1 -1
  106. package/dist/assets/{personality-sliders-vC7qRQZ4.js → personality-sliders-B8XJXHql.js} +1 -1
  107. package/dist/assets/{plans-page-Cqz11rXC.js → plans-page-COqIWjjU.js} +1 -1
  108. package/dist/assets/{platform-loopback-page-zI5kt-1B.js → platform-loopback-page-Be6zZTjk.js} +1 -1
  109. package/dist/assets/{plugin-detail-page-BVUJF_Z0.js → plugin-detail-page-B7rDYqFA.js} +1 -1
  110. package/dist/assets/{plugins-page-grMYw6ca.js → plugins-page-CLR2LTmD.js} +1 -1
  111. package/dist/assets/plugins-surface-DV2Ze-pt.js +1 -0
  112. package/dist/assets/{preview-error-DAI-w4oR.js → preview-error-BJZmVu5_.js} +1 -1
  113. package/dist/assets/{privacy-page-CkYCyPUl.js → privacy-page-DoWHQiAM.js} +1 -1
  114. package/dist/assets/{privacy-screen-C8KSanLw.js → privacy-screen-CqHYvdcC.js} +1 -1
  115. package/dist/assets/{provider-callback-page-CaXQeoGc.js → provider-callback-page-CoDo_LGa.js} +1 -1
  116. package/dist/assets/{provider-key-CMRKdOp6.js → provider-key-CdT-QLy6.js} +1 -1
  117. package/dist/assets/{provider-signup-page-pmWAHHvg.js → provider-signup-page-BqLSsqmz.js} +1 -1
  118. package/dist/assets/{quick-input-page-D2Ps4Nn9.js → quick-input-page-DNQrrRym.js} +1 -1
  119. package/dist/assets/referral-modal-Cb9yHvB_.js +1 -0
  120. package/dist/assets/{referral-modal-T0tz9cKz.js → referral-modal-Cxu42QEQ.js} +1 -1
  121. package/dist/assets/{research-mock-page-C2hO1AJp.js → research-mock-page-BGxSDObT.js} +1 -1
  122. package/dist/assets/{research-onboarding-route-YUY_VAoR.js → research-onboarding-route-DIsnSqMQ.js} +1 -1
  123. package/dist/assets/{review-terms-screen-ClCuevTT.js → review-terms-screen-DO7ygsE4.js} +1 -1
  124. package/dist/assets/routes-CBqv5JWO.js +1 -0
  125. package/dist/assets/{schedules-C4v6G4Yl.js → schedules-BVvKpKi_.js} +1 -1
  126. package/dist/assets/{schedules-page-BEE6gG-0.js → schedules-page-DMg82o_w.js} +1 -1
  127. package/dist/assets/{security-redirect-page-CfHdAiGm.js → security-redirect-page-Dt9NUQpQ.js} +1 -1
  128. package/dist/assets/{select-assistant-screen-uEMd-mms.js → select-assistant-screen-C_lmPTkj.js} +1 -1
  129. package/dist/assets/{self-hosted-servers-qDFPnEcM.js → self-hosted-servers-rVknxhh5.js} +1 -1
  130. package/dist/assets/{service-form-controls-DTOMkj0Y.js → service-form-controls-Dtw6VZjE.js} +1 -1
  131. package/dist/assets/{setting-row-snAhMVc8.js → setting-row-Dl37RqUe.js} +1 -1
  132. package/dist/assets/{settings-divider-DAr-iUO3.js → settings-divider-CqLEhf9T.js} +1 -1
  133. package/dist/assets/{settings-layout-iM3mkXFz.js → settings-layout-g2w2BcMj.js} +1 -1
  134. package/dist/assets/share-feedback-modal-Cw4b0uTf.js +1 -0
  135. package/dist/assets/{share-feedback-modal-BkIQkrgI.js → share-feedback-modal-DQOqrbac.js} +1 -1
  136. package/dist/assets/{sidebar-tree-Ar6vYFqW.js → sidebar-tree-AAmgDds0.js} +1 -1
  137. package/dist/assets/{signup-page-DP1R2EYG.js → signup-page-Bo3kV3uI.js} +1 -1
  138. package/dist/assets/{signup-shell-DDOwFm8f.js → signup-shell-BFlnJZeT.js} +1 -1
  139. package/dist/assets/{skill-detail-page-tlOn1SgY.js → skill-detail-page-D3aEzdPR.js} +1 -1
  140. package/dist/assets/{skill-detail-panel-BT-gwhZC.js → skill-detail-panel-p4BBQO99.js} +1 -1
  141. package/dist/assets/{skill-removal-dialog-BKxKHM93.js → skill-removal-dialog-DDrOdXOm.js} +1 -1
  142. package/dist/assets/{skills-page-CNDvB7S4.js → skills-page-C6d2b4U2.js} +1 -1
  143. package/dist/assets/{sounds-page-CB-BYrIs.js → sounds-page-DcDVb904.js} +1 -1
  144. package/dist/assets/{start-screen-TdesbZb_.js → start-screen-xNv_UqZY.js} +1 -1
  145. package/dist/assets/{stt-language-picker-modal-DPCuG3ZL.js → stt-language-picker-modal-ClWhCUb4.js} +1 -1
  146. package/dist/assets/{subagent-detail-panel-CZ80KyIm.js → subagent-detail-panel-Br1VLPKI.js} +1 -1
  147. package/dist/assets/{superpowers-page-CWF29nBb.js → superpowers-page-4mJC8gCY.js} +1 -1
  148. package/dist/assets/{system-events-page-1v0djQRa.js → system-events-page-BxTLnX53.js} +1 -1
  149. package/dist/assets/{system-events-redirect-page-H4jpP5pT.js → system-events-redirect-page-sTK7jdID.js} +1 -1
  150. package/dist/assets/{text-preview-DSjmL18D.js → text-preview-ByPfVkyx.js} +1 -1
  151. package/dist/assets/{theme-stage-page-DW2rC9j9.js → theme-stage-page-BUDy_3aW.js} +1 -1
  152. package/dist/assets/{tiptap-document-editor-nrxutBtH.js → tiptap-document-editor-D0xp5ZOs.js} +1 -1
  153. package/dist/assets/tool-detail-panel-DkIHPygu.js +1 -0
  154. package/dist/assets/tool-detail-panel-aNvOK4DH.js +15 -0
  155. package/dist/assets/{trait-cycle-row-BSA19j9_.js → trait-cycle-row-DxnV3-Yt.js} +1 -1
  156. package/dist/assets/{upgrade-cancel-page-DTHemN5k.js → upgrade-cancel-page-C30oAeVw.js} +1 -1
  157. package/dist/assets/{upgrade-success-page-CIFrIxM0.js → upgrade-success-page-oW6vbrAs.js} +1 -1
  158. package/dist/assets/{usage-redirect-page-Cq63trs2.js → usage-redirect-page-CgUD4SND.js} +1 -1
  159. package/dist/assets/{use-app-delete-BE_RhdkC.js → use-app-delete-CKSNRj2W.js} +1 -1
  160. package/dist/assets/{use-assistant-identity-details-CrtLW4Dl.js → use-assistant-identity-details-V-aHH_Fd.js} +1 -1
  161. package/dist/assets/{use-checkout-dismiss-refresh-Ch1dFcBe.js → use-checkout-dismiss-refresh-3vETASUz.js} +1 -1
  162. package/dist/assets/{use-edge-swipe-back-DCbPXF6z.js → use-edge-swipe-back-iYvf5Z3Y.js} +1 -1
  163. package/dist/assets/{use-hotkey-recorder-v5Akb2eM.js → use-hotkey-recorder-D_xoveSa.js} +1 -1
  164. package/dist/assets/{use-invite-link-dialog-BWou3cIT.js → use-invite-link-dialog-BmO2UW56.js} +1 -1
  165. package/dist/assets/{use-platform-assistant-id-eSCNuEeV.js → use-platform-assistant-id-B2zxeseH.js} +1 -1
  166. package/dist/assets/{use-plugins-list-BeN4VoGr.js → use-plugins-list-B2RZk-mQ.js} +1 -1
  167. package/dist/assets/{use-return-to-short-circuit-sIhAEoPs.js → use-return-to-short-circuit-DmEpr1I6.js} +1 -1
  168. package/dist/assets/{use-side-list-room-DKS_urYu.js → use-side-list-room-Bzn8D2aH.js} +1 -1
  169. package/dist/assets/{use-skill-actions-VsDYLi1F.js → use-skill-actions-D8xWO_74.js} +1 -1
  170. package/dist/assets/{use-skill-detail-files-4oFtcDS1.js → use-skill-detail-files-tb5cSgGr.js} +1 -1
  171. package/dist/assets/use-supports-credentials-settings-D7VgTBHl.js +1 -0
  172. package/dist/assets/{use-transcript-message-by-id-DAnqm2sU.js → use-transcript-message-by-id-CUhOzUVt.js} +1 -1
  173. package/dist/assets/{voice-page-ZM6m4a6g.js → voice-page-V5DTtBCx.js} +1 -1
  174. package/dist/assets/{wake-detail-panel-DDiMpVwh.js → wake-detail-panel-CwGS3ebR.js} +1 -1
  175. package/dist/assets/{weather-forecast-display-BidX04za.js → weather-forecast-display-Cy7gAmUS.js} +1 -1
  176. package/dist/assets/{welcome-screen-BLO3HSl6.js → welcome-screen-CsDlUcyv.js} +1 -1
  177. package/dist/assets/{workflow-detail-panel-DoYNc1Sc.js → workflow-detail-panel-BoCJgSNC.js} +1 -1
  178. package/dist/assets/{workspace-page-CBkUkz3A.js → workspace-page-ch8vZBtm.js} +1 -1
  179. package/dist/index.html +1 -1
  180. package/package.json +1 -1
  181. package/dist/assets/add-credits-modal-3J4yC3LM.js +0 -1
  182. package/dist/assets/auth-store-BPEP8tVJ.js +0 -1
  183. package/dist/assets/avatar-bundled-components-B9pE82_X.js +0 -1
  184. package/dist/assets/checkout-return-target-Be4ZEj1n.js +0 -1
  185. package/dist/assets/command-palette-Qu5B2KQE.js +0 -1
  186. package/dist/assets/deploy-dialogs-X-N6_uqc.js +0 -1
  187. package/dist/assets/document-load-Cr8Ud-va.js +0 -1
  188. package/dist/assets/intelligence-layout-slots-store-BmRlMDFx.js +0 -1
  189. package/dist/assets/local-mode-CBsNlz7d.js +0 -1
  190. package/dist/assets/native-attachment-pickers-CtYddiW_.js +0 -1
  191. package/dist/assets/native-file-D3F1srNM.js +0 -1
  192. package/dist/assets/paired-platform-identity-B0dB5CoX.js +0 -1
  193. package/dist/assets/password-reset-page-Dr4-0_xs.js +0 -1
  194. package/dist/assets/plugins-surface-BSzMy9bT.js +0 -1
  195. package/dist/assets/referral-modal-CeOVD766.js +0 -1
  196. package/dist/assets/routes-DxNQ44wo.js +0 -1
  197. package/dist/assets/share-feedback-modal-BPKLrcqs.js +0 -1
  198. package/dist/assets/tool-detail-panel-CFC6gU9K.js +0 -15
  199. package/dist/assets/tool-detail-panel-CVYxc8vR.js +0 -1
  200. package/dist/assets/use-supports-credentials-settings-DqJKqLDf.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,Ah as n,Ba as r,Ex as i,Fb as a,Fx as o,Ib as s,Iu as c,Iy as l,Kr as u,Mx as d,Ob as f,Ox as p,Ph as m,Ra as h,Rt as g,Ry as _,Sb as ee,Ux as v,Uy as y,Wh as b,Wy as te,Xx as x,Yr as S,_y as C,as as ne,ch as w,cx as T,ds as E,eb as re,eh as ie,fb as ae,gy as oe,hb as se,kb as ce,kp as le,ob as ue,os as de,ox as D,qn as fe,qy as O,sx as k,us as pe,ux as me,vb as he,wb as ge,wu as A,xm as j,xy as M,ys as _e,yy as ve,za as ye}from"./app-BffxeWB8.js";import{er as be,j as N}from"./vendor-CtuA73w5.js";import{_ as xe,f as Se,t as Ce,x as P}from"./react-B9IgSVeK.js";import{It as we,Sr as Te,er as F,gi as Ee,or as De,qi as I}from"./icons-DxrLl-Dj.js";import{t as L}from"./ellipsis-vertical-DWDUOGRm.js";import{t as Oe}from"./radio-card-nav-CZkUYNJ9.js";import{a as ke,i as Ae,n as je,o as R,r as z,t as Me}from"./self-hosted-servers-qDFPnEcM.js";import{t as Ne}from"./format-countdown-Dceq8qd-.js";var B=e(P(),1),Pe=a.remotePair.slice(`${a.assistant}/`.length);async function Fe(e,t){let n=t?f(e.url,t):null,r=t&&n!==null?`${Pe}?${new URLSearchParams({device_code:t}).toString()}`:null,i=()=>window.location.assign(n??`${e.url}${a.assistant}`);if(!ie()){i();return}(r===null?await je(e.url):await z(e.url,r))||i()}function Ie(e){return ke(y()?b():window.location.origin)===e.url}var V=Ce();function Le({traits:e,imageUrl:t,size:n=48,fallback:r,className:i,decorative:a=!1,onImageError:o}){let{t:s}=N(),c=S();if(e){if(!c)return r;if(j(c,e.bodyShape,e.eyeStyle,e.color)){let t=(0,V.jsx)(fe,{components:c,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:n,className:i});return a?(0,V.jsx)(`span`,{"aria-hidden":`true`,children:t}):t}}return t?(0,V.jsx)(`img`,{src:t,alt:a?``:s(`chooserAvatarChip.alt`),width:n,height:n,className:`rounded-full object-cover ${i??``}`.trim(),style:{width:n,height:n,flexShrink:0},onError:o}):r}function Re(e){let t;try{t=k(e)}catch{return{ok:!1,reason:`unparseable`}}if(D(t))return{ok:!1,reason:`service-website`};let n=ke(t);return n===null?{ok:!1,reason:`non-https`}:{ok:!0,url:n,deviceCode:T(e).deviceCode}}function ze({open:e,onClose:n,onAdded:r}){let{t:i}=N(`onboarding`),[a,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(null);(0,B.useEffect)(()=>{e&&(s(``),l(!1),d(null))},[e]);let f=()=>{c||n()},p=async()=>{if(!a.trim()||c)return;let e=Re(a);if(!e.ok){d(ce(e.reason,a));return}l(!0),d(null);try{let t=await R.getState().addOrigin({url:e.url});if(t.ok){r(t.origin,e.deviceCode);return}d(i(`addRemoteOriginDialog.addFailed`))}catch(e){console.error(`addRemoteOriginDialog.add failed`,e),d(i(`addRemoteOriginDialog.addFailed`))}l(!1)};return(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{e||f()},children:(0,V.jsxs)(o.Content,{size:`md`,children:[(0,V.jsxs)(o.Header,{icon:Te,children:[(0,V.jsx)(o.Title,{children:i(`addRemoteOriginDialog.title`)}),(0,V.jsx)(o.Description,{children:i(`addRemoteOriginDialog.body`)})]}),(0,V.jsx)(o.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`add-remote-origin-url`,children:i(`addRemoteOriginDialog.addressLabel`)}),(0,V.jsx)(v,{id:`add-remote-origin-url`,type:`url`,value:a,onChange:e=>s(e.target.value),placeholder:`https://example.com/assistant-1`,fullWidth:!0,autoFocus:!0})]}),u&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:u})]})}),(0,V.jsxs)(o.Footer,{children:[(0,V.jsx)(t,{variant:`ghost`,onClick:f,disabled:c,children:i(`actions.cancel`)}),(0,V.jsx)(t,{variant:`primary`,onClick:()=>void p(),disabled:!a.trim()||c,children:i(c?`actions.adding`:`actions.add`)})]})]})})}var H=e=>new Promise(t=>setTimeout(t,e)),U=30,Be=e=>{let t=Date.parse(e);return Number.isFinite(t)&&Date.now()>=t};function Ve({open:e,initialAddress:n,guidanceKind:r,onClose:i,onImported:a}){let{t:s}=N(`onboarding`),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(null),[ee,y]=(0,B.useState)(0),[b,S]=(0,B.useState)(!1),[C,ne]=(0,B.useState)(null),w=(0,B.useRef)(null),T=(0,B.useRef)({abandoned:!1}),E=()=>{let e=w.current;w.current=null,e&&M(e)};(0,B.useEffect)(()=>{if(!e)return;l(n??``),d(``),p(!1),h(null),_(null),S(!1),ne(null);let t={abandoned:!1};return T.current=t,()=>{t.abandoned=!0,E()}},[e,n]),(0,B.useEffect)(()=>{if(!g)return;let e=setInterval(()=>y(Date.parse(g.expiresAt)-Date.now()),1e3);return()=>clearInterval(e)},[g]);let re=async()=>{let e=c.trim();if(!e||f)return;p(!0),h(null);let t=u.trim()||void 0,n=T.current;try{let r=await ue(e);if(n.abandoned){r.ok&&M(r.handle);return}if(!r.ok){h(r.rejection?{kind:`rejected-address`,rejection:r.rejection,address:e}:{kind:`message`,text:r.error}),p(!1);return}w.current=r.handle,r.userCode&&(_({userCode:r.userCode,expiresAt:r.expiresAt}),y(Date.parse(r.expiresAt)-Date.now()));let i=r.userCode!==null,o=r.expiresAt,c=r.intervalSeconds,l=0;for(;;){let e=await O(r.handle,t);if(n.abandoned)return;if(!e.ok){let t=i&&te(e);if(t&&!Be(o)){if(l+=1,l===1&&S(!0),await H(Math.min(c*l,U)*1e3),n.abandoned)return;continue}E(),_(null),S(!1),h({kind:`message`,text:t?s(`connectAssistantDialog.retryExpired`):e.error});break}if(l>0&&(l=0,S(!1)),e.status===`imported`){if(w.current=null,e.accessOnly){_(null),ne(e.assistantId);break}a(e.assistantId);return}if(e.expiresAt!==o&&(_(t=>t&&{...t,expiresAt:e.expiresAt}),y(Date.parse(e.expiresAt)-Date.now())),o=e.expiresAt,c=e.intervalSeconds,await H(c*1e3),n.abandoned)return}}catch(e){console.error(`connectAssistantDialog.pairing failed`,e),E(),_(null),S(!1),h({kind:`message`,text:s(`connectAssistantDialog.submitError`)})}p(!1)};return C==null?(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(o.Content,{size:`md`,children:[(0,V.jsxs)(o.Header,{icon:F,children:[(0,V.jsx)(o.Title,{children:s(`connectAssistantDialog.title`)}),(0,V.jsx)(o.Description,{children:s(`connectAssistantDialog.instruction`)})]}),(0,V.jsx)(o.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[r&&(0,V.jsx)(x,{tone:`info`,children:s(r===`legacy`?`connectAssistantDialog.legacyLinkGuidance`:`connectAssistantDialog.linkGuidance`)}),g?(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(`code`,{className:`w-fit rounded-md bg-[var(--surface-active)] px-3 py-2 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`,children:g.userCode}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:s(`connectAssistantDialog.approveOnHost`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,V.jsx)(`span`,{className:b?`text-[color:var(--system-warning-strong)]`:void 0,children:s(b?`connectAssistantDialog.retrying`:`connectAssistantDialog.waitingForApproval`)}),(0,V.jsx)(`span`,{children:s(`connectAssistantDialog.expiresIn`,{time:Ne(ee)})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-address`,children:s(`connectAssistantDialog.addressLabel`)}),(0,V.jsx)(v,{id:`connect-assistant-address`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:s(`connectAssistantDialog.addressPlaceholder`),fullWidth:!0,autoFocus:!0})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-name`,children:s(`connectAssistantDialog.nameLabel`)}),(0,V.jsx)(v,{id:`connect-assistant-name`,type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`office-mac`,fullWidth:!0})]})]}),m&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:m.kind===`rejected-address`?ce(m.rejection,m.address):m.text})]})}),(0,V.jsxs)(o.Footer,{children:[(0,V.jsx)(t,{variant:`ghost`,onClick:i,children:s(`actions.cancel`)}),!g&&(0,V.jsx)(t,{variant:`primary`,onClick:()=>void re(),disabled:!c.trim()||f,children:s(f?`actions.connecting`:`actions.connect`)})]})]})}):(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(o.Content,{size:`sm`,children:[(0,V.jsx)(o.Header,{icon:F,children:(0,V.jsx)(o.Title,{children:s(`connectAssistantDialog.importedTitle`)})}),(0,V.jsx)(o.Body,{children:(0,V.jsx)(x,{tone:`warning`,children:s(`connectAssistantDialog.importedBody`)})}),(0,V.jsx)(o.Footer,{children:(0,V.jsx)(t,{variant:`primary`,onClick:()=>a(C),children:s(`actions.continue`)})})]})})}function He({open:e,assistantName:n,isPending:r,errorMessage:i,onCancel:a,onRepair:s,onRetire:c}){let{t:l}=N(`onboarding`),[u,f]=(0,B.useState)(`menu`);(0,B.useEffect)(()=>{e&&f(`menu`)},[e]);let p=i?(0,V.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,V.jsx)(d,{open:e,title:l(`connectRecoveryDialog.repairTitle`),message:(0,V.jsxs)(V.Fragment,{children:[l(`connectRecoveryDialog.repairBody`),p]}),confirmLabel:l(`connectRecoveryDialog.repairConfirm`),isPending:r,onConfirm:s,onCancel:()=>f(`menu`)}):u===`confirm-retire`?(0,V.jsx)(h,{open:e,isPending:r,extraMessage:p,onConfirm:c,onCancel:()=>f(`menu`)}):(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,V.jsxs)(o.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,V.jsx)(o.Header,{children:(0,V.jsx)(o.Title,{children:l(`connectRecoveryDialog.authFailedTitle`)})}),(0,V.jsxs)(o.Body,{children:[(0,V.jsx)(o.Description,{children:l(`connectRecoveryDialog.authFailedBody`,{name:n})}),p,(0,V.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,V.jsx)(t,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>f(`confirm-repair`),children:l(`connectRecoveryDialog.wakeAndRepair`)}),(0,V.jsx)(t,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>f(`confirm-retire`),children:l(`connectRecoveryDialog.retire`)}),(0,V.jsx)(t,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:l(`actions.cancel`)})]})]})]})})}function Ue(e){return e.name?e.name:e.isPaired?`Paired Assistant`:e.isLocal&&e.cloud===`local`?e.id:e.isLocal?`Local Assistant`:`Cloud Assistant`}function W(e,t){if(e)try{return t(`selectAssistantScreen.selfHostedWithHost`,{host:new URL(e).hostname})}catch{}return t(`selectAssistantScreen.selfHosted`)}function G(e,t){let n=e.isPaired?me(e.runtimeUrl):e.isLocal?_()?`On this computer`:W(e.ingressUrl,t):`Cloud-hosted`;return e.hatchedAt?`${n} · Created ${g(e.hatchedAt)}`:n}function We(e){return new URL(e.url).hostname}function Ge(e){return e.name??We(e)}function K(e){return`origin:${e.url}`}var q=`origin:vellum-cloud`;function Ke(e){let t=new URLSearchParams(e);return t.delete(`register`),t.delete(`name`),t}function J(){let{t:e}=N(`onboarding`),i=Se(),o=be(),[d,f]=xe(),p=d.get(`fromLogin`)===`1`,h=d.get(`noAutoSkip`)===`1`,g=s(),v=_(),y=le(),b=C.use.assistants(),te=m.use.currentOrganizationId(),x=R.use.origins(),S=R.use.hydrated(),T=w(),{loading:E,error:ie,login:ce,cancel:ue}=_e(),[D,fe]=(0,B.useState)(null),O=D===null?null:{url:D,name:`Vellum Cloud`},k=O!==null,me=e=>e.isPaired||e.isLocal&&v||y,j=b.filter(oe),M=j.filter(me),Ce=M.length>0||x.length>0||O!==null,P=ae(),De=!y&&P,[I,L]=(0,B.useState)(null),[z,Ne]=(0,B.useState)(!1),[Pe,Le]=(0,B.useState)(!1),[Re,H]=(0,B.useState)(null),[U,Be]=(0,B.useState)(null),[W,G]=(0,B.useState)(!1),[We,J]=(0,B.useState)(null),[Y,X]=(0,B.useState)(null),[Ze,Qe]=(0,B.useState)(!1),[$e,Z]=(0,B.useState)(null),[et,tt]=(0,B.useState)(!1),[Q,nt]=(0,B.useState)(null),[rt,it]=(0,B.useState)(!1),[at,ot]=(0,B.useState)(null),st=A.use.open(),ct=A.use.initialAddress(),lt=A.use.guidanceKind(),ut=A.use.deepLinkDrainSettled(),$=(0,B.useRef)(!1);(0,B.useEffect)(()=>{c()},[]),(0,B.useEffect)(()=>{Me(),R.getState().hydrate()},[]),(0,B.useEffect)(()=>{if(!T)return;let e=!1;return Ae().then(t=>{e||fe(t)}),()=>{e=!0}},[T]);let dt=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if(dt.current)return;dt.current=!0;let e=d.get(`register`);if(e===null)return;let t=()=>f(Ke,{replace:!0}),n=ke(e);if(n===null){t();return}R.getState().addOrigin({url:n,name:d.get(`name`)??void 0}).then(e=>{e.ok?t():dt.current=!1}).catch(()=>{dt.current=!1})},[d,f]),(0,B.useEffect)(()=>{if(I===q&&k||I!=null&&x.some(e=>K(e)===I))return;if(M.length===0){let e=x[0],t=e?K(e):k?q:null;I!==t&&L(t);return}if(I!=null&&M.some(e=>e.id===I))return;let e=n(te);L(M.find(t=>t.id===e)?.id??M[0].id)},[I,M,te,x,k]);let ft=async e=>{Ne(!0),H(null);try{await de(e),i(a.assistant,{replace:!0})}catch(t){console.error(`selectAssistant.handleConnect failed`,t),e.isLocal&&ae()&&(se(t)||ge(t)||t instanceof ve)&&l(e.id)?Be(e):e.isPaired&&se(t)?H(`This pairing has expired. Run vellum pair on the assistant's machine and import it again with vellum connect import.`):H(`Failed to connect. Please try again.`),Ne(!1)}},pt=()=>{Be(null),G(!1),J(null),Le(!1)},mt=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await he(U.id,{repairGuardian:!0});if(e.ok){ee(),pt(),ft(U);return}J(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),J(`Repair failed. Please try again.`)}G(!1)}},ht=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await r(o,U.id);if(e.ok){pt(),i(e.nextRoute,{replace:!0});return}J(e.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),J(`Failed to retire assistant. Please try again.`)}G(!1)}},gt=()=>{Ze||(X(null),Z(null))},_t=async()=>{if(!(!Y||Ze)){if(Qe(!0),Z(null),Y.isPaired){let e=await ne(o,Y.id);e.ok?($.current=!0,X(null)):Z(e.error),Qe(!1);return}try{let e=await re(Y.id);if(e.ok){let e=C.getState();e.activeAssistantId===Y.id&&e.setActiveAssistantId(null),pe(o,Y.id),$.current=!0,X(null)}else Z(e.error??`Failed to remove. Please try again.`)}catch(e){console.error(`selectAssistant.removeFromDevice failed`,e),Z(`Failed to remove. Please try again.`)}Qe(!1)}},vt=()=>{rt||(nt(null),ot(null))},yt=async()=>{!Q||rt||(it(!0),ot(null),await R.getState().removeOrigin(Q.url),R.getState().origins.some(e=>e.url===Q.url)?ot(`Failed to remove. Please try again.`):($.current=!0,nt(null)),it(!1))},bt=e=>{A.getState().closeConnectDialog(),ft(C.getState().assistants.find(t=>t.id===e)??{id:e,isLocal:!1,isPlatformHosted:!1,isPaired:!0})},xt=(e,t)=>{tt(!1),Fe(e,t??void 0)};(0,B.useEffect)(()=>{p||h||$.current||v&&S&&(x.length>0||g&&!ut||z||Pe||st||j.length!==0&&j.length===1&&M.length===1&&(Le(!0),ft(M[0])))},[j.length,M.length,ut,v,x.length,S]);let St=()=>{if(I===q){je(null).then(e=>{!e&&D!==null&&window.location.assign(D)});return}let e=x.find(e=>K(e)===I);if(e){Ie(e)?i(a.assistant,{replace:!0}):Fe(e);return}let t=j.find(e=>e.id===I);t&&ft(t)},Ct=()=>{i(v?a.welcome:a.assistant)},wt=ie??Re;return Pe&&!wt&&!U?(0,V.jsx)(qe,{}):(0,V.jsxs)(u,{avatarWave:`beside`,children:[(0,V.jsx)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${g?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-6 md:min-h-full md:pb-6`} text-[var(--content-default)]`,children:(0,V.jsxs)(`div`,{className:`flex w-full flex-col items-center ${g?``:`flex-1 justify-center`}`,children:[(0,V.jsx)(`h1`,{className:`text-center text-5xl font-normal tracking-tight md:text-4xl lg:text-5xl`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:e(`selectAssistantScreen.title`)}),wt&&(0,V.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:wt}),(0,V.jsxs)(`div`,{role:`radiogroup`,"aria-label":e(`selectAssistantScreen.listAriaLabel`),onKeyDown:Oe,className:`flex w-full flex-col ${g?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:[j.map(t=>{let n=me(t);return(0,V.jsx)(Ye,{assistant:t,selected:I===t.id,locked:!n,tabStop:I==null?M[0]?.id===t.id:I===t.id,onSelect:()=>{n&&L(t.id)},loginLabel:e(E?`actions.cancel`:`actions.loginToUse`),loginDisabled:z,onLogin:!n&&(t.isPlatformHosted||t.isLocal)?E?ue:()=>void ce():void 0,onRemove:t.isPlatformHosted&&De||t.isPaired&&P?()=>X(t):void 0},t.id)}),x.map((e,t)=>{let n=K(e),r=Ie(e);return(0,V.jsx)(Xe,{origin:e,selected:I===n,current:r,tabStop:I==null?M.length===0&&t===0:I===n,onSelect:()=>L(n),onRemove:r&&T?void 0:()=>nt(e)},e.url)}),O&&(0,V.jsx)(Xe,{origin:O,icon:(0,V.jsx)(Ee,{className:`h-5 w-5`}),selected:I===q,current:!1,tabStop:I==null?M.length===0&&x.length===0:I===q,onSelect:()=>L(q)}),v&&(0,V.jsx)(Je,{icon:(0,V.jsx)(we,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.createNew`),disabled:z||E,onClick:()=>void i(`${a.onboarding.hosting}?from=select-assistant`)}),P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(F,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.connectRemote`),disabled:z||E,onClick:()=>A.getState().openConnectDialog()}),!P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(Te,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.addRemote`),disabled:z||E,onClick:()=>tt(!0)})]}),Ce&&(0,V.jsx)(`div`,{className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:(0,V.jsx)(t,{variant:`primary`,size:`regular`,fullWidth:!0,className:g?void 0:`h-11 text-base`,onClick:St,disabled:!I||z,children:e(z?`actions.connecting`:`actions.continue`)})}),(0,V.jsx)(`div`,{className:Ce?`mt-3`:`mt-8`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,V.jsx)(t,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,onClick:Ct,disabled:z||E,children:e(`actions.back`)})})]})}),(0,V.jsx)(ze,{open:et,onClose:()=>tt(!1),onAdded:xt}),(0,V.jsx)(Ve,{open:st,initialAddress:ct??void 0,guidanceKind:lt??void 0,onClose:()=>A.getState().closeConnectDialog(),onImported:bt}),(0,V.jsx)(He,{open:U!=null,assistantName:U?Ue(U):``,isPending:W,errorMessage:We??void 0,onCancel:pt,onRepair:()=>void mt(),onRetire:()=>void ht()}),(0,V.jsx)(ye,{open:Y!=null,kind:Y?.isPaired?`paired`:`platform`,assistantName:Y?Ue(Y):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:$e??void 0,isPending:Ze,onConfirm:()=>void _t(),onCancel:gt}),(0,V.jsx)(ye,{open:Q!=null,kind:`origin`,assistantName:Q?Ge(Q):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:at??void 0,isPending:rt,onConfirm:()=>void yt(),onCancel:vt})]})}function qe(){let{t:e}=N(`onboarding`);return(0,V.jsx)(u,{avatarWave:`beside`,children:(0,V.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`selectAssistantScreen.connectingToAssistant`)})})})}function Je({icon:e,label:t,disabled:n,onClick:r}){let i=s();return(0,V.jsxs)(`button`,{type:`button`,onClick:r,disabled:n,className:[`group flex w-full items-center justify-center gap-2 border border-dashed border-[var(--border-element)]/50 text-[var(--content-tertiary)]`,i?`rounded-lg px-3 py-2.5`:`rounded-xl px-5 py-3`,`cursor-pointer transition-all duration-200 ease-out`,`hover:border-[var(--border-element)] hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,`disabled:cursor-not-allowed disabled:opacity-50`].join(` `),children:[e,(0,V.jsx)(`span`,{className:i?`text-body-small-default`:`text-body-medium-default`,children:t})]})}function Y({label:e,onRemove:n}){let{t:r}=N(`onboarding`);return(0,V.jsxs)(p.Root,{children:[(0,V.jsx)(p.Trigger,{asChild:!0,children:(0,V.jsx)(t,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,iconOnly:(0,V.jsx)(L,{}),"aria-label":r(`selectAssistantScreen.rowActionsAriaLabel`,{name:e})})}),(0,V.jsx)(p.Content,{align:`end`,sideOffset:4,children:(0,V.jsx)(p.Item,{onSelect:n,className:i.anchored,children:r(`selectAssistantScreen.removeFromDevice`)})})]})}function X({icon:e,title:t,subtitle:n,selected:r,locked:i=!1,tabStop:a,onSelect:o,action:c,removeMenu:l}){let u=s();return(0,V.jsxs)(`div`,{role:i?void 0:`radio`,"aria-checked":i?void 0:r,tabIndex:i?void 0:a?0:-1,onClick:i?void 0:o,onKeyDown:i?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:[`group flex w-full items-center border text-left`,u?`gap-3 rounded-lg px-[10px] py-3`:`gap-4 rounded-2xl px-[18px] py-4`,`transition-all duration-200 ease-out`,i?`border-[var(--border-base)] bg-[var(--surface-overlay)]`:`cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--primary-base)]`,i?``:r?`border-[var(--primary-base)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-lift)]/60 hover:border-[var(--border-element)] hover:bg-[var(--surface-lift)]`].join(` `),children:[(0,V.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,`h-12 w-12 rounded-[10px]`,r&&!i?`bg-[var(--primary-base)] text-[var(--surface-base)]`:`bg-[var(--surface-active)]/40 text-[var(--content-secondary)]`].join(` `),children:e}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t}),(0,V.jsx)(`span`,{className:`mt-1 block text-[var(--content-tertiary)] ${u?`text-label-medium-default font-normal`:`text-body-small-lighter`}`,children:n})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c,l&&(i?l:(0,V.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:l})),!i&&(0,V.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:r&&(0,V.jsx)(I,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})]})}function Ye({assistant:e,selected:n,locked:r,tabStop:i,onSelect:a,loginLabel:o,loginDisabled:s,onLogin:c,onRemove:l}){let{t:u}=N(`onboarding`),d=Ue(e),{traits:f,imageUrl:p,onImageError:m}=E(e);return(0,V.jsx)(X,{icon:(0,V.jsx)(Le,{traits:f,imageUrl:p,fallback:e.isPaired?(0,V.jsx)(F,{className:`h-5 w-5`}):e.isLocal?(0,V.jsx)(De,{className:`h-5 w-5`}):(0,V.jsx)(Ee,{className:`h-5 w-5`}),decorative:!0,onImageError:m}),title:d,subtitle:G(e,u),selected:n,locked:r,tabStop:i,onSelect:a,action:r&&c?(0,V.jsx)(t,{variant:`primary`,size:`regular`,onClick:c,disabled:s,children:o}):void 0,removeMenu:l&&(0,V.jsx)(Y,{label:d,onRemove:l})})}function Xe({origin:e,icon:t,selected:n,current:r,tabStop:i,onSelect:a,onRemove:o}){let{t:s}=N(`onboarding`),c=Ge(e);return(0,V.jsx)(X,{icon:t??(0,V.jsx)(Te,{className:`h-5 w-5`}),title:c,subtitle:s(r?`selectAssistantScreen.currentWithHost`:`selectAssistantScreen.remoteWithHost`,{host:We(e)}),selected:n,tabStop:i,onSelect:a,removeMenu:o&&(0,V.jsx)(Y,{label:c,onRemove:o})})}export{J as SelectAssistantScreen};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,Ah as n,Ba as r,Ex as i,Fb as a,Fx as o,Ib as s,Iu as c,Iy as l,Kr as u,Mx as d,Ob as f,Ox as p,Ph as m,Ra as h,Rt as g,Ry as _,Sb as ee,Ux as v,Uy as y,Wh as b,Wy as te,Xx as x,Yr as S,_y as C,as as ne,ch as w,cx as T,ds as E,eb as re,eh as ie,fb as ae,gy as oe,hb as se,kb as ce,kp as le,ob as ue,os as de,ox as D,qn as fe,qy as O,sx as k,us as pe,ux as me,vb as he,wb as ge,wu as A,xm as j,xy as M,ys as _e,yy as ve,za as ye}from"./app-Bevxq2OH.js";import{er as be,j as N}from"./vendor-CtuA73w5.js";import{_ as xe,f as Se,t as Ce,x as P}from"./react-B9IgSVeK.js";import{It as we,Sr as Te,er as F,gi as Ee,or as De,qi as I}from"./icons-DxrLl-Dj.js";import{t as L}from"./ellipsis-vertical-DWDUOGRm.js";import{t as Oe}from"./radio-card-nav-CZkUYNJ9.js";import{a as ke,i as Ae,n as je,o as R,r as z,t as Me}from"./self-hosted-servers-rVknxhh5.js";import{t as Ne}from"./format-countdown-Dceq8qd-.js";var B=e(P(),1),Pe=a.remotePair.slice(`${a.assistant}/`.length);async function Fe(e,t){let n=t?f(e.url,t):null,r=t&&n!==null?`${Pe}?${new URLSearchParams({device_code:t}).toString()}`:null,i=()=>window.location.assign(n??`${e.url}${a.assistant}`);if(!ie()){i();return}(r===null?await je(e.url):await z(e.url,r))||i()}function Ie(e){return ke(y()?b():window.location.origin)===e.url}var V=Ce();function Le({traits:e,imageUrl:t,size:n=48,fallback:r,className:i,decorative:a=!1,onImageError:o}){let{t:s}=N(),c=S();if(e){if(!c)return r;if(j(c,e.bodyShape,e.eyeStyle,e.color)){let t=(0,V.jsx)(fe,{components:c,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:n,className:i});return a?(0,V.jsx)(`span`,{"aria-hidden":`true`,children:t}):t}}return t?(0,V.jsx)(`img`,{src:t,alt:a?``:s(`chooserAvatarChip.alt`),width:n,height:n,className:`rounded-full object-cover ${i??``}`.trim(),style:{width:n,height:n,flexShrink:0},onError:o}):r}function Re(e){let t;try{t=k(e)}catch{return{ok:!1,reason:`unparseable`}}if(D(t))return{ok:!1,reason:`service-website`};let n=ke(t);return n===null?{ok:!1,reason:`non-https`}:{ok:!0,url:n,deviceCode:T(e).deviceCode}}function ze({open:e,onClose:n,onAdded:r}){let{t:i}=N(`onboarding`),[a,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(null);(0,B.useEffect)(()=>{e&&(s(``),l(!1),d(null))},[e]);let f=()=>{c||n()},p=async()=>{if(!a.trim()||c)return;let e=Re(a);if(!e.ok){d(ce(e.reason,a));return}l(!0),d(null);try{let t=await R.getState().addOrigin({url:e.url});if(t.ok){r(t.origin,e.deviceCode);return}d(i(`addRemoteOriginDialog.addFailed`))}catch(e){console.error(`addRemoteOriginDialog.add failed`,e),d(i(`addRemoteOriginDialog.addFailed`))}l(!1)};return(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{e||f()},children:(0,V.jsxs)(o.Content,{size:`md`,children:[(0,V.jsxs)(o.Header,{icon:Te,children:[(0,V.jsx)(o.Title,{children:i(`addRemoteOriginDialog.title`)}),(0,V.jsx)(o.Description,{children:i(`addRemoteOriginDialog.body`)})]}),(0,V.jsx)(o.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`add-remote-origin-url`,children:i(`addRemoteOriginDialog.addressLabel`)}),(0,V.jsx)(v,{id:`add-remote-origin-url`,type:`url`,value:a,onChange:e=>s(e.target.value),placeholder:`https://example.com/assistant-1`,fullWidth:!0,autoFocus:!0})]}),u&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:u})]})}),(0,V.jsxs)(o.Footer,{children:[(0,V.jsx)(t,{variant:`ghost`,onClick:f,disabled:c,children:i(`actions.cancel`)}),(0,V.jsx)(t,{variant:`primary`,onClick:()=>void p(),disabled:!a.trim()||c,children:i(c?`actions.adding`:`actions.add`)})]})]})})}var H=e=>new Promise(t=>setTimeout(t,e)),U=30,Be=e=>{let t=Date.parse(e);return Number.isFinite(t)&&Date.now()>=t};function Ve({open:e,initialAddress:n,guidanceKind:r,onClose:i,onImported:a}){let{t:s}=N(`onboarding`),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(null),[ee,y]=(0,B.useState)(0),[b,S]=(0,B.useState)(!1),[C,ne]=(0,B.useState)(null),w=(0,B.useRef)(null),T=(0,B.useRef)({abandoned:!1}),E=()=>{let e=w.current;w.current=null,e&&M(e)};(0,B.useEffect)(()=>{if(!e)return;l(n??``),d(``),p(!1),h(null),_(null),S(!1),ne(null);let t={abandoned:!1};return T.current=t,()=>{t.abandoned=!0,E()}},[e,n]),(0,B.useEffect)(()=>{if(!g)return;let e=setInterval(()=>y(Date.parse(g.expiresAt)-Date.now()),1e3);return()=>clearInterval(e)},[g]);let re=async()=>{let e=c.trim();if(!e||f)return;p(!0),h(null);let t=u.trim()||void 0,n=T.current;try{let r=await ue(e);if(n.abandoned){r.ok&&M(r.handle);return}if(!r.ok){h(r.rejection?{kind:`rejected-address`,rejection:r.rejection,address:e}:{kind:`message`,text:r.error}),p(!1);return}w.current=r.handle,r.userCode&&(_({userCode:r.userCode,expiresAt:r.expiresAt}),y(Date.parse(r.expiresAt)-Date.now()));let i=r.userCode!==null,o=r.expiresAt,c=r.intervalSeconds,l=0;for(;;){let e=await O(r.handle,t);if(n.abandoned)return;if(!e.ok){let t=i&&te(e);if(t&&!Be(o)){if(l+=1,l===1&&S(!0),await H(Math.min(c*l,U)*1e3),n.abandoned)return;continue}E(),_(null),S(!1),h({kind:`message`,text:t?s(`connectAssistantDialog.retryExpired`):e.error});break}if(l>0&&(l=0,S(!1)),e.status===`imported`){if(w.current=null,e.accessOnly){_(null),ne(e.assistantId);break}a(e.assistantId);return}if(e.expiresAt!==o&&(_(t=>t&&{...t,expiresAt:e.expiresAt}),y(Date.parse(e.expiresAt)-Date.now())),o=e.expiresAt,c=e.intervalSeconds,await H(c*1e3),n.abandoned)return}}catch(e){console.error(`connectAssistantDialog.pairing failed`,e),E(),_(null),S(!1),h({kind:`message`,text:s(`connectAssistantDialog.submitError`)})}p(!1)};return C==null?(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(o.Content,{size:`md`,children:[(0,V.jsxs)(o.Header,{icon:F,children:[(0,V.jsx)(o.Title,{children:s(`connectAssistantDialog.title`)}),(0,V.jsx)(o.Description,{children:s(`connectAssistantDialog.instruction`)})]}),(0,V.jsx)(o.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[r&&(0,V.jsx)(x,{tone:`info`,children:s(r===`legacy`?`connectAssistantDialog.legacyLinkGuidance`:`connectAssistantDialog.linkGuidance`)}),g?(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(`code`,{className:`w-fit rounded-md bg-[var(--surface-active)] px-3 py-2 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`,children:g.userCode}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:s(`connectAssistantDialog.approveOnHost`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,V.jsx)(`span`,{className:b?`text-[color:var(--system-warning-strong)]`:void 0,children:s(b?`connectAssistantDialog.retrying`:`connectAssistantDialog.waitingForApproval`)}),(0,V.jsx)(`span`,{children:s(`connectAssistantDialog.expiresIn`,{time:Ne(ee)})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-address`,children:s(`connectAssistantDialog.addressLabel`)}),(0,V.jsx)(v,{id:`connect-assistant-address`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:s(`connectAssistantDialog.addressPlaceholder`),fullWidth:!0,autoFocus:!0})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-name`,children:s(`connectAssistantDialog.nameLabel`)}),(0,V.jsx)(v,{id:`connect-assistant-name`,type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`office-mac`,fullWidth:!0})]})]}),m&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:m.kind===`rejected-address`?ce(m.rejection,m.address):m.text})]})}),(0,V.jsxs)(o.Footer,{children:[(0,V.jsx)(t,{variant:`ghost`,onClick:i,children:s(`actions.cancel`)}),!g&&(0,V.jsx)(t,{variant:`primary`,onClick:()=>void re(),disabled:!c.trim()||f,children:s(f?`actions.connecting`:`actions.connect`)})]})]})}):(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(o.Content,{size:`sm`,children:[(0,V.jsx)(o.Header,{icon:F,children:(0,V.jsx)(o.Title,{children:s(`connectAssistantDialog.importedTitle`)})}),(0,V.jsx)(o.Body,{children:(0,V.jsx)(x,{tone:`warning`,children:s(`connectAssistantDialog.importedBody`)})}),(0,V.jsx)(o.Footer,{children:(0,V.jsx)(t,{variant:`primary`,onClick:()=>a(C),children:s(`actions.continue`)})})]})})}function He({open:e,assistantName:n,isPending:r,errorMessage:i,onCancel:a,onRepair:s,onRetire:c}){let{t:l}=N(`onboarding`),[u,f]=(0,B.useState)(`menu`);(0,B.useEffect)(()=>{e&&f(`menu`)},[e]);let p=i?(0,V.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,V.jsx)(d,{open:e,title:l(`connectRecoveryDialog.repairTitle`),message:(0,V.jsxs)(V.Fragment,{children:[l(`connectRecoveryDialog.repairBody`),p]}),confirmLabel:l(`connectRecoveryDialog.repairConfirm`),isPending:r,onConfirm:s,onCancel:()=>f(`menu`)}):u===`confirm-retire`?(0,V.jsx)(h,{open:e,isPending:r,extraMessage:p,onConfirm:c,onCancel:()=>f(`menu`)}):(0,V.jsx)(o.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,V.jsxs)(o.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,V.jsx)(o.Header,{children:(0,V.jsx)(o.Title,{children:l(`connectRecoveryDialog.authFailedTitle`)})}),(0,V.jsxs)(o.Body,{children:[(0,V.jsx)(o.Description,{children:l(`connectRecoveryDialog.authFailedBody`,{name:n})}),p,(0,V.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,V.jsx)(t,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>f(`confirm-repair`),children:l(`connectRecoveryDialog.wakeAndRepair`)}),(0,V.jsx)(t,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>f(`confirm-retire`),children:l(`connectRecoveryDialog.retire`)}),(0,V.jsx)(t,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:l(`actions.cancel`)})]})]})]})})}function Ue(e){return e.name?e.name:e.isPaired?`Paired Assistant`:e.isLocal&&e.cloud===`local`?e.id:e.isLocal?`Local Assistant`:`Cloud Assistant`}function W(e,t){if(e)try{return t(`selectAssistantScreen.selfHostedWithHost`,{host:new URL(e).hostname})}catch{}return t(`selectAssistantScreen.selfHosted`)}function G(e,t){let n=e.isPaired?me(e.runtimeUrl):e.isLocal?_()?`On this computer`:W(e.ingressUrl,t):`Cloud-hosted`;return e.hatchedAt?`${n} · Created ${g(e.hatchedAt)}`:n}function We(e){return new URL(e.url).hostname}function Ge(e){return e.name??We(e)}function K(e){return`origin:${e.url}`}var q=`origin:vellum-cloud`;function Ke(e){let t=new URLSearchParams(e);return t.delete(`register`),t.delete(`name`),t}function J(){let{t:e}=N(`onboarding`),i=Se(),o=be(),[d,f]=xe(),p=d.get(`fromLogin`)===`1`,h=d.get(`noAutoSkip`)===`1`,g=s(),v=_(),y=le(),b=C.use.assistants(),te=m.use.currentOrganizationId(),x=R.use.origins(),S=R.use.hydrated(),T=w(),{loading:E,error:ie,login:ce,cancel:ue}=_e(),[D,fe]=(0,B.useState)(null),O=D===null?null:{url:D,name:`Vellum Cloud`},k=O!==null,me=e=>e.isPaired||e.isLocal&&v||y,j=b.filter(oe),M=j.filter(me),Ce=M.length>0||x.length>0||O!==null,P=ae(),De=!y&&P,[I,L]=(0,B.useState)(null),[z,Ne]=(0,B.useState)(!1),[Pe,Le]=(0,B.useState)(!1),[Re,H]=(0,B.useState)(null),[U,Be]=(0,B.useState)(null),[W,G]=(0,B.useState)(!1),[We,J]=(0,B.useState)(null),[Y,X]=(0,B.useState)(null),[Ze,Qe]=(0,B.useState)(!1),[$e,Z]=(0,B.useState)(null),[et,tt]=(0,B.useState)(!1),[Q,nt]=(0,B.useState)(null),[rt,it]=(0,B.useState)(!1),[at,ot]=(0,B.useState)(null),st=A.use.open(),ct=A.use.initialAddress(),lt=A.use.guidanceKind(),ut=A.use.deepLinkDrainSettled(),$=(0,B.useRef)(!1);(0,B.useEffect)(()=>{c()},[]),(0,B.useEffect)(()=>{Me(),R.getState().hydrate()},[]),(0,B.useEffect)(()=>{if(!T)return;let e=!1;return Ae().then(t=>{e||fe(t)}),()=>{e=!0}},[T]);let dt=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if(dt.current)return;dt.current=!0;let e=d.get(`register`);if(e===null)return;let t=()=>f(Ke,{replace:!0}),n=ke(e);if(n===null){t();return}R.getState().addOrigin({url:n,name:d.get(`name`)??void 0}).then(e=>{e.ok?t():dt.current=!1}).catch(()=>{dt.current=!1})},[d,f]),(0,B.useEffect)(()=>{if(I===q&&k||I!=null&&x.some(e=>K(e)===I))return;if(M.length===0){let e=x[0],t=e?K(e):k?q:null;I!==t&&L(t);return}if(I!=null&&M.some(e=>e.id===I))return;let e=n(te);L(M.find(t=>t.id===e)?.id??M[0].id)},[I,M,te,x,k]);let ft=async e=>{Ne(!0),H(null);try{await de(e),i(a.assistant,{replace:!0})}catch(t){console.error(`selectAssistant.handleConnect failed`,t),e.isLocal&&ae()&&(se(t)||ge(t)||t instanceof ve)&&l(e.id)?Be(e):e.isPaired&&se(t)?H(`This pairing has expired. Run vellum pair on the assistant's machine and import it again with vellum connect import.`):H(`Failed to connect. Please try again.`),Ne(!1)}},pt=()=>{Be(null),G(!1),J(null),Le(!1)},mt=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await he(U.id,{repairGuardian:!0});if(e.ok){ee(),pt(),ft(U);return}J(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),J(`Repair failed. Please try again.`)}G(!1)}},ht=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await r(o,U.id);if(e.ok){pt(),i(e.nextRoute,{replace:!0});return}J(e.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),J(`Failed to retire assistant. Please try again.`)}G(!1)}},gt=()=>{Ze||(X(null),Z(null))},_t=async()=>{if(!(!Y||Ze)){if(Qe(!0),Z(null),Y.isPaired){let e=await ne(o,Y.id);e.ok?($.current=!0,X(null)):Z(e.error),Qe(!1);return}try{let e=await re(Y.id);if(e.ok){let e=C.getState();e.activeAssistantId===Y.id&&e.setActiveAssistantId(null),pe(o,Y.id),$.current=!0,X(null)}else Z(e.error??`Failed to remove. Please try again.`)}catch(e){console.error(`selectAssistant.removeFromDevice failed`,e),Z(`Failed to remove. Please try again.`)}Qe(!1)}},vt=()=>{rt||(nt(null),ot(null))},yt=async()=>{!Q||rt||(it(!0),ot(null),await R.getState().removeOrigin(Q.url),R.getState().origins.some(e=>e.url===Q.url)?ot(`Failed to remove. Please try again.`):($.current=!0,nt(null)),it(!1))},bt=e=>{A.getState().closeConnectDialog(),ft(C.getState().assistants.find(t=>t.id===e)??{id:e,isLocal:!1,isPlatformHosted:!1,isPaired:!0})},xt=(e,t)=>{tt(!1),Fe(e,t??void 0)};(0,B.useEffect)(()=>{p||h||$.current||v&&S&&(x.length>0||g&&!ut||z||Pe||st||j.length!==0&&j.length===1&&M.length===1&&(Le(!0),ft(M[0])))},[j.length,M.length,ut,v,x.length,S]);let St=()=>{if(I===q){je(null).then(e=>{!e&&D!==null&&window.location.assign(D)});return}let e=x.find(e=>K(e)===I);if(e){Ie(e)?i(a.assistant,{replace:!0}):Fe(e);return}let t=j.find(e=>e.id===I);t&&ft(t)},Ct=()=>{i(v?a.welcome:a.assistant)},wt=ie??Re;return Pe&&!wt&&!U?(0,V.jsx)(qe,{}):(0,V.jsxs)(u,{avatarWave:`beside`,children:[(0,V.jsx)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${g?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-6 md:min-h-full md:pb-6`} text-[var(--content-default)]`,children:(0,V.jsxs)(`div`,{className:`flex w-full flex-col items-center ${g?``:`flex-1 justify-center`}`,children:[(0,V.jsx)(`h1`,{className:`text-center text-5xl font-normal tracking-tight md:text-4xl lg:text-5xl`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:e(`selectAssistantScreen.title`)}),wt&&(0,V.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:wt}),(0,V.jsxs)(`div`,{role:`radiogroup`,"aria-label":e(`selectAssistantScreen.listAriaLabel`),onKeyDown:Oe,className:`flex w-full flex-col ${g?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:[j.map(t=>{let n=me(t);return(0,V.jsx)(Ye,{assistant:t,selected:I===t.id,locked:!n,tabStop:I==null?M[0]?.id===t.id:I===t.id,onSelect:()=>{n&&L(t.id)},loginLabel:e(E?`actions.cancel`:`actions.loginToUse`),loginDisabled:z,onLogin:!n&&(t.isPlatformHosted||t.isLocal)?E?ue:()=>void ce():void 0,onRemove:t.isPlatformHosted&&De||t.isPaired&&P?()=>X(t):void 0},t.id)}),x.map((e,t)=>{let n=K(e),r=Ie(e);return(0,V.jsx)(Xe,{origin:e,selected:I===n,current:r,tabStop:I==null?M.length===0&&t===0:I===n,onSelect:()=>L(n),onRemove:r&&T?void 0:()=>nt(e)},e.url)}),O&&(0,V.jsx)(Xe,{origin:O,icon:(0,V.jsx)(Ee,{className:`h-5 w-5`}),selected:I===q,current:!1,tabStop:I==null?M.length===0&&x.length===0:I===q,onSelect:()=>L(q)}),v&&(0,V.jsx)(Je,{icon:(0,V.jsx)(we,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.createNew`),disabled:z||E,onClick:()=>void i(`${a.onboarding.hosting}?from=select-assistant`)}),P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(F,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.connectRemote`),disabled:z||E,onClick:()=>A.getState().openConnectDialog()}),!P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(Te,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.addRemote`),disabled:z||E,onClick:()=>tt(!0)})]}),Ce&&(0,V.jsx)(`div`,{className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:(0,V.jsx)(t,{variant:`primary`,size:`regular`,fullWidth:!0,className:g?void 0:`h-11 text-base`,onClick:St,disabled:!I||z,children:e(z?`actions.connecting`:`actions.continue`)})}),(0,V.jsx)(`div`,{className:Ce?`mt-3`:`mt-8`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,V.jsx)(t,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,onClick:Ct,disabled:z||E,children:e(`actions.back`)})})]})}),(0,V.jsx)(ze,{open:et,onClose:()=>tt(!1),onAdded:xt}),(0,V.jsx)(Ve,{open:st,initialAddress:ct??void 0,guidanceKind:lt??void 0,onClose:()=>A.getState().closeConnectDialog(),onImported:bt}),(0,V.jsx)(He,{open:U!=null,assistantName:U?Ue(U):``,isPending:W,errorMessage:We??void 0,onCancel:pt,onRepair:()=>void mt(),onRetire:()=>void ht()}),(0,V.jsx)(ye,{open:Y!=null,kind:Y?.isPaired?`paired`:`platform`,assistantName:Y?Ue(Y):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:$e??void 0,isPending:Ze,onConfirm:()=>void _t(),onCancel:gt}),(0,V.jsx)(ye,{open:Q!=null,kind:`origin`,assistantName:Q?Ge(Q):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:at??void 0,isPending:rt,onConfirm:()=>void yt(),onCancel:vt})]})}function qe(){let{t:e}=N(`onboarding`);return(0,V.jsx)(u,{avatarWave:`beside`,children:(0,V.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`selectAssistantScreen.connectingToAssistant`)})})})}function Je({icon:e,label:t,disabled:n,onClick:r}){let i=s();return(0,V.jsxs)(`button`,{type:`button`,onClick:r,disabled:n,className:[`group flex w-full items-center justify-center gap-2 border border-dashed border-[var(--border-element)]/50 text-[var(--content-tertiary)]`,i?`rounded-lg px-3 py-2.5`:`rounded-xl px-5 py-3`,`cursor-pointer transition-all duration-200 ease-out`,`hover:border-[var(--border-element)] hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,`disabled:cursor-not-allowed disabled:opacity-50`].join(` `),children:[e,(0,V.jsx)(`span`,{className:i?`text-body-small-default`:`text-body-medium-default`,children:t})]})}function Y({label:e,onRemove:n}){let{t:r}=N(`onboarding`);return(0,V.jsxs)(p.Root,{children:[(0,V.jsx)(p.Trigger,{asChild:!0,children:(0,V.jsx)(t,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,iconOnly:(0,V.jsx)(L,{}),"aria-label":r(`selectAssistantScreen.rowActionsAriaLabel`,{name:e})})}),(0,V.jsx)(p.Content,{align:`end`,sideOffset:4,children:(0,V.jsx)(p.Item,{onSelect:n,className:i.anchored,children:r(`selectAssistantScreen.removeFromDevice`)})})]})}function X({icon:e,title:t,subtitle:n,selected:r,locked:i=!1,tabStop:a,onSelect:o,action:c,removeMenu:l}){let u=s();return(0,V.jsxs)(`div`,{role:i?void 0:`radio`,"aria-checked":i?void 0:r,tabIndex:i?void 0:a?0:-1,onClick:i?void 0:o,onKeyDown:i?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:[`group flex w-full items-center border text-left`,u?`gap-3 rounded-lg px-[10px] py-3`:`gap-4 rounded-2xl px-[18px] py-4`,`transition-all duration-200 ease-out`,i?`border-[var(--border-base)] bg-[var(--surface-overlay)]`:`cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--primary-base)]`,i?``:r?`border-[var(--primary-base)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-lift)]/60 hover:border-[var(--border-element)] hover:bg-[var(--surface-lift)]`].join(` `),children:[(0,V.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,`h-12 w-12 rounded-[10px]`,r&&!i?`bg-[var(--primary-base)] text-[var(--surface-base)]`:`bg-[var(--surface-active)]/40 text-[var(--content-secondary)]`].join(` `),children:e}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t}),(0,V.jsx)(`span`,{className:`mt-1 block text-[var(--content-tertiary)] ${u?`text-label-medium-default font-normal`:`text-body-small-lighter`}`,children:n})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c,l&&(i?l:(0,V.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:l})),!i&&(0,V.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:r&&(0,V.jsx)(I,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})]})}function Ye({assistant:e,selected:n,locked:r,tabStop:i,onSelect:a,loginLabel:o,loginDisabled:s,onLogin:c,onRemove:l}){let{t:u}=N(`onboarding`),d=Ue(e),{traits:f,imageUrl:p,onImageError:m}=E(e);return(0,V.jsx)(X,{icon:(0,V.jsx)(Le,{traits:f,imageUrl:p,fallback:e.isPaired?(0,V.jsx)(F,{className:`h-5 w-5`}):e.isLocal?(0,V.jsx)(De,{className:`h-5 w-5`}):(0,V.jsx)(Ee,{className:`h-5 w-5`}),decorative:!0,onImageError:m}),title:d,subtitle:G(e,u),selected:n,locked:r,tabStop:i,onSelect:a,action:r&&c?(0,V.jsx)(t,{variant:`primary`,size:`regular`,onClick:c,disabled:s,children:o}):void 0,removeMenu:l&&(0,V.jsx)(Y,{label:d,onRemove:l})})}function Xe({origin:e,icon:t,selected:n,current:r,tabStop:i,onSelect:a,onRemove:o}){let{t:s}=N(`onboarding`),c=Ge(e);return(0,V.jsx)(X,{icon:t??(0,V.jsx)(Te,{className:`h-5 w-5`}),title:c,subtitle:s(r?`selectAssistantScreen.currentWithHost`:`selectAssistantScreen.remoteWithHost`,{host:We(e)}),selected:n,tabStop:i,onSelect:a,removeMenu:o&&(0,V.jsx)(Y,{label:c,onRemove:o})})}export{J as SelectAssistantScreen};
@@ -1 +1 @@
1
- import{Nv as e,dx as t,eh as n,ix as r,kh as i}from"./app-BffxeWB8.js";import{Q as a,k as o}from"./vendor-CtuA73w5.js";var s=`vellum:remembered-origins`;function c(e){let t=e.trim();if(t===``)return null;let n;try{n=new URL(t)}catch{return null}return n.protocol!==`https:`||n.hostname===``?null:`${n.origin}${n.pathname.replace(/\/+$/,``)}`}function l(e,t){let n=[],r=new Set,i=t??new Date().toISOString();for(let t of e){if(typeof t!=`object`||!t)continue;let{url:e,name:a,addedAt:o}=t;if(typeof e!=`string`)continue;let s=c(e);s===null||r.has(s)||(r.add(s),n.push({url:s,...typeof a==`string`&&a!==``?{name:a}:{},addedAt:typeof o==`string`?o:i}))}return n}function u(e){let t=JSON.parse(e);return Array.isArray(t)?l(t):null}var d=e({key:s,scope:`device`,parse:u,serialize:JSON.stringify,fallback:[]}),f={load:async()=>d.load(),save:async e=>{d.save(e)},watch:e=>r(s,e)},p=f,m=null,h=0,g=Promise.resolve(),_=`vellum:remembered-origins:mutate`;async function v(e){let t=typeof navigator>`u`?void 0:navigator.locks;return t?await t.request(_,e):e()}function y(e){let t=()=>v(e),n=g.then(t,t);return g=n.catch(()=>void 0),n}var b=null,x=!1;function S(e){return y(async()=>{try{let t=await p.load();if(e!==h)return;T.getState().hydrated?T.setState({origins:t}):m===null?T.getState().hydrate():x=!0}catch{}})}function C(){b?.();let e=h;b=p.watch?.(()=>void S(e))??null}function w(e){p=e,h+=1,m=null,x=!1,T.setState({hydrated:!1}),C(),T.getState().hydrate()}var T=a()((e,t)=>({origins:[],hydrated:!1,hydrate:()=>(m??=(async()=>{let t=h;await Promise.resolve();try{let n=await p.load();t===h&&(e({origins:n,hydrated:!0}),x&&(x=!1,S(t)))}catch{t===h&&(m=null)}})(),m),addOrigin:async({url:n,name:r})=>{let i=c(n);return i===null?{ok:!1}:y(async()=>{if(await t().hydrate(),!t().hydrated)return{ok:!1};let n=p,a=h,o;try{o=await n.load()}catch{return{ok:!1}}if(a!==h)return{ok:!1};let s=r?.trim(),c=o.find(e=>e.url===i),l=c??{url:i,addedAt:new Date().toISOString()},u=s?{...l,name:s}:l,d=c?o.map(e=>e.url===i?u:e):[...o,u];try{await n.save(d)}catch{return{ok:!1}}return a===h?(e({origins:d}),{ok:!0,origin:u}):{ok:!1}})},removeOrigin:async n=>{let r=c(n);r!==null&&await y(async()=>{if(await t().hydrate(),!t().hydrated)return;let n=p,i=h,a;try{a=await n.load()}catch{return}if(i!==h)return;let o=a.filter(e=>e.url!==r);if(o.length!==a.length)try{await n.save(o)}catch{return}i===h&&e({origins:o})})}}));C();var E=t(T),D=o(`SelfHostedServers`),O=`1970-01-01T00:00:00.000Z`;async function k(){try{return await D.list()}catch(e){return console.debug(`[self-hosted-servers] bridge unavailable:`,e),null}}var A=`vellum:remembered-origins:native-migrated`;function j(){try{return window.localStorage.getItem(A)===`true`}catch{return!0}}function M(){try{window.localStorage.setItem(A,`true`)}catch{}}async function N(e){if(j())return e;let t=[];try{t=await f.load()}catch{t=[]}let n=new Set(e.map(e=>e.url)),r=t.filter(e=>!n.has(e.url)),i=[];for(let t of r){try{await D.add({url:t.url,...t.name?{name:t.name}:{}})}catch(t){return console.debug(`[self-hosted-servers] migration add failed:`,t),[...e,...i]}i.push(t)}return M(),[...e,...i]}function P(){return{load:async()=>{let e=await k();return e===null?f.load():N(l(e.servers,O))},save:async e=>{let t=await k();if(t===null){await f.save(e);return}let n=new Map(l(t.servers,O).map(e=>[e.url,e.name])),r=new Set(e.map(e=>e.url));for(let e of n.keys())r.has(e)||await D.remove({url:e});for(let t of e)(!n.has(t.url)||t.name&&t.name!==n.get(t.url))&&await D.add({url:t.url,...t.name?{name:t.name}:{}})},watch:f.watch}}var F=!1;function I(){F||!n()||(F=!0,w(P()))}async function L(e,t){if(!n())return!1;await i();try{return await t(),!0}catch(t){return console.debug(`[self-hosted-servers] ${e} unavailable:`,t),!1}}async function R(e){return L(`switchTo`,()=>D.switchTo(e===null?{}:{url:e}))}async function z(e,t){return L(`switchToPath`,()=>D.switchToPath({...e===null?{}:{url:e},path:t}))}async function B(){if(!n())return null;let e=await k();return e===null||!e.activeUrl?null:e.bakedUrl?c(e.bakedUrl):null}export{c as a,B as i,R as n,E as o,z as r,I as t};
1
+ import{Nv as e,dx as t,eh as n,ix as r,kh as i}from"./app-Bevxq2OH.js";import{Q as a,k as o}from"./vendor-CtuA73w5.js";var s=`vellum:remembered-origins`;function c(e){let t=e.trim();if(t===``)return null;let n;try{n=new URL(t)}catch{return null}return n.protocol!==`https:`||n.hostname===``?null:`${n.origin}${n.pathname.replace(/\/+$/,``)}`}function l(e,t){let n=[],r=new Set,i=t??new Date().toISOString();for(let t of e){if(typeof t!=`object`||!t)continue;let{url:e,name:a,addedAt:o}=t;if(typeof e!=`string`)continue;let s=c(e);s===null||r.has(s)||(r.add(s),n.push({url:s,...typeof a==`string`&&a!==``?{name:a}:{},addedAt:typeof o==`string`?o:i}))}return n}function u(e){let t=JSON.parse(e);return Array.isArray(t)?l(t):null}var d=e({key:s,scope:`device`,parse:u,serialize:JSON.stringify,fallback:[]}),f={load:async()=>d.load(),save:async e=>{d.save(e)},watch:e=>r(s,e)},p=f,m=null,h=0,g=Promise.resolve(),_=`vellum:remembered-origins:mutate`;async function v(e){let t=typeof navigator>`u`?void 0:navigator.locks;return t?await t.request(_,e):e()}function y(e){let t=()=>v(e),n=g.then(t,t);return g=n.catch(()=>void 0),n}var b=null,x=!1;function S(e){return y(async()=>{try{let t=await p.load();if(e!==h)return;T.getState().hydrated?T.setState({origins:t}):m===null?T.getState().hydrate():x=!0}catch{}})}function C(){b?.();let e=h;b=p.watch?.(()=>void S(e))??null}function w(e){p=e,h+=1,m=null,x=!1,T.setState({hydrated:!1}),C(),T.getState().hydrate()}var T=a()((e,t)=>({origins:[],hydrated:!1,hydrate:()=>(m??=(async()=>{let t=h;await Promise.resolve();try{let n=await p.load();t===h&&(e({origins:n,hydrated:!0}),x&&(x=!1,S(t)))}catch{t===h&&(m=null)}})(),m),addOrigin:async({url:n,name:r})=>{let i=c(n);return i===null?{ok:!1}:y(async()=>{if(await t().hydrate(),!t().hydrated)return{ok:!1};let n=p,a=h,o;try{o=await n.load()}catch{return{ok:!1}}if(a!==h)return{ok:!1};let s=r?.trim(),c=o.find(e=>e.url===i),l=c??{url:i,addedAt:new Date().toISOString()},u=s?{...l,name:s}:l,d=c?o.map(e=>e.url===i?u:e):[...o,u];try{await n.save(d)}catch{return{ok:!1}}return a===h?(e({origins:d}),{ok:!0,origin:u}):{ok:!1}})},removeOrigin:async n=>{let r=c(n);r!==null&&await y(async()=>{if(await t().hydrate(),!t().hydrated)return;let n=p,i=h,a;try{a=await n.load()}catch{return}if(i!==h)return;let o=a.filter(e=>e.url!==r);if(o.length!==a.length)try{await n.save(o)}catch{return}i===h&&e({origins:o})})}}));C();var E=t(T),D=o(`SelfHostedServers`),O=`1970-01-01T00:00:00.000Z`;async function k(){try{return await D.list()}catch(e){return console.debug(`[self-hosted-servers] bridge unavailable:`,e),null}}var A=`vellum:remembered-origins:native-migrated`;function j(){try{return window.localStorage.getItem(A)===`true`}catch{return!0}}function M(){try{window.localStorage.setItem(A,`true`)}catch{}}async function N(e){if(j())return e;let t=[];try{t=await f.load()}catch{t=[]}let n=new Set(e.map(e=>e.url)),r=t.filter(e=>!n.has(e.url)),i=[];for(let t of r){try{await D.add({url:t.url,...t.name?{name:t.name}:{}})}catch(t){return console.debug(`[self-hosted-servers] migration add failed:`,t),[...e,...i]}i.push(t)}return M(),[...e,...i]}function P(){return{load:async()=>{let e=await k();return e===null?f.load():N(l(e.servers,O))},save:async e=>{let t=await k();if(t===null){await f.save(e);return}let n=new Map(l(t.servers,O).map(e=>[e.url,e.name])),r=new Set(e.map(e=>e.url));for(let e of n.keys())r.has(e)||await D.remove({url:e});for(let t of e)(!n.has(t.url)||t.name&&t.name!==n.get(t.url))&&await D.add({url:t.url,...t.name?{name:t.name}:{}})},watch:f.watch}}var F=!1;function I(){F||!n()||(F=!0,w(P()))}async function L(e,t){if(!n())return!1;await i();try{return await t(),!0}catch(t){return console.debug(`[self-hosted-servers] ${e} unavailable:`,t),!1}}async function R(e){return L(`switchTo`,()=>D.switchTo(e===null?{}:{url:e}))}async function z(e,t){return L(`switchToPath`,()=>D.switchToPath({...e===null?{}:{url:e},path:t}))}async function B(){if(!n())return null;let e=await k();return e===null||!e.activeUrl?null:e.bakedUrl?c(e.bakedUrl):null}export{c as a,B as i,R as n,E as o,z as r,I as t};
@@ -1 +1 @@
1
- import{$x as e}from"./app-BffxeWB8.js";import{j as t}from"./vendor-CtuA73w5.js";import{t as n}from"./react-B9IgSVeK.js";import{Xr as r,dr as i}from"./icons-DxrLl-Dj.js";import{t as a}from"./detail-card-B3_bSihf.js";var o=n();function s({id:e,title:t,subtitle:n,children:r}){return(0,o.jsx)(a,{id:e,title:t,subtitle:n,children:(0,o.jsx)(`div`,{className:`mt-4`,children:r})})}function c({onClick:n,disabled:r}){let{t:i}=t();return(0,o.jsx)(e,{onClick:n,disabled:r,children:i(`serviceFormControls.save`)})}function l({onClick:n,filled:r=!1}){let{t:i}=t();return(0,o.jsx)(e,{variant:r?`danger`:`dangerGhost`,onClick:n,children:i(`serviceFormControls.reset`)})}function u({guide:e}){return(0,o.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,o.jsx)(i,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{children:e.description}),(0,o.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,o.jsx)(r,{className:`h-3 w-3`})]})]})]})}export{s as i,l as n,c as r,u as t};
1
+ import{$x as e}from"./app-Bevxq2OH.js";import{j as t}from"./vendor-CtuA73w5.js";import{t as n}from"./react-B9IgSVeK.js";import{Xr as r,dr as i}from"./icons-DxrLl-Dj.js";import{t as a}from"./detail-card-BwHvhGMs.js";var o=n();function s({id:e,title:t,subtitle:n,children:r}){return(0,o.jsx)(a,{id:e,title:t,subtitle:n,children:(0,o.jsx)(`div`,{className:`mt-4`,children:r})})}function c({onClick:n,disabled:r}){let{t:i}=t();return(0,o.jsx)(e,{onClick:n,disabled:r,children:i(`serviceFormControls.save`)})}function l({onClick:n,filled:r=!1}){let{t:i}=t();return(0,o.jsx)(e,{variant:r?`danger`:`dangerGhost`,onClick:n,children:i(`serviceFormControls.reset`)})}function u({guide:e}){return(0,o.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,o.jsx)(i,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{children:e.description}),(0,o.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,o.jsx)(r,{className:`h-3 w-3`})]})]})]})}export{s as i,l as n,c as r,u as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Hx as t}from"./app-BffxeWB8.js";import{t as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1),a=n();function o({label:e,helperText:n,checked:r,onChange:o,variant:s=`toggle-leading`}){let c=(0,i.useId)(),l=(0,a.jsx)(t,{checked:r,onChange:o,id:c}),u=(0,a.jsxs)(`label`,{htmlFor:c,className:`min-w-0 flex-1 cursor-pointer`,children:[(0,a.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:e}),(0,a.jsx)(`span`,{className:`mt-1 block text-body-small-default text-[var(--content-tertiary)]`,children:n})]});return s===`toggle-trailing`?(0,a.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[u,l]}):(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[l,u]})}export{o as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Hx as t}from"./app-Bevxq2OH.js";import{t as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1),a=n();function o({label:e,helperText:n,checked:r,onChange:o,variant:s=`toggle-leading`}){let c=(0,i.useId)(),l=(0,a.jsx)(t,{checked:r,onChange:o,id:c}),u=(0,a.jsxs)(`label`,{htmlFor:c,className:`min-w-0 flex-1 cursor-pointer`,children:[(0,a.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:e}),(0,a.jsx)(`span`,{className:`mt-1 block text-body-small-default text-[var(--content-tertiary)]`,children:n})]});return s===`toggle-trailing`?(0,a.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[u,l]}):(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[l,u]})}export{o as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Lb as t,bn as n,nS as r}from"./app-BffxeWB8.js";import{t as i,x as a}from"./react-B9IgSVeK.js";var o=e(a(),1),s=3e4;function c(e){let[,t]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),s);return()=>clearInterval(n)},[e])}function l(e){return n(typeof e==`string`?new Date(e).getTime():e,{locale:t(),minimumUnit:`minute`})}var u=i();function d({className:e}){return(0,u.jsx)(`div`,{role:`presentation`,className:r(`h-px w-full bg-[var(--border-base)]`,e)})}export{l as n,c as r,d as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Lb as t,bn as n,nS as r}from"./app-Bevxq2OH.js";import{t as i,x as a}from"./react-B9IgSVeK.js";var o=e(a(),1),s=3e4;function c(e){let[,t]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),s);return()=>clearInterval(n)},[e])}function l(e){return n(typeof e==`string`?new Date(e).getTime():e,{locale:t(),minimumUnit:`minute`})}var u=i();function d({className:e}){return(0,u.jsx)(`div`,{role:`presentation`,className:r(`h-px w-full bg-[var(--border-base)]`,e)})}export{l as n,c as r,d as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Fb as t,Ns as n,Ri as r,Xu as i,_y as a,an as o,cd as s,kp as c,oh as l,wp as u,xr as d,ys as f}from"./app-BffxeWB8.js";import{j as p}from"./vendor-CtuA73w5.js";import{d as m,f as h,i as g,t as _,x as v}from"./react-B9IgSVeK.js";import{Gn as y,Wn as b}from"./icons-DxrLl-Dj.js";import{n as x,t as S}from"./sidebar-tree-Ar6vYFqW.js";import{t as C}from"./use-supports-credentials-settings-DqJKqLDf.js";var w=e(v(),1),T=_();function E(){let e=s.use.settingsDeveloperNav(),_=s.use.vellumHostedInference(),v=i.use.setWindowsMenuBarSuppressed();(0,w.useEffect)(()=>(v(!0),()=>v(!1)),[v]);let{t:E}=p(`settings`),D=l(),O=a.use.activeAssistantId(),k=o(O),A=C(O),j=r(),M=u(),{pathname:N}=m(),P=h(),F=c(),{login:I}=f(),L=(0,w.useCallback)((e,t)=>{switch(e){case`assistant-status`:return E(`sidebar.general`,`General`);case`model`:return E(`sidebar.model`,`Models & Services`);case`integrations`:return E(`sidebar.integrations`,`Integrations`);case`credentials`:return E(`sidebar.credentials`,`Credentials`);case`notifications`:return E(`sidebar.notifications`,`Notifications`);case`voice`:return E(`sidebar.voice`,`Voice`);case`sounds`:return E(`sidebar.sounds`,`Sounds`);case`privacy`:return E(`sidebar.privacy`,`Permissions & Privacy`);case`bookmarks`:return E(`sidebar.bookmarks`,`Bookmarks`);case`billing`:return M===`full`?E(`sidebar.billingUsage`,`Billing & Usage`):E(`sidebar.usage`,`Usage`);case`community`:return E(`sidebar.community`,`Community`);case`debug`:return E(`sidebar.debug`,`Debug`);case`developer`:return E(`sidebar.developer`,`Developer`);case`personality`:return E(`sidebar.personality`,`Personality`);default:return t}},[E,M]),R=(0,w.useMemo)(()=>d.filter(e=>!(e.id===`notifications`&&!D||e.id===`bookmarks`&&(!k||!j)||e.id===`credentials`&&!A||e.id===`developer`||e.id===`personality`)).map(e=>({...e,label:L(e.id,e.label)})),[D,k,j,A,L]),z=(0,w.useMemo)(()=>{let t=[];return _&&t.push(...d.filter(e=>e.id===`personality`).map(e=>({...e,label:L(e.id,e.label)}))),e&&t.push(...d.filter(e=>e.id===`developer`).map(e=>({...e,label:L(e.id,e.label)}))),t.push(F?{id:`logout`,label:E(`sidebar.logout`,`Log Out`),icon:b,onSelect:()=>void n(P)}:{id:`login`,label:E(`sidebar.login`,`Log In`),icon:y,onSelect:()=>void I()}),t},[e,_,F,P,I,E,L]),B=(0,w.useMemo)(()=>{if(N===t.settings.root)return E(`sidebar.title`,`Settings`);let e=d.find(e=>N===e.href||N.startsWith(e.href+`/`));return e?L(e.id,e.label):E(`sidebar.title`,`Settings`)},[N,E,L]);return(0,T.jsx)(x,{backHref:t.assistant,sidebar:(0,T.jsx)(S,{items:R,bottomItems:z,indexPath:t.settings.root}),title:B,menuReplacesContentOnMobile:!0,children:(0,T.jsx)(g,{})})}export{E as SettingsLayout};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Fb as t,Ns as n,Ri as r,Xu as i,_y as a,an as o,cd as s,kp as c,oh as l,wp as u,xr as d,ys as f}from"./app-Bevxq2OH.js";import{j as p}from"./vendor-CtuA73w5.js";import{d as m,f as h,i as g,t as _,x as v}from"./react-B9IgSVeK.js";import{Gn as y,Wn as b}from"./icons-DxrLl-Dj.js";import{n as x,t as S}from"./sidebar-tree-AAmgDds0.js";import{t as C}from"./use-supports-credentials-settings-D7VgTBHl.js";var w=e(v(),1),T=_();function E(){let e=s.use.settingsDeveloperNav(),_=s.use.vellumHostedInference(),v=i.use.setWindowsMenuBarSuppressed();(0,w.useEffect)(()=>(v(!0),()=>v(!1)),[v]);let{t:E}=p(`settings`),D=l(),O=a.use.activeAssistantId(),k=o(O),A=C(O),j=r(),M=u(),{pathname:N}=m(),P=h(),F=c(),{login:I}=f(),L=(0,w.useCallback)((e,t)=>{switch(e){case`assistant-status`:return E(`sidebar.general`,`General`);case`model`:return E(`sidebar.model`,`Models & Services`);case`integrations`:return E(`sidebar.integrations`,`Integrations`);case`credentials`:return E(`sidebar.credentials`,`Credentials`);case`notifications`:return E(`sidebar.notifications`,`Notifications`);case`voice`:return E(`sidebar.voice`,`Voice`);case`sounds`:return E(`sidebar.sounds`,`Sounds`);case`privacy`:return E(`sidebar.privacy`,`Permissions & Privacy`);case`bookmarks`:return E(`sidebar.bookmarks`,`Bookmarks`);case`billing`:return M===`full`?E(`sidebar.billingUsage`,`Billing & Usage`):E(`sidebar.usage`,`Usage`);case`community`:return E(`sidebar.community`,`Community`);case`debug`:return E(`sidebar.debug`,`Debug`);case`developer`:return E(`sidebar.developer`,`Developer`);case`personality`:return E(`sidebar.personality`,`Personality`);default:return t}},[E,M]),R=(0,w.useMemo)(()=>d.filter(e=>!(e.id===`notifications`&&!D||e.id===`bookmarks`&&(!k||!j)||e.id===`credentials`&&!A||e.id===`developer`||e.id===`personality`)).map(e=>({...e,label:L(e.id,e.label)})),[D,k,j,A,L]),z=(0,w.useMemo)(()=>{let t=[];return _&&t.push(...d.filter(e=>e.id===`personality`).map(e=>({...e,label:L(e.id,e.label)}))),e&&t.push(...d.filter(e=>e.id===`developer`).map(e=>({...e,label:L(e.id,e.label)}))),t.push(F?{id:`logout`,label:E(`sidebar.logout`,`Log Out`),icon:b,onSelect:()=>void n(P)}:{id:`login`,label:E(`sidebar.login`,`Log In`),icon:y,onSelect:()=>void I()}),t},[e,_,F,P,I,E,L]),B=(0,w.useMemo)(()=>{if(N===t.settings.root)return E(`sidebar.title`,`Settings`);let e=d.find(e=>N===e.href||N.startsWith(e.href+`/`));return e?L(e.id,e.label):E(`sidebar.title`,`Settings`)},[N,E,L]);return(0,T.jsx)(x,{backHref:t.assistant,sidebar:(0,T.jsx)(S,{items:R,bottomItems:z,indexPath:t.settings.root}),title:B,menuReplacesContentOnMobile:!0,children:(0,T.jsx)(g,{})})}export{E as SettingsLayout};
@@ -0,0 +1 @@
1
+ import{t as e}from"./share-feedback-modal-DQOqrbac.js";export{e as ShareFeedbackModal};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-DNzQmwtL.js","assets/react-B9IgSVeK.js","assets/rolldown-runtime-BM3Ffeng.js","assets/vendor-CtuA73w5.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,Cl as n,Cx as r,Dp as i,Gi as a,Hx as o,Ib as s,Mr as c,Ux as l,Wx as u,Xx as d,bb as f,eS as p,h_ as m,um as ee}from"./app-BffxeWB8.js";import{E as h,Jn as g,N as _,j as v}from"./vendor-CtuA73w5.js";import{b as y,t as b,v as x,x as S}from"./react-B9IgSVeK.js";import{Bn as te,Jn as ne,dr as re,fa as C,gt as ie,i as ae,jn as w,ni as oe,rn as se,tr as T}from"./icons-DxrLl-Dj.js";var E=e(S(),1),ce=e(y(),1),D=`vellum:debug:`;function O(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function le(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:f()},overrides:O()}}var k=b(),ue=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,de=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,fe={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},A=[{value:`bug_report`,icon:C,includesLogsByDefault:!0},{value:`feature_request`,icon:T,includesLogsByDefault:!1},{value:`other`,icon:w,includesLogsByDefault:!1}],j=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,pe={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function me(){if(s())return`electron`;let e=h.getPlatform();return e===`ios`||e===`android`?e:`web`}function he(e){return typeof e==`object`&&!!e&&`client`in e}function ge(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}var I=8192,L=/^data:([^;,]+);base64,/i,R=/^[A-Za-z0-9+/]+={0,2}$/;function z(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>z(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=z(a,t,n);i=r}return n.delete(e),i}function B(e){return z(e,e=>{if(typeof e!=`string`)return null;let t=L.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=I&&R.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function V(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),z(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function H(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function U(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await m({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function W(){if(!h.isNativePlatform())return null;try{let{App:e}=await x(async()=>{let{App:e}=await import(`./esm-DNzQmwtL.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function _e(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,c=new Date,l=j.find(t=>t.value===e),u=c.getTime(),d=l?.cutoffMs==null?null:u-l.cutoffMs,f=d==null?null:new Date(d).toISOString(),p=null;try{p=i?.()??null}catch{p=null}let m=ee(p),h={collected_at:c.toISOString(),time_range:e,cutoff:f,log_window:{start_time_ms:d,end_time_ms:u},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,client_version:null,native_app:await W(),user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},g=new TextEncoder,_=g.encode(JSON.stringify(h,null,2)),v=g.encode(JSON.stringify(m,null,2)),y=[H(`web-client-context.json`,_),H(`web-chat-diagnostics.json`,v)],b=new TextEncoder().encode(JSON.stringify(le(),null,2));y.push(H(`web-debug-flags.json`,b));for(let e of o){let t=e.contents.trim();t&&y.push(H(e.filename,g.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:V(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(B(n),null,2));y.push(H(`web-chat-debug-api-triage.json`,r))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(B(t),null,2));y.push(H(`web-sse-liveness-triage.json`,n))}}catch{}if(s()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));y.push(H(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);y.push(H(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await U(t,{window:{startTime:d,endTime:u},activeConversationId:n});e&&y.push(H(`platform-logs.tar.gz`,e))}y.push(new Uint8Array(1024));let x=y.reduce((e,t)=>e+t.length,0),S=new Uint8Array(x),te=0;for(let e of y)S.set(e,te),te+=e.length;let ne=new Blob([S.buffer]),re=await new Response(ne.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([re],`web-client-logs-${c.getTime()}.tar.gz`,{type:`application/gzip`})}function G({open:e,onClose:f,initialReason:m,initialMessage:ee,onSubmitted:h,assistantId:y,assistantVersion:b,activeConversationId:x,doctorSessionId:S,doctorSessionLog:C,getDiagnosticsSnapshot:w}){let{t:T}=v(),D=i.use.user(),O=D?.email,le=D?.isStaff??!1,j=(0,E.useId)(),M=(0,E.useRef)(null),N=(0,E.useRef)(null),F=(0,E.useRef)(null),I=(0,E.useRef)(null),L=(0,E.useMemo)(()=>[{value:`past_hour`,label:T(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:T(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:T(`shareFeedbackModal.timeRangeAllTime`)}],[T]),[R,z]=(0,E.useState)(m??`bug_report`),[B,V]=(0,E.useState)(``),[H,U]=(0,E.useState)(``),[W,G]=(0,E.useState)(A.find(e=>e.value===(m??`bug_report`))?.includesLogsByDefault??!0),[be,xe]=(0,E.useState)(!1),[K,q]=(0,E.useState)(`past_hour`),[J,Y]=(0,E.useState)([]),[Se,X]=(0,E.useState)(null),[Ce,we]=(0,E.useState)(!1),[Te,Ee]=(0,E.useState)(!1),[Z,De]=(0,E.useState)(!1),Oe=g(n()),[ke,Q]=(0,E.useState)(!1),$=Oe.isPending||ke,Ae=!O,je=(0,E.useMemo)(()=>B.trim().length>0&&H.trim().length>0,[B,H]);(0,E.useEffect)(()=>{if(!e)return;let t=m??`bug_report`;z(t),V(ee??``),U(O??``),G(A.find(e=>e.value===t)?.includesLogsByDefault??!0),xe(!1),q(`past_hour`),Y([]),Ee(!1),De(!1),X(null),Q(!1),Oe.reset();let n=setTimeout(()=>{O?F.current?.focus():I.current?.focus()},50);return()=>clearTimeout(n)},[e]),a(e);let Me=e=>{z(e),be||G(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},Ne=()=>{G(e=>!e),xe(!0)},Pe=C?.trim()?[{filename:`doctor-session.txt`,contents:C}]:[],Fe=(0,E.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),f())},[f,$]),Ie=(0,E.useCallback)(e=>{e.target===M.current&&!$&&f()},[f,$]),Le=(0,E.useCallback)(e=>{Y(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ge(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Re=e=>{e.target.files&&Le(Array.from(e.target.files)),e.target.value=``},ze=e=>{e.preventDefault(),we(!1),e.dataTransfer.files?.length&&Le(Array.from(e.dataTransfer.files))},Be=e=>{e.preventDefault(),we(!0)},Ve=e=>{e.preventDefault(),e.currentTarget===e.target&&we(!1)},He=e=>{Y(t=>t.filter((t,n)=>n!==e))};return e?(0,ce.createPortal)((0,k.jsx)(`div`,{ref:M,role:`dialog`,"aria-modal":`true`,"aria-labelledby":j,className:ue,onKeyDown:Fe,onClick:Ie,onDrop:ze,onDragOver:Be,onDragLeave:Ve,children:(0,k.jsxs)(`div`,{className:de,style:fe,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:j,className:`!m-0 text-title-small text-[var(--content-default)]`,children:T(`shareFeedbackModal.title`)}),(0,k.jsx)(t,{variant:`ghost`,iconOnly:(0,k.jsx)(ae,{}),onClick:f,disabled:$,"aria-label":T(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[le&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(o,{checked:Z,onChange:()=>De(e=>!e),"aria-label":T(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:T(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:T(`shareFeedbackModal.adminOnlyHint`)})]}),Z?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:T(`shareFeedbackModal.timeRange`)}),(0,k.jsx)(r,{options:L,value:K,onChange:q,"aria-label":T(`shareFeedbackModal.timeRangeAria`)})]}):(0,k.jsxs)(k.Fragment,{children:[Ae&&(0,k.jsx)(l,{id:`${j}-email`,ref:I,label:T(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:H,onChange:e=>U(e.target.value),leftIcon:(0,k.jsx)(te,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:T(`shareFeedbackModal.category`)}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(ve,{option:e,isSelected:R===e.value,onSelect:()=>Me(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),R===`bug_report`&&(0,k.jsx)(d,{tone:`info`,children:(0,k.jsx)(_,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,k.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),R===`feature_request`&&(0,k.jsx)(d,{tone:`info`,children:(0,k.jsx)(_,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,k.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),(0,k.jsx)(u,{id:`${j}-message`,ref:F,label:T(R===`bug_report`?`shareFeedbackModal.messageLabelBug`:R===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:T(R===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:R===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:B,onChange:e=>V(e.target.value),fullWidth:!0}),R!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(o,{checked:W,onChange:Ne,"aria-label":T(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:T(`shareFeedbackModal.includeDiagnostics`)})]}),(0,k.jsx)(p,{content:T(`shareFeedbackModal.diagnosticsTooltip`),children:(0,k.jsx)(`button`,{type:`button`,"aria-label":T(`shareFeedbackModal.aboutDiagnosticsAria`),className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(re,{className:`h-3.5 w-3.5`})})})]}),W&&(0,k.jsx)(r,{options:L,value:K,onChange:q,"aria-label":T(`shareFeedbackModal.timeRangeAria`)})]}),s()&&x&&R!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(o,{checked:Te,onChange:()=>Ee(e=>!e),"aria-label":T(`shareFeedbackModal.includeConversationAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:T(`shareFeedbackModal.includeConversation`)})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[T(`shareFeedbackModal.attachments`),J.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,J.length,`/`,P]})]}),(0,k.jsx)(t,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(se,{}),onClick:()=>N.current?.click(),disabled:J.length>=P,children:T(`shareFeedbackModal.addFiles`)}),(0,k.jsx)(`input`,{ref:N,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Re,className:`hidden`})]}),J.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:J.map((e,t)=>(0,k.jsx)(ye,{file:e,onRemove:()=>He(t)},`${e.name}-${t}`))}),Ce&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:T(`shareFeedbackModal.dropFiles`)})]})]}),Se&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:Se})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(ne,{className:`h-4 w-4 animate-spin`}),T(Z?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(t,{variant:`ghost`,onClick:f,children:T(`shareFeedbackModal.cancel`)}),Z?(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(oe,{}),onClick:async()=>{if(!$){X(null),Q(!0);try{let e=await _e(K,y??null,s()?Te?x??null:null:x??null,{diagnosticsProvider:w,doctorSessionId:S,extraLogFiles:Pe});if(!e){X(`Diagnostics export isn't supported in this browser.`);return}await c(e,e.name),f()}catch(e){X(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:T(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(ie,{}),onClick:async()=>{if(!(!je||$)){X(null),Q(!0);try{let e=W&&R!==`feature_request`?await _e(K,y??null,s()?Te?x??null:null:x??null,{diagnosticsProvider:w,doctorSessionId:S,extraLogFiles:Pe}):null,t=me(),n;if(t===`electron`)try{n=(await window.vellum?.app.versionInfo())?.version??n}catch{}let r=t=>Oe.mutateAsync({headers:{"Content-Type":null},body:{message:B.trim(),classification:pe[R],email:H.trim(),client:t,client_version:n,...y?{assistant_id:y}:{},...b?{assistant_version:b}:{},...S?{doctor_session_id:S}:{},...e?{logs_file:e}:{},...J.length?{attachments:J}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}});try{await r(t)}catch(e){if(t!==`android`||!he(e))throw e;await r(`web`)}h?.(),f()}catch(e){X(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!je,children:T(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function ve({option:e,isSelected:t,onSelect:n}){let{t:r}=v(),i=e.icon,a=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:a})]})}function ye({file:e,onRemove:n}){let{t:r}=v(),i=e.type.startsWith(`image/`),a=(0,E.useMemo)(()=>i?URL.createObjectURL(e):null,[e,i]);return(0,E.useEffect)(()=>{if(a)return()=>URL.revokeObjectURL(a)},[a]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[i&&a?(0,k.jsx)(`img`,{src:a,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(se,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(ae,{}),onClick:n,"aria-label":r(`shareFeedbackModal.removeAttachmentAria`,{name:e.name}),className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{V as n,B as r,G as t};
2
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,Cl as n,Cx as r,Dp as i,Gi as a,Hx as o,Ib as s,Mr as c,Ux as l,Wx as u,Xx as d,bb as f,eS as p,h_ as m,um as ee}from"./app-Bevxq2OH.js";import{E as h,Jn as g,N as _,j as v}from"./vendor-CtuA73w5.js";import{b as y,t as b,v as x,x as S}from"./react-B9IgSVeK.js";import{Bn as te,Jn as ne,dr as re,fa as C,gt as ie,i as ae,jn as w,ni as oe,rn as se,tr as T}from"./icons-DxrLl-Dj.js";var E=e(S(),1),ce=e(y(),1),D=`vellum:debug:`;function O(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function le(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:f()},overrides:O()}}var k=b(),ue=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,de=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,fe={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},A=[{value:`bug_report`,icon:C,includesLogsByDefault:!0},{value:`feature_request`,icon:T,includesLogsByDefault:!1},{value:`other`,icon:w,includesLogsByDefault:!1}],j=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,pe={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function me(){if(s())return`electron`;let e=h.getPlatform();return e===`ios`||e===`android`?e:`web`}function he(e){return typeof e==`object`&&!!e&&`client`in e}function ge(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}var I=8192,L=/^data:([^;,]+);base64,/i,R=/^[A-Za-z0-9+/]+={0,2}$/;function z(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>z(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=z(a,t,n);i=r}return n.delete(e),i}function B(e){return z(e,e=>{if(typeof e!=`string`)return null;let t=L.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=I&&R.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function V(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),z(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function H(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function U(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await m({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function W(){if(!h.isNativePlatform())return null;try{let{App:e}=await x(async()=>{let{App:e}=await import(`./esm-DNzQmwtL.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function _e(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,c=new Date,l=j.find(t=>t.value===e),u=c.getTime(),d=l?.cutoffMs==null?null:u-l.cutoffMs,f=d==null?null:new Date(d).toISOString(),p=null;try{p=i?.()??null}catch{p=null}let m=ee(p),h={collected_at:c.toISOString(),time_range:e,cutoff:f,log_window:{start_time_ms:d,end_time_ms:u},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,client_version:null,native_app:await W(),user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},g=new TextEncoder,_=g.encode(JSON.stringify(h,null,2)),v=g.encode(JSON.stringify(m,null,2)),y=[H(`web-client-context.json`,_),H(`web-chat-diagnostics.json`,v)],b=new TextEncoder().encode(JSON.stringify(le(),null,2));y.push(H(`web-debug-flags.json`,b));for(let e of o){let t=e.contents.trim();t&&y.push(H(e.filename,g.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:V(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(B(n),null,2));y.push(H(`web-chat-debug-api-triage.json`,r))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(B(t),null,2));y.push(H(`web-sse-liveness-triage.json`,n))}}catch{}if(s()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));y.push(H(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);y.push(H(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await U(t,{window:{startTime:d,endTime:u},activeConversationId:n});e&&y.push(H(`platform-logs.tar.gz`,e))}y.push(new Uint8Array(1024));let x=y.reduce((e,t)=>e+t.length,0),S=new Uint8Array(x),te=0;for(let e of y)S.set(e,te),te+=e.length;let ne=new Blob([S.buffer]),re=await new Response(ne.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([re],`web-client-logs-${c.getTime()}.tar.gz`,{type:`application/gzip`})}function G({open:e,onClose:f,initialReason:m,initialMessage:ee,onSubmitted:h,assistantId:y,assistantVersion:b,activeConversationId:x,doctorSessionId:S,doctorSessionLog:C,getDiagnosticsSnapshot:w}){let{t:T}=v(),D=i.use.user(),O=D?.email,le=D?.isStaff??!1,j=(0,E.useId)(),M=(0,E.useRef)(null),N=(0,E.useRef)(null),F=(0,E.useRef)(null),I=(0,E.useRef)(null),L=(0,E.useMemo)(()=>[{value:`past_hour`,label:T(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:T(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:T(`shareFeedbackModal.timeRangeAllTime`)}],[T]),[R,z]=(0,E.useState)(m??`bug_report`),[B,V]=(0,E.useState)(``),[H,U]=(0,E.useState)(``),[W,G]=(0,E.useState)(A.find(e=>e.value===(m??`bug_report`))?.includesLogsByDefault??!0),[be,xe]=(0,E.useState)(!1),[K,q]=(0,E.useState)(`past_hour`),[J,Y]=(0,E.useState)([]),[Se,X]=(0,E.useState)(null),[Ce,we]=(0,E.useState)(!1),[Te,Ee]=(0,E.useState)(!1),[Z,De]=(0,E.useState)(!1),Oe=g(n()),[ke,Q]=(0,E.useState)(!1),$=Oe.isPending||ke,Ae=!O,je=(0,E.useMemo)(()=>B.trim().length>0&&H.trim().length>0,[B,H]);(0,E.useEffect)(()=>{if(!e)return;let t=m??`bug_report`;z(t),V(ee??``),U(O??``),G(A.find(e=>e.value===t)?.includesLogsByDefault??!0),xe(!1),q(`past_hour`),Y([]),Ee(!1),De(!1),X(null),Q(!1),Oe.reset();let n=setTimeout(()=>{O?F.current?.focus():I.current?.focus()},50);return()=>clearTimeout(n)},[e]),a(e);let Me=e=>{z(e),be||G(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},Ne=()=>{G(e=>!e),xe(!0)},Pe=C?.trim()?[{filename:`doctor-session.txt`,contents:C}]:[],Fe=(0,E.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),f())},[f,$]),Ie=(0,E.useCallback)(e=>{e.target===M.current&&!$&&f()},[f,$]),Le=(0,E.useCallback)(e=>{Y(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ge(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Re=e=>{e.target.files&&Le(Array.from(e.target.files)),e.target.value=``},ze=e=>{e.preventDefault(),we(!1),e.dataTransfer.files?.length&&Le(Array.from(e.dataTransfer.files))},Be=e=>{e.preventDefault(),we(!0)},Ve=e=>{e.preventDefault(),e.currentTarget===e.target&&we(!1)},He=e=>{Y(t=>t.filter((t,n)=>n!==e))};return e?(0,ce.createPortal)((0,k.jsx)(`div`,{ref:M,role:`dialog`,"aria-modal":`true`,"aria-labelledby":j,className:ue,onKeyDown:Fe,onClick:Ie,onDrop:ze,onDragOver:Be,onDragLeave:Ve,children:(0,k.jsxs)(`div`,{className:de,style:fe,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:j,className:`!m-0 text-title-small text-[var(--content-default)]`,children:T(`shareFeedbackModal.title`)}),(0,k.jsx)(t,{variant:`ghost`,iconOnly:(0,k.jsx)(ae,{}),onClick:f,disabled:$,"aria-label":T(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[le&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(o,{checked:Z,onChange:()=>De(e=>!e),"aria-label":T(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:T(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:T(`shareFeedbackModal.adminOnlyHint`)})]}),Z?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:T(`shareFeedbackModal.timeRange`)}),(0,k.jsx)(r,{options:L,value:K,onChange:q,"aria-label":T(`shareFeedbackModal.timeRangeAria`)})]}):(0,k.jsxs)(k.Fragment,{children:[Ae&&(0,k.jsx)(l,{id:`${j}-email`,ref:I,label:T(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:H,onChange:e=>U(e.target.value),leftIcon:(0,k.jsx)(te,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:T(`shareFeedbackModal.category`)}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(ve,{option:e,isSelected:R===e.value,onSelect:()=>Me(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),R===`bug_report`&&(0,k.jsx)(d,{tone:`info`,children:(0,k.jsx)(_,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,k.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),R===`feature_request`&&(0,k.jsx)(d,{tone:`info`,children:(0,k.jsx)(_,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,k.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),(0,k.jsx)(u,{id:`${j}-message`,ref:F,label:T(R===`bug_report`?`shareFeedbackModal.messageLabelBug`:R===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:T(R===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:R===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:B,onChange:e=>V(e.target.value),fullWidth:!0}),R!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(o,{checked:W,onChange:Ne,"aria-label":T(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:T(`shareFeedbackModal.includeDiagnostics`)})]}),(0,k.jsx)(p,{content:T(`shareFeedbackModal.diagnosticsTooltip`),children:(0,k.jsx)(`button`,{type:`button`,"aria-label":T(`shareFeedbackModal.aboutDiagnosticsAria`),className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(re,{className:`h-3.5 w-3.5`})})})]}),W&&(0,k.jsx)(r,{options:L,value:K,onChange:q,"aria-label":T(`shareFeedbackModal.timeRangeAria`)})]}),s()&&x&&R!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(o,{checked:Te,onChange:()=>Ee(e=>!e),"aria-label":T(`shareFeedbackModal.includeConversationAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:T(`shareFeedbackModal.includeConversation`)})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[T(`shareFeedbackModal.attachments`),J.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,J.length,`/`,P]})]}),(0,k.jsx)(t,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(se,{}),onClick:()=>N.current?.click(),disabled:J.length>=P,children:T(`shareFeedbackModal.addFiles`)}),(0,k.jsx)(`input`,{ref:N,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Re,className:`hidden`})]}),J.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:J.map((e,t)=>(0,k.jsx)(ye,{file:e,onRemove:()=>He(t)},`${e.name}-${t}`))}),Ce&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:T(`shareFeedbackModal.dropFiles`)})]})]}),Se&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:Se})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(ne,{className:`h-4 w-4 animate-spin`}),T(Z?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(t,{variant:`ghost`,onClick:f,children:T(`shareFeedbackModal.cancel`)}),Z?(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(oe,{}),onClick:async()=>{if(!$){X(null),Q(!0);try{let e=await _e(K,y??null,s()?Te?x??null:null:x??null,{diagnosticsProvider:w,doctorSessionId:S,extraLogFiles:Pe});if(!e){X(`Diagnostics export isn't supported in this browser.`);return}await c(e,e.name),f()}catch(e){X(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:T(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(ie,{}),onClick:async()=>{if(!(!je||$)){X(null),Q(!0);try{let e=W&&R!==`feature_request`?await _e(K,y??null,s()?Te?x??null:null:x??null,{diagnosticsProvider:w,doctorSessionId:S,extraLogFiles:Pe}):null,t=me(),n;if(t===`electron`)try{n=(await window.vellum?.app.versionInfo())?.version??n}catch{}let r=t=>Oe.mutateAsync({headers:{"Content-Type":null},body:{message:B.trim(),classification:pe[R],email:H.trim(),client:t,client_version:n,...y?{assistant_id:y}:{},...b?{assistant_version:b}:{},...S?{doctor_session_id:S}:{},...e?{logs_file:e}:{},...J.length?{attachments:J}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}});try{await r(t)}catch(e){if(t!==`android`||!he(e))throw e;await r(`web`)}h?.(),f()}catch(e){X(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!je,children:T(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function ve({option:e,isSelected:t,onSelect:n}){let{t:r}=v(),i=e.icon,a=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:a})]})}function ye({file:e,onRemove:n}){let{t:r}=v(),i=e.type.startsWith(`image/`),a=(0,E.useMemo)(()=>i?URL.createObjectURL(e):null,[e,i]);return(0,E.useEffect)(()=>{if(a)return()=>URL.revokeObjectURL(a)},[a]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[i&&a?(0,k.jsx)(`img`,{src:a,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(se,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(ae,{}),onClick:n,"aria-label":r(`shareFeedbackModal.removeAttachmentAria`,{name:e.name}),className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{V as n,B as r,G as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,Fb as n,Ib as r,Ka as i,Mi as a,Qx as o,_x as s,eh as c,xc as l}from"./app-BffxeWB8.js";import{j as u}from"./vendor-CtuA73w5.js";import{d,f,n as p,t as m,x as h}from"./react-B9IgSVeK.js";import{Ra as g,Wi as _}from"./icons-DxrLl-Dj.js";import{t as v}from"./use-edge-swipe-back-DCbPXF6z.js";import{t as y}from"./link-click-Bzv2fph0.js";var b=e(h(),1),x=`data-page-transition`,S=400,C;function w(){return typeof document<`u`&&typeof document.startViewTransition==`function`}function T(){return c()&&w()}function E(e,t,n,r){if(!T()){e(t,r);return}document.documentElement.setAttribute(x,n),C!==void 0&&clearTimeout(C),C=setTimeout(()=>{C=void 0,document.documentElement.removeAttribute(x)},S),e(t,{...r,viewTransition:!0})}var D=m();function O({sidebar:e,children:s,actions:c,backHref:m,title:h=`Settings`,menuRoute:_=n.settings.root,menuReplacesContentOnMobile:y=!1}){let{t:x}=u(),{pathname:S}=d(),C=f(),w=S===_,T=l(),O=T&&w,k=!(O&&y),A=(0,b.useRef)(null),j=(0,b.useRef)(null);(0,b.useLayoutEffect)(()=>{j.current?.scrollTo(0,0)},[S]);let M=w?m:_;v({containerRef:A,onBack:(0,b.useCallback)(()=>{C(M)},[C,M]),enabled:T,navKey:S,prefetchHref:M});let N=r(),P=x(w?`sidebarShell.backFrom`:`sidebarShell.backToMenu`,{title:h}),F=(0,D.jsx)(t,{variant:`ghost`,iconOnly:(0,D.jsx)(g,{}),"aria-label":P,tintColor:`var(--content-secondary)`,onClick:()=>E(C,M,`pop`)}),I=(0,D.jsx)(t,{asChild:!0,variant:`outlined`,"aria-label":x(`sidebarShell.backFrom`,{title:h}),className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,D.jsx)(p,{to:m,className:`flex items-center justify-center no-underline`,children:(0,D.jsx)(g,{size:16,"aria-hidden":`true`})})});return(0,D.jsxs)(`div`,{ref:A,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:N?`3.75rem`:`1rem`},children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[F,(0,D.jsx)(o,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:h}),(0,D.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),N?(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,D.jsx)(i,{placement:`electron`,className:`px-0 pt-0`}),(0,D.jsx)(a,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,D.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[I,(0,D.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:h})]}),(0,D.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c})]}),(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[T?null:(0,D.jsx)(`aside`,{className:`w-64 shrink-0 overflow-y-auto`,"aria-label":x(`sidebarShell.navigationAria`,{title:h}),children:e}),O?(0,D.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6`,children:e}):null,k?(0,D.jsx)(`main`,{ref:j,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:px-6 md:pt-0 ${O?`hidden`:`flex`}`,children:s}):null]})]})]})}function k({items:e,bottomItems:t,indexPath:n}){let{t:r}=u(),{pathname:i}=d(),a=f(),o=l(),c=(e,t,r)=>{let{href:c,onSelect:l}=e,u=c!=null&&(i===c||i.startsWith(c+`/`)||!o&&r&&n!=null&&i===n);return(0,D.jsxs)(b.Fragment,{children:[(0,D.jsx)(s.Item,{icon:e.icon,label:e.label,active:u,trailingIcon:c==null?void 0:_,trailingIconClassName:c==null?void 0:`md:hidden`,href:c,onSelect:l,onClick:c==null?void 0:e=>{y(e)||(e.preventDefault(),E(a,c,`push`))}}),!t&&(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,D.jsxs)(`nav`,{"aria-label":r(`sidebarTree.ariaLabel`),className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>c(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{className:`flex-1`}),(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>c(e,n===t.length-1,!1))]})]})}export{O as n,k as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,Fb as n,Ib as r,Ka as i,Mi as a,Qx as o,_x as s,eh as c,xc as l}from"./app-Bevxq2OH.js";import{j as u}from"./vendor-CtuA73w5.js";import{d,f,n as p,t as m,x as h}from"./react-B9IgSVeK.js";import{Ra as g,Wi as _}from"./icons-DxrLl-Dj.js";import{t as v}from"./use-edge-swipe-back-iYvf5Z3Y.js";import{t as y}from"./link-click-Bzv2fph0.js";var b=e(h(),1),x=`data-page-transition`,S=400,C;function w(){return typeof document<`u`&&typeof document.startViewTransition==`function`}function T(){return c()&&w()}function E(e,t,n,r){if(!T()){e(t,r);return}document.documentElement.setAttribute(x,n),C!==void 0&&clearTimeout(C),C=setTimeout(()=>{C=void 0,document.documentElement.removeAttribute(x)},S),e(t,{...r,viewTransition:!0})}var D=m();function O({sidebar:e,children:s,actions:c,backHref:m,title:h=`Settings`,menuRoute:_=n.settings.root,menuReplacesContentOnMobile:y=!1}){let{t:x}=u(),{pathname:S}=d(),C=f(),w=S===_,T=l(),O=T&&w,k=!(O&&y),A=(0,b.useRef)(null),j=(0,b.useRef)(null);(0,b.useLayoutEffect)(()=>{j.current?.scrollTo(0,0)},[S]);let M=w?m:_;v({containerRef:A,onBack:(0,b.useCallback)(()=>{C(M)},[C,M]),enabled:T,navKey:S,prefetchHref:M});let N=r(),P=x(w?`sidebarShell.backFrom`:`sidebarShell.backToMenu`,{title:h}),F=(0,D.jsx)(t,{variant:`ghost`,iconOnly:(0,D.jsx)(g,{}),"aria-label":P,tintColor:`var(--content-secondary)`,onClick:()=>E(C,M,`pop`)}),I=(0,D.jsx)(t,{asChild:!0,variant:`outlined`,"aria-label":x(`sidebarShell.backFrom`,{title:h}),className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,D.jsx)(p,{to:m,className:`flex items-center justify-center no-underline`,children:(0,D.jsx)(g,{size:16,"aria-hidden":`true`})})});return(0,D.jsxs)(`div`,{ref:A,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:N?`3.75rem`:`1rem`},children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[F,(0,D.jsx)(o,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:h}),(0,D.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),N?(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,D.jsx)(i,{placement:`electron`,className:`px-0 pt-0`}),(0,D.jsx)(a,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,D.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[I,(0,D.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:h})]}),(0,D.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c})]}),(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[T?null:(0,D.jsx)(`aside`,{className:`w-64 shrink-0 overflow-y-auto`,"aria-label":x(`sidebarShell.navigationAria`,{title:h}),children:e}),O?(0,D.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6`,children:e}):null,k?(0,D.jsx)(`main`,{ref:j,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:px-6 md:pt-0 ${O?`hidden`:`flex`}`,children:s}):null]})]})]})}function k({items:e,bottomItems:t,indexPath:n}){let{t:r}=u(),{pathname:i}=d(),a=f(),o=l(),c=(e,t,r)=>{let{href:c,onSelect:l}=e,u=c!=null&&(i===c||i.startsWith(c+`/`)||!o&&r&&n!=null&&i===n);return(0,D.jsxs)(b.Fragment,{children:[(0,D.jsx)(s.Item,{icon:e.icon,label:e.label,active:u,trailingIcon:c==null?void 0:_,trailingIconClassName:c==null?void 0:`md:hidden`,href:c,onSelect:l,onClick:c==null?void 0:e=>{y(e)||(e.preventDefault(),E(a,c,`push`))}}),!t&&(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,D.jsxs)(`nav`,{"aria-label":r(`sidebarTree.ariaLabel`),className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>c(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{className:`flex-1`}),(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>c(e,n===t.length-1,!1))]})]})}export{O as n,k as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ds as t,Es as n,cv as r,un as i}from"./app-BffxeWB8.js";import{N as a,_ as o,g as s,j as c}from"./vendor-CtuA73w5.js";import{t as l,x as u}from"./react-B9IgSVeK.js";import{n as d,t as f}from"./use-return-to-short-circuit-sIhAEoPs.js";import{t as p}from"./signup-shell-DDOwFm8f.js";var m=e(u(),1),h=l();function g({words:e}){let[t,n]=(0,m.useState)(0),r=(0,m.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,m.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,h.jsxs)(`span`,{className:`signup__rotating`,children:[(0,h.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,h.jsx)(o,{mode:`wait`,children:(0,h.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var _=[`signupScreen.headlineRoles.personalIntelligence`,`signupScreen.headlineRoles.softwareEngineer`,`signupScreen.headlineRoles.financeOps`,`signupScreen.headlineRoles.householdManager`,`signupScreen.headlineRoles.gtmEngineer`,`signupScreen.headlineRoles.productLead`];function v({returnTo:e}){let{t:o}=c(`account`),s=(0,m.useMemo)(()=>_.map(e=>o(e)),[o]),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!1),v=(i,a)=>{u(null),f(!0),r(n,t(e,{authIntent:i}),{returnTo:e,intent:i}).catch(e=>{console.error(a,e),u(o(`authErrors.genericFailure`))}).finally(()=>{f(!1)})};return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`signup__title`,children:[o(`signupScreen.headlineLead`),(0,h.jsx)(`br`,{}),(0,h.jsx)(g,{words:s})]}),(0,h.jsx)(`p`,{className:`signup__subtitle`,children:o(`signupScreen.subtitle`)}),(0,h.jsx)(`div`,{className:`signup__buttons`,children:(0,h.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{v(`signup`,`[signup] auth flow failed:`)},disabled:d,children:o(`signupScreen.continue`)})}),l&&(0,h.jsx)(`p`,{className:`signup__error`,children:l}),(0,h.jsx)(`p`,{className:`signup__footer`,children:(0,h.jsx)(a,{i18nKey:`signupScreen.haveAccountPrompt`,ns:`account`,components:{signIn:(0,h.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{v(void 0,`[signup] sign-in flow failed:`)},disabled:d})}})}),(0,h.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,h.jsx)(i,{size:16}),o(`signupScreen.downloadMac`)]})]})}function y(){let e=f();return e.kind===`wait`?(0,h.jsx)(p,{children:(0,h.jsx)(d,{})}):e.kind===`redirect`?e.node:(0,h.jsx)(v,{returnTo:e.returnTo})}export{y as SignupPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ds as t,Es as n,cv as r,un as i}from"./app-Bevxq2OH.js";import{N as a,_ as o,g as s,j as c}from"./vendor-CtuA73w5.js";import{t as l,x as u}from"./react-B9IgSVeK.js";import{n as d,t as f}from"./use-return-to-short-circuit-DmEpr1I6.js";import{t as p}from"./signup-shell-BFlnJZeT.js";var m=e(u(),1),h=l();function g({words:e}){let[t,n]=(0,m.useState)(0),r=(0,m.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,m.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,h.jsxs)(`span`,{className:`signup__rotating`,children:[(0,h.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,h.jsx)(o,{mode:`wait`,children:(0,h.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var _=[`signupScreen.headlineRoles.personalIntelligence`,`signupScreen.headlineRoles.softwareEngineer`,`signupScreen.headlineRoles.financeOps`,`signupScreen.headlineRoles.householdManager`,`signupScreen.headlineRoles.gtmEngineer`,`signupScreen.headlineRoles.productLead`];function v({returnTo:e}){let{t:o}=c(`account`),s=(0,m.useMemo)(()=>_.map(e=>o(e)),[o]),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!1),v=(i,a)=>{u(null),f(!0),r(n,t(e,{authIntent:i}),{returnTo:e,intent:i}).catch(e=>{console.error(a,e),u(o(`authErrors.genericFailure`))}).finally(()=>{f(!1)})};return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`signup__title`,children:[o(`signupScreen.headlineLead`),(0,h.jsx)(`br`,{}),(0,h.jsx)(g,{words:s})]}),(0,h.jsx)(`p`,{className:`signup__subtitle`,children:o(`signupScreen.subtitle`)}),(0,h.jsx)(`div`,{className:`signup__buttons`,children:(0,h.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{v(`signup`,`[signup] auth flow failed:`)},disabled:d,children:o(`signupScreen.continue`)})}),l&&(0,h.jsx)(`p`,{className:`signup__error`,children:l}),(0,h.jsx)(`p`,{className:`signup__footer`,children:(0,h.jsx)(a,{i18nKey:`signupScreen.haveAccountPrompt`,ns:`account`,components:{signIn:(0,h.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{v(void 0,`[signup] sign-in flow failed:`)},disabled:d})}})}),(0,h.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,h.jsx)(i,{size:16}),o(`signupScreen.downloadMac`)]})]})}function y(){let e=f();return e.kind===`wait`?(0,h.jsx)(p,{children:(0,h.jsx)(d,{})}):e.kind===`redirect`?e.node:(0,h.jsx)(v,{returnTo:e.returnTo})}export{y as SignupPage};
@@ -1 +1 @@
1
- import{qr as e}from"./app-BffxeWB8.js";import{g as t}from"./vendor-CtuA73w5.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({children:n}){return(0,r.jsxs)(t.div,{"data-theme":`dark`,className:`signup`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[(0,r.jsxs)(`div`,{className:`signup__left`,children:[(0,r.jsx)(`div`,{className:`signup__logo`,children:(0,r.jsx)(`img`,{src:e(`/vellum-logo-white.svg`),alt:`Vellum`,width:82,height:25})}),(0,r.jsx)(`div`,{className:`signup__form`,children:n})]}),(0,r.jsx)(t.div,{className:`signup__right`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,delay:.15},"aria-hidden":!0,children:(0,r.jsx)(`video`,{className:`signup__video`,src:e(`/vellum-scene-cut.mp4`),autoPlay:!0,loop:!0,muted:!0,playsInline:!0})})]})}export{i as t};
1
+ import{qr as e}from"./app-Bevxq2OH.js";import{g as t}from"./vendor-CtuA73w5.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({children:n}){return(0,r.jsxs)(t.div,{"data-theme":`dark`,className:`signup`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[(0,r.jsxs)(`div`,{className:`signup__left`,children:[(0,r.jsx)(`div`,{className:`signup__logo`,children:(0,r.jsx)(`img`,{src:e(`/vellum-logo-white.svg`),alt:`Vellum`,width:82,height:25})}),(0,r.jsx)(`div`,{className:`signup__form`,children:n})]}),(0,r.jsx)(t.div,{className:`signup__right`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,delay:.15},"aria-hidden":!0,children:(0,r.jsx)(`video`,{className:`signup__video`,src:e(`/vellum-scene-cut.mp4`),autoPlay:!0,loop:!0,muted:!0,playsInline:!0})})]})}export{i as t};
@@ -1,2 +1,2 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,B_ as n,Fb as r,It as i,Lx as a,Mf as o,On as s,Ox as c,Pf as l,Qb as u,Rt as d,Rx as f,Wb as p,Zx as m,et as h,hx as g,jf as _,kn as v,lp as y,ls as b,m as x,p as S,xc as C}from"./app-BffxeWB8.js";import{Zn as w,er as T,j as E}from"./vendor-CtuA73w5.js";import{_ as D,b as O,d as k,f as A,h as j,r as M,t as N,x as P}from"./react-B9IgSVeK.js";import{E as ee,Ja as te,Jn as F,Jr as I,Ki as L,Or as R,Ra as z,Va as B,Wi as V,Xr as ne,k as H,pi as re,zr as U}from"./icons-DxrLl-Dj.js";import{a as W,n as G,r as K,t as ie}from"./use-skill-actions-VsDYLi1F.js";import{t as ae}from"./diff-rows-Bf-wMfUA.js";import{t as q}from"./skill-icon-B7ALU8Ca.js";import{n as J,t as Y}from"./use-skill-detail-files-4oFtcDS1.js";import{t as oe}from"./skill-removal-dialog-BKxKHM93.js";import{t as se}from"./use-edge-swipe-back-DCbPXF6z.js";import{i as ce,n as le,r as ue,t as X}from"./file-editor--nn3ZR0r.js";var de=te(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Z=e(P(),1),Q=N();function $(){return(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Q.jsx)(F,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}var fe=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,pe=/^diff --git a\/(.+) b\/\1$/;function me(e,t){let n=e.replace(/^[ab]\//,``),r=`skills/${t}/`;return n.startsWith(r)?n.slice(r.length):n}function he(e){let t=e.slice(4).replace(/\t$/,``);return t===`/dev/null`?null:t}function ge(e,t){let n=[],r=null,i=0,a=0,o=!1,s=!1;for(let c of e.split(`
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$x as t,B_ as n,Fb as r,It as i,Lx as a,Mf as o,On as s,Ox as c,Pf as l,Qb as u,Rt as d,Rx as f,Wb as p,Zx as m,et as h,hx as g,jf as _,kn as v,lp as y,ls as b,m as x,p as S,xc as C}from"./app-Bevxq2OH.js";import{Zn as w,er as T,j as E}from"./vendor-CtuA73w5.js";import{_ as D,b as O,d as k,f as A,h as j,r as M,t as N,x as P}from"./react-B9IgSVeK.js";import{E as ee,Ja as te,Jn as F,Jr as I,Ki as L,Or as R,Ra as z,Va as B,Wi as V,Xr as ne,k as H,pi as re,zr as U}from"./icons-DxrLl-Dj.js";import{a as W,n as G,r as K,t as ie}from"./use-skill-actions-D8xWO_74.js";import{t as ae}from"./diff-rows-Bf-wMfUA.js";import{t as q}from"./skill-icon-B7ALU8Ca.js";import{n as J,t as Y}from"./use-skill-detail-files-tb5cSgGr.js";import{t as oe}from"./skill-removal-dialog-DDrOdXOm.js";import{t as se}from"./use-edge-swipe-back-iYvf5Z3Y.js";import{i as ce,n as le,r as ue,t as X}from"./file-editor-yxcARNDB.js";var de=te(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Z=e(P(),1),Q=N();function $(){return(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Q.jsx)(F,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}var fe=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,pe=/^diff --git a\/(.+) b\/\1$/;function me(e,t){let n=e.replace(/^[ab]\//,``),r=`skills/${t}/`;return n.startsWith(r)?n.slice(r.length):n}function he(e){let t=e.slice(4).replace(/\t$/,``);return t===`/dev/null`?null:t}function ge(e,t){let n=[],r=null,i=0,a=0,o=!1,s=!1;for(let c of e.split(`
2
2
  `)){if(c.startsWith(`diff --git `)){r={path:me(pe.exec(c)?.[1]??(c.split(` `).slice(3).join(` `)||``),t),rows:[],added:0,removed:0},n.push(r),i=0,a=0,o=!1,s=!1;continue}if(!r)continue;let e=fe.exec(c);if(e){i=Number(e[1]),a=Number(e[2]),o=!0,r.rows.length>0&&r.rows.push({type:`meta`,text:c});continue}if(!c.startsWith(`\\ No newline`)){if(!o&&(c.startsWith(`+++ `)||c.startsWith(`--- `))){let e=he(c);e!==null&&(c.startsWith(`+++ `)||!s)&&(r.path=me(e,t),s=c.startsWith(`+++ `));continue}!o&&(c.startsWith(`index `)||c.startsWith(`new file mode `)||c.startsWith(`deleted file mode `)||c.startsWith(`similarity index `)||c.startsWith(`rename `)||c.startsWith(`old mode `)||c.startsWith(`new mode `)||c.startsWith(`Binary files `))||(c.startsWith(`+`)?(r.rows.push({type:`add`,text:c.slice(1),newNo:a}),r.added+=1,a+=1):c.startsWith(`-`)?(r.rows.push({type:`del`,text:c.slice(1),oldNo:i}),r.removed+=1,i+=1):c.startsWith(` `)&&(r.rows.push({type:`ctx`,text:c.slice(1),oldNo:i,newNo:a}),i+=1,a+=1))}}return{files:n,added:n.reduce((e,t)=>e+t.added,0),removed:n.reduce((e,t)=>e+t.removed,0)}}async function _e(e,t,r){let{data:i,error:a,response:o}=await n({path:{assistant_id:e,id:t},throwOnError:!1,signal:r});if(!o||!o.ok){if(o?.status===404)return null;throw o?u(a,o):a??Error(`Failed to fetch skill history.`)}return i??null}function ve(e){return e.isLoading?!1:e.isError||e.revisionCount>0}function ye(e,t){let n=!!(e&&t),r=w({queryKey:o({path:{assistant_id:e??``,id:t}}),queryFn:({signal:n})=>_e(e??``,t,n),enabled:n,refetchOnWindowFocus:!1});return{history:r.data??null,revisions:r.data?.revisions??[],truncatedByCompaction:r.data?.truncatedByCompaction??!1,isLoading:r.isLoading,isError:r.isError}}function be({assistantId:e,skillId:t}){let{t:n}=E(`intelligence`),{revisions:r,truncatedByCompaction:i,isLoading:a,isError:o}=ye(e,t);return a?(0,Q.jsx)($,{}):o?(0,Q.jsx)(Se,{children:n(`skillRevisionHistory.loadError`)}):(0,Q.jsx)(xe,{skillId:t,revisions:r,truncatedByCompaction:i})}function xe({skillId:e,revisions:t,truncatedByCompaction:n}){let{t:r}=E(`intelligence`);return t.length===0?(0,Q.jsx)(Se,{children:r(`skillRevisionHistory.noChanges`)}):(0,Q.jsxs)(g.Root,{type:`multiple`,className:`flex flex-col gap-2 p-3`,children:[t.map(t=>(0,Q.jsx)(Ce,{revision:t,skillId:e},t.id)),n&&(0,Q.jsx)(`p`,{className:`px-1 pt-1 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:r(`skillRevisionHistory.truncatedNotice`)})]})}function Se({children:e}){return(0,Q.jsx)(`p`,{className:`px-3 py-10 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e})}function Ce({revision:e,skillId:t}){let{t:n}=E(`intelligence`),r=(0,Z.useMemo)(()=>ge(e.diff,t),[e.diff,t]);return(0,Q.jsxs)(g.Item,{value:e.id,className:`overflow-hidden rounded-md border`,style:{borderColor:`var(--border-base)`},children:[(0,Q.jsxs)(g.Trigger,{className:`group flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-[var(--surface-hover)]`,children:[(0,Q.jsx)(V,{className:`h-4 w-4 shrink-0 transition-transform group-data-[state=open]:rotate-90`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:d(e.changedAt)}),(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:e.files.join(` · `)})]}),r.added>0&&(0,Q.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-positive-strong)`},children:[`+`,r.added]}),r.removed>0&&(0,Q.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-negative-strong)`},children:[`−`,r.removed]})]}),(0,Q.jsxs)(g.Content,{className:`border-t`,style:{borderColor:`var(--border-base)`},children:[(0,Q.jsx)(`p`,{className:`px-3 py-2 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:i(e.changedAt)}),r.files.length===0?(0,Q.jsx)(`p`,{className:`px-3 pb-3 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:n(`skillRevisionHistory.noPreviewForChange`)}):r.files.map(e=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`border-t px-3 py-1.5 font-mono text-body-small-default`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:e.path}),(0,Q.jsx)(`div`,{className:`py-1`,children:(0,Q.jsx)(ae,{rows:e.rows})})]},e.path))]})]})}function we(e){return e===`history`?`history`:`files`}function Te({assistantId:e,skill:n,tab:r,onTabChange:i,onBack:a,backToConversation:o=!1,onInstall:s,onRemove:c,isInstalling:l=!1,isRemoving:u=!1,sourceConversationId:d}){let{t:p}=E(`intelligence`),h=K(n),g=x(n),{fileEntries:_,setSelectedPath:v,activePath:y,activeFile:b,isFilesLoading:S,fileContent:C,isBinary:w,isContentLoading:T}=Y(e,n.id),{revisions:D,isLoading:O,isError:k}=ye(e,n.id),A=ve({isLoading:O,isError:k,revisionCount:D.length}),j=A?r:`files`,M=(0,Q.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Q.jsx)(t,{type:`button`,variant:`ghost`,iconOnly:(0,Q.jsx)(z,{"aria-hidden":!0}),"aria-label":p(o?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:a}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Q.jsx)(q,{skill:n,className:`h-8 w-8 text-3xl`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:n.name}),(0,Q.jsx)(W,{origin:n.origin})]}),(0,Q.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:n.description}),(0,Q.jsx)(J,{skill:{origin:n.origin,sourceConversationId:d},className:`mt-1`})]})]}),h?l?(0,Q.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Q.jsx)(F,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Q.jsx)(t,{type:`button`,onClick:s,disabled:!s,leftIcon:(0,Q.jsx)(B,{"aria-hidden":!0}),children:p(`skillDetail.install`)}):(0,Q.jsx)(t,{type:`button`,variant:g?`dangerOutline`:`outlined`,onClick:c,disabled:!g||u||!c,leftIcon:u?(0,Q.jsx)(F,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(H,{"aria-hidden":!0}),children:p(`skillDetail.remove`)})]})]}),N=(0,Q.jsx)(m.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Q.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:S?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(F,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):_.length===0?(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:p(`skillDetail.noFilesAvailable`)}):_.map(e=>{let t=y===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>v(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Q.jsx)(R,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Q.jsx)(U,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:T?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(F,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):b?(0,Q.jsx)(Ee,{assistantId:e,skillId:n.id,fileName:b.name,filePath:b.path,content:C,isBinary:w,editable:n.kind===`installed`},`${n.id}/${b.path}`):(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:p(`skillDetail.selectFilePrompt`)})})]})});return(0,Q.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[M,(0,Q.jsxs)(f.Root,{value:j,onValueChange:e=>i(we(e)),className:`flex min-h-0 flex-1 flex-col`,children:[A&&(0,Q.jsxs)(f.List,{className:`mb-3`,children:[(0,Q.jsx)(f.Trigger,{value:`files`,children:p(`skillDetail.filesTab`)}),(0,Q.jsx)(f.Trigger,{value:`history`,children:p(`skillDetail.historyTab`)})]}),(0,Q.jsx)(f.Panel,{value:`files`,forceMount:!0,className:`min-h-0 flex-1 flex-col`,style:{display:j===`files`?`flex`:`none`},children:N}),A&&(0,Q.jsx)(f.Panel,{value:`history`,className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(m.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,Q.jsx)(be,{assistantId:e,skillId:n.id})})})})]})]})}function Ee({assistantId:e,skillId:n,fileName:r,filePath:i,content:a,isBinary:o,editable:c}){let{t:l}=E(`intelligence`),u=T(),[d,f]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(``),g=`skills/${n}/${i}`,_=y({onSuccess:()=>{f(!1),h(``),u.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),u.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),u.invalidateQueries({queryKey:[{_id:`skillsByIdHistoryGet`}]}),i===`SKILL.md`&&S(u,e)},onError:e=>{p(e,{context:`skill-file-save`,bestEffort:!0})}}),x=d&&m!==(a??``),C=(0,Z.useCallback)(()=>{!x||_.isPending||_.mutate({path:{assistant_id:e},body:{path:g,content:m,encoding:`utf8`}})},[x,_,e,g,m]),w=(0,Z.useCallback)(()=>{f(!0),h(a??``),_.reset()},[a,_]),D=(0,Z.useCallback)(()=>{f(!1),h(``),_.reset()},[_]);if(o)return(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:l(`skillFileContent.binaryFile`)});if(a===null)return(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:l(`skillFileContent.noPreviewAvailable`,{fileName:r})});let O=c?(0,Q.jsx)(t,{variant:`ghost`,size:`regular`,iconOnly:(0,Q.jsx)(ne,{"aria-hidden":!0}),onClick:()=>void b(g),"aria-label":l(`skillDetail.openInWorkspaceAriaLabel`),className:`hover:bg-[var(--surface-base)]`}):void 0;return v(r,void 0)&&!d?(0,Q.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Q.jsx)(X,{content:a,fileName:r,showEdit:c,isEditing:!1,onToggleEdit:w,extraActions:O}),(0,Q.jsx)(s,{content:a})]})}):(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(X,{content:d?m:a,fileName:r,showEdit:c,isEditing:d,onToggleEdit:()=>d?D():w(),extraActions:O}),d?(0,Q.jsx)(ue,{value:m,onChange:h,onSave:C}):(0,Q.jsx)(ce,{content:a,readOnly:!c,onStartEdit:w})]}),d&&(0,Q.jsx)(le,{isDirty:x,isSaving:_.isPending,error:_.isError?l(`skillDetail.saveFailed`):null,onSave:C,onDiscard:D})]})}var De=e(O(),1);function Oe({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){let{t:i}=E(`intelligence`);return n?(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:i(`skillFileContent.binaryFile`)}):t===null?(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:i(`skillFileContent.noPreviewAvailable`,{fileName:e})}):v(e,void 0)&&r===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Q.jsx)(s,{content:t})}):(0,Q.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function ke({assistantId:e,skill:n,onBack:r,backToConversation:i=!1,onInstall:o,onRemove:s,isInstalling:c=!1,isRemoving:l=!1,swipeContainerRef:u,sourceConversationId:d}){let{t:f}=E(`intelligence`),p=K(n),h=x(n),{fileEntries:g,setSelectedPath:_,activePath:y,activeFile:b,isFilesLoading:S,fileContent:C,isBinary:w,isContentLoading:T}=Y(e,n.id),[D,O]=(0,Z.useState)(`preview`);(0,Z.useEffect)(()=>{O(`preview`)},[y]);let[k,A]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{A(document.getElementById(`viewport-overlays`))},[]);let j=b?v(b.name,void 0):!1,M=j?D:`raw`,N=(0,Q.jsxs)(`div`,{ref:u,className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(t,{variant:`ghost`,iconOnly:(0,Q.jsx)(z,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":f(i?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:r,className:`max-md:bg-[var(--surface-active)]`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:n.name}),(0,Q.jsx)(Ae,{available:p,removable:h,isInstalling:c,isRemoving:l,onInstall:o,onRemove:s})]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(q,{skill:n,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Q.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:n.name})]}),(0,Q.jsx)(W,{origin:n.origin})]}),(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n.description}),(0,Q.jsx)(J,{skill:{origin:n.origin,sourceConversationId:d}})]}),(0,Q.jsx)(m.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Q.jsx)(Me,{fileEntries:g,activePath:y,activeName:b?.name??null,onSelect:_}),(0,Q.jsx)(a,{iconOnly:!0,ariaLabel:f(`skillDetail.fileViewModeAriaLabel`),value:M,onChange:O,items:[{value:`preview`,label:f(`skillDetail.preview`),icon:(0,Q.jsx)(I,{"aria-hidden":!0}),disabled:!j},{value:`raw`,label:f(`skillDetail.source`),icon:(0,Q.jsx)(re,{"aria-hidden":!0})}]})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:S||T?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(F,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):b?(0,Q.jsx)(Oe,{fileName:b.name,content:C,isBinary:w,viewMode:M}):(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:f(`skillDetail.selectFilePrompt`)})})]})})]});return k?(0,De.createPortal)(N,k):N}function Ae({available:e,removable:n,isInstalling:r,isRemoving:i,onInstall:a,onRemove:o}){let{t:s}=E(`intelligence`);return r||i?(0,Q.jsx)(t,{variant:`ghost`,iconOnly:(0,Q.jsx)(F,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":s(`skillDetail.pendingAriaLabel`),className:`max-md:bg-[var(--surface-active)]`}):e?(0,Q.jsx)(t,{variant:`ghost`,iconOnly:(0,Q.jsx)(B,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.installSkillAriaLabel`),onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):n?(0,Q.jsx)(t,{variant:`dangerGhost`,iconOnly:(0,Q.jsx)(H,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.removeSkillAriaLabel`),onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Q.jsx)(t,{variant:`dangerGhost`,iconOnly:(0,Q.jsx)(H,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:s(`skillRow.bundledSkillsCannotBeRemoved`),"aria-label":s(`skillRow.bundledSkillCannotBeRemovedAriaLabel`),className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function je(e){return(e??``).endsWith(`/directory`)}function Me({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let{t:i}=E(`intelligence`),a=n??i(`skillDetail.selectAFile`);return e.length===0?(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Q.jsx)(Ne,{}),(0,Q.jsx)(`span`,{className:`truncate`,children:a})]}):(0,Q.jsxs)(c.Root,{children:[(0,Q.jsx)(c.Trigger,{children:(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Q.jsx)(Ne,{}),(0,Q.jsx)(`span`,{className:`truncate`,children:a}),(0,Q.jsx)(L,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Q.jsx)(c.Content,{align:`start`,children:e.map(e=>{let n=je(e.mimeType);return(0,Q.jsx)(c.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Q.jsx)(R,{}):(0,Q.jsx)(U,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Ne(){return(0,Q.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Q.jsx)(U,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function Pe(){let{t:e}=E(`intelligence`);return(0,Q.jsx)(G,{icon:ee,iconColor:`var(--system-danger)`,title:e(`skillsErrorState.title`),subtitle:e(`skillsErrorState.subtitle`)})}function Fe(){let{t:e}=E(`intelligence`),n=h(),{skillId:i}=j(),a=A(),o=k(),{pathname:s}=o,c=C(),u=(0,Z.useRef)(null),d=o.state,f=typeof d?.listSearch==`string`?d.listSearch:``,p=typeof d?.backTo==`string`&&d.backTo.startsWith(`/`)&&!d.backTo.startsWith(`//`)?d.backTo:null,[m,g]=D(),v=we(m.get(`tab`)),y=(0,Z.useCallback)(e=>{let t=new URLSearchParams(m);e===`history`?t.set(`tab`,`history`):t.delete(`tab`),g(t,{replace:!0,state:o.state})},[m,g,o.state]),b=w({...l({path:{assistant_id:n},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),x=p??`${r.superpowers}${f}`,S=(0,Z.useCallback)(()=>{a(x)},[a,x]),T=(0,Z.useCallback)(()=>{a(x,{replace:!0})},[a,x]);se({containerRef:u,onBack:S,enabled:c,navKey:s,prefetchHref:x.split(`?`)[0]??x});let{handleInstall:O,handleRemove:N,isInstallingSkill:P,isRemovingSkill:ee,skillPendingRemoval:te,confirmRemove:F,cancelRemove:I}=ie(n,{onRemoved:T}),L=b.data,R=(0,Z.useMemo)(()=>L?.find(e=>e.id===i)??null,[L,i]),B=w({..._({path:{assistant_id:n,id:i??``}}),enabled:!!i&&R?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!i)return(0,Q.jsx)(M,{to:r.superpowers,replace:!0});if(b.isLoading)return(0,Q.jsx)($,{});if(b.isError&&!R)return(0,Q.jsx)(Pe,{});if(!R&&b.isFetching)return(0,Q.jsx)($,{});if(!R)return(0,Q.jsx)(G,{icon:de,title:e(`skillDetailPage.notFoundTitle`),subtitle:e(`skillDetailPage.notFoundSubtitle`),children:(0,Q.jsx)(t,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Q.jsx)(z,{"aria-hidden":!0}),onClick:S,children:e(p?`skillDetailPage.backToConversation`:`skillDetailPage.backToSuperpowers`)})});let V={assistantId:n,skill:R,onBack:S,backToConversation:p!==null,onInstall:()=>O(R),onRemove:()=>N(R),isInstalling:P(R),isRemoving:ee(R),sourceConversationId:B.data??void 0};return(0,Q.jsxs)(Q.Fragment,{children:[c?(0,Q.jsx)(ke,{...V,swipeContainerRef:u}):(0,Q.jsx)(Te,{...V,tab:v,onTabChange:y}),(0,Q.jsx)(oe,{skillName:te?.name??null,onConfirm:F,onCancel:I})]})}export{Fe as SkillDetailPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$n as t,$x as n,Fb as r,On as i,Ox as a,Qx as o,Wb as s,Zn as c,_y as l,cp as u,h as d,jf as f,m as p,p as m}from"./app-BffxeWB8.js";import{Zn as h,er as g,j as _}from"./vendor-CtuA73w5.js";import{d as v,f as y,t as b,x}from"./react-B9IgSVeK.js";import{Jn as S,Qr as C,k as w,ma as T}from"./icons-DxrLl-Dj.js";import{n as E,t as D}from"./use-skill-detail-files-4oFtcDS1.js";import{t as O}from"./skill-removal-dialog-BKxKHM93.js";var k=e(x(),1),A=b();function j({skillId:e,onClose:b}){let{t:x}=_(`chat`),j=y(),M=v(),N=g(),P=l.use.activeAssistantId(),[F,I]=(0,k.useState)(!1),L=h({...f({path:{assistant_id:P??``,id:e}}),select:e=>e.skill,enabled:!!P}),R=L.data,{skillMd:z,fileContent:B,isFilesPending:V,isContentPending:H}=D(P,e),U=u({onSuccess:()=>{P&&m(N,P),b()},onError:e=>{s(e,{context:`skill-detail-panel-remove`})}}),W=()=>{P&&(U.mutate({path:{assistant_id:P,id:e}}),I(!1))},G=L.isPending||V||z!=null&&H,K=R!=null&&p(R);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(c,{icon:R?.emoji?(0,A.jsx)(`span`,{className:`text-xl leading-none`,"aria-hidden":!0,children:R.emoji}):void 0,Glyph:T,title:R?.name??x(`skillDetailPanel.titleFallback`),closeLabel:x(`skillDetailPanel.closeDetails`),onClose:b,headerActions:K?(0,A.jsxs)(a.Root,{children:[(0,A.jsx)(a.Trigger,{asChild:!0,children:(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(C,{}),"aria-label":x(`skillDetailPanel.actionsAria`),tooltip:x(`skillDetailPanel.moreTooltip`),className:`shrink-0`})}),(0,A.jsx)(a.Content,{side:`bottom`,align:`end`,children:(0,A.jsx)(a.Item,{leftIcon:(0,A.jsx)(w,{size:14}),onSelect:()=>I(!0),children:x(`skillDetailPanel.removeSkill`)})})]}):void 0,footer:(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsx)(n,{onClick:()=>{b(),j(r.skills.detail(e),{state:d(M)})},children:x(`skillDetailPanel.goToSkill`)})}),children:L.isError&&!R?(0,A.jsx)(t,{children:x(`skillDetailPanel.loadError`)}):G?(0,A.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,A.jsx)(S,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,A.jsxs)(A.Fragment,{children:[R?.description&&(0,A.jsx)(o,{variant:`body-medium-lighter`,as:`p`,className:`mb-4 text-[var(--content-secondary)]`,children:R.description}),R&&(0,A.jsx)(E,{skill:R,className:`mb-4`,onNavigate:b}),B&&(0,A.jsx)(i,{content:B})]})}),(0,A.jsx)(O,{skillName:F&&R?R.name:null,onConfirm:W,onCancel:()=>I(!1)})]})}export{j as SkillDetailPanel};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$n as t,$x as n,Fb as r,On as i,Ox as a,Qx as o,Wb as s,Zn as c,_y as l,cp as u,h as d,jf as f,m as p,p as m}from"./app-Bevxq2OH.js";import{Zn as h,er as g,j as _}from"./vendor-CtuA73w5.js";import{d as v,f as y,t as b,x}from"./react-B9IgSVeK.js";import{Jn as S,Qr as C,k as w,ma as T}from"./icons-DxrLl-Dj.js";import{n as E,t as D}from"./use-skill-detail-files-tb5cSgGr.js";import{t as O}from"./skill-removal-dialog-DDrOdXOm.js";var k=e(x(),1),A=b();function j({skillId:e,onClose:b}){let{t:x}=_(`chat`),j=y(),M=v(),N=g(),P=l.use.activeAssistantId(),[F,I]=(0,k.useState)(!1),L=h({...f({path:{assistant_id:P??``,id:e}}),select:e=>e.skill,enabled:!!P}),R=L.data,{skillMd:z,fileContent:B,isFilesPending:V,isContentPending:H}=D(P,e),U=u({onSuccess:()=>{P&&m(N,P),b()},onError:e=>{s(e,{context:`skill-detail-panel-remove`})}}),W=()=>{P&&(U.mutate({path:{assistant_id:P,id:e}}),I(!1))},G=L.isPending||V||z!=null&&H,K=R!=null&&p(R);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(c,{icon:R?.emoji?(0,A.jsx)(`span`,{className:`text-xl leading-none`,"aria-hidden":!0,children:R.emoji}):void 0,Glyph:T,title:R?.name??x(`skillDetailPanel.titleFallback`),closeLabel:x(`skillDetailPanel.closeDetails`),onClose:b,headerActions:K?(0,A.jsxs)(a.Root,{children:[(0,A.jsx)(a.Trigger,{asChild:!0,children:(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(C,{}),"aria-label":x(`skillDetailPanel.actionsAria`),tooltip:x(`skillDetailPanel.moreTooltip`),className:`shrink-0`})}),(0,A.jsx)(a.Content,{side:`bottom`,align:`end`,children:(0,A.jsx)(a.Item,{leftIcon:(0,A.jsx)(w,{size:14}),onSelect:()=>I(!0),children:x(`skillDetailPanel.removeSkill`)})})]}):void 0,footer:(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsx)(n,{onClick:()=>{b(),j(r.skills.detail(e),{state:d(M)})},children:x(`skillDetailPanel.goToSkill`)})}),children:L.isError&&!R?(0,A.jsx)(t,{children:x(`skillDetailPanel.loadError`)}):G?(0,A.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,A.jsx)(S,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,A.jsxs)(A.Fragment,{children:[R?.description&&(0,A.jsx)(o,{variant:`body-medium-lighter`,as:`p`,className:`mb-4 text-[var(--content-secondary)]`,children:R.description}),R&&(0,A.jsx)(E,{skill:R,className:`mb-4`,onNavigate:b}),B&&(0,A.jsx)(i,{content:B})]})}),(0,A.jsx)(O,{skillName:F&&R?R.name:null,onConfirm:W,onCancel:()=>I(!1)})]})}export{j as SkillDetailPanel};
@@ -1 +1 @@
1
- import{Mx as e}from"./app-BffxeWB8.js";import{j as t}from"./vendor-CtuA73w5.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({skillName:n,onConfirm:i,onCancel:a}){let{t:o}=t();return(0,r.jsx)(e,{open:n!==null,title:o(`skillRemovalDialog.title`),message:n?o(`skillRemovalDialog.message`,{name:n}):``,confirmLabel:o(`skillRemovalDialog.remove`),destructive:!0,onConfirm:i,onCancel:a})}export{i as t};
1
+ import{Mx as e}from"./app-Bevxq2OH.js";import{j as t}from"./vendor-CtuA73w5.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({skillName:n,onConfirm:i,onCancel:a}){let{t:o}=t();return(0,r.jsx)(e,{open:n!==null,title:o(`skillRemovalDialog.title`),message:n?o(`skillRemovalDialog.message`,{name:n}):``,confirmLabel:o(`skillRemovalDialog.remove`),destructive:!0,onConfirm:i,onCancel:a})}export{i as t};
@@ -1 +1 @@
1
- import{Fb as e}from"./app-BffxeWB8.js";import{_ as t,r as n,t as r}from"./react-B9IgSVeK.js";var i=r();function a(){let[r]=t(),a=r.get(`skill`);if(a)return(0,i.jsx)(n,{to:e.skills.detail(a),replace:!0});let o=r.toString();return(0,i.jsx)(n,{to:`${e.superpowers}${o?`?${o}`:``}`,replace:!0})}export{a as SkillsPage};
1
+ import{Fb as e}from"./app-Bevxq2OH.js";import{_ as t,r as n,t as r}from"./react-B9IgSVeK.js";var i=r();function a(){let[r]=t(),a=r.get(`skill`);if(a)return(0,i.jsx)(n,{to:e.skills.detail(a),replace:!0});let o=r.toString();return(0,i.jsx)(n,{to:`${e.superpowers}${o?`?${o}`:``}`,replace:!0})}export{a as SkillsPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Cc as t,Ff as n,Hx as r,If as i,Lf as a,Rf as o,Sc as s,Tc as c,Zx as l,et as u,wc as d}from"./app-BffxeWB8.js";import{Jn as f,Zn as p,er as m,j as h}from"./vendor-CtuA73w5.js";import{t as g,x as _}from"./react-B9IgSVeK.js";import{Ki as v,Rt as y,k as b}from"./icons-DxrLl-Dj.js";var x=e(_(),1),S=g(),C={task_complete:`soundsSections.soundEventTaskComplete`,needs_input:`soundsSections.soundEventNeedsInput`,task_failed:`soundsSections.soundEventTaskFailed`,notification:`soundsSections.soundEventNotification`,new_conversation:`soundsSections.soundEventNewConversation`,message_sent:`soundsSections.soundEventMessageSent`,character_poke:`soundsSections.soundEventCharacterPoke`,random:`soundsSections.soundEventRandom`};function w(e,t){return t(C[e])}function T({label:e,description:t,checked:n,disabled:i,onChange:a}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(r,{checked:n,disabled:i,onChange:a,label:e})]})}function E(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function D({event:e,eventConfig:t,availableSounds:n,globalEnabled:i,onToggle:a,onAddSound:o,onRemoveSound:s,onPreview:l,t:u}){let[d,f]=(0,x.useState)(!1),p=w(e,u),m=n.filter(e=>!t.sounds.includes(e.filename)),h=n.length>0&&m.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:p}),(0,S.jsx)(r,{checked:t.enabled,disabled:!i,onChange:a,label:u(`soundsSections.enableEvent`,{eventName:p})})]}),t.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:u(`soundsSections.defaultBlip`)}):t.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:c(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":u(`soundsSections.previewSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(y,{className:`h-3 w-3`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":u(`soundsSections.removeSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(b,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:u(`soundsSections.noSoundFiles`)}):h?(0,S.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:u(`soundsSections.allSoundsAdded`)}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>f(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[u(`soundsSections.addSound`),(0,S.jsx)(v,{className:`h-3 w-3`})]}),d&&(0,S.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>f(!1),children:m.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{o(e.filename),f(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function O(){let{t:e}=h(`settings`),r=m(),c=u(),g=(0,x.useMemo)(()=>i({path:{assistant_id:c}}),[c]),_=(0,x.useMemo)(()=>n({path:{assistant_id:c}}),[c]),{data:v}=p(g),{data:b}=p(_),C=v??d(),w=b?.sounds??[],O=(0,x.useMemo)(()=>({path:{assistant_id:c}}),[c]),k=f({...o(O),onMutate:async e=>{await r.cancelQueries({queryKey:g.queryKey});let t=r.getQueryData(g.queryKey);return a(r,O,e.body),{previous:t}},onError:(e,t,n)=>{n?.previous!==void 0&&a(r,O,n.previous)},onSettled:()=>{r.invalidateQueries({queryKey:g.queryKey})}}),A=(0,x.useCallback)(e=>{let t=e(r.getQueryData(g.queryKey)??d());k.mutate({path:{assistant_id:c},body:t})},[c,g.queryKey,r,k]),j=e=>{A(t=>({...t,globalEnabled:e}))},M=e=>{A(t=>({...t,volume:e}))},[N,P]=(0,x.useState)(null),F=N??C.volume,I=(e,t)=>{A(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},L=(e,t)=>{A(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},R=(e,t)=>{A(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},z=()=>{s().previewFallbackBlip(C.volume)},B=e=>{s().previewSound(e,C.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(l,{children:[(0,S.jsx)(T,{label:e(`soundsSections.enableSoundEffects`),description:e(`soundsSections.enableSoundEffectsDescription`),checked:C.globalEnabled,onChange:j}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.volume`)}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:F,onChange:e=>P(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},className:`h-1 w-48 cursor-pointer`,disabled:!C.globalEnabled,"aria-label":e(`soundsSections.volumeAriaLabel`)}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(F*100),`%`]})]}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.previewDefaultBlip`)}),(0,S.jsxs)(`button`,{type:`button`,onClick:z,disabled:!C.globalEnabled,className:`inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] transition-colors hover:bg-[var(--surface-hover)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(y,{className:`h-3.5 w-3.5`}),e(`soundsSections.preview`)]})]})]}),(0,S.jsxs)(l,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:e(`soundsSections.soundEventsTitle`)}),(0,S.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`soundsSections.soundEventsDescription`)})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:t.map(t=>(0,S.jsx)(D,{event:t,eventConfig:C.events[t]??{enabled:!1,sounds:[]},availableSounds:w,globalEnabled:C.globalEnabled,onToggle:e=>I(t,e),onAddSound:e=>L(t,e),onRemoveSound:e=>R(t,e),onPreview:e=>B(e),t:e},t))})]})]})}function k(){return(0,S.jsx)(O,{})}export{k as SoundsPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Cc as t,Ff as n,Hx as r,If as i,Lf as a,Rf as o,Sc as s,Tc as c,Zx as l,et as u,wc as d}from"./app-Bevxq2OH.js";import{Jn as f,Zn as p,er as m,j as h}from"./vendor-CtuA73w5.js";import{t as g,x as _}from"./react-B9IgSVeK.js";import{Ki as v,Rt as y,k as b}from"./icons-DxrLl-Dj.js";var x=e(_(),1),S=g(),C={task_complete:`soundsSections.soundEventTaskComplete`,needs_input:`soundsSections.soundEventNeedsInput`,task_failed:`soundsSections.soundEventTaskFailed`,notification:`soundsSections.soundEventNotification`,new_conversation:`soundsSections.soundEventNewConversation`,message_sent:`soundsSections.soundEventMessageSent`,character_poke:`soundsSections.soundEventCharacterPoke`,random:`soundsSections.soundEventRandom`};function w(e,t){return t(C[e])}function T({label:e,description:t,checked:n,disabled:i,onChange:a}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(r,{checked:n,disabled:i,onChange:a,label:e})]})}function E(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function D({event:e,eventConfig:t,availableSounds:n,globalEnabled:i,onToggle:a,onAddSound:o,onRemoveSound:s,onPreview:l,t:u}){let[d,f]=(0,x.useState)(!1),p=w(e,u),m=n.filter(e=>!t.sounds.includes(e.filename)),h=n.length>0&&m.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:p}),(0,S.jsx)(r,{checked:t.enabled,disabled:!i,onChange:a,label:u(`soundsSections.enableEvent`,{eventName:p})})]}),t.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:u(`soundsSections.defaultBlip`)}):t.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:c(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":u(`soundsSections.previewSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(y,{className:`h-3 w-3`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":u(`soundsSections.removeSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(b,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:u(`soundsSections.noSoundFiles`)}):h?(0,S.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:u(`soundsSections.allSoundsAdded`)}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>f(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[u(`soundsSections.addSound`),(0,S.jsx)(v,{className:`h-3 w-3`})]}),d&&(0,S.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>f(!1),children:m.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{o(e.filename),f(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function O(){let{t:e}=h(`settings`),r=m(),c=u(),g=(0,x.useMemo)(()=>i({path:{assistant_id:c}}),[c]),_=(0,x.useMemo)(()=>n({path:{assistant_id:c}}),[c]),{data:v}=p(g),{data:b}=p(_),C=v??d(),w=b?.sounds??[],O=(0,x.useMemo)(()=>({path:{assistant_id:c}}),[c]),k=f({...o(O),onMutate:async e=>{await r.cancelQueries({queryKey:g.queryKey});let t=r.getQueryData(g.queryKey);return a(r,O,e.body),{previous:t}},onError:(e,t,n)=>{n?.previous!==void 0&&a(r,O,n.previous)},onSettled:()=>{r.invalidateQueries({queryKey:g.queryKey})}}),A=(0,x.useCallback)(e=>{let t=e(r.getQueryData(g.queryKey)??d());k.mutate({path:{assistant_id:c},body:t})},[c,g.queryKey,r,k]),j=e=>{A(t=>({...t,globalEnabled:e}))},M=e=>{A(t=>({...t,volume:e}))},[N,P]=(0,x.useState)(null),F=N??C.volume,I=(e,t)=>{A(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},L=(e,t)=>{A(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},R=(e,t)=>{A(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},z=()=>{s().previewFallbackBlip(C.volume)},B=e=>{s().previewSound(e,C.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(l,{children:[(0,S.jsx)(T,{label:e(`soundsSections.enableSoundEffects`),description:e(`soundsSections.enableSoundEffectsDescription`),checked:C.globalEnabled,onChange:j}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.volume`)}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:F,onChange:e=>P(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},className:`h-1 w-48 cursor-pointer`,disabled:!C.globalEnabled,"aria-label":e(`soundsSections.volumeAriaLabel`)}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(F*100),`%`]})]}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.previewDefaultBlip`)}),(0,S.jsxs)(`button`,{type:`button`,onClick:z,disabled:!C.globalEnabled,className:`inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] transition-colors hover:bg-[var(--surface-hover)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(y,{className:`h-3.5 w-3.5`}),e(`soundsSections.preview`)]})]})]}),(0,S.jsxs)(l,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:e(`soundsSections.soundEventsTitle`)}),(0,S.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`soundsSections.soundEventsDescription`)})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:t.map(t=>(0,S.jsx)(D,{event:t,eventConfig:C.events[t]??{enabled:!1,sounds:[]},availableSounds:w,globalEnabled:C.globalEnabled,onToggle:e=>I(t,e),onAddSound:e=>L(t,e),onRemoveSound:e=>R(t,e),onPreview:e=>B(e),t:e},t))})]})]})}function k(){return(0,S.jsx)(O,{})}export{k as SoundsPage};
@@ -1 +1 @@
1
- import{$x as e,Fb as t,Kr as n,Tv as r,Xr as i}from"./app-BffxeWB8.js";import{j as a}from"./vendor-CtuA73w5.js";import{f as o,t as s}from"./react-B9IgSVeK.js";var c=s();function l(){let{t:s}=a(`onboarding`),l=o();return(0,c.jsx)(n,{avatarWave:`around`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 md:min-h-full md:pb-6 text-[var(--content-default)]`,children:(0,c.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,c.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:s(`welcome.title`)}),(0,c.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:s(`welcome.body`)}),(0,c.jsx)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,c.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>void l(`${t.onboarding.privacy}?${r}=1`,i),children:s(`startScreen.createAssistant`)})})]})})})}export{l as StartScreen};
1
+ import{$x as e,Fb as t,Kr as n,Tv as r,Xr as i}from"./app-Bevxq2OH.js";import{j as a}from"./vendor-CtuA73w5.js";import{f as o,t as s}from"./react-B9IgSVeK.js";var c=s();function l(){let{t:s}=a(`onboarding`),l=o();return(0,c.jsx)(n,{avatarWave:`around`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 md:min-h-full md:pb-6 text-[var(--content-default)]`,children:(0,c.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,c.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:s(`welcome.title`)}),(0,c.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:s(`welcome.body`)}),(0,c.jsx)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,c.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>void l(`${t.onboarding.privacy}?${r}=1`,i),children:s(`startScreen.createAssistant`)})})]})})})}export{l as StartScreen};
@@ -1 +1 @@
1
- import{Fx as e,rt as t}from"./app-BffxeWB8.js";import{j as n}from"./vendor-CtuA73w5.js";import{t as r}from"./react-B9IgSVeK.js";var i=r();function a({open:r,onOpenChange:a,title:o,currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d}){let{t:f}=n();return(0,i.jsx)(e.Root,{open:r,onOpenChange:a,children:(0,i.jsxs)(e.Content,{size:`sm`,onOpenAutoFocus:e=>{e.preventDefault(),e.target?.querySelector(`input[role="combobox"]`)?.focus()},children:[(0,i.jsxs)(e.Header,{children:[(0,i.jsx)(e.Title,{children:o}),(0,i.jsx)(e.Description,{children:f(`sttLanguagePickerModal.description`)})]}),(0,i.jsx)(e.Body,{children:(0,i.jsx)(t,{currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d,onDone:()=>a(!1)})})]})})}export{a as t};
1
+ import{Fx as e,rt as t}from"./app-Bevxq2OH.js";import{j as n}from"./vendor-CtuA73w5.js";import{t as r}from"./react-B9IgSVeK.js";var i=r();function a({open:r,onOpenChange:a,title:o,currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d}){let{t:f}=n();return(0,i.jsx)(e.Root,{open:r,onOpenChange:a,children:(0,i.jsxs)(e.Content,{size:`sm`,onOpenAutoFocus:e=>{e.preventDefault(),e.target?.querySelector(`input[role="combobox"]`)?.focus()},children:[(0,i.jsxs)(e.Header,{children:[(0,i.jsx)(e.Title,{children:o}),(0,i.jsx)(e.Description,{children:f(`sttLanguagePickerModal.description`)})]}),(0,i.jsx)(e.Body,{children:(0,i.jsx)(t,{currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d,onDone:()=>a(!1)})})]})})}export{a as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$n as t,$x as n,At as r,Ct as i,Dt as a,Fn as o,Gn as s,Hn as c,In as l,Kn as u,Mc as d,Nc as f,Ot as p,Pc as m,Pn as h,Qx as g,Tt as _,Un as v,Wn as y,Yr as b,Zn as x,_t as S,bt as C,jc as w,kt as T,qa as E,qn as D,vt as O,wn as k,wt as A,xt as j,yt as M}from"./app-BffxeWB8.js";import{_ as N,f as P,g as F,j as I}from"./vendor-CtuA73w5.js";import{t as L,x as R}from"./react-B9IgSVeK.js";import{Gi as z,Ki as B,Sr as V,Va as H,Wi as U,ba as W,ma as G}from"./icons-DxrLl-Dj.js";import{i as K,r as q,t as J}from"./metric-card-qtWiXfjv.js";import{t as ee}from"./detail-panel-stop-button-DOTn90Cm.js";import{t as Y}from"./status-badge-pill-Dw3L9IOE.js";import{i as te,n as ne,t as re}from"./tool-detail-panel-CFC6gU9K.js";var X=e(R(),1),Z=L();function ie({status:e}){return(0,Z.jsx)(Y,{color:f(e),label:m(e)})}function ae(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?p(n,t):``}`}function Q(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function oe(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function se(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function ce(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return c(n.text)}}function le(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ue({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,X.useState)(new Set),s=n??a,c=(0,X.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,X.useMemo)(()=>_(e),[e]);return l.length===0?null:(0,Z.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=ae(e,n),a=n===l.length-1;return(0,Z.jsx)(de,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var de=(0,X.memo)(function({section:e,isLast:t,isActiveTail:n,expanded:s,sectionKeyValue:l,onToggle:u,onStepDetailClick:d}){let{t:f}=I(`chat`),m=P(),h=a(e.steps),_=h===`running`&&!n?`completed`:h,v=_===`running`||n,y=e.steps[0]?.kind===`thinking`,b=e.steps.length,x=e.label===`Searching the web`,w=x?se(e):void 0,D=b>=2,k=e.steps.some(e=>T(e)||!!d&&!!le(e)),j=_===`running`?``:r(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),L=_===`running`?Q(e):void 0,R=_===`running`&&!x?oe(L,e.label):``,z=x&&(_===`running`||!!w),B=w??e.label,H=y&&v,U=H?ce(e)??e.label:void 0,W=_===`running`||z||H||!!j,K=`${b} step${b===1?``:`s`}`;return(0,Z.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:E(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,Z.jsx)(i,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!k,onClick:k?()=>u(l):void 0,className:E(`flex h-[22px] w-full items-center gap-2 text-left`,k&&`cursor-pointer`),children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,Z.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,Z.jsx)(A,{status:v?`running`:_,isThinking:y&&!v}),(0,Z.jsx)(g,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),W&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),z?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(o,{currentStepTitle:``,currentStepInfo:B})]}):H?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(G,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(o,{currentStepTitle:``,currentStepInfo:U??e.label})]}):_===`running`?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(G,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(o,{currentStepTitle:``,currentStepInfo:R})]}):j?(0,Z.jsx)(g,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:f(`subagentPhaseTimeline.workedFor`,{duration:j})}):null,k&&D&&(0,Z.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,Z.jsx)(g,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:K})})]}),(0,Z.jsx)(N,{initial:!1,children:k&&s&&(0,Z.jsx)(F.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:m?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,Z.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=d?le(e):void 0;if(n&&d){if(e.kind===`tool`)return(0,Z.jsx)(M,{variant:`tool`,iconName:e.iconName,label:e.activity||e.info||e.title,ariaLabel:f(`subagentPhaseTimeline.viewToolDetails`),onClick:()=>d(n)},p(e,t));if(e.kind===`thinking`)return(0,Z.jsx)(M,{variant:`tool`,iconName:`brain`,label:c(e.text),ariaLabel:f(`subagentPhaseTimeline.viewReasoning`),onClick:()=>d(n)},p(e,t));if(e.kind===`web_search`)return(0,Z.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:f(`subagentPhaseTimeline.viewSearchDetails`),onClick:()=>d(n)},p(e,t));if(e.kind===`web_search_error`)return(0,Z.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.errorMessage,ariaLabel:f(`subagentPhaseTimeline.viewSearchError`),onClick:()=>d(n)},p(e,t))}return e.kind===`web_search`?(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,Z.jsx)(g,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,Z.jsx)(O,{step:e})]},p(e,t)):e.kind===`web_search_error`?(0,Z.jsx)(S,{step:e},p(e,t)):(0,Z.jsx)(C,{step:e},p(e,t))})})},`phase-steps`)})]})});function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function fe(e=l){let t=null,n=[],r=[],i=new Map;function a(a){let o=[],s=[];for(let t of a)e(o,s,t);return t=a,n=o,r=s,i=$(n),i}function o(o){let c=s(t,o);switch(c.kind){case`identity`:return i;case`first`:return a(o);case`append`:{let a=o.length,s=n.slice(),l=r.slice();for(let t=c.from;t<a;t++)e(s,l,o[t]);return t=o,n=s,r=l,i=$(n),i}case`mutate-last`:{let a=o.length,s=n.slice(),c=r.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===o[a-1].id&&(s.pop(),c.pop()),e(s,c,o[a-1]),t=o,n=s,r=c,i=$(n),i}case`fallback`:return a(o)}}return{project:o}}function pe(e){let t=(0,X.useRef)(null);return t.current??=fe(),t.current.project(e)}function me(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:v(e.toolName,e.input).iconName}function he({detail:e}){return e.status===`running`?(0,Z.jsx)(h,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,Z.jsx)(j[me(e)]??W,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function ge({entry:e,onClose:r,onStop:i,onRequestDetail:a,assistantId:o}){let{t:s}=I(`chat`),c=d(e.status),l=P(),f=b(),p=(0,X.useMemo)(()=>u(e.subagentId),[e.subagentId]),{steps:m}=y(e.events),h=pe(e.events),[_,v]=(0,X.useState)(null),S=(0,X.useRef)(h);S.current=h;let C=(0,X.useCallback)(e=>{S.current.has(e)&&v(e)},[]),[T,E]=(0,X.useState)(new Set),[O,A]=(0,X.useState)(!1),[j,M]=(0,X.useState)(!1),N=(0,X.useRef)(null),[L,R]=(0,X.useState)(e.subagentId);L!==e.subagentId&&(R(e.subagentId),A(!1),M(!1),v(null),E(new Set)),(0,X.useLayoutEffect)(()=>{if(O)return;let e=N.current;e&&M(e.scrollHeight>e.clientHeight)},[e.subagentId,e.objective,O]);let V=w(e);(0,X.useEffect)(()=>{a&&V&&e.events.length===0&&a(e.subagentId)},[e.subagentId,V,e.events.length,a]);let W=_?h.get(_):void 0,G=(0,X.useCallback)(()=>v(null),[]),Y=W?te(W):``,ae=W?Y:e.label,Q=!!(W&&W.kind!==`thinking`);return(0,Z.jsx)(x,{headerAbove:W&&(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,Z.jsx)(n,{variant:`link`,onClick:G,title:e.label,className:`inline-flex min-w-0 shrink border-0 text-left text-[color:var(--content-default)]`,children:(0,Z.jsx)(g,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate`,children:e.label})}),(0,Z.jsx)(U,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,Z.jsx)(g,{variant:`body-small-default`,as:`span`,title:Y,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:Y})]}),icon:(0,Z.jsxs)(Z.Fragment,{children:[W&&(0,Z.jsx)(n,{variant:`outlined`,iconOnly:(0,Z.jsx)(z,{}),onClick:G,"aria-label":s(`subagentDetailPanel.backToTimelineAria`),tooltip:s(`subagentDetailPanel.backTooltip`),className:`shrink-0`}),W?(0,Z.jsx)(he,{detail:W}):f?(0,Z.jsx)(D,{components:f,bodyShapeId:p.bodyShape,eyeStyleId:p.eyeStyle,colorId:p.color,size:32}):(0,Z.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0})]}),title:Q?void 0:ae,titleNode:Q&&W?(0,Z.jsx)(ne,{detail:W}):void 0,headerTrailing:(0,Z.jsx)(ie,{status:e.status}),headerActions:c&&i?(0,Z.jsx)(ee,{onStop:()=>i(e.subagentId),ariaLabel:s(`subagentDetailPanel.stopSubagentAria`)}):void 0,closeLabel:s(`subagentDetailPanel.closeDetail`),onClose:r,children:(0,Z.jsx)(F.div,{initial:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:W?(0,Z.jsx)(Z.Fragment,{children:W.kind===`thinking`?(0,Z.jsx)(k,{content:W.thinkingText??``,hardLineBreaks:!0,assistantId:o}):(0,Z.jsx)(re,{detail:W,assistantId:o})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(J,{icon:(0,Z.jsx)(H,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>q(Math.round(e)),label:s(`subagentDetailPanel.input`)}),(0,Z.jsx)(J,{icon:(0,Z.jsx)(K,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>q(Math.round(e)),label:s(`subagentDetailPanel.output`)})]}),e.objective&&(0,Z.jsxs)(`div`,{className:`mb-5`,children:[(0,Z.jsx)(g,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:s(`subagentDetailPanel.objective`)}),(0,Z.jsx)(g,{ref:N,variant:`body-medium-lighter`,as:`p`,tabIndex:O?0:void 0,role:O?`region`:void 0,"aria-label":O?s(`subagentDetailPanel.objective`):void 0,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)] ${O?`max-h-[280px] overflow-y-auto`:`line-clamp-5`}`,children:e.objective}),j&&(0,Z.jsx)(n,{variant:`link`,onClick:()=>A(e=>!e),"aria-expanded":O,rightIcon:(0,Z.jsx)(B,{className:`h-3.5 w-3.5 transition-transform ${O?`rotate-180`:``}`,"aria-hidden":!0}),className:`mt-1.5 inline-flex gap-1 border-0 text-[color:var(--content-secondary)] hover:text-[color:var(--content-default)] hover:no-underline`,children:(0,Z.jsx)(g,{variant:`label-small-default`,children:s(O?`subagentDetailPanel.showLess`:`subagentDetailPanel.showMore`)})}),(0,Z.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(g,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:s(`subagentDetailPanel.timeline`)}),e.events.length>0?(0,Z.jsx)(ue,{steps:m,expandedKeys:T,onExpandedKeysChange:E,onStepDetailClick:C,isRunning:c},e.subagentId):(0,Z.jsx)(t,{children:s(`subagentDetailPanel.noEventsYet`)})]})]})},W?`detail`:`list`)})}export{ge as SubagentDetailPanel};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$n as t,$x as n,At as r,Ct as i,Dt as a,Fn as o,Gn as s,Hn as c,In as l,Kn as u,Mc as d,Nc as f,Ot as p,Pc as m,Pn as h,Qx as g,Tt as _,Un as v,Wn as y,Yr as b,Zn as x,_t as S,bt as C,jc as w,kt as T,qa as E,qn as D,vt as O,wn as k,wt as A,xt as j,yt as M}from"./app-Bevxq2OH.js";import{_ as N,f as P,g as F,j as I}from"./vendor-CtuA73w5.js";import{t as L,x as R}from"./react-B9IgSVeK.js";import{Gi as z,Ki as B,Sr as V,Va as H,Wi as U,ba as W,ma as G}from"./icons-DxrLl-Dj.js";import{i as K,r as q,t as J}from"./metric-card-Cp9VXC7R.js";import{t as ee}from"./detail-panel-stop-button-CeSH5ncG.js";import{t as Y}from"./status-badge-pill-Dw3L9IOE.js";import{i as te,n as ne,t as re}from"./tool-detail-panel-aNvOK4DH.js";var X=e(R(),1),Z=L();function ie({status:e}){return(0,Z.jsx)(Y,{color:f(e),label:m(e)})}function ae(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?p(n,t):``}`}function Q(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function oe(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function se(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function ce(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return c(n.text)}}function le(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ue({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,X.useState)(new Set),s=n??a,c=(0,X.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,X.useMemo)(()=>_(e),[e]);return l.length===0?null:(0,Z.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=ae(e,n),a=n===l.length-1;return(0,Z.jsx)(de,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var de=(0,X.memo)(function({section:e,isLast:t,isActiveTail:n,expanded:s,sectionKeyValue:l,onToggle:u,onStepDetailClick:d}){let{t:f}=I(`chat`),m=P(),h=a(e.steps),_=h===`running`&&!n?`completed`:h,v=_===`running`||n,y=e.steps[0]?.kind===`thinking`,b=e.steps.length,x=e.label===`Searching the web`,w=x?se(e):void 0,D=b>=2,k=e.steps.some(e=>T(e)||!!d&&!!le(e)),j=_===`running`?``:r(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),L=_===`running`?Q(e):void 0,R=_===`running`&&!x?oe(L,e.label):``,z=x&&(_===`running`||!!w),B=w??e.label,H=y&&v,U=H?ce(e)??e.label:void 0,W=_===`running`||z||H||!!j,K=`${b} step${b===1?``:`s`}`;return(0,Z.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:E(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,Z.jsx)(i,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!k,onClick:k?()=>u(l):void 0,className:E(`flex h-[22px] w-full items-center gap-2 text-left`,k&&`cursor-pointer`),children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,Z.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,Z.jsx)(A,{status:v?`running`:_,isThinking:y&&!v}),(0,Z.jsx)(g,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),W&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),z?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(o,{currentStepTitle:``,currentStepInfo:B})]}):H?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(G,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(o,{currentStepTitle:``,currentStepInfo:U??e.label})]}):_===`running`?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(G,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(o,{currentStepTitle:``,currentStepInfo:R})]}):j?(0,Z.jsx)(g,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:f(`subagentPhaseTimeline.workedFor`,{duration:j})}):null,k&&D&&(0,Z.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,Z.jsx)(g,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:K})})]}),(0,Z.jsx)(N,{initial:!1,children:k&&s&&(0,Z.jsx)(F.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:m?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,Z.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=d?le(e):void 0;if(n&&d){if(e.kind===`tool`)return(0,Z.jsx)(M,{variant:`tool`,iconName:e.iconName,label:e.activity||e.info||e.title,ariaLabel:f(`subagentPhaseTimeline.viewToolDetails`),onClick:()=>d(n)},p(e,t));if(e.kind===`thinking`)return(0,Z.jsx)(M,{variant:`tool`,iconName:`brain`,label:c(e.text),ariaLabel:f(`subagentPhaseTimeline.viewReasoning`),onClick:()=>d(n)},p(e,t));if(e.kind===`web_search`)return(0,Z.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:f(`subagentPhaseTimeline.viewSearchDetails`),onClick:()=>d(n)},p(e,t));if(e.kind===`web_search_error`)return(0,Z.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.errorMessage,ariaLabel:f(`subagentPhaseTimeline.viewSearchError`),onClick:()=>d(n)},p(e,t))}return e.kind===`web_search`?(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,Z.jsx)(g,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,Z.jsx)(O,{step:e})]},p(e,t)):e.kind===`web_search_error`?(0,Z.jsx)(S,{step:e},p(e,t)):(0,Z.jsx)(C,{step:e},p(e,t))})})},`phase-steps`)})]})});function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function fe(e=l){let t=null,n=[],r=[],i=new Map;function a(a){let o=[],s=[];for(let t of a)e(o,s,t);return t=a,n=o,r=s,i=$(n),i}function o(o){let c=s(t,o);switch(c.kind){case`identity`:return i;case`first`:return a(o);case`append`:{let a=o.length,s=n.slice(),l=r.slice();for(let t=c.from;t<a;t++)e(s,l,o[t]);return t=o,n=s,r=l,i=$(n),i}case`mutate-last`:{let a=o.length,s=n.slice(),c=r.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===o[a-1].id&&(s.pop(),c.pop()),e(s,c,o[a-1]),t=o,n=s,r=c,i=$(n),i}case`fallback`:return a(o)}}return{project:o}}function pe(e){let t=(0,X.useRef)(null);return t.current??=fe(),t.current.project(e)}function me(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:v(e.toolName,e.input).iconName}function he({detail:e}){return e.status===`running`?(0,Z.jsx)(h,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,Z.jsx)(j[me(e)]??W,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function ge({entry:e,onClose:r,onStop:i,onRequestDetail:a,assistantId:o}){let{t:s}=I(`chat`),c=d(e.status),l=P(),f=b(),p=(0,X.useMemo)(()=>u(e.subagentId),[e.subagentId]),{steps:m}=y(e.events),h=pe(e.events),[_,v]=(0,X.useState)(null),S=(0,X.useRef)(h);S.current=h;let C=(0,X.useCallback)(e=>{S.current.has(e)&&v(e)},[]),[T,E]=(0,X.useState)(new Set),[O,A]=(0,X.useState)(!1),[j,M]=(0,X.useState)(!1),N=(0,X.useRef)(null),[L,R]=(0,X.useState)(e.subagentId);L!==e.subagentId&&(R(e.subagentId),A(!1),M(!1),v(null),E(new Set)),(0,X.useLayoutEffect)(()=>{if(O)return;let e=N.current;e&&M(e.scrollHeight>e.clientHeight)},[e.subagentId,e.objective,O]);let V=w(e);(0,X.useEffect)(()=>{a&&V&&e.events.length===0&&a(e.subagentId)},[e.subagentId,V,e.events.length,a]);let W=_?h.get(_):void 0,G=(0,X.useCallback)(()=>v(null),[]),Y=W?te(W):``,ae=W?Y:e.label,Q=!!(W&&W.kind!==`thinking`);return(0,Z.jsx)(x,{headerAbove:W&&(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,Z.jsx)(n,{variant:`link`,onClick:G,title:e.label,className:`inline-flex min-w-0 shrink border-0 text-left text-[color:var(--content-default)]`,children:(0,Z.jsx)(g,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate`,children:e.label})}),(0,Z.jsx)(U,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,Z.jsx)(g,{variant:`body-small-default`,as:`span`,title:Y,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:Y})]}),icon:(0,Z.jsxs)(Z.Fragment,{children:[W&&(0,Z.jsx)(n,{variant:`outlined`,iconOnly:(0,Z.jsx)(z,{}),onClick:G,"aria-label":s(`subagentDetailPanel.backToTimelineAria`),tooltip:s(`subagentDetailPanel.backTooltip`),className:`shrink-0`}),W?(0,Z.jsx)(he,{detail:W}):f?(0,Z.jsx)(D,{components:f,bodyShapeId:p.bodyShape,eyeStyleId:p.eyeStyle,colorId:p.color,size:32}):(0,Z.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0})]}),title:Q?void 0:ae,titleNode:Q&&W?(0,Z.jsx)(ne,{detail:W}):void 0,headerTrailing:(0,Z.jsx)(ie,{status:e.status}),headerActions:c&&i?(0,Z.jsx)(ee,{onStop:()=>i(e.subagentId),ariaLabel:s(`subagentDetailPanel.stopSubagentAria`)}):void 0,closeLabel:s(`subagentDetailPanel.closeDetail`),onClose:r,children:(0,Z.jsx)(F.div,{initial:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:W?(0,Z.jsx)(Z.Fragment,{children:W.kind===`thinking`?(0,Z.jsx)(k,{content:W.thinkingText??``,hardLineBreaks:!0,assistantId:o}):(0,Z.jsx)(re,{detail:W,assistantId:o})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(J,{icon:(0,Z.jsx)(H,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>q(Math.round(e)),label:s(`subagentDetailPanel.input`)}),(0,Z.jsx)(J,{icon:(0,Z.jsx)(K,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>q(Math.round(e)),label:s(`subagentDetailPanel.output`)})]}),e.objective&&(0,Z.jsxs)(`div`,{className:`mb-5`,children:[(0,Z.jsx)(g,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:s(`subagentDetailPanel.objective`)}),(0,Z.jsx)(g,{ref:N,variant:`body-medium-lighter`,as:`p`,tabIndex:O?0:void 0,role:O?`region`:void 0,"aria-label":O?s(`subagentDetailPanel.objective`):void 0,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)] ${O?`max-h-[280px] overflow-y-auto`:`line-clamp-5`}`,children:e.objective}),j&&(0,Z.jsx)(n,{variant:`link`,onClick:()=>A(e=>!e),"aria-expanded":O,rightIcon:(0,Z.jsx)(B,{className:`h-3.5 w-3.5 transition-transform ${O?`rotate-180`:``}`,"aria-hidden":!0}),className:`mt-1.5 inline-flex gap-1 border-0 text-[color:var(--content-secondary)] hover:text-[color:var(--content-default)] hover:no-underline`,children:(0,Z.jsx)(g,{variant:`label-small-default`,children:s(O?`subagentDetailPanel.showLess`:`subagentDetailPanel.showMore`)})}),(0,Z.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(g,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:s(`subagentDetailPanel.timeline`)}),e.events.length>0?(0,Z.jsx)(ue,{steps:m,expandedKeys:T,onExpandedKeysChange:E,onStepDetailClick:C,isRunning:c},e.subagentId):(0,Z.jsx)(t,{children:s(`subagentDetailPanel.noEventsYet`)})]})]})},W?`detail`:`list`)})}export{ge as SubagentDetailPanel};