yepanywhere 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/bundled/@yep-anywhere/shared/dist/__tests__/long-context-effort-warning.test.js +19 -0
  2. package/bundled/@yep-anywhere/shared/dist/__tests__/long-context-effort-warning.test.js.map +1 -1
  3. package/bundled/@yep-anywhere/shared/dist/__tests__/model-prices.test.js +12 -0
  4. package/bundled/@yep-anywhere/shared/dist/__tests__/model-prices.test.js.map +1 -1
  5. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +2 -2
  6. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
  7. package/bundled/@yep-anywhere/shared/dist/app-types.js +5 -5
  8. package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
  9. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts +21 -0
  10. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts.map +1 -1
  11. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js +22 -1
  12. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js.map +1 -1
  13. package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts +6 -0
  14. package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts.map +1 -1
  15. package/bundled/@yep-anywhere/shared/dist/capability-ids.js +6 -0
  16. package/bundled/@yep-anywhere/shared/dist/capability-ids.js.map +1 -1
  17. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts +2 -2
  18. package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts +41 -0
  19. package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts.map +1 -0
  20. package/bundled/@yep-anywhere/shared/dist/find/documentFind.js +280 -0
  21. package/bundled/@yep-anywhere/shared/dist/find/documentFind.js.map +1 -0
  22. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts +2 -0
  23. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts.map +1 -0
  24. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts +2 -0
  25. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts.map +1 -0
  26. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js +5 -0
  27. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js.map +1 -0
  28. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js +59 -0
  29. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js.map +1 -0
  30. package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts +46 -0
  31. package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts.map +1 -0
  32. package/bundled/@yep-anywhere/shared/dist/find/protocol.js +45 -0
  33. package/bundled/@yep-anywhere/shared/dist/find/protocol.js.map +1 -0
  34. package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -2
  35. package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
  36. package/bundled/@yep-anywhere/shared/dist/index.js +3 -1
  37. package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
  38. package/bundled/@yep-anywhere/shared/dist/long-context-effort-warning.d.ts +11 -11
  39. package/bundled/@yep-anywhere/shared/dist/long-context-effort-warning.d.ts.map +1 -1
  40. package/bundled/@yep-anywhere/shared/dist/long-context-effort-warning.js +26 -9
  41. package/bundled/@yep-anywhere/shared/dist/long-context-effort-warning.js.map +1 -1
  42. package/bundled/@yep-anywhere/shared/dist/model-prices.d.ts.map +1 -1
  43. package/bundled/@yep-anywhere/shared/dist/model-prices.js +9 -2
  44. package/bundled/@yep-anywhere/shared/dist/model-prices.js.map +1 -1
  45. package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts +7 -0
  46. package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts.map +1 -0
  47. package/bundled/@yep-anywhere/shared/dist/pdfjs.js +7 -0
  48. package/bundled/@yep-anywhere/shared/dist/pdfjs.js.map +1 -0
  49. package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +20 -0
  50. package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
  51. package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +22 -0
  52. package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
  53. package/bundled/@yep-anywhere/shared/dist/skill-invocations.d.ts.map +1 -1
  54. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js +7 -10
  55. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js.map +1 -1
  56. package/bundled/@yep-anywhere/shared/dist/types.d.ts +7 -0
  57. package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
  58. package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
  59. package/bundled/@yep-anywhere/shared/package.json +1 -1
  60. package/client-dist/assets/AboutSettings-CCzudbSj.js +1 -0
  61. package/client-dist/assets/{ActivityPage-FgSG_9Sl.js → ActivityPage-Bn0LbMgE.js} +1 -1
  62. package/client-dist/assets/{AgentContextSettings-BfTCI7qG.js → AgentContextSettings-DI8jQVIx.js} +3 -3
  63. package/client-dist/assets/AgentsPage-Ci_iJt8T.js +2 -0
  64. package/client-dist/assets/App-rFnK5pnF.js +2 -0
  65. package/client-dist/assets/AppearanceSettings-DTYVt0W5.js +2 -0
  66. package/client-dist/assets/AppsSettings-hbh_sguk.js +1 -0
  67. package/client-dist/assets/AttachmentChip-BFve3lTD.js +1 -0
  68. package/client-dist/assets/{AuthContext-CVsoMulX.js → AuthContext-DmXjW0be.js} +1 -1
  69. package/client-dist/assets/{BangCommandDisplayObject-B8KrHDzH.js → BangCommandDisplayObject-BH2KRGnc.js} +1 -1
  70. package/client-dist/assets/BangCommandsPage-MfkuL8yS.js +1 -0
  71. package/client-dist/assets/BrowserDebugToolbarButton-BPghQu17.js +1 -0
  72. package/client-dist/assets/{CacheMissBillingSettings-Bfqlk9rA.js → CacheMissBillingSettings-rUgC-_DD.js} +2 -2
  73. package/client-dist/assets/{CodexUpdatePrompt-ChHtbla-.js → CodexUpdatePrompt-mT9K-f1e.js} +1 -1
  74. package/client-dist/assets/{CommittedRangeInput-C3Z7YUlS.js → CommittedRangeInput-BwuV6Q6c.js} +1 -1
  75. package/client-dist/assets/{CommittedRangeNumberInput-D497_5ff.js → CommittedRangeNumberInput-C5YSVltB.js} +1 -1
  76. package/client-dist/assets/ComputerControlSettings-MWIdP7SS.js +1 -0
  77. package/client-dist/assets/{ConversationPreviewPage-CTWx9N3v.js → ConversationPreviewPage-B47r7mUF.js} +2 -2
  78. package/client-dist/assets/DevelopmentSettings-BEAy_xq-.js +1 -0
  79. package/client-dist/assets/DevicesSettings-DKQOZkRN.js +1 -0
  80. package/client-dist/assets/EmulatorPage-DlsPq3nR.js +1 -0
  81. package/client-dist/assets/EmulatorSettings-C6Ye1k_Y.js +1 -0
  82. package/client-dist/assets/EnvironmentSettings-ou8UNqTa.js +1 -0
  83. package/client-dist/assets/FilePage-Cw2PaO5H.js +1 -0
  84. package/client-dist/assets/FilterDropdown-CACc6ysA.js +1 -0
  85. package/client-dist/assets/FilterDropdown-D11gXriH.css +1 -0
  86. package/client-dist/assets/FloatingActionButton-Bl1Eumxh.js +1 -0
  87. package/client-dist/assets/{GitStatusPage-879aktqc.js → GitStatusPage-CLTkgnDI.js} +3 -3
  88. package/client-dist/assets/GlobalSessionsPage-Bvzs4zmW.js +2 -0
  89. package/client-dist/assets/GlobalSessionsPage-dlTB6crv.css +1 -0
  90. package/client-dist/assets/{HeartbeatTextArea-CKxL-bdJ.js → HeartbeatTextArea-CtP5kx9R.js} +1 -1
  91. package/client-dist/assets/HostIdentityContext-DA7dMF-y.js +1 -0
  92. package/client-dist/assets/HostsPage-CBOYGC2-.js +1 -0
  93. package/client-dist/assets/{InboxContext-opkOiXDB.js → InboxContext-8PXoTbK1.js} +1 -1
  94. package/client-dist/assets/InboxPage-DWl7uzdw.js +1 -0
  95. package/client-dist/assets/IssueSettings-BVljRpuD.js +1 -0
  96. package/client-dist/assets/IssuesPage-BFxgsMkf.js +1 -0
  97. package/client-dist/assets/LifecycleWebhooksSettings-Qw_dN3F3.js +1 -0
  98. package/client-dist/assets/{LocalAccessSettings-BpmNC9pI.js → LocalAccessSettings-SWirs75o.js} +3 -3
  99. package/client-dist/assets/LocalMediaModal-B3KXtyEB.css +1 -0
  100. package/client-dist/assets/LocalMediaModal-B9eHVx6y.js +14 -0
  101. package/client-dist/assets/{LoginPage-Cu7cX9wS.js → LoginPage-CYWqVJ95.js} +1 -1
  102. package/client-dist/assets/{MessageAge-Cd1C0-Kr.js → MessageAge-CaPpa1nH.js} +1 -1
  103. package/client-dist/assets/{MessageDeliverySettings-B_9VqCMP.js → MessageDeliverySettings-BUSuGKlc.js} +2 -2
  104. package/client-dist/assets/MessageInput-a13ZPAHv.js +3 -0
  105. package/client-dist/assets/MessageInputToolbar-BIL_6i7G.css +1 -0
  106. package/client-dist/assets/MessageInputToolbar-CQGTnVea.js +58 -0
  107. package/client-dist/assets/MessageList-C7kAuWKg.js +4 -0
  108. package/client-dist/assets/MessageList-rD5OPsAJ.css +1 -0
  109. package/client-dist/assets/Modal-ClSjJagX.js +15 -0
  110. package/client-dist/assets/ModelSettings-Dnd4yzmI.js +1 -0
  111. package/client-dist/assets/NavigationLayout-BTFsWVtE.js +2 -0
  112. package/client-dist/assets/NewSessionPage-BfiAS-Mo.js +1 -0
  113. package/client-dist/assets/NotificationsSettings-B1ugQIp-.js +1 -0
  114. package/client-dist/assets/PageHeader-BjwH2pWD.js +1 -0
  115. package/client-dist/assets/PerformanceSettings-jJYF9SPY.js +1 -0
  116. package/client-dist/assets/{ProjectSessionDefaultsModal-Dq2_xDka.js → ProjectSessionDefaultsModal-G_0uxJEv.js} +1 -1
  117. package/client-dist/assets/ProjectTemplatesSettings-BQTCV3-3.js +1 -0
  118. package/client-dist/assets/ProjectsPage-suTd8s9l.js +1 -0
  119. package/client-dist/assets/ProviderBadge-P0VTI71n.js +1 -0
  120. package/client-dist/assets/{ProviderChildSessionDetail-tWrpaB_X.js → ProviderChildSessionDetail-D0472EW8.js} +35 -35
  121. package/client-dist/assets/ProviderChildSessionPage-9__sgY14.js +1 -0
  122. package/client-dist/assets/ProvidersSettings-Bwzy73Rk.js +1 -0
  123. package/client-dist/assets/{RecapAfterSecondsControl-qU0RMrUX.js → RecapAfterSecondsControl-CxuXyFSr.js} +1 -1
  124. package/client-dist/assets/{RelayProtocol-DjpPJk64.js → RelayProtocol-BpdH0COG.js} +1 -1
  125. package/client-dist/assets/RemoteAccessSettings-Dn7KB5nK.js +1 -0
  126. package/client-dist/assets/RemoteExecutorsSettings-Cjl4Y2rB.js +1 -0
  127. package/client-dist/assets/SchemaValidationContext-57RCj4c4.js +1 -0
  128. package/client-dist/assets/{SearchPreview-B25ksFLA.js → SearchPreview-OzVFWPJZ.js} +1 -1
  129. package/client-dist/assets/{SessionHeader.module-Co9s-JR3.js → SessionHeader.module-BpaFAQ-S.js} +1 -1
  130. package/client-dist/assets/SessionPage-BYthaEfZ.js +50 -0
  131. package/client-dist/assets/SessionPage-CXXEAwu2.css +1 -0
  132. package/client-dist/assets/{SettingsItem-B_rM9Vhi.js → SettingsItem-C9Vh5p7F.js} +1 -1
  133. package/client-dist/assets/{SettingsSection-DOwc_RwX.js → SettingsSection-BaPzETK6.js} +1 -1
  134. package/client-dist/assets/SourceControlSettings-DnqLg0db.js +1 -0
  135. package/client-dist/assets/{SourceFileHeaderActions-3_76js_o.js → SourceFileHeaderActions-PjhUGnn6.js} +1 -1
  136. package/client-dist/assets/SpeechControlMenu-BYVdEa3C.js +2 -0
  137. package/client-dist/assets/{SpeechSettings-BT4TnSgr.js → SpeechSettings-B6LkqfSK.js} +2 -2
  138. package/client-dist/assets/{SpeechSmartTurnControls-vIZ8a7Lb.js → SpeechSmartTurnControls-LPq9wBaM.js} +1 -1
  139. package/client-dist/assets/StorageSettings-DtsJnYaz.js +1 -0
  140. package/client-dist/assets/{ThinkingControls-CbZcYobp.js → ThinkingControls-DXbxdJRi.js} +1 -1
  141. package/client-dist/assets/ToolbarSettings-Nb2BKpnk.js +1 -0
  142. package/client-dist/assets/UsersSettings-BdvqmyqK.js +1 -0
  143. package/client-dist/assets/ViewerModePage-CfJJA5GL.css +1 -0
  144. package/client-dist/assets/ViewerModePage-DzRIpuYF.js +1 -0
  145. package/client-dist/assets/{VoiceInputButton-japn0Kx_.js → VoiceInputButton-CCgovfyf.js} +1 -1
  146. package/client-dist/assets/WorkstreamsPage-dlEUllSL.js +1 -0
  147. package/client-dist/assets/{YaServerProvider-OSxrnpr9.js → YaServerProvider-CN3tC5UL.js} +1 -1
  148. package/client-dist/assets/{YepAnywhereLogo-OH70DoR4.js → YepAnywhereLogo-5zFKWjQq.js} +1 -1
  149. package/client-dist/assets/{abnfDiagram-VCTEODGH-BK2byNq2.js → abnfDiagram-VCTEODGH-BWHUBcV3.js} +1 -1
  150. package/client-dist/assets/{arc-BZ7613Gf.js → arc-DKsIJWGD.js} +1 -1
  151. package/client-dist/assets/{architectureDiagram-5GKGNRK7-WEjy-r-z.js → architectureDiagram-5GKGNRK7-BuLImqW3.js} +1 -1
  152. package/client-dist/assets/{attachmentFileNames-BfFUuufi.js → attachmentFileNames-CBV_5g65.js} +1 -1
  153. package/client-dist/assets/{blockDiagram-I7D4REHJ-BOsYYXyW.js → blockDiagram-I7D4REHJ-CJ4Gh6sL.js} +1 -1
  154. package/client-dist/assets/{c4Diagram-7LVT6UL2-BRrAUZLE.js → c4Diagram-7LVT6UL2-WR43XvCI.js} +1 -1
  155. package/client-dist/assets/channel-PV8AAsuo.js +1 -0
  156. package/client-dist/assets/{chunk-2Q5K7J3B-ikUS9MZO.js → chunk-2Q5K7J3B-CiP4m_EA.js} +1 -1
  157. package/client-dist/assets/{chunk-5VM5RSS4-DqxRtuTQ.js → chunk-5VM5RSS4-BUAhj1h9.js} +1 -1
  158. package/client-dist/assets/{chunk-F27PBJKO-DQAhMVEw.js → chunk-F27PBJKO-BUZNwiGx.js} +1 -1
  159. package/client-dist/assets/{chunk-IMKFNOWR-B2QXI9W-.js → chunk-IMKFNOWR-CX1a0BCE.js} +1 -1
  160. package/client-dist/assets/{chunk-JWPE2WC7-Px4jgxzE.js → chunk-JWPE2WC7-C6tL-mLF.js} +1 -1
  161. package/client-dist/assets/{chunk-POPQ4Y6H-BTrXHY42.js → chunk-POPQ4Y6H-BzijGGWv.js} +1 -1
  162. package/client-dist/assets/{chunk-SVP7TREG-DufcbLSM.js → chunk-SVP7TREG-CsZImJKI.js} +1 -1
  163. package/client-dist/assets/{chunk-TICWLB2K-C6xArrXi.js → chunk-TICWLB2K-TwCtuDc1.js} +1 -1
  164. package/client-dist/assets/{chunk-XXDRQBXY-CtTuQMK6.js → chunk-XXDRQBXY-C-2EoNns.js} +1 -1
  165. package/client-dist/assets/classDiagram-ZZMXUADV-DvtSxfma.js +1 -0
  166. package/client-dist/assets/classDiagram-v2-VYDZK3BY-DvtSxfma.js +1 -0
  167. package/client-dist/assets/{client-sN_tbfxh.js → client-Ci_HPGfl.js} +2 -2
  168. package/client-dist/assets/{compactSettingsControls-BjKplkgf.js → compactSettingsControls-C9mLZh5H.js} +1 -1
  169. package/client-dist/assets/{cose-bilkent-JH36ORCC-Cn15YJGj.js → cose-bilkent-JH36ORCC-CmbEx2jT.js} +1 -1
  170. package/client-dist/assets/{cynefin-OW5HDTMX-CJkFJ0DX.js → cynefin-OW5HDTMX-BSQHHXFU.js} +1 -1
  171. package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-CVX2L_eF.js → cynefinDiagram-5FMLGOSQ-C-62JZJD.js} +1 -1
  172. package/client-dist/assets/{dagre-GXQ25YYZ-BMbYVbaU.js → dagre-GXQ25YYZ-BBERQe_A.js} +1 -1
  173. package/client-dist/assets/de-Cgdxe5vX.js +6 -0
  174. package/client-dist/assets/{diagram-S7CK7UJ4-DTZ_P_Fh.js → diagram-S7CK7UJ4-muw11lmG.js} +1 -1
  175. package/client-dist/assets/{diagram-UQ7AKVKN-C6cgxro0.js → diagram-UQ7AKVKN-DpePWzAe.js} +1 -1
  176. package/client-dist/assets/{diagram-VSXAHHWV-MzNPAr2n.js → diagram-VSXAHHWV-DHX6AHUY.js} +1 -1
  177. package/client-dist/assets/{diagram-VX7I27RA-BZN6iloV.js → diagram-VX7I27RA-DYmR6NH_.js} +1 -1
  178. package/client-dist/assets/{diagram-Z3DM3KII-CtTiorxp.js → diagram-Z3DM3KII-BC1SenHB.js} +1 -1
  179. package/client-dist/assets/{ebnfDiagram-PWID7BFC-B28XYdqt.js → ebnfDiagram-PWID7BFC-EVpri6Ma.js} +1 -1
  180. package/client-dist/assets/{erDiagram-RLTQ6QDP-DlMmHWyy.js → erDiagram-RLTQ6QDP-DthztUaa.js} +1 -1
  181. package/client-dist/assets/es-gyRk85dY.js +6 -0
  182. package/client-dist/assets/{flowDiagram-HODETNUW-C5mVciwL.js → flowDiagram-HODETNUW-DEpC5nMx.js} +1 -1
  183. package/client-dist/assets/fr-Dx9lA8u-.js +6 -0
  184. package/client-dist/assets/{frontendReload-DT6MOpjg.js → frontendReload-CBdyvvdy.js} +1 -1
  185. package/client-dist/assets/{ganttDiagram-EL5Y4UJY-BTl7ZRTR.js → ganttDiagram-EL5Y4UJY-Csqji8t1.js} +1 -1
  186. package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-BsG6KEKe.js → gitGraphDiagram-WWUBYQGX-DVX1SDIE.js} +1 -1
  187. package/client-dist/assets/{hostStorage-BoEdRarg.js → hostStorage-D1KAm3U1.js} +1 -1
  188. package/client-dist/assets/{index-D7q51uJV.js → index-BESqiBDI.js} +1 -1
  189. package/client-dist/assets/index-BkOdUxq4.js +2 -0
  190. package/client-dist/assets/index-CPb-36gi.css +1 -0
  191. package/client-dist/assets/index-CoR-vzsb.js +2 -0
  192. package/client-dist/assets/index-Cv3tQXyE.js +1 -0
  193. package/client-dist/assets/{index-CkZXrIi5.js → index-DSFMItgO.js} +1 -1
  194. package/client-dist/assets/index-umZg0LZ6.js +81 -0
  195. package/client-dist/assets/{infoDiagram-27XIBGKW-CkZcthz-.js → infoDiagram-27XIBGKW-CHm3qsd2.js} +1 -1
  196. package/client-dist/assets/{ishikawaDiagram-5VMMS53U-Cvqitz5U.js → ishikawaDiagram-5VMMS53U-tBRZwz-_.js} +1 -1
  197. package/client-dist/assets/ja-BOj7smkY.js +6 -0
  198. package/client-dist/assets/{journeyDiagram-3NMN7TZE-vCw00Cqy.js → journeyDiagram-3NMN7TZE-EJic7nqD.js} +1 -1
  199. package/client-dist/assets/{kanban-definition-UXKFOSKX-BZGCo-wX.js → kanban-definition-UXKFOSKX-DtzL6eeO.js} +1 -1
  200. package/client-dist/assets/{layout-D7JRfual.js → layout-gb-Axsoq.js} +1 -1
  201. package/client-dist/assets/{linear-O9cHRsA5.js → linear-CAe4xGbR.js} +1 -1
  202. package/client-dist/assets/long-context-effort-warning-C6XHizE1.js +1 -0
  203. package/client-dist/assets/{mermaid.core-CdC8AeOx.js → mermaid.core-BCu1nv8H.js} +5 -5
  204. package/client-dist/assets/{mindmap-definition-YA3MSWOX-CczC57z0.js → mindmap-definition-YA3MSWOX-C7-KSPtJ.js} +1 -1
  205. package/client-dist/assets/newSessionPrefill-DKcy0abh.js +1 -0
  206. package/client-dist/assets/{pegDiagram-XKGWAZYB-jTm4iBWK.js → pegDiagram-XKGWAZYB-iWVH9rbY.js} +1 -1
  207. package/client-dist/assets/{pieDiagram-E7YTZNPT-DfkDPuJg.js → pieDiagram-E7YTZNPT-VKD6PLHa.js} +1 -1
  208. package/client-dist/assets/providerChildSessions-Cd7oK6KQ.css +1 -0
  209. package/client-dist/assets/providerChildSessions-DbLFSybt.js +77 -0
  210. package/client-dist/assets/{quadrantDiagram-AXDQQJYC--bBZSIt1.js → quadrantDiagram-AXDQQJYC-AXFugcFl.js} +1 -1
  211. package/client-dist/assets/{railroadDiagram-O6MQD6OU-gbkMdGN6.js → railroadDiagram-O6MQD6OU-D6oZy6Al.js} +1 -1
  212. package/client-dist/assets/{recentProjectPathLinks-Ba20jx5b.js → recentProjectPathLinks-D0Dx6YXT.js} +2 -2
  213. package/client-dist/assets/{registerServiceWorker-CGxgV4Yi.js → registerServiceWorker-B8K2KVOY.js} +1 -1
  214. package/client-dist/assets/{relayEndpoints-0oIbn4eU.js → relayEndpoints-BTq9xppf.js} +1 -1
  215. package/client-dist/assets/{remoteRoutePaths-CiDZeM2I.js → remoteRoutePaths-D8htA0xa.js} +1 -1
  216. package/client-dist/assets/{requirementDiagram-BXWQKSXE-WfLCTewk.js → requirementDiagram-BXWQKSXE-Eqtb74It.js} +1 -1
  217. package/client-dist/assets/{sankeyDiagram-P5KCCOFB-BhJkx_M1.js → sankeyDiagram-P5KCCOFB-CxvDiZ1R.js} +1 -1
  218. package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-_S-ZN-hK.js → sequenceDiagram-WJ2MYXX4-BbpkgW2L.js} +1 -1
  219. package/client-dist/assets/sessionHistorySearch.worker-DCkPlfGO.js +61 -0
  220. package/client-dist/assets/{sessionNavigationState-DKXD1sTS.js → sessionNavigationState-BXejf2ZW.js} +1 -1
  221. package/client-dist/assets/sessionRouteLayer-D9T2QT8G.js +1 -0
  222. package/client-dist/assets/{sizeCapture-INFHLROL-YfaR_7-Y.js → sizeCapture-INFHLROL-DcuwWD5r.js} +1 -1
  223. package/client-dist/assets/{sourceControlNavigationState-lyZ29oaF.js → sourceControlNavigationState-BJbTzWTE.js} +1 -1
  224. package/client-dist/assets/{speechDraftTransaction-zyWVCYTF.js → speechDraftTransaction-WhqFE1h9.js} +1 -1
  225. package/client-dist/assets/{stateDiagram-D77RDMKH-_N9FdD6m.js → stateDiagram-D77RDMKH-Cidpq73w.js} +1 -1
  226. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-DFqKXxjz.js +1 -0
  227. package/client-dist/assets/{swimlanes-42K2YHIH-DUl5jFZz.js → swimlanes-42K2YHIH-Ba8C7MwG.js} +1 -1
  228. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-3pW2TcAt.js +8 -0
  229. package/client-dist/assets/{timeline-definition-24CTP7MA-DtYzRl63.js → timeline-definition-24CTP7MA-CKefGvUK.js} +1 -1
  230. package/client-dist/assets/useAcliCommentarySetting-CBKAl7qr.js +9 -0
  231. package/client-dist/assets/useActivityBusState-C0dor9p7.js +1 -0
  232. package/client-dist/assets/{useBackgroundRevalidation-CULom4_W.js → useBackgroundRevalidation-C79HAUP3.js} +1 -1
  233. package/client-dist/assets/{useCodexUpdateStatus-BIDehnvt.js → useCodexUpdateStatus-CEZO_f2Y.js} +1 -1
  234. package/client-dist/assets/{useConnectedDevices-kBo43kbz.js → useConnectedDevices-Ds-DuUDc.js} +1 -1
  235. package/client-dist/assets/{useDocumentTitle-C06qawRj.js → useDocumentTitle-Xz5t-nlB.js} +1 -1
  236. package/client-dist/assets/{useEmulators-Bz8194e3.js → useEmulators-qS_cCZ3I.js} +1 -1
  237. package/client-dist/assets/{useFileActivity-CwkGwsQt.js → useFileActivity-BoW4X3DY.js} +1 -1
  238. package/client-dist/assets/{useFloatingActionButtonEnabled-C31rfHtR.js → useFloatingActionButtonEnabled-2_hw7nSa.js} +1 -1
  239. package/client-dist/assets/{useForkSummaryAutoOpen-D_SvtmbE.js → useForkSummaryAutoOpen-CS33Irpf.js} +1 -1
  240. package/client-dist/assets/{useGeneratedTitleLength-Cu-SoQ6T.js → useGeneratedTitleLength-D856ktVg.js} +1 -1
  241. package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-C-cYLaEU.js → useKeepMobileKeyboardOpenAfterDelivery-Ba77SbWF.js} +1 -1
  242. package/client-dist/assets/useModelSettings-BdlYk1DT.js +1 -0
  243. package/client-dist/assets/{useNotifyInApp-BcLZ8ie_.js → useNotifyInApp-DcWe3dh4.js} +1 -1
  244. package/client-dist/assets/{useOnboarding-CYgE-Xsg.js → useOnboarding-CoE3WF8a.js} +1 -1
  245. package/client-dist/assets/{useProviders-C6kBPWYX.js → useProviders-CeN1PclA.js} +1 -1
  246. package/client-dist/assets/{useQuestionAsideSetting-6Excl6Pm.js → useQuestionAsideSetting-CPFw1u0y.js} +1 -1
  247. package/client-dist/assets/{useRecentSessions-CsmsGemq.js → useRecentSessions-ieTzzJu4.js} +2 -2
  248. package/client-dist/assets/{useRelativeNow-BdLaPgKO.js → useRelativeNow-Ca6QGcPa.js} +1 -1
  249. package/client-dist/assets/{useReloadNotifications-B0egr2ys.js → useReloadNotifications-Dm1jmdIb.js} +1 -1
  250. package/client-dist/assets/{useRemoteExecutors-Bgjgzif1.js → useRemoteExecutors-zBAQnQXH.js} +1 -1
  251. package/client-dist/assets/{useSidebarWidth-ut6NNk5Y.js → useSidebarWidth-CBCcbSLg.js} +1 -1
  252. package/client-dist/assets/{useSourceControlCleanLanding-DxrwogwF.js → useSourceControlCleanLanding-VDlft5tr.js} +1 -1
  253. package/client-dist/assets/{useStableToolPreviewRendering-CcrkchTG.js → useStableToolPreviewRendering-hbVp38Jd.js} +1 -1
  254. package/client-dist/assets/{useStreamingEnabled-EdvW04Vz.js → useStreamingEnabled-hU1g8i7_.js} +1 -1
  255. package/client-dist/assets/{useTabTitleActivityPreference-B0suFUHK.js → useTabTitleActivityPreference-DhREY7m2.js} +1 -1
  256. package/client-dist/assets/{useVhostAccess-2ZKr0Lcl.js → useVhostAccess-DUtn_sH1.js} +1 -1
  257. package/client-dist/assets/{useWorkflowTags-_4F_41YI.js → useWorkflowTags-DxbEBqtf.js} +1 -1
  258. package/client-dist/assets/{vennDiagram-4TSXK5OY-26XZDUe6.js → vennDiagram-4TSXK5OY-CSGBq-Ur.js} +1 -1
  259. package/client-dist/assets/{wardleyDiagram-VM6X3IG4-YvZ37BJ7.js → wardleyDiagram-VM6X3IG4-DIMvcaMb.js} +1 -1
  260. package/client-dist/assets/{xychartDiagram-S5SC5T6Z-BMT0MEGz.js → xychartDiagram-S5SC5T6Z-TYXSqT3w.js} +1 -1
  261. package/client-dist/assets/zh-CN-DadySLj9.js +7 -0
  262. package/client-dist/index.html +3 -3
  263. package/dist/app.d.ts.map +1 -1
  264. package/dist/app.js +29 -10
  265. package/dist/app.js.map +1 -1
  266. package/dist/artifacts/ArtifactServer.d.ts +2 -0
  267. package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
  268. package/dist/artifacts/ArtifactServer.js +79 -1
  269. package/dist/artifacts/ArtifactServer.js.map +1 -1
  270. package/dist/auth/limitedUserPolicy.d.ts +9 -5
  271. package/dist/auth/limitedUserPolicy.d.ts.map +1 -1
  272. package/dist/auth/limitedUserPolicy.js +64 -35
  273. package/dist/auth/limitedUserPolicy.js.map +1 -1
  274. package/dist/auth/principal.d.ts +6 -0
  275. package/dist/auth/principal.d.ts.map +1 -1
  276. package/dist/auth/principal.js +6 -0
  277. package/dist/auth/principal.js.map +1 -1
  278. package/dist/frontend/static.d.ts.map +1 -1
  279. package/dist/frontend/static.js +2 -1
  280. package/dist/frontend/static.js.map +1 -1
  281. package/dist/middleware/authenticated-transport.d.ts +13 -0
  282. package/dist/middleware/authenticated-transport.d.ts.map +1 -1
  283. package/dist/middleware/authenticated-transport.js +12 -0
  284. package/dist/middleware/authenticated-transport.js.map +1 -1
  285. package/dist/middleware/limited-users.d.ts +9 -5
  286. package/dist/middleware/limited-users.d.ts.map +1 -1
  287. package/dist/middleware/limited-users.js +37 -23
  288. package/dist/middleware/limited-users.js.map +1 -1
  289. package/dist/routes/file-edit.d.ts +18 -0
  290. package/dist/routes/file-edit.d.ts.map +1 -0
  291. package/dist/routes/file-edit.js +244 -0
  292. package/dist/routes/file-edit.js.map +1 -0
  293. package/dist/routes/files.d.ts.map +1 -1
  294. package/dist/routes/files.js +34 -9
  295. package/dist/routes/files.js.map +1 -1
  296. package/dist/routes/pdfjs.d.ts +9 -0
  297. package/dist/routes/pdfjs.d.ts.map +1 -0
  298. package/dist/routes/pdfjs.js +34 -0
  299. package/dist/routes/pdfjs.js.map +1 -0
  300. package/dist/routes/public-file-shares.d.ts +6 -0
  301. package/dist/routes/public-file-shares.d.ts.map +1 -1
  302. package/dist/routes/public-file-shares.js +22 -10
  303. package/dist/routes/public-file-shares.js.map +1 -1
  304. package/dist/routes/public-shares.d.ts.map +1 -1
  305. package/dist/routes/public-shares.js +18 -1
  306. package/dist/routes/public-shares.js.map +1 -1
  307. package/dist/routes/recents.d.ts +4 -1
  308. package/dist/routes/recents.d.ts.map +1 -1
  309. package/dist/routes/recents.js +7 -0
  310. package/dist/routes/recents.js.map +1 -1
  311. package/dist/routes/sessions.d.ts.map +1 -1
  312. package/dist/routes/sessions.js +4 -0
  313. package/dist/routes/sessions.js.map +1 -1
  314. package/dist/routes/settings.d.ts +7 -2
  315. package/dist/routes/settings.d.ts.map +1 -1
  316. package/dist/routes/settings.js +43 -1
  317. package/dist/routes/settings.js.map +1 -1
  318. package/dist/routes/version.d.ts.map +1 -1
  319. package/dist/routes/version.js +1 -0
  320. package/dist/routes/version.js.map +1 -1
  321. package/dist/routes/ws-relay-handlers.d.ts +12 -0
  322. package/dist/routes/ws-relay-handlers.d.ts.map +1 -1
  323. package/dist/routes/ws-relay-handlers.js +25 -4
  324. package/dist/routes/ws-relay-handlers.js.map +1 -1
  325. package/dist/routes/ws-relay.d.ts.map +1 -1
  326. package/dist/routes/ws-relay.js +8 -0
  327. package/dist/routes/ws-relay.js.map +1 -1
  328. package/dist/sdk/providers/agent-self.js +1 -1
  329. package/dist/sdk/providers/agent-self.js.map +1 -1
  330. package/dist/sdk/providers/claude.d.ts +1 -0
  331. package/dist/sdk/providers/claude.d.ts.map +1 -1
  332. package/dist/sdk/providers/claude.js +7 -0
  333. package/dist/sdk/providers/claude.js.map +1 -1
  334. package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -1
  335. package/dist/sdk/providers/codex-model-catalog.js +5 -3
  336. package/dist/sdk/providers/codex-model-catalog.js.map +1 -1
  337. package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts +4 -1
  338. package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts.map +1 -1
  339. package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts +4 -1
  340. package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts.map +1 -1
  341. package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts +3 -0
  342. package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts.map +1 -1
  343. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts +2 -0
  344. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts.map +1 -0
  345. package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackParams.js → McpAppDisplayMode.js} +1 -1
  346. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.js.map +1 -0
  347. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts +9 -0
  348. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts.map +1 -0
  349. package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackResponse.js → McpAppUi.js} +1 -1
  350. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.js.map +1 -0
  351. package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +1 -1
  352. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts +4 -0
  353. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts.map +1 -1
  354. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +6 -1
  355. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
  356. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts +4 -0
  357. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts.map +1 -1
  358. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts +9 -0
  359. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts.map +1 -1
  360. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts +9 -0
  361. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts.map +1 -1
  362. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts +4 -0
  363. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts.map +1 -1
  364. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +7 -1
  365. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
  366. package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts +3 -0
  367. package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts.map +1 -1
  368. package/dist/sdk/providers/codex-protocol/index.d.ts +0 -2
  369. package/dist/sdk/providers/codex-protocol/index.d.ts.map +1 -1
  370. package/dist/sdk/providers/codex.d.ts +23 -2
  371. package/dist/sdk/providers/codex.d.ts.map +1 -1
  372. package/dist/sdk/providers/codex.js +55 -22
  373. package/dist/sdk/providers/codex.js.map +1 -1
  374. package/dist/sdk/providers/index.d.ts.map +1 -1
  375. package/dist/sdk/providers/index.js +4 -1
  376. package/dist/sdk/providers/index.js.map +1 -1
  377. package/dist/sdk/providers/opencode.d.ts +9 -0
  378. package/dist/sdk/providers/opencode.d.ts.map +1 -1
  379. package/dist/sdk/providers/opencode.js +129 -76
  380. package/dist/sdk/providers/opencode.js.map +1 -1
  381. package/dist/sdk/providers/provider-session-owner.d.ts +9 -0
  382. package/dist/sdk/providers/provider-session-owner.d.ts.map +1 -1
  383. package/dist/sdk/providers/provider-session-owner.js +39 -3
  384. package/dist/sdk/providers/provider-session-owner.js.map +1 -1
  385. package/dist/sdk/providers/types.d.ts +13 -0
  386. package/dist/sdk/providers/types.d.ts.map +1 -1
  387. package/dist/sdk/providers/types.js.map +1 -1
  388. package/dist/services/ArtifactRebuildService.d.ts +67 -0
  389. package/dist/services/ArtifactRebuildService.d.ts.map +1 -0
  390. package/dist/services/ArtifactRebuildService.js +229 -0
  391. package/dist/services/ArtifactRebuildService.js.map +1 -0
  392. package/dist/services/DirtyFileEditorService.d.ts +2 -0
  393. package/dist/services/DirtyFileEditorService.d.ts.map +1 -1
  394. package/dist/services/DirtyFileEditorService.js +20 -1
  395. package/dist/services/DirtyFileEditorService.js.map +1 -1
  396. package/dist/services/PdfjsAssetCache.d.ts +20 -0
  397. package/dist/services/PdfjsAssetCache.d.ts.map +1 -0
  398. package/dist/services/PdfjsAssetCache.js +131 -0
  399. package/dist/services/PdfjsAssetCache.js.map +1 -0
  400. package/dist/services/SessionCatalogService.d.ts +27 -0
  401. package/dist/services/SessionCatalogService.d.ts.map +1 -1
  402. package/dist/services/SessionCatalogService.js +129 -34
  403. package/dist/services/SessionCatalogService.js.map +1 -1
  404. package/dist/sessions/opencode-reader.d.ts +2 -1
  405. package/dist/sessions/opencode-reader.d.ts.map +1 -1
  406. package/dist/sessions/opencode-reader.js +30 -1
  407. package/dist/sessions/opencode-reader.js.map +1 -1
  408. package/dist/sessions/types.d.ts +6 -0
  409. package/dist/sessions/types.d.ts.map +1 -1
  410. package/dist/supervisor/Process.d.ts +7 -0
  411. package/dist/supervisor/Process.d.ts.map +1 -1
  412. package/dist/supervisor/Process.js +48 -3
  413. package/dist/supervisor/Process.js.map +1 -1
  414. package/dist/supervisor/Supervisor.d.ts.map +1 -1
  415. package/dist/supervisor/Supervisor.js +11 -0
  416. package/dist/supervisor/Supervisor.js.map +1 -1
  417. package/dist/supervisor/types.d.ts +3 -1
  418. package/dist/supervisor/types.d.ts.map +1 -1
  419. package/dist/supervisor/types.js.map +1 -1
  420. package/package.json +3 -3
  421. package/client-dist/assets/AboutSettings-BlEONE7w.js +0 -1
  422. package/client-dist/assets/AgentsPage-CBku9RWz.js +0 -2
  423. package/client-dist/assets/App-DWHvFKob.js +0 -2
  424. package/client-dist/assets/AppearanceSettings-BSEBjSjr.js +0 -2
  425. package/client-dist/assets/AppsSettings-iDL6Xuaa.js +0 -1
  426. package/client-dist/assets/AttachmentChip-DHKr4EfG.js +0 -1
  427. package/client-dist/assets/BangCommandsPage-yX8grXp9.js +0 -1
  428. package/client-dist/assets/BrowserDebugToolbarButton-B-b7N4cr.js +0 -1
  429. package/client-dist/assets/ComputerControlSettings-DzRDwfJ1.js +0 -1
  430. package/client-dist/assets/DevelopmentSettings-Bf9gyeU0.js +0 -1
  431. package/client-dist/assets/DevicesSettings-dbZHFEEc.js +0 -1
  432. package/client-dist/assets/EmulatorPage-CKJwVTFq.js +0 -1
  433. package/client-dist/assets/EmulatorSettings-BV9Bg3Xk.js +0 -1
  434. package/client-dist/assets/EnvironmentSettings-DmOTuSwm.js +0 -1
  435. package/client-dist/assets/FilePage-DnPW5Pbc.js +0 -1
  436. package/client-dist/assets/FilterDropdown-CB_tRt6g.css +0 -1
  437. package/client-dist/assets/FilterDropdown-DpS1eMEf.js +0 -1
  438. package/client-dist/assets/FloatingActionButton-DBIoFwff.js +0 -1
  439. package/client-dist/assets/GlobalSessionsPage-Dbnuis89.css +0 -1
  440. package/client-dist/assets/GlobalSessionsPage-DcmQcX7q.js +0 -2
  441. package/client-dist/assets/HostIdentityContext-D5aBdejC.js +0 -1
  442. package/client-dist/assets/HostsPage-C1ZTrhJv.js +0 -1
  443. package/client-dist/assets/InboxPage-Cepu8VGM.js +0 -1
  444. package/client-dist/assets/IssueSettings-xRU8E-xR.js +0 -1
  445. package/client-dist/assets/IssuesPage-c6PUStFT.js +0 -1
  446. package/client-dist/assets/LifecycleWebhooksSettings-CZcZATjJ.js +0 -1
  447. package/client-dist/assets/MessageInput-B0t6b_Hd.js +0 -3
  448. package/client-dist/assets/MessageInputToolbar-DdP4tB2S.css +0 -1
  449. package/client-dist/assets/MessageInputToolbar-rhYW1xGJ.js +0 -58
  450. package/client-dist/assets/MessageList-Dcvfxbeq.css +0 -1
  451. package/client-dist/assets/MessageList-dH63bflu.js +0 -4
  452. package/client-dist/assets/Modal-QUinFhBP.js +0 -16
  453. package/client-dist/assets/ModelSettings-CcWkVSEK.js +0 -1
  454. package/client-dist/assets/NavigationLayout-BkOsag-J.js +0 -2
  455. package/client-dist/assets/NewSessionPage-DcZ9YjmC.js +0 -1
  456. package/client-dist/assets/NotificationsSettings-DoVzfeME.js +0 -1
  457. package/client-dist/assets/PageHeader-BaYMLVHI.js +0 -1
  458. package/client-dist/assets/PerformanceSettings-dwoVtUlX.js +0 -1
  459. package/client-dist/assets/ProjectTemplatesSettings-BlMWq1wb.js +0 -1
  460. package/client-dist/assets/ProjectsPage-B5VBairc.js +0 -1
  461. package/client-dist/assets/ProviderChildSessionPage-B3eTTTjF.js +0 -1
  462. package/client-dist/assets/ProvidersSettings-OUKp5-Hb.js +0 -1
  463. package/client-dist/assets/RemoteAccessSettings-Bn0ng7s4.js +0 -1
  464. package/client-dist/assets/RemoteExecutorsSettings-2Qh-9Qv_.js +0 -1
  465. package/client-dist/assets/SchemaValidationContext-CIAd7icg.js +0 -1
  466. package/client-dist/assets/SessionPage-B1g1UFEV.js +0 -49
  467. package/client-dist/assets/SessionPage-BiV0X3n1.css +0 -1
  468. package/client-dist/assets/SourceControlSettings-BQfC1KbV.js +0 -1
  469. package/client-dist/assets/SpeechControlMenu-BIv0O1la.js +0 -2
  470. package/client-dist/assets/StorageSettings-DQcG9Mbq.js +0 -1
  471. package/client-dist/assets/ToolbarSettings-CmHVAejU.js +0 -1
  472. package/client-dist/assets/UsersSettings-COgiiV9D.js +0 -1
  473. package/client-dist/assets/WorkstreamsPage-DKLRDEAp.js +0 -1
  474. package/client-dist/assets/channel-C-7AVqtf.js +0 -1
  475. package/client-dist/assets/classDiagram-ZZMXUADV-DkRr8VcO.js +0 -1
  476. package/client-dist/assets/classDiagram-v2-VYDZK3BY-DkRr8VcO.js +0 -1
  477. package/client-dist/assets/de-DKHK9Tu3.js +0 -6
  478. package/client-dist/assets/es-XSkBrKBg.js +0 -6
  479. package/client-dist/assets/fr-DKUJaPhN.js +0 -6
  480. package/client-dist/assets/index-BBpZzMBa.js +0 -2
  481. package/client-dist/assets/index-BUrcmRdN.js +0 -76
  482. package/client-dist/assets/index-CA-BRFYh.js +0 -1
  483. package/client-dist/assets/index-wA2zlxt-.css +0 -1
  484. package/client-dist/assets/ja-BDnQUlyD.js +0 -6
  485. package/client-dist/assets/long-context-effort-warning-BGls6uvf.js +0 -1
  486. package/client-dist/assets/newSessionPrefill-DkkSfnYR.js +0 -1
  487. package/client-dist/assets/providerChildSessions-ClrSXOQr.js +0 -80
  488. package/client-dist/assets/providerChildSessions-D2O1SLei.css +0 -1
  489. package/client-dist/assets/sessionHistorySearch.worker-BGlVvPYq.js +0 -60
  490. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-CBvcZngO.js +0 -1
  491. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-DKVyQBDp.js +0 -8
  492. package/client-dist/assets/useAcliCommentarySetting-DxndlmkH.js +0 -9
  493. package/client-dist/assets/useActivityBusState-CINl9yjP.js +0 -1
  494. package/client-dist/assets/useModelSettings-DoDJRymT.js +0 -1
  495. package/client-dist/assets/zh-CN-FVXKSeP_.js +0 -7
  496. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts +0 -14
  497. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts.map +0 -1
  498. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.js.map +0 -1
  499. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts +0 -12
  500. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts.map +0 -1
  501. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.js.map +0 -1
  502. /package/client-dist/assets/{Modal-EC-u4IZ7.css → index-EC-u4IZ7.css} +0 -0
