@opengeni/react 6.35.1-canary.45051251770001 → 6.36.0

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 (1122) hide show
  1. package/dist/app/app-state.js +32 -32
  2. package/dist/app/components/Composer.js +43 -43
  3. package/dist/app/components/add-card-dialog.js +1 -1
  4. package/dist/app/components/add-card.js +2 -2
  5. package/dist/app/components/agent/agent-capability-picker.js +9 -9
  6. package/dist/app/components/agents/agent-can-use.js +47 -47
  7. package/dist/app/components/agents/agent-form-page.js +139 -139
  8. package/dist/app/components/agents/agent-page.js +122 -122
  9. package/dist/app/components/agents/agent-setup-sections.js +74 -74
  10. package/dist/app/components/agents/agent-skills.js +13 -13
  11. package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
  12. package/dist/app/components/agents/agent-trigger-dialog.js +31 -31
  13. package/dist/app/components/agents/agent-trigger-picker.js +8 -8
  14. package/dist/app/components/agents/agents-page.js +87 -87
  15. package/dist/app/components/agents/composer-agent-chip.js +59 -59
  16. package/dist/app/components/agents/session-agent-chip.js +55 -55
  17. package/dist/app/components/artifacts/app-package.js +11 -11
  18. package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
  19. package/dist/app/components/artifacts/artifact-library.js +28 -28
  20. package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
  21. package/dist/app/components/artifacts/artifact-viewer.js +65 -65
  22. package/dist/app/components/artifacts/chat-interactive-block.js +27 -27
  23. package/dist/app/components/artifacts/copy-artifact-link.js +1 -1
  24. package/dist/app/components/artifacts/file-reach-dialog.js +12 -12
  25. package/dist/app/components/artifacts/inline-chat-image.js +52 -52
  26. package/dist/app/components/artifacts/retained-file-preview.js +58 -58
  27. package/dist/app/components/artifacts/retained-text-preview.js +8 -8
  28. package/dist/app/components/artifacts/site-actions.js +12 -12
  29. package/dist/app/components/artifacts/site-audience.js +7 -7
  30. package/dist/app/components/artifacts/site-conversations.js +34 -34
  31. package/dist/app/components/artifacts/site-data.js +26 -26
  32. package/dist/app/components/artifacts/site-public-link.js +3 -3
  33. package/dist/app/components/artifacts/site-publishing-page.js +69 -69
  34. package/dist/app/components/artifacts/site-publishing.js +54 -54
  35. package/dist/app/components/artifacts/site-settings.js +68 -68
  36. package/dist/app/components/artifacts/site-version-menu.js +9 -9
  37. package/dist/app/components/billing-class-mark.js +8 -8
  38. package/dist/app/components/capabilities/capability-detail-sheet.js +16 -16
  39. package/dist/app/components/capabilities/capability-logo-source.js +28 -28
  40. package/dist/app/components/capabilities/capability-logo.js +1 -1
  41. package/dist/app/components/capabilities/connection-account-picker.js +2 -2
  42. package/dist/app/components/capabilities/connector-tool-permissions.js +8 -8
  43. package/dist/app/components/capabilities/native-connect-setup.js +32 -32
  44. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +6 -6
  45. package/dist/app/components/capabilities/perform-capability-action.js +4 -4
  46. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +31 -31
  47. package/dist/app/components/capabilities/session-capability-card.js +146 -146
  48. package/dist/app/components/capabilities/session-chrome-card.js +49 -49
  49. package/dist/app/components/capabilities/session-connect-inputs-card.js +33 -33
  50. package/dist/app/components/capabilities/session-custom-mcp-card.js +38 -38
  51. package/dist/app/components/capabilities/session-github-card.js +44 -44
  52. package/dist/app/components/capabilities/session-machine-card.js +50 -50
  53. package/dist/app/components/capabilities/session-personal-github-card.js +32 -32
  54. package/dist/app/components/capabilities/session-plugin-card.js +21 -21
  55. package/dist/app/components/capabilities/use-capabilities-catalog.js +1 -1
  56. package/dist/app/components/capabilities/use-connection-accounts.js +3 -3
  57. package/dist/app/components/chat-payment-pages.js +2 -2
  58. package/dist/app/components/command-menu/chat-status.js +26 -26
  59. package/dist/app/components/command-menu/chat-switcher.js +86 -86
  60. package/dist/app/components/command-menu/command-menu.js +109 -109
  61. package/dist/app/components/command-menu/shortcut-sheet.js +23 -23
  62. package/dist/app/components/composer-capabilities-menu-body.js +7 -7
  63. package/dist/app/components/composer-mobile-plus-panel.js +29 -29
  64. package/dist/app/components/composer-mobile-plus.js +3 -3
  65. package/dist/app/components/credit-required-gate.js +6 -6
  66. package/dist/app/components/credit-required-prompt.js +24 -24
  67. package/dist/app/components/credits/checkout-credits-celebration.js +1 -1
  68. package/dist/app/components/credits/checkout-return.js +1 -1
  69. package/dist/app/components/credits/coupon-redeem.js +1 -1
  70. package/dist/app/components/credits/credit-refusal-notice.js +8 -8
  71. package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
  72. package/dist/app/components/desktop/app-shots.js +9 -9
  73. package/dist/app/components/desktop/app-update.js +3 -3
  74. package/dist/app/components/desktop/computer-use.js +3 -3
  75. package/dist/app/components/desktop/this-computer.js +6 -6
  76. package/dist/app/components/feedback.js +10 -10
  77. package/dist/app/components/follow-up-repository-menu-body.js +14 -14
  78. package/dist/app/components/follow-up-repository-picker.js +1 -1
  79. package/dist/app/components/github-app-connect-launcher.js +2 -2
  80. package/dist/app/components/in-app-help-link.js +3 -3
  81. package/dist/app/components/knowledge/agent-learning-settings.js +3 -3
  82. package/dist/app/components/machines/connect-machine-dialog.js +25 -25
  83. package/dist/app/components/manual-repository-editor.js +3 -3
  84. package/dist/app/components/markdown.js +16 -16
  85. package/dist/app/components/model-identity.js +3 -3
  86. package/dist/app/components/models/models-ui.js +17 -17
  87. package/dist/app/components/models/provider-mark.js +3 -3
  88. package/dist/app/components/models/subscription-usage.js +5 -5
  89. package/dist/app/components/my-things.js +15 -15
  90. package/dist/app/components/own-where-it-works.js +10 -10
  91. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  92. package/dist/app/components/pickers.js +12 -12
  93. package/dist/app/components/rail/channel-create-dialog.js +6 -6
  94. package/dist/app/components/rail/project-glyph.js +52 -52
  95. package/dist/app/components/rail/project-profile.js +73 -73
  96. package/dist/app/components/rail/rail-context.js +2 -2
  97. package/dist/app/components/rail/rail-sections.js +155 -155
  98. package/dist/app/components/rail/session-header.js +124 -124
  99. package/dist/app/components/rail/session-list.js +154 -154
  100. package/dist/app/components/rail/session-row-content.js +7 -7
  101. package/dist/app/components/rail/session-row-hover-details.js +37 -37
  102. package/dist/app/components/rail/session-shell.js +192 -192
  103. package/dist/app/components/rail/site-session-group-heading.js +36 -36
  104. package/dist/app/components/repository-picker.js +14 -14
  105. package/dist/app/components/secrets/session-secrets-panel.js +4 -4
  106. package/dist/app/components/session/agent-configuration-panel.js +48 -48
  107. package/dist/app/components/session/artifact-session-page.js +7 -7
  108. package/dist/app/components/session/banners.js +20 -20
  109. package/dist/app/components/session/chat-avatar.js +52 -52
  110. package/dist/app/components/session/console-new-conversation.js +111 -111
  111. package/dist/app/components/session/descendant-requests.js +109 -109
  112. package/dist/app/components/session/editable-artifacts-workspace.js +59 -59
  113. package/dist/app/components/session/failed-session-banner.js +30 -30
  114. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  115. package/dist/app/components/session/human-input-delegation-record.js +3 -3
  116. package/dist/app/components/session/human-input.js +86 -86
  117. package/dist/app/components/session/inspector.js +142 -142
  118. package/dist/app/components/session/linked-panel.js +3 -3
  119. package/dist/app/components/session/message-actions.js +10 -10
  120. package/dist/app/components/session/model-recovery-notice.js +4 -4
  121. package/dist/app/components/session/new-session-settings-menu.js +28 -28
  122. package/dist/app/components/session/new-session-setup-strip.js +55 -55
  123. package/dist/app/components/session/pull-request-panel.js +25 -25
  124. package/dist/app/components/session/sandbox-recovery-actions.js +3 -3
  125. package/dist/app/components/session/sandbox-switcher.js +22 -22
  126. package/dist/app/components/session/sandbox-workspace.js +118 -118
  127. package/dist/app/components/session/search-markdown-highlight.js +17 -17
  128. package/dist/app/components/session/search-results-view.js +18 -18
  129. package/dist/app/components/session/session-admin-access.js +13 -13
  130. package/dist/app/components/session/session-admission-notice.js +11 -11
  131. package/dist/app/components/session/session-avatar-picker.js +59 -59
  132. package/dist/app/components/session/session-avatar.js +54 -54
  133. package/dist/app/components/session/session-machine-access-notice.js +11 -11
  134. package/dist/app/components/session/session-profile-dialog.js +70 -70
  135. package/dist/app/components/session/session-profile-editor.js +71 -71
  136. package/dist/app/components/session/session-retention.js +6 -6
  137. package/dist/app/components/session/session-search-dialog.js +20 -20
  138. package/dist/app/components/session/session-skill-reviews.js +5 -5
  139. package/dist/app/components/session/session-tenancy-control.js +26 -26
  140. package/dist/app/components/session/session-unattended-setting.js +1 -1
  141. package/dist/app/components/session/session-usage-limit-section.js +11 -11
  142. package/dist/app/components/session/share-chat-dialog.js +10 -10
  143. package/dist/app/components/session/subagents.js +23 -23
  144. package/dist/app/components/session/subscription-account-indicator.js +25 -25
  145. package/dist/app/components/session/subscription-account-menu.js +7 -7
  146. package/dist/app/components/session-connectors-menu-body.js +10 -10
  147. package/dist/app/components/settings/row-select.js +6 -6
  148. package/dist/app/components/toaster.js +2 -2
  149. package/dist/app/components/transcription-settings.js +10 -10
  150. package/dist/app/components/ui/destructive-confirm.js +10 -10
  151. package/dist/app/components/usage/usage-entry.js +8 -8
  152. package/dist/app/components/window-bar.js +24 -24
  153. package/dist/app/components/workspace-composer-plus.js +43 -43
  154. package/dist/app/components/workspace-reach.js +6 -6
  155. package/dist/app/embed/session-app.js +398 -398
  156. package/dist/app/lib/actions/actions-provider.js +18 -18
  157. package/dist/app/lib/agent-capabilities.js +4 -4
  158. package/dist/app/lib/app-connect-card.js +14 -14
  159. package/dist/app/lib/app-shared-key-dialog.js +8 -8
  160. package/dist/app/lib/app-surfaces.js +1 -1
  161. package/dist/app/lib/app-sync-opt-in.js +4 -4
  162. package/dist/app/lib/codex-usage-query.js +3 -3
  163. package/dist/app/lib/composer-agent.js +2 -2
  164. package/dist/app/lib/composer-connectors.js +32 -32
  165. package/dist/app/lib/composer-send-blocking.js +3 -3
  166. package/dist/app/lib/console-site.js +6 -6
  167. package/dist/app/lib/console-text.js +2 -2
  168. package/dist/app/lib/deployment-free-model.js +2 -2
  169. package/dist/app/lib/events.js +29 -29
  170. package/dist/app/lib/failed-session-copy.js +6 -6
  171. package/dist/app/lib/feedback-capture.js +2 -2
  172. package/dist/app/lib/free-credit-gap.js +2 -2
  173. package/dist/app/lib/model-access-onboarding.js +5 -5
  174. package/dist/app/lib/model-policy.js +1 -1
  175. package/dist/app/lib/move-chat-to-machine.js +5 -5
  176. package/dist/app/lib/personal-resource-attachments.js +1 -1
  177. package/dist/app/lib/session-branch-cache.js +19 -19
  178. package/dist/app/lib/session-create.js +5 -5
  179. package/dist/app/lib/session-group-pagination.js +19 -19
  180. package/dist/app/lib/session-hover-facts.js +26 -26
  181. package/dist/app/lib/session-list-dirty-scopes.js +20 -20
  182. package/dist/app/lib/session-model.js +3 -3
  183. package/dist/app/lib/session-rail.js +16 -16
  184. package/dist/app/lib/session-rename.js +4 -4
  185. package/dist/app/lib/sessions-group.js +23 -23
  186. package/dist/app/lib/site-tool-consent-dialog.js +23 -23
  187. package/dist/app/lib/site-tool-consent.js +1 -1
  188. package/dist/app/lib/turn-failure-analytics.js +8 -8
  189. package/dist/app/lib/unavailable-session-model.js +2 -2
  190. package/dist/app/lib/use-artifact-catalog.js +2 -2
  191. package/dist/app/lib/use-duplicate-site.js +4 -4
  192. package/dist/app/lib/use-follow-up-repositories.js +5 -5
  193. package/dist/app/lib/use-personal-resource-attachment.js +2 -2
  194. package/dist/app/lib/use-workspace-machines.js +9 -9
  195. package/dist/app/lib/use-workspace-model-catalog.js +7 -7
  196. package/dist/app/lib/use-workspace-rigs.js +6 -6
  197. package/dist/app/lib/workspace-navigation-preference.js +5 -5
  198. package/dist/app/lib/workspace-scope-context.js +4 -4
  199. package/dist/app/routes/app-page-view.js +17 -17
  200. package/dist/app/routes/app-page.js +2 -2
  201. package/dist/app/routes/artifacts.js +152 -152
  202. package/dist/app/routes/retained-artifact.js +108 -108
  203. package/dist/app/routes/session-unavailable.js +5 -5
  204. package/dist/app/routes/session.js +249 -249
  205. package/dist/app/routes/sessions-index-hydration.js +6 -6
  206. package/dist/app/routes/sessions-index.js +207 -207
  207. package/dist/app/routes/site-view.js +200 -200
  208. package/dist/artifacts-document.js +4 -4
  209. package/dist/artifacts-presentation.js +7 -7
  210. package/dist/artifacts-spreadsheet.js +4 -4
  211. package/dist/artifacts.js +50 -50
  212. package/dist/automation-model.js +7 -7
  213. package/dist/automations.js +65 -65
  214. package/dist/browser-viewer-EIEMRVFF.js +23 -0
  215. package/dist/chat-interactive-block-FV37LWYZ.js +22 -0
  216. package/dist/chunk-2COBAJC7.js +818 -0
  217. package/dist/chunk-2HS3IUXE.js +170 -0
  218. package/dist/chunk-2JTMFYCT.js +296 -0
  219. package/dist/chunk-2JXKP4M6.js +114 -0
  220. package/dist/chunk-2P5K7CBH.js +269 -0
  221. package/dist/chunk-2XGRHMRI.js +250 -0
  222. package/dist/chunk-332BYSAZ.js +65 -0
  223. package/dist/chunk-3EM5GTP3.js +158 -0
  224. package/dist/chunk-3L5ATO4A.js +52 -0
  225. package/dist/chunk-3S3PJB7J.js +107 -0
  226. package/dist/chunk-3SBKYPNM.js +270 -0
  227. package/dist/chunk-3Z7VA6ET.js +114 -0
  228. package/dist/chunk-43BRJBEV.js +207 -0
  229. package/dist/chunk-46LZO4ZO.js +188 -0
  230. package/dist/chunk-46ZC5VNC.js +38 -0
  231. package/dist/chunk-4AH4EEHE.js +298 -0
  232. package/dist/chunk-4D3YJNVN.js +270 -0
  233. package/dist/chunk-4E5QVAT4.js +4480 -0
  234. package/dist/chunk-4E5QVAT4.js.map +1 -0
  235. package/dist/chunk-4I4RTI4D.js +37 -0
  236. package/dist/chunk-4KASGJTF.js +287 -0
  237. package/dist/chunk-4RUKLIOF.js +1263 -0
  238. package/dist/chunk-4UU7FN3I.js +650 -0
  239. package/dist/chunk-4VEIBNC2.js +427 -0
  240. package/dist/chunk-4VEIBNC2.js.map +1 -0
  241. package/dist/chunk-4ZRNASBF.js +2551 -0
  242. package/dist/chunk-5EJBPQI2.js +41 -0
  243. package/dist/chunk-5G4IGG7F.js +209 -0
  244. package/dist/chunk-5JAYZOAW.js +131 -0
  245. package/dist/chunk-5JOKVDSR.js +789 -0
  246. package/dist/chunk-5MP3G7ZV.js +1236 -0
  247. package/dist/chunk-5OVRMKP5.js +42 -0
  248. package/dist/chunk-5SGTRULO.js +1184 -0
  249. package/dist/chunk-5SOL4INY.js +572 -0
  250. package/dist/chunk-5Y34P32B.js +27 -0
  251. package/dist/chunk-62HIKJ5F.js +72 -0
  252. package/dist/chunk-62T2ZPD5.js +266 -0
  253. package/dist/chunk-63VNZRLY.js +386 -0
  254. package/dist/chunk-6CDBX3XG.js +33 -0
  255. package/dist/chunk-6D3D2JWY.js +278 -0
  256. package/dist/chunk-6DOIINY4.js +201 -0
  257. package/dist/chunk-6DQBUKGJ.js +112 -0
  258. package/dist/chunk-6SETNFNH.js +1399 -0
  259. package/dist/chunk-6XYFMHNT.js +56 -0
  260. package/dist/chunk-6YU3WV2P.js +33 -0
  261. package/dist/chunk-6YUHDFOZ.js +351 -0
  262. package/dist/chunk-72EOXOR7.js +1185 -0
  263. package/dist/chunk-72ND4ALI.js +532 -0
  264. package/dist/chunk-757LE32E.js +283 -0
  265. package/dist/chunk-7S2S4MXR.js +138 -0
  266. package/dist/chunk-7SYCHMXS.js +200 -0
  267. package/dist/chunk-7TVAPQOV.js +5089 -0
  268. package/dist/chunk-7UDLRDHK.js +214 -0
  269. package/dist/chunk-7YLQCMZP.js +357 -0
  270. package/dist/chunk-A5GX3CAE.js +849 -0
  271. package/dist/chunk-A7EBV2EB.js +318 -0
  272. package/dist/chunk-AB5SPXUR.js +114 -0
  273. package/dist/chunk-AHVQGL5A.js +202 -0
  274. package/dist/chunk-AI77ZKEV.js +26 -0
  275. package/dist/chunk-AIX2D6RB.js +1019 -0
  276. package/dist/chunk-AVSIHP7Q.js +192 -0
  277. package/dist/chunk-AWK23Q32.js +107 -0
  278. package/dist/chunk-AYVWA6KD.js +432 -0
  279. package/dist/chunk-AYZXE4IM.js +2553 -0
  280. package/dist/chunk-AZGGSPTE.js +124 -0
  281. package/dist/chunk-B45TB4HY.js +931 -0
  282. package/dist/chunk-BIUJHNVR.js +46 -0
  283. package/dist/chunk-BJUOKUE5.js +234 -0
  284. package/dist/chunk-BPEEVMKH.js +292 -0
  285. package/dist/chunk-BPHPAGYF.js +74 -0
  286. package/dist/chunk-BXMND6YU.js +307 -0
  287. package/dist/chunk-C6OM2SRG.js +117 -0
  288. package/dist/chunk-CIRCUDKF.js +1309 -0
  289. package/dist/chunk-CLKR4UG3.js +403 -0
  290. package/dist/chunk-CPX6BHER.js +554 -0
  291. package/dist/chunk-CVC4RO7D.js +155 -0
  292. package/dist/chunk-D3YJAQGK.js +103 -0
  293. package/dist/chunk-DFQ72BLS.js +1024 -0
  294. package/dist/chunk-DG65PJOZ.js +4564 -0
  295. package/dist/chunk-DNAXAS5R.js +406 -0
  296. package/dist/chunk-DO247ITS.js +175 -0
  297. package/dist/chunk-DONBARLL.js +154 -0
  298. package/dist/chunk-DTLXQ3ZU.js +373 -0
  299. package/dist/chunk-EAXTACI4.js +274 -0
  300. package/dist/chunk-EDPH7AJH.js +412 -0
  301. package/dist/chunk-EER3B3G5.js +10036 -0
  302. package/dist/chunk-EER3B3G5.js.map +1 -0
  303. package/dist/chunk-EFKQHCGJ.js +276 -0
  304. package/dist/chunk-EILSPMVD.js +133 -0
  305. package/dist/chunk-EK7KIETS.js +211 -0
  306. package/dist/chunk-EMWT6GOK.js +437 -0
  307. package/dist/chunk-EO22NST7.js +259 -0
  308. package/dist/chunk-ER5MYLIE.js +256 -0
  309. package/dist/chunk-ES5HKVQF.js +234 -0
  310. package/dist/chunk-EXRQ5ATC.js +738 -0
  311. package/dist/chunk-EXRQ5ATC.js.map +1 -0
  312. package/dist/chunk-F26YBYAZ.js +111 -0
  313. package/dist/chunk-F6QP4GSK.js +515 -0
  314. package/dist/chunk-F7QEO7M2.js +851 -0
  315. package/dist/chunk-FJFGDLXB.js +12 -0
  316. package/dist/chunk-FLLJ2WXW.js +113 -0
  317. package/dist/chunk-FMBJKMT4.js +107 -0
  318. package/dist/chunk-FPN4I4CG.js +3690 -0
  319. package/dist/chunk-FUXFJTXL.js +3070 -0
  320. package/dist/chunk-FXFOKD7A.js +449 -0
  321. package/dist/chunk-FZI4QOAV.js +3996 -0
  322. package/dist/chunk-FZI4QOAV.js.map +1 -0
  323. package/dist/chunk-G6SSSX5R.js +158 -0
  324. package/dist/chunk-GBGCMHBB.js +608 -0
  325. package/dist/chunk-GIHE7U3Y.js +174 -0
  326. package/dist/chunk-GJ4GTYOD.js +372 -0
  327. package/dist/chunk-GLSDWNFV.js +432 -0
  328. package/dist/chunk-GMGAW3T6.js +278 -0
  329. package/dist/chunk-GNGI6XFN.js +43 -0
  330. package/dist/chunk-GO5VIAA7.js +264 -0
  331. package/dist/chunk-GSW4YHZE.js +229 -0
  332. package/dist/chunk-GUC6IWEY.js +407 -0
  333. package/dist/chunk-GWAY3SO5.js +15 -0
  334. package/dist/chunk-GXOTNT5D.js +168 -0
  335. package/dist/chunk-GZZCVF76.js +3851 -0
  336. package/dist/chunk-H4VMHFOX.js +214 -0
  337. package/dist/chunk-HA5RFQAF.js +110 -0
  338. package/dist/chunk-HFROJDFQ.js +118 -0
  339. package/dist/chunk-HHFFPE67.js +220 -0
  340. package/dist/chunk-HJLHGXWL.js +103 -0
  341. package/dist/chunk-HKNMNL7B.js +2984 -0
  342. package/dist/chunk-HT7MBHLY.js +1021 -0
  343. package/dist/chunk-I5FSUZVW.js +584 -0
  344. package/dist/chunk-IINQO425.js +246 -0
  345. package/dist/chunk-IIXNEOK4.js +1022 -0
  346. package/dist/chunk-IM3WA5AL.js +311 -0
  347. package/dist/chunk-IX4P4OGR.js +399 -0
  348. package/dist/chunk-IX5VHZYS.js +129 -0
  349. package/dist/chunk-JB3TSUZO.js +263 -0
  350. package/dist/chunk-JIC6RLUB.js +27 -0
  351. package/dist/chunk-JNJIZCTN.js +172 -0
  352. package/dist/chunk-JNV5ZPUV.js +828 -0
  353. package/dist/chunk-JPQFVR24.js +50 -0
  354. package/dist/chunk-JPZVMXDP.js +1333 -0
  355. package/dist/chunk-JVPF34MX.js +215 -0
  356. package/dist/chunk-KED67KAF.js +85 -0
  357. package/dist/chunk-KJ72GMZ2.js +378 -0
  358. package/dist/chunk-KTGKGHEA.js +75 -0
  359. package/dist/chunk-KU77XHWB.js +285 -0
  360. package/dist/chunk-KVPQUADA.js +5915 -0
  361. package/dist/chunk-KVPQUADA.js.map +1 -0
  362. package/dist/chunk-KXBLLFOO.js +249 -0
  363. package/dist/chunk-L6WVCO6D.js +61 -0
  364. package/dist/chunk-LIOZ2MXJ.js +380 -0
  365. package/dist/chunk-LIOZ2MXJ.js.map +1 -0
  366. package/dist/chunk-LPEFULJY.js +73 -0
  367. package/dist/chunk-LRMGPO7E.js +98 -0
  368. package/dist/chunk-LVKTKORH.js +121 -0
  369. package/dist/chunk-MCPKUVMQ.js +99 -0
  370. package/dist/chunk-MFLU3466.js +99 -0
  371. package/dist/chunk-MIUJ3EH5.js +60 -0
  372. package/dist/chunk-MIUMNTIJ.js +175 -0
  373. package/dist/chunk-ML46TXRM.js +113 -0
  374. package/dist/chunk-MO3XJQN2.js +629 -0
  375. package/dist/chunk-MQRHTOQ2.js +218 -0
  376. package/dist/chunk-MVYQDBE6.js +79 -0
  377. package/dist/chunk-NIPON7YB.js +850 -0
  378. package/dist/chunk-NIPON7YB.js.map +1 -0
  379. package/dist/chunk-NPBEUU22.js +196 -0
  380. package/dist/chunk-NSXKGS2K.js +178 -0
  381. package/dist/chunk-NUEFORM6.js +2317 -0
  382. package/dist/chunk-NZOFNQNC.js +176 -0
  383. package/dist/chunk-O664PL2U.js +47 -0
  384. package/dist/chunk-O664PL2U.js.map +1 -0
  385. package/dist/chunk-OATXCLTY.js +211 -0
  386. package/dist/chunk-OG3ELROW.js +538 -0
  387. package/dist/chunk-OI4WS7FW.js +162 -0
  388. package/dist/chunk-OITGZUDC.js +82 -0
  389. package/dist/chunk-OKD2LBMK.js +333 -0
  390. package/dist/chunk-OLFOGAWU.js +273 -0
  391. package/dist/chunk-OLFOGAWU.js.map +1 -0
  392. package/dist/chunk-OSA4CGST.js +134 -0
  393. package/dist/chunk-OXYAKUFU.js +401 -0
  394. package/dist/chunk-OYMSMU5O.js +396 -0
  395. package/dist/chunk-P4NZ72KY.js +162 -0
  396. package/dist/chunk-PBYL2VIM.js +379 -0
  397. package/dist/chunk-PDW3OOSZ.js +505 -0
  398. package/dist/chunk-PGRKTQIW.js +523 -0
  399. package/dist/chunk-PPQJIVGM.js +175 -0
  400. package/dist/chunk-PYMQM65Y.js +125 -0
  401. package/dist/chunk-Q273Q33U.js +166 -0
  402. package/dist/chunk-Q4CLS2HL.js +340 -0
  403. package/dist/chunk-QA5UNVHD.js +85 -0
  404. package/dist/chunk-QFOBUA2J.js +428 -0
  405. package/dist/chunk-QLIM4D56.js +1095 -0
  406. package/dist/chunk-QMQF5U2D.js +20 -0
  407. package/dist/chunk-QNOWKKZ4.js +40 -0
  408. package/dist/chunk-QPOUPVPD.js +144 -0
  409. package/dist/chunk-QTJAQ6DS.js +48 -0
  410. package/dist/chunk-QUOFP3G7.js +404 -0
  411. package/dist/chunk-QVOTPOXK.js +29 -0
  412. package/dist/chunk-QYZ5RVGM.js +184 -0
  413. package/dist/chunk-R7CVDKRN.js +2580 -0
  414. package/dist/chunk-RB7MXNZD.js +639 -0
  415. package/dist/chunk-RDZQFZOQ.js +187 -0
  416. package/dist/chunk-RIHKEGWS.js +194 -0
  417. package/dist/chunk-ROSB7GF6.js +57 -0
  418. package/dist/chunk-RP3YMYCX.js +723 -0
  419. package/dist/chunk-RPHXJHNX.js +271 -0
  420. package/dist/chunk-RVC3M66H.js +191 -0
  421. package/dist/chunk-S3OTJAAC.js +283 -0
  422. package/dist/chunk-SBWPMVRN.js +56 -0
  423. package/dist/chunk-SERECSAR.js +138 -0
  424. package/dist/chunk-SHSEF3GJ.js +187 -0
  425. package/dist/chunk-SMS2M3RG.js +772 -0
  426. package/dist/chunk-SRDHDIRQ.js +177 -0
  427. package/dist/chunk-SXRYA7NN.js +389 -0
  428. package/dist/chunk-SYA3WYG4.js +1187 -0
  429. package/dist/chunk-SYYFA7W7.js +23 -0
  430. package/dist/chunk-T2QDSTBH.js +371 -0
  431. package/dist/chunk-TFSCGFYV.js +251 -0
  432. package/dist/chunk-TGCKZOSX.js +246 -0
  433. package/dist/chunk-THILLYQM.js +132 -0
  434. package/dist/chunk-TI6LGUEZ.js +2412 -0
  435. package/dist/chunk-TSY6YZL2.js +366 -0
  436. package/dist/chunk-TW2RHTLH.js +3321 -0
  437. package/dist/chunk-TWA5G277.js +141 -0
  438. package/dist/chunk-TZZ2S4XI.js +247 -0
  439. package/dist/chunk-U5D3K53R.js +58 -0
  440. package/dist/chunk-UECD27LX.js +251 -0
  441. package/dist/chunk-UFJDETKG.js +108 -0
  442. package/dist/chunk-UHCFYX4I.js +570 -0
  443. package/dist/chunk-UHTURYJO.js +898 -0
  444. package/dist/chunk-UJH63JT3.js +67 -0
  445. package/dist/chunk-UOLDS6S5.js +1152 -0
  446. package/dist/chunk-UUE3OGXI.js +84 -0
  447. package/dist/chunk-UUNJ2E57.js +391 -0
  448. package/dist/chunk-UYQVWRAH.js +199 -0
  449. package/dist/chunk-UYWVK7JQ.js +234 -0
  450. package/dist/chunk-UYWWUEL4.js +126 -0
  451. package/dist/chunk-V4CQKX5H.js +48 -0
  452. package/dist/chunk-V4QM7GDQ.js +3176 -0
  453. package/dist/chunk-V5Y74WII.js +91 -0
  454. package/dist/chunk-VGGZLUQK.js +129 -0
  455. package/dist/chunk-VGX636MB.js +311 -0
  456. package/dist/chunk-VGZLFQO2.js +773 -0
  457. package/dist/chunk-VJWZATNF.js +137 -0
  458. package/dist/chunk-VMWCIC2N.js +50 -0
  459. package/dist/chunk-VPWKTIU5.js +227 -0
  460. package/dist/chunk-VXOLG6YB.js +469 -0
  461. package/dist/chunk-W2NAU5VB.js +1628 -0
  462. package/dist/chunk-WGORKMR3.js +353 -0
  463. package/dist/chunk-WMIDELSJ.js +391 -0
  464. package/dist/chunk-WSOSGL2G.js +383 -0
  465. package/dist/chunk-WXUUOM4X.js +400 -0
  466. package/dist/chunk-WZ74QHLE.js +4863 -0
  467. package/dist/chunk-WZ74QHLE.js.map +1 -0
  468. package/dist/chunk-X2OWM2ME.js +1870 -0
  469. package/dist/chunk-X6UMGG4T.js +68 -0
  470. package/dist/chunk-XDXKB25W.js +93 -0
  471. package/dist/chunk-XE4PHI74.js +231 -0
  472. package/dist/chunk-XHF2XNU5.js +73 -0
  473. package/dist/chunk-XLJ4SQFS.js +230 -0
  474. package/dist/chunk-XOD4FX6M.js +2434 -0
  475. package/dist/chunk-XODQ2GPF.js +3110 -0
  476. package/dist/chunk-XT54RTAM.js +441 -0
  477. package/dist/chunk-YAVW5OJ5.js +131 -0
  478. package/dist/chunk-YDQHFJM2.js +83 -0
  479. package/dist/chunk-YH6O6OQ6.js +1356 -0
  480. package/dist/chunk-YIKPC2QP.js +794 -0
  481. package/dist/chunk-ZD7PKYC4.js +335 -0
  482. package/dist/chunk-ZEQYHEWP.js +406 -0
  483. package/dist/chunk-ZP3QCPYG.js +21 -0
  484. package/dist/chunk-ZRVUCTSI.js +265 -0
  485. package/dist/chunk-ZSI3ITRK.js +449 -0
  486. package/dist/chunk-ZZMEQCIZ.js +236 -0
  487. package/dist/components/browser-viewer.d.ts +4 -1
  488. package/dist/composer.js +35 -35
  489. package/dist/computer-viewer-ZBY3BPYW.js +21 -0
  490. package/dist/connect.js +30 -30
  491. package/dist/connection-step-up-JQ4OFSQN.js +145 -0
  492. package/dist/desktop-dictation.js +24 -24
  493. package/dist/desktop.js +2 -2
  494. package/dist/editor.js +2 -2
  495. package/dist/embedded-new-voice-ZB5XLKLU.js +25 -0
  496. package/dist/embedded-voice-MZJISDCS.js +25 -0
  497. package/dist/fleet-decision-row-LG3SYVR3.js +361 -0
  498. package/dist/human-input-model.d.ts +2 -0
  499. package/dist/in-chat-connect-model.js +6 -6
  500. package/dist/index.js +298 -298
  501. package/dist/interaction.d.ts +2 -0
  502. package/dist/interaction.js +11 -9
  503. package/dist/interaction.js.map +1 -1
  504. package/dist/latest-question-QWJTXMFA.js +1 -1
  505. package/dist/machine-request-model.js +1 -1
  506. package/dist/machines.js +8 -8
  507. package/dist/meetings-recorder.js +1 -1
  508. package/dist/meetings.js +116 -116
  509. package/dist/messages/en.d.ts +12 -0
  510. package/dist/messages.js +1 -1
  511. package/dist/model-levels.js +2 -2
  512. package/dist/model-picker-model.js +2 -2
  513. package/dist/model-policy-picker-menu-5Y72PLNF.js +23 -0
  514. package/dist/model-policy.js +1 -1
  515. package/dist/payment-page-card-YPSXRHBA.js +226 -0
  516. package/dist/platform-activity-row-ZU4MEBNK.js +156 -0
  517. package/dist/queue-surface-implementation-6Q25RPH6.js +932 -0
  518. package/dist/realtime.js +17 -17
  519. package/dist/recorder-host-JD4GWJ2Z.js +80 -0
  520. package/dist/recordings.js +3 -3
  521. package/dist/sandbox-files-HCLEEJMU.js +28 -0
  522. package/dist/session-app.js +398 -398
  523. package/dist/session-connect-cards-DRKEN3Z4.js +27 -0
  524. package/dist/session-list-model.js +3 -3
  525. package/dist/session-realtime-IZOTTRH6.js +30 -0
  526. package/dist/session-realtime.js +2 -2
  527. package/dist/session-ui.js +95 -95
  528. package/dist/session.js +42 -42
  529. package/dist/sites.js +3 -3
  530. package/dist/terminal.js +2 -2
  531. package/dist/this-computer.js +3 -3
  532. package/dist/timeline-annotation-markers-WWXNJOXI.js +157 -0
  533. package/dist/timeline-annotation-selection-ZKRIQFIQ.js +208 -0
  534. package/dist/timeline-annotations-dialog-4IMKTOXJ.js +283 -0
  535. package/dist/timeline-model.js +58 -58
  536. package/dist/ui/access-list.js +23 -23
  537. package/dist/ui/cadence-picker.js +7 -7
  538. package/dist/ui/choice-cards.js +3 -3
  539. package/dist/ui/confirm-dialog.js +2 -2
  540. package/dist/ui/copy-field.js +3 -3
  541. package/dist/ui/detail-page.js +5 -5
  542. package/dist/ui/detail-sheet.js +5 -5
  543. package/dist/ui/diff-view.js +3 -3
  544. package/dist/ui/disclosure.js +6 -6
  545. package/dist/ui/email-chips-input.js +3 -3
  546. package/dist/ui/field.js +2 -2
  547. package/dist/ui/flush-form-page.js +7 -7
  548. package/dist/ui/form-dialog.js +6 -6
  549. package/dist/ui/list-row.js +6 -6
  550. package/dist/ui/load-failure.js +3 -3
  551. package/dist/ui/relative-time.js +3 -3
  552. package/dist/ui/revision-history.js +13 -13
  553. package/dist/ui/role-select.js +11 -11
  554. package/dist/ui/select-menu.js +5 -5
  555. package/dist/ui/settings-nav.js +6 -6
  556. package/dist/ui/sheet.js +2 -2
  557. package/dist/ui/usage-meter.js +4 -4
  558. package/dist/usage.js +3 -3
  559. package/dist/workbench.js +11 -11
  560. package/package.json +5 -6
  561. package/src/components/browser-viewer.tsx +109 -72
  562. package/src/components/secret-question-field.tsx +2 -1
  563. package/src/human-input-model.ts +53 -10
  564. package/src/interaction.ts +2 -0
  565. package/src/messages/en.ts +12 -0
  566. package/src/model-policy.ts +3 -1
  567. package/dist/browser-viewer-5DCULGWS.js +0 -23
  568. package/dist/chat-interactive-block-ISMUKH3P.js +0 -22
  569. package/dist/chunk-22NKV5QE.js +0 -133
  570. package/dist/chunk-25SCFA2X.js +0 -794
  571. package/dist/chunk-2NJRDH3Z.js +0 -4480
  572. package/dist/chunk-2NJRDH3Z.js.map +0 -1
  573. package/dist/chunk-2O5EDTVB.js +0 -723
  574. package/dist/chunk-2R7AOT3Y.js +0 -400
  575. package/dist/chunk-2XQFDRP6.js +0 -234
  576. package/dist/chunk-34XY4PWB.js +0 -2412
  577. package/dist/chunk-37J33BLN.js +0 -107
  578. package/dist/chunk-3AXHBU7K.js +0 -818
  579. package/dist/chunk-3B4D4BV7.js +0 -270
  580. package/dist/chunk-3EQMXU5V.js +0 -403
  581. package/dist/chunk-3QUDVXDR.js +0 -227
  582. package/dist/chunk-3SKJO525.js +0 -215
  583. package/dist/chunk-3Y2VSFYS.js +0 -26
  584. package/dist/chunk-3Y7IJPHB.js +0 -3321
  585. package/dist/chunk-3YLXGP2I.js +0 -515
  586. package/dist/chunk-4AUUNEQY.js +0 -15
  587. package/dist/chunk-4D4XXJJJ.js +0 -379
  588. package/dist/chunk-4DW5QEAP.js +0 -201
  589. package/dist/chunk-4KF5I3H5.js +0 -335
  590. package/dist/chunk-4PG2BEQA.js +0 -175
  591. package/dist/chunk-4SW3EUNM.js +0 -83
  592. package/dist/chunk-4T2KWNYX.js +0 -378
  593. package/dist/chunk-4TTWUMDP.js +0 -168
  594. package/dist/chunk-4WKITG7P.js +0 -132
  595. package/dist/chunk-4YXA5UO3.js +0 -287
  596. package/dist/chunk-4ZCTHNOA.js +0 -298
  597. package/dist/chunk-52BUMJQB.js +0 -98
  598. package/dist/chunk-53ZK2JFE.js +0 -538
  599. package/dist/chunk-5ABIZ7YT.js +0 -371
  600. package/dist/chunk-5AHIKB3O.js +0 -449
  601. package/dist/chunk-5DEP55DK.js +0 -251
  602. package/dist/chunk-5ERDSF2C.js +0 -79
  603. package/dist/chunk-5G55HNJB.js +0 -412
  604. package/dist/chunk-62AHHCFV.js +0 -340
  605. package/dist/chunk-644P2VLV.js +0 -407
  606. package/dist/chunk-6F34IWSA.js +0 -47
  607. package/dist/chunk-6F34IWSA.js.map +0 -1
  608. package/dist/chunk-6QDXVH45.js +0 -114
  609. package/dist/chunk-6TBA45QF.js +0 -12
  610. package/dist/chunk-6Y3EFN4Q.js +0 -265
  611. package/dist/chunk-73P7NEOX.js +0 -52
  612. package/dist/chunk-7CLQ7RQV.js +0 -828
  613. package/dist/chunk-7M57K6K5.js +0 -505
  614. package/dist/chunk-7QORJTVI.js +0 -3690
  615. package/dist/chunk-ABO54U65.js +0 -108
  616. package/dist/chunk-ANCI6T7S.js +0 -406
  617. package/dist/chunk-AO27D7GY.js +0 -1021
  618. package/dist/chunk-ATQ3O5E6.js +0 -144
  619. package/dist/chunk-AXBSHKRP.js +0 -246
  620. package/dist/chunk-AZC5P5PV.js +0 -131
  621. package/dist/chunk-B6YDINPE.js +0 -68
  622. package/dist/chunk-BJNSS4UV.js +0 -399
  623. package/dist/chunk-BKYHS4IH.js +0 -276
  624. package/dist/chunk-BOCDCQYX.js +0 -41
  625. package/dist/chunk-BOP5TAUU.js +0 -229
  626. package/dist/chunk-BPD6VRVH.js +0 -432
  627. package/dist/chunk-BSAKPNKY.js +0 -263
  628. package/dist/chunk-BUBEMKK3.js +0 -4845
  629. package/dist/chunk-BUBEMKK3.js.map +0 -1
  630. package/dist/chunk-BXKNGFX5.js +0 -5089
  631. package/dist/chunk-CBHZXVSI.js +0 -207
  632. package/dist/chunk-CGEAOUXW.js +0 -246
  633. package/dist/chunk-CGWLKFQF.js +0 -2580
  634. package/dist/chunk-CIDJMJ44.js +0 -380
  635. package/dist/chunk-CIDJMJ44.js.map +0 -1
  636. package/dist/chunk-CNLR3MVZ.js +0 -175
  637. package/dist/chunk-CPN7JXYV.js +0 -93
  638. package/dist/chunk-DDCDQ4BF.js +0 -2551
  639. package/dist/chunk-DK5L6E4G.js +0 -391
  640. package/dist/chunk-DMDJPQCR.js +0 -5903
  641. package/dist/chunk-DMDJPQCR.js.map +0 -1
  642. package/dist/chunk-DNNW2FSP.js +0 -256
  643. package/dist/chunk-DRPIGAMM.js +0 -4564
  644. package/dist/chunk-DUZZB4C6.js +0 -283
  645. package/dist/chunk-DWH35C5X.js +0 -56
  646. package/dist/chunk-DWW2MA3S.js +0 -278
  647. package/dist/chunk-E4NQIEA3.js +0 -85
  648. package/dist/chunk-E4SAFP76.js +0 -112
  649. package/dist/chunk-EO7NZKIX.js +0 -249
  650. package/dist/chunk-EQSANTUC.js +0 -84
  651. package/dist/chunk-EVHNQCEM.js +0 -214
  652. package/dist/chunk-EVRLHFIG.js +0 -187
  653. package/dist/chunk-FAVXYNTK.js +0 -67
  654. package/dist/chunk-FRDJUZ6E.js +0 -91
  655. package/dist/chunk-FWRKCWQO.js +0 -141
  656. package/dist/chunk-G65TM5FL.js +0 -166
  657. package/dist/chunk-G7TU7QDO.js +0 -432
  658. package/dist/chunk-GGIPEZLL.js +0 -849
  659. package/dist/chunk-GKA5LFYR.js +0 -21
  660. package/dist/chunk-GMQFRX2V.js +0 -406
  661. package/dist/chunk-HE5BTYPR.js +0 -37
  662. package/dist/chunk-HI6TPRY5.js +0 -1356
  663. package/dist/chunk-HLNSIXSJ.js +0 -357
  664. package/dist/chunk-HUKGLWAY.js +0 -174
  665. package/dist/chunk-HUTQJY3F.js +0 -23
  666. package/dist/chunk-HWDHA4KS.js +0 -137
  667. package/dist/chunk-HWDKTGNX.js +0 -1263
  668. package/dist/chunk-HWOJ7JSO.js +0 -20
  669. package/dist/chunk-HWOYJOKK.js +0 -266
  670. package/dist/chunk-HXVKXFIC.js +0 -56
  671. package/dist/chunk-HYVRYGY3.js +0 -270
  672. package/dist/chunk-I5ZTAMDP.js +0 -27
  673. package/dist/chunk-IGVRNMXK.js +0 -154
  674. package/dist/chunk-IHNCZONS.js +0 -230
  675. package/dist/chunk-IIUBCLH6.js +0 -437
  676. package/dist/chunk-IQKLWMIF.js +0 -373
  677. package/dist/chunk-IQWAFZGW.js +0 -191
  678. package/dist/chunk-J3GK2LZP.js +0 -292
  679. package/dist/chunk-J4OOKDRV.js +0 -40
  680. package/dist/chunk-JBNCFLMW.js +0 -3996
  681. package/dist/chunk-JBNCFLMW.js.map +0 -1
  682. package/dist/chunk-JY4ACIKP.js +0 -194
  683. package/dist/chunk-KDZ7WKYY.js +0 -192
  684. package/dist/chunk-KGTZGR4F.js +0 -172
  685. package/dist/chunk-KKIJYI7N.js +0 -351
  686. package/dist/chunk-KLOB3IXX.js +0 -175
  687. package/dist/chunk-KMZUIWL6.js +0 -107
  688. package/dist/chunk-KUYTRUIE.js +0 -214
  689. package/dist/chunk-KYDLVMKA.js +0 -99
  690. package/dist/chunk-KZQDP2JM.js +0 -155
  691. package/dist/chunk-L22AVXXW.js +0 -187
  692. package/dist/chunk-L5AQCKRR.js +0 -311
  693. package/dist/chunk-LG3WCCUT.js +0 -188
  694. package/dist/chunk-LRE7WH6D.js +0 -1095
  695. package/dist/chunk-LSQP22UI.js +0 -176
  696. package/dist/chunk-LTNBDO5B.js +0 -72
  697. package/dist/chunk-LUUFLV27.js +0 -113
  698. package/dist/chunk-M2KDPKQC.js +0 -126
  699. package/dist/chunk-M5FX5KH5.js +0 -629
  700. package/dist/chunk-MD27CX2K.js +0 -1022
  701. package/dist/chunk-MEUAI3B7.js +0 -199
  702. package/dist/chunk-MFYH4N6I.js +0 -650
  703. package/dist/chunk-MPW67ODY.js +0 -639
  704. package/dist/chunk-MRNOTVGF.js +0 -366
  705. package/dist/chunk-MTOWY5MX.js +0 -307
  706. package/dist/chunk-MVLHO6AU.js +0 -441
  707. package/dist/chunk-N4AHWDN2.js +0 -121
  708. package/dist/chunk-NABGUV6O.js +0 -48
  709. package/dist/chunk-NH6OLIQD.js +0 -1628
  710. package/dist/chunk-NKCK4LBK.js +0 -103
  711. package/dist/chunk-NNE73MK2.js +0 -1333
  712. package/dist/chunk-NPKFHO6N.js +0 -584
  713. package/dist/chunk-NRRRO3NJ.js +0 -851
  714. package/dist/chunk-NSLCRIQ6.js +0 -386
  715. package/dist/chunk-NUZNJSL5.js +0 -285
  716. package/dist/chunk-NYTKZQ2V.js +0 -234
  717. package/dist/chunk-O4UAH7WR.js +0 -427
  718. package/dist/chunk-O4UAH7WR.js.map +0 -1
  719. package/dist/chunk-OAEI3MUO.js +0 -50
  720. package/dist/chunk-OCWCZRVU.js +0 -3110
  721. package/dist/chunk-ODR2Q4JQ.js +0 -1236
  722. package/dist/chunk-ODWNT3XC.js +0 -3176
  723. package/dist/chunk-OE6XABJ3.js +0 -269
  724. package/dist/chunk-OEGJWY2U.js +0 -3851
  725. package/dist/chunk-OHJXHKQT.js +0 -162
  726. package/dist/chunk-OJE3WTHK.js +0 -391
  727. package/dist/chunk-OJNZTTQE.js +0 -353
  728. package/dist/chunk-OMYNOB7U.js +0 -124
  729. package/dist/chunk-OX234K6A.js +0 -1399
  730. package/dist/chunk-OYJ7KP6H.js +0 -1152
  731. package/dist/chunk-OZGG6TS7.js +0 -554
  732. package/dist/chunk-P5DGNIGZ.js +0 -773
  733. package/dist/chunk-PCSRHFRF.js +0 -75
  734. package/dist/chunk-PGDGX6PO.js +0 -178
  735. package/dist/chunk-PGMXITPB.js +0 -85
  736. package/dist/chunk-PHNLFMBS.js +0 -158
  737. package/dist/chunk-PJF47YJJ.js +0 -202
  738. package/dist/chunk-PMBZMVKE.js +0 -33
  739. package/dist/chunk-PNLVWZSM.js +0 -211
  740. package/dist/chunk-PQ7WJAKL.js +0 -74
  741. package/dist/chunk-PTLRNXWE.js +0 -200
  742. package/dist/chunk-PTSRBKQC.js +0 -118
  743. package/dist/chunk-PX64T6XV.js +0 -134
  744. package/dist/chunk-PYS63BC6.js +0 -138
  745. package/dist/chunk-QHPB7VSA.js +0 -111
  746. package/dist/chunk-QJQTLBT3.js +0 -73
  747. package/dist/chunk-QR74WLXN.js +0 -65
  748. package/dist/chunk-QZSIADFZ.js +0 -523
  749. package/dist/chunk-R2T4IUNB.js +0 -29
  750. package/dist/chunk-R6CFPY3F.js +0 -278
  751. package/dist/chunk-R6OBJ7LF.js +0 -131
  752. package/dist/chunk-R6WQLIFX.js +0 -73
  753. package/dist/chunk-R7QHNWYL.js +0 -1309
  754. package/dist/chunk-R7ZIFQ7D.js +0 -738
  755. package/dist/chunk-R7ZIFQ7D.js.map +0 -1
  756. package/dist/chunk-RCKXQ2RY.js +0 -3070
  757. package/dist/chunk-RCN3SVJC.js +0 -211
  758. package/dist/chunk-RDTZN6HR.js +0 -372
  759. package/dist/chunk-RET43Z3F.js +0 -43
  760. package/dist/chunk-REUQ464X.js +0 -898
  761. package/dist/chunk-RIOTQESW.js +0 -107
  762. package/dist/chunk-RPJC2JCE.js +0 -209
  763. package/dist/chunk-RT2GW3LO.js +0 -10035
  764. package/dist/chunk-RT2GW3LO.js.map +0 -1
  765. package/dist/chunk-RULIWGQ6.js +0 -2984
  766. package/dist/chunk-RWZ5XML5.js +0 -103
  767. package/dist/chunk-RYWPD5WU.js +0 -572
  768. package/dist/chunk-RYYBQ4PW.js +0 -129
  769. package/dist/chunk-S44ADSZG.js +0 -236
  770. package/dist/chunk-SB3LGY34.js +0 -27
  771. package/dist/chunk-SG4FA5CX.js +0 -33
  772. package/dist/chunk-SMCHRNUL.js +0 -129
  773. package/dist/chunk-SMSEI6VH.js +0 -184
  774. package/dist/chunk-SNACGK3Z.js +0 -177
  775. package/dist/chunk-SOZTO34S.js +0 -2553
  776. package/dist/chunk-SP7XRRGB.js +0 -428
  777. package/dist/chunk-STA75WRF.js +0 -383
  778. package/dist/chunk-SUO5NPEX.js +0 -318
  779. package/dist/chunk-T2NC7ALH.js +0 -333
  780. package/dist/chunk-T3OUZVHU.js +0 -250
  781. package/dist/chunk-T4YOQ6DF.js +0 -789
  782. package/dist/chunk-TGG3ODCS.js +0 -99
  783. package/dist/chunk-TLR2SX7T.js +0 -2317
  784. package/dist/chunk-TXCGPEWC.js +0 -243
  785. package/dist/chunk-TXCGPEWC.js.map +0 -1
  786. package/dist/chunk-TZGJPDZL.js +0 -259
  787. package/dist/chunk-U7KNZEMU.js +0 -271
  788. package/dist/chunk-UDDZDC2Q.js +0 -772
  789. package/dist/chunk-UFIETNB2.js +0 -469
  790. package/dist/chunk-UFRXYZCJ.js +0 -125
  791. package/dist/chunk-UILJ5INQ.js +0 -170
  792. package/dist/chunk-UJ4DLPYG.js +0 -449
  793. package/dist/chunk-UKDLZ76A.js +0 -2434
  794. package/dist/chunk-UMYCZQSL.js +0 -1870
  795. package/dist/chunk-UPRN4FBY.js +0 -38
  796. package/dist/chunk-UQBYKWGG.js +0 -311
  797. package/dist/chunk-UQR5RZ5I.js +0 -218
  798. package/dist/chunk-UWPSCSIZ.js +0 -57
  799. package/dist/chunk-UYLO2JP2.js +0 -158
  800. package/dist/chunk-V2YSF3MJ.js +0 -114
  801. package/dist/chunk-VAJQQKSG.js +0 -283
  802. package/dist/chunk-VDHWFRTL.js +0 -58
  803. package/dist/chunk-VLDKWGHD.js +0 -61
  804. package/dist/chunk-VLODMRE3.js +0 -138
  805. package/dist/chunk-VM6BM3NV.js +0 -389
  806. package/dist/chunk-VRVB2XSO.js +0 -117
  807. package/dist/chunk-W2PBDF4F.js +0 -231
  808. package/dist/chunk-W7BNYXRT.js +0 -296
  809. package/dist/chunk-WCA777NS.js +0 -1187
  810. package/dist/chunk-WDDAHRBC.js +0 -404
  811. package/dist/chunk-WEXKKIPB.js +0 -1024
  812. package/dist/chunk-WG7OVUCV.js +0 -401
  813. package/dist/chunk-WMW4AXVG.js +0 -570
  814. package/dist/chunk-WRMMZYZC.js +0 -931
  815. package/dist/chunk-WYICOILE.js +0 -50
  816. package/dist/chunk-WYNXSYTH.js +0 -532
  817. package/dist/chunk-X62OJCQW.js +0 -234
  818. package/dist/chunk-XBFNNP6B.js +0 -608
  819. package/dist/chunk-XDXPGA3N.js +0 -850
  820. package/dist/chunk-XDXPGA3N.js.map +0 -1
  821. package/dist/chunk-XFP3AIZO.js +0 -247
  822. package/dist/chunk-XSL5GKL3.js +0 -110
  823. package/dist/chunk-XVXYLCSC.js +0 -82
  824. package/dist/chunk-XX2J7H2J.js +0 -196
  825. package/dist/chunk-Y6CNWBV3.js +0 -264
  826. package/dist/chunk-YEFIICAN.js +0 -46
  827. package/dist/chunk-YJBRNXFL.js +0 -1184
  828. package/dist/chunk-YP4SNX4P.js +0 -220
  829. package/dist/chunk-YQ6AYWGT.js +0 -162
  830. package/dist/chunk-YWKJSF3R.js +0 -396
  831. package/dist/chunk-Z3EQ3XBB.js +0 -114
  832. package/dist/chunk-ZD67RM6G.js +0 -60
  833. package/dist/chunk-ZMCVED5L.js +0 -1185
  834. package/dist/chunk-ZOTNM76R.js +0 -42
  835. package/dist/chunk-ZP7BJXQ5.js +0 -113
  836. package/dist/chunk-ZRNDPAED.js +0 -274
  837. package/dist/chunk-ZUQKQP3T.js +0 -251
  838. package/dist/chunk-ZVT2KQTH.js +0 -48
  839. package/dist/chunk-ZXDIEGD5.js +0 -1019
  840. package/dist/computer-viewer-KLRAA56S.js +0 -21
  841. package/dist/connection-step-up-PWIIW3KK.js +0 -145
  842. package/dist/embedded-new-voice-P2RCFI3X.js +0 -25
  843. package/dist/embedded-voice-HY5F4D2I.js +0 -25
  844. package/dist/fleet-decision-row-UEXT7NAN.js +0 -361
  845. package/dist/model-policy-picker-menu-AAGNLTEG.js +0 -23
  846. package/dist/payment-page-card-MHTYJHCW.js +0 -226
  847. package/dist/platform-activity-row-7VAPGRZQ.js +0 -156
  848. package/dist/queue-surface-implementation-AE5P3PSA.js +0 -932
  849. package/dist/recorder-host-I53BQIRX.js +0 -80
  850. package/dist/sandbox-files-LGE7EDX2.js +0 -28
  851. package/dist/session-connect-cards-QNL7WRKJ.js +0 -27
  852. package/dist/session-realtime-ZMXMK5EV.js +0 -30
  853. package/dist/timeline-annotation-markers-5RICTVVW.js +0 -157
  854. package/dist/timeline-annotation-selection-ITAHBOFW.js +0 -208
  855. package/dist/timeline-annotations-dialog-7PGBTPVD.js +0 -283
  856. /package/dist/{browser-viewer-5DCULGWS.js.map → browser-viewer-EIEMRVFF.js.map} +0 -0
  857. /package/dist/{chat-interactive-block-ISMUKH3P.js.map → chat-interactive-block-FV37LWYZ.js.map} +0 -0
  858. /package/dist/{chunk-3AXHBU7K.js.map → chunk-2COBAJC7.js.map} +0 -0
  859. /package/dist/{chunk-UILJ5INQ.js.map → chunk-2HS3IUXE.js.map} +0 -0
  860. /package/dist/{chunk-W7BNYXRT.js.map → chunk-2JTMFYCT.js.map} +0 -0
  861. /package/dist/{chunk-V2YSF3MJ.js.map → chunk-2JXKP4M6.js.map} +0 -0
  862. /package/dist/{chunk-OE6XABJ3.js.map → chunk-2P5K7CBH.js.map} +0 -0
  863. /package/dist/{chunk-T3OUZVHU.js.map → chunk-2XGRHMRI.js.map} +0 -0
  864. /package/dist/{chunk-QR74WLXN.js.map → chunk-332BYSAZ.js.map} +0 -0
  865. /package/dist/{chunk-UYLO2JP2.js.map → chunk-3EM5GTP3.js.map} +0 -0
  866. /package/dist/{chunk-73P7NEOX.js.map → chunk-3L5ATO4A.js.map} +0 -0
  867. /package/dist/{chunk-RIOTQESW.js.map → chunk-3S3PJB7J.js.map} +0 -0
  868. /package/dist/{chunk-HYVRYGY3.js.map → chunk-3SBKYPNM.js.map} +0 -0
  869. /package/dist/{chunk-6QDXVH45.js.map → chunk-3Z7VA6ET.js.map} +0 -0
  870. /package/dist/{chunk-CBHZXVSI.js.map → chunk-43BRJBEV.js.map} +0 -0
  871. /package/dist/{chunk-LG3WCCUT.js.map → chunk-46LZO4ZO.js.map} +0 -0
  872. /package/dist/{chunk-UPRN4FBY.js.map → chunk-46ZC5VNC.js.map} +0 -0
  873. /package/dist/{chunk-4ZCTHNOA.js.map → chunk-4AH4EEHE.js.map} +0 -0
  874. /package/dist/{chunk-3B4D4BV7.js.map → chunk-4D3YJNVN.js.map} +0 -0
  875. /package/dist/{chunk-HE5BTYPR.js.map → chunk-4I4RTI4D.js.map} +0 -0
  876. /package/dist/{chunk-4YXA5UO3.js.map → chunk-4KASGJTF.js.map} +0 -0
  877. /package/dist/{chunk-HWDKTGNX.js.map → chunk-4RUKLIOF.js.map} +0 -0
  878. /package/dist/{chunk-MFYH4N6I.js.map → chunk-4UU7FN3I.js.map} +0 -0
  879. /package/dist/{chunk-DDCDQ4BF.js.map → chunk-4ZRNASBF.js.map} +0 -0
  880. /package/dist/{chunk-BOCDCQYX.js.map → chunk-5EJBPQI2.js.map} +0 -0
  881. /package/dist/{chunk-RPJC2JCE.js.map → chunk-5G4IGG7F.js.map} +0 -0
  882. /package/dist/{chunk-AZC5P5PV.js.map → chunk-5JAYZOAW.js.map} +0 -0
  883. /package/dist/{chunk-T4YOQ6DF.js.map → chunk-5JOKVDSR.js.map} +0 -0
  884. /package/dist/{chunk-ODR2Q4JQ.js.map → chunk-5MP3G7ZV.js.map} +0 -0
  885. /package/dist/{chunk-ZOTNM76R.js.map → chunk-5OVRMKP5.js.map} +0 -0
  886. /package/dist/{chunk-YJBRNXFL.js.map → chunk-5SGTRULO.js.map} +0 -0
  887. /package/dist/{chunk-RYWPD5WU.js.map → chunk-5SOL4INY.js.map} +0 -0
  888. /package/dist/{chunk-SB3LGY34.js.map → chunk-5Y34P32B.js.map} +0 -0
  889. /package/dist/{chunk-LTNBDO5B.js.map → chunk-62HIKJ5F.js.map} +0 -0
  890. /package/dist/{chunk-HWOYJOKK.js.map → chunk-62T2ZPD5.js.map} +0 -0
  891. /package/dist/{chunk-NSLCRIQ6.js.map → chunk-63VNZRLY.js.map} +0 -0
  892. /package/dist/{chunk-PMBZMVKE.js.map → chunk-6CDBX3XG.js.map} +0 -0
  893. /package/dist/{chunk-R6CFPY3F.js.map → chunk-6D3D2JWY.js.map} +0 -0
  894. /package/dist/{chunk-4DW5QEAP.js.map → chunk-6DOIINY4.js.map} +0 -0
  895. /package/dist/{chunk-E4SAFP76.js.map → chunk-6DQBUKGJ.js.map} +0 -0
  896. /package/dist/{chunk-OX234K6A.js.map → chunk-6SETNFNH.js.map} +0 -0
  897. /package/dist/{chunk-HXVKXFIC.js.map → chunk-6XYFMHNT.js.map} +0 -0
  898. /package/dist/{chunk-SG4FA5CX.js.map → chunk-6YU3WV2P.js.map} +0 -0
  899. /package/dist/{chunk-KKIJYI7N.js.map → chunk-6YUHDFOZ.js.map} +0 -0
  900. /package/dist/{chunk-ZMCVED5L.js.map → chunk-72EOXOR7.js.map} +0 -0
  901. /package/dist/{chunk-WYNXSYTH.js.map → chunk-72ND4ALI.js.map} +0 -0
  902. /package/dist/{chunk-DUZZB4C6.js.map → chunk-757LE32E.js.map} +0 -0
  903. /package/dist/{chunk-VLODMRE3.js.map → chunk-7S2S4MXR.js.map} +0 -0
  904. /package/dist/{chunk-PTLRNXWE.js.map → chunk-7SYCHMXS.js.map} +0 -0
  905. /package/dist/{chunk-BXKNGFX5.js.map → chunk-7TVAPQOV.js.map} +0 -0
  906. /package/dist/{chunk-EVHNQCEM.js.map → chunk-7UDLRDHK.js.map} +0 -0
  907. /package/dist/{chunk-HLNSIXSJ.js.map → chunk-7YLQCMZP.js.map} +0 -0
  908. /package/dist/{chunk-GGIPEZLL.js.map → chunk-A5GX3CAE.js.map} +0 -0
  909. /package/dist/{chunk-SUO5NPEX.js.map → chunk-A7EBV2EB.js.map} +0 -0
  910. /package/dist/{chunk-Z3EQ3XBB.js.map → chunk-AB5SPXUR.js.map} +0 -0
  911. /package/dist/{chunk-PJF47YJJ.js.map → chunk-AHVQGL5A.js.map} +0 -0
  912. /package/dist/{chunk-3Y2VSFYS.js.map → chunk-AI77ZKEV.js.map} +0 -0
  913. /package/dist/{chunk-ZXDIEGD5.js.map → chunk-AIX2D6RB.js.map} +0 -0
  914. /package/dist/{chunk-KDZ7WKYY.js.map → chunk-AVSIHP7Q.js.map} +0 -0
  915. /package/dist/{chunk-37J33BLN.js.map → chunk-AWK23Q32.js.map} +0 -0
  916. /package/dist/{chunk-G7TU7QDO.js.map → chunk-AYVWA6KD.js.map} +0 -0
  917. /package/dist/{chunk-SOZTO34S.js.map → chunk-AYZXE4IM.js.map} +0 -0
  918. /package/dist/{chunk-OMYNOB7U.js.map → chunk-AZGGSPTE.js.map} +0 -0
  919. /package/dist/{chunk-WRMMZYZC.js.map → chunk-B45TB4HY.js.map} +0 -0
  920. /package/dist/{chunk-YEFIICAN.js.map → chunk-BIUJHNVR.js.map} +0 -0
  921. /package/dist/{chunk-NYTKZQ2V.js.map → chunk-BJUOKUE5.js.map} +0 -0
  922. /package/dist/{chunk-J3GK2LZP.js.map → chunk-BPEEVMKH.js.map} +0 -0
  923. /package/dist/{chunk-PQ7WJAKL.js.map → chunk-BPHPAGYF.js.map} +0 -0
  924. /package/dist/{chunk-MTOWY5MX.js.map → chunk-BXMND6YU.js.map} +0 -0
  925. /package/dist/{chunk-VRVB2XSO.js.map → chunk-C6OM2SRG.js.map} +0 -0
  926. /package/dist/{chunk-R7QHNWYL.js.map → chunk-CIRCUDKF.js.map} +0 -0
  927. /package/dist/{chunk-3EQMXU5V.js.map → chunk-CLKR4UG3.js.map} +0 -0
  928. /package/dist/{chunk-OZGG6TS7.js.map → chunk-CPX6BHER.js.map} +0 -0
  929. /package/dist/{chunk-KZQDP2JM.js.map → chunk-CVC4RO7D.js.map} +0 -0
  930. /package/dist/{chunk-NKCK4LBK.js.map → chunk-D3YJAQGK.js.map} +0 -0
  931. /package/dist/{chunk-WEXKKIPB.js.map → chunk-DFQ72BLS.js.map} +0 -0
  932. /package/dist/{chunk-DRPIGAMM.js.map → chunk-DG65PJOZ.js.map} +0 -0
  933. /package/dist/{chunk-GMQFRX2V.js.map → chunk-DNAXAS5R.js.map} +0 -0
  934. /package/dist/{chunk-CNLR3MVZ.js.map → chunk-DO247ITS.js.map} +0 -0
  935. /package/dist/{chunk-IGVRNMXK.js.map → chunk-DONBARLL.js.map} +0 -0
  936. /package/dist/{chunk-IQKLWMIF.js.map → chunk-DTLXQ3ZU.js.map} +0 -0
  937. /package/dist/{chunk-ZRNDPAED.js.map → chunk-EAXTACI4.js.map} +0 -0
  938. /package/dist/{chunk-5G55HNJB.js.map → chunk-EDPH7AJH.js.map} +0 -0
  939. /package/dist/{chunk-BKYHS4IH.js.map → chunk-EFKQHCGJ.js.map} +0 -0
  940. /package/dist/{chunk-22NKV5QE.js.map → chunk-EILSPMVD.js.map} +0 -0
  941. /package/dist/{chunk-PNLVWZSM.js.map → chunk-EK7KIETS.js.map} +0 -0
  942. /package/dist/{chunk-IIUBCLH6.js.map → chunk-EMWT6GOK.js.map} +0 -0
  943. /package/dist/{chunk-TZGJPDZL.js.map → chunk-EO22NST7.js.map} +0 -0
  944. /package/dist/{chunk-DNNW2FSP.js.map → chunk-ER5MYLIE.js.map} +0 -0
  945. /package/dist/{chunk-2XQFDRP6.js.map → chunk-ES5HKVQF.js.map} +0 -0
  946. /package/dist/{chunk-QHPB7VSA.js.map → chunk-F26YBYAZ.js.map} +0 -0
  947. /package/dist/{chunk-3YLXGP2I.js.map → chunk-F6QP4GSK.js.map} +0 -0
  948. /package/dist/{chunk-NRRRO3NJ.js.map → chunk-F7QEO7M2.js.map} +0 -0
  949. /package/dist/{chunk-6TBA45QF.js.map → chunk-FJFGDLXB.js.map} +0 -0
  950. /package/dist/{chunk-LUUFLV27.js.map → chunk-FLLJ2WXW.js.map} +0 -0
  951. /package/dist/{chunk-KMZUIWL6.js.map → chunk-FMBJKMT4.js.map} +0 -0
  952. /package/dist/{chunk-7QORJTVI.js.map → chunk-FPN4I4CG.js.map} +0 -0
  953. /package/dist/{chunk-RCKXQ2RY.js.map → chunk-FUXFJTXL.js.map} +0 -0
  954. /package/dist/{chunk-5AHIKB3O.js.map → chunk-FXFOKD7A.js.map} +0 -0
  955. /package/dist/{chunk-PHNLFMBS.js.map → chunk-G6SSSX5R.js.map} +0 -0
  956. /package/dist/{chunk-XBFNNP6B.js.map → chunk-GBGCMHBB.js.map} +0 -0
  957. /package/dist/{chunk-HUKGLWAY.js.map → chunk-GIHE7U3Y.js.map} +0 -0
  958. /package/dist/{chunk-RDTZN6HR.js.map → chunk-GJ4GTYOD.js.map} +0 -0
  959. /package/dist/{chunk-BPD6VRVH.js.map → chunk-GLSDWNFV.js.map} +0 -0
  960. /package/dist/{chunk-DWW2MA3S.js.map → chunk-GMGAW3T6.js.map} +0 -0
  961. /package/dist/{chunk-RET43Z3F.js.map → chunk-GNGI6XFN.js.map} +0 -0
  962. /package/dist/{chunk-Y6CNWBV3.js.map → chunk-GO5VIAA7.js.map} +0 -0
  963. /package/dist/{chunk-BOP5TAUU.js.map → chunk-GSW4YHZE.js.map} +0 -0
  964. /package/dist/{chunk-644P2VLV.js.map → chunk-GUC6IWEY.js.map} +0 -0
  965. /package/dist/{chunk-4AUUNEQY.js.map → chunk-GWAY3SO5.js.map} +0 -0
  966. /package/dist/{chunk-4TTWUMDP.js.map → chunk-GXOTNT5D.js.map} +0 -0
  967. /package/dist/{chunk-OEGJWY2U.js.map → chunk-GZZCVF76.js.map} +0 -0
  968. /package/dist/{chunk-KUYTRUIE.js.map → chunk-H4VMHFOX.js.map} +0 -0
  969. /package/dist/{chunk-XSL5GKL3.js.map → chunk-HA5RFQAF.js.map} +0 -0
  970. /package/dist/{chunk-PTSRBKQC.js.map → chunk-HFROJDFQ.js.map} +0 -0
  971. /package/dist/{chunk-YP4SNX4P.js.map → chunk-HHFFPE67.js.map} +0 -0
  972. /package/dist/{chunk-RWZ5XML5.js.map → chunk-HJLHGXWL.js.map} +0 -0
  973. /package/dist/{chunk-RULIWGQ6.js.map → chunk-HKNMNL7B.js.map} +0 -0
  974. /package/dist/{chunk-AO27D7GY.js.map → chunk-HT7MBHLY.js.map} +0 -0
  975. /package/dist/{chunk-NPKFHO6N.js.map → chunk-I5FSUZVW.js.map} +0 -0
  976. /package/dist/{chunk-AXBSHKRP.js.map → chunk-IINQO425.js.map} +0 -0
  977. /package/dist/{chunk-MD27CX2K.js.map → chunk-IIXNEOK4.js.map} +0 -0
  978. /package/dist/{chunk-UQBYKWGG.js.map → chunk-IM3WA5AL.js.map} +0 -0
  979. /package/dist/{chunk-BJNSS4UV.js.map → chunk-IX4P4OGR.js.map} +0 -0
  980. /package/dist/{chunk-SMCHRNUL.js.map → chunk-IX5VHZYS.js.map} +0 -0
  981. /package/dist/{chunk-BSAKPNKY.js.map → chunk-JB3TSUZO.js.map} +0 -0
  982. /package/dist/{chunk-I5ZTAMDP.js.map → chunk-JIC6RLUB.js.map} +0 -0
  983. /package/dist/{chunk-KGTZGR4F.js.map → chunk-JNJIZCTN.js.map} +0 -0
  984. /package/dist/{chunk-7CLQ7RQV.js.map → chunk-JNV5ZPUV.js.map} +0 -0
  985. /package/dist/{chunk-OAEI3MUO.js.map → chunk-JPQFVR24.js.map} +0 -0
  986. /package/dist/{chunk-NNE73MK2.js.map → chunk-JPZVMXDP.js.map} +0 -0
  987. /package/dist/{chunk-3SKJO525.js.map → chunk-JVPF34MX.js.map} +0 -0
  988. /package/dist/{chunk-E4NQIEA3.js.map → chunk-KED67KAF.js.map} +0 -0
  989. /package/dist/{chunk-4T2KWNYX.js.map → chunk-KJ72GMZ2.js.map} +0 -0
  990. /package/dist/{chunk-PCSRHFRF.js.map → chunk-KTGKGHEA.js.map} +0 -0
  991. /package/dist/{chunk-NUZNJSL5.js.map → chunk-KU77XHWB.js.map} +0 -0
  992. /package/dist/{chunk-EO7NZKIX.js.map → chunk-KXBLLFOO.js.map} +0 -0
  993. /package/dist/{chunk-VLDKWGHD.js.map → chunk-L6WVCO6D.js.map} +0 -0
  994. /package/dist/{chunk-QJQTLBT3.js.map → chunk-LPEFULJY.js.map} +0 -0
  995. /package/dist/{chunk-52BUMJQB.js.map → chunk-LRMGPO7E.js.map} +0 -0
  996. /package/dist/{chunk-N4AHWDN2.js.map → chunk-LVKTKORH.js.map} +0 -0
  997. /package/dist/{chunk-TGG3ODCS.js.map → chunk-MCPKUVMQ.js.map} +0 -0
  998. /package/dist/{chunk-KYDLVMKA.js.map → chunk-MFLU3466.js.map} +0 -0
  999. /package/dist/{chunk-ZD67RM6G.js.map → chunk-MIUJ3EH5.js.map} +0 -0
  1000. /package/dist/{chunk-KLOB3IXX.js.map → chunk-MIUMNTIJ.js.map} +0 -0
  1001. /package/dist/{chunk-ZP7BJXQ5.js.map → chunk-ML46TXRM.js.map} +0 -0
  1002. /package/dist/{chunk-M5FX5KH5.js.map → chunk-MO3XJQN2.js.map} +0 -0
  1003. /package/dist/{chunk-UQR5RZ5I.js.map → chunk-MQRHTOQ2.js.map} +0 -0
  1004. /package/dist/{chunk-5ERDSF2C.js.map → chunk-MVYQDBE6.js.map} +0 -0
  1005. /package/dist/{chunk-XX2J7H2J.js.map → chunk-NPBEUU22.js.map} +0 -0
  1006. /package/dist/{chunk-PGDGX6PO.js.map → chunk-NSXKGS2K.js.map} +0 -0
  1007. /package/dist/{chunk-TLR2SX7T.js.map → chunk-NUEFORM6.js.map} +0 -0
  1008. /package/dist/{chunk-LSQP22UI.js.map → chunk-NZOFNQNC.js.map} +0 -0
  1009. /package/dist/{chunk-RCN3SVJC.js.map → chunk-OATXCLTY.js.map} +0 -0
  1010. /package/dist/{chunk-53ZK2JFE.js.map → chunk-OG3ELROW.js.map} +0 -0
  1011. /package/dist/{chunk-YQ6AYWGT.js.map → chunk-OI4WS7FW.js.map} +0 -0
  1012. /package/dist/{chunk-XVXYLCSC.js.map → chunk-OITGZUDC.js.map} +0 -0
  1013. /package/dist/{chunk-T2NC7ALH.js.map → chunk-OKD2LBMK.js.map} +0 -0
  1014. /package/dist/{chunk-PX64T6XV.js.map → chunk-OSA4CGST.js.map} +0 -0
  1015. /package/dist/{chunk-WG7OVUCV.js.map → chunk-OXYAKUFU.js.map} +0 -0
  1016. /package/dist/{chunk-YWKJSF3R.js.map → chunk-OYMSMU5O.js.map} +0 -0
  1017. /package/dist/{chunk-OHJXHKQT.js.map → chunk-P4NZ72KY.js.map} +0 -0
  1018. /package/dist/{chunk-4D4XXJJJ.js.map → chunk-PBYL2VIM.js.map} +0 -0
  1019. /package/dist/{chunk-7M57K6K5.js.map → chunk-PDW3OOSZ.js.map} +0 -0
  1020. /package/dist/{chunk-QZSIADFZ.js.map → chunk-PGRKTQIW.js.map} +0 -0
  1021. /package/dist/{chunk-4PG2BEQA.js.map → chunk-PPQJIVGM.js.map} +0 -0
  1022. /package/dist/{chunk-UFRXYZCJ.js.map → chunk-PYMQM65Y.js.map} +0 -0
  1023. /package/dist/{chunk-G65TM5FL.js.map → chunk-Q273Q33U.js.map} +0 -0
  1024. /package/dist/{chunk-62AHHCFV.js.map → chunk-Q4CLS2HL.js.map} +0 -0
  1025. /package/dist/{chunk-PGMXITPB.js.map → chunk-QA5UNVHD.js.map} +0 -0
  1026. /package/dist/{chunk-SP7XRRGB.js.map → chunk-QFOBUA2J.js.map} +0 -0
  1027. /package/dist/{chunk-LRE7WH6D.js.map → chunk-QLIM4D56.js.map} +0 -0
  1028. /package/dist/{chunk-HWOJ7JSO.js.map → chunk-QMQF5U2D.js.map} +0 -0
  1029. /package/dist/{chunk-J4OOKDRV.js.map → chunk-QNOWKKZ4.js.map} +0 -0
  1030. /package/dist/{chunk-ATQ3O5E6.js.map → chunk-QPOUPVPD.js.map} +0 -0
  1031. /package/dist/{chunk-ZVT2KQTH.js.map → chunk-QTJAQ6DS.js.map} +0 -0
  1032. /package/dist/{chunk-WDDAHRBC.js.map → chunk-QUOFP3G7.js.map} +0 -0
  1033. /package/dist/{chunk-R2T4IUNB.js.map → chunk-QVOTPOXK.js.map} +0 -0
  1034. /package/dist/{chunk-SMSEI6VH.js.map → chunk-QYZ5RVGM.js.map} +0 -0
  1035. /package/dist/{chunk-CGWLKFQF.js.map → chunk-R7CVDKRN.js.map} +0 -0
  1036. /package/dist/{chunk-MPW67ODY.js.map → chunk-RB7MXNZD.js.map} +0 -0
  1037. /package/dist/{chunk-EVRLHFIG.js.map → chunk-RDZQFZOQ.js.map} +0 -0
  1038. /package/dist/{chunk-JY4ACIKP.js.map → chunk-RIHKEGWS.js.map} +0 -0
  1039. /package/dist/{chunk-UWPSCSIZ.js.map → chunk-ROSB7GF6.js.map} +0 -0
  1040. /package/dist/{chunk-2O5EDTVB.js.map → chunk-RP3YMYCX.js.map} +0 -0
  1041. /package/dist/{chunk-U7KNZEMU.js.map → chunk-RPHXJHNX.js.map} +0 -0
  1042. /package/dist/{chunk-IQWAFZGW.js.map → chunk-RVC3M66H.js.map} +0 -0
  1043. /package/dist/{chunk-VAJQQKSG.js.map → chunk-S3OTJAAC.js.map} +0 -0
  1044. /package/dist/{chunk-DWH35C5X.js.map → chunk-SBWPMVRN.js.map} +0 -0
  1045. /package/dist/{chunk-PYS63BC6.js.map → chunk-SERECSAR.js.map} +0 -0
  1046. /package/dist/{chunk-L22AVXXW.js.map → chunk-SHSEF3GJ.js.map} +0 -0
  1047. /package/dist/{chunk-UDDZDC2Q.js.map → chunk-SMS2M3RG.js.map} +0 -0
  1048. /package/dist/{chunk-SNACGK3Z.js.map → chunk-SRDHDIRQ.js.map} +0 -0
  1049. /package/dist/{chunk-VM6BM3NV.js.map → chunk-SXRYA7NN.js.map} +0 -0
  1050. /package/dist/{chunk-WCA777NS.js.map → chunk-SYA3WYG4.js.map} +0 -0
  1051. /package/dist/{chunk-HUTQJY3F.js.map → chunk-SYYFA7W7.js.map} +0 -0
  1052. /package/dist/{chunk-5ABIZ7YT.js.map → chunk-T2QDSTBH.js.map} +0 -0
  1053. /package/dist/{chunk-ZUQKQP3T.js.map → chunk-TFSCGFYV.js.map} +0 -0
  1054. /package/dist/{chunk-CGEAOUXW.js.map → chunk-TGCKZOSX.js.map} +0 -0
  1055. /package/dist/{chunk-4WKITG7P.js.map → chunk-THILLYQM.js.map} +0 -0
  1056. /package/dist/{chunk-34XY4PWB.js.map → chunk-TI6LGUEZ.js.map} +0 -0
  1057. /package/dist/{chunk-MRNOTVGF.js.map → chunk-TSY6YZL2.js.map} +0 -0
  1058. /package/dist/{chunk-3Y7IJPHB.js.map → chunk-TW2RHTLH.js.map} +0 -0
  1059. /package/dist/{chunk-FWRKCWQO.js.map → chunk-TWA5G277.js.map} +0 -0
  1060. /package/dist/{chunk-XFP3AIZO.js.map → chunk-TZZ2S4XI.js.map} +0 -0
  1061. /package/dist/{chunk-VDHWFRTL.js.map → chunk-U5D3K53R.js.map} +0 -0
  1062. /package/dist/{chunk-5DEP55DK.js.map → chunk-UECD27LX.js.map} +0 -0
  1063. /package/dist/{chunk-ABO54U65.js.map → chunk-UFJDETKG.js.map} +0 -0
  1064. /package/dist/{chunk-WMW4AXVG.js.map → chunk-UHCFYX4I.js.map} +0 -0
  1065. /package/dist/{chunk-REUQ464X.js.map → chunk-UHTURYJO.js.map} +0 -0
  1066. /package/dist/{chunk-FAVXYNTK.js.map → chunk-UJH63JT3.js.map} +0 -0
  1067. /package/dist/{chunk-OYJ7KP6H.js.map → chunk-UOLDS6S5.js.map} +0 -0
  1068. /package/dist/{chunk-EQSANTUC.js.map → chunk-UUE3OGXI.js.map} +0 -0
  1069. /package/dist/{chunk-OJE3WTHK.js.map → chunk-UUNJ2E57.js.map} +0 -0
  1070. /package/dist/{chunk-MEUAI3B7.js.map → chunk-UYQVWRAH.js.map} +0 -0
  1071. /package/dist/{chunk-X62OJCQW.js.map → chunk-UYWVK7JQ.js.map} +0 -0
  1072. /package/dist/{chunk-M2KDPKQC.js.map → chunk-UYWWUEL4.js.map} +0 -0
  1073. /package/dist/{chunk-NABGUV6O.js.map → chunk-V4CQKX5H.js.map} +0 -0
  1074. /package/dist/{chunk-ODWNT3XC.js.map → chunk-V4QM7GDQ.js.map} +0 -0
  1075. /package/dist/{chunk-FRDJUZ6E.js.map → chunk-V5Y74WII.js.map} +0 -0
  1076. /package/dist/{chunk-RYYBQ4PW.js.map → chunk-VGGZLUQK.js.map} +0 -0
  1077. /package/dist/{chunk-L5AQCKRR.js.map → chunk-VGX636MB.js.map} +0 -0
  1078. /package/dist/{chunk-P5DGNIGZ.js.map → chunk-VGZLFQO2.js.map} +0 -0
  1079. /package/dist/{chunk-HWDHA4KS.js.map → chunk-VJWZATNF.js.map} +0 -0
  1080. /package/dist/{chunk-WYICOILE.js.map → chunk-VMWCIC2N.js.map} +0 -0
  1081. /package/dist/{chunk-3QUDVXDR.js.map → chunk-VPWKTIU5.js.map} +0 -0
  1082. /package/dist/{chunk-UFIETNB2.js.map → chunk-VXOLG6YB.js.map} +0 -0
  1083. /package/dist/{chunk-NH6OLIQD.js.map → chunk-W2NAU5VB.js.map} +0 -0
  1084. /package/dist/{chunk-OJNZTTQE.js.map → chunk-WGORKMR3.js.map} +0 -0
  1085. /package/dist/{chunk-DK5L6E4G.js.map → chunk-WMIDELSJ.js.map} +0 -0
  1086. /package/dist/{chunk-STA75WRF.js.map → chunk-WSOSGL2G.js.map} +0 -0
  1087. /package/dist/{chunk-2R7AOT3Y.js.map → chunk-WXUUOM4X.js.map} +0 -0
  1088. /package/dist/{chunk-UMYCZQSL.js.map → chunk-X2OWM2ME.js.map} +0 -0
  1089. /package/dist/{chunk-B6YDINPE.js.map → chunk-X6UMGG4T.js.map} +0 -0
  1090. /package/dist/{chunk-CPN7JXYV.js.map → chunk-XDXKB25W.js.map} +0 -0
  1091. /package/dist/{chunk-W2PBDF4F.js.map → chunk-XE4PHI74.js.map} +0 -0
  1092. /package/dist/{chunk-R6WQLIFX.js.map → chunk-XHF2XNU5.js.map} +0 -0
  1093. /package/dist/{chunk-IHNCZONS.js.map → chunk-XLJ4SQFS.js.map} +0 -0
  1094. /package/dist/{chunk-UKDLZ76A.js.map → chunk-XOD4FX6M.js.map} +0 -0
  1095. /package/dist/{chunk-OCWCZRVU.js.map → chunk-XODQ2GPF.js.map} +0 -0
  1096. /package/dist/{chunk-MVLHO6AU.js.map → chunk-XT54RTAM.js.map} +0 -0
  1097. /package/dist/{chunk-R6OBJ7LF.js.map → chunk-YAVW5OJ5.js.map} +0 -0
  1098. /package/dist/{chunk-4SW3EUNM.js.map → chunk-YDQHFJM2.js.map} +0 -0
  1099. /package/dist/{chunk-HI6TPRY5.js.map → chunk-YH6O6OQ6.js.map} +0 -0
  1100. /package/dist/{chunk-25SCFA2X.js.map → chunk-YIKPC2QP.js.map} +0 -0
  1101. /package/dist/{chunk-4KF5I3H5.js.map → chunk-ZD7PKYC4.js.map} +0 -0
  1102. /package/dist/{chunk-ANCI6T7S.js.map → chunk-ZEQYHEWP.js.map} +0 -0
  1103. /package/dist/{chunk-GKA5LFYR.js.map → chunk-ZP3QCPYG.js.map} +0 -0
  1104. /package/dist/{chunk-6Y3EFN4Q.js.map → chunk-ZRVUCTSI.js.map} +0 -0
  1105. /package/dist/{chunk-UJ4DLPYG.js.map → chunk-ZSI3ITRK.js.map} +0 -0
  1106. /package/dist/{chunk-S44ADSZG.js.map → chunk-ZZMEQCIZ.js.map} +0 -0
  1107. /package/dist/{computer-viewer-KLRAA56S.js.map → computer-viewer-ZBY3BPYW.js.map} +0 -0
  1108. /package/dist/{connection-step-up-PWIIW3KK.js.map → connection-step-up-JQ4OFSQN.js.map} +0 -0
  1109. /package/dist/{embedded-new-voice-P2RCFI3X.js.map → embedded-new-voice-ZB5XLKLU.js.map} +0 -0
  1110. /package/dist/{embedded-voice-HY5F4D2I.js.map → embedded-voice-MZJISDCS.js.map} +0 -0
  1111. /package/dist/{fleet-decision-row-UEXT7NAN.js.map → fleet-decision-row-LG3SYVR3.js.map} +0 -0
  1112. /package/dist/{model-policy-picker-menu-AAGNLTEG.js.map → model-policy-picker-menu-5Y72PLNF.js.map} +0 -0
  1113. /package/dist/{payment-page-card-MHTYJHCW.js.map → payment-page-card-YPSXRHBA.js.map} +0 -0
  1114. /package/dist/{platform-activity-row-7VAPGRZQ.js.map → platform-activity-row-ZU4MEBNK.js.map} +0 -0
  1115. /package/dist/{queue-surface-implementation-AE5P3PSA.js.map → queue-surface-implementation-6Q25RPH6.js.map} +0 -0
  1116. /package/dist/{recorder-host-I53BQIRX.js.map → recorder-host-JD4GWJ2Z.js.map} +0 -0
  1117. /package/dist/{sandbox-files-LGE7EDX2.js.map → sandbox-files-HCLEEJMU.js.map} +0 -0
  1118. /package/dist/{session-connect-cards-QNL7WRKJ.js.map → session-connect-cards-DRKEN3Z4.js.map} +0 -0
  1119. /package/dist/{session-realtime-ZMXMK5EV.js.map → session-realtime-IZOTTRH6.js.map} +0 -0
  1120. /package/dist/{timeline-annotation-markers-5RICTVVW.js.map → timeline-annotation-markers-WWXNJOXI.js.map} +0 -0
  1121. /package/dist/{timeline-annotation-selection-ITAHBOFW.js.map → timeline-annotation-selection-ZKRIQFIQ.js.map} +0 -0
  1122. /package/dist/{timeline-annotations-dialog-7PGBTPVD.js.map → timeline-annotations-dialog-4IMKTOXJ.js.map} +0 -0
