@aeolus-fleet/gateway 0.38.1 → 0.38.3

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 (319) hide show
  1. package/README.md +1 -1
  2. package/dist/adapters/prisma/fleet-forgetter.d.ts +1 -1
  3. package/dist/adapters/prisma/fleet-forgetter.js +2 -2
  4. package/dist/adapters/prisma/fleet-forgetter.js.map +1 -1
  5. package/dist/adapters/prisma/generated/browser.d.ts +10 -0
  6. package/dist/adapters/prisma/generated/client.d.ts +10 -0
  7. package/dist/adapters/prisma/generated/internal/class.d.ts +22 -0
  8. package/dist/adapters/prisma/generated/internal/class.js +4 -4
  9. package/dist/adapters/prisma/generated/internal/class.js.map +1 -1
  10. package/dist/adapters/prisma/generated/internal/prismaNamespace.d.ts +172 -1
  11. package/dist/adapters/prisma/generated/internal/prismaNamespace.js +19 -0
  12. package/dist/adapters/prisma/generated/internal/prismaNamespace.js.map +1 -1
  13. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.d.ts +21 -0
  14. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js +19 -0
  15. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js.map +1 -1
  16. package/dist/adapters/prisma/generated/models/QuietHours.d.ts +1102 -0
  17. package/dist/adapters/prisma/generated/models/QuietHours.js +2 -0
  18. package/dist/adapters/prisma/generated/models/QuietHours.js.map +1 -0
  19. package/dist/adapters/prisma/generated/models/QuietShip.d.ts +1031 -0
  20. package/dist/adapters/prisma/generated/models/QuietShip.js +2 -0
  21. package/dist/adapters/prisma/generated/models/QuietShip.js.map +1 -0
  22. package/dist/adapters/prisma/generated/models.d.ts +2 -0
  23. package/dist/adapters/prisma/quiet-preferences.d.ts +12 -0
  24. package/dist/adapters/prisma/quiet-preferences.js +49 -0
  25. package/dist/adapters/prisma/quiet-preferences.js.map +1 -0
  26. package/dist/adapters/trpc/router.d.ts +86 -0
  27. package/dist/adapters/trpc/router.js +37 -0
  28. package/dist/adapters/trpc/router.js.map +1 -1
  29. package/dist/app.js +17 -2
  30. package/dist/app.js.map +1 -1
  31. package/dist/core/argo-inbox/wake-for-argo.d.ts +3 -1
  32. package/dist/core/argo-inbox/wake-for-argo.js +10 -2
  33. package/dist/core/argo-inbox/wake-for-argo.js.map +1 -1
  34. package/dist/core/people/inbox-entry.d.ts +3 -1
  35. package/dist/core/people/inbox-entry.js +2 -2
  36. package/dist/core/people/inbox-entry.js.map +1 -1
  37. package/dist/core/people/person-wakes.d.ts +9 -2
  38. package/dist/core/people/person-wakes.js +10 -2
  39. package/dist/core/people/person-wakes.js.map +1 -1
  40. package/dist/core/people/quiet-hours.d.ts +40 -0
  41. package/dist/core/people/quiet-hours.js +65 -0
  42. package/dist/core/people/quiet-hours.js.map +1 -0
  43. package/dist/core/people/quiet-ships.d.ts +40 -0
  44. package/dist/core/people/quiet-ships.js +24 -0
  45. package/dist/core/people/quiet-ships.js.map +1 -0
  46. package/dist/core/people/read-item.d.ts +31 -0
  47. package/dist/core/people/read-item.js +77 -0
  48. package/dist/core/people/read-item.js.map +1 -0
  49. package/dist/core/people/read-quiet-among.d.ts +15 -0
  50. package/dist/core/people/read-quiet-among.js +15 -0
  51. package/dist/core/people/read-quiet-among.js.map +1 -0
  52. package/dist/core/people/read-quiet-hours.d.ts +30 -0
  53. package/dist/core/people/read-quiet-hours.js +35 -0
  54. package/dist/core/people/read-quiet-hours.js.map +1 -0
  55. package/dist/core/people/read-quiet-ships.d.ts +26 -0
  56. package/dist/core/people/read-quiet-ships.js +19 -0
  57. package/dist/core/people/read-quiet-ships.js.map +1 -0
  58. package/dist/core/people/set-quiet-hours.d.ts +21 -0
  59. package/dist/core/people/set-quiet-hours.js +24 -0
  60. package/dist/core/people/set-quiet-hours.js.map +1 -0
  61. package/dist/core/people/turn-ship-quiet.d.ts +24 -0
  62. package/dist/core/people/turn-ship-quiet.js +25 -0
  63. package/dist/core/people/turn-ship-quiet.js.map +1 -0
  64. package/dist/core/people/wake-person.d.ts +10 -1
  65. package/dist/core/people/wake-person.js +18 -2
  66. package/dist/core/people/wake-person.js.map +1 -1
  67. package/dist/core/shared/errors.d.ts +1 -1
  68. package/dist/core/shared/errors.js.map +1 -1
  69. package/package.json +1 -1
  70. package/src/adapters/prisma/migrations/20261111090000_quiet_preferences/migration.sql +27 -0
  71. package/src/adapters/prisma/schema.prisma +28 -0
  72. package/web/.next/BUILD_ID +1 -1
  73. package/web/.next/build-manifest.json +3 -3
  74. package/web/.next/diagnostics/route-bundle-stats.json +73 -73
  75. package/web/.next/fallback-build-manifest.json +3 -3
  76. package/web/.next/prerender-manifest.json +3 -3
  77. package/web/.next/server/app/(bridge)/bridge/basket/page/server-reference-manifest.json +10 -10
  78. package/web/.next/server/app/(bridge)/bridge/basket/page.js.nft.json +1 -1
  79. package/web/.next/server/app/(bridge)/bridge/basket/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/(bridge)/bridge/done/page/server-reference-manifest.json +4 -4
  81. package/web/.next/server/app/(bridge)/bridge/done/page.js.nft.json +1 -1
  82. package/web/.next/server/app/(bridge)/bridge/done/page_client-reference-manifest.js +1 -1
  83. package/web/.next/server/app/(bridge)/bridge/fleet/page/server-reference-manifest.json +3 -3
  84. package/web/.next/server/app/(bridge)/bridge/fleet/page.js.nft.json +1 -1
  85. package/web/.next/server/app/(bridge)/bridge/fleet/page_client-reference-manifest.js +1 -1
  86. package/web/.next/server/app/(bridge)/bridge/messages/page/server-reference-manifest.json +11 -11
  87. package/web/.next/server/app/(bridge)/bridge/messages/page.js.nft.json +1 -1
  88. package/web/.next/server/app/(bridge)/bridge/messages/page_client-reference-manifest.js +1 -1
  89. package/web/.next/server/app/(bridge)/bridge/page/server-reference-manifest.json +10 -10
  90. package/web/.next/server/app/(bridge)/bridge/page.js.nft.json +1 -1
  91. package/web/.next/server/app/(bridge)/bridge/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/(bridge)/bridge/settings/page/server-reference-manifest.json +3 -3
  93. package/web/.next/server/app/(bridge)/bridge/settings/page.js.nft.json +1 -1
  94. package/web/.next/server/app/(bridge)/bridge/settings/page_client-reference-manifest.js +1 -1
  95. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page/server-reference-manifest.json +4 -4
  96. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page.js.nft.json +1 -1
  97. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page_client-reference-manifest.js +1 -1
  98. package/web/.next/server/app/(bridge)/bridge/settings/routing/page/server-reference-manifest.json +7 -7
  99. package/web/.next/server/app/(bridge)/bridge/settings/routing/page.js.nft.json +1 -1
  100. package/web/.next/server/app/(bridge)/bridge/settings/routing/page_client-reference-manifest.js +1 -1
  101. package/web/.next/server/app/(bridge)/bridge/stay-aware/page/server-reference-manifest.json +10 -10
  102. package/web/.next/server/app/(bridge)/bridge/stay-aware/page.js.nft.json +1 -1
  103. package/web/.next/server/app/(bridge)/bridge/stay-aware/page_client-reference-manifest.js +1 -1
  104. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page/server-reference-manifest.json +19 -19
  105. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page.js.nft.json +1 -1
  106. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
  107. package/web/.next/server/app/(bridge)/outside-parties/[name]/page/server-reference-manifest.json +10 -10
  108. package/web/.next/server/app/(bridge)/outside-parties/[name]/page.js.nft.json +1 -1
  109. package/web/.next/server/app/(bridge)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
  110. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page/server-reference-manifest.json +19 -19
  111. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page.js.nft.json +1 -1
  112. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
  113. package/web/.next/server/app/(bridge)/outside-parties/add/page/server-reference-manifest.json +12 -12
  114. package/web/.next/server/app/(bridge)/outside-parties/add/page.js.nft.json +1 -1
  115. package/web/.next/server/app/(bridge)/outside-parties/add/page_client-reference-manifest.js +1 -1
  116. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +4 -4
  117. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page.js.nft.json +1 -1
  118. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +1 -1
  119. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page/server-reference-manifest.json +4 -4
  120. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page.js.nft.json +1 -1
  121. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page_client-reference-manifest.js +1 -1
  122. package/web/.next/server/app/(bridge)/outside-parties/page/server-reference-manifest.json +4 -4
  123. package/web/.next/server/app/(bridge)/outside-parties/page.js.nft.json +1 -1
  124. package/web/.next/server/app/(bridge)/outside-parties/page_client-reference-manifest.js +1 -1
  125. package/web/.next/server/app/(console)/gateway-off/page/server-reference-manifest.json +1 -1
  126. package/web/.next/server/app/(console)/gateway-off/page.js.nft.json +1 -1
  127. package/web/.next/server/app/(console)/gateway-off/page_client-reference-manifest.js +1 -1
  128. package/web/.next/server/app/(console)/meetings/[meetingId]/page/server-reference-manifest.json +3 -3
  129. package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.nft.json +1 -1
  130. package/web/.next/server/app/(console)/meetings/[meetingId]/page_client-reference-manifest.js +1 -1
  131. package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +9 -9
  132. package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
  133. package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
  134. package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
  135. package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
  136. package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
  137. package/web/.next/server/app/(console)/slack/disconnect/page/server-reference-manifest.json +9 -9
  138. package/web/.next/server/app/(console)/slack/disconnect/page.js.nft.json +1 -1
  139. package/web/.next/server/app/(console)/slack/disconnect/page_client-reference-manifest.js +1 -1
  140. package/web/.next/server/app/(console)/slack/expose/page/server-reference-manifest.json +9 -9
  141. package/web/.next/server/app/(console)/slack/expose/page.js.nft.json +1 -1
  142. package/web/.next/server/app/(console)/slack/expose/page_client-reference-manifest.js +1 -1
  143. package/web/.next/server/app/(console)/slack/page/server-reference-manifest.json +9 -9
  144. package/web/.next/server/app/(console)/slack/page.js.nft.json +1 -1
  145. package/web/.next/server/app/(console)/slack/page_client-reference-manifest.js +1 -1
  146. package/web/.next/server/app/(console)/slack/remove/page/server-reference-manifest.json +9 -9
  147. package/web/.next/server/app/(console)/slack/remove/page.js.nft.json +1 -1
  148. package/web/.next/server/app/(console)/slack/remove/page_client-reference-manifest.js +1 -1
  149. package/web/.next/server/app/_global-error.html +1 -1
  150. package/web/.next/server/app/_global-error.rsc +1 -1
  151. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  152. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  153. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  154. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  155. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  156. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  157. package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
  158. package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
  159. package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
  160. package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
  161. package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
  162. package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
  163. package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
  164. package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
  165. package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
  166. package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js +1 -1
  167. package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js.map +1 -1
  168. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_messages_page_actions_1tg2-lw0i6g9l.js +1 -1
  169. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_messages_page_actions_1tg2-lw0i6g9l.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js +1 -1
  171. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js.map +1 -1
  172. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js +1 -1
  173. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js.map +1 -1
  174. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js +1 -1
  175. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js.map +1 -1
  176. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js +1 -1
  177. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js.map +1 -1
  178. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js +1 -1
  179. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js +1 -1
  181. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js.map +1 -1
  182. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js +1 -1
  183. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js.map +1 -1
  184. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js +1 -1
  185. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js.map +1 -1
  186. package/web/.next/server/chunks/ssr/[root-of-the-server]__04g-10_lwy-l2._.js +1 -1
  187. package/web/.next/server/chunks/ssr/[root-of-the-server]__0geojgpilsx6e._.js +1 -1
  188. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ktja-0332icp._.js +1 -1
  189. package/web/.next/server/chunks/ssr/[root-of-the-server]__0m_acooerfxfb._.js +1 -1
  190. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js +1 -1
  191. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js.map +1 -1
  192. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js +1 -1
  193. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js.map +1 -1
  194. package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js +1 -1
  195. package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js.map +1 -1
  196. package/web/.next/server/chunks/ssr/[root-of-the-server]__14hg5j_bmrdxt._.js +1 -1
  197. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js +1 -1
  198. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js.map +1 -1
  199. package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js +1 -1
  200. package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js.map +1 -1
  201. package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.js +1 -1
  202. package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.js.map +1 -1
  203. package/web/.next/server/chunks/ssr/[root-of-the-server]__1odtiyyqa5vlq._.js +1 -1
  204. package/web/.next/server/chunks/ssr/[root-of-the-server]__1vrtfw4dxnfxt._.js +1 -1
  205. package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js +1 -1
  206. package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js.map +1 -1
  207. package/web/.next/server/chunks/ssr/_0_nfv33ug5g31._.js +1 -1
  208. package/web/.next/server/chunks/ssr/_0_nfv33ug5g31._.js.map +1 -1
  209. package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js +1 -1
  210. package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js.map +1 -1
  211. package/web/.next/server/chunks/ssr/{_08jq3ga73wgy1._.js → _0nz6sbd5qnb97._.js} +2 -2
  212. package/web/.next/server/chunks/ssr/{_08jq3ga73wgy1._.js.map → _0nz6sbd5qnb97._.js.map} +1 -1
  213. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
  214. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
  215. package/web/.next/server/chunks/ssr/{_090owdv-b-luu._.js → _0tvjhfjjhmllr._.js} +2 -2
  216. package/web/.next/server/chunks/ssr/{_090owdv-b-luu._.js.map → _0tvjhfjjhmllr._.js.map} +1 -1
  217. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
  218. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
  219. package/web/.next/server/chunks/ssr/{_0cbvl92sxxpsf._.js → _13b33o-hvhs42._.js} +2 -2
  220. package/web/.next/server/chunks/ssr/{_0cbvl92sxxpsf._.js.map → _13b33o-hvhs42._.js.map} +1 -1
  221. package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js +1 -1
  222. package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js.map +1 -1
  223. package/web/.next/server/chunks/ssr/{_0t-yyzc3pbo8m._.js → _1j8eks4eyxdp2._.js} +2 -2
  224. package/web/.next/server/chunks/ssr/{_0t-yyzc3pbo8m._.js.map → _1j8eks4eyxdp2._.js.map} +1 -1
  225. package/web/.next/server/chunks/ssr/_1l2qxsuvs6qro._.js +3 -0
  226. package/web/.next/server/chunks/ssr/{_0239h2ocqyibp._.js.map → _1l2qxsuvs6qro._.js.map} +1 -1
  227. package/web/.next/server/chunks/ssr/_1pd7s9yymb567._.js +57 -0
  228. package/web/.next/server/chunks/ssr/_1pd7s9yymb567._.js.map +1 -0
  229. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
  230. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
  231. package/web/.next/server/chunks/ssr/_1preuo1e_lntw._.js +3 -0
  232. package/web/.next/server/chunks/ssr/{_087cuueeby0hw._.js.map → _1preuo1e_lntw._.js.map} +1 -1
  233. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
  234. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
  235. package/web/.next/server/chunks/ssr/_20soyq-dwc131._.js +57 -0
  236. package/web/.next/server/chunks/ssr/_20soyq-dwc131._.js.map +1 -0
  237. package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js +1 -1
  238. package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js.map +1 -1
  239. package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js +1 -1
  240. package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js.map +1 -1
  241. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js +1 -1
  242. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js.map +1 -1
  243. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js +1 -1
  244. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js.map +1 -1
  245. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js +1 -1
  246. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js.map +1 -1
  247. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js +1 -1
  248. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js.map +1 -1
  249. package/web/.next/server/chunks/ssr/{web_features_0fji0qhw-fk8x._.js → web_features_0r6fdx9tk4lfm._.js} +2 -2
  250. package/web/.next/server/chunks/ssr/{web_features_0fji0qhw-fk8x._.js.map → web_features_0r6fdx9tk4lfm._.js.map} +1 -1
  251. package/web/.next/server/chunks/ssr/{web_features_1tbi4ma6mufmp._.js → web_features_115v4ed7e_b-8._.js} +2 -2
  252. package/web/.next/server/chunks/ssr/{web_features_1tbi4ma6mufmp._.js.map → web_features_115v4ed7e_b-8._.js.map} +1 -1
  253. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +1 -1
  254. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -1
  255. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +1 -1
  256. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -1
  257. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
  258. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
  259. package/web/.next/server/chunks/ssr/{web_features_bridge_0zkl4uc3a1wa6._.js → web_features_bridge_0cugt1x2wt4m0._.js} +2 -2
  260. package/web/.next/server/chunks/ssr/{web_features_bridge_0zkl4uc3a1wa6._.js.map → web_features_bridge_0cugt1x2wt4m0._.js.map} +1 -1
  261. package/web/.next/server/chunks/ssr/web_features_bridge_hooks_bridge-actions_ts_0h-_xm2rcb-ij._.js +1 -1
  262. package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js +1 -1
  263. package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js.map +1 -1
  264. package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js +1 -1
  265. package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js.map +1 -1
  266. package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js +1 -1
  267. package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js.map +1 -1
  268. package/web/.next/server/chunks/ssr/web_features_bridge_state_message-rows_tsx_1ky4-xa4az_yu._.js +1 -1
  269. package/web/.next/server/chunks/ssr/web_features_bridge_state_message-rows_tsx_1ky4-xa4az_yu._.js.map +1 -1
  270. package/web/.next/server/chunks/ssr/web_features_bridge_state_messages-panel_tsx_1yvr_ww639d25._.js +1 -1
  271. package/web/.next/server/chunks/ssr/web_features_bridge_state_messages-panel_tsx_1yvr_ww639d25._.js.map +1 -1
  272. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js +1 -1
  273. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map +1 -1
  274. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
  275. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
  276. package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
  277. package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
  278. package/web/.next/server/chunks/ssr/web_features_slack_actions_ts_1l3yg9vl20_vu._.js +1 -1
  279. package/web/.next/server/middleware-build-manifest.js +3 -3
  280. package/web/.next/server/pages/500.html +1 -1
  281. package/web/.next/server/preview-props.json +3 -3
  282. package/web/.next/server/server-reference-manifest.js +1 -1
  283. package/web/.next/server/server-reference-manifest.json +51 -51
  284. package/web/.next/static/chunks/{0pypj0_ydhccr.js → 0-r1bwsrnja6x.js} +1 -1
  285. package/web/.next/static/chunks/{2vaqwkb5z2wz8.js → 0fm-6zl5hm5-9.js} +1 -1
  286. package/web/.next/static/chunks/{3nifwjh6pf2oa.js → 0iu2ts1oy1nzi.js} +1 -1
  287. package/web/.next/static/chunks/{0t63w7558fw1a.js → 0yx6w-_36c76d.js} +1 -1
  288. package/web/.next/static/chunks/1mke3ztpr-wmu.js +1 -0
  289. package/web/.next/static/chunks/1nicl2mkstipv.js +1 -0
  290. package/web/.next/static/chunks/{36ccnz8nhzbm0.js → 1t0fq-vepg52w.js} +1 -1
  291. package/web/.next/static/chunks/{2w5o8qcjwdoqm.js → 1xzhbir4zphli.js} +1 -1
  292. package/web/.next/static/chunks/1zy3y1lvr38g4.js +1 -0
  293. package/web/.next/static/chunks/{2h3yztsbjw8sd.js → 2-wl7cajj-ynx.js} +1 -1
  294. package/web/.next/static/chunks/{1js-1nyhxr0b3.js → 2a8ce88qvmtth.js} +1 -1
  295. package/web/.next/static/chunks/{0-mbc7l-ce37z.js → 2o5u1c-wzvbgm.js} +1 -1
  296. package/web/.next/static/chunks/{3a347eh56u6w0.js → 2rtc0exjb6w5l.js} +1 -1
  297. package/web/.next/static/chunks/2s1d7_ca-qsif.js +1 -0
  298. package/web/.next/static/chunks/39m3_x0v7i-za.js +1 -0
  299. package/web/.next/static/chunks/{1zv4cn94bmk2x.js → 3_jnl679rr4gb.js} +1 -1
  300. package/web/.next/static/chunks/{3qmppgfbfoif6.js → 3ool2gtdd_dtc.js} +1 -1
  301. package/web/.next/static/chunks/3z9siyl43u-rb.js +1 -0
  302. package/web/.next/static/chunks/{3tmji77wyx7q4.js → 3zqj28w22cklq.js} +1 -1
  303. package/web/.next/trace +1 -1
  304. package/web/.next/trace-build +1 -1
  305. package/web/.next/server/chunks/ssr/_0239h2ocqyibp._.js +0 -3
  306. package/web/.next/server/chunks/ssr/_087cuueeby0hw._.js +0 -3
  307. package/web/.next/server/chunks/ssr/_1e7srghw1_x9p._.js +0 -57
  308. package/web/.next/server/chunks/ssr/_1e7srghw1_x9p._.js.map +0 -1
  309. package/web/.next/server/chunks/ssr/_1q0rhps0nvrq5._.js +0 -57
  310. package/web/.next/server/chunks/ssr/_1q0rhps0nvrq5._.js.map +0 -1
  311. package/web/.next/static/chunks/06tpbp-er8dog.js +0 -1
  312. package/web/.next/static/chunks/1ovt2ef2naqgj.js +0 -1
  313. package/web/.next/static/chunks/24qt7-p52g31c.js +0 -1
  314. package/web/.next/static/chunks/2ukdl2v0q677n.js +0 -1
  315. package/web/.next/static/chunks/33kxvt_kxg5yb.js +0 -1
  316. package/web/.next/static/chunks/38m6y148vwux3.js +0 -1
  317. /package/web/.next/static/{9KCcVgnuuZ1fElZoEqTjx → vYCXAc7TLc4U7-Vynu6VC}/_buildManifest.js +0 -0
  318. /package/web/.next/static/{9KCcVgnuuZ1fElZoEqTjx → vYCXAc7TLc4U7-Vynu6VC}/_clientMiddlewareManifest.js +0 -0
  319. /package/web/.next/static/{9KCcVgnuuZ1fElZoEqTjx → vYCXAc7TLc4U7-Vynu6VC}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[37134,45017,47125,10030,e=>{var t=e.i(24189);e.s(["f",0,t],37134),e.s(["f",0,t],45017),e.s(["f",0,t],47125),e.s(["f",0,t],10030)},66595,e=>{var t=e.i(56420);let n={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],66595)},95187,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0});var r={callServer:function(){return a.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return d.findSourceMapURL}};for(var s in r)Object.defineProperty(n,s,{enumerable:!0,get:r[s]});let a=e.r(32120),d=e.r(92245),i=e.r(35326)},27921,e=>{var t=e.i(43476),n=e.i(71645),r=e.i(95187);let s=(0,r.createServerReference)("60f1c81cb059506421a786ca06d16eed1bdec8eb3b",r.callServer,void 0,r.findSourceMapURL,"approveServer"),a=(0,r.createServerReference)("607c8bc28c55c0eb9962c932ac7a3cf0f34bb428d2",r.callServer,void 0,r.findSourceMapURL,"checkServer");var d=e.i(28008),i=e.i(88374),l=e.i(62052),o=e.i(30402),c=e.i(58107);let u=["Address","Check","Owner"],m=["Address","Owner","Sign in"];var p=e.i(94984);function x({refusal:e}){return void 0===e?null:(0,t.jsx)(p.f,{state:{kind:"refused",message:e}})}function h({names:e,at:n}){return(0,t.jsx)("ol",{className:"flex gap-4 text-meta",children:e.map((e,r)=>(0,t.jsxs)("li",{"aria-current":r===n?"step":void 0,className:r<=n?"font-semibold":"text-muted-foreground",children:[r+1," ",e]},e))})}function f({state:e,action:r,fleetId:s}){let[a,p]=(0,n.useState)((0,i.G)(e.fields.credentialKind??"")),g=a===i.m.kind;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h,{names:a===i.m.kind?m:u,at:0}),(0,t.jsxs)("form",{action:r,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-address",children:[(0,t.jsx)("input",{type:"hidden",name:d.H,value:s}),(0,t.jsx)(x,{refusal:e.refusal}),(0,t.jsxs)("label",{className:o.z,children:[(0,t.jsx)("span",{children:"Streamable HTTP address"}),(0,t.jsx)("input",{className:o.w,type:"url",name:"url",defaultValue:e.fields.url??"",placeholder:"https://mcp.example.com/mcp",required:!0})]}),(0,t.jsx)(l.f,{legend:"The server's credential",fields:e.fields,noneHelp:"The gateway sends no credential: for a server reached only on a private network.",canEachPersonSignIn:!0,onKindChange:p}),(0,t.jsx)("div",{children:(0,t.jsx)(c.f,{pending:g?"Next…":"Checking the server…",testId:"add-server-check",children:g?"Next":"Check the server"})})]})]})}var g=e.i(65818),b=e.i(25621),j=e.i(97e3);function v({tool:e,control:n,testId:r}){let{name:s,description:a,isReadOnly:d,isNew:i=!1}=e,l=void 0===a?"":a.split("\n").map(e=>e.trim()).find(e=>""!==e)??"",o=void 0!==a&&a.trim()!==l;return(0,t.jsxs)("li",{className:"grid gap-1 border-b border-border py-2 last:border-b-0","data-testid":r,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[n,(0,t.jsx)("span",{className:"font-mono",children:s}),d?(0,t.jsx)(j.E,{children:"reads only"}):null,i?(0,t.jsx)(j.T,{tone:"attention",label:"New"}):null]}),""===l?null:o?(0,t.jsxs)("details",{className:"text-muted-foreground",children:[(0,t.jsx)("summary",{className:"cursor-pointer",children:l}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-line",children:a})]}):(0,t.jsx)("p",{className:"text-muted-foreground",children:l})]})}function w({tools:e,canSwitch:r}){let[s,a]=(0,n.useState)(new Set),d=e.length-s.size;return(0,t.jsxs)("section",{className:"grid gap-2","data-testid":"add-server-tools",children:[(0,t.jsxs)("h2",{className:"flex flex-wrap justify-between gap-2 text-section font-semibold",children:[(0,t.jsxs)("span",{children:["The server answers: ",e.length," ",1===e.length?"tool":"tools"]}),r?(0,t.jsxs)("span",{role:"status",className:"font-normal text-muted-foreground","data-testid":"add-server-tools-on",children:[d," of ",e.length," on"]}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground",children:r?"The fleet may call only the tools switched on. A tool the server adds later starts off.":"Switching tools needs gateway:approve: every tool starts on, and an approver switches them on its page."}),(0,t.jsx)("ul",{className:"grid",children:e.map(e=>{let n=!s.has(e.name);return(0,t.jsx)(v,{tool:e,testId:"add-server-tool",control:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"hidden",name:"toolShown",value:e.name}),n?(0,t.jsx)("input",{type:"hidden",name:"toolOn",value:e.name}):null,(0,t.jsx)(b.f,{isOn:n,label:e.name,onClick:()=>{var t;t=e.name,a(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n})}})]}):null},e.name)})})]})}let y=["url","credentialKind","token","clientId","clientSecret","issuer","scope"];function N({state:e,refused:r,action:s,onBack:a,fleetId:i,canSwitchTools:l}){let p,f="refused"===r.kind&&r.requestId===e.requestId,b=f?r.fields:e.fields,j=b.url??"",[v,k]=(0,n.useState)(b.name??function(e){if(!URL.canParse(e))return"";let{hostname:t}=new URL(e);return/^\d+(\.\d+){3}$/.test(t)||t.startsWith("[")?"":(t.split(".").filter(e=>"mcp"!==e&&"www"!==e)[0]??"").toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"")}(j)),S=e.tools;return(0,t.jsxs)(t.Fragment,{children:[null===S?(0,t.jsx)(h,{names:m,at:1}):(0,t.jsx)(h,{names:u,at:2}),(0,t.jsxs)("form",{action:s,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-owner",children:[null===S?null:(0,t.jsx)(w,{tools:S,canSwitch:l}),(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Its owner"}),(0,t.jsx)(x,{refusal:f?r.message:void 0}),(0,t.jsx)("input",{type:"hidden",name:d.H,value:i}),(0,t.jsx)("input",{type:"hidden",name:"requestId",value:e.requestId}),y.map(e=>(0,t.jsx)("input",{type:"hidden",name:e,value:b[e]??""},e)),(0,t.jsx)("p",{className:"font-mono text-muted-foreground",children:j}),(0,t.jsxs)("label",{className:o.z,children:[(0,t.jsx)("span",{children:"Proxy ship's name"}),(0,t.jsx)("input",{className:o.w,type:"text",name:"name",value:v,onChange:e=>{k(e.target.value)},required:!0})]}),(0,t.jsx)(g.f,{choices:e.owners,current:e.owners.find(e=>e.shipId===b.ownerShipId)??null,help:"A person ship or argo. It answers for this server."}),(0,t.jsxs)("label",{className:o.z,children:[(0,t.jsx)("span",{children:"Calls at once"}),(0,t.jsx)("input",{className:o.w,type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:b.concurrencyLimit??"4"})]}),null===S?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Its tools show once someone signs in."}):null,(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(c.f,{pending:null===S?"Checking the sign-in…":"Adding…",testId:"add-server-approve",children:""===(p=v.trim())?"Add as outside party":p.length>20?`Add ${p.slice(0,20)}…`:`Add ${p}`}),(0,t.jsx)("button",{type:"button",className:o.x.secondary,onClick:a,children:"Back to the address"})]})]})]})}var k=e.i(65894),S=e.i(31831),I=e.i(3032);function C({fleetId:e,name:r}){let[s,a]=(0,n.useActionState)(I.f,d.Q);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h,{names:m,at:2}),(0,t.jsxs)("form",{action:a,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-sign-in",children:[(0,t.jsx)(p.f,{state:{kind:"done",message:`${r} is added.`}}),(0,t.jsx)(p.f,{state:s}),(0,t.jsx)("input",{type:"hidden",name:d.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:r}),(0,t.jsxs)("p",{children:["Sign in to ",r," for yourself. Its tools show after the first sign-in."]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(c.f,{pending:`Opening ${r}…`,testId:"add-server-sign-in-start",children:["Sign in to ",r]}),(0,t.jsx)("a",{href:(0,k.i)((0,S.N)(r),e),className:o.x.secondary,children:"Later"})]})]})]})}e.s(["AddServer",0,function({fleetId:e,canSwitchTools:r}){let[d,i]=(0,n.useActionState)(a,{step:"address",fields:{}}),[l,o]=(0,n.useActionState)(s,{kind:"idle"}),[c,u]=(0,n.useState)(void 0),m="owner"===d.step&&c!==d.requestId?d:void 0;return(0,t.jsxs)("div",{className:"grid max-w-160 gap-3",children:[(0,t.jsx)("h1",{className:"text-heading-touch font-semibold max-sm:sr-only",children:"Add MCP server"}),"added"===l.kind?(0,t.jsx)(C,{fleetId:e,name:l.name}):void 0===m?(0,t.jsx)(f,{state:d,action:i,fleetId:e}):(0,t.jsx)(N,{state:m,refused:l,action:o,onBack:()=>{u(m.requestId)},fleetId:e,canSwitchTools:r})]})}],27921)},55070,e=>{var t=e.i(43476);let n={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},r={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:s,variant:a="secondary",size:d="regular",children:i,className:l="",disabled:o,...c}){return(0,t.jsx)("button",{...c,disabled:!0===o||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${r[d]} ${n[a]} ${l}`,children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),s]}):i})},"o",0,r])},28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},88374,e=>{let t=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}],n={kind:"personSignIn",label:"Each person signs in"},r=[...t,n];e.s(["a",0,r,"x",0,t,"m",0,n,"G",0,function(e){return r.find(({kind:t})=>t===e)?.kind??"bearer"},"C",0,function(e){return t.find(({kind:t})=>t===e)?.kind??"bearer"}])},62052,e=>{var t=e.i(43476),n=e.i(16327),r=e.i(71645),s=e.i(88374),a=e.i(30402);e.s(["f",0,function({legend:e,fields:d,noneHelp:i,canEachPersonSignIn:l=!1,onKindChange:o}){let c=l?s.G:s.C,[u,m]=(0,r.useState)(c(d.credentialKind??""));return(0,t.jsxs)("fieldset",{className:"grid gap-3",children:[(0,t.jsx)("legend",{className:"font-medium",children:e}),(0,t.jsxs)("span",{className:"relative",children:[(0,t.jsx)("select",{className:a.D,"aria-label":e,name:"credentialKind",value:u,onChange:e=>{let t=c(e.target.value);m(t),o?.(t)},children:(l?s.a:s.x).map(({kind:e,label:n})=>(0,t.jsx)("option",{value:e,children:n},e))}),(0,t.jsx)(n.f,{"aria-hidden":!0,className:"pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground"})]}),"clientCredentials"===u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:a.z,children:[(0,t.jsx)("span",{children:"Client id"}),(0,t.jsx)("input",{className:a.w,type:"text",name:"clientId",defaultValue:d.clientId??""})]}),(0,t.jsxs)("label",{className:a.z,children:[(0,t.jsx)("span",{children:"Client secret"}),(0,t.jsx)("input",{className:a.w,type:"password",name:"clientSecret"})]}),(0,t.jsxs)("label",{className:a.z,children:[(0,t.jsx)("span",{children:"Issuer"}),(0,t.jsx)("input",{className:a.w,type:"url",name:"issuer",defaultValue:d.issuer??""})]}),(0,t.jsxs)("label",{className:a.z,children:[(0,t.jsx)("span",{children:"Scope"}),(0,t.jsx)("input",{className:a.w,type:"text",name:"scope",defaultValue:d.scope??""})]})]}):"bearer"===u?(0,t.jsxs)("label",{className:a.z,children:[(0,t.jsx)("span",{children:"Bearer token"}),(0,t.jsx)("input",{className:a.w,type:"password",name:"token"})]}):u===s.m.kind?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Each person signs in for themselves. A ship calls under its owner's sign-in."}):(0,t.jsx)("p",{className:"text-muted-foreground",children:i})]})}])},30402,e=>{let t="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",n={primary:`${t} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${t} border border-border bg-card hover:bg-accent`,destructive:`${t} bg-destructive text-destructive-foreground`};e.s(["x",0,n,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","E",0,"rounded-lg border border-border bg-card p-3 text-card-foreground","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1","D",0,"h-9 w-full appearance-none rounded-md border border-input bg-background pr-8 pl-3"])},94984,e=>{var t=e.i(43476);e.s(["f",0,function({state:e,testId:n}){switch(e.kind){case"idle":return null;case"done":return(0,t.jsx)("p",{role:"status","data-testid":n,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,t.jsx)("p",{role:"alert","data-testid":n,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},65818,e=>{var t=e.i(43476),n=e.i(30402);e.s(["f",0,function({choices:e,current:r,help:s,refusal:a}){let d=null===r||e.some(e=>e.shipId===r.shipId)?e:[r,...e];return(0,t.jsxs)("label",{className:n.z,children:[(0,t.jsx)("span",{children:"Owner"}),(0,t.jsxs)("select",{className:n.w,name:"ownerShipId",defaultValue:r?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===r?(0,t.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,d.map(e=>(0,t.jsx)("option",{value:e.shipId,children:e.name},e.shipId))]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a??s})]})}])},58107,e=>{var t=e.i(43476),n=e.i(74080),r=e.i(30402);e.s(["f",0,function({children:e,pending:s,kind:a="primary",testId:d}){let i=(0,n.useFormStatus)();return(0,t.jsx)("button",{type:"submit",className:r.x[a],disabled:i.pending,"aria-busy":i.pending,"data-testid":d,children:i.pending?s:e})}])},67914,e=>{var t=e.i(43476),n=e.i(71645),r=e.i(95187);let s=(0,r.createServerReference)("4028a841e3a56738319e16ecad460936d256385103",r.callServer,void 0,r.findSourceMapURL,"setTheme"),a=["light","dark","system"];e.s(["f",0,function({email:e,accountUrl:r,theme:d,entries:i=[]}){let[l,o]=(0,n.useState)(d),[c,u]=(0,n.useState)(!1),m=(0,n.useRef)(null);return{account:{name:e,signedInAs:"account",accountUrl:r,theme:l,themes:a,hasTheme:!0,onThemeChange:e=>{let t;o(e),document.documentElement.dataset.theme=e,t="dark"===e||"system"===e&&window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.classList.toggle("dark",t),s(e)},shortcuts:[],helpUrl:"https://github.com/ThomasHendrickx/aeolus-fleet",onSignOut:()=>{u(!0),m.current?.requestSubmit()},isSigningOut:c,entries:i},signOutForm:(0,t.jsx)("form",{ref:m,method:"post",action:"/sign-in/end",hidden:!0})}}],67914)},97e3,e=>{var t=e.i(43476);let n={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},r={waiting:"text-tone-waiting-fg",active:"text-tone-active-fg",ok:"text-tone-ok-fg",attention:"rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-tone-attention-fg",ended:"text-tone-ended-fg"};e.s(["T",0,function({tone:e,label:s,look:a="pill",icon:d}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-caption ${"pill"===a?`rounded-full border px-2 ${n[e]}`:`h-5.5 px-0.5 font-medium ${r[e]}`}`,children:[d,s]})},"E",0,function({children:e,isMono:n=!1}){return(0,t.jsx)("span",{className:`inline-flex h-5.5 items-center rounded-sm border border-border px-1.5 text-caption font-medium ${n?"font-mono":""}`,children:e})}])},65894,e=>{let t="fleet";e.s(["n",0,t,"i",0,function(e,n){let[r="",s=""]=e.split("?"),a=new URLSearchParams(s);return a.set(t,n),`${r}?${a.toString()}`}])}],18566,(e,t,n)=>{t.exports=e.r(76562)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[69288,73459,31317,6379,70340,2356,90414,e=>{e.s(["f",0,function(e,t){e.replaceState(null,"",t)}],69288),e.s(["f",0,function(e){let t=new URLSearchParams({fleet:e.fleetId,...void 0===e.cursor?{}:{cursor:e.cursor}});return`/meetings/${encodeURIComponent(e.meetingId)}?${t.toString()}`}],73459);var t=e.i(95187);let i=(0,t.createServerReference)("400eae2d6cd258045189d51c623c82d36a37f64386",t.callServer,void 0,t.findSourceMapURL,"answerDelivery");e.s(["f",0,i],31317);let n=(0,t.createServerReference)("409c12fe0b01d63ebbbc2a12b2b2dfac6477ec3d50",t.callServer,void 0,t.findSourceMapURL,"doneDelivery");e.s(["f",0,n],6379);let r=(0,t.createServerReference)("606e0d74c6b0d3d1df4de39bd22d9408f01a679551",t.callServer,void 0,t.findSourceMapURL,"openDelivery");e.s(["f",0,r],70340);let a=(0,t.createServerReference)("40174e9e0edfb1138ae859a3f77519ab7ee8658099",t.callServer,void 0,t.findSourceMapURL,"putInBasket");e.s(["f",0,a],2356);let s=(0,t.createServerReference)("407746915cb9e535e2c80db4d3e85e4103bcf54f2b",t.callServer,void 0,t.findSourceMapURL,"putPickInBasket");e.s(["f",0,s],90414)},70812,71136,96315,28623,e=>{var t=e.i(56420);let i={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],70812);let r={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],71136);let s={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};s.node;let d=(0,t.f)(s);e.s(["f",0,d],96315);let o={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};o.node;let l=(0,t.f)(o);e.s(["f",0,l],28623)},51481,59381,e=>{var t=e.i(75043);e.s(["f",()=>t.f],51481);var i=e.i(56420);let n={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};n.node;let r=(0,i.f)(n);e.s(["f",0,r],59381)},66595,e=>{var t=e.i(56420);let i={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],66595)},95187,(e,t,i)=>{Object.defineProperty(i,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return d.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var r in n)Object.defineProperty(i,r,{enumerable:!0,get:n[r]});let a=e.r(32120),s=e.r(92245),d=e.r(35326)},69969,e=>{var t=e.i(95187);let i=(0,t.createServerReference)("60e7e6f4ed489b1e317abedf31af08ac78c4e3ca08",t.callServer,void 0,t.findSourceMapURL,"removeFromBasket");e.s(["f",0,i])},28287,e=>{var t=e.i(18566),i=e.i(71645);let n={standing:new Set,staleSince:new Map};e.s(["f",0,function(e){let r=(0,t.useRouter)(),[a,s]=(0,i.useState)(n),[d,o]=(0,i.useState)(()=>Date.now()),l=e.map(({deliveryId:e,isStale:t})=>`${e}${t?"!":""}`).join(" ");return(0,i.useEffect)(()=>{let e=Date.now();s(t=>(function(e,t){let{items:i,atMs:n}=t,r=new Set(e.standing),a=new Map(e.staleSince);for(let{deliveryId:e,isStale:t}of i)t?r.has(e)&&!a.has(e)&&a.set(e,n):r.add(e);return{standing:r,staleSince:a}})(t,{items:""===l?[]:l.split(" ").map(e=>({deliveryId:e.replace("!",""),isStale:e.endsWith("!")})),atMs:e})),o(e)},[l]),(0,i.useEffect)(()=>{let e,t=0===(e=[...a.staleSince.values()].flatMap(e=>[e+5e3-300,e+5e3]).filter(e=>e>d)).length?void 0:Math.min(...e);if(void 0===t)return;let i=setTimeout(()=>{o(Date.now()),[...a.staleSince.values()].some(e=>e+5e3===t)&&r.refresh()},t-Date.now());return()=>{clearTimeout(i)}},[a,d,r]),e=>(function(e,t){let{item:i,atMs:n}=t;if(!i.isStale)return"shown";let r=e.staleSince.get(i.deliveryId);if(void 0===r)return e.standing.has(i.deliveryId)?"shown":"gone";let a=n-r;return a>=5e3?"gone":a>=4700?"leaving":"shown"})(a,{item:e,atMs:d})}],28287)},31785,e=>{let t={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},i={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},n=["decide","do"],r="Bridge keeps every item.",a={label:"Not offered",isOk:!1},s={label:"Off",isOk:!1},d="Says only that something waits, with a link here.",o=`${d} Nothing is on until you turn it on.`,l="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,t,"k",0,i,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${l}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${l}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:t}){return e?t?{state:{label:"On",isOk:!0},description:d,action:"turnOff"}:{state:s,description:o,action:"turnOn"}:{state:a,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,t){return e.jobs.filter(({job:e,places:i})=>i.email!==t&&(!t||n.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:t}))},"r",0,function(e){let t=["Bridge",...e.map(e=>c[e])],i=t.at(-1),n=1===t.length?"Bridge":`${t.slice(0,-1).join(", ")} and ${String(i)}`;return`Shows in ${n}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:t,link:i}=e;return null===i?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${t} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${i.slackName} in ${t}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:n,place:a,isOn:s,waiting:d,isChatOn:o}=e,{name:l,item:c,items:u}=t[n],m=`${i[a]} is ${s?"on":"off"} for ${l}`;return s?"chat"===a?{title:m,detail:`A chat lists every ${c} not done when you ask it.`}:{title:m,detail:`${i[a]} shows ${u} that arrive from now on.${void 0===d||0===d?"":` The ${String(d)} already waiting ${1===d?"stays":"stay"} ${o?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:m,detail:"everything-else"===n&&"slack"===a?`Bots only: a bot ship's messages and replies to Slack still show there. ${r}`:r}},"B",0,function(e){if(!e.isOffered)return{state:a,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:s,description:"This browser takes no web push.",action:"none"};let t=e.browsers.find(({endpoint:t,isGone:i})=>t===e.ownEndpoint&&!i);return void 0===t?{state:s,description:o,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${t.browser}. ${d}`,action:"remove"}}])},35159,e=>{e.s(["b",0,function(e){let t="report-unchanged"===e.signal?`The alert clears when ${e.ship.name} reports again`:"The alert clears by itself once what it tells of moves";return`Aeolus only tells you. ${t}; nothing is sent on clear, so this stays here as it was.`},"c",0,function({consoleUrl:e,shipId:t}){return`${e.replace(/\/$/,"")}/ships/${t}`},"E",0,function(e){return`${String(e)} unseen`}])},85989,e=>{var t=e.i(43476),i=e.i(70812),n=e.i(56420);let r={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};r.node;let a=(0,n.f)(r);var s=e.i(68590),d=e.i(47130),o=e.i(28287),l=e.i(65894),c=e.i(57228),u=e.i(29247),m=e.i(12497),f=e.i(17904),g=e.i(99200),h=e.i(55070),p=e.i(19015),v=e.i(82022);function b({href:e,isOutside:i,children:n,...r}){return(0,t.jsxs)("a",{...r,href:e,...i?{target:"_blank",rel:"noopener noreferrer"}:{},className:`inline-flex items-center rounded-md border border-border bg-card text-card-foreground hover:bg-accent ${h.o.row}`,children:[(0,t.jsx)(v.f,{"aria-hidden":"true",className:"size-3.5"}),n]})}var x=e.i(3523),y=e.i(48680),w=e.i(29039);function j(e){let{stale:t,inBasket:i}=e;return null===t&&null!==i?null===i.option?"In the basket: the note alone":`In the basket: option ${String(i.option)}`:null===t?"seen"===e.state?(0,m.M)(e.seenIn):void 0:(0,u.f)(t,{from:e.from})}function k({item:e,opening:i}){let n=e.stale?.replacementId??null;return null===n?null:(0,t.jsx)(h.i,{"data-testid":"bridge-replacement",size:"row",isPending:i.openingId===n,pendingLabel:"Opening...",disabled:void 0!==i.openingId,onClick:()=>{i.open({deliveryId:n,job:e.job})},children:"do"===e.job?"Open the new step":"Open the new question"})}function S({item:e,opening:i}){return(0,t.jsx)(h.i,{"data-testid":"bridge-open",size:"row",isPending:i.openingId===e.deliveryId,pendingLabel:"Opening...",disabled:void 0!==i.openingId,onClick:()=>{i.open(e)},children:"Open"})}function I({item:e,opening:i}){let n=e.actInPlace;return n?.kind==="ownStep"?(0,t.jsx)(b,{"data-testid":"bridge-own-step",href:n.href,isOutside:!1,children:n.label}):(0,t.jsxs)(t.Fragment,{children:[n?.kind==="putPick"?(0,t.jsxs)(h.i,{"data-testid":"bridge-put-pick",variant:"primary",size:"row",isPending:i.puttingId===e.deliveryId,pendingLabel:"Putting...",disabled:void 0!==i.openingId||void 0!==i.puttingId,onClick:()=>{i.putPick(e,n.option)},children:[(0,t.jsx)(d.f,{"aria-hidden":"true",className:"size-3.5"}),"Put option ",n.option," in the basket"]}):null,n?.kind==="openLink"?(0,t.jsxs)(b,{"data-testid":"bridge-step-link",href:n.href,isOutside:!0,children:["Open ",n.host]}):null,(0,t.jsx)(k,{item:e,opening:i}),(0,t.jsx)(S,{item:e,opening:i})]})}function N(e,t){return void 0===t.openingId?()=>{t.open(e)}:void 0}function $({items:e,readAt:i,opening:n,leaving:r}){let a=void 0!==n.opened;return(0,t.jsx)("ul",{className:a?"border-t border-border":"overflow-hidden rounded-lg border border-border bg-card",children:e.map(e=>(0,t.jsx)(p.V,{item:e,now:i,isNew:"new"===e.state,isOpen:n.opened?.deliveryId===e.deliveryId,staleKind:e.stale?.kind,isLeaving:r.has(e.deliveryId),outcome:j(e),failure:n.failure?.deliveryId===e.deliveryId?n.failure.message:void 0,onOpen:N(e,n),actions:a?void 0:(0,t.jsx)(I,{item:e,opening:n})},e.deliveryId))})}function O({items:e,readAt:i,opening:n}){return(0,t.jsx)("ul",{className:void 0===n.opened?"overflow-hidden rounded-lg border border-border bg-card":"border-t border-border",children:e.map(e=>(0,t.jsx)(p.V,{item:e,now:i,isNew:"new"===e.state,isOpen:n.opened?.deliveryId===e.deliveryId,outcome:void 0,failure:n.failure?.deliveryId===e.deliveryId?n.failure.message:void 0,onOpen:N(e,n)},e.deliveryId))})}function R({home:e,readAt:i,opening:n,leaving:r}){let{waiting:a,stayAware:s}=e;return"stay-aware"===n.opened.job?(0,t.jsxs)("section",{"aria-labelledby":"bridge-stay-aware-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 px-3 py-2.5",children:[(0,t.jsx)("h2",{id:"bridge-stay-aware-heading",className:"font-semibold",children:"Stay aware"}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground",children:[s.filter(({state:e})=>"new"===e).length," unseen"]})]}),(0,t.jsx)(O,{items:s,readAt:i,opening:n})]}):(0,t.jsxs)("section",{"aria-labelledby":"bridge-waiting-heading",children:[(0,t.jsxs)("h1",{id:"bridge-waiting-heading",className:"px-3 py-2.5 font-semibold",children:["Waiting on you ",(0,t.jsx)("span",{"data-testid":"bridge-count",className:"text-tone-waiting-fg",children:a.count})]}),(0,t.jsx)($,{items:a.items,readAt:i,opening:n,leaving:r})]})}function M({fleetId:e,home:n,now:r,opening:d,argo:o,leaving:u=new Set}){let{waiting:m,stayAware:f,messages:h}=n,p=new Date(r),{opened:v}=d;if(void 0!==v)return(0,t.jsx)(R,{home:n,readAt:p,opening:{...d,opened:v},leaving:u});let b=h.filter(({state:e})=>"new"===e).length;return(0,t.jsxs)("div",{className:"grid gap-8",children:[(0,t.jsx)("section",{className:"grid gap-3","aria-labelledby":"bridge-waiting-heading",children:0===m.items.length?(0,t.jsxs)("div",{"data-testid":"bridge-nothing-waits",className:"grid justify-items-center gap-1 rounded-lg border border-border bg-card p-6 text-center",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Nothing waits on you"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Your ships have what they need from you. A question or a step shows here the moment one arrives."})]}):(0,t.jsx)($,{items:m.items,readAt:p,opening:d,leaving:u})}),0===h.length?null:(0,t.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-messages-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("h2",{id:"bridge-messages-heading",className:"inline-flex items-center gap-2 text-section font-semibold",children:[(0,t.jsx)(s.f,{"aria-hidden":"true",className:"size-4 shrink-0"}),"Messages"]}),(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:(0,g.v)(b)})]}),(0,t.jsx)(y.f,{fleetId:e,messages:h.slice(0,g.d),readAt:p,opening:d,isOpenedOnPage:!0}),h.length>g.d?(0,t.jsxs)("a",{"data-testid":"bridge-all-messages",href:(0,l.i)(c.i,e),className:"flex h-9 items-center justify-center gap-1.5 rounded-lg border border-border bg-card font-medium text-primary hover:bg-accent",children:[(0,g.w)(h.length),(0,t.jsx)(a,{"aria-hidden":"true",className:"size-4"})]}):null]}),o,(0,t.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-stay-aware-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("h2",{id:"bridge-stay-aware-heading",className:"inline-flex items-center gap-2 text-section font-semibold",children:[(0,t.jsx)(i.f,{"aria-hidden":"true",className:"size-4 shrink-0"}),"Stay aware"]}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground",children:[f.filter(({state:e})=>"new"===e).length," unseen, outside the count"]})]}),0===f.length?(0,t.jsx)("p",{"data-testid":"bridge-nothing-new",className:"rounded-md border border-border bg-card p-3 text-muted-foreground",children:"Nothing new. What you saw is in Done."}):(0,t.jsx)(O,{items:f,readAt:p,opening:d})]})]})}function z({items:e,lastReadAt:i}){let n=new Date(i);return(0,t.jsxs)("section",{className:"grid gap-3","aria-label":"Waiting on you, as last read",children:[0===e.length?null:(0,t.jsx)("ul",{inert:!0,className:"overflow-hidden rounded-lg border border-border bg-card opacity-60",children:e.map(e=>(0,t.jsx)(p.V,{item:e,now:n,isNew:"new"===e.state,isOpen:!1,staleKind:e.stale?.kind,outcome:j(e),failure:void 0,onOpen:void 0},e.deliveryId))}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:`Shown as last read, at ${(0,f.C)(i)}.`})]})}function A({deliveryId:e,stale:t}){return{deliveryId:e,isStale:null!==t}}e.s(["HomePanel",0,function({fleetId:e,home:i,now:n,decidePlaces:r,argo:a}){let s=(0,w.useLastReadAt)(),d=(0,o.f)(i.waiting.items.map(A));if(void 0!==s)return(0,t.jsx)(z,{items:i.waiting.items,lastReadAt:s});let l=i.waiting.items.filter(e=>"gone"!==d(A(e))),c=new Set(l.filter(e=>"leaving"===d(A(e))).map(({deliveryId:e})=>e)),u={...i,waiting:{...i.waiting,items:l}};return(0,t.jsx)(x.f,{fleetId:e,decidePlaces:r,known:[...l,...i.stayAware],children:i=>(0,t.jsx)(M,{fleetId:e,home:u,now:n,opening:i,argo:a,leaving:c})})},"StayAwareRows",0,O],85989)},3523,e=>{var t=e.i(43476),i=e.i(58487),n=e.i(5654),r=e.i(71645),a=e.i(69288),s=e.i(73459),d=e.i(65894),o=e.i(31317),l=e.i(6379),c=e.i(70340),u=e.i(2356),m=e.i(90414),f=e.i(69969),g=e.i(57228),h=e.i(29247),p=e.i(20347),v=e.i(34244),b=e.i(43328),x=e.i(27538),y=e.i(77826),w=e.i(80734),j=e.i(60296),k=e.i(66734),S=e.i(47130);function I(){let{toasts:e}=n.f.useToastManager();return(0,t.jsx)(b.f.Portal,{children:(0,t.jsx)(x.f.Viewport,{className:"fixed bottom-4 left-4 z-50 hidden w-[min(24rem,calc(100vw-2rem))] gap-2 sm:grid",children:e.map(e=>(0,t.jsxs)(y.f.Root,{toast:e,"data-testid":"bridge-basket-toast",className:"flex items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(S.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0"}),(0,t.jsxs)(w.f.Content,{className:"grid flex-1 gap-1",children:[(0,t.jsx)(j.f.Title,{className:"font-medium"}),(0,t.jsx)(k.f.Description,{className:"text-caption text-muted-foreground"})]})]},e.id))})})}var N=e.i(54235),$=e.i(62579),O=e.i(63132),R=e.i(75103),M=e.i(52021);function z({fleetId:e,decidePlaces:i,consoleUrl:b,known:x,children:y}){let w=n.f.useToastManager(),j=(0,R.P)(),[k,S]=(0,r.useState)(),[I,A]=(0,r.useState)(""),[L,T]=(0,r.useState)(),[P,D]=(0,r.useState)(),[U,B]=(0,r.useState)(),[C,q]=(0,r.useState)(),[E,F]=(0,r.useState)(),[V,_]=(0,r.useState)(),[,H]=(0,r.useTransition)(),[W,Y]=(0,r.useState)(0);(0,M.R)(void 0===k?void 0:(0,v.u)(k.opened.job),()=>{S(void 0)});let K=t=>{T(t.deliveryId),q(void 0),_(void 0),H(async()=>{let i=await (0,c.f)(e,t.deliveryId);if(T(void 0),i.isOk){let e=t.inBasket??null;S({delivery:i.value,opened:{job:t.job,isAlert:t.isAlert??!1,wasNew:"seen"!==t.state},inBasket:e,finished:null}),A(e?.note??""),F(void 0)}else q({deliveryId:t.deliveryId,message:i.message})})},Q=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(Q.current)return;Q.current=!0;let e=(0,p.L)(window.location.href,x);"open"===e.kind?K(e.item):"gone"===e.kind&&((0,a.f)(window.history,(0,p.v)(window.location.href,void 0)),_("That item is no longer in your inbox."))});let G=k?.delivery.deliveryId,J=x.find(({deliveryId:e})=>e===G)?.stale??null;(0,r.useEffect)(()=>{null!==J&&void 0!==G&&S(e=>void 0===e?e:{...e,delivery:(0,h.B)(e.delivery,[{deliveryId:G,stale:J}])})},[J,G]);let X=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!X.current){X.current=!0;return}(0,a.f)(window.history,(0,p.v)(window.location.href,G))},[G]);let Z=({control:e,action:t,onSettled:i})=>{B(e),F(void 0),H(async()=>{let e=await t();B(void 0),e.isOk?i(e.value):F(e.message)})},ee=e=>()=>{S(void 0),_(e)},et=void 0===k?void 0:{deliveryId:k.delivery.deliveryId,job:k.opened.job};return(0,t.jsx)($.f,{list:(0,t.jsxs)("div",{className:"grid gap-4",children:[void 0===V?null:(0,t.jsx)(O.f,{message:V,isFailure:!1}),y({open:K,openingId:L,putPick:(t,i)=>{D(t.deliveryId),q(void 0),_(void 0),H(async()=>{let n=await (0,m.f)({fleet:e,deliveryId:t.deliveryId,option:i});D(void 0),n.isOk?(_(`Option ${String(i)} is in the basket, not sent: ${t.from} receives it when you send the basket.`),Y(e=>e+1)):q({deliveryId:t.deliveryId,message:n.message})})},puttingId:P,failure:C,opened:et})]},W),item:void 0===k?void 0:(({delivery:n,inBasket:r,opened:a,finished:c})=>{let m=n.question?.id;return(0,t.jsx)(N.u,{delivery:n,opened:a,meetingHref:void 0===n.meetingId?void 0:(0,s.f)({fleetId:e,meetingId:n.meetingId}),consoleUrl:b,basketHref:(0,d.i)(g.H,e),inBasket:r,finished:c,places:i,note:I,working:U,failure:E,onNoteChange:A,onAnswer:t=>{Z({control:void 0===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:n.question?.id,option:t,note:I}}),onSettled:ee(`Your answer went to ${n.from}.`)})},onPut:t=>{Z({control:null===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,u.f)({fleet:e,deliveryId:n.deliveryId,option:t,optionLabel:n.question?.options.find(({key:e})=>e===t)?.label??null,note:I}),onSettled:e=>{var t;S({delivery:n,opened:a,finished:c,inBasket:e}),w.add({title:null===(t=e.option)?"Your note alone in the basket":`Option ${String(t)} in the basket`,description:"Not sent. Still waiting on you until you send it."})}})},onSend:t=>{Z({control:{kind:"send"},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:m,option:t??void 0,note:I}}),onSettled:ee(`Your answer went to ${n.from}.`)})},onRemove:()=>{void 0!==m&&Z({control:{kind:"remove"},action:()=>(0,f.f)(e,m),onSettled:ee(`Your answer to “${n.title}” is out of the basket; the question still waits on you.`)})},onDone:()=>{Z({control:{kind:"done"},action:()=>(0,l.f)({fleet:e,deliveryId:n.deliveryId}),onSettled:ee(`Done with “${n.title}”.`)})},onFinishStep:t=>{Z({control:{kind:t},action:()=>(0,l.f)({fleet:e,deliveryId:n.deliveryId,step:{outcome:t,note:I}}),onSettled:()=>{S({delivery:n,inBasket:r,opened:a,finished:{outcome:t,note:I.trim(),at:new Date().toISOString()}})}})},onOpen:e=>{K({deliveryId:e,job:a.job})},onSendMessage:void 0===n.alertShip||void 0===j?void 0:e=>{j({alertShip:e})},onBack:()=>{S(void 0)}},n.deliveryId)})(k)})}e.s(["f",0,function({fleetId:e,decidePlaces:n,consoleUrl:r,known:a,children:s}){return(0,t.jsxs)(i.f.Provider,{children:[(0,t.jsx)(z,{fleetId:e,decidePlaces:n,consoleUrl:r,known:a,children:s}),(0,t.jsx)(I,{})]})}],3523)},48680,e=>{var t=e.i(43476),i=e.i(18566),n=e.i(71645),r=e.i(95187);let a=(0,r.createServerReference)("40e18abbb5c1566937721c8c2adfa555efe588d7c3",r.callServer,void 0,r.findSourceMapURL,"doneMessage");var s=e.i(99200),d=e.i(89664),o=e.i(22768),l=e.i(12497),c=e.i(55070),u=e.i(19015);function m({message:e,now:i,isOpen:n,isMarkingDone:r,isOpening:a,isBusy:f,failure:g,onDone:h,onOpen:p}){let v=void 0===h,b=v?"":(0,s.R)(e.excerpt);return(0,t.jsx)(u.V,{item:{...e,title:(0,s.R)(e.title)},now:i,isNew:"new"===e.state,isOpen:n,outcome:function({message:e,isOpen:t}){return t?"Seen":"seen"===e.state?(0,l.M)(e.seenIn):void 0}({message:e,isOpen:n}),failure:void 0,onOpen:f?void 0:p,detail:""===b?void 0:(0,t.jsx)("p",{className:"line-clamp-2 max-w-[560px] break-words text-meta text-muted-foreground",children:b}),actions:v?void 0:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.i,{"data-testid":"bridge-message-done",size:"row",isPending:r,pendingLabel:"Marking done...",disabled:f,onClick:h,children:[(0,t.jsx)(d.f,{"aria-hidden":"true",className:"size-3.5"}),"Done"]}),(0,t.jsx)(c.i,{"data-testid":"bridge-message-open",size:"row",isPending:a,pendingLabel:"Opening...",disabled:f,onClick:p,children:"Open"}),void 0===g?null:(0,t.jsxs)("p",{role:"alert","data-testid":"bridge-message-failure",className:"flex basis-full items-center gap-1.5 text-meta text-destructive-text",children:[(0,t.jsx)(o.f,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),g]})]})})}e.s(["f",0,function({fleetId:e,messages:r,readAt:d,opening:o,isOpenedOnPage:l=!1}){let c=(0,i.useRouter)(),[u,f]=(0,n.useState)(),[g,h]=(0,n.useState)(),[p,v]=(0,n.useState)(new Set),[b,x]=(0,n.useState)(),[,y]=(0,n.useTransition)(),w=void 0!==o.opened,j=g??o.openingId,k=void 0!==u||void 0!==j;return(0,t.jsx)("ul",{className:w?"border-t border-border":"overflow-hidden rounded-lg border border-border bg-card",children:r.filter(({deliveryId:e})=>!p.has(e)).map(i=>{var n;return(0,t.jsx)(m,{message:i,now:d,isOpen:o.opened?.deliveryId===i.deliveryId,isMarkingDone:u===i.deliveryId,isOpening:j===i.deliveryId,isBusy:k,failure:(n=i.deliveryId,b?.deliveryId===n?b.message:o.failure?.deliveryId===n?o.failure.message:void 0),onDone:w?void 0:()=>{f(i.deliveryId),x(void 0),y(async()=>{let t=await a({fleet:e,deliveryId:i.deliveryId,isNew:"new"===i.state});f(void 0),t.isOk?v(e=>new Set([...e,i.deliveryId])):x({deliveryId:i.deliveryId,message:(0,s.z)(void 0===t.code?void 0:t.message)})})},onOpen:()=>{l?(h(i.deliveryId),y(()=>{c.push((0,s.C)({fleetId:e,deliveryId:i.deliveryId}))})):o.open(i)}},i.deliveryId)})})}],48680)},55070,e=>{var t=e.i(43476);let i={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},n={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:r,variant:a="secondary",size:s="regular",children:d,className:o="",disabled:l,...c}){return(0,t.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${n[s]} ${i[a]} ${o}`,children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),r]}):d})},"o",0,n])},19015,e=>{var t=e.i(43476),i=e.i(70812),n=e.i(71136),r=e.i(96315),a=e.i(49287),s=e.i(28623),d=e.i(12497),o=e.i(91604),l=e.i(63132),c=e.i(779);let u={bridge:{icon:a.f,name:"Bridge"},slack:{icon:n.f,name:"Slack"},chat:{icon:s.f,name:"a chat"},"web-push":{icon:i.f,name:"web push"},email:{icon:r.f,name:"email"}};function m(){return(0,t.jsx)("span",{"aria-hidden":"true",className:"text-border",children:"·"})}function f({places:e}){var i;let n,r=["bridge",...e].map(e=>u[e]);return(0,t.jsx)("span",{role:"img","aria-label":`Shows in ${(n=(i=r.map(({name:e})=>e)).at(-1)??"",i.length<2?n:`${i.slice(0,-1).join(", ")} and ${n}`)}`,className:"inline-flex items-center gap-0.5",children:r.map(({icon:e,name:i})=>(0,t.jsx)(e,{"aria-hidden":"true",className:"size-3"},i))})}let g="overflow-hidden motion-safe:animate-row-leave";e.s(["V",0,function({item:e,now:i,isNew:n,isOpen:r=!1,staleKind:a,isLeaving:s=!1,outcome:u,failure:h,onOpen:p,time:v,detail:b,actions:x}){var y;let w=e.isAlert??!1,j=(0,o.P)({job:e.job,isAlert:w}),k=j.icon,S="min-w-0 break-words text-left text-body-touch font-medium sm:truncate sm:text-body",I=void 0===a?e.title:(0,t.jsx)("s",{className:"decoration-muted-foreground",children:e.title});return(0,t.jsxs)("li",{"data-testid":"bridge-item","data-stale":void 0!==a,"data-leaving":s||void 0,"aria-current":!!r||void 0,className:`grid min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto] items-start gap-x-2.5 gap-y-1.5 border-t border-border px-3 py-2.5 first:border-t-0 ${function({isOpen:e,isStale:t}){return e?"bg-highlight shadow-[inset_2px_0_0_var(--primary)]":t?"bg-muted":""}({isOpen:r,isStale:void 0!==a})} ${s?g:""}`,children:[(0,t.jsx)(k,{"aria-hidden":"true",className:`mt-0.5 size-4 ${j.tone}`}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-baseline sm:items-center",children:[n?(0,t.jsx)("span",{"aria-label":"New",className:"mr-1.5 size-[7px] shrink-0 -translate-y-px rounded-full bg-primary"}):null,void 0===p?(0,t.jsx)("span",{"data-testid":"bridge-item-title",className:S,children:I}):(0,t.jsx)("button",{type:"button","data-testid":"bridge-item-title",onClick:p,className:`${S} hover:underline`,children:I})]}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsx)("span",{className:`font-medium ${j.tone}`,children:(0,d.z)({job:e.job,isAlert:w})}),(0,t.jsx)(m,{}),(0,t.jsx)("span",{children:e.from}),void 0===u?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsxs)("span",{"data-testid":"bridge-outcome",className:"inline-flex items-center gap-1.5",children:[void 0===a?null:(0,t.jsx)(c.f,{kind:a}),u]})]}),void 0===e.places?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsx)(f,{places:e.places})]})]})]}),(0,t.jsx)("time",{dateTime:v?.at??e.sentAt,title:(y=v?.at??e.sentAt,`${new Date(y).toISOString().slice(0,16).replace("T"," ")} UTC`),className:"whitespace-nowrap text-right text-caption text-muted-foreground",children:v?.said??(0,d.V)(e.sentAt,i)}),void 0===b?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:b}),null==x?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2 flex flex-wrap items-center gap-1.5",children:x}),void 0===h?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:(0,t.jsx)(l.f,{message:h,isFailure:!0})})]})},"U",0,g])},63132,e=>{var t=e.i(43476);e.s(["f",0,function({message:e,isFailure:i}){return i?(0,t.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,t.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},30402,e=>{let t="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",i={primary:`${t} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${t} border border-border bg-card hover:bg-accent`,destructive:`${t} bg-destructive text-destructive-foreground`};e.s(["x",0,i,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","E",0,"rounded-lg border border-border bg-card p-3 text-card-foreground","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1","D",0,"h-9 w-full appearance-none rounded-md border border-input bg-background pr-8 pl-3"])},67914,e=>{var t=e.i(43476),i=e.i(71645),n=e.i(95187);let r=(0,n.createServerReference)("4028a841e3a56738319e16ecad460936d256385103",n.callServer,void 0,n.findSourceMapURL,"setTheme"),a=["light","dark","system"];e.s(["f",0,function({email:e,accountUrl:n,theme:s,entries:d=[]}){let[o,l]=(0,i.useState)(s),[c,u]=(0,i.useState)(!1),m=(0,i.useRef)(null);return{account:{name:e,signedInAs:"account",accountUrl:n,theme:o,themes:a,hasTheme:!0,onThemeChange:e=>{let t;l(e),document.documentElement.dataset.theme=e,t="dark"===e||"system"===e&&window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.classList.toggle("dark",t),r(e)},shortcuts:[],helpUrl:"https://github.com/ThomasHendrickx/aeolus-fleet",onSignOut:()=>{u(!0),m.current?.requestSubmit()},isSigningOut:c,entries:d},signOutForm:(0,t.jsx)("form",{ref:m,method:"post",action:"/sign-in/end",hidden:!0})}}],67914)},65894,e=>{let t="fleet";e.s(["n",0,t,"i",0,function(e,i){let[n="",r=""]=e.split("?"),a=new URLSearchParams(r);return a.set(t,i),`${n}?${a.toString()}`}])}],18566,(e,t,i)=>{t.exports=e.r(76562)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[69288,73459,31317,6379,70340,2356,90414,e=>{e.s(["f",0,function(e,t){e.replaceState(null,"",t)}],69288),e.s(["f",0,function(e){let t=new URLSearchParams({fleet:e.fleetId,...void 0===e.cursor?{}:{cursor:e.cursor}});return`/meetings/${encodeURIComponent(e.meetingId)}?${t.toString()}`}],73459);var t=e.i(95187);let i=(0,t.createServerReference)("400eae2d6cd258045189d51c623c82d36a37f64386",t.callServer,void 0,t.findSourceMapURL,"answerDelivery");e.s(["f",0,i],31317);let n=(0,t.createServerReference)("409c12fe0b01d63ebbbc2a12b2b2dfac6477ec3d50",t.callServer,void 0,t.findSourceMapURL,"doneDelivery");e.s(["f",0,n],6379);let r=(0,t.createServerReference)("606e0d74c6b0d3d1df4de39bd22d9408f01a679551",t.callServer,void 0,t.findSourceMapURL,"openDelivery");e.s(["f",0,r],70340);let a=(0,t.createServerReference)("40174e9e0edfb1138ae859a3f77519ab7ee8658099",t.callServer,void 0,t.findSourceMapURL,"putInBasket");e.s(["f",0,a],2356);let s=(0,t.createServerReference)("407746915cb9e535e2c80db4d3e85e4103bcf54f2b",t.callServer,void 0,t.findSourceMapURL,"putPickInBasket");e.s(["f",0,s],90414)},70812,71136,96315,28623,e=>{var t=e.i(56420);let i={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],70812);let r={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],71136);let s={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};s.node;let d=(0,t.f)(s);e.s(["f",0,d],96315);let o={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};o.node;let l=(0,t.f)(o);e.s(["f",0,l],28623)},51481,59381,e=>{var t=e.i(75043);e.s(["f",()=>t.f],51481);var i=e.i(56420);let n={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};n.node;let r=(0,i.f)(n);e.s(["f",0,r],59381)},66595,e=>{var t=e.i(56420);let i={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],66595)},95187,(e,t,i)=>{Object.defineProperty(i,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return d.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var r in n)Object.defineProperty(i,r,{enumerable:!0,get:n[r]});let a=e.r(32120),s=e.r(92245),d=e.r(35326)},69969,e=>{var t=e.i(95187);let i=(0,t.createServerReference)("60e7e6f4ed489b1e317abedf31af08ac78c4e3ca08",t.callServer,void 0,t.findSourceMapURL,"removeFromBasket");e.s(["f",0,i])},28287,e=>{var t=e.i(18566),i=e.i(71645);let n={standing:new Set,staleSince:new Map};e.s(["f",0,function(e){let r=(0,t.useRouter)(),[a,s]=(0,i.useState)(n),[d,o]=(0,i.useState)(()=>Date.now()),l=e.map(({deliveryId:e,isStale:t})=>`${e}${t?"!":""}`).join(" ");return(0,i.useEffect)(()=>{let e=Date.now();s(t=>(function(e,t){let{items:i,atMs:n}=t,r=new Set(e.standing),a=new Map(e.staleSince);for(let{deliveryId:e,isStale:t}of i)t?r.has(e)&&!a.has(e)&&a.set(e,n):r.add(e);return{standing:r,staleSince:a}})(t,{items:""===l?[]:l.split(" ").map(e=>({deliveryId:e.replace("!",""),isStale:e.endsWith("!")})),atMs:e})),o(e)},[l]),(0,i.useEffect)(()=>{let e,t=0===(e=[...a.staleSince.values()].flatMap(e=>[e+5e3-300,e+5e3]).filter(e=>e>d)).length?void 0:Math.min(...e);if(void 0===t)return;let i=setTimeout(()=>{o(Date.now()),[...a.staleSince.values()].some(e=>e+5e3===t)&&r.refresh()},t-Date.now());return()=>{clearTimeout(i)}},[a,d,r]),e=>(function(e,t){let{item:i,atMs:n}=t;if(!i.isStale)return"shown";let r=e.staleSince.get(i.deliveryId);if(void 0===r)return e.standing.has(i.deliveryId)?"shown":"gone";let a=n-r;return a>=5e3?"gone":a>=4700?"leaving":"shown"})(a,{item:e,atMs:d})}],28287)},31785,e=>{let t={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},i={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},n=["decide","do"],r="Bridge keeps every item.",a={label:"Not offered",isOk:!1},s={label:"Off",isOk:!1},d="Says only that something waits, with a link here.",o=`${d} Nothing is on until you turn it on.`,l="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,t,"k",0,i,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${l}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${l}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:t}){return e?t?{state:{label:"On",isOk:!0},description:d,action:"turnOff"}:{state:s,description:o,action:"turnOn"}:{state:a,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,t){return e.jobs.filter(({job:e,places:i})=>i.email!==t&&(!t||n.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:t}))},"r",0,function(e){let t=["Bridge",...e.map(e=>c[e])],i=t.at(-1),n=1===t.length?"Bridge":`${t.slice(0,-1).join(", ")} and ${String(i)}`;return`Shows in ${n}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:t,link:i}=e;return null===i?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${t} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${i.slackName} in ${t}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:n,place:a,isOn:s,waiting:d,isChatOn:o}=e,{name:l,item:c,items:u}=t[n],m=`${i[a]} is ${s?"on":"off"} for ${l}`;return s?"chat"===a?{title:m,detail:`A chat lists every ${c} not done when you ask it.`}:{title:m,detail:`${i[a]} shows ${u} that arrive from now on.${void 0===d||0===d?"":` The ${String(d)} already waiting ${1===d?"stays":"stay"} ${o?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:m,detail:"everything-else"===n&&"slack"===a?`Bots only: a bot ship's messages and replies to Slack still show there. ${r}`:r}},"B",0,function(e){if(!e.isOffered)return{state:a,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:s,description:"This browser takes no web push.",action:"none"};let t=e.browsers.find(({endpoint:t,isGone:i})=>t===e.ownEndpoint&&!i);return void 0===t?{state:s,description:o,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${t.browser}. ${d}`,action:"remove"}}])},85989,e=>{var t=e.i(43476),i=e.i(70812),n=e.i(56420);let r={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};r.node;let a=(0,n.f)(r);var s=e.i(68590),d=e.i(47130),o=e.i(28287),l=e.i(65894),c=e.i(57228),u=e.i(29247),m=e.i(12497),f=e.i(17904),g=e.i(99200),p=e.i(55070),h=e.i(19015),v=e.i(82022);function b({href:e,isOutside:i,children:n,...r}){return(0,t.jsxs)("a",{...r,href:e,...i?{target:"_blank",rel:"noopener noreferrer"}:{},className:`inline-flex items-center rounded-md border border-border bg-card text-card-foreground hover:bg-accent ${p.o.row}`,children:[(0,t.jsx)(v.f,{"aria-hidden":"true",className:"size-3.5"}),n]})}var x=e.i(3523),y=e.i(48680),w=e.i(29039);function j(e){let{stale:t,inBasket:i}=e;return null===t&&null!==i?null===i.option?"In the basket: the note alone":`In the basket: option ${String(i.option)}`:null===t?"seen"===e.state?(0,m.M)(e.seenIn):void 0:(0,u.f)(t,{from:e.from})}function k({item:e,opening:i}){let n=e.stale?.replacementId??null;return null===n?null:(0,t.jsx)(p.i,{"data-testid":"bridge-replacement",size:"row",isPending:i.openingId===n,pendingLabel:"Opening...",disabled:void 0!==i.openingId,onClick:()=>{i.open({deliveryId:n,job:e.job})},children:"do"===e.job?"Open the new step":"Open the new question"})}function S({item:e,opening:i}){return(0,t.jsx)(p.i,{"data-testid":"bridge-open",size:"row",isPending:i.openingId===e.deliveryId,pendingLabel:"Opening...",disabled:void 0!==i.openingId,onClick:()=>{i.open(e)},children:"Open"})}function I({item:e,opening:i}){let n=e.actInPlace;return n?.kind==="ownStep"?(0,t.jsx)(b,{"data-testid":"bridge-own-step",href:n.href,isOutside:!1,children:n.label}):(0,t.jsxs)(t.Fragment,{children:[n?.kind==="putPick"?(0,t.jsxs)(p.i,{"data-testid":"bridge-put-pick",variant:"primary",size:"row",isPending:i.puttingId===e.deliveryId,pendingLabel:"Putting...",disabled:void 0!==i.openingId||void 0!==i.puttingId,onClick:()=>{i.putPick(e,n.option)},children:[(0,t.jsx)(d.f,{"aria-hidden":"true",className:"size-3.5"}),"Put option ",n.option," in the basket"]}):null,n?.kind==="openLink"?(0,t.jsxs)(b,{"data-testid":"bridge-step-link",href:n.href,isOutside:!0,children:["Open ",n.host]}):null,(0,t.jsx)(k,{item:e,opening:i}),(0,t.jsx)(S,{item:e,opening:i})]})}function N(e,t){return void 0===t.openingId?()=>{t.open(e)}:void 0}function O({items:e,readAt:i,opening:n,leaving:r}){let a=void 0!==n.opened;return(0,t.jsx)("ul",{className:a?"border-t border-border":"overflow-hidden rounded-lg border border-border bg-card",children:e.map(e=>(0,t.jsx)(h.V,{item:e,now:i,isNew:"new"===e.state,isOpen:n.opened?.deliveryId===e.deliveryId,staleKind:e.stale?.kind,isLeaving:r.has(e.deliveryId),outcome:j(e),failure:n.failure?.deliveryId===e.deliveryId?n.failure.message:void 0,onOpen:N(e,n),actions:a?void 0:(0,t.jsx)(I,{item:e,opening:n})},e.deliveryId))})}function $({items:e,readAt:i,opening:n}){return(0,t.jsx)("ul",{className:void 0===n.opened?"overflow-hidden rounded-lg border border-border bg-card":"border-t border-border",children:e.map(e=>(0,t.jsx)(h.V,{item:e,now:i,isNew:"new"===e.state,isOpen:n.opened?.deliveryId===e.deliveryId,outcome:void 0,failure:n.failure?.deliveryId===e.deliveryId?n.failure.message:void 0,onOpen:N(e,n)},e.deliveryId))})}function R({home:e,readAt:i,opening:n,leaving:r}){let{waiting:a,stayAware:s}=e;return"stay-aware"===n.opened.job?(0,t.jsxs)("section",{"aria-labelledby":"bridge-stay-aware-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 px-3 py-2.5",children:[(0,t.jsx)("h2",{id:"bridge-stay-aware-heading",className:"font-semibold",children:"Stay aware"}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground",children:[s.filter(({state:e})=>"new"===e).length," unseen"]})]}),(0,t.jsx)($,{items:s,readAt:i,opening:n})]}):(0,t.jsxs)("section",{"aria-labelledby":"bridge-waiting-heading",children:[(0,t.jsxs)("h1",{id:"bridge-waiting-heading",className:"px-3 py-2.5 font-semibold",children:["Waiting on you ",(0,t.jsx)("span",{"data-testid":"bridge-count",className:"text-tone-waiting-fg",children:a.count})]}),(0,t.jsx)(O,{items:a.items,readAt:i,opening:n,leaving:r})]})}function M({fleetId:e,home:n,now:r,opening:d,argo:o,leaving:u=new Set}){let{waiting:m,stayAware:f,messages:p}=n,h=new Date(r),{opened:v}=d;if(void 0!==v)return(0,t.jsx)(R,{home:n,readAt:h,opening:{...d,opened:v},leaving:u});let b=p.filter(({state:e})=>"new"===e).length;return(0,t.jsxs)("div",{className:"grid gap-8",children:[(0,t.jsx)("section",{className:"grid gap-3","aria-labelledby":"bridge-waiting-heading",children:0===m.items.length?(0,t.jsxs)("div",{"data-testid":"bridge-nothing-waits",className:"grid justify-items-center gap-1 rounded-lg border border-border bg-card p-6 text-center",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Nothing waits on you"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Your ships have what they need from you. A question or a step shows here the moment one arrives."})]}):(0,t.jsx)(O,{items:m.items,readAt:h,opening:d,leaving:u})}),0===p.length?null:(0,t.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-messages-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("h2",{id:"bridge-messages-heading",className:"inline-flex items-center gap-2 text-section font-semibold",children:[(0,t.jsx)(s.f,{"aria-hidden":"true",className:"size-4 shrink-0"}),"Messages"]}),(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:(0,g.v)(b)})]}),(0,t.jsx)(y.f,{fleetId:e,messages:p.slice(0,g.d),readAt:h,opening:d,isOpenedOnPage:!0}),p.length>g.d?(0,t.jsxs)("a",{"data-testid":"bridge-all-messages",href:(0,l.i)(c.i,e),className:"flex h-9 items-center justify-center gap-1.5 rounded-lg border border-border bg-card font-medium text-primary hover:bg-accent",children:[(0,g.w)(p.length),(0,t.jsx)(a,{"aria-hidden":"true",className:"size-4"})]}):null]}),o,(0,t.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-stay-aware-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("h2",{id:"bridge-stay-aware-heading",className:"inline-flex items-center gap-2 text-section font-semibold",children:[(0,t.jsx)(i.f,{"aria-hidden":"true",className:"size-4 shrink-0"}),"Stay aware"]}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground",children:[f.filter(({state:e})=>"new"===e).length," unseen, outside the count"]})]}),0===f.length?(0,t.jsx)("p",{"data-testid":"bridge-nothing-new",className:"rounded-md border border-border bg-card p-3 text-muted-foreground",children:"Nothing new. What you saw is in Done."}):(0,t.jsx)($,{items:f,readAt:h,opening:d})]})]})}function z({items:e,lastReadAt:i}){let n=new Date(i);return(0,t.jsxs)("section",{className:"grid gap-3","aria-label":"Waiting on you, as last read",children:[0===e.length?null:(0,t.jsx)("ul",{inert:!0,className:"overflow-hidden rounded-lg border border-border bg-card opacity-60",children:e.map(e=>(0,t.jsx)(h.V,{item:e,now:n,isNew:"new"===e.state,isOpen:!1,staleKind:e.stale?.kind,outcome:j(e),failure:void 0,onOpen:void 0},e.deliveryId))}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:`Shown as last read, at ${(0,f.C)(i)}.`})]})}function L({deliveryId:e,stale:t}){return{deliveryId:e,isStale:null!==t}}e.s(["HomePanel",0,function({fleetId:e,home:i,now:n,decidePlaces:r,argo:a}){let s=(0,w.useLastReadAt)(),d=(0,o.f)(i.waiting.items.map(L));if(void 0!==s)return(0,t.jsx)(z,{items:i.waiting.items,lastReadAt:s});let l=i.waiting.items.filter(e=>"gone"!==d(L(e))),c=new Set(l.filter(e=>"leaving"===d(L(e))).map(({deliveryId:e})=>e)),u={...i,waiting:{...i.waiting,items:l}};return(0,t.jsx)(x.f,{fleetId:e,decidePlaces:r,known:[...l,...i.stayAware],children:i=>(0,t.jsx)(M,{fleetId:e,home:u,now:n,opening:i,argo:a,leaving:c})})},"StayAwareRows",0,$],85989)},3523,e=>{var t=e.i(43476),i=e.i(58487),n=e.i(5654),r=e.i(71645),a=e.i(69288),s=e.i(73459),d=e.i(65894),o=e.i(31317),l=e.i(6379),c=e.i(70340),u=e.i(2356),m=e.i(90414),f=e.i(69969),g=e.i(57228),p=e.i(29247),h=e.i(20347),v=e.i(34244),b=e.i(43328),x=e.i(27538),y=e.i(77826),w=e.i(80734),j=e.i(60296),k=e.i(66734),S=e.i(47130);function I(){let{toasts:e}=n.f.useToastManager();return(0,t.jsx)(b.f.Portal,{children:(0,t.jsx)(x.f.Viewport,{className:"fixed bottom-4 left-4 z-50 hidden w-[min(24rem,calc(100vw-2rem))] gap-2 sm:grid",children:e.map(e=>(0,t.jsxs)(y.f.Root,{toast:e,"data-testid":"bridge-basket-toast",className:"flex items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(S.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0"}),(0,t.jsxs)(w.f.Content,{className:"grid flex-1 gap-1",children:[(0,t.jsx)(j.f.Title,{className:"font-medium"}),(0,t.jsx)(k.f.Description,{className:"text-caption text-muted-foreground"})]})]},e.id))})})}var N=e.i(54235),O=e.i(62579),$=e.i(63132),R=e.i(75103),M=e.i(52021);function z({fleetId:e,decidePlaces:i,consoleUrl:b,known:x,children:y}){let w=n.f.useToastManager(),j=(0,R.P)(),[k,S]=(0,r.useState)(),[I,L]=(0,r.useState)(""),[A,P]=(0,r.useState)(),[T,D]=(0,r.useState)(),[U,B]=(0,r.useState)(),[C,q]=(0,r.useState)(),[E,F]=(0,r.useState)(),[V,_]=(0,r.useState)(),[,H]=(0,r.useTransition)(),[W,Y]=(0,r.useState)(0);(0,M.R)(void 0===k?void 0:(0,v.u)(k.opened.job),()=>{S(void 0)});let K=t=>{P(t.deliveryId),q(void 0),_(void 0),H(async()=>{let i=await (0,c.f)(e,t.deliveryId);if(P(void 0),i.isOk){let e=t.inBasket??null;S({delivery:i.value,opened:{job:t.job,isAlert:t.isAlert??!1,wasNew:"seen"!==t.state},inBasket:e,finished:null}),L(e?.note??""),F(void 0)}else q({deliveryId:t.deliveryId,message:i.message})})},Q=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(Q.current)return;Q.current=!0;let e=(0,h.L)(window.location.href,x);"open"===e.kind?K(e.item):"gone"===e.kind&&((0,a.f)(window.history,(0,h.v)(window.location.href,void 0)),_("That item is no longer in your inbox."))});let G=k?.delivery.deliveryId,J=x.find(({deliveryId:e})=>e===G)?.stale??null;(0,r.useEffect)(()=>{null!==J&&void 0!==G&&S(e=>void 0===e?e:{...e,delivery:(0,p.B)(e.delivery,[{deliveryId:G,stale:J}])})},[J,G]);let X=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!X.current){X.current=!0;return}(0,a.f)(window.history,(0,h.v)(window.location.href,G))},[G]);let Z=({control:e,action:t,onSettled:i})=>{B(e),F(void 0),H(async()=>{let e=await t();B(void 0),e.isOk?i(e.value):F(e.message)})},ee=e=>()=>{S(void 0),_(e)},et=void 0===k?void 0:{deliveryId:k.delivery.deliveryId,job:k.opened.job};return(0,t.jsx)(O.f,{list:(0,t.jsxs)("div",{className:"grid gap-4",children:[void 0===V?null:(0,t.jsx)($.f,{message:V,isFailure:!1}),y({open:K,openingId:A,putPick:(t,i)=>{D(t.deliveryId),q(void 0),_(void 0),H(async()=>{let n=await (0,m.f)({fleet:e,deliveryId:t.deliveryId,option:i});D(void 0),n.isOk?(_(`Option ${String(i)} is in the basket, not sent: ${t.from} receives it when you send the basket.`),Y(e=>e+1)):q({deliveryId:t.deliveryId,message:n.message})})},puttingId:T,failure:C,opened:et})]},W),item:void 0===k?void 0:(({delivery:n,inBasket:r,opened:a,finished:c})=>{let m=n.question?.id;return(0,t.jsx)(N.u,{delivery:n,opened:a,meetingHref:void 0===n.meetingId?void 0:(0,s.f)({fleetId:e,meetingId:n.meetingId}),consoleUrl:b,basketHref:(0,d.i)(g.H,e),inBasket:r,finished:c,places:i,note:I,working:U,failure:E,onNoteChange:L,onAnswer:t=>{Z({control:void 0===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:n.question?.id,option:t,note:I}}),onSettled:ee(`Your answer went to ${n.from}.`)})},onPut:t=>{Z({control:null===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,u.f)({fleet:e,deliveryId:n.deliveryId,option:t,optionLabel:n.question?.options.find(({key:e})=>e===t)?.label??null,note:I}),onSettled:e=>{var t;S({delivery:n,opened:a,finished:c,inBasket:e}),w.add({title:null===(t=e.option)?"Your note alone in the basket":`Option ${String(t)} in the basket`,description:"Not sent. Still waiting on you until you send it."})}})},onSend:t=>{Z({control:{kind:"send"},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:m,option:t??void 0,note:I}}),onSettled:ee(`Your answer went to ${n.from}.`)})},onRemove:()=>{void 0!==m&&Z({control:{kind:"remove"},action:()=>(0,f.f)(e,m),onSettled:ee(`Your answer to “${n.title}” is out of the basket; the question still waits on you.`)})},onDone:()=>{Z({control:{kind:"done"},action:()=>(0,l.f)({fleet:e,deliveryId:n.deliveryId}),onSettled:ee(`Done with “${n.title}”.`)})},onFinishStep:t=>{Z({control:{kind:t},action:()=>(0,l.f)({fleet:e,deliveryId:n.deliveryId,step:{outcome:t,note:I}}),onSettled:()=>{S({delivery:n,inBasket:r,opened:a,finished:{outcome:t,note:I.trim(),at:new Date().toISOString()}})}})},onOpen:e=>{K({deliveryId:e,job:a.job})},onSendMessage:void 0===n.alertShip||void 0===j?void 0:e=>{j({alertShip:e})},onBack:()=>{S(void 0)}},n.deliveryId)})(k)})}e.s(["f",0,function({fleetId:e,decidePlaces:n,consoleUrl:r,known:a,children:s}){return(0,t.jsxs)(i.f.Provider,{children:[(0,t.jsx)(z,{fleetId:e,decidePlaces:n,consoleUrl:r,known:a,children:s}),(0,t.jsx)(I,{})]})}],3523)},48680,e=>{var t=e.i(43476),i=e.i(18566),n=e.i(71645),r=e.i(95187);let a=(0,r.createServerReference)("40e18abbb5c1566937721c8c2adfa555efe588d7c3",r.callServer,void 0,r.findSourceMapURL,"doneMessage");var s=e.i(99200),d=e.i(89664),o=e.i(22768),l=e.i(12497),c=e.i(55070),u=e.i(19015);function m({message:e,now:i,isOpen:n,isMarkingDone:r,isOpening:a,isBusy:f,failure:g,onDone:p,onOpen:h}){let v=void 0===p,b=v?"":(0,s.R)(e.excerpt);return(0,t.jsx)(u.V,{item:{...e,title:(0,s.R)(e.title)},now:i,isNew:"new"===e.state,isOpen:n,outcome:function({message:e,isOpen:t}){return t?"Seen":"seen"===e.state?(0,l.M)(e.seenIn):void 0}({message:e,isOpen:n}),failure:void 0,onOpen:f?void 0:h,detail:""===b?void 0:(0,t.jsx)("p",{className:"line-clamp-2 max-w-[560px] break-words text-meta text-muted-foreground",children:b}),actions:v?void 0:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.i,{"data-testid":"bridge-message-done",size:"row",isPending:r,pendingLabel:"Marking done...",disabled:f,onClick:p,children:[(0,t.jsx)(d.f,{"aria-hidden":"true",className:"size-3.5"}),"Done"]}),(0,t.jsx)(c.i,{"data-testid":"bridge-message-open",size:"row",isPending:a,pendingLabel:"Opening...",disabled:f,onClick:h,children:"Open"}),void 0===g?null:(0,t.jsxs)("p",{role:"alert","data-testid":"bridge-message-failure",className:"flex basis-full items-center gap-1.5 text-meta text-destructive-text",children:[(0,t.jsx)(o.f,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),g]})]})})}e.s(["f",0,function({fleetId:e,messages:r,readAt:d,opening:o,isOpenedOnPage:l=!1}){let c=(0,i.useRouter)(),[u,f]=(0,n.useState)(),[g,p]=(0,n.useState)(),[h,v]=(0,n.useState)(new Set),[b,x]=(0,n.useState)(),[,y]=(0,n.useTransition)(),w=void 0!==o.opened,j=g??o.openingId,k=void 0!==u||void 0!==j;return(0,t.jsx)("ul",{className:w?"border-t border-border":"overflow-hidden rounded-lg border border-border bg-card",children:r.filter(({deliveryId:e})=>!h.has(e)).map(i=>{var n;return(0,t.jsx)(m,{message:i,now:d,isOpen:o.opened?.deliveryId===i.deliveryId,isMarkingDone:u===i.deliveryId,isOpening:j===i.deliveryId,isBusy:k,failure:(n=i.deliveryId,b?.deliveryId===n?b.message:o.failure?.deliveryId===n?o.failure.message:void 0),onDone:w?void 0:()=>{f(i.deliveryId),x(void 0),y(async()=>{let t=await a({fleet:e,deliveryId:i.deliveryId,isNew:"new"===i.state});f(void 0),t.isOk?v(e=>new Set([...e,i.deliveryId])):x({deliveryId:i.deliveryId,message:(0,s.z)(void 0===t.code?void 0:t.message)})})},onOpen:()=>{l?(p(i.deliveryId),y(()=>{c.push((0,s.C)({fleetId:e,deliveryId:i.deliveryId}))})):o.open(i)}},i.deliveryId)})})}],48680)},55070,e=>{var t=e.i(43476);let i={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},n={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:r,variant:a="secondary",size:s="regular",children:d,className:o="",disabled:l,...c}){return(0,t.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${n[s]} ${i[a]} ${o}`,children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),r]}):d})},"o",0,n])},19015,e=>{var t=e.i(43476),i=e.i(70812),n=e.i(71136),r=e.i(96315),a=e.i(49287),s=e.i(28623),d=e.i(12497),o=e.i(91604),l=e.i(63132),c=e.i(779);let u={bridge:{icon:a.f,name:"Bridge"},slack:{icon:n.f,name:"Slack"},chat:{icon:s.f,name:"a chat"},"web-push":{icon:i.f,name:"web push"},email:{icon:r.f,name:"email"}};function m(){return(0,t.jsx)("span",{"aria-hidden":"true",className:"text-border",children:"·"})}function f({places:e}){var i;let n,r=["bridge",...e].map(e=>u[e]);return(0,t.jsx)("span",{role:"img","aria-label":`Shows in ${(n=(i=r.map(({name:e})=>e)).at(-1)??"",i.length<2?n:`${i.slice(0,-1).join(", ")} and ${n}`)}`,className:"inline-flex items-center gap-0.5",children:r.map(({icon:e,name:i})=>(0,t.jsx)(e,{"aria-hidden":"true",className:"size-3"},i))})}let g="overflow-hidden motion-safe:animate-row-leave";e.s(["V",0,function({item:e,now:i,isNew:n,isOpen:r=!1,staleKind:a,isLeaving:s=!1,outcome:u,failure:p,onOpen:h,time:v,detail:b,actions:x}){var y;let w=e.isAlert??!1,j=(0,o.P)({job:e.job,isAlert:w}),k=j.icon,S="min-w-0 break-words text-left text-body-touch font-medium sm:truncate sm:text-body",I=void 0===a?e.title:(0,t.jsx)("s",{className:"decoration-muted-foreground",children:e.title});return(0,t.jsxs)("li",{"data-testid":"bridge-item","data-stale":void 0!==a,"data-leaving":s||void 0,"aria-current":!!r||void 0,className:`grid min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto] items-start gap-x-2.5 gap-y-1.5 border-t border-border px-3 py-2.5 first:border-t-0 ${function({isOpen:e,isStale:t}){return e?"bg-highlight shadow-[inset_2px_0_0_var(--primary)]":t?"bg-muted":""}({isOpen:r,isStale:void 0!==a})} ${s?g:""}`,children:[(0,t.jsx)(k,{"aria-hidden":"true",className:`mt-0.5 size-4 ${j.tone}`}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-baseline sm:items-center",children:[n?(0,t.jsx)("span",{"aria-label":"New",className:"mr-1.5 size-[7px] shrink-0 -translate-y-px rounded-full bg-primary"}):null,void 0===h?(0,t.jsx)("span",{"data-testid":"bridge-item-title",className:S,children:I}):(0,t.jsx)("button",{type:"button","data-testid":"bridge-item-title",onClick:h,className:`${S} hover:underline`,children:I})]}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsx)("span",{className:`font-medium ${j.tone}`,children:(0,d.z)({job:e.job,isAlert:w})}),(0,t.jsx)(m,{}),(0,t.jsx)("span",{children:e.from}),void 0===u?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsxs)("span",{"data-testid":"bridge-outcome",className:"inline-flex items-center gap-1.5",children:[void 0===a?null:(0,t.jsx)(c.f,{kind:a}),u]})]}),void 0===e.places?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsx)(f,{places:e.places})]})]})]}),(0,t.jsx)("time",{dateTime:v?.at??e.sentAt,title:(y=v?.at??e.sentAt,`${new Date(y).toISOString().slice(0,16).replace("T"," ")} UTC`),className:"whitespace-nowrap text-right text-caption text-muted-foreground",children:v?.said??(0,d.V)(e.sentAt,i)}),void 0===b?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:b}),null==x?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2 flex flex-wrap items-center gap-1.5",children:x}),void 0===p?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:(0,t.jsx)(l.f,{message:p,isFailure:!0})})]})},"U",0,g])},63132,e=>{var t=e.i(43476);e.s(["f",0,function({message:e,isFailure:i}){return i?(0,t.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,t.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},30402,e=>{let t="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",i={primary:`${t} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${t} border border-border bg-card hover:bg-accent`,destructive:`${t} bg-destructive text-destructive-foreground`};e.s(["x",0,i,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","E",0,"rounded-lg border border-border bg-card p-3 text-card-foreground","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1","D",0,"h-9 w-full appearance-none rounded-md border border-input bg-background pr-8 pl-3"])},67914,e=>{var t=e.i(43476),i=e.i(71645),n=e.i(95187);let r=(0,n.createServerReference)("4028a841e3a56738319e16ecad460936d256385103",n.callServer,void 0,n.findSourceMapURL,"setTheme"),a=["light","dark","system"];e.s(["f",0,function({email:e,accountUrl:n,theme:s,entries:d=[]}){let[o,l]=(0,i.useState)(s),[c,u]=(0,i.useState)(!1),m=(0,i.useRef)(null);return{account:{name:e,signedInAs:"account",accountUrl:n,theme:o,themes:a,hasTheme:!0,onThemeChange:e=>{let t;l(e),document.documentElement.dataset.theme=e,t="dark"===e||"system"===e&&window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.classList.toggle("dark",t),r(e)},shortcuts:[],helpUrl:"https://github.com/ThomasHendrickx/aeolus-fleet",onSignOut:()=>{u(!0),m.current?.requestSubmit()},isSigningOut:c,entries:d},signOutForm:(0,t.jsx)("form",{ref:m,method:"post",action:"/sign-in/end",hidden:!0})}}],67914)},65894,e=>{let t="fleet";e.s(["n",0,t,"i",0,function(e,i){let[n="",r=""]=e.split("?"),a=new URLSearchParams(r);return a.set(t,i),`${n}?${a.toString()}`}])}],18566,(e,t,i)=>{t.exports=e.r(76562)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[69288,73459,31317,6379,70340,2356,90414,e=>{e.s(["f",0,function(e,t){e.replaceState(null,"",t)}],69288),e.s(["f",0,function(e){let t=new URLSearchParams({fleet:e.fleetId,...void 0===e.cursor?{}:{cursor:e.cursor}});return`/meetings/${encodeURIComponent(e.meetingId)}?${t.toString()}`}],73459);var t=e.i(95187);let i=(0,t.createServerReference)("400eae2d6cd258045189d51c623c82d36a37f64386",t.callServer,void 0,t.findSourceMapURL,"answerDelivery");e.s(["f",0,i],31317);let n=(0,t.createServerReference)("409c12fe0b01d63ebbbc2a12b2b2dfac6477ec3d50",t.callServer,void 0,t.findSourceMapURL,"doneDelivery");e.s(["f",0,n],6379);let r=(0,t.createServerReference)("606e0d74c6b0d3d1df4de39bd22d9408f01a679551",t.callServer,void 0,t.findSourceMapURL,"openDelivery");e.s(["f",0,r],70340);let a=(0,t.createServerReference)("40174e9e0edfb1138ae859a3f77519ab7ee8658099",t.callServer,void 0,t.findSourceMapURL,"putInBasket");e.s(["f",0,a],2356);let s=(0,t.createServerReference)("407746915cb9e535e2c80db4d3e85e4103bcf54f2b",t.callServer,void 0,t.findSourceMapURL,"putPickInBasket");e.s(["f",0,s],90414)},70812,71136,96315,28623,e=>{var t=e.i(56420);let i={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],70812);let r={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],71136);let s={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};s.node;let d=(0,t.f)(s);e.s(["f",0,d],96315);let o={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};o.node;let l=(0,t.f)(o);e.s(["f",0,l],28623)},51481,59381,e=>{var t=e.i(75043);e.s(["f",()=>t.f],51481);var i=e.i(56420);let n={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};n.node;let r=(0,i.f)(n);e.s(["f",0,r],59381)},66595,e=>{var t=e.i(56420);let i={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],66595)},95187,(e,t,i)=>{Object.defineProperty(i,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return d.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var r in n)Object.defineProperty(i,r,{enumerable:!0,get:n[r]});let a=e.r(32120),s=e.r(92245),d=e.r(35326)},69969,e=>{var t=e.i(95187);let i=(0,t.createServerReference)("60e7e6f4ed489b1e317abedf31af08ac78c4e3ca08",t.callServer,void 0,t.findSourceMapURL,"removeFromBasket");e.s(["f",0,i])},31785,e=>{let t={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},i={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},n=["decide","do"],r="Bridge keeps every item.",a={label:"Not offered",isOk:!1},s={label:"Off",isOk:!1},d="Says only that something waits, with a link here.",o=`${d} Nothing is on until you turn it on.`,l="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,t,"k",0,i,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${l}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${l}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:t}){return e?t?{state:{label:"On",isOk:!0},description:d,action:"turnOff"}:{state:s,description:o,action:"turnOn"}:{state:a,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,t){return e.jobs.filter(({job:e,places:i})=>i.email!==t&&(!t||n.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:t}))},"r",0,function(e){let t=["Bridge",...e.map(e=>c[e])],i=t.at(-1),n=1===t.length?"Bridge":`${t.slice(0,-1).join(", ")} and ${String(i)}`;return`Shows in ${n}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:t,link:i}=e;return null===i?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${t} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${i.slackName} in ${t}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:n,place:a,isOn:s,waiting:d,isChatOn:o}=e,{name:l,item:c,items:u}=t[n],m=`${i[a]} is ${s?"on":"off"} for ${l}`;return s?"chat"===a?{title:m,detail:`A chat lists every ${c} not done when you ask it.`}:{title:m,detail:`${i[a]} shows ${u} that arrive from now on.${void 0===d||0===d?"":` The ${String(d)} already waiting ${1===d?"stays":"stay"} ${o?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:m,detail:"everything-else"===n&&"slack"===a?`Bots only: a bot ship's messages and replies to Slack still show there. ${r}`:r}},"B",0,function(e){if(!e.isOffered)return{state:a,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:s,description:"This browser takes no web push.",action:"none"};let t=e.browsers.find(({endpoint:t,isGone:i})=>t===e.ownEndpoint&&!i);return void 0===t?{state:s,description:o,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${t.browser}. ${d}`,action:"remove"}}])},35159,e=>{e.s(["b",0,function(e){let t="report-unchanged"===e.signal?`The alert clears when ${e.ship.name} reports again`:"The alert clears by itself once what it tells of moves";return`Aeolus only tells you. ${t}; nothing is sent on clear, so this stays here as it was.`},"c",0,function({consoleUrl:e,shipId:t}){return`${e.replace(/\/$/,"")}/ships/${t}`},"E",0,function(e){return`${String(e)} unseen`}])},94528,e=>{var t=e.i(43476),i=e.i(17904),n=e.i(29039);e.s(["FadedAsLastRead",0,function({children:e}){let r=(0,n.useLastReadAt)();return void 0===r?e:(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsx)("div",{inert:!0,className:"opacity-60 [&_button:not([data-testid=bridge-item-title])]:hidden",children:e}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:`Shown as last read, at ${(0,i.C)(r)}.`})]})}])},3523,e=>{var t=e.i(43476),i=e.i(58487),n=e.i(5654),r=e.i(71645),a=e.i(69288),s=e.i(73459),d=e.i(65894),o=e.i(31317),l=e.i(6379),c=e.i(70340),u=e.i(2356),m=e.i(90414),f=e.i(69969),g=e.i(57228),p=e.i(29247),h=e.i(20347),v=e.i(34244),b=e.i(43328),x=e.i(27538),y=e.i(77826),k=e.i(80734),w=e.i(60296),j=e.i(66734),S=e.i(47130);function N(){let{toasts:e}=n.f.useToastManager();return(0,t.jsx)(b.f.Portal,{children:(0,t.jsx)(x.f.Viewport,{className:"fixed bottom-4 left-4 z-50 hidden w-[min(24rem,calc(100vw-2rem))] gap-2 sm:grid",children:e.map(e=>(0,t.jsxs)(y.f.Root,{toast:e,"data-testid":"bridge-basket-toast",className:"flex items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(S.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0"}),(0,t.jsxs)(k.f.Content,{className:"grid flex-1 gap-1",children:[(0,t.jsx)(w.f.Title,{className:"font-medium"}),(0,t.jsx)(j.f.Description,{className:"text-caption text-muted-foreground"})]})]},e.id))})})}var I=e.i(54235),$=e.i(62579),O=e.i(63132),R=e.i(75103),M=e.i(52021);function z({fleetId:e,decidePlaces:i,consoleUrl:b,known:x,children:y}){let k=n.f.useToastManager(),w=(0,R.P)(),[j,S]=(0,r.useState)(),[N,L]=(0,r.useState)(""),[T,C]=(0,r.useState)(),[A,P]=(0,r.useState)(),[U,B]=(0,r.useState)(),[D,q]=(0,r.useState)(),[F,E]=(0,r.useState)(),[_,V]=(0,r.useState)(),[,H]=(0,r.useTransition)(),[Y,W]=(0,r.useState)(0);(0,M.R)(void 0===j?void 0:(0,v.u)(j.opened.job),()=>{S(void 0)});let K=t=>{C(t.deliveryId),q(void 0),V(void 0),H(async()=>{let i=await (0,c.f)(e,t.deliveryId);if(C(void 0),i.isOk){let e=t.inBasket??null;S({delivery:i.value,opened:{job:t.job,isAlert:t.isAlert??!1,wasNew:"seen"!==t.state},inBasket:e,finished:null}),L(e?.note??""),E(void 0)}else q({deliveryId:t.deliveryId,message:i.message})})},Q=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(Q.current)return;Q.current=!0;let e=(0,h.L)(window.location.href,x);"open"===e.kind?K(e.item):"gone"===e.kind&&((0,a.f)(window.history,(0,h.v)(window.location.href,void 0)),V("That item is no longer in your inbox."))});let G=j?.delivery.deliveryId,J=x.find(({deliveryId:e})=>e===G)?.stale??null;(0,r.useEffect)(()=>{null!==J&&void 0!==G&&S(e=>void 0===e?e:{...e,delivery:(0,p.B)(e.delivery,[{deliveryId:G,stale:J}])})},[J,G]);let X=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!X.current){X.current=!0;return}(0,a.f)(window.history,(0,h.v)(window.location.href,G))},[G]);let Z=({control:e,action:t,onSettled:i})=>{B(e),E(void 0),H(async()=>{let e=await t();B(void 0),e.isOk?i(e.value):E(e.message)})},ee=e=>()=>{S(void 0),V(e)},et=void 0===j?void 0:{deliveryId:j.delivery.deliveryId,job:j.opened.job};return(0,t.jsx)($.f,{list:(0,t.jsxs)("div",{className:"grid gap-4",children:[void 0===_?null:(0,t.jsx)(O.f,{message:_,isFailure:!1}),y({open:K,openingId:T,putPick:(t,i)=>{P(t.deliveryId),q(void 0),V(void 0),H(async()=>{let n=await (0,m.f)({fleet:e,deliveryId:t.deliveryId,option:i});P(void 0),n.isOk?(V(`Option ${String(i)} is in the basket, not sent: ${t.from} receives it when you send the basket.`),W(e=>e+1)):q({deliveryId:t.deliveryId,message:n.message})})},puttingId:A,failure:D,opened:et})]},Y),item:void 0===j?void 0:(({delivery:n,inBasket:r,opened:a,finished:c})=>{let m=n.question?.id;return(0,t.jsx)(I.u,{delivery:n,opened:a,meetingHref:void 0===n.meetingId?void 0:(0,s.f)({fleetId:e,meetingId:n.meetingId}),consoleUrl:b,basketHref:(0,d.i)(g.H,e),inBasket:r,finished:c,places:i,note:N,working:U,failure:F,onNoteChange:L,onAnswer:t=>{Z({control:void 0===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:n.question?.id,option:t,note:N}}),onSettled:ee(`Your answer went to ${n.from}.`)})},onPut:t=>{Z({control:null===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,u.f)({fleet:e,deliveryId:n.deliveryId,option:t,optionLabel:n.question?.options.find(({key:e})=>e===t)?.label??null,note:N}),onSettled:e=>{var t;S({delivery:n,opened:a,finished:c,inBasket:e}),k.add({title:null===(t=e.option)?"Your note alone in the basket":`Option ${String(t)} in the basket`,description:"Not sent. Still waiting on you until you send it."})}})},onSend:t=>{Z({control:{kind:"send"},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:m,option:t??void 0,note:N}}),onSettled:ee(`Your answer went to ${n.from}.`)})},onRemove:()=>{void 0!==m&&Z({control:{kind:"remove"},action:()=>(0,f.f)(e,m),onSettled:ee(`Your answer to “${n.title}” is out of the basket; the question still waits on you.`)})},onDone:()=>{Z({control:{kind:"done"},action:()=>(0,l.f)({fleet:e,deliveryId:n.deliveryId}),onSettled:ee(`Done with “${n.title}”.`)})},onFinishStep:t=>{Z({control:{kind:t},action:()=>(0,l.f)({fleet:e,deliveryId:n.deliveryId,step:{outcome:t,note:N}}),onSettled:()=>{S({delivery:n,inBasket:r,opened:a,finished:{outcome:t,note:N.trim(),at:new Date().toISOString()}})}})},onOpen:e=>{K({deliveryId:e,job:a.job})},onSendMessage:void 0===n.alertShip||void 0===w?void 0:e=>{w({alertShip:e})},onBack:()=>{S(void 0)}},n.deliveryId)})(j)})}e.s(["f",0,function({fleetId:e,decidePlaces:n,consoleUrl:r,known:a,children:s}){return(0,t.jsxs)(i.f.Provider,{children:[(0,t.jsx)(z,{fleetId:e,decidePlaces:n,consoleUrl:r,known:a,children:s}),(0,t.jsx)(N,{})]})}],3523)},48680,e=>{var t=e.i(43476),i=e.i(18566),n=e.i(71645),r=e.i(95187);let a=(0,r.createServerReference)("40e18abbb5c1566937721c8c2adfa555efe588d7c3",r.callServer,void 0,r.findSourceMapURL,"doneMessage");var s=e.i(99200),d=e.i(89664),o=e.i(22768),l=e.i(12497),c=e.i(55070),u=e.i(19015);function m({message:e,now:i,isOpen:n,isMarkingDone:r,isOpening:a,isBusy:f,failure:g,onDone:p,onOpen:h}){let v=void 0===p,b=v?"":(0,s.R)(e.excerpt);return(0,t.jsx)(u.V,{item:{...e,title:(0,s.R)(e.title)},now:i,isNew:"new"===e.state,isOpen:n,outcome:function({message:e,isOpen:t}){return t?"Seen":"seen"===e.state?(0,l.M)(e.seenIn):void 0}({message:e,isOpen:n}),failure:void 0,onOpen:f?void 0:h,detail:""===b?void 0:(0,t.jsx)("p",{className:"line-clamp-2 max-w-[560px] break-words text-meta text-muted-foreground",children:b}),actions:v?void 0:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.i,{"data-testid":"bridge-message-done",size:"row",isPending:r,pendingLabel:"Marking done...",disabled:f,onClick:p,children:[(0,t.jsx)(d.f,{"aria-hidden":"true",className:"size-3.5"}),"Done"]}),(0,t.jsx)(c.i,{"data-testid":"bridge-message-open",size:"row",isPending:a,pendingLabel:"Opening...",disabled:f,onClick:h,children:"Open"}),void 0===g?null:(0,t.jsxs)("p",{role:"alert","data-testid":"bridge-message-failure",className:"flex basis-full items-center gap-1.5 text-meta text-destructive-text",children:[(0,t.jsx)(o.f,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),g]})]})})}e.s(["f",0,function({fleetId:e,messages:r,readAt:d,opening:o,isOpenedOnPage:l=!1}){let c=(0,i.useRouter)(),[u,f]=(0,n.useState)(),[g,p]=(0,n.useState)(),[h,v]=(0,n.useState)(new Set),[b,x]=(0,n.useState)(),[,y]=(0,n.useTransition)(),k=void 0!==o.opened,w=g??o.openingId,j=void 0!==u||void 0!==w;return(0,t.jsx)("ul",{className:k?"border-t border-border":"overflow-hidden rounded-lg border border-border bg-card",children:r.filter(({deliveryId:e})=>!h.has(e)).map(i=>{var n;return(0,t.jsx)(m,{message:i,now:d,isOpen:o.opened?.deliveryId===i.deliveryId,isMarkingDone:u===i.deliveryId,isOpening:w===i.deliveryId,isBusy:j,failure:(n=i.deliveryId,b?.deliveryId===n?b.message:o.failure?.deliveryId===n?o.failure.message:void 0),onDone:k?void 0:()=>{f(i.deliveryId),x(void 0),y(async()=>{let t=await a({fleet:e,deliveryId:i.deliveryId,isNew:"new"===i.state});f(void 0),t.isOk?v(e=>new Set([...e,i.deliveryId])):x({deliveryId:i.deliveryId,message:(0,s.z)(void 0===t.code?void 0:t.message)})})},onOpen:()=>{l?(p(i.deliveryId),y(()=>{c.push((0,s.C)({fleetId:e,deliveryId:i.deliveryId}))})):o.open(i)}},i.deliveryId)})})}],48680)},45818,e=>{var t=e.i(43476),i=e.i(89664),n=e.i(56420);let r={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};r.node;let a=(0,n.f)(r);var s=e.i(71645),d=e.i(95187);let o=(0,d.createServerReference)("400723c5986b731084f36a98ce2009ab404451a250",d.callServer,void 0,d.findSourceMapURL,"markMessagesDone");var l=e.i(99200),c=e.i(55070),u=e.i(63132),m=e.i(3523),f=e.i(48680),g=e.i(52021);function p({said:e,onAsk:i}){return(0,t.jsxs)(c.i,{"data-testid":"bridge-mark-seen-done",size:"row",className:"shrink-0 gap-1.5",isPending:!1,pendingLabel:"",onClick:i,children:[(0,t.jsx)(a,{"aria-hidden":"true",className:"size-3.5"}),e]})}function h({question:e,confirm:n,pending:r,isPending:a,onConfirm:s,onCancel:d}){return(0,t.jsxs)("div",{role:"alertdialog","aria-labelledby":"bridge-mark-seen-question",className:"flex flex-wrap items-center gap-2 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2.5 text-meta",children:[(0,t.jsx)("span",{id:"bridge-mark-seen-question",className:"mr-auto",children:e}),(0,t.jsxs)(c.i,{"data-testid":"bridge-mark-seen-confirm",variant:"primary",size:"row",className:"gap-1.5",isPending:a,pendingLabel:r,onClick:s,children:[(0,t.jsx)(i.f,{"aria-hidden":"true",className:"size-3.5"}),n]}),(0,t.jsx)(c.i,{"data-testid":"bridge-mark-seen-cancel",size:"row",isPending:!1,pendingLabel:"",disabled:a,onClick:d,children:"Cancel"})]})}e.s(["MessagesPanel",0,function({fleetId:e,messages:n,now:r}){let[a,d]=(0,s.useState)({kind:"idle"}),[c,v]=(0,s.useState)(!1),[,b]=(0,s.useTransition)();(0,g.i)(n.length);let x=n.filter(({state:e})=>"seen"===e),y=n.length-x.length,k=(0,l.M)({seenCount:x.length,newCount:y}),w=()=>{v(!0),b(async()=>{let t=await o({fleet:e,messages:x.map(({deliveryId:e,title:t})=>({deliveryId:e,title:t}))});v(!1),d(t.isOk?{kind:"marked",said:(0,l.N)(t.value),isFailure:t.value.failed.length>0}:{kind:"marked",said:`Nothing was marked done: ${t.message}`,isFailure:!0})})};return(0,t.jsx)(m.f,{fleetId:e,known:n,children:s=>(0,t.jsxs)("section",{className:`grid gap-3 ${void 0===s.opened?"max-w-[44rem]":""}`,"aria-labelledby":"bridge-messages-heading",children:[(0,t.jsxs)("div",{"data-testid":"bridge-messages-head",className:`flex items-start justify-between gap-3 ${void 0===s.opened?"":"px-3 pt-2.5"}`,children:[(0,t.jsxs)("div",{className:"grid gap-1 max-sm:sr-only",children:[(0,t.jsxs)("h1",{id:"bridge-messages-heading",className:void 0===s.opened?"text-heading font-semibold":"font-semibold",children:["Messages ",(0,t.jsx)("span",{"data-testid":"bridge-messages-count",className:"text-muted-foreground",children:n.length})]}),0===n.length||void 0!==s.opened?null:(0,t.jsx)("p",{className:"text-caption text-muted-foreground max-sm:hidden",children:(0,l.O)({newCount:y,seenCount:x.length})})]}),void 0===s.opened&&x.length>0&&"asking"!==a.kind?(0,t.jsx)(p,{said:k.button,onAsk:()=>{d({kind:"asking"})}}):null]}),void 0===s.opened&&"asking"===a.kind?(0,t.jsx)(h,{question:k.question,confirm:k.confirm,pending:k.pending,isPending:c,onConfirm:w,onCancel:()=>{d({kind:"idle"})}}):null,"marked"!==a.kind?null:a.isFailure?(0,t.jsx)(u.f,{message:a.said,isFailure:!0}):(0,t.jsxs)("p",{role:"status","data-testid":"bridge-success",className:"flex items-center gap-2 rounded-lg border border-tone-ok-border bg-tone-ok-bg px-3 py-2.5 text-meta text-tone-ok-fg",children:[(0,t.jsx)(i.f,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),a.said]}),0===n.length?(0,t.jsx)("p",{"data-testid":"bridge-no-messages",className:"rounded-md border border-border bg-card p-3 text-muted-foreground",children:"No message waits. What you marked done is in Done."}):(0,t.jsx)(f.f,{fleetId:e,messages:n,readAt:new Date(r),opening:s})]})})}],45818)},55070,e=>{var t=e.i(43476);let i={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},n={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:r,variant:a="secondary",size:s="regular",children:d,className:o="",disabled:l,...c}){return(0,t.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${n[s]} ${i[a]} ${o}`,children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),r]}):d})},"o",0,n])},19015,e=>{var t=e.i(43476),i=e.i(70812),n=e.i(71136),r=e.i(96315),a=e.i(49287),s=e.i(28623),d=e.i(12497),o=e.i(91604),l=e.i(63132),c=e.i(779);let u={bridge:{icon:a.f,name:"Bridge"},slack:{icon:n.f,name:"Slack"},chat:{icon:s.f,name:"a chat"},"web-push":{icon:i.f,name:"web push"},email:{icon:r.f,name:"email"}};function m(){return(0,t.jsx)("span",{"aria-hidden":"true",className:"text-border",children:"·"})}function f({places:e}){var i;let n,r=["bridge",...e].map(e=>u[e]);return(0,t.jsx)("span",{role:"img","aria-label":`Shows in ${(n=(i=r.map(({name:e})=>e)).at(-1)??"",i.length<2?n:`${i.slice(0,-1).join(", ")} and ${n}`)}`,className:"inline-flex items-center gap-0.5",children:r.map(({icon:e,name:i})=>(0,t.jsx)(e,{"aria-hidden":"true",className:"size-3"},i))})}let g="overflow-hidden motion-safe:animate-row-leave";e.s(["V",0,function({item:e,now:i,isNew:n,isOpen:r=!1,staleKind:a,isLeaving:s=!1,outcome:u,failure:p,onOpen:h,time:v,detail:b,actions:x}){var y;let k=e.isAlert??!1,w=(0,o.P)({job:e.job,isAlert:k}),j=w.icon,S="min-w-0 break-words text-left text-body-touch font-medium sm:truncate sm:text-body",N=void 0===a?e.title:(0,t.jsx)("s",{className:"decoration-muted-foreground",children:e.title});return(0,t.jsxs)("li",{"data-testid":"bridge-item","data-stale":void 0!==a,"data-leaving":s||void 0,"aria-current":!!r||void 0,className:`grid min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto] items-start gap-x-2.5 gap-y-1.5 border-t border-border px-3 py-2.5 first:border-t-0 ${function({isOpen:e,isStale:t}){return e?"bg-highlight shadow-[inset_2px_0_0_var(--primary)]":t?"bg-muted":""}({isOpen:r,isStale:void 0!==a})} ${s?g:""}`,children:[(0,t.jsx)(j,{"aria-hidden":"true",className:`mt-0.5 size-4 ${w.tone}`}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-baseline sm:items-center",children:[n?(0,t.jsx)("span",{"aria-label":"New",className:"mr-1.5 size-[7px] shrink-0 -translate-y-px rounded-full bg-primary"}):null,void 0===h?(0,t.jsx)("span",{"data-testid":"bridge-item-title",className:S,children:N}):(0,t.jsx)("button",{type:"button","data-testid":"bridge-item-title",onClick:h,className:`${S} hover:underline`,children:N})]}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsx)("span",{className:`font-medium ${w.tone}`,children:(0,d.z)({job:e.job,isAlert:k})}),(0,t.jsx)(m,{}),(0,t.jsx)("span",{children:e.from}),void 0===u?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsxs)("span",{"data-testid":"bridge-outcome",className:"inline-flex items-center gap-1.5",children:[void 0===a?null:(0,t.jsx)(c.f,{kind:a}),u]})]}),void 0===e.places?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsx)(f,{places:e.places})]})]})]}),(0,t.jsx)("time",{dateTime:v?.at??e.sentAt,title:(y=v?.at??e.sentAt,`${new Date(y).toISOString().slice(0,16).replace("T"," ")} UTC`),className:"whitespace-nowrap text-right text-caption text-muted-foreground",children:v?.said??(0,d.V)(e.sentAt,i)}),void 0===b?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:b}),null==x?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2 flex flex-wrap items-center gap-1.5",children:x}),void 0===p?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:(0,t.jsx)(l.f,{message:p,isFailure:!0})})]})},"U",0,g])},63132,e=>{var t=e.i(43476);e.s(["f",0,function({message:e,isFailure:i}){return i?(0,t.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,t.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},30402,e=>{let t="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",i={primary:`${t} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${t} border border-border bg-card hover:bg-accent`,destructive:`${t} bg-destructive text-destructive-foreground`};e.s(["x",0,i,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","E",0,"rounded-lg border border-border bg-card p-3 text-card-foreground","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1","D",0,"h-9 w-full appearance-none rounded-md border border-input bg-background pr-8 pl-3"])},67914,e=>{var t=e.i(43476),i=e.i(71645),n=e.i(95187);let r=(0,n.createServerReference)("4028a841e3a56738319e16ecad460936d256385103",n.callServer,void 0,n.findSourceMapURL,"setTheme"),a=["light","dark","system"];e.s(["f",0,function({email:e,accountUrl:n,theme:s,entries:d=[]}){let[o,l]=(0,i.useState)(s),[c,u]=(0,i.useState)(!1),m=(0,i.useRef)(null);return{account:{name:e,signedInAs:"account",accountUrl:n,theme:o,themes:a,hasTheme:!0,onThemeChange:e=>{let t;l(e),document.documentElement.dataset.theme=e,t="dark"===e||"system"===e&&window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.classList.toggle("dark",t),r(e)},shortcuts:[],helpUrl:"https://github.com/ThomasHendrickx/aeolus-fleet",onSignOut:()=>{u(!0),m.current?.requestSubmit()},isSigningOut:c,entries:d},signOutForm:(0,t.jsx)("form",{ref:m,method:"post",action:"/sign-in/end",hidden:!0})}}],67914)},65894,e=>{let t="fleet";e.s(["n",0,t,"i",0,function(e,i){let[n="",r=""]=e.split("?"),a=new URLSearchParams(r);return a.set(t,i),`${n}?${a.toString()}`}])}],18566,(e,t,i)=>{t.exports=e.r(76562)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[69288,73459,31317,6379,70340,2356,90414,e=>{e.s(["f",0,function(e,t){e.replaceState(null,"",t)}],69288),e.s(["f",0,function(e){let t=new URLSearchParams({fleet:e.fleetId,...void 0===e.cursor?{}:{cursor:e.cursor}});return`/meetings/${encodeURIComponent(e.meetingId)}?${t.toString()}`}],73459);var t=e.i(95187);let n=(0,t.createServerReference)("400eae2d6cd258045189d51c623c82d36a37f64386",t.callServer,void 0,t.findSourceMapURL,"answerDelivery");e.s(["f",0,n],31317);let i=(0,t.createServerReference)("409c12fe0b01d63ebbbc2a12b2b2dfac6477ec3d50",t.callServer,void 0,t.findSourceMapURL,"doneDelivery");e.s(["f",0,i],6379);let s=(0,t.createServerReference)("606e0d74c6b0d3d1df4de39bd22d9408f01a679551",t.callServer,void 0,t.findSourceMapURL,"openDelivery");e.s(["f",0,s],70340);let r=(0,t.createServerReference)("40174e9e0edfb1138ae859a3f77519ab7ee8658099",t.callServer,void 0,t.findSourceMapURL,"putInBasket");e.s(["f",0,r],2356);let a=(0,t.createServerReference)("407746915cb9e535e2c80db4d3e85e4103bcf54f2b",t.callServer,void 0,t.findSourceMapURL,"putPickInBasket");e.s(["f",0,a],90414)},51481,59381,e=>{var t=e.i(75043);e.s(["f",()=>t.f],51481);var n=e.i(56420);let i={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};i.node;let s=(0,n.f)(i);e.s(["f",0,s],59381)},66595,e=>{var t=e.i(56420);let n={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};n.node;let i=(0,t.f)(n);e.s(["f",0,i],66595)},95187,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0});var i={callServer:function(){return r.callServer},createServerReference:function(){return d.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var s in i)Object.defineProperty(n,s,{enumerable:!0,get:i[s]});let r=e.r(32120),a=e.r(92245),d=e.r(35326)},69969,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("60e7e6f4ed489b1e317abedf31af08ac78c4e3ca08",t.callServer,void 0,t.findSourceMapURL,"removeFromBasket");e.s(["f",0,n])},31785,e=>{let t={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},n={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},i=["decide","do"],s="Bridge keeps every item.",r={label:"Not offered",isOk:!1},a={label:"Off",isOk:!1},d="Says only that something waits, with a link here.",o=`${d} Nothing is on until you turn it on.`,l="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,t,"k",0,n,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${l}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${l}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:t}){return e?t?{state:{label:"On",isOk:!0},description:d,action:"turnOff"}:{state:a,description:o,action:"turnOn"}:{state:r,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,t){return e.jobs.filter(({job:e,places:n})=>n.email!==t&&(!t||i.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:t}))},"r",0,function(e){let t=["Bridge",...e.map(e=>c[e])],n=t.at(-1),i=1===t.length?"Bridge":`${t.slice(0,-1).join(", ")} and ${String(n)}`;return`Shows in ${i}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:t,link:n}=e;return null===n?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${t} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${n.slackName} in ${t}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:i,place:r,isOn:a,waiting:d,isChatOn:o}=e,{name:l,item:c,items:u}=t[i],h=`${n[r]} is ${a?"on":"off"} for ${l}`;return a?"chat"===r?{title:h,detail:`A chat lists every ${c} not done when you ask it.`}:{title:h,detail:`${n[r]} shows ${u} that arrive from now on.${void 0===d||0===d?"":` The ${String(d)} already waiting ${1===d?"stays":"stay"} ${o?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:h,detail:"everything-else"===i&&"slack"===r?`Bots only: a bot ship's messages and replies to Slack still show there. ${s}`:s}},"B",0,function(e){if(!e.isOffered)return{state:r,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:a,description:"This browser takes no web push.",action:"none"};let t=e.browsers.find(({endpoint:t,isGone:n})=>t===e.ownEndpoint&&!n);return void 0===t?{state:a,description:o,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${t.browser}. ${d}`,action:"remove"}}])},35159,e=>{e.s(["b",0,function(e){let t="report-unchanged"===e.signal?`The alert clears when ${e.ship.name} reports again`:"The alert clears by itself once what it tells of moves";return`Aeolus only tells you. ${t}; nothing is sent on clear, so this stays here as it was.`},"c",0,function({consoleUrl:e,shipId:t}){return`${e.replace(/\/$/,"")}/ships/${t}`},"E",0,function(e){return`${String(e)} unseen`}])},22141,e=>{var t=e.i(43476),n=e.i(56420);let i={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};i.node;let s=(0,n.f)(i);var r=e.i(47211),a=e.i(89664),d=e.i(22768),o=e.i(85595),l=e.i(51481);let c={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};c.node;let u=(0,n.f)(c);var h=e.i(11568);let p={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};p.node;let f=(0,n.f)(p);var m=e.i(32645),g=e.i(30274),b=e.i(47130),v=e.i(63676),x=e.i(71645),k=e.i(69969),w=e.i(95187);let y=(0,w.createServerReference)("40e9c41f0b0709783b4c06aff369d7acdf11bbe7c1",w.callServer,void 0,w.findSourceMapURL,"sendBasket");function j(e){return`${new Date(e).toISOString().slice(11,16)} UTC`}let S={bridge:"in Bridge",chat:"in a chat",slack:"in Slack",gateway:"by the gateway"};function $(e){return{desktop:e,phone:e}}function N(e){return 1===e?"1 answer":`${String(e)} answers`}function I(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)??""}`}function R(e){return[...new Set(e.map(({from:e})=>e))]}var O=e.i(55070),T=e.i(63132),L=e.i(3523);let z={sent:o.f,sending:h.f,next:u,unanswered:h.f,refused:d.f,withdrawn:r.f,replaced:m.f,elsewhere:a.f},B={ok:"text-tone-ok-fg",waiting:"text-tone-waiting-fg",attention:"text-tone-attention-fg",off:"text-muted-foreground"};function M({words:e}){return e.desktop===e.phone?(0,t.jsx)("span",{children:e.desktop}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:e.desktop}),(0,t.jsx)("span",{className:"sm:hidden",children:e.phone})]})}function U({line:e}){let n=z[e.icon];return(0,t.jsxs)("p",{"data-testid":"bridge-basket-standing",className:"col-span-2 col-start-2 flex items-start gap-1.5 text-meta",children:[(0,t.jsx)(n,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 ${B[e.tone]}`}),(0,t.jsx)("span",{children:(0,t.jsx)(M,{words:e.words})})]})}function A({entry:e,line:n,opening:i,working:r,onRemove:a}){let{standing:d}=e,o="withdrawn"===d.kind||"replaced"===d.kind||"dealtElsewhere"===d.kind,c=void 0!==r||void 0!==i.openingId,u=r?.kind==="remove"&&r.questionId===e.questionId,h="replaced"===d.kind?d.replacementId:null,p=o?"line-through decoration-muted-foreground":"";return(0,t.jsxs)("li",{"data-testid":"bridge-basket-entry","data-standing":d.kind,className:`grid grid-cols-[18px_1fr_auto] items-start gap-x-2.5 gap-y-1.5 border-t border-border p-3 first:border-t-0 sm:px-3.5 ${o?"bg-muted":""}`,children:[(0,t.jsx)(l.f,{"aria-hidden":!0,className:"mt-0.5 size-4 text-tone-active-fg"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:`font-medium ${p}`,children:e.title}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsxs)("span",{children:["to ",(0,t.jsx)("b",{className:"font-medium text-foreground",children:e.from})]}),(0,t.jsx)("span",{"aria-hidden":!0,className:"hidden text-border sm:inline",children:"·"}),(0,t.jsxs)("span",{className:"hidden sm:inline",children:["asked at ",(0,t.jsx)("time",{dateTime:e.sentAt,children:j(e.sentAt)})]})]}),(0,t.jsxs)("span",{className:`${o?"hidden sm:flex":"flex"} items-center gap-1.5 text-meta ${p}`,children:[(0,t.jsx)(s,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-primary"}),null===e.option?"Note alone":null===e.optionLabel?`Option ${String(e.option)}`:`${String(e.option)}. ${e.optionLabel}`]}),null===e.note?null:(0,t.jsxs)("span",{className:"text-caption italic text-muted-foreground",children:['"',e.note,'"']})]}),"waiting"===d.kind?(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(O.i,{"data-testid":"bridge-basket-change",size:"small","aria-label":"Change",isPending:i.openingId===e.deliveryId,pendingLabel:"Opening...",disabled:c,onClick:()=>{i.open({deliveryId:e.deliveryId,job:"decide",inBasket:{option:e.option,note:e.note}})},children:[(0,t.jsx)(f,{"aria-hidden":!0,className:"size-3.5"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Change"})]}),(0,t.jsxs)(O.i,{"data-testid":"bridge-basket-remove",size:"small",variant:"ghost","aria-label":"Remove",isPending:u,pendingLabel:"Removing...",disabled:c,onClick:()=>{a(e.questionId)},children:[(0,t.jsx)(v.X,{"aria-hidden":!0,className:"size-4 sm:hidden"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Remove"})]})]}):(0,t.jsx)("span",{}),void 0===n?null:(0,t.jsx)(U,{line:n}),i.failure?.deliveryId===e.deliveryId?(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:(0,t.jsx)(T.f,{message:i.failure.message,isFailure:!0})}):null,"withdrawn"===d.kind||"replaced"===d.kind||"dealtElsewhere"===d.kind||"refused"===d.kind?(0,t.jsxs)("div",{className:"col-span-2 col-start-2 flex flex-wrap items-center gap-1.5",children:[null===h?null:(0,t.jsxs)(O.i,{"data-testid":"bridge-replacement",size:"small",isPending:i.openingId===h,pendingLabel:"Opening...",disabled:c,onClick:()=>{i.open({deliveryId:h,job:"decide"})},children:[(0,t.jsx)(s,{"aria-hidden":!0,className:"size-3.5"}),"Answer the new question"]}),(0,t.jsx)(O.i,{"data-testid":"bridge-basket-remove",size:"small",variant:"replaced"===d.kind?"ghost":"secondary",isPending:u,pendingLabel:"Removing...",disabled:c,onClick:()=>{a(e.questionId)},children:"refused"===d.kind?"Remove and mark done":"Remove"})]}):null]})}function P({foot:e,isSending:n,isWorking:i,onSend:s}){return"none"===e.kind?null:(0,t.jsxs)("div",{"data-testid":"bridge-basket-foot",className:"flex flex-col items-stretch gap-2 border-t border-border bg-card p-3 sm:flex-row sm:items-center sm:gap-3 sm:px-3.5",children:[(0,t.jsx)("p",{className:"flex-1 text-caption text-muted-foreground",children:(0,t.jsx)(M,{words:e.words})}),"send"===e.kind?(0,t.jsxs)(O.i,{"data-testid":"bridge-basket-send",variant:"primary",className:"justify-center",isPending:n,pendingLabel:"Sending...",disabled:i,onClick:s,children:[(0,t.jsx)(g.f,{"aria-hidden":!0,className:"size-4"}),e.label]}):null,"sending"===e.kind?(0,t.jsxs)("button",{type:"button","data-testid":"bridge-basket-sending",disabled:!0,"aria-busy":"true",className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-border bg-card px-4 font-medium text-card-foreground",children:[(0,t.jsx)(h.f,{"aria-hidden":!0,className:"size-4 animate-spin"}),e.progress]}):null]})}function C({summary:e}){return(0,t.jsxs)("div",{"data-testid":"bridge-basket-sent",role:"status",className:"flex max-w-[620px] items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(o.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0 text-tone-ok-fg"}),(0,t.jsxs)("span",{className:"grid gap-1",children:[(0,t.jsx)("span",{className:"font-medium",children:e.title}),(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e.description})]})]})}function D(){return(0,t.jsxs)("div",{"data-testid":"bridge-basket-empty",className:"grid max-w-[820px] justify-items-center gap-3 rounded-lg border border-dashed border-border bg-card px-6 py-10 text-center",children:[(0,t.jsx)("span",{className:"inline-flex size-11 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,t.jsx)(b.f,{"aria-hidden":!0,className:"size-5"})}),(0,t.jsx)("span",{className:"text-heading font-semibold",children:"The basket is empty"}),(0,t.jsx)("span",{className:"max-w-[360px] text-muted-foreground",children:"Pick an option on a question and put it in the basket; it waits here until you send it."})]})}e.s(["BasketPanel",0,function({fleetId:e,basket:n}){let i,s,[r,a]=(0,x.useState)(),[d,o]=(0,x.useState)(),[,l]=(0,x.useTransition)(),c=(i=n.entries.some(({standing:e})=>"sent"===e.kind),s=n.entries.find(({standing:e})=>"sending"===e.kind&&!e.isUnanswered),n.entries.map(e=>(function(e,t){let{standing:n,from:i}=e;switch(n.kind){case"waiting":return;case"sent":{let e=j(n.at);return{icon:"sent",tone:"ok",words:{desktop:`Sent at ${e} and stored. Done.`,phone:`Sent at ${e}. Done.`}}}case"sending":if(n.isUnanswered)return{icon:"unanswered",tone:"waiting",words:{desktop:"The fleet did not answer. Sending again with the same key until it is stored; it arrives once.",phone:"No answer from the fleet. Sending again, same key."}};return t.isSendingNow?{icon:"sending",tone:"waiting",words:$("Sending...")}:{icon:"next",tone:"waiting",words:{desktop:"Next, in the order you added it",phone:"Next"}};case"refused":{let e=`Not sent: ${n.reason}.`,[i=n.reason]=n.reason.split(", so ");return{icon:"refused",tone:"attention",words:{desktop:t.isAnySent?`${e} The others were sent.`:e,phone:`Not sent: ${i}.`}}}case"withdrawn":return{icon:"withdrawn",tone:"off",words:{desktop:`Withdrawn by ${i} at ${j(n.at)}. Not sent; Send skips it.`,phone:`Withdrawn by ${i}. Not sent.`}};case"replaced":{let e=null===n.replacementTitle?".":` with "${n.replacementTitle}"`;return{icon:"replaced",tone:"off",words:{desktop:`Replaced by ${i} at ${j(n.at)}${e} Not sent: its options differ, so answer the new one.`,phone:`Replaced by ${i}. Not sent.`}}}case"dealtElsewhere":return{icon:"elsewhere",tone:"off",words:$(null===n.option?`Done ${S[n.place]}. Nothing is sent from it.`:`Answered ${S[n.place]}: option ${String(n.option)}. Nothing is sent from it.`)}}})(e,{isAnySent:i,isSendingNow:e===s}))),u=function(e){let{entries:t}=e;if(0===t.length||t.some(({standing:e})=>"sent"!==e.kind))return;let n=`To ${I(R(t))}, as you;`;return{title:`${N(t.length)} sent`,description:1===t.length?`${n} stored, and in Done.`:`${n} each stored, each in Done.`}}(n),h=t=>{a({kind:"remove",questionId:t}),o(void 0),l(async()=>{let n=await (0,k.f)(e,t);a(void 0),o(n.isOk?void 0:n.message)})},p=()=>{a({kind:"send"}),o(void 0),l(async()=>{let t=await y(e);a(void 0),o(t.isOk?void 0:t.message)})};return(0,t.jsx)(L.f,{fleetId:e,known:n.entries.map(e=>({deliveryId:e.deliveryId,job:"decide",isAlert:!1,state:"seen",inBasket:{option:e.option,note:e.note}})),children:e=>(0,t.jsxs)("section",{className:"grid gap-4","aria-labelledby":"bridge-basket-heading",children:[(0,t.jsxs)("div",{className:"hidden sm:block",children:[(0,t.jsxs)("h1",{id:"bridge-basket-heading",className:"text-heading font-semibold",children:["Basket ",(0,t.jsx)("span",{"data-testid":"bridge-basket-count",className:"text-primary",children:n.count})]}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:"Answers you picked in Bridge, not sent yet. Nothing goes until you press Send."})]}),void 0===d?null:(0,t.jsx)(T.f,{message:d,isFailure:!0}),void 0===u?null:(0,t.jsx)(C,{summary:u}),0===n.entries.length||void 0!==u?(0,t.jsx)(D,{}):(0,t.jsxs)("div",{className:"max-w-[820px] overflow-hidden rounded-lg border border-border bg-card",children:[(0,t.jsx)("ul",{children:n.entries.map((n,i)=>(0,t.jsx)(A,{entry:n,line:c[i],opening:e,working:r,onRemove:h},n.questionId))}),(0,t.jsx)(P,{foot:function(e){if(e.toSend>0)return function(e){var t;let n=function(e){let t=t=>e.filter(({standing:e})=>e.kind===t).length,n=["withdrawn","replaced"].map(e=>({kind:e,count:t(e)})).filter(({count:e})=>e>0),i=n.map(({kind:e,count:t},i)=>t>1?`the ${String(t)} ${e}`:i===n.length-1?`the ${e} one`:`the ${e}`),s=t("dealtElsewhere"),r=0===s?i:[...i,1===s?"the one answered elsewhere":`the ${String(s)} answered elsewhere`];if(0===r.length)return;let a=I(r),d=1===n.reduce((e,{count:t})=>e+t,s);return`${a.charAt(0).toUpperCase()}${a.slice(1)} ${d?"is":"are"} not sent.`}(e.entries),i=(t=e.toSend,`Send ${N(t)}`);if(void 0!==n)return{kind:"send",words:{desktop:`${String(e.toSend)} to send. ${n}`,phone:n},label:i};let s=e.entries.filter(({standing:e})=>"waiting"===e.kind),r=R(s),a=r.length>1?"each receive their own answer":s.length>1?"receives its own answer to each":"receives its own answer";return{kind:"send",words:{desktop:`${I(r)} ${a}, as you, as if sent one by one.`,phone:"Each asker receives its own answer."},label:i}}(e);let t=e.entries.map(({standing:e})=>e),n=t.filter(({kind:e})=>"sent"===e).length,i=t.filter(({kind:e})=>"sending"===e).length,s=t.filter(({kind:e})=>"refused"===e).length,r=t.some(e=>"sending"===e.kind&&e.isUnanswered);if(i>0&&0===s&&!r)return{kind:"sending",words:{desktop:"You can close Bridge: the gateway keeps sending what is stored as sending.",phone:"You can close Bridge; the gateway keeps sending."},progress:`Sending ${String(n+1)} of ${String(n+i)}`};if(0===i&&0===s)return{kind:"none"};let a=(e,t)=>0===e?[]:[`${String(e)} ${t}`];return{kind:"summary",words:{desktop:`${[...a(n,"sent"),...a(i,"still sending"),...a(s,"not sent")].join(", ")}.`,phone:`${[...a(n,"sent"),...a(i,"sending"),...a(s,"not sent")].join(", ")}.`}}}(n),isSending:r?.kind==="send",isWorking:void 0!==r||void 0!==e.openingId,onSend:p})]})]})})}],22141)},94528,e=>{var t=e.i(43476),n=e.i(17904),i=e.i(29039);e.s(["FadedAsLastRead",0,function({children:e}){let s=(0,i.useLastReadAt)();return void 0===s?e:(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsx)("div",{inert:!0,className:"opacity-60 [&_button:not([data-testid=bridge-item-title])]:hidden",children:e}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:`Shown as last read, at ${(0,n.C)(s)}.`})]})}])},3523,e=>{var t=e.i(43476),n=e.i(58487),i=e.i(5654),s=e.i(71645),r=e.i(69288),a=e.i(73459),d=e.i(65894),o=e.i(31317),l=e.i(6379),c=e.i(70340),u=e.i(2356),h=e.i(90414),p=e.i(69969),f=e.i(57228),m=e.i(29247),g=e.i(20347),b=e.i(34244),v=e.i(43328),x=e.i(27538),k=e.i(77826),w=e.i(80734),y=e.i(60296),j=e.i(66734),S=e.i(47130);function $(){let{toasts:e}=i.f.useToastManager();return(0,t.jsx)(v.f.Portal,{children:(0,t.jsx)(x.f.Viewport,{className:"fixed bottom-4 left-4 z-50 hidden w-[min(24rem,calc(100vw-2rem))] gap-2 sm:grid",children:e.map(e=>(0,t.jsxs)(k.f.Root,{toast:e,"data-testid":"bridge-basket-toast",className:"flex items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(S.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0"}),(0,t.jsxs)(w.f.Content,{className:"grid flex-1 gap-1",children:[(0,t.jsx)(y.f.Title,{className:"font-medium"}),(0,t.jsx)(j.f.Description,{className:"text-caption text-muted-foreground"})]})]},e.id))})})}var N=e.i(54235),I=e.i(62579),R=e.i(63132),O=e.i(75103),T=e.i(52021);function L({fleetId:e,decidePlaces:n,consoleUrl:v,known:x,children:k}){let w=i.f.useToastManager(),y=(0,O.P)(),[j,S]=(0,s.useState)(),[$,z]=(0,s.useState)(""),[B,M]=(0,s.useState)(),[U,A]=(0,s.useState)(),[P,C]=(0,s.useState)(),[D,q]=(0,s.useState)(),[E,F]=(0,s.useState)(),[Y,H]=(0,s.useState)(),[,W]=(0,s.useTransition)(),[_,V]=(0,s.useState)(0);(0,T.R)(void 0===j?void 0:(0,b.u)(j.opened.job),()=>{S(void 0)});let K=t=>{M(t.deliveryId),q(void 0),H(void 0),W(async()=>{let n=await (0,c.f)(e,t.deliveryId);if(M(void 0),n.isOk){let e=t.inBasket??null;S({delivery:n.value,opened:{job:t.job,isAlert:t.isAlert??!1,wasNew:"seen"!==t.state},inBasket:e,finished:null}),z(e?.note??""),F(void 0)}else q({deliveryId:t.deliveryId,message:n.message})})},Q=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(Q.current)return;Q.current=!0;let e=(0,g.L)(window.location.href,x);"open"===e.kind?K(e.item):"gone"===e.kind&&((0,r.f)(window.history,(0,g.v)(window.location.href,void 0)),H("That item is no longer in your inbox."))});let X=j?.delivery.deliveryId,G=x.find(({deliveryId:e})=>e===X)?.stale??null;(0,s.useEffect)(()=>{null!==G&&void 0!==X&&S(e=>void 0===e?e:{...e,delivery:(0,m.B)(e.delivery,[{deliveryId:X,stale:G}])})},[G,X]);let J=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!J.current){J.current=!0;return}(0,r.f)(window.history,(0,g.v)(window.location.href,X))},[X]);let Z=({control:e,action:t,onSettled:n})=>{C(e),F(void 0),W(async()=>{let e=await t();C(void 0),e.isOk?n(e.value):F(e.message)})},ee=e=>()=>{S(void 0),H(e)},et=void 0===j?void 0:{deliveryId:j.delivery.deliveryId,job:j.opened.job};return(0,t.jsx)(I.f,{list:(0,t.jsxs)("div",{className:"grid gap-4",children:[void 0===Y?null:(0,t.jsx)(R.f,{message:Y,isFailure:!1}),k({open:K,openingId:B,putPick:(t,n)=>{A(t.deliveryId),q(void 0),H(void 0),W(async()=>{let i=await (0,h.f)({fleet:e,deliveryId:t.deliveryId,option:n});A(void 0),i.isOk?(H(`Option ${String(n)} is in the basket, not sent: ${t.from} receives it when you send the basket.`),V(e=>e+1)):q({deliveryId:t.deliveryId,message:i.message})})},puttingId:U,failure:D,opened:et})]},_),item:void 0===j?void 0:(({delivery:i,inBasket:s,opened:r,finished:c})=>{let h=i.question?.id;return(0,t.jsx)(N.u,{delivery:i,opened:r,meetingHref:void 0===i.meetingId?void 0:(0,a.f)({fleetId:e,meetingId:i.meetingId}),consoleUrl:v,basketHref:(0,d.i)(f.H,e),inBasket:s,finished:c,places:n,note:$,working:P,failure:E,onNoteChange:z,onAnswer:t=>{Z({control:void 0===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,o.f)({fleet:e,deliveryId:i.deliveryId,input:{questionId:i.question?.id,option:t,note:$}}),onSettled:ee(`Your answer went to ${i.from}.`)})},onPut:t=>{Z({control:null===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,u.f)({fleet:e,deliveryId:i.deliveryId,option:t,optionLabel:i.question?.options.find(({key:e})=>e===t)?.label??null,note:$}),onSettled:e=>{var t;S({delivery:i,opened:r,finished:c,inBasket:e}),w.add({title:null===(t=e.option)?"Your note alone in the basket":`Option ${String(t)} in the basket`,description:"Not sent. Still waiting on you until you send it."})}})},onSend:t=>{Z({control:{kind:"send"},action:()=>(0,o.f)({fleet:e,deliveryId:i.deliveryId,input:{questionId:h,option:t??void 0,note:$}}),onSettled:ee(`Your answer went to ${i.from}.`)})},onRemove:()=>{void 0!==h&&Z({control:{kind:"remove"},action:()=>(0,p.f)(e,h),onSettled:ee(`Your answer to “${i.title}” is out of the basket; the question still waits on you.`)})},onDone:()=>{Z({control:{kind:"done"},action:()=>(0,l.f)({fleet:e,deliveryId:i.deliveryId}),onSettled:ee(`Done with “${i.title}”.`)})},onFinishStep:t=>{Z({control:{kind:t},action:()=>(0,l.f)({fleet:e,deliveryId:i.deliveryId,step:{outcome:t,note:$}}),onSettled:()=>{S({delivery:i,inBasket:s,opened:r,finished:{outcome:t,note:$.trim(),at:new Date().toISOString()}})}})},onOpen:e=>{K({deliveryId:e,job:r.job})},onSendMessage:void 0===i.alertShip||void 0===y?void 0:e=>{y({alertShip:e})},onBack:()=>{S(void 0)}},i.deliveryId)})(j)})}e.s(["f",0,function({fleetId:e,decidePlaces:i,consoleUrl:s,known:r,children:a}){return(0,t.jsxs)(n.f.Provider,{children:[(0,t.jsx)(L,{fleetId:e,decidePlaces:i,consoleUrl:s,known:r,children:a}),(0,t.jsx)($,{})]})}],3523)},55070,e=>{var t=e.i(43476);let n={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},i={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:s,variant:r="secondary",size:a="regular",children:d,className:o="",disabled:l,...c}){return(0,t.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${i[a]} ${n[r]} ${o}`,children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),s]}):d})},"o",0,i])},63132,e=>{var t=e.i(43476);e.s(["f",0,function({message:e,isFailure:n}){return n?(0,t.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,t.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},30402,e=>{let t="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",n={primary:`${t} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${t} border border-border bg-card hover:bg-accent`,destructive:`${t} bg-destructive text-destructive-foreground`};e.s(["x",0,n,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","E",0,"rounded-lg border border-border bg-card p-3 text-card-foreground","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1","D",0,"h-9 w-full appearance-none rounded-md border border-input bg-background pr-8 pl-3"])},67914,e=>{var t=e.i(43476),n=e.i(71645),i=e.i(95187);let s=(0,i.createServerReference)("4028a841e3a56738319e16ecad460936d256385103",i.callServer,void 0,i.findSourceMapURL,"setTheme"),r=["light","dark","system"];e.s(["f",0,function({email:e,accountUrl:i,theme:a,entries:d=[]}){let[o,l]=(0,n.useState)(a),[c,u]=(0,n.useState)(!1),h=(0,n.useRef)(null);return{account:{name:e,signedInAs:"account",accountUrl:i,theme:o,themes:r,hasTheme:!0,onThemeChange:e=>{let t;l(e),document.documentElement.dataset.theme=e,t="dark"===e||"system"===e&&window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.classList.toggle("dark",t),s(e)},shortcuts:[],helpUrl:"https://github.com/ThomasHendrickx/aeolus-fleet",onSignOut:()=>{u(!0),h.current?.requestSubmit()},isSigningOut:c,entries:d},signOutForm:(0,t.jsx)("form",{ref:h,method:"post",action:"/sign-in/end",hidden:!0})}}],67914)},65894,e=>{let t="fleet";e.s(["n",0,t,"i",0,function(e,n){let[i="",s=""]=e.split("?"),r=new URLSearchParams(s);return r.set(t,n),`${i}?${r.toString()}`}])}],18566,(e,t,n)=>{t.exports=e.r(76562)}]);
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25621,e=>{var t=e.i(43476);e.s(["f",0,function({isOn:e,label:n,isPending:s=!1,type:r="button",onClick:a,testId:l}){return(0,t.jsx)("button",{type:r,role:"switch","aria-checked":e,"aria-label":n,"aria-busy":s,disabled:s,onClick:a,"data-testid":l,className:`inline-flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition-colors disabled:opacity-60 ${e?"border-primary bg-primary":"border-input bg-muted"}`,children:(0,t.jsx)("span",{className:`size-3.5 rounded-full bg-background shadow-sm transition-transform ${e?"translate-x-4":"translate-x-0"} ${s?"animate-pulse":""}`})})}])},23019,19407,17779,35671,44047,90218,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("40a657614147f046e413deb974a3d92e5788505446",t.callServer,void 0,t.findSourceMapURL,"setPartyScopes");function s(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)??""}`}function r(e){return`${String(e)} ${1===e?"tool":"tools"}`}function a(e,t){return null===t?e:`${e}; the fleet sees it at the proxy ship's next statement: ${t}`}e.s(["f",0,n],23019),e.s(["B",0,function({party:e,scopes:t}){return 0===t.length?`Every message to ${e} needs nothing beyond reaching it`:`Every message to ${e} needs ${s(t)}`},"G",0,function({party:e,scopes:t}){return 0===t.length?`Every tool of ${e} needs nothing beyond reaching it`:`Every tool of ${e} needs ${s(t)}`},"y",0,function({scopes:e,how:t,count:n}){return"remove"===t?`${s(e)} removed from ${r(n)}`:0===e.length?`${r(n)} need${1===n?"s":""} nothing of ${1===n?"its":"their"} own`:`${s(e)} set on ${r(n)}`},"I",0,a,"q",0,function(e){return e.map(({scopes:e,count:t})=>`${s(e)} set on ${r(t)}`).join("; ")},"g",0,function({count:e,isOn:t,statementRefusal:n}){return a(`${r(e)} switched ${t?"on":"off"}`,n)}],19407);var l=e.i(43476);e.s(["f",0,function({party:e=[],own:t,listed:n}){if(0===e.length&&0===t.length)return(0,l.jsx)("span",{className:"text-muted-foreground",children:"Nothing"});let s=(e,t)=>{let s=null!==n&&!n.has(e);return(0,l.jsxs)("span",{className:`inline-flex items-center rounded-md border px-2 font-mono text-caption ${s?"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg":t?"border-transparent bg-muted text-muted-foreground":"border-border"}`,"data-testid":t?"tools-table-party-scope":"tools-table-scope",title:s?"No longer defined in the fleet":t?"Every tool needs it":void 0,children:[e,s?(0,l.jsx)("span",{className:"ml-1 font-sans",children:"(no longer defined)"}):null]},`${t?"party":"own"}-${e}`)};return(0,l.jsxs)("span",{className:"flex flex-wrap gap-1",children:[e.map(e=>s(e,!0)),t.filter(t=>!e.includes(t)).map(e=>s(e,!1))]})}],17779);var i=e.i(24189),i=i,o=e.i(93976),d=e.i(37134),c=i,u=i,p=i,f=i,m=e.i(62050),h=e.i(45017),g=e.i(47125),x=e.i(10030),b=e.i(58998),v=e.i(94313),w=e.i(53535),y=i;let S=({scope:e,description:t})=>({value:e,label:e,description:t});e.s(["f",0,function({label:e,listed:t,picked:n,onPick:s,isDisabled:r=!1,testId:a}){let{contains:j}=i.useFilter(),N=[...t.map(S),...n.filter(e=>!t.some(t=>t.scope===e)).map(e=>({value:e,label:e,description:"No longer defined in the fleet"}))],R=N.filter(e=>n.includes(e.value));return(0,l.jsxs)(o.f.Root,{multiple:!0,items:N,value:R,disabled:r,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{"escape-key"===t.reason?t.cancel():s(e.map(e=>e.value))},filter:(e,t)=>j(e.label,t)||j(e.description,t),children:[(0,l.jsxs)("div",{className:"grid gap-1","data-testid":a,children:[(0,l.jsx)(d.f.Label,{className:"font-medium",children:e}),(0,l.jsx)(c.InputGroup,{className:"flex min-h-9 flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1",children:(0,l.jsxs)(u.Chips,{className:"contents",children:[R.map(e=>(0,l.jsxs)(p.Chip,{className:"inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 font-mono text-caption","aria-label":e.value,children:[e.value,(0,l.jsx)(f.ChipRemove,{className:"text-muted-foreground hover:text-foreground","aria-label":`Remove ${e.value}`,children:"×"})]},e.value)),(0,l.jsx)(m.f.Input,{placeholder:0===R.length?"Search the fleet's scopes":"",className:"h-7 min-w-32 flex-1 bg-transparent outline-none"})]})})]}),(0,l.jsx)(h.f.Portal,{children:(0,l.jsx)(g.f.Positioner,{sideOffset:4,className:"z-50",children:(0,l.jsxs)(x.f.Popup,{className:"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",children:[(0,l.jsx)(b.f.Empty,{className:"px-2 py-1 text-muted-foreground",children:"No scope listed matches."}),(0,l.jsx)(v.f.List,{children:e=>(0,l.jsxs)(w.f.Item,{value:e,className:"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded px-2 py-1 data-highlighted:bg-accent",children:[(0,l.jsx)(y.ItemIndicator,{className:"row-span-2",children:"✓"}),(0,l.jsx)("span",{className:"col-start-2 font-mono text-code",children:e.value}),(0,l.jsx)("span",{className:"col-start-2 text-caption text-muted-foreground",children:e.description})]},e.value)})]})})})]})}],35671);var j=e.i(26323),N=e.i(9977),R=e.i(41708),C=e.i(93480),k=e.i(9169),$=e.i(52744),P=e.i(30402),T=e.i(55070);e.s(["G",0,function({isOpen:e,onClose:t,title:n,description:s,children:r,appliesTo:a,action:i,isSaving:o,refusal:d,onReload:c,isReloading:u,testId:p}){return(0,l.jsx)(j.f.Root,{open:e,onOpenChange:e=>{e||o||t()},children:(0,l.jsxs)(N.f.Portal,{children:[(0,l.jsx)(R.f.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,l.jsxs)(C.f.Popup,{className:"fixed top-1/2 left-1/2 z-50 grid max-h-[90vh] w-[min(36rem,calc(100vw-2rem))] -translate-1/2 gap-4 overflow-auto rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-lg","data-testid":p,children:[(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(k.f.Title,{className:"text-heading font-semibold",children:n}),(0,l.jsx)($.f.Description,{className:"text-muted-foreground",children:s})]}),(0,l.jsx)("fieldset",{disabled:o,className:"grid gap-4",children:r}),null===d?null:(0,l.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-dialog-refusal",children:[(0,l.jsx)("span",{children:d.message}),d.isConflict?(0,l.jsx)(T.i,{isPending:u,pendingLabel:"Reloading…",onClick:c,"data-testid":"tools-table-reload",children:"Reload"}):null]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)("span",{className:"text-muted-foreground","data-testid":"tools-table-applies-to",children:a}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",className:P.x.secondary,disabled:o,onClick:t,children:"Cancel"}),(0,l.jsx)(T.i,{variant:"primary",isPending:o,pendingLabel:i.pending,disabled:i.isDisabled||u,onClick:i.onPress,"data-testid":"tools-table-dialog-action",children:i.label})]})]})]})]})})},"V",0,function(e,t){return e?.isConflict===!0&&t>e.version?null:e}],44047);var O=e.i(5654),I=e.i(43328),M=e.i(27538),D=e.i(77826),A=e.i(80734),E=e.i(60296),F=e.i(88941);e.s(["f",0,function(){let{toasts:e}=O.f.useToastManager();return(0,l.jsx)(I.f.Portal,{children:(0,l.jsx)(M.f.Viewport,{className:"fixed right-4 bottom-4 z-50 grid w-[min(24rem,calc(100vw-2rem))] gap-2",children:e.map(e=>(0,l.jsx)(D.f.Root,{toast:e,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-4 py-3 text-tone-ok-fg shadow-md","data-testid":"tools-table-toast",children:(0,l.jsxs)(A.f.Content,{className:"flex items-start justify-between gap-3",children:[(0,l.jsx)(E.f.Title,{}),(0,l.jsx)(F.f.Close,{"aria-label":"Dismiss",children:"×"})]})},e.id))})})}],90218)},3032,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("60655c9361674168d2c8e451d8cb06d1ece6649be8",t.callServer,void 0,t.findSourceMapURL,"signInToParty");e.s(["f",0,n])},12589,e=>{var t=e.i(43476),n=e.i(58487),s=e.i(5654),r=e.i(18566),a=e.i(71645),l=e.i(23019),i=e.i(19407),o=e.i(17779),d=e.i(35671),c=e.i(44047),u=e.i(90218);function p({fleetId:e,party:n,version:u,scopes:f,listed:m,canChange:h}){let g=(0,r.useRouter)(),x=s.f.useToastManager(),[,b]=(0,a.useTransition)(),[v,w]=(0,a.useTransition)(),[y,S]=(0,a.useState)(!1),[j,N]=(0,a.useState)([]),[R,C]=(0,a.useState)(!1),[k,$]=(0,a.useState)(null),[P,T]=(0,a.useState)(null),[O,I]=(0,a.useState)(0),[M,D]=(0,a.useState)(null),A=M?.basis===f?M.scopes:f;return(0,t.jsxs)("div",{className:`flex flex-wrap items-center gap-2 rounded-md ${O>0?"animate-highlight":""}`,"data-testid":"agent-needs",children:[(0,t.jsx)(o.f,{own:A,listed:null===m?null:new Set(m.map(({scope:e})=>e))}),h&&null!==m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-primary hover:underline",onClick:()=>{N([...A]),$(null),S(!0)},"data-testid":"agent-needs-change",children:"Change…"}),(0,t.jsx)(c.G,{isOpen:y,onClose:()=>{S(!1)},title:"Every message needs",description:`The scopes a calling ship must hold to message ${n}.`,appliesTo:`Applies to every message to ${n}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{C(!0),$(null);let t=Math.max(u,P??0);b(async()=>{let s=await (0,l.f)({fleetId:e,name:n,version:t,party:j,tools:[]});(C(!1),s.isOk)?(T(s.version),D({basis:f,scopes:j}),S(!1),I(e=>e+1),x.add({title:(0,i.I)((0,i.B)({party:n,scopes:j}),s.statementRefusal)}),g.refresh()):$({message:s.message,isConflict:s.isConflict,version:t})})}},isSaving:R,refusal:(0,c.V)(k,Math.max(u,P??0)),isReloading:v,onReload:()=>{w(()=>{g.refresh()})},testId:"agent-needs-dialog",children:(0,t.jsx)(d.f,{label:"Scopes",listed:m,picked:j,onPick:N,isDisabled:R,testId:"agent-needs-picker"})})]}):null]},O)}e.s(["AgentNeeds",0,function(e){return(0,t.jsxs)(n.f.Provider,{children:[(0,t.jsx)(p,{...e}),(0,t.jsx)(u.f,{})]})}])},54418,e=>{var t,n,s=e.i(43476),r=e.i(71645),a=e.i(8821),l=e.i(52245),i=e.i(79938);let o="--drawer-height",d="--drawer-swipe-movement-x",c="--drawer-swipe-movement-y",u="--drawer-snap-point-offset",p="--drawer-swipe-strength",f="--drawer-swipe-progress",m=r.forwardRef(function(e,t){let{render:n,className:s,style:r,forceRender:o=!1,...d}=e,c=(0,a.x)(),u=c.useState("open"),m=c.useState("nested"),h=c.useState("mounted"),g=c.useState("transitionStatus");return(0,l.a)("div",e,{state:{open:u,transitionStatus:g},ref:[c.context.backdropRef,t],stateAttributesMapping:i.M,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[f]:"0",[p]:"1"}},d],enabled:o||!m})}),h=e.i(56736).f,g="data-drawer-content",x=r.forwardRef(function(e,t){let{render:n,className:s,style:r,...i}=e;return(0,a.x)(),(0,l.a)("div",e,{ref:t,props:[{[g]:""},i]})});var b=e.i(46376),v=e.i(67865),w=e.i(56789),y=e.i(61487),S=e.i(35890),j=e.i(64938),N=e.i(80829),R=e.i(6640);S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;let C="data-swipe-dismiss",k="data-swiping";var $=e.i(25834),P=e.i(37584),T=e.i(73327),O=e.i(33332);let I=r.createContext(void 0);function M(e){let t=r.useContext(I);if(!0!==e&&void 0===t)throw Error((0,O.f)(90));return t}var D=e.i(8868),A=e.i(24429);function E(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function F(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if("number"==typeof e)return Number.isFinite(e)?e<=1?(0,A.f)(e,0,1)*t:e:null;let s=e.trim();if(s.endsWith("px")){let e=Number.parseFloat(s);return Number.isFinite(e)?e:null}if(s.endsWith("rem")){let e=Number.parseFloat(s);return Number.isFinite(e)?e*n:null}return null}function U(e,t){let n=-1,s=1/0;for(let r=0;r<e.length;r+=1){let a=Math.abs(e[r]-t);a<s&&(s=a,n=r)}return n}function z(){let e=(0,a.x)(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l}=M(),i=e.useState("viewportElement"),[o,d]=r.useState(0),[c,u]=r.useState(16),p=(0,v.f)(()=>{let e=(0,D.f)(i).documentElement;d(i?i.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});(0,b.f)(()=>{if(p(),!i||"function"!=typeof ResizeObserver)return;let e=new ResizeObserver(p);return e.observe(i),()=>{e.disconnect()}},[p,i]);let f=r.useMemo(()=>{if(!t||0===t.length||o<=0||l<=0)return[];let e=Math.min(l,o),n=t.map(t=>{let n=F(t,o,c);if(null===n)return null;let s=(0,A.f)(n,0,e);return{value:t,height:s,offset:Math.max(0,l-s)}}).filter(e=>!!e);if(n.length<=1)return n;let s=[],r=[];for(let e=n.length-1;e>=0;e-=1){let t=n[e];r.some(e=>1>=Math.abs(e-t.height))||(r.push(t.height),s.push(t))}return s.reverse(),s},[l,c,t,o]),m=r.useMemo(()=>{if(null===n)return;let e=f.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(l,o),s=F(n,o,c);if(null===s)return;let r=(0,A.f)(s,0,t);return f[U(f.map(e=>e.height),r)]},[n,l,f,c,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l,viewportHeight:o,resolvedSnapPoints:f,activeSnapPointOffset:m?.offset??null}}let H=r.createContext(null);var L=e.i(64111);let Y=!1,X={...i.M,expanded:e=>e?{"data-expanded":""}:null,nestedDrawerOpen:e=>e?{"data-nested-drawer-open":""}:null,nestedDrawerSwiping:e=>e?{"data-nested-drawer-swiping":""}:null,swipeDirection:e=>({"data-swipe-direction":e}),swiping:e=>e?{[k]:""}:null},V=r.forwardRef(function(e,t){let n,{render:i,className:m,style:h,finalFocus:g,initialFocus:x,...S}=e,j=(0,a.x)(),N=j.context.popupRef,{swipeDirection:R,frontmostHeight:C,hasNestedDrawer:k,nestedSwiping:O,nestedSwipeProgressStore:I,onPopupHeightChange:D,notifyParentFrontmostHeight:A,notifyParentHasNestedDrawer:F}=M(),U=j.useState("descriptionElementId"),V=j.useState("disablePointerDismissal"),G=j.useState("floatingRootContext"),W=j.useState("popupProps"),B=j.useState("modal"),K=j.useState("mounted"),q=j.useState("nested"),J=j.useState("nestedOpenDrawerCount"),Q=j.useState("transitionStatus"),Z=j.useState("open"),_=j.useState("openMethod"),ee=j.useState("titleElementId"),et=j.useState("role"),en=G.useState("floatingId"),es=S.id??en,er=r.useContext(H);(0,$.Z)();let{snapPoints:ea,activeSnapPoint:el,activeSnapPointOffset:ei}=z(),eo=J>0,ed=er?.swiping??!1,ec=er?.swipeStrength??null,[eu,ep]=r.useState(0),ef=r.useRef(0),em=(0,v.f)(()=>{let e=N.current;if(!e)return;let t=e.offsetHeight;if(!(ef.current>0)||!(C>ef.current)||!(t>ef.current)){if(ef.current>0&&k){let e=ef.current;ep(e),D(e);return}t!==ef.current&&(ef.current=t,ep(t),D(t))}});(0,b.f)(()=>{if(!K){ef.current=0,ep(0),D(0);return}let e=N.current;if(!e||(Y||("u">typeof CSS&&"registerProperty"in CSS&&([d,c,u].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:f,initialValue:"0"},{name:p,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),Y=!0),em(),"function"!=typeof ResizeObserver))return;let t=new ResizeObserver(em);return t.observe(e),()=>{t.disconnect()}},[em,K,eo,D,N]),(0,b.f)(()=>{let e=()=>{let e=N.current;if(!e)return;let t=I.getSnapshot();t>0?e.style.setProperty(f,`${t}`):e.style.setProperty(f,"0")};e();let t=I.subscribe(e),n=N.current;return()=>{t(),n&&n.style.setProperty(f,"0")}},[I,N]),(0,b.f)(()=>{if(Z)return A?.(C),()=>{A?.(0)}},[C,Z,A]),(0,b.f)(()=>{if(F)return F(Z||"ending"===Q),()=>{F(!1)}},[F,Z,Q]),(0,P.f)({open:Z,ref:N,onComplete(){Z&&j.context.onOpenChangeComplete?.(!0)}});let eh=void 0===x?N:x,eg=j.useStateSetter("popupElement"),ex=!k&&"ending"!==Q;eu&&!ex&&(n=`${eu}px`);let eb=ea&&ea.length>0&&("down"===R||"up"===R),ev=null;eb&&null!==ei&&(ev="up"===R?-ei:ei);let ew=er?er.getDragStyles():w.w;if(eb&&"down"===R){let e=Number.parseFloat(String(ew[c]));ew=ed&&Number.isFinite(e)?{...ew,transform:void 0,[c]:`${E(ei??0,e)}px`}:{...ew,transform:void 0}}let ey=(0,l.a)("div",e,{state:{open:Z,nested:q,transitionStatus:Q,expanded:1===el,nestedDrawerOpen:eo,nestedDrawerSwiping:O,swipeDirection:R,swiping:ed},props:[W,{id:es,"aria-labelledby":ee,"aria-describedby":U,role:et,...L.X,hidden:!K,onKeyDown(e){T.f.has(e.key)&&e.stopPropagation()},style:{...ew,[f]:"0","--nested-drawers":J,[o]:n,[u]:"number"==typeof ev?`${ev}px`:"0px","--drawer-frontmost-height":C?`${C}px`:void 0,[p]:"number"==typeof ec&&Number.isFinite(ec)&&ec>0?`${ec}`:"1"}},S],ref:[t,N,eg],stateAttributesMapping:X});return(0,s.jsx)(y.f,{context:G,openInteractionType:_,disabled:!K,closeOnFocusOut:!V,initialFocus:eh,returnFocus:g,modal:!1!==B,restoreFocus:"popup",children:ey})}),G=e.i(64951).f;var W=e.i(74735),B=e.i(51437),K=e.i(33848),q=e.i(22162),J=e.i(75606),Q=e.i(80025),Z=e.i(16856),Z=Z,_=e.i(66250);let ee=r.createContext(void 0);function et(){return r.useContext(ee)}function en(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let s=Number.isFinite(n)?n:0;s!==e&&(e=s,t.forEach(e=>{e()}))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}function es(){let e=et(),t=(0,a.x)(!1),n=e?.setDrawerOpen,s=e?.removeDrawer,l=t.useState("open"),i=t.useState("nestedOpenDialogCount"),o=t.useState("popupElement"),d=0===i;return(0,b.f)(()=>{if(s)return()=>{s(t)}},[s,t]),(0,b.f)(()=>{n?.(t,l)},[l,n,t]),r.useEffect(()=>{if(!l||!d||!q.f.os.android)return;let e=(0,K.f)(o).CloseWatcher;if(!e)return;let n=new e,s=(0,W.f)(n,"cancel",function(e){if(!t.select("open"))return;let n=(0,J.j)(Z.closeWatcher,e);e.cancelable||(n.cancel=w.x),t.setOpen(!1,n),n.isCanceled&&e.preventDefault()});return()=>{s(),n.destroy()}},[t,d,l,o]),null}let er=e.i(77173).f,ea=e.i(13488).f;var el=e.i(74080),ei=e.i(29315),eo=e.i(8445),ed=e.i(10199);let ec=r.forwardRef(function(e,t){let{render:n,className:s,style:r,children:i,...o}=e,d=(0,$.Z)(),c=(0,a.x)(),u=c.useState("open"),p=c.useState("nested"),f=c.useState("transitionStatus"),m=c.useState("nestedOpenDialogCount"),h=c.useState("mounted"),g=c.useStateSetter("viewportElement");return(0,l.a)("div",e,{enabled:d||h,state:{open:u,nested:p,transitionStatus:f,nestedDialogOpen:m>0},ref:[t,g],stateAttributesMapping:ed.f,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none"},children:i},o]})});S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;var eu=e.i(76782),ep=e.i(8760),ef=Z,em=e.i(84446),eh=e.i(24166),eg=e.i(96545),ex=e.i(38396),eb=e.i(2410);let ev=r.createContext(void 0),ew=`[${g}]`,ey={horizontal:`[${ex.a}="x"]`,vertical:`[${ex.a}="y"]`},eS=r.forwardRef(function(e,t){let{render:n,className:l,style:i,children:u,...p}=e,m=(0,a.x)(),h=m.context.popupRef,g=m.context.backdropRef,{swipeDirection:x,notifyParentSwipingChange:w,notifyParentSwipeProgressChange:y,frontmostHeight:S,snapToSequentialPoints:j,swipeAreaActiveRef:N}=M(),R=et(),{snapPoints:k,resolvedSnapPoints:$,activeSnapPoint:P,activeSnapPointOffset:T,setActiveSnapPoint:O,popupHeight:I}=z(),F=m.useState("open"),L=m.useState("mounted"),Y=m.useState("nested"),X=m.useState("nestedOpenDrawerCount"),V=m.useState("viewportElement"),G=m.useState("popupElement"),B=R?.visualStateStore,q=X>0,Q="left"===x||"right"===x?"horizontal":"vertical",Z="vertical"===Q,_=Z?"horizontal":"vertical",[ee,en]=r.useState(null),es=r.useRef(void 0),er=r.useRef(null),ea=(0,eo.z)(),ed=r.useRef(!1),eS=r.useRef(!1),eT=r.useRef(""),eO=r.useRef(!1),eI=r.useRef(!1),eM=r.useRef(null),eD=r.useContext(ev),eA=r.useMemo(()=>{if(!k||k.length<2||$.length<2||"down"!==x&&"up"!==x)return null;let e=$.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[$,k,x]),eE=r.useMemo(()=>eA&&null!==T?(0,A.f)((T-eA.minOffset)/eA.range,0,1):null,[T,eA]),eF=r.useMemo(()=>k&&k.length>0&&("down"===x||"up"===x)?"down"===x?["down","up"]:["up","down"]:[x],[k,x]),eU=(0,v.f)(e=>{h.current?.toggleAttribute(C,e),g.current?.toggleAttribute(C,e)}),ez=(0,v.f)(()=>{eU(!1),h.current?.removeAttribute(eh.f.endingStyle),en(null)}),eH=(0,v.f)(()=>{eS.current&&(eS.current=!1,w?.(!1))}),eL=(0,v.f)((e,t,n)=>{let s=F&&!Y&&t,r=s?e:0,a=F&&t?e:0;n&&y&&(y(a),a<=0&&eH()),B?.set({swipeProgress:r,frontmostHeight:r>0?S:0});let l=g.current;if(!l)return;let i=s&&r>0;l.style.setProperty(f,i?`${r}`:"0"),i&&S>0?l.style.setProperty(o,`${S}px`):l.style.removeProperty(o)}),eY=(0,ep.w)({enabled:L&&!q,directions:eF,elementRef:m.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:d,y:c},onSwipeStart(e){if("touches"in e||"touch"===e.pointerType)return;let t=h.current,n=(0,D.f)(t),s=n.getSelection?.();if(!s||s.isCollapsed)return;let r=(0,ei.m)(s.anchorNode)?s.anchorNode:s.anchorNode?.parentElement,a=(0,ei.m)(s.focusNode)?s.focusNode:s.focusNode?.parentElement;((0,em.I)(t,r)||(0,em.I)(t,a))&&s.removeAllRanges()},onSwipingChange(e){ed.current=e,ej(m.context.backdropRef.current,e),e||y||eH()},swipeThreshold:({element:e,direction:t})=>eR(e,t),canStart(e,t){let n=m.context.popupRef.current;if(!n)return!1;let s=t.nativeEvent,r="touches"in s||"touch"===s.pointerType,a=r?eM.current:null,l=n.ownerDocument,i=(0,eb.f)(n.getRootNode(),e.x,e.y);return!(!a?.startedInPopup&&!(0,em.I)(n,i)||r&&eC(l,n)||a?.hasCrossAxisGestureTarget&&!a.drawerAxisAttributed&&!0!==a.allowSwipe)},onProgress(e,t){let n=ed.current;n&&function(e){if(eS.current||!e)return;let t=e.direction??x;10>Math.abs((0,ep.R)(t,e.deltaX,e.deltaY))||(eS.current=!0,w?.(!0))}(t);let s=!!(k&&k.length>0);if(n&&"down"===x&&s&&t){let e=m.context.popupRef.current;e&&(e.style.removeProperty("transform"),e.style.setProperty(c,`${E(T??0,t.deltaY)}px`))}let r=e;if(eA&&I>0){let e=T??eA.minOffset;if(n&&t&&Number.isFinite(t.deltaY)){let n;n=(0,A.f)(e+t.deltaY,0,I),r=(0,A.f)((n-eA.minOffset)/eA.range,0,1)}else null!==eE&&(r=eE)}n||(y?.(0),eH()),eL(r,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:s,velocityX:r,velocityY:a,releaseVelocityX:l,releaseVelocityY:i}){let o=m.context.popupRef.current;if(!o)return void ez();function d(e){eH(),eU(!0),o.style.removeProperty("transition"),o.setAttribute(eh.f.endingStyle,""),el.flushSync(()=>{en(function(e,t,n,s,r,a,l,i){let o=eN(e,t);if(o<=0)return null;let d=Math.max(0,o-((("down"===t||"up"===t)&&k&&k.length>0?T??0:0)+(0,ep.R)(t,n,s)));if(d<=0)return null;let c=(0,ep.R)(t,l,i),u=Math.abs(c)>0?c:(0,ep.R)(t,r,a);if(u<=.2)return null;let p=(0,A.f)(u,.2,4);return .1+((0,A.f)(d/p,80,360)-80)/280*.9}(o,e,t,n,r,a,l,i))})}if(!k||0===k.length){if(!s)return void ez();let e=(0,ep.R)(s,t,n);if(e<=0)return ez(),!1;if((0,ep.R)(s,r,a)>=.5)return d(s),!0;let l=e>eR(o,s);return l?d(s):ez(),l}if("down"!==x&&"up"!==x)return void ez();if(!I)return ez(),!1;if(0===$.length)return void ez();let c="down"===x?n:-n,u=Math.sign(c),p="down"===x?i:-i,f="down"===x?a:-a,h=p;if(0!==u&&Math.abs(c)>=10){let e=Math.sign(h);0!==e&&e!==u&&(h=f)}let g=T??0,b=(0,A.f)(g+c,0,I),v=Math.abs(h)>=.5?300*(0,A.f)(h,-4,4):0,w=j?b:(0,A.f)(b+v,0,I),y=(0,J.j)(ef.swipe,e),S=()=>(eL(0,!0,!0),ez(),!1),N=e=>(O(e.value,y),S()),R=e=>s?(O(null,y),y.isCanceled)?S():(es.current=P,d(x),!0):N(e);if(j){let e=[...$].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=U(t,g),s=e[U(t,w)],r=Math.sign(h),a=w;if(0!==u&&0!==r&&r===u&&Math.abs(h)>=.5){let t=(0,A.f)(n+u,0,e.length-1);if(t!==n){let n=e[t];(u>0?w<n.offset:w>n.offset)&&(s=n,a=n.offset)}else if(u>0)return R(s)}return Math.abs(a-I)<Math.abs(a-s.offset)?R(s):N(s)}let C=$[U($.map(e=>e.offset),w)];return h>=.5&&c>0||Math.abs(w-I)<Math.abs(w-C.offset)?R(C):N(C)},onDismiss(e){B?.set({swipeProgress:0,frontmostHeight:0});let t=m.context.backdropRef.current;t&&(t.style.setProperty(f,"0"),t.style.removeProperty(o));let n=(0,J.j)(ef.swipe,e);if(m.setOpen(!1,n),n.isCanceled){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,er.current?.(),ez();return}m.select("open")?ea.request(()=>{if(m.select("open")){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,ez(),er.current?.()}else es.current=void 0}):(es.current=void 0,eU(!0))}}),eX=eY.getPointerProps(),eV=eY.getTouchProps(),{moveNative:eG,reset:eW}=eY;er.current=eW,r.useEffect(()=>{let e=V??G;if(!e||!F||!L)return;let t=(0,D.f)(e);return(0,W.f)(t,"touchmove",function(n){var s,r;if(eD?.onTouchMove(n),eI.current)return;let a=eM.current,l=n.touches[0];l&&a&&(!function(n,s,r){let a=Z?r.clientY-s.lastY:r.clientX-s.lastX;if(2===n.touches.length||eC(t,e)||q||function(e,t,n,s){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||!0===e.allowSwipe||!e.hasCrossAxisGestureTarget)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let r=s?n.clientY-e.startY:n.clientX-e.startX,a=s?n.clientX-e.startX:n.clientY-e.startY,l=Math.abs(r),i=Math.abs(a);return i>=6&&i>l+2?(e.preserveNativeCrossAxisScroll=!0,!0):!(l>=6)||(e.drawerAxisAttributed=!0,!1)}(s,n,r,Z))return;let l=s.scrollTarget;if(!l||l===t.documentElement||l===t.body){n.cancelable&&n.preventDefault(),n.stopPropagation(),eG(n,e);return}if(!(ek(l,Q).max>0)){n.cancelable&&n.preventDefault(),n.stopPropagation();return}if(0!==a){var i,o,d,c;let e=(i=l,o=Q,d=x,c=a,!!(eP(d,o)?c>0:c<0)&&e$(i,o,d));s.allowSwipe?n.cancelable&&n.preventDefault():n.cancelable&&e?(s.allowSwipe=!0,n.preventDefault()):s.allowSwipe=!1}!0===s.allowSwipe&&(n.stopPropagation(),eG(n,e))}(n,a,l),(s=a).lastX=(r=l).clientX,s.lastY=r.clientY)},{passive:!1,capture:!0})},[L,q,F,G,Z,Q,x,eG,V,eD]),(0,b.f)(()=>{eA&&!eY.swiping&&eL(!F||Y?0:eE??0,!0,!1)},[eL,S,Y,y,F,eE,eA,eY.swiping,m,B]),(0,b.f)(()=>{if(y)return F||y(0),()=>{y(0)}},[y,F]),(0,b.f)(()=>{F&&(N.current||eW(),ez())},[ez,F,eW,N]),(0,b.f)(()=>{let e=g.current;return()=>{B?.set({swipeProgress:0,frontmostHeight:0}),ej(e,!1);let t=g.current;t!==e&&ej(t,!1),eH()}},[g,eH,B]);let eB=r.useMemo(()=>({swiping:eY.swiping,getDragStyles:eY.getDragStyles,swipeStrength:ee??null,setSwipeDismissed:eU}),[eU,eY.getDragStyles,eY.swiping,ee]);function eK(e){eI.current=e,eM.current=null}function eq(){eK(!1),eT.current="",eO.current=!1}function eJ(e){return eT.current="","touch"!==e.pointerType}return(0,s.jsx)(ec,{ref:t,className:l,style:i,render:n,...(0,eu.w)(p,{onPointerDown(e){var t,n;if(eT.current=e.pointerType,eO.current="pen"===e.pointerType,!F||!L||q)return;let s=(0,eb.f)(e.currentTarget.getRootNode(),e.clientX,e.clientY);t=s,(0,em.h)(t,ex.u)||(n=s,(0,em.h)(n,ew))||"touch"!==e.pointerType&&eX.onPointerDown?.(e)},onPointerMove(e){"touch"!==e.pointerType&&eX.onPointerMove?.(e)},onPointerUp(e){eJ(e)&&eX.onPointerUp?.(e)},onPointerCancel(e){eJ(e)&&eX.onPointerCancel?.(e)},onTouchStart(e){var t,n,s;if("pen"===eT.current&&eO.current){eO.current=!1,eK(!1);return}if(!F||!L||q)return void eK(!1);let r=e.touches[0];if(!r)return;if(n=(t=e).nativeEvent,s=(0,K.f)(t.currentTarget),n.composedPath().some(e=>e instanceof s.HTMLInputElement&&"range"===e.type))return void eK(!1);let a=e.currentTarget,l=(0,eb.f)(a.getRootNode(),r.clientX,r.clientY),i=(0,em.Z)(e.nativeEvent),o=(0,ei.m)(i)?i:a;if(!(0,em.I)(a,o)||(eD?.onTouchStart(e),(0,em.h)(l,`${ex.u}:not(${ey[_]})`)))return void eK(!0);eI.current=!1;let d=(0,eg.U)(o,a,Q),c=null!=(0,eg.U)(o,a,_)||null!=(0,em.h)(l,ey[_]),u=null;d&&(u=!!e$(d,Q,x)&&null),eM.current={startX:r.clientX,startY:r.clientY,lastX:r.clientX,lastY:r.clientY,startedInPopup:(0,em.I)(h.current,l),scrollTarget:d,hasCrossAxisGestureTarget:c,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},eV.onTouchStart?.(e)},onTouchEnd(e){eD?.onTouchEnd(e),eq(),eV.onTouchEnd?.(e)},onTouchCancel(e){eD?.onTouchCancel(),eq(),eV.onTouchCancel?.(e)},"data-nested-dialog-open":void 0}),children:(0,s.jsx)(H.Provider,{value:eB,children:u})})});function ej(e,t){e?.toggleAttribute(k,t)}function eN(e,t){return"left"===t||"right"===t?e.offsetWidth:e.offsetHeight}function eR(e,t){return Math.max(.5*eN(e,t),10)}function eC(e,t){let n,s,r=(0,em.T)(e);if(r&&(0,em.I)(t,r)&&("INPUT"===r.tagName||"TEXTAREA"===r.tagName)){let{selectionStart:e,selectionEnd:t}=r;if(null!=e&&null!=t&&e<t)return!0}let a=e.getSelection?.();return!!a&&!a.isCollapsed&&(n=(0,ei.m)(a.anchorNode)?a.anchorNode:a.anchorNode?.parentElement,s=(0,ei.m)(a.focusNode)?a.focusNode:a.focusNode?.parentElement,a.containsNode(t,!0)||(0,em.I)(t,n)||(0,em.I)(t,s))}function ek(e,t){if("vertical"===t){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function e$(e,t,n){let s=eP(n,t),{offset:r,max:a}=ek(e,t);return s?r<=0:r>=a}function eP(e,t){return"vertical"===t?"down"===e:"right"===e}e.s(["Backdrop",0,m,"Close",0,h,"Content",0,x,"Popup",0,V,"Portal",0,G,"Root",0,function(e){let{children:a,open:l,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:d,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h=null,swipeDirection:g="down",snapToSequentialPoints:x=!1,snapPoints:b,snapPoint:w,defaultSnapPoint:y,onSnapPointChange:S}=e,j=M(!0),N=j?.onNestedSwipeProgressChange,R=j?.onNestedFrontmostHeightChange,C=j?.onNestedSwipingChange,k=j?.onNestedDrawerPresenceChange,[$,P]=r.useState(0),[T,O]=r.useState(0),[D,A]=r.useState(!1),[E,F]=r.useState(!1),[U]=r.useState(en),z=void 0!==y?y:b?.[0]??null,H=void 0!==w,[L,Y]=(0,B.f)({controlled:w,default:z,name:"Drawer",state:"snapPoint"}),X=r.useRef(!1),V=r.useRef(!1),G=(0,v.f)((e,t)=>{let n=t??(0,J.j)(Q.f.none);S?.(e,n),n.isCanceled||Y(e)}),W=r.useMemo(()=>H||!b||0===b.length||null!==L&&b.some(e=>Object.is(e,L))?L:z,[L,H,z,b]),K=(0,v.f)(e=>{P(e),!X.current&&e>0&&O(e)}),q=(0,v.f)(e=>{if(e>0){X.current=!0,O(e);return}X.current=!1,$>0&&O($)}),Z=(0,v.f)(e=>{A(e)}),ee=(0,v.f)(e=>{U.set(e),N?.(e)}),et=(0,v.f)(e=>{F(e),C?.(e)}),er=(0,v.f)((e,t)=>{o?.(e,t),!t.isCanceled&&!e&&b&&b.length>0&&G(z,(0,J.j)(t.reason,t.event,t.trigger))}),ea=r.useMemo(()=>({swipeDirection:g,swipeAreaActiveRef:V,snapToSequentialPoints:x,snapPoints:b,activeSnapPoint:W,setActiveSnapPoint:G,frontmostHeight:T,popupHeight:$,hasNestedDrawer:D,nestedSwiping:E,nestedSwipeProgressStore:U,onNestedDrawerPresenceChange:Z,onPopupHeightChange:K,onNestedFrontmostHeightChange:q,onNestedSwipingChange:et,onNestedSwipeProgressChange:ee,notifyParentFrontmostHeight:R,notifyParentSwipingChange:C,notifyParentSwipeProgressChange:N,notifyParentHasNestedDrawer:k}),[W,T,D,E,U,k,N,C,R,Z,q,ee,et,K,$,G,b,x,V,g]),el="function"==typeof a?e=>(0,s.jsxs)(r.Fragment,{children:[t||(t=(0,s.jsx)(es,{})),a(e)]}):(0,s.jsxs)(r.Fragment,{children:[n||(n=(0,s.jsx)(es,{})),a]}),ei=(0,_.f)("drawer",{open:l,defaultOpen:i,onOpenChange:er,onOpenChangeComplete:d,disablePointerDismissal:c,modal:u,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h,children:el});return(0,s.jsx)(I.Provider,{value:ea,children:ei})},"Title",0,er,"Trigger",0,ea,"Viewport",0,eS],58954);var eT=e.i(58954),eT=eT,eO=eT,eI=eT,eM=eT,eD=eT,eA=eT,eE=eT,eF=eT,eU=eT,ez=e.i(58487),eH=e.i(5654),eL=e.i(18566),eY=e.i(30402),eX=e.i(25621),eV=e.i(55070),eG=e.i(97e3),eW=e.i(23019),eB=e.i(95187);let eK=(0,eB.createServerReference)("409d54d6f9f4c413c2f1447f907698cb0e0c1ebc65",eB.callServer,void 0,eB.findSourceMapURL,"switchPartyTools"),eq=[{how:"add",label:"Add to each"},{how:"remove",label:"Remove from each"},{how:"replace",label:"Replace with these"}];var eJ=e.i(19407);let eQ=[{state:"all",label:"All"},{state:"on",label:"On"},{state:"off",label:"Off"},{state:"new",label:"New"},{state:"needsNothing",label:"Needs nothing"}];var eZ=e.i(17779),e_=e.i(35671),e0=e.i(44047),e1=e.i(90218);function e2(e){return e?.split("\n").find(e=>""!==e.trim())?.trim()??""}function e4({fleetId:e,party:t,tools:n,version:a,partyScopes:l,listed:i,canChange:o,serverRefusal:d}){var c;let u,p,f=(0,eL.useRouter)(),m=eH.f.useToastManager(),[,h]=(0,r.useTransition)(),[g,x]=(0,r.useTransition)(),[b,v]=(0,r.useState)(""),[w,y]=(0,r.useState)("all"),[S,j]=(0,r.useState)(new Set),[N,R]=(0,r.useState)(null),[C,k]=(0,r.useState)([]),[$,P]=(0,r.useState)("add"),[T,O]=(0,r.useState)({readOnly:[],other:[]}),[I,M]=(0,r.useState)(!1),[D,A]=(0,r.useState)(null),[E,F]=(0,r.useState)(null),[U,z]=(0,r.useState)(null),[H,L]=(0,r.useState)({names:new Set,round:0}),[Y,X]=(0,r.useState)(null),[V,G]=(0,r.useState)(!1),[W,B]=(0,r.useState)(null),K=W?.basis===n?W:null,q=null===K?n:n.map(e=>({...e,scopes:K.scopes.get(e.name)??e.scopes,isOn:null===e.isOn?null:K.switches.get(e.name)??e.isOn})),J=K?.party??l,Q=Math.max(a,Y??0),Z=null===i?null:new Set(i.map(({scope:e})=>e)),_=(u=(c={name:b,state:w,partyScopes:J}).name.trim().toLowerCase(),q.filter(e=>e.name.toLowerCase().includes(u)&&function(e,{state:t,partyScopes:n}){switch(t){case"all":return!0;case"on":return!0===e.isOn;case"off":return!1===e.isOn;case"new":return e.isNew;case"needsNothing":return 0===n.length&&0===e.scopes.length}}(e,c))),ee=q.filter(({name:e})=>S.has(e)),et=null===d,en=_.length>0&&_.every(({name:e})=>S.has(e)),es=function(e){let t={readOnly:[],other:[],withoutHints:[]};for(let n of e.filter(({scopes:e})=>0===e.length))!0===n.isDestructive||!1===n.isReadOnly?t.other.push(n.name):!0===n.isReadOnly?t.readOnly.push(n.name):t.withoutHints.push(n.name);return t}(q),er=[...(p=(e,t)=>0===t.length?[]:e.map(e=>({tool:e,scopes:[...t]})))(es.readOnly,T.readOnly),...p(es.other,T.other)],ea=({outcome:e,changed:t,message:s,change:r})=>{B({basis:n,party:r.party??K?.party??null,scopes:new Map([...K?.scopes??[],...(r.scopes??[]).map(({tool:e,scopes:t})=>[e,t])]),switches:new Map([...K?.switches??[],...r.switches??[]])}),null!==e.version&&X(e.version),L(e=>({names:new Set(t),round:e.round+1})),m.add({title:(0,eJ.I)(s,e.statementRefusal)}),f.refresh()},el=e=>{A(null),G(!1),k("party"===e?[...J]:[]),P("add"),O({readOnly:[],other:[]}),R(e)},ei=()=>{R(null),A(null)},eo=({change:n,changed:s,message:r})=>{M(!0),A(null),h(async()=>{let a=await (0,eW.f)({fleetId:e,name:t,version:Q,...n});(M(!1),a.isOk)?(R(null),j(new Set),ea({outcome:a,changed:s,message:r,change:{...void 0===n.party?{}:{party:n.party},scopes:n.tools}})):A({message:a.message,isConflict:a.isConflict,version:Q})})},ed=({names:n,isOn:s,working:r})=>{F(r),z(null),G(!1),h(async()=>{let r=await eK({fleetId:e,name:t,tools:[...n],isOn:s});if(F(null),!r.isOk)return void z(r.message);let[a]=n;ea({outcome:r,changed:n,change:{switches:new Map(n.map(e=>[e,s]))},message:1===n.length&&void 0!==a?function({tool:e,isOn:t,statementRefusal:n}){let s=`${e} is ${t?"on":"off"}`;return null!==n?`${s}; the fleet sees it at the proxy ship's next statement: ${n}`:t?`${s}: the fleet may call it.`:`${s}: the fleet sees it no more, and a call to it is refused.`}({tool:a,isOn:s,statementRefusal:null}):(0,eJ.g)({count:n.length,isOn:s,statementRefusal:null})})})},ec=()=>{x(()=>{f.refresh()})},eu=null!==E||I,ep=(0,s.jsxs)("div",{className:"grid gap-3 sm:flex sm:flex-wrap sm:items-center","data-testid":"tools-table-toolbar",children:[(0,s.jsxs)("label",{className:"grid gap-1 sm:w-56",children:[(0,s.jsx)("span",{className:"sr-only",children:"Filter by name"}),(0,s.jsx)("input",{className:eY.w,type:"search",placeholder:"Filter by name",value:b,onChange:e=>{v(e.target.value)},"data-testid":"tools-table-name-filter"})]}),(0,s.jsx)("div",{role:"group","aria-label":"Filter by state",className:"flex flex-wrap gap-1",children:eQ.map(({state:e,label:t})=>(0,s.jsx)("button",{type:"button","aria-pressed":w===e,onClick:()=>{y(e)},className:`h-8 rounded-md border px-3 ${w===e?"border-primary bg-primary text-primary-foreground":"border-border bg-card hover:bg-accent"}`,"data-testid":`tools-table-state-${e}`,children:t},e))}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:en,onChange:()=>{j(e=>{let t=new Set(e);for(let{name:e}of _)en?t.delete(e):t.add(e);return t})},disabled:0===_.length,"data-testid":"tools-table-select-shown"}),"Select all shown"]}),(0,s.jsxs)("span",{className:"text-muted-foreground","data-testid":"tools-table-selected",children:[S.size," selected"]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:0===S.size||eu||null===i,onClick:()=>{el("scopes")},"data-testid":"tools-table-set-scopes",children:"Set scopes…"}),(0,s.jsx)(eV.i,{isPending:"on"===E,pendingLabel:"Switching on…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!0,working:"on"})},"data-testid":"tools-table-switch-on",children:"Switch on"}),(0,s.jsx)(eV.i,{isPending:"off"===E,pendingLabel:"Switching off…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!1,working:"off"})},"data-testid":"tools-table-switch-off",children:"Switch off"}),(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:eu||!et||null===i,onClick:()=>{el("suggest")},"data-testid":"tools-table-suggest",children:"Suggest from hints…"})]})]}):null]});return(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"tools-table-party-needs",children:[(0,s.jsx)("span",{className:"font-medium",children:"Every tool needs"}),(0,s.jsx)(eZ.f,{party:J,own:[],listed:Z}),o?(0,s.jsx)("button",{type:"button",className:"text-primary hover:underline disabled:opacity-60",disabled:eu||null===i,onClick:()=>{el("party")},"data-testid":"tools-table-party-change",children:"Change…"}):null]}),null===d?null:(0,s.jsxs)("p",{role:"status",className:"rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-tone-waiting-fg","data-testid":"tools-table-server-down",children:["The server did not answer, so this shows the scopes kept per tool name; they can still be changed. ",d]}),(0,s.jsx)("div",{className:"hidden sm:block",children:ep}),(0,s.jsx)("div",{className:"sm:hidden",children:(0,s.jsxs)(eT.Root,{open:V,onOpenChange:G,children:[(0,s.jsxs)(eO.Trigger,{className:eY.x.secondary,"data-testid":"tools-table-sheet-open",children:["Filters and actions",o?` (${String(S.size)} selected)`:""]}),(0,s.jsxs)(eI.Portal,{children:[(0,s.jsx)(eM.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,s.jsx)(eD.Viewport,{className:"fixed inset-0 z-50 flex items-end",children:(0,s.jsx)(eA.Popup,{className:"w-full rounded-t-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:(0,s.jsxs)(eE.Content,{className:"grid gap-3",children:[(0,s.jsx)(eF.Title,{className:"text-heading font-semibold",children:"Filters and actions"}),ep,(0,s.jsx)(eU.Close,{className:eY.x.secondary,children:"Done"})]})})})]})]})}),null===U?null:(0,s.jsx)("p",{role:"alert",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-switch-refusal",children:U}),(0,s.jsxs)("table",{className:"w-full border-collapse max-sm:block","data-testid":"tools-table",children:[(0,s.jsx)("thead",{className:"max-sm:hidden",children:(0,s.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[o?(0,s.jsx)("th",{className:"w-8 py-2",children:(0,s.jsx)("span",{className:"sr-only",children:"Selected"})}):null,(0,s.jsx)("th",{className:"py-2 font-medium",children:"Tool"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Hints"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"On"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Needs"})]})}),(0,s.jsx)("tbody",{className:"max-sm:grid max-sm:gap-2",children:_.map(e=>{let t=H.names.has(e.name);return(0,s.jsxs)("tr",{className:`border-b border-border align-top last:border-b-0 max-sm:grid max-sm:grid-cols-[auto_1fr] max-sm:gap-x-2 max-sm:rounded-md max-sm:border max-sm:p-2 ${t?"animate-highlight":""}`,"data-testid":"tools-table-row","data-tool":e.name,children:[o?(0,s.jsx)("td",{className:"py-2 pr-2 max-sm:row-span-4",children:(0,s.jsx)("input",{type:"checkbox","aria-label":`Select ${e.name}`,checked:S.has(e.name),onChange:()=>{var t;t=e.name,j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},"data-testid":"tools-table-select"})}):null,(0,s.jsxs)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:[(0,s.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono",children:e.name}),e.isNew?(0,s.jsx)(eG.T,{tone:"attention",label:"New"}):null]}),""===e2(e.description)?null:(0,s.jsx)("span",{className:"block text-muted-foreground",children:e2(e.description)})]}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:(0,s.jsxs)("span",{className:"flex flex-wrap gap-1",children:[!0===e.isReadOnly?(0,s.jsx)(eG.E,{children:"Read only"}):null,!0===e.isDestructive?(0,s.jsx)(eG.E,{children:"Destructive"}):null]})}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:null===e.isOn?(0,s.jsx)("span",{className:"text-muted-foreground",children:"Not known"}):o?(0,s.jsx)(eX.f,{isOn:e.isOn,label:e.name,isPending:E===e.name,onClick:()=>{ed({names:[e.name],isOn:!0!==e.isOn,working:e.name})},testId:"tools-table-switch"}):(0,s.jsx)(eG.E,{children:e.isOn?"On":"Off"})}),(0,s.jsx)("td",{className:"py-2 max-sm:col-start-2",children:(0,s.jsx)(eZ.f,{party:J,own:e.scopes,listed:Z})})]},t?`${e.name}-${String(H.round)}`:e.name)})})]}),0===_.length?(0,s.jsx)("p",{className:"text-muted-foreground","data-testid":"tools-table-empty",children:0===q.length?et?`${t} lists no tools.`:"No tool needs a scope of its own yet.":"No tool matches the filters."}):null,null===i?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e0.G,{isOpen:"scopes"===N,onClose:ei,title:"Set scopes",description:"The scopes a calling ship must hold for each selected tool, beside what every tool needs.",appliesTo:`Applies to ${String(ee.length)} ${1===ee.length?"tool":"tools"}`,action:{label:"Set scopes",pending:"Setting…",isDisabled:0===C.length&&"replace"!==$,onPress:()=>{var e;eo({change:{tools:(e={scopes:C,how:$},ee.map(({name:t,scopes:n})=>{switch(e.how){case"add":return{tool:t,scopes:[...new Set([...n,...e.scopes])]};case"remove":return{tool:t,scopes:n.filter(t=>!e.scopes.includes(t))};case"replace":return{tool:t,scopes:[...new Set(e.scopes)]}}}))},changed:ee.map(({name:e})=>e),message:(0,eJ.y)({scopes:C,how:$,count:ee.length})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-scopes-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-scopes-picker"}),(0,s.jsxs)("fieldset",{className:"grid gap-1",children:[(0,s.jsx)("legend",{className:"font-medium",children:"On each selected tool"}),eq.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"how",value:e.how,checked:$===e.how,onChange:()=>{P(e.how)},"data-testid":`tools-table-how-${e.how}`}),e.label]},e.how))]})]}),(0,s.jsx)(e0.G,{isOpen:"party"===N,onClose:ei,title:"Every tool needs",description:`The scopes a calling ship must hold for every tool of ${t}, beside each tool's own.`,appliesTo:`Applies to every tool of ${t}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{eo({change:{party:C,tools:[]},changed:q.map(({name:e})=>e),message:(0,eJ.G)({party:t,scopes:C})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-party-dialog",children:(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-party-picker"})}),(0,s.jsxs)(e0.G,{isOpen:"suggest"===N,onClose:ei,title:"Suggest from hints",description:"Scopes for each tool with no scope of its own, by what the server says of it. Hints are the server's claim: nothing applies until you confirm.",appliesTo:`Applies to ${String(er.length)} ${1===er.length?"tool":"tools"}`,action:{label:"Apply",pending:"Applying…",isDisabled:0===er.length,onPress:()=>{let e=[{scopes:T.readOnly,count:0===T.readOnly.length?0:es.readOnly.length},{scopes:T.other,count:0===T.other.length?0:es.other.length}].filter(({count:e})=>e>0);eo({change:{tools:er},changed:er.map(({tool:e})=>e),message:(0,eJ.q)(e)})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-suggest-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes for read-only tools",listed:i,picked:T.readOnly,onPick:e=>{O(t=>({...t,readOnly:e}))},isDisabled:I,testId:"tools-table-suggest-read-only"}),(0,s.jsx)(e_.f,{label:"Scopes for the other tools",listed:i,picked:T.other,onPick:e=>{O(t=>({...t,other:e}))},isDisabled:I,testId:"tools-table-suggest-other"}),(0,s.jsx)(e7,{title:"Read-only tools",names:es.readOnly,testId:"tools-table-suggest-read-only-tools"}),(0,s.jsx)(e7,{title:"Other tools",names:es.other,testId:"tools-table-suggest-other-tools"}),(0,s.jsx)(e7,{title:"Without hints, left as they are",names:es.withoutHints,testId:"tools-table-suggest-without-hints"})]})]})]})}function e7({title:e,names:t,testId:n}){return(0,s.jsxs)("details",{className:"rounded-md border border-border px-3 py-2","data-testid":n,children:[(0,s.jsxs)("summary",{className:"cursor-pointer",children:[e," (",t.length,")"]}),0===t.length?(0,s.jsx)("p",{className:"text-muted-foreground",children:"None"}):(0,s.jsx)("p",{className:"font-mono text-code break-words",children:t.join(", ")})]})}e.s(["ToolsTable",0,function(e){return(0,s.jsxs)(ez.f.Provider,{children:[(0,s.jsx)(e4,{...e}),(0,s.jsx)(e1.f,{})]})}],54418)},15327,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(95187);let a=(0,r.createServerReference)("40ff915cb4a3fa62ec0afa2d7966cb1f99230b68c8",r.callServer,void 0,r.findSourceMapURL,"readMoreSignIns"),l=(0,r.createServerReference)("40950775a7f51b1c70b9dbbae1145deeab986abb75",r.callServer,void 0,r.findSourceMapURL,"removePersonSignIn");function i(e,t){let n=new Set(e.map(({personShipId:e})=>e));return[...e,...t.filter(({personShipId:e})=>!n.has(e))]}var o=e.i(30402),d=e.i(94984),c=e.i(97e3);let u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p=e=>String(e).padStart(2,"0"),f={signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}};function m(e){return e.personName??e.personShipId}function h({count:e}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Everyone's sign-ins"}),null===e?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:e})]})}function g(){return(0,t.jsx)("thead",{className:"max-sm:hidden",children:(0,t.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Person"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Account"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"State"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Last used"}),(0,t.jsx)("th",{className:"h-10 px-2",children:(0,t.jsx)("span",{className:"sr-only",children:"Remove"})})]})})}function x({signIn:e,party:n,isRemoving:s,onConfirm:r,onKeep:a}){let l=m(e);return(0,t.jsxs)("div",{className:"grid gap-2 rounded-md bg-muted p-3","data-testid":"outside-party-sign-ins-confirm",children:[(0,t.jsxs)("p",{children:["Remove ",l,"'s sign-in? Their ships' calls to ",n," are refused until they sign in again."]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:o.x.destructive,disabled:s,"aria-busy":s,onClick:r,"data-testid":"outside-party-sign-ins-remove-confirmed",children:s?"Removing…":`Remove ${l}'s sign-in`}),(0,t.jsx)("button",{type:"button",className:o.x.secondary,onClick:a,children:"Keep"})]})]})}function b(e){let{party:n,now:s,rows:r,refusal:a,hasMore:l,isLoadingMore:i,confirming:b,removing:v,outcome:w}=e;return(0,t.jsxs)("section",{className:`${o.r} grid gap-3`,"data-testid":"outside-party-sign-ins",children:[(0,t.jsx)(h,{count:null===a?r.length:null}),(0,t.jsx)(d.f,{state:w}),null!==a?(0,t.jsx)(d.f,{state:{kind:"refused",message:a}}):0===r.length?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Nobody has signed in yet."}):(0,t.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,t.jsx)(g,{}),(0,t.jsx)("tbody",{className:"max-sm:grid",children:r.map(r=>{var a;let l,i,d=f[r.state],h=b===r.personShipId,g=null===r.lastUsedAt?"Not yet":(a=r.lastUsedAt,(i=new Date(s).getTime()-new Date(a).getTime())<6e4?"Just now":i<36e5?`${String(Math.floor(i/6e4))} min ago`:(l=new Date(a),`${String(l.getUTCDate())} ${u[l.getUTCMonth()]??""}, ${p(l.getUTCHours())}:${p(l.getUTCMinutes())}`));return[(0,t.jsxs)("tr",{className:`border-b border-border max-sm:grid max-sm:grid-cols-[1fr_auto] max-sm:gap-1 max-sm:py-3 ${h?"border-b-0":"last:border-b-0"}`,"data-testid":"outside-party-sign-ins-row",children:[(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-start-1 max-sm:row-start-1 max-sm:h-auto max-sm:px-0 max-sm:font-medium",children:[m(r),r.isYours?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" (you)"}):null]}),(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-span-2 max-sm:row-start-2 max-sm:h-auto max-sm:px-0 max-sm:text-muted-foreground",children:[function({outsideAccount:e}){return e.name??e.subject??(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}(r),(0,t.jsxs)("span",{className:"sm:hidden",children:[" · last used ",null===r.lastUsedAt?"not yet":g]})]}),(0,t.jsx)("td",{className:"h-12 px-2 max-sm:col-start-2 max-sm:row-start-1 max-sm:h-auto max-sm:px-0",children:(0,t.jsx)(c.T,{tone:d.tone,label:d.label})}),(0,t.jsx)("td",{className:"h-12 px-2 text-muted-foreground max-sm:hidden",children:g}),(0,t.jsx)("td",{className:"h-12 px-2 text-right max-sm:col-span-2 max-sm:row-start-3 max-sm:h-auto max-sm:px-0 max-sm:text-left",children:(0,t.jsx)("button",{type:"button",className:`${o.x.secondary} ${h?"max-sm:hidden":""}`,onClick:()=>{e.onRemove(r.personShipId)},"data-testid":"outside-party-sign-ins-remove",children:"Remove"})})]},r.personShipId),h?(0,t.jsx)("tr",{className:"border-b border-border last:border-b-0 max-sm:block max-sm:pb-3",children:(0,t.jsx)("td",{colSpan:5,className:"pb-2 max-sm:block max-sm:pb-0",children:(0,t.jsx)(x,{signIn:r,party:n,isRemoving:v===r.personShipId,onConfirm:()=>{e.onConfirm(r)},onKeep:e.onKeep})})},`${r.personShipId}-confirm`):null]})})]}),null===a&&l?(0,t.jsx)("div",{children:(0,t.jsx)("button",{type:"button",className:o.x.secondary,disabled:i,"aria-busy":i,onClick:e.onMore,"data-testid":"outside-party-sign-ins-more",children:i?"Showing more…":"Show more"})}):null]})}e.s(["EveryonesSignInsCard",0,function({fleetId:e,party:r,now:o,first:d}){let[c,u]=(0,n.useState)([]),[p,f]=(0,n.useState)(d.next),[h,g]=(0,n.useState)(new Set),[x,v]=(0,n.useState)(null),[w,y]=(0,n.useState)(null),[S,j]=(0,n.useState)(s.Q),[N,R]=(0,n.useTransition)(),[,C]=(0,n.useTransition)(),k=i(d.grants,c).filter(({personShipId:e})=>!h.has(e));return(0,t.jsx)(b,{party:r,now:o,rows:k,refusal:null,hasMore:null!==p,isLoadingMore:N,confirming:x,removing:w,outcome:S,onRemove:e=>{v(e),j(s.Q)},onConfirm:t=>{y(t.personShipId),C(async()=>{let n=await l({fleetId:e,name:r,personShipId:t.personShipId});y(null),v(null),n.isOk?(g(e=>new Set([...e,t.personShipId])),j({kind:"done",message:function({person:e,party:t,isRevoked:n}){return n?`${e}'s sign-in is removed, and revoked at ${t}.`:`${e}'s sign-in is removed.`}({person:m(t),party:r,isRevoked:n.isRevoked})})):j({kind:"refused",message:n.message})})},onKeep:()=>{v(null)},onMore:()=>{let t=p??k.at(-1)?.personShipId;void 0!==t&&R(async()=>{let n=await a({fleetId:e,name:r,after:t});n.isOk?(u(e=>i(e,n.grants)),f(n.next)):j({kind:"refused",message:n.message})})}})}],15327)},52979,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(94984),a=e.i(58107),l=e.i(95187);let i=(0,l.createServerReference)("606d313829d9c2108131b763ec8a2b819b6eee19e6",l.callServer,void 0,l.findSourceMapURL,"removeOwnSignIn");var o=e.i(3032);function d({fleetId:e,party:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"hidden",name:s.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:n})]})}e.s(["RemoveSignInForm",0,function({fleetId:e,party:l}){let[o,c]=(0,n.useActionState)(i,s.Q);return(0,t.jsxs)("form",{action:c,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:o}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:"secondary",pending:"Removing…",testId:"outside-party-sign-in-remove",children:"Remove"})})]})},"SignInForm",0,function({fleetId:e,party:l,label:i,kind:c}){let[u,p]=(0,n.useActionState)(o.f,s.Q);return(0,t.jsxs)("form",{action:p,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:u}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:c,pending:`Opening ${l}…`,testId:"outside-party-sign-in-start",children:i})})]})}],52979)},12137,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(74080),r=e.i(28008),a=e.i(25621),l=e.i(95187);let i=(0,l.createServerReference)("604c675edd999baab7c5ba915bf2295417206b928d",l.callServer,void 0,l.findSourceMapURL,"markA2aAgent"),o={kind:"idle"};function d({isRepeatable:e}){let n=(0,s.useFormStatus)();return(0,t.jsx)(a.f,{type:"submit",isOn:e,label:"Repeatable",isPending:n.pending,testId:"outside-party-repeatable-switch"})}e.s(["RepeatableSwitch",0,function({fleetId:e,party:s,isRepeatable:a}){let[l,c]=(0,n.useActionState)(i,o),u="marked"===l.kind?l.isRepeatable:a;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{action:c,className:"contents",children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:s}),(0,t.jsx)("input",{type:"hidden",name:"isRepeatable",value:String(!u)}),(0,t.jsx)(d,{isRepeatable:u})]}),"idle"===l.kind?null:(0,t.jsx)("span",{role:"refused"===l.kind?"alert":"status",className:`basis-full text-caption ${"refused"===l.kind?"text-tone-attention-fg":"text-tone-ok-fg"}`,"data-testid":"outside-party-repeatable-outcome",children:l.message})]})}],12137)}])})();