@vellumai/web 0.12.1 → 0.12.2-staging.2

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 (480) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +486 -0
  2. package/dist/assets/a2a-invite-CkKBIpe8.js +1 -0
  3. package/dist/assets/about-page-DiWDYidS.js +1 -0
  4. package/dist/assets/account-page-BdWEyJKJ.js +1 -0
  5. package/dist/assets/account-shell-CDIxCuoE.js +1 -0
  6. package/dist/assets/acp-run-detail-panel-BnPXD9PJ.js +3 -0
  7. package/dist/assets/activation-CuGQVIGK.js +1 -0
  8. package/dist/assets/activation-DEvPd6pg.js +1 -0
  9. package/dist/assets/activation-list-route-BpGfAO8z.js +1 -0
  10. package/dist/assets/activation-tasks-BkdeoQQy.js +1 -0
  11. package/dist/assets/activation-tasks-DwVlvR2F.js +1 -0
  12. package/dist/assets/activity-redirect-page-D_VBOpOl.js +1 -0
  13. package/dist/assets/activity-steps-panel-DLOwDGMX.js +1 -0
  14. package/dist/assets/add-credits-modal-C3OHD6qf.js +1 -0
  15. package/dist/assets/add-credits-modal-DbveV5No.js +1 -0
  16. package/dist/assets/ai-page-BY6qxepq.js +1 -0
  17. package/dist/assets/android-billing-handoff-CdjBg7iY.js +1 -0
  18. package/dist/assets/api-key-screen-CnqV2gP4.js +1 -0
  19. package/dist/assets/app-DYcUyeCV.js +392 -0
  20. package/dist/assets/app-info-Cwc9Ok0v.js +1 -0
  21. package/dist/assets/app-zlzLjynM.css +2 -0
  22. package/dist/assets/archive-redirect-page-CFe6XL4Y.js +1 -0
  23. package/dist/assets/assistant-status-panel-CnUpJoll.js +1 -0
  24. package/dist/assets/auth-store-qFyOugDY.js +1 -0
  25. package/dist/assets/auth-welcome-screen-BO0eq8kj.js +1 -0
  26. package/dist/assets/avatar-bundled-components-DK3FoHp8.js +1 -0
  27. package/dist/assets/avatar-random-CKrkTaqV.js +2 -0
  28. package/dist/assets/await-org-header-settled-BWq2sN7_.js +1 -0
  29. package/dist/assets/background-task-detail-panel-ORUKrW2i.js +1 -0
  30. package/dist/assets/billing-page-kzeezxE8.js +3 -0
  31. package/dist/assets/billing-redirect-page-BTNxUma5.js +1 -0
  32. package/dist/assets/bookmarks-page-1Iz7hnH8.js +1 -0
  33. package/dist/assets/bundle-confirm-page-D0m8wyRa.js +1 -0
  34. package/dist/assets/channel-transcript-panel-D9JTYmma.js +1 -0
  35. package/dist/assets/{channels-BIVOatvA.js → channels-BHIR9mQr.js} +1 -1
  36. package/dist/assets/{channels-C9mCB0CJ.js → channels-CO0Un7Vq.js} +1 -1
  37. package/dist/assets/{channels-CDirkQc7.js → channels-Dlzw-hbd.js} +1 -1
  38. package/dist/assets/channels-page-route-IP5Jv1og.js +1 -0
  39. package/dist/assets/{channels-BCLfuOUD.js → channels-qz1rLPhm.js} +1 -1
  40. package/dist/assets/chat-BKI_zbji.js +3 -0
  41. package/dist/assets/chat-BKuyrsfu.js +3 -0
  42. package/dist/assets/chat-BcPDKWAI.js +3 -0
  43. package/dist/assets/chat-C2T6sQev.js +3 -0
  44. package/dist/assets/chat-info-panel-BUuwract.js +1 -0
  45. package/dist/assets/checkout-continuation-Ir9Qg-Pv.js +1 -0
  46. package/dist/assets/checkout-page-C7--EoDh.js +1 -0
  47. package/dist/assets/checkout-return-target-C4W9yc_g.js +1 -0
  48. package/dist/assets/command-palette-C0GSIX1A.js +1 -0
  49. package/dist/assets/command-palette-CsrD98bN.js +1 -0
  50. package/dist/assets/command-palette-window-page-LLKVQLTl.js +1 -0
  51. package/dist/assets/common-AudD8oBL.js +1 -0
  52. package/dist/assets/common-DCEa_FHA.js +1 -0
  53. package/dist/assets/common-DK3YVoJu.js +1 -0
  54. package/dist/assets/common-sjv1KsmO.js +1 -0
  55. package/dist/assets/community-page-COiKMV7G.js +1 -0
  56. package/dist/assets/companion-accent-Bkp2ghsY.js +1 -0
  57. package/dist/assets/companion-dock-zones-page-xiaXIxvD.js +1 -0
  58. package/dist/assets/companion-layout-BI1zMzgY.js +1 -0
  59. package/dist/assets/companion-popover-page-C_JHNBel.js +1 -0
  60. package/dist/assets/companion-popover-v-F80EHk.js +1 -0
  61. package/dist/assets/companion-surface-page-CsXzldY9.js +1 -0
  62. package/dist/assets/companion-watch-frame-page-DH4dTyql.js +1 -0
  63. package/dist/assets/connect-page-D7gSntXr.js +1 -0
  64. package/dist/assets/consent-controls-Gq28evub.js +1 -0
  65. package/dist/assets/contacts-gateway-ChHU1rQs.js +1 -0
  66. package/dist/assets/contacts-page-route-CLN-9RMq.js +1 -0
  67. package/dist/assets/credential-entry-page-CMdEgB2X.js +1 -0
  68. package/dist/assets/credentials-page-DUy0d8Qf.js +1 -0
  69. package/dist/assets/{csv-preview-DDWd92MO.js → csv-preview-mNT5jrl1.js} +2 -2
  70. package/dist/assets/danger-zone-redirect-page-CpBANsPW.js +1 -0
  71. package/dist/assets/debug-page-DEHSMzm6.js +4 -0
  72. package/dist/assets/deploy-dialogs-BsuRgQBS.js +1 -0
  73. package/dist/assets/deploy-dialogs-imfnwAMP.js +1 -0
  74. package/dist/assets/desktop-sidebar-content-CLSH_2DT.js +2 -0
  75. package/dist/assets/desktop-viewer-BnQ2rure.js +5 -0
  76. package/dist/assets/detail-card-BfZQepf_.js +1 -0
  77. package/dist/assets/detail-panel-stop-button-CQdsxMzy.js +1 -0
  78. package/dist/assets/detail-primitives-DWM6BL6-.js +1 -0
  79. package/dist/assets/developer-page-BPvgy8Wi.js +1 -0
  80. package/dist/assets/devices-redirect-page-ODdh9ZCh.js +1 -0
  81. package/dist/assets/dictation-overlay-page-Jnv8kJNY.js +1 -0
  82. package/dist/assets/{diff-rows-6HtO6KNr.js → diff-rows-CUycwYUl.js} +1 -1
  83. package/dist/assets/document-load-CPnHWBZj.js +1 -0
  84. package/dist/assets/document-load-DhRvPpKP.js +1 -0
  85. package/dist/assets/document-viewer-page-BwgyP6mg.js +1 -0
  86. package/dist/assets/{ellipsis-vertical-BMOhP0Zs.js → ellipsis-vertical-xUQM-Elm.js} +1 -1
  87. package/dist/assets/emails-page-x39HaZGf.js +1 -0
  88. package/dist/assets/environment-store-C0GY-RDl.js +1 -0
  89. package/dist/assets/esm-ByLpJZU-.js +2 -0
  90. package/dist/assets/{esm-DUr8Sd7e.js → esm-CEzvChXG.js} +1 -1
  91. package/dist/assets/esm-Ce_5OZEK.js +1 -0
  92. package/dist/assets/esm-D50EEn3i.js +1 -0
  93. package/dist/assets/{esm-krw2tVOJ.js → esm-DfbgKT6v.js} +1 -1
  94. package/dist/assets/esm-DqVgYgSz.js +2 -0
  95. package/dist/assets/esm-DvwokPO4.js +2 -0
  96. package/dist/assets/esm-WmNNZ6G5.js +2 -0
  97. package/dist/assets/esm-cjSwwcic.js +2 -0
  98. package/dist/assets/{esm-hPUUgGy5.js → esm-vJJO9AjB.js} +2 -2
  99. package/dist/assets/{file-diff-view-EiQSECOw.js → file-diff-view-DL32vE3_.js} +1 -1
  100. package/dist/assets/file-editor-BsKygMVy.js +1 -0
  101. package/dist/assets/general-page-CA95DkzX.js +2 -0
  102. package/dist/assets/hatching-screen-BU5hSl8C.js +1 -0
  103. package/dist/assets/hosting-screen-BRLbMCaI.js +1 -0
  104. package/dist/assets/icons-SKs_cTXW.js +1 -0
  105. package/dist/assets/identity-page-route-BCUZfhDl.js +7 -0
  106. package/dist/assets/inspect-page-DrdNSLbW.js +9 -0
  107. package/dist/assets/integrations-page-BQ3zkbc_.js +1 -0
  108. package/dist/assets/intelligence-layout-DQA7dP9H.js +1 -0
  109. package/dist/assets/intelligence-layout-slots-store-Bn393qZ_.js +1 -0
  110. package/dist/assets/keyboard-shortcuts-redirect-page-Cj2MgzIj.js +1 -0
  111. package/dist/assets/{latest-assistant-text-mcgHfCbd.js → latest-assistant-text-DP5fiLaB.js} +1 -1
  112. package/dist/assets/library-detail-page-ChnVd3vO.js +1 -0
  113. package/dist/assets/library-page-DBPMNzOs.js +1 -0
  114. package/dist/assets/local-mode-DBwK3Yoy.js +1 -0
  115. package/dist/assets/login-page-D9xCGRlZ.js +1 -0
  116. package/dist/assets/logout-page-DIGz42Xt.js +1 -0
  117. package/dist/assets/logs-layout-wdm0ydut.js +1 -0
  118. package/dist/assets/markdown-preview-C31CUlHr.js +1 -0
  119. package/dist/assets/media-preview-oUDIObuT.js +1 -0
  120. package/dist/assets/memory-page-route-DB6Z_crP.js +2 -0
  121. package/dist/assets/memory-router-playground-page-tRavfyXm.js +1 -0
  122. package/dist/assets/message-files-panel-BVush96L.js +1 -0
  123. package/dist/assets/metric-card-T-AHvj71.js +1 -0
  124. package/dist/assets/native-attachment-pickers-iN790LWy.js +1 -0
  125. package/dist/assets/native-file-CBaSUD63.js +1 -0
  126. package/dist/assets/notifications-page-Dr26_JFe.js +1 -0
  127. package/dist/assets/{oauth-complete-page-_act6krk.js → oauth-complete-page-eoOM2u1b.js} +2 -2
  128. package/dist/assets/{oauth-popup-complete-page-D9d5IH9z.js → oauth-popup-complete-page-DkAKB7TM.js} +2 -2
  129. package/dist/assets/onboarding-Ck1WpDTk.js +1 -0
  130. package/dist/assets/onboarding-DUkDMEeR.js +1 -0
  131. package/dist/assets/onboarding-Da4AoTDW.js +1 -0
  132. package/dist/assets/onboarding-Nd6x50X1.js +1 -0
  133. package/dist/assets/paired-platform-identity-DSyb0yom.js +1 -0
  134. package/dist/assets/pairing-page-DMhPf4tK.js +1 -0
  135. package/dist/assets/password-reset-page-DbQS4Jyq.js +1 -0
  136. package/dist/assets/{pdf-B2KVp4ZG.js → pdf-a0wURVJB.js} +1 -1
  137. package/dist/assets/pdf-file-preview-CGZjzTCX.js +1 -0
  138. package/dist/assets/{peeking-eyes-DNBQeifP.js → peeking-eyes-Bz7deqfy.js} +1 -1
  139. package/dist/assets/personality-page-CJ9xaG4j.js +1 -0
  140. package/dist/assets/personality-page-mlJSlhjM.js +1 -0
  141. package/dist/assets/personality-sliders-CTKQGSuO.js +1 -0
  142. package/dist/assets/plans-page-CTSNc-V_.js +1 -0
  143. package/dist/assets/platform-loopback-page-D5LpFJJK.js +1 -0
  144. package/dist/assets/plugin-detail-page-DQLFC5mY.js +1 -0
  145. package/dist/assets/plugins-page-DMpCtHwR.js +1 -0
  146. package/dist/assets/plugins-surface-DXgmI6Fa.js +1 -0
  147. package/dist/assets/preview-error-DceuF__7.js +1 -0
  148. package/dist/assets/privacy-page-D5QEDjup.js +1 -0
  149. package/dist/assets/privacy-screen-SUppoO7T.js +1 -0
  150. package/dist/assets/provider-callback-page-fcCX9vWX.js +1 -0
  151. package/dist/assets/provider-key-Bsl0fmCg.js +1 -0
  152. package/dist/assets/provider-signup-page-BPUq5809.js +1 -0
  153. package/dist/assets/{provisioning-targets-BZJdjS_6.js → provisioning-targets-CZtAFx6_.js} +1 -1
  154. package/dist/assets/quick-input-page-DdGClmC4.js +1 -0
  155. package/dist/assets/{react-DPM_L_aA.js → react-B9IgSVeK.js} +1 -1
  156. package/dist/assets/{rehype-katex-qwWAif3X.js → rehype-katex-DCyKPcx9.js} +1 -1
  157. package/dist/assets/research-mock-page-BDKXQ_IH.js +1 -0
  158. package/dist/assets/research-onboarding-route-D79iKU2n.js +50 -0
  159. package/dist/assets/review-terms-screen-DeSN6E81.js +1 -0
  160. package/dist/assets/routes-D8-BQV23.js +1 -0
  161. package/dist/assets/schedules-Bkin-xNo.js +1 -0
  162. package/dist/assets/schedules-page-osEW2t2y.js +1 -0
  163. package/dist/assets/security-redirect-page-D4kh6_4O.js +1 -0
  164. package/dist/assets/select-assistant-screen-CeXQW_nG.js +1 -0
  165. package/dist/assets/self-hosted-servers-rYrIbt0S.js +1 -0
  166. package/dist/assets/service-form-controls-3rmQU6bc.js +1 -0
  167. package/dist/assets/setting-row-rsGippsf.js +1 -0
  168. package/dist/assets/settings-5b6v7dcF.js +3 -0
  169. package/dist/assets/settings-B78MqHTl.js +3 -0
  170. package/dist/assets/settings-BEnsoU0B.js +3 -0
  171. package/dist/assets/settings-DcE8Dx9m.js +3 -0
  172. package/dist/assets/settings-divider-DrVFbm_Z.js +1 -0
  173. package/dist/assets/settings-layout-CguVDhKN.js +1 -0
  174. package/dist/assets/share-feedback-modal-BMEDwwPF.js +1 -0
  175. package/dist/assets/share-feedback-modal-Ds30t4rl.js +2 -0
  176. package/dist/assets/sidebar-tree-CLAWfbdV.js +1 -0
  177. package/dist/assets/signup-page-OdyD2G67.js +1 -0
  178. package/dist/assets/signup-shell-D4FRWPAq.js +1 -0
  179. package/dist/assets/skill-detail-page-DcLkTuWs.js +2 -0
  180. package/dist/assets/skill-detail-panel-CCpjeza1.js +1 -0
  181. package/dist/assets/skill-icon-BlANbII_.js +1 -0
  182. package/dist/assets/skill-removal-dialog-BSJ4vEhM.js +1 -0
  183. package/dist/assets/skills-page-uHuHRkHV.js +1 -0
  184. package/dist/assets/sounds-page-CPJH0X_U.js +1 -0
  185. package/dist/assets/start-screen-B3ioYfe_.js +1 -0
  186. package/dist/assets/{status-badge-pill-DsYKTPMw.js → status-badge-pill-e7pOiHx8.js} +1 -1
  187. package/dist/assets/stt-language-picker-modal-CvY6PHkq.js +1 -0
  188. package/dist/assets/subagent-detail-panel-D8BizQX9.js +1 -0
  189. package/dist/assets/superpowers-page-c3qAVKAY.js +1 -0
  190. package/dist/assets/system-events-page-DusjB-yv.js +1 -0
  191. package/dist/assets/system-events-redirect-page-B1LED8xu.js +1 -0
  192. package/dist/assets/text-preview-ifJ0FLN8.js +1 -0
  193. package/dist/assets/theme-stage-page-ml2zGok2.js +1 -0
  194. package/dist/assets/{tiptap-document-editor-7zjNquKo.js → tiptap-document-editor-301Udytr.js} +30 -30
  195. package/dist/assets/tool-detail-panel-BEKchUyO.js +1 -0
  196. package/dist/assets/tool-detail-panel-lkM3coiO.js +15 -0
  197. package/dist/assets/trait-cycle-row-BtL4_fB9.js +1 -0
  198. package/dist/assets/upgrade-cancel-page-eys9-GiP.js +1 -0
  199. package/dist/assets/upgrade-success-page-DBo4-ty1.js +1 -0
  200. package/dist/assets/usage-redirect-page-BVd5XOoA.js +1 -0
  201. package/dist/assets/use-app-delete-D78AElYp.js +1 -0
  202. package/dist/assets/use-assistant-identity-details-7UWP5j2N.js +1 -0
  203. package/dist/assets/use-checkout-dismiss-refresh-BVsFNWT8.js +1 -0
  204. package/dist/assets/use-edge-swipe-back-BkOkzu0f.js +1 -0
  205. package/dist/assets/use-hotkey-recorder-e0BAwbQD.js +1 -0
  206. package/dist/assets/use-invite-link-dialog-L4TB7aPd.js +1 -0
  207. package/dist/assets/use-platform-assistant-id-DsEYYPfs.js +1 -0
  208. package/dist/assets/use-return-to-short-circuit-COMSHsAl.js +1 -0
  209. package/dist/assets/use-side-list-room-C0JlGYbh.js +1 -0
  210. package/dist/assets/use-skill-actions-D6M_AuIh.js +1 -0
  211. package/dist/assets/use-skill-detail-files-B4ZIUELX.js +1 -0
  212. package/dist/assets/use-supports-credentials-settings-1gt6t1jo.js +1 -0
  213. package/dist/assets/use-transcript-message-by-id-Doye708D.js +1 -0
  214. package/dist/assets/{use-truncated-blob-text-B50a7Mkr.js → use-truncated-blob-text-Csy5XNd4.js} +1 -1
  215. package/dist/assets/vendor-Dce4XQGd.js +127 -0
  216. package/dist/assets/voice-page-a4H6kqs2.js +1 -0
  217. package/dist/assets/wake-detail-panel-Al2XWMVU.js +1 -0
  218. package/dist/assets/weather-forecast-display-CWgFzub-.js +1 -0
  219. package/dist/assets/{web-CeDxhWFH.js → web-B8-jpFMe.js} +1 -1
  220. package/dist/assets/{web-C_Ui7gb5.js → web-C2h3VA7z.js} +1 -1
  221. package/dist/assets/{web-Bulr9QQn.js → web-CPz9Go5w.js} +1 -1
  222. package/dist/assets/{web-y4PoIMXz.js → web-CcivtN3-.js} +1 -1
  223. package/dist/assets/{web-9D8isJOk.js → web-CntdjdN2.js} +1 -1
  224. package/dist/assets/{web-BkmK5STh.js → web-DdVas5FJ.js} +1 -1
  225. package/dist/assets/{web-CaauzE8c.js → web-Dpz2Ffo3.js} +1 -1
  226. package/dist/assets/{web-BpX3Y-_s.js → web-LNm-oerp.js} +1 -1
  227. package/dist/assets/{web-ykYrL9yl.js → web-XyOUV4KJ.js} +1 -1
  228. package/dist/assets/welcome-screen-CAZRHEQL.js +1 -0
  229. package/dist/assets/workflow-detail-panel-BhWqjNLU.js +1 -0
  230. package/dist/assets/workspace-CLEaBD_r.js +1 -0
  231. package/dist/assets/workspace-DszduRsw.js +1 -0
  232. package/dist/assets/workspace-E_cFOroL.js +1 -0
  233. package/dist/assets/workspace-XYOLCcR6.js +1 -0
  234. package/dist/assets/workspace-page-CMhhDRc1.js +1 -0
  235. package/dist/images/integrations/ATTRIBUTION.md +6 -6
  236. package/dist/images/integrations/quickbooks.svg +1 -0
  237. package/dist/images/integrations/shopify.svg +1 -0
  238. package/dist/index.html +6 -6
  239. package/package.json +1 -1
  240. package/dist/assets/a2a-invite-DOlvPnsj.js +0 -1
  241. package/dist/assets/about-page-CAHLo_IM.js +0 -1
  242. package/dist/assets/account-page-CR9m-bbG.js +0 -1
  243. package/dist/assets/account-shell-CfKMHHXQ.js +0 -1
  244. package/dist/assets/acp-run-detail-panel-BBEBzZSw.js +0 -3
  245. package/dist/assets/activation-list-route-WkR2XN13.js +0 -1
  246. package/dist/assets/activation-tasks-BJZEpFIy.js +0 -1
  247. package/dist/assets/activation-tasks-Bk658x3i.js +0 -1
  248. package/dist/assets/activation-tasks-K8Swziqu.js +0 -1
  249. package/dist/assets/activation-tasks-wz108byj.js +0 -1
  250. package/dist/assets/activity-redirect-page-D5jSj1d4.js +0 -1
  251. package/dist/assets/activity-steps-panel-C91mUEgr.js +0 -1
  252. package/dist/assets/add-credits-modal-BtOBq6__.js +0 -1
  253. package/dist/assets/ai-page-BjjHb_KN.js +0 -1
  254. package/dist/assets/android-billing-handoff-C_65hbFm.js +0 -1
  255. package/dist/assets/api-key-screen-DAWDc1tS.js +0 -1
  256. package/dist/assets/app-info--nQmKvGC.js +0 -1
  257. package/dist/assets/archive-redirect-page-BlzqQ5_P.js +0 -1
  258. package/dist/assets/assistant-status-panel-CXq4xqak.js +0 -1
  259. package/dist/assets/auth-welcome-screen-YynWXFYd.js +0 -1
  260. package/dist/assets/avatar-random-T8euI8sG.js +0 -2
  261. package/dist/assets/await-org-header-settled-DzQQ7QxL.js +0 -1
  262. package/dist/assets/background-task-detail-panel-DGc2RnBm.js +0 -1
  263. package/dist/assets/billing-page-eSvbiGuR.js +0 -3
  264. package/dist/assets/billing-redirect-page-BAtaOafH.js +0 -1
  265. package/dist/assets/bookmarks-page-UeYoXk3X.js +0 -1
  266. package/dist/assets/bundle-confirm-page-CrNXSEwP.js +0 -1
  267. package/dist/assets/channel-transcript-panel-BdOlGjnN.js +0 -1
  268. package/dist/assets/channels-page-route-CTDjdZZV.js +0 -1
  269. package/dist/assets/chat-BOrB9oHu.js +0 -3
  270. package/dist/assets/chat-C1MeXG-2.js +0 -3
  271. package/dist/assets/chat-CWzsWu23.js +0 -3
  272. package/dist/assets/chat-eAA7-NU8.js +0 -3
  273. package/dist/assets/chat-info-panel-CIcb19Yz.js +0 -1
  274. package/dist/assets/checkout-continuation-DCEWSKgL.js +0 -1
  275. package/dist/assets/checkout-page-CjZEKzRZ.js +0 -1
  276. package/dist/assets/checkout-return-target-RlOhwSvu.js +0 -1
  277. package/dist/assets/command-palette-D2wqOJue.js +0 -1
  278. package/dist/assets/command-palette-window-page-Bg2nuHq5.js +0 -1
  279. package/dist/assets/common-BztqCOmk.js +0 -1
  280. package/dist/assets/common-DTjszpuj.js +0 -1
  281. package/dist/assets/common-DmcKuTke.js +0 -1
  282. package/dist/assets/common-Hpbr_vpQ.js +0 -1
  283. package/dist/assets/community-page-BLhzGTuy.js +0 -1
  284. package/dist/assets/companion-accent-gsn9VuVB.js +0 -1
  285. package/dist/assets/companion-layout-BES0UfBy.js +0 -1
  286. package/dist/assets/companion-surface-page-kl9ej_zQ.js +0 -1
  287. package/dist/assets/companion-watch-frame-page-CX0lYK6Y.js +0 -1
  288. package/dist/assets/connect-page-8LGXfYwr.js +0 -1
  289. package/dist/assets/consent-controls-BRXg7A0b.js +0 -1
  290. package/dist/assets/contacts-gateway-Cm83W9Sw.js +0 -1
  291. package/dist/assets/contacts-page-route-YdSPP6ct.js +0 -1
  292. package/dist/assets/credential-entry-page-B0E7m9Ka.js +0 -1
  293. package/dist/assets/credentials-page-KL8TseTX.js +0 -1
  294. package/dist/assets/danger-zone-redirect-page-CeG41nRv.js +0 -1
  295. package/dist/assets/debug-page-Cq9veQE7.js +0 -4
  296. package/dist/assets/deploy-dialogs-DiKerPg3.js +0 -1
  297. package/dist/assets/detail-card-B0OGBJ1-.js +0 -1
  298. package/dist/assets/detail-panel-stop-button-B6n2CDuJ.js +0 -1
  299. package/dist/assets/detail-primitives-MMaUWytS.js +0 -1
  300. package/dist/assets/developer-page--7O3Jeje.js +0 -1
  301. package/dist/assets/devices-redirect-page-De4zPGBG.js +0 -1
  302. package/dist/assets/dictation-overlay-page-BebL8Sje.js +0 -1
  303. package/dist/assets/document-viewer-page-R_dKhaWy.js +0 -1
  304. package/dist/assets/emails-page-CqVlJ1LT.js +0 -1
  305. package/dist/assets/environment-store-yY-PFyNj.js +0 -1
  306. package/dist/assets/esm-CEQ5-BPY.js +0 -2
  307. package/dist/assets/esm-CZUymCSO.js +0 -1
  308. package/dist/assets/esm-DyNBzk7k.js +0 -2
  309. package/dist/assets/esm-V26rZBqv.js +0 -2
  310. package/dist/assets/esm-VDGp8N8o.js +0 -2
  311. package/dist/assets/esm-bBYOtNIe.js +0 -2
  312. package/dist/assets/file-editor-B_RqvjQp.js +0 -1
  313. package/dist/assets/general-page-DZ2OQRcR.js +0 -2
  314. package/dist/assets/hatching-screen-BsUtOe4T.js +0 -1
  315. package/dist/assets/hosting-screen-CnZGwkfa.js +0 -1
  316. package/dist/assets/icons-xHdc0dPY.js +0 -1
  317. package/dist/assets/identity-page-route-DojUio39.js +0 -7
  318. package/dist/assets/index-CleA12ha.js +0 -379
  319. package/dist/assets/index-_KUyDosG.css +0 -2
  320. package/dist/assets/inspect-page-BE_JG1N4.js +0 -9
  321. package/dist/assets/integrations-page-KDXF3d-g.js +0 -1
  322. package/dist/assets/intelligence-layout-STvbMPLB.js +0 -1
  323. package/dist/assets/intelligence-layout-slots-store-DMLOaMGU.js +0 -1
  324. package/dist/assets/keyboard-shortcuts-redirect-page-DXaUnoFR.js +0 -1
  325. package/dist/assets/library-detail-page-CCmvUHtD.js +0 -1
  326. package/dist/assets/library-page-DlTszOAL.js +0 -1
  327. package/dist/assets/login-page-CUNLD9gj.js +0 -1
  328. package/dist/assets/logout-page-DcyTUY-b.js +0 -1
  329. package/dist/assets/logs-layout-BqkRgpwq.js +0 -1
  330. package/dist/assets/markdown-preview-CG-FNmRz.js +0 -1
  331. package/dist/assets/media-preview-CCq9FQiT.js +0 -1
  332. package/dist/assets/memory-page-route-BHUAp-C2.js +0 -2
  333. package/dist/assets/memory-router-playground-page-Dt9vB83b.js +0 -1
  334. package/dist/assets/message-files-panel-DpvaRorj.js +0 -1
  335. package/dist/assets/metric-card-CgEc3VST.js +0 -1
  336. package/dist/assets/notifications-page-kX-DNd3J.js +0 -1
  337. package/dist/assets/onboarding-8Qvub-HF.js +0 -1
  338. package/dist/assets/onboarding-BqMOEnu1.js +0 -1
  339. package/dist/assets/onboarding-Do0E1QsF.js +0 -1
  340. package/dist/assets/onboarding-ml_qpGn-.js +0 -1
  341. package/dist/assets/pairing-page-DJRUbeSZ.js +0 -1
  342. package/dist/assets/password-reset-page-Cegloo1P.js +0 -1
  343. package/dist/assets/pdf-file-preview-3kkKGH7o.js +0 -1
  344. package/dist/assets/personality-page-CmZHiyRo.js +0 -1
  345. package/dist/assets/personality-page-DjPVfIFL.js +0 -1
  346. package/dist/assets/personality-sliders-D0p9kgNx.js +0 -1
  347. package/dist/assets/plans-page-CCY1BUZx.js +0 -1
  348. package/dist/assets/platform-loopback-page-vdNjdoVw.js +0 -1
  349. package/dist/assets/plugin-detail-page-Co0YswmF.js +0 -1
  350. package/dist/assets/plugins-page-DxCCY6yP.js +0 -1
  351. package/dist/assets/preview-error-DyczP1Cl.js +0 -1
  352. package/dist/assets/privacy-page-nfyEw6V_.js +0 -1
  353. package/dist/assets/privacy-screen-CSYkxRBc.js +0 -1
  354. package/dist/assets/provider-callback-page-Cms4b36-.js +0 -1
  355. package/dist/assets/provider-key-B2zz48-r.js +0 -1
  356. package/dist/assets/provider-signup-page-nO1KOWei.js +0 -1
  357. package/dist/assets/quick-input-page-CtMMOIj7.js +0 -1
  358. package/dist/assets/research-mock-page-TkBJ2Xzt.js +0 -1
  359. package/dist/assets/research-onboarding-route-BBvprgLG.js +0 -50
  360. package/dist/assets/review-terms-screen-CdlPmf8I.js +0 -1
  361. package/dist/assets/schedules-BH4Qj3v_.js +0 -1
  362. package/dist/assets/schedules-page-BwWZDVOO.js +0 -1
  363. package/dist/assets/security-redirect-page-BflZPXbv.js +0 -1
  364. package/dist/assets/select-assistant-screen-s2j8iyBA.js +0 -1
  365. package/dist/assets/self-hosted-servers-BbfoTPnN.js +0 -1
  366. package/dist/assets/service-form-controls-B4TOUC0S.js +0 -1
  367. package/dist/assets/setting-row-DqAfZdv2.js +0 -1
  368. package/dist/assets/settings-C63GjmJb.js +0 -3
  369. package/dist/assets/settings-CrvJCEjH.js +0 -3
  370. package/dist/assets/settings-D4bcxNIG.js +0 -3
  371. package/dist/assets/settings-Dn888InQ.js +0 -3
  372. package/dist/assets/settings-divider-CM41jU8r.js +0 -1
  373. package/dist/assets/settings-layout-dXTKjyLn.js +0 -1
  374. package/dist/assets/share-feedback-modal-Bf_f-1Md.js +0 -2
  375. package/dist/assets/sidebar-tree-Bk7IUERw.js +0 -1
  376. package/dist/assets/signup-page-C-3fDL0D.js +0 -1
  377. package/dist/assets/signup-shell-DqL_hfoj.js +0 -1
  378. package/dist/assets/skill-detail-page-CVduyZVJ.js +0 -2
  379. package/dist/assets/skill-detail-panel-BxZAnZbg.js +0 -1
  380. package/dist/assets/skill-icon-FPL5xeRb.js +0 -1
  381. package/dist/assets/skill-removal-dialog-D3tHR3Ld.js +0 -1
  382. package/dist/assets/skills-page-C-0iE9BV.js +0 -1
  383. package/dist/assets/sounds-page-_EVUXllQ.js +0 -1
  384. package/dist/assets/start-screen-yHd9KDX3.js +0 -1
  385. package/dist/assets/stt-language-picker-modal-BUc9OzaG.js +0 -1
  386. package/dist/assets/subagent-detail-panel-rXvn591h.js +0 -1
  387. package/dist/assets/superpowers-page-BZt2aSZX.js +0 -1
  388. package/dist/assets/system-events-page-C8lfUiSV.js +0 -1
  389. package/dist/assets/system-events-redirect-page-8LxoBVmn.js +0 -1
  390. package/dist/assets/text-preview-DW6f8CZi.js +0 -1
  391. package/dist/assets/theme-stage-page-DzWIjgFX.js +0 -1
  392. package/dist/assets/tool-detail-panel-UBD8L_LV.js +0 -15
  393. package/dist/assets/trait-cycle-row-CSwys30K.js +0 -1
  394. package/dist/assets/upgrade-cancel-page-o-OcUT1B.js +0 -1
  395. package/dist/assets/upgrade-success-page-D2BicwBj.js +0 -1
  396. package/dist/assets/usage-redirect-page-BmlaczMS.js +0 -1
  397. package/dist/assets/use-app-delete-B8jp3vIE.js +0 -1
  398. package/dist/assets/use-assistant-identity-details-BRqAQ7pS.js +0 -1
  399. package/dist/assets/use-checkout-dismiss-refresh-DX3GymbX.js +0 -1
  400. package/dist/assets/use-edge-swipe-back-CbTl-FwD.js +0 -2
  401. package/dist/assets/use-hotkey-recorder-BKNmxbXj.js +0 -1
  402. package/dist/assets/use-invite-link-dialog-Daa3jhkP.js +0 -1
  403. package/dist/assets/use-platform-assistant-id-Dj8c4xX-.js +0 -1
  404. package/dist/assets/use-return-to-short-circuit-DusBrJ_h.js +0 -1
  405. package/dist/assets/use-side-list-room-3ENOwQ0t.js +0 -1
  406. package/dist/assets/use-skill-actions-BjY9oa7a.js +0 -1
  407. package/dist/assets/use-skill-detail-files-kPuMdyDL.js +0 -1
  408. package/dist/assets/use-supports-credentials-settings-BuLaPijC.js +0 -1
  409. package/dist/assets/use-transcript-message-by-id-DOMa4nxw.js +0 -1
  410. package/dist/assets/vendor-C_e0Rl2s.js +0 -127
  411. package/dist/assets/voice-page-DuWSfI5B.js +0 -1
  412. package/dist/assets/wake-detail-panel-D34xuHov.js +0 -1
  413. package/dist/assets/weather-forecast-display-D1iB5UK2.js +0 -1
  414. package/dist/assets/welcome-screen-Dw3nj99H.js +0 -1
  415. package/dist/assets/workflow-detail-panel-BbS4Uq2Q.js +0 -1
  416. package/dist/assets/workspace-B3qxH51y.js +0 -1
  417. package/dist/assets/workspace-BUMgSIAc.js +0 -1
  418. package/dist/assets/workspace-DBbRFlwk.js +0 -1
  419. package/dist/assets/workspace-LUczKAWY.js +0 -1
  420. package/dist/assets/workspace-page-CmL3AaIw.js +0 -1
  421. /package/dist/assets/{account-DDtCvPF5.js → account-3GFMLigt.js} +0 -0
  422. /package/dist/assets/{account-Diu-bFrX.js → account-BZPOh6pV.js} +0 -0
  423. /package/dist/assets/{account-Bxy_vX-K.js → account-QucJ2Y5u.js} +0 -0
  424. /package/dist/assets/{account-BF5lrfyX.js → account-lTaON6P7.js} +0 -0
  425. /package/dist/assets/{activation-BYAGAleJ.js → activation-CoAfI7zY.js} +0 -0
  426. /package/dist/assets/{activation-CEdyqKUu.js → activation-tasks-CBv6lXCw.js} +0 -0
  427. /package/dist/assets/{activation-DEdwceum.js → activation-tasks-D-qyBs3B.js} +0 -0
  428. /package/dist/assets/{activation-DF1oj8j7.js → activation-un8nBcxR.js} +0 -0
  429. /package/dist/assets/{app-types-Dij41aJ8.js → app-types-zXUHUKUx.js} +0 -0
  430. /package/dist/assets/{build.umd-BrZECSr1.js → build.umd-CqzQelGW.js} +0 -0
  431. /package/dist/assets/{contacts-4xLilqUA.js → contacts-C56-I-X9.js} +0 -0
  432. /package/dist/assets/{contacts-DIgSZ4hU.js → contacts-D-Az5-cK.js} +0 -0
  433. /package/dist/assets/{contacts-CnVtG-pl.js → contacts-DTybocWJ.js} +0 -0
  434. /package/dist/assets/{contacts-DE8gWrSn.js → contacts-DxMblAMX.js} +0 -0
  435. /package/dist/assets/{credential-requests-CPxFLVT9.js → credential-requests-8vU09vq-.js} +0 -0
  436. /package/dist/assets/{credential-requests-BFLeXf78.js → credential-requests-BC6_zno-.js} +0 -0
  437. /package/dist/assets/{credential-requests-lDkcsmmB.js → credential-requests-CMIr5-ug.js} +0 -0
  438. /package/dist/assets/{credential-requests-Qe84hNEC.js → credential-requests-tqoAnXSd.js} +0 -0
  439. /package/dist/assets/{definitions-BjZOswgM.js → definitions-CXFBHfRh.js} +0 -0
  440. /package/dist/assets/{definitions-BTebkxyz.js → definitions-at6loHuH.js} +0 -0
  441. /package/dist/assets/{emoji-catalog-data-QQIw94Eu.js → emoji-catalog-data-_ZhwYlX6.js} +0 -0
  442. /package/dist/assets/{format-countdown-C-J64lue.js → format-countdown-BRdD5t1W.js} +0 -0
  443. /package/dist/assets/{format-file-size-Daiq0gMr.js → format-file-size-CEqN0m2h.js} +0 -0
  444. /package/dist/assets/{home-tbbkVcjW.js → home-B--cMopL.js} +0 -0
  445. /package/dist/assets/{home-BteaphB_.js → home-B6H0v48H.js} +0 -0
  446. /package/dist/assets/{home-CCUv41ef.js → home-C1py7XQe.js} +0 -0
  447. /package/dist/assets/{home-DO7A2tVm.js → home-CZSiQM2c.js} +0 -0
  448. /package/dist/assets/{intelligence-xiqKApFj.js → intelligence-AZoeHYNk.js} +0 -0
  449. /package/dist/assets/{intelligence-s33k1wI2.js → intelligence-ByOscdNs.js} +0 -0
  450. /package/dist/assets/{intelligence-Bla65nm5.js → intelligence-CACuvYQr.js} +0 -0
  451. /package/dist/assets/{intelligence-Db527yzW.js → intelligence-Dg4wVSdX.js} +0 -0
  452. /package/dist/assets/{library-BRmAQI9e.js → library-B9Qt21qk.js} +0 -0
  453. /package/dist/assets/{library-DuuiJut6.js → library-CnxFRxu8.js} +0 -0
  454. /package/dist/assets/{library-ClpjgmQn.js → library-Cx3az3ti.js} +0 -0
  455. /package/dist/assets/{library-BhC14-NO.js → library-DIO1gZ0U.js} +0 -0
  456. /package/dist/assets/{link-click-e-Fdx5JV.js → link-click-BdI43zRN.js} +0 -0
  457. /package/dist/assets/{logs-SCSd0kUm.js → logs-4gzI0mqO.js} +0 -0
  458. /package/dist/assets/{logs-DwYHebVx.js → logs-CDvqZ4JP.js} +0 -0
  459. /package/dist/assets/{logs-NHN9-mUP.js → logs-CrDZcD8o.js} +0 -0
  460. /package/dist/assets/{logs-CQYFdGa_.js → logs-Dmqay4Dh.js} +0 -0
  461. /package/dist/assets/{machine-sizes-DadN4uVk.js → machine-sizes-ez3aIfKG.js} +0 -0
  462. /package/dist/assets/{onboarding-step-layout-COS57xjn.js → onboarding-step-layout-DgPEiR2D.js} +0 -0
  463. /package/dist/assets/{plugin-attribution-zkdgIHRG.js → plugin-attribution-BHvBZd51.js} +0 -0
  464. /package/dist/assets/{radio-card-nav-DCE3wYLZ.js → radio-card-nav-CZ23fZDo.js} +0 -0
  465. /package/dist/assets/{remote-web-DfCFOpuR.js → remote-web-4NRQQXml.js} +0 -0
  466. /package/dist/assets/{remote-web-D3chXkbO.js → remote-web-B8SfPASo.js} +0 -0
  467. /package/dist/assets/{remote-web-BIYYINs1.js → remote-web-Cc4dmJ0o.js} +0 -0
  468. /package/dist/assets/{remote-web-CSrWAyIC.js → remote-web-Dp6mRdmN.js} +0 -0
  469. /package/dist/assets/{schedules-BBaBmcJG.js → schedules-BiEnjMbJ.js} +0 -0
  470. /package/dist/assets/{schedules-jUeeTvGp.js → schedules-Bv2BFo_x.js} +0 -0
  471. /package/dist/assets/{schedules-CjtoHUii.js → schedules-CSTIvSjW.js} +0 -0
  472. /package/dist/assets/{schedules-CpR8IZ0O.js → schedules-CrEwUMbq.js} +0 -0
  473. /package/dist/assets/{signup-onboarding-handoff-DsARDCO5.js → signup-onboarding-handoff-BZ0YGSjD.js} +0 -0
  474. /package/dist/assets/{terminal-BkBRbIo0.js → terminal-Cjb3eVUa.js} +0 -0
  475. /package/dist/assets/{terminal-BDTudyuW.js → terminal-DDmiKM39.js} +0 -0
  476. /package/dist/assets/{terminal-DOjJsvsr.js → terminal-hha8indE.js} +0 -0
  477. /package/dist/assets/{terminal-DzafX5hx.js → terminal-sl6GyHu4.js} +0 -0
  478. /package/dist/assets/{usage-window-C3F8jUQI.js → usage-window-JvfWtnk-.js} +0 -0
  479. /package/dist/assets/{xterm-BQMgK3JF.js → xterm-D8OYaXNN.js} +0 -0
  480. /package/dist/assets/{xterm-addon-fit-Cb7BiyPE.js → xterm-addon-fit-BjUM59GY.js} +0 -0
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Dc as t,Df as n,Ec as r,Fx as i,Ga as a,Ha as o,Jt as s,Ka as c,Lb as l,Ns as u,Os as d,Ua as f,Ut as p,Wa as m,Wt as h,Zt as g,_b as _,_x as v,ao as y,ax as b,co as x,dm as S,dx as C,et as w,ex as T,gd as E,hd as D,hx as O,io as k,it as A,jg as j,ks as M,lu as ee,no as te,nt as ne,oo as N,qa as re,ro as ie,so as P,su as ae,tb as oe,to as se,tt as ce,vb as le,vx as ue,wx as F,yx as de,zb as fe}from"./app-DYcUyeCV.js";import{Zn as I,er as pe,j as L}from"./vendor-Dce4XQGd.js";import{_ as me,n as he,r as R,t as ge,x as _e}from"./react-B9IgSVeK.js";import{Ia as ve,ur as z}from"./icons-SKs_cTXW.js";import{t as B}from"./detail-card-BfZQepf_.js";import{t as ye}from"./stt-language-picker-modal-CvY6PHkq.js";import{t as be}from"./use-hotkey-recorder-e0BAwbQD.js";var V=e(_e(),1),H=ge();function U({label:e,selected:t,recording:n=!1,onClick:r}){return(0,H.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,H.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,H.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function xe(){let{t:e}=L(`settings`),{available:t,currentCode:n,configuredProviderId:r,selectLanguage:a,selecting:o}=ne(w()),[s,c]=(0,V.useState)(!1);return t?(0,H.jsxs)(B,{title:e(`listeningLanguageCard.title`),subtitle:e(`listeningLanguageCard.subtitle`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`span`,{className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`,children:A(n,r)}),(0,H.jsx)(i,{variant:`outlined`,onClick:()=>c(!0),className:`shrink-0`,children:e(`listeningLanguageCard.change`)})]}),(0,H.jsx)(ye,{open:s,onOpenChange:c,title:e(`listeningLanguageCard.title`),currentCode:n,configuredProviderId:r,selectLanguage:a,selecting:o})]}):null}var W=`flux`;function Se(e){return e===`vellum`}function Ce(e,t){let n=e?.trim().toLowerCase();return!n||n===`multi`||t===void 0?!0:t.includes(n.split(`-`)[0]??n)}function we(){let{t:e}=L(`settings`),t=pe(),r=S(),i=w(),[a,o]=(0,V.useState)(!1),{data:s}=I({...D({path:{assistant_id:i}}),enabled:r,staleTime:3e4}),c=s?.services?.stt,{data:l}=I({...n({path:{assistant_id:i}}),enabled:r,staleTime:5*6e4}),u=c?.roles?.liveVoice?.provider??c?.provider,d=l?.providers?.find(e=>e.id===u),f=d?.modelFamilies?.includes(W)??!1;if(!u||!f)return null;let p=Ce(c?.language,d?.turnDetectionLanguages),m=c?.roles?.liveVoice,h=m?m.model:c?.providers?.[u]?.model,g=h===void 0?Se(u)&&p:h===W,_=async n=>{o(!0);try{let{response:e}=await j({path:{assistant_id:i},body:{services:{stt:{roles:{liveVoice:{provider:u,model:n?W:d?.baseModelFamily}}}}},throwOnError:!1});if(!e?.ok)throw Error(String(e?.status??``));await t.invalidateQueries({queryKey:E({path:{assistant_id:i}})})}catch{O.error(e(`voicePage.turnDetectionFailed`))}finally{o(!1)}};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`voicePage.turnDetectionLabel`)}),(0,H.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(p?`voicePage.turnDetectionDescription`:`voicePage.turnDetectionLanguageUnsupported`)}),(0,H.jsx)(F,{checked:g,disabled:a||!p&&!g,onChange:e=>void _(e),"aria-label":e(`voicePage.turnDetectionLabel`)})]})}var G=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,K=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--system-negative-strong)]`,Te=2;function q(e){let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),x(t)}function Ee(){let{t:e}=L(`settings`),t=ie(),n=o(e=>e.registered)===!1,[r,a]=(0,V.useState)(null),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)([]),[d,f]=(0,V.useState)(!1),p=(0,V.useRef)(null),m=(0,V.useCallback)(async()=>{a((await ae())?.inputMonitoring.status??null)},[]);(0,V.useEffect)(()=>{m();let e=setInterval(()=>{m()},2e3);return()=>{clearInterval(e)}},[m]);let h=(0,V.useCallback)(()=>{ee(`inputMonitoring`).then(m)},[m]),g=(0,V.useCallback)(e=>{k(e),c(!1),u([]),f(!1),e.kind!==`off`&&h()},[h]),_=(0,V.useCallback)(()=>{c(!0),u([]),f(!1),requestAnimationFrame(()=>{p.current?.focus()})},[]),v=(0,V.useCallback)(()=>{c(!1),u([]),f(!1)},[]),y=(0,V.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){v();return}u(q(e))},[v]),b=(0,V.useCallback)(e=>{if(s&&!(q(e).length>0)){if(l.length>=Te){g({kind:`modifierOnly`,modifiers:l});return}u([]),f(!0)}},[g,l,s]);(0,V.useEffect)(()=>{if(!s)return;let e=e=>{p.current&&!p.current.contains(e.target)&&v()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[v,s]);let x=te(t),S=t.kind===`modifierOnly`&&!x,C=t.kind!==`off`,w=t.kind===`modifierOnly`&&t.modifiers.includes(`control`)&&t.modifiers.includes(`option`),T=r===`granted`;return(0,H.jsx)(B,{title:e(`voiceKeyCard.title`),subtitle:e(`voiceKeyCard.subtitle`),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{ref:p,tabIndex:s?0:-1,onKeyDown:s?y:void 0,onKeyUp:s?b:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[(0,H.jsx)(U,{label:e(`voiceKeyCard.fnLabel`),selected:x,onClick:()=>g(se)}),s?(0,H.jsx)(U,{label:l.length>0?P(l):e(`voiceKeyCard.recordingPrompt`),selected:!0,recording:!0,onClick:v}):(0,H.jsx)(U,{label:t.kind===`modifierOnly`&&!x?P(t.modifiers):e(`voiceKeyCard.customLabel`),selected:S,onClick:_}),(0,H.jsx)(U,{label:e(`voiceKeyCard.offLabel`),selected:!C,onClick:()=>g({kind:`off`})})]}),d&&(0,H.jsxs)(`div`,{className:G,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voiceKeyCard.customHint`)})]}),C&&r!==null&&!T&&(0,H.jsxs)(`div`,{className:`flex flex-col items-start gap-2 pt-1`,children:[(0,H.jsxs)(`div`,{className:K,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voiceKeyCard.needsInputMonitoring`)})]}),(0,H.jsx)(i,{variant:`outlined`,onClick:h,children:e(`voiceKeyCard.allowInputMonitoring`)})]}),C&&T&&n&&(0,H.jsxs)(`div`,{className:K,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voiceKeyCard.refusedNote`)})]}),x&&(0,H.jsxs)(`div`,{className:G,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voiceKeyCard.fnDictationNote`)})]}),w&&(0,H.jsxs)(`div`,{className:G,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voiceKeyCard.voiceOverNote`)})]})]})})}function De({assistantId:e,open:t,onOpenChange:n}){return(0,H.jsx)(v.Root,{open:t,onOpenChange:n,children:(0,H.jsx)(v.Content,{size:`md`,children:(0,H.jsx)(Oe,{assistantId:e,onDone:()=>n(!1)})})})}function Oe({assistantId:e,onDone:t}){let{t:n}=L(),{available:r,currentModel:a,selectModel:o,selecting:c}=s(e);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(v.Header,{children:[(0,H.jsx)(v.Title,{children:n(`voicePickerModal.title`)}),r&&(0,H.jsx)(v.Description,{children:`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`})]}),(0,H.jsx)(v.Body,{children:(0,H.jsx)(h,{assistantId:e,filterBySource:!0,value:a,onChange:o,autoScrollToSelected:!0})}),(0,H.jsxs)(v.Footer,{className:`items-center justify-between gap-3`,children:[(0,H.jsx)(ce,{}),(0,H.jsx)(i,{variant:`primary`,onClick:t,disabled:c,className:`shrink-0`,children:n(`voicePickerModal.done`)})]})]})}function ke(){let{t:e}=L(`settings`),t=w(),{available:n,settled:r,voices:a,currentModel:o}=s(t),c=a.find(e=>e.model===o)??a[0],[l,u]=(0,V.useState)(!1),d=oe.use.name(),f=d?e(`voicePickerCard.titleWithName`,{name:d}):e(`voicePickerCard.title`);return r?n&&c?(0,H.jsxs)(B,{title:f,subtitle:e(`voicePickerCard.creditsNote`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(p,{description:c.description,className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`}),(0,H.jsx)(i,{variant:`outlined`,onClick:()=>u(!0),className:`shrink-0`,children:e(`voicePickerCard.changeButton`)})]}),(0,H.jsx)(De,{assistantId:t,open:l,onOpenChange:u})]}):(0,H.jsx)(B,{title:f,children:(0,H.jsx)(g,{})}):(0,H.jsx)(B,{title:f,children:(0,H.jsx)(T,{as:`span`,role:`status`,"aria-label":e(`voicePickerCard.loadingAria`),className:`block h-9 w-48`})})}var Ae=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],je=`We recommend keeping both off to start. It feels more like a real conversation.`;function Me(){let{t:e}=L();return(0,H.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:e(`voiceTranscriptToggles.recommendedOff`)})}function Ne({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,H.jsx)(Me,{}):null]}),t?(0,H.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,H.jsx)(F,{checked:r,onChange:i,"aria-label":e})]})}function Pe({showDescription:e=!1,showRecommendedBadge:n=!1}){let{t:r}=L(),i=t.use.showUserTranscript(),a=t.use.showAssistantTranscript(),o=t.use.setShowUserTranscript(),s=t.use.setShowAssistantTranscript(),c={showUserTranscript:{checked:i,onChange:o},showAssistantTranscript:{checked:a,onChange:s}},l=(e,t)=>r(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptLabel`:`voiceTranscriptToggles.assistantTranscriptLabel`,t),u=(e,t)=>r(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptDescription`:`voiceTranscriptToggles.assistantTranscriptDescription`,t);return(0,H.jsx)(H.Fragment,{children:Ae.map(t=>{let r=c[t.prefKey];return(0,H.jsx)(Ne,{label:l(t.prefKey,t.label),description:e?u(t.prefKey,t.description):void 0,showBadge:n,checked:r.checked,onChange:r.onChange},t.prefKey)})})}var J=`text-body-small-default text-[var(--content-tertiary)]`;function Fe(){let[e]=me(),t=e.get(`tab`);return t===`sounds`?(0,H.jsx)(R,{replace:!0,to:_.settings.sounds}):t===`services`?(0,H.jsx)(R,{replace:!0,to:_.settings.ai}):(0,H.jsx)(Ie,{})}function Ie(){let{t:e}=L(`settings`);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,H.jsxs)(Y,{heading:e(`voicePage.sectionOutputHeading`),description:e(`voicePage.sectionOutputDescription`),children:[(0,H.jsx)(ke,{}),(0,H.jsx)(Le,{})]}),(0,H.jsxs)(Y,{heading:e(`voicePage.sectionInputHeading`),description:e(`voicePage.sectionInputDescription`),children:[(0,H.jsx)(Re,{}),(0,H.jsx)(xe,{}),u()?(0,H.jsx)(Ee,{}):(0,H.jsx)(Ve,{}),(0,H.jsx)(He,{})]}),(0,H.jsx)(Y,{heading:e(`voicePage.sectionCaptionsHeading`),children:(0,H.jsx)(X,{})})]})}function Le(){let{t:e}=L(`settings`),{available:t}=s(w());return t?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 text-body-small-lighter text-[var(--content-tertiary)]`,children:[(0,H.jsx)(z,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-quiet)]`}),(0,H.jsx)(`span`,{children:e(`voicePage.speechServicesBannerPrompt`)}),(0,H.jsxs)(he,{to:`${_.settings.ai}#text-to-speech`,className:`inline-flex items-center gap-1 text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 hover:text-[var(--content-default)]`,children:[e(`voicePage.speechServicesBannerLink`),(0,H.jsx)(ve,{className:`h-3 w-3`})]})]}):null}function Y({heading:e,description:t,children:n}){return(0,H.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t&&(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:t})]}),n]})}function X(){let{t:e}=L(`settings`);return(0,H.jsx)(B,{title:e(`voicePage.captionsTitle`),subtitle:e(`voicePage.captionsSubtitle`),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(Pe,{showDescription:!0}),(0,H.jsx)(`p`,{className:`${J} pt-1`,children:e(`voicePage.captionsRecommendation`,je)})]})})}var Z=``;function Re(){let{t:e}=L(`settings`),[t,n]=(0,V.useState)([]),[r,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(!1),[c,u]=(0,V.useState)(()=>M()),f=(0,V.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);a(e.length>0&&e.every(e=>!e.label)),n(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`)),s(e.length===0||e.some(e=>!!e.label))}catch{n([]),a(!1),s(!1)}},[]),p=(0,V.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}f()},[f]);(0,V.useEffect)(()=>{f();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void f();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[f]);let m=(0,V.useMemo)(()=>{let n=t.map((t,n)=>({value:t.deviceId,label:t.label||e(`voicePage.microphoneFallbackLabel`,{index:n+1})})),r=c!==Z&&!n.some(e=>e.value===c);return[{value:null,label:e(`voicePage.systemDefault`)},...n,...r?[{value:c,label:e(o?`voicePage.savedMicrophoneNotConnected`:`voicePage.savedMicrophone`)}]:[]]},[t,c,o,e]),h=(0,V.useCallback)(e=>{u(e),e===Z?l(d):fe(d,e)},[]),g=c===Z?null:c;return(0,H.jsx)(B,{title:e(`voicePage.microphoneTitle`),subtitle:e(`voicePage.microphoneSubtitle`),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsx)(`div`,{className:`max-w-xs`,children:(0,H.jsx)(b,{options:m,value:g,onChange:h,onSelectNone:()=>h(Z),"aria-label":e(`voicePage.microphoneAriaLabel`)})}),r&&(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(i,{variant:`outlined`,onClick:p,children:e(`voicePage.allowMicrophoneAccess`)}),(0,H.jsx)(`span`,{className:J,children:e(`voicePage.grantMicrophoneAccessHint`)})]})]})})}var ze=new Set([`Control`,`Alt`,`Shift`,`Meta`]),Q=`toggleVoice`,Be=[{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}}];function Ve(){let{t:e}=L(`settings`),t=le(),[n,r]=(0,V.useState)(()=>a()),[i,o]=(0,V.useState)(!1),[s,l]=(0,V.useState)([]),[u,d]=(0,V.useState)(!1),p=(0,V.useRef)(null),h=(0,V.useMemo)(()=>{let e=m();return[{label:y(e),activator:e}]},[]),g=n.kind!==`off`,_=(0,V.useCallback)(e=>{r(e),re(e),o(!1),l([]),d(!1)},[]),v=be({onBound:()=>_({kind:`off`})}),b=v.catalog.find(e=>e.key===Q)?.accelerator??``,S=v.recordingKey===Q,w=c()?Be:[],T=(0,V.useCallback)(e=>{_(e),v.removeHotkey(Q)},[v,_]),E=(0,V.useCallback)(()=>{_({kind:`off`}),v.removeHotkey(Q)},[v,_]),D=(0,V.useCallback)(()=>{o(!0),l([]),d(!1),requestAnimationFrame(()=>{p.current?.focus()})},[]),O=(0,V.useCallback)(()=>{o(!1),l([]),d(!1)},[]),k=(0,V.useCallback)(e=>{let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),t},[]),A=(0,V.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){O();return}let t=k(e);if(ze.has(e.key)){d(!1),l(x(t));return}if(t.length===0){d(!0);return}_({kind:`key`,label:e.key.length===1?e.key.toUpperCase():e.key,modifiers:x(t)})},[O,k,_]),j=(0,V.useCallback)(e=>{i&&k(e).length===0&&s.length>0&&(l([]),d(!0))},[k,i,s]);(0,V.useEffect)(()=>{if(!i)return;let e=e=>{p.current&&!p.current.contains(e.target)&&O()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[O,i]);let M=g&&!h.some(e=>N(e.activator,n));return t?(0,H.jsx)(B,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitleDesktop`),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[w.map(e=>(0,H.jsx)(U,{label:e.label,selected:N(e.activator,n),onClick:()=>T(e.activator)},e.label)),(0,H.jsx)(U,{label:S?e(`voicePage.recordingPrompt`):b?(0,H.jsx)(C,{accelerator:b}):e(`voicePage.customKey`),selected:b!==``,recording:S,onClick:S?v.stopRecording:()=>v.startRecording(Q)}),(0,H.jsx)(U,{label:e(`voicePage.offKeyLabel`),selected:n.kind===`off`&&!b&&!S,onClick:E})]}),v.conflict?.key===Q&&(0,H.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voicePage.shortcutConflict`,{command:v.conflict.label})})]})]})}):(0,H.jsx)(B,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitle`),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(F,{checked:g,onChange:e=>{_(e?f():{kind:`off`})},label:e(`voicePage.enableVoiceShortcut`)}),g&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`span`,{className:J,children:e(`voicePage.activationKeyLabel`)}),(0,H.jsxs)(`div`,{ref:p,tabIndex:i?0:-1,onKeyDown:i?A:void 0,onKeyUp:i?j:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[h.map(e=>(0,H.jsx)(U,{label:e.label,selected:N(e.activator,n),onClick:()=>_(e.activator)},e.label)),i?(0,H.jsx)(U,{label:s.length>0?P(s):e(`voicePage.pressShortcut`),selected:!0,recording:!0,onClick:O}):(0,H.jsx)(U,{label:M?y(n):e(`voicePage.customKey`),selected:M,onClick:D})]}),u&&(0,H.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voicePage.shortcutChordHint`)})]}),g&&(0,H.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,H.jsx)(z,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{children:e(`voicePage.focusedTabNote`)})]})]})]})})}function He(){let{t:e}=L(`settings`),n=t.use.pauseBeforeReplyMs(),a=t.use.setPauseBeforeReplyMs(),o=t.use.interruptSensitivity(),s=t.use.setInterruptSensitivity(),c=(0,V.useMemo)(()=>[{value:`low`,label:e(`voicePage.interruptSensitivityLow`)},{value:`medium`,label:e(`voicePage.interruptSensitivityMedium`)},{value:`high`,label:e(`voicePage.interruptSensitivityHigh`)}],[e]),l=n!==null||o!==null;return(0,H.jsx)(B,{title:e(`voicePage.turnTakingTitle`),subtitle:e(`voicePage.turnTakingSubtitle`),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,H.jsx)(we,{}),(0,H.jsx)($,{label:e(`voicePage.pauseBeforeReplyLabel`),description:e(`voicePage.pauseBeforeReplyDescription`),isDefault:n===null,children:(0,H.jsx)(`div`,{className:`max-w-xs`,children:(0,H.jsx)(ue,{value:(n??1200)/1e3,onValueChange:e=>{typeof e==`number`&&a(Math.round(e*1e3))},min:500/1e3,max:r/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":e(`voicePage.pauseBeforeReplyAriaLabel`)})})}),(0,H.jsx)($,{label:e(`voicePage.interruptSensitivityLabel`),description:e(`voicePage.interruptSensitivityDescription`),isDefault:o===null,children:(0,H.jsx)(`div`,{className:`max-w-xs`,children:(0,H.jsx)(de,{items:c,value:o??`medium`,onChange:s,ariaLabel:e(`voicePage.interruptSensitivityAriaLabel`)})})}),l&&(0,H.jsx)(`div`,{children:(0,H.jsx)(i,{variant:`outlined`,onClick:()=>{a(null),s(null)},children:e(`voicePage.resetToDefaults`)})})]})})}function $({label:e,description:t,isDefault:n,children:r}){let{t:i}=L(`settings`);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),n&&(0,H.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:i(`voicePage.defaultBadge`)})]}),(0,H.jsx)(`p`,{className:J,children:t}),r]})}export{Fe as VoicePage};
@@ -0,0 +1 @@
1
+ import{$n as e,Cn as t,wn as n}from"./app-DYcUyeCV.js";import{j as r}from"./vendor-Dce4XQGd.js";import{t as i}from"./react-B9IgSVeK.js";import{Q as a}from"./icons-SKs_cTXW.js";var o=i();function s({payload:t,onClose:i}){let{t:s}=r(`chat`),u=n(t.body);return(0,o.jsx)(e,{Glyph:a,title:t.title||s(`wakeDetailPanel.title`),closeLabel:s(`wakeDetailPanel.close`),closeTooltip:s(`wakeDetailPanel.close`),closeVariant:`outlined`,onClose:i,children:(0,o.jsxs)(`dl`,{className:`flex flex-col gap-6`,children:[u.workflow&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.workflow`),children:u.workflow}),u.runStatus&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.runStatus`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.runStatus})}),u.result&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.result`),children:(0,o.jsx)(c,{result:u.result})}),u.rest&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.details`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.rest})}),t.metadata.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-6`,children:t.metadata.map(e=>(0,o.jsx)(l,{label:e.label,children:e.value},e.label))})]})})}function c({result:e}){let n=t(e);return n?(0,o.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map((e,t)=>(0,o.jsx)(`div`,{className:t>0?`flex flex-col gap-2 border-t border-[var(--border-hover)] pt-4`:`flex flex-col gap-2`,children:e.map(e=>(0,o.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,o.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.key}),(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e.value})]},e.key))},t))}):(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e})}function l({label:e,children:t}){return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`dt`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:e}),(0,o.jsx)(`dd`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t})]})}export{s as WakeDetailPanel};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$t as t,Ba as n,en as r,nn as i,tn as a}from"./app-DYcUyeCV.js";import{j as o}from"./vendor-Dce4XQGd.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{B as l,bi as u,c as d,ei as f,et as p,gi as m,gn as h,hi as g,vi as _,xi as v,yi as y}from"./icons-SKs_cTXW.js";var b=e(c(),1),x={"sun.max.fill":{icon:l,className:`text-orange-500`},"cloud.sun.fill":{icon:m,className:`text-amber-400`},"moon.fill":{icon:h,className:`text-blue-400`},"cloud.moon.fill":{icon:y,className:`text-blue-400`},"cloud.fill":{icon:g,className:`text-stone-400`},"cloud.rain.fill":{icon:_,className:`text-blue-400`},snowflake:{icon:p,className:`text-blue-300`},"cloud.bolt.fill":{icon:u,className:`text-orange-500`},"cloud.fog.fill":{icon:v,className:`text-stone-400`}},S={sunny:{icon:l,className:`text-orange-500`},clear:{icon:l,className:`text-orange-500`},"partly cloudy":{icon:m,className:`text-amber-400`},"mostly sunny":{icon:m,className:`text-amber-400`},cloudy:{icon:g,className:`text-stone-400`},overcast:{icon:g,className:`text-stone-400`},rainy:{icon:_,className:`text-blue-400`},rain:{icon:_,className:`text-blue-400`},drizzle:{icon:_,className:`text-blue-400`},snow:{icon:p,className:`text-blue-300`},snowy:{icon:p,className:`text-blue-300`},thunderstorm:{icon:u,className:`text-orange-500`},thunder:{icon:u,className:`text-orange-500`},foggy:{icon:v,className:`text-stone-400`},fog:{icon:v,className:`text-stone-400`},mist:{icon:v,className:`text-stone-400`},hazy:{icon:v,className:`text-stone-400`},night:{icon:h,className:`text-blue-400`},"mainly clear":{icon:l,className:`text-orange-500`},"mostly cloudy":{icon:g,className:`text-stone-400`},breezy:{icon:d,className:`text-stone-400`},windy:{icon:d,className:`text-stone-400`},cool:{icon:g,className:`text-stone-400`},warm:{icon:l,className:`text-orange-500`},hot:{icon:l,className:`text-orange-500`},cold:{icon:p,className:`text-blue-300`},"cold snap":{icon:p,className:`text-blue-300`},"warm, mostly sunny":{icon:m,className:`text-amber-400`},"cooler, breezy":{icon:d,className:`text-stone-400`}},C={icon:g,className:`text-stone-400`};function w(e){let t=x[e];if(t)return t;let n=e.toLowerCase(),r=S[n];if(r)return r;for(let[e,t]of Object.entries(S))if(n.includes(e))return t;return C}function T(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function E(e){let n;if(typeof e.location==`string`)n=e.location;else{let t=a(e.location);t&&typeof t.name==`string`&&(n=t.name)}if(!n)return null;let o=a(e.current),s=r(o?.temp)??r(e.currentTemp)??r(e.temperature)??r(e.temp),c=r(o?.feelsLike)??r(o?.feels_like)??r(o?.apparentTemperature)??r(e.feelsLike)??r(e.feels_like)??r(e.apparentTemperature),l=i(o?.condition)??i(e.condition),u=r(o?.humidity)??r(e.humidity),d=T(o?.wind??e.wind),f=r(o?.windSpeed)??r(o?.wind_speed)??r(e.windSpeed)??r(e.wind_speed)??d.speed,p=i(o?.windDirection)??i(o?.wind_direction)??i(e.windDirection)??i(e.wind_direction)??d.direction,m=a(e.units),h=i(m?.temperature)??i(o?.unit)??i(e.unit)??`F`,g=i(m?.speed)??i(e.windUnit)??i(e.wind_unit),_=t(e.hourly).map((e,t)=>({id:i(e.id)??String(t),time:i(e.time)??``,icon:i(e.icon)??i(e.condition)??`cloud.fill`,temp:r(e.tempC)??r(e.temp)??r(e.temperature),tempC:r(e.tempC)})),v=t([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:i(e.id)??String(t),day:i(e.day)??i(e.date),dayLabel:i(e.dayLabel)??i(e.date),icon:i(e.icon)??i(e.condition)??`cloud.fill`,low:r(e.low),high:r(e.high),lowC:r(e.lowC),highC:r(e.highC),precip:r(e.precip)??r(e.precipitation)??r(e.precipitationProbability),condition:i(e.condition)}));return{location:n,currentTemp:s,feelsLike:c,condition:l,humidity:u,windSpeed:f,windDirection:p,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function D(e){return e*9/5+32}function O(e){return(e-32)*5/9}function k(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=O(e)),!t&&n&&(r=D(e)),`${Math.round(r)}`}function A(e,t,n){return e.tempC===void 0?e.temp===void 0?null:k(e.temp,t,n):k(e.tempC,!1,n)}function j(e,t,n){return e.lowC===void 0?k(e.low,t,n):k(e.lowC,!1,n)}function M(e,t,n){return e.highC===void 0?k(e.high,t,n):k(e.highC,!1,n)}var N=s();function P({icon:e,size:t=20}){let{icon:n,className:r}=w(e);return(0,N.jsx)(n,{width:t,height:t,className:r})}function F({useFahrenheit:e,onToggle:t}){let{t:r}=o(`chat`);return(0,N.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:n(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:r(`weatherForecastDisplay.fahrenheit`)}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:n(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:r(`weatherForecastDisplay.celsius`)})]})}function I({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let{t:i}=o(`chat`),a=e.location,s=k(e.currentTemp,t,n),c=k(e.feelsLike,t,n),l=n?`F`:`C`,u=e.forecast?.[0],p=u?M(u,t,n):null,m=u?j(u,t,n):null,h=null;return e.windSpeed!==void 0&&(h=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(h=`${e.windDirection} ${h}`)),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:a}),s!==null&&(0,N.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[s,`°`,l]}),e.condition&&(0,N.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,N.jsx)(F,{useFahrenheit:n,onToggle:r})]}),(0,N.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[c!==null&&(0,N.jsx)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:i(`weatherForecastDisplay.feelsLike`,{temp:c})}),p!==null&&m!==null&&(0,N.jsx)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:i(`weatherForecastDisplay.highLow`,{high:p,low:m})}),h&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,N.jsx)(d,{width:12,height:12}),h]}),e.humidity!==void 0&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,N.jsx)(f,{width:12,height:12}),e.humidity,`%`]})]})]})}function L({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){let{t:r}=o(`chat`);return(0,N.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,N.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,i)=>{let a=e.time.toLowerCase()===`now`,o=A(e,t,n);return(0,N.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,N.jsx)(`span`,{className:a?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:a?r(`weatherForecastDisplay.now`):e.time}),(0,N.jsx)(P,{icon:e.icon,size:18}),o!==null&&(0,N.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[o,`°`]})]},e.id??i)})})})}function R({forecast:e,currentTemp:t,sourceIsFahrenheit:r,useFahrenheit:i}){let{globalMin:a,globalMax:o}=(0,b.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,N.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,N.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=j(e,r,i),f=M(e,r,i),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&t!==void 0){let n=(e.lowC!==void 0||e.highC!==void 0)&&r?(t-32)*5/9:t;y=h===m?50:(Math.max(m,Math.min(h,n))-m)/(h-m)*100}return(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:n(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,N.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,N.jsx)(P,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,N.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,N.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,N.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,N.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,N.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,N.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function z({templateData:e,fallback:t}){let n=(0,b.useMemo)(()=>E(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,b.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,N.jsxs)(`div`,{className:`mt-3`,children:[(0,N.jsx)(I,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,N.jsx)(L,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,N.jsx)(R,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{z as WeatherForecastDisplay};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";function t(){let e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t=`unknown`,n=e?e.type||e.effectiveType:null;if(n&&typeof n==`string`)switch(n){case`bluetooth`:case`cellular`:t=`cellular`;break;case`none`:t=`none`;break;case`ethernet`:case`wifi`:case`wimax`:t=`wifi`;break;case`other`:case`unknown`:t=`unknown`;break;case`slow-2g`:case`2g`:case`3g`:t=`cellular`;break;case`4g`:t=`wifi`;break;default:break}return t}var n=class extends e{constructor(){super(),this.handleOnline=()=>{let e={connected:!0,connectionType:t()};this.notifyListeners(`networkStatusChange`,e)},this.handleOffline=()=>{this.notifyListeners(`networkStatusChange`,{connected:!1,connectionType:`none`})},typeof window<`u`&&(window.addEventListener(`online`,this.handleOnline),window.addEventListener(`offline`,this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable(`Browser does not support the Network Information API`);let e=window.navigator.onLine,n=t();return{connected:e,connectionType:e?n:`none`}}};new n;export{n as NetworkWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";function t(){let e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t=`unknown`,n=e?e.type||e.effectiveType:null;if(n&&typeof n==`string`)switch(n){case`bluetooth`:case`cellular`:t=`cellular`;break;case`none`:t=`none`;break;case`ethernet`:case`wifi`:case`wimax`:t=`wifi`;break;case`other`:case`unknown`:t=`unknown`;break;case`slow-2g`:case`2g`:case`3g`:t=`cellular`;break;case`4g`:t=`wifi`;break;default:break}return t}var n=class extends e{constructor(){super(),this.handleOnline=()=>{let e={connected:!0,connectionType:t()};this.notifyListeners(`networkStatusChange`,e)},this.handleOffline=()=>{this.notifyListeners(`networkStatusChange`,{connected:!1,connectionType:`none`})},typeof window<`u`&&(window.addEventListener(`online`,this.handleOnline),window.addEventListener(`offline`,this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable(`Browser does not support the Network Information API`);let e=window.navigator.onLine,n=t();return{connected:e,connectionType:e?n:`none`}}};new n;export{n as NetworkWeb};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";var t=class extends e{constructor(){super(),this._lastWindow=null}async open(e){this._lastWindow=window.open(e.url,e.windowName||`_blank`)}async close(){return new Promise((e,t)=>{this._lastWindow==null?t(`No active window to close!`):(this._lastWindow.close(),this._lastWindow=null,e())})}};new t;export{t as BrowserWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";var t=class extends e{constructor(){super(),this._lastWindow=null}async open(e){this._lastWindow=window.open(e.url,e.windowName||`_blank`)}async close(){return new Promise((e,t)=>{this._lastWindow==null?t(`No active window to close!`):(this._lastWindow.close(),this._lastWindow=null,e())})}};new t;export{t as BrowserWeb};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";import{n as t,t as n}from"./definitions-BTebkxyz.js";var r=class extends e{constructor(){super(...arguments),this.selectionStarted=!1}async impact(e){let t=this.patternForImpact(e?.style);this.vibrateWithPattern(t)}async notification(e){let t=this.patternForNotification(e?.type);this.vibrateWithPattern(t)}async vibrate(e){let t=e?.duration||300;this.vibrateWithPattern([t])}async selectionStart(){this.selectionStarted=!0}async selectionChanged(){this.selectionStarted&&this.vibrateWithPattern([70])}async selectionEnd(){this.selectionStarted=!1}patternForImpact(e=n.Heavy){return e===n.Medium?[43]:e===n.Light?[20]:[61]}patternForNotification(e=t.Success){return e===t.Warning?[30,40,30,50,60]:e===t.Error?[27,45,50]:[35,65,21]}vibrateWithPattern(e){if(navigator.vibrate)navigator.vibrate(e);else throw this.unavailable(`Browser does not support the vibrate API`)}};export{r as HapticsWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";import{n as t,t as n}from"./definitions-at6loHuH.js";var r=class extends e{constructor(){super(...arguments),this.selectionStarted=!1}async impact(e){let t=this.patternForImpact(e?.style);this.vibrateWithPattern(t)}async notification(e){let t=this.patternForNotification(e?.type);this.vibrateWithPattern(t)}async vibrate(e){let t=e?.duration||300;this.vibrateWithPattern([t])}async selectionStart(){this.selectionStarted=!0}async selectionChanged(){this.selectionStarted&&this.vibrateWithPattern([70])}async selectionEnd(){this.selectionStarted=!1}patternForImpact(e=n.Heavy){return e===n.Medium?[43]:e===n.Light?[20]:[61]}patternForNotification(e=t.Success){return e===t.Warning?[30,40,30,50,60]:e===t.Error?[27,45,50]:[35,65,21]}vibrateWithPattern(e){if(navigator.vibrate)navigator.vibrate(e);else throw this.unavailable(`Browser does not support the vibrate API`)}};export{r as HapticsWeb};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";var t=class extends e{async start(e){return new Promise(async(t,n)=>{await navigator.mediaDevices.getUserMedia({audio:!e.disableAudio,video:!0}).then(e=>{e.getTracks().forEach(e=>e.stop())}).catch(e=>{n(e)});let r=document.getElementById(`video`),i=document.getElementById(e.parent);if(r)n({message:`camera already started`});else{let r=document.createElement(`video`);r.id=`video`,r.setAttribute(`class`,e.className||``),e.position!==`rear`&&r.setAttribute(`style`,`-webkit-transform: scaleX(-1); transform: scaleX(-1);`);let a=navigator.userAgent.toLowerCase();if(a.includes(`safari`)&&!a.includes(`chrome`)&&(r.setAttribute(`autoplay`,`true`),r.setAttribute(`muted`,`true`),r.setAttribute(`playsinline`,`true`)),i.appendChild(r),navigator.mediaDevices?.getUserMedia){let i={video:{width:{ideal:e.width},height:{ideal:e.height}}};e.position===`rear`?(i.video.facingMode=`environment`,this.isBackCamera=!0):this.isBackCamera=!1,navigator.mediaDevices.getUserMedia(i).then(function(e){r.srcObject=e,r.play(),t()},e=>{n(e)})}}})}async startRecordVideo(){throw this.unimplemented(`Not implemented on web.`)}async stopRecordVideo(){throw this.unimplemented(`Not implemented on web.`)}async stop(){let e=document.getElementById(`video`);if(e){e.pause();let t=e.srcObject.getTracks();for(let e of t)e.stop();e.remove()}}async capture(e){return new Promise(t=>{let n=document.getElementById(`video`),r=document.createElement(`canvas`),i=r.getContext(`2d`);r.width=n.videoWidth,r.height=n.videoHeight,this.isBackCamera||(i.translate(n.videoWidth,0),i.scale(-1,1)),i.drawImage(n,0,0,n.videoWidth,n.videoHeight);let a;a=e.quality==null?r.toDataURL(`image/png`).replace(`data:image/png;base64,`,``):r.toDataURL(`image/jpeg`,e.quality/100).replace(`data:image/jpeg;base64,`,``),t({value:a})})}async captureSample(e){return this.capture(e)}async getSupportedFlashModes(){throw Error(`getSupportedFlashModes not supported under the web platform`)}async setFlashMode(e){throw Error(`setFlashMode not supported under the web platform`)}async flip(){throw Error(`flip not supported under the web platform`)}async setOpacity(e){let t=document.getElementById(`video`);t&&e.opacity&&t.style.setProperty(`opacity`,e.opacity.toString())}async isCameraStarted(){throw this.unimplemented(`Not implemented on web.`)}};export{t as CameraPreviewWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";var t=class extends e{async start(e){return new Promise(async(t,n)=>{await navigator.mediaDevices.getUserMedia({audio:!e.disableAudio,video:!0}).then(e=>{e.getTracks().forEach(e=>e.stop())}).catch(e=>{n(e)});let r=document.getElementById(`video`),i=document.getElementById(e.parent);if(r)n({message:`camera already started`});else{let r=document.createElement(`video`);r.id=`video`,r.setAttribute(`class`,e.className||``),e.position!==`rear`&&r.setAttribute(`style`,`-webkit-transform: scaleX(-1); transform: scaleX(-1);`);let a=navigator.userAgent.toLowerCase();if(a.includes(`safari`)&&!a.includes(`chrome`)&&(r.setAttribute(`autoplay`,`true`),r.setAttribute(`muted`,`true`),r.setAttribute(`playsinline`,`true`)),i.appendChild(r),navigator.mediaDevices?.getUserMedia){let i={video:{width:{ideal:e.width},height:{ideal:e.height}}};e.position===`rear`?(i.video.facingMode=`environment`,this.isBackCamera=!0):this.isBackCamera=!1,navigator.mediaDevices.getUserMedia(i).then(function(e){r.srcObject=e,r.play(),t()},e=>{n(e)})}}})}async startRecordVideo(){throw this.unimplemented(`Not implemented on web.`)}async stopRecordVideo(){throw this.unimplemented(`Not implemented on web.`)}async stop(){let e=document.getElementById(`video`);if(e){e.pause();let t=e.srcObject.getTracks();for(let e of t)e.stop();e.remove()}}async capture(e){return new Promise(t=>{let n=document.getElementById(`video`),r=document.createElement(`canvas`),i=r.getContext(`2d`);r.width=n.videoWidth,r.height=n.videoHeight,this.isBackCamera||(i.translate(n.videoWidth,0),i.scale(-1,1)),i.drawImage(n,0,0,n.videoWidth,n.videoHeight);let a;a=e.quality==null?r.toDataURL(`image/png`).replace(`data:image/png;base64,`,``):r.toDataURL(`image/jpeg`,e.quality/100).replace(`data:image/jpeg;base64,`,``),t({value:a})})}async captureSample(e){return this.capture(e)}async getSupportedFlashModes(){throw Error(`getSupportedFlashModes not supported under the web platform`)}async setFlashMode(e){throw Error(`setFlashMode not supported under the web platform`)}async flip(){throw Error(`flip not supported under the web platform`)}async setOpacity(e){let t=document.getElementById(`video`);t&&e.opacity&&t.style.setProperty(`opacity`,e.opacity.toString())}async isCameraStarted(){throw this.unimplemented(`Not implemented on web.`)}};export{t as CameraPreviewWeb};
@@ -1 +1 @@
1
- import{D as e,O as t}from"./vendor-C_e0Rl2s.js";import{n}from"./definitions-BjZOswgM.js";function r(e){let t=e.split(`/`).filter(e=>e!==`.`),n=[];return t.forEach(e=>{e===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():n.push(e)}),n.join(`/`)}function i(e,t){e=r(e),t=r(t);let n=e.split(`/`),i=t.split(`/`);return e!==t&&n.every((e,t)=>e===i[t])}var a=class r extends e{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME=`Disc`,this._writeCmds=[`add`,`put`,`delete`],this.downloadFile=async e=>{let n=t(e,e.webFetchExtra),r=await fetch(e.url,n),i;if(!e.progress)i=await r.blob();else if(!r?.body)i=new Blob;else{let t=r.body.getReader(),n=0,a=[],o=r.headers.get(`content-type`),s=parseInt(r.headers.get(`content-length`)||`0`,10);for(;;){let{done:r,value:i}=await t.read();if(r)break;a.push(i),n+=i?.length||0;let o={url:e.url,bytes:n,contentLength:s};this.notifyListeners(`progress`,o)}let c=new Uint8Array(n),l=0;for(let e of a)e!==void 0&&(c.set(e,l),l+=e.length);i=new Blob([c.buffer],{type:o||void 0})}return{path:(await this.writeFile({path:e.path,directory:e.directory??void 0,recursive:e.recursive??!1,data:i})).uri,blob:i}}}readFileInChunks(e,t){throw this.unavailable(`Method not implemented.`)}async initDb(){if(this._db!==void 0)return this._db;if(!(`indexedDB`in window))throw this.unavailable(`This browser doesn't support IndexedDB`);return new Promise((e,t)=>{let n=indexedDB.open(this.DB_NAME,this.DB_VERSION);n.onupgradeneeded=r.doUpgrade,n.onsuccess=()=>{this._db=n.result,e(n.result)},n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`db blocked`)}})}static doUpgrade(e){let t=e.target.result;switch(e.oldVersion){default:t.objectStoreNames.contains(`FileStorage`)&&t.deleteObjectStore(`FileStorage`),t.createObjectStore(`FileStorage`,{keyPath:`path`}).createIndex(`by_folder`,`folder`)}}async dbRequest(e,t){let n=this._writeCmds.indexOf(e)===-1?`readonly`:`readwrite`;return this.initDb().then(r=>new Promise((i,a)=>{let o=r.transaction([`FileStorage`],n).objectStore(`FileStorage`)[e](...t);o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)}))}async dbIndexRequest(e,t,n){let r=this._writeCmds.indexOf(t)===-1?`readonly`:`readwrite`;return this.initDb().then(i=>new Promise((a,o)=>{let s=i.transaction([`FileStorage`],r).objectStore(`FileStorage`).index(e)[t](...n);s.onsuccess=()=>a(s.result),s.onerror=()=>o(s.error)}))}getPath(e,t){let n=t===void 0?``:t.replace(/^[/]+|[/]+$/g,``),r=``;return e!==void 0&&(r+=`/`+e),t!==``&&(r+=`/`+n),r}async clear(){(await this.initDb()).transaction([`FileStorage`],`readwrite`).objectStore(`FileStorage`).clear()}async readFile(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0)throw Error(`File does not exist.`);return{data:n.content?n.content:``}}async writeFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=e.recursive,a=await this.dbRequest(`get`,[t]);if(a&&a.type===`directory`)throw Error(`The supplied path is a directory.`);let o=t.substr(0,t.lastIndexOf(`/`));if(await this.dbRequest(`get`,[o])===void 0){let t=o.indexOf(`/`,1);if(t!==-1){let n=o.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:i})}}if(!r&&!(n instanceof Blob)&&(n=n.indexOf(`,`)>=0?n.split(`,`)[1]:n,!this.isBase64String(n)))throw Error(`The supplied data is not valid base64 content.`);let s=Date.now(),c={path:t,folder:o,type:`file`,size:n instanceof Blob?n.size:n.length,ctime:s,mtime:s,content:n};return await this.dbRequest(`put`,[c]),{uri:c.path}}async appendFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=t.substr(0,t.lastIndexOf(`/`)),a=Date.now(),o=a,s=await this.dbRequest(`get`,[t]);if(s&&s.type===`directory`)throw Error(`The supplied path is a directory.`);if(await this.dbRequest(`get`,[i])===void 0){let t=i.indexOf(`/`,1);if(t!==-1){let n=i.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:!0})}}if(!r&&!this.isBase64String(n))throw Error(`The supplied data is not valid base64 content.`);if(s!==void 0){if(s.content instanceof Blob)throw Error(`The occupied entry contains a Blob object which cannot be appended to.`);n=s.content!==void 0&&!r?btoa(atob(s.content)+atob(n)):s.content+n,o=s.ctime}let c={path:t,folder:i,type:`file`,size:n.length,ctime:o,mtime:a,content:n};await this.dbRequest(`put`,[c])}async deleteFile(e){let t=this.getPath(e.directory,e.path);if(await this.dbRequest(`get`,[t])===void 0)throw Error(`File does not exist.`);if((await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)])).length!==0)throw Error(`Folder is not empty.`);await this.dbRequest(`delete`,[t])}async mkdir(e){let t=this.getPath(e.directory,e.path),n=e.recursive,r=t.substr(0,t.lastIndexOf(`/`)),i=(t.match(/\//g)||[]).length,a=await this.dbRequest(`get`,[r]),o=await this.dbRequest(`get`,[t]);if(i===1)throw Error(`Cannot create Root directory`);if(o!==void 0)throw Error(`Current directory does already exist.`);if(!n&&i!==2&&a===void 0)throw Error(`Parent directory must exist`);if(n&&i!==2&&a===void 0){let t=r.substr(r.indexOf(`/`,1));await this.mkdir({path:t,directory:e.directory,recursive:n})}let s=Date.now(),c={path:t,folder:r,type:`directory`,size:0,ctime:s,mtime:s};await this.dbRequest(`put`,[c])}async rmdir(e){let{path:t,directory:n,recursive:r}=e,i=this.getPath(n,t),a=await this.dbRequest(`get`,[i]);if(a===void 0)throw Error(`Folder does not exist.`);if(a.type!==`directory`)throw Error(`Requested path is not a directory`);let o=await this.readdir({path:t,directory:n});if(o.files.length!==0&&!r)throw Error(`Folder is not empty`);for(let e of o.files){let i=`${t}/${e.name}`;(await this.stat({path:i,directory:n})).type===`file`?await this.deleteFile({path:i,directory:n}):await this.rmdir({path:i,directory:n,recursive:r})}await this.dbRequest(`delete`,[i])}async readdir(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(e.path!==``&&n===void 0)throw Error(`Folder does not exist.`);let r=await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)]);return{files:await Promise.all(r.map(async e=>{let n=await this.dbRequest(`get`,[e]);return n===void 0&&(n=await this.dbRequest(`get`,[e+`/`])),{name:e.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}))}}async getUri(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);return n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),{uri:n?.path||t}}async stat(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),n===void 0)throw Error(`Entry does not exist.`);return{name:n.path.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:`granted`}}async checkPermissions(){return{publicStorage:`granted`}}async _copy(e,t=!1){let{toDirectory:r}=e,{to:a,from:o,directory:s}=e;if(!a||!o)throw Error(`Both to and from must be provided`);r||=s;let c=this.getPath(s,o),l=this.getPath(r,a);if(c===l)return{uri:l};if(i(c,l))throw Error(`To path cannot contain the from path`);let u;try{u=await this.stat({path:a,directory:r})}catch{let e=a.split(`/`);e.pop();let t=e.join(`/`);if(e.length>0&&(await this.stat({path:t,directory:r})).type!==`directory`)throw Error(`Parent directory of the to path is a file`)}if(u&&u.type===`directory`)throw Error(`Cannot overwrite a directory with a file`);let d=await this.stat({path:o,directory:s}),f=async(e,t,n)=>{let i=this.getPath(r,e),a=await this.dbRequest(`get`,[i]);a.ctime=t,a.mtime=n,await this.dbRequest(`put`,[a])},p=d.ctime?d.ctime:Date.now();switch(d.type){case`file`:{let e=await this.readFile({path:o,directory:s});t&&await this.deleteFile({path:o,directory:s});let i;!(e.data instanceof Blob)&&!this.isBase64String(e.data)&&(i=n.UTF8);let c=await this.writeFile({path:a,directory:r,data:e.data,encoding:i});return t&&await f(a,p,d.mtime),c}case`directory`:{if(u)throw Error(`Cannot move a directory over an existing object`);try{await this.mkdir({path:a,directory:r,recursive:!1}),t&&await f(a,p,d.mtime)}catch{}let e=(await this.readdir({path:o,directory:s})).files;for(let n of e)await this._copy({from:`${o}/${n.name}`,to:`${a}/${n.name}`,directory:s,toDirectory:r},t);t&&await this.rmdir({path:o,directory:s})}}return{uri:l}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}};a._debug=!0;export{a as FilesystemWeb};
1
+ import{D as e,O as t}from"./vendor-Dce4XQGd.js";import{n}from"./definitions-CXFBHfRh.js";function r(e){let t=e.split(`/`).filter(e=>e!==`.`),n=[];return t.forEach(e=>{e===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():n.push(e)}),n.join(`/`)}function i(e,t){e=r(e),t=r(t);let n=e.split(`/`),i=t.split(`/`);return e!==t&&n.every((e,t)=>e===i[t])}var a=class r extends e{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME=`Disc`,this._writeCmds=[`add`,`put`,`delete`],this.downloadFile=async e=>{let n=t(e,e.webFetchExtra),r=await fetch(e.url,n),i;if(!e.progress)i=await r.blob();else if(!r?.body)i=new Blob;else{let t=r.body.getReader(),n=0,a=[],o=r.headers.get(`content-type`),s=parseInt(r.headers.get(`content-length`)||`0`,10);for(;;){let{done:r,value:i}=await t.read();if(r)break;a.push(i),n+=i?.length||0;let o={url:e.url,bytes:n,contentLength:s};this.notifyListeners(`progress`,o)}let c=new Uint8Array(n),l=0;for(let e of a)e!==void 0&&(c.set(e,l),l+=e.length);i=new Blob([c.buffer],{type:o||void 0})}return{path:(await this.writeFile({path:e.path,directory:e.directory??void 0,recursive:e.recursive??!1,data:i})).uri,blob:i}}}readFileInChunks(e,t){throw this.unavailable(`Method not implemented.`)}async initDb(){if(this._db!==void 0)return this._db;if(!(`indexedDB`in window))throw this.unavailable(`This browser doesn't support IndexedDB`);return new Promise((e,t)=>{let n=indexedDB.open(this.DB_NAME,this.DB_VERSION);n.onupgradeneeded=r.doUpgrade,n.onsuccess=()=>{this._db=n.result,e(n.result)},n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`db blocked`)}})}static doUpgrade(e){let t=e.target.result;switch(e.oldVersion){default:t.objectStoreNames.contains(`FileStorage`)&&t.deleteObjectStore(`FileStorage`),t.createObjectStore(`FileStorage`,{keyPath:`path`}).createIndex(`by_folder`,`folder`)}}async dbRequest(e,t){let n=this._writeCmds.indexOf(e)===-1?`readonly`:`readwrite`;return this.initDb().then(r=>new Promise((i,a)=>{let o=r.transaction([`FileStorage`],n).objectStore(`FileStorage`)[e](...t);o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)}))}async dbIndexRequest(e,t,n){let r=this._writeCmds.indexOf(t)===-1?`readonly`:`readwrite`;return this.initDb().then(i=>new Promise((a,o)=>{let s=i.transaction([`FileStorage`],r).objectStore(`FileStorage`).index(e)[t](...n);s.onsuccess=()=>a(s.result),s.onerror=()=>o(s.error)}))}getPath(e,t){let n=t===void 0?``:t.replace(/^[/]+|[/]+$/g,``),r=``;return e!==void 0&&(r+=`/`+e),t!==``&&(r+=`/`+n),r}async clear(){(await this.initDb()).transaction([`FileStorage`],`readwrite`).objectStore(`FileStorage`).clear()}async readFile(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0)throw Error(`File does not exist.`);return{data:n.content?n.content:``}}async writeFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=e.recursive,a=await this.dbRequest(`get`,[t]);if(a&&a.type===`directory`)throw Error(`The supplied path is a directory.`);let o=t.substr(0,t.lastIndexOf(`/`));if(await this.dbRequest(`get`,[o])===void 0){let t=o.indexOf(`/`,1);if(t!==-1){let n=o.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:i})}}if(!r&&!(n instanceof Blob)&&(n=n.indexOf(`,`)>=0?n.split(`,`)[1]:n,!this.isBase64String(n)))throw Error(`The supplied data is not valid base64 content.`);let s=Date.now(),c={path:t,folder:o,type:`file`,size:n instanceof Blob?n.size:n.length,ctime:s,mtime:s,content:n};return await this.dbRequest(`put`,[c]),{uri:c.path}}async appendFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=t.substr(0,t.lastIndexOf(`/`)),a=Date.now(),o=a,s=await this.dbRequest(`get`,[t]);if(s&&s.type===`directory`)throw Error(`The supplied path is a directory.`);if(await this.dbRequest(`get`,[i])===void 0){let t=i.indexOf(`/`,1);if(t!==-1){let n=i.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:!0})}}if(!r&&!this.isBase64String(n))throw Error(`The supplied data is not valid base64 content.`);if(s!==void 0){if(s.content instanceof Blob)throw Error(`The occupied entry contains a Blob object which cannot be appended to.`);n=s.content!==void 0&&!r?btoa(atob(s.content)+atob(n)):s.content+n,o=s.ctime}let c={path:t,folder:i,type:`file`,size:n.length,ctime:o,mtime:a,content:n};await this.dbRequest(`put`,[c])}async deleteFile(e){let t=this.getPath(e.directory,e.path);if(await this.dbRequest(`get`,[t])===void 0)throw Error(`File does not exist.`);if((await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)])).length!==0)throw Error(`Folder is not empty.`);await this.dbRequest(`delete`,[t])}async mkdir(e){let t=this.getPath(e.directory,e.path),n=e.recursive,r=t.substr(0,t.lastIndexOf(`/`)),i=(t.match(/\//g)||[]).length,a=await this.dbRequest(`get`,[r]),o=await this.dbRequest(`get`,[t]);if(i===1)throw Error(`Cannot create Root directory`);if(o!==void 0)throw Error(`Current directory does already exist.`);if(!n&&i!==2&&a===void 0)throw Error(`Parent directory must exist`);if(n&&i!==2&&a===void 0){let t=r.substr(r.indexOf(`/`,1));await this.mkdir({path:t,directory:e.directory,recursive:n})}let s=Date.now(),c={path:t,folder:r,type:`directory`,size:0,ctime:s,mtime:s};await this.dbRequest(`put`,[c])}async rmdir(e){let{path:t,directory:n,recursive:r}=e,i=this.getPath(n,t),a=await this.dbRequest(`get`,[i]);if(a===void 0)throw Error(`Folder does not exist.`);if(a.type!==`directory`)throw Error(`Requested path is not a directory`);let o=await this.readdir({path:t,directory:n});if(o.files.length!==0&&!r)throw Error(`Folder is not empty`);for(let e of o.files){let i=`${t}/${e.name}`;(await this.stat({path:i,directory:n})).type===`file`?await this.deleteFile({path:i,directory:n}):await this.rmdir({path:i,directory:n,recursive:r})}await this.dbRequest(`delete`,[i])}async readdir(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(e.path!==``&&n===void 0)throw Error(`Folder does not exist.`);let r=await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)]);return{files:await Promise.all(r.map(async e=>{let n=await this.dbRequest(`get`,[e]);return n===void 0&&(n=await this.dbRequest(`get`,[e+`/`])),{name:e.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}))}}async getUri(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);return n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),{uri:n?.path||t}}async stat(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),n===void 0)throw Error(`Entry does not exist.`);return{name:n.path.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:`granted`}}async checkPermissions(){return{publicStorage:`granted`}}async _copy(e,t=!1){let{toDirectory:r}=e,{to:a,from:o,directory:s}=e;if(!a||!o)throw Error(`Both to and from must be provided`);r||=s;let c=this.getPath(s,o),l=this.getPath(r,a);if(c===l)return{uri:l};if(i(c,l))throw Error(`To path cannot contain the from path`);let u;try{u=await this.stat({path:a,directory:r})}catch{let e=a.split(`/`);e.pop();let t=e.join(`/`);if(e.length>0&&(await this.stat({path:t,directory:r})).type!==`directory`)throw Error(`Parent directory of the to path is a file`)}if(u&&u.type===`directory`)throw Error(`Cannot overwrite a directory with a file`);let d=await this.stat({path:o,directory:s}),f=async(e,t,n)=>{let i=this.getPath(r,e),a=await this.dbRequest(`get`,[i]);a.ctime=t,a.mtime=n,await this.dbRequest(`put`,[a])},p=d.ctime?d.ctime:Date.now();switch(d.type){case`file`:{let e=await this.readFile({path:o,directory:s});t&&await this.deleteFile({path:o,directory:s});let i;!(e.data instanceof Blob)&&!this.isBase64String(e.data)&&(i=n.UTF8);let c=await this.writeFile({path:a,directory:r,data:e.data,encoding:i});return t&&await f(a,p,d.mtime),c}case`directory`:{if(u)throw Error(`Cannot move a directory over an existing object`);try{await this.mkdir({path:a,directory:r,recursive:!1}),t&&await f(a,p,d.mtime)}catch{}let e=(await this.readdir({path:o,directory:s})).files;for(let n of e)await this._copy({from:`${o}/${n.name}`,to:`${a}/${n.name}`,directory:s,toDirectory:r},t);t&&await this.rmdir({path:o,directory:s})}}return{uri:l}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}};a._debug=!0;export{a as FilesystemWeb};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
@@ -1 +1 @@
1
- import{D as e}from"./vendor-C_e0Rl2s.js";var t=class extends e{async canShare(){return typeof navigator>`u`||!navigator.share?{value:!1}:{value:!0}}async share(e){if(typeof navigator>`u`||!navigator.share)throw this.unavailable(`Share API not available in this browser`);return await navigator.share({title:e.title,text:e.text,url:e.url}),{}}};export{t as ShareWeb};
1
+ import{D as e}from"./vendor-Dce4XQGd.js";var t=class extends e{async canShare(){return typeof navigator>`u`||!navigator.share?{value:!1}:{value:!0}}async share(e){if(typeof navigator>`u`||!navigator.share)throw this.unavailable(`Share API not available in this browser`);return await navigator.share({title:e.title,text:e.text,url:e.url}),{}}};export{t as ShareWeb};
@@ -0,0 +1 @@
1
+ import{Yr as e,_b as t,_y as n}from"./app-DYcUyeCV.js";import{j as r}from"./vendor-Dce4XQGd.js";import{f as i,t as a}from"./react-B9IgSVeK.js";import{t as o}from"./auth-welcome-screen-BO0eq8kj.js";var s=a();function c(){let{t:a}=r(`onboarding`),c=i();return(0,s.jsx)(o,{secondary:{label:a(`welcome.continueWithoutAccount`),onSelect:()=>{n()?c(t.selectAssistant,e):c(t.onboarding.hosting,e)}}})}export{c as WelcomeScreen};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$n as t,Fn as n,Fx as r,Jn as i,Jr as a,Px as o,Yn as s,_c as c,tr as l,vc as u,yc as d}from"./app-DYcUyeCV.js";import{_ as f,f as p,g as m,j as h}from"./vendor-Dce4XQGd.js";import{t as g,x as _}from"./react-B9IgSVeK.js";import{E as v,Gi as y,Li as b,Va as x,Wi as S,ka as C,o as w,v as T}from"./icons-SKs_cTXW.js";import{i as E,r as D,t as O}from"./metric-card-T-AHvj71.js";import{t as k}from"./detail-panel-stop-button-CQdsxMzy.js";import{t as A}from"./status-badge-pill-e7pOiHx8.js";var j=e(_(),1),M=g();function N({title:e,body:t,emptyText:n}){return(0,M.jsxs)(`div`,{className:`mb-5`,children:[(0,M.jsx)(o,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:e}),t?(0,M.jsx)(o,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:t}):(0,M.jsx)(o,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]})}function P({leaf:e}){let{t}=h(`chat`),n=e.status===`running`?t(`workflowLeafDetail.running`):t(`workflowLeafDetail.noResultSummary`);return(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,M.jsx)(O,{icon:(0,M.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens??0,format:e=>D(Math.round(e)),label:t(`workflowLeafDetail.input`)}),(0,M.jsx)(O,{icon:(0,M.jsx)(E,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens??0,format:e=>D(Math.round(e)),label:t(`workflowLeafDetail.output`)})]}),(0,M.jsx)(N,{title:t(`workflowLeafDetail.prompt`),body:e.promptSummary,emptyText:t(`workflowLeafDetail.noPromptSummary`)}),(0,M.jsx)(N,{title:t(`workflowLeafDetail.result`),body:e.resultSummary,emptyText:n})]})}function F({status:e}){return(0,M.jsx)(A,{color:u(e),label:d(e)})}function I(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:return`var(--system-negative-strong)`;case`cancelled`:return`var(--content-secondary)`;default:return`var(--primary-base)`}}function L(e){switch(e){case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Running`}}function R({status:e}){return(0,M.jsx)(A,{color:I(e),label:L(e)})}function z({status:e}){let{t}=h(`chat`),r=p(),i=`h-3.5 w-3.5 shrink-0`,a;return a=e===`running`?(0,M.jsx)(n,{className:`shrink-0`,dotSize:4,gap:2}):e===`completed`?(0,M.jsx)(b,{className:i,style:{color:`var(--system-positive-strong)`}}):e===`failed`?(0,M.jsx)(v,{className:i,style:{color:`var(--system-negative-strong)`}}):(0,M.jsx)(C,{className:i,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":t(`workflowSubagentRow.cancelledAria`)}),(0,M.jsx)(f,{mode:`wait`,initial:!1,children:(0,M.jsx)(m.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:r?{duration:0}:{duration:.15,ease:[.16,1,.3,1]},className:`flex shrink-0 items-center`,children:a},e)})}function B({runId:e,leaf:t,components:n,onSelect:r}){let{t:a}=h(`chat`),c=t.label??`Subagent ${t.seq}`,l=t.promptSummary,u=i(`${e}:${t.seq}`);return(0,M.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`workflowSubagentRow.openDetailsAria`,{title:c}),className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] px-2 py-1.5 text-left transition-colors hover:bg-[var(--surface-overlay)]`,children:(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,M.jsx)(z,{status:t.status}),n?(0,M.jsx)(s,{components:n,bodyShapeId:u.bodyShape,eyeStyleId:u.eyeStyle,colorId:u.color,size:16}):(0,M.jsx)(`div`,{style:{width:16,height:16,flexShrink:0},"aria-hidden":!0}),(0,M.jsx)(o,{variant:`body-medium-default`,title:c,className:`max-w-[60%] shrink-0 truncate text-[var(--content-default)]`,children:c}),l&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)] opacity-10`,children:`|`}),(0,M.jsx)(o,{variant:`body-medium-lighter`,title:l,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:l})]})]})})}function V({entry:e,onClose:n,onStop:u,onRequestJournal:d}){let{t:f}=h(`chat`),g=c(e.status),_=p(),v=e.label??e.runId,b=e.agentsSpawned||e.leaves.size,C=a(),A=[...e.leaves.values()].sort((e,t)=>e.seq-t.seq),[N,I]=(0,j.useState)(null),[L,z]=(0,j.useState)(e.runId);L!==e.runId&&(z(e.runId),I(null));let V=N==null?void 0:e.leaves.get(N),H=V?i(`${e.runId}:${V.seq}`):void 0,U=(0,j.useCallback)(()=>I(null),[]),W=V?V.label??`Subagent ${V.seq}`:``,G=V?W:v,K=g?`live`:`final`;return(0,j.useEffect)(()=>{d?.(e.runId)},[e.runId,K,d]),(0,M.jsx)(t,{headerAbove:V&&(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:U,title:v,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,M.jsx)(o,{variant:`body-small-default`,as:`span`,children:v})}),(0,M.jsx)(S,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,M.jsx)(o,{variant:`body-small-default`,as:`span`,title:W,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:W})]}),icon:(0,M.jsxs)(M.Fragment,{children:[V&&(0,M.jsx)(r,{variant:`outlined`,iconOnly:(0,M.jsx)(y,{}),onClick:U,"aria-label":f(`workflowDetailPanel.backToSubagentsAria`),tooltip:f(`workflowDetailPanel.back`),className:`shrink-0`}),V?C&&H?(0,M.jsx)(s,{components:C,bodyShapeId:H.bodyShape,eyeStyleId:H.eyeStyle,colorId:H.color,size:32}):(0,M.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}):(0,M.jsx)(w,{className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0})]}),title:G,headerTrailing:V?(0,M.jsx)(R,{status:V.status}):(0,M.jsx)(F,{status:e.status}),headerActions:g&&u?(0,M.jsx)(k,{onStop:()=>u(e.runId),ariaLabel:f(`workflowDetailPanel.stopWorkflow`)}):void 0,closeLabel:f(`workflowDetailPanel.closeDetail`),onClose:n,children:(0,M.jsx)(m.div,{initial:{opacity:0},animate:{opacity:1},transition:_?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:V?(0,M.jsx)(P,{leaf:V}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,M.jsx)(O,{icon:(0,M.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>D(Math.round(e)),label:f(`workflowDetailPanel.input`)}),(0,M.jsx)(O,{icon:(0,M.jsx)(E,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>D(Math.round(e)),label:f(`workflowDetailPanel.output`)}),(0,M.jsx)(O,{icon:(0,M.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:b,format:e=>D(Math.round(e)),label:f(`workflowDetailPanel.agents`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(o,{variant:`body-medium-default`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:f(`workflowDetailPanel.subagents`)}),A.length===0?(0,M.jsx)(l,{children:f(`workflowDetailPanel.noSubagentsYet`)}):(0,M.jsx)(`div`,{className:`flex flex-col gap-1`,children:A.map(t=>(0,M.jsx)(B,{runId:e.runId,leaf:t,components:C,onSelect:()=>I(t.seq)},t.seq))})]})]})},V?String(V.seq):`list`)})}export{V as WorkflowDetailPanel};
@@ -0,0 +1 @@
1
+ var e={heading:`文件`,newFile:`新建文件`,newFolder:`新建文件夹`,delete:`删除`,rename:`重命名`,renaming:`正在重命名…`,create:`创建`,creating:`正在创建…`,creatingHeading:`新建`,createTriggerAria:`创建新文件或文件夹`,createTriggerTitle:`新建文件或文件夹`,nameLabel:`名称`,nameError:`请输入不含斜杠的单个文件或文件夹名称。`,nameTaken:`此文件夹中已存在“{name}”。`,createFailed:`创建失败。请检查名称后重试。`,renameFailed:`重命名失败。请检查名称后重试。`,deleteFailed:`删除失败。请重试。`,cancel:`取消`,sortByNameAria:`按名称排序`,sortBySizeAria:`按大小排序`,sortedBySizeTitle:`已按大小排序,切换为按名称排序`,sortedByNameTitle:`已按名称排序,切换为按大小排序`,hideHiddenAria:`隐藏隐藏文件`,showHiddenAria:`显示隐藏文件`,searchPlaceholder:`搜索文件`,clearSearchAria:`清除搜索`,noFilesFound:`未找到文件`,deleteFolderTitle:`删除文件夹`,deleteFileTitle:`删除文件`,deleteFileMessage:`确定要删除 <name>{name}</name> 吗?此操作无法撤消。`,deleteFolderMessage:`确定要删除 <name>{name}</name> 及其所有内容吗?此操作无法撤消。`,deleting:`正在删除…`},t={drawerTitle:`文件`},n={download:`下载`,downloading:`正在下载…`,downloadFailed:`下载失败。请重试。`,preview:`预览`,source:`源文件`,modifiedLabel:`修改时间:`,selectAFile:`选择一个文件以查看`,browseFiles:`浏览文件`,fileNotFound:`文件未找到`,saveFailed:`保存失败`,unknownSize:`大小未知`,downloadAria:`下载 {name}`},r={workspaceTree:e,workspaceBrowser:t,workspaceFileViewer:n};export{r as default,t as workspaceBrowser,n as workspaceFileViewer,e as workspaceTree};
@@ -0,0 +1 @@
1
+ var e={heading:`Archivos`,newFile:`Nuevo archivo`,newFolder:`Nueva carpeta`,delete:`Eliminar`,rename:`Cambiar el nombre`,renaming:`Cambiando el nombre…`,create:`Crear`,creating:`Creando…`,creatingHeading:`Crear`,createTriggerAria:`Crear un archivo o una carpeta`,createTriggerTitle:`Nuevo archivo o carpeta`,nameLabel:`Nombre`,nameError:`Escribe el nombre de un solo archivo o carpeta, sin barras.`,nameTaken:`«{name}» ya existe en esta carpeta.`,createFailed:`No se pudo crear. Revisa el nombre e inténtalo de nuevo.`,renameFailed:`No se pudo cambiar el nombre. Revisa el nombre e inténtalo de nuevo.`,deleteFailed:`No se pudo eliminar. Inténtalo de nuevo.`,cancel:`Cancelar`,sortByNameAria:`Ordenar por nombre`,sortBySizeAria:`Ordenar por tamaño`,sortedBySizeTitle:`Ordenado por tamaño, cambiar a nombre`,sortedByNameTitle:`Ordenado por nombre, cambiar a tamaño`,hideHiddenAria:`Ocultar los archivos ocultos`,showHiddenAria:`Mostrar los archivos ocultos`,searchPlaceholder:`Buscar archivos`,clearSearchAria:`Borrar la búsqueda`,noFilesFound:`No se han encontrado archivos`,deleteFolderTitle:`Eliminar la carpeta`,deleteFileTitle:`Eliminar el archivo`,deleteFileMessage:`¿Seguro que quieres eliminar <name>{name}</name>? Esto no se puede deshacer.`,deleteFolderMessage:`¿Seguro que quieres eliminar <name>{name}</name> y todo su contenido? Esto no se puede deshacer.`,deleting:`Eliminando…`},t={drawerTitle:`Archivos`},n={download:`Descargar`,downloading:`Descargando…`,downloadFailed:`No se pudo descargar. Inténtalo de nuevo.`,preview:`Vista previa`,source:`Código`,modifiedLabel:`Modificado:`,selectAFile:`Selecciona un archivo para verlo`,browseFiles:`Explorar archivos`,fileNotFound:`Archivo no encontrado`,saveFailed:`No se pudo guardar`,unknownSize:`Tamaño desconocido`,downloadAria:`Descargar {name}`},r={workspaceTree:e,workspaceBrowser:t,workspaceFileViewer:n};export{r as default,t as workspaceBrowser,n as workspaceFileViewer,e as workspaceTree};
@@ -0,0 +1 @@
1
+ var e={heading:`Файлы`,newFile:`Новый файл`,newFolder:`Новая папка`,delete:`Удалить`,rename:`Переименовать`,renaming:`Переименование…`,create:`Создать`,creating:`Создание…`,creatingHeading:`Создать`,createTriggerAria:`Создать файл или папку`,createTriggerTitle:`Новый файл или папка`,nameLabel:`Имя`,nameError:`Имя одного файла или папки без слэшей.`,nameTaken:`«{name}» уже есть в этой папке.`,createFailed:`Не удалось создать. Проверьте имя и повторите попытку.`,renameFailed:`Не удалось переименовать. Проверьте имя и повторите попытку.`,deleteFailed:`Не удалось удалить. Повторите попытку.`,cancel:`Отмена`,sortByNameAria:`Сортировать по имени`,sortBySizeAria:`Сортировать по размеру`,sortedBySizeTitle:`Сортировка по размеру, переключить на имя`,sortedByNameTitle:`Сортировка по имени, переключить на размер`,hideHiddenAria:`Скрыть скрытые файлы`,showHiddenAria:`Показать скрытые файлы`,searchPlaceholder:`Поиск файлов`,clearSearchAria:`Очистить поиск`,noFilesFound:`Файлы не найдены`,deleteFolderTitle:`Удалить папку`,deleteFileTitle:`Удалить файл`,deleteFileMessage:`Точно удалить <name>{name}</name>? Это нельзя отменить.`,deleteFolderMessage:`Точно удалить <name>{name}</name> и всё содержимое? Это нельзя отменить.`,deleting:`Удаление…`},t={drawerTitle:`Файлы`},n={download:`Скачать`,downloading:`Скачивание…`,downloadFailed:`Не удалось скачать. Повторите попытку.`,preview:`Просмотр`,source:`Исходник`,modifiedLabel:`Изменён:`,selectAFile:`Выбор файла для просмотра`,browseFiles:`Обзор файлов`,fileNotFound:`Файл не найден`,saveFailed:`Не удалось сохранить`,unknownSize:`Размер неизвестен`,downloadAria:`Скачать {name}`},r={workspaceTree:e,workspaceBrowser:t,workspaceFileViewer:n};export{r as default,t as workspaceBrowser,n as workspaceFileViewer,e as workspaceTree};
@@ -0,0 +1 @@
1
+ var e={heading:`檔案`,newFile:`新增檔案`,newFolder:`新增資料夾`,delete:`刪除`,rename:`重新命名`,renaming:`正在重新命名…`,create:`建立`,creating:`正在建立…`,creatingHeading:`建立新項目`,createTriggerAria:`建立新檔案或資料夾`,createTriggerTitle:`新檔案或資料夾`,nameLabel:`名稱`,nameError:`請輸入不含斜線的單一檔案或資料夾名稱。`,nameTaken:`此資料夾中已有「{name}」。`,createFailed:`建立失敗。請檢查名稱後再試一次。`,renameFailed:`重新命名失敗。請檢查名稱後再試一次。`,deleteFailed:`刪除失敗。請再試一次。`,cancel:`取消`,sortByNameAria:`依名稱排序`,sortBySizeAria:`依大小排序`,sortedBySizeTitle:`已依大小排序,切換為依名稱排序`,sortedByNameTitle:`已依名稱排序,切換為依大小排序`,hideHiddenAria:`隱藏隱藏檔案`,showHiddenAria:`顯示隱藏檔案`,searchPlaceholder:`搜尋檔案`,clearSearchAria:`清除搜尋`,noFilesFound:`找不到檔案`,deleteFolderTitle:`刪除資料夾`,deleteFileTitle:`刪除檔案`,deleteFileMessage:`您確定要刪除 <name>{name}</name> 嗎?此操作無法復原。`,deleteFolderMessage:`您確定要刪除 <name>{name}</name> 及其所有內容嗎?此操作無法復原。`,deleting:`正在刪除…`},t={drawerTitle:`檔案`},n={download:`下載`,downloading:`正在下載…`,downloadFailed:`下載失敗。請再試一次。`,preview:`預覽`,source:`來源`,modifiedLabel:`修改時間:`,selectAFile:`選取檔案以檢視`,browseFiles:`瀏覽檔案`,fileNotFound:`找不到檔案`,saveFailed:`儲存失敗`,unknownSize:`大小不明`,downloadAria:`下載 {name}`},r={workspaceTree:e,workspaceBrowser:t,workspaceFileViewer:n};export{r as default,t as workspaceBrowser,n as workspaceFileViewer,e as workspaceTree};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{A_ as t,An as n,Ci as r,Dn as i,En as a,Fx as o,M_ as s,N_ as c,O_ as l,P_ as u,Pb as d,Tx as f,_x as p,bb as m,et as h,gx as g,j_ as _,k_ as v,kn as y,lx as b,mx as x,ox as S,ur as C,ux as w}from"./app-DYcUyeCV.js";import{Jn as T,N as E,Xn as D,Zn as O,er as k,j as A}from"./vendor-Dce4XQGd.js";import{_ as j,t as M,x as N}from"./react-B9IgSVeK.js";import{Ar as P,Dr as F,Ir as I,It as L,Ja as R,Jr as ee,Ki as z,Rr as te,Vr as B,Wi as V,Xt as H,_t as ne,fr as U,h as W,i as re,k as ie,kr as G,qn as K,qr as ae,ti as q}from"./icons-SKs_cTXW.js";import{n as oe,r as se,t as ce}from"./use-side-list-room-C0JlGYbh.js";import{t as J}from"./format-file-size-CEqN0m2h.js";import{i as Y,n as le,r as X,t as ue}from"./file-editor-BsKygMVy.js";var de=R(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),fe=R(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),Z=e(N(),1);function pe(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function me(e,t){return pe(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function he(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function ge(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Q=M();function _e(e){let{assistantId:t,path:n,name:r,showHidden:i}=e,[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(!1);return{isDownloading:a,error:s,download:(0,Z.useCallback)(async()=>{c(!1),o(!0);try{await C({assistantId:t,path:n,filename:r,showHidden:i})}catch{c(!0)}finally{o(!1)}},[t,n,r,i])}}function ve({assistantId:e,path:t,name:n,showHidden:r}){let{t:i}=A(`workspace`),{isDownloading:a,error:s,download:c}=_e({assistantId:e,path:t,name:n,showHidden:r});return(0,Q.jsx)(o,{variant:`ghost`,size:`regular`,iconOnly:a?(0,Q.jsx)(K,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(q,{"aria-hidden":!0}),onClick:()=>void c(),disabled:a,"aria-label":i(`workspaceFileViewer.downloadAria`,{name:n}),tooltip:i(s?`workspaceFileViewer.downloadFailed`:`workspaceFileViewer.download`)})}function ye(e){return D({queryFn:async()=>{let{data:n,error:r}=await t({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(r)throw r;return n},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function be({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=te;return n.startsWith(`image/`)?r=U:n.startsWith(`video/`)?r=W:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=I),(0,Q.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Q.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function xe({viewMode:e,onChange:t}){let{t:n}=A(`workspace`);return(0,Q.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Q.jsx)(o,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:n(r===`preview`?`workspaceFileViewer.preview`:`workspaceFileViewer.source`)},r)})})}function $({name:e,mimeType:t,size:n,rightContent:r}){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(be,{mimeType:t}),(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:J(n)})]}),r]})}function Se({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:a}=O({queryFn:async()=>{let n=await v({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[o,s]=(0,Z.useState)(null);return(0,Z.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return s(e),()=>{URL.revokeObjectURL(e),s(null)}},[i]),a?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(K,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):o?n.startsWith(`image/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`img`,{src:o,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`video`,{src:o,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function Ce({assistantId:e,path:t,name:n,mimeType:r,size:i,modifiedAt:a,showHidden:s}){let{t:c}=A(`workspace`),{isDownloading:l,error:u,download:d}=_e({assistantId:e,path:t,name:n,showHidden:s});return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:n,mimeType:r,size:i}),(0,Q.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Q.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Q.jsx)(I,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Q.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:n}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:r}),(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:J(i,c(`workspaceFileViewer.unknownSize`))}),a&&(0,Q.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[c(`workspaceFileViewer.modifiedLabel`),` `,new Date(a).toLocaleString(m())]})]}),(0,Q.jsx)(o,{variant:`outlined`,size:`compact`,leftIcon:l?(0,Q.jsx)(K,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(q,{"aria-hidden":!0}),onClick:d,disabled:l,"aria-label":c(`workspaceFileViewer.downloadAria`,{name:n}),className:`mt-4`,children:c(l?`workspaceFileViewer.downloading`:`workspaceFileViewer.download`)}),u&&(0,Q.jsx)(`p`,{className:`mt-2 text-body-small-default`,style:{color:`var(--system-error)`},children:c(`workspaceFileViewer.downloadFailed`)})]})})]})}function we({assistantId:e,selectedPath:t,showHidden:r,viewMode:i,onChangeViewMode:a,onBrowse:s,pathRename:c,pathDelete:l}){let{t:d}=A(`workspace`),f=k(),{data:p,isLoading:m}=O({...ye({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{if(!c)return;let{from:e,to:t}=c,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),v(e=>e==null?e:{...e,path:n(e.path)})},[c]),(0,Z.useEffect)(()=>{if(!l)return;let{path:e}=l,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),v(e=>e!=null&&t(e.path)?null:e)},[l]);let b=h!=null&&h===t,x=p?.content??``,S=_?.path===t?_.content:x,C=()=>{g(null),v(null)},w=T({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await u({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),v(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=S!==x,D=(0,Z.useCallback)(()=>{t&&E&&!w.isPending&&w.mutate({path:t,content:S})},[t,E,w,S]);if(!t)return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`workspaceFileViewer.selectAFile`)}),s&&(0,Q.jsx)(o,{type:`button`,onClick:s,leftIcon:(0,Q.jsx)(P,{"aria-hidden":!0}),children:d(`workspaceFileViewer.browseFiles`)})]});if(m)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(K,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`workspaceFileViewer.fileNotFound`)})});let j=p.mimeType??`application/octet-stream`,M=p.name??t.split(`/`).pop()??t,N=n(M,j),F=me(M,j),I=p.content!=null&&!N&&!F,L=t?ge(t):!0,R=b&&(0,Q.jsx)(le,{isDirty:E,isSaving:w.isPending,error:w.isError?d(`workspaceFileViewer.saveFailed`):null,onSave:D,onDiscard:C});if(N&&p.content!=null){let e=b?S:p.content;return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:M,mimeType:j,rightContent:(0,Q.jsx)(xe,{viewMode:i,onChange:e=>{b&&C(),a(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(ue,{content:e,fileName:M,mimeType:j,showEdit:!L&&i===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),i===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Q.jsx)(y,{content:e})}):b?(0,Q.jsx)(X,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(Y,{content:p.content,readOnly:L,onStartEdit:()=>g(t)})]}),R]})}if(F&&p.content!=null){let e=b?S:p.content,n=he(e);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:M,mimeType:j,rightContent:(0,Q.jsx)(xe,{viewMode:i,onChange:e=>{b&&C(),a(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(ue,{content:i===`preview`?n:e,downloadContent:e,fileName:M,mimeType:j,showEdit:!L&&i===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),i===`preview`?(0,Q.jsx)(Y,{content:n,readOnly:!0,whiteSpace:`pre`}):b?(0,Q.jsx)(X,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(Y,{content:p.content,readOnly:L,onStartEdit:()=>g(t)})]}),R]})}return I?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:M,mimeType:j,size:p.size}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(ue,{content:b?S:p.content??``,fileName:M,mimeType:j,showEdit:!L,isEditing:b,onToggleEdit:()=>b?C():g(t)}),b?(0,Q.jsx)(X,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(Y,{content:p.content??``,readOnly:L,onStartEdit:()=>g(t)})]}),R]}):j.startsWith(`image/`)||j.startsWith(`video/`)?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:M,mimeType:j,size:p.size,rightContent:(0,Q.jsx)(ve,{assistantId:e,path:t,name:M,showHidden:r})}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Q.jsx)(Se,{assistantId:e,path:t,mimeType:j,showHidden:r})})]}):(0,Q.jsx)(Ce,{assistantId:e,path:t,name:M,mimeType:j,size:p.size,modifiedAt:p.modifiedAt,showHidden:r})}var Te=class extends Error{takenName;constructor(e){super(`Workspace entry name is taken: ${e}`),this.name=`WorkspaceNameTakenError`,this.takenName=e}};function Ee(e,t,n){if(e instanceof Te)return n(`workspaceTree.nameTaken`,{name:e.takenName});switch(t){case`create`:return n(`workspaceTree.createFailed`);case`rename`:return n(`workspaceTree.renameFailed`);case`delete`:return n(`workspaceTree.deleteFailed`)}}function De(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}async function Oe(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await c({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=e.name.toLowerCase();return t===i&&t!==a}))throw new Te(n)}function ke({entry:e}){return e.type===`directory`?(0,Q.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Q.jsx)(U,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Q.jsx)(W,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(te,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function Ae({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:a,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:u,onRequestRename:d,onRequestCreate:f,depth:p}){let{t:m}=A(`workspace`),h=e.path??``,g=e.name??``,_=e.type===`directory`,v=n.has(h),y=r===h,b=g.startsWith(`.`),x=!ge(h),C=_&&(v||s.length>0),{data:w}=O({...i({assistantId:t,path:h,showHidden:a,includeDirSizes:o===`size`}),enabled:_&&C}),T=(0,Z.useMemo)(()=>De(w?.entries??[],o),[w?.entries,o]),E=s===``||g.toLowerCase().includes(s);if(s!==``&&!_&&!E)return null;let D=(0,Q.jsxs)(`button`,{onClick:()=>{_?c(h):l(h)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${p*14+8}px`,paddingRight:`8px`,color:y?`var(--content-default)`:b?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:y?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:b&&!y?.7:1},children:[_?C?(0,Q.jsx)(z,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(V,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Q.jsx)(ke,{entry:e}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g}),e.size!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:J(e.size)})]});return(0,Q.jsxs)(`div`,{children:[x?(0,Q.jsxs)(S.Root,{children:[(0,Q.jsx)(S.Trigger,{children:D}),(0,Q.jsxs)(S.Content,{children:[_&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S.Item,{leftIcon:(0,Q.jsx)(B,{className:`h-3.5 w-3.5`}),onSelect:()=>f({kind:`file`,parentPath:h}),children:m(`workspaceTree.newFile`)}),(0,Q.jsx)(S.Item,{leftIcon:(0,Q.jsx)(G,{className:`h-3.5 w-3.5`}),onSelect:()=>f({kind:`folder`,parentPath:h}),children:m(`workspaceTree.newFolder`)}),(0,Q.jsx)(S.Separator,{})]}),(0,Q.jsx)(S.Item,{leftIcon:(0,Q.jsx)(ie,{className:`h-3.5 w-3.5`}),onSelect:()=>u({path:h,name:g,isDirectory:_}),children:m(`workspaceTree.delete`)}),(0,Q.jsx)(S.Item,{leftIcon:(0,Q.jsx)(H,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:h,name:g,isDirectory:_}),children:m(`workspaceTree.rename`)})]})]}):D,_&&C&&T.length>0&&(0,Q.jsx)(`div`,{children:T.map(e=>(0,Q.jsx)(Ae,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:a,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:u,onRequestRename:d,onRequestCreate:f,depth:p+1},e.path))})]})}function je({title:e,placeholder:t,confirmLabel:n,pendingLabel:r,initialName:i,onCancel:a,onConfirm:s,pending:c,error:l}){let{t:u}=A(`workspace`),d=(0,Z.useRef)(null),[m,h]=(0,Z.useState)(i??``),g=m.trim(),_=g.length>0&&(/[/\\]/.test(g)||g===`.`||g===`..`),v=g.length>0&&!_&&!c;return(0,Q.jsx)(p.Root,{open:!0,onOpenChange:e=>{!e&&!c&&a()},children:(0,Q.jsx)(p.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=d.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||a()},children:(0,Q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),v&&s(g)},children:[(0,Q.jsx)(p.Header,{children:(0,Q.jsx)(p.Title,{children:e})}),(0,Q.jsx)(p.Body,{children:(0,Q.jsx)(f,{ref:d,label:u(`workspaceTree.nameLabel`),value:m,onChange:e=>h(e.target.value),placeholder:t,errorText:l??(_?u(`workspaceTree.nameError`):void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Q.jsxs)(p.Footer,{children:[(0,Q.jsx)(o,{type:`button`,variant:`outlined`,onClick:a,disabled:c,children:u(`workspaceTree.cancel`)}),(0,Q.jsx)(o,{type:`submit`,variant:`primary`,disabled:!v,children:c?r:n})]})]})})})}function Me({assistantId:e,expandedPaths:t,selectedPath:n,showHidden:r,sortMode:c,onToggleExpand:p,onExpandPath:m,onSelectPath:h,onToggleShowHidden:g,onChangeSortMode:v,onPathDeleted:y,onPathRenamed:b,search:S,onSearchChange:C}){let{t:w}=A(`workspace`),D=k(),j=S.trim().toLowerCase(),[M,N]=(0,Z.useState)(!1),[P,F]=(0,Z.useState)(null),[I,L]=(0,Z.useState)(null),R=(0,Z.useCallback)(()=>{F(null),L(null)},[]),{data:z,isLoading:te}=O(i({assistantId:e,showHidden:r,includeDirSizes:c===`size`})),B=(0,Z.useMemo)(()=>De(z?.entries??[],c),[z?.entries,c]),V=(0,Z.useCallback)(()=>{for(let e of[a,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])D.invalidateQueries({queryKey:[e]})},[D]),H=T({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await Oe(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await u({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await _({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw i?d(r,i):r;return{...t,path:n}},onSuccess:e=>{R(),V(),e.parentPath&&m(e.parentPath),e.kind===`file`?h(e.path):m(e.path)},onError:e=>{L(Ee(e,`create`,w))}}),U=T({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await Oe(e,r,t.newName,i);let{error:o,response:c}=await s({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!c?.ok)throw c?d(o,c):o;return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{R(),V(),b(e,t)},onError:e=>{L(Ee(e,`rename`,w))}}),W=(0,Z.useCallback)(e=>{L(null),F({type:`create`,...e})},[]),ie=(0,Z.useCallback)(e=>{L(null),F({type:`rename`,path:e.path,name:e.name})},[]),[G,K]=(0,Z.useState)(null),q=T({mutationFn:async t=>{let{error:n,response:r}=await l({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw r?d(n,r):n;return t},onSuccess:e=>{K(null),V(),y(e.path)}}),oe=(0,Z.useCallback)(e=>{q.reset(),K(e)},[q]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:w(`workspaceTree.heading`)}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Q.jsx)(o,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Q.jsx)(fe,{"aria-hidden":!0}):(0,Q.jsx)(de,{"aria-hidden":!0}),onClick:()=>v(c===`size`?`name`:`size`),"aria-label":w(c===`size`?`workspaceTree.sortByNameAria`:`workspaceTree.sortBySizeAria`),title:w(c===`size`?`workspaceTree.sortedBySizeTitle`:`workspaceTree.sortedByNameTitle`),tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(o,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:r?(0,Q.jsx)(ae,{"aria-hidden":!0}):(0,Q.jsx)(ee,{"aria-hidden":!0}),onClick:g,"aria-label":w(r?`workspaceTree.hideHiddenAria`:`workspaceTree.showHiddenAria`),title:w(r?`workspaceTree.hideHiddenAria`:`workspaceTree.showHiddenAria`),tintColor:r?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(Ne,{open:M,onOpenChange:N,onSelectKind:e=>{N(!1),W({kind:e,parentPath:``})}})]})]}),(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(f,{type:`text`,value:S,onChange:e=>C(e.target.value),placeholder:w(`workspaceTree.searchPlaceholder`),leftIcon:(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),S&&(0,Q.jsx)(o,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(re,{"aria-hidden":!0}),onClick:()=>C(``),"aria-label":w(`workspaceTree.clearSearchAria`),className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:te?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):B.length?B.map(i=>(0,Q.jsx)(Ae,{entry:i,assistantId:e,expandedPaths:t,selectedPath:n,showHidden:r,sortMode:c,searchLower:j,onToggleExpand:p,onSelectPath:h,onRequestDelete:oe,onRequestRename:ie,onRequestCreate:W,depth:0},i.path)):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:w(`workspaceTree.noFilesFound`)})}),P?.type===`create`&&(0,Q.jsx)(je,{title:P.kind===`file`?w(`workspaceTree.newFile`):w(`workspaceTree.newFolder`),placeholder:P.kind===`file`?`filename.md`:`folder-name`,confirmLabel:w(`workspaceTree.create`),pendingLabel:w(`workspaceTree.creating`),onCancel:R,onConfirm:e=>{L(null),H.mutate({kind:P.kind,parentPath:P.parentPath,name:e})},pending:H.isPending,error:I},`create-${P.kind}-${P.parentPath}`),P?.type===`rename`&&(0,Q.jsx)(je,{title:w(`workspaceTree.rename`),placeholder:P.name,confirmLabel:w(`workspaceTree.rename`),pendingLabel:w(`workspaceTree.renaming`),initialName:P.name,onCancel:R,onConfirm:e=>{if(e===P.name){R();return}L(null),U.mutate({oldPath:P.path,newName:e})},pending:U.isPending,error:I},`rename-${P.path}`),(0,Q.jsx)(x,{open:G!==null,title:G?.isDirectory?w(`workspaceTree.deleteFolderTitle`):w(`workspaceTree.deleteFileTitle`),message:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{i18nKey:G?.isDirectory?`workspaceTree.deleteFolderMessage`:`workspaceTree.deleteFileMessage`,ns:`workspace`,values:{name:G?.name??``},components:{name:(0,Q.jsx)(`span`,{style:{color:`var(--content-default)`}})}}),q.error&&(0,Q.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:Ee(q.error,`delete`,w)})]}),confirmLabel:q.isPending?w(`workspaceTree.deleting`):w(`workspaceTree.delete`),destructive:!0,isPending:q.isPending,onConfirm:()=>{G&&q.mutate(G)},onCancel:()=>K(null)})]})}function Ne({open:e,onOpenChange:t,onSelectKind:n}){let{t:i}=A(`workspace`);return r()?(0,Q.jsxs)(g.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(g.Trigger,{asChild:!0,children:(0,Q.jsx)(o,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(L,{"aria-hidden":!0}),"aria-label":i(`workspaceTree.createTriggerAria`),title:i(`workspaceTree.createTriggerTitle`),tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(g.Content,{children:[(0,Q.jsx)(g.Header,{className:`sr-only`,children:(0,Q.jsx)(g.Title,{children:i(`workspaceTree.creatingHeading`)})}),(0,Q.jsxs)(g.Body,{className:`pt-0`,children:[(0,Q.jsx)(b,{icon:B,label:i(`workspaceTree.newFile`),onSelect:()=>n(`file`)}),(0,Q.jsx)(b,{icon:G,label:i(`workspaceTree.newFolder`),onSelect:()=>n(`folder`)})]})]})]}):(0,Q.jsxs)(w.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(w.Trigger,{asChild:!0,children:(0,Q.jsx)(o,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(L,{"aria-hidden":!0}),"aria-label":i(`workspaceTree.createTriggerAria`),title:i(`workspaceTree.createTriggerTitle`),tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(w.Content,{align:`end`,sideOffset:4,children:[(0,Q.jsx)(w.Item,{leftIcon:(0,Q.jsx)(B,{className:`h-3.5 w-3.5`}),onSelect:()=>n(`file`),children:i(`workspaceTree.newFile`)}),(0,Q.jsx)(w.Item,{leftIcon:(0,Q.jsx)(G,{className:`h-3.5 w-3.5`}),onSelect:()=>n(`folder`),children:i(`workspaceTree.newFolder`)})]})]})}function Pe(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Fe({assistantId:e}){let{t}=A(`workspace`),[n,r]=j(),[i,a]=(0,Z.useState)(()=>{let e=n.get(`file`);return e?Pe(e):new Set}),[o,s]=(0,Z.useState)(()=>n.get(`file`)),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>n.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Z.useState)(`preview`);(0,Z.useEffect)(()=>{let e=n.get(`file`);e&&(s(e),a(t=>{let n=new Set(t);for(let t of Pe(e))n.add(t);return n.size===t.size?t:n}),r(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0}))},[n,r]);let m=(0,Z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Z.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),{paneRef:g,hasRoomForList:_,drawerOpen:v,openDrawer:y,closeDrawer:b}=ce(),[x,S]=(0,Z.useState)(``),C=(0,Z.useCallback)(e=>{s(e),b()},[b]),[w,T]=(0,Z.useState)(null),E=(0,Z.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),T({path:e})},[]),[D,O]=(0,Z.useState)(null),k={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:C,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:E,onPathRenamed:(0,Z.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),O({from:e,to:t})},[]),search:x,onSearchChange:S};return(0,Q.jsxs)(`div`,{ref:g,className:`flex h-full min-h-0 flex-col gap-4`,children:[_?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex items-center`,children:(0,Q.jsx)(se,{onClick:y})}),(0,Q.jsx)(oe,{open:v,onClose:b,title:t(`workspaceBrowser.drawerTitle`),children:(0,Q.jsx)(Me,{...k})})]}),(0,Q.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 ${_?`grid-cols-[320px_1fr]`:`grid-cols-1`}`,children:[_?(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(Me,{...k})}):null,(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(we,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:_?void 0:y,pathRename:D,pathDelete:w})})]})]})}function Ie(){return(0,Q.jsx)(Fe,{assistantId:h()})}export{Ie as WorkspacePage};
@@ -11,12 +11,12 @@ doesn't tell a third party which providers a user is looking at.
11
11
  Downloaded from the URL each one replaces, so the bytes match the source
12
12
  exactly (except where noted).
13
13
 
14
- | Assets | Source | Licence |
15
- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------- |
16
- | `airtable`, `asana`, `calendly`, `discord`, `dropbox`, `hubspot`, `sanity`, `spotify`, `telegram`, `todoist`, `x` | [Simple Icons](https://github.com/simple-icons/simple-icons) | CC0-1.0 (public domain, no attribution required) |
17
- | `eventbrite`, `salesforce` | [glincker/thesvg](https://github.com/glincker/thesvg) | MIT (notice below) |
18
- | `monday` | [WorldVectorLogo](https://worldvectorlogo.com/logo/monday-1) | Trademark of monday.com; no software licence granted (see Trademark, below) |
19
- | `stripe-link` | [link.com](https://link.com) | Trademark of Stripe; no software licence granted (see Trademark, below) |
14
+ | Assets | Source | Licence |
15
+ | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------- |
16
+ | `airtable`, `asana`, `calendly`, `discord`, `dropbox`, `hubspot`, `quickbooks`, `sanity`, `spotify`, `telegram`, `todoist`, `x` | [Simple Icons](https://github.com/simple-icons/simple-icons) | CC0-1.0 (public domain, no attribution required) |
17
+ | `eventbrite`, `salesforce` | [glincker/thesvg](https://github.com/glincker/thesvg) | MIT (notice below) |
18
+ | `monday` | [WorldVectorLogo](https://worldvectorlogo.com/logo/monday-1) | Trademark of monday.com; no software licence granted (see Trademark, below) |
19
+ | `stripe-link` | [link.com](https://link.com) | Trademark of Stripe; no software licence granted (see Trademark, below) |
20
20
 
21
21
  `monday`'s path data and fill colours are byte-identical to the source. Only
22
22
  the outer `viewBox` and a wrapping group transform were changed, to fit the
@@ -0,0 +1 @@
1
+ <svg fill="#2CA01C" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>QuickBooks</title><path d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm.642 4.1335c.9554 0 1.7296.776 1.7296 1.7332v9.0667h1.6c1.614 0 2.9275-1.3156 2.9275-2.933 0-1.6173-1.3136-2.9333-2.9276-2.9333h-.6654V7.3334h.6654c2.5722 0 4.6577 2.0897 4.6577 4.667 0 2.5774-2.0855 4.6666-4.6577 4.6666H12.642zM7.9837 7.333h3.3291v12.533c-.9555 0-1.73-.7759-1.73-1.7332V9.0662H7.9837c-1.6146 0-2.9277 1.316-2.9277 2.9334 0 1.6175 1.3131 2.9333 2.9277 2.9333h.6654v1.7332h-.6654c-2.5725 0-4.6577-2.0892-4.6577-4.6665 0-2.5771 2.0852-4.6666 4.6577-4.6666Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg fill="#7AB55C" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Shopify</title><path d="M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"/></svg>
package/dist/index.html CHANGED
@@ -331,12 +331,12 @@
331
331
  display: none;
332
332
  }
333
333
  </style>
334
- <script type="module" crossorigin src="/assistant/assets/index-CleA12ha.js"></script>
335
- <link rel="modulepreload" crossorigin href="/assistant/assets/rolldown-runtime-BM3Ffeng.js">
336
- <link rel="modulepreload" crossorigin href="/assistant/assets/react-DPM_L_aA.js">
337
- <link rel="modulepreload" crossorigin href="/assistant/assets/vendor-C_e0Rl2s.js">
338
- <link rel="modulepreload" crossorigin href="/assistant/assets/icons-xHdc0dPY.js">
339
- <link rel="stylesheet" crossorigin href="/assistant/assets/index-_KUyDosG.css">
334
+ <script type="module" crossorigin src="/assistant/assets/rolldown-runtime-BM3Ffeng.js"></script>
335
+ <script type="module" crossorigin src="/assistant/assets/react-B9IgSVeK.js"></script>
336
+ <script type="module" crossorigin src="/assistant/assets/vendor-Dce4XQGd.js"></script>
337
+ <script type="module" crossorigin src="/assistant/assets/icons-SKs_cTXW.js"></script>
338
+ <script type="module" crossorigin src="/assistant/assets/app-DYcUyeCV.js"></script>
339
+ <link rel="stylesheet" crossorigin href="/assistant/assets/app-zlzLjynM.css">
340
340
  <script>window.__VELLUM_CONFIG__={"webUrl":"https://www.vellum.ai","platformUrl":"https://platform.vellum.ai"}</script></head>
341
341
  <body>
342
342
  <!--
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/web",
3
- "version": "0.12.1",
3
+ "version": "0.12.2-staging.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Pre-built web SPA for the Vellum Assistant",
@@ -1 +0,0 @@
1
- import{Xv as e}from"./index-CleA12ha.js";function t(t){let n=typeof window<`u`?window.location.origin:``,r=new URLSearchParams({senderAssistantId:t.senderAssistantId,token:t.token});return`${n}${e.connect}?${r.toString()}`}function n(e){let t=e.get(`senderAssistantId`)?.trim(),n=e.get(`token`)?.trim();return!t||!n?null:{senderAssistantId:t,token:n}}export{n,t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-C_e0Rl2s.js";import{b as n,t as r}from"./react-DPM_L_aA.js";import{Zv as i}from"./index-CleA12ha.js";import{n as a,t as o}from"./app-info--nQmKvGC.js";var s=e(n(),1),c=r();function l(){let{t:e}=t(),[n,r]=(0,s.useState)(null);(0,s.useEffect)(()=>{o().then(r)},[]);let l=n??u;return(0,c.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,c.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:l.appName}),(0,c.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:e(`aboutPage.tagline`)}),(0,c.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,c.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:e(`aboutPage.version`)}),(0,c.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:l.version}),(0,c.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:e(`aboutPage.build`)}),(0,c.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:l.commitSha})]}),(0,c.jsx)(`a`,{href:l.website,className:`text-primary text-sm hover:underline`,onClick:e=>{i()&&(e.preventDefault(),a())},children:new URL(l.website).host}),(0,c.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:l.copyright})]})}var u={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{l as AboutPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-C_e0Rl2s.js";import{b as n,n as r,t as i}from"./react-DPM_L_aA.js";import{Ko as a,Xv as o,fp as s,lp as c,mp as l,qg as u,qo as d,ts as f}from"./index-CleA12ha.js";import{r as p,t as m}from"./account-shell-CfKMHHXQ.js";var h=e(n(),1),g=i();function _(){let{t:e}=t(`account`),n=s(),i=l(),_=c.use.user(),v=c.use.logout(),[y,b]=(0,h.useState)(null),[x,S]=(0,h.useState)(!1),C=async()=>{b(null),S(!0);try{await u(d,a)}catch(t){console.error(`[account] auth flow failed:`,t),b(e(`authErrors.genericFailure`)),S(!1)}};return i?(0,g.jsx)(m,{children:(0,g.jsx)(p,{title:e(`accountPage.loading`)})}):n?(0,g.jsxs)(m,{children:[(0,g.jsx)(p,{title:_?.username?e(`accountPage.signedInTitleNamed`,{name:_.username}):e(`accountPage.signedInTitle`),subtitle:e(`accountPage.signedInSubtitle`)}),(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,g.jsx)(r,{to:o.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:e(`accountPage.goToAssistant`)}),(0,g.jsx)(`button`,{type:`button`,onClick:async()=>{await v(),f(o.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:e(`accountPage.signOut`)})]})]}):(0,g.jsxs)(m,{children:[(0,g.jsx)(p,{title:e(`accountPage.welcomeTitle`),subtitle:e(`accountPage.welcomeSubtitle`)}),y&&(0,g.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:y}),(0,g.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,g.jsx)(`button`,{type:`button`,onClick:()=>void C(),disabled:x,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:e(`accountPage.signIn`)})})]})}export{_ as AccountPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./react-DPM_L_aA.js";import{ub as t}from"./index-CleA12ha.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
@@ -1,3 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{I as t,j as n}from"./vendor-C_e0Rl2s.js";import{b as r,t as i}from"./react-DPM_L_aA.js";import{Ba as a,E as o,Gi as s,Li as c,N as l,Oi as u,Ot as d,Pi as f,Rr as p,Ui as m,Wi as h,Zn as g,_t as _,fi as v,gt as y,jr as b,k as x,pa as S,qa as C,xr as ee,za as te}from"./icons-xHdc0dPY.js";import{n as w,r as T,t as E}from"./metric-card-CgEc3VST.js";import{Hn as ne,Tn as D,Un as O,Wn as k,cr as A,dr as j,fb as M,hn as N,iy as P,lr as F,ob as I,pb as L,ur as re,w as ie}from"./index-CleA12ha.js";import{t as ae}from"./file-diff-view-EiQSECOw.js";import{t as oe}from"./detail-panel-stop-button-B6n2CDuJ.js";import{t as se}from"./status-badge-pill-DsYKTPMw.js";var ce=C(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),R=e(r(),1),z=``;function B(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function le(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function V(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(A.length):t}function H(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function U(e,t){if(t.updateType===`agent_message_chunk`&&le(t)){H(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:V(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??z,r=V(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(H(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??z,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==z&&r&&r.kind===`agent`&&r.messageId===z&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}H(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??z,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}H(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;H(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:B(t.toolStatus,`running`),content:t.content,locations:W(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=W(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:B(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=ue(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(H(e),e.push(i)):e[r]=i;return}}}function W(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function ue(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function de(e){let t=[];for(let n of e)U(t,n);return t}function fe(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function pe(){let e=null,t=[];function n(n){return t=de(n),e=n,t}function r(r){let i=fe(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)U(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function me(e){let t=(0,R.useRef)(null);return t.current??=pe(),t.current.project(e)}function G(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=he(e);t&&r.push(t)}return r}function he(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:ge(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=_e(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function ge(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function _e(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function K(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function q(e){return G(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
2
- `)}function J(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}}function Y(e,t){let n=new Map;for(let t of e)t.type===`diff`&&n.set(t.path,{path:t.path,newText:t.newText,...t.oldText===void 0?{}:{oldText:t.oldText}});for(let e of t??[])n.has(e.path)||n.set(e.path,{path:e.path});return Array.from(n.values())}var X=i();function ve({content:e,isComplete:t,assistantId:n}){return(0,X.jsxs)(`div`,{"data-testid":`acp-chat-agent-message`,className:`flex w-full flex-col items-start text-chat text-[var(--content-default)]`,children:[(0,X.jsx)(N,{content:e,assistantId:n}),!t&&(0,X.jsx)(D,{className:`mt-1`,"data-testid":`acp-chat-agent-streaming`})]})}function ye({entries:e}){let{t}=n(`chat`);return e.length===0?null:(0,X.jsxs)(`div`,{"data-testid":`acp-chat-plan-block`,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 text-[var(--content-tertiary)]`,children:[(0,X.jsx)(g,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,X.jsx)(M,{variant:`body-small-emphasised`,className:`text-inherit`,children:t(`acpChatPlanBlock.plan`)})]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map((e,t)=>(0,X.jsxs)(`li`,{"data-testid":`acp-chat-plan-entry`,"data-checked":e.checked,className:`flex items-start gap-2`,children:[e.checked?(0,X.jsx)(c,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,X.jsx)(u,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`}),(0,X.jsx)(`span`,{className:e.checked?`text-body-small-default text-[var(--content-tertiary)] line-through`:`text-body-small-default text-[var(--content-default)]`,children:e.label})]},t))})]})}function be(e){switch(e){case`max_tokens`:case`max_turn_requests`:return t(`chat:acpChatTerminalBlock.stoppedLimitReached`);case`refusal`:return t(`chat:acpChatTerminalBlock.refused`);case`cancelled`:return t(`chat:acpChatTerminalBlock.cancelled`);default:return t(`chat:acpChatTerminalBlock.completed`)}}function xe(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function Z({completedAt:e}){let{t}=n(`chat`);return e===void 0?null:(0,X.jsx)(`span`,{"data-testid":`acp-chat-terminal-time`,children:t(`acpChatTerminalBlock.atTime`,{time:xe(e)})})}function Se({status:e,stopReason:t,error:r,completedAt:i}){let{t:a}=n(`chat`);if(j(e))return null;if(e===`failed`)return(0,X.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`failed`,className:`flex items-start gap-2 rounded-md bg-[var(--system-negative-weak)] px-3 py-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-terminal-failed-icon`,className:`flex h-[12px] w-4 shrink-0 items-center justify-center`,children:(0,X.jsx)(o,{className:`h-4 w-4`})}),(0,X.jsx)(`span`,{children:r??a(`acpChatTerminalBlock.runFailed`)})]});if(e===`cancelled`)return(0,X.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`cancelled`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,X.jsx)(f,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{children:a(`acpChatTerminalBlock.cancelled`)}),(0,X.jsx)(Z,{completedAt:i})]});let s=be(t);return(0,X.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`completed`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,X.jsx)(c,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,X.jsx)(`span`,{children:s}),(0,X.jsx)(Z,{completedAt:i})]})}function Ce({showDot:e,isLast:t,children:n}){return(0,X.jsxs)(`div`,{className:`relative flex items-start gap-2${t?``:` pb-4`}`,children:[!t&&(0,X.jsx)(`div`,{"aria-hidden":!0,className:`absolute bottom-0 left-[6.5px] w-px bg-[var(--border-element)] ${e?`top-[16px]`:`top-0`}`}),e?(0,X.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-timeline-dot`,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,X.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-[14px] w-[14px] shrink-0`}),(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:n})]})}function we({content:e,isComplete:t,assistantId:n}){let[r,i]=(0,R.useState)(null),a=r??!t,o=e.trim().length>0,c=t?`Thought process`:`Thinking`,l=t?(0,X.jsx)(S,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,X.jsx)(D,{dotSize:5,className:`shrink-0`,"data-testid":`acp-chat-thinking-streaming`});return o?(0,X.jsxs)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>i(!a),"data-testid":`acp-chat-thinking-toggle`,className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,children:[a?(0,X.jsx)(s,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,X.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),l,(0,X.jsx)(`span`,{children:c})]}),a&&(0,X.jsx)(`div`,{"data-testid":`acp-chat-thinking-body`,className:`mt-1.5 border-l-2 border-[var(--border-base)] pl-3 text-body-small-default text-[var(--content-tertiary)]`,children:(0,X.jsx)(N,{content:e,assistantId:n})})]}):(0,X.jsx)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:(0,X.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:[l,(0,X.jsx)(`span`,{children:c})]})})}var Te={running:`neutral`,completed:`positive`,error:`negative`,ended:`neutral`},Ee={running:`Running`,completed:`Completed`,error:`Failed`,ended:`Ended`},De={read:`Read file`,edit:`Edit file`,delete:`Delete file`,move:`Move file`,search:`Search`,execute:`Run command`,think:`Thinking`,fetch:`Fetch`,switch_mode:`Switch mode`},Oe=`Tool call`,ke={read:p,edit:ce,delete:x,move:b,search:_,execute:l,think:S,fetch:ee,switch_mode:d},Ae=new Set([`read`,`edit`,`delete`,`move`]);function je({toolKind:e}){return(0,X.jsx)(e&&ke[e]||v,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`})}function Q({label:e,value:t,testId:n}){return(0,X.jsxs)(`div`,{"data-testid":n,children:[(0,X.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-tertiary)]`,children:e}),(0,X.jsx)(`pre`,{className:`max-h-60 overflow-auto rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] p-2.5 font-mono text-body-small-default text-[var(--content-secondary)]`,children:t})]})}function Me({block:e,isTerminal:t=!1,onOpenDiff:r,onOpenOutput:i}){let{t:a}=n(`chat`),[o,c]=(0,R.useState)(!1),u=(0,R.useMemo)(()=>G(e.content),[e.content]),d=(0,R.useMemo)(()=>q(e.content),[e.content]),f=(0,R.useMemo)(()=>d.split(`
3
- `).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith("```"))||`View output`,[d]),h=(0,R.useMemo)(()=>Y(u,e.locations),[u,e.locations]),g=t&&e.status===`running`?`ended`:e.status,_=g===`running`,v=e.toolKind&&De[e.toolKind]||Oe,y=K(e.rawInput)??e.title,b=y&&y!==v&&(!Ae.has(e.toolKind??``)||h.length===0)?y:null,x=J(e.rawInput),S=J(e.rawOutput),C=x!==void 0||S!==void 0;return(0,X.jsxs)(`div`,{"data-testid":`acp-chat-tool-card`,"data-status":e.status,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(je,{toolKind:e.toolKind}),(0,X.jsx)(M,{variant:`body-small-emphasised`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,title:e.title,children:v}),(0,X.jsx)(I,{tone:Te[g],"data-testid":`acp-chat-tool-status`,children:Ee[g]}),_&&(0,X.jsx)(D,{className:`shrink-0`,"data-testid":`acp-chat-tool-running`})]}),b&&(0,X.jsx)(`div`,{"data-testid":`acp-chat-tool-detail`,className:`mt-1.5 font-mono text-body-small-default whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:b}),h.length>0&&(0,X.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:h.map(t=>{let n=t.oldText!==void 0||t.newText!==void 0,i=`flex max-w-full items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-1 text-body-small-default text-[var(--content-secondary)]`;return n?(0,X.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-file-chip`,onClick:()=>r(e.toolCallId,t),title:t.path,className:`${i} cursor-pointer transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,X.jsx)(p,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path):(0,X.jsxs)(`span`,{"data-testid":`acp-chat-tool-file-ref`,title:t.path,className:i,children:[(0,X.jsx)(p,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path)})}),d.length>0&&(0,X.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-output-open`,onClick:()=>i?.(e.toolCallId),className:`mt-2 flex w-full items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-2.5 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,X.jsx)(l,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:f}),(0,X.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`})]}),C&&(0,X.jsxs)(`div`,{className:`mt-2`,"data-testid":`acp-chat-tool-raw`,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-raw-toggle`,"aria-expanded":o,onClick:()=>c(e=>!e),className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-default)]`,children:[o?(0,X.jsx)(s,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,X.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,X.jsx)(`span`,{children:a(o?`acpChatToolCard.hideRaw`:`acpChatToolCard.showRaw`)})]}),o&&(0,X.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-2`,children:[x!==void 0&&(0,X.jsx)(Q,{label:a(`acpChatToolCard.rawInput`),value:x,testId:`acp-chat-tool-raw-input`}),S!==void 0&&(0,X.jsx)(Q,{label:a(`acpChatToolCard.rawOutput`),value:S,testId:`acp-chat-tool-raw-output`})]})]})]})}function Ne({content:e}){return(0,X.jsx)(`div`,{"data-testid":`acp-chat-user-turn`,className:`flex w-full justify-end`,children:(0,X.jsx)(`div`,{className:`max-w-[80%] rounded-lg bg-[var(--surface-lift)] px-4 py-3 whitespace-pre-wrap text-chat text-[var(--content-default)]`,children:e})})}function Pe({content:e,assistantId:t}){return(0,X.jsx)(`div`,{"data-testid":`acp-chat-command-output`,className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 [&_pre]:!max-h-none`,children:(0,X.jsx)(N,{content:q(e),hardLineBreaks:!0,assistantId:t})})}var Fe=80;function Ie(e){return e.scrollHeight-e.clientHeight-e.scrollTop<=Fe}function Le(e){let t=(0,R.useRef)(null),n=(0,R.useRef)(!0),[r,i]=(0,R.useState)(!1),a=(0,R.useCallback)(()=>{let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]),o=(0,R.useCallback)(()=>{let e=t.current;if(!e)return;let r=Ie(e);n.current=r,i(e=>e===!r?e:!r)},[]),s=(0,R.useCallback)(()=>{n.current=!0,a(),i(!1)},[a]),c=(0,R.useCallback)(e=>{let r=t.current;r&&r.removeEventListener(`scroll`,o),t.current=e,e&&(e.addEventListener(`scroll`,o,{passive:!0}),n.current?e.scrollTop=e.scrollHeight:o())},[o]);return(0,R.useLayoutEffect)(()=>{n.current?a():o()},[e,a,o]),{scrollRef:c,showScrollToLatest:r,scrollToLatest:s}}function Re(e,t){switch(e.kind){case`user`:return`user-${e.id||t}`;case`agent`:return`agent-${e.messageId||t}`;case`thinking`:return`thinking-${e.messageId||t}`;case`tool`:return`tool-${e.toolCallId}`;case`plan`:return`plan`}}var $=[];function ze({entry:e,onClose:t,assistantId:r}){let{t:i}=n(`chat`),o=j(e.status),s=me(F(t=>t.byId[e.acpSessionId]?.events??$)),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(e.acpSessionId);u!==e.acpSessionId&&(d(e.acpSessionId),l(null));let f=(0,R.useCallback)((e,t)=>l({kind:`diff`,toolCallId:e,path:t.path}),[]),p=(0,R.useCallback)(e=>l({kind:`output`,toolCallId:e}),[]),h=(0,R.useCallback)(()=>l(null),[]),g=(0,R.useMemo)(()=>c?s.find(e=>e.kind===`tool`&&e.toolCallId===c.toolCallId)??null:null,[c,s]),_=(0,R.useMemo)(()=>c?.kind!==`diff`||!g?null:Y(G(g.content),g.locations).find(e=>e.path===c.path)??null,[c,g]),v=c?.kind===`diff`?c.path:g?K(g.rawInput)??g.title??`Output`:`Output`,{scrollRef:y,showScrollToLatest:b,scrollToLatest:x}=Le((0,R.useMemo)(()=>({blocks:s,status:e.status,completedAt:e.completedAt}),[s,e.status,e.completedAt])),S=!o;return(0,X.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[c&&(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:h,title:e.agent,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,X.jsx)(M,{variant:`body-small-default`,as:`span`,children:e.agent})}),(0,X.jsx)(m,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,X.jsx)(M,{variant:`body-small-default`,as:`span`,title:v,className:`min-w-0 shrink truncate font-mono text-[var(--content-secondary)]`,children:v})]}),(0,X.jsx)(Be,{entry:e,isRunning:o,onClose:t,showBack:!!c,onBack:h},`header-${e.acpSessionId}`),c?(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:c.kind===`diff`?(0,X.jsx)(ae,{path:c.path,oldText:_?.oldText,newText:_?.newText}):(0,X.jsx)(Pe,{content:g?.content,assistantId:r})}):(0,X.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{ref:y,"data-testid":`acp-chat-conversation`,className:`flex h-full flex-col gap-4 overflow-y-auto px-5 py-5`,children:[(e.inputTokens!==void 0||e.outputTokens!==void 0)&&(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,"data-testid":`acp-run-metrics`,children:[(0,X.jsx)(E,{icon:(0,X.jsx)(a,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens??0,format:e=>w(Math.round(e)),label:i(`acpRunChatView.inputLabel`)}),(0,X.jsx)(E,{icon:(0,X.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens??0,format:e=>w(Math.round(e)),label:i(`acpRunChatView.outputLabel`)})]}),(0,X.jsx)(Ve,{task:e.task}),(0,X.jsx)(`div`,{className:`flex flex-col`,"data-testid":`acp-chat-timeline`,children:s.map((e,t)=>(0,X.jsx)(Ce,{showDot:t===0||t===s.length-1||e.kind===`tool`||e.kind===`plan`,isLast:t===s.length-1,children:(0,X.jsx)(He,{block:e,isTerminal:S,onOpenDiff:f,onOpenOutput:p,assistantId:r})},Re(e,t)))}),!o&&(0,X.jsx)(Se,{status:e.status,stopReason:e.stopReason,error:e.error,completedAt:e.completedAt})]}),b&&(0,X.jsx)(L,{variant:`outlined`,size:`compact`,iconOnly:(0,X.jsx)(te,{}),onClick:x,"aria-label":i(`acpRunChatView.goToNewest`),tooltip:i(`acpRunChatView.goToNewest`),"data-testid":`acp-chat-scroll-to-latest`,className:`absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full shadow-md`})]}),o&&!c&&(0,X.jsx)(Ue,{acpSessionId:e.acpSessionId},`steer-${e.acpSessionId}`)]})}function Be({entry:e,isRunning:t,onClose:r,showBack:i=!1,onBack:a}){let{t:o}=n(`chat`),[s,c]=(0,R.useState)(!1),l=re(e.status,e.stopReason),u=(0,R.useCallback)(()=>{c(!0),O(e.acpSessionId).catch(e=>{c(!1),P(e,{context:`AcpRunChatView.stop`})})},[e.acpSessionId]);return(0,X.jsx)(ie,{icon:(0,X.jsxs)(X.Fragment,{children:[i&&(0,X.jsx)(L,{variant:`outlined`,iconOnly:(0,X.jsx)(h,{}),onClick:a,"aria-label":o(`acpRunChatView.backToConversationAria`),tooltip:o(`acpRunChatView.backTooltip`),"data-testid":`acp-chat-diff-back`,className:`shrink-0`}),(0,X.jsx)(k,{agent:e.agent,className:`h-5 w-5 shrink-0`})]}),title:e.agent,headerTrailing:(0,X.jsx)(se,{color:l.color,label:l.label}),headerActions:t?(0,X.jsx)(oe,{onStop:u,ariaLabel:o(`acpRunChatView.stopRunAria`),disabled:s}):void 0,closeLabel:o(`acpRunChatView.closeRunDetail`),onClose:r})}function Ve({task:e}){let{t}=n(`chat`);return e?(0,X.jsxs)(`div`,{"data-testid":`acp-chat-objective`,children:[(0,X.jsx)(M,{variant:`body-medium-default`,as:`h3`,className:`mb-1 text-[var(--content-emphasised)]`,children:t(`acpRunChatView.objective`)}),(0,X.jsx)(M,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e}),(0,X.jsx)(`div`,{className:`mt-4 h-px w-full bg-[var(--border-hover)]`})]}):null}function He({block:e,isTerminal:t,onOpenDiff:n,onOpenOutput:r,assistantId:i}){switch(e.kind){case`user`:return(0,X.jsx)(Ne,{content:e.content});case`agent`:return(0,X.jsx)(ve,{content:e.content,isComplete:e.isComplete||t,assistantId:i});case`thinking`:return(0,X.jsx)(we,{content:e.content,isComplete:e.isComplete||t,assistantId:i});case`tool`:return(0,X.jsx)(Me,{block:e,isTerminal:t,onOpenDiff:n,onOpenOutput:r});case`plan`:return(0,X.jsx)(ye,{entries:e.entries})}}function Ue({acpSessionId:e}){let{t}=n(`chat`),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(!1);return(0,X.jsx)(`form`,{onSubmit:(0,R.useCallback)(t=>{t.preventDefault();let n=r.trim();if(!n||a)return;o(!0);let s=F.getState().appendLocalMarker({acpSessionId:e,content:`${A}${n}`});ne(e,n).then(()=>i(``)).catch(t=>{s&&F.getState().removeLocalMarker({acpSessionId:e,markerId:s}),P(t,{context:`AcpRunChatView.steer`})}).finally(()=>o(!1))},[r,a,e]),"data-testid":`acp-chat-steer-form`,className:`sticky bottom-0 z-10 shrink-0 border-t border-[var(--border-hover)] bg-[var(--surface-lift)] px-5 py-3`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md bg-[var(--surface-base)] px-3 py-2`,children:[(0,X.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:t(`acpRunChatView.steerPlaceholder`),disabled:a,"aria-label":t(`acpRunChatView.steerAria`),className:`text-body-medium-default min-w-0 flex-1 bg-transparent text-[color:var(--content-default)] placeholder:text-[color:var(--content-tertiary)] focus:outline-none disabled:opacity-50`}),(0,X.jsx)(L,{type:`submit`,variant:`primary`,size:`compact`,iconOnly:(0,X.jsx)(y,{}),disabled:a||r.trim()===``,"aria-label":t(`acpRunChatView.sendSteerAria`),className:`shrink-0`})]})})}function We({entry:e,onClose:t,assistantId:n}){return(0,X.jsx)(ze,{entry:e,onClose:t,assistantId:n})}export{We as AcpRunDetailPanel};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-C_e0Rl2s.js";import{b as n,f as r,r as i,t as a}from"./react-DPM_L_aA.js";import{Jr as o,Ns as s,Xr as c,Xv as l,Yr as u,a as d,ev as f,i as p,n as m,o as h}from"./index-CleA12ha.js";var g=e(n(),1),_=a();function v(){let e=r(),{t:n}=t(`activation`),a=f.use.activeAssistantId(),v=o(),y=c(),{data:b}=u(),{starters:x,items:S}=h(v??``),{launch:C,pendingTaskIds:w}=d(v??``),T=(0,g.useMemo)(()=>[...x,...S],[x,S]),E=(0,g.useCallback)(async t=>{p(await C(t),n,t=>{s(e,t)})},[C,e,n]);return v===null?y?(0,_.jsx)(i,{to:l.assistant,replace:!0}):null:(0,_.jsx)(m,{tasks:T,progress:b?.tasks,pendingTaskIds:w,onLaunch:e=>{E(e)},onOpenConversation:t=>{s(e,t)},assistantId:a??void 0})}export{v as ActivationListRoute};
@@ -1 +0,0 @@
1
- var e={};export{e as default};
@@ -1 +0,0 @@
1
- var e={};export{e as default};
@@ -1 +0,0 @@
1
- var e={};export{e as default};
@@ -1 +0,0 @@
1
- var e={};export{e as default};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{b as t,d as n,f as r}from"./react-DPM_L_aA.js";import{Xv as i}from"./index-CleA12ha.js";var a=e(t(),1);function o(){let e=r(),{search:t,hash:o}=n();return(0,a.useEffect)(()=>{e(`${i.assistant}${t}${o}`,{replace:!0})},[e,t,o]),null}export{o as ActivityRedirectPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-C_e0Rl2s.js";import{b as n,t as r}from"./react-DPM_L_aA.js";import{Wi as i}from"./icons-xHdc0dPY.js";import{An as a,At as o,C as s,Dn as c,E as l,Ln as u,Mn as d,Nt as f,Pn as p,Pt as m,Qs as h,_r as g,_t as _,dt as v,fb as y,fn as b,ft as x,gt as S,hn as C,ht as w,jn as T,jt as E,kn as D,lr as O,lt as k,mt as A,pb as j,ut as M,yt as N}from"./index-CleA12ha.js";import{t as P}from"./use-transcript-message-by-id-DOMa4nxw.js";import{ToolDetailBody as F,ToolDetailHeaderTitle as I,t as L}from"./tool-detail-panel-UBD8L_LV.js";var R=e(n(),1);function z(e,t,n){let r=E(t,n.workflow),i=e=>{let t=m(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=o(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=f(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let s=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||s.has(e.toolCall.id)),toolCalls:a}}function B(e,t){let n=P(e),r=b(),i=h.use.byId(),o=h.use.byToolUseId(),s=h.use.notFoundRunIds(),c=h.use.hydrationFailedRunIds(),l=O.use.byId(),u=O.use.byToolUseId(),f=g.use.byId();return(0,R.useMemo)(()=>{if(!n||t==null)return null;let e=T(n.contentBlocks??[],d(n,r))[t];if(!e||e.type!==`activity`)return null;let{cardItems:p,toolCalls:m}=a(e.items);return z(p,m,{workflow:{byId:i,byToolUseId:o,notFoundRunIds:s,hydrationFailedRunIds:c},acpById:l,acpByToolUseId:u,backgroundTaskById:f})},[n,t,r,i,o,s,c,l,u,f])}var V=r(),H=60;function U({payload:e,onClose:n,assistantId:r}){let{t:a}=t(`chat`),[o,u]=(0,R.useState)(null),d=B(e.messageId,e.groupIndex),f=d?.items??e.items,p=d?.toolCalls??e.toolCalls,m=x(f),h=M(m.steps),g=v(m.state,m.steps),_=g===`loading`,b=k(g,m.totalDurationLabel??``,h.failed),S=_&&m.currentStepTitle||b,C=new Map(p.map(e=>[e.id,e]));return(0,V.jsx)(s,{icon:o?(0,V.jsx)(j,{variant:`outlined`,iconOnly:(0,V.jsx)(i,{}),"aria-label":a(`activityStepsPanel.backAria`),tooltip:a(`activityStepsPanel.backTooltip`),onClick:()=>u(null),className:`shrink-0`}):void 0,titleNode:o?o.kind===`thinking`?(0,V.jsx)(y,{variant:`title-medium`,className:`min-w-0 shrink truncate py-0.5 leading-snug text-[var(--content-default)]`,children:a(`activityStepsPanel.thinkingTitle`)}):(0,V.jsx)(I,{detail:o}):(0,V.jsx)(l,{title:_?(0,V.jsx)(c,{children:S}):S,count:m.stepCount}),closeLabel:a(`activityStepsPanel.closeSteps`),onClose:n,children:o?(0,V.jsx)(G,{detail:o,assistantId:r}):(0,V.jsx)(N,{steps:m.steps,timeline:!0,renderStep:t=>(0,V.jsx)(W,{step:t,activeDetail:o,onOpenDetail:u,lookupToolCall:e=>C.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function W({step:e,activeDetail:n,onOpenDetail:r,lookupToolCall:i,messageId:a,groupIndex:o}){let{t:s}=t(`chat`);if(e.kind===`thinking`){let t=a!=null&&e.thinkingItemIndex!=null?{messageId:a,thinkingGroupIndex:o,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,V.jsx)(S,{iconName:`brain`,label:u(p(e.text),H),ariaLabel:s(`activityStepsPanel.viewThinkingAria`),active:!1,onClick:()=>r({kind:`thinking`,toolCallId:``,toolName:``,title:s(`activityStepsPanel.thinkingTitle`),activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,V.jsx)(w,{step:e});if(e.kind===`web_search_error`)return(0,V.jsx)(A,{step:e});if(e.kind!==`tool`)return(0,V.jsx)(_,{step:e});let c=i(e.toolCallId);return(0,V.jsx)(S,{iconName:e.iconName,label:e.activity||e.info||e.title,active:n?.toolCallId===e.toolCallId,onClick:()=>{c&&r(D(c))}})}function G({detail:e,assistantId:t}){let n=L(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,V.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,V.jsx)(C,{content:n??e.thinkingText??``,hardLineBreaks:!0,assistantId:t}):(0,V.jsx)(F,{detail:e,assistantId:t})})}export{U as ActivityStepsPanel};
@@ -1 +0,0 @@
1
- import{o as e,r as t}from"./rolldown-runtime-BM3Ffeng.js";import{Jn as n,Zn as r,j as i}from"./vendor-C_e0Rl2s.js";import{b as a,d as o,g as s,n as c,t as l}from"./react-DPM_L_aA.js";import{Ui as u,Vi as d,qn as f}from"./icons-xHdc0dPY.js";import{El as p,Ly as m,Ol as h,Ug as g,Wg as _,Xv as v,Yy as y,fu as b,pb as x}from"./index-CleA12ha.js";import{n as S}from"./android-billing-handoff-C_65hbFm.js";import{t as C}from"./checkout-return-target-RlOhwSvu.js";var w=t({AddCreditsModal:()=>j}),T=e(a(),1),E=l(),D=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function O(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function k(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function A({open:e,onOpenChange:t}){let{t:a}=i(),{pathname:l}=o(),[S]=s(),w=S.toString()?`${l}?${S.toString()}`:l,{data:A,isLoading:j}=r(p()),M=A?.allowed_top_up_amounts?.length?A.allowed_top_up_amounts:D,[N,P]=(0,T.useState)(null),F=N&&M.includes(N)?N:M[0]??D[0],I=n(h());return(0,T.useEffect)(()=>_(()=>{t(!1)}),[t]),b(`deeplink.billingCheckoutComplete`,({flow:e})=>{e===`top_up`&&t(!1)}),(0,E.jsx)(y.Root,{open:e,onOpenChange:t,children:(0,E.jsxs)(y.Content,{size:`sm`,children:[(0,E.jsxs)(y.Header,{children:[(0,E.jsx)(y.Title,{children:a(`addCreditsModal.title`)}),(0,E.jsx)(y.Description,{children:a(`addCreditsModal.description`)})]}),(0,E.jsx)(y.Body,{children:(0,E.jsxs)(`div`,{className:`space-y-4`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:a(`addCreditsModal.amount`)}),(0,E.jsx)(m,{id:`add-credits-amount`,value:F,onChange:e=>{P(e),I.isError&&I.reset()},disabled:j||!A,options:M.map(e=>({value:e,label:O(e)}))})]}),I.isError&&(0,E.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,E.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`}),k(I.error)]}),(0,E.jsxs)(c,{to:v.settings.usageBillingConfigureTopUps,className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:[a(`addCreditsModal.configureAutoReload`),(0,E.jsx)(u,{className:`size-4`})]}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,E.jsxs)(y.Footer,{children:[(0,E.jsx)(y.Close,{asChild:!0,children:(0,E.jsx)(x,{variant:`outlined`,children:a(`addCreditsModal.cancel`)})}),(0,E.jsx)(x,{variant:`primary`,leftIcon:I.isPending?(0,E.jsx)(f,{className:`animate-spin`}):void 0,onClick:()=>{I.isPending||I.mutate({body:{amount:F,return_path:w,return_target:C()}},{onSuccess:e=>{g(e.checkout_url)}})},disabled:I.isPending||j||!A,children:a(`addCreditsModal.continue`)})]})]})})}function j(e){return S({open:e.open,path:v.settings.usageBilling,onClose:()=>e.onOpenChange(!1)})?null:(0,E.jsx)(A,{...e})}export{w as n,j as t};