@@ -0,0 +1,3321 @@
1
+ "use client";
2
+ import {
3
+ OPEN_WORKSTREAM_CONTROL_EVENT
4
+ } from "./chunk-3IWPC6O3.js";
5
+ import {
6
+ useCalmServiceFailure
7
+ } from "./chunk-SVKPSCTH.js";
8
+ import {
9
+ useVoiceInput
10
+ } from "./chunk-W2NAU5VB.js";
11
+ import {
12
+ Tooltip,
13
+ TooltipContent,
14
+ TooltipProvider,
15
+ TooltipTrigger
16
+ } from "./chunk-6IWKHHRS.js";
17
+ import {
18
+ ShimmerText
19
+ } from "./chunk-HZPCSRSB.js";
20
+ import {
21
+ useLightboxOptional
22
+ } from "./chunk-UHTURYJO.js";
23
+ import {
24
+ shouldRecallQueuedOnKey
25
+ } from "./chunk-2NPJEEJ5.js";
26
+ import {
27
+ readStoredFilePreviewUrl,
28
+ useStoredFiles
29
+ } from "./chunk-PSXDRW2R.js";
30
+ import {
31
+ shouldSteerOnKey,
32
+ shouldSubmitOnKey
33
+ } from "./chunk-XODQ2GPF.js";
34
+ import {
35
+ OPENGENI_UPDATING_ACTION_NOTICE,
36
+ OPENGENI_UPDATING_NOTICE,
37
+ isActionFailure
38
+ } from "./chunk-5AIMVW6Y.js";
39
+ import {
40
+ useErrorMessage
41
+ } from "./chunk-CM7LVUKC.js";
42
+ import {
43
+ COMPOSER_VOICE_INPUT_START_EVENT,
44
+ ComposerFooterSignalProvider,
45
+ composerVoiceEventScope,
46
+ useComposerFooterSignal,
47
+ useComposerFooterSignalState
48
+ } from "./chunk-O664PL2U.js";
49
+ import {
50
+ groupPickerRowsByBillingClass,
51
+ projectClientModelRows
52
+ } from "./chunk-4VEIBNC2.js";
53
+ import {
54
+ ComposerResponsiveContext
55
+ } from "./chunk-XEA5BCMA.js";
56
+ import {
57
+ cn
58
+ } from "./chunk-TXS65BB2.js";
59
+ import {
60
+ singleSendText,
61
+ useOpenGeniText
62
+ } from "./chunk-KVPQUADA.js";
63
+ import {
64
+ defaultChatComposerMessages
65
+ } from "./chunk-EYGBHGY5.js";
66
+ import {
67
+ composerSubmissionErrorMessage
68
+ } from "./chunk-UIK52VL4.js";
69
+
70
+ // src/commands/registry.ts
71
+ import { formatErrorMessage } from "@opengeni/sdk";
72
+ function parseCommandLine(value) {
73
+ if (value[0] !== "/") {
74
+ return null;
75
+ }
76
+ const body = value.slice(1);
77
+ const firstSpace = body.indexOf(" ");
78
+ if (firstSpace === -1) {
79
+ return { name: body, rest: "", hasTrailingSpace: false, args: [] };
80
+ }
81
+ const name = body.slice(0, firstSpace);
82
+ const rest = body.slice(firstSpace + 1);
83
+ return {
84
+ name,
85
+ rest,
86
+ hasTrailingSpace: true,
87
+ args: rest.split(/\s+/).filter((token) => token.length > 0)
88
+ };
89
+ }
90
+ var PERMISSION_SUPERUSER = "workspace:admin";
91
+ function hasPermission(required, permissions) {
92
+ if (!required) {
93
+ return true;
94
+ }
95
+ return permissions.includes(required) || permissions.includes(PERMISSION_SUPERUSER);
96
+ }
97
+ function matchCommand(commands, value) {
98
+ const parsed = parseCommandLine(value);
99
+ if (!parsed) {
100
+ return null;
101
+ }
102
+ const token = parsed.name.toLowerCase();
103
+ return commands.find((command) => command.name === token || command.aliases?.includes(token)) ?? null;
104
+ }
105
+ function filterCommands(commands, token, ctx) {
106
+ const needle = token.toLowerCase();
107
+ return commands.filter((command) => {
108
+ if (!hasPermission(command.permission, ctx.permissions)) {
109
+ return false;
110
+ }
111
+ if (command.available && !command.available(ctx)) {
112
+ return false;
113
+ }
114
+ if (needle.length === 0) {
115
+ return true;
116
+ }
117
+ return command.name.startsWith(needle) || (command.aliases?.some((alias) => alias.startsWith(needle)) ?? false);
118
+ });
119
+ }
120
+ function argHint(args) {
121
+ if (!args || args.length === 0) {
122
+ return "";
123
+ }
124
+ return args.map((arg) => {
125
+ const label = arg.oneOf ? arg.oneOf.join("|") : arg.name;
126
+ return arg.required ? `<${label}>` : `[${label}]`;
127
+ }).join(" ");
128
+ }
129
+ function firstMissingRequiredArg(command, args) {
130
+ const required = (command.args ?? []).filter((arg) => arg.required);
131
+ for (let i = 0; i < required.length; i += 1) {
132
+ const value = args[i];
133
+ if (value === void 0 || value.length === 0) {
134
+ return required[i] ?? null;
135
+ }
136
+ }
137
+ return null;
138
+ }
139
+ function requireSession(t, ctx) {
140
+ if (!ctx.sessionId) {
141
+ throw new Error(t("commands.registry.noActiveSessionYetStart"));
142
+ }
143
+ return ctx.sessionId;
144
+ }
145
+ var hasSession = (ctx) => ctx.sessionId !== null;
146
+ var defaultCommands = (t) => [
147
+ {
148
+ name: "help",
149
+ aliases: ["?"],
150
+ description: t("commands.registry.showAvailableCommands"),
151
+ run: (_args, ctx) => {
152
+ ctx.openHelp();
153
+ return { status: "ok" };
154
+ }
155
+ },
156
+ {
157
+ name: "clear-view",
158
+ description: t("commands.registry.clearTheLocalTimelineView"),
159
+ run: (_args, ctx) => {
160
+ const cleared = ctx.clearView();
161
+ if (!cleared) {
162
+ return {
163
+ status: "error",
164
+ message: t("commands.registry.thisViewCanTBe")
165
+ };
166
+ }
167
+ return { status: "ok", message: t("commands.registry.localViewCleared") };
168
+ }
169
+ },
170
+ {
171
+ name: "goal",
172
+ description: t("commands.registry.pauseOrResumeTheSession"),
173
+ permission: "sessions:control",
174
+ available: hasSession,
175
+ args: [
176
+ { name: "action", required: true, oneOf: ["pause", "resume"], description: "pause | resume" }
177
+ ],
178
+ run: async (args, ctx) => {
179
+ const sessionId = requireSession(t, ctx);
180
+ const action = args[0];
181
+ if (action !== "pause" && action !== "resume") {
182
+ return { status: "error", message: "Usage: /goal pause | /goal resume" };
183
+ }
184
+ try {
185
+ await ctx.client.updateGoal(ctx.workspaceId, sessionId, {
186
+ status: action === "pause" ? "paused" : "active"
187
+ });
188
+ return {
189
+ status: "ok",
190
+ message: action === "pause" ? t("commands.registry.goalPaused") : t("commands.registry.goalResumed")
191
+ };
192
+ } catch (cause) {
193
+ return {
194
+ status: "error",
195
+ message: commandErrorMessage(ctx, cause, goalErrorMessage(t, cause, action))
196
+ };
197
+ }
198
+ }
199
+ },
200
+ {
201
+ name: "compact",
202
+ description: t("commands.registry.compactTheConversationContextNow"),
203
+ permission: "sessions:control",
204
+ available: hasSession,
205
+ run: async (_args, ctx) => {
206
+ const sessionId = requireSession(t, ctx);
207
+ try {
208
+ const result = await ctx.client.compactSessionContext(ctx.workspaceId, sessionId);
209
+ return { status: "ok", message: result.message };
210
+ } catch (cause) {
211
+ return { status: "error", message: commandErrorMessage(ctx, cause) };
212
+ }
213
+ }
214
+ },
215
+ {
216
+ name: "clear",
217
+ description: t("commands.registry.clearTheConversationContextDestructive"),
218
+ permission: "sessions:control",
219
+ danger: true,
220
+ available: hasSession,
221
+ run: async (_args, ctx) => {
222
+ const sessionId = requireSession(t, ctx);
223
+ const confirmed = await ctx.confirm();
224
+ if (!confirmed) {
225
+ return { status: "ok", keepDraft: true };
226
+ }
227
+ try {
228
+ await ctx.client.clearSessionContext(ctx.workspaceId, sessionId);
229
+ return { status: "ok", message: t("commands.registry.contextCleared") };
230
+ } catch (cause) {
231
+ return {
232
+ status: "error",
233
+ message: commandErrorMessage(ctx, cause, clearErrorMessage(t, cause))
234
+ };
235
+ }
236
+ }
237
+ }
238
+ ];
239
+ function commandErrorMessage(ctx, cause, message = formatErrorMessage(cause)) {
240
+ return ctx.formatError?.(cause, message) || message;
241
+ }
242
+ function statusCode(cause) {
243
+ if (cause && typeof cause === "object" && "status" in cause && typeof cause.status === "number") {
244
+ return cause.status;
245
+ }
246
+ return void 0;
247
+ }
248
+ function goalErrorMessage(t, cause, action) {
249
+ const code = statusCode(cause);
250
+ if (code === 404) {
251
+ return t("commands.registry.thisSessionHasNoGoal");
252
+ }
253
+ if (code === 409) {
254
+ return action === "resume" ? t("commands.registry.onlyAPausedGoalCan") : t("commands.registry.goalIsAlreadyInA");
255
+ }
256
+ return formatErrorMessage(cause);
257
+ }
258
+ function clearErrorMessage(t, cause) {
259
+ if (statusCode(cause) === 409) {
260
+ return t("commands.registry.pauseTheSessionAndWait");
261
+ }
262
+ return formatErrorMessage(cause);
263
+ }
264
+
265
+ // src/hooks/use-slash-commands.ts
266
+ import { useCallback, useMemo, useRef, useState } from "react";
267
+ function useSlashCommands(options) {
268
+ const formatError = useErrorMessage();
269
+ const { commands, context, handlers, value, setValue } = options;
270
+ const [highlight, setHighlight] = useState(0);
271
+ const [dismissedValue, setDismissedValue] = useState(null);
272
+ const dismissed = dismissedValue !== null && dismissedValue === value;
273
+ const navigatedRef = useRef(false);
274
+ const navTokenRef = useRef(value);
275
+ if (navTokenRef.current !== value) {
276
+ navTokenRef.current = value;
277
+ navigatedRef.current = false;
278
+ }
279
+ const parsed = useMemo(() => parseCommandLine(value), [value]);
280
+ const filterCtx = useMemo(
281
+ () => ({
282
+ sessionId: context?.sessionId ?? null,
283
+ status: context?.status ?? null,
284
+ permissions: context?.permissions ?? []
285
+ }),
286
+ [context?.sessionId, context?.status, context?.permissions]
287
+ );
288
+ const activeCommand = useMemo(() => {
289
+ if (!parsed || !parsed.hasTrailingSpace) {
290
+ return null;
291
+ }
292
+ return matchCommand(commands, value);
293
+ }, [commands, value, parsed]);
294
+ const items = useMemo(() => {
295
+ if (!parsed) {
296
+ return [];
297
+ }
298
+ if (activeCommand) {
299
+ return [activeCommand];
300
+ }
301
+ return filterCommands(commands, parsed.name, filterCtx);
302
+ }, [commands, parsed, activeCommand, filterCtx]);
303
+ const open = parsed !== null && items.length > 0 && !dismissed;
304
+ const isCommandDraft = parsed !== null && items.length > 0;
305
+ const clampedHighlight = items.length === 0 ? 0 : Math.min(highlight, items.length - 1);
306
+ const activeArgHint = activeCommand ? argHint(activeCommand.args) : "";
307
+ const buildContext = useCallback(
308
+ (command) => {
309
+ if (!context) {
310
+ return null;
311
+ }
312
+ return { ...context, ...handlers, formatError, confirm: () => handlers.confirm(command) };
313
+ },
314
+ [context, handlers, formatError]
315
+ );
316
+ const execute = useCallback(
317
+ async (command, args) => {
318
+ const ctx = buildContext(command);
319
+ if (!ctx) {
320
+ return;
321
+ }
322
+ try {
323
+ const result = await command.run(args, ctx);
324
+ if (result.message) {
325
+ ctx.notice({ tone: result.status === "ok" ? "ok" : "error", message: result.message });
326
+ }
327
+ if (result.status === "ok" && !result.keepDraft) {
328
+ setValue("");
329
+ }
330
+ } catch (cause) {
331
+ ctx.notice({ tone: "error", message: formatError(cause) });
332
+ }
333
+ },
334
+ [buildContext, setValue, formatError]
335
+ );
336
+ const autocomplete = useCallback(
337
+ (command) => {
338
+ setValue(`/${command.name} `);
339
+ setHighlight(0);
340
+ },
341
+ [setValue]
342
+ );
343
+ const autocompleteHighlighted = useCallback(() => {
344
+ const command = items[clampedHighlight];
345
+ if (command) {
346
+ autocomplete(command);
347
+ }
348
+ }, [items, clampedHighlight, autocomplete]);
349
+ const runningRef = useRef(false);
350
+ const runResolved = useCallback(
351
+ async (command, executionOptions) => {
352
+ if (!parsed || runningRef.current) {
353
+ return;
354
+ }
355
+ runningRef.current = true;
356
+ try {
357
+ const explicit = executionOptions?.explicit ?? false;
358
+ const nameMatchesToken = command.name === parsed.name.toLowerCase() || (command.aliases?.includes(parsed.name.toLowerCase()) ?? false);
359
+ if (!explicit && !activeCommand && !nameMatchesToken && !parsed.hasTrailingSpace) {
360
+ autocomplete(command);
361
+ return;
362
+ }
363
+ const args = nameMatchesToken || parsed.hasTrailingSpace ? parsed.args : [];
364
+ const missing = firstMissingRequiredArg(command, args);
365
+ if (missing) {
366
+ if (!parsed.hasTrailingSpace) {
367
+ autocomplete(command);
368
+ }
369
+ return;
370
+ }
371
+ await execute(command, args);
372
+ } finally {
373
+ runningRef.current = false;
374
+ }
375
+ },
376
+ [parsed, activeCommand, autocomplete, execute]
377
+ );
378
+ const runHighlighted = useCallback(async () => {
379
+ if (!parsed) {
380
+ return;
381
+ }
382
+ if (navigatedRef.current && !activeCommand) {
383
+ const highlighted = items[clampedHighlight];
384
+ if (highlighted) {
385
+ await runResolved(highlighted, { explicit: true });
386
+ }
387
+ return;
388
+ }
389
+ const token = parsed.name.toLowerCase();
390
+ const exact = items.find((item) => item.name === token || item.aliases?.includes(token));
391
+ const command = activeCommand ?? exact ?? items[clampedHighlight];
392
+ if (!command) {
393
+ return;
394
+ }
395
+ await runResolved(command);
396
+ }, [parsed, activeCommand, items, clampedHighlight, runResolved]);
397
+ const runAt = useCallback(
398
+ async (index) => {
399
+ const command = items[index];
400
+ if (!command) {
401
+ return;
402
+ }
403
+ await runResolved(command, { explicit: true });
404
+ },
405
+ [items, runResolved]
406
+ );
407
+ const onKeyDown = useCallback(
408
+ (event) => {
409
+ if (!open) {
410
+ return false;
411
+ }
412
+ switch (event.key) {
413
+ case "ArrowDown": {
414
+ event.preventDefault();
415
+ navigatedRef.current = true;
416
+ setHighlight(
417
+ (current) => items.length === 0 ? 0 : (Math.min(current, items.length - 1) + 1) % items.length
418
+ );
419
+ return true;
420
+ }
421
+ case "ArrowUp": {
422
+ event.preventDefault();
423
+ navigatedRef.current = true;
424
+ setHighlight((current) => {
425
+ const base = Math.min(current, items.length - 1);
426
+ return items.length === 0 ? 0 : (base - 1 + items.length) % items.length;
427
+ });
428
+ return true;
429
+ }
430
+ case "Tab": {
431
+ event.preventDefault();
432
+ autocompleteHighlighted();
433
+ return true;
434
+ }
435
+ case "Enter": {
436
+ if (event.shiftKey || event.nativeEvent?.isComposing) {
437
+ return false;
438
+ }
439
+ event.preventDefault();
440
+ void runHighlighted();
441
+ return true;
442
+ }
443
+ case "Escape": {
444
+ event.preventDefault();
445
+ setDismissedValue(value);
446
+ return true;
447
+ }
448
+ default:
449
+ return false;
450
+ }
451
+ },
452
+ [open, items, autocompleteHighlighted, runHighlighted, value]
453
+ );
454
+ return {
455
+ open,
456
+ isCommandDraft,
457
+ items,
458
+ highlight: clampedHighlight,
459
+ setHighlight,
460
+ activeCommand,
461
+ activeArgHint,
462
+ onKeyDown,
463
+ runHighlighted,
464
+ runAt,
465
+ autocompleteHighlighted
466
+ };
467
+ }
468
+
469
+ // src/components/command-palette.tsx
470
+ import { AnimatePresence, motion } from "motion/react";
471
+ import { jsx, jsxs } from "react/jsx-runtime";
472
+ function CommandPalette({
473
+ open,
474
+ items,
475
+ highlight,
476
+ onHighlight,
477
+ onRun,
478
+ argHintText,
479
+ listboxId,
480
+ label: labelProp,
481
+ dangerLabel = "danger"
482
+ }) {
483
+ const t = useOpenGeniText();
484
+ const label = labelProp === void 0 ? t("commandPalette.slashCommands") : labelProp;
485
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsxs(
486
+ motion.div,
487
+ {
488
+ initial: { opacity: 0, y: 6, scale: 0.99 },
489
+ animate: { opacity: 1, y: 0, scale: 1 },
490
+ exit: { opacity: 0, y: 6, scale: 0.99 },
491
+ transition: { duration: 0.13, ease: "easeOut" },
492
+ className: cn(
493
+ "absolute bottom-full left-0 right-0 z-20 mb-2 overflow-hidden",
494
+ "rounded-og-lg border border-og-border bg-og-surface-2 shadow-og-sm"
495
+ ),
496
+ children: [
497
+ /* @__PURE__ */ jsx(
498
+ "ul",
499
+ {
500
+ id: listboxId,
501
+ role: "listbox",
502
+ "aria-label": label,
503
+ className: "max-h-72 overflow-y-auto py-1",
504
+ children: items.map((command, index) => {
505
+ const selected = index === highlight;
506
+ const hint = argHint(command.args);
507
+ return /* @__PURE__ */ jsxs(
508
+ "li",
509
+ {
510
+ id: `${listboxId}-option-${index}`,
511
+ role: "option",
512
+ "aria-selected": selected,
513
+ onMouseEnter: () => onHighlight(index),
514
+ onMouseDown: (event) => {
515
+ event.preventDefault();
516
+ onRun(index);
517
+ },
518
+ className: cn(
519
+ "mx-1 flex cursor-pointer items-center gap-2 rounded-og-md px-2.5 py-1.5",
520
+ "transition-colors duration-100",
521
+ selected ? "bg-og-accent/15 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3"
522
+ ),
523
+ children: [
524
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
525
+ /* @__PURE__ */ jsxs(
526
+ "span",
527
+ {
528
+ className: cn(
529
+ "font-mono text-[13px]",
530
+ selected ? "text-og-accent" : "text-og-fg"
531
+ ),
532
+ children: [
533
+ "/",
534
+ command.name
535
+ ]
536
+ }
537
+ ),
538
+ hint ? /* @__PURE__ */ jsx("span", { className: "truncate font-mono text-[11px] text-og-fg-subtle", children: hint }) : null
539
+ ] }),
540
+ /* @__PURE__ */ jsxs("span", { className: "ml-auto flex items-center gap-1.5", children: [
541
+ command.danger ? /* @__PURE__ */ jsx("span", { className: "rounded-og-xs bg-og-status-failed/15 px-1 text-[10px] uppercase tracking-wide text-og-status-failed", children: dangerLabel }) : null,
542
+ /* @__PURE__ */ jsx("span", { className: "og-command-description truncate text-[12px] text-og-fg-subtle max-sm:hidden", children: command.description })
543
+ ] })
544
+ ]
545
+ },
546
+ command.name
547
+ );
548
+ })
549
+ }
550
+ ),
551
+ argHintText ? /* @__PURE__ */ jsx("div", { className: "border-t border-og-border px-3 py-1.5 font-mono text-[11px] text-og-fg-subtle", children: argHintText }) : null
552
+ ]
553
+ }
554
+ ) : null });
555
+ }
556
+
557
+ // src/components/model-picker.tsx
558
+ import { modelDisplayName } from "@opengeni/sdk/model-display";
559
+ import { ChevronDownIcon } from "lucide-react";
560
+ import { useId, useMemo as useMemo2 } from "react";
561
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
562
+ var EMPTY_CLIENT_MODELS = [];
563
+ function isCodexClientModel(model) {
564
+ return model.id.startsWith("codex/") || model.source === "codex";
565
+ }
566
+ function isCodexPickerRow(row) {
567
+ return row.id.startsWith("codex/") || row.catalog.source === "codex";
568
+ }
569
+ function applyCodexOnlyRows(t, rows, codexOnly) {
570
+ if (!codexOnly) return rows;
571
+ return rows.map((row) => {
572
+ if (isCodexPickerRow(row)) return row;
573
+ return {
574
+ ...row,
575
+ selectable: false,
576
+ unavailableReason: row.unavailableReason ?? t("modelPicker.codexOnlySession")
577
+ };
578
+ });
579
+ }
580
+ function providerGroups(models, codexOnly) {
581
+ const byProvider = /* @__PURE__ */ new Map();
582
+ for (const model of models) {
583
+ let group = byProvider.get(model.provider);
584
+ if (!group) {
585
+ group = { label: model.providerLabel, models: [] };
586
+ byProvider.set(model.provider, group);
587
+ }
588
+ group.models.push({
589
+ ...model,
590
+ optionDisabled: codexOnly && !isCodexClientModel(model)
591
+ });
592
+ }
593
+ const groups = [...byProvider.values()];
594
+ if (codexOnly) {
595
+ const codexIndex = groups.findIndex(
596
+ (group) => group.models.some((model) => !model.optionDisabled && isCodexClientModel(model))
597
+ );
598
+ if (codexIndex > 0) groups.unshift(...groups.splice(codexIndex, 1));
599
+ }
600
+ return groups;
601
+ }
602
+ function ModelPicker({
603
+ models = EMPTY_CLIENT_MODELS,
604
+ rows,
605
+ value,
606
+ onChange,
607
+ disabled,
608
+ className,
609
+ label: labelProp,
610
+ codexOnly = false
611
+ }) {
612
+ const t = useOpenGeniText();
613
+ const label = labelProp === void 0 ? t("modelPicker.model") : labelProp;
614
+ const selectId = useId();
615
+ const effectiveRows = useMemo2(
616
+ () => rows && rows.length > 0 ? applyCodexOnlyRows(t, rows, codexOnly) : [],
617
+ [rows, codexOnly, t]
618
+ );
619
+ const billingGroups = useMemo2(
620
+ () => effectiveRows.length > 0 ? groupPickerRowsByBillingClass(t, effectiveRows, { codexOnly, selectedId: value }) : [],
621
+ [effectiveRows, codexOnly, value, t]
622
+ );
623
+ const providerGroupList = useMemo2(() => providerGroups(models, codexOnly), [models, codexOnly]);
624
+ const modelLabels = useMemo2(
625
+ () => new Map(projectClientModelRows(t, models).map((row) => [row.id, row.label])),
626
+ [models, t]
627
+ );
628
+ const useBillingGroups = Boolean(effectiveRows.length);
629
+ if (models.length === 0 && effectiveRows.length === 0) {
630
+ return null;
631
+ }
632
+ return /* @__PURE__ */ jsxs2("span", { className: cn("relative inline-flex items-center", className), children: [
633
+ /* @__PURE__ */ jsx2("label", { htmlFor: selectId, className: "sr-only", children: label }),
634
+ /* @__PURE__ */ jsx2(
635
+ "select",
636
+ {
637
+ id: selectId,
638
+ value: value ?? "",
639
+ onChange: (event) => onChange(event.target.value),
640
+ disabled: disabled === true,
641
+ "aria-label": label,
642
+ className: cn(
643
+ "og-model-picker-native h-8 max-w-[180px] cursor-pointer appearance-none truncate rounded-og-md bg-transparent pointer-coarse:h-11",
644
+ "py-0 pl-2 pr-6 text-[13px] text-og-fg-muted",
645
+ "transition-colors duration-150 hover:bg-og-surface-2 hover:text-og-fg",
646
+ "focus:outline-hidden focus-visible:outline-hidden",
647
+ "disabled:cursor-not-allowed disabled:opacity-50"
648
+ ),
649
+ children: useBillingGroups ? billingGroups.map((group) => /* @__PURE__ */ jsx2("optgroup", { label: group.label, children: group.rows.map((row) => /* @__PURE__ */ jsx2("option", { value: row.id, disabled: !row.selectable, children: row.unavailableReason ? `${row.label} (${row.unavailableReason})` : row.label }, row.id)) }, group.billingClass)) : providerGroupList.map((group) => /* @__PURE__ */ jsx2("optgroup", { label: group.label, children: group.models.map((model) => /* @__PURE__ */ jsx2("option", { value: model.id, disabled: model.optionDisabled, children: modelLabels.get(model.id) ?? modelDisplayName(model) }, model.id)) }, group.label))
650
+ }
651
+ ),
652
+ /* @__PURE__ */ jsx2(
653
+ ChevronDownIcon,
654
+ {
655
+ "aria-hidden": true,
656
+ className: "pointer-events-none absolute right-1.5 size-3.5 text-og-fg-subtle"
657
+ }
658
+ )
659
+ ] });
660
+ }
661
+
662
+ // src/components/composer.tsx
663
+ import {
664
+ ArrowUpIcon,
665
+ ChevronDownIcon as ChevronDownIcon2,
666
+ FileIcon as FileIcon2,
667
+ LoaderCircleIcon as LoaderCircleIcon2,
668
+ PaperclipIcon,
669
+ PauseIcon,
670
+ PlayIcon,
671
+ SquareIcon,
672
+ XIcon as XIcon2
673
+ } from "lucide-react";
674
+ import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
675
+ import {
676
+ createContext,
677
+ forwardRef,
678
+ useCallback as useCallback2,
679
+ useContext,
680
+ useEffect as useEffect3,
681
+ useId as useId2,
682
+ useLayoutEffect,
683
+ useMemo as useMemo4,
684
+ useRef as useRef4,
685
+ useState as useState4
686
+ } from "react";
687
+
688
+ // src/hooks/use-composer-image-tags.ts
689
+ import { useEffect, useMemo as useMemo3, useRef as useRef2, useState as useState2 } from "react";
690
+
691
+ // src/lib/image-markers.ts
692
+ var TAG = /\[Image (\d+)\]/g;
693
+ function imageMarker(number) {
694
+ return `[Image ${number}]`;
695
+ }
696
+ function reconcileImageMarkers({
697
+ text,
698
+ previous,
699
+ next,
700
+ insert,
701
+ caret
702
+ }) {
703
+ const nextNumber = new Map(next.map((id, index) => [id, index + 1]));
704
+ const inserted = new Set(insert.filter((id) => nextNumber.has(id)));
705
+ const changedOrder = previous.length !== next.length || previous.some((id, index) => next[index] !== id);
706
+ if (!inserted.size && !changedOrder) return null;
707
+ let position = Math.max(0, Math.min(caret, text.length));
708
+ let result = "";
709
+ let last = 0;
710
+ for (const match of text.matchAll(TAG)) {
711
+ const start = match.index;
712
+ const end = start + match[0].length;
713
+ const id = previous[Number(match[1]) - 1];
714
+ if (id === void 0) continue;
715
+ const number = nextNumber.get(id);
716
+ let cutStart = start;
717
+ let cutEnd = end;
718
+ const replacement = number === void 0 ? "" : imageMarker(number);
719
+ if (number === void 0) {
720
+ if (text[cutEnd] === " ") cutEnd += 1;
721
+ else if (start > last && text[start - 1] === " ") cutStart -= 1;
722
+ }
723
+ result += text.slice(last, cutStart) + replacement;
724
+ if (position >= cutEnd) position += replacement.length - (cutEnd - cutStart);
725
+ else if (position > cutStart) position = cutStart + replacement.length;
726
+ last = cutEnd;
727
+ }
728
+ result += text.slice(last);
729
+ if (inserted.size) {
730
+ const tags = next.filter((id) => inserted.has(id)).map((id) => imageMarker(nextNumber.get(id))).join(" ");
731
+ const before = result.slice(0, position);
732
+ const after = result.slice(position);
733
+ const lead = before.length && !/\s$/.test(before) ? " " : "";
734
+ const trail = !/^\s/.test(after) ? " " : "";
735
+ result = before + lead + tags + trail + after;
736
+ position = before.length + lead.length + tags.length + trail.length;
737
+ }
738
+ return result === text ? null : { text: result, caret: position };
739
+ }
740
+ function messageImageIds(restoredImageFileIds, attachments) {
741
+ const restored = new Set(restoredImageFileIds);
742
+ return [
743
+ ...restoredImageFileIds.map(restoredImageKey),
744
+ ...attachments.filter(
745
+ (attachment) => attachment.contentType.startsWith("image/") && !(attachment.file && restored.has(attachment.file.id))
746
+ ).map((attachment) => attachment.id)
747
+ ];
748
+ }
749
+ function restoredImageKey(fileId) {
750
+ return `restored-file:${fileId}`;
751
+ }
752
+
753
+ // src/hooks/use-composer-image-tags.ts
754
+ function useComposerImageTags({
755
+ enabled,
756
+ attachments,
757
+ restoredResources,
758
+ loadFileContentType,
759
+ readValue,
760
+ setValue,
761
+ textareaRef
762
+ }) {
763
+ const restoredFileIds = useMemo3(
764
+ () => enabled ? restoredResources.flatMap(
765
+ (resource) => resource.kind === "file" ? [resource.fileId] : []
766
+ ) : [],
767
+ [enabled, restoredResources]
768
+ );
769
+ const restoredKey = restoredFileIds.join("\n");
770
+ const [restoredKinds, setRestoredKinds] = useState2(() => /* @__PURE__ */ new Map());
771
+ const restoredKindsRef = useRef2(restoredKinds);
772
+ restoredKindsRef.current = restoredKinds;
773
+ useEffect(() => {
774
+ const unknown = restoredFileIds.filter((fileId) => !restoredKindsRef.current.has(fileId));
775
+ if (unknown.length === 0) return;
776
+ const controller = new AbortController();
777
+ const kindOf = async (fileId) => {
778
+ try {
779
+ const contentType = await loadFileContentType?.(fileId, controller.signal);
780
+ return [fileId, contentType === void 0 || contentType.startsWith("image/")];
781
+ } catch {
782
+ return [fileId, true];
783
+ }
784
+ };
785
+ void Promise.all(unknown.map(kindOf)).then((entries) => {
786
+ if (controller.signal.aborted) return;
787
+ setRestoredKinds((current) => new Map([...current, ...entries]));
788
+ });
789
+ return () => controller.abort();
790
+ }, [restoredKey, loadFileContentType]);
791
+ const restoredReady = restoredFileIds.every((fileId) => restoredKinds.has(fileId));
792
+ const imageIds = useMemo3(
793
+ () => enabled && restoredReady ? messageImageIds(
794
+ restoredFileIds.filter((fileId) => restoredKinds.get(fileId) === true),
795
+ attachments
796
+ ) : null,
797
+ [attachments, enabled, restoredFileIds, restoredKinds, restoredReady]
798
+ );
799
+ const imageNumbers = useMemo3(
800
+ () => imageIds ? new Map(imageIds.map((id, index) => [id, index + 1])) : void 0,
801
+ [imageIds]
802
+ );
803
+ const previousRef = useRef2(null);
804
+ const attachmentsRef = useRef2(attachments);
805
+ attachmentsRef.current = attachments;
806
+ const imageIdsKey = imageIds?.join("\n") ?? null;
807
+ useEffect(() => {
808
+ if (!enabled) {
809
+ previousRef.current = null;
810
+ return;
811
+ }
812
+ if (!imageIds) return;
813
+ const previous = previousRef.current;
814
+ previousRef.current = imageIds;
815
+ if (previous === null) return;
816
+ const added = new Set(
817
+ attachmentsRef.current.filter((attachment) => attachment.restored !== true).map((attachment) => attachment.id)
818
+ );
819
+ const insert = imageIds.filter((id) => added.has(id) && !previous.includes(id));
820
+ const value = readValue();
821
+ const textarea = textareaRef.current;
822
+ const edit = reconcileImageMarkers({
823
+ text: value,
824
+ previous,
825
+ next: imageIds,
826
+ insert,
827
+ caret: textarea && textarea.value === value ? textarea.selectionStart : value.length
828
+ });
829
+ if (!edit) return;
830
+ setValue(edit.text);
831
+ window.requestAnimationFrame(() => {
832
+ const current = textareaRef.current;
833
+ if (current && current.value === edit.text) current.setSelectionRange(edit.caret, edit.caret);
834
+ });
835
+ }, [imageIdsKey, enabled]);
836
+ return imageNumbers;
837
+ }
838
+
839
+ // src/components/attachment-chips.tsx
840
+ import {
841
+ AppWindowIcon,
842
+ FileIcon,
843
+ ImageIcon,
844
+ LoaderCircleIcon,
845
+ RotateCwIcon,
846
+ XIcon
847
+ } from "lucide-react";
848
+ import {
849
+ cloneElement,
850
+ useEffect as useEffect2,
851
+ useRef as useRef3,
852
+ useState as useState3
853
+ } from "react";
854
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
855
+ function ComposerTip({
856
+ tip,
857
+ children
858
+ }) {
859
+ if (!tip) return children;
860
+ return cloneElement(children, { title: tip });
861
+ }
862
+ function ImageTagLabel({ children }) {
863
+ return /* @__PURE__ */ jsx3("span", { "data-image-tag": "", className: "shrink-0 font-medium text-og-fg tabular-nums", children });
864
+ }
865
+ function storedFileAttachment(id, file) {
866
+ return {
867
+ id,
868
+ name: file.filename,
869
+ contentType: file.contentType,
870
+ sizeBytes: file.sizeBytes,
871
+ status: "ready",
872
+ file,
873
+ ...file.appShot ? { appShot: file.appShot } : {}
874
+ };
875
+ }
876
+ var noRetainedPreview = () => void 0;
877
+ function AttachmentChips({
878
+ attachments,
879
+ messages,
880
+ disabled = false,
881
+ onRemove,
882
+ onRetry,
883
+ onRetainPreview = noRetainedPreview,
884
+ onLoadPreview,
885
+ openFile,
886
+ imageNumbers,
887
+ className
888
+ }) {
889
+ const t = useOpenGeniText();
890
+ const lightbox = useLightboxOptional();
891
+ const previewRequest = useRef3(null);
892
+ const [previewLoadingId, setPreviewLoadingId] = useState3(null);
893
+ const [previewErrorId, setPreviewErrorId] = useState3(null);
894
+ const [opening, setOpening] = useState3(null);
895
+ const [storedThumbs, setStoredThumbs] = useState3({});
896
+ const [brokenLocal, setBrokenLocal] = useState3(() => /* @__PURE__ */ new Set());
897
+ const thumbRequests = useRef3(/* @__PURE__ */ new Map());
898
+ const localPreview = (attachment) => attachment.previewUrl && !brokenLocal.has(attachment.id) ? attachment.previewUrl : void 0;
899
+ useEffect2(() => {
900
+ if (!onLoadPreview) return;
901
+ for (const attachment of attachments) {
902
+ const id = attachment.id;
903
+ if (attachment.status !== "ready" || !attachment.file || !attachment.contentType.startsWith("image/") || attachment.previewUrl && !brokenLocal.has(id) || storedThumbs[id] || thumbRequests.current.has(id)) {
904
+ continue;
905
+ }
906
+ const controller = new AbortController();
907
+ thumbRequests.current.set(id, controller);
908
+ void onLoadPreview(id, controller.signal).then((url) => {
909
+ if (url && !controller.signal.aborted) {
910
+ setStoredThumbs((current) => ({ ...current, [id]: url }));
911
+ }
912
+ }).catch(() => void 0).finally(() => {
913
+ if (thumbRequests.current.get(id) === controller) thumbRequests.current.delete(id);
914
+ });
915
+ }
916
+ }, [attachments, brokenLocal, onLoadPreview, storedThumbs]);
917
+ useEffect2(() => {
918
+ const requests = thumbRequests.current;
919
+ return () => {
920
+ for (const controller of requests.values()) controller.abort();
921
+ requests.clear();
922
+ };
923
+ }, []);
924
+ useEffect2(() => () => previewRequest.current?.abort(), [onLoadPreview]);
925
+ async function openPreview(attachment, source, canLoadPreview) {
926
+ previewRequest.current?.abort();
927
+ const attachmentId = attachment.id;
928
+ const local = localPreview(attachment);
929
+ const releaseSource = local ? onRetainPreview(attachmentId) : void 0;
930
+ let src = local ?? storedThumbs[attachmentId];
931
+ if (!releaseSource && canLoadPreview) src = storedThumbs[attachmentId];
932
+ if (!src && canLoadPreview) {
933
+ const controller = new AbortController();
934
+ previewRequest.current = controller;
935
+ setPreviewLoadingId(attachmentId);
936
+ setPreviewErrorId(null);
937
+ try {
938
+ src = await onLoadPreview(attachmentId, controller.signal);
939
+ if (controller.signal.aborted) return;
940
+ if (!src) {
941
+ setPreviewErrorId(attachmentId);
942
+ return;
943
+ }
944
+ } catch {
945
+ if (!controller.signal.aborted) setPreviewErrorId(attachmentId);
946
+ return;
947
+ } finally {
948
+ if (previewRequest.current === controller) {
949
+ setPreviewLoadingId(null);
950
+ }
951
+ }
952
+ }
953
+ lightbox.open(
954
+ src,
955
+ attachment.name,
956
+ source,
957
+ messages.attachmentPreviewLabel,
958
+ attachment.name,
959
+ {
960
+ download: messages.downloadAttachment(attachment.name),
961
+ close: messages.closeAttachmentPreview
962
+ },
963
+ releaseSource
964
+ );
965
+ }
966
+ function runOpen(attachmentId, open) {
967
+ if (opening?.id === attachmentId && !opening.failed) return;
968
+ setOpening({ id: attachmentId, failed: false });
969
+ void Promise.resolve().then(open).then(
970
+ () => setOpening((current) => current?.id === attachmentId ? null : current),
971
+ () => setOpening(
972
+ (current) => current?.id === attachmentId ? { id: attachmentId, failed: true } : current
973
+ )
974
+ );
975
+ }
976
+ const readOnly = !onRemove;
977
+ return (
978
+ // Compact chips extend their touch targets beyond their visible borders.
979
+ // Keep neighboring rows and columns outside those expanded hit areas.
980
+ /* @__PURE__ */ jsx3("div", { className: cn("flex flex-wrap gap-1.5 pointer-coarse:gap-2.5", className), children: attachments.map((attachment) => {
981
+ const failed = attachment.status === "failed";
982
+ const secureContextRequired = attachment.errorCode === "secure_context_required";
983
+ const previewFailed = previewErrorId === attachment.id;
984
+ const previewLoading = previewLoadingId === attachment.id;
985
+ const local = localPreview(attachment);
986
+ const thumb = local ?? storedThumbs[attachment.id];
987
+ const onThumbError = local ? () => setBrokenLocal(
988
+ (current) => current.has(attachment.id) ? current : new Set(current).add(attachment.id)
989
+ ) : void 0;
990
+ const canLoadPreview = Boolean(
991
+ lightbox && onLoadPreview && attachment.status === "ready" && attachment.file && attachment.contentType.startsWith("image/")
992
+ );
993
+ const previewable = Boolean(lightbox && (thumb || canLoadPreview));
994
+ const resolution = readOnly && !previewable ? openFile?.(attachment) : void 0;
995
+ const fileOpening = opening?.id === attachment.id && !opening.failed;
996
+ const openFailed = opening?.id === attachment.id && opening.failed;
997
+ const unavailable = readOnly && attachment.status === "ready" && !attachment.file;
998
+ const appShot = attachment.appShot;
999
+ const statusText = previewFailed ? messages.previewUnavailable ?? t("composer.previewUnavailable") : openFailed ? t("composerMessages.openFailed") : attachment.status === "uploading" ? messages.uploading : failed ? attachment.error || messages.uploadFailed : appShot ? t("composer.appShotSummary", { app: appShot.app }) : unavailable ? t("composerMessages.unavailable") : messages.formatBytes(attachment.sizeBytes);
1000
+ const displayName = appShot ? appShot.title.trim() || appShot.app : attachment.name;
1001
+ const compact = !appShot && !failed && !previewFailed && !openFailed;
1002
+ const imageNumber = imageNumbers?.get(attachment.id);
1003
+ const thumbSize = appShot ? "h-10 w-16" : compact ? "size-6" : "size-8";
1004
+ const chipClass = cn(
1005
+ "flex min-w-0 items-center gap-2 rounded-og-md border text-left text-og-sm",
1006
+ compact ? cn("py-1 pl-1", readOnly ? "pr-2" : "pr-1") : "px-2 py-1.5",
1007
+ // A captured window arrives from outside the page: let it settle in.
1008
+ appShot && "animate-og-enter",
1009
+ failed ? cn(
1010
+ "border-og-status-failed/40 bg-og-status-failed/10",
1011
+ secureContextRequired ? "max-w-full items-start sm:max-w-[32rem]" : appShot ? "max-w-[320px]" : "max-w-[240px]"
1012
+ ) : cn("border-og-border bg-og-surface-2", appShot ? "max-w-[320px]" : "max-w-[240px]")
1013
+ );
1014
+ const interactiveClass = "cursor-pointer outline-hidden transition-colors hover:bg-og-surface-3 focus-visible:ring-2 focus-visible:ring-og-accent disabled:cursor-wait pointer-coarse:min-h-11";
1015
+ const thumbImage = /* @__PURE__ */ jsx3(
1016
+ "img",
1017
+ {
1018
+ src: thumb,
1019
+ alt: "",
1020
+ onError: onThumbError,
1021
+ className: cn(
1022
+ "h-full w-full object-cover",
1023
+ !readOnly && "transition-opacity hover:opacity-80",
1024
+ appShot && "object-top",
1025
+ compact && "rounded"
1026
+ )
1027
+ }
1028
+ );
1029
+ const pendingIcon = /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-4 animate-og-spin text-og-fg-muted" });
1030
+ const leading = readOnly && previewable ? /* @__PURE__ */ jsx3(
1031
+ "span",
1032
+ {
1033
+ className: cn(
1034
+ thumbSize,
1035
+ "shrink-0 overflow-hidden rounded",
1036
+ appShot && "border border-og-border bg-og-surface-1",
1037
+ !thumb && "flex items-center justify-center"
1038
+ ),
1039
+ children: thumb ? thumbImage : previewLoading ? pendingIcon : /* @__PURE__ */ jsx3(ImageIcon, { className: "size-4 text-og-fg-muted" })
1040
+ }
1041
+ ) : previewable ? /* @__PURE__ */ jsx3(
1042
+ "button",
1043
+ {
1044
+ type: "button",
1045
+ className: cn(
1046
+ thumbSize,
1047
+ "shrink-0 overflow-hidden rounded outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent",
1048
+ // The slim chip's 24px preview keeps a 44px touch target; the
1049
+ // hit area grows over the name, never the remove button.
1050
+ compact && "relative overflow-visible pointer-coarse:before:absolute pointer-coarse:before:-inset-y-2.5 pointer-coarse:before:-left-2.5 pointer-coarse:before:-right-2.5 pointer-coarse:before:content-['']",
1051
+ appShot && "border border-og-border bg-og-surface-1",
1052
+ !thumb && "flex items-center justify-center disabled:cursor-wait"
1053
+ ),
1054
+ "aria-label": messages.previewAttachment(displayName),
1055
+ "aria-busy": previewLoading || void 0,
1056
+ disabled: previewLoading,
1057
+ onClick: (event) => void openPreview(attachment, event.currentTarget, canLoadPreview),
1058
+ children: thumb ? thumbImage : previewLoading ? pendingIcon : /* @__PURE__ */ jsx3(ImageIcon, { className: "size-4 text-og-fg-muted" })
1059
+ }
1060
+ ) : thumb ? /* @__PURE__ */ jsx3(
1061
+ "img",
1062
+ {
1063
+ src: thumb,
1064
+ alt: "",
1065
+ onError: onThumbError,
1066
+ className: cn(thumbSize, "shrink-0 rounded object-cover", appShot && "object-top")
1067
+ }
1068
+ ) : fileOpening ? /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-4 shrink-0 animate-og-spin text-og-fg-muted" }) : attachment.contentType.startsWith("image/") ? /* @__PURE__ */ jsx3(ImageIcon, { className: "size-4 shrink-0 text-og-fg-muted" }) : /* @__PURE__ */ jsx3(FileIcon, { className: "size-4 shrink-0 text-og-fg-muted" });
1069
+ const content = /* @__PURE__ */ jsxs3(Fragment, { children: [
1070
+ leading,
1071
+ compact ? /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 flex-1 items-baseline gap-1.5", children: [
1072
+ imageNumber !== void 0 ? /* @__PURE__ */ jsx3(ImageTagLabel, { children: t("composer.imageTag", { number: imageNumber }) }) : null,
1073
+ /* @__PURE__ */ jsx3(
1074
+ "span",
1075
+ {
1076
+ className: cn(
1077
+ "truncate",
1078
+ imageNumber === void 0 ? "font-medium text-og-fg" : "text-og-fg-muted"
1079
+ ),
1080
+ children: displayName
1081
+ }
1082
+ ),
1083
+ /* @__PURE__ */ jsx3("span", { className: "shrink-0 text-og-xs text-og-fg-subtle tabular-nums", children: statusText })
1084
+ ] }) : /* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
1085
+ /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
1086
+ imageNumber !== void 0 ? /* @__PURE__ */ jsx3(ImageTagLabel, { children: t("composer.imageTag", { number: imageNumber }) }) : null,
1087
+ /* @__PURE__ */ jsx3("span", { className: "block min-w-0 truncate font-medium text-og-fg", children: displayName })
1088
+ ] }),
1089
+ appShot && !failed && !previewFailed && attachment.status !== "uploading" ? /* @__PURE__ */ jsx3(
1090
+ ComposerTip,
1091
+ {
1092
+ tip: appShot.text?.trim() ? t("composer.appShotTextIncluded") : t("composer.appShotNoText"),
1093
+ children: /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-center gap-1 text-og-xs text-og-fg-subtle", children: [
1094
+ /* @__PURE__ */ jsx3(AppWindowIcon, { "aria-hidden": true, className: "size-3 shrink-0" }),
1095
+ /* @__PURE__ */ jsx3("span", { className: "truncate", children: statusText })
1096
+ ] })
1097
+ }
1098
+ ) : secureContextRequired ? /* @__PURE__ */ jsx3("span", { className: "block break-words text-og-xs leading-4 text-og-status-failed", children: statusText }) : failed || previewFailed || openFailed ? /* @__PURE__ */ jsx3(ComposerTip, { tip: statusText, children: /* @__PURE__ */ jsx3("span", { className: "block truncate text-og-xs text-og-status-failed", children: statusText }) }) : /* @__PURE__ */ jsx3("span", { className: "block truncate text-og-xs text-og-fg-subtle", children: statusText })
1099
+ ] }),
1100
+ attachment.status === "uploading" ? /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-3.5 shrink-0 animate-og-spin" }) : null,
1101
+ failed && !secureContextRequired && onRetry ? /* @__PURE__ */ jsx3(ComposerTip, { tip: messages.retryUpload, children: /* @__PURE__ */ jsx3(
1102
+ "button",
1103
+ {
1104
+ type: "button",
1105
+ onClick: () => onRetry(attachment.id),
1106
+ disabled,
1107
+ className: "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-10",
1108
+ "aria-label": messages.retryAttachment(displayName),
1109
+ children: /* @__PURE__ */ jsx3(RotateCwIcon, { className: "size-3.5" })
1110
+ }
1111
+ ) }) : null,
1112
+ onRemove ? /* @__PURE__ */ jsx3(
1113
+ "button",
1114
+ {
1115
+ type: "button",
1116
+ onClick: () => onRemove(attachment.id),
1117
+ disabled,
1118
+ className: cn(
1119
+ "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50",
1120
+ // The slim chip keeps a 44px touch target with an invisible hit area.
1121
+ compact ? "relative pointer-coarse:p-1.5 pointer-coarse:before:absolute pointer-coarse:before:-inset-2.5 pointer-coarse:before:content-['']" : "pointer-coarse:size-10"
1122
+ ),
1123
+ "aria-label": messages.removeAttachment(displayName),
1124
+ children: /* @__PURE__ */ jsx3(XIcon, { className: "size-3.5" })
1125
+ }
1126
+ ) : null
1127
+ ] });
1128
+ if (readOnly && previewable) {
1129
+ return /* @__PURE__ */ jsx3(
1130
+ "button",
1131
+ {
1132
+ type: "button",
1133
+ "data-app-shot": appShot ? "" : void 0,
1134
+ className: cn(chipClass, interactiveClass),
1135
+ "aria-label": messages.previewAttachment(displayName),
1136
+ "aria-busy": previewLoading || void 0,
1137
+ disabled: previewLoading,
1138
+ onClick: (event) => void openPreview(attachment, event.currentTarget, canLoadPreview),
1139
+ children: content
1140
+ },
1141
+ attachment.id
1142
+ );
1143
+ }
1144
+ if (resolution?.href) {
1145
+ const navigate = resolution.open;
1146
+ return /* @__PURE__ */ jsx3(
1147
+ "a",
1148
+ {
1149
+ href: resolution.href,
1150
+ target: "_blank",
1151
+ rel: "noopener noreferrer",
1152
+ className: cn(chipClass, interactiveClass),
1153
+ "aria-label": t("composerMessages.openName", { name: displayName }),
1154
+ onClick: (event) => {
1155
+ if (!navigate || event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
1156
+ return;
1157
+ event.preventDefault();
1158
+ navigate();
1159
+ },
1160
+ children: content
1161
+ },
1162
+ attachment.id
1163
+ );
1164
+ }
1165
+ if (resolution?.open) {
1166
+ const open = resolution.open;
1167
+ return /* @__PURE__ */ jsx3(
1168
+ "button",
1169
+ {
1170
+ type: "button",
1171
+ className: cn(chipClass, interactiveClass),
1172
+ "aria-label": t("composerMessages.openName", { name: displayName }),
1173
+ "aria-busy": fileOpening || void 0,
1174
+ disabled: fileOpening,
1175
+ onClick: () => runOpen(attachment.id, open),
1176
+ children: content
1177
+ },
1178
+ attachment.id
1179
+ );
1180
+ }
1181
+ return /* @__PURE__ */ jsx3("div", { "data-app-shot": appShot ? "" : void 0, className: chipClass, children: content }, attachment.id);
1182
+ }) })
1183
+ );
1184
+ }
1185
+
1186
+ // src/components/composer.tsx
1187
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1188
+ var HELD_SEND_LIMIT_MS = 3e4;
1189
+ var composerHeightMirror = null;
1190
+ function measureComposerContentHeight(textarea) {
1191
+ if (typeof document === "undefined") {
1192
+ return textarea.scrollHeight;
1193
+ }
1194
+ const width = textarea.clientWidth;
1195
+ if (width <= 0) {
1196
+ return textarea.offsetHeight;
1197
+ }
1198
+ let mirror = composerHeightMirror;
1199
+ if (!mirror) {
1200
+ mirror = document.createElement("textarea");
1201
+ mirror.setAttribute("aria-hidden", "true");
1202
+ mirror.tabIndex = -1;
1203
+ mirror.rows = 1;
1204
+ mirror.style.cssText = "position:fixed;top:0;left:-100000px;visibility:hidden;pointer-events:none;height:auto;min-height:0;max-height:none;overflow:hidden;z-index:-1;";
1205
+ composerHeightMirror = mirror;
1206
+ }
1207
+ const style = getComputedStyle(textarea);
1208
+ mirror.style.width = `${width}px`;
1209
+ mirror.style.boxSizing = style.boxSizing;
1210
+ mirror.style.font = style.font;
1211
+ mirror.style.fontSize = style.fontSize;
1212
+ mirror.style.fontFamily = style.fontFamily;
1213
+ mirror.style.fontWeight = style.fontWeight;
1214
+ mirror.style.fontStyle = style.fontStyle;
1215
+ mirror.style.letterSpacing = style.letterSpacing;
1216
+ mirror.style.lineHeight = style.lineHeight;
1217
+ mirror.style.textTransform = style.textTransform;
1218
+ mirror.style.paddingTop = style.paddingTop;
1219
+ mirror.style.paddingRight = style.paddingRight;
1220
+ mirror.style.paddingBottom = style.paddingBottom;
1221
+ mirror.style.paddingLeft = style.paddingLeft;
1222
+ mirror.style.borderTopWidth = style.borderTopWidth;
1223
+ mirror.style.borderRightWidth = style.borderRightWidth;
1224
+ mirror.style.borderBottomWidth = style.borderBottomWidth;
1225
+ mirror.style.borderLeftWidth = style.borderLeftWidth;
1226
+ mirror.style.borderStyle = style.borderStyle;
1227
+ mirror.style.whiteSpace = style.whiteSpace;
1228
+ mirror.style.wordBreak = style.wordBreak;
1229
+ mirror.style.overflowWrap = style.overflowWrap;
1230
+ mirror.value = textarea.value;
1231
+ if (!mirror.isConnected) {
1232
+ document.documentElement.appendChild(mirror);
1233
+ }
1234
+ return mirror.scrollHeight;
1235
+ }
1236
+ function applyComposerTextareaHeight(textarea, maxPx = 220, measure = measureComposerContentHeight) {
1237
+ const before = textarea.offsetHeight;
1238
+ const nextPx = Math.min(
1239
+ textarea.scrollHeight > textarea.clientHeight + 1 ? textarea.scrollHeight : measure(textarea),
1240
+ maxPx
1241
+ );
1242
+ if (Math.abs(nextPx - before) < 1) {
1243
+ return;
1244
+ }
1245
+ textarea.style.height = `${nextPx}px`;
1246
+ }
1247
+ var WORKING_CONTROLS_LINGER_MS = 1e3;
1248
+ var NO_ATTACHMENTS = [];
1249
+ var NO_RESOURCES = [];
1250
+ function useLingeringTrue(value, lingerMs) {
1251
+ const [state, setState] = useState4({ value, lingering: false });
1252
+ let current = state;
1253
+ if (state.value !== value) {
1254
+ current = { value, lingering: state.value && !value };
1255
+ setState(current);
1256
+ }
1257
+ const { lingering } = current;
1258
+ const currentValue = current.value;
1259
+ useEffect3(() => {
1260
+ if (!lingering || currentValue) return;
1261
+ const timer = setTimeout(
1262
+ () => setState((latest) => latest.value ? latest : { value: false, lingering: false }),
1263
+ lingerMs
1264
+ );
1265
+ return () => clearTimeout(timer);
1266
+ }, [currentValue, lingering, lingerMs]);
1267
+ return current.value || current.lingering;
1268
+ }
1269
+ function useChatComposerController({
1270
+ delivery,
1271
+ draft,
1272
+ control,
1273
+ effectiveControl,
1274
+ queuedAheadCount = 0,
1275
+ canControlWorkspace = false,
1276
+ controlLinks,
1277
+ disabled = false,
1278
+ attachments,
1279
+ commands: commandsProp,
1280
+ commandContext,
1281
+ onClearView,
1282
+ onPaste,
1283
+ messages: messageOverrides,
1284
+ runControl = "pause",
1285
+ running = false,
1286
+ queuedRecall,
1287
+ imageTags = false
1288
+ }) {
1289
+ const t = useOpenGeniText();
1290
+ const commands = useMemo4(() => commandsProp ?? defaultCommands(t), [commandsProp, t]);
1291
+ const formatError = useErrorMessage();
1292
+ const singleSend = delivery.singleSend === true;
1293
+ const deliveryWorking = delivery.working ?? true;
1294
+ const working = deliveryWorking;
1295
+ const workstreamWorking = useLingeringTrue(
1296
+ deliveryWorking || running,
1297
+ WORKING_CONTROLS_LINGER_MS
1298
+ );
1299
+ const messages = useMemo4(
1300
+ () => ({
1301
+ ...defaultChatComposerMessages(singleSend ? singleSendText(t) : t),
1302
+ ...messageOverrides
1303
+ }),
1304
+ [messageOverrides, singleSend, t]
1305
+ );
1306
+ const id = useId2();
1307
+ const rootRef = useRef4(null);
1308
+ const textareaRef = useRef4(null);
1309
+ const pauseButtonRef = useRef4(null);
1310
+ const fileInputRef = useRef4(null);
1311
+ const listboxId = useId2();
1312
+ const controlPaused = effectiveControl?.state === "paused";
1313
+ const [stoppedHere, setStoppedHere] = useState4(false);
1314
+ useEffect3(() => {
1315
+ if (!controlPaused) setStoppedHere(false);
1316
+ }, [controlPaused]);
1317
+ const resumesOnSend = runControl === "stop" && stoppedHere && controlPaused && effectiveControl?.directState === "paused" && effectiveControl.additionalBlockerCount === 0 && queuedAheadCount === 0;
1318
+ const paused = controlPaused && !resumesOnSend;
1319
+ const [controlDetailsOpen, setControlDetailsOpen] = useState4(false);
1320
+ const [paletteMounted, setPaletteMounted] = useState4(false);
1321
+ const [submitting, setSubmitting] = useState4(false);
1322
+ const [submittingMode, setSubmittingMode] = useState4(null);
1323
+ const submittingRef = useRef4(false);
1324
+ const controlOperationRef = useRef4(false);
1325
+ const deliveryValue = delivery.value;
1326
+ const setDeliveryValue = delivery.setValue;
1327
+ const mountedRef = useRef4(true);
1328
+ const deliveredValueRef = useRef4(deliveryValue);
1329
+ const liveValueRef = useRef4(deliveryValue);
1330
+ const [renderedValue, setRenderedValue] = useState4(deliveryValue);
1331
+ const deliveryChanged = deliveryValue !== deliveredValueRef.current;
1332
+ if (deliveryChanged) {
1333
+ deliveredValueRef.current = deliveryValue;
1334
+ liveValueRef.current = deliveryValue;
1335
+ }
1336
+ const setComposerValue = useCallback2(
1337
+ (next) => {
1338
+ liveValueRef.current = next;
1339
+ setRenderedValue(next);
1340
+ setDeliveryValue(next);
1341
+ },
1342
+ [setDeliveryValue]
1343
+ );
1344
+ const visibleValue = deliveryChanged ? deliveryValue : renderedValue;
1345
+ const imageNumbers = useComposerImageTags({
1346
+ enabled: imageTags,
1347
+ attachments: attachments?.attachments ?? NO_ATTACHMENTS,
1348
+ restoredResources: draft?.restoredResources ?? NO_RESOURCES,
1349
+ loadFileContentType: attachments?.loadFileContentType,
1350
+ readValue: () => liveValueRef.current,
1351
+ setValue: setComposerValue,
1352
+ textareaRef
1353
+ });
1354
+ useLayoutEffect(() => {
1355
+ if (renderedValue !== liveValueRef.current) {
1356
+ setRenderedValue(liveValueRef.current);
1357
+ }
1358
+ }, [deliveryValue, renderedValue]);
1359
+ useEffect3(() => {
1360
+ mountedRef.current = true;
1361
+ return () => {
1362
+ mountedRef.current = false;
1363
+ };
1364
+ }, []);
1365
+ useEffect3(() => {
1366
+ const openControl = (event) => {
1367
+ const requestedId = event instanceof CustomEvent && isRecord(event.detail) && typeof event.detail.composerId === "string" ? event.detail.composerId : null;
1368
+ if (requestedId && requestedId !== id) return;
1369
+ if (!requestedId) {
1370
+ const roots = document.querySelectorAll("[data-og-composer-id]");
1371
+ if (roots.length > 1 && !rootRef.current?.contains(document.activeElement)) return;
1372
+ }
1373
+ textareaRef.current?.scrollIntoView({ block: "end", behavior: "smooth" });
1374
+ if (paused) {
1375
+ setControlDetailsOpen(true);
1376
+ return;
1377
+ }
1378
+ window.requestAnimationFrame(() => pauseButtonRef.current?.focus());
1379
+ };
1380
+ document.addEventListener(OPEN_WORKSTREAM_CONTROL_EVENT, openControl);
1381
+ return () => document.removeEventListener(OPEN_WORKSTREAM_CONTROL_EVENT, openControl);
1382
+ }, [id, paused]);
1383
+ const blockedByAttachment = attachments?.hasUnresolved === true;
1384
+ const [dragging, setDragging] = useState4(false);
1385
+ const dragCarriesFiles = (event) => event.dataTransfer !== null && [...event.dataTransfer.types].includes("Files");
1386
+ const handleDragOver = useCallback2(
1387
+ (event) => {
1388
+ if (!attachments || !dragCarriesFiles(event)) return;
1389
+ event.preventDefault();
1390
+ if (!disabled) setDragging(true);
1391
+ },
1392
+ [attachments, disabled]
1393
+ );
1394
+ const handleDragLeave = useCallback2(
1395
+ (event) => {
1396
+ if (!attachments) return;
1397
+ if (event.currentTarget.contains(event.relatedTarget)) return;
1398
+ setDragging(false);
1399
+ },
1400
+ [attachments]
1401
+ );
1402
+ const handleDrop = useCallback2(
1403
+ (event) => {
1404
+ if (!attachments || !dragCarriesFiles(event)) return;
1405
+ event.preventDefault();
1406
+ setDragging(false);
1407
+ if (!disabled && event.dataTransfer.files.length > 0)
1408
+ attachments.addFiles(event.dataTransfer.files);
1409
+ },
1410
+ [attachments, disabled]
1411
+ );
1412
+ useEffect3(() => {
1413
+ if (disabled) setDragging(false);
1414
+ }, [disabled]);
1415
+ const [notice, setNotice] = useState4(null);
1416
+ const [helpOpen, setHelpOpen] = useState4(false);
1417
+ const [confirmState, setConfirmState] = useState4(null);
1418
+ const pendingConfirm = useRef4(null);
1419
+ const settleConfirmation = useCallback2((confirmed) => {
1420
+ const resolve = pendingConfirm.current;
1421
+ pendingConfirm.current = null;
1422
+ setConfirmState(null);
1423
+ resolve?.(confirmed);
1424
+ }, []);
1425
+ useEffect3(
1426
+ () => () => {
1427
+ pendingConfirm.current?.(false);
1428
+ pendingConfirm.current = null;
1429
+ },
1430
+ []
1431
+ );
1432
+ const resizeInputRafRef = useRef4(null);
1433
+ const resizeInput = useCallback2(() => {
1434
+ if (resizeInputRafRef.current !== null) {
1435
+ return;
1436
+ }
1437
+ resizeInputRafRef.current = requestAnimationFrame(() => {
1438
+ resizeInputRafRef.current = null;
1439
+ const textarea = textareaRef.current;
1440
+ if (!textarea) {
1441
+ return;
1442
+ }
1443
+ applyComposerTextareaHeight(textarea, 220);
1444
+ });
1445
+ }, []);
1446
+ useEffect3(() => resizeInput(), [resizeInput, visibleValue]);
1447
+ useEffect3(
1448
+ () => () => {
1449
+ if (resizeInputRafRef.current !== null) {
1450
+ cancelAnimationFrame(resizeInputRafRef.current);
1451
+ resizeInputRafRef.current = null;
1452
+ }
1453
+ },
1454
+ []
1455
+ );
1456
+ const handlers = useMemo4(
1457
+ () => ({
1458
+ notice: (next) => {
1459
+ setNotice(next);
1460
+ delivery.clearError();
1461
+ },
1462
+ openHelp: () => setHelpOpen(true),
1463
+ clearView: () => {
1464
+ if (!onClearView) return false;
1465
+ onClearView();
1466
+ return true;
1467
+ },
1468
+ confirm: (command) => new Promise((resolve) => {
1469
+ pendingConfirm.current?.(false);
1470
+ pendingConfirm.current = resolve;
1471
+ setConfirmState({ command, resolve: settleConfirmation });
1472
+ })
1473
+ }),
1474
+ [delivery, onClearView, settleConfirmation]
1475
+ );
1476
+ const palette = useSlashCommands({
1477
+ commands,
1478
+ context: commandContext,
1479
+ handlers,
1480
+ value: visibleValue,
1481
+ setValue: setComposerValue
1482
+ });
1483
+ const paletteEnabled = commandContext !== void 0;
1484
+ const commandDraftBlocked = paletteEnabled && palette.isCommandDraft;
1485
+ const annotationsIncomplete = (delivery.annotations ?? []).some(
1486
+ (annotation) => annotation.note.trim().length === 0
1487
+ );
1488
+ const preparing = delivery.preparing === true;
1489
+ const hasDraftText = visibleValue.trim().length > 0 || (attachments?.attachments.length ?? 0) > 0;
1490
+ const waitsForPreparation = preparing && hasDraftText;
1491
+ const heldSendRef = useRef4(null);
1492
+ const heldSendNoticeRef = useRef4(null);
1493
+ const clearHeldSendNotice = useCallback2(() => {
1494
+ const shown = heldSendNoticeRef.current;
1495
+ if (!shown) return;
1496
+ heldSendNoticeRef.current = null;
1497
+ setNotice((current) => current === shown ? null : current);
1498
+ }, []);
1499
+ const latestSendRef = useRef4({ delivery, resumesOnSend, singleSend });
1500
+ useLayoutEffect(() => {
1501
+ latestSendRef.current = { delivery, resumesOnSend, singleSend };
1502
+ });
1503
+ const deliveryCanSend = delivery.canSend;
1504
+ useEffect3(() => {
1505
+ const release = heldSendRef.current;
1506
+ if (!release) return;
1507
+ const ready = deliveryCanSend && !disabled;
1508
+ if (!ready && waitsForPreparation) return;
1509
+ heldSendRef.current = null;
1510
+ release(ready);
1511
+ }, [deliveryCanSend, disabled, waitsForPreparation]);
1512
+ useEffect3(
1513
+ () => () => {
1514
+ heldSendRef.current?.(false);
1515
+ heldSendRef.current = null;
1516
+ },
1517
+ []
1518
+ );
1519
+ const submitBlocker = disabled ? "disabled" : blockedByAttachment ? "attachment" : delivery.sending || submitting ? "sending" : commandDraftBlocked ? "command" : annotationsIncomplete ? "annotations" : delivery.canSend || waitsForPreparation ? null : "empty";
1520
+ const canSubmit = submitBlocker === null;
1521
+ const submit = useCallback2(
1522
+ async (mode) => {
1523
+ clearHeldSendNotice();
1524
+ if (commandDraftBlocked) {
1525
+ setNotice({ tone: "error", message: messages.slashCommandBlocked });
1526
+ delivery.clearError();
1527
+ return false;
1528
+ }
1529
+ if (disabled || blockedByAttachment || delivery.sending || submittingRef.current)
1530
+ return false;
1531
+ if (annotationsIncomplete) {
1532
+ setNotice({ tone: "error", message: messages.annotationNotesRequired });
1533
+ delivery.clearError();
1534
+ delivery.requestAnnotationReview?.();
1535
+ return false;
1536
+ }
1537
+ if (!delivery.canSend && !waitsForPreparation) return false;
1538
+ submittingRef.current = true;
1539
+ setSubmitting(true);
1540
+ setSubmittingMode(mode);
1541
+ try {
1542
+ if (!delivery.canSend) {
1543
+ let gaveUp = false;
1544
+ const ready = await new Promise((resolve) => {
1545
+ const limit = window.setTimeout(() => {
1546
+ if (heldSendRef.current !== settle) return;
1547
+ heldSendRef.current = null;
1548
+ gaveUp = true;
1549
+ resolve(false);
1550
+ }, HELD_SEND_LIMIT_MS);
1551
+ const settle = (value) => {
1552
+ window.clearTimeout(limit);
1553
+ resolve(value);
1554
+ };
1555
+ heldSendRef.current = settle;
1556
+ });
1557
+ if (!ready) {
1558
+ if (gaveUp && mountedRef.current) {
1559
+ const gaveUpNotice = {
1560
+ tone: "error",
1561
+ message: messages.heldSendGaveUp ?? t("composerMessages.heldSendGaveUp")
1562
+ };
1563
+ heldSendNoticeRef.current = gaveUpNotice;
1564
+ setNotice(gaveUpNotice);
1565
+ }
1566
+ return false;
1567
+ }
1568
+ }
1569
+ const current = latestSendRef.current;
1570
+ if (current.resumesOnSend) return await current.delivery.steer();
1571
+ if (mode !== "steer" || current.singleSend) return await current.delivery.send();
1572
+ return current.delivery.sendAlternate ? await current.delivery.sendAlternate() : await current.delivery.steer();
1573
+ } finally {
1574
+ submittingRef.current = false;
1575
+ if (mountedRef.current) {
1576
+ setSubmitting(false);
1577
+ setSubmittingMode(null);
1578
+ }
1579
+ }
1580
+ },
1581
+ [
1582
+ annotationsIncomplete,
1583
+ blockedByAttachment,
1584
+ clearHeldSendNotice,
1585
+ commandDraftBlocked,
1586
+ delivery,
1587
+ disabled,
1588
+ messages.annotationNotesRequired,
1589
+ messages.heldSendGaveUp,
1590
+ messages.slashCommandBlocked,
1591
+ t,
1592
+ waitsForPreparation
1593
+ ]
1594
+ );
1595
+ const recallingRef = useRef4(false);
1596
+ const caretToEndRef = useRef4(false);
1597
+ const placeCaretAtEnd = useCallback2(() => {
1598
+ const textarea = textareaRef.current;
1599
+ if (!textarea) return;
1600
+ textarea.focus();
1601
+ const end = textarea.value.length;
1602
+ textarea.setSelectionRange(end, end);
1603
+ }, []);
1604
+ useLayoutEffect(() => {
1605
+ if (!caretToEndRef.current) return;
1606
+ caretToEndRef.current = false;
1607
+ placeCaretAtEnd();
1608
+ }, [placeCaretAtEnd, visibleValue]);
1609
+ const recallQueued = useCallback2(async () => {
1610
+ if (!queuedRecall || recallingRef.current) return;
1611
+ recallingRef.current = true;
1612
+ try {
1613
+ const outcome = await queuedRecall.recall();
1614
+ if (!mountedRef.current) return;
1615
+ if (outcome === "recalled") {
1616
+ caretToEndRef.current = true;
1617
+ window.requestAnimationFrame(() => {
1618
+ if (!caretToEndRef.current) return;
1619
+ caretToEndRef.current = false;
1620
+ placeCaretAtEnd();
1621
+ });
1622
+ } else if (outcome === "already_sent") {
1623
+ setNotice({
1624
+ tone: "ok",
1625
+ message: messages.queuedPromptAlreadySent ?? t("composerMessages.queuedPromptAlreadySent")
1626
+ });
1627
+ }
1628
+ } catch {
1629
+ } finally {
1630
+ recallingRef.current = false;
1631
+ }
1632
+ }, [messages.queuedPromptAlreadySent, placeCaretAtEnd, queuedRecall, t]);
1633
+ const handleKeyDown = useCallback2(
1634
+ (event) => {
1635
+ if (paletteEnabled && paletteMounted && palette.onKeyDown(event)) return;
1636
+ if (queuedRecall?.available && !disabled && shouldRecallQueuedOnKey(event, {
1637
+ value: event.currentTarget.value,
1638
+ selectionStart: event.currentTarget.selectionStart,
1639
+ selectionEnd: event.currentTarget.selectionEnd,
1640
+ hasOtherContent: (delivery.annotations?.length ?? 0) > 0 || (draft?.restoredResources.length ?? 0) > 0 || (attachments?.attachments.length ?? 0) > 0,
1641
+ popupOpen: paletteEnabled && paletteMounted && palette.open
1642
+ })) {
1643
+ event.preventDefault();
1644
+ void recallQueued();
1645
+ return;
1646
+ }
1647
+ if (!shouldSubmitOnKey(event)) return;
1648
+ event.preventDefault();
1649
+ void submit(shouldSteerOnKey(event) ? "steer" : "queue");
1650
+ },
1651
+ [
1652
+ attachments,
1653
+ delivery.annotations,
1654
+ disabled,
1655
+ draft?.restoredResources,
1656
+ palette,
1657
+ paletteEnabled,
1658
+ paletteMounted,
1659
+ queuedRecall,
1660
+ recallQueued,
1661
+ submit
1662
+ ]
1663
+ );
1664
+ const handlePaste = useCallback2(
1665
+ (event) => {
1666
+ if (disabled) return;
1667
+ onPaste?.(event);
1668
+ attachments?.addFromPaste(event);
1669
+ },
1670
+ [attachments, disabled, onPaste]
1671
+ );
1672
+ const handleFileChange = useCallback2(
1673
+ (event) => {
1674
+ if (!disabled && event.target.files) attachments?.addFiles(event.target.files);
1675
+ event.target.value = "";
1676
+ },
1677
+ [attachments, disabled]
1678
+ );
1679
+ const helpCommands = useMemo4(
1680
+ () => commands.filter((command) => {
1681
+ if (command.permission && commandContext) {
1682
+ const permissions = commandContext.permissions;
1683
+ return permissions.includes(command.permission) || permissions.includes("workspace:admin");
1684
+ }
1685
+ return true;
1686
+ }),
1687
+ [commandContext, commands]
1688
+ );
1689
+ const calmServiceFailure = useCalmServiceFailure(delivery.error);
1690
+ const calmActionFailure = calmServiceFailure && isActionFailure(delivery.error);
1691
+ const serviceUpdating = calmServiceFailure && !calmActionFailure || delivery.reconnecting === true;
1692
+ const activeNotice = notice ?? (calmActionFailure ? { tone: "ok", message: OPENGENI_UPDATING_ACTION_NOTICE(t) } : delivery.error && !calmServiceFailure ? {
1693
+ tone: "error",
1694
+ message: /control changed|paused while/i.test(delivery.error.message) ? messages.controlChangedError : formatError(
1695
+ delivery.error,
1696
+ composerSubmissionErrorMessage(
1697
+ t,
1698
+ delivery.error,
1699
+ delivery.canBuyCredits ?? true
1700
+ ) || messages.sendFailedError
1701
+ )
1702
+ } : null);
1703
+ useEffect3(() => {
1704
+ if (notice?.tone !== "ok") return;
1705
+ const timer = window.setTimeout(
1706
+ () => setNotice((current) => current === notice ? null : current),
1707
+ 2400
1708
+ );
1709
+ return () => window.clearTimeout(timer);
1710
+ }, [notice]);
1711
+ useEffect3(() => {
1712
+ if (annotationsIncomplete) return;
1713
+ setNotice(
1714
+ (current) => current?.message === messages.annotationNotesRequired ? null : current
1715
+ );
1716
+ }, [annotationsIncomplete, messages.annotationNotesRequired]);
1717
+ const attachmentCount = attachments?.attachments.length ?? 0;
1718
+ useEffect3(() => {
1719
+ clearHeldSendNotice();
1720
+ }, [attachmentCount, clearHeldSendNotice, visibleValue]);
1721
+ const runControlOperation = useCallback2(async (operation) => {
1722
+ if (controlOperationRef.current) return false;
1723
+ controlOperationRef.current = true;
1724
+ try {
1725
+ await operation();
1726
+ return true;
1727
+ } finally {
1728
+ controlOperationRef.current = false;
1729
+ }
1730
+ }, []);
1731
+ const pause = useCallback2(
1732
+ async (reason) => {
1733
+ if (!control || control.pausing || control.resuming) return false;
1734
+ return await runControlOperation(() => control.pause(reason));
1735
+ },
1736
+ [control, runControlOperation]
1737
+ );
1738
+ const resume = useCallback2(
1739
+ async (reason) => {
1740
+ if (!control || control.pausing || control.resuming) return false;
1741
+ return await runControlOperation(() => control.resume(reason));
1742
+ },
1743
+ [control, runControlOperation]
1744
+ );
1745
+ const resumeScope = useCallback2(
1746
+ async (option) => {
1747
+ if (!control || control.pausing || control.resuming) return false;
1748
+ return await runControlOperation(() => control.resumeScope(option));
1749
+ },
1750
+ [control, runControlOperation]
1751
+ );
1752
+ const stop = useCallback2(async () => {
1753
+ const stopped = await pause();
1754
+ if (stopped && mountedRef.current) setStoppedHere(true);
1755
+ return stopped;
1756
+ }, [pause]);
1757
+ return {
1758
+ id,
1759
+ rootRef,
1760
+ textareaRef,
1761
+ imageNumbers,
1762
+ pauseButtonRef,
1763
+ fileInputRef,
1764
+ listboxId,
1765
+ effectiveControl,
1766
+ queuedAheadCount,
1767
+ canControlWorkspace,
1768
+ controlLinks,
1769
+ disabled,
1770
+ attachments,
1771
+ messages,
1772
+ sending: delivery.sending || submitting,
1773
+ error: delivery.error,
1774
+ clearError: delivery.clearError,
1775
+ hasDraftState: draft !== void 0,
1776
+ draftConflict: draft?.draftConflict ?? null,
1777
+ draftSaving: draft?.draftSaving ?? false,
1778
+ restoredResources: draft?.restoredResources ?? [],
1779
+ removeRestoredResource: draft?.removeRestoredResource,
1780
+ fileSource: draft?.fileSource,
1781
+ resolveDraftConflict: draft?.resolveDraftConflict,
1782
+ hasControl: control !== void 0,
1783
+ runControl,
1784
+ running,
1785
+ pausing: control?.pausing ?? false,
1786
+ resuming: control?.resuming ?? false,
1787
+ pause,
1788
+ stop,
1789
+ resume,
1790
+ resumeScope,
1791
+ paused,
1792
+ controlDetailsOpen,
1793
+ setControlDetailsOpen,
1794
+ paletteMounted,
1795
+ setPaletteMounted,
1796
+ dragging,
1797
+ handleDragOver,
1798
+ handleDragLeave,
1799
+ handleDrop,
1800
+ palette,
1801
+ paletteEnabled,
1802
+ commandDraftBlocked,
1803
+ confirmState,
1804
+ settleConfirmation,
1805
+ helpOpen,
1806
+ setHelpOpen,
1807
+ helpCommands,
1808
+ activeNotice,
1809
+ /** Opengeni is updating: show the calm reconnecting line, not an error. */
1810
+ serviceUpdating,
1811
+ serviceUpdatingMessage: OPENGENI_UPDATING_NOTICE(t),
1812
+ canSubmit,
1813
+ submitBlocker,
1814
+ submit,
1815
+ busySend: delivery.busySend ?? "queue",
1816
+ singleSend,
1817
+ /** The agent works here (a turn runs or messages wait); Send uses its working wording and the Steer/Queue choice shows. */
1818
+ working,
1819
+ /** This conversation, work it started or a pending wake keeps it working; Pause is offered (lingers briefly). */
1820
+ workstreamWorking,
1821
+ alternateSend: delivery.sendAlternate && working ? delivery.alternateSend ?? null : null,
1822
+ submittingMode,
1823
+ handleKeyDown,
1824
+ handlePaste,
1825
+ handleFileChange,
1826
+ focusInput: () => textareaRef.current?.focus(),
1827
+ setValue: setComposerValue,
1828
+ value: visibleValue
1829
+ };
1830
+ }
1831
+ var ComposerContext = createContext(null);
1832
+ function useComposerController() {
1833
+ const controller = useContext(ComposerContext);
1834
+ if (!controller) throw new Error("useChatComposer must be used inside <Composer.Root>");
1835
+ return controller;
1836
+ }
1837
+ function useChatComposer() {
1838
+ return useComposerController();
1839
+ }
1840
+ function isRecord(value) {
1841
+ return typeof value === "object" && value !== null;
1842
+ }
1843
+ var Root = forwardRef(function ComposerRoot({ controller, children, className, style, responsiveBasis = "viewport", ...props }, forwardedRef) {
1844
+ const responsiveRootRef = useRef4(null);
1845
+ const responsiveContext = useMemo4(
1846
+ () => ({ responsiveBasis, rootRef: responsiveRootRef }),
1847
+ [responsiveBasis]
1848
+ );
1849
+ return /* @__PURE__ */ jsx4(ComposerContext.Provider, { value: controller, children: /* @__PURE__ */ jsx4(ComposerResponsiveContext.Provider, { value: responsiveContext, children: /* @__PURE__ */ jsx4(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs4(
1850
+ "div",
1851
+ {
1852
+ ...props,
1853
+ ref: mergeRefs(controller.rootRef, responsiveRootRef, forwardedRef),
1854
+ "data-og-composer-id": controller.id,
1855
+ "data-og-responsive-basis": responsiveBasis,
1856
+ className: cn("og-root og-composer", className),
1857
+ style: { paddingBottom: "env(safe-area-inset-bottom)", ...style },
1858
+ children: [
1859
+ children,
1860
+ /* @__PURE__ */ jsx4(ComposerAnnouncements, {})
1861
+ ]
1862
+ }
1863
+ ) }) }) });
1864
+ });
1865
+ var Frame = forwardRef(function ComposerFrame({ className, ...props }, ref) {
1866
+ return /* @__PURE__ */ jsx4("div", { ...props, ref, className: cn("relative", className) });
1867
+ });
1868
+ function CommandPalette2({ className }) {
1869
+ const controller = useComposerController();
1870
+ const setPaletteMounted = controller.setPaletteMounted;
1871
+ useEffect3(() => {
1872
+ setPaletteMounted(true);
1873
+ return () => setPaletteMounted(false);
1874
+ }, [setPaletteMounted]);
1875
+ if (!controller.paletteEnabled) return null;
1876
+ return /* @__PURE__ */ jsx4("div", { className, children: /* @__PURE__ */ jsx4(
1877
+ CommandPalette,
1878
+ {
1879
+ open: controller.palette.open && controller.confirmState === null,
1880
+ items: controller.palette.items,
1881
+ highlight: controller.palette.highlight,
1882
+ onHighlight: controller.palette.setHighlight,
1883
+ onRun: (index) => {
1884
+ controller.palette.setHighlight(index);
1885
+ void controller.palette.runAt(index);
1886
+ },
1887
+ argHintText: controller.palette.activeArgHint,
1888
+ listboxId: controller.listboxId,
1889
+ label: controller.messages.slashCommandsLabel,
1890
+ dangerLabel: controller.messages.danger
1891
+ }
1892
+ ) });
1893
+ }
1894
+ var Surface = forwardRef(function ComposerSurface({ className, children, ...props }, ref) {
1895
+ const controller = useComposerController();
1896
+ return /* @__PURE__ */ jsxs4(
1897
+ "div",
1898
+ {
1899
+ "data-og-composer-surface": "",
1900
+ ...props,
1901
+ ref,
1902
+ onDragOver: controller.attachments ? controller.handleDragOver : void 0,
1903
+ onDragLeave: controller.attachments ? controller.handleDragLeave : void 0,
1904
+ onDrop: controller.attachments ? controller.handleDrop : void 0,
1905
+ className: cn(
1906
+ "relative rounded-og-lg border border-og-border/90 bg-og-surface-1 shadow-og-sm",
1907
+ "transition-[border-color,box-shadow] duration-200 ease-og-out",
1908
+ "focus-within:border-og-accent/50 focus-within:shadow-og-glow",
1909
+ controller.dragging && "border-dashed border-og-accent",
1910
+ className
1911
+ ),
1912
+ children: [
1913
+ controller.dragging ? /* @__PURE__ */ jsx4(
1914
+ "div",
1915
+ {
1916
+ "aria-hidden": true,
1917
+ className: cn(
1918
+ "pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
1919
+ "rounded-og-lg bg-og-surface-1/85 text-og-menu font-medium text-og-accent backdrop-blur-[1px]"
1920
+ ),
1921
+ children: /* @__PURE__ */ jsxs4("span", { className: "inline-flex items-center gap-2", children: [
1922
+ /* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" }),
1923
+ controller.messages.dropFiles
1924
+ ] })
1925
+ }
1926
+ ) : null,
1927
+ children
1928
+ ]
1929
+ }
1930
+ );
1931
+ });
1932
+ function PausedState() {
1933
+ const controller = useComposerController();
1934
+ if (!controller.paused || !controller.effectiveControl || !controller.hasControl) return null;
1935
+ return /* @__PURE__ */ jsx4(
1936
+ WorkstreamPausedStrip,
1937
+ {
1938
+ control: controller.effectiveControl,
1939
+ queuedAheadCount: controller.queuedAheadCount,
1940
+ open: controller.controlDetailsOpen,
1941
+ busy: controller.resuming,
1942
+ sending: controller.sending,
1943
+ canControlWorkspace: controller.canControlWorkspace,
1944
+ controlLinks: controller.controlLinks,
1945
+ messages: controller.messages,
1946
+ onOpenChange: controller.setControlDetailsOpen,
1947
+ onResume: () => void controller.resume(),
1948
+ onResumeOption: (option) => void controller.resumeScope(option)
1949
+ }
1950
+ );
1951
+ }
1952
+ function RestoredResources() {
1953
+ const controller = useComposerController();
1954
+ const resources = controller.restoredResources;
1955
+ const onRemove = controller.removeRestoredResource;
1956
+ const fileSource = controller.fileSource;
1957
+ const uploadedFileIds = new Set(
1958
+ controller.attachments?.attachments.flatMap(
1959
+ (attachment) => attachment.file ? [attachment.file.id] : []
1960
+ ) ?? []
1961
+ );
1962
+ const restoredFiles = resources.flatMap(
1963
+ (resource, index) => resource.kind === "file" && !uploadedFileIds.has(resource.fileId) ? [{ fileId: resource.fileId, index }] : []
1964
+ );
1965
+ const stored = useStoredFiles(
1966
+ fileSource,
1967
+ restoredFiles.map((file) => file.fileId)
1968
+ );
1969
+ const fileIdByIdRef = useRef4(/* @__PURE__ */ new Map());
1970
+ const previewClient = fileSource?.client;
1971
+ const previewWorkspaceId = fileSource?.workspaceId;
1972
+ const previewSessionId = fileSource?.sessionId;
1973
+ const loadPreview = useMemo4(
1974
+ () => previewClient && previewWorkspaceId !== void 0 && typeof previewClient.createFileDownloadUrl === "function" ? async (id) => {
1975
+ const fileId = fileIdByIdRef.current.get(id);
1976
+ return fileId ? await readStoredFilePreviewUrl(
1977
+ {
1978
+ client: previewClient,
1979
+ workspaceId: previewWorkspaceId,
1980
+ sessionId: previewSessionId
1981
+ },
1982
+ fileId
1983
+ ) : void 0;
1984
+ } : void 0,
1985
+ [previewClient, previewSessionId, previewWorkspaceId]
1986
+ );
1987
+ if (resources.length === 0 || !onRemove) return null;
1988
+ const fileEntries = stored.ready ? restoredFiles.flatMap(({ fileId, index }) => {
1989
+ const file = stored.files.get(fileId);
1990
+ return file ? [
1991
+ {
1992
+ index,
1993
+ attachment: storedFileAttachment(`restored-resource:${index}:${file.id}`, file)
1994
+ }
1995
+ ] : [];
1996
+ }) : [];
1997
+ const shownFileIds = new Set(fileEntries.map((entry) => entry.attachment.file.id));
1998
+ const otherEntries = resources.flatMap(
1999
+ (resource, index) => resource.kind !== "file" || stored.ready && !uploadedFileIds.has(resource.fileId) && !shownFileIds.has(resource.fileId) ? [{ resource, index }] : []
2000
+ );
2001
+ const indexById = new Map(fileEntries.map((entry) => [entry.attachment.id, entry.index]));
2002
+ fileIdByIdRef.current = new Map(
2003
+ fileEntries.map((entry) => [entry.attachment.id, entry.attachment.file.id])
2004
+ );
2005
+ const imageNumbers = controller.imageNumbers;
2006
+ const restoredImageNumbers = imageNumbers ? new Map(
2007
+ fileEntries.flatMap((entry) => {
2008
+ const number = imageNumbers.get(restoredImageKey(entry.attachment.file.id));
2009
+ return number === void 0 ? [] : [[entry.attachment.id, number]];
2010
+ })
2011
+ ) : void 0;
2012
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
2013
+ fileEntries.length > 0 ? /* @__PURE__ */ jsx4(
2014
+ AttachmentChips,
2015
+ {
2016
+ className: ATTACHMENT_CHIPS_PADDING,
2017
+ attachments: fileEntries.map((entry) => entry.attachment),
2018
+ messages: controller.messages,
2019
+ disabled: controller.disabled,
2020
+ onRemove: (id) => {
2021
+ const index = indexById.get(id);
2022
+ if (index !== void 0) onRemove(index);
2023
+ },
2024
+ onLoadPreview: loadPreview,
2025
+ imageNumbers: restoredImageNumbers
2026
+ }
2027
+ ) : null,
2028
+ otherEntries.length > 0 ? /* @__PURE__ */ jsx4(
2029
+ RestoredResourceChips,
2030
+ {
2031
+ entries: otherEntries,
2032
+ messages: controller.messages,
2033
+ onRemove,
2034
+ imageNumbers: controller.imageNumbers
2035
+ }
2036
+ ) : null
2037
+ ] });
2038
+ }
2039
+ var ATTACHMENT_CHIPS_PADDING = "px-3 pt-2 pb-0.5";
2040
+ function Attachments() {
2041
+ const controller = useComposerController();
2042
+ if (!controller.attachments || controller.attachments.attachments.length === 0) return null;
2043
+ return /* @__PURE__ */ jsx4(
2044
+ AttachmentChips,
2045
+ {
2046
+ className: ATTACHMENT_CHIPS_PADDING,
2047
+ attachments: controller.attachments.attachments,
2048
+ messages: controller.messages,
2049
+ disabled: controller.disabled,
2050
+ onRemove: controller.attachments.remove,
2051
+ onRetry: controller.attachments.retry,
2052
+ onRetainPreview: controller.attachments.retainPreview,
2053
+ onLoadPreview: controller.attachments.loadPreview,
2054
+ imageNumbers: controller.imageNumbers
2055
+ }
2056
+ );
2057
+ }
2058
+ var EDITING_FOCUS_SELECTOR = 'input, textarea, select, [contenteditable="true"], [role="textbox"]';
2059
+ var POPUP_FOCUS_SELECTOR = '[role="menu"], [role="menubar"], [role="listbox"], [role="dialog"], [role="alertdialog"]';
2060
+ function focusBelongsElsewhere(textarea) {
2061
+ const active = textarea.ownerDocument.activeElement;
2062
+ if (!active || active === textarea) return false;
2063
+ if (active.closest(EDITING_FOCUS_SELECTOR)) return true;
2064
+ const popup = active.closest(POPUP_FOCUS_SELECTOR);
2065
+ if (popup) return !popup.contains(textarea);
2066
+ return active !== textarea.ownerDocument.body && active !== textarea.ownerDocument.documentElement;
2067
+ }
2068
+ var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className, "aria-label": ariaLabel, autoFocus = false, ...props }, forwardedRef) {
2069
+ const controller = useComposerController();
2070
+ const autoFocusedRef = useRef4(false);
2071
+ const paletteOpen = controller.paletteEnabled && controller.paletteMounted && controller.palette.open;
2072
+ useEffect3(() => {
2073
+ if (!autoFocus || controller.disabled || autoFocusedRef.current) return;
2074
+ const frame = window.requestAnimationFrame(() => {
2075
+ const textarea = controller.textareaRef.current;
2076
+ if (!textarea || textarea.disabled) return;
2077
+ autoFocusedRef.current = true;
2078
+ if (focusBelongsElsewhere(textarea)) return;
2079
+ textarea.focus();
2080
+ });
2081
+ return () => window.cancelAnimationFrame(frame);
2082
+ }, [autoFocus, controller.disabled, controller.textareaRef]);
2083
+ useEffect3(() => {
2084
+ const textarea = controller.textareaRef.current;
2085
+ if (!textarea || typeof ResizeObserver === "undefined") return;
2086
+ let width = textarea.clientWidth;
2087
+ let frame = null;
2088
+ const observer = new ResizeObserver(() => {
2089
+ if (textarea.clientWidth === width) return;
2090
+ width = textarea.clientWidth;
2091
+ if (frame !== null) return;
2092
+ frame = window.requestAnimationFrame(() => {
2093
+ frame = null;
2094
+ applyComposerTextareaHeight(textarea, 220);
2095
+ });
2096
+ });
2097
+ observer.observe(textarea);
2098
+ return () => {
2099
+ observer.disconnect();
2100
+ if (frame !== null) window.cancelAnimationFrame(frame);
2101
+ };
2102
+ }, [controller.textareaRef]);
2103
+ return /* @__PURE__ */ jsx4(
2104
+ "textarea",
2105
+ {
2106
+ ...props,
2107
+ ref: mergeRefs(controller.textareaRef, forwardedRef),
2108
+ rows,
2109
+ value: controller.value,
2110
+ onChange: (event) => controller.setValue(event.target.value),
2111
+ onKeyDown: controller.handleKeyDown,
2112
+ onPaste: controller.handlePaste,
2113
+ placeholder: controller.paused && !controller.disabled ? controller.messages.pausedPlaceholder : placeholder ?? controller.messages.messagePlaceholder,
2114
+ disabled: controller.disabled,
2115
+ "aria-label": ariaLabel ?? controller.messages.inputLabel,
2116
+ "aria-keyshortcuts": "Enter Meta+Enter Control+Enter Shift+Enter",
2117
+ "aria-autocomplete": controller.paletteEnabled && controller.paletteMounted ? "list" : void 0,
2118
+ "aria-controls": paletteOpen ? controller.listboxId : void 0,
2119
+ "aria-activedescendant": paletteOpen ? `${controller.listboxId}-option-${controller.palette.highlight}` : void 0,
2120
+ className: cn(
2121
+ "og-composer-input block w-full resize-none bg-transparent px-3.5 pt-3 pb-1 text-og-composer md:px-4 md:text-og-composer-wide pointer-coarse:min-h-11",
2122
+ "text-og-fg placeholder:text-og-fg-subtle focus:outline-hidden focus-visible:outline-hidden",
2123
+ "disabled:cursor-not-allowed disabled:opacity-60",
2124
+ className
2125
+ )
2126
+ }
2127
+ );
2128
+ });
2129
+ function Confirmation() {
2130
+ const controller = useComposerController();
2131
+ const command = controller.confirmState?.command;
2132
+ if (!command || !controller.confirmState) return null;
2133
+ return /* @__PURE__ */ jsx4(
2134
+ ConfirmBar,
2135
+ {
2136
+ command,
2137
+ messages: controller.messages,
2138
+ onCancel: () => controller.settleConfirmation(false),
2139
+ onConfirm: () => controller.settleConfirmation(true),
2140
+ returnFocusRef: controller.textareaRef
2141
+ }
2142
+ );
2143
+ }
2144
+ var Footer = forwardRef(function ComposerFooter({ className, children, ...props }, ref) {
2145
+ const signals = useComposerFooterSignalState();
2146
+ return /* @__PURE__ */ jsx4(
2147
+ "div",
2148
+ {
2149
+ ...props,
2150
+ ...signals.attributes,
2151
+ ref,
2152
+ className: cn(
2153
+ "og-composer-footer flex items-end gap-1.5 px-2 pb-2 pt-0.5 sm:px-2.5 sm:pb-2.5",
2154
+ // Mobile: one control row — never wrap into a second toolbar line.
2155
+ "max-sm:flex-nowrap max-sm:items-center max-sm:gap-1",
2156
+ className
2157
+ ),
2158
+ children: /* @__PURE__ */ jsx4(ComposerFooterSignalProvider, { value: signals.report, children })
2159
+ }
2160
+ );
2161
+ });
2162
+ var Controls = forwardRef(
2163
+ function ComposerControls({ className, ...props }, ref) {
2164
+ return /* @__PURE__ */ jsx4(
2165
+ "span",
2166
+ {
2167
+ ...props,
2168
+ ref,
2169
+ className: cn(
2170
+ "og-composer-controls flex min-w-0 flex-1 flex-wrap items-center gap-1.5",
2171
+ // Phone: 44px touch targets already space themselves; tight gaps leave
2172
+ // the model pill room for its name.
2173
+ "max-sm:flex-nowrap max-sm:gap-0.5",
2174
+ className
2175
+ )
2176
+ }
2177
+ );
2178
+ }
2179
+ );
2180
+ var Hint = forwardRef(function ComposerHint({ className, children, ...props }, ref) {
2181
+ const controller = useComposerController();
2182
+ return /* @__PURE__ */ jsx4(
2183
+ "span",
2184
+ {
2185
+ ...props,
2186
+ ref,
2187
+ className: cn(
2188
+ "og-composer-hint min-w-0 flex-1 px-1.5 text-og-xs text-og-fg-subtle max-sm:hidden",
2189
+ className
2190
+ ),
2191
+ children: children ?? controller.messages.keyboardHint
2192
+ }
2193
+ );
2194
+ });
2195
+ var Actions = forwardRef(function ComposerActions({ className, ...props }, ref) {
2196
+ return /* @__PURE__ */ jsx4(
2197
+ "span",
2198
+ {
2199
+ ...props,
2200
+ ref,
2201
+ className: cn(
2202
+ "og-composer-actions ml-auto flex shrink-0 items-center gap-1.5",
2203
+ "max-sm:flex-nowrap max-sm:gap-0.5",
2204
+ className
2205
+ )
2206
+ }
2207
+ );
2208
+ });
2209
+ var AttachButton = forwardRef(
2210
+ function ComposerAttachButton({ accept, multiple = true, className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2211
+ const controller = useComposerController();
2212
+ if (!controller.attachments) return null;
2213
+ const tip = title ?? controller.messages.attachFiles;
2214
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
2215
+ /* @__PURE__ */ jsx4(
2216
+ "input",
2217
+ {
2218
+ ref: controller.fileInputRef,
2219
+ type: "file",
2220
+ accept,
2221
+ multiple,
2222
+ "data-og-composer-attach": true,
2223
+ className: "hidden",
2224
+ onChange: controller.handleFileChange
2225
+ }
2226
+ ),
2227
+ /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2228
+ "button",
2229
+ {
2230
+ ...props,
2231
+ ref,
2232
+ type: "button",
2233
+ disabled: controller.disabled,
2234
+ onClick: () => controller.fileInputRef.current?.click(),
2235
+ "aria-label": ariaLabel ?? tip,
2236
+ className: cn(
2237
+ "inline-flex size-8 items-center justify-center rounded-og-md",
2238
+ "text-og-fg-muted transition-colors duration-150 hover:bg-og-surface-2 hover:text-og-fg",
2239
+ "disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11",
2240
+ className
2241
+ ),
2242
+ children: children ?? /* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" })
2243
+ }
2244
+ ) })
2245
+ ] });
2246
+ }
2247
+ );
2248
+ function ModelPicker2({
2249
+ models,
2250
+ rows,
2251
+ value,
2252
+ onChange,
2253
+ label,
2254
+ className,
2255
+ codexOnly
2256
+ }) {
2257
+ const controller = useComposerController();
2258
+ return /* @__PURE__ */ jsx4(
2259
+ ModelPicker,
2260
+ {
2261
+ models,
2262
+ rows,
2263
+ value,
2264
+ onChange: (modelId) => onChange?.(modelId),
2265
+ disabled: controller.disabled,
2266
+ label: label ?? controller.messages.modelLabel,
2267
+ className,
2268
+ codexOnly
2269
+ }
2270
+ );
2271
+ }
2272
+ function pausePresence(controller) {
2273
+ if (controller.runControl !== "pause" || !controller.effectiveControl || controller.paused || !controller.hasControl)
2274
+ return "none";
2275
+ return controller.workstreamWorking ? "shown" : "reserved";
2276
+ }
2277
+ var PAUSE_BOX_CLASS = "inline-flex size-8 items-center justify-center pointer-coarse:size-11";
2278
+ var PAUSE_YIELDS_CLASS = "og-composer-pause-yields max-sm:hidden";
2279
+ function PauseButtonSlot() {
2280
+ const controller = useComposerController();
2281
+ if (pausePresence(controller) !== "reserved") return null;
2282
+ return /* @__PURE__ */ jsx4(
2283
+ "span",
2284
+ {
2285
+ "aria-hidden": true,
2286
+ "data-og-composer-pause-slot": "",
2287
+ className: cn(
2288
+ PAUSE_BOX_CLASS,
2289
+ "invisible shrink-0",
2290
+ controller.submitBlocker !== "empty" && PAUSE_YIELDS_CLASS
2291
+ )
2292
+ }
2293
+ );
2294
+ }
2295
+ var PauseButton = forwardRef(
2296
+ function ComposerPauseButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2297
+ const controller = useComposerController();
2298
+ if (pausePresence(controller) !== "shown") return null;
2299
+ const busy = controller.pausing || controller.resuming;
2300
+ const tip = title ?? controller.messages.pauseTitle;
2301
+ const yieldsToDraft = controller.submitBlocker !== "empty";
2302
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2303
+ "button",
2304
+ {
2305
+ "data-analytics-action": "pause",
2306
+ ...props,
2307
+ ref: mergeRefs(controller.pauseButtonRef, ref),
2308
+ type: "button",
2309
+ onClick: () => void controller.pause(),
2310
+ disabled: busy,
2311
+ "aria-label": ariaLabel ?? controller.messages.pauseAriaLabel,
2312
+ className: cn(
2313
+ PAUSE_BOX_CLASS,
2314
+ "rounded-og-md border border-og-border",
2315
+ "bg-og-surface-2 text-og-fg-muted transition-colors duration-150",
2316
+ "hover:border-og-status-waiting/50 hover:text-og-status-waiting",
2317
+ "disabled:opacity-50",
2318
+ yieldsToDraft && PAUSE_YIELDS_CLASS,
2319
+ className
2320
+ ),
2321
+ children: children ?? (busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 fill-current" }))
2322
+ }
2323
+ ) });
2324
+ }
2325
+ );
2326
+ var StopButton = forwardRef(
2327
+ function ComposerStopButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2328
+ const t = useOpenGeniText();
2329
+ const controller = useComposerController();
2330
+ if (controller.runControl !== "stop" || !controller.running || !controller.hasControl || controller.effectiveControl?.state === "paused")
2331
+ return null;
2332
+ const busy = controller.pausing;
2333
+ const label = ariaLabel ?? controller.messages.stopAriaLabel ?? t("composer.stop");
2334
+ const tip = title ?? controller.messages.stopTitle ?? label;
2335
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2336
+ "button",
2337
+ {
2338
+ "data-analytics-action": "stop",
2339
+ "data-og-composer-stop": "",
2340
+ ...props,
2341
+ ref,
2342
+ type: "button",
2343
+ onClick: () => void controller.stop(),
2344
+ disabled: busy,
2345
+ "aria-label": label,
2346
+ className: cn(
2347
+ "inline-flex size-8 items-center justify-center rounded-og-md border border-og-border pointer-coarse:size-11",
2348
+ "bg-og-surface-1 text-og-fg transition-colors duration-150",
2349
+ "hover:bg-og-surface-2 disabled:opacity-50",
2350
+ className
2351
+ ),
2352
+ children: children ?? (busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(SquareIcon, { className: "size-3 fill-current" }))
2353
+ }
2354
+ ) });
2355
+ }
2356
+ );
2357
+ var AlternateSendButton = forwardRef(
2358
+ function ComposerAlternateSendButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2359
+ const t = useOpenGeniText();
2360
+ const controller = useComposerController();
2361
+ if (controller.alternateSend === null || controller.paused || controller.submitBlocker === "empty" || controller.submitBlocker === "disabled")
2362
+ return null;
2363
+ const queues = controller.alternateSend === "queue";
2364
+ const label = queues ? controller.messages.queueLabel ?? t("composerMessages.queue") : controller.messages.steerLabel ?? t("composerMessages.steer");
2365
+ const tip = title ?? (controller.submitBlocker === "annotations" ? controller.messages.annotationNotesRequired : queues ? controller.messages.queueTitle ?? t("composerMessages.queueRunsAfterCurrentWork") : controller.messages.steerTitle ?? t("composerMessages.steerReadsItSoon"));
2366
+ const inFlight = controller.sending && controller.submittingMode === "steer";
2367
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2368
+ "button",
2369
+ {
2370
+ "data-analytics-action": queues ? "queue" : "steer",
2371
+ "data-og-composer-alternate-send": "",
2372
+ ...props,
2373
+ ref,
2374
+ type: "button",
2375
+ onClick: (event) => {
2376
+ const hadFocus = event.currentTarget === document.activeElement;
2377
+ void controller.submit("steer").then((sent) => {
2378
+ if (sent && hadFocus) controller.focusInput();
2379
+ });
2380
+ },
2381
+ disabled: !controller.canSubmit,
2382
+ "aria-label": ariaLabel ?? label,
2383
+ "aria-keyshortcuts": "Meta+Enter Control+Enter",
2384
+ className: cn(
2385
+ "inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-og-md px-2.5 pointer-coarse:h-11 pointer-coarse:px-3.5",
2386
+ "border border-og-border bg-og-surface-1 text-og-control font-medium text-og-fg",
2387
+ "transition-[background-color,transform,opacity] duration-150 ease-og-spring",
2388
+ "hover:bg-og-surface-2 active:scale-95",
2389
+ "disabled:cursor-not-allowed disabled:opacity-50",
2390
+ className
2391
+ ),
2392
+ children: children ?? (inFlight ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
2393
+ /* @__PURE__ */ jsx4(LoaderCircleIcon2, { "aria-hidden": "true", className: "size-3.5 animate-og-spin" }),
2394
+ /* @__PURE__ */ jsx4("span", { children: label })
2395
+ ] }) : label)
2396
+ }
2397
+ ) });
2398
+ }
2399
+ );
2400
+ var SendButton = forwardRef(
2401
+ function ComposerSendButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2402
+ const controller = useComposerController();
2403
+ const tip = title ?? (controller.submitBlocker === "annotations" ? controller.messages.annotationNotesRequired : controller.paused ? controller.messages.sendAndResumeTitle : !controller.working ? controller.messages.idleSendTitle ?? controller.messages.sendTitle : controller.busySend === "steer" ? controller.messages.steerSendTitle ?? controller.messages.sendTitle : controller.messages.sendTitle);
2404
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2405
+ "button",
2406
+ {
2407
+ "data-analytics-action": "send",
2408
+ ...props,
2409
+ ref,
2410
+ type: "button",
2411
+ onClick: (event) => {
2412
+ const hadFocus = event.currentTarget === document.activeElement;
2413
+ void controller.submit("queue").then((sent) => {
2414
+ if (sent && hadFocus) controller.focusInput();
2415
+ });
2416
+ },
2417
+ disabled: !controller.canSubmit,
2418
+ "data-og-tip": tip,
2419
+ "aria-label": ariaLabel ?? (controller.paused ? controller.messages.sendAndResumeAriaLabel : controller.messages.sendMessageAriaLabel),
2420
+ className: cn(
2421
+ "inline-flex size-8 items-center justify-center rounded-og-md pointer-coarse:size-11",
2422
+ "border border-og-primary-border bg-og-primary text-og-primary-fg",
2423
+ "transition-[background-color,transform,opacity] duration-150 ease-og-spring",
2424
+ "hover:bg-og-primary-hover active:scale-95",
2425
+ "disabled:cursor-not-allowed disabled:opacity-50",
2426
+ className
2427
+ ),
2428
+ children: children ?? (controller.sending && controller.submittingMode !== "steer" ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-4 animate-og-spin" }) : /* @__PURE__ */ jsx4(ArrowUpIcon, { className: "size-4" }))
2429
+ }
2430
+ ) });
2431
+ }
2432
+ );
2433
+ function Help() {
2434
+ const controller = useComposerController();
2435
+ return /* @__PURE__ */ jsx4(AnimatePresence2, { children: controller.helpOpen ? /* @__PURE__ */ jsx4(
2436
+ HelpPanel,
2437
+ {
2438
+ commands: controller.helpCommands,
2439
+ messages: controller.messages,
2440
+ onClose: () => controller.setHelpOpen(false)
2441
+ }
2442
+ ) : null });
2443
+ }
2444
+ function Status() {
2445
+ const controller = useComposerController();
2446
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
2447
+ /* @__PURE__ */ jsx4(AnimatePresence2, { children: controller.activeNotice ? (
2448
+ // Visible only: the composer root's ComposerAnnouncements region
2449
+ // already announces this notice, so a second live region here would
2450
+ // make screen readers read it twice.
2451
+ /* @__PURE__ */ jsx4(
2452
+ motion2.p,
2453
+ {
2454
+ initial: { opacity: 0, height: 0 },
2455
+ animate: { opacity: 1, height: "auto" },
2456
+ exit: { opacity: 0, height: 0 },
2457
+ className: cn(
2458
+ "overflow-hidden px-1 pt-1.5 text-og-control",
2459
+ controller.activeNotice.tone === "ok" ? "text-og-fg-muted" : "text-og-status-failed"
2460
+ ),
2461
+ children: controller.activeNotice.message
2462
+ },
2463
+ "notice"
2464
+ )
2465
+ ) : controller.serviceUpdating ? /* @__PURE__ */ jsxs4(
2466
+ motion2.p,
2467
+ {
2468
+ "data-og-composer-status": "updating",
2469
+ initial: { opacity: 0, height: 0 },
2470
+ animate: { opacity: 1, height: "auto" },
2471
+ exit: { opacity: 0, height: 0 },
2472
+ className: "flex items-center gap-1.5 overflow-hidden px-1 pt-1.5 text-og-control text-og-fg-muted",
2473
+ children: [
2474
+ /* @__PURE__ */ jsx4(
2475
+ LoaderCircleIcon2,
2476
+ {
2477
+ "aria-hidden": "true",
2478
+ className: "size-3.5 shrink-0 animate-og-spin motion-reduce:animate-none"
2479
+ }
2480
+ ),
2481
+ /* @__PURE__ */ jsx4("span", { children: controller.serviceUpdatingMessage })
2482
+ ]
2483
+ },
2484
+ "service-updating"
2485
+ ) : null }),
2486
+ controller.draftConflict ? /* @__PURE__ */ jsxs4("div", { className: "mt-1.5 flex flex-wrap items-center gap-2 px-1 text-og-xs text-og-status-failed", children: [
2487
+ /* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: controller.messages.draftConflict }),
2488
+ /* @__PURE__ */ jsx4(
2489
+ "button",
2490
+ {
2491
+ type: "button",
2492
+ className: "underline underline-offset-2",
2493
+ onClick: () => void controller.resolveDraftConflict?.("use_remote"),
2494
+ children: controller.messages.useOtherDraft
2495
+ }
2496
+ ),
2497
+ /* @__PURE__ */ jsx4(
2498
+ "button",
2499
+ {
2500
+ type: "button",
2501
+ className: "font-medium underline underline-offset-2",
2502
+ onClick: () => void controller.resolveDraftConflict?.("keep_mine"),
2503
+ children: controller.messages.keepMine
2504
+ }
2505
+ )
2506
+ ] }) : null
2507
+ ] });
2508
+ }
2509
+ function ComposerAnnouncements() {
2510
+ const controller = useComposerController();
2511
+ return /* @__PURE__ */ jsxs4("div", { className: "sr-only", children: [
2512
+ controller.activeNotice ? /* @__PURE__ */ jsx4("p", { role: controller.activeNotice.tone === "error" ? "alert" : "status", children: controller.activeNotice.message }) : controller.serviceUpdating ? /* @__PURE__ */ jsx4("p", { role: "status", children: controller.serviceUpdatingMessage }) : null,
2513
+ controller.draftConflict ? /* @__PURE__ */ jsx4("p", { role: "alert", children: controller.messages.draftConflict }) : null
2514
+ ] });
2515
+ }
2516
+ function mergeRefs(...refs) {
2517
+ return (node) => {
2518
+ for (const ref of refs) {
2519
+ if (typeof ref === "function") ref(node);
2520
+ else if (ref) ref.current = node;
2521
+ }
2522
+ };
2523
+ }
2524
+ function WorkstreamPausedStrip({
2525
+ control,
2526
+ queuedAheadCount,
2527
+ open,
2528
+ busy,
2529
+ sending,
2530
+ canControlWorkspace,
2531
+ controlLinks,
2532
+ messages,
2533
+ onOpenChange,
2534
+ onResume,
2535
+ onResumeOption
2536
+ }) {
2537
+ const blocker = control.primaryBlocker;
2538
+ const cause = blocker?.kind === "workspace" ? messages.workspacePaused : control.directState === "paused" ? messages.pausedHere : messages.pausedBy(blocker?.displayName ?? messages.parentBlocker);
2539
+ const primary = control.resumeOptions.find((option) => option.scope === "selected");
2540
+ const broaderOptions = control.resumeOptions.filter(
2541
+ (option) => option !== primary && option.scope !== "selected" && (option.scope !== "workspace" || canControlWorkspace)
2542
+ );
2543
+ return /* @__PURE__ */ jsxs4("div", { className: "border-b border-og-status-waiting/25 bg-og-status-waiting/[0.07]", children: [
2544
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 px-3 py-2", children: [
2545
+ /* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 shrink-0 text-og-status-waiting" }),
2546
+ /* @__PURE__ */ jsxs4(
2547
+ "button",
2548
+ {
2549
+ type: "button",
2550
+ className: "min-w-0 flex-1 text-left",
2551
+ onClick: () => onOpenChange(!open),
2552
+ "aria-expanded": open,
2553
+ children: [
2554
+ /* @__PURE__ */ jsx4("span", { className: "block truncate text-og-xs font-medium text-og-fg", children: cause }),
2555
+ /* @__PURE__ */ jsx4("span", { className: "block truncate text-[11px] text-og-fg-muted", children: queuedAheadCount > 0 ? messages.queuedAhead(queuedAheadCount) : sending ? messages.resumingAndSending : messages.nextMessageResumes })
2556
+ ]
2557
+ }
2558
+ ),
2559
+ /* @__PURE__ */ jsxs4(
2560
+ "button",
2561
+ {
2562
+ type: "button",
2563
+ "aria-label": messages.resumeThisWorkstream,
2564
+ className: "inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-og-md border border-og-primary-border bg-og-primary px-2.5 text-og-xs font-medium text-og-primary-fg hover:bg-og-primary-hover disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
2565
+ disabled: busy,
2566
+ onClick: onResume,
2567
+ children: [
2568
+ busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PlayIcon, { className: "size-3.5 fill-current" }),
2569
+ /* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-long hidden min-[400px]:inline", children: messages.resumeThisWorkstream }),
2570
+ /* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-short min-[400px]:hidden", children: messages.resumeShort })
2571
+ ]
2572
+ }
2573
+ ),
2574
+ /* @__PURE__ */ jsx4(
2575
+ "button",
2576
+ {
2577
+ type: "button",
2578
+ className: "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md text-og-fg-muted hover:bg-og-surface-2 pointer-coarse:size-11",
2579
+ onClick: () => onOpenChange(!open),
2580
+ "aria-label": open ? messages.hidePauseDetails : messages.showPauseDetails,
2581
+ children: /* @__PURE__ */ jsx4(ChevronDownIcon2, { className: cn("size-3.5 transition-transform", open && "rotate-180") })
2582
+ }
2583
+ )
2584
+ ] }),
2585
+ open ? /* @__PURE__ */ jsxs4("div", { className: "border-t border-og-status-waiting/20 px-3 pb-3 pt-2", children: [
2586
+ /* @__PURE__ */ jsx4("ul", { className: "grid gap-2", "aria-label": messages.pauseReasonsLabel, children: control.blockers.map((entry, index) => /* @__PURE__ */ jsxs4(
2587
+ "li",
2588
+ {
2589
+ className: "text-og-xs",
2590
+ children: [
2591
+ /* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: index === 0 ? messages.pausedByLabel : messages.alsoPausedByLabel }),
2592
+ blockerHref(entry, controlLinks) ? /* @__PURE__ */ jsx4(
2593
+ "a",
2594
+ {
2595
+ href: blockerHref(entry, controlLinks),
2596
+ className: "font-medium text-og-fg underline decoration-og-border-strong underline-offset-2 hover:text-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
2597
+ children: entry.displayName
2598
+ }
2599
+ ) : /* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: entry.displayName }),
2600
+ entry.reason ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-muted", children: [
2601
+ " \xB7 ",
2602
+ entry.reason
2603
+ ] }) : null,
2604
+ entry.actor ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
2605
+ " \xB7 ",
2606
+ entry.actor
2607
+ ] }) : null,
2608
+ entry.changedAt ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
2609
+ " ",
2610
+ "\xB7 ",
2611
+ messages.formatRelativeTime(entry.changedAt)
2612
+ ] }) : null
2613
+ ]
2614
+ },
2615
+ `${entry.kind}-${entry.sessionId ?? "workspace"}-${entry.revision}`
2616
+ )) }),
2617
+ broaderOptions.length > 0 ? /* @__PURE__ */ jsx4("div", { className: "mt-2 flex flex-wrap gap-1.5", children: broaderOptions.map((option) => /* @__PURE__ */ jsx4(
2618
+ ComposerTip,
2619
+ {
2620
+ tip: option.impactCopy,
2621
+ children: /* @__PURE__ */ jsxs4(
2622
+ "button",
2623
+ {
2624
+ type: "button",
2625
+ disabled: busy,
2626
+ onClick: () => onResumeOption(option),
2627
+ className: "rounded-og-md border border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg pointer-coarse:min-h-10",
2628
+ children: [
2629
+ /* @__PURE__ */ jsx4("span", { className: "block font-medium", children: option.scope === "workspace" ? messages.resumeWorkspace : messages.resumeFromSession }),
2630
+ /* @__PURE__ */ jsx4("span", { className: "block text-[10px] text-og-fg-subtle", children: option.selectedStateAfter === "active" ? messages.sessionCanRun : messages.stillPausedBy(
2631
+ option.remainingPrimaryBlocker?.displayName ?? messages.narrowerPause
2632
+ ) })
2633
+ ]
2634
+ }
2635
+ )
2636
+ },
2637
+ `${option.scope}-${option.targetId ?? "selected"}`
2638
+ )) }) : null
2639
+ ] }) : null
2640
+ ] });
2641
+ }
2642
+ function blockerHref(blocker, links) {
2643
+ if (blocker.kind === "workspace") return links?.workspaceHref;
2644
+ return blocker.sessionId ? links?.sessionHref?.(blocker.sessionId) : void 0;
2645
+ }
2646
+ function RestoredResourceChips({
2647
+ entries,
2648
+ messages,
2649
+ onRemove,
2650
+ imageNumbers
2651
+ }) {
2652
+ const t = useOpenGeniText();
2653
+ return /* @__PURE__ */ jsx4(
2654
+ "div",
2655
+ {
2656
+ className: "flex flex-wrap gap-1.5 border-b border-og-border px-3 py-2",
2657
+ "aria-label": messages.restoredResourcesLabel,
2658
+ children: entries.map(({ resource, index }) => /* @__PURE__ */ jsxs4(
2659
+ "span",
2660
+ {
2661
+ className: "inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-og-md border border-og-border bg-og-surface-2 px-2 py-1 text-og-xs text-og-fg-muted",
2662
+ children: [
2663
+ /* @__PURE__ */ jsx4(FileIcon2, { className: "size-3 shrink-0" }),
2664
+ resource.kind === "file" && imageNumbers?.has(restoredImageKey(resource.fileId)) ? /* @__PURE__ */ jsx4(ImageTagLabel, { children: t("composer.imageTag", {
2665
+ number: imageNumbers.get(restoredImageKey(resource.fileId))
2666
+ }) }) : null,
2667
+ /* @__PURE__ */ jsx4("span", { className: "truncate", children: resource.kind === "file" ? messages.restoredFile(resource.fileId) : resource.uri }),
2668
+ /* @__PURE__ */ jsx4(
2669
+ "button",
2670
+ {
2671
+ type: "button",
2672
+ className: "shrink-0 hover:text-og-fg",
2673
+ onClick: () => onRemove(index),
2674
+ "aria-label": messages.removeRestoredResource(index),
2675
+ children: /* @__PURE__ */ jsx4(XIcon2, { className: "size-3" })
2676
+ }
2677
+ )
2678
+ ]
2679
+ },
2680
+ `${resource.kind}-${resource.kind === "file" ? resource.fileId : resource.uri}`
2681
+ ))
2682
+ }
2683
+ );
2684
+ }
2685
+ function ConfirmBar({
2686
+ command,
2687
+ messages,
2688
+ onCancel,
2689
+ onConfirm,
2690
+ returnFocusRef
2691
+ }) {
2692
+ const confirmRef = useRef4(null);
2693
+ const descriptionId = useId2();
2694
+ useEffect3(() => {
2695
+ const returnTo = returnFocusRef?.current ?? null;
2696
+ confirmRef.current?.focus();
2697
+ return () => returnTo?.focus();
2698
+ }, [returnFocusRef]);
2699
+ return /* @__PURE__ */ jsxs4(
2700
+ "div",
2701
+ {
2702
+ role: "alertdialog",
2703
+ "aria-label": messages.confirmCommand(command.name),
2704
+ "aria-describedby": descriptionId,
2705
+ "data-testid": "danger-confirm",
2706
+ onKeyDown: (event) => {
2707
+ if (event.key === "Escape") {
2708
+ event.preventDefault();
2709
+ event.stopPropagation();
2710
+ onCancel();
2711
+ }
2712
+ },
2713
+ className: "flex items-end justify-between gap-2 px-2.5 pb-2.5 pt-1",
2714
+ children: [
2715
+ /* @__PURE__ */ jsx4("span", { id: descriptionId, className: "min-w-0 flex-1 px-1.5 text-og-sm text-og-status-failed", children: messages.confirmDescription(command) }),
2716
+ /* @__PURE__ */ jsxs4("span", { className: "flex shrink-0 items-center gap-1.5", children: [
2717
+ /* @__PURE__ */ jsx4(
2718
+ "button",
2719
+ {
2720
+ type: "button",
2721
+ onClick: onCancel,
2722
+ className: "rounded-og-md border border-og-border bg-og-surface-2 px-2.5 py-1 text-og-sm text-og-fg-muted hover:bg-og-surface-3 pointer-coarse:min-h-11",
2723
+ children: messages.cancel
2724
+ }
2725
+ ),
2726
+ /* @__PURE__ */ jsx4(
2727
+ "button",
2728
+ {
2729
+ ref: confirmRef,
2730
+ type: "button",
2731
+ onClick: onConfirm,
2732
+ className: "rounded-og-md border border-og-status-failed/50 bg-og-status-failed/15 px-2.5 py-1 text-og-sm text-og-status-failed hover:bg-og-status-failed/25 pointer-coarse:min-h-11",
2733
+ children: messages.runCommand(command.name)
2734
+ }
2735
+ )
2736
+ ] })
2737
+ ]
2738
+ }
2739
+ );
2740
+ }
2741
+ function HelpPanel({
2742
+ commands,
2743
+ messages,
2744
+ onClose
2745
+ }) {
2746
+ return /* @__PURE__ */ jsxs4(
2747
+ motion2.div,
2748
+ {
2749
+ initial: { opacity: 0, height: 0 },
2750
+ animate: { opacity: 1, height: "auto" },
2751
+ exit: { opacity: 0, height: 0 },
2752
+ className: "mt-2 overflow-hidden rounded-og-lg border border-og-border bg-og-surface-2",
2753
+ children: [
2754
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between border-b border-og-border px-3 py-1.5", children: [
2755
+ /* @__PURE__ */ jsx4("span", { className: "text-og-sm font-medium text-og-fg", children: messages.commands }),
2756
+ /* @__PURE__ */ jsx4(
2757
+ "button",
2758
+ {
2759
+ type: "button",
2760
+ onClick: onClose,
2761
+ className: "text-og-xs text-og-fg-subtle hover:text-og-fg",
2762
+ children: messages.close
2763
+ }
2764
+ )
2765
+ ] }),
2766
+ /* @__PURE__ */ jsx4("ul", { className: "py-1", children: commands.map((command) => {
2767
+ const hint = argHint(command.args);
2768
+ return /* @__PURE__ */ jsxs4("li", { className: "flex items-baseline gap-2 px-3 py-1", children: [
2769
+ /* @__PURE__ */ jsxs4("span", { className: "font-mono text-og-sm text-og-accent", children: [
2770
+ "/",
2771
+ command.name,
2772
+ hint ? /* @__PURE__ */ jsx4("span", { className: "ml-1 text-og-fg-subtle", children: hint }) : null
2773
+ ] }),
2774
+ /* @__PURE__ */ jsx4("span", { className: "text-og-sm text-og-fg-muted", children: command.description }),
2775
+ command.danger ? /* @__PURE__ */ jsx4("span", { className: "ml-auto rounded-og-xs bg-og-status-failed/15 px-1 text-og-xs uppercase tracking-wide text-og-status-failed", children: messages.danger }) : null
2776
+ ] }, command.name);
2777
+ }) })
2778
+ ]
2779
+ }
2780
+ );
2781
+ }
2782
+
2783
+ // src/components/composer-transcription-control.tsx
2784
+ import {
2785
+ ClipboardPasteIcon,
2786
+ LoaderCircleIcon as LoaderCircleIcon3,
2787
+ MicIcon,
2788
+ RefreshCwIcon,
2789
+ SquareIcon as SquareIcon2,
2790
+ Trash2Icon,
2791
+ XIcon as XIcon3
2792
+ } from "lucide-react";
2793
+ import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/react";
2794
+ import {
2795
+ forwardRef as forwardRef2,
2796
+ useCallback as useCallback3,
2797
+ useEffect as useEffect4,
2798
+ useRef as useRef5,
2799
+ useState as useState5
2800
+ } from "react";
2801
+ import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2802
+ var Tip = /* @__PURE__ */ forwardRef2(
2803
+ function Tip2({ tip, children }, ref) {
2804
+ return /* @__PURE__ */ jsxs5(Tooltip, { children: [
2805
+ /* @__PURE__ */ jsx5(TooltipTrigger, { ref, asChild: true, children }),
2806
+ /* @__PURE__ */ jsx5(TooltipContent, { side: "top", children: tip })
2807
+ ] });
2808
+ }
2809
+ );
2810
+ var defaultMessages = (t) => ({
2811
+ start: t("composerTranscriptionControl.startVoiceInput"),
2812
+ stop: t("composerTranscriptionControl.stopAndTranscribe"),
2813
+ cancel: t("composerTranscriptionControl.discardDictation"),
2814
+ retry: t("composerTranscriptionControl.retryVoiceInput"),
2815
+ transcribeSaved: t("composerTranscriptionControl.transcribeSavedRecording"),
2816
+ timeRemaining: t("composerTranscriptionControl.stopsAndTranscribesInSeconds", {
2817
+ seconds: "{seconds}"
2818
+ }),
2819
+ pauseRetrying: t("composerTranscriptionControl.pauseAutomaticRetry"),
2820
+ requestingPermission: t("composerTranscriptionControl.requestingMicrophone"),
2821
+ recording: t("composerTranscriptionControl.recordingPressEscapeToDiscard"),
2822
+ saving: t("composerTranscriptionControl.savingAudioLocally"),
2823
+ transcribing: t("composerTranscriptionControl.transcribing"),
2824
+ retrying: t("composerTranscriptionControl.savedRetryingTranscription"),
2825
+ recovered: t("composerTranscriptionControl.recordingSavedOnThisDevice"),
2826
+ recoveredTranscript: t("composerTranscriptionControl.transcriptSavedInsertItInto"),
2827
+ insertRecoveredTranscript: t("composerTranscriptionControl.insertSavedTranscript"),
2828
+ discardRecovered: t("composerTranscriptionControl.discardSavedRecording"),
2829
+ unavailableDisabled: t("composerTranscriptionControl.voiceInputIsUnavailableWhile"),
2830
+ unavailable: t("composerTranscriptionControl.voiceInputIsUnavailableFor"),
2831
+ errorPermissionDenied: t("composerTranscriptionControl.microphoneAccessIsBlockedAllow"),
2832
+ errorNotSupported: t("composerTranscriptionControl.voiceInputIsNotSupported"),
2833
+ errorUnavailable: t("composerTranscriptionControl.voiceInputIsNotConfigured"),
2834
+ errorInsufficientCredits: t("composerTranscriptionControl.voiceInputNeedsCreditsRecording"),
2835
+ errorAllowanceExhausted: t("composerTranscriptionControl.usageLimitReachedRecordingSaved"),
2836
+ errorPolicyBlocked: t("composerTranscriptionControl.voiceInputIsnTAllowed"),
2837
+ errorRegionRestricted: t("inferenceRegion.notSupportedInEu"),
2838
+ errorTooLarge: t("composerTranscriptionControl.recordingIsTooLargeTry"),
2839
+ errorInvalidAudio: t("composerTranscriptionControl.theRecordingCouldNotBe"),
2840
+ errorStorageUnavailable: t("composerTranscriptionControl.voiceInputStoppedBecauseAudio"),
2841
+ errorProviderQuotaExceeded: t("composerTranscriptionControl.speechServiceOutOfCredit"),
2842
+ errorRetryable: t("composerTranscriptionControl.savedTranscriptionFailedRetryWhen"),
2843
+ errorHandoffUncertain: t("composerTranscriptionControl.transcriptSavedCheckYourDraft"),
2844
+ errorUnknown: t("composerTranscriptionControl.voiceInputCouldNotStart")
2845
+ });
2846
+ var WAVEFORM_BARS = 18;
2847
+ var WAVEFORM_BAR_KEYS = Array.from(
2848
+ { length: WAVEFORM_BARS },
2849
+ (_, index) => `voice-waveform-bar-${index + 1}`
2850
+ );
2851
+ function ComposerTranscriptionControl({
2852
+ client = null,
2853
+ workspaceId = "",
2854
+ capability = null,
2855
+ workspaceEnabled = false,
2856
+ language = null,
2857
+ beforeStart,
2858
+ messages: overrides,
2859
+ className,
2860
+ recordings,
2861
+ platform,
2862
+ suppressed = false
2863
+ }) {
2864
+ const t = useOpenGeniText();
2865
+ const composer = useChatComposer();
2866
+ const messages = { ...defaultMessages(t), ...overrides };
2867
+ const startScope = useRef5(null);
2868
+ const hostGate = useRef5(beforeStart);
2869
+ hostGate.current = beforeStart;
2870
+ const gate = useCallback3(async () => {
2871
+ if (hostGate.current && !await hostGate.current()) return false;
2872
+ startScope.current?.dispatchEvent(new Event(COMPOSER_VOICE_INPUT_START_EVENT));
2873
+ return true;
2874
+ }, []);
2875
+ const transcription = useVoiceInput({
2876
+ client,
2877
+ workspaceId,
2878
+ capability,
2879
+ enabled: workspaceEnabled && !suppressed,
2880
+ value: composer.value,
2881
+ setValue: composer.setValue,
2882
+ focusInput: composer.focusInput,
2883
+ disabled: composer.disabled,
2884
+ language,
2885
+ beforeStart: gate,
2886
+ recordings,
2887
+ platform
2888
+ });
2889
+ const { status } = transcription;
2890
+ const retrying = status === "retrying";
2891
+ const capturing = status === "requesting-permission" || status === "recording";
2892
+ const setAsideTranscription = transcription.setAside;
2893
+ const discardTranscription = transcription.discard;
2894
+ const hasRecoverableRecording = transcription.hasRecoverableRecording;
2895
+ useEffect4(() => {
2896
+ if (!suppressed) return;
2897
+ if (status === "recording" || status === "requesting-permission") {
2898
+ setAsideTranscription();
2899
+ } else if (status === "error" && !hasRecoverableRecording) {
2900
+ void discardTranscription();
2901
+ }
2902
+ }, [setAsideTranscription, discardTranscription, hasRecoverableRecording, status, suppressed]);
2903
+ const active = capturing || status === "saving" || status === "transcribing";
2904
+ const recoverable = transcription.hasRecoverableRecording && (retrying || status === "recovered" || status === "transcript-ready" || status === "error");
2905
+ const savedTranscript = status === "transcript-ready" && transcription.savedTranscript !== null;
2906
+ const unavailableMessage = composer.disabled ? messages.unavailableDisabled : !capability?.available || !workspaceEnabled ? messages.unavailable : !transcription.available ? messages.errorStorageUnavailable : null;
2907
+ const idleLabel = unavailableMessage ?? (status === "error" ? messages.retry : messages.start);
2908
+ const errorMessage = transcription.error ? transcriptionErrorMessage(transcription.error, messages) : null;
2909
+ const announcement = status === "requesting-permission" ? messages.requestingPermission : status === "recording" ? messages.recording : status === "saving" ? messages.saving : status === "transcribing" ? messages.transcribing : retrying ? messages.retrying : status === "recovered" ? messages.recovered : status === "transcript-ready" ? messages.recoveredTranscript : status === "error" ? errorMessage ?? messages.errorUnknown : unavailableMessage;
2910
+ const recoveredLabel = savedTranscript ? errorMessage ?? messages.recoveredTranscript : retrying ? messages.retrying : status === "error" ? errorMessage ?? messages.errorRetryable : messages.recovered;
2911
+ function start(event) {
2912
+ if (unavailableMessage) {
2913
+ event.preventDefault();
2914
+ return;
2915
+ }
2916
+ startScope.current = composerVoiceEventScope(event.currentTarget) ?? null;
2917
+ void transcription.start();
2918
+ }
2919
+ const needsAttention = !capturing && (recoverable || status === "error" && !!errorMessage);
2920
+ useComposerFooterSignal("transcription-capturing", !suppressed && capturing);
2921
+ useComposerFooterSignal("transcription-attention", !suppressed && needsAttention);
2922
+ return /* @__PURE__ */ jsx5(AnimatePresence3, { initial: false, children: suppressed ? null : /* @__PURE__ */ jsx5(
2923
+ motion3.span,
2924
+ {
2925
+ initial: { opacity: 0, width: 0 },
2926
+ animate: { opacity: 1, width: "auto" },
2927
+ exit: { opacity: 0, width: 0 },
2928
+ transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
2929
+ className: cn(
2930
+ "inline-flex min-w-0 overflow-hidden",
2931
+ // Mobile capture mode reserves the footer for this control. Keep the
2932
+ // shell itself from shrinking and clipping its trailing actions.
2933
+ capturing && "shrink-0",
2934
+ className
2935
+ ),
2936
+ "data-transcription-status": status,
2937
+ "data-transcription-capturing": capturing ? "" : void 0,
2938
+ "data-transcription-attention": needsAttention ? "" : void 0,
2939
+ children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
2940
+ /* @__PURE__ */ jsx5(AnimatePresence3, { mode: "popLayout", initial: false, children: recoverable ? /* @__PURE__ */ jsxs5(
2941
+ motion3.span,
2942
+ {
2943
+ initial: { opacity: 0, scale: 0.96 },
2944
+ animate: { opacity: 1, scale: 1 },
2945
+ exit: { opacity: 0, scale: 0.96 },
2946
+ transition: { duration: 0.16, ease: [0.22, 1, 0.36, 1] },
2947
+ className: cn(
2948
+ "inline-flex h-8 min-w-0 items-center gap-1 rounded-og-md border border-og-border/80",
2949
+ "bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
2950
+ ),
2951
+ children: [
2952
+ /* @__PURE__ */ jsx5(
2953
+ "span",
2954
+ {
2955
+ title: recoveredLabel,
2956
+ className: "og-transcription-recovered-label max-w-56 line-clamp-2 text-og-xs leading-tight text-og-fg-muted max-sm:max-w-32",
2957
+ children: recoveredLabel
2958
+ }
2959
+ ),
2960
+ /* @__PURE__ */ jsx5(
2961
+ Tip,
2962
+ {
2963
+ tip: savedTranscript ? messages.insertRecoveredTranscript : retrying ? messages.pauseRetrying : status === "recovered" ? messages.transcribeSaved : messages.retry,
2964
+ children: /* @__PURE__ */ jsx5(
2965
+ "button",
2966
+ {
2967
+ type: "button",
2968
+ disabled: composer.disabled && !retrying,
2969
+ onClick: () => savedTranscript ? void transcription.insertSavedTranscript() : retrying ? transcription.setAside() : transcription.retry(),
2970
+ "aria-label": savedTranscript ? messages.insertRecoveredTranscript : retrying ? messages.pauseRetrying : status === "recovered" ? messages.transcribeSaved : messages.retry,
2971
+ className: cn(
2972
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
2973
+ "border border-og-primary-border bg-og-primary text-og-primary-fg hover:bg-og-primary-hover transition-colors duration-150 motion-reduce:transition-none",
2974
+ "disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11"
2975
+ ),
2976
+ children: savedTranscript ? /* @__PURE__ */ jsx5(ClipboardPasteIcon, { className: "size-3.5" }) : retrying ? /* @__PURE__ */ jsx5(SquareIcon2, { className: "size-3.5" }) : /* @__PURE__ */ jsx5(RefreshCwIcon, { className: "size-3.5" })
2977
+ }
2978
+ )
2979
+ }
2980
+ ),
2981
+ /* @__PURE__ */ jsx5(Tip, { tip: messages.discardRecovered, children: /* @__PURE__ */ jsx5(
2982
+ "button",
2983
+ {
2984
+ type: "button",
2985
+ disabled: composer.disabled,
2986
+ onClick: () => void transcription.discard(),
2987
+ "aria-label": messages.discardRecovered,
2988
+ className: cn(
2989
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
2990
+ "text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
2991
+ "hover:bg-og-surface-3 hover:text-og-status-failed disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11"
2992
+ ),
2993
+ children: /* @__PURE__ */ jsx5(Trash2Icon, { className: "size-3.5" })
2994
+ }
2995
+ ) })
2996
+ ]
2997
+ },
2998
+ "recovered"
2999
+ ) : active ? /* @__PURE__ */ jsxs5(
3000
+ motion3.span,
3001
+ {
3002
+ initial: { opacity: 0, scale: 0.96 },
3003
+ animate: { opacity: 1, scale: 1 },
3004
+ exit: { opacity: 0, scale: 0.96 },
3005
+ transition: { duration: 0.16, ease: [0.22, 1, 0.36, 1] },
3006
+ className: cn(
3007
+ "inline-flex h-8 items-center gap-1 rounded-og-md border border-og-border/80",
3008
+ "bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
3009
+ ),
3010
+ children: [
3011
+ status === "requesting-permission" ? /* @__PURE__ */ jsx5(
3012
+ LoaderCircleIcon3,
3013
+ {
3014
+ className: "size-3.5 shrink-0 text-og-fg-muted animate-og-spin motion-reduce:animate-none",
3015
+ "aria-hidden": true
3016
+ }
3017
+ ) : /* @__PURE__ */ jsxs5("span", { className: "flex items-center gap-1.5", children: [
3018
+ status === "recording" ? /* @__PURE__ */ jsx5(
3019
+ "span",
3020
+ {
3021
+ "aria-hidden": true,
3022
+ className: "size-1.5 shrink-0 rounded-full bg-og-status-failed animate-og-pulse motion-reduce:animate-none"
3023
+ }
3024
+ ) : null,
3025
+ /* @__PURE__ */ jsx5(
3026
+ VoiceWaveform,
3027
+ {
3028
+ stream: status === "recording" ? transcription.stream : null,
3029
+ mode: status === "recording" ? "recording" : "transcribing"
3030
+ }
3031
+ ),
3032
+ status === "recording" && transcription.recordingStartedAt !== null ? /* @__PURE__ */ jsx5(
3033
+ RecordingClock,
3034
+ {
3035
+ startedAt: transcription.recordingStartedAt,
3036
+ maxSeconds: transcription.maxRecordingSeconds,
3037
+ remainingLabel: messages.timeRemaining
3038
+ }
3039
+ ) : null
3040
+ ] }),
3041
+ status === "recording" ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
3042
+ /* @__PURE__ */ jsx5(Tip, { tip: messages.cancel, children: /* @__PURE__ */ jsx5(
3043
+ "button",
3044
+ {
3045
+ type: "button",
3046
+ onClick: () => transcription.cancel(),
3047
+ "aria-label": messages.cancel,
3048
+ className: cn(
3049
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
3050
+ "text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
3051
+ "hover:bg-og-surface-3 hover:text-og-fg pointer-coarse:size-11"
3052
+ ),
3053
+ children: /* @__PURE__ */ jsx5(XIcon3, { className: "size-3.5" })
3054
+ }
3055
+ ) }),
3056
+ /* @__PURE__ */ jsx5(Tip, { tip: messages.stop, children: /* @__PURE__ */ jsx5(
3057
+ "button",
3058
+ {
3059
+ type: "button",
3060
+ onClick: () => transcription.stop(),
3061
+ "aria-label": messages.stop,
3062
+ className: cn(
3063
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
3064
+ "border border-og-primary-border bg-og-primary text-og-primary-fg hover:bg-og-primary-hover",
3065
+ "transition-colors duration-150 motion-reduce:transition-none pointer-coarse:size-11"
3066
+ ),
3067
+ children: /* @__PURE__ */ jsx5(SquareIcon2, { className: "size-2.5 fill-current" })
3068
+ }
3069
+ ) })
3070
+ ] }) : status === "transcribing" || status === "saving" ? /* @__PURE__ */ jsx5(ShimmerText, { className: "px-1.5 text-og-xs font-medium whitespace-nowrap", children: status === "saving" ? messages.saving : messages.transcribing }) : /* @__PURE__ */ jsx5("span", { className: "px-1.5 text-og-xs text-og-fg-muted whitespace-nowrap", children: messages.requestingPermission })
3071
+ ]
3072
+ },
3073
+ status === "transcribing" || status === "saving" ? "processing" : "capture"
3074
+ ) : /* @__PURE__ */ jsx5(Tip, { tip: idleLabel, children: /* @__PURE__ */ jsx5(
3075
+ motion3.button,
3076
+ {
3077
+ type: "button",
3078
+ "data-og-composer-dictate": true,
3079
+ initial: { opacity: 0, scale: 0.96 },
3080
+ animate: { opacity: 1, scale: 1 },
3081
+ exit: { opacity: 0, scale: 0.96 },
3082
+ transition: { duration: 0.14, ease: [0.22, 1, 0.36, 1] },
3083
+ onClick: start,
3084
+ "aria-label": idleLabel,
3085
+ "aria-pressed": false,
3086
+ "aria-disabled": unavailableMessage !== null,
3087
+ className: cn(
3088
+ "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md pointer-coarse:size-11",
3089
+ "text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
3090
+ unavailableMessage ? "cursor-not-allowed opacity-45" : "hover:bg-og-surface-2 hover:text-og-fg"
3091
+ ),
3092
+ children: /* @__PURE__ */ jsx5(MicIcon, { className: "size-4" })
3093
+ }
3094
+ ) }, "idle") }),
3095
+ status === "error" && errorMessage && !recoverable ? (
3096
+ // Nothing is saved in this state, so dismissing loses no speech.
3097
+ /* @__PURE__ */ jsxs5(
3098
+ "button",
3099
+ {
3100
+ type: "button",
3101
+ title: errorMessage,
3102
+ "aria-label": t("composerTranscriptionControl.dismissErrormessage", { errorMessage }),
3103
+ onClick: () => void transcription.discard(),
3104
+ className: cn(
3105
+ "inline-flex min-w-0 items-center gap-1 rounded-og-sm text-left outline-hidden",
3106
+ "text-og-status-failed focus-visible:ring-2 focus-visible:ring-og-accent/45"
3107
+ ),
3108
+ children: [
3109
+ /* @__PURE__ */ jsx5("span", { className: "og-transcription-error-label max-w-56 line-clamp-2 text-og-xs leading-tight max-sm:max-w-32", children: errorMessage }),
3110
+ /* @__PURE__ */ jsx5(XIcon3, { className: "size-3 shrink-0 opacity-70", "aria-hidden": true })
3111
+ ]
3112
+ }
3113
+ )
3114
+ ) : null,
3115
+ /* @__PURE__ */ jsx5(
3116
+ "span",
3117
+ {
3118
+ className: "sr-only",
3119
+ role: status === "error" ? "alert" : "status",
3120
+ "aria-live": "polite",
3121
+ children: announcement
3122
+ }
3123
+ )
3124
+ ] })
3125
+ },
3126
+ "composer-dictate"
3127
+ ) });
3128
+ }
3129
+ function RecordingClock({
3130
+ startedAt,
3131
+ maxSeconds,
3132
+ remainingLabel
3133
+ }) {
3134
+ const [now, setNow] = useState5(() => Date.now());
3135
+ useEffect4(() => {
3136
+ const timer = setInterval(() => setNow(Date.now()), 500);
3137
+ return () => clearInterval(timer);
3138
+ }, []);
3139
+ const elapsed = Math.max(0, Math.floor((now - startedAt) / 1e3));
3140
+ const remaining = maxSeconds === null ? null : Math.max(0, maxSeconds - elapsed);
3141
+ const warn = remaining !== null && remaining <= 15;
3142
+ const label = `${Math.floor(elapsed / 60)}:${String(elapsed % 60).padStart(2, "0")}`;
3143
+ return /* @__PURE__ */ jsxs5(
3144
+ "span",
3145
+ {
3146
+ "data-recording-clock": true,
3147
+ title: warn ? remainingLabel.replace("{seconds}", String(remaining)) : void 0,
3148
+ className: cn(
3149
+ "min-w-[2.25rem] text-right text-og-xs tabular-nums",
3150
+ warn ? "font-medium text-og-status-failed" : "text-og-fg-muted"
3151
+ ),
3152
+ children: [
3153
+ label,
3154
+ warn ? /* @__PURE__ */ jsx5("span", { className: "sr-only", children: remainingLabel.replace("{seconds}", String(remaining)) }) : null
3155
+ ]
3156
+ }
3157
+ );
3158
+ }
3159
+ function VoiceWaveform({
3160
+ stream,
3161
+ mode
3162
+ }) {
3163
+ const [levels, setLevels] = useState5(() => restingLevels(WAVEFORM_BARS));
3164
+ const [live, setLive] = useState5(false);
3165
+ useEffect4(() => {
3166
+ if (!stream || mode !== "recording") {
3167
+ setLive(false);
3168
+ setLevels(restingLevels(WAVEFORM_BARS));
3169
+ return;
3170
+ }
3171
+ const AudioCtx = window.AudioContext ?? window.webkitAudioContext;
3172
+ if (!AudioCtx) return;
3173
+ let cancelled = false;
3174
+ let frame = 0;
3175
+ let context = null;
3176
+ try {
3177
+ context = new AudioCtx();
3178
+ const source = context.createMediaStreamSource(stream);
3179
+ const analyser = context.createAnalyser();
3180
+ analyser.fftSize = 64;
3181
+ analyser.smoothingTimeConstant = 0.8;
3182
+ source.connect(analyser);
3183
+ const bins = new Uint8Array(analyser.frequencyBinCount);
3184
+ const tick = () => {
3185
+ if (cancelled) return;
3186
+ analyser.getByteFrequencyData(bins);
3187
+ const next = new Array(WAVEFORM_BARS);
3188
+ const usable = Math.max(8, Math.floor(bins.length * 0.65));
3189
+ for (let i = 0; i < WAVEFORM_BARS; i++) {
3190
+ const start = Math.floor(i / WAVEFORM_BARS * usable);
3191
+ const end = Math.max(start + 1, Math.floor((i + 1) / WAVEFORM_BARS * usable));
3192
+ let sum = 0;
3193
+ for (let j = start; j < end; j++) sum += bins[j] ?? 0;
3194
+ const avg = sum / (end - start) / 255;
3195
+ next[i] = Math.min(1, 0.14 + avg * 1.65);
3196
+ }
3197
+ setLevels(next);
3198
+ setLive(true);
3199
+ frame = requestAnimationFrame(tick);
3200
+ };
3201
+ void context.resume().then(() => {
3202
+ if (!cancelled) frame = requestAnimationFrame(tick);
3203
+ });
3204
+ } catch {
3205
+ setLive(false);
3206
+ }
3207
+ return () => {
3208
+ cancelled = true;
3209
+ cancelAnimationFrame(frame);
3210
+ void context?.close();
3211
+ };
3212
+ }, [stream, mode]);
3213
+ return /* @__PURE__ */ jsx5(
3214
+ "span",
3215
+ {
3216
+ "aria-hidden": true,
3217
+ "data-voice-waveform": live ? "live" : "fallback",
3218
+ className: "flex h-4 w-[3.75rem] items-center justify-center gap-px",
3219
+ children: WAVEFORM_BAR_KEYS.map((key, index) => {
3220
+ const level = levels[index] ?? 0;
3221
+ return /* @__PURE__ */ jsx5(
3222
+ "span",
3223
+ {
3224
+ className: cn(
3225
+ "w-0.5 rounded-full bg-og-fg-muted/90 origin-center",
3226
+ !live && "animate-og-waveform motion-reduce:animate-none",
3227
+ mode === "transcribing" && "opacity-45"
3228
+ ),
3229
+ style: {
3230
+ height: live ? `${Math.max(3, Math.round(level * 14))}px` : "14px",
3231
+ animationDelay: live ? void 0 : `${index % 9 * 0.07}s`,
3232
+ opacity: live ? 0.55 + level * 0.45 : void 0
3233
+ }
3234
+ },
3235
+ key
3236
+ );
3237
+ })
3238
+ }
3239
+ );
3240
+ }
3241
+ function restingLevels(count) {
3242
+ return Array.from({ length: count }, (_, index) => 0.22 + index * 17 % 5 * 0.06);
3243
+ }
3244
+ function transcriptionErrorMessage(code, messages) {
3245
+ switch (code) {
3246
+ case "insufficient_credits":
3247
+ return messages.errorInsufficientCredits;
3248
+ case "allowance_exhausted":
3249
+ case "monthly_model_cost_limit":
3250
+ return messages.errorAllowanceExhausted;
3251
+ case "policy_blocked":
3252
+ return messages.errorPolicyBlocked;
3253
+ case "region_restricted":
3254
+ return messages.errorRegionRestricted;
3255
+ case "permission_denied":
3256
+ return messages.errorPermissionDenied;
3257
+ case "not_supported":
3258
+ return messages.errorNotSupported;
3259
+ case "unavailable":
3260
+ return messages.errorUnavailable;
3261
+ case "too_large":
3262
+ return messages.errorTooLarge;
3263
+ case "invalid_audio":
3264
+ return messages.errorInvalidAudio;
3265
+ case "storage_unavailable":
3266
+ return messages.errorStorageUnavailable;
3267
+ case "provider_quota_exceeded":
3268
+ return messages.errorProviderQuotaExceeded;
3269
+ case "network":
3270
+ case "provider":
3271
+ case "timeout":
3272
+ return messages.errorRetryable;
3273
+ case "handoff_uncertain":
3274
+ return messages.errorHandoffUncertain;
3275
+ case "unknown":
3276
+ return messages.errorUnknown;
3277
+ default:
3278
+ return messages.errorUnknown;
3279
+ }
3280
+ }
3281
+
3282
+ export {
3283
+ parseCommandLine,
3284
+ hasPermission,
3285
+ matchCommand,
3286
+ filterCommands,
3287
+ argHint,
3288
+ firstMissingRequiredArg,
3289
+ defaultCommands,
3290
+ useSlashCommands,
3291
+ CommandPalette,
3292
+ ModelPicker,
3293
+ storedFileAttachment,
3294
+ AttachmentChips,
3295
+ useChatComposerController,
3296
+ useChatComposer,
3297
+ Root,
3298
+ Frame,
3299
+ CommandPalette2,
3300
+ Surface,
3301
+ PausedState,
3302
+ RestoredResources,
3303
+ Attachments,
3304
+ Input,
3305
+ Confirmation,
3306
+ Footer,
3307
+ Controls,
3308
+ Hint,
3309
+ Actions,
3310
+ AttachButton,
3311
+ ModelPicker2,
3312
+ PauseButtonSlot,
3313
+ PauseButton,
3314
+ StopButton,
3315
+ AlternateSendButton,
3316
+ SendButton,
3317
+ Help,
3318
+ Status,
3319
+ ComposerTranscriptionControl
3320
+ };
3321
+ //# sourceMappingURL=chunk-TW2RHTLH.js.map