thursday-agent 0.16.0 → 0.17.1

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 (278) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +1 -1
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/api/artifact/route.js +9 -9
  17. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  18. package/.next/server/app/api/bot/memory/files/route.js +3 -3
  19. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/memory/route.js +8 -8
  21. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/route.js +8 -8
  23. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  24. package/.next/server/app/api/bot/thread/[id]/route.js +3 -3
  25. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  26. package/.next/server/app/api/bot/thread/route.js +3 -3
  27. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  28. package/.next/server/app/api/config/route.js.nft.json +1 -1
  29. package/.next/server/app/api/events/route.js.nft.json +1 -1
  30. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  31. package/.next/server/app/api/file/[...path]/route.js +4 -4
  32. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  34. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  35. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  36. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  37. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  38. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  39. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  40. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  41. package/.next/server/app/api/memory/edit/route.js +11 -11
  42. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  43. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  44. package/.next/server/app/api/reach/route.js +11 -11
  45. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  46. package/.next/server/app/api/routine/route.js +7 -7
  47. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  48. package/.next/server/app/api/signins/route.js +5 -5
  49. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  50. package/.next/server/app/api/skills/[source]/[name]/route.js +7 -7
  51. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  52. package/.next/server/app/api/skills/route.js +7 -7
  53. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  54. package/.next/server/app/api/thursday/call/route.js +5 -5
  55. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  56. package/.next/server/app/api/thursday/settings/route.js +5 -5
  57. package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
  58. package/.next/server/app/api/thursday/text/route.js +13 -13
  59. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  60. package/.next/server/app/api/thursday/tool-call/route.js +12 -12
  61. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  62. package/.next/server/app/api/workspace/files/route.js +8 -8
  63. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  64. package/.next/server/app/api/workspace/route.js +9 -9
  65. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  66. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +3 -3
  67. package/.next/server/app/artifact/[...path]/page.js +4 -4
  68. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  69. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  71. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  72. package/.next/server/app/page/server-reference-manifest.json +60 -60
  73. package/.next/server/app/page.js +5 -5
  74. package/.next/server/app/page.js.nft.json +1 -1
  75. package/.next/server/app/page_client-reference-manifest.js +1 -1
  76. package/.next/server/chunks/[root-of-the-server]__00qyw01._.js +1 -1
  77. package/.next/server/chunks/[root-of-the-server]__01ypm_z._.js +3 -0
  78. package/.next/server/chunks/[root-of-the-server]__021dkui._.js +3 -0
  79. package/.next/server/chunks/{[root-of-the-server]__18e65_-._.js → [root-of-the-server]__03xamry._.js} +2 -2
  80. package/.next/server/chunks/[root-of-the-server]__05dp5tr._.js +1 -1
  81. package/.next/server/chunks/[root-of-the-server]__09gdscj._.js +7 -0
  82. package/.next/server/chunks/{[root-of-the-server]__10_7vqz._.js → [root-of-the-server]__0b36yfw._.js} +1 -1
  83. package/.next/server/chunks/{[root-of-the-server]__1gamvcz._.js → [root-of-the-server]__0jzwdg-._.js} +2 -2
  84. package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
  85. package/.next/server/chunks/[root-of-the-server]__0nmust6._.js +5 -0
  86. package/.next/server/chunks/[root-of-the-server]__0svzjwa._.js +7 -0
  87. package/.next/server/chunks/{[root-of-the-server]__16yw3mb._.js → [root-of-the-server]__12m24xl._.js} +1 -1
  88. package/.next/server/chunks/{[root-of-the-server]__1zrwxis._.js → [root-of-the-server]__12tahb4._.js} +1 -1
  89. package/.next/server/chunks/{[root-of-the-server]__1ep-pao._.js → [root-of-the-server]__1_h4hf9._.js} +4 -4
  90. package/.next/server/chunks/{[root-of-the-server]__1-tdj60._.js → [root-of-the-server]__1de1o6m._.js} +2 -2
  91. package/.next/server/chunks/{[root-of-the-server]__1voqqyc._.js → [root-of-the-server]__1ignh6-._.js} +1 -1
  92. package/.next/server/chunks/[root-of-the-server]__1t02-1p._.js +3 -0
  93. package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
  94. package/.next/server/chunks/{[root-of-the-server]__11g20j-._.js → [root-of-the-server]__1yl5l25._.js} +1 -1
  95. package/.next/server/chunks/{[root-of-the-server]__1mbd2w_._.js → [root-of-the-server]__208vmyf._.js} +1 -1
  96. package/.next/server/chunks/{_1mfu9a3._.js → _02lipqs._.js} +1 -1
  97. package/.next/server/chunks/_05sa7xl._.js +1 -1
  98. package/.next/server/chunks/{_1rg5bfd._.js → _074f2ts._.js} +1 -1
  99. package/.next/server/chunks/_07nxi75._.js +37 -37
  100. package/.next/server/chunks/_08354bn._.js +12 -12
  101. package/.next/server/chunks/_08btiir._.js +7 -0
  102. package/.next/server/chunks/_0caua_s._.js +1 -1
  103. package/.next/server/chunks/{_0qoush_._.js → _0gt6cbj._.js} +1 -1
  104. package/.next/server/chunks/_0xygcxs._.js +37 -37
  105. package/.next/server/chunks/{_09c4we8._.js → _17i1lt2._.js} +1 -1
  106. package/.next/server/chunks/_19kea1l._.js +9 -9
  107. package/.next/server/chunks/_1gn2r2q._.js +3 -3
  108. package/.next/server/chunks/{_03niwml._.js → _1ntwp1s._.js} +1 -1
  109. package/.next/server/chunks/_1q6e56i._.js +3 -3
  110. package/.next/server/chunks/{_02fn1o3._.js → _1tkzgtm._.js} +1 -1
  111. package/.next/server/chunks/_1wl2g8_._.js +2 -2
  112. package/.next/server/chunks/{_1w6uf9k._.js → _1y3mnz4._.js} +1 -1
  113. package/.next/server/chunks/features_workspace_workspace_ts_13h82gv._.js +4 -4
  114. package/.next/server/chunks/features_workspace_workspace_ts_1iyjroj._.js +4 -4
  115. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0cux6zt._.js → node_modules_consola_dist_chunks_prompt_mjs_04oxl25._.js} +1 -1
  116. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0w32bqh._.js → node_modules_consola_dist_chunks_prompt_mjs_0g87zst._.js} +1 -1
  117. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_1clmnaj._.js → node_modules_consola_dist_chunks_prompt_mjs_1341cnf._.js} +1 -1
  118. package/.next/server/chunks/ssr/{[root-of-the-server]__02jdtqa._.js → [root-of-the-server]__07660xu._.js} +3 -3
  119. package/.next/server/chunks/ssr/[root-of-the-server]__07iyl1_._.js +3 -0
  120. package/.next/server/chunks/ssr/{[root-of-the-server]__0rnjkw2._.js → [root-of-the-server]__0g__u45._.js} +2 -2
  121. package/.next/server/chunks/ssr/[root-of-the-server]__17h1ggo._.js +1 -1
  122. package/.next/server/chunks/ssr/[root-of-the-server]__1jyeu61._.js +1 -1
  123. package/.next/server/chunks/ssr/_0-i6wdi._.js +3 -0
  124. package/.next/server/chunks/ssr/{_1k0efi3._.js → _00g5sq-._.js} +2 -2
  125. package/.next/server/chunks/ssr/{_0ncuqct._.js → _03akcjz._.js} +2 -2
  126. package/.next/server/chunks/ssr/{_0l1-xc6._.js → _06xy39t._.js} +2 -2
  127. package/.next/server/chunks/ssr/_088vzgn._.js +3 -0
  128. package/.next/server/chunks/ssr/_0fo4552._.js +7 -7
  129. package/.next/server/chunks/ssr/_0r0g9ki._.js +1 -1
  130. package/.next/server/chunks/ssr/{_1dqaksc._.js → _0sefgiu._.js} +2 -2
  131. package/.next/server/chunks/ssr/_0v9r8g2._.js +3 -0
  132. package/.next/server/chunks/ssr/_0x8ophf._.js +1 -1
  133. package/.next/server/chunks/ssr/{_0w8r7o7._.js → _1-41lck._.js} +2 -2
  134. package/.next/server/chunks/ssr/{_11pnnvd._.js → _113ukfo._.js} +3 -3
  135. package/.next/server/chunks/ssr/_12p8f9_._.js +3 -0
  136. package/.next/server/chunks/ssr/{_10fwcz_._.js → _14dfh7a._.js} +2 -2
  137. package/.next/server/chunks/ssr/{_1f6s34p._.js → _1_gwau0._.js} +2 -2
  138. package/.next/server/chunks/ssr/{_0wupyvd._.js → _1hn3szq._.js} +2 -2
  139. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  140. package/.next/server/chunks/ssr/{_17ble8k._.js → _1o7a11b._.js} +3 -3
  141. package/.next/server/chunks/ssr/{_0y28gl3._.js → _1swhm5m._.js} +3 -3
  142. package/.next/server/chunks/ssr/_1uij_rj._.js +1 -1
  143. package/.next/server/chunks/ssr/_1umbr78._.js +1 -1
  144. package/.next/server/chunks/ssr/_1w9w1ok._.js +1 -1
  145. package/.next/server/chunks/ssr/_1wac78_._.js +3 -0
  146. package/.next/server/chunks/ssr/{_1z586yw._.js → _20ywznt._.js} +2 -2
  147. package/.next/server/chunks/ssr/features_0796o8r._.js +1 -1
  148. package/.next/server/chunks/ssr/{features_bot_1k25jdg._.js → features_bot_0j4h9qu._.js} +2 -2
  149. package/.next/server/chunks/ssr/features_bot_1knyan7._.js +3 -0
  150. package/.next/server/chunks/ssr/{features_config_11dpa7r._.js → features_config_1xrlh3l._.js} +3 -3
  151. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  152. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  153. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  154. package/.next/server/chunks/ssr/features_workspace_workspace_ts_1wc7_u_._.js +4 -4
  155. package/.next/server/chunks/ssr/{node_modules_1r5o-bo._.js → node_modules_00kqq8n._.js} +1 -1
  156. package/.next/server/chunks/ssr/{node_modules_0u24mg0._.js → node_modules_04o9dd2._.js} +1 -1
  157. package/.next/server/chunks/ssr/{node_modules_0mark4f._.js → node_modules_05jatne._.js} +1 -1
  158. package/.next/server/chunks/ssr/{node_modules_0bas34k._.js → node_modules_06rkzq5._.js} +1 -1
  159. package/.next/server/chunks/ssr/{node_modules_0y5uubt._.js → node_modules_07w6r9n._.js} +1 -1
  160. package/.next/server/chunks/ssr/{node_modules_0ka8te1._.js → node_modules_08ld3lm._.js} +1 -1
  161. package/.next/server/chunks/ssr/{node_modules_0n1js5k._.js → node_modules_0ft86sp._.js} +1 -1
  162. package/.next/server/chunks/ssr/{node_modules_156m1qh._.js → node_modules_0g0lr19._.js} +1 -1
  163. package/.next/server/chunks/ssr/{node_modules_0bbwe-u._.js → node_modules_0kg-vd-._.js} +1 -1
  164. package/.next/server/chunks/ssr/{node_modules_0x_2io2._.js → node_modules_0nl9i29._.js} +1 -1
  165. package/.next/server/chunks/ssr/{node_modules_18yn_bs._.js → node_modules_0p0xf5f._.js} +1 -1
  166. package/.next/server/chunks/ssr/{node_modules_0-8r9yw._.js → node_modules_0pyepmf._.js} +1 -1
  167. package/.next/server/chunks/ssr/{node_modules_1dzye0n._.js → node_modules_0vg-4fo._.js} +1 -1
  168. package/.next/server/chunks/ssr/{node_modules_1xua-g1._.js → node_modules_0y5upun._.js} +1 -1
  169. package/.next/server/chunks/ssr/{node_modules_1o9n7_n._.js → node_modules_13seln7._.js} +1 -1
  170. package/.next/server/chunks/ssr/{node_modules_1ozyial._.js → node_modules_15vsfpv._.js} +1 -1
  171. package/.next/server/chunks/ssr/{node_modules_0sdjzae._.js → node_modules_17azpeb._.js} +1 -1
  172. package/.next/server/chunks/ssr/{node_modules_1zkzksd._.js → node_modules_1_il5l7._.js} +1 -1
  173. package/.next/server/chunks/ssr/{node_modules_0-ew8f8._.js → node_modules_1aeg65a._.js} +1 -1
  174. package/.next/server/chunks/ssr/{node_modules_0etz1i0._.js → node_modules_1d73q89._.js} +1 -1
  175. package/.next/server/chunks/ssr/{node_modules_0ld7p-1._.js → node_modules_1iq8zjs._.js} +1 -1
  176. package/.next/server/chunks/ssr/{node_modules_138kcrz._.js → node_modules_1mcsva4._.js} +1 -1
  177. package/.next/server/chunks/ssr/{node_modules_0uibk9z._.js → node_modules_1mhg5br._.js} +1 -1
  178. package/.next/server/chunks/ssr/{node_modules_1tj7_9z._.js → node_modules_1mqisle._.js} +1 -1
  179. package/.next/server/chunks/ssr/{node_modules_02uwbwp._.js → node_modules_1va4lz9._.js} +1 -1
  180. package/.next/server/chunks/ssr/{node_modules_097cl9f._.js → node_modules_207ay1p._.js} +1 -1
  181. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_133hjui._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0hefprb._.js} +1 -1
  182. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b3vwd3._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1uuvrfp._.js} +1 -1
  183. package/.next/server/middleware-build-manifest.js +3 -3
  184. package/.next/server/pages/404.html +1 -1
  185. package/.next/server/pages/500.html +1 -1
  186. package/.next/server/server-reference-manifest.js +1 -1
  187. package/.next/server/server-reference-manifest.json +61 -61
  188. package/.next/static/chunks/04toe_3nqfjqt.js +1 -0
  189. package/.next/static/chunks/{245_cp14iz637.js → 0780wmy0_rva8.js} +1 -1
  190. package/.next/static/chunks/{314szf8yer-3n.js → 09opsnra7k4k0.js} +2 -2
  191. package/.next/static/chunks/{42m371fn687r5.js → 0if7xqoj3ysfj.js} +1 -1
  192. package/.next/static/chunks/{0609ejkwuy4sf.js → 1-q6so9vze75d.js} +2 -2
  193. package/.next/static/chunks/{23tx-2paw9qa6.js → 106jbz6qd0c5l.js} +1 -1
  194. package/.next/static/chunks/19wkcgzetkh6-.js +1 -0
  195. package/.next/static/chunks/{39miwvg4k-b2d.js → 1_me_-lnpwdfd.js} +1 -1
  196. package/.next/static/chunks/{2oa4gpkzjtpni.js → 1mkw_05uc8_ft.js} +1 -1
  197. package/.next/static/chunks/1njjf8bfkg4_v.js +1 -0
  198. package/.next/static/chunks/{1ub9obhgfm4jl.js → 25ciqm-ee14nf.js} +1 -1
  199. package/.next/static/chunks/{2xjr5b-yk_h3o.js → 29laj9_xhx0d1.js} +1 -1
  200. package/.next/static/chunks/{2jbjyazqfqyoh.js → 2b306ek_blfp1.js} +1 -1
  201. package/.next/static/chunks/2mpqmpf8wcst1.js +15 -0
  202. package/.next/static/chunks/{3ro66d9dc70bc.js → 2rpyc6mevfhu6.js} +1 -1
  203. package/.next/static/chunks/{0cl_fgkphk1oz.js → 2wj77vx62ng3n.js} +1 -1
  204. package/.next/static/chunks/{3j-l8un0d77v7.js → 2y2v3bk65fdle.js} +3 -3
  205. package/.next/static/chunks/{3vwjs5kq11417.js → 32oho7re_n3dq.js} +1 -1
  206. package/.next/static/chunks/388l-zszwa_jf.js +1 -0
  207. package/.next/static/chunks/{0q4ws7qd21chx.js → 3_s5svfgu9kl_.js} +3 -3
  208. package/.next/static/chunks/3bwrvpjk95_x4.js +1 -0
  209. package/.next/static/chunks/{07vcuxousbmy1.js → 3suz18umxycuk.js} +1 -1
  210. package/.next/static/chunks/{0unonxbajyknw.js → 44n-w1bs83ejz.js} +1 -1
  211. package/README.md +12 -12
  212. package/guide/bots.md +48 -8
  213. package/guide/calls.md +13 -12
  214. package/guide/setup.md +4 -2
  215. package/package.json +1 -1
  216. package/public/sounds/NOTICE +3 -0
  217. package/public/sounds/opening-land.ogg +0 -0
  218. package/public/sounds/opening-rise.ogg +0 -0
  219. package/public/sounds/opening-step-1.ogg +0 -0
  220. package/public/sounds/opening-step-2.ogg +0 -0
  221. package/public/sounds/opening-step-3.ogg +0 -0
  222. package/skills/README.md +3 -0
  223. package/skills/artifact/SKILL.md +6 -5
  224. package/skills/artifact/references/book.md +23 -8
  225. package/skills/artifact/references/deck.md +4 -2
  226. package/skills/artifact/references/document.md +9 -0
  227. package/skills/artifact/references/sheet.md +113 -0
  228. package/skills/artifact/runtime/book/book.css +75 -0
  229. package/skills/artifact/runtime/book/book.html +6 -3
  230. package/skills/artifact/runtime/book/book.js +21 -0
  231. package/skills/artifact/runtime/canvas/canvas.css +1 -1
  232. package/skills/artifact/runtime/canvas/canvas.js +11 -1
  233. package/skills/artifact/runtime/deck/deck.css +164 -1
  234. package/skills/artifact/runtime/deck/deck.js +76 -1
  235. package/skills/artifact/runtime/document/docx.js +631 -0
  236. package/skills/artifact/runtime/document/markdown.mjs +58 -2
  237. package/skills/artifact/runtime/document/quick.css +66 -0
  238. package/skills/artifact/runtime/document/quick.html +1 -0
  239. package/skills/artifact/runtime/document/quick.js +154 -0
  240. package/skills/artifact/runtime/document/word.mjs +65 -0
  241. package/skills/artifact/runtime/sheet/format.mjs +392 -0
  242. package/skills/artifact/runtime/sheet/formula.mjs +755 -0
  243. package/skills/artifact/runtime/sheet/sheet.css +499 -0
  244. package/skills/artifact/runtime/sheet/sheet.html +102 -0
  245. package/skills/artifact/runtime/sheet/sheet.js +1361 -0
  246. package/skills/artifact/runtime/sheet/xlsx.mjs +320 -0
  247. package/skills/artifact/runtime/shell/head.html +1 -1
  248. package/skills/artifact/runtime/shell/shell.css +3 -0
  249. package/skills/artifact/runtime/shell/wear.mjs +47 -1
  250. package/skills/artifact/runtime/vendor/fflate.LICENSE.md +23 -0
  251. package/skills/artifact/runtime/vendor/fflate.mjs +2710 -0
  252. package/skills/artifact/scripts/book.mjs +160 -11
  253. package/skills/artifact/scripts/chart.mjs +229 -11
  254. package/skills/artifact/scripts/document.mjs +29 -2
  255. package/skills/artifact/scripts/spreadsheet.mjs +1165 -0
  256. package/skills/data-report/SKILL.md +8 -1
  257. package/.next/server/chunks/[root-of-the-server]__0aijj66._.js +0 -3
  258. package/.next/server/chunks/[root-of-the-server]__0tvoct-._.js +0 -3
  259. package/.next/server/chunks/[root-of-the-server]__118qjk_._.js +0 -7
  260. package/.next/server/chunks/[root-of-the-server]__1b8tp42._.js +0 -5
  261. package/.next/server/chunks/[root-of-the-server]__1gzcbda._.js +0 -3
  262. package/.next/server/chunks/[root-of-the-server]__1qcn1ti._.js +0 -7
  263. package/.next/server/chunks/_0xx3ryc._.js +0 -7
  264. package/.next/server/chunks/ssr/[root-of-the-server]__1y5_1cv._.js +0 -3
  265. package/.next/server/chunks/ssr/_0-ou1b0._.js +0 -3
  266. package/.next/server/chunks/ssr/_1g48r6t._.js +0 -3
  267. package/.next/server/chunks/ssr/_1u5vsy-._.js +0 -3
  268. package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +0 -3
  269. package/.next/server/chunks/ssr/lib_utils_ts_0_f1xvm._.js +0 -3
  270. package/.next/static/chunks/00d54fcfm-lko.js +0 -1
  271. package/.next/static/chunks/0gjlsu6vrfzod.js +0 -1
  272. package/.next/static/chunks/17yqt1p_svv13.js +0 -1
  273. package/.next/static/chunks/203pbwecfs3tm.js +0 -1
  274. package/.next/static/chunks/3ghvoe_mlljzs.js +0 -15
  275. package/.next/static/chunks/3gn7dubb4-pwy.js +0 -1
  276. /package/.next/static/{RtLRT9EEaGn-OqwpMFdYg → SNCDmWKeIrXB6yqnwzClS}/_buildManifest.js +0 -0
  277. /package/.next/static/{RtLRT9EEaGn-OqwpMFdYg → SNCDmWKeIrXB6yqnwzClS}/_clientMiddlewareManifest.js +0 -0
  278. /package/.next/static/{RtLRT9EEaGn-OqwpMFdYg → SNCDmWKeIrXB6yqnwzClS}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,947627,e=>{"use strict";var t=e.i(843476),n=e.i(647163);e.s(["Table",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,n.cn)("w-full caption-bottom text-sm",e),...r})})},"TableBody",0,function({className:e,...r}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,n.cn)("[&_tr:last-child]:border-0",e),...r})},"TableCell",0,function({className:e,...r}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,n.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0",e),...r})},"TableHead",0,function({className:e,...r}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,n.cn)("h-9 px-2 text-left align-middle font-mono text-[11px] font-normal tracking-[0.1em] whitespace-nowrap text-muted-foreground uppercase [&:has([role=checkbox])]:pr-0",e),...r})},"TableHeader",0,function({className:e,...r}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,n.cn)("[&_tr]:border-b",e),...r})},"TableRow",0,function({className:e,...r}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,n.cn)("border-b border-border/60 transition-colors data-[state=selected]:bg-muted hover:bg-muted/40",e),...r})}])},621285,442466,988027,e=>{"use strict";var t=e.i(843476),n=e.i(24071),r=e.i(867927),i=e.i(482022),l=e.i(657688),a=e.i(271645),s=e.i(798120),o=e.i(167881),u=e.i(630374),d=e.i(683408),c=e.i(671428),f=e.i(947627),m=e.i(41533),p=e.i(616172),h=e.i(95187);let g=(0,h.createServerReference)("7f3121fc646d0a75f62e314461151534a6388fac09",h.callServer,void 0,h.findSourceMapURL,"openFileAction");e.s(["openFileAction",0,g],442466);let x=(0,h.createServerReference)("7fcd5a8bb2806bee334cec73e729c90e26ad83eb5f",h.callServer,void 0,h.findSourceMapURL,"revealFileAction");e.s(["revealFileAction",0,x],988027);let b=(0,h.createServerReference)("7fd1f6e08972507c65d599a7276b77ecf6e44aaf17",h.callServer,void 0,h.findSourceMapURL,"savePageAction");var w=e.i(393080),v=e.i(609856),y=e.i(647163);let j=new Set(["frame","image","audio","video"]);function k(e){let t=(0,p.workspaceRelative)(e);return t?"none"===(0,p.viewKindOf)(t)?{how:"os"}:{how:"dialog",path:t}:{how:"os"}}let _=(0,a.createContext)(null),S={dialog:{prose:"px-5 py-4",block:"px-4 py-3"},page:{prose:"px-5 py-6 sm:px-8",block:"px-5 py-5"},inline:{prose:"pb-3",block:"pb-3"}};function O({kind:e,content:n,truncated:r,where:i="dialog"}){return(0,t.jsxs)(t.Fragment,{children:[null!=r&&(0,t.jsx)(C,{of:r}),(0,t.jsx)(P,{kind:e,content:n,where:i})]})}function C({of:e}){return(0,t.jsxs)("p",{className:"border-b border-border/60 px-5 py-2.5 font-mono text-[11px] text-muted-foreground",children:[`Showing the first ${(0,y.formatBytes)(m.WORKSPACE_VIEW.textMax)} of ${(0,y.formatBytes)(e)}. `,"Open the file itself for the rest."]})}function P({kind:e,content:n,where:r}){let i=S[r];switch(e){case"markdown":return(0,t.jsx)("div",{className:(0,y.cn)("min-w-0 text-sm leading-relaxed",i.prose),children:(0,t.jsx)(d.Markdown,{children:n})});case"csv":return(0,t.jsx)(D,{content:n,className:i.block});case"json":return(0,t.jsx)(L,{text:function(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(n),className:i.block});default:return(0,t.jsx)(L,{text:n,className:i.block})}}function R(e){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[l,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;n(null),i(null),o(null);let t=!1;return fetch(s.queryKey.file(e),{headers:{range:`bytes=0-${m.WORKSPACE_VIEW.textMax-1}`}}).then(async e=>{if(!e.ok)throw Error(await e.text());return{text:await e.text(),of:function(e){let t=e.headers.get("content-range")?.match(/^bytes \d+-(\d+)\/(\d+)$/);if(!t)return null;let[,n,r]=t.map(Number);return n+1<r?r:null}(e)}}).then(({text:e,of:r})=>{t||(n(null===r?e:e.slice(0,e.lastIndexOf("\n")+1||void 0)),o(r))}).catch(e=>!t&&i((0,y.errorToString)(e))),()=>{t=!0}},[e]),{content:t,failure:r,truncated:l}}let N={named:new Map,opened:new Map,showing:new WeakMap,listening:!1},E=e=>{let t=N.named.get(e);return t||(t=crypto.randomUUID(),N.named.set(e,t),N.opened.set(t,e)),{thursday:"host",as:t}};async function M(e){let t=e.source,n=e.data;if(!t||"null"!==e.origin||"string"!=typeof n?.thursday)return;if("hello"===n.thursday){let e=N.showing.get(t);e&&t.postMessage(E(e),"*");return}let r="save"===n.thursday&&N.opened.get(n.as);if(!r||"string"!=typeof n.html)return;let i=await b(r,n.html,"string"==typeof n.base?n.base:""),l={as:n.as,id:n.id};t.postMessage((0,w.isResultOk)(i)?i.data.changed?{...l,thursday:"not-saved",changed:!0}:{...l,thursday:"saved",revision:i.data.revision}:{...l,thursday:"not-saved",error:i.message},"*")}function I({path:e,className:n,takeKeys:r}){let i=(0,a.useRef)(null),l=(0,a.useCallback)(()=>{r&&i.current?.focus();let t=i.current?.contentWindow;t&&(N.showing.set(t,e),t.postMessage(E(e),"*"))},[e,r]);return(0,a.useEffect)(l,[l]),(0,a.useEffect)(()=>{N.listening||(N.listening=!0,window.addEventListener("message",M))},[]),(0,t.jsx)("iframe",{ref:i,title:e,src:s.queryKey.file(e),allow:"clipboard-read *; clipboard-write *; fullscreen *; autoplay *",className:n,onLoad:l})}function z({path:e,kind:n,where:r,takeKeys:i}){return"frame"===n?(0,t.jsx)(I,{path:e,className:"h-full w-full bg-white",takeKeys:i}):"image"===n?(0,t.jsx)("img",{src:s.queryKey.file(e),alt:e,className:"dialog"===r?"mx-auto max-h-[calc(100vh-11rem)] object-contain p-4":"mx-auto max-w-full p-6"}):"audio"===n?(0,t.jsx)("audio",{controls:!0,src:s.queryKey.file(e),className:"w-full p-6",children:(0,t.jsx)("track",{kind:"captions"})}):(0,t.jsx)("video",{controls:!0,src:s.queryKey.file(e),className:"mx-auto max-h-full max-w-full p-4",children:(0,t.jsx)("track",{kind:"captions"})})}function T({path:e}){let[n,r]=(0,v.useServerAction)(g);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Nothing here can draw this file. It opens in its own program."}),(0,t.jsx)(o.Button,{variant:"outline",loading:r,onClick:()=>n(e),children:"Open it"})]})}function $({path:e,bytes:n}){let[r,i]=(0,v.useServerAction)(x);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:[`This file is ${(0,y.formatBytes)(n)} — too big to draw here without `,"taking the window with it. Open it where it is instead."]}),(0,t.jsx)(o.Button,{variant:"outline",loading:i,onClick:()=>r(e),children:"Reveal in the file manager"})]})}function A({path:e,opening:d,group:f=[],kind:p,byHer:h,onPath:g,onClose:x}){let b="image"===p,w=j.has(p),{content:v,failure:k,truncated:_}=R(w?null:e),S=e?.split("/").pop()??"",C=e?f.indexOf(e):-1,P=e=>{!(C<0)&&g&&g(f[(C+e+f.length)%f.length])},{left:N,keep:E}=function(e,t){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(t);i.current=t;let l=(0,a.useRef)(()=>void 0);return(0,a.useEffect)(()=>{if(!e)return void r(null);let t=Math.round(m.WORKSPACE_VIEW.autoCloseMs/1e3);r(t);let n=()=>{for(let e of(window.clearInterval(s),["pointermove","keydown","wheel","blur"]))window.removeEventListener(e,a);r(null)},a=()=>n(),s=window.setInterval(()=>{if((t-=1)>0)return r(t);n(),i.current()},1e3);for(let e of["pointermove","keydown","wheel","blur"])window.addEventListener(e,a);return l.current=n,n},[e]),{left:n,keep:(0,a.useCallback)(()=>l.current(),[])}}(h&&null!==e,x),M="frame"===p||"video"===p,I=(0,a.useRef)(null);return(0,t.jsx)(u.Dialog,{open:null!==e,onOpenChange:e=>!e&&x(),children:(0,t.jsxs)(u.DialogContent,{ref:I,initialFocus:I,onKeyDown:e=>{"ArrowLeft"===e.key&&P(-1),"ArrowRight"===e.key&&P(1)},onPointerOver:E,className:(0,y.cn)("flex flex-col gap-0 overflow-hidden p-0",M?"h-[min(42rem,calc(100vh-3rem))] sm:max-w-232":"max-h-[calc(100vh-3rem)] sm:max-w-4xl"),children:[(0,t.jsx)(u.DialogTitle,{className:"sr-only",children:S}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border/60 py-2 pr-12 pl-4",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:e}),null!==N&&(0,t.jsx)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground tabular-nums",children:`Closing in ${N}s`}),C>=0&&f.length>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:[C+1," / ",f.length]}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Previous image",onClick:()=>P(-1),children:(0,t.jsx)(n.ChevronLeft,{})}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Next image",onClick:()=>P(1),children:(0,t.jsx)(r.ChevronRight,{})})]}),e&&(0,t.jsx)("a",{href:s.queryKey.fileView(e),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:(0,y.cn)((0,o.buttonVariants)({variant:"ghost",size:"icon-sm"})),children:(0,t.jsx)(i.ExternalLink,{})})]}),(0,t.jsx)("div",{className:(0,y.cn)("min-h-0 flex-1","frame"===p?"overflow-hidden":"overflow-auto"),children:w&&e?(0,t.jsx)(z,{path:e,kind:p,where:"dialog",takeKeys:!h},d):k?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:k}):null===v?(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(c.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-5/6"})]}):(0,t.jsx)(O,{kind:p,content:v,truncated:_})}),b&&f.length>1&&(0,t.jsx)("div",{className:"flex shrink-0 justify-center gap-1.5 border-t border-border/60 p-2.5",children:f.map(n=>(0,t.jsx)("button",{type:"button","aria-label":n.split("/").pop(),onClick:()=>g?.(n),className:(0,y.cn)("size-11 shrink-0 overflow-hidden rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50",n===e?"ring-2 ring-foreground":"opacity-55"),children:(0,t.jsx)(l.default,{src:s.queryKey.file(n),alt:"",width:96,height:96,loading:"lazy",className:"size-full bg-muted object-cover"})},n))})]})})}function L({text:e,className:n}){return(0,t.jsx)("pre",{className:(0,y.cn)("overflow-x-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-foreground/90",n),children:e})}function D({content:e,className:n}){let[r,...i]=(0,a.useMemo)(()=>(function(e){let t=[],n=[],r="",i=!1;for(let l=0;l<e.length;l++){let a=e[l];i?'"'===a&&'"'===e[l+1]?(r+='"',l++):'"'===a?i=!1:r+=a:'"'===a?i=!0:","===a?(n.push(r),r=""):"\n"===a||"\r"===a?("\r"===a&&"\n"===e[l+1]&&l++,n.push(r),t.push(n),n=[],r=""):r+=a}return(r.length||n.length)&&(n.push(r),t.push(n)),t.filter(e=>e.some(e=>e.trim()))})(e),[e]),l=(0,a.useMemo)(()=>(r??[]).map((e,t)=>i.some(e=>""!==(e[t]??"").trim())&&i.every(e=>{let n=(e[t]??"").trim();return""===n||/^[+-]?[\d,]*\.?\d+%?$/.test(n)})),[r,i]);return r?(0,t.jsx)("div",{className:(0,y.cn)("overflow-x-auto",n),children:(0,t.jsxs)(f.Table,{children:[(0,t.jsx)(f.TableHeader,{children:(0,t.jsx)(f.TableRow,{children:r.map((e,n)=>(0,t.jsx)(f.TableHead,{className:(0,y.cn)("whitespace-nowrap",l[n]&&"text-right"),children:e},`${n}-${e}`))})}),(0,t.jsx)(f.TableBody,{children:i.map((e,n)=>(0,t.jsx)(f.TableRow,{children:r.map((r,i)=>(0,t.jsx)(f.TableCell,{className:(0,y.cn)("whitespace-nowrap",l[i]&&"text-right tabular-nums"),children:e[i]??""},`${n}-${i}`))},`${n}-${e[0]??""}`))})]})}):(0,t.jsx)(L,{text:e,className:n})}e.s(["FileBody",0,O,"FileFrame",0,I,"FileLink",0,function({path:e,group:n,className:r,title:i,label:l,children:o}){let u=k(e),d=(0,a.useContext)(_),[c,f]=(0,v.useServerAction)(g);return(0,t.jsx)("button",{type:"button",disabled:f,title:i??e,"aria-label":l,className:r,onClick:()=>{"dialog"===u.how?d?d(u.path,n):window.open(s.queryKey.fileView(u.path),"_blank"):c(e)},children:o})},"FilePreview",0,function({path:e,bytes:n}){let r=(0,p.viewKindOf)(e),{content:i,failure:l,truncated:a}=R(j.has(r)||"none"===r?null:e);return"none"===r?(0,t.jsx)(T,{path:e}):("frame"===r||"image"===r)&&n>m.WORKSPACE_VIEW.elementMax?(0,t.jsx)($,{path:e,bytes:n}):j.has(r)?(0,t.jsx)(z,{path:e,kind:r,where:"preview"}):l?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===i?(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(c.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-5/6"})]}):(0,t.jsx)(O,{kind:r,content:i,truncated:a})},"FileViewer",0,function({children:e}){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(0),l=(0,a.useCallback)((e,t=[],n=!1)=>r({path:e,group:t,byHer:n,n:++i.current}),[]);return(0,t.jsxs)(_,{value:l,children:[e,(0,t.jsx)(A,{path:n?.path??null,opening:n?.n??0,group:n?.group??[],kind:n?(0,p.viewKindOf)(n.path):"text",byHer:n?.byHer??!1,onPath:e=>r(t=>t&&{...t,path:e}),onClose:()=>r(null)})]})},"fileTarget",0,k,"useFileText",0,R,"useOpenFile",0,function(){let e=(0,a.useContext)(_);return(0,a.useCallback)((t,n=[],r=!1)=>{let i=k(t);return"os"!==i.how&&(e?(e(i.path,n,r),!0):null!==window.open(s.queryKey.fileView(i.path),"_blank"))},[e])}],621285)},616172,e=>{"use strict";var t=e.i(798120),n=e.i(41533);let r=e=>`text/${e}; charset=utf-8`,i={md:{kind:"markdown",mime:r("markdown")},markdown:{kind:"markdown",mime:r("markdown")},csv:{kind:"csv",mime:r("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:r("plain")},log:{kind:"text",mime:r("plain")},html:{kind:"frame",mime:r("html")},htm:{kind:"frame",mime:r("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},docx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},xlsx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},pptx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},css:{kind:"none",mime:r("css")},js:{kind:"none",mime:r("javascript")},woff2:{kind:"none",mime:"font/woff2"}},l=e=>e.split(".").pop()?.toLowerCase()??"",a=new Set(["css","js","woff2"]),s=Object.keys(i).filter(e=>!a.has(e)),o=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])\/?(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${s.join("|")})\b`,"giu"),u=`${n.PATHS.workspace}/`,d=t.queryKey.file("");function c(e){let t=function(e){if(!e.startsWith(d))return e;let t=e.slice(d.length);try{return decodeURIComponent(t)}catch{return t}}(e.trim()),n=t.indexOf(u);return n>=0?t.slice(n+u.length)||null:t.startsWith("/")||/^[A-Za-z]:/.test(t)||t.split("/").includes("..")?null:t||null}let f=e=>e.startsWith(`${n.PATHS.artifacts}/`)&&["md","markdown","html","htm"].includes(l(e));e.s(["extensionOf",0,l,"leadFirst",0,function(e){let t=e.findIndex(f);return t>0?[e[t],...e.filter((e,n)=>n!==t)]:e},"pathsIn",0,function(e){let t=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," ").replace(/\b[a-z][\w+.-]+:(?=\/)/gi," "),n=new Set,r="";for(let[e]of t.matchAll(o)){let t=!e.includes("/"),i=function(e){let t=c(e);if(!t)return null;let[n,...r]=t.split("/");return r.length&&n.includes(".")?null:t}(t?r+e:e);t||(r=i?.slice(0,i.lastIndexOf("/")+1)??""),i&&n.add(i)}return[...n].slice(0,12)},"viewKindOf",0,e=>i[l(e)]?.kind??"none","workspaceRelative",0,c])},325633,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return h},defaultHead:function(){return c}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=e.r(555682),a=e.r(190809),s=e.r(843476),o=a._(e.r(271645)),u=l._(e.r(898879)),d=e.r(742732);function c(){return[(0,s.jsx)("meta",{charSet:"utf-8"},"charset"),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,n,r,i;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,n=new Set,r=new Set,i={},e=>{let l=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let n=e.key.slice(e.key.indexOf("$")+1);t.has(n)?l=!1:t.add(n)}switch(e.type){case"title":case"base":n.has(e.type)?l=!1:n.add(e.type);break;case"meta":for(let t=0,n=m.length;t<n;t++){let n=m[t];if(e.props.hasOwnProperty(n))if("charSet"===n)r.has(n)?l=!1:r.add(n);else{let t=e.props[n],r=i[n]||new Set;("name"!==n||!a)&&r.has(t)?l=!1:(r.add(t),i[n]=r)}}}return l})).reverse().map((e,t)=>{let n=e.key||t;return o.default.cloneElement(e,{key:n})})}let h=function({children:e}){let t=(0,o.useContext)(d.HeadManagerContext);return(0,s.jsx)(u.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},918556,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ImageConfigContext",{enumerable:!0,get:function(){return l}});let r=e.r(555682)._(e.r(271645)),i=e.r(987690),l=r.default.createContext(i.imageConfigDefault)},65856,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(555682)._(e.r(271645)).default.createContext(null)},670965,(e,t,n)=>{"use strict";function r(e,t){let n=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e,t.qualities[0]):n}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"findClosestQuality",{enumerable:!0,get:function(){return r}})},1948,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let r=e.r(670965),i=e.r(543369);function l({config:e,src:t,width:n,quality:a}){let s=(0,i.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,i.getAssetToken)())s=void 0;else{let e=t.indexOf("?");if(-1!==e){let n=new URLSearchParams(t.slice(e+1)),r=n.get("dpl");if(r){s=r,n.delete("dpl");let i=n.toString();t=t.slice(0,e)+(i?"?"+i:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,947627,e=>{"use strict";var t=e.i(843476),n=e.i(647163);e.s(["Table",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,n.cn)("w-full caption-bottom text-sm",e),...r})})},"TableBody",0,function({className:e,...r}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,n.cn)("[&_tr:last-child]:border-0",e),...r})},"TableCell",0,function({className:e,...r}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,n.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0",e),...r})},"TableHead",0,function({className:e,...r}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,n.cn)("h-9 px-2 text-left align-middle font-mono text-[11px] font-normal tracking-[0.1em] whitespace-nowrap text-muted-foreground uppercase [&:has([role=checkbox])]:pr-0",e),...r})},"TableHeader",0,function({className:e,...r}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,n.cn)("[&_tr]:border-b",e),...r})},"TableRow",0,function({className:e,...r}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,n.cn)("border-b border-border/60 transition-colors data-[state=selected]:bg-muted hover:bg-muted/40",e),...r})}])},621285,462032,108096,e=>{"use strict";var t=e.i(843476),n=e.i(24071),r=e.i(867927),i=e.i(482022),l=e.i(657688),a=e.i(271645),s=e.i(798120),o=e.i(167881),u=e.i(630374),d=e.i(683408),c=e.i(671428),f=e.i(947627),m=e.i(41533),p=e.i(616172),h=e.i(95187);let g=(0,h.createServerReference)("7ff2da640de89424d0eed26f1298731920b9a66e81",h.callServer,void 0,h.findSourceMapURL,"openFileAction");e.s(["openFileAction",0,g],462032);let x=(0,h.createServerReference)("7f61bf1735e166fe77b4dd3f611ba92a4b0ea8cf34",h.callServer,void 0,h.findSourceMapURL,"revealFileAction");e.s(["revealFileAction",0,x],108096);let b=(0,h.createServerReference)("7fb876adcee76a50de2d222db1aa2f80504195c3af",h.callServer,void 0,h.findSourceMapURL,"savePageAction");var w=e.i(393080),v=e.i(609856),y=e.i(647163);let j=new Set(["frame","image","audio","video"]);function k(e){let t=(0,p.workspaceRelative)(e);return t?"none"===(0,p.viewKindOf)(t)?{how:"os"}:{how:"dialog",path:t}:{how:"os"}}let _=(0,a.createContext)(null),S={dialog:{prose:"px-5 py-4",block:"px-4 py-3"},page:{prose:"px-5 py-6 sm:px-8",block:"px-5 py-5"},inline:{prose:"pb-3",block:"pb-3"}};function O({kind:e,content:n,truncated:r,where:i="dialog"}){return(0,t.jsxs)(t.Fragment,{children:[null!=r&&(0,t.jsx)(C,{of:r}),(0,t.jsx)(P,{kind:e,content:n,where:i})]})}function C({of:e}){return(0,t.jsxs)("p",{className:"border-b border-border/60 px-5 py-2.5 font-mono text-[11px] text-muted-foreground",children:[`Showing the first ${(0,y.formatBytes)(m.WORKSPACE_VIEW.textMax)} of ${(0,y.formatBytes)(e)}. `,"Open the file itself for the rest."]})}function P({kind:e,content:n,where:r}){let i=S[r];switch(e){case"markdown":return(0,t.jsx)("div",{className:(0,y.cn)("min-w-0 text-sm leading-relaxed",i.prose),children:(0,t.jsx)(d.Markdown,{children:n})});case"csv":return(0,t.jsx)(D,{content:n,className:i.block});case"json":return(0,t.jsx)(L,{text:function(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(n),className:i.block});default:return(0,t.jsx)(L,{text:n,className:i.block})}}function R(e){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[l,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;n(null),i(null),o(null);let t=!1;return fetch(s.queryKey.file(e),{headers:{range:`bytes=0-${m.WORKSPACE_VIEW.textMax-1}`}}).then(async e=>{if(!e.ok)throw Error(await e.text());return{text:await e.text(),of:function(e){let t=e.headers.get("content-range")?.match(/^bytes \d+-(\d+)\/(\d+)$/);if(!t)return null;let[,n,r]=t.map(Number);return n+1<r?r:null}(e)}}).then(({text:e,of:r})=>{t||(n(null===r?e:e.slice(0,e.lastIndexOf("\n")+1||void 0)),o(r))}).catch(e=>!t&&i((0,y.errorToString)(e))),()=>{t=!0}},[e]),{content:t,failure:r,truncated:l}}let N={named:new Map,opened:new Map,showing:new WeakMap,listening:!1},E=e=>{let t=N.named.get(e);return t||(t=crypto.randomUUID(),N.named.set(e,t),N.opened.set(t,e)),{thursday:"host",as:t}};async function M(e){let t=e.source,n=e.data;if(!t||"null"!==e.origin||"string"!=typeof n?.thursday)return;if("hello"===n.thursday){let e=N.showing.get(t);e&&t.postMessage(E(e),"*");return}let r="save"===n.thursday&&N.opened.get(n.as);if(!r||"string"!=typeof n.html)return;let i=await b(r,n.html,"string"==typeof n.base?n.base:""),l={as:n.as,id:n.id};t.postMessage((0,w.isResultOk)(i)?i.data.changed?{...l,thursday:"not-saved",changed:!0}:{...l,thursday:"saved",revision:i.data.revision}:{...l,thursday:"not-saved",error:i.message},"*")}function I({path:e,className:n,takeKeys:r}){let i=(0,a.useRef)(null),l=(0,a.useCallback)(()=>{r&&i.current?.focus();let t=i.current?.contentWindow;t&&(N.showing.set(t,e),t.postMessage(E(e),"*"))},[e,r]);return(0,a.useEffect)(l,[l]),(0,a.useEffect)(()=>{N.listening||(N.listening=!0,window.addEventListener("message",M))},[]),(0,t.jsx)("iframe",{ref:i,title:e,src:s.queryKey.file(e),allow:"clipboard-read *; clipboard-write *; fullscreen *; autoplay *",className:n,onLoad:l})}function z({path:e,kind:n,where:r,takeKeys:i}){return"frame"===n?(0,t.jsx)(I,{path:e,className:"h-full w-full bg-white",takeKeys:i}):"image"===n?(0,t.jsx)("img",{src:s.queryKey.file(e),alt:e,className:"dialog"===r?"mx-auto max-h-[calc(100vh-11rem)] object-contain p-4":"mx-auto max-w-full p-6"}):"audio"===n?(0,t.jsx)("audio",{controls:!0,src:s.queryKey.file(e),className:"w-full p-6",children:(0,t.jsx)("track",{kind:"captions"})}):(0,t.jsx)("video",{controls:!0,src:s.queryKey.file(e),className:"mx-auto max-h-full max-w-full p-4",children:(0,t.jsx)("track",{kind:"captions"})})}function T({path:e}){let[n,r]=(0,v.useServerAction)(g);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Nothing here can draw this file. It opens in its own program."}),(0,t.jsx)(o.Button,{variant:"outline",loading:r,onClick:()=>n(e),children:"Open it"})]})}function $({path:e,bytes:n}){let[r,i]=(0,v.useServerAction)(x);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:[`This file is ${(0,y.formatBytes)(n)} — too big to draw here without `,"taking the window with it. Open it where it is instead."]}),(0,t.jsx)(o.Button,{variant:"outline",loading:i,onClick:()=>r(e),children:"Reveal in the file manager"})]})}function A({path:e,opening:d,group:f=[],kind:p,byHer:h,onPath:g,onClose:x}){let b="image"===p,w=j.has(p),{content:v,failure:k,truncated:_}=R(w?null:e),S=e?.split("/").pop()??"",C=e?f.indexOf(e):-1,P=e=>{!(C<0)&&g&&g(f[(C+e+f.length)%f.length])},{left:N,keep:E}=function(e,t){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(t);i.current=t;let l=(0,a.useRef)(()=>void 0);return(0,a.useEffect)(()=>{if(!e)return void r(null);let t=Math.round(m.WORKSPACE_VIEW.autoCloseMs/1e3);r(t);let n=()=>{for(let e of(window.clearInterval(s),["pointermove","keydown","wheel","blur"]))window.removeEventListener(e,a);r(null)},a=()=>n(),s=window.setInterval(()=>{if((t-=1)>0)return r(t);n(),i.current()},1e3);for(let e of["pointermove","keydown","wheel","blur"])window.addEventListener(e,a);return l.current=n,n},[e]),{left:n,keep:(0,a.useCallback)(()=>l.current(),[])}}(h&&null!==e,x),M="frame"===p||"video"===p,I=(0,a.useRef)(null);return(0,t.jsx)(u.Dialog,{open:null!==e,onOpenChange:e=>!e&&x(),children:(0,t.jsxs)(u.DialogContent,{ref:I,initialFocus:I,onKeyDown:e=>{"ArrowLeft"===e.key&&P(-1),"ArrowRight"===e.key&&P(1)},onPointerOver:E,className:(0,y.cn)("flex flex-col gap-0 overflow-hidden p-0",M?"h-[min(42rem,calc(100vh-3rem))] sm:max-w-232":"max-h-[calc(100vh-3rem)] sm:max-w-4xl"),children:[(0,t.jsx)(u.DialogTitle,{className:"sr-only",children:S}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border/60 py-2 pr-12 pl-4",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:e}),null!==N&&(0,t.jsx)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground tabular-nums",children:`Closing in ${N}s`}),C>=0&&f.length>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:[C+1," / ",f.length]}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Previous image",onClick:()=>P(-1),children:(0,t.jsx)(n.ChevronLeft,{})}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Next image",onClick:()=>P(1),children:(0,t.jsx)(r.ChevronRight,{})})]}),e&&(0,t.jsx)("a",{href:s.queryKey.fileView(e),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:(0,y.cn)((0,o.buttonVariants)({variant:"ghost",size:"icon-sm"})),children:(0,t.jsx)(i.ExternalLink,{})})]}),(0,t.jsx)("div",{className:(0,y.cn)("min-h-0 flex-1","frame"===p?"overflow-hidden":"overflow-auto"),children:w&&e?(0,t.jsx)(z,{path:e,kind:p,where:"dialog",takeKeys:!h},d):k?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:k}):null===v?(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(c.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-5/6"})]}):(0,t.jsx)(O,{kind:p,content:v,truncated:_})}),b&&f.length>1&&(0,t.jsx)("div",{className:"flex shrink-0 justify-center gap-1.5 border-t border-border/60 p-2.5",children:f.map(n=>(0,t.jsx)("button",{type:"button","aria-label":n.split("/").pop(),onClick:()=>g?.(n),className:(0,y.cn)("size-11 shrink-0 overflow-hidden rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50",n===e?"ring-2 ring-foreground":"opacity-55"),children:(0,t.jsx)(l.default,{src:s.queryKey.file(n),alt:"",width:96,height:96,loading:"lazy",className:"size-full bg-muted object-cover"})},n))})]})})}function L({text:e,className:n}){return(0,t.jsx)("pre",{className:(0,y.cn)("overflow-x-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-foreground/90",n),children:e})}function D({content:e,className:n}){let[r,...i]=(0,a.useMemo)(()=>(function(e){let t=[],n=[],r="",i=!1;for(let l=0;l<e.length;l++){let a=e[l];i?'"'===a&&'"'===e[l+1]?(r+='"',l++):'"'===a?i=!1:r+=a:'"'===a?i=!0:","===a?(n.push(r),r=""):"\n"===a||"\r"===a?("\r"===a&&"\n"===e[l+1]&&l++,n.push(r),t.push(n),n=[],r=""):r+=a}return(r.length||n.length)&&(n.push(r),t.push(n)),t.filter(e=>e.some(e=>e.trim()))})(e),[e]),l=(0,a.useMemo)(()=>(r??[]).map((e,t)=>i.some(e=>""!==(e[t]??"").trim())&&i.every(e=>{let n=(e[t]??"").trim();return""===n||/^[+-]?[\d,]*\.?\d+%?$/.test(n)})),[r,i]);return r?(0,t.jsx)("div",{className:(0,y.cn)("overflow-x-auto",n),children:(0,t.jsxs)(f.Table,{children:[(0,t.jsx)(f.TableHeader,{children:(0,t.jsx)(f.TableRow,{children:r.map((e,n)=>(0,t.jsx)(f.TableHead,{className:(0,y.cn)("whitespace-nowrap",l[n]&&"text-right"),children:e},`${n}-${e}`))})}),(0,t.jsx)(f.TableBody,{children:i.map((e,n)=>(0,t.jsx)(f.TableRow,{children:r.map((r,i)=>(0,t.jsx)(f.TableCell,{className:(0,y.cn)("whitespace-nowrap",l[i]&&"text-right tabular-nums"),children:e[i]??""},`${n}-${i}`))},`${n}-${e[0]??""}`))})]})}):(0,t.jsx)(L,{text:e,className:n})}e.s(["FileBody",0,O,"FileFrame",0,I,"FileLink",0,function({path:e,group:n,className:r,title:i,label:l,children:o}){let u=k(e),d=(0,a.useContext)(_),[c,f]=(0,v.useServerAction)(g);return(0,t.jsx)("button",{type:"button",disabled:f,title:i??e,"aria-label":l,className:r,onClick:()=>{"dialog"===u.how?d?d(u.path,n):window.open(s.queryKey.fileView(u.path),"_blank"):c(e)},children:o})},"FilePreview",0,function({path:e,bytes:n}){let r=(0,p.viewKindOf)(e),{content:i,failure:l,truncated:a}=R(j.has(r)||"none"===r?null:e);return"none"===r?(0,t.jsx)(T,{path:e}):("frame"===r||"image"===r)&&n>m.WORKSPACE_VIEW.elementMax?(0,t.jsx)($,{path:e,bytes:n}):j.has(r)?(0,t.jsx)(z,{path:e,kind:r,where:"preview"}):l?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===i?(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(c.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(c.Skeleton,{className:"h-4 w-5/6"})]}):(0,t.jsx)(O,{kind:r,content:i,truncated:a})},"FileViewer",0,function({children:e}){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(0),l=(0,a.useCallback)((e,t=[],n=!1)=>r({path:e,group:t,byHer:n,n:++i.current}),[]);return(0,t.jsxs)(_,{value:l,children:[e,(0,t.jsx)(A,{path:n?.path??null,opening:n?.n??0,group:n?.group??[],kind:n?(0,p.viewKindOf)(n.path):"text",byHer:n?.byHer??!1,onPath:e=>r(t=>t&&{...t,path:e}),onClose:()=>r(null)})]})},"fileTarget",0,k,"useFileText",0,R,"useOpenFile",0,function(){let e=(0,a.useContext)(_);return(0,a.useCallback)((t,n=[],r=!1)=>{let i=k(t);return"os"!==i.how&&(e?(e(i.path,n,r),!0):null!==window.open(s.queryKey.fileView(i.path),"_blank"))},[e])}],621285)},616172,e=>{"use strict";var t=e.i(798120),n=e.i(41533);let r=e=>`text/${e}; charset=utf-8`,i={md:{kind:"markdown",mime:r("markdown")},markdown:{kind:"markdown",mime:r("markdown")},csv:{kind:"csv",mime:r("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:r("plain")},log:{kind:"text",mime:r("plain")},html:{kind:"frame",mime:r("html")},htm:{kind:"frame",mime:r("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},docx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},xlsx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},pptx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},css:{kind:"none",mime:r("css")},js:{kind:"none",mime:r("javascript")},woff2:{kind:"none",mime:"font/woff2"}},l=e=>e.split(".").pop()?.toLowerCase()??"",a=new Set(["css","js","woff2"]),s=Object.keys(i).filter(e=>!a.has(e)),o=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])\/?(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${s.join("|")})\b`,"giu"),u=`${n.PATHS.workspace}/`,d=t.queryKey.file("");function c(e){let t=function(e){if(!e.startsWith(d))return e;let t=e.slice(d.length);try{return decodeURIComponent(t)}catch{return t}}(e.trim()),n=t.indexOf(u);return n>=0?t.slice(n+u.length)||null:t.startsWith("/")||/^[A-Za-z]:/.test(t)||t.split("/").includes("..")?null:t||null}let f=e=>e.startsWith(`${n.PATHS.artifacts}/`)&&["md","markdown","html","htm"].includes(l(e));e.s(["extensionOf",0,l,"leadFirst",0,function(e){let t=e.findIndex(f);return t>0?[e[t],...e.filter((e,n)=>n!==t)]:e},"pathsIn",0,function(e){let t=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," ").replace(/\b[a-z][\w+.-]+:(?=\/)/gi," "),n=new Set,r="";for(let[e]of t.matchAll(o)){let t=!e.includes("/"),i=function(e){let t=c(e);if(!t)return null;let[n,...r]=t.split("/");return r.length&&n.includes(".")?null:t}(t?r+e:e);t||(r=i?.slice(0,i.lastIndexOf("/")+1)??""),i&&n.add(i)}return[...n].slice(0,12)},"viewKindOf",0,e=>i[l(e)]?.kind??"none","workspaceRelative",0,c])},325633,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return h},defaultHead:function(){return c}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=e.r(555682),a=e.r(190809),s=e.r(843476),o=a._(e.r(271645)),u=l._(e.r(898879)),d=e.r(742732);function c(){return[(0,s.jsx)("meta",{charSet:"utf-8"},"charset"),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,n,r,i;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,n=new Set,r=new Set,i={},e=>{let l=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let n=e.key.slice(e.key.indexOf("$")+1);t.has(n)?l=!1:t.add(n)}switch(e.type){case"title":case"base":n.has(e.type)?l=!1:n.add(e.type);break;case"meta":for(let t=0,n=m.length;t<n;t++){let n=m[t];if(e.props.hasOwnProperty(n))if("charSet"===n)r.has(n)?l=!1:r.add(n);else{let t=e.props[n],r=i[n]||new Set;("name"!==n||!a)&&r.has(t)?l=!1:(r.add(t),i[n]=r)}}}return l})).reverse().map((e,t)=>{let n=e.key||t;return o.default.cloneElement(e,{key:n})})}let h=function({children:e}){let t=(0,o.useContext)(d.HeadManagerContext);return(0,s.jsx)(u.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},918556,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ImageConfigContext",{enumerable:!0,get:function(){return l}});let r=e.r(555682)._(e.r(271645)),i=e.r(987690),l=r.default.createContext(i.imageConfigDefault)},65856,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(555682)._(e.r(271645)).default.createContext(null)},670965,(e,t,n)=>{"use strict";function r(e,t){let n=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e,t.qualities[0]):n}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"findClosestQuality",{enumerable:!0,get:function(){return r}})},1948,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let r=e.r(670965),i=e.r(543369);function l({config:e,src:t,width:n,quality:a}){let s=(0,i.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,i.getAssetToken)())s=void 0;else{let e=t.indexOf("?");if(-1!==e){let n=new URLSearchParams(t.slice(e+1)),r=n.get("dpl");if(r){s=r,n.delete("dpl");let i=n.toString();t=t.slice(0,e)+(i?"?"+i:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
2
2
  Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let o=(0,r.findClosestQuality)(a,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${n}&q=${o}${t.startsWith("/")&&s?`&dpl=${s}`:""}`}l.__next_img_default=!0;let a=l},818581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return i}});let r=e.r(271645);function i(e,t){let n=(0,r.useRef)(null),i=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(n.current=l(e,r)),t&&(i.current=l(t,r))},[e,t])}function l(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},605500,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Image",{enumerable:!0,get:function(){return y}});let r=e.r(555682),i=e.r(190809),l=e.r(843476),a=i._(e.r(271645)),s=r._(e.r(174080)),o=r._(e.r(325633)),u=e.r(908927),d=e.r(987690),c=e.r(918556),f=e.r(65856),m=r._(e.r(1948)),p=e.r(818581),h={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[48,96,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,n,r,i,l,a){let s=e?.src;e&&e["data-loaded-src"]!==s&&(e["data-loaded-src"]=s,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),n?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,i=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function x(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b="u"<typeof window?a.useEffect:a.useLayoutEffect,w=(0,a.forwardRef)(({src:e,srcSet:t,sizes:n,height:r,width:i,decoding:s,className:o,style:u,fetchPriority:d,placeholder:c,loading:f,unoptimized:m,fill:h,onLoadRef:w,onLoadingCompleteRef:v,setBlurComplete:y,setShowAltText:j,sizesInput:k,onLoad:_,onError:S,...O},C)=>{let P=(0,a.useRef)(!1),R=(0,a.useRef)(null);b(()=>{let{current:e}=P,{current:t}=R;e||null===t||(S&&(t.src=t.src),t.complete&&g(t,c,w,v,y,m,k),P.current=!0)},[e,c,w,v,S,m,k]);let N=(0,p.useMergedRef)(C,R);return(0,l.jsx)("img",{...O,...x(d),loading:f,width:i,height:r,decoding:s,"data-nimg":h?"fill":"1",className:o,style:u,sizes:n,srcSet:t,src:e,ref:N,onLoad:e=>{g(e.currentTarget,c,w,v,y,m,k)},onError:e=>{j(!0),"empty"!==c&&y(!0),S&&S(e)}})});function v({isAppRouter:e,imgAttributes:t}){let n={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...x(t.fetchPriority)};return e&&s.default.preload?(s.default.preload(t.src,n),null):(0,l.jsx)(o.default,{children:(0,l.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...n},"__nimg-"+t.src+t.srcSet+t.sizes)})}let y=(0,a.forwardRef)((e,t)=>{let n=(0,a.useContext)(f.RouterContext),r=(0,a.useContext)(c.ImageConfigContext),i=(0,a.useMemo)(()=>{let e=h||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t),i=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n,qualities:i,localPatterns:"u"<typeof window?r?.localPatterns:e.localPatterns}},[r]),{onLoad:s,onLoadingComplete:o}=e,p=(0,a.useRef)(s);(0,a.useEffect)(()=>{p.current=s},[s]);let g=(0,a.useRef)(o);(0,a.useEffect)(()=>{g.current=o},[o]);let[x,b]=(0,a.useState)(!1),[y,j]=(0,a.useState)(!1),{props:k,meta:_}=(0,u.getImgProps)(e,{defaultLoader:m.default,imgConf:i,blurComplete:x,showAltText:y});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(w,{...k,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:b,setShowAltText:j,sizesInput:e.sizes,ref:t}),_.preload?(0,l.jsx)(v,{isAppRouter:!n,imgAttributes:k}):null]})});("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},794909,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return d},getImageProps:function(){return u}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=e.r(555682),a=e.r(908927),s=e.r(605500),o=l._(e.r(1948));function u(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[48,96,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let d=s.Image},657688,(e,t,n)=>{t.exports=e.r(794909)},488143,(e,t,n)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:n,blurHeight:i,blurDataURL:l,objectFit:a}){let s=n?40*n:e,o=i?40*i:t,u=s&&o?`viewBox='0 0 ${s} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${u}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${l}'/%3E%3C/svg%3E`}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},987690,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return l},imageConfigDefault:function(){return a}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=["default","imgix","cloudinary","akamai","custom"],a={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},908927,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImgProps",{enumerable:!0,get:function(){return u}});let r=e.r(543369),i=e.r(488143),l=e.r(987690),a=["-moz-initial","fill","none","scale-down",void 0];function s(e){return void 0!==e.default}function o(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:n=!1,priority:d=!1,preload:c=!1,loading:f,className:m,quality:p,width:h,height:g,fill:x=!1,style:b,overrideSrc:w,onLoad:v,onLoadingComplete:y,placeholder:j="empty",blurDataURL:k,fetchPriority:_,decoding:S="async",layout:O,objectFit:C,objectPosition:P,lazyBoundary:R,lazyRoot:N,...E},M){var I;let z,T,$,{imgConf:A,showAltText:L,blurComplete:D,defaultLoader:F}=M,W=A||l.imageConfigDefault;if("allSizes"in W)z=W;else{let e=[...W.deviceSizes,...W.imageSizes].sort((e,t)=>e-t),t=W.deviceSizes.sort((e,t)=>e-t),n=W.qualities?.sort((e,t)=>e-t);z={...W,allSizes:e,deviceSizes:t,qualities:n}}if(void 0===F)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let K=E.loader||F;delete E.loader,delete E.srcSet;let q="__next_img_default"in K;if(q){if("custom"===z.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
3
3
  Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=K;K=t=>{let{config:n,...r}=t;return e(r)}}if(O){"fill"===O&&(x=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[O];e&&(b={...b,...e});let n={responsive:"100vw",fill:"100vw"}[O];n&&!t&&(t=n)}let B="",U=o(h),V=o(g);if((I=e)&&"object"==typeof I&&(s(I)||void 0!==I.src)){let t=s(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(T=t.blurWidth,$=t.blurHeight,k=k||t.blurDataURL,B=t.src,!x)if(U||V){if(U&&!V){let e=U/t.width;V=Math.round(t.height*e)}else if(!U&&V){let e=V/t.height;U=Math.round(t.width*e)}}else U=t.width,V=t.height}let H=!d&&!c&&("lazy"===f||void 0===f);(!(e="string"==typeof e?e:B)||e.startsWith("data:")||e.startsWith("blob:"))&&(n=!0,H=!1),z.unoptimized&&(n=!0),q&&!z.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(n=!0);let G=o(p),X=Object.assign(x?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:P}:{},L?{}:{color:"transparent"},b),J=D||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,i.getImageBlurSvg)({widthInt:U,heightInt:V,blurWidth:T,blurHeight:$,blurDataURL:k||"",objectFit:X.objectFit})}")`:`url("${j}")`,Q=a.includes(X.objectFit)?"fill"===X.objectFit?"100% 100%":"cover":X.objectFit,Y=J?{backgroundSize:Q,backgroundPosition:X.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:J}:{},Z=function({config:e,src:t,unoptimized:n,width:i,quality:l,sizes:a,loader:s}){if(n){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,r.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,r.getAssetToken)())e=void 0;else if(e){let n=t.indexOf("?");if(-1!==n){let r=new URLSearchParams(t.slice(n+1));r.get("dpl")||(r.append("dpl",e),t=t.slice(0,n)+"?"+r.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:u}=function({deviceSizes:e,allSizes:t},n,r){if(r){let n=/(^|\s)(1?\d?\d)vw/g,i=[];for(let e;e=n.exec(r);)i.push(parseInt(e[2]));if(i.length){let n=.01*Math.min(...i);return{widths:t.filter(t=>t>=e[0]*n),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof n?{widths:e,kind:"w"}:{widths:[...new Set([n,2*n].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,i,a),d=o.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:o.map((n,r)=>`${s({config:e,src:t,quality:l,width:n})} ${"w"===u?n:r+1}${u}`).join(", "),src:s({config:e,src:t,quality:l,width:o[d]})}}({config:z,src:e,unoptimized:n,width:U,quality:G,sizes:t,loader:K}),ee=H?"lazy":f;return{props:{...E,loading:ee,fetchPriority:_,width:U,height:V,decoding:S,className:m,style:{...X,...Y},sizes:Z.sizes,srcSet:Z.srcSet,src:w||Z.src},meta:{unoptimized:n,preload:c||d,placeholder:j,fill:x}}}},898879,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return s}});let r=e.r(271645),i="u"<typeof window,l=i?()=>{}:r.useLayoutEffect,a=i?()=>{}:r.useEffect;function s(e){let{headManager:t,reduceComponentsToState:n}=e;function s(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(e))}}return i&&(t?.mountedInstances?.add(e.children),s()),l(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),l(()=>(t&&(t._pendingUpdate=s),()=>{t&&(t._pendingUpdate=s)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,616816,e=>{"use strict";var t=e.i(843476),r=e.i(375775),a=e.i(689664),n=e.i(263676),l=e.i(271645),i=e.i(798120),s=e.i(167881),o=e.i(23750),h=e.i(41533),u=e.i(968978),c=e.i(149666),d=e.i(265402),f=e.i(609856),m=e.i(283653),p=e.i(647163),g=e.i(670641),y=e.i(992112);function M({provider:e,saved:r,autoFocus:a,dense:n,plain:l,value:i,ready:s,saving:o,onValue:h,onSubmit:c}){return(0,t.jsxs)("div",{className:"space-y-2",children:[!l&&(0,t.jsxs)("span",{className:"flex items-center gap-2 px-0.5 text-muted-foreground",children:[(0,t.jsx)(u.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:(0,p.cn)("font-mono",n?"text-[11px]":"text-[12.5px]"),children:e.label})]}),(0,t.jsx)(w,{provider:e,saved:r,autoFocus:a,dense:n,mark:l,value:i,ready:s,saving:o,onValue:h,onSubmit:c})]})}let x=e=>e?.replace(/…$/,"")??"";function w({provider:e,saved:r,autoFocus:n,dense:l,mark:i,value:h,ready:c,saving:f,onValue:m,onSubmit:g}){var y;let M,b=(y=e.id,M=x(d.TEXT_MODEL_PROVIDERS[y].keyLooks),Object.entries(d.TEXT_MODEL_PROVIDERS).flatMap(([e,t])=>{let r=x(t.keyLooks);return e!==y&&r&&!M.startsWith(r)?[r]:[]})).some(e=>h.trim().startsWith(e));return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g()},className:(0,p.cn)("flex items-center gap-3 rounded-2xl border bg-muted/40 px-4 transition-colors",l?"h-11 rounded-xl px-3":"h-14",r||c?"border-foreground bg-transparent":"border-border"),children:[i&&(0,t.jsx)(u.ProviderIcon,{provider:e.id,className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsx)(o.Input,{autoFocus:n,type:"password","aria-label":"OpenAI API key",autoComplete:"off",value:h,spellCheck:!1,placeholder:r?"Replace it":"sk-…",onChange:e=>m(e.target.value),className:(0,p.cn)("min-w-0 flex-1 border-0 bg-transparent px-0 font-mono shadow-none focus-visible:ring-0 dark:bg-transparent",l?"h-7 text-[13px]":"h-9 text-[15px]")}),h?(0,t.jsx)(s.Button,{type:"submit",size:"sm",variant:b?"outline":"default",loading:f,disabled:!c,className:(0,p.cn)("shrink-0",l?"h-7 px-3":"h-9 px-4"),children:b?`Not ${e.label}?`:"Save"}):r&&(0,t.jsx)("span",{className:(0,p.cn)("grid shrink-0 animate-in place-items-center rounded-full bg-foreground text-background zoom-in-50 duration-300",l?"size-5":"size-7"),children:(0,t.jsx)(a.Check,{className:l?"size-3":"size-4"})})]})}e.s(["GetKeyLink",0,function(){let e=d.TEXT_MODEL_PROVIDERS[c.LIVE_PROVIDER.id].keysAt;return e?(0,t.jsxs)("a",{href:e,target:"_blank",rel:"noreferrer",className:"flex items-center gap-2.5 text-[13px] font-medium text-foreground no-underline",children:[(0,t.jsxs)("span",{className:"flex h-7.5 shrink-0 items-center gap-1.5 rounded-full bg-muted px-3.5 whitespace-nowrap transition-colors hover:bg-accent",children:["Get a key",(0,t.jsx)(r.ArrowUpRight,{className:"size-3.5"})]}),(0,t.jsx)("span",{className:"truncate font-mono text-[11px] font-normal text-muted-foreground/70",children:e.replace(/^https:\/\//,"")})]}):null},"KeyInput",0,w,"VoiceKeys",0,function({ref:e,autoFocus:r,dense:a=!1,plain:o=!1,onCancel:u,onSaved:d,className:x}){let{data:w}=(0,m.useServerRoute)(i.queryKey.config),[b,v]=(0,l.useState)({}),[k,A]=(0,l.useState)(null),[O,S]=(0,l.useState)(null),[E]=(0,f.useServerAction)(g.setConfigAction,{errorMessage:!1,onError:e=>S(e??"That key was not saved."),onOk:()=>{(0,m.revalidate)(i.queryKey.config),(0,m.revalidate)(i.queryKey.llmModel)}}),_=e=>(b[e]?.trim().length??0)>=h.KEY_MIN,L=async e=>{let t=e.apiKeyName;if(!_(t)||k)return!1;S(null),A(t);try{return await E(t,b[t]),v(e=>({...e,[t]:""})),d?.(e.id),!0}catch{return!1}finally{A(null)}};return(0,l.useImperativeHandle)(e,()=>({pending:()=>_(c.LIVE_PROVIDER.apiKeyName),flush:async()=>!_(c.LIVE_PROVIDER.apiKeyName)||L(c.LIVE_PROVIDER)})),(0,t.jsxs)("div",{className:(0,p.cn)("w-full",a?"space-y-2":"space-y-4",x),children:[a&&!o&&(0,t.jsxs)("div",{className:"flex h-6 items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"px-0.5 font-mono text-[11px] text-muted-foreground",children:"Voice key"}),u&&(0,t.jsx)(s.Button,{type:"button",size:"icon",variant:"ghost","aria-label":"Not now",onClick:u,className:"-my-1 size-6",children:(0,t.jsx)(n.X,{className:"size-3.5"})})]}),(0,t.jsx)(M,{provider:c.LIVE_PROVIDER,saved:(0,y.isConfigSet)(w,c.LIVE_PROVIDER.apiKeyName),autoFocus:r,dense:a,plain:o,value:b[c.LIVE_PROVIDER.apiKeyName]??"",ready:_(c.LIVE_PROVIDER.apiKeyName),saving:k===c.LIVE_PROVIDER.apiKeyName,onValue:e=>{S(null),v(t=>({...t,[c.LIVE_PROVIDER.apiKeyName]:e}))},onSubmit:()=>void L(c.LIVE_PROVIDER)}),O&&(0,t.jsx)("p",{className:(0,p.cn)("px-0.5 leading-5 break-words",a?"text-xs":"text-center text-[13px]",p.WAITING_INK),children:O}),!o&&(0,t.jsx)("p",{className:(0,p.cn)("px-0.5 font-mono text-muted-foreground",a?"text-[11px]":"pt-1 text-center text-[12.5px]"),children:a?"Live voice and reasoning share this OpenAI API key.":"Live uses an OpenAI API key, billed separately from ChatGPT. Stored on this machine, in this app's database."})]})}])},671228,67045,297825,e=>{"use strict";let t,r;var a=e.i(504565),n=e.i(265402),l=e.i(413168);let i=[{id:"chatgpt",...n.TEXT_MODEL_PROVIDERS.chatgpt},{id:"openai",...n.TEXT_MODEL_PROVIDERS.openai}];a.default.object({id:a.default.string().min(1),text:a.default.string(),said:a.default.boolean()});let s="note",o=e=>e.type===`data-${s}`?e.data:null,h={min:3,max:32},u=a.default.object({enabled:a.default.boolean(),phrase:a.default.string().trim().min(h.min).max(h.max)}),c={enabled:!1,phrase:"hey thursday"},d=a.default.object({enabled:a.default.boolean(),combo:a.default.string().trim().min(1).max(64)}),f={enabled:!1,combo:"alt+shift+KeyT"},m=["off","waiting","any"],p=a.default.enum(m),g="waiting",y=["center","sides"],M=a.default.enum(y);a.default.object({id:a.default.string().min(1),role:a.default.enum(["user","assistant","tool"]),tool:a.default.string().nullish(),text:a.default.string(),seq:a.default.number().int().min(0),fragments:a.default.array(l.LiveFragmentSchema).nullish()}),a.default.object({id:a.default.string().min(1),text:a.default.string(),seq:a.default.number().int().min(0)}),e.s(["CALL_BACK_DEFAULT",0,g,"CALL_BACK_LABEL",0,{off:"Never",waiting:"When a job needs me",any:"Whenever a job ends"},"CALL_BACK_MODES",0,m,"CAPTION_VIEWS",0,y,"CallBackSchema",0,p,"CaptionViewSchema",0,M,"HOTKEY_DEFAULT",0,f,"HotkeySchema",0,d,"TEXT_CALL_NOTE",0,s,"WAKE_DEFAULT",0,c,"WAKE_PHRASE",0,h,"WakeSchema",0,u,"isEnglishPhrase",0,e=>/^[a-z0-9\s'.,!?-]+$/i.test(e.trim())&&/[a-z]/i.test(e),"noteOf",0,o,"notesIn",0,e=>e.flatMap(e=>e.parts.flatMap(e=>{let t=o(e);return t?[t]:[]})),"textCallRunsOn",0,e=>i.find(t=>e(t.apiKeyName))?.id??null],671228);var x=e.i(681307),w=e.i(768834);let b=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>b(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>b(t)(e)}}};var v=e.i(149666);let k=x.z.object({wake:u.catch(c),hotkey:d.catch(f),callBack:p.catch(g),captionView:M.catch("sides"),textModel:n.textModelRefSchema.nullable().catch(null)}),A={wake:c,hotkey:f,callBack:g,captionView:"sides",textModel:null},O=(0,w.create)()((t=e=>({...A,carried:null,patch:t=>e(t),carriedDone:()=>e({carried:null})}),r={name:"thursday.settings",version:2,migrate:(e,t)=>t<1&&e&&"object"==typeof e?{...e,webSearch:!0}:e,partialize:e=>({wake:e.wake,hotkey:e.hotkey,callBack:e.callBack,captionView:e.captionView,textModel:e.textModel}),merge:(e,t)=>{let r=k.safeParse(e),a=r.success?r.data:A;return{...t,...a,carried:function(e){if(!e||"object"!=typeof e)return null;let t=[...Object.keys(v.LiveSettingsSchema.shape),"voicePrompt","systemPrompt","model"].filter(t=>t in e);return t.length?Object.fromEntries(t.map(t=>[t,e[t]])):null}(e)}}},(e,a,n)=>{let l,i={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let a=e=>null===e?null:JSON.parse(e,void 0),n=null!=(r=t.getItem(e))?r:null;return n instanceof Promise?n.then(a):a(n)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...r},s=!1,o=0,h=new Set,u=new Set,c=i.storage;if(!c)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),e(...t)});let d=()=>{let e=i.partialize({...a()});return c.setItem(i.name,{state:e,version:i.version})},f=n.setState;n.setState=(e,t)=>(f(e,t),d());let m=t((...t)=>(e(...t),d()));n.getInitialState=()=>m;let p=()=>{var t,r;if(!c)return;let n=++o;s=!1,h.forEach(e=>{var t;return e(null!=(t=a())?t:m)});let f=(null==(r=i.onRehydrateStorage)?void 0:r.call(i,null!=(t=a())?t:m))||void 0;return b(c.getItem.bind(c))(i.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===i.version)return[!1,e.state];else{if(i.migrate){let t=i.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var r;if(n!==o)return;let[s,h]=t;if(e(l=i.merge(h,null!=(r=a())?r:m),!0),s)return d()}).then(()=>{n===o&&(null==f||f(a(),void 0),l=a(),s=!0,u.forEach(e=>e(l)))}).catch(e=>{n===o&&(null==f||f(void 0,e))})};return n.persist={setOptions:e=>{i={...i,...e},e.storage&&(c=e.storage)},clearStorage:()=>{++o,null==c||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:e=>(h.add(e),()=>{h.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},i.skipHydration||p(),l||m}));e.s(["useThursdayStore",0,O],67045);var S=e.i(271645),E=e.i(798120),_=e.i(609856),L=e.i(283653),N=e.i(95187);let R=(0,N.createServerReference)("7f3925a2a0d63922470784ab5cb32d5cc91c1623ed",N.callServer,void 0,N.findSourceMapURL,"seedLiveSettingsAction"),I=(0,N.createServerReference)("7fb6d28b25bd7f622c3369c13d03bf762d02acb340",N.callServer,void 0,N.findSourceMapURL,"setLiveSettingsAction");e.s(["useLiveSettings",0,function(){let{data:e}=(0,L.useServerRoute)(E.queryKey.thursdaySettings),[t]=(0,_.useServerAction)(I,{onOk:()=>(0,L.revalidate)(E.queryKey.thursdaySettings)}),r=(0,S.useRef)(e);r.current=e;let a=(0,S.useCallback)(e=>{let a=r.current;a&&t({...a,...e})},[t]);return function(){let e=O(e=>e.carried),t=O(e=>e.carriedDone),[r]=(0,_.useServerAction)(R,{onOk:e=>{e&&(0,L.revalidate)(E.queryKey.thursdaySettings)},errorMessage:!1});(0,S.useEffect)(()=>{e&&(t(),r(e))},[e,t,r])}(),{settings:e,patch:a}}],297825)},561540,377090,732061,298293,387758,333495,e=>{"use strict";var t=e.i(213377);let r={[t.TOOL_NAMES.memory_recall]:"Checking your notes",[t.TOOL_NAMES.memory_create]:"Starting a note",[t.TOOL_NAMES.memory_remember]:"Noting that down",[t.TOOL_NAMES.memory_describe]:"Renaming a note",[t.TOOL_NAMES.memory_forget]:"Forgetting that",[t.TOOL_NAMES.bash]:"Doing it on this computer",[t.TOOL_NAMES.web_search]:"Searching the web",[t.TOOL_NAMES.load_skill]:"Reading how to do this",[t.TOOL_NAMES.look_at]:"Looking at the picture",[t.TOOL_NAMES.make_deck]:"Making the deck",[t.TOOL_NAMES.end_call]:"Ending the call",[t.TOOL_NAMES.routine]:"Checking your routines"};function a(e,t=28){let r=e.trim().replace(/\s+/g," ");if(r.length<=t)return r;let n=r.slice(0,t),l=n.lastIndexOf(" ");return`${(l>t/2?n.slice(0,l):n).trimEnd()}…`}let n=(e,t)=>"string"==typeof e[t]?e[t].trim():"";function l(e){if(!e)return null;try{let t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return t}catch{}return null}let i=new Set([t.TOOL_NAMES.thread_tell,t.TOOL_NAMES.thread_answer,t.TOOL_NAMES.thread_status,t.TOOL_NAMES.thread_show,t.TOOL_NAMES.thread_cancel,t.TOOL_NAMES.thread_seen]);function s(e){return Array.isArray(e)?e.flatMap(e=>e&&"object"==typeof e&&"string"==typeof e.url?[e]:[]):[]}e.s(["reasoningTitle",0,function(e){return/^\s*\*\*(.+?)\*\*/.exec(e)?.[1]?.trim()||null},"searchOf",0,function(e,r){if(e!==t.TOOL_NAMES.web_search)return null;try{let e=JSON.parse(r);return{query:"string"==typeof e.query?e.query:null,sources:s(e.sources)}}catch{return null}},"searchQueryOf",0,function(e){let t=l(e)?.query;return"string"==typeof t&&t.trim()?t.trim():null},"searchSourcesOf",0,function(e){return s(l(e)?.sources)},"startedLabel",0,function(e,r){if(e!==t.TOOL_NAMES.thread_start)return null;try{let e=JSON.parse(r);return"string"==typeof e.label?e.label:null}catch{return null}},"toolBot",0,function(e,r,a,n){let s=l(r);if(!s)return null;if(e===t.TOOL_NAMES.thread_start)return"string"==typeof s.bot&&s.bot.trim()?s.bot.trim():null;if(!i.has(e))return null;let o="string"==typeof s.thread?s.thread.trim():"";if(!o||"all"===o.toLowerCase())return null;let h=o.toLowerCase(),u=a?.find(e=>e.id===o)??a?.find(e=>e.label.toLowerCase()===h);return u?e===t.TOOL_NAMES.thread_answer?u.room.questions[0]?.bot??u.bot:u.bot:function(e){let t=l(e);if(!t)return null;if("string"==typeof t.bot&&t.bot.trim())return t.bot.trim();let r=t.answered;return"string"==typeof r?.bot?r.bot:null}(n)},"toolLine",0,function(e,i,s=null){let o;if(e===t.TOOL_NAMES.tool_search||e===t.TOOL_NAMES.tool_call)return"Reaching a connected service";let h=l(i);return(h&&function(e,r,l){if(e===t.TOOL_NAMES.memory_remember||e===t.TOOL_NAMES.memory_create){let l=n(r,"path"),i=function(e){if(!Array.isArray(e.facts))return null;let t=e.facts.map(e=>e&&"object"==typeof e&&"string"==typeof e.text?e.text.trim():"").filter(Boolean);return t.length?{text:t[0],more:t.length-1}:null}(r),s=e===t.TOOL_NAMES.memory_create?"Starting":"Noting";if(!l)return null;if(!i)return`${s} ${l}`;let o=i.more>0?` (+${i.more})`:"";return`${s} ${l}: ${a(i.text)}${o}`}if(e===t.TOOL_NAMES.memory_recall){let e=n(r,"path");return e?`Checking \xb7 ${e}`:null}if(e===t.TOOL_NAMES.memory_describe){let e=n(r,"path");return e?`Renaming \xb7 ${e}`:null}if(e===t.TOOL_NAMES.bash){let e=n(r,"description")||n(r,"command");return e?`On this computer \xb7 ${a(e,44)}`:null}if(e===t.TOOL_NAMES.load_skill){let e=n(r,"name");return e?`Reading the ${e} skill`:null}if(e===t.TOOL_NAMES.look_at){let e=n(r,"path");return e?`Looking at ${e.split("/").filter(Boolean).at(-1)??""}`:null}if(e===t.TOOL_NAMES.make_deck){let e=n(r,"title");return e?`Making the deck \xb7 ${a(e,44)}`:null}if(e===t.TOOL_NAMES.thread_start){let e=n(r,"bot");return e?`Handing this to ${e}`:"Handing this over"}if(e===t.TOOL_NAMES.web_search){let e=n(r,"query");return e?`Searching \xb7 ${e}`:null}if(e===t.TOOL_NAMES.routine){if("create"===r.action){let e=[n(r,"bot"),function(e){if("string"==typeof e.at&&e.at.length>=16){let[t,r]=e.at.split(" "),[a,n,l]=t.split("-").map(Number),i=new Date(a,n-1,l);if(i.toDateString()===new Date().toDateString())return`once at ${r}`;let s=i.toLocaleDateString("en-US",{month:"short",day:"numeric"});return`once, ${s} ${r}`}return"string"==typeof e.time&&e.time?`daily at ${e.time}`:"number"==typeof e.everyHours?`every ${e.everyHours} hours`:null}(r)].filter(Boolean).join(", ");return e?`Setting a routine \xb7 ${e}`:"Setting a routine"}return"change"===r.action?"Changing a routine":"delete"===r.action?"Deleting a routine":null}let i=n(r,"thread");return e===t.TOOL_NAMES.thread_tell?l?`Telling ${l}`:"Passing that on":e===t.TOOL_NAMES.thread_answer?l?`Answering ${l}`:"Answering that":e===t.TOOL_NAMES.thread_cancel?i?`Stopping ${i}`:"Stopping that":e===t.TOOL_NAMES.thread_seen?i?`Marking ${i} as read`:"Marking that as read":e===t.TOOL_NAMES.thread_show?i?`Opening ${i}`:"Opening that":e===t.TOOL_NAMES.thread_status?i&&"all"!==i.toLowerCase()?`Checking on ${i}`:"Checking on the work":null}(e,h,s))??r[e]??((o=e.indexOf("__"))<=0?null:`Reaching ${e.slice(0,o).replace(/[-_]/g," ")}`)}],561540);var o=e.i(843476),h=e.i(271645),u=e.i(41533),c=e.i(218080),d=e.i(567334);function f(e,t,r){let a=(0|e)*0x165667b1+(0|t)*0x27d4eb2f+(0|r)*0x4bf19f61;return(((a=Math.imul(a^a>>>13,0x4bf19f61))^a>>>16)>>>0)/0x100000000}let m=(e,t,r)=>e+(t-e)*r;function p(e,t,r){let a=Math.floor(e),n=Math.floor(t),l=Math.floor(r),i=e-a,s=t-n,o=r-l,h=i*i*(3-2*i),u=s*s*(3-2*s),c=m(f(a,n,l),f(a+1,n,l),h),d=m(f(a,n+1,l),f(a+1,n+1,l),h),p=m(f(a,n,l+1),f(a+1,n,l+1),h),g=m(f(a,n+1,l+1),f(a+1,n+1,l+1),h);return m(m(c,d,u),m(p,g,u),o*o*(3-2*o))}function g(e,t,r,a=3){let n=0,l=.5,i=0;for(let s=0;s<a;s++)n+=l*p(e,t,r),i+=l,e*=2.03,t*=2.03,r*=1.97,l*=.5;return n/i}function y(e,t,r,a=4){let n=g(e,t,r,2),l=g(e+5.2,t+1.3,r+2.8,2);return g(e+a*n,t+a*l,r,3)}function M(e,t=0){let r=9.2*g(.1*e+3.7*t,3.1+t,1.4,2);return{x:Math.cos(r),y:Math.sin(r),g:.38+.62*Math.max(0,Math.min(1,(g(.11*e+5.3*t,7.7,2.2,3)-.38)*3.2))**1.5}}e.s(["fbm",0,g,"ihash",0,f,"vnoise",0,p,"warp",0,y,"windAt",0,M],377090);let x=2*Math.PI,w=(e,t,r)=>(0,d.smoothstep)(t,t+(r-t)*.3,e)*(1-(0,d.smoothstep)(r-(r-t)*.3,r,e)),b={x:0,y:0,rot:0,yaw:0,pitch:0,spin:0,axis:0,sx:1,sy:1,lidL:1,lidR:1,size:1,gx:0,gy:0},v=(()=>{let e=0;for(let t=0;t<5;t++)e+=Math.exp(-t/1.6);return Array.from({length:5},(t,r)=>Math.exp(-r/1.6)/e)})(),k={now:{wake:!0,sighs:!0,len:0,pose:()=>b},dust:{wake:!0,len:2.4,pose(e,t){let r=t?-1:1,a=.55*(0,d.smoothstep)(.16,.3,e)*Math.exp(-Math.max(0,e-.3)/.55),n=2.5*x*(e-.2),l=.3+.2*(0,d.smoothstep)(.05,.25,e)+.5*(0,d.smoothstep)(1.35,1.75,e),i=w(e,1.45,2.4);return{...b,yaw:r*a*Math.sin(n),x:.035*r*a*Math.sin(n-.5),rot:.03*r*a*Math.sin(n+.9),y:-.02*i,lidL:l,lidR:l,size:1+.06*i}},fx(e,t,r,a,n,l,i,s){let o=t?-1:1,h=1;for(let t=0;t<5;t++){let r=.2+(.25+.5*t)/2.5;h-=v[t]*(0,d.smoothstep)(r-.03,r+.1,e),e>=r&&l.thrown<=t&&(l.thrown=t+1,function(e,t,r,a){let n=e.head,l=Math.min(1.4,3.2*r),i=4+Math.round(6*l);for(let r=0;r<i;r++){let r=(Math.random()-.5)*1.6*a,i=t*Math.sqrt(Math.max(0,a*a-r*r))*(.1+.8*Math.random()),s=(230+170*Math.random())*(.55+.45*l),o=(Math.random()-.6)*90+r/a*50;for(let l=0;l<7;l++){let l=s*(.75+.5*Math.random());L(e,{...N,x:n.x*a+i+(Math.random()-.5)*24,y:n.y*a+r+(Math.random()-.5)*24,vx:t*l,vy:o+(Math.random()-.5)*50,life:1.3+.8*Math.random(),a:.55+.3*Math.random(),r0:4,r1:30+20*Math.random(),grow:.5,keep:.35,fall:45,curl:40,kind:2,hold:0,fadeP:1.5})}for(let l=0;l<3;l++)L(e,{...N,x:n.x*a+i,y:n.y*a+r,vx:t*s*(.8+.5*Math.random()),vy:o-40*Math.random(),life:.6+.4*Math.random(),a:.9,r0:1.5,r1:2.5,grow:1,keep:.4,fall:320,curl:0,kind:2,hold:0,fadeP:1})}}(a,o*(t%2?-1:1),v[t],s))}r.crust=Math.max(r.crust,e<0?(0,d.smoothstep)(-.8,-.3,e):Math.max(0,h))}},turn:{wake:!0,len:1.8,pose(e,t){let r=t?-1:1,a=x*(0,d.smoothstep)(-.6,.95,e),n=e>.95?-.1*Math.sin(Math.min(1,(e-.95)/.6)*Math.PI):0,l=(0,d.smoothstep)(0,.3,e);return{...b,spin:r*(a+n),axis:.22*r,y:-.02*w(e,.5,1.6),lidL:l,lidR:l}}},vape:{len:6.6,pose(e){let t=w(e,.2,1.7),r=(0,d.smoothstep)(1.7,2.3,e)*(1-(0,d.smoothstep)(5.2,6.4,e)),a=1-.35*t-.42*r;return{...b,pitch:.12*t-.08*r,y:-.02*t+.015*r,sx:1+.03*t,sy:1+.03*t,lidL:a,lidR:a}},fx(e,t,r,a,n,l,i,s){if(e<0||e>6.8)return;r.hush=Math.max(r.hush,.8*w(e,.2,2));let o=e>1.8&&e<5.4?(0,d.smoothstep)(1.8,2.2,e)*(.4+.6*Math.exp(-(e-1.8)/1.6))*(1-(0,d.smoothstep)(4.5,5.4,e)):0;o>0&&function(e,t,r,a,n,l){var i;let s,o,h,u,c,[d,f]=(i=.55*l,o=Math.cos((s=e.head).rot),h=Math.sin(s.rot),u=0*s.sx,c=i*s.sy,[s.x*l+u*o-c*h,s.y*l+u*h+c*o]),m=.88*t.field;for(r.owed+=110*a*n;r.owed>=1;){r.owed-=1;let t=Math.PI/2+(Math.random()-.5)*1.6,n=165*(.6+.4*a)*(.7+.6*Math.random());L(e,{x:d+(Math.random()-.5)*26,y:f+(Math.random()-.5)*10,vx:Math.cos(t)*n,vy:Math.sin(t)*n,life:5+2.5*Math.random(),a:.75,r0:10,r1:96*(.7+.6*Math.random()),grow:1.6,keep:.55,fall:10,rise:30,riseT:3.6,curl:85,splay:55,wall:m,home:m*Math.random()**.85*.92,peel:.1+1.0999999999999999*Math.random(),side:0,hitAt:-1,peeled:!1,kind:1,hold:3,fadeP:2.4})}}(a,n,l,o,i,s)}},look:{len:2.8,pose(e,t){let r=t?-1:1,a=w(e,.45,1.35),n=w(e,1.45,2.45);return{...b,yaw:r*(-.42*a+.42*n),gx:r*(-.08*a+.08*n),x:r*(-.03*a+.03*n),rot:r*(-.03*a+.03*n)}}},wink:{len:2,pose(e,t){let r=w(e,.8,1.35),a=.08*w(e,.7,1.55);return t?{...b,lidL:1-r,rot:-a}:{...b,lidR:1-r,rot:a}}},sleepy:{len:3.2,hold:!0,pose(e){let t=w(e,1.5,1.95),r=.8*(0,d.smoothstep)(.1,1.5,e)*(1-.8*t)+.2*(0,d.smoothstep)(1.95,3.1,e),a=1-.7*r;return{...b,y:.07*r,rot:.1*r,gy:.05*r,lidL:a,lidR:a}}},spin:{len:3,pose(e,t){let r=t?-1:1,a=-.25*w(e,0,.45)+x*(0,d.smoothstep)(.3,1.75,e),n=e>1.7?Math.exp(-(e-1.7)/.55)*(0,d.smoothstep)(1.7,1.85,e):0,l=1.5*x*(e-1.7),i=1-.3*n;return{...b,spin:r*a,axis:.62*r,x:.035*n*Math.sin(l),y:.022*n*Math.cos(l),rot:.07*n*Math.sin(l+.6),gx:.06*n*Math.sin(1.3*l),gy:.04*n*Math.cos(1.3*l),lidL:i,lidR:i}}}},A=Object.keys(k),O=A.filter(e=>k[e].wake),S=A.filter(e=>!k[e].wake),E=(e,t,r,a)=>e+(t-e)*(1-Math.exp(-a/r)),_=e=>Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.rot)+Math.abs(e.yaw)+Math.abs(e.pitch)+Math.abs(e.spin)+Math.abs(e.sx-1)+Math.abs(e.sy-1)<1e-4;function L(e,t){e.parts.length>=2200||e.parts.push({...t,age:0,seed:60*Math.random()})}let N={rise:0,riseT:1,splay:0,wall:0,home:0,peel:0,side:0,hitAt:-1,peeled:!1},R={x:0,y:0},I={v:0,kind:0,hold:0,covers:!1},T=(e,t,r)=>e+(t-e)*r,z=(e,t,r)=>{let a,n=(a=(r-e)/(t-e))<0?0:a>1?1:a;return n*n*(3-2*n)};function P(e,t=!1,r=0){let a,n=t=>f(e,7*t+3,1),l=.5>n(3)?-1:1,i=(.26+.18*n(2))*l,s=[0,0],o=e=>[l*e*(.15+.07*n(9)),(n(10)-.5)*.07],h=e=>({ms:.62+.2*n(11),tilt:0,gaze:s,blink:[e,e+.22]});switch(t?[0,2,3,4][4*n(1)|0]:5*n(1)|0){case 0:a=[{ms:1.3+.9*n(4),tilt:0,gaze:s,snap:.01},{ms:1.4+.9*n(5),tilt:0,gaze:s},h(.12),{ms:1.2+.9*n(6),tilt:0,gaze:o(1),snap:.1},{ms:1.3+.9*n(7),tilt:0,gaze:s,snap:.12},{ms:.95,tilt:0,gaze:s,blink:[.1,.3],blink2:.5>n(8)?[.44,.64]:null},{ms:1.6+1.2*n(12),tilt:0,gaze:s}];break;case 1:a=[{ms:.9+.5*n(4),tilt:0,gaze:s,snap:.01},{ms:.8+.5*n(5),tilt:0,gaze:s},h(.1),{ms:.7+.6*n(6),tilt:0,gaze:s}];break;case 2:a=[{ms:1.2+.8*n(4),tilt:0,gaze:s,snap:.01},{ms:1.6+1.2*n(13),tilt:i,gaze:s,snap:.9},{ms:.8,tilt:i,gaze:s,blink:[.14,.36]},{ms:1.8+1.1*n(5),tilt:0,gaze:s,snap:.75},{ms:1.5+1.3*n(6),tilt:0,gaze:s}];break;case 3:a=[{ms:.9+.5*n(4),tilt:0,gaze:s,snap:.01},{ms:1.1+.7*n(5),tilt:0,gaze:o(1.1),snap:.09},{ms:1.4+.8*n(6),tilt:0,gaze:s,snap:.12},{ms:1,tilt:0,gaze:s,blink:[.08,.28],blink2:[.42,.62]},{ms:1.4+1.2*n(7),tilt:0,gaze:s}];break;default:a=[{ms:1.2+.7*n(4),tilt:0,gaze:s,snap:.01},{ms:1.2+.7*n(5),tilt:0,gaze:s},{ms:1+.6*n(6),tilt:0,gaze:o(1),snap:.09},{ms:.9+.5*n(7),tilt:0,gaze:o(-.85),snap:.09},{ms:1.2+.8*n(8),tilt:0,gaze:s,snap:.12},h(.12),{ms:1.3+ +n(12),tilt:0,gaze:s}]}let u=0;for(let e of a)u+=e.ms;for(let e=20;u<r;e+=2){let t=2.6+1.8*n(e);a.push({ms:t,tilt:0,gaze:s,blink:.7>n(e+1)?[.4,.62]:void 0}),u+=t}return{beats:a,total:u}}let j={gaze:[0,0],tilt:0,lid:1};var V=e.i(877267);let F=(e,t,r)=>e+(t-e)*r,C=(e,t,r,a)=>a<.5?e+(t-e)*a*2:t+(r-t)*(a-.5)*2;function $(e,t,r){return .58+.07*Math.sin(.35*r)+(g(.011*e+.04*r,.011*t-.03*r,.22*r,2)-.5)*.6}function D(){let e={face:0,hush:0,dim:0,ink:0,reach:0,few:0,narrow:0,hard:0,haze:0,sigh:{live:!1,t0:0,dir:Math.PI/2,seed:0,now:0,front:0},ways:{jumble:new Float32Array(257),reach:new Float32Array(257),gush:new Float32Array(257),gust:new Float32Array(257),lobe:new Float32Array(257)}};return K(e),e}function K(e){let t=F(.52,1,e.face);e.ink=F(1.52,2.5,e.face),e.reach=F(2.2,4,e.face),e.haze=F(.27,.57,e.face),e.few=C(4.2,1.9,1,t),e.narrow=C(.3,.17,.04,t),e.hard=C(2.6,2,1.25,t)}function q(e,t){return(0,d.smoothstep)(0,.05,e)*Math.max(.18,Math.exp(-Math.max(0,e-.5)/.3))*(.6+.8*g(5*e+t,1.7,2.9,2))}function B(e,t,r,a,n,l,i=!0){let s=e.sigh;i&&l>=0&&l<.3&&!s.live&&(s.live=!0,s.t0=t-l,s.dir=Math.PI/2+(.5>Math.random()?-1:1)*(.7+(Math.random()-.5)*.3),s.seed=50*Math.random());let o=(t-s.t0)*.65;s.live&&o>2.4&&(s.live=!1),s.now=s.live?q(o,s.seed)*(1-(0,d.smoothstep)(.855,2.4,o))*1.5*(0,d.smoothstep)(0,.25,o):0,s.front=.55+1.53*(1-Math.exp(-Math.max(0,o)/.6))+.18*Math.max(0,o),e.dim=Math.max(n,e.dim*Math.exp(-r/2.2));let h=l>=0?a*(0,d.smoothstep)(.65,.65+.2,l):0,u=h>e.face?2.05/2.3:.5;e.face+=(h-e.face)*(1-Math.exp(-r/u)),K(e);let c=e.ways;for(let e=0;e<=256;e++){let r=-Math.PI+e/256*Math.PI*2,a=Math.cos(r),n=Math.sin(r);c.jumble[e]=(g(2.2*a+11,2.2*n,.35*t,2)-.5)*220,c.reach[e]=Math.max(0,g(1.1*a+5,1.1*n,.12*t,2)-.22),c.gush[e]=(0,d.smoothstep)(.5,.78,g(1.6*a+3,1.6*n,.5*t,2)),c.gust[e]=.4+1.2*g(1.2*a+7,1.2*n,.4*t,2),s.live&&(c.lobe[e]=1.53*(.5+ +g(1.4*a+s.seed,1.4*n,.3*o,2)))}}function W(e,t){let r=(t+Math.PI)/(2*Math.PI)*256,a=Math.min(255,Math.max(0,Math.floor(r)));return e[a]+(e[a+1]-e[a])*(r-a)}function H(e,t,r,a,n,l,i){let s=e.px??e.dx,o=e.py??e.dy,h=e.sx??e.dx,u=e.sy??e.dy,c=.018*i.g*Math.min(1,e.dist/a)**2*a,f=Math.hypot(s-i.x*c,o-i.y*c),m=1-(0,d.smoothstep)(.55*a,a,f),p=m>0?($(e.dx,e.dy,t)+r)*m:0;l.dim>.002&&(p*=1-.16*l.dim);let M=1-l.hush,x=Math.hypot(h-i.x*c,u-i.y*c);if(l.haze>0&&M>0&&x<1.32*a){let e=l.haze*M*(1-.39*l.dim)*(1-(0,d.smoothstep)(.9*a,1.32*a,x))*n;if(1.55*e>p){let r=e*(.45+1.1*y(.012*h+11,.012*u,.15*t,2));r>p&&(p=r)}}let w=.55+Math.max(0,.92*l.ink-.55)*(0,d.smoothstep)(.92*a,1.14*a,x);if(M>0&&w*n*M>p){let e=function(e,t,r,a,n,l,i,s,o){let h;if(n>a*(i.reach+.2+.54))return 0;let u=.087*s.g*n,c=e-s.x*u,f=t-s.y*u,m=Math.hypot(c,f)||1,p=Math.atan2(f,c),M=i.few/(1+.006*n),x=g(c/m*M,f/m*M,.008*(n-66*r-W(i.ways.jumble,p)),3),w=function(e,t){let r=e.sigh;if(!r.live||r.now<=.01)return 0;let a=t-r.dir;return a-=Math.round(a/(2*Math.PI))*Math.PI*2,r.now*(1-(0,d.smoothstep)(1.3608,3.024,Math.abs(a)))}(i,p),b=i.sigh.front,v=w>0?w*(1-(0,d.smoothstep)(b-.35,b+.05,n/a)):0,k=w>0?w*((h=b-1)<0?0:h>1?1:h):0,A=a*(1.05+(i.reach-1.05)*Math.min(1,2.4*W(i.ways.reach,p))+.54*k),O=(0,d.smoothstep)(.55*a,A,n),S=.4+i.narrow*O;if(1.2*x<=S)return 0;let E=x*(.8+.4*y(.02*e+3,.02*t,.3*r,2)),_=(3.2*Math.max(0,E-S))**i.hard;return _<=0?0:(_*=1+.9*W(i.ways.gush,p)+1.2*v,i.dim>.002&&(_*=1-.65*i.dim),Math.min(o,_*(1-O)**1.25*(.6+.65*(s.g*W(i.ways.gust,p)))*i.ink)*l)}(h,u,t,a,x,n,l,i,w)*M;e>p&&(p=e)}if(n<.98&&p>0){let t=y(.015*e.dx-7,.015*e.dy+3,11.4,2);p*=(0,d.smoothstep)(t-.34,t+.34,1.7*n-.24)}return p}function U(e,t,r,a){let n=a.sigh;if(!n.live)return 0;let l=(t-n.t0)*.65,i=e.dist/r-.55;if(i<=0)return 0;let s=Math.atan2(e.py??e.dy,e.px??e.dx)-n.dir;if(Math.abs(s-=Math.round(s/(2*Math.PI))*Math.PI*2)>3.141592653589793)return 0;let o=W(a.ways.lobe,s);if(i>o*(1-Math.exp(-l/.6))+.18*l)return 0;let h=-.6*Math.log(1-Math.min(i/o,.97));for(let e=0;e<3;e++){let e=Math.exp(-h/.6);h-=(o*(1-e)+.18*h-i)/(o*e/.6+.18)}let u=l-h;if(h<0||u<0||u>1.9)return 0;let c=q(u,n.seed),f=1-(0,d.smoothstep)(.855,2.4,l);if(c*f<.01)return 0;s+=(g(1.8*i,2.2*u,.3*t,2)-.5)*1.1*(.3+h);let m=Math.min(Math.PI,(.95+1.45*(1-Math.exp(-h/.45)))*1.8*(.55+.9*g(2.2*i+n.seed,1.7*u,3.3,2))),p=1-(0,d.smoothstep)(.55*m,m,Math.abs(s));if(p<=0)return 0;let M=1+.4*h,x=(3*Math.max(0,g(2.2*s/M+4,3*u+.6*i/M,5.1,3)-.32))**1.4,w=1-(0,d.smoothstep)(.15,.9,i)*(1-Math.min(1,.45+x)),b=1/(1+(i/.81)**2),v=(0,d.smoothstep)(.25,.65,y(.014*e.dx+n.seed,.014*e.dy,.9*u+.2*t,2)),k=1-.65*(0,d.smoothstep)(.1,.7,i)*(1-v);return Math.min(.95,$(e.dx,e.dy,t)*c*f*p*w*b*k*3.5)}e.s(["createSmoke",0,D,"restValue",0,H,"sighValue",0,U,"stepSmoke",0,B],732061);let G=(e,t,r)=>{let a,n=(a=(r-e)/(t-e))<0?0:a>1?1:a;return n*n*(3-2*n)},J=[{letters:["0","1","7","4","9","2","8","3","5","6"],emoji:["🤍","🖤","⚪","⚫","☁️","🦢","🐧","🐼","🎱","🕊️"]},{letters:["/","\\","|","_","-","~","^","<",">","="],emoji:["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘","🌙","🌚"]},{letters:["(",")","[","]","{","}",":",";","*","+"],emoji:["❄️","🫧","💧","🌊","🧊","🐳","🐟","🪸","🌌","🔮"]},{letters:[".",",","'","`",":",'"',";","·","*","^"],emoji:["🗿","💬","🖨️","📀","🗝️","🧷","📎","🖇️","🧮","🔭"]}];function X(e,t,r,a,n){let l=Math.floor(r/a);return Q(e,t,r,l*a+.6+f(l,11,5)*a*.45,n*(.6+3.4*f(l,17,9)**2),l)}function Y(e){let t=e;for(let e=0;e<400;e++,t++){let e=1+t%J.length;if(.25>f(t,19,7)&&(2===e||3===e)&&.35>f(t,3,2))break}return t}function Q(e,t,r,a,n,l){let i=r-a;if(i<0||i>n)return 0;let s=G(0,1.7+2.6*f(l,3,2),i),o=G(n-(1.5+2.8*f(l,4,3)),n,i),h=1+(4*f(l,19,7)|0);for(let r=0;r<h;r++){let a=(f(7*l+r,23,1)-.5)*300,n=(f(7*l+r,29,2)-.5)*300,i=e-a,h=t-n,u=Math.hypot(i,h),c=470*s*(.4+1.1*g(.011*i+l,.011*h,3.3*r,3));if(u>=c||o>.85*g(.016*i-4,.016*h+6,5.1*r+1,2)+.1)continue;let d=1-u/Math.max(1,c);if(!(g(.05*e+r,.05*t,2.7*l,2)>.95*d+.34))return 1+(l+r)%J.length}return 0}e.s(["WASH_SETS",0,J,"wakingSlot",0,Y,"washAt",0,X,"washOnce",0,Q],298293);let Z=1e3/240,{fontSize:ee,density:et}=u.ASCII_FACE,er=e=>`700 ${e}px ui-monospace,SFMono-Regular,Menlo,monospace`,ea=(e,t,r)=>er(e*(.5+.5*(0,d.emojiWeight)(t,r))),en=[235,235,235];function el(e){let t=[[],[],[],[],[]],r=0;for(let a of Array.from(e.toUpperCase())){let e=d.LETTERS[a];if(e){if(t[0].length)for(let e of t)e.push(-1);e.forEach((e,a)=>{for(let n of e)t[a].push("#"===n?r:-1)})," "!==a&&r++}}return t}let ei=el("ERROR");function es(e,t,r,a,n){return e+(t-e)*Math.min(1,n/(t>e?r:a))}function eo(e,t,r,a,n,l){let i=Math.floor(t/(a*l)+e[0].length/2),s=Math.floor(r/(n*l)+e.length/2);return s<0||s>=e.length?-1:e[s][i]??-1}let eh=[...J,{letters:["~","s","S","§","~","∫","s","≈","S","~"],emoji:["💨","☁️","🌫️","💨","☁️","🫧","💭","💨","☁️","🌫️"]},{letters:["*",":","'",".","*",",",":","`","*",";"],emoji:null}],eu=J.length,ec={gap:1,size:1.1},ed=e=>e<0?0:e>1?1:e;function ef(e,t,r,a){let n=e=>Math.max(1,Math.min(3,Math.floor(625.6/(e[0].length*t)),Math.floor(421.6/(e.length*r)))),l=el(a),i=3>n(l)?function(e){let t=Array.from(e.trim()),r=t.flatMap((e,t)=>" "===e?[t]:[]);if(!r.length)return null;let a=t.length/2,n=r.reduce((e,t)=>Math.abs(t-a)<Math.abs(e-a)?t:e),l=el(t.slice(0,n).join("")),i=el(t.slice(n+1).join(""));if(!l[0].length||!i[0].length)return null;let s=Math.max(-1,...l.flat())+1,o=Math.max(l[0].length,i[0].length),h=(e,t)=>{let r=Math.floor((o-e.length)/2);return[...Array(r).fill(-1),...e.map(e=>e<0?e:e+t),...Array(o-e.length-r).fill(-1)]},u=()=>Array(o).fill(-1);return[...l.map(e=>h(e,0)),u(),u(),...i.map(e=>h(e,s))]}(a):null,s=i&&n(i)>n(l)?i:l,o=n(s),h=0;for(let a of e)a.word=eo(s,a.dx,a.dy,t,r,o),h=Math.max(h,a.word+1);return h}function em({className:e,mode:t="idle",size:r=680,color:a=en,getSpectrum:n,word:l=null,waking:i=!1}){let s=(0,h.useRef)(null),f=(0,h.useRef)(null),m=(0,h.useRef)([]),y=(0,h.useRef)(null),x=(0,h.useRef)({cur:[...a],target:a}),w=(0,h.useRef)(0),v=(0,h.useRef)(n);v.current=n;let A=(0,h.useRef)({phrase:0,bob:0,bobVel:0,amp:[,,,,].fill(0),phase:Array.from({length:4},(e,t)=>2.1*t),spin:0,rings:[]}),F=(0,h.useRef)({mode:t,start:0}),C=(0,h.useRef)(performance.now()),$=(0,h.useRef)(90*Math.random()).current,K=(0,h.useRef)({scale:.3,lift:0,gather:0,comet:0,speech:0,err:0,word:0}),q=(0,h.useRef)(null),W=(0,h.useRef)({cw:1,ch:1}),G=(0,h.useRef)({script:null,from:0,until:0}),J=(0,h.useRef)(null),el=(0,h.useRef)(i);return(0,h.useEffect)(()=>{let e=s.current;if(!e)return;let t=.95*ee/et,a=1.25*ee/et,n=680/r,l=t*n,i=a*n,o=Math.max(1,Math.floor(625.6/(ei[0].length*l)));w.current=r,W.current={cw:l,ch:i};let h=[],u=Math.ceil(r/t),c=Math.ceil(r/a),p=new Int32Array(u*c).fill(-1);for(let e=0;e<c;e++)for(let s=0;s<u;s++){let c=s*t,f=e*a,m=(c-r/2)*n,g=(f-r/2)*n,y=Math.hypot(m,g),M=eo(ei,m,g,l,i,o);M<0&&y>328||(p[e*u+s]=h.length,h.push({x:c+t/2,y:f+a/2,dx:m,dy:g,dist:y,angle:Math.atan2(g,m),cos:y>0?m/y:1,sin:y>0?g/y:0,seed:(0,d.hash)(s,e),grain:(0,d.hash)(5.7*s+19,2.3*e+53),gap:.05+.3*(0,d.hash)(7.3*s+11,3.1*e+5),speck:(0,d.hash)(4.1*s+23,6.3*e+41),letter:M,word:-1}))}m.current=h,J.current={cells:h,cols:u,rows:c,cw:l,ch:i,half:340,at:p,field:328},q.current&&ef(h,l,i,q.current.text),y.current={byLevel:Array.from({length:d.LEVELS},()=>new Int32Array(h.length)),inLevel:new Int32Array(d.LEVELS),glyph:Array(h.length),fast:new Float32Array(h.length),slow:new Float32Array(h.length),wasLevel:new Int8Array(h.length).fill(-9),turn:new Int32Array(h.length).fill(-9),pick:new Int32Array(h.length),pool:new Int8Array(h.length),poolFor:new Float32Array(h.length)};let g=Math.min(2,window.devicePixelRatio||1);e.width=r*g,e.height=r*g,e.style.width=`${r}px`,e.style.height=`${r}px`;let M=e.getContext("2d");return M&&(M.setTransform(g,0,0,g,0,0),M.textAlign="center",M.textBaseline="middle","emoji"===(0,V.faceGlyphs)()&&function(e,t,r){if(0===r.length)return;let a=new Set(d.EMOJI_POOL);for(let e of eh)for(let t of e.emoji??[])a.add(t);let n=d.LEVELS-1,l=[];for(let e=1;e<=n;e++)l.push(ea(t,e,n));for(let t of l){e.font=t;let n=0;for(let t of a){let a=r[97*n++%r.length];e.fillText(t,a.x,a.y)}}e.clearRect(0,0,e.canvas.width,e.canvas.height)}(M,ee,h),f.current=M),()=>{M?.clearRect(0,0,r,r),m.current=[],J.current=null,y.current=null}},[r]),(0,h.useEffect)(()=>{x.current.target=a},[a]),(0,h.useEffect)(()=>{F.current.mode!==t&&(F.current={mode:t,start:.001*performance.now()})},[t]),(0,h.useEffect)(()=>{if(!l||Date.now()-l.at>(l.hold??3.4)*1e3)return;let{cw:e,ch:t}=W.current,r=performance.now();if(q.current={text:l.text,start:.001*r,letters:ef(m.current,e,t,l.text),hold:l.hold??3.4},r-C.current<600){let e=K.current;e.word=1,e.scale=0}},[l]),(0,h.useEffect)(()=>{let e,t=0,r=(0,c.createVoiceFollower)(),a="letters"===(0,V.faceGlyphs)(),n=a?.4:.264,l=D(),i=(e=new Float32Array(0),{deck:[],lastWake:null,head:{...b},smoke:{...b},want:{hush:0,crust:0},doing:{hush:0,crust:0},yawSlow:0,yawV:0,moved:!1,turned:!1,hx:e,hy:e,hz:e,px:e,py:e,pd:e,sx:e,sy:e,crust:0,crustSeed:40*Math.random(),crustWas:new Uint8Array(0),crusted:0,crustedNow:0,parts:[],live:!1,calm:1,thick:e,top:e,kind:new Int8Array(0),keep:e}),s={dx:0,dy:0,dist:0,px:0,py:0,sx:0,sy:0},o=Array(c.SPECTRUM_BANDS).fill(0),h=.001*performance.now(),C=0,W=0,et=el.current?{slot:Y(4e3*Math.random()|0)}:null;if(et){let e=P(1e6*Math.random()|0,!0);G.current={script:e,from:.15,until:1.4+e.total+1.5}}let en=-1/0,ei=e=>{var c,V;if(e-en<1e3/u.ASCII_FACE.fps-Z){t=requestAnimationFrame(ei);return}en=e;let D=.001*e,Y=Math.min(.05,Math.max(0,D-h));h=D;let el=f.current,eo=y.current,ef=J.current;if(!el||!eo||!ef){t=requestAnimationFrame(ei);return}let em=w.current;eo.inLevel.fill(0);let ep=v.current?.();if(!ep||ep.length<2){for(let e=0;e<o.length;e++){let t=.5*Math.sin(1.7*D+1.7*e)+.3*Math.sin(.8*D+.6*e)+.2*Math.sin(3*D+2.9*e);o[e]=.5*t+.5}ep=o}let eg=A.current,ey=Math.max(1,Math.round(60*Y)),eM=r.read(ep,Y);eg.phrase=eM.phrase,eM.onset>0&&(eg.bobVel+=.06*eM.onset,eg.rings.push({born:D,power:eM.onset}),eg.rings.length>5&&eg.rings.shift());for(let e=0;e<ey;e++)eg.bobVel+=-(.012*eg.bob)-.09*eg.bobVel,eg.bob+=eg.bobVel;C+=Y;for(let e=0;e<4;e++){let t=Math.floor(e*eM.bands.length/4),r=Math.max(t+1,Math.floor((e+1)*eM.bands.length/4)),a=0;for(let e=t;e<r;e++)a+=eM.bands[e];a/=r-t;let n=.7+.6*(0,d.hash)((.9*D|0)+31*e,e);eg.amp[e]+=(a*n-eg.amp[e])*(1-(1-(.05+.02*e))**ey),eg.phase[e]+=Y*(.9+.5*e)*(e%2?-1:1)}for(eg.spin+=Y*(1.1+.9*eg.phrase);eg.rings.length>0&&D-eg.rings[0].born>.7;)eg.rings.shift();let ex=F.current,ew=q.current,eb=ew?D-ew.start:0,ev=null!==ew&&"error"!==ex.mode&&eb<ew.hold+.08*ew.letters+.45+.35+.9,ek=function(e,t){let r={scale:1,lift:0,gather:0,comet:0,speech:0,err:0,word:0};switch(e){case"idle":return r;case"connecting":{let e=1-Math.exp(-t/1.3);return{...r,scale:.45+.55*e,lift:.06*e,gather:1}}case"speaking":return{...r,speech:1};case"working":return{...r,scale:0,comet:1};case"ending":return{...r,scale:0};case"error":return{...r,scale:0,err:1}}}(ex.mode,D-ex.start);ev&&(ek.word=1,null!==ew&&eb<ew.hold&&(ek.scale=0,ek.lift=0,ek.gather=0,ek.comet=0,ek.speech=0));let eA=K.current;eA.scale=es(eA.scale,ek.scale,.45,"ending"===ex.mode?.4:.7,Y),eA.lift=es(eA.lift,ek.lift,.22,.4,Y),eA.gather=es(eA.gather,ek.gather,.3,.95,Y),eA.comet=es(eA.comet,ek.comet,.45,.9,Y),eA.speech=es(eA.speech,ek.speech,.5,.75,Y),"error"===ex.mode&&(eA.err<=.01&&(W=0),W+=Y),eA.err=es(eA.err,ek.err,.5,.6,Y),eA.word=es(eA.word,ek.word,.35,.5,Y);let eO=eA.err>.5,eS=eA.word>.5,eE=M(C,$),e_=Math.exp(-Y/.085),eL=Math.exp(-Y/.8),eN=eA.scale*(1-eA.speech)*(1-eA.comet)*(1-eA.gather),eR=null,eI=0,eT=0,ez=0,eP=-1,ej=null,eV=-1,eF=G.current,eC=eN>.4&&!eO&&!eS,e$=(0,d.smoothstep)(.4,.75,eN)*(1-(0,d.smoothstep)(0,.5,eA.word));if(!eC&&void 0===eF.cut&&eF.script&&C>eF.from&&C<eF.until&&(eF.cut=C),eC&&void 0===eF.cut&&C>eF.until){let e=0===eF.until,t=function(e){let[t,r]=function(e){let t=e.deck;if(!t.length){for(let e of O)for(let r of S)t.push([e,r]);for(let r=0;r<200;r++){for(let e=t.length-1;e>0;e--){let r=Math.random()*(e+1)|0;[t[e],t[r]]=[t[r],t[e]]}let r=t[t.length-1][0]!==e.lastWake;for(let e=1;r&&e<t.length;e++)r=t[e][0]!==t[e-1][0];if(r)break}}let r=t.pop()??[O[0],S[0]];return e.lastWake=r[0],r}(e),a=11*(.75+.5*Math.random()),n=Math.max(Math.max(k[t].len,1.5)+.8,a-k[r].len),l=(e,t)=>({key:e,at:t,m:.5>Math.random(),thrown:0,owed:0});return{items:[l(t,0),l(r,n)],open:n+k[r].len+.8*!k[r].hold}}(i);eF.plan=t,eF.script=P(1e3*C|0,!1,t.open),eF.from=C+(e?.15:17*(.55+.9*Math.random())),eF.until=eF.from+1.25+Math.max(eF.script.total,t.open)+1.5}if(eC||void 0!==eF.cut){let e=C-eF.from,t=eF.until-eF.from;if(eF.script&&e>0){let r=(0,d.smoothstep)(.4,.75,eN),a=t-1.5-.3,n=void 0===eF.cut?ed((e-a)/1.35):Math.max(ed((e-a)/1.35),ed((C-eF.cut)/.4));eI=(0,d.smoothstep)(.75,1.05,e);let l=function(e,t){let r=0,a=[0,0],n=0;for(let l of e.beats){let e=t-r;if(e<l.ms){let t=z(0,l.snap??.12,e),r=1;for(let t of[l.blink,l.blink2])!t||e<=t[0]||e>=t[1]||(r*=Math.abs(Math.cos(Math.PI*((e-t[0])/(t[1]-t[0]))))**.7);return{gaze:[T(a[0],l.gaze[0],t),T(a[1],l.gaze[1],t)],tilt:T(n,l.tilt,t),lid:r}}r+=l.ms,a=l.gaze,n=l.tilt}return j}(eF.script,Math.max(0,e-.875)),i=l.lid*(0,d.smoothstep)(.75,1.13,e),s=(1-n)**2.2;eR={...l,gaze:[l.gaze[0],l.gaze[1]+.04*(0,d.smoothstep)(0,.65,n)],lid:i*s,fall:i*(1-s)*.3999999999999999},eT=eI*(1-n)*r,ez=(0,d.smoothstep)(.1,.9,n)*r,r>.5&&(eP=e-.75),void 0===eF.cut?(ej=eF.plan??null,eV=e-.75):n>=1&&(eF.until=C,eF.cut=void 0,eR=null,eI=0)}}let eD=170*1.08*Math.max(.02,eA.scale);eR=function(e,t,r,a,n,l,i,s,o){var h;h=t.cells.length,e.hx.length!==h&&(e.hx=new Float32Array(h),e.hy=new Float32Array(h),e.hz=new Float32Array(h),e.px=new Float32Array(h),e.py=new Float32Array(h),e.pd=new Float32Array(h),e.sx=new Float32Array(h),e.sy=new Float32Array(h),e.crustWas=new Uint8Array(h),e.thick=new Float32Array(h),e.top=new Float32Array(h),e.kind=new Int8Array(h),e.keep=new Float32Array(h),e.parts.length=0,e.live=!1),e.calm=o,e.crusted=e.crustedNow,e.crustedNow=0;let u=b,c=e.want;if(c.hush=0,c.crust=0,n&&l>-1){let o={...b},h=!1;for(let r of n.items){let n=k[r.key],i=l-r.at;if(n.fx?.(i,r.m,c,e,t,r,a,s),i<(n.wake?-.8:0)||!n.hold&&i>n.len+.6)continue;let u=n.pose(i,r.m);u!==b&&(h=!0,o.x+=u.x,o.y+=u.y,o.rot+=u.rot,o.yaw+=u.yaw,o.pitch+=u.pitch,o.spin+=u.spin,u.spin&&(o.axis=u.axis),o.gx+=u.gx,o.gy+=u.gy,o.sx*=u.sx,o.sy*=u.sy,o.lidL*=u.lidL,o.lidR*=u.lidR,o.size*=u.size)}if(i&&l>=0){let e;o.yaw+=.08*(g(.13*r+3.1,1.7,.4,2)-.5)*2*(0,d.smoothstep)(0,1.2,l)*((e=i.lid)<0?0:e>1?1:e),h=!0}h&&(u=o)}let f=e.doing;f.hush=E(f.hush,c.hush,.15,a),f.crust=E(f.crust,c.crust,.1,a),e.crust=f.crust;let m=e.head,y=m.yaw,M=u!==b?.045:o<.99?.3:.6;m.spin=u.spin+Math.atan2(Math.sin(m.spin-u.spin),Math.cos(m.spin-u.spin)),u.spin&&(m.axis=u.axis),m.x=E(m.x,u.x,M,a),m.y=E(m.y,u.y,M,a),m.rot=E(m.rot,u.rot,M,a),m.yaw=E(m.yaw,u.yaw,M,a),m.pitch=E(m.pitch,u.pitch,M,a),m.spin=E(m.spin,u.spin,M,a),m.sx=E(m.sx,u.sx,M,a),m.sy=E(m.sy,u.sy,M,a),e.yawV=(m.yaw-y)/Math.max(a,.001);let x=e.smoke;e.yawSlow=E(e.yawSlow,m.yaw,.3,a);let w=1-Math.exp(-a/.12);return(x.x+=(m.x+.25*Math.sin(e.yawSlow)-x.x)*w,x.y+=(m.y-x.y)*w,x.rot+=(m.rot-x.rot)*w,x.sx+=(m.sx-x.sx)*w,x.sy+=(m.sy-x.sy)*w,e.moved=!(_(m)&&_(x)),e.turned=Math.abs(m.yaw)+Math.abs(m.pitch)+Math.abs(m.spin)>1e-4,e.moved&&function(e,t,r){let a=t.cells,n=e.head;{let t=Math.cos(n.rot),l=Math.sin(n.rot),i=n.x*r,s=n.y*r,o=e.turned?function(e){let t=Math.cos(e.yaw),r=Math.sin(e.yaw),a=Math.cos(e.pitch),n=Math.sin(e.pitch),l=[t,r*n,r*a,0,a,-n,-r,t*n,t*a];if(!e.spin)return l;let i=Math.sin(e.axis),s=Math.cos(e.axis),o=Math.cos(e.spin),h=Math.sin(e.spin),u=1-o,c=[o+i*i*u,i*s*u,s*h,i*s*u,o+s*s*u,-i*h,-s*h,i*h,o],d=Array(9);for(let e=0;e<3;e++)for(let t=0;t<3;t++)d[3*e+t]=c[3*e]*l[t]+c[3*e+1]*l[3+t]+c[3*e+2]*l[6+t];return d}(n):null,h=r*r;for(let r=0;r<a.length;r++){let u=a[r].dx-i,c=a[r].dy-s,d=(u*t+c*l)/n.sx,f=(-u*l+c*t)/n.sy;if(e.px[r]=d,e.py[r]=f,e.pd[r]=Math.hypot(d,f),o){let t=Math.sqrt(Math.max(0,h-d*d-f*f));e.hx[r]=o[0]*d+o[3]*f+o[6]*t,e.hy[r]=o[1]*d+o[4]*f+o[7]*t,e.hz[r]=o[2]*d+o[5]*f+o[8]*t}else e.hx[r]=d,e.hy[r]=f,e.hz[r]=1}}let l=e.smoke,i=Math.cos(l.rot),s=Math.sin(l.rot),o=l.x*r,h=l.y*r;for(let t=0;t<a.length;t++){let r=a[t].dx-o,n=a[t].dy-h;e.sx[t]=(r*i+n*s)/l.sx,e.sy[t]=(-r*s+n*i)/l.sy}}(e,t,s),function(e,t,r,a){let n=e.parts;if(!n.length&&!e.live)return;e.calm<.02&&(n.length=0),e.thick.fill(0),e.top.fill(0),e.keep.fill(0);let l=0;for(let i of n){if(i.age+=a,i.age>=i.life)continue;let s=i.x,o=i.y,h=i.keep**a;i.vx*=h,i.vy*=h,i.vy+=(i.fall-i.rise*Math.min(1,i.age/i.riseT))*a,i.splay&&(i.vx+=(0===i.vx?i.seed%2<1?-1:1:Math.sign(i.vx))*i.splay*Math.min(1,i.age/.8)*a),i.wall&&function(e,t){let r=Math.hypot(e.x,e.y);if(r>.94*e.wall){let a=e.x/r,n=e.y/r,l=-n,i=e.vx*a+e.vy*n;if(!e.side){let t=e.vx*l+e.vy*a;e.side=Math.abs(t)>1?Math.sign(t):e.seed%2<1?-1:1}r>e.wall&&i>0&&(e.vx+=-i*a+e.side*i*.85*l,e.vy+=-i*n+e.side*i*.85*a);let s=120*Math.max(0,1-e.age/3.2);e.vx+=e.side*l*s*t,e.vy+=e.side*a*s*t,r>e.wall&&(e.x-=a*(r-e.wall)*.5,e.y-=n*(r-e.wall)*.5),e.hitAt<0&&(e.hitAt=e.age)}if(e.hitAt>=0&&e.age-e.hitAt>e.peel&&r>1){e.peeled||(e.peeled=!0,e.rise=Math.min(e.rise,14));let a=1.2*(r-e.home)*Math.min(1,(e.age-e.hitAt-e.peel)/.6);e.vx-=e.x/r*a*t,e.vy-=e.y/r*a*t}}(i,a);let u=0,c=0;if(i.curl){let e=i.curl*Math.min(1,i.age/.4);!function(e,t,r){let a=.011*e,n=.011*t,l=.3*r;R.x=(p(a,n+.25,l)-p(a,n-.25,l))/.5,R.y=-(p(a+.25,n,l)-p(a-.25,n,l))/.5}(i.x+7*i.seed,i.y,r),u=R.x*e,c=R.y*e}i.x+=(i.vx+u)*a,i.y+=(i.vy+c)*a;let f=i.a*(1-(i.age/i.life)**i.fadeP)*(0,d.smoothstep)(0,.06,i.age)*e.calm,m=i.r0+(i.r1-i.r0)*(1-Math.exp(-i.age/i.grow)),g=Math.min(4,Math.max(1,Math.ceil(Math.hypot(i.x-s,i.y-o)/7)));for(let r=1;r<=g;r++)!function(e,t,r,a,n,l,i,s){let o=Math.min(70,n+9),h=(r+t.half)/t.cw,u=(a+t.half)/t.ch,c=o/t.cw,d=o/t.ch,f=Math.max(0,Math.floor(h-c)),m=Math.min(t.cols-1,Math.ceil(h+c)),p=Math.max(0,Math.floor(u-d)),g=Math.min(t.rows-1,Math.ceil(u+d)),y=1/(o*o),M=t.cells;for(let n=p;n<=g;n++)for(let o=f;o<=m;o++){let h=t.at[n*t.cols+o];if(h<0)continue;let u=M[h].dx-r,c=M[h].dy-a,d=1-(u*u+c*c)*y;if(d<=0)continue;let f=l*d*d;e.thick[h]+=f-e.thick[h]*f,f>e.top[h]&&(e.top[h]=f,e.kind[h]=i),s>e.keep[h]&&(e.keep[h]=s)}}(e,t,s+(i.x-s)*r/g,o+(i.y-o)*r/g,m,f/Math.sqrt(g),i.kind,i.hold);n[l++]=i}n.length=l,e.live=l>0}(e,t,r,a),i&&u!==b)?{...i,gaze:[i.gaze[0]+u.gx,i.gaze[1]+u.gy],lids:[u.lidL,u.lidR],size:u.size}:i}(i,ef,D,Y,ej,eV,eR,eD,e$),l.hush=i.doing.hush,B(l,D,Y,eT,ez,eP,null===ej||null!==(c=ej)&&!0===k[c.items[0].key].sighs);let eK=i.moved,eq=i.live||i.crust>.004||i.crusted>0,eB=m.current;for(let e=0;e<eB.length;e++){let t=eB[e];eK?(s.dx=i.hx[e],s.dy=i.hy[e],s.px=i.px[e],s.py=i.py[e],s.dist=i.pd[e],s.sx=i.sx[e],s.sy=i.sy[e]):(s.dx=s.px=s.sx=t.dx,s.dy=s.py=s.sy=t.dy,s.dist=t.dist);let r=function(e,t,r,a,n,l,i,s,o,h){let u,c,f,m,p=i.scale>.02?H(t,r,i.lift,170*1.08*i.scale,i.scale,o,h)*(1-.6*i.speech):0;return i.gather>.01&&(p+=function(e,t,r){let a=170*r;if(e.speck>=.55||e.dist<.8*a)return 0;let n=Math.min(55,Math.floor((e.angle+Math.PI)/(2*Math.PI)*56)),l=(.7*t+(0,d.hash)(n,5.3))%1,i=e.dist-(a+(320-a)*(1-l)**1.25)-(e.grain-.5)*16;return Math.exp(-(i*i)/260)*(0,d.smoothstep)(0,.2,l)*(1-l)*1.1}(e,r,i.scale)*i.gather),i.comet>.01&&(p+=(c=Math.exp(-((u=e.dist-210)*u)/1100),c*Math.exp(-((m=Math.atan2(Math.sin(f=e.angle-3*r),Math.cos(f)))*m)/(m<0?2.8:.16))*i.comet)),i.speech>.01&&(p+=function(e,t,r,a){var n;let l=170+40*r.phrase+85*r.bob;for(let t=0;t<4;t++)l+=28*r.amp[t]*Math.sin((t+2)*(e.angle+r.spin)+r.phase[t]);let i=170+(((n=l)<=205?Math.max(110,n):205+30*Math.tanh((n-205)/30))-170)*a,s=(e.grain-.5)*20+20*Math.sin(5*e.angle+.9*t+6.283*e.seed)*.3,o=e.dist-(i+s),h=Math.exp(-(o*o)/800)+.5*Math.exp(-(e.dist*e.dist)/6e3);if(e.dist<i&&(h+=.22*(1-e.dist/i)**.6*(.75+.25*Math.sin(.05*e.dist-1.2*t))),e.speck<.22){let a=90*(.6+.9*e.grain);for(let n=0;n<r.rings.length;n++){let l=r.rings[n],s=t-l.born,o=e.dist-(i+6+s*a);h+=Math.exp(-(o*o)/500)*l.power*Math.max(0,1-s/.7)}}return h}(e,r,s,i.speech)*i.speech),i.err>.01&&(p+=function(e,t,r){if(e.letter<0)return 0;let a=r%9.2,n=.12*e.seed;return Math.max(0,(0,d.smoothstep)(0,1,(a-.65*e.letter-n)/.8)-(0,d.smoothstep)(0,1,(a-5.6-.5*e.letter-n)/.7))*(.86+.14*Math.sin(3.5*t+6*e.seed))}(e,r,a)*i.err),i.word>.01&&(p+=function(e,t,r,a){if(e.word<0)return 0;let n=.45*e.seed,l=(0,d.smoothstep)(0,1,(r-.11*e.word-n)/.3),i=r-a-.08*e.word-n,s=(0,d.smoothstep)(0,1,i/.35),o=.2*(1-(0,d.smoothstep)(0,1,(i-.35)/.9));return Math.max(l-s,l>.5?o*s:0)*((l>0&&l<1||s>0&&o>0)&&.35>(0,d.hash)(Math.floor(14*t)+97*e.seed,31*e.grain)?.25:1)*(.86+.14*Math.sin(3.5*t+6*e.seed))}(e,r,n,l)*i.word),p}(t,s,D,W,eb,ew?.hold??3.4,eA,eg,l,eE);if(l.sigh.live){let e=U(s,D,eD,l)*eA.scale;e>r&&(r=e)}let o=!(eO&&t.letter>=0||eS&&t.word>=0),h=0,u=0,c=!1;if(eq&&o){let t=function(e,t,r,a,n,l,i){let s=t.cells[r];if(I.v=a,I.kind=0,I.hold=0,I.covers=!1,e.crust>.004||e.crusted>0){let t=e.moved?e.hx[r]:s.dx,a=e.moved?e.hy[r]:s.dy,n=e.moved?e.pd[r]:s.dist,o=1-(0,d.smoothstep)(.92*l,1.1*l,n),h=!1;if(o>.05){let r=.12+.76*g(.022*t+e.crustSeed,.022*a,2.7,2);(h=e.crust>r)&&(I.v=.42*(.5+.9*g(.09*t,.09*a,5.5,2))*o*i,I.kind=2,I.hold=.15,e.crustedNow++)}e.crustWas[r]&&!h&&.06>Math.random()&&function(e,t,r){let a=Math.sqrt(Math.max(0,r*r-t.dist*t.dist)),n=Math.max(-260,Math.min(260,e.yawV*a*.55)),l=90+80*Math.random();L(e,{...N,x:t.dx,y:t.dy,vx:n+t.cos*l,vy:t.sin*l-30,life:1+.7*Math.random(),a:.45+.25*Math.random(),r0:3,r1:18+12*Math.random(),grow:.6,keep:.3,fall:45,curl:35,kind:2,hold:0,fadeP:1.5}),.35>Math.random()&&L(e,{...N,x:t.dx,y:t.dy,vx:n+t.cos*(120+80*Math.random()),vy:t.sin*l-50,life:.6+.4*Math.random(),a:.9,r0:1.5,r1:2.5,grow:1,keep:.4,fall:300,curl:0,kind:2,hold:0,fadeP:1})}(e,s,l),e.crustWas[r]=+!!h}if(e.live){let t=e.thick[r];if(t>.02){let a=e.kind[r],l=t*i*(.6+.8*p(.04*s.dx+.3*n,.04*s.dy-.2*n,.5*n)),o=.1+.3*s.grain;l>o?(I.v=2===a?.5*(1-Math.exp(-1.5*l)):.3+.62*Math.min(1,l),I.kind=a,I.hold=.12,l>.45&&2===a&&(I.covers=!0)):e.keep[r]>0&&l>.5*o&&(I.kind=a,I.hold=e.keep[r]*(.5+s.grain))}}return I}(i,ef,e,r,D,eD,eA.scale);r=t.v,h=t.kind,u=t.hold,c=t.covers}o&&(r*=(.66+.72*t.grain)*(.8+.4*(0,d.hash)(Math.floor(.05*t.dx+.5*D),Math.floor(.05*t.dy-.3*D))))>.3&&(0,d.hash)(31.7*Math.floor(1.6*D),613*t.seed)>.992&&(r=Math.max(r,.9));let f=!o||h?0:C<42?et?Q(t.dx,t.dy,C,1,2.9,et.slot):0:X(t.dx,t.dy,C,42,3.2);if(h?(eo.pool[e]=eu+h,eo.poolFor[e]=u):f?(eo.pool[e]=f,eo.poolFor[e]=.3+.9*t.grain):eo.poolFor[e]>0?(eo.poolFor[e]-=Y,eo.poolFor[e]<=0&&(eo.pool[e]=0)):eo.pool[e]=0,eI>.03&&null!==eR&&o&&!c&&(V=e,!i.turned||i.pd[V]<.985*eD&&i.hz[V]>0)&&function(e,t,r,a,n,l){if(a<=.03||n.lid<=.02)return!1;let i=r/112,s=i*l.size*(n.size??1);for(let o of[-1,1]){let h=n.lid*(n.lids?n.lids[o<0?0:1]:1);if(h<=.02)continue;let u=e-(44*o*i*l.gap+n.gaze[0]*r),c=t-(-20*i+n.gaze[1]*r+(n.fall??0)*51*s/2),d=Math.cos(n.tilt),f=Math.sin(n.tilt),m=u*d-c*f,p=51*s*h,y=(-(u*f+c*d)+p/2)/p;if(!(y<=0||y>=1||Math.abs(m- - -(2*(1-y)*y*1)*s)>38*s/2*Math.sin(Math.PI*y)**.35)&&!(a<.99&&a<.88*g(.026*u+3,.026*c,7.7,2)+.06))return!0}return!1}(eK?i.hx[e]:t.dx,eK?i.hy[e]:t.dy,eD,eI,eR,ec)){eo.fast[e]=0,eo.slow[e]=0,eo.pool[e]=0;continue}let m=eo.fast[e]=r>eo.fast[e]*e_?r:eo.fast[e]*e_,y=eo.slow[e]=r>eo.slow[e]*eL?r:eo.slow[e]*eL;r=m>.52*y?m:.52*y,o&&r<t.gap+.05*Math.sin(.28*D+6.283*t.seed)&&(r=0);let M=(r=r<0?0:r>1?1:r)*(d.LEVELS-1)|0;if(0===M)continue;let x=C*n+7*t.seed|0;(x!==eo.turn[e]||M-eo.wasLevel[e]>=2||eo.wasLevel[e]-M>=2)&&(eo.turn[e]=x,eo.wasLevel[e]=M,eo.pick[e]=(997*t.seed|0)+x+M);let w=eo.pick[e],b=eo.pool[e]?eh[eo.pool[e]-1]:null,v=a?b?.letters??d.RAMP[M]:b?.emoji??d.EMOJI_POOL;eo.glyph[e]=v[(w%v.length+v.length)%v.length],eo.byLevel[M][eo.inLevel[M]++]=e}el.clearRect(0,0,em,em);let eW=m.current,eH=d.LEVELS-1,eU=x.current;for(let e=0;e<3;e++)eU.cur[e]+=(eU.target[e]-eU.cur[e])*(1-.95**ey);el.fillStyle=`rgb(${0|eU.cur[0]},${0|eU.cur[1]},${0|eU.cur[2]})`,a&&(el.font=er(ee));for(let e=1;e<=eH;e++){let t=eo.inLevel[e];if(0===t)continue;a?el.globalAlpha=d.ALPHA_TOP*(e/eH):(el.globalAlpha=(0,d.emojiAlpha)(e,eH),el.font=ea(ee,e,eH));let r=eo.byLevel[e];for(let e=0;e<t;e++){let t=eW[r[e]];el.fillText(eo.glyph[r[e]],t.x,t.y)}}el.globalAlpha=1,t=requestAnimationFrame(ei)};return t=requestAnimationFrame(ei),()=>cancelAnimationFrame(t)},[]),(0,o.jsx)("canvas",{ref:s,className:e,"aria-hidden":!0,style:{display:"block",pointerEvents:"none"}})}e.s(["AsciiOrb",0,em,"CHURN_EMOJI",0,.264,"CHURN_LETTERS",0,.4,"DESIGN",0,680,"GLYPH_FONT",0,er,"REST_R",0,170*1.08,"TRAIL_FAST",0,.085],387758);var ep=e.i(922521),eg=e.i(647163);let ey={ending:"ending",idle:"idle",connecting:"connecting",listening:"idle",speaking:"speaking",working:"working",delegating:"working"},eM=[247,247,247],ex=[10,10,10];function ew({status:e,failed:t,word:r,size:a,getSpectrum:n,waking:l,className:i}){let s=(0,ep.useIsDark)();return(0,o.jsx)(em,{mode:t?"error":ey[e],word:r,size:a,color:s?eM:ex,getSpectrum:n,waking:l,className:i})}let eb=(0,h.memo)(function({status:e="idle",covered:t=!1,className:r,...a}){let n=(0,h.useRef)(null),[l,i]=(0,h.useState)(null),[s,u]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(([e])=>{let t=Math.round(e.contentRect.width);t>0&&i(t)});return t.observe(e),()=>t.disconnect()},[]),(0,h.useEffect)(()=>{let e=requestAnimationFrame(()=>u(!0));return()=>cancelAnimationFrame(e)},[]),(0,o.jsx)("div",{ref:n,className:(0,eg.cn)("aspect-square transition-opacity duration-700 ease-out",s&&null!==l?"opacity-100":"opacity-0",r),children:null!==l&&!t&&(0,o.jsx)(ew,{...a,status:e,size:l})})});e.s(["Face",0,eb],333495)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null),[p,b]=(0,a.useState)(e);return p!==e&&(b(e),c(!1)),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep wrap-anywhere",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),h=e.i(660302),f=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7f9bb64ae5decdc5eb16cf9a9298a8a8772204a462",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),T=e.i(647163),C=e.i(553429),_=e.i(978411),M=e.i(222055);function A({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})}function B({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R,{thread:e}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(q,{thread:e})]})}function R({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,T.formatCount)(n)} tokens \xb7 in total in ${(0,T.formatCount)(a.input)} \xb7 out ${(0,T.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,T.formatCount)(n)}):null}function $({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)}),[l,d]=(0,m.useState)(n);if(l!==n&&(d(n),r(!1)),!n||!a)return null;let c=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name),title:s?"It summarizes itself at its next step":`Context ${(0,T.formatCount)(n)} of ${(0,T.formatCount)(a)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,T.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":c>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*c))}%`}})})})}let D={working:"text-muted-foreground",waiting:T.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"},I={working:"working",waiting:"waiting",done:"done",cancelled:"stopped"};function q({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(h.ShinyText,{text:I.working,speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,T.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:I[e.status]})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(f.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,T.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(f.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:n.map(n=>{let a=O(e,n.name);return(0,t.jsxs)(f.TabsTrigger,{value:n.name,className:(0,T.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function O(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===W.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(ee,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(J,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(H,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==W.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(et,{line:o.line,surface:r,mention:d},o.key)})})})}function K({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?O(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),f=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",f?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":f,onClick:()=>{o(e=>!e),c(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(h.ShinyText,{text:"asking"===u?"waiting on you":b?V(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:(0,T.cn)("min-w-0 truncate text-[12px] leading-4",f&&"flex-1")}):(0,t.jsx)(U,{words:b?V(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · "),grow:f}),e.length>0&&(0,t.jsx)(G,{open:f})]}),!f&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),f&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ec(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(el,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e,inset:!0},e.id)))})]})}function H({lines:e,trailing:n,bot:a,thread:s}){let r=n?O(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ec(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(el,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e},e.id))),r&&!i&&(0,t.jsx)(h.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,T.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function G({open:e}){return(0,t.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,t.jsx)(s.ChevronDown,{className:(0,T.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function V(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,T.plainText)(e.text).replace(/\s+/g," ").trim()}function Q({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X,{from:W,to:e.bot}),(0,t.jsx)(ee,{side:"end",name:W.name,mark:(0,t.jsx)(J,{bot:W}),children:(0,t.jsx)(Z,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let W={name:C.ROOM_THURSDAY};function X({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(Y,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(Y,{bot:n})]})})}function Y({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function J({bot:e}){return e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function Z({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,T.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,T.cn)("min-w-0",e&&"inverse"),children:n})})})}function ee({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,T.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function et({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(er,{}),a?(0,t.jsx)(es,{bot:a,bubble:i,children:o}):(0,t.jsx)(en,{bubble:i,className:(0,T.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(Z,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(eo,{text:e.text})})]})}function en({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,T.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",n&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",a),children:e})}function ea({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,T.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function es({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(ea,{bot:e,bubble:n}),(0,t.jsx)(en,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function er(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function ei({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(en,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(en,{className:(0,T.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function eo({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,T.errorToString)(e)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function el({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:ed(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep wrap-anywhere",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let ed=e=>e.split(" (")[0].replace(/\.$/,"");function ec(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||ed(a.lines[0].text)===ed(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=e.roster,c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&O(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>e.id))).size?{...e,lines:e.lines.filter(e=>!("ask"===e.kind&&void 0!==e.questionId&&i.has(e.questionId)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,m.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{l.current&&(e.scrollTop=e.scrollHeight)});for(let n of Array.from(e.children))t.observe(n);return()=>t.disconnect()},[p.length,e.lines,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,T.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",s),children:[!c&&(0,t.jsx)(Q,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(X,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,A,"TAB",0,L,"THURSDAY",0,W,"ThreadFacts",0,B,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:e.label}),(0,t.jsx)(B,{thread:e}),(0,t.jsx)(A,{onClick:a})]})},"leadOf",0,ed,"stepOf",0,V],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),h=e.i(496336),f=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(603854),v=e.i(43374),w=e.i(95187);let y=(0,w.createServerReference)("7f7f8cd31895eb44170d7269aeeb477a94986b2694",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),T=e.i(609856),C=e.i(283653),_=e.i(180245);function M({bot:e,onAllowed:n}){let{data:a}=(0,C.useServerRoute)(x.queryKey.signIns),[s,r]=(0,T.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,C.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var A=e.i(6799),B=e.i(41533),R=e.i(83928);let $=(0,w.createServerReference)("7f0362ac5f4ef10351a512c0ff3b70858aa27e0f46",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,T.useServerAction)($),r=(0,m.useCallback)(async e=>{let r=B.GIVEN_FILES.perMessage-n.length;e.length>r&&A.toast.add({type:"error",title:`At most ${B.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function q({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[e.path?(0,t.jsx)(R.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[O(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let F=null,L={claim:e=>(F=e,()=>{F===e&&(F=null)}),offer:(e,t)=>!!F&&!!e?.closest?.("[data-room]")&&(F(t),!0)},O=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;e.s(["GivenFiles",0,q,"roomDrop",0,L,"useGivenFiles",0,I],709190);var E=e.i(319841);function K({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function H({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(V,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:h,className:f}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:T}=N;(0,m.useEffect)(()=>L.claim(e=>void T(e)),[T]);let C=!!g.trim()&&!i&&!N.arriving,_=async()=>{C&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",f),children:[N.files.length>0&&(0,t.jsx)(q,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,disabled:i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),T(t))},onKeyDown:e=>{let t=(0,E.composing)(e);if("Escape"===e.key&&x&&!t){e.preventDefault(),x();return}"Enter"!==e.key||e.shiftKey||t||(e.preventDefault(),_())},placeholder:o,"aria-label":c,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{T([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),h,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:C?"default":"ghost",disabled:!C,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function G({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,t.jsx)("span",{className:"pl-1 text-muted-foreground",children:"To"}),(0,t.jsx)(V,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(V,{bot:e,size:16}),e.name]},e.name))})})]})}function V({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function Q(){let[e,t]=(0,T.useServerAction)(j.answerThreadAction,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[A,B]=(0,m.useState)(null),[R,$]=(0,m.useState)({id:e.id,bot:e.bot});(R.id!==e.id||R.bot!==e.bot)&&($({id:e.id,bot:e.bot}),w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let I=e.room.participants,q=e.room.questions,F=Math.max(0,q.findIndex(e=>e.id===b)),L=q[F],O="waiting"===n?e.ask:null,E=(0,N.isAppStop)(O),V=L?.bot??(I.some(e=>e.bot===j)?j:e.bot),W=L?.id,[X,Y]=Q(),[J,Z]=(0,T.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,C.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),ee=Y||Z,et=e.room.deliveries.filter(e=>!e.delivered),[en,ea]=(0,T.useServerAction)(y,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)}),es=et.map(e=>`${e.bot}: ${e.text}`).join(" · "),er=I.filter(e=>"running"===e.state).map(e=>e.bot),ei=er.join(", ")||e.bot,eo="running"===n&&I.some(e=>e.bot===V&&("running"===e.state||"queued"===e.state)),el="running"===n&&!eo,ed=V!==e.bot,ec=e=>a.find(t=>t.name===e)??{name:e},eu=async t=>{if(ee)return!1;let n=await X(e,t,V,W);return n&&eo&&_(!1),n},em=async e=>{B(e),await eu(e),B(null)},ex=(a=!1)=>"running"===n||"waiting"===n?(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:Z,disabled:ee,onClick:()=>J(e.id),"aria-label":"Stop this thread",className:(0,D.cn)("h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",a&&"bg-background px-3 hover:bg-background/60 dark:hover:bg-background/60"),children:[!Z&&(0,t.jsx)(c.Square,{className:"size-2.5 fill-current"}),"Stop"]}):null;if(L){let n=L.options??[],a=L.text;return(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(V),word:"Question",children:(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[q.length>1&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:ee||0===F,onClick:()=>k(q[F-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[F+1," / ",q.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:ee||F===q.length-1,onClick:()=>k(q[F+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]}),ex(!0)]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(f.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:A,busy:ee,onChoose:em}),(0,t.jsx)(M,{bot:V,onAllowed:eu}),(0,t.jsx)(U,{threadId:e.id,recipient:V,draftKey:L.id,send:eu,busy:ee,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${V}`},JSON.stringify([e.id,V,L.id]))]})}return E?(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(e.bot),word:"Paused",children:(0,t.jsx)("span",{className:"ml-auto flex shrink-0",children:ex(!0)})}),O?.question&&(0,t.jsx)(h.FoldedText,{text:O.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:O?.options.length?O.options:[N.THREAD_CONTINUE],picked:A,busy:ee,onChoose:em}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,placeholder:"Or put it another way…",label:`Message for ${V}`},JSON.stringify([e.id,V,"paused"]))]}):eo&&!S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[et.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep wrap-anywhere text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ea,onClick:()=>en(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ei} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:ee,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[el&&(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 pr-1.5 pl-3.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[12.5px] leading-5",children:[(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[V," is idle"]}),er.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,t.jsx)(g.ShinyText,{text:`${er.join(", ")} working`,speed:2.4,className:"min-w-0 truncate"})]})]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,autoFocus:eo,onEscape:eo?()=>_(!1):void 0,placeholder:eo?`What's off? ${V} reads this before its next step`:el?`Anything for ${V}? It starts again as soon as you send`:"Anything more? It picks up where it left off",label:`Message for ${V}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:I.length>1?(0,t.jsx)(G,{current:ec(V),bots:I.map(e=>ec(e.bot)),disabled:ee,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:eo?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ee,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,V])),ed&&(0,t.jsxs)("p",{className:"min-w-0 truncate px-1 text-xs text-muted-foreground",children:[V,"’s answer goes back to ",e.bot]}),!!es&&!eo&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",es]})]})]})},"useAnswerThread",0,Q],399512)},603854,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f7bb799009465b1485b93cf098c5444693f8355b4",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},43374,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f9c2c29ef859b4f85149212550e72d94f6c816a69",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,o.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null),[p,b]=(0,a.useState)(e);return p!==e&&(b(e),c(!1)),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep wrap-anywhere",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),h=e.i(660302),f=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7fa811dfc7103cf026174da99a0cfa1fe79c472f3b",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),T=e.i(647163),C=e.i(553429),_=e.i(978411),M=e.i(222055);function A({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})}function B({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R,{thread:e}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(q,{thread:e})]})}function R({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,T.formatCount)(n)} tokens \xb7 in total in ${(0,T.formatCount)(a.input)} \xb7 out ${(0,T.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,T.formatCount)(n)}):null}function $({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)}),[l,d]=(0,m.useState)(n);if(l!==n&&(d(n),r(!1)),!n||!a)return null;let c=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name),title:s?"It summarizes itself at its next step":`Context ${(0,T.formatCount)(n)} of ${(0,T.formatCount)(a)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,T.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":c>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*c))}%`}})})})}let D={working:"text-muted-foreground",waiting:T.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"},I={working:"working",waiting:"waiting",done:"done",cancelled:"stopped"};function q({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(h.ShinyText,{text:I.working,speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,T.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:I[e.status]})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(f.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,T.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(f.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:n.map(n=>{let a=O(e,n.name);return(0,t.jsxs)(f.TabsTrigger,{value:n.name,className:(0,T.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function O(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===W.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(ee,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(J,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(H,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==W.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(et,{line:o.line,surface:r,mention:d},o.key)})})})}function K({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?O(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),f=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",f?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":f,onClick:()=>{o(e=>!e),c(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(h.ShinyText,{text:"asking"===u?"waiting on you":b?V(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:(0,T.cn)("min-w-0 truncate text-[12px] leading-4",f&&"flex-1")}):(0,t.jsx)(U,{words:b?V(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · "),grow:f}),e.length>0&&(0,t.jsx)(G,{open:f})]}),!f&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),f&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ec(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(el,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e,inset:!0},e.id)))})]})}function H({lines:e,trailing:n,bot:a,thread:s}){let r=n?O(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ec(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(el,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(ei,{line:e},e.id))),r&&!i&&(0,t.jsx)(h.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,T.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function G({open:e}){return(0,t.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,t.jsx)(s.ChevronDown,{className:(0,T.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function V(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,T.plainText)(e.text).replace(/\s+/g," ").trim()}function Q({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X,{from:W,to:e.bot}),(0,t.jsx)(ee,{side:"end",name:W.name,mark:(0,t.jsx)(J,{bot:W}),children:(0,t.jsx)(Z,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let W={name:C.ROOM_THURSDAY};function X({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(Y,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(Y,{bot:n})]})})}function Y({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function J({bot:e}){return e.name===W.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function Z({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,T.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,T.cn)("min-w-0",e&&"inverse"),children:n})})})}function ee({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,T.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,T.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function et({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(er,{}),a?(0,t.jsx)(es,{bot:a,bubble:i,children:o}):(0,t.jsx)(en,{bubble:i,className:(0,T.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(Z,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(eo,{text:e.text})})]})}function en({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,T.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",n&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",a),children:e})}function ea({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,T.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function es({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(ea,{bot:e,bubble:n}),(0,t.jsx)(en,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function er(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function ei({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(en,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(en,{className:(0,T.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function eo({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,T.errorToString)(e)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function el({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:ed(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep wrap-anywhere",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let ed=e=>e.split(" (")[0].replace(/\.$/,"");function ec(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||ed(a.lines[0].text)===ed(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=e.roster,c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&O(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>e.id))).size?{...e,lines:e.lines.filter(e=>!("ask"===e.kind&&void 0!==e.questionId&&i.has(e.questionId)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,m.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{l.current&&(e.scrollTop=e.scrollHeight)});for(let n of Array.from(e.children))t.observe(n);return()=>t.disconnect()},[p.length,e.lines,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,T.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",s),children:[!c&&(0,t.jsx)(Q,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(X,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,A,"TAB",0,L,"THURSDAY",0,W,"ThreadFacts",0,B,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:e.label}),(0,t.jsx)(B,{thread:e}),(0,t.jsx)(A,{onClick:a})]})},"leadOf",0,ed,"stepOf",0,V],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),h=e.i(496336),f=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(7453),v=e.i(517759),w=e.i(95187);let y=(0,w.createServerReference)("7fc63176d80d9e8976385c79b5d8e8b9de3dc517f7",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),T=e.i(609856),C=e.i(283653),_=e.i(687835);function M({bot:e,onAllowed:n}){let{data:a}=(0,C.useServerRoute)(x.queryKey.signIns),[s,r]=(0,T.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,C.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var A=e.i(6799),B=e.i(41533),R=e.i(83928);let $=(0,w.createServerReference)("7fed114f2d90f6aa4d4abd2e2b14e227edce09a1f4",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,T.useServerAction)($),r=(0,m.useCallback)(async e=>{let r=B.GIVEN_FILES.perMessage-n.length;e.length>r&&A.toast.add({type:"error",title:`At most ${B.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function q({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[e.path?(0,t.jsx)(R.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[O(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let F=null,L={claim:e=>(F=e,()=>{F===e&&(F=null)}),offer:(e,t)=>!!F&&!!e?.closest?.("[data-room]")&&(F(t),!0)},O=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;e.s(["GivenFiles",0,q,"roomDrop",0,L,"useGivenFiles",0,I],709190);var E=e.i(319841);function K({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function H({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(V,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:h,className:f}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:T}=N;(0,m.useEffect)(()=>L.claim(e=>void T(e)),[T]);let C=!!g.trim()&&!i&&!N.arriving,_=async()=>{C&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",f),children:[N.files.length>0&&(0,t.jsx)(q,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,disabled:i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),T(t))},onKeyDown:e=>{let t=(0,E.composing)(e);if("Escape"===e.key&&x&&!t){e.preventDefault(),x();return}"Enter"!==e.key||e.shiftKey||t||(e.preventDefault(),_())},placeholder:o,"aria-label":c,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{T([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),h,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:C?"default":"ghost",disabled:!C,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function G({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,t.jsx)("span",{className:"pl-1 text-muted-foreground",children:"To"}),(0,t.jsx)(V,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(V,{bot:e,size:16}),e.name]},e.name))})})]})}function V({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function Q(){let[e,t]=(0,T.useServerAction)(j.answerThreadAction,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[A,B]=(0,m.useState)(null),[R,$]=(0,m.useState)({id:e.id,bot:e.bot});(R.id!==e.id||R.bot!==e.bot)&&($({id:e.id,bot:e.bot}),w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let I=e.room.participants,q=e.room.questions,F=Math.max(0,q.findIndex(e=>e.id===b)),L=q[F],O="waiting"===n?e.ask:null,E=(0,N.isAppStop)(O),V=L?.bot??(I.some(e=>e.bot===j)?j:e.bot),W=L?.id,[X,Y]=Q(),[J,Z]=(0,T.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,C.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),ee=Y||Z,et=e.room.deliveries.filter(e=>!e.delivered),[en,ea]=(0,T.useServerAction)(y,{onOk:()=>(0,C.revalidate)(x.queryKey.threads)}),es=et.map(e=>`${e.bot}: ${e.text}`).join(" · "),er=I.filter(e=>"running"===e.state).map(e=>e.bot),ei=er.join(", ")||e.bot,eo="running"===n&&I.some(e=>e.bot===V&&("running"===e.state||"queued"===e.state)),el="running"===n&&!eo,ed=V!==e.bot,ec=e=>a.find(t=>t.name===e)??{name:e},eu=async t=>{if(ee)return!1;let n=await X(e,t,V,W);return n&&eo&&_(!1),n},em=async e=>{B(e),await eu(e),B(null)},ex=(a=!1)=>"running"===n||"waiting"===n?(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:Z,disabled:ee,onClick:()=>J(e.id),"aria-label":"Stop this thread",className:(0,D.cn)("h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",a&&"bg-background px-3 hover:bg-background/60 dark:hover:bg-background/60"),children:[!Z&&(0,t.jsx)(c.Square,{className:"size-2.5 fill-current"}),"Stop"]}):null;if(L){let n=L.options??[],a=L.text;return(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(V),word:"Question",children:(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[q.length>1&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:ee||0===F,onClick:()=>k(q[F-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[F+1," / ",q.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:ee||F===q.length-1,onClick:()=>k(q[F+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]}),ex(!0)]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(f.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:A,busy:ee,onChoose:em}),(0,t.jsx)(M,{bot:V,onAllowed:eu}),(0,t.jsx)(U,{threadId:e.id,recipient:V,draftKey:L.id,send:eu,busy:ee,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${V}`},JSON.stringify([e.id,V,L.id]))]})}return E?(0,t.jsxs)(K,{className:d,children:[(0,t.jsx)(H,{bot:ec(e.bot),word:"Paused",children:(0,t.jsx)("span",{className:"ml-auto flex shrink-0",children:ex(!0)})}),O?.question&&(0,t.jsx)(h.FoldedText,{text:O.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:O?.options.length?O.options:[N.THREAD_CONTINUE],picked:A,busy:ee,onChoose:em}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,placeholder:"Or put it another way…",label:`Message for ${V}`},JSON.stringify([e.id,V,"paused"]))]}):eo&&!S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[et.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep wrap-anywhere text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ea,onClick:()=>en(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ei} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:ee,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[el&&(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 pr-1.5 pl-3.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[12.5px] leading-5",children:[(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[V," is idle"]}),er.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,t.jsx)(g.ShinyText,{text:`${er.join(", ")} working`,speed:2.4,className:"min-w-0 truncate"})]})]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),ex()]}),(0,t.jsx)(U,{threadId:e.id,recipient:V,send:eu,busy:ee,autoFocus:eo,onEscape:eo?()=>_(!1):void 0,placeholder:eo?`What's off? ${V} reads this before its next step`:el?`Anything for ${V}? It starts again as soon as you send`:"Anything more? It picks up where it left off",label:`Message for ${V}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:I.length>1?(0,t.jsx)(G,{current:ec(V),bots:I.map(e=>ec(e.bot)),disabled:ee,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:eo?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:ee,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,V])),ed&&(0,t.jsxs)("p",{className:"min-w-0 truncate px-1 text-xs text-muted-foreground",children:[V,"’s answer goes back to ",e.bot]}),!!es&&!eo&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",es]})]})]})},"useAnswerThread",0,Q],399512)},7453,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f47dfbb47ded1fb60912bd60356cca8e423ee1475",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},517759,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f0c5b3e04521fcdcc4d2e61574ad09b7240b5c856",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,o.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);