@@ -1,2 +1,2 @@
1
- import{u as yt,r,j as s,s as Ms,bw as Di,bx as Ai,d as ir,i as _o,aG as Ht,e as Fi}from"./index-BUrcmRdN.js";import{b as an,f as ar,u as Oi,e as Ui}from"./Modal-QUinFhBP.js";import{a as Bi,P as $i,H as Qt,c as cr,b as qi,g as Hi,r as Qi,n as Ki,D as Wi}from"./types-BHkriVjU.js";import{c as zi,i as Vi,P as Kt,g as Gi,r as Yi,a as Xi,b as Ji,f as Zi,h as ea,j as ta,d as sa}from"./newSessionPrefill-DkkSfnYR.js";import{b as lr,_ as na,a as be}from"./client-sN_tbfxh.js";import{o as oa,u as ra,n as ia,c as aa,d as sn,e as ca,g as Io,a as la,b as ua,t as da,m as pa,f as fa,r as Lo}from"./YaServerProvider-OSxrnpr9.js";import{u as ha,f as Do,c as ma,h as ga}from"./speechDraftTransaction-zyWVCYTF.js";import{r as Sa}from"./recentProjectPathLinks-Ba20jx5b.js";import{b as wa}from"./useSidebarWidth-ut6NNk5Y.js";import{u as va,g as ba,a as xa,r as ja,i as ya,A as Ma,b as Ra,f as Ca,B as Ao}from"./useModelSettings-DoDJRymT.js";import{O as Pa,p as Na,s as ka,l as Ta,Q as Ea}from"./NavigationLayout-BkOsag-J.js";import{u as _a,b as Fo,d as Ia,c as La}from"./useProviders-C6kBPWYX.js";import{t as Da,u as Aa,v as Fa,b as Oa,p as Oo,d as Uo,g as Bo,m as Ua,h as Ba,a as $a,f as qa}from"./attachmentFileNames-BfFUuufi.js";import{u as Ha}from"./useRemoteExecutors-Bgjgzif1.js";import{a as Qa}from"./frontendReload-DT6MOpjg.js";import{u as Ka,r as $o,p as qo,w as Wa,n as za,D as Va,l as Ho}from"./SpeechControlMenu-BIv0O1la.js";import{p as Ga,h as Ya,g as bs,a as xs,w as Xa}from"./newSessionDefaults-C6a9Cpc6.js";import{g as ur,s as Ja,b as Za,p as Qo,M as ec,a as Ko,R as tc}from"./RecapAfterSecondsControl-qU0RMrUX.js";import{s as sc,A as nc}from"./AttachmentChip-DHKr4EfG.js";import{h as oc}from"./deviceDetection-BVPclkty.js";import{N as nn,a4 as $t}from"./providerChildSessions-ClrSXOQr.js";import{c as rc}from"./sessionNavigationState-DKXD1sTS.js";import{u as ic,g as ac,T as cc,S as lc}from"./ThinkingControls-CbZcYobp.js";import{F as on}from"./FilterDropdown-DpS1eMEf.js";import{V as uc}from"./VoiceInputButton-japn0Kx_.js";const dc="_selection_166ey_1",pc={selection:dc};function fc({eligible:t,selected:o,onChange:i}){const{transport:l}=an(),{t:u}=yt(),[f,b]=r.useState(!1);return r.useEffect(()=>{let v=!1;return b(!1),i(!1),t&&l.fetch("/computer-control").then(M=>{v||b(M.enabled&&M.available)}).catch(()=>{}),()=>{v=!0}},[l,t,i]),!f||!t?null:s.jsxs("label",{className:pc.selection,children:[s.jsx("input",{type:"checkbox",checked:o,onChange:v=>i(v.currentTarget.checked)}),s.jsxs("span",{children:[s.jsx("strong",{children:u("computerSessionOptIn")}),s.jsx("small",{children:u("computerSessionScope")})]})]})}const hc="_mutedComposer_1g8u4_4",mc="_fullPaneToggle_1g8u4_13",gc="_optionsWithCaptionToggle_1g8u4_23",Sc="_projectControlsSlot_1g8u4_27",wc="_secondaryOptions_1g8u4_28",vc="_secondaryOptionsHidden_1g8u4_43",bc="_optionLayout_1g8u4_48",xc="_optionLayoutWithoutProvider_1g8u4_56",jc="_optionLayoutWithoutProject_1g8u4_76",yc="_captionToggle_1g8u4_98",Mc="_optionCaption_1g8u4_125",Rc="_captionedRecapDuration_1g8u4_133",Cc="_fullPane_1g8u4_13",Pc="_fullPaneWide_1g8u4_219",Nc="_pendingFilesList_1g8u4_241",te={mutedComposer:hc,fullPaneToggle:mc,optionsWithCaptionToggle:gc,projectControlsSlot:Sc,secondaryOptions:wc,secondaryOptionsHidden:vc,optionLayout:bc,optionLayoutWithoutProvider:xc,optionLayoutWithoutProject:jc,captionToggle:yc,optionCaption:Mc,captionedRecapDuration:Rc,fullPane:Cc,fullPaneWide:Pc,pendingFilesList:Nc},kc=.5,dr=20,Tc=1,Ec="Ctrl+U";function _c(t){return t.key.toLowerCase()==="u"&&t.ctrlKey&&!t.shiftKey&&!t.metaKey&&!t.altKey}function Pu(t){var i;const o=t.value.length;if(o!==0){t.focus(),t.setSelectionRange(0,o);try{if((i=document.execCommand)!=null&&i.call(document,"delete"))return}catch{}t.setRangeText("",0,o,"start"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}function Ic(t,o,i,l){var u;t.focus(),t.setSelectionRange(o,i);try{const f=l?"insertText":"delete";if((u=document.execCommand)!=null&&u.call(document,f,!1,l))return}catch{}t.setRangeText(l,o,i,"end")}function Nu(t,o,i,l){const u=Math.max(0,l-i),f=o.length-t.length+u;return f<=0?"":o.slice(i,i+f)}function Xe(t){const o=Number.parseFloat(t);return Number.isFinite(o)?o:0}function Lc(t){const o=window.getComputedStyle(t),i=Xe(o.fontSize)||dr,l=Xe(o.lineHeight)||i*1.35,u=Xe(o.paddingTop)+Xe(o.paddingBottom),f=Xe(o.borderTopWidth)+Xe(o.borderBottomWidth);return l*t.rows+u+f}function pr(t){const o=t.closest('[data-composer-shell="true"], .message-input');return o instanceof HTMLElement?Math.max(0,o.getBoundingClientRect().height-t.getBoundingClientRect().height):0}function Dc(t,o){var Q;const i=t.closest('[data-composer-full-pane="true"]'),l=t.closest(".session-split"),u=l??i,f=u instanceof HTMLElement?u.getBoundingClientRect().height:0,b=((Q=window.visualViewport)==null?void 0:Q.height)??window.innerHeight,v=Number.isFinite(f)&&f>0?f:b;if(!Number.isFinite(v)||v<=0)return Number.POSITIVE_INFINITY;const M=t.closest(".session-input"),he=l instanceof HTMLElement&&M instanceof HTMLElement&&i instanceof HTMLElement?Math.max(0,M.getBoundingClientRect().height-i.getBoundingClientRect().height):0;return Math.max(o,Math.floor(v-pr(t)-he))}function Ac(t,o){var u;const i=((u=window.visualViewport)==null?void 0:u.height)??window.innerHeight;if(!Number.isFinite(i)||i<=0)return Number.POSITIVE_INFINITY;const l=pr(t);return Math.max(o,Math.floor(i*kc-l))}function Wo(t,o,i=!1){if(o)return t.style.height="",t.style.overflowY="",{overflowed:!1};const l=Lc(t);t.style.height="auto";const u=i?fr(t)*Tc:0,f=Math.max(t.scrollHeight+u,l),b=i?Dc(t,l):Ac(t,l),v=Math.min(f,b);return t.style.height=`${v}px`,t.style.overflowY=f>v+1?"auto":"hidden",{overflowed:f>v+1}}function Fc(t){return t.length===0?1:t.split(/\r\n|\r|\n/).length}function fr(t){const o=window.getComputedStyle(t),i=Xe(o.fontSize)||dr;return Xe(o.lineHeight)||i*1.35}function ku(t){const o=t.value,i=Math.max(0,Math.min(t.selectionStart??o.length,o.length)),l=fr(t),u=Math.max(0,t.scrollHeight-t.clientHeight);if(i>=o.length){t.scrollTop=u;return}const f=Fc(o.slice(0,i))-1;t.scrollTop=Math.min(u,Math.max(0,f*l))}const Oc=[],zo=new Set;function Uc(t,o){var l,u;const i=/(?:^|\s)@([^\s@]*)$/.exec(t.slice(0,o));return i?{query:i[1]??"",start:o-(((l=i[1])==null?void 0:l.length)??0)-1,end:o+(((u=/^[^\s@]*/.exec(t.slice(o)))==null?void 0:u[0].length)??0)}:null}function Bc(t){var Rt,g,ct;const o=lr(),i=an(),{version:l}=ar(),u=JSON.stringify([o,t.projectId]),f=`ya:file-completion:${u}`,[b,v]=r.useState(t.text.length),[M,he]=r.useState(!1),[Q,I]=r.useState(null),[me,W]=r.useState(null),[H,se]=r.useState(null),w=r.useRef(null),a=Uc(t.text,b),L=a==null?void 0:a.query;let it=zo.has(f);try{it||(it=localStorage.getItem(f)==="1")}catch{}const ie=!!t.projectId&&!t.disabled&&M&&Ms(l,Di)&&a!==null&&(it||a.query.length>=2)?JSON.stringify([u,a==null?void 0:a.start,a==null?void 0:a.query]):null,xe=ie!==null&&Q!==ie;r.useEffect(()=>{I(h=>h===ie?h:null),W(null)},[ie]);const Oe=t.items??Oc,Mt=r.useMemo(()=>xe?Sa(Oe):[],[Oe,xe]);r.useEffect(()=>{if(!xe||!ie||!t.projectId||L===void 0)return;let h=!1;const j=new AbortController;let D;const B=new URLSearchParams({q:L});let Ue=0;for(const oe of Mt){const Be=encodeURIComponent(oe).length+8;Ue+Be>4096||(B.append("recent",oe),Ue+=Be)}const Je=`/projects/${t.projectId}/file-completion?${B}`,ne=async()=>{try{const oe=await i.transport.fetch(Je,{signal:j.signal});if(h)return;se({key:ie,result:oe}),oe.pending&&(D=setTimeout(ne,250))}catch(oe){h||se({key:ie,error:oe instanceof Error?oe.message:String(oe)})}};return D=setTimeout(ne,75),()=>{h=!0,j.abort(),clearTimeout(D)}},[xe,ie,t.projectId,L,Mt,i]);const ae=xe&&(H==null?void 0:H.key)===ie?H:null,z=((Rt=ae==null?void 0:ae.result)==null?void 0:Rt.entries)??[],ge=z.find(h=>h.path===me)??z[0];function $(h,j,D){const B=t.textarea.current;B&&(t.replace?t.replace(h,j,D):(Ic(B,h,j,D),t.setText(B.value)),B.setSelectionRange(h+D.length,h+D.length),v(h+D.length))}function ye(h){const j=t.textarea.current;if(!j||!a||!xe||j.selectionStart!==j.selectionEnd)return;const D=/[\s"\\]/.test(h.path)?JSON.stringify(h.path):h.path;$(a.start,a.end,`${D} `),w.current={value:j.value,cursor:a.start+D.length+1},zo.add(f);try{localStorage.setItem(f,"1")}catch{}I(ie)}function C(h){var B;if(h.nativeEvent.isComposing)return!1;const j=w.current,D=t.textarea.current;if(j&&D&&D.value===j.value&&D.selectionStart===j.cursor&&D.selectionEnd===j.cursor&&(h.key===" "||h.key==="Enter")?($(j.cursor-1,j.cursor,""),w.current=null):["Shift","Control","Alt","Meta"].includes(h.key)||(w.current=null),!xe||h.ctrlKey||h.metaKey||h.altKey||h.shiftKey)return!1;if(h.key==="Escape")return h.preventDefault(),I(ie),!0;if(ge&&(h.key==="ArrowUp"||h.key==="ArrowDown")){h.preventDefault();const Ue=z.indexOf(ge);return W(((B=z[(Ue+(h.key==="ArrowDown"?1:-1)+z.length)%z.length])==null?void 0:B.path)??null),!0}return h.key==="Tab"&&ge?(h.preventDefault(),ye(ge),!0):!1}function at(h){var D;const j=w.current;if(w.current=null,j&&(h===j.value.slice(0,j.cursor)+" "+j.value.slice(j.cursor)||h===j.value.slice(0,j.cursor)+`
2
- `+j.value.slice(j.cursor))){const B=t.textarea.current;if(B)return B.setRangeText("",j.cursor-1,j.cursor,"preserve"),v(B.selectionStart),B.value}return v(((D=t.textarea.current)==null?void 0:D.selectionStart)??h.length),h}return{visible:xe,entries:z,selected:ge==null?void 0:ge.path,accept:ye,onKeyDown:C,normalizeInput:at,pending:xe&&(!ae||((g=ae.result)==null?void 0:g.pending)),truncated:((ct=ae==null?void 0:ae.result)==null?void 0:ct.truncated)??!1,error:ae==null?void 0:ae.error,onSelect:()=>{var h;v(((h=t.textarea.current)==null?void 0:h.selectionStart)??t.text.length)},onFocus:()=>he(!0),onBlur:()=>{he(!1),w.current=null}}}const $c="_menu_93hmr_1",qc="_row_93hmr_9",Hc="_basename_93hmr_26",Qc="_parent_93hmr_33",Kc="_kind_93hmr_41",Wc="_status_93hmr_45",bt={menu:$c,row:qc,basename:Hc,parent:Qc,kind:Kc,status:Wc};function zc({completion:t}){const{t:o}=yt(),i=r.useRef(null);return r.useEffect(()=>{var l,u,f;t.selected&&((f=(u=(l=i.current)==null?void 0:l.querySelector('[aria-selected="true"]'))==null?void 0:u.scrollIntoView)==null||f.call(u,{block:"nearest"}))},[t.selected]),t.visible?s.jsxs("div",{ref:i,className:bt.menu,role:"listbox","aria-label":o("fileCompletionLabel"),children:[t.entries.map(l=>{const u=l.path.replace(/\/$/,""),f=u.lastIndexOf("/");return s.jsxs("button",{type:"button",role:"option","aria-selected":l.path===t.selected,className:bt.row,onMouseDown:b=>b.preventDefault(),onClick:()=>t.accept(l),children:[s.jsx("span",{className:bt.basename,children:u.slice(f+1)}),s.jsx("span",{className:bt.parent,children:f>=0?u.slice(0,f+1):""}),s.jsx("span",{className:bt.kind,children:l.kind==="directory"?"dir":"file"})]},l.path)}),(t.pending||t.error||t.entries.length===0||t.truncated)&&s.jsx("div",{className:bt.status,role:"status",children:t.error?o("fileCompletionUnavailable"):t.pending?o("fileCompletionSearching"):t.truncated?o("fileCompletionMore"):o("fileCompletionEmpty")})]}):null}const Vc={limited:!1,provider:null,model:null,effort:null};function Gc(t){var l;if(t.username===null)return Vc;const o=((l=t.grants)==null?void 0:l.lock)??{};return{limited:!0,provider:o.provider&&Bi.includes(o.provider)?o.provider:null,model:o.model??null,effort:zi(o.effort)?o.effort:null}}function Vo(t){return t.limited?{...t.provider?{provider:t.provider}:{},...t.model?{model:t.model}:{},...t.effort?{thinking:Pa(t.effort)}:{},sandboxLevel:"project-write"}:{}}function Yc(t,o,i){return!o||t.some(l=>l.id===o)?[...t]:[...t,{id:o,name:o,description:i,catalogGroup:"additional"}]}function Xc(t,o,i,l){return Ga(t)?[...o]:Yc(o,i,l)}function Jc(t,o){var i,l;return((i=t[o])==null?void 0:i.catalogGroup)==="additional"&&((l=t[o-1])==null?void 0:l.catalogGroup)!=="additional"}function zt(t){return t.kind==="local"}function fe(t){return t.kind==="staged"}function Go(t){return zt(t)?t.file.name:t.originalName}function Zc(t){return zt(t)?t.file.size:t.size}function el(t){return zt(t)?t.file.type||"application/octet-stream":t.mimeType}function tl(t){if(fe(t)&&!(t.width===void 0||t.height===void 0))return{width:t.width,height:t.height}}function js(t){return Da(t)}function Yo(t){for(const o of t)o.previewUrl&&URL.revokeObjectURL(o.previewUrl)}const hr=["off","side-session","fork"],mr=[...$i];function Xo(t,o){return t==="off"?"off":t==="auto"?"auto":`on:${o}`}function Jo(t){if(t==="off")return{mode:"off",effort:"high"};if(t==="auto")return{mode:"auto",effort:"high"};const o=t.startsWith("on:")?t.slice(3):t;return{mode:"on",effort:Vi(o)?o:"high"}}function sl(t,o){return o==="off"?!0:o==="native"?!1:(t==null?void 0:t.supportsRecaps)===!0}function nl(t,o){return o!=null&&o.recapMode&&hr.includes(o.recapMode)?o.recapMode:"off"}function ol(t,o){return sl(t,o)?o:"off"}function rl(t,o){return o==="off"?!0:(t==null?void 0:t.supportsNativePromptSuggestions)===!0}function il(t){return t!=null&&t.promptSuggestionMode&&mr.includes(t.promptSuggestionMode)?t.promptSuggestionMode:"off"}function al(t,o){return rl(t,o)?o:"off"}function ys(t,o){const i=o==null?void 0:o.helperSideModel;return i&&(i===Qt||i===cr||t.some(l=>l.id===i))?i:Qt}const cl=10,ll=10;function Zo(t){return t.lastActivity?new Date(t.lastActivity).getTime():0}function ul(t,o=[]){const i=new Map(o.map((l,u)=>[l,u]));return[...t].sort((l,u)=>{const f=i.get(l.id)??Number.POSITIVE_INFINITY,b=i.get(u.id)??Number.POSITIVE_INFINITY;if(f!==b)return f-b;const v=Zo(u)-Zo(l);if(v!==0)return v;const M=l.name.localeCompare(u.name);return M!==0?M:l.path.localeCompare(u.path)})}function qt(t){const o=t.trim();return o?o.length>1&&/[/\\]$/.test(o)?o.slice(0,-1):o:""}function er(t,o){const i=qt(o);if(!i)return null;const l=t.find(f=>f.path===i);if(l)return l;const u=t.filter(f=>f.name.toLowerCase()===i.toLowerCase());return u.length===1?u[0]??null:null}function dl({version:t,text:o,attachmentCount:i}){return i>0&&!o.trim()&&!Ms(t??void 0,Ai)}let Wt=0,tr=!1;function sr(t){return Number.isFinite(t)?t:0}function nr(t=Date.now()){return Math.round(t+Wt)}function pl(){return Wt}function rn(t){if(!Number.isFinite(t.serverTimestamp))return null;const o=sr(t.clientRequestStartMs),i=sr(t.clientResponseEndMs),l=Math.max(0,i-o),u=o+l/2,f=t.serverTimestamp-u;return Wt=tr?Wt*.8+f*.2:f,tr=!0,{serverOffsetMs:Wt,roundTripMs:l,sampleOffsetMs:f}}function or(t,o){if(!(!Number.isFinite(t)||!Number.isFinite(o)))return o-t}function fl(t){return t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.shiftKey&&(t.code==="Space"||t.key===" "||t.key==="Spacebar")}function hl(t){const o=r.useRef(0),i=r.useRef(null),[l,u]=r.useState(!1),f=r.useCallback(()=>{o.current=0,i.current!==null&&(clearTimeout(i.current),i.current=null),u(!1)},[]),b=r.useCallback(()=>{if(t<=0){f();return}o.current=Date.now()+t,i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,o.current=0,u(!1)},t),u(!0)},[f,t]),v=r.useCallback(()=>{const M=o.current>Date.now();return!M&&o.current!==0&&f(),M},[f]);return r.useEffect(()=>{t<=0&&f()},[f,t]),r.useEffect(()=>()=>{o.current=0,i.current!==null&&clearTimeout(i.current),i.current=null},[]),{active:l,noteSpeech:b,isRecent:v,consume:f}}function ml({expanded:t,onToggle:o,className:i}){const{t:l}=yt();return s.jsx("button",{type:"button",className:i,onClick:o,"aria-label":l(t?"composerFullPaneRestore":"composerFullPaneExpand"),"aria-pressed":t,title:l(t?"composerFullPaneRestoreTitle":"composerFullPaneExpandTitle",{shortcut:Ec}),children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t?s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M9 3v6H3"}),s.jsx("path",{d:"m3 3 6 6"}),s.jsx("path",{d:"M15 21v-6h6"}),s.jsx("path",{d:"m21 21-6-6"})]}):s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M8 3H3v5"}),s.jsx("path",{d:"m3 3 6 6"}),s.jsx("path",{d:"M16 21h5v-5"}),s.jsx("path",{d:"m21 21-6-6"})]})})})}const gl="_fixedLaunch_1qxr7_5",Sl="_caption_1qxr7_20",wl="_rows_1qxr7_30",vl="_rowLabel_1qxr7_37",bl="_rowValue_1qxr7_42",xl="_badge_1qxr7_55",xt={fixedLaunch:gl,caption:Sl,rows:wl,rowLabel:vl,rowValue:bl,badge:xl};function jl({lock:t,modelLabel:o,effortLabel:i,sandboxAvailable:l,className:u}){const{t:f}=yt(),b=ur(f);if(!t.limited)return null;const v=[];return t.provider&&v.push({key:"provider",label:b.provider.title,value:s.jsx(Kt,{provider:t.provider,model:t.model??void 0,className:xt.badge})}),t.model&&v.push({key:"model",label:b.model.title,value:o??t.model}),t.effort&&v.push({key:"effort",label:f("newSessionFixedEffortLabel"),value:i??t.effort}),l&&v.push({key:"sandbox",label:b.sandbox.title,value:f("newSessionFixedSandboxValue")}),v.length===0?null:s.jsxs("section",{className:`${xt.fixedLaunch}${u?` ${u}`:""}`,"aria-label":f("newSessionFixedTitle"),children:[s.jsx("h3",{children:f("newSessionFixedTitle")}),s.jsx("p",{className:xt.caption,children:f("newSessionFixedCaption")}),s.jsx("dl",{className:xt.rows,children:v.map(M=>s.jsxs(r.Fragment,{children:[s.jsx("dt",{className:xt.rowLabel,children:M.label}),s.jsx("dd",{className:xt.rowValue,children:M.value})]},M.key))})]})}const yl="_section_1nqke_1",Ml="_header_1nqke_11",Rl="_count_1nqke_34",Cl="_error_1nqke_41",Pl="_itemError_1nqke_42",Nl="_list_1nqke_49",kl="_item_1nqke_42",Tl="_itemButton_1nqke_61",El="_itemHeading_1nqke_93",_l="_itemTitle_1nqke_101",Il="_status_1nqke_111",Ll="_statusDispatching_1nqke_125",Dl="_statusFailed_1nqke_130",Al="_targetRow_1nqke_135",Fl="_target_1nqke_135",Ol="_provider_1nqke_152",G={section:yl,header:Ml,count:Rl,error:Cl,itemError:Pl,list:Nl,item:kl,itemButton:Tl,itemHeading:El,itemTitle:_l,status:Il,statusDispatching:Ll,statusFailed:Dl,targetRow:Al,target:Fl,provider:Ol},Ul={queued:void 0,dispatching:G.statusDispatching,failed:G.statusFailed};function Bl(t,o){switch(t){case"dispatching":return o("projectQueueStatusDispatching");case"failed":return o("projectQueueStatusFailed");case"queued":return o("projectQueueStatusQueued")}}function $l(t,o){var i,l;return t.target.type==="new-session"?o("projectQueueTargetNewSession"):((i=t.targetFullTitle)==null?void 0:i.trim())||((l=t.targetTitle)==null?void 0:l.trim())||o("projectQueueTargetSession",{sessionId:t.target.sessionId.slice(0,8)})}function ql(t,o){var l;const i=t.messagePreview.trim();return t.target.type==="new-session"?((l=t.target.title)==null?void 0:l.trim())||i||o("projectQueueAttachmentOnly"):i||o("projectQueueAttachmentOnly")}function Hl({items:t,loading:o,error:i,onOpenItem:l}){const{t:u}=yt(),f=r.useId();return t.length===0&&!i?null:s.jsxs("section",{className:G.section,"aria-labelledby":f,"data-new-session-project-queue":"true",children:[s.jsxs("div",{className:G.header,children:[s.jsx("h3",{id:f,children:u("projectQueueTitle")}),s.jsx("span",{className:G.count,children:o?u("projectQueueRefreshing"):u("projectQueueCount",{count:t.length})})]}),i&&s.jsx("p",{className:G.error,role:"alert",children:u("projectQueueLoadError",{message:i.message})}),s.jsx("ul",{className:G.list,children:t.map(b=>{const v=ql(b,u);return s.jsx("li",{className:G.item,"data-new-session-project-queue-item-id":b.id,children:s.jsxs("button",{type:"button",className:G.itemButton,onClick:()=>l(b.id),title:v,children:[s.jsxs("span",{className:G.itemHeading,children:[s.jsx("strong",{className:G.itemTitle,children:v}),s.jsx("span",{className:`${G.status} ${Ul[b.status]??""}`,children:Bl(b.status,u)})]}),s.jsxs("span",{className:G.targetRow,children:[s.jsx("span",{className:G.target,children:$l(b,u)}),b.target.provider&&s.jsx(Kt,{provider:b.target.provider,model:b.target.model,className:G.provider})]}),b.lastError&&s.jsx("span",{className:G.itemError,children:b.lastError})]})},b.id)})})]})}function Ql(){return Ht()}function Kl(){return`speech-target-${Ht()}`}function Wl(t){return{name:t,displayName:t,installed:!1,authenticated:!1,enabled:!1}}function Fe({caption:t,children:o,className:i,showCaption:l,title:u}){return s.jsxs("div",{className:i,title:l?void 0:t,children:[s.jsx("h3",{children:u}),l&&t&&s.jsx("p",{className:te.optionCaption,children:t}),o]})}function Tu({projectId:t,selectedProject:o,projects:i=[],recentProjectIds:l=[],projectsLoading:u=!1,onProjectChange:f,autoFocus:b=!0,rows:v=6,placeholder:M,compact:he=!1,preferredProvider:Q,preferredModel:I,preferredThinking:me,preferredPermissionMode:W,preferredExecutor:H,incomingShareFiles:se,launch:w}){var Ro,Co;const{t:a}=yt(),L=ur(a),it=ir(),Vt=Oi(),{relayTransport:ie,relayedServerSpeechAvailable:xe}=oa(),Oe=lr(),Mt=an(),ae=Mt.summary,z=Mt.transport,ge=r.useMemo(()=>(w==null?void 0:w.draftKey)??wa(Oe),[Oe,w==null?void 0:w.draftKey]),[$,ye,C]=ha(ge),[at,Rt]=r.useState("default"),[g,ct]=r.useState(null),[h,j]=r.useState(null),[D,B]=r.useState("off"),[Ue,Je]=r.useState("high"),[ne,oe]=r.useState("off"),[Be,Rs]=r.useState("none"),[Cs,Sr]=r.useState(!1),[Gt,Yt]=r.useState(!0),[Ne,cn]=r.useState(qi),[lt,ln]=r.useState("off"),[ut,Ct]=r.useState(Qt),[Ps,Ns]=r.useState(null),[Y,wr]=r.useState([]),ke=r.useRef([]),dt=r.useRef(null),Xt=r.useRef(0),ks=r.useRef(new Map),Ts=r.useRef(new Set),[A,pt]=r.useState(!1),[Te,vr]=r.useState(!1),[Jt,un]=r.useState(!1),[re,br]=r.useState(!1),[dn,xr]=r.useState(null),[jr,Es]=r.useState({}),[Zt]=Aa(),{visibility:pn}=Ka(),[Ee,Ze]=r.useState(""),$e=r.useRef(Ee);$e.current=Ee;const[Pt,fn]=r.useState(null),ft=r.useRef(null),qe=r.useRef(null),He=r.useRef(!1),es=r.useRef(!1),_s=r.useRef(!1),hn=r.useRef(()=>{}),{asrAttributionMs:mn,speechMessagePrefix:Nt}=ra(),{active:yr,noteSpeech:ts,isRecent:Is,consume:Ls}=hl(mn),[,ss]=r.useState(0),[_e,Ie]=r.useState(!1),[Mr,gn]=r.useState(null),[Ds,ns]=r.useState({status:"idle",projectId:null,workstreams:[]}),[kt,os]=r.useState(()=>(o==null?void 0:o.path)??""),Sn=r.useRef(null),wn=r.useRef(null),Rr=r.useRef(null),vn=r.useRef(null),Me=r.useRef(null),X=r.useRef(null),As=r.useRef(null),J=r.useRef(null),Z=r.useRef(null),je=r.useRef(new Map),Qe=r.useRef(null),Le=r.useRef(null),Fs=r.useRef(!1),ht=r.useRef(null),bn=r.useRef(!1),xn=r.useRef(!1),ee=r.useRef(!1),Tt=r.useRef(null),jn=r.useRef(!1),Os=r.useRef(null),yn=r.useRef(b),{effortLevel:Mn,thinkingMode:Rn,showThinking:Cr,setShowThinking:Pr,voiceInputEnabled:Nr,speechMethod:Cn,hasStoredSpeechMethod:Pn,setSpeechMethod:Nn,speechSmartTurnSettings:kr,setSpeechSmartTurnSettings:Tr}=va(),{version:E,loading:kn}=ar(),{principal:Tn}=Na(),U=r.useMemo(()=>Gc(Tn),[Tn]),ce=Ja(E),En=Za(g),et=En?Ps:null,_n=ce&&et===null&&Qo(g),Se=U.limited?"project-write":_n?Be:"none",Et=Se==="project-write"&&Gt,Us=g==="codex"&&!et&&Se==="none"&&!w&&Ms(E,_o.computerControl.name),mt=ka(E),In=((Ro=E==null?void 0:E.clientDefaults)==null?void 0:Ro.projectQueueCtrlEnterEnabled)??Hi,{hasBrowserXaiSttApiKey:rs}=ia(),{showToast:le}=Ui(),is=(w==null?void 0:w.allowAttachments)??!0,Er=(w==null?void 0:w.allowProjectQueue)??!0,Ln=(w==null?void 0:w.fixedProject)??!1,Re=(w==null?void 0:w.composer)==="muted",Dn=!((w==null?void 0:w.fixedProviderModel)??!1),An=Dn&&!U.provider,Fn=Dn&&!U.model;Os.current===null&&(Os.current=$),r.useLayoutEffect(()=>{if(!w||jn.current||!w.initialMessage)return;jn.current=!0;const e=Os.current??"";if(!$){ye(w.initialMessage);return}if(e)return;const n=`${w.initialMessage}${$}`;ht.current={value:n,restore:p=>{p.focus(),p.setSelectionRange(n.length,n.length)}},ye(n)},[w,$,ye]);const On=r.useCallback(e=>{var d;const n=e.filter(fe).map(js);if(n.length===0){e.some(c=>c.kind==="uploading")||(dt.current=null),C.setAttachmentState(null);return}const p=(d=n[0])==null?void 0:d.batchId;if(!p){C.setAttachmentState(null);return}dt.current=p,C.setAttachmentState({batchId:p,refs:n,updatedAt:new Date().toISOString()})},[C]),ue=r.useCallback((e,n)=>{const p=ke.current,d=typeof e=="function"?e(p):e;if(d===p)return;const c=[...d];if(n!=null&&n.revokeRemovedPreviewUrls){const m=new Set(c.map(x=>x.id));Yo(p.filter(x=>!m.has(x.id)))}ke.current=c,wr(c),(n==null?void 0:n.persistDraft)!==!1&&On(c)},[On]);r.useEffect(()=>()=>{Yo(ke.current)},[]);const Un=r.useCallback(()=>{var p;const e=((p=C.getAttachmentState())==null?void 0:p.batchId)??dt.current;if(e)return dt.current=e,e;const n=Ht();return dt.current=n,n},[C]),Bn=r.useCallback(async()=>{var p;if(!mt)return;const e=C.getAttachmentState();if(!e){ue(d=>d.some(fe)?d.filter(c=>!fe(c)):d,{persistDraft:!1,revokeRemovedPreviewUrls:!0});return}if(ke.current.some(d=>d.kind==="uploading"||fe(d)))return;const n=Xt.current+1;Xt.current=n;try{const d=await Fa(z,e);if(Xt.current!==n)return;const c=d.length>0?{batchId:((p=d[0])==null?void 0:p.batchId)??e.batchId,refs:d,updatedAt:new Date().toISOString()}:null;dt.current=(c==null?void 0:c.batchId)??null,C.setAttachmentState(c),ue(m=>[...m.filter(x=>!fe(x)),...d.map(x=>({...x,kind:"staged"}))],{persistDraft:!1,revokeRemovedPreviewUrls:!0})}catch(d){if(Xt.current!==n)return;console.warn("[NewSessionForm] Failed to validate draft attachments:",d),C.setAttachmentState(null),ue(c=>c.some(fe)?c.filter(m=>!fe(m)):c,{persistDraft:!1,revokeRemovedPreviewUrls:!0}),le(a("sessionDraftAttachmentsUnavailable"),"info")}},[z,C,ue,le,mt,a]);r.useEffect(()=>{Bn()},[Bn,ge]);const as=r.useCallback(e=>{if(e.length===0)return;const n=ke.current.map(Go),p=Oa(e,n),d=mt?Un():null;if(!d){const c=p.map(m=>({kind:"local",id:`pending-${Ht()}`,file:m,previewUrl:m.type.startsWith("image/")?URL.createObjectURL(m):void 0}));ue(m=>[...m,...c]);return}for(const c of p){const m=`pending-${Ht()}`,x=c.type.startsWith("image/")?URL.createObjectURL(c):void 0,k={kind:"uploading",id:m,originalName:c.name,size:c.size,mimeType:c.type||"application/octet-stream",...x?{previewUrl:x}:{}};ue(R=>[...R,k]);const V=(async()=>{const R=c.type.startsWith("image/")?await Oo(c,Bo(Zt)):{file:c},F=R.file,S=await z.uploadStagedAttachment(F,{batchId:d,onProgress:N=>{Es(y=>({...y,[m]:{uploaded:N,total:F.size}}))},...R.width!==void 0&&R.height!==void 0?{imageDimensions:{width:R.width,height:R.height}}:{}});return F.type.startsWith("image/")&&sc({id:S.id,originalName:c.name,name:S.name,path:S.id,size:S.size,mimeType:S.mimeType,...S.width!==void 0?{width:S.width}:{},...S.height!==void 0?{height:S.height}:{}},F).catch(()=>{}),{...S,originalName:c.name,kind:"staged",...x?{previewUrl:x}:{}}})().then(R=>Ts.current.delete(m)||!ke.current.some(S=>S.id===m)?(x&&URL.revokeObjectURL(x),Uo(z,R.batchId,R.id).catch(S=>{console.warn("[NewSessionForm] Failed to delete staged attachment:",S)}),null):(ue(S=>S.map(N=>N.id===m?R:N)),R),R=>{if(!(Ts.current.delete(m)||!ke.current.some(S=>S.id===m))){console.error("Failed to upload staged file:",R);const S=R instanceof Error?R.message:String(R);le(a("newSessionUploadError",{message:S}),"error"),ue(N=>N.filter(y=>y.id!==m),{revokeRemovedPreviewUrls:!0})}return null}).finally(()=>{Es(R=>{const{[m]:F,...S}=R;return S}),ks.current.delete(m)});ks.current.set(m,V)}},[Zt,z,Un,ue,le,mt,a]),$n=r.useRef(null);r.useEffect(()=>{!is||!(se!=null&&se.length)||$n.current===se||($n.current=se,as(se))},[as,is,se]);const{providers:De,loading:qn,stale:_r}=_a(),{usage:Hn}=ic(g,{bootstrapTier:"supplementary"}),{settings:P,isLoading:cs,updateSetting:Qn}=Qa(),Kn=r.useRef(P==null?void 0:P.newSessionDefaults);r.useEffect(()=>{Kn.current=P==null?void 0:P.newSessionDefaults},[P==null?void 0:P.newSessionDefaults]);const{executors:Wn,loading:Ir}=Ha(),Lr=Fo(De),Dr=M??a("newSessionPlaceholder"),Ar={default:a("modeDefaultLabel"),acceptEdits:a("modeAcceptEditsLabel"),plan:a("modePlanLabel"),bypassPermissions:a("modeBypassPermissionsLabel"),auto:a("modeAutoLabel")},Fr={default:a("modeDefaultDescription"),acceptEdits:a("modeAcceptEditsDescription"),plan:a("modePlanDescription"),bypassPermissions:a("modeBypassPermissionsDescription"),auto:a("modeAutoDescription")},Or={off:a("recapModeOff"),native:a("recapModeNative"),"side-session":a("recapModeSideSession"),fork:a("recapModeFork")},Ur={off:a("promptSuggestionModeOff"),native:a("promptSuggestionModeNative")},zn={off:a("promptSuggestionModeOffDescription"),native:a("promptSuggestionModeNativeDescription")},Br={off:a("recapAfterSecondsLabel"),native:a("recapAfterSecondsInlineNative"),"side-session":a("recapAfterSecondsInlineSideSession"),fork:a("recapAfterSecondsInlineFork")},Ke=Ia(g,{forceRefreshOnMount:g==="claude-gateway"}),$r=De.find(e=>e.name===g),q=Ke.row??$r,we=(q==null?void 0:q.models)??[],tt=r.useMemo(()=>Xc(g,we,h,a("modelSelectionUnavailable")),[we,h,g,a]),_t=(g!=="claude-gateway"||Ke.fresh&&!Ke.refreshing&&Ke.error===null)&&Ya(g,we,h),Vn=r.useMemo(()=>[...tt],[tt]),qr=r.useMemo(()=>[{value:Qt,label:a("helperSideModelCheapest")},{value:cr,label:a("helperSideModelSameAsMain"),description:h??void 0},...Vn.map(e=>({value:e.id,label:e.name,description:e.description}))],[Vn,h,a]),Hr=(q==null?void 0:q.supportsPermissionMode)??!0,Qr=(q==null?void 0:q.supportsThinkingToggle)??!0,gt=tt.find(e=>e.id===h),ls=r.useMemo(()=>Gi({provider:q,model:gt,translate:a}),[gt,q,a]),us=Yi(Ue,ls),Bs=r.useMemo(()=>Xi({provider:q,model:gt,effortOptions:ls}),[ls,gt,q]),ds=Ji(D,Bs),Kr=Qr&&!U.effort&&Bs.some(e=>e!=="off"),Gn=r.useMemo(()=>ac({model:gt}),[gt]),ps=Gn.includes(at)?at:"default",Ae=r.useCallback(e=>({model:e==="claude"?Qi(ba()):void 0,thinkingMode:Rn,effortLevel:Mn}),[Mn,Rn]),Wr=hr,zr=mr,Vr=ne==="side-session",It=r.useMemo(()=>ul(i,l),[i,l]),Yn=r.useMemo(()=>It.slice(0,cl),[It]),We=qt(kt),Xn=qt((o==null?void 0:o.path)??""),Ce=!!We&&!!Xn&&We===Xn?"":We,Lt=r.useMemo(()=>er(i,Ce),[Ce,i]),Jn=r.useMemo(()=>{if(!Ce)return It;const e=Ce.toLowerCase();return It.filter(n=>n.name.toLowerCase().includes(e)||n.path.toLowerCase().includes(e))},[Ce,It]),Dt=r.useMemo(()=>(Ce?Jn:Yn).slice(0,ll),[Ce,Jn,Yn]),Gr=r.useMemo(()=>Dt.map(e=>s.jsx("option",{value:e.path,children:e.name},e.id)),[Dt]),ze=!!Ce&&Lt===null,_=Lt??o??null,Pe=!ze&&We&&_?_.id:null,St=Bc({projectId:Pe,text:$,textarea:Me,setText:ye,disabled:A||Re||!!Ee}),Yr=r.useMemo(()=>Pe?[Pe]:[],[Pe]),$s=Ta(Yr),Xr=na(Pe),Zn=Pe?$s.queuesByProject[Pe]??[]:[],Jr=Zn.length,Zr=(_==null?void 0:_.projectQueueBlockingCount)??null,qs=mt&&Ea({projectId:Pe,activeProjectSessionIds:Xr,projectQueueBlockingCount:Zr,projectQueueItemCount:Jr}),Hs=!ze&&_===null,ei=(_==null?void 0:_.name)??a("newSessionProjectDetached"),Qs=ze?We:(_==null?void 0:_.path)??a("newSessionProjectDetachedHint"),ti=ze||_?nn(Qs):Qs,Ve=!ze&&We&&_?_.id:null,Ks=(P==null?void 0:P.workstreamsEnabled)===!0;r.useEffect(()=>{if(gn(null),!Ks||!Ve){ns({status:"idle",projectId:null,workstreams:[]});return}let e=!1;return ns({status:"loading",projectId:Ve,workstreams:[]}),be.getProjectWorkstreams(Ve).then(n=>{e||ns({status:"ready",projectId:Ve,workstreams:n.workstreams})}).catch(()=>{e||ns({status:"error",projectId:Ve,workstreams:[]})}),()=>{e=!0}},[Ks,Ve]);const fs=Ds.status==="ready"&&Ds.projectId===Ve?Ds.workstreams.filter(e=>e.kind==="main"||e.status==="active"):[],si=Ks&&Ve!==null&&fs.length>1,st=fs.find(e=>e.id===Mr)??fs.find(e=>e.kind==="main")??null,Ws=(st==null?void 0:st.kind)==="checkout"?st.id:void 0,ni=r.useCallback(e=>{const n=e.currentTarget.value;gn(n||null)},[]),hs=r.useCallback(e=>{os(e.path),Tt.current=e.id,f==null||f(e.id),Ie(!1)},[f]),eo=r.useCallback(()=>{os(""),Tt.current=null,f==null||f(null),Ie(!1)},[f]),to=r.useMemo(()=>{if(!_e)return null;const e=[s.jsxs("button",{type:"button",className:`new-session-project-option ${Hs?"selected":""}`,onClick:eo,children:[s.jsx("span",{className:"new-session-project-option-name",children:a("newSessionProjectDetached")}),s.jsx("span",{className:"new-session-project-option-path",children:a("newSessionProjectDetachedHint")})]},"detached")];return ze&&e.push(s.jsxs("button",{type:"button",className:"new-session-project-option new-session-project-option-custom",onClick:()=>Ie(!1),children:[s.jsx("span",{className:"new-session-project-option-name",children:a("newSessionProjectUseTypedPath")}),s.jsx("span",{className:"new-session-project-option-path",children:Ce})]},"custom")),u?(e.push(s.jsx("div",{className:"new-session-project-empty",children:a("newSessionLoading")},"loading")),e):Dt.length===0?(e.push(s.jsx("div",{className:"new-session-project-empty",children:a("newSessionProjectNoMatches")},"no-matches")),e):(e.push(...Dt.map(n=>s.jsxs("button",{type:"button",className:`new-session-project-option ${(_==null?void 0:_.id)===n.id&&!ze?"selected":""}`,onClick:()=>hs(n),title:n.path,children:[s.jsx("span",{className:"new-session-project-option-name",children:n.name}),s.jsx("span",{className:"new-session-project-option-path",children:nn(n.path)})]},n.id))),e)},[_==null?void 0:_.id,eo,hs,ze,Hs,_e,Ce,Dt,u,a]),ms=r.useCallback(()=>{U.limited&&(U.provider&&ct(U.provider),U.model&&j(U.model),U.effort&&(Je(U.effort),B("on")),Rs("project-write"),Yt(!0),oe(e=>e==="side-session"?"off":e))},[U]),gs=r.useCallback(e=>{const n=e.length>0,p=new Set(Fo(e).map(O=>O.name)),d=O=>!n||p.has(O),c=P==null?void 0:P.newSessionDefaults,m=Q&&d(Q)?Q:null,x=m??(c!=null&&c.provider&&d(c.provider)?c.provider:null),k=e.find(O=>O.name===x)??La(e)??(n?null:Wl(x??Wi));if(!k)return;const V=k.models??[],R=m&&k.name===m&&I&&(k.name!=="claude-gateway"&&V.length===0||V.some(O=>O.id===I))?I:null,F=il(c),S=bs(c,k.name,Ae(k.name));ct(k.name),j(R??xs(k.name,V,S.model));const N=me?Jo(me):null;B((N==null?void 0:N.mode)??S.thinkingMode??"off"),Je((N==null?void 0:N.effort)??S.effortLevel??"high");const y=ce&&(c==null?void 0:c.sandboxLevel)==="project-write"?"project-write":"none",T=nl(k,c);oe(Qo(k.name)&&y==="project-write"&&T==="side-session"?"off":T),Rs(y),Yt(y==="project-write"&&(c==null?void 0:c.sandboxNetworkFirewall)!==!1),cn(Ki(c==null?void 0:c.recapAfterSeconds)),ln(F),Ct(ys(V,S)),Rt(W??(c==null?void 0:c.permissionMode)??"default"),Ns(H??null),ms()},[ms,P,ce,Ae,Q,I,me,W,H]);r.useEffect(()=>{bn.current||cs||(bn.current=!0,!ee.current&&gs(De))},[gs,De,cs]),r.useEffect(()=>{xn.current||qn||cs||kn||(xn.current=!0,!ee.current&&De.length!==0&&gs(De))},[gs,De,qn,cs,kn]),r.useEffect(()=>{ms()},[ms]),r.useEffect(()=>{const e=t??null;Tt.current!==e&&(Tt.current=e,os(n=>n||((o==null?void 0:o.path)??"")))},[t,o]),r.useEffect(()=>{if(!_e)return;const e=d=>{if(!(d instanceof Node))return;const c=wn.current;c&&!c.contains(d)&&Ie(!1)},n=d=>{e(d.target)},p=d=>{e(d.target)};return document.addEventListener("pointerdown",n,!0),document.addEventListener("focusin",p,!0),()=>{document.removeEventListener("pointerdown",n,!0),document.removeEventListener("focusin",p,!0)}},[_e]);const oi=e=>{ee.current=!0,ct(e);const n=De.find(m=>m.name===e),p=(n==null?void 0:n.models)??[],d=bs(P==null?void 0:P.newSessionDefaults,e,Ae(e));n!=null&&n.models&&n.models.length>0?j(xs(e,p,d.model)):j(null);const c=me?Jo(me):null;B((c==null?void 0:c.mode)??d.thinkingMode??"off"),Je((c==null?void 0:c.effort)??d.effortLevel??"high"),Ct(ys(p,d))};r.useEffect(()=>{if(g!=="claude-gateway"||h&&we.some(p=>p.id===h))return;const e=bs(P==null?void 0:P.newSessionDefaults,g,Ae(g)),n=xs(g,we,e.model);h!==n&&(j(n),Ct(ys(we,e)))},[we,Ae,h,g,P==null?void 0:P.newSessionDefaults]),r.useEffect(()=>{if(!g||h||we.length===0)return;const e=bs(P==null?void 0:P.newSessionDefaults,g,Ae(g)),n=xs(g,we,e.model);n&&(j(n),Ct(ys(we,e)))},[we,Ae,h,g,P==null?void 0:P.newSessionDefaults]);const Ss=r.useMemo(()=>tt.map((e,n)=>{const p=e.size?`${e.name} (${(e.size/1073741824).toFixed(1)} GB)`:e.name;let d=e.description;if(!d){const c=[];e.parameterSize&&c.push(e.parameterSize),e.contextWindow&&c.push(`${Math.round(e.contextWindow/1024)}K ctx`),e.parentModel&&c.push(e.parentModel),e.quantizationLevel&&c.push(e.quantizationLevel),c.length>0&&(d=c.join(" · "))}return{value:e.id,label:p,description:d,groupLabelBefore:Jc(tt,n)?a("previousModelsGroup"):void 0,icon:g?s.jsx(Kt,{provider:g,model:e.id}):void 0,meta:s.jsx(ec,{usage:Hn,modelId:e.id})}}),[g,Hn,a,tt]),so=r.useCallback(e=>{ee.current=!0,j(e[0]??null)},[]),no=r.useMemo(()=>{const e=(E==null?void 0:E.voiceBackends)??[];return xa(e,void 0,{directXaiAvailable:rs}).map(n=>({value:n.id,label:n.label,description:n.description,disabled:!n.clientSupported}))},[E==null?void 0:E.voiceBackends,rs]),wt=r.useMemo(()=>ja(Cn,E==null?void 0:E.voiceBackends,Pn,{directXaiAvailable:rs,browserNativeAvailable:ya()}),[Cn,E==null?void 0:E.voiceBackends,Pn,rs]),ri=r.useCallback(e=>{const n=e[0];n&&Ma(n)&&Nn(n)},[Nn]),ii=Nr&&no.length>1,ai=wt===null?{}:Ra(wt,E==null?void 0:E.voiceBackendCapabilities),oo=wt!==null&&Ca({methodId:wt,serverCapabilities:E==null?void 0:E.voiceBackendCapabilities,relayTransport:ie,relayedServerSpeechAvailable:xe})&&ai.smartTurn===!0,ro=oo?kr:void 0,ci=r.useCallback(e=>{if(Me.current=e,!e||!yn.current)return;yn.current=!1,e.focus();const n=e.value.length;e.setSelectionRange(n,n)},[]);r.useLayoutEffect(()=>{const e=ht.current,n=Me.current;!e||!n||$!==e.value||n.value!==e.value||(ht.current=null,e.restore(n))},[$]),r.useLayoutEffect(()=>{var p;const e=Me.current;if(!e)return;if(!Te){Wo(e,!0);return}const n=()=>{const{overflowed:d}=Wo(e,!1,!0);d&&!Jt&&un(!0)};return n(),window.addEventListener("resize",n),(p=window.visualViewport)==null||p.addEventListener("resize",n),()=>{var d;window.removeEventListener("resize",n),(d=window.visualViewport)==null||d.removeEventListener("resize",n)}},[Te,Jt,$]);const io=r.useCallback(()=>{var e;if(!(he||Re)){if(!Te){const n=(e=vn.current)==null?void 0:e.getBoundingClientRect().width;xr(n&&n>0?n:null),un(!1)}vr(n=>!n)}},[he,Re,Te]);r.useEffect(()=>{const e=new URLSearchParams(window.location.search),n=e.get("prefillToken"),p=n?Zi(n,Oe):ea(Oe);if(p){if(n){e.delete("prefillToken");const d=e.toString(),c=`${window.location.pathname}${d?`?${d}`:""}${window.location.hash}`;window.history.replaceState(window.history.state,"",c)}ht.current={value:p.text,restore:d=>{const c=p.caret==="start"?0:p.text.length;d.focus(),d.setSelectionRange(c,c)}},ye(p.text)}},[Oe,ye]);const li=r.useCallback(e=>{e.key==="Enter"?(e.preventDefault(),Lt?hs(Lt):We&&Ie(!1)):e.key==="Escape"&&(e.preventDefault(),Ie(!1))},[Lt,hs,We]),ui=e=>{const n=e.target.files;n!=null&&n.length&&(as(Array.from(n)),e.target.value="")},di=e=>{const n=ke.current.find(p=>p.id===e);(n==null?void 0:n.kind)==="uploading"&&Ts.current.add(e),ue(p=>p.filter(d=>d.id!==e),{revokeRemovedPreviewUrls:!0}),n&&fe(n)&&Uo(z,n.batchId,n.id).catch(p=>{console.warn("[NewSessionForm] Failed to delete staged attachment:",p)})},pi=e=>{ee.current=!0,Rt(e)};r.useEffect(()=>{if(!ee.current||!g)return;const{helperSideModel:e,sandboxLevel:n,sandboxNetworkFirewall:p,...d}=Kn.current??{};Promise.resolve(Qn("newSessionDefaults",{...Xa({...d,provider:g??void 0,permissionMode:at,recapMode:ne,recapAfterSeconds:Ne,promptSuggestionMode:lt,...ce?{sandboxLevel:Be,...Be==="project-write"?{sandboxNetworkFirewall:Gt}:{}}:{}},g,{model:h??void 0,thinkingMode:D,effortLevel:Ue,helperSideModel:ut},Ae(g))})).catch(c=>{console.error("Failed to save new session defaults:",c)})},[Ae,ut,at,Ne,Be,Gt,h,Ue,g,lt,ne,D,ce,Qn]);const zs=r.useCallback(async e=>{var p;let n=e&&(_==null?void 0:_.path)===e?_.id:((p=er(i,e))==null?void 0:p.id)??null;if(e&&!n){if(n=(await be.addProject(e)).project.id??null,!n)return null;Tt.current=n,f==null||f(n)}return n},[_,f,i]),ao=r.useCallback(async(e,n)=>{var R;const p=[...ks.current.values()];p.length>0&&await Promise.all(p);const d=ke.current,c=[],m=d.filter(zt);for(const F of m)try{const S=F.file.type.startsWith("image/")?await Oo(F.file,Bo(Zt)):{file:F.file},N=S.file,y=await z.upload(e,n,N,{onProgress:T=>{Es(O=>({...O,[F.id]:{uploaded:T,total:N.size}}))},...S.width!==void 0&&S.height!==void 0?{imageDimensions:{width:S.width,height:S.height}}:{}});c.push(y)}catch(S){console.error("Failed to upload file:",S);const N=S instanceof Error?S.message:"";le(a("newSessionUploadError",{message:N}),"error")}const x=d.filter(fe).map(js);if(x.length===0)return c;const k=(R=x[0])==null?void 0:R.batchId;if(!k||x.some(F=>F.batchId!==k))throw new Error("Draft attachments are split across staging batches");const V=await Ua(z,e,n,{batchId:k,refs:x,updatedAt:new Date().toISOString()});return[...c,...V]},[Zt,z,le,a]),Vs=r.useCallback(e=>{if(_s.current)return!1;const n=X.current;return(n==null?void 0:n.isListening)===!0||ft.current!==null||Le.current!==null?(qe.current={kind:e,visibleTextSnapshot:aa(C.getDraft(),$e.current,J.current)},He.current=!1,n!=null&&n.isListening&&n.stopAndFinalize(),!0):(qe.current=null,He.current=!1,!1)},[C]),nt=r.useCallback(async(e,n=!1)=>{const p=typeof e=="string"?e:void 0;if(p===void 0&&Vs("start"))return;const d=(p??C.getDraft()).trimEnd(),c=d.trim()||Y.length>0;if(!c&&!Re||A||!_t)return;const m=$o({configuredPrefix:Nt,speechTriggered:n,recentSpeech:Is()});let x=m&&c?qo(d,m):d.trim();const k=Wa(x),V=k&&ta(k.kind)?k.kind:void 0;if(V&&(!Ms(E,_o.turnEffortModifiers.name)||w||!["codex","claude","claude-gateway","claude-ollama"].includes(g??""))){le(a("turnEffortUnavailable"),"error");return}if(V&&k){if(!k.argument.trim()){le(a("turnEffortNeedsMessage"),"error");return}x=k.argument}const R=V?{deliveryIntent:"direct",turnEffort:V}:void 0;if(dl({version:E,text:d,attachmentCount:Y.length})){le(a("attachmentOnlyRequiresServerUpdate"),"error");return}const F=qt(kt),S=Date.now(),N=nr(S);Ze(""),Ls(),pt(!0);try{let y=await zs(F),T,O;const de=ps;let rt=de,Ot,Xs=0;const Js=[],Ut=Xo(ds,us),Po=ol(q,ne),No=al(q,lt),ko=Ao(),Bt={...Cs&&Us?{computerControl:!0}:{},mode:de,model:h??void 0,thinking:Ut,showThinking:ko,provider:g??void 0,executor:et??void 0,...ce?{sandboxLevel:Se,...Se==="project-write"?{sandboxNetworkFirewall:Et}:{}}:{},recapMode:Po,recapAfterSeconds:Ne,promptSuggestionMode:No,helperSideModel:ut,workstreamId:Ws,...Vo(U)};if($t("new-session-submit",{projectId:y??null,detached:!y,mode:de,model:h??null,thinking:Ut,provider:g??null,executor:et,sandboxLevel:ce?Se:null,sandboxNetworkFirewall:ce?Et:null,recapMode:Po,recapAfterSeconds:Ne,promptSuggestionMode:No,helperSideModel:ut,textLength:x.length,pendingFileCount:Y.length,clientTimestamp:N,serverOffsetMs:pl()}),w){if(Y.length>0)throw new Error("This session launch does not accept attachments");await w.submit({message:x,options:Bt,clientTimestamp:N}),C.clearDraft(),pt(!1);return}if(Y.length>0){const Zs=Date.now(),K=y?await be.createSession(y,Bt):await be.createDetachedSession(Bt),en=Date.now(),pe=rn({clientRequestStartMs:Zs,clientResponseEndMs:en,serverTimestamp:K.serverTimestamp}),To=K.projectId;T=K.sessionId,O=K.processId,rt=K.permissionMode,Ot=K.appliedPermissionMode,Xs=K.modeVersion,y=To,$t("new-session-created",{sessionId:T,processId:O,projectId:y,thinking:Ut,mode:de,serverTimestamp:K.serverTimestamp,requestRttMs:(pe==null?void 0:pe.roundTripMs)??null,estimatedServerOffsetMs:(pe==null?void 0:pe.serverOffsetMs)??null}),Js.push(...await ao(To,T));const Eo=Date.now(),tn=await be.queueMessage(T,x,de,Js.length>0?Js:void 0,void 0,Ut,void 0,N,R,void 0,ko),Li=Date.now(),vt=rn({clientRequestStartMs:Eo,clientResponseEndMs:Li,serverTimestamp:tn.serverTimestamp});$t("new-session-queued",{sessionId:T,processId:O,projectId:y,clientTimestamp:N,serverTimestamp:tn.serverTimestamp,uploadWaitMs:Eo-S,requestRttMs:(vt==null?void 0:vt.roundTripMs)??null,estimatedServerOffsetMs:(vt==null?void 0:vt.serverOffsetMs)??null,clientToServerLatencyMs:or(N,tn.serverTimestamp)})}else{const Zs=Date.now(),K=y?await be.startSession(y,x,Bt,void 0,N,R):await be.startDetachedSession(x,Bt,void 0,N,R),en=Date.now(),pe=rn({clientRequestStartMs:Zs,clientResponseEndMs:en,serverTimestamp:K.serverTimestamp});T=K.sessionId,O=K.processId,rt=K.permissionMode,Ot=K.appliedPermissionMode,Xs=K.modeVersion,y=K.projectId,$t("new-session-started",{sessionId:T,processId:O,projectId:y,thinking:Ut,mode:de,provider:g??null,model:h??null,clientTimestamp:N,serverTimestamp:K.serverTimestamp,requestRttMs:(pe==null?void 0:pe.roundTripMs)??null,estimatedServerOffsetMs:(pe==null?void 0:pe.serverOffsetMs)??null,clientToServerLatencyMs:or(N,K.serverTimestamp)})}if(!y)throw new Error("Missing project ID for new session");ue([],{persistDraft:!1,revokeRemovedPreviewUrls:!0}),C.clearDraft(),it(`${Vt}/projects/${y}/sessions/${T}`,{state:rc({initialStatus:{owner:"self",processId:O,permissionMode:rt,appliedPermissionMode:Ot,modeVersion:Xs,recapAfterSeconds:Ne},initialTitle:x,initialModel:h??void 0,initialProvider:g??void 0})})}catch(y){console.error("Failed to start session:",y),C.restoreFromStorage(),pt(!1);let T=a("newSessionStartError");if(y instanceof Error){const O=(q==null?void 0:q.displayName)??g??"Provider",de=y.message.toLowerCase(),rt=y.status;y.message.includes("Queue is full")?T=a("newSessionServerBusy"):de.includes("invalid authentication credentials")||de.includes("authentication_error")||de.includes("please run /login")||rt===401&&(g==="claude"||g==="gemini"||g==="codex")?T=a("newSessionProviderAuthError",{provider:O}):y.message.includes("503")?T=a("newSessionServerCapacity"):y.message.includes("404")?T=a("newSessionProjectNotFound"):y.message.includes("fetch")||y.message.includes("network")?T=a("newSessionNetworkError"):T=y.message}le(T,"error")}},[Vt,C,Us,Cs,us,et,ps,ds,ut,_t,A,w,U,Re,Ls,Vs,Is,it,Y,kt,Ne,Se,Et,ao,zs,Ws,h,lt,g,q,ne,ue,le,Nt,ce,a,E]),Gs=async e=>{const n=typeof e=="string"?e:void 0;if(n===void 0&&Vs("project-queue"))return;const d=(n??C.getDraft()).trimEnd().trim(),c=$o({configuredPrefix:Nt,speechTriggered:!1,recentSpeech:Is()}),m=d&&qo(d,c),x=qt(kt),k=Y.filter(fe).map(js),V=k.length===Y.length;if(!m||!V||A||!_t)return;Ls();const R=Date.now(),F=nr(R),S=new Date(F).toISOString(),N=k[0],y=N?{batchId:N.batchId,refs:k,updatedAt:new Date().toISOString()}:void 0;Ze(""),pt(!0);try{const T=await zs(x);if(!T)throw new Error(a("projectQueueNewSessionNeedsProject"));const O=ps,de=Xo(ds,us),rt=Ao(),Ot=await be.createProjectQueueItem(T,{target:{type:"new-session",mode:O,model:h??void 0,thinking:de,showThinking:rt,provider:g??void 0,executor:et??void 0,...ce?{sandboxLevel:Se,...Se==="project-write"?{sandboxNetworkFirewall:Et}:{}}:{},...Vo(U),title:m},message:{text:m,mode:O,...y?{stagedAttachments:y}:{},metadata:{deliveryIntent:"deferred",clientTimestamp:F,composition:{submittedAt:S,typingEndedAt:S}}},createdFrom:{client:"new-session"}});ae.reportProjectQueueCollectionSnapshot(Ot.queue),$t("new-session-project-queued",{projectId:T,mode:O,model:h??null,thinking:de,provider:g??null,executor:et,sandboxLevel:ce?Se:null,sandboxNetworkFirewall:ce?Et:null,textLength:m.length,attachmentCount:k.length,uploadWaitMs:Date.now()-R}),ue([],{persistDraft:!1,revokeRemovedPreviewUrls:!0}),C.clearDraft(),pt(!1),le(a("projectQueueNewSessionQueuedToast"),"success")}catch(T){console.error("Failed to queue project session:",T),C.restoreFromStorage(),pt(!1);const O=T instanceof Error?T.message:String(T);le(a("projectQueueSubmitFailed",{message:O}),"error")}};hn.current=()=>{if(ft.current!==null||Le.current!==null||!He.current)return;const e=qe.current;if(e){qe.current=null,He.current=!1,_s.current=!0;try{if(e.kind==="project-queue"){Gs(e.visibleTextSnapshot);return}nt(e.visibleTextSnapshot)}finally{_s.current=!1}}};const ws=r.useCallback(()=>{hn.current()},[]),fi=e=>{var n,p;if(!St.onKeyDown(e)){if(_c(e)){e.preventDefault(),e.stopPropagation(),io();return}if(Te&&e.key==="Enter"){if(e.nativeEvent.isComposing)return;e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),nt());return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(Pt==="transcribing"||Pt==="finalizing")){e.preventDefault(),e.stopPropagation(),xi();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&((n=X.current)!=null&&n.isListening)){e.preventDefault(),e.stopPropagation(),X.current.toggle();return}if(e.key==="Enter"){if(e.nativeEvent.isComposing)return;if((p=X.current)!=null&&p.isListening){e.preventDefault(),nt();return}if(In&&pn.projectQueue&&qs&&fo&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),Gs();return}if(oc())return;{if(e.ctrlKey||e.shiftKey)return;e.preventDefault(),nt()}}}},hi=e=>{var d;const n=(d=e.clipboardData)==null?void 0:d.items;if(!n)return;const p=[];for(const c of n)if(c.kind==="file"){const m=c.getAsFile();m&&p.push(m)}p.length>0&&(e.preventDefault(),as(p))},mi=r.useCallback(()=>{es.current=!1;const e=Me.current,n=C.getDraft(),p=Math.max(0,Math.min((e==null?void 0:e.selectionStart)??n.length,n.length)),d=Math.max(p,Math.min((e==null?void 0:e.selectionEnd)??p,n.length)),c=Kl(),m=fa(p,d);Z.current=c,J.current=m,je.current.set(c,m),ht.current=null,Qe.current=null,Fs.current=!1,e&&(Do(e),e.setSelectionRange(p,d)),$e.current="",Ze("")},[C]),ve=r.useCallback(()=>{const e=Le.current;e!==null&&(clearTimeout(e.timer),Le.current=null)},[]);r.useEffect(()=>ve,[ve]);const Ge=r.useCallback((e,n)=>{var F;const p=e!==void 0,d=Me.current,c=J.current;if(!d||!c)return;const m=d.selectionStart,x=d.selectionEnd,k=S=>m===x?ft.current==="listening"?Lo(S,m,x):sn(S):S.replaceSelectedAtMs===void 0&&S.end===m&&S.replaceEnd===x?S:Lo(S,m,x);m===x&&ve();const V=$e.current.trim().length>0;if(p&&(V||Qe.current!==null)){Qe.current={draft:n??C.getDraft(),start:m,end:x};return}const R=k(c);ft.current==="listening"&&R!==c&&((F=X.current)==null||F.beginInsertionBoundary()),J.current=R,Z.current&&je.current.set(Z.current,R),ss(S=>S+1)},[ve,C]),Ys=r.useCallback(()=>{if(ve(),!J.current)return;const e=sn(J.current);J.current=e,Z.current&&je.current.set(Z.current,e),ss(n=>n+1)},[ve]),gi=r.useCallback(()=>{window.setTimeout(()=>Ge(!0),0)},[Ge]),ot=r.useCallback((e,n)=>{e.trim()&&(n==null?void 0:n.smartTurnCommand)!=="cancel"&&(es.current=!0,ts()),He.current=!0;const p=ma({textareaRef:Me,getDraft:C.getDraft,setDraft:C.setDraft,setInterimTranscript:c=>{$e.current=c,Ze(c)},speechInsertionRangeRef:J,activeSpeechTargetIdRef:Z,speechInsertionRangesRef:je,pendingTextareaSelectionRef:ht,pendingSpeechRetargetRef:Qe,onInsertionBoundary:()=>{var c;return(c=X.current)==null?void 0:c.beginInsertionBoundary()},onSpeechTargetChanged:()=>ss(c=>c+1),onSmartTurnSend:c=>{var m;(m=X.current)==null||m.continueAfterSpeechSend(),nt(c,!0)},composerEditedDuringSpeech:()=>Fs.current},e,n);ws();const d=n==null?void 0:n.speechTargetId;return d&&d!==Z.current&&je.current.delete(d)&&ss(c=>c+1),p},[C,nt,ws,ts]),Si=r.useCallback((e,n)=>{const p=n!=null&&n.speechTargetId?je.current.get(n.speechTargetId)??null:J.current,d=n!=null&&n.smartTurnCommand||Qe.current?0:ca(p);if(d>0){ve();const c=setTimeout(()=>{const m=Le.current;!m||m.timer!==c||(Le.current=null,ot(m.transcript,m.metadata))},d);Le.current={timer:c,transcript:e,metadata:n};return}return ve(),ot(e,n)},[ve,ot]),co=r.useCallback(()=>{const e=Le.current;e!==null&&(clearTimeout(e.timer),Le.current=null,ot(e.transcript,e.metadata))},[ot]),wi=r.useCallback(()=>{const e=Io(C.getDraft(),$e.current,J.current);return co(),e&&ot(e),Qe.current=null,$e.current="",Ze(""),Do(Me.current),!!e},[ot,C,co]),vi=r.useCallback(e=>{$e.current=e,Ze(e)},[]),bi=r.useCallback((e,n)=>{if(n==="failed"?(qe.current=null,He.current=!1):n==="completed"&&(qe.current&&es.current&&ts(),He.current=!0),ft.current=e,e==="listening"&&Ge(),e===null){const p=Z.current;p&&je.current.delete(p),J.current=null,Z.current=null,Qe.current=null}fn(e),e===null&&ws()},[Ge,ws,ts]),xi=r.useCallback(()=>{var n;(n=X.current)==null||n.cancelProcessing(),qe.current=null,He.current=!1,ve();const e=Z.current;e&&je.current.delete(e),J.current=null,Z.current=null,Qe.current=null,fn(null),ft.current=null,Ze("")},[ve]),lo=r.useCallback(e=>{if(!fl(e))return;e.preventDefault(),e.stopPropagation();const n=X.current;n!=null&&n.isAvailable&&n.toggle()},[]),ji=!!(($.trim()||Y.length>0||Pt!==null||Ee||Re)&&_t),uo=!!Pe,po=Y.every(fe),yi=Y.filter(fe).map(js),Mi=Ba({pendingUploadCount:Y.filter(e=>e.kind==="uploading").length,transientAttachmentCount:Y.filter(zt).length,stagedRefs:yi,draftState:C.getAttachmentState()});$a(Mi);const fo=!!(Er&&qs&&($.trim()||Pt!==null||Ee)&&po&&uo&&_t),Ri=a(po?uo?In?"toolbarProjectQueueTooltipWithShortcut":"toolbarProjectQueueTooltip":"projectQueueNewSessionNeedsProject":"projectQueueNewSessionAttachmentsPreparing"),Ye=Nt&&mn>0&&(yr||(Pt!==null||qe.current!==null)&&(es.current||Ee.trim().length>0))?Nt:null,ho=e=>Ye?a("speechPrefixDeliveryLabel",{action:e,prefix:Ye}):e,mo=e=>Ye?a("speechPrefixDeliveryTooltip",{tooltip:e,prefix:Ye}):e,At=J.current,vs=Io($,Ee,At),Ft=At?la($,vs,At.end,At.replaceEnd??At.end):ua($,vs,$.length),Ci=r.useCallback(()=>{const e=C.getDraft();return As.current||(As.current=Ql()),{projectId:t,draftKey:ge,clientTurnId:As.current,speechTargetId:Z.current??void 0,textBeforeCursor:da(e,J.current,Me.current)}},[C,t,ge]),go=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`speech-draft-field ${vs?"has-interim":""}`,children:[s.jsxs("div",{className:"speech-draft-inline",children:[vs&&s.jsxs("div",{className:"speech-draft-mirror","aria-hidden":"true",children:[s.jsx("span",{children:Ft.before}),Ft.separatorBefore,s.jsx("span",{className:"speech-interim-inline",children:Ft.transcript}),s.jsx("span",{className:"speech-interim-caret"}),Ft.separatorAfter,s.jsx("span",{children:Ft.after})]}),s.jsx("textarea",{ref:ci,"data-composer-input":!0,value:$,onChange:e=>{const n=St.normalizeInput(e.target.value);if(ve(),je.current.size>0){const p=new Map;for(const[d,c]of je.current)p.set(d,sn(pa($,n,c)));je.current=p,J.current=Z.current!==null?p.get(Z.current)??null:null}Z.current!==null&&ga($,n)&&(Fs.current=!0),Ge(!0,n),ye(n)},onKeyDown:fi,onFocus:St.onFocus,onBlur:St.onBlur,onSelect:()=>{Ge(),St.onSelect()},onPointerUp:Ge,onClick:gi,onKeyUp:Ge,onCut:Ys,onCopy:Ys,onPaste:e=>{Ys(),is&&hi(e)},placeholder:Dr,disabled:A,readOnly:Re,rows:Re?Math.min(v,3):v,className:"new-session-form-textarea"})]}),Ee&&s.jsx("div",{className:"speech-interim-status",role:"status","aria-live":"polite","aria-label":"Tentative speech transcript",children:Ee})]}),s.jsx(zc,{completion:St}),s.jsxs("div",{className:"new-session-form-toolbar",children:[s.jsxs("div",{className:"new-session-form-toolbar-left",children:[is&&s.jsxs(s.Fragment,{children:[s.jsx("input",{ref:Sn,type:"file",multiple:!0,style:{display:"none"},onChange:ui}),s.jsx("button",{type:"button",className:"toolbar-button",onClick:()=>{var e;return(e=Sn.current)==null?void 0:e.click()},disabled:A,"aria-label":a("newSessionAttachFiles"),children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:s.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]}),s.jsx(za,{showMethodSelector:ii,methodOptions:no,selectedMethod:wt,onMethodChange:ri,smartTurnSettings:ro,onSmartTurnSettingsChange:oo?Tr:void 0,smartTurnDisabled:A,onBeforeOpen:()=>{var e;(e=X.current)!=null&&e.isListening&&X.current.toggle()},onBeforeCaptureChange:()=>{var e;(e=X.current)!=null&&e.isListening&&X.current.toggle()},onPointerNearTrigger:()=>{var e,n;return(n=(e=X.current)==null?void 0:e.prewarm)==null?void 0:n.call(e)},trigger:s.jsx(uc,{ref:X,onTranscript:Si,onInterimTranscript:vi,onListeningStart:mi,onListeningStop:wi,onPendingSpeechChange:bi,disabled:A,className:"toolbar-button",speechMethod:wt,getTranscriptionContext:Ci,smartTurn:ro})}),g&&(U.model?s.jsx(Kt,{provider:g,model:h??void 0}):Ss.length>0&&s.jsx(on,{triggerVariant:"chip",panelVariant:"model",label:a("newSessionModelTitle"),options:Ss,selected:h?[h]:[],onChange:so,multiSelect:!1,triggerContent:s.jsx(Kt,{provider:g,model:h??void 0}),triggerTitle:a("composerModelChipTitle")})),!he&&!Re&&s.jsx(ml,{expanded:Te,className:`toolbar-button ${te.fullPaneToggle}`,onToggle:()=>{var e;io(),(e=Me.current)==null||e.focus()}})]}),s.jsxs("div",{className:"new-session-form-toolbar-actions",children:[pn.projectQueue&&qs&&s.jsxs("button",{type:"button",onClick:Gs,disabled:A||!fo,className:"send-button project-queue-button new-session-project-queue-button","aria-label":ho(a("toolbarProjectQueueLabel")),title:mo(Ri),children:[s.jsx(Va,{className:"send-icon",children:"⇥"}),Ye&&s.jsx(Ho,{prefix:Ye})]}),s.jsxs("button",{type:"button",onClick:nt,disabled:A||!ji,className:"send-button new-session-submit-button","aria-label":ho((w==null?void 0:w.startLabel)??a("newSessionStartAction")),title:mo((w==null?void 0:w.startLabel)??a("newSessionStartAction")),children:[A?s.jsx("span",{className:"send-spinner"}):s.jsxs("svg",{className:"send-icon new-session-submit-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M12 19V5"}),s.jsx("path",{d:"m5 12 7-7 7 7"})]}),!A&&Ye&&s.jsx(Ho,{prefix:Ye})]})]})]}),Y.length>0&&s.jsx("div",{className:te.pendingFilesList,children:Y.map(e=>{const n=jr[e.id],p=Go(e),d=Zc(e),c=tl(e);return s.jsx(nc,{attachmentId:e.id,originalName:p,mimeType:el(e),sizeLabel:n?`${Math.round(n.uploaded/n.total*100)}%`:qa(d),imageWidth:c==null?void 0:c.width,imageHeight:c==null?void 0:c.height,previewUrl:e.previewUrl,onRemove:A?void 0:()=>di(e.id)},e.id)})})]}),Pi=s.jsxs("div",{ref:wn,className:`new-session-project-chooser ${_e?"expanded":""}`,children:[s.jsxs("div",{className:"new-session-project-controls",children:[s.jsxs("button",{type:"button",className:"new-session-project-summary",onClick:()=>Ie(e=>!e),"aria-expanded":_e,"aria-controls":"new-session-project-panel",children:[s.jsxs("span",{className:"new-session-project-summary-body",children:[s.jsx("span",{className:"new-session-project-summary-title",children:ei}),s.jsx("span",{className:"new-session-project-summary-path",title:Qs,children:Hs?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"new-session-project-summary-path-long",children:a("newSessionProjectDetachedHint")}),s.jsx("span",{className:"new-session-project-summary-path-short",children:a("newSessionProjectDetachedHintShort")})]}):ti})]}),s.jsx("svg",{className:"new-session-project-summary-chevron",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),s.jsxs("label",{className:"new-session-project-inline-field",children:[s.jsx("span",{className:"new-session-project-inline-label",children:a("newSessionProjectPathLabel")}),s.jsx("input",{ref:Rr,type:"text",value:kt,onChange:e=>{os(e.target.value),_e||Ie(!0)},onFocus:()=>Ie(!0),onKeyDown:li,placeholder:a("newSessionProjectPathPlaceholder"),disabled:A,className:"new-session-project-input",spellCheck:!1,list:"new-session-project-options"})]}),s.jsx("datalist",{id:"new-session-project-options",children:Gr})]}),_e&&to&&s.jsxs("div",{id:"new-session-project-panel",className:"new-session-project-panel",children:[s.jsx("p",{className:"new-session-project-field-hint",children:a("newSessionProjectPathHint")}),s.jsx("div",{className:"new-session-project-suggestions",children:to})]})]}),Ni=si&&st?s.jsxs("label",{className:"new-session-workstream-field",children:[s.jsx("span",{className:"new-session-workstream-label",children:a("newSessionWorkstreamLabel")}),s.jsx("select",{className:"new-session-workstream-select",value:Ws??"",onChange:ni,disabled:A,"aria-label":a("newSessionWorkstreamLabel"),children:fs.map(e=>s.jsx("option",{value:e.kind==="main"?"":e.id,children:e.kind==="main"?a("newSessionWorkstreamMain"):e.label},e.id))}),s.jsx("span",{className:"new-session-workstream-path",title:st.path,children:nn(st.path)})]}):null,So=Lr.length>1?s.jsx(Fe,{className:"new-session-provider-section",title:L.provider.title,caption:L.provider.description,showCaption:re,children:s.jsx("div",{className:"provider-options","aria-busy":_r,children:De.map(e=>{const n=e.installed,p=g===e.name;return s.jsxs("button",{type:"button",className:`provider-option ${p?"selected":""} ${n?"":"disabled"}`,onClick:()=>n&&oi(e.name),disabled:A||!n,title:n?!e.authenticated&&!e.enabled?a("newSessionProviderAuthenticationPending",{provider:e.displayName}):void 0:a("newSessionProviderUnavailable",{provider:e.displayName,reason:a("newSessionProviderNotInstalled")}),children:[s.jsx("span",{className:`provider-option-dot provider-${e.name}`}),s.jsxs("div",{className:"provider-option-content",children:[s.jsx("span",{className:"provider-option-label",children:e.displayName}),n?!e.authenticated&&!e.enabled?s.jsx("span",{className:"provider-option-status",children:a("newSessionProviderStatusAuthenticationNeeded")}):null:s.jsx("span",{className:"provider-option-status",children:a("newSessionProviderStatusNotInstalled")})]})]},e.name)})})}):null,wo=g&&Ss.length>0?s.jsx(Fe,{className:"new-session-model-field",title:L.model.title,caption:L.model.description,showCaption:re,children:s.jsx(on,{panelVariant:"model",label:L.model.title,options:Ss,selected:h?[h]:[],onChange:so,multiSelect:!1,placeholder:a("newSessionModelPlaceholder"),fullWidth:!0})}):null,vo=g==="claude-gateway"&&(!Ke.fresh||we.length===0)?s.jsxs("div",{className:"new-session-model-field",children:[s.jsx("h3",{children:L.model.title}),s.jsxs("div",{className:"new-session-provider-catalog-status",role:"status","aria-live":"polite",children:[s.jsx("span",{children:Ke.refreshing?a("newSessionGatewayCatalogLoading"):a("newSessionGatewayCatalogUnavailable")}),s.jsx("button",{type:"button",className:"new-session-provider-catalog-retry",disabled:Ke.refreshing,onClick:()=>void Ke.refresh(),children:a("newSessionGatewayCatalogRetry")})]})]}):null,bo=wo||vo?s.jsxs("div",{className:"new-session-model-section",children:[wo,vo]}):null,ki=s.jsx(Fe,{className:"new-session-helper-section new-session-show-thinking-section",title:L.showThinking.title,caption:L.showThinking.description,showCaption:re,children:s.jsx(lc,{value:Cr,onChange:e=>Pr(e),t:a,showLabel:!1})}),xo=Kr?s.jsx(Fe,{className:"new-session-helper-section new-session-thinking-section",title:L.thinking.title,caption:L.thinking.description,showCaption:re,children:s.jsx(cc,{mode:ds,modeOptions:Bs,onSetMode:e=>{ee.current=!0,B(e)},level:us,effortOptions:ls,onSetEffort:e=>{ee.current=!0,Je(e)},onSetEffortMode:e=>{ee.current=!0,Je(e),B("on")},showThinkingControl:!1,provider:g??void 0,t:a,className:"thinking-controls-panel--inline new-session-thinking-controls"})}):null,Ti=g?s.jsxs(Fe,{className:"new-session-helper-section",title:L.recap.title,caption:Ko(ne,a,Ne),showCaption:re,children:[s.jsx("div",{className:"new-session-helper-options",children:Wr.map(e=>s.jsxs("button",{type:"button",className:`new-session-helper-option ${ne===e?"selected":""}`,onClick:()=>{ee.current=!0,oe(e)},disabled:A||Se==="project-write"&&e==="side-session",title:Ko(e,a,Ne),children:[s.jsx("span",{className:`mode-option-dot recap-${e}`}),s.jsx("span",{children:Or[e]})]},e))}),ne!=="off"&&s.jsx(tc,{value:Ne,disabled:A,className:re?te.captionedRecapDuration:void 0,label:re?Br[ne]:void 0,mode:ne,onCommit:e=>{ee.current=!0,cn(e)}})]}):null,Ei=Vr?s.jsx(Fe,{className:"new-session-helper-section new-session-helper-model-section",title:L.helperModel.title,caption:L.helperModel.description,showCaption:re,children:s.jsx(on,{label:L.helperModel.title,options:qr,selected:[ut],onChange:e=>{ee.current=!0,Ct(e[0]??Qt)},multiSelect:!1,placeholder:a("helperSideModelCheapest"),fullWidth:!0})}):null,_i=g?s.jsx(Fe,{className:"new-session-helper-section",title:L.suggestions.title,caption:zn[lt],showCaption:re,children:s.jsx("div",{className:"new-session-helper-options",children:zr.map(e=>s.jsxs("button",{type:"button",className:`new-session-helper-option ${lt===e?"selected":""}`,onClick:()=>{ee.current=!0,ln(e)},disabled:A,title:zn[e],children:[s.jsx("span",{className:`mode-option-dot suggestion-${e}`}),s.jsx("span",{children:Ur[e]})]},e))})}):null,jo=Hr?s.jsx(Fe,{className:"new-session-mode-section",title:L.permission.title,showCaption:re,children:s.jsx("div",{className:"mode-options",children:Gn.map(e=>s.jsxs("button",{type:"button",className:`mode-option ${ps===e?"selected":""}`,onClick:()=>pi(e),disabled:A,children:[s.jsx("span",{className:`mode-option-dot mode-${e}`}),s.jsxs("div",{className:"mode-option-content",children:[s.jsx("span",{className:"mode-option-label",children:Ar[e]}),s.jsx("span",{className:"mode-option-desc",children:Fr[e]})]})]},e))})}):null,Ii=_n?s.jsxs(Fe,{className:"new-session-helper-section new-session-sandbox-section",title:L.sandbox.title,caption:[L.sandbox.description,L.sandboxFirewall.description].join(" "),showCaption:re,children:[!U.limited&&s.jsxs("label",{className:"settings-item",children:[s.jsx("div",{className:"settings-item-info",children:s.jsx("strong",{children:a("newSessionSandboxLabel")})}),s.jsx("input",{type:"checkbox",checked:Be==="project-write",disabled:A,onChange:e=>{ee.current=!0;const n=e.currentTarget.checked;Rs(n?"project-write":"none"),n&&Yt(!0),n&&ne==="side-session"&&oe("off")},"aria-label":a("newSessionSandboxLabel")})]}),s.jsxs("label",{className:"settings-item",children:[s.jsx("div",{className:"settings-item-info",children:s.jsx("strong",{children:L.sandboxFirewall.title})}),s.jsx("input",{type:"checkbox",checked:Se==="project-write"&&Gt,disabled:A||Se!=="project-write",onChange:e=>{ee.current=!0,Yt(e.currentTarget.checked)},"aria-label":L.sandboxFirewall.title})]})]}):null,yo=U.limited?s.jsx(jl,{lock:U,modelLabel:U.model?((Co=tt.find(e=>e.id===U.model))==null?void 0:Co.name)??null:null,effortLabel:U.effort?sa(U.effort,q,a):null,sandboxAvailable:ce}):null,Mo=!!(yo||An&&So||Fn&&bo||xo||jo);return he?s.jsx("div",{className:"new-session-form new-session-form-compact",onKeyDownCapture:lo,children:go}):s.jsxs("div",{className:`new-session-form new-session-container${Te?` ${te.fullPane}`:""}${Jt?` ${te.fullPaneWide}`:""}`,"data-composer-full-pane":Te?"true":void 0,onKeyDownCapture:lo,style:Te&&!Jt&&dn?{width:`${dn}px`,maxWidth:"100%"}:void 0,children:[!w&&s.jsx("div",{className:"new-session-header",children:s.jsx("p",{className:"new-session-subtitle",children:a("newSessionHeaderSubtitle")})}),s.jsxs("div",{className:`new-session-top-layout ${te.optionLayout}${Ln?` ${te.optionLayoutWithoutProject}`:""}${Mo?"":` ${te.optionLayoutWithoutProvider}`}`,children:[s.jsx("div",{ref:vn,className:"new-session-main-stack",children:s.jsx("div",{className:`new-session-input-area${Re?` ${te.mutedComposer}`:""}`,"data-composer-shell":"true",children:go})}),!Ln&&s.jsxs("aside",{className:`new-session-project-slot ${te.projectControlsSlot}`,children:[Pi,!w&&mt&&Pe&&s.jsx(Hl,{items:Zn,loading:$s.loading,error:$s.error,onOpenItem:e=>it(`${Vt}/projects?queueItem=${encodeURIComponent(e)}`)}),Ni]}),Mo&&s.jsxs("div",{className:"new-session-provider-slot",children:[yo,An&&So,Fn&&bo,xo,jo]}),s.jsxs("div",{className:`${te.secondaryOptions} ${te.optionsWithCaptionToggle}${_e?` ${te.secondaryOptionsHidden}`:""}`,"data-new-session-secondary-options":"true",children:[s.jsx("button",{type:"button",className:te.captionToggle,"aria-label":a(re?"newSessionHideOptionCaptions":"newSessionShowOptionCaptions"),"aria-pressed":re,title:a(re?"newSessionHideOptionCaptions":"newSessionShowOptionCaptions"),onClick:()=>br(e=>!e),children:s.jsx("span",{"aria-hidden":"true",children:"?"})}),ki,Ti,Ei,_i,Ii,s.jsx(fc,{eligible:Us,selected:Cs,onChange:Sr})]})]}),En&&!Ir&&Wn.length>0&&s.jsxs("div",{className:"new-session-executor-section",children:[s.jsx("h3",{children:a("newSessionRunOnTitle")}),s.jsxs("div",{className:"executor-options",children:[s.jsxs("button",{type:"button",className:`executor-option ${Ps===null?"selected":""}`,onClick:()=>Ns(null),disabled:A,children:[s.jsx("span",{className:"executor-option-dot executor-local"}),s.jsxs("div",{className:"executor-option-content",children:[s.jsx("span",{className:"executor-option-label",children:a("newSessionRunOnLocal")}),s.jsx("span",{className:"executor-option-desc",children:a("newSessionRunOnLocalDesc")})]})]},"local"),Wn.map(e=>s.jsxs("button",{type:"button",className:`executor-option ${Ps===e?"selected":""}`,onClick:()=>Ns(e),disabled:A,children:[s.jsx("span",{className:"executor-option-dot executor-remote"}),s.jsxs("div",{className:"executor-option-content",children:[s.jsx("span",{className:"executor-option-label",children:e}),s.jsx("span",{className:"executor-option-desc",children:a("newSessionRunOnRemoteDesc")})]})]},e))]})]})]})}const rr="__ya_share",zl="ya-incoming-shares",jt="shares",Vl=1;function gr(){return typeof indexedDB>"u"?Promise.reject(new Error("Browser storage is unavailable")):new Promise((t,o)=>{const i=indexedDB.open(zl,Vl);i.onerror=()=>o(i.error),i.onupgradeneeded=()=>{const l=i.result;l.objectStoreNames.contains(jt)||l.createObjectStore(jt,{keyPath:"id"})},i.onsuccess=()=>t(i.result)})}function Gl(t){if(!t||typeof t!="object")return!1;const o=t;return typeof o.id=="string"&&typeof o.createdAt=="number"&&Array.isArray(o.files)&&o.files.every(i=>i&&typeof i=="object"&&i.blob instanceof Blob&&typeof i.name=="string"&&typeof i.type=="string"&&typeof i.lastModified=="number")}async function Yl(t){const o=await gr();return new Promise((i,l)=>{const u=o.transaction(jt,"readonly"),f=u.objectStore(jt);let b;const v=f.get(t);v.onerror=()=>l(v.error),v.onsuccess=()=>{b=v.result},u.onerror=()=>l(u.error),u.onabort=()=>l(u.error),u.oncomplete=()=>{if(o.close(),!Gl(b)){i([]);return}i(b.files.map(M=>new File([M.blob],M.name,{type:M.type,lastModified:M.lastModified})))}}).finally(()=>o.close())}async function Xl(t){const o=await gr();return new Promise((i,l)=>{const u=o.transaction(jt,"readwrite"),f=u.objectStore(jt).delete(t);f.onerror=()=>l(f.error),u.onerror=()=>l(u.error),u.onabort=()=>l(u.error),u.oncomplete=()=>i()}).finally(()=>o.close())}function Eu(t,o={}){const{enabled:i=!0,onError:l}=o,u=Fi(),f=ir(),b=r.useRef(t),v=r.useRef(l),M=r.useRef(null);b.current=t,v.current=l;const Q=new URLSearchParams(u.search).get(rr);r.useEffect(()=>{if(!i||!Q||M.current===Q)return;M.current=Q;let I=!0;const me=()=>{const W=new URLSearchParams(u.search);W.delete(rr);const H=W.toString();f({pathname:u.pathname,search:H?`?${H}`:"",hash:u.hash},{replace:!0,state:u.state})};return(async()=>{var W;try{const H=await Yl(Q);if(!I)return;if(H.length===0)throw new Error("The shared image is no longer available");if(await b.current(H),!I)return;await Xl(Q),I&&me()}catch(H){if(!I)return;const se=H instanceof Error?H:new Error("The shared image could not be attached");(W=v.current)==null||W.call(v,se),me()}})(),()=>{I=!1}},[i,u.hash,u.pathname,u.search,u.state,f,Q])}function _u(t,o){be.recordVisit(t,o).catch(i=>{console.error("Failed to record session visit:",i)})}function Iu(t={}){const{limit:o}=t,[i,l]=r.useState([]),[u,f]=r.useState(!0),[b,v]=r.useState(null),M=r.useCallback(async()=>{try{const I=await be.getRecents(o);l(I.recents),v(null)}catch(I){v(I instanceof Error?I:new Error("Failed to fetch"))}finally{f(!1)}},[o]);r.useEffect(()=>{M()},[M]);const he=r.useCallback((I,me)=>{l(W=>{const H=W.find(w=>w.sessionId===I),se=W.filter(w=>w.sessionId!==I);return H?[{...H,visitedAt:new Date().toISOString()},...se]:W}),be.recordVisit(I,me).catch(W=>{console.error("Failed to record session visit:",W),M()})},[M]),Q=r.useCallback(()=>{l([]),be.clearRecents().catch(I=>{console.error("Failed to clear recents:",I),M()})},[M]);return{recentSessions:i,isLoading:u,error:b,recordVisit:he,clearRecents:Q,refetch:M}}export{ml as F,Tu as N,zc as P,Iu as a,hl as b,Bc as c,Wo as d,Fc as e,Pu as f,Nu as g,_c as h,fl as i,Jc as j,nr as k,_u as l,dl as m,pl as n,rn as o,or as p,Ic as r,ku as s,Eu as u,Yc as w};
1
+ import{u as yt,r,j as s,s as Ms,bw as Di,bx as Ai,d as ir,i as _o,aG as Ht,e as Fi}from"./index-umZg0LZ6.js";import{b as an,e as ar,u as Oi}from"./Modal-ClSjJagX.js";import{a as Ui,P as Bi,H as Qt,c as cr,b as $i,g as qi,r as Hi,n as Qi,D as Ki}from"./types-BHkriVjU.js";import{c as Wi,i as zi,P as Kt,g as Vi,r as Gi,a as Yi,b as Xi,f as Ji,d as Zi}from"./ProviderBadge-P0VTI71n.js";import{b as lr,_ as ea,a as be}from"./client-Ci_HPGfl.js";import{u as ta}from"./index-CoR-vzsb.js";import{o as sa,u as na,n as oa,c as ra,d as sn,e as ia,g as Io,a as aa,b as ca,t as la,m as ua,f as da,r as Lo}from"./YaServerProvider-CN3tC5UL.js";import{u as pa,f as Do,c as fa,h as ma}from"./speechDraftTransaction-WhqFE1h9.js";import{r as ha}from"./recentProjectPathLinks-D0Dx6YXT.js";import{b as ga}from"./useSidebarWidth-CBCcbSLg.js";import{u as Sa,g as wa,a as va,r as ba,i as xa,A as ja,b as ya,f as Ma,B as Ao}from"./useModelSettings-BdlYk1DT.js";import{O as Ra,p as Ca,s as Pa,l as Na,Q as ka}from"./NavigationLayout-BTFsWVtE.js";import{u as Ta,b as Fo,d as Ea,c as _a}from"./useProviders-CeN1PclA.js";import{t as Ia,u as La,v as Da,b as Aa,p as Oo,d as Uo,g as Bo,m as Fa,h as Oa,a as Ua,f as Ba}from"./attachmentFileNames-CBV_5g65.js";import{u as $a}from"./useRemoteExecutors-zBAQnQXH.js";import{a as qa}from"./frontendReload-CBdyvvdy.js";import{u as Ha,r as $o,p as qo,w as Qa,n as Ka,D as Wa,l as Ho}from"./SpeechControlMenu-BYVdEa3C.js";import{p as za,h as Va,g as bs,a as xs,w as Ga}from"./newSessionDefaults-C6a9Cpc6.js";import{g as ur,s as Ya,b as Xa,p as Qo,M as Ja,a as Ko,R as Za}from"./RecapAfterSecondsControl-CxuXyFSr.js";import{s as ec,A as tc}from"./AttachmentChip-BFve3lTD.js";import{h as sc}from"./deviceDetection-BVPclkty.js";import{z as $t}from"./providerChildSessions-DbLFSybt.js";import{c as nc,a as oc}from"./newSessionPrefill-DKcy0abh.js";import{c as rc}from"./sessionNavigationState-BXejf2ZW.js";import{u as ic,g as ac,T as cc,S as lc}from"./ThinkingControls-DXbxdJRi.js";import{l as nn}from"./LocalMediaModal-B9eHVx6y.js";import{F as on}from"./FilterDropdown-CACc6ysA.js";import{V as uc}from"./VoiceInputButton-CCgovfyf.js";const dc="_selection_166ey_1",pc={selection:dc};function fc({eligible:t,selected:o,onChange:i}){const{transport:l}=an(),{t:u}=yt(),[f,b]=r.useState(!1);return r.useEffect(()=>{let v=!1;return b(!1),i(!1),t&&l.fetch("/computer-control").then(M=>{v||b(M.enabled&&M.available)}).catch(()=>{}),()=>{v=!0}},[l,t,i]),!f||!t?null:s.jsxs("label",{className:pc.selection,children:[s.jsx("input",{type:"checkbox",checked:o,onChange:v=>i(v.currentTarget.checked)}),s.jsxs("span",{children:[s.jsx("strong",{children:u("computerSessionOptIn")}),s.jsx("small",{children:u("computerSessionScope")})]})]})}const mc="_mutedComposer_1g8u4_4",hc="_fullPaneToggle_1g8u4_13",gc="_optionsWithCaptionToggle_1g8u4_23",Sc="_projectControlsSlot_1g8u4_27",wc="_secondaryOptions_1g8u4_28",vc="_secondaryOptionsHidden_1g8u4_43",bc="_optionLayout_1g8u4_48",xc="_optionLayoutWithoutProvider_1g8u4_56",jc="_optionLayoutWithoutProject_1g8u4_76",yc="_captionToggle_1g8u4_98",Mc="_optionCaption_1g8u4_125",Rc="_captionedRecapDuration_1g8u4_133",Cc="_fullPane_1g8u4_13",Pc="_fullPaneWide_1g8u4_219",Nc="_pendingFilesList_1g8u4_241",te={mutedComposer:mc,fullPaneToggle:hc,optionsWithCaptionToggle:gc,projectControlsSlot:Sc,secondaryOptions:wc,secondaryOptionsHidden:vc,optionLayout:bc,optionLayoutWithoutProvider:xc,optionLayoutWithoutProject:jc,captionToggle:yc,optionCaption:Mc,captionedRecapDuration:Rc,fullPane:Cc,fullPaneWide:Pc,pendingFilesList:Nc},kc=.5,dr=20,Tc=1,Ec="Ctrl+U";function _c(t){return t.key.toLowerCase()==="u"&&t.ctrlKey&&!t.shiftKey&&!t.metaKey&&!t.altKey}function Tu(t){var i;const o=t.value.length;if(o!==0){t.focus(),t.setSelectionRange(0,o);try{if((i=document.execCommand)!=null&&i.call(document,"delete"))return}catch{}t.setRangeText("",0,o,"start"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}function Ic(t,o,i,l){var u;t.focus(),t.setSelectionRange(o,i);try{const f=l?"insertText":"delete";if((u=document.execCommand)!=null&&u.call(document,f,!1,l))return}catch{}t.setRangeText(l,o,i,"end")}function Eu(t,o,i,l){const u=Math.max(0,l-i),f=o.length-t.length+u;return f<=0?"":o.slice(i,i+f)}function Xe(t){const o=Number.parseFloat(t);return Number.isFinite(o)?o:0}function Lc(t){const o=window.getComputedStyle(t),i=Xe(o.fontSize)||dr,l=Xe(o.lineHeight)||i*1.35,u=Xe(o.paddingTop)+Xe(o.paddingBottom),f=Xe(o.borderTopWidth)+Xe(o.borderBottomWidth);return l*t.rows+u+f}function pr(t){const o=t.closest('[data-composer-shell="true"], .message-input');return o instanceof HTMLElement?Math.max(0,o.getBoundingClientRect().height-t.getBoundingClientRect().height):0}function Dc(t,o){var Q;const i=t.closest('[data-composer-full-pane="true"]'),l=t.closest(".session-split"),u=l??i,f=u instanceof HTMLElement?u.getBoundingClientRect().height:0,b=((Q=window.visualViewport)==null?void 0:Q.height)??window.innerHeight,v=Number.isFinite(f)&&f>0?f:b;if(!Number.isFinite(v)||v<=0)return Number.POSITIVE_INFINITY;const M=t.closest(".session-input"),me=l instanceof HTMLElement&&M instanceof HTMLElement&&i instanceof HTMLElement?Math.max(0,M.getBoundingClientRect().height-i.getBoundingClientRect().height):0;return Math.max(o,Math.floor(v-pr(t)-me))}function Ac(t,o){var u;const i=((u=window.visualViewport)==null?void 0:u.height)??window.innerHeight;if(!Number.isFinite(i)||i<=0)return Number.POSITIVE_INFINITY;const l=pr(t);return Math.max(o,Math.floor(i*kc-l))}function Wo(t,o,i=!1){if(o)return t.style.height="",t.style.overflowY="",{overflowed:!1};const l=Lc(t);t.style.height="auto";const u=i?fr(t)*Tc:0,f=Math.max(t.scrollHeight+u,l),b=i?Dc(t,l):Ac(t,l),v=Math.min(f,b);return t.style.height=`${v}px`,t.style.overflowY=f>v+1?"auto":"hidden",{overflowed:f>v+1}}function Fc(t){return t.length===0?1:t.split(/\r\n|\r|\n/).length}function fr(t){const o=window.getComputedStyle(t),i=Xe(o.fontSize)||dr;return Xe(o.lineHeight)||i*1.35}function _u(t){const o=t.value,i=Math.max(0,Math.min(t.selectionStart??o.length,o.length)),l=fr(t),u=Math.max(0,t.scrollHeight-t.clientHeight);if(i>=o.length){t.scrollTop=u;return}const f=Fc(o.slice(0,i))-1;t.scrollTop=Math.min(u,Math.max(0,f*l))}const Oc=[],zo=new Set;function Uc(t,o){var l,u;const i=/(?:^|\s)@([^\s@]*)$/.exec(t.slice(0,o));return i?{query:i[1]??"",start:o-(((l=i[1])==null?void 0:l.length)??0)-1,end:o+(((u=/^[^\s@]*/.exec(t.slice(o)))==null?void 0:u[0].length)??0)}:null}function Bc(t){var Rt,g,ct;const o=lr(),i=an(),{version:l}=ar(),u=JSON.stringify([o,t.projectId]),f=`ya:file-completion:${u}`,[b,v]=r.useState(t.text.length),[M,me]=r.useState(!1),[Q,I]=r.useState(null),[he,W]=r.useState(null),[H,se]=r.useState(null),w=r.useRef(null),a=Uc(t.text,b),L=a==null?void 0:a.query;let it=zo.has(f);try{it||(it=localStorage.getItem(f)==="1")}catch{}const ie=!!t.projectId&&!t.disabled&&M&&Ms(l,Di)&&a!==null&&(it||a.query.length>=2)?JSON.stringify([u,a==null?void 0:a.start,a==null?void 0:a.query]):null,xe=ie!==null&&Q!==ie;r.useEffect(()=>{I(m=>m===ie?m:null),W(null)},[ie]);const Oe=t.items??Oc,Mt=r.useMemo(()=>xe?ha(Oe):[],[Oe,xe]);r.useEffect(()=>{if(!xe||!ie||!t.projectId||L===void 0)return;let m=!1;const j=new AbortController;let D;const B=new URLSearchParams({q:L});let Ue=0;for(const oe of Mt){const Be=encodeURIComponent(oe).length+8;Ue+Be>4096||(B.append("recent",oe),Ue+=Be)}const Je=`/projects/${t.projectId}/file-completion?${B}`,ne=async()=>{try{const oe=await i.transport.fetch(Je,{signal:j.signal});if(m)return;se({key:ie,result:oe}),oe.pending&&(D=setTimeout(ne,250))}catch(oe){m||se({key:ie,error:oe instanceof Error?oe.message:String(oe)})}};return D=setTimeout(ne,75),()=>{m=!0,j.abort(),clearTimeout(D)}},[xe,ie,t.projectId,L,Mt,i]);const ae=xe&&(H==null?void 0:H.key)===ie?H:null,z=((Rt=ae==null?void 0:ae.result)==null?void 0:Rt.entries)??[],ge=z.find(m=>m.path===he)??z[0];function $(m,j,D){const B=t.textarea.current;B&&(t.replace?t.replace(m,j,D):(Ic(B,m,j,D),t.setText(B.value)),B.setSelectionRange(m+D.length,m+D.length),v(m+D.length))}function ye(m){const j=t.textarea.current;if(!j||!a||!xe||j.selectionStart!==j.selectionEnd)return;const D=/[\s"\\]/.test(m.path)?JSON.stringify(m.path):m.path;$(a.start,a.end,`${D} `),w.current={value:j.value,cursor:a.start+D.length+1},zo.add(f);try{localStorage.setItem(f,"1")}catch{}I(ie)}function C(m){var B;if(m.nativeEvent.isComposing)return!1;const j=w.current,D=t.textarea.current;if(j&&D&&D.value===j.value&&D.selectionStart===j.cursor&&D.selectionEnd===j.cursor&&(m.key===" "||m.key==="Enter")?($(j.cursor-1,j.cursor,""),w.current=null):["Shift","Control","Alt","Meta"].includes(m.key)||(w.current=null),!xe||m.ctrlKey||m.metaKey||m.altKey||m.shiftKey)return!1;if(m.key==="Escape")return m.preventDefault(),I(ie),!0;if(ge&&(m.key==="ArrowUp"||m.key==="ArrowDown")){m.preventDefault();const Ue=z.indexOf(ge);return W(((B=z[(Ue+(m.key==="ArrowDown"?1:-1)+z.length)%z.length])==null?void 0:B.path)??null),!0}return m.key==="Tab"&&ge?(m.preventDefault(),ye(ge),!0):!1}function at(m){var D;const j=w.current;if(w.current=null,j&&(m===j.value.slice(0,j.cursor)+" "+j.value.slice(j.cursor)||m===j.value.slice(0,j.cursor)+`
2
+ `+j.value.slice(j.cursor))){const B=t.textarea.current;if(B)return B.setRangeText("",j.cursor-1,j.cursor,"preserve"),v(B.selectionStart),B.value}return v(((D=t.textarea.current)==null?void 0:D.selectionStart)??m.length),m}return{visible:xe,entries:z,selected:ge==null?void 0:ge.path,accept:ye,onKeyDown:C,normalizeInput:at,pending:xe&&(!ae||((g=ae.result)==null?void 0:g.pending)),truncated:((ct=ae==null?void 0:ae.result)==null?void 0:ct.truncated)??!1,error:ae==null?void 0:ae.error,onSelect:()=>{var m;v(((m=t.textarea.current)==null?void 0:m.selectionStart)??t.text.length)},onFocus:()=>me(!0),onBlur:()=>{me(!1),w.current=null}}}const $c="_menu_93hmr_1",qc="_row_93hmr_9",Hc="_basename_93hmr_26",Qc="_parent_93hmr_33",Kc="_kind_93hmr_41",Wc="_status_93hmr_45",bt={menu:$c,row:qc,basename:Hc,parent:Qc,kind:Kc,status:Wc};function zc({completion:t}){const{t:o}=yt(),i=r.useRef(null);return r.useEffect(()=>{var l,u,f;t.selected&&((f=(u=(l=i.current)==null?void 0:l.querySelector('[aria-selected="true"]'))==null?void 0:u.scrollIntoView)==null||f.call(u,{block:"nearest"}))},[t.selected]),t.visible?s.jsxs("div",{ref:i,className:bt.menu,role:"listbox","aria-label":o("fileCompletionLabel"),children:[t.entries.map(l=>{const u=l.path.replace(/\/$/,""),f=u.lastIndexOf("/");return s.jsxs("button",{type:"button",role:"option","aria-selected":l.path===t.selected,className:bt.row,onMouseDown:b=>b.preventDefault(),onClick:()=>t.accept(l),children:[s.jsx("span",{className:bt.basename,children:u.slice(f+1)}),s.jsx("span",{className:bt.parent,children:f>=0?u.slice(0,f+1):""}),s.jsx("span",{className:bt.kind,children:l.kind==="directory"?"dir":"file"})]},l.path)}),(t.pending||t.error||t.entries.length===0||t.truncated)&&s.jsx("div",{className:bt.status,role:"status",children:t.error?o("fileCompletionUnavailable"):t.pending?o("fileCompletionSearching"):t.truncated?o("fileCompletionMore"):o("fileCompletionEmpty")})]}):null}const Vc={limited:!1,provider:null,model:null,effort:null};function Gc(t){var l;if(t.username===null)return Vc;const o=((l=t.grants)==null?void 0:l.lock)??{};return{limited:!0,provider:o.provider&&Ui.includes(o.provider)?o.provider:null,model:o.model??null,effort:Wi(o.effort)?o.effort:null}}function Vo(t){return t.limited?{...t.provider?{provider:t.provider}:{},...t.model?{model:t.model}:{},...t.effort?{thinking:Ra(t.effort)}:{},sandboxLevel:"project-write"}:{}}function Yc(t,o,i){return!o||t.some(l=>l.id===o)?[...t]:[...t,{id:o,name:o,description:i,catalogGroup:"additional"}]}function Xc(t,o,i,l){return za(t)?[...o]:Yc(o,i,l)}function Jc(t,o){var i,l;return((i=t[o])==null?void 0:i.catalogGroup)==="additional"&&((l=t[o-1])==null?void 0:l.catalogGroup)!=="additional"}function zt(t){return t.kind==="local"}function fe(t){return t.kind==="staged"}function Go(t){return zt(t)?t.file.name:t.originalName}function Zc(t){return zt(t)?t.file.size:t.size}function el(t){return zt(t)?t.file.type||"application/octet-stream":t.mimeType}function tl(t){if(fe(t)&&!(t.width===void 0||t.height===void 0))return{width:t.width,height:t.height}}function js(t){return Ia(t)}function Yo(t){for(const o of t)o.previewUrl&&URL.revokeObjectURL(o.previewUrl)}const mr=["off","side-session","fork"],hr=[...Bi];function Xo(t,o){return t==="off"?"off":t==="auto"?"auto":`on:${o}`}function Jo(t){if(t==="off")return{mode:"off",effort:"high"};if(t==="auto")return{mode:"auto",effort:"high"};const o=t.startsWith("on:")?t.slice(3):t;return{mode:"on",effort:zi(o)?o:"high"}}function sl(t,o){return o==="off"?!0:o==="native"?!1:(t==null?void 0:t.supportsRecaps)===!0}function nl(t,o){return o!=null&&o.recapMode&&mr.includes(o.recapMode)?o.recapMode:"off"}function ol(t,o){return sl(t,o)?o:"off"}function rl(t,o){return o==="off"?!0:(t==null?void 0:t.supportsNativePromptSuggestions)===!0}function il(t){return t!=null&&t.promptSuggestionMode&&hr.includes(t.promptSuggestionMode)?t.promptSuggestionMode:"off"}function al(t,o){return rl(t,o)?o:"off"}function ys(t,o){const i=o==null?void 0:o.helperSideModel;return i&&(i===Qt||i===cr||t.some(l=>l.id===i))?i:Qt}const cl=10,ll=10;function Zo(t){return t.lastActivity?new Date(t.lastActivity).getTime():0}function ul(t,o=[]){const i=new Map(o.map((l,u)=>[l,u]));return[...t].sort((l,u)=>{const f=i.get(l.id)??Number.POSITIVE_INFINITY,b=i.get(u.id)??Number.POSITIVE_INFINITY;if(f!==b)return f-b;const v=Zo(u)-Zo(l);if(v!==0)return v;const M=l.name.localeCompare(u.name);return M!==0?M:l.path.localeCompare(u.path)})}function qt(t){const o=t.trim();return o?o.length>1&&/[/\\]$/.test(o)?o.slice(0,-1):o:""}function er(t,o){const i=qt(o);if(!i)return null;const l=t.find(f=>f.path===i);if(l)return l;const u=t.filter(f=>f.name.toLowerCase()===i.toLowerCase());return u.length===1?u[0]??null:null}function dl({version:t,text:o,attachmentCount:i}){return i>0&&!o.trim()&&!Ms(t??void 0,Ai)}let Wt=0,tr=!1;function sr(t){return Number.isFinite(t)?t:0}function nr(t=Date.now()){return Math.round(t+Wt)}function pl(){return Wt}function rn(t){if(!Number.isFinite(t.serverTimestamp))return null;const o=sr(t.clientRequestStartMs),i=sr(t.clientResponseEndMs),l=Math.max(0,i-o),u=o+l/2,f=t.serverTimestamp-u;return Wt=tr?Wt*.8+f*.2:f,tr=!0,{serverOffsetMs:Wt,roundTripMs:l,sampleOffsetMs:f}}function or(t,o){if(!(!Number.isFinite(t)||!Number.isFinite(o)))return o-t}function fl(t){return t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.shiftKey&&(t.code==="Space"||t.key===" "||t.key==="Spacebar")}function ml(t){const o=r.useRef(0),i=r.useRef(null),[l,u]=r.useState(!1),f=r.useCallback(()=>{o.current=0,i.current!==null&&(clearTimeout(i.current),i.current=null),u(!1)},[]),b=r.useCallback(()=>{if(t<=0){f();return}o.current=Date.now()+t,i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,o.current=0,u(!1)},t),u(!0)},[f,t]),v=r.useCallback(()=>{const M=o.current>Date.now();return!M&&o.current!==0&&f(),M},[f]);return r.useEffect(()=>{t<=0&&f()},[f,t]),r.useEffect(()=>()=>{o.current=0,i.current!==null&&clearTimeout(i.current),i.current=null},[]),{active:l,noteSpeech:b,isRecent:v,consume:f}}function hl({expanded:t,onToggle:o,className:i}){const{t:l}=yt();return s.jsx("button",{type:"button",className:i,onClick:o,"aria-label":l(t?"composerFullPaneRestore":"composerFullPaneExpand"),"aria-pressed":t,title:l(t?"composerFullPaneRestoreTitle":"composerFullPaneExpandTitle",{shortcut:Ec}),children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t?s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M9 3v6H3"}),s.jsx("path",{d:"m3 3 6 6"}),s.jsx("path",{d:"M15 21v-6h6"}),s.jsx("path",{d:"m21 21-6-6"})]}):s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M8 3H3v5"}),s.jsx("path",{d:"m3 3 6 6"}),s.jsx("path",{d:"M16 21h5v-5"}),s.jsx("path",{d:"m21 21-6-6"})]})})})}const gl="_fixedLaunch_1qxr7_5",Sl="_caption_1qxr7_20",wl="_rows_1qxr7_30",vl="_rowLabel_1qxr7_37",bl="_rowValue_1qxr7_42",xl="_badge_1qxr7_55",xt={fixedLaunch:gl,caption:Sl,rows:wl,rowLabel:vl,rowValue:bl,badge:xl};function jl({lock:t,modelLabel:o,effortLabel:i,sandboxAvailable:l,className:u}){const{t:f}=yt(),b=ur(f);if(!t.limited)return null;const v=[];return t.provider&&v.push({key:"provider",label:b.provider.title,value:s.jsx(Kt,{provider:t.provider,model:t.model??void 0,className:xt.badge})}),t.model&&v.push({key:"model",label:b.model.title,value:o??t.model}),t.effort&&v.push({key:"effort",label:f("newSessionFixedEffortLabel"),value:i??t.effort}),l&&v.push({key:"sandbox",label:b.sandbox.title,value:f("newSessionFixedSandboxValue")}),v.length===0?null:s.jsxs("section",{className:`${xt.fixedLaunch}${u?` ${u}`:""}`,"aria-label":f("newSessionFixedTitle"),children:[s.jsx("h3",{children:f("newSessionFixedTitle")}),s.jsx("p",{className:xt.caption,children:f("newSessionFixedCaption")}),s.jsx("dl",{className:xt.rows,children:v.map(M=>s.jsxs(r.Fragment,{children:[s.jsx("dt",{className:xt.rowLabel,children:M.label}),s.jsx("dd",{className:xt.rowValue,children:M.value})]},M.key))})]})}const yl="_section_1nqke_1",Ml="_header_1nqke_11",Rl="_count_1nqke_34",Cl="_error_1nqke_41",Pl="_itemError_1nqke_42",Nl="_list_1nqke_49",kl="_item_1nqke_42",Tl="_itemButton_1nqke_61",El="_itemHeading_1nqke_93",_l="_itemTitle_1nqke_101",Il="_status_1nqke_111",Ll="_statusDispatching_1nqke_125",Dl="_statusFailed_1nqke_130",Al="_targetRow_1nqke_135",Fl="_target_1nqke_135",Ol="_provider_1nqke_152",G={section:yl,header:Ml,count:Rl,error:Cl,itemError:Pl,list:Nl,item:kl,itemButton:Tl,itemHeading:El,itemTitle:_l,status:Il,statusDispatching:Ll,statusFailed:Dl,targetRow:Al,target:Fl,provider:Ol},Ul={queued:void 0,dispatching:G.statusDispatching,failed:G.statusFailed};function Bl(t,o){switch(t){case"dispatching":return o("projectQueueStatusDispatching");case"failed":return o("projectQueueStatusFailed");case"queued":return o("projectQueueStatusQueued")}}function $l(t,o){var i,l;return t.target.type==="new-session"?o("projectQueueTargetNewSession"):((i=t.targetFullTitle)==null?void 0:i.trim())||((l=t.targetTitle)==null?void 0:l.trim())||o("projectQueueTargetSession",{sessionId:t.target.sessionId.slice(0,8)})}function ql(t,o){var l;const i=t.messagePreview.trim();return t.target.type==="new-session"?((l=t.target.title)==null?void 0:l.trim())||i||o("projectQueueAttachmentOnly"):i||o("projectQueueAttachmentOnly")}function Hl({items:t,loading:o,error:i,onOpenItem:l}){const{t:u}=yt(),f=r.useId();return t.length===0&&!i?null:s.jsxs("section",{className:G.section,"aria-labelledby":f,"data-new-session-project-queue":"true",children:[s.jsxs("div",{className:G.header,children:[s.jsx("h3",{id:f,children:u("projectQueueTitle")}),s.jsx("span",{className:G.count,children:o?u("projectQueueRefreshing"):u("projectQueueCount",{count:t.length})})]}),i&&s.jsx("p",{className:G.error,role:"alert",children:u("projectQueueLoadError",{message:i.message})}),s.jsx("ul",{className:G.list,children:t.map(b=>{const v=ql(b,u);return s.jsx("li",{className:G.item,"data-new-session-project-queue-item-id":b.id,children:s.jsxs("button",{type:"button",className:G.itemButton,onClick:()=>l(b.id),title:v,children:[s.jsxs("span",{className:G.itemHeading,children:[s.jsx("strong",{className:G.itemTitle,children:v}),s.jsx("span",{className:`${G.status} ${Ul[b.status]??""}`,children:Bl(b.status,u)})]}),s.jsxs("span",{className:G.targetRow,children:[s.jsx("span",{className:G.target,children:$l(b,u)}),b.target.provider&&s.jsx(Kt,{provider:b.target.provider,model:b.target.model,className:G.provider})]}),b.lastError&&s.jsx("span",{className:G.itemError,children:b.lastError})]})},b.id)})})]})}function Ql(){return Ht()}function Kl(){return`speech-target-${Ht()}`}function Wl(t){return{name:t,displayName:t,installed:!1,authenticated:!1,enabled:!1}}function Fe({caption:t,children:o,className:i,showCaption:l,title:u}){return s.jsxs("div",{className:i,title:l?void 0:t,children:[s.jsx("h3",{children:u}),l&&t&&s.jsx("p",{className:te.optionCaption,children:t}),o]})}function Iu({projectId:t,selectedProject:o,projects:i=[],recentProjectIds:l=[],projectsLoading:u=!1,onProjectChange:f,autoFocus:b=!0,rows:v=6,placeholder:M,compact:me=!1,preferredProvider:Q,preferredModel:I,preferredThinking:he,preferredPermissionMode:W,preferredExecutor:H,incomingShareFiles:se,launch:w}){var Ro,Co;const{t:a}=yt(),L=ur(a),it=ir(),Vt=Oi(),{relayTransport:ie,relayedServerSpeechAvailable:xe}=sa(),Oe=lr(),Mt=an(),ae=Mt.summary,z=Mt.transport,ge=r.useMemo(()=>(w==null?void 0:w.draftKey)??ga(Oe),[Oe,w==null?void 0:w.draftKey]),[$,ye,C]=pa(ge),[at,Rt]=r.useState("default"),[g,ct]=r.useState(null),[m,j]=r.useState(null),[D,B]=r.useState("off"),[Ue,Je]=r.useState("high"),[ne,oe]=r.useState("off"),[Be,Rs]=r.useState("none"),[Cs,Sr]=r.useState(!1),[Gt,Yt]=r.useState(!0),[Ne,cn]=r.useState($i),[lt,ln]=r.useState("off"),[ut,Ct]=r.useState(Qt),[Ps,Ns]=r.useState(null),[Y,wr]=r.useState([]),ke=r.useRef([]),dt=r.useRef(null),Xt=r.useRef(0),ks=r.useRef(new Map),Ts=r.useRef(new Set),[A,pt]=r.useState(!1),[Te,vr]=r.useState(!1),[Jt,un]=r.useState(!1),[re,br]=r.useState(!1),[dn,xr]=r.useState(null),[jr,Es]=r.useState({}),[Zt]=La(),{visibility:pn}=Ha(),[Ee,Ze]=r.useState(""),$e=r.useRef(Ee);$e.current=Ee;const[Pt,fn]=r.useState(null),ft=r.useRef(null),qe=r.useRef(null),He=r.useRef(!1),es=r.useRef(!1),_s=r.useRef(!1),mn=r.useRef(()=>{}),{asrAttributionMs:hn,speechMessagePrefix:Nt}=na(),{active:yr,noteSpeech:ts,isRecent:Is,consume:Ls}=ml(hn),[,ss]=r.useState(0),[_e,Ie]=r.useState(!1),[Mr,gn]=r.useState(null),[Ds,ns]=r.useState({status:"idle",projectId:null,workstreams:[]}),[kt,os]=r.useState(()=>(o==null?void 0:o.path)??""),Sn=r.useRef(null),wn=r.useRef(null),Rr=r.useRef(null),vn=r.useRef(null),Me=r.useRef(null),X=r.useRef(null),As=r.useRef(null),J=r.useRef(null),Z=r.useRef(null),je=r.useRef(new Map),Qe=r.useRef(null),Le=r.useRef(null),Fs=r.useRef(!1),mt=r.useRef(null),bn=r.useRef(!1),xn=r.useRef(!1),ee=r.useRef(!1),Tt=r.useRef(null),jn=r.useRef(!1),Os=r.useRef(null),yn=r.useRef(b),{effortLevel:Mn,thinkingMode:Rn,showThinking:Cr,setShowThinking:Pr,voiceInputEnabled:Nr,speechMethod:Cn,hasStoredSpeechMethod:Pn,setSpeechMethod:Nn,speechSmartTurnSettings:kr,setSpeechSmartTurnSettings:Tr}=Sa(),{version:E,loading:kn}=ar(),{principal:Tn}=Ca(),U=r.useMemo(()=>Gc(Tn),[Tn]),ce=Ya(E),En=Xa(g),et=En?Ps:null,_n=ce&&et===null&&Qo(g),Se=U.limited?"project-write":_n?Be:"none",Et=Se==="project-write"&&Gt,Us=g==="codex"&&!et&&Se==="none"&&!w&&Ms(E,_o.computerControl.name),ht=Pa(E),In=((Ro=E==null?void 0:E.clientDefaults)==null?void 0:Ro.projectQueueCtrlEnterEnabled)??qi,{hasBrowserXaiSttApiKey:rs}=oa(),{showToast:le}=ta(),is=(w==null?void 0:w.allowAttachments)??!0,Er=(w==null?void 0:w.allowProjectQueue)??!0,Ln=(w==null?void 0:w.fixedProject)??!1,Re=(w==null?void 0:w.composer)==="muted",Dn=!((w==null?void 0:w.fixedProviderModel)??!1),An=Dn&&!U.provider,Fn=Dn&&!U.model;Os.current===null&&(Os.current=$),r.useLayoutEffect(()=>{if(!w||jn.current||!w.initialMessage)return;jn.current=!0;const e=Os.current??"";if(!$){ye(w.initialMessage);return}if(e)return;const n=`${w.initialMessage}${$}`;mt.current={value:n,restore:p=>{p.focus(),p.setSelectionRange(n.length,n.length)}},ye(n)},[w,$,ye]);const On=r.useCallback(e=>{var d;const n=e.filter(fe).map(js);if(n.length===0){e.some(c=>c.kind==="uploading")||(dt.current=null),C.setAttachmentState(null);return}const p=(d=n[0])==null?void 0:d.batchId;if(!p){C.setAttachmentState(null);return}dt.current=p,C.setAttachmentState({batchId:p,refs:n,updatedAt:new Date().toISOString()})},[C]),ue=r.useCallback((e,n)=>{const p=ke.current,d=typeof e=="function"?e(p):e;if(d===p)return;const c=[...d];if(n!=null&&n.revokeRemovedPreviewUrls){const h=new Set(c.map(x=>x.id));Yo(p.filter(x=>!h.has(x.id)))}ke.current=c,wr(c),(n==null?void 0:n.persistDraft)!==!1&&On(c)},[On]);r.useEffect(()=>()=>{Yo(ke.current)},[]);const Un=r.useCallback(()=>{var p;const e=((p=C.getAttachmentState())==null?void 0:p.batchId)??dt.current;if(e)return dt.current=e,e;const n=Ht();return dt.current=n,n},[C]),Bn=r.useCallback(async()=>{var p;if(!ht)return;const e=C.getAttachmentState();if(!e){ue(d=>d.some(fe)?d.filter(c=>!fe(c)):d,{persistDraft:!1,revokeRemovedPreviewUrls:!0});return}if(ke.current.some(d=>d.kind==="uploading"||fe(d)))return;const n=Xt.current+1;Xt.current=n;try{const d=await Da(z,e);if(Xt.current!==n)return;const c=d.length>0?{batchId:((p=d[0])==null?void 0:p.batchId)??e.batchId,refs:d,updatedAt:new Date().toISOString()}:null;dt.current=(c==null?void 0:c.batchId)??null,C.setAttachmentState(c),ue(h=>[...h.filter(x=>!fe(x)),...d.map(x=>({...x,kind:"staged"}))],{persistDraft:!1,revokeRemovedPreviewUrls:!0})}catch(d){if(Xt.current!==n)return;console.warn("[NewSessionForm] Failed to validate draft attachments:",d),C.setAttachmentState(null),ue(c=>c.some(fe)?c.filter(h=>!fe(h)):c,{persistDraft:!1,revokeRemovedPreviewUrls:!0}),le(a("sessionDraftAttachmentsUnavailable"),"info")}},[z,C,ue,le,ht,a]);r.useEffect(()=>{Bn()},[Bn,ge]);const as=r.useCallback(e=>{if(e.length===0)return;const n=ke.current.map(Go),p=Aa(e,n),d=ht?Un():null;if(!d){const c=p.map(h=>({kind:"local",id:`pending-${Ht()}`,file:h,previewUrl:h.type.startsWith("image/")?URL.createObjectURL(h):void 0}));ue(h=>[...h,...c]);return}for(const c of p){const h=`pending-${Ht()}`,x=c.type.startsWith("image/")?URL.createObjectURL(c):void 0,k={kind:"uploading",id:h,originalName:c.name,size:c.size,mimeType:c.type||"application/octet-stream",...x?{previewUrl:x}:{}};ue(R=>[...R,k]);const V=(async()=>{const R=c.type.startsWith("image/")?await Oo(c,Bo(Zt)):{file:c},F=R.file,S=await z.uploadStagedAttachment(F,{batchId:d,onProgress:N=>{Es(y=>({...y,[h]:{uploaded:N,total:F.size}}))},...R.width!==void 0&&R.height!==void 0?{imageDimensions:{width:R.width,height:R.height}}:{}});return F.type.startsWith("image/")&&ec({id:S.id,originalName:c.name,name:S.name,path:S.id,size:S.size,mimeType:S.mimeType,...S.width!==void 0?{width:S.width}:{},...S.height!==void 0?{height:S.height}:{}},F).catch(()=>{}),{...S,originalName:c.name,kind:"staged",...x?{previewUrl:x}:{}}})().then(R=>Ts.current.delete(h)||!ke.current.some(S=>S.id===h)?(x&&URL.revokeObjectURL(x),Uo(z,R.batchId,R.id).catch(S=>{console.warn("[NewSessionForm] Failed to delete staged attachment:",S)}),null):(ue(S=>S.map(N=>N.id===h?R:N)),R),R=>{if(!(Ts.current.delete(h)||!ke.current.some(S=>S.id===h))){console.error("Failed to upload staged file:",R);const S=R instanceof Error?R.message:String(R);le(a("newSessionUploadError",{message:S}),"error"),ue(N=>N.filter(y=>y.id!==h),{revokeRemovedPreviewUrls:!0})}return null}).finally(()=>{Es(R=>{const{[h]:F,...S}=R;return S}),ks.current.delete(h)});ks.current.set(h,V)}},[Zt,z,Un,ue,le,ht,a]),$n=r.useRef(null);r.useEffect(()=>{!is||!(se!=null&&se.length)||$n.current===se||($n.current=se,as(se))},[as,is,se]);const{providers:De,loading:qn,stale:_r}=Ta(),{usage:Hn}=ic(g,{bootstrapTier:"supplementary"}),{settings:P,isLoading:cs,updateSetting:Qn}=qa(),Kn=r.useRef(P==null?void 0:P.newSessionDefaults);r.useEffect(()=>{Kn.current=P==null?void 0:P.newSessionDefaults},[P==null?void 0:P.newSessionDefaults]);const{executors:Wn,loading:Ir}=$a(),Lr=Fo(De),Dr=M??a("newSessionPlaceholder"),Ar={default:a("modeDefaultLabel"),acceptEdits:a("modeAcceptEditsLabel"),plan:a("modePlanLabel"),bypassPermissions:a("modeBypassPermissionsLabel"),auto:a("modeAutoLabel")},Fr={default:a("modeDefaultDescription"),acceptEdits:a("modeAcceptEditsDescription"),plan:a("modePlanDescription"),bypassPermissions:a("modeBypassPermissionsDescription"),auto:a("modeAutoDescription")},Or={off:a("recapModeOff"),native:a("recapModeNative"),"side-session":a("recapModeSideSession"),fork:a("recapModeFork")},Ur={off:a("promptSuggestionModeOff"),native:a("promptSuggestionModeNative")},zn={off:a("promptSuggestionModeOffDescription"),native:a("promptSuggestionModeNativeDescription")},Br={off:a("recapAfterSecondsLabel"),native:a("recapAfterSecondsInlineNative"),"side-session":a("recapAfterSecondsInlineSideSession"),fork:a("recapAfterSecondsInlineFork")},Ke=Ea(g,{forceRefreshOnMount:g==="claude-gateway"}),$r=De.find(e=>e.name===g),q=Ke.row??$r,we=(q==null?void 0:q.models)??[],tt=r.useMemo(()=>Xc(g,we,m,a("modelSelectionUnavailable")),[we,m,g,a]),_t=(g!=="claude-gateway"||Ke.fresh&&!Ke.refreshing&&Ke.error===null)&&Va(g,we,m),Vn=r.useMemo(()=>[...tt],[tt]),qr=r.useMemo(()=>[{value:Qt,label:a("helperSideModelCheapest")},{value:cr,label:a("helperSideModelSameAsMain"),description:m??void 0},...Vn.map(e=>({value:e.id,label:e.name,description:e.description}))],[Vn,m,a]),Hr=(q==null?void 0:q.supportsPermissionMode)??!0,Qr=(q==null?void 0:q.supportsThinkingToggle)??!0,gt=tt.find(e=>e.id===m),ls=r.useMemo(()=>Vi({provider:q,model:gt,translate:a}),[gt,q,a]),us=Gi(Ue,ls),Bs=r.useMemo(()=>Yi({provider:q,model:gt,effortOptions:ls}),[ls,gt,q]),ds=Xi(D,Bs),Kr=Qr&&!U.effort&&Bs.some(e=>e!=="off"),Gn=r.useMemo(()=>ac({model:gt}),[gt]),ps=Gn.includes(at)?at:"default",Ae=r.useCallback(e=>({model:e==="claude"?Hi(wa()):void 0,thinkingMode:Rn,effortLevel:Mn}),[Mn,Rn]),Wr=mr,zr=hr,Vr=ne==="side-session",It=r.useMemo(()=>ul(i,l),[i,l]),Yn=r.useMemo(()=>It.slice(0,cl),[It]),We=qt(kt),Xn=qt((o==null?void 0:o.path)??""),Ce=!!We&&!!Xn&&We===Xn?"":We,Lt=r.useMemo(()=>er(i,Ce),[Ce,i]),Jn=r.useMemo(()=>{if(!Ce)return It;const e=Ce.toLowerCase();return It.filter(n=>n.name.toLowerCase().includes(e)||n.path.toLowerCase().includes(e))},[Ce,It]),Dt=r.useMemo(()=>(Ce?Jn:Yn).slice(0,ll),[Ce,Jn,Yn]),Gr=r.useMemo(()=>Dt.map(e=>s.jsx("option",{value:e.path,children:e.name},e.id)),[Dt]),ze=!!Ce&&Lt===null,_=Lt??o??null,Pe=!ze&&We&&_?_.id:null,St=Bc({projectId:Pe,text:$,textarea:Me,setText:ye,disabled:A||Re||!!Ee}),Yr=r.useMemo(()=>Pe?[Pe]:[],[Pe]),$s=Na(Yr),Xr=ea(Pe),Zn=Pe?$s.queuesByProject[Pe]??[]:[],Jr=Zn.length,Zr=(_==null?void 0:_.projectQueueBlockingCount)??null,qs=ht&&ka({projectId:Pe,activeProjectSessionIds:Xr,projectQueueBlockingCount:Zr,projectQueueItemCount:Jr}),Hs=!ze&&_===null,ei=(_==null?void 0:_.name)??a("newSessionProjectDetached"),Qs=ze?We:(_==null?void 0:_.path)??a("newSessionProjectDetachedHint"),ti=ze||_?nn(Qs):Qs,Ve=!ze&&We&&_?_.id:null,Ks=(P==null?void 0:P.workstreamsEnabled)===!0;r.useEffect(()=>{if(gn(null),!Ks||!Ve){ns({status:"idle",projectId:null,workstreams:[]});return}let e=!1;return ns({status:"loading",projectId:Ve,workstreams:[]}),be.getProjectWorkstreams(Ve).then(n=>{e||ns({status:"ready",projectId:Ve,workstreams:n.workstreams})}).catch(()=>{e||ns({status:"error",projectId:Ve,workstreams:[]})}),()=>{e=!0}},[Ks,Ve]);const fs=Ds.status==="ready"&&Ds.projectId===Ve?Ds.workstreams.filter(e=>e.kind==="main"||e.status==="active"):[],si=Ks&&Ve!==null&&fs.length>1,st=fs.find(e=>e.id===Mr)??fs.find(e=>e.kind==="main")??null,Ws=(st==null?void 0:st.kind)==="checkout"?st.id:void 0,ni=r.useCallback(e=>{const n=e.currentTarget.value;gn(n||null)},[]),ms=r.useCallback(e=>{os(e.path),Tt.current=e.id,f==null||f(e.id),Ie(!1)},[f]),eo=r.useCallback(()=>{os(""),Tt.current=null,f==null||f(null),Ie(!1)},[f]),to=r.useMemo(()=>{if(!_e)return null;const e=[s.jsxs("button",{type:"button",className:`new-session-project-option ${Hs?"selected":""}`,onClick:eo,children:[s.jsx("span",{className:"new-session-project-option-name",children:a("newSessionProjectDetached")}),s.jsx("span",{className:"new-session-project-option-path",children:a("newSessionProjectDetachedHint")})]},"detached")];return ze&&e.push(s.jsxs("button",{type:"button",className:"new-session-project-option new-session-project-option-custom",onClick:()=>Ie(!1),children:[s.jsx("span",{className:"new-session-project-option-name",children:a("newSessionProjectUseTypedPath")}),s.jsx("span",{className:"new-session-project-option-path",children:Ce})]},"custom")),u?(e.push(s.jsx("div",{className:"new-session-project-empty",children:a("newSessionLoading")},"loading")),e):Dt.length===0?(e.push(s.jsx("div",{className:"new-session-project-empty",children:a("newSessionProjectNoMatches")},"no-matches")),e):(e.push(...Dt.map(n=>s.jsxs("button",{type:"button",className:`new-session-project-option ${(_==null?void 0:_.id)===n.id&&!ze?"selected":""}`,onClick:()=>ms(n),title:n.path,children:[s.jsx("span",{className:"new-session-project-option-name",children:n.name}),s.jsx("span",{className:"new-session-project-option-path",children:nn(n.path)})]},n.id))),e)},[_==null?void 0:_.id,eo,ms,ze,Hs,_e,Ce,Dt,u,a]),hs=r.useCallback(()=>{U.limited&&(U.provider&&ct(U.provider),U.model&&j(U.model),U.effort&&(Je(U.effort),B("on")),Rs("project-write"),Yt(!0),oe(e=>e==="side-session"?"off":e))},[U]),gs=r.useCallback(e=>{const n=e.length>0,p=new Set(Fo(e).map(O=>O.name)),d=O=>!n||p.has(O),c=P==null?void 0:P.newSessionDefaults,h=Q&&d(Q)?Q:null,x=h??(c!=null&&c.provider&&d(c.provider)?c.provider:null),k=e.find(O=>O.name===x)??_a(e)??(n?null:Wl(x??Ki));if(!k)return;const V=k.models??[],R=h&&k.name===h&&I&&(k.name!=="claude-gateway"&&V.length===0||V.some(O=>O.id===I))?I:null,F=il(c),S=bs(c,k.name,Ae(k.name));ct(k.name),j(R??xs(k.name,V,S.model));const N=he?Jo(he):null;B((N==null?void 0:N.mode)??S.thinkingMode??"off"),Je((N==null?void 0:N.effort)??S.effortLevel??"high");const y=ce&&(c==null?void 0:c.sandboxLevel)==="project-write"?"project-write":"none",T=nl(k,c);oe(Qo(k.name)&&y==="project-write"&&T==="side-session"?"off":T),Rs(y),Yt(y==="project-write"&&(c==null?void 0:c.sandboxNetworkFirewall)!==!1),cn(Qi(c==null?void 0:c.recapAfterSeconds)),ln(F),Ct(ys(V,S)),Rt(W??(c==null?void 0:c.permissionMode)??"default"),Ns(H??null),hs()},[hs,P,ce,Ae,Q,I,he,W,H]);r.useEffect(()=>{bn.current||cs||(bn.current=!0,!ee.current&&gs(De))},[gs,De,cs]),r.useEffect(()=>{xn.current||qn||cs||kn||(xn.current=!0,!ee.current&&De.length!==0&&gs(De))},[gs,De,qn,cs,kn]),r.useEffect(()=>{hs()},[hs]),r.useEffect(()=>{const e=t??null;Tt.current!==e&&(Tt.current=e,os(n=>n||((o==null?void 0:o.path)??"")))},[t,o]),r.useEffect(()=>{if(!_e)return;const e=d=>{if(!(d instanceof Node))return;const c=wn.current;c&&!c.contains(d)&&Ie(!1)},n=d=>{e(d.target)},p=d=>{e(d.target)};return document.addEventListener("pointerdown",n,!0),document.addEventListener("focusin",p,!0),()=>{document.removeEventListener("pointerdown",n,!0),document.removeEventListener("focusin",p,!0)}},[_e]);const oi=e=>{ee.current=!0,ct(e);const n=De.find(h=>h.name===e),p=(n==null?void 0:n.models)??[],d=bs(P==null?void 0:P.newSessionDefaults,e,Ae(e));n!=null&&n.models&&n.models.length>0?j(xs(e,p,d.model)):j(null);const c=he?Jo(he):null;B((c==null?void 0:c.mode)??d.thinkingMode??"off"),Je((c==null?void 0:c.effort)??d.effortLevel??"high"),Ct(ys(p,d))};r.useEffect(()=>{if(g!=="claude-gateway"||m&&we.some(p=>p.id===m))return;const e=bs(P==null?void 0:P.newSessionDefaults,g,Ae(g)),n=xs(g,we,e.model);m!==n&&(j(n),Ct(ys(we,e)))},[we,Ae,m,g,P==null?void 0:P.newSessionDefaults]),r.useEffect(()=>{if(!g||m||we.length===0)return;const e=bs(P==null?void 0:P.newSessionDefaults,g,Ae(g)),n=xs(g,we,e.model);n&&(j(n),Ct(ys(we,e)))},[we,Ae,m,g,P==null?void 0:P.newSessionDefaults]);const Ss=r.useMemo(()=>tt.map((e,n)=>{const p=e.size?`${e.name} (${(e.size/1073741824).toFixed(1)} GB)`:e.name;let d=e.description;if(!d){const c=[];e.parameterSize&&c.push(e.parameterSize),e.contextWindow&&c.push(`${Math.round(e.contextWindow/1024)}K ctx`),e.parentModel&&c.push(e.parentModel),e.quantizationLevel&&c.push(e.quantizationLevel),c.length>0&&(d=c.join(" · "))}return{value:e.id,label:p,description:d,groupLabelBefore:Jc(tt,n)?a("previousModelsGroup"):void 0,icon:g?s.jsx(Kt,{provider:g,model:e.id}):void 0,meta:s.jsx(Ja,{usage:Hn,modelId:e.id})}}),[g,Hn,a,tt]),so=r.useCallback(e=>{ee.current=!0,j(e[0]??null)},[]),no=r.useMemo(()=>{const e=(E==null?void 0:E.voiceBackends)??[];return va(e,void 0,{directXaiAvailable:rs}).map(n=>({value:n.id,label:n.label,description:n.description,disabled:!n.clientSupported}))},[E==null?void 0:E.voiceBackends,rs]),wt=r.useMemo(()=>ba(Cn,E==null?void 0:E.voiceBackends,Pn,{directXaiAvailable:rs,browserNativeAvailable:xa()}),[Cn,E==null?void 0:E.voiceBackends,Pn,rs]),ri=r.useCallback(e=>{const n=e[0];n&&ja(n)&&Nn(n)},[Nn]),ii=Nr&&no.length>1,ai=wt===null?{}:ya(wt,E==null?void 0:E.voiceBackendCapabilities),oo=wt!==null&&Ma({methodId:wt,serverCapabilities:E==null?void 0:E.voiceBackendCapabilities,relayTransport:ie,relayedServerSpeechAvailable:xe})&&ai.smartTurn===!0,ro=oo?kr:void 0,ci=r.useCallback(e=>{if(Me.current=e,!e||!yn.current)return;yn.current=!1,e.focus();const n=e.value.length;e.setSelectionRange(n,n)},[]);r.useLayoutEffect(()=>{const e=mt.current,n=Me.current;!e||!n||$!==e.value||n.value!==e.value||(mt.current=null,e.restore(n))},[$]),r.useLayoutEffect(()=>{var p;const e=Me.current;if(!e)return;if(!Te){Wo(e,!0);return}const n=()=>{const{overflowed:d}=Wo(e,!1,!0);d&&!Jt&&un(!0)};return n(),window.addEventListener("resize",n),(p=window.visualViewport)==null||p.addEventListener("resize",n),()=>{var d;window.removeEventListener("resize",n),(d=window.visualViewport)==null||d.removeEventListener("resize",n)}},[Te,Jt,$]);const io=r.useCallback(()=>{var e;if(!(me||Re)){if(!Te){const n=(e=vn.current)==null?void 0:e.getBoundingClientRect().width;xr(n&&n>0?n:null),un(!1)}vr(n=>!n)}},[me,Re,Te]);r.useEffect(()=>{const e=new URLSearchParams(window.location.search),n=e.get("prefillToken"),p=n?nc(n,Oe):oc(Oe);if(p){if(n){e.delete("prefillToken");const d=e.toString(),c=`${window.location.pathname}${d?`?${d}`:""}${window.location.hash}`;window.history.replaceState(window.history.state,"",c)}mt.current={value:p.text,restore:d=>{const c=p.caret==="start"?0:p.text.length;d.focus(),d.setSelectionRange(c,c)}},ye(p.text)}},[Oe,ye]);const li=r.useCallback(e=>{e.key==="Enter"?(e.preventDefault(),Lt?ms(Lt):We&&Ie(!1)):e.key==="Escape"&&(e.preventDefault(),Ie(!1))},[Lt,ms,We]),ui=e=>{const n=e.target.files;n!=null&&n.length&&(as(Array.from(n)),e.target.value="")},di=e=>{const n=ke.current.find(p=>p.id===e);(n==null?void 0:n.kind)==="uploading"&&Ts.current.add(e),ue(p=>p.filter(d=>d.id!==e),{revokeRemovedPreviewUrls:!0}),n&&fe(n)&&Uo(z,n.batchId,n.id).catch(p=>{console.warn("[NewSessionForm] Failed to delete staged attachment:",p)})},pi=e=>{ee.current=!0,Rt(e)};r.useEffect(()=>{if(!ee.current||!g)return;const{helperSideModel:e,sandboxLevel:n,sandboxNetworkFirewall:p,...d}=Kn.current??{};Promise.resolve(Qn("newSessionDefaults",{...Ga({...d,provider:g??void 0,permissionMode:at,recapMode:ne,recapAfterSeconds:Ne,promptSuggestionMode:lt,...ce?{sandboxLevel:Be,...Be==="project-write"?{sandboxNetworkFirewall:Gt}:{}}:{}},g,{model:m??void 0,thinkingMode:D,effortLevel:Ue,helperSideModel:ut},Ae(g))})).catch(c=>{console.error("Failed to save new session defaults:",c)})},[Ae,ut,at,Ne,Be,Gt,m,Ue,g,lt,ne,D,ce,Qn]);const zs=r.useCallback(async e=>{var p;let n=e&&(_==null?void 0:_.path)===e?_.id:((p=er(i,e))==null?void 0:p.id)??null;if(e&&!n){if(n=(await be.addProject(e)).project.id??null,!n)return null;Tt.current=n,f==null||f(n)}return n},[_,f,i]),ao=r.useCallback(async(e,n)=>{var R;const p=[...ks.current.values()];p.length>0&&await Promise.all(p);const d=ke.current,c=[],h=d.filter(zt);for(const F of h)try{const S=F.file.type.startsWith("image/")?await Oo(F.file,Bo(Zt)):{file:F.file},N=S.file,y=await z.upload(e,n,N,{onProgress:T=>{Es(O=>({...O,[F.id]:{uploaded:T,total:N.size}}))},...S.width!==void 0&&S.height!==void 0?{imageDimensions:{width:S.width,height:S.height}}:{}});c.push(y)}catch(S){console.error("Failed to upload file:",S);const N=S instanceof Error?S.message:"";le(a("newSessionUploadError",{message:N}),"error")}const x=d.filter(fe).map(js);if(x.length===0)return c;const k=(R=x[0])==null?void 0:R.batchId;if(!k||x.some(F=>F.batchId!==k))throw new Error("Draft attachments are split across staging batches");const V=await Fa(z,e,n,{batchId:k,refs:x,updatedAt:new Date().toISOString()});return[...c,...V]},[Zt,z,le,a]),Vs=r.useCallback(e=>{if(_s.current)return!1;const n=X.current;return(n==null?void 0:n.isListening)===!0||ft.current!==null||Le.current!==null?(qe.current={kind:e,visibleTextSnapshot:ra(C.getDraft(),$e.current,J.current)},He.current=!1,n!=null&&n.isListening&&n.stopAndFinalize(),!0):(qe.current=null,He.current=!1,!1)},[C]),nt=r.useCallback(async(e,n=!1)=>{const p=typeof e=="string"?e:void 0;if(p===void 0&&Vs("start"))return;const d=(p??C.getDraft()).trimEnd(),c=d.trim()||Y.length>0;if(!c&&!Re||A||!_t)return;const h=$o({configuredPrefix:Nt,speechTriggered:n,recentSpeech:Is()});let x=h&&c?qo(d,h):d.trim();const k=Qa(x),V=k&&Ji(k.kind)?k.kind:void 0;if(V&&(!Ms(E,_o.turnEffortModifiers.name)||w||!["codex","claude","claude-gateway","claude-ollama"].includes(g??""))){le(a("turnEffortUnavailable"),"error");return}if(V&&k){if(!k.argument.trim()){le(a("turnEffortNeedsMessage"),"error");return}x=k.argument}const R=V?{deliveryIntent:"direct",turnEffort:V}:void 0;if(dl({version:E,text:d,attachmentCount:Y.length})){le(a("attachmentOnlyRequiresServerUpdate"),"error");return}const F=qt(kt),S=Date.now(),N=nr(S);Ze(""),Ls(),pt(!0);try{let y=await zs(F),T,O;const de=ps;let rt=de,Ot,Xs=0;const Js=[],Ut=Xo(ds,us),Po=ol(q,ne),No=al(q,lt),ko=Ao(),Bt={...Cs&&Us?{computerControl:!0}:{},mode:de,model:m??void 0,thinking:Ut,showThinking:ko,provider:g??void 0,executor:et??void 0,...ce?{sandboxLevel:Se,...Se==="project-write"?{sandboxNetworkFirewall:Et}:{}}:{},recapMode:Po,recapAfterSeconds:Ne,promptSuggestionMode:No,helperSideModel:ut,workstreamId:Ws,...Vo(U)};if($t("new-session-submit",{projectId:y??null,detached:!y,mode:de,model:m??null,thinking:Ut,provider:g??null,executor:et,sandboxLevel:ce?Se:null,sandboxNetworkFirewall:ce?Et:null,recapMode:Po,recapAfterSeconds:Ne,promptSuggestionMode:No,helperSideModel:ut,textLength:x.length,pendingFileCount:Y.length,clientTimestamp:N,serverOffsetMs:pl()}),w){if(Y.length>0)throw new Error("This session launch does not accept attachments");await w.submit({message:x,options:Bt,clientTimestamp:N}),C.clearDraft(),pt(!1);return}if(Y.length>0){const Zs=Date.now(),K=y?await be.createSession(y,Bt):await be.createDetachedSession(Bt),en=Date.now(),pe=rn({clientRequestStartMs:Zs,clientResponseEndMs:en,serverTimestamp:K.serverTimestamp}),To=K.projectId;T=K.sessionId,O=K.processId,rt=K.permissionMode,Ot=K.appliedPermissionMode,Xs=K.modeVersion,y=To,$t("new-session-created",{sessionId:T,processId:O,projectId:y,thinking:Ut,mode:de,serverTimestamp:K.serverTimestamp,requestRttMs:(pe==null?void 0:pe.roundTripMs)??null,estimatedServerOffsetMs:(pe==null?void 0:pe.serverOffsetMs)??null}),Js.push(...await ao(To,T));const Eo=Date.now(),tn=await be.queueMessage(T,x,de,Js.length>0?Js:void 0,void 0,Ut,void 0,N,R,void 0,ko),Li=Date.now(),vt=rn({clientRequestStartMs:Eo,clientResponseEndMs:Li,serverTimestamp:tn.serverTimestamp});$t("new-session-queued",{sessionId:T,processId:O,projectId:y,clientTimestamp:N,serverTimestamp:tn.serverTimestamp,uploadWaitMs:Eo-S,requestRttMs:(vt==null?void 0:vt.roundTripMs)??null,estimatedServerOffsetMs:(vt==null?void 0:vt.serverOffsetMs)??null,clientToServerLatencyMs:or(N,tn.serverTimestamp)})}else{const Zs=Date.now(),K=y?await be.startSession(y,x,Bt,void 0,N,R):await be.startDetachedSession(x,Bt,void 0,N,R),en=Date.now(),pe=rn({clientRequestStartMs:Zs,clientResponseEndMs:en,serverTimestamp:K.serverTimestamp});T=K.sessionId,O=K.processId,rt=K.permissionMode,Ot=K.appliedPermissionMode,Xs=K.modeVersion,y=K.projectId,$t("new-session-started",{sessionId:T,processId:O,projectId:y,thinking:Ut,mode:de,provider:g??null,model:m??null,clientTimestamp:N,serverTimestamp:K.serverTimestamp,requestRttMs:(pe==null?void 0:pe.roundTripMs)??null,estimatedServerOffsetMs:(pe==null?void 0:pe.serverOffsetMs)??null,clientToServerLatencyMs:or(N,K.serverTimestamp)})}if(!y)throw new Error("Missing project ID for new session");ue([],{persistDraft:!1,revokeRemovedPreviewUrls:!0}),C.clearDraft(),it(`${Vt}/projects/${y}/sessions/${T}`,{state:rc({initialStatus:{owner:"self",processId:O,permissionMode:rt,appliedPermissionMode:Ot,modeVersion:Xs,recapAfterSeconds:Ne},initialTitle:x,initialModel:m??void 0,initialProvider:g??void 0})})}catch(y){console.error("Failed to start session:",y),C.restoreFromStorage(),pt(!1);let T=a("newSessionStartError");if(y instanceof Error){const O=(q==null?void 0:q.displayName)??g??"Provider",de=y.message.toLowerCase(),rt=y.status;y.message.includes("Queue is full")?T=a("newSessionServerBusy"):de.includes("invalid authentication credentials")||de.includes("authentication_error")||de.includes("please run /login")||rt===401&&(g==="claude"||g==="gemini"||g==="codex")?T=a("newSessionProviderAuthError",{provider:O}):y.message.includes("503")?T=a("newSessionServerCapacity"):y.message.includes("404")?T=a("newSessionProjectNotFound"):y.message.includes("fetch")||y.message.includes("network")?T=a("newSessionNetworkError"):T=y.message}le(T,"error")}},[Vt,C,Us,Cs,us,et,ps,ds,ut,_t,A,w,U,Re,Ls,Vs,Is,it,Y,kt,Ne,Se,Et,ao,zs,Ws,m,lt,g,q,ne,ue,le,Nt,ce,a,E]),Gs=async e=>{const n=typeof e=="string"?e:void 0;if(n===void 0&&Vs("project-queue"))return;const d=(n??C.getDraft()).trimEnd().trim(),c=$o({configuredPrefix:Nt,speechTriggered:!1,recentSpeech:Is()}),h=d&&qo(d,c),x=qt(kt),k=Y.filter(fe).map(js),V=k.length===Y.length;if(!h||!V||A||!_t)return;Ls();const R=Date.now(),F=nr(R),S=new Date(F).toISOString(),N=k[0],y=N?{batchId:N.batchId,refs:k,updatedAt:new Date().toISOString()}:void 0;Ze(""),pt(!0);try{const T=await zs(x);if(!T)throw new Error(a("projectQueueNewSessionNeedsProject"));const O=ps,de=Xo(ds,us),rt=Ao(),Ot=await be.createProjectQueueItem(T,{target:{type:"new-session",mode:O,model:m??void 0,thinking:de,showThinking:rt,provider:g??void 0,executor:et??void 0,...ce?{sandboxLevel:Se,...Se==="project-write"?{sandboxNetworkFirewall:Et}:{}}:{},...Vo(U),title:h},message:{text:h,mode:O,...y?{stagedAttachments:y}:{},metadata:{deliveryIntent:"deferred",clientTimestamp:F,composition:{submittedAt:S,typingEndedAt:S}}},createdFrom:{client:"new-session"}});ae.reportProjectQueueCollectionSnapshot(Ot.queue),$t("new-session-project-queued",{projectId:T,mode:O,model:m??null,thinking:de,provider:g??null,executor:et,sandboxLevel:ce?Se:null,sandboxNetworkFirewall:ce?Et:null,textLength:h.length,attachmentCount:k.length,uploadWaitMs:Date.now()-R}),ue([],{persistDraft:!1,revokeRemovedPreviewUrls:!0}),C.clearDraft(),pt(!1),le(a("projectQueueNewSessionQueuedToast"),"success")}catch(T){console.error("Failed to queue project session:",T),C.restoreFromStorage(),pt(!1);const O=T instanceof Error?T.message:String(T);le(a("projectQueueSubmitFailed",{message:O}),"error")}};mn.current=()=>{if(ft.current!==null||Le.current!==null||!He.current)return;const e=qe.current;if(e){qe.current=null,He.current=!1,_s.current=!0;try{if(e.kind==="project-queue"){Gs(e.visibleTextSnapshot);return}nt(e.visibleTextSnapshot)}finally{_s.current=!1}}};const ws=r.useCallback(()=>{mn.current()},[]),fi=e=>{var n,p;if(!St.onKeyDown(e)){if(_c(e)){e.preventDefault(),e.stopPropagation(),io();return}if(Te&&e.key==="Enter"){if(e.nativeEvent.isComposing)return;e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),nt());return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(Pt==="transcribing"||Pt==="finalizing")){e.preventDefault(),e.stopPropagation(),xi();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&((n=X.current)!=null&&n.isListening)){e.preventDefault(),e.stopPropagation(),X.current.toggle();return}if(e.key==="Enter"){if(e.nativeEvent.isComposing)return;if((p=X.current)!=null&&p.isListening){e.preventDefault(),nt();return}if(In&&pn.projectQueue&&qs&&fo&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),Gs();return}if(sc())return;{if(e.ctrlKey||e.shiftKey)return;e.preventDefault(),nt()}}}},mi=e=>{var d;const n=(d=e.clipboardData)==null?void 0:d.items;if(!n)return;const p=[];for(const c of n)if(c.kind==="file"){const h=c.getAsFile();h&&p.push(h)}p.length>0&&(e.preventDefault(),as(p))},hi=r.useCallback(()=>{es.current=!1;const e=Me.current,n=C.getDraft(),p=Math.max(0,Math.min((e==null?void 0:e.selectionStart)??n.length,n.length)),d=Math.max(p,Math.min((e==null?void 0:e.selectionEnd)??p,n.length)),c=Kl(),h=da(p,d);Z.current=c,J.current=h,je.current.set(c,h),mt.current=null,Qe.current=null,Fs.current=!1,e&&(Do(e),e.setSelectionRange(p,d)),$e.current="",Ze("")},[C]),ve=r.useCallback(()=>{const e=Le.current;e!==null&&(clearTimeout(e.timer),Le.current=null)},[]);r.useEffect(()=>ve,[ve]);const Ge=r.useCallback((e,n)=>{var F;const p=e!==void 0,d=Me.current,c=J.current;if(!d||!c)return;const h=d.selectionStart,x=d.selectionEnd,k=S=>h===x?ft.current==="listening"?Lo(S,h,x):sn(S):S.replaceSelectedAtMs===void 0&&S.end===h&&S.replaceEnd===x?S:Lo(S,h,x);h===x&&ve();const V=$e.current.trim().length>0;if(p&&(V||Qe.current!==null)){Qe.current={draft:n??C.getDraft(),start:h,end:x};return}const R=k(c);ft.current==="listening"&&R!==c&&((F=X.current)==null||F.beginInsertionBoundary()),J.current=R,Z.current&&je.current.set(Z.current,R),ss(S=>S+1)},[ve,C]),Ys=r.useCallback(()=>{if(ve(),!J.current)return;const e=sn(J.current);J.current=e,Z.current&&je.current.set(Z.current,e),ss(n=>n+1)},[ve]),gi=r.useCallback(()=>{window.setTimeout(()=>Ge(!0),0)},[Ge]),ot=r.useCallback((e,n)=>{e.trim()&&(n==null?void 0:n.smartTurnCommand)!=="cancel"&&(es.current=!0,ts()),He.current=!0;const p=fa({textareaRef:Me,getDraft:C.getDraft,setDraft:C.setDraft,setInterimTranscript:c=>{$e.current=c,Ze(c)},speechInsertionRangeRef:J,activeSpeechTargetIdRef:Z,speechInsertionRangesRef:je,pendingTextareaSelectionRef:mt,pendingSpeechRetargetRef:Qe,onInsertionBoundary:()=>{var c;return(c=X.current)==null?void 0:c.beginInsertionBoundary()},onSpeechTargetChanged:()=>ss(c=>c+1),onSmartTurnSend:c=>{var h;(h=X.current)==null||h.continueAfterSpeechSend(),nt(c,!0)},composerEditedDuringSpeech:()=>Fs.current},e,n);ws();const d=n==null?void 0:n.speechTargetId;return d&&d!==Z.current&&je.current.delete(d)&&ss(c=>c+1),p},[C,nt,ws,ts]),Si=r.useCallback((e,n)=>{const p=n!=null&&n.speechTargetId?je.current.get(n.speechTargetId)??null:J.current,d=n!=null&&n.smartTurnCommand||Qe.current?0:ia(p);if(d>0){ve();const c=setTimeout(()=>{const h=Le.current;!h||h.timer!==c||(Le.current=null,ot(h.transcript,h.metadata))},d);Le.current={timer:c,transcript:e,metadata:n};return}return ve(),ot(e,n)},[ve,ot]),co=r.useCallback(()=>{const e=Le.current;e!==null&&(clearTimeout(e.timer),Le.current=null,ot(e.transcript,e.metadata))},[ot]),wi=r.useCallback(()=>{const e=Io(C.getDraft(),$e.current,J.current);return co(),e&&ot(e),Qe.current=null,$e.current="",Ze(""),Do(Me.current),!!e},[ot,C,co]),vi=r.useCallback(e=>{$e.current=e,Ze(e)},[]),bi=r.useCallback((e,n)=>{if(n==="failed"?(qe.current=null,He.current=!1):n==="completed"&&(qe.current&&es.current&&ts(),He.current=!0),ft.current=e,e==="listening"&&Ge(),e===null){const p=Z.current;p&&je.current.delete(p),J.current=null,Z.current=null,Qe.current=null}fn(e),e===null&&ws()},[Ge,ws,ts]),xi=r.useCallback(()=>{var n;(n=X.current)==null||n.cancelProcessing(),qe.current=null,He.current=!1,ve();const e=Z.current;e&&je.current.delete(e),J.current=null,Z.current=null,Qe.current=null,fn(null),ft.current=null,Ze("")},[ve]),lo=r.useCallback(e=>{if(!fl(e))return;e.preventDefault(),e.stopPropagation();const n=X.current;n!=null&&n.isAvailable&&n.toggle()},[]),ji=!!(($.trim()||Y.length>0||Pt!==null||Ee||Re)&&_t),uo=!!Pe,po=Y.every(fe),yi=Y.filter(fe).map(js),Mi=Oa({pendingUploadCount:Y.filter(e=>e.kind==="uploading").length,transientAttachmentCount:Y.filter(zt).length,stagedRefs:yi,draftState:C.getAttachmentState()});Ua(Mi);const fo=!!(Er&&qs&&($.trim()||Pt!==null||Ee)&&po&&uo&&_t),Ri=a(po?uo?In?"toolbarProjectQueueTooltipWithShortcut":"toolbarProjectQueueTooltip":"projectQueueNewSessionNeedsProject":"projectQueueNewSessionAttachmentsPreparing"),Ye=Nt&&hn>0&&(yr||(Pt!==null||qe.current!==null)&&(es.current||Ee.trim().length>0))?Nt:null,mo=e=>Ye?a("speechPrefixDeliveryLabel",{action:e,prefix:Ye}):e,ho=e=>Ye?a("speechPrefixDeliveryTooltip",{tooltip:e,prefix:Ye}):e,At=J.current,vs=Io($,Ee,At),Ft=At?aa($,vs,At.end,At.replaceEnd??At.end):ca($,vs,$.length),Ci=r.useCallback(()=>{const e=C.getDraft();return As.current||(As.current=Ql()),{projectId:t,draftKey:ge,clientTurnId:As.current,speechTargetId:Z.current??void 0,textBeforeCursor:la(e,J.current,Me.current)}},[C,t,ge]),go=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`speech-draft-field ${vs?"has-interim":""}`,children:[s.jsxs("div",{className:"speech-draft-inline",children:[vs&&s.jsxs("div",{className:"speech-draft-mirror","aria-hidden":"true",children:[s.jsx("span",{children:Ft.before}),Ft.separatorBefore,s.jsx("span",{className:"speech-interim-inline",children:Ft.transcript}),s.jsx("span",{className:"speech-interim-caret"}),Ft.separatorAfter,s.jsx("span",{children:Ft.after})]}),s.jsx("textarea",{ref:ci,"data-composer-input":!0,value:$,onChange:e=>{const n=St.normalizeInput(e.target.value);if(ve(),je.current.size>0){const p=new Map;for(const[d,c]of je.current)p.set(d,sn(ua($,n,c)));je.current=p,J.current=Z.current!==null?p.get(Z.current)??null:null}Z.current!==null&&ma($,n)&&(Fs.current=!0),Ge(!0,n),ye(n)},onKeyDown:fi,onFocus:St.onFocus,onBlur:St.onBlur,onSelect:()=>{Ge(),St.onSelect()},onPointerUp:Ge,onClick:gi,onKeyUp:Ge,onCut:Ys,onCopy:Ys,onPaste:e=>{Ys(),is&&mi(e)},placeholder:Dr,disabled:A,readOnly:Re,rows:Re?Math.min(v,3):v,className:"new-session-form-textarea"})]}),Ee&&s.jsx("div",{className:"speech-interim-status",role:"status","aria-live":"polite","aria-label":"Tentative speech transcript",children:Ee})]}),s.jsx(zc,{completion:St}),s.jsxs("div",{className:"new-session-form-toolbar",children:[s.jsxs("div",{className:"new-session-form-toolbar-left",children:[is&&s.jsxs(s.Fragment,{children:[s.jsx("input",{ref:Sn,type:"file",multiple:!0,style:{display:"none"},onChange:ui}),s.jsx("button",{type:"button",className:"toolbar-button",onClick:()=>{var e;return(e=Sn.current)==null?void 0:e.click()},disabled:A,"aria-label":a("newSessionAttachFiles"),children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:s.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]}),s.jsx(Ka,{showMethodSelector:ii,methodOptions:no,selectedMethod:wt,onMethodChange:ri,smartTurnSettings:ro,onSmartTurnSettingsChange:oo?Tr:void 0,smartTurnDisabled:A,onBeforeOpen:()=>{var e;(e=X.current)!=null&&e.isListening&&X.current.toggle()},onBeforeCaptureChange:()=>{var e;(e=X.current)!=null&&e.isListening&&X.current.toggle()},onPointerNearTrigger:()=>{var e,n;return(n=(e=X.current)==null?void 0:e.prewarm)==null?void 0:n.call(e)},trigger:s.jsx(uc,{ref:X,onTranscript:Si,onInterimTranscript:vi,onListeningStart:hi,onListeningStop:wi,onPendingSpeechChange:bi,disabled:A,className:"toolbar-button",speechMethod:wt,getTranscriptionContext:Ci,smartTurn:ro})}),g&&(U.model?s.jsx(Kt,{provider:g,model:m??void 0}):Ss.length>0&&s.jsx(on,{triggerVariant:"chip",panelVariant:"model",label:a("newSessionModelTitle"),options:Ss,selected:m?[m]:[],onChange:so,multiSelect:!1,triggerContent:s.jsx(Kt,{provider:g,model:m??void 0}),triggerTitle:a("composerModelChipTitle")})),!me&&!Re&&s.jsx(hl,{expanded:Te,className:`toolbar-button ${te.fullPaneToggle}`,onToggle:()=>{var e;io(),(e=Me.current)==null||e.focus()}})]}),s.jsxs("div",{className:"new-session-form-toolbar-actions",children:[pn.projectQueue&&qs&&s.jsxs("button",{type:"button",onClick:Gs,disabled:A||!fo,className:"send-button project-queue-button new-session-project-queue-button","aria-label":mo(a("toolbarProjectQueueLabel")),title:ho(Ri),children:[s.jsx(Wa,{className:"send-icon",children:"⇥"}),Ye&&s.jsx(Ho,{prefix:Ye})]}),s.jsxs("button",{type:"button",onClick:nt,disabled:A||!ji,className:"send-button new-session-submit-button","aria-label":mo((w==null?void 0:w.startLabel)??a("newSessionStartAction")),title:ho((w==null?void 0:w.startLabel)??a("newSessionStartAction")),children:[A?s.jsx("span",{className:"send-spinner"}):s.jsxs("svg",{className:"send-icon new-session-submit-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M12 19V5"}),s.jsx("path",{d:"m5 12 7-7 7 7"})]}),!A&&Ye&&s.jsx(Ho,{prefix:Ye})]})]})]}),Y.length>0&&s.jsx("div",{className:te.pendingFilesList,children:Y.map(e=>{const n=jr[e.id],p=Go(e),d=Zc(e),c=tl(e);return s.jsx(tc,{attachmentId:e.id,originalName:p,mimeType:el(e),sizeLabel:n?`${Math.round(n.uploaded/n.total*100)}%`:Ba(d),imageWidth:c==null?void 0:c.width,imageHeight:c==null?void 0:c.height,previewUrl:e.previewUrl,onRemove:A?void 0:()=>di(e.id)},e.id)})})]}),Pi=s.jsxs("div",{ref:wn,className:`new-session-project-chooser ${_e?"expanded":""}`,children:[s.jsxs("div",{className:"new-session-project-controls",children:[s.jsxs("button",{type:"button",className:"new-session-project-summary",onClick:()=>Ie(e=>!e),"aria-expanded":_e,"aria-controls":"new-session-project-panel",children:[s.jsxs("span",{className:"new-session-project-summary-body",children:[s.jsx("span",{className:"new-session-project-summary-title",children:ei}),s.jsx("span",{className:"new-session-project-summary-path",title:Qs,children:Hs?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"new-session-project-summary-path-long",children:a("newSessionProjectDetachedHint")}),s.jsx("span",{className:"new-session-project-summary-path-short",children:a("newSessionProjectDetachedHintShort")})]}):ti})]}),s.jsx("svg",{className:"new-session-project-summary-chevron",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),s.jsxs("label",{className:"new-session-project-inline-field",children:[s.jsx("span",{className:"new-session-project-inline-label",children:a("newSessionProjectPathLabel")}),s.jsx("input",{ref:Rr,type:"text",value:kt,onChange:e=>{os(e.target.value),_e||Ie(!0)},onFocus:()=>Ie(!0),onKeyDown:li,placeholder:a("newSessionProjectPathPlaceholder"),disabled:A,className:"new-session-project-input",spellCheck:!1,list:"new-session-project-options"})]}),s.jsx("datalist",{id:"new-session-project-options",children:Gr})]}),_e&&to&&s.jsxs("div",{id:"new-session-project-panel",className:"new-session-project-panel",children:[s.jsx("p",{className:"new-session-project-field-hint",children:a("newSessionProjectPathHint")}),s.jsx("div",{className:"new-session-project-suggestions",children:to})]})]}),Ni=si&&st?s.jsxs("label",{className:"new-session-workstream-field",children:[s.jsx("span",{className:"new-session-workstream-label",children:a("newSessionWorkstreamLabel")}),s.jsx("select",{className:"new-session-workstream-select",value:Ws??"",onChange:ni,disabled:A,"aria-label":a("newSessionWorkstreamLabel"),children:fs.map(e=>s.jsx("option",{value:e.kind==="main"?"":e.id,children:e.kind==="main"?a("newSessionWorkstreamMain"):e.label},e.id))}),s.jsx("span",{className:"new-session-workstream-path",title:st.path,children:nn(st.path)})]}):null,So=Lr.length>1?s.jsx(Fe,{className:"new-session-provider-section",title:L.provider.title,caption:L.provider.description,showCaption:re,children:s.jsx("div",{className:"provider-options","aria-busy":_r,children:De.map(e=>{const n=e.installed,p=g===e.name;return s.jsxs("button",{type:"button",className:`provider-option ${p?"selected":""} ${n?"":"disabled"}`,onClick:()=>n&&oi(e.name),disabled:A||!n,title:n?!e.authenticated&&!e.enabled?a("newSessionProviderAuthenticationPending",{provider:e.displayName}):void 0:a("newSessionProviderUnavailable",{provider:e.displayName,reason:a("newSessionProviderNotInstalled")}),children:[s.jsx("span",{className:`provider-option-dot provider-${e.name}`}),s.jsxs("div",{className:"provider-option-content",children:[s.jsx("span",{className:"provider-option-label",children:e.displayName}),n?!e.authenticated&&!e.enabled?s.jsx("span",{className:"provider-option-status",children:a("newSessionProviderStatusAuthenticationNeeded")}):null:s.jsx("span",{className:"provider-option-status",children:a("newSessionProviderStatusNotInstalled")})]})]},e.name)})})}):null,wo=g&&Ss.length>0?s.jsx(Fe,{className:"new-session-model-field",title:L.model.title,caption:L.model.description,showCaption:re,children:s.jsx(on,{panelVariant:"model",label:L.model.title,options:Ss,selected:m?[m]:[],onChange:so,multiSelect:!1,placeholder:a("newSessionModelPlaceholder"),fullWidth:!0})}):null,vo=g==="claude-gateway"&&(!Ke.fresh||we.length===0)?s.jsxs("div",{className:"new-session-model-field",children:[s.jsx("h3",{children:L.model.title}),s.jsxs("div",{className:"new-session-provider-catalog-status",role:"status","aria-live":"polite",children:[s.jsx("span",{children:Ke.refreshing?a("newSessionGatewayCatalogLoading"):a("newSessionGatewayCatalogUnavailable")}),s.jsx("button",{type:"button",className:"new-session-provider-catalog-retry",disabled:Ke.refreshing,onClick:()=>void Ke.refresh(),children:a("newSessionGatewayCatalogRetry")})]})]}):null,bo=wo||vo?s.jsxs("div",{className:"new-session-model-section",children:[wo,vo]}):null,ki=s.jsx(Fe,{className:"new-session-helper-section new-session-show-thinking-section",title:L.showThinking.title,caption:L.showThinking.description,showCaption:re,children:s.jsx(lc,{value:Cr,onChange:e=>Pr(e),t:a,showLabel:!1})}),xo=Kr?s.jsx(Fe,{className:"new-session-helper-section new-session-thinking-section",title:L.thinking.title,caption:L.thinking.description,showCaption:re,children:s.jsx(cc,{mode:ds,modeOptions:Bs,onSetMode:e=>{ee.current=!0,B(e)},level:us,effortOptions:ls,onSetEffort:e=>{ee.current=!0,Je(e)},onSetEffortMode:e=>{ee.current=!0,Je(e),B("on")},showThinkingControl:!1,provider:g??void 0,t:a,className:"thinking-controls-panel--inline new-session-thinking-controls"})}):null,Ti=g?s.jsxs(Fe,{className:"new-session-helper-section",title:L.recap.title,caption:Ko(ne,a,Ne),showCaption:re,children:[s.jsx("div",{className:"new-session-helper-options",children:Wr.map(e=>s.jsxs("button",{type:"button",className:`new-session-helper-option ${ne===e?"selected":""}`,onClick:()=>{ee.current=!0,oe(e)},disabled:A||Se==="project-write"&&e==="side-session",title:Ko(e,a,Ne),children:[s.jsx("span",{className:`mode-option-dot recap-${e}`}),s.jsx("span",{children:Or[e]})]},e))}),ne!=="off"&&s.jsx(Za,{value:Ne,disabled:A,className:re?te.captionedRecapDuration:void 0,label:re?Br[ne]:void 0,mode:ne,onCommit:e=>{ee.current=!0,cn(e)}})]}):null,Ei=Vr?s.jsx(Fe,{className:"new-session-helper-section new-session-helper-model-section",title:L.helperModel.title,caption:L.helperModel.description,showCaption:re,children:s.jsx(on,{label:L.helperModel.title,options:qr,selected:[ut],onChange:e=>{ee.current=!0,Ct(e[0]??Qt)},multiSelect:!1,placeholder:a("helperSideModelCheapest"),fullWidth:!0})}):null,_i=g?s.jsx(Fe,{className:"new-session-helper-section",title:L.suggestions.title,caption:zn[lt],showCaption:re,children:s.jsx("div",{className:"new-session-helper-options",children:zr.map(e=>s.jsxs("button",{type:"button",className:`new-session-helper-option ${lt===e?"selected":""}`,onClick:()=>{ee.current=!0,ln(e)},disabled:A,title:zn[e],children:[s.jsx("span",{className:`mode-option-dot suggestion-${e}`}),s.jsx("span",{children:Ur[e]})]},e))})}):null,jo=Hr?s.jsx(Fe,{className:"new-session-mode-section",title:L.permission.title,showCaption:re,children:s.jsx("div",{className:"mode-options",children:Gn.map(e=>s.jsxs("button",{type:"button",className:`mode-option ${ps===e?"selected":""}`,onClick:()=>pi(e),disabled:A,children:[s.jsx("span",{className:`mode-option-dot mode-${e}`}),s.jsxs("div",{className:"mode-option-content",children:[s.jsx("span",{className:"mode-option-label",children:Ar[e]}),s.jsx("span",{className:"mode-option-desc",children:Fr[e]})]})]},e))})}):null,Ii=_n?s.jsxs(Fe,{className:"new-session-helper-section new-session-sandbox-section",title:L.sandbox.title,caption:[L.sandbox.description,L.sandboxFirewall.description].join(" "),showCaption:re,children:[!U.limited&&s.jsxs("label",{className:"settings-item",children:[s.jsx("div",{className:"settings-item-info",children:s.jsx("strong",{children:a("newSessionSandboxLabel")})}),s.jsx("input",{type:"checkbox",checked:Be==="project-write",disabled:A,onChange:e=>{ee.current=!0;const n=e.currentTarget.checked;Rs(n?"project-write":"none"),n&&Yt(!0),n&&ne==="side-session"&&oe("off")},"aria-label":a("newSessionSandboxLabel")})]}),s.jsxs("label",{className:"settings-item",children:[s.jsx("div",{className:"settings-item-info",children:s.jsx("strong",{children:L.sandboxFirewall.title})}),s.jsx("input",{type:"checkbox",checked:Se==="project-write"&&Gt,disabled:A||Se!=="project-write",onChange:e=>{ee.current=!0,Yt(e.currentTarget.checked)},"aria-label":L.sandboxFirewall.title})]})]}):null,yo=U.limited?s.jsx(jl,{lock:U,modelLabel:U.model?((Co=tt.find(e=>e.id===U.model))==null?void 0:Co.name)??null:null,effortLabel:U.effort?Zi(U.effort,q,a):null,sandboxAvailable:ce}):null,Mo=!!(yo||An&&So||Fn&&bo||xo||jo);return me?s.jsx("div",{className:"new-session-form new-session-form-compact",onKeyDownCapture:lo,children:go}):s.jsxs("div",{className:`new-session-form new-session-container${Te?` ${te.fullPane}`:""}${Jt?` ${te.fullPaneWide}`:""}`,"data-composer-full-pane":Te?"true":void 0,onKeyDownCapture:lo,style:Te&&!Jt&&dn?{width:`${dn}px`,maxWidth:"100%"}:void 0,children:[!w&&s.jsx("div",{className:"new-session-header",children:s.jsx("p",{className:"new-session-subtitle",children:a("newSessionHeaderSubtitle")})}),s.jsxs("div",{className:`new-session-top-layout ${te.optionLayout}${Ln?` ${te.optionLayoutWithoutProject}`:""}${Mo?"":` ${te.optionLayoutWithoutProvider}`}`,children:[s.jsx("div",{ref:vn,className:"new-session-main-stack",children:s.jsx("div",{className:`new-session-input-area${Re?` ${te.mutedComposer}`:""}`,"data-composer-shell":"true",children:go})}),!Ln&&s.jsxs("aside",{className:`new-session-project-slot ${te.projectControlsSlot}`,children:[Pi,!w&&ht&&Pe&&s.jsx(Hl,{items:Zn,loading:$s.loading,error:$s.error,onOpenItem:e=>it(`${Vt}/projects?queueItem=${encodeURIComponent(e)}`)}),Ni]}),Mo&&s.jsxs("div",{className:"new-session-provider-slot",children:[yo,An&&So,Fn&&bo,xo,jo]}),s.jsxs("div",{className:`${te.secondaryOptions} ${te.optionsWithCaptionToggle}${_e?` ${te.secondaryOptionsHidden}`:""}`,"data-new-session-secondary-options":"true",children:[s.jsx("button",{type:"button",className:te.captionToggle,"aria-label":a(re?"newSessionHideOptionCaptions":"newSessionShowOptionCaptions"),"aria-pressed":re,title:a(re?"newSessionHideOptionCaptions":"newSessionShowOptionCaptions"),onClick:()=>br(e=>!e),children:s.jsx("span",{"aria-hidden":"true",children:"?"})}),ki,Ti,Ei,_i,Ii,s.jsx(fc,{eligible:Us,selected:Cs,onChange:Sr})]})]}),En&&!Ir&&Wn.length>0&&s.jsxs("div",{className:"new-session-executor-section",children:[s.jsx("h3",{children:a("newSessionRunOnTitle")}),s.jsxs("div",{className:"executor-options",children:[s.jsxs("button",{type:"button",className:`executor-option ${Ps===null?"selected":""}`,onClick:()=>Ns(null),disabled:A,children:[s.jsx("span",{className:"executor-option-dot executor-local"}),s.jsxs("div",{className:"executor-option-content",children:[s.jsx("span",{className:"executor-option-label",children:a("newSessionRunOnLocal")}),s.jsx("span",{className:"executor-option-desc",children:a("newSessionRunOnLocalDesc")})]})]},"local"),Wn.map(e=>s.jsxs("button",{type:"button",className:`executor-option ${Ps===e?"selected":""}`,onClick:()=>Ns(e),disabled:A,children:[s.jsx("span",{className:"executor-option-dot executor-remote"}),s.jsxs("div",{className:"executor-option-content",children:[s.jsx("span",{className:"executor-option-label",children:e}),s.jsx("span",{className:"executor-option-desc",children:a("newSessionRunOnRemoteDesc")})]})]},e))]})]})]})}const rr="__ya_share",zl="ya-incoming-shares",jt="shares",Vl=1;function gr(){return typeof indexedDB>"u"?Promise.reject(new Error("Browser storage is unavailable")):new Promise((t,o)=>{const i=indexedDB.open(zl,Vl);i.onerror=()=>o(i.error),i.onupgradeneeded=()=>{const l=i.result;l.objectStoreNames.contains(jt)||l.createObjectStore(jt,{keyPath:"id"})},i.onsuccess=()=>t(i.result)})}function Gl(t){if(!t||typeof t!="object")return!1;const o=t;return typeof o.id=="string"&&typeof o.createdAt=="number"&&Array.isArray(o.files)&&o.files.every(i=>i&&typeof i=="object"&&i.blob instanceof Blob&&typeof i.name=="string"&&typeof i.type=="string"&&typeof i.lastModified=="number")}async function Yl(t){const o=await gr();return new Promise((i,l)=>{const u=o.transaction(jt,"readonly"),f=u.objectStore(jt);let b;const v=f.get(t);v.onerror=()=>l(v.error),v.onsuccess=()=>{b=v.result},u.onerror=()=>l(u.error),u.onabort=()=>l(u.error),u.oncomplete=()=>{if(o.close(),!Gl(b)){i([]);return}i(b.files.map(M=>new File([M.blob],M.name,{type:M.type,lastModified:M.lastModified})))}}).finally(()=>o.close())}async function Xl(t){const o=await gr();return new Promise((i,l)=>{const u=o.transaction(jt,"readwrite"),f=u.objectStore(jt).delete(t);f.onerror=()=>l(f.error),u.onerror=()=>l(u.error),u.onabort=()=>l(u.error),u.oncomplete=()=>i()}).finally(()=>o.close())}function Lu(t,o={}){const{enabled:i=!0,onError:l}=o,u=Fi(),f=ir(),b=r.useRef(t),v=r.useRef(l),M=r.useRef(null);b.current=t,v.current=l;const Q=new URLSearchParams(u.search).get(rr);r.useEffect(()=>{if(!i||!Q||M.current===Q)return;M.current=Q;let I=!0;const he=()=>{const W=new URLSearchParams(u.search);W.delete(rr);const H=W.toString();f({pathname:u.pathname,search:H?`?${H}`:"",hash:u.hash},{replace:!0,state:u.state})};return(async()=>{var W;try{const H=await Yl(Q);if(!I)return;if(H.length===0)throw new Error("The shared image is no longer available");if(await b.current(H),!I)return;await Xl(Q),I&&he()}catch(H){if(!I)return;const se=H instanceof Error?H:new Error("The shared image could not be attached");(W=v.current)==null||W.call(v,se),he()}})(),()=>{I=!1}},[i,u.hash,u.pathname,u.search,u.state,f,Q])}function Du(t,o){be.recordVisit(t,o).catch(i=>{console.error("Failed to record session visit:",i)})}function Au(t={}){const{limit:o}=t,[i,l]=r.useState([]),[u,f]=r.useState(!0),[b,v]=r.useState(null),M=r.useCallback(async()=>{try{const I=await be.getRecents(o);l(I.recents),v(null)}catch(I){v(I instanceof Error?I:new Error("Failed to fetch"))}finally{f(!1)}},[o]);r.useEffect(()=>{M()},[M]);const me=r.useCallback((I,he)=>{l(W=>{const H=W.find(w=>w.sessionId===I),se=W.filter(w=>w.sessionId!==I);return H?[{...H,visitedAt:new Date().toISOString()},...se]:W}),be.recordVisit(I,he).catch(W=>{console.error("Failed to record session visit:",W),M()})},[M]),Q=r.useCallback(()=>{l([]),be.clearRecents().catch(I=>{console.error("Failed to clear recents:",I),M()})},[M]);return{recentSessions:i,isLoading:u,error:b,recordVisit:me,clearRecents:Q,refetch:M}}export{hl as F,Iu as N,zc as P,Au as a,ml as b,Bc as c,Wo as d,Fc as e,Tu as f,Eu as g,_c as h,fl as i,Jc as j,nr as k,Du as l,dl as m,pl as n,rn as o,or as p,Ic as r,_u as s,Lu as u,Yc as w};
@@ -1 +1 @@
1
- import{r as t}from"./index-BUrcmRdN.js";function a(e=30*1e3){const[o,n]=t.useState(()=>Date.now());return t.useEffect(()=>{const r=window.setInterval(()=>{n(Date.now())},e);return()=>window.clearInterval(r)},[e]),o}export{a as u};
1
+ import{r as t}from"./index-umZg0LZ6.js";function a(e=30*1e3){const[o,n]=t.useState(()=>Date.now());return t.useEffect(()=>{const r=window.setInterval(()=>{n(Date.now())},e);return()=>window.clearInterval(r)},[e]),o}export{a as u};
@@ -1 +1 @@
1
- import{f as u,r as o,aw as x}from"./index-BUrcmRdN.js";import{h as b,b as Q}from"./client-sN_tbfxh.js";import{i as W}from"./appHref-ByaEnJGJ.js";import{d as L,c as M}from"./Modal-QUinFhBP.js";import{g as H,b as J}from"./frontendReload-DT6MOpjg.js";const X=L({endpoint:"dev-status"}),j=L({endpoint:"dev-restart-safety"}),Y={status:"idle",blockers:[],canRestartNow:!0,updatedAt:""},z={type:"worker-activity-changed",activeWorkers:0,interruptibleSessionCount:0,queueLength:0,queuedSessionMessageCount:0,hasActiveWork:!1,timestamp:""},G=1e3,Z=3;function O(e){const t=new Map,a=new Set,i=c=>t.get(c)??e,s=(c,f)=>{t.set(c,f);for(const S of Array.from(a))S()};return{get:i,set:s,update:(c,f)=>{s(c,f(i(c)))},subscribe:c=>(a.add(c),()=>{a.delete(c)}),reset:()=>{t.clear(),a.clear()}}}const $={devStatus:null},ee={workerActivity:z,workerActivityLoaded:!1,safeRestart:Y,safeRestartLoaded:!1},y=O($),R=O(ee),te=y.subscribe,ae=R.subscribe;function se(e){return y.get(e)}function ne(e){return R.get(e)}async function re(){return await b("/dev/status")??null}function oe(e,t){const a=y.get(t.sourceKey);a.observedAt!==void 0&&a.observedAt>t.requestStartedAt||y.set(t.sourceKey,{devStatus:e,observedAt:t.requestStartedAt})}function ce(e){return new Promise(t=>{setTimeout(t,e)})}async function ie(){const[e,t]=await Promise.all([b("/status/workers"),b("/dev/safe-restart")]);if(!e)throw new Error("Missing worker activity state");if(!t)throw new Error("Missing safe restart state");return{workerActivity:e,safeRestart:t}}async function de(){let e;for(let t=0;t<=Z;t+=1){t>0&&await ce(G);try{return await ie()}catch(a){e=a}}throw e instanceof Error?e:new Error(String(e))}function ue(e,t){R.update(t.sourceKey,a=>({...a,workerActivity:e.workerActivity,workerActivityLoaded:!0,safeRestart:e.safeRestart,safeRestartLoaded:!0}))}function h(e,t){R.update(e,a=>({...a,safeRestart:t,safeRestartLoaded:!0}))}function fe(e,t){R.update(e,a=>({...a,workerActivity:t,workerActivityLoaded:!0}))}const A=new Map;function le(e){let t=A.get(e);t||(t={retainedCount:0,unsubscribers:[]},A.set(e,t),t.unsubscribers.push(u.on("worker-activity-changed",s=>{fe(e,s)}),u.on("safe-restart-changed",s=>{h(e,s.state)}),u.on("backend-reloaded",()=>{h(e,Y),y.update(e,s=>{var c;return(c=s.devStatus)!=null&&c.backendDirty?{...s,devStatus:{...s.devStatus,backendDirty:!1}}:s})})));const a=t;a.retainedCount+=1;let i=!1;return()=>{if(!i&&(i=!0,a.retainedCount-=1,!(a.retainedCount>0))){for(const s of a.unsubscribers)s();A.delete(e)}}}const F=["reconnect","refresh"],N=0;function Se(e){return u.subscribeConnected(e)}function D(){return u.connected}function Ee(e,t,a={}){return e?t.backend?a.backendReloadSafetyKnown===!1?{backend:!1,frontend:!1}:{backend:!0,frontend:!1}:{backend:!1,frontend:t.frontend}:{backend:!1,frontend:!1}}function be(){const e=Q(),t=o.useCallback(()=>se(e),[e]),a=o.useSyncExternalStore(te,t,t),i=!W(window.location.pathname,"/login");M({sourceKey:e,key:X,bootstrapTier:"supplementary",ready:i,hasData:a.observedAt!==void 0,debounceMs:N,revalidateOn:F,fetcher:re,applySnapshot:oe});const s=a.devStatus;return{sourceKey:e,offLoginRoute:i,devStatus:s,isManualReloadMode:(s==null?void 0:s.noBackendReload)||(s==null?void 0:s.noFrontendReload)}}function ve(){const{sourceKey:e,offLoginRoute:t,devStatus:a,isManualReloadMode:i}=be(),[s,c]=o.useState({backend:!1,frontend:!1}),[f,S]=o.useState({backend:!1,frontend:!1}),[P,T]=o.useState(!1),g=o.useCallback(()=>ne(e),[e]),d=o.useSyncExternalStore(ae,g,g),U=o.useSyncExternalStore(Se,D,D);M({sourceKey:e,key:j,bootstrapTier:"supplementary",enabled:i===!0,ready:t,hasData:d.workerActivityLoaded&&d.safeRestartLoaded,debounceMs:N,revalidateOn:F,fetcher:de,applySnapshot:ue}),o.useEffect(()=>le(e),[e]);const l=o.useCallback(n=>{c(r=>f[n]||r[n]?r:{...r,[n]:!0})},[f]);o.useEffect(()=>{a&&(a.backendDirty?l("backend"):c(n=>n.backend?{...n,backend:!1}:n))},[a,l]);const m=d.safeRestart.status;o.useEffect(()=>{m!=="idle"&&l("backend")},[m,l]),o.useEffect(()=>{const n=H(window.location.href);n&&window.history.replaceState(window.history.state,"",n)},[]),o.useEffect(()=>{const n=[u.on("source-change",r=>{l(r.target)}),u.on("backend-reloaded",()=>{c(r=>({...r,backend:!1})),S(r=>({...r,backend:!1}))})];return()=>{for(const r of n)r()}},[l]);const p=o.useCallback(async()=>{console.log("[ReloadNotifications] Requesting backend reload...");try{await b("/server/restart",{method:"POST"}),console.log("[ReloadNotifications] Reload completed"),c(n=>({...n,backend:!1}))}catch(n){console.log("[ReloadNotifications] Reload error (may be expected):",n)}},[]),k=o.useCallback(async n=>{T(!0);try{const r=await b("/dev/safe-restart",{method:n});r&&h(e,r)}finally{T(!1)}},[e]),q=o.useCallback(()=>k("POST"),[k]),K=o.useCallback(()=>k("DELETE"),[k]),E=o.useCallback(()=>{const n=J(window.location.href,String(Date.now()));window.location.replace(n)},[]),v=o.useCallback(()=>{s.backend?p():s.frontend&&E()},[s,p,E]),B=o.useCallback(n=>{S(r=>({...r,[n]:!0})),c(r=>({...r,[n]:!1}))},[]),I=o.useCallback(()=>{S({backend:!0,frontend:!0}),c({backend:!1,frontend:!1})},[]);o.useEffect(()=>{const n=r=>{r.ctrlKey&&r.shiftKey&&r.key==="R"&&(r.preventDefault(),v())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[v]);const w=d.workerActivity,C=x(w),_=Math.max(0,w.queuedSessionMessageCount??w.queueLength),V=d.workerActivityLoaded&&d.safeRestartLoaded;return{isManualReloadMode:i,pendingReloads:s,connected:U,reloadBackend:p,reloadFrontend:E,reload:v,scheduleSafeRestart:q,cancelSafeRestart:K,dismiss:B,dismissAll:I,workerActivity:w,interruptibleSessionCount:C,queuedSessionMessageCount:_,safeRestartState:d.safeRestart,safeRestartMutating:P,backendReloadSafetyKnown:V,unsafeToRestart:C>0||_>0}}export{Ee as g,ve as u};
1
+ import{f as u,r as o,aw as x}from"./index-umZg0LZ6.js";import{h as b,b as Q}from"./client-Ci_HPGfl.js";import{i as W}from"./appHref-ByaEnJGJ.js";import{d as L,c as M}from"./Modal-ClSjJagX.js";import{g as H,b as J}from"./frontendReload-CBdyvvdy.js";const X=L({endpoint:"dev-status"}),j=L({endpoint:"dev-restart-safety"}),Y={status:"idle",blockers:[],canRestartNow:!0,updatedAt:""},z={type:"worker-activity-changed",activeWorkers:0,interruptibleSessionCount:0,queueLength:0,queuedSessionMessageCount:0,hasActiveWork:!1,timestamp:""},G=1e3,Z=3;function O(e){const t=new Map,a=new Set,i=c=>t.get(c)??e,s=(c,f)=>{t.set(c,f);for(const S of Array.from(a))S()};return{get:i,set:s,update:(c,f)=>{s(c,f(i(c)))},subscribe:c=>(a.add(c),()=>{a.delete(c)}),reset:()=>{t.clear(),a.clear()}}}const $={devStatus:null},ee={workerActivity:z,workerActivityLoaded:!1,safeRestart:Y,safeRestartLoaded:!1},y=O($),R=O(ee),te=y.subscribe,ae=R.subscribe;function se(e){return y.get(e)}function ne(e){return R.get(e)}async function re(){return await b("/dev/status")??null}function oe(e,t){const a=y.get(t.sourceKey);a.observedAt!==void 0&&a.observedAt>t.requestStartedAt||y.set(t.sourceKey,{devStatus:e,observedAt:t.requestStartedAt})}function ce(e){return new Promise(t=>{setTimeout(t,e)})}async function ie(){const[e,t]=await Promise.all([b("/status/workers"),b("/dev/safe-restart")]);if(!e)throw new Error("Missing worker activity state");if(!t)throw new Error("Missing safe restart state");return{workerActivity:e,safeRestart:t}}async function de(){let e;for(let t=0;t<=Z;t+=1){t>0&&await ce(G);try{return await ie()}catch(a){e=a}}throw e instanceof Error?e:new Error(String(e))}function ue(e,t){R.update(t.sourceKey,a=>({...a,workerActivity:e.workerActivity,workerActivityLoaded:!0,safeRestart:e.safeRestart,safeRestartLoaded:!0}))}function h(e,t){R.update(e,a=>({...a,safeRestart:t,safeRestartLoaded:!0}))}function fe(e,t){R.update(e,a=>({...a,workerActivity:t,workerActivityLoaded:!0}))}const A=new Map;function le(e){let t=A.get(e);t||(t={retainedCount:0,unsubscribers:[]},A.set(e,t),t.unsubscribers.push(u.on("worker-activity-changed",s=>{fe(e,s)}),u.on("safe-restart-changed",s=>{h(e,s.state)}),u.on("backend-reloaded",()=>{h(e,Y),y.update(e,s=>{var c;return(c=s.devStatus)!=null&&c.backendDirty?{...s,devStatus:{...s.devStatus,backendDirty:!1}}:s})})));const a=t;a.retainedCount+=1;let i=!1;return()=>{if(!i&&(i=!0,a.retainedCount-=1,!(a.retainedCount>0))){for(const s of a.unsubscribers)s();A.delete(e)}}}const F=["reconnect","refresh"],N=0;function Se(e){return u.subscribeConnected(e)}function D(){return u.connected}function Ee(e,t,a={}){return e?t.backend?a.backendReloadSafetyKnown===!1?{backend:!1,frontend:!1}:{backend:!0,frontend:!1}:{backend:!1,frontend:t.frontend}:{backend:!1,frontend:!1}}function be(){const e=Q(),t=o.useCallback(()=>se(e),[e]),a=o.useSyncExternalStore(te,t,t),i=!W(window.location.pathname,"/login");M({sourceKey:e,key:X,bootstrapTier:"supplementary",ready:i,hasData:a.observedAt!==void 0,debounceMs:N,revalidateOn:F,fetcher:re,applySnapshot:oe});const s=a.devStatus;return{sourceKey:e,offLoginRoute:i,devStatus:s,isManualReloadMode:(s==null?void 0:s.noBackendReload)||(s==null?void 0:s.noFrontendReload)}}function ve(){const{sourceKey:e,offLoginRoute:t,devStatus:a,isManualReloadMode:i}=be(),[s,c]=o.useState({backend:!1,frontend:!1}),[f,S]=o.useState({backend:!1,frontend:!1}),[P,T]=o.useState(!1),g=o.useCallback(()=>ne(e),[e]),d=o.useSyncExternalStore(ae,g,g),U=o.useSyncExternalStore(Se,D,D);M({sourceKey:e,key:j,bootstrapTier:"supplementary",enabled:i===!0,ready:t,hasData:d.workerActivityLoaded&&d.safeRestartLoaded,debounceMs:N,revalidateOn:F,fetcher:de,applySnapshot:ue}),o.useEffect(()=>le(e),[e]);const l=o.useCallback(n=>{c(r=>f[n]||r[n]?r:{...r,[n]:!0})},[f]);o.useEffect(()=>{a&&(a.backendDirty?l("backend"):c(n=>n.backend?{...n,backend:!1}:n))},[a,l]);const m=d.safeRestart.status;o.useEffect(()=>{m!=="idle"&&l("backend")},[m,l]),o.useEffect(()=>{const n=H(window.location.href);n&&window.history.replaceState(window.history.state,"",n)},[]),o.useEffect(()=>{const n=[u.on("source-change",r=>{l(r.target)}),u.on("backend-reloaded",()=>{c(r=>({...r,backend:!1})),S(r=>({...r,backend:!1}))})];return()=>{for(const r of n)r()}},[l]);const p=o.useCallback(async()=>{console.log("[ReloadNotifications] Requesting backend reload...");try{await b("/server/restart",{method:"POST"}),console.log("[ReloadNotifications] Reload completed"),c(n=>({...n,backend:!1}))}catch(n){console.log("[ReloadNotifications] Reload error (may be expected):",n)}},[]),k=o.useCallback(async n=>{T(!0);try{const r=await b("/dev/safe-restart",{method:n});r&&h(e,r)}finally{T(!1)}},[e]),q=o.useCallback(()=>k("POST"),[k]),K=o.useCallback(()=>k("DELETE"),[k]),E=o.useCallback(()=>{const n=J(window.location.href,String(Date.now()));window.location.replace(n)},[]),v=o.useCallback(()=>{s.backend?p():s.frontend&&E()},[s,p,E]),B=o.useCallback(n=>{S(r=>({...r,[n]:!0})),c(r=>({...r,[n]:!1}))},[]),I=o.useCallback(()=>{S({backend:!0,frontend:!0}),c({backend:!1,frontend:!1})},[]);o.useEffect(()=>{const n=r=>{r.ctrlKey&&r.shiftKey&&r.key==="R"&&(r.preventDefault(),v())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[v]);const w=d.workerActivity,C=x(w),_=Math.max(0,w.queuedSessionMessageCount??w.queueLength),V=d.workerActivityLoaded&&d.safeRestartLoaded;return{isManualReloadMode:i,pendingReloads:s,connected:U,reloadBackend:p,reloadFrontend:E,reload:v,scheduleSafeRestart:q,cancelSafeRestart:K,dismiss:B,dismissAll:I,workerActivity:w,interruptibleSessionCount:C,queuedSessionMessageCount:_,safeRestartState:d.safeRestart,safeRestartMutating:P,backendReloadSafetyKnown:V,unsafeToRestart:C>0||_>0}}export{Ee as g,ve as u};
@@ -1 +1 @@
1
- import{r as o}from"./index-BUrcmRdN.js";import{a as p}from"./client-sN_tbfxh.js";import{a as d}from"./frontendReload-DT6MOpjg.js";function y(){const{settings:s,isLoading:u,error:c,updateSetting:r,refetch:n}=d(),t=(s==null?void 0:s.remoteExecutors)??[],i=o.useMemo(()=>c?new Error(c):null,[c]),m=o.useCallback(async e=>{if(!e.trim())return;const a=e.trim();await r("remoteExecutors",[...t.filter(f=>f!==a),a])},[t,r]),l=o.useCallback(async e=>{await r("remoteExecutors",t.filter(a=>a!==e))},[t,r]),x=o.useCallback(async e=>{await r("remoteExecutors",e)},[r]),E=o.useCallback(async e=>p.testRemoteExecutor(e),[]);return{executors:t,loading:u&&s===null,error:i,refetch:n,addExecutor:m,removeExecutor:l,replaceExecutors:x,testExecutor:E}}export{y as u};
1
+ import{r as o}from"./index-umZg0LZ6.js";import{a as p}from"./client-Ci_HPGfl.js";import{a as d}from"./frontendReload-CBdyvvdy.js";function y(){const{settings:s,isLoading:u,error:c,updateSetting:r,refetch:n}=d(),t=(s==null?void 0:s.remoteExecutors)??[],i=o.useMemo(()=>c?new Error(c):null,[c]),m=o.useCallback(async e=>{if(!e.trim())return;const a=e.trim();await r("remoteExecutors",[...t.filter(f=>f!==a),a])},[t,r]),l=o.useCallback(async e=>{await r("remoteExecutors",t.filter(a=>a!==e))},[t,r]),x=o.useCallback(async e=>{await r("remoteExecutors",e)},[r]),E=o.useCallback(async e=>p.testRemoteExecutor(e),[]);return{executors:t,loading:u&&s===null,error:i,refetch:n,addExecutor:m,removeExecutor:l,replaceExecutors:x,testExecutor:E}}export{y as u};
@@ -1 +1 @@
1
- import{r as s,B as y,U as I}from"./index-BUrcmRdN.js";import{b as h,s as T,k as A,r as K}from"./client-sN_tbfxh.js";const O="draft-new-session:",k="fab-draft:";function i(e){return encodeURIComponent(e)}function m(e,t){const r=`${O}${i(e)}`;return t?`${r}:${i(t)}`:r}function H(e){return`${k}${i(e)}`}function M(e){const t=h(),[r,a]=s.useState(()=>g(t,e)),n=s.useCallback(()=>{a(g(t,e))},[e,t]);return s.useEffect(()=>{n()},[n]),s.useEffect(()=>{const c=u=>{S(t,e).includes(u.key??"")&&n()};return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)},[n,e,t]),s.useEffect(()=>{const c=new Set(S(t,e));return T(u=>{c.has(u.storageKey)&&n()})},[n,e,t]),r}function g(e,t){try{return S(e,t).some(r=>{const a=localStorage.getItem(r);return A(a)})}catch{return!1}}function S(e,t){const r=m(e);return t?[r,m(e,t)]:[r]}const w="draft-tool-approval-feedback:",N="draft-question-other:";function p(e,t){return`${w}${i(e)}:${i(t)}`}function C(e,t){return`${N}${i(e)}:${i(t)}`}function D(e){try{return K(localStorage.getItem(e))}catch{return""}}function E(e){try{const t=localStorage.getItem(e);if(!t)return{};const r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function U(e){const t=h(),r=p(t,e),[a,n]=s.useState(()=>D(r));s.useEffect(()=>{n(D(r))},[r]);const c=s.useCallback(o=>{n(o);try{o?localStorage.setItem(r,o):localStorage.removeItem(r)}catch{}},[r]),u=s.useCallback(()=>{n("");try{localStorage.removeItem(r)}catch{}},[r]);return[a,c,u]}function Y(e){const t=h(),r=C(t,e),[a,n]=s.useState(()=>E(r));s.useEffect(()=>{n(E(r))},[r]);const c=s.useCallback((o,f)=>{n(P=>{const l={...P};f?l[o]=f:delete l[o];try{Object.keys(l).length>0?localStorage.setItem(r,JSON.stringify(l)):localStorage.removeItem(r)}catch{}return l})},[r]),u=s.useCallback(()=>{n({});try{localStorage.removeItem(r)}catch{}},[r]);return[a,c,u]}function F(){return typeof window>"u"?null:localStorage.getItem(y.recentProject)}function X(e){typeof window>"u"||localStorage.setItem(y.recentProject,e)}function Q(e,t){var a;const r=F();return r&&e.some(n=>n.id===r)?r:t&&e.some(n=>n.id===t)?t:((a=e[0])==null?void 0:a.id)??null}function W(e){const t=e.match(/\/projects\/([^/]+)/);return t!=null&&t[1]?decodeURIComponent(t[1]):null}function V(e,t){const r=new URLSearchParams(t);return r.get("projectId")||r.get("project")||W(e)}const d=280,_=560,j=56,v=600,$=1100;function b(e,t,r){return Math.min(Math.max(e,t),r)}function R(){if(typeof window>"u")return d;const e=localStorage.getItem(I.sidebarWidth);if(e===null)return d;const t=Number.parseInt(e,10);return Number.isNaN(t)?d:b(t,d,_)}function x(e){localStorage.setItem(I.sidebarWidth,String(e))}function z(){const[e,t]=s.useState(R),[r,a]=s.useState(!1),n=s.useCallback(o=>{const f=b(o,d,_);t(f),x(f)},[]),c=s.useCallback(o=>o>=$,[]),u=s.useCallback(o=>o>=e+v,[e]);return{width:e,setWidth:n,isResizing:r,setIsResizing:a,canShowDesktop:c,canShowExpanded:u}}function J(){return R()}export{$ as D,v as M,j as S,J as a,m as b,H as c,V as d,W as e,d as f,F as g,_ as h,z as i,Y as j,U as k,Q as r,X as s,M as u};
1
+ import{r as s,B as y,U as I}from"./index-umZg0LZ6.js";import{b as h,s as T,k as A,r as K}from"./client-Ci_HPGfl.js";const O="draft-new-session:",k="fab-draft:";function i(e){return encodeURIComponent(e)}function m(e,t){const r=`${O}${i(e)}`;return t?`${r}:${i(t)}`:r}function H(e){return`${k}${i(e)}`}function M(e){const t=h(),[r,a]=s.useState(()=>g(t,e)),n=s.useCallback(()=>{a(g(t,e))},[e,t]);return s.useEffect(()=>{n()},[n]),s.useEffect(()=>{const c=u=>{S(t,e).includes(u.key??"")&&n()};return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)},[n,e,t]),s.useEffect(()=>{const c=new Set(S(t,e));return T(u=>{c.has(u.storageKey)&&n()})},[n,e,t]),r}function g(e,t){try{return S(e,t).some(r=>{const a=localStorage.getItem(r);return A(a)})}catch{return!1}}function S(e,t){const r=m(e);return t?[r,m(e,t)]:[r]}const w="draft-tool-approval-feedback:",N="draft-question-other:";function p(e,t){return`${w}${i(e)}:${i(t)}`}function C(e,t){return`${N}${i(e)}:${i(t)}`}function D(e){try{return K(localStorage.getItem(e))}catch{return""}}function E(e){try{const t=localStorage.getItem(e);if(!t)return{};const r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function U(e){const t=h(),r=p(t,e),[a,n]=s.useState(()=>D(r));s.useEffect(()=>{n(D(r))},[r]);const c=s.useCallback(o=>{n(o);try{o?localStorage.setItem(r,o):localStorage.removeItem(r)}catch{}},[r]),u=s.useCallback(()=>{n("");try{localStorage.removeItem(r)}catch{}},[r]);return[a,c,u]}function Y(e){const t=h(),r=C(t,e),[a,n]=s.useState(()=>E(r));s.useEffect(()=>{n(E(r))},[r]);const c=s.useCallback((o,f)=>{n(P=>{const l={...P};f?l[o]=f:delete l[o];try{Object.keys(l).length>0?localStorage.setItem(r,JSON.stringify(l)):localStorage.removeItem(r)}catch{}return l})},[r]),u=s.useCallback(()=>{n({});try{localStorage.removeItem(r)}catch{}},[r]);return[a,c,u]}function F(){return typeof window>"u"?null:localStorage.getItem(y.recentProject)}function X(e){typeof window>"u"||localStorage.setItem(y.recentProject,e)}function Q(e,t){var a;const r=F();return r&&e.some(n=>n.id===r)?r:t&&e.some(n=>n.id===t)?t:((a=e[0])==null?void 0:a.id)??null}function W(e){const t=e.match(/\/projects\/([^/]+)/);return t!=null&&t[1]?decodeURIComponent(t[1]):null}function V(e,t){const r=new URLSearchParams(t);return r.get("projectId")||r.get("project")||W(e)}const d=280,_=560,j=56,v=600,$=1100;function b(e,t,r){return Math.min(Math.max(e,t),r)}function R(){if(typeof window>"u")return d;const e=localStorage.getItem(I.sidebarWidth);if(e===null)return d;const t=Number.parseInt(e,10);return Number.isNaN(t)?d:b(t,d,_)}function x(e){localStorage.setItem(I.sidebarWidth,String(e))}function z(){const[e,t]=s.useState(R),[r,a]=s.useState(!1),n=s.useCallback(o=>{const f=b(o,d,_);t(f),x(f)},[]),c=s.useCallback(o=>o>=$,[]),u=s.useCallback(o=>o>=e+v,[e]);return{width:e,setWidth:n,isResizing:r,setIsResizing:a,canShowDesktop:c,canShowExpanded:u}}function J(){return R()}export{$ as D,v as M,j as S,J as a,m as b,H as c,V as d,W as e,d as f,F as g,_ as h,z as i,Y as j,U as k,Q as r,X as s,M as u};
@@ -1 +1 @@
1
- import{r,h as t,U as a}from"./index-BUrcmRdN.js";const s=["working-tree","latest-commit"],o="working-tree";function c(e){return s.includes(e)?e:void 0}const n=t(a.sourceControlCleanLanding,o,c);n.read;n.set;function l(){return{sourceControlCleanLanding:r.useSyncExternalStore(n.subscribe,n.read,()=>o),setSourceControlCleanLanding:n.set}}export{l as u};
1
+ import{r,h as t,U as a}from"./index-umZg0LZ6.js";const s=["working-tree","latest-commit"],o="working-tree";function c(e){return s.includes(e)?e:void 0}const n=t(a.sourceControlCleanLanding,o,c);n.read;n.set;function l(){return{sourceControlCleanLanding:r.useSyncExternalStore(n.subscribe,n.read,()=>o),setSourceControlCleanLanding:n.set}}export{l as u};
@@ -1 +1 @@
1
- import{r,g as o,U as t}from"./index-BUrcmRdN.js";const e=o(t.stableToolPreviewRendering,!0);e.set;function s(){return{stableToolPreviewRendering:r.useSyncExternalStore(e.subscribe,e.read,e.read),setStableToolPreviewRendering:e.set}}e.read;export{s as u};
1
+ import{r,g as o,U as t}from"./index-umZg0LZ6.js";const e=o(t.stableToolPreviewRendering,!0);e.set;function s(){return{stableToolPreviewRendering:r.useSyncExternalStore(e.subscribe,e.read,e.read),setStableToolPreviewRendering:e.set}}e.read;export{s as u};
@@ -1 +1 @@
1
- import{r,g as n,U as a}from"./index-BUrcmRdN.js";const e=n(a.sessionLoadingProgress,!0);e.set;function i(){return{sessionLoadingProgressEnabled:r.useSyncExternalStore(e.subscribe,e.read,e.read),setSessionLoadingProgressEnabled:e.set}}e.read;const s=n(a.streamingEnabled,!0),d=s.subscribe;function g(){return{streamingEnabled:r.useSyncExternalStore(s.subscribe,s.read,s.read),setStreamingEnabled:s.set}}const b=s.read;export{i as a,b as g,d as s,g as u};
1
+ import{r,g as n,U as a}from"./index-umZg0LZ6.js";const e=n(a.sessionLoadingProgress,!0);e.set;function i(){return{sessionLoadingProgressEnabled:r.useSyncExternalStore(e.subscribe,e.read,e.read),setSessionLoadingProgressEnabled:e.set}}e.read;const s=n(a.streamingEnabled,!0),d=s.subscribe;function g(){return{streamingEnabled:r.useSyncExternalStore(s.subscribe,s.read,s.read),setStreamingEnabled:s.set}}const b=s.read;export{i as a,b as g,d as s,g as u};
@@ -1 +1 @@
1
- import{r as t,g as a,U as i}from"./index-BUrcmRdN.js";const r={enabled:!1},e=a(i.tabTitleActivityEnabled,r.enabled);function c(){return{tabTitleActivityEnabled:t.useSyncExternalStore(e.subscribe,e.read,e.read),setTabTitleActivityEnabled:e.set}}export{c as u};
1
+ import{r as t,g as a,U as i}from"./index-umZg0LZ6.js";const r={enabled:!1},e=a(i.tabTitleActivityEnabled,r.enabled);function c(){return{tabTitleActivityEnabled:t.useSyncExternalStore(e.subscribe,e.read,e.read),setTabTitleActivityEnabled:e.set}}export{c as u};
@@ -1 +1 @@
1
- import{s as h,i as k,r as s}from"./index-BUrcmRdN.js";import{b as l,h as E}from"./Modal-QUinFhBP.js";function A(t){const r=l(),i=E(r.sourceKey),e=h(i,k.vhostBearerAccess.name),[c,v]=s.useState(),[f,u]=s.useState(),[m,p]=s.useState(0),S=s.useCallback(()=>p(o=>o+1),[]);s.useEffect(()=>{if(!e||!t)return;let o=!1;return r.transport.fetch("/artifacts/vhosts/links").then(({tokens:n})=>{o||(v({source:r.sourceKey,tokens:n}),u(void 0))},n=>{o||u(n instanceof Error?n.message:String(n))}),()=>{o=!0}},[e,t,r,m]);const a=(c==null?void 0:c.source)===r.sourceKey?c.tokens:void 0,d=s.useMemo(()=>t&&(!e||a)?{...t,...e?{accessTokens:a}:{}}:void 0,[t,e,a]);return{supported:e,error:f,refresh:S,config:d}}export{A as u};
1
+ import{s as k,i as l,r as s}from"./index-umZg0LZ6.js";import{b as E,g as h}from"./Modal-ClSjJagX.js";function A(t){const r=E(),i=h(r.sourceKey),e=k(i,l.vhostBearerAccess.name),[c,v]=s.useState(),[f,u]=s.useState(),[m,p]=s.useState(0),S=s.useCallback(()=>p(o=>o+1),[]);s.useEffect(()=>{if(!e||!t)return;let o=!1;return r.transport.fetch("/artifacts/vhosts/links").then(({tokens:n})=>{o||(v({source:r.sourceKey,tokens:n}),u(void 0))},n=>{o||u(n instanceof Error?n.message:String(n))}),()=>{o=!0}},[e,t,r,m]);const a=(c==null?void 0:c.source)===r.sourceKey?c.tokens:void 0,d=s.useMemo(()=>t&&(!e||a)?{...t,...e?{accessTokens:a}:{}}:void 0,[t,e,a]);return{supported:e,error:f,refresh:S,config:d}}export{A as u};
@@ -1 +1 @@
1
- import{r as t,g as o,U as n}from"./index-BUrcmRdN.js";const s=o(n.widerConversationActivityPreviews,!1);function f(){return{widerConversationActivityPreviews:t.useSyncExternalStore(s.subscribe,s.read,s.read),setWiderConversationActivityPreviews:s.set}}function i(){const e=localStorage.getItem(n.funPhrases);return e===null?!0:e==="true"}function l(e){localStorage.setItem(n.funPhrases,String(e))}function v(){const[e,u]=t.useState(i),c=t.useCallback(a=>{u(a),l(a)},[]);return{funPhrasesEnabled:e,setFunPhrasesEnabled:c}}function w(){return i()}const r=o(n.workflowTags,!1);function b(){return{workflowTagsEnabled:t.useSyncExternalStore(r.subscribe,r.read,r.read),setWorkflowTagsEnabled:r.set}}export{b as a,v as b,w as g,f as u};
1
+ import{r as t,g as o,U as n}from"./index-umZg0LZ6.js";const s=o(n.widerConversationActivityPreviews,!1);function f(){return{widerConversationActivityPreviews:t.useSyncExternalStore(s.subscribe,s.read,s.read),setWiderConversationActivityPreviews:s.set}}function i(){const e=localStorage.getItem(n.funPhrases);return e===null?!0:e==="true"}function l(e){localStorage.setItem(n.funPhrases,String(e))}function v(){const[e,u]=t.useState(i),c=t.useCallback(a=>{u(a),l(a)},[]);return{funPhrasesEnabled:e,setFunPhrasesEnabled:c}}function w(){return i()}const r=o(n.workflowTags,!1);function b(){return{workflowTagsEnabled:t.useSyncExternalStore(r.subscribe,r.read,r.read),setWorkflowTagsEnabled:r.set}}export{b as a,v as b,w as g,f as u};