@aeolus-fleet/gateway 0.37.1 → 0.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/adapters/prisma/changes.d.ts +8 -3
  2. package/dist/adapters/prisma/changes.js +18 -2
  3. package/dist/adapters/prisma/changes.js.map +1 -1
  4. package/dist/app.js +19 -11
  5. package/dist/app.js.map +1 -1
  6. package/dist/core/people/held-deliveries.d.ts +30 -0
  7. package/dist/core/people/held-deliveries.js +42 -0
  8. package/dist/core/people/held-deliveries.js.map +1 -0
  9. package/dist/core/people/opened-of.d.ts +2 -0
  10. package/dist/core/people/opened-of.js.map +1 -1
  11. package/dist/core/people/ports.d.ts +8 -0
  12. package/dist/core/people/read-basket.d.ts +2 -0
  13. package/dist/core/people/read-basket.js.map +1 -1
  14. package/dist/core/people/read-bridge-home.d.ts +2 -0
  15. package/dist/core/people/read-bridge-home.js.map +1 -1
  16. package/dist/core/people/read-inbox.d.ts +16 -8
  17. package/dist/core/people/read-inbox.js +21 -10
  18. package/dist/core/people/read-inbox.js.map +1 -1
  19. package/dist/core/people/send-stored-answers.d.ts +2 -0
  20. package/dist/core/people/send-stored-answers.js +1 -1
  21. package/dist/core/people/send-stored-answers.js.map +1 -1
  22. package/package.json +1 -1
  23. package/web/.next/BUILD_ID +1 -1
  24. package/web/.next/build-manifest.json +3 -3
  25. package/web/.next/diagnostics/route-bundle-stats.json +75 -75
  26. package/web/.next/fallback-build-manifest.json +3 -3
  27. package/web/.next/prerender-manifest.json +3 -3
  28. package/web/.next/server/app/(bridge)/bridge/basket/page/server-reference-manifest.json +10 -10
  29. package/web/.next/server/app/(bridge)/bridge/basket/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(bridge)/bridge/basket/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(bridge)/bridge/done/page/server-reference-manifest.json +4 -4
  32. package/web/.next/server/app/(bridge)/bridge/done/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(bridge)/bridge/done/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(bridge)/bridge/fleet/page/server-reference-manifest.json +3 -3
  35. package/web/.next/server/app/(bridge)/bridge/fleet/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(bridge)/bridge/fleet/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(bridge)/bridge/page/server-reference-manifest.json +9 -9
  38. package/web/.next/server/app/(bridge)/bridge/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(bridge)/bridge/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(bridge)/bridge/settings/page/server-reference-manifest.json +3 -3
  41. package/web/.next/server/app/(bridge)/bridge/settings/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(bridge)/bridge/settings/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page/server-reference-manifest.json +4 -4
  44. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(bridge)/bridge/settings/routing/page/server-reference-manifest.json +7 -7
  47. package/web/.next/server/app/(bridge)/bridge/settings/routing/page.js.nft.json +1 -1
  48. package/web/.next/server/app/(bridge)/bridge/settings/routing/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/(bridge)/bridge/stay-aware/page/server-reference-manifest.json +9 -9
  50. package/web/.next/server/app/(bridge)/bridge/stay-aware/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(bridge)/bridge/stay-aware/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page/server-reference-manifest.json +16 -16
  53. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/(bridge)/outside-parties/[name]/page/server-reference-manifest.json +10 -10
  56. package/web/.next/server/app/(bridge)/outside-parties/[name]/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(bridge)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page/server-reference-manifest.json +16 -16
  59. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page.js.nft.json +1 -1
  60. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/(bridge)/outside-parties/add/page/server-reference-manifest.json +12 -12
  62. package/web/.next/server/app/(bridge)/outside-parties/add/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(bridge)/outside-parties/add/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +4 -4
  65. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page.js.nft.json +1 -1
  66. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page/server-reference-manifest.json +4 -4
  68. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(bridge)/outside-parties/page/server-reference-manifest.json +4 -4
  71. package/web/.next/server/app/(bridge)/outside-parties/page.js.nft.json +1 -1
  72. package/web/.next/server/app/(bridge)/outside-parties/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/(console)/gateway-off/page/server-reference-manifest.json +1 -1
  74. package/web/.next/server/app/(console)/gateway-off/page.js.nft.json +1 -1
  75. package/web/.next/server/app/(console)/gateway-off/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/(console)/meetings/[meetingId]/page/server-reference-manifest.json +3 -3
  77. package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.nft.json +1 -1
  78. package/web/.next/server/app/(console)/meetings/[meetingId]/page_client-reference-manifest.js +1 -1
  79. package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +9 -9
  80. package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
  81. package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
  82. package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
  83. package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
  84. package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
  85. package/web/.next/server/app/(console)/slack/disconnect/page/server-reference-manifest.json +11 -11
  86. package/web/.next/server/app/(console)/slack/disconnect/page.js.nft.json +1 -1
  87. package/web/.next/server/app/(console)/slack/disconnect/page_client-reference-manifest.js +1 -1
  88. package/web/.next/server/app/(console)/slack/expose/page/server-reference-manifest.json +11 -11
  89. package/web/.next/server/app/(console)/slack/expose/page.js.nft.json +1 -1
  90. package/web/.next/server/app/(console)/slack/expose/page_client-reference-manifest.js +1 -1
  91. package/web/.next/server/app/(console)/slack/page/server-reference-manifest.json +11 -11
  92. package/web/.next/server/app/(console)/slack/page.js.nft.json +1 -1
  93. package/web/.next/server/app/(console)/slack/page_client-reference-manifest.js +1 -1
  94. package/web/.next/server/app/(console)/slack/remove/page/server-reference-manifest.json +11 -11
  95. package/web/.next/server/app/(console)/slack/remove/page.js.nft.json +1 -1
  96. package/web/.next/server/app/(console)/slack/remove/page_client-reference-manifest.js +1 -1
  97. package/web/.next/server/app/_global-error.html +1 -1
  98. package/web/.next/server/app/_global-error.rsc +1 -1
  99. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  100. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  101. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  102. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  103. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  104. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  105. package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
  106. package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
  107. package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
  108. package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
  109. package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
  110. package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
  111. package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
  112. package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
  113. package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
  114. package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js +1 -1
  115. package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js +1 -1
  117. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js +1 -1
  119. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js.map +1 -1
  120. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js +1 -1
  121. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js +1 -1
  123. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js +1 -1
  125. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js +1 -1
  127. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js +1 -1
  129. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js +1 -1
  131. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ipo8r1s1ntds._.js +1 -1
  133. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js +1 -1
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js.map +1 -1
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js +1 -1
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/[root-of-the-server]__0xurmpdv5uqfl._.js +1 -1
  138. package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js +1 -1
  139. package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js.map +1 -1
  140. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js +1 -1
  141. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js +1 -1
  143. package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.js +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/{_0d9el5z4r07h8._.js → _0-9rlwz3ujd0r._.js} +2 -2
  147. package/web/.next/server/chunks/ssr/{_0nmqkf1y-qsc2._.js.map → _0-9rlwz3ujd0r._.js.map} +1 -1
  148. package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js +1 -1
  149. package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/_0_nfv33ug5g31._.js +1 -1
  151. package/web/.next/server/chunks/ssr/_0_nfv33ug5g31._.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js +1 -1
  153. package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js.map +1 -1
  154. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
  155. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
  156. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
  157. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
  158. package/web/.next/server/chunks/ssr/{_0nmqkf1y-qsc2._.js → _15yv_08kq3cgn._.js} +2 -2
  159. package/web/.next/server/chunks/ssr/{_0d9el5z4r07h8._.js.map → _15yv_08kq3cgn._.js.map} +1 -1
  160. package/web/.next/server/chunks/ssr/{_0msh_lv5ns4e9._.js → _1ag569itedbet._.js} +2 -2
  161. package/web/.next/server/chunks/ssr/{_1a-gh-psko_2f._.js.map → _1ag569itedbet._.js.map} +1 -1
  162. package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js +1 -1
  163. package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/{_1a-gh-psko_2f._.js → _1m4bmxzmjr-8s._.js} +2 -2
  165. package/web/.next/server/chunks/ssr/{_0msh_lv5ns4e9._.js.map → _1m4bmxzmjr-8s._.js.map} +1 -1
  166. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
  167. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
  168. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
  169. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/_1x3tv4gu7i2sy._.js +57 -0
  171. package/web/.next/server/chunks/ssr/_1x3tv4gu7i2sy._.js.map +1 -0
  172. package/web/.next/server/chunks/ssr/_1zcbk6s3j_jfy._.js +57 -0
  173. package/web/.next/server/chunks/ssr/_1zcbk6s3j_jfy._.js.map +1 -0
  174. package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js +1 -1
  175. package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js.map +1 -1
  176. package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js +1 -1
  177. package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js.map +1 -1
  178. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js +1 -1
  179. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js +1 -1
  181. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js.map +1 -1
  182. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js +1 -1
  183. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js.map +1 -1
  184. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js +1 -1
  185. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js.map +1 -1
  186. package/web/.next/server/chunks/ssr/{web_features_11rwm0rhf5957._.js → web_features_16z82ve7t15n5._.js} +2 -2
  187. package/web/.next/server/chunks/ssr/{web_features_11rwm0rhf5957._.js.map → web_features_16z82ve7t15n5._.js.map} +1 -1
  188. package/web/.next/server/chunks/ssr/{web_features_0cgvngtsgzu24._.js → web_features_1e7_lwq7351pm._.js} +2 -2
  189. package/web/.next/server/chunks/ssr/{web_features_0cgvngtsgzu24._.js.map → web_features_1e7_lwq7351pm._.js.map} +1 -1
  190. package/web/.next/server/chunks/ssr/{web_features_1r2u065j-hgrq._.js → web_features_1fzx-ctm4ru39._.js} +2 -2
  191. package/web/.next/server/chunks/ssr/{web_features_1r2u065j-hgrq._.js.map → web_features_1fzx-ctm4ru39._.js.map} +1 -1
  192. package/web/.next/server/chunks/ssr/{web_features_1loqabdanp8wi._.js → web_features_1wo7gr7bxvsi-._.js} +2 -2
  193. package/web/.next/server/chunks/ssr/{web_features_1loqabdanp8wi._.js.map → web_features_1wo7gr7bxvsi-._.js.map} +1 -1
  194. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +1 -1
  195. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -1
  196. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +1 -1
  197. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -1
  198. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
  199. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
  200. package/web/.next/server/chunks/ssr/{web_features_bridge_17dx2edv4zsex._.js → web_features_bridge_0qdb9pmm6338t._.js} +2 -2
  201. package/web/.next/server/chunks/ssr/{web_features_bridge_17dx2edv4zsex._.js.map → web_features_bridge_0qdb9pmm6338t._.js.map} +1 -1
  202. package/web/.next/server/chunks/ssr/web_features_bridge_hooks_bridge-actions_ts_0h-_xm2rcb-ij._.js +1 -1
  203. package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js +1 -1
  204. package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js.map +1 -1
  205. package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js +1 -1
  206. package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js.map +1 -1
  207. package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js +1 -1
  208. package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js.map +1 -1
  209. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js +1 -1
  210. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map +1 -1
  211. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
  212. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
  213. package/web/.next/server/chunks/ssr/web_features_outside-party_1-lre9nfakki7._.js +1 -1
  214. package/web/.next/server/chunks/ssr/web_features_outside-party_1-lre9nfakki7._.js.map +1 -1
  215. package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
  216. package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
  217. package/web/.next/server/chunks/ssr/web_features_slack_actions_ts_1l3yg9vl20_vu._.js +1 -1
  218. package/web/.next/server/middleware-build-manifest.js +3 -3
  219. package/web/.next/server/pages/500.html +1 -1
  220. package/web/.next/server/preview-props.json +3 -3
  221. package/web/.next/server/server-reference-manifest.js +1 -1
  222. package/web/.next/server/server-reference-manifest.json +51 -51
  223. package/web/.next/static/chunks/{1az8wx3bt0tc-.js → 07km754q38z4c.js} +1 -1
  224. package/web/.next/static/chunks/{3c2whoiify4hd.js → 0ev65_p1z_ll0.js} +1 -1
  225. package/web/.next/static/chunks/17akrnci0j_nn.js +1 -0
  226. package/web/.next/static/chunks/{2ztqsnh1sq5f9.js → 1_f6w3i1t1svg.js} +1 -1
  227. package/web/.next/static/chunks/1e5_kej4hnnf_.js +1 -0
  228. package/web/.next/static/chunks/{3bvcgvk4m3hxh.js → 1edk_zyv9lbyy.js} +1 -1
  229. package/web/.next/static/chunks/{0klu03tcnjzsm.js → 1lq70vpqz6u1c.js} +1 -1
  230. package/web/.next/static/chunks/{1oipnf2j_m8oy.js → 1zqkns-nn-wz0.js} +4 -4
  231. package/web/.next/static/chunks/{3q_d1vlm22cy0.js → 2490rbe6dmnwe.js} +1 -1
  232. package/web/.next/static/chunks/{0jqdvhip5x6im.js → 27tnlhw9cxgul.js} +1 -1
  233. package/web/.next/static/chunks/{0d0fsf26a1ep_.js → 2_ayfyj3csc8m.js} +1 -1
  234. package/web/.next/static/chunks/2v-0k1odkn9cu.js +1 -0
  235. package/web/.next/static/chunks/{3po7blcdi5_y6.js → 2v4z6cjtqu95k.js} +1 -1
  236. package/web/.next/static/chunks/{12kwix3z2z-fs.js → 3ban8s8z3ah0y.js} +1 -1
  237. package/web/.next/static/chunks/{3nqasvqr8d81s.js → 3ik7w8wf5u23q.js} +1 -1
  238. package/web/.next/trace +1 -1
  239. package/web/.next/trace-build +1 -1
  240. package/web/.next/server/chunks/ssr/_1e720g1qty0xj._.js +0 -57
  241. package/web/.next/server/chunks/ssr/_1e720g1qty0xj._.js.map +0 -1
  242. package/web/.next/server/chunks/ssr/_1xjxj1ur-j87t._.js +0 -57
  243. package/web/.next/server/chunks/ssr/_1xjxj1ur-j87t._.js.map +0 -1
  244. package/web/.next/static/chunks/04r-53h_fb5rq.js +0 -1
  245. package/web/.next/static/chunks/2fjzmc7-5sf_m.js +0 -1
  246. package/web/.next/static/chunks/38w8690okopia.js +0 -1
  247. /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → yJHYTb3NO7GRc3o3RS0f0}/_buildManifest.js +0 -0
  248. /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → yJHYTb3NO7GRc3o3RS0f0}/_clientMiddlewareManifest.js +0 -0
  249. /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → yJHYTb3NO7GRc3o3RS0f0}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[20298,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(72131),e=a.i(5050);let f=(0,e.createServerReference)("407f1cedcb3c48d984bacb4b1f06f0744be888950e",e.callServer,void 0,e.findSourceMapURL,"decideRequest");var g=a.i(16550),h=a.i(51636),i=a.i(35149);let j=["messages:send","messages:receive"],k={"messages:send":"Send","messages:receive":"Receive","fleet:read":"Read the fleet"};var l=a.i(32043),m=a.i(10039);let n="rounded-md border border-input bg-background px-2 py-1.5";function o({scope:a,isLocked:c}){return(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[c?(0,b.jsx)("input",{type:"checkbox",checked:!0,disabled:!0,"aria-label":k[a]??a}):(0,b.jsx)("input",{type:"checkbox",name:"scope",value:a,"aria-label":k[a]??a}),(0,b.jsx)("span",{children:k[a]??a}),(0,b.jsx)("span",{className:"font-mono text-caption text-muted-foreground",children:a}),c?(0,b.jsx)("span",{className:"text-caption text-muted-foreground",children:"(always)"}):null]})}function p(a,b){let c=a.get(b);return"string"==typeof c?c:""}function q({request:a,heldScopes:c,owners:e,working:f,failure:g,onDecide:k}){let[r,s]=(0,d.useState)("bearer"),t=function(a){switch(a.subject.kind){case"client":return a.subject.clientName;case"server":return URL.canParse(a.subject.url)?new URL(a.subject.url).host:a.subject.url}}(a),u="server"===a.subject.kind;return(0,b.jsxs)("section",{className:"grid gap-3 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm",children:[(0,b.jsxs)("h2",{className:"text-heading font-semibold",children:["Approve ",t]}),(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault();let b=new FormData(a.currentTarget),c=b.getAll("scope").filter(a=>"string"==typeof a);k({kind:"approve",name:p(b,"name"),ownerShipId:p(b,"ownerShipId"),scopes:c,server:u?{credentialKind:(0,h.C)(p(b,"credentialKind")),token:p(b,"token"),clientId:p(b,"clientId"),clientSecret:p(b,"clientSecret"),issuer:p(b,"issuer"),scope:p(b,"scope-requested"),concurrencyLimit:Number(p(b,"concurrencyLimit"))}:void 0})},className:"grid gap-3",children:[(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Proxy ship's name"}),(0,b.jsx)("input",{name:"name",defaultValue:t.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,""),required:!0,className:n})]}),(0,b.jsx)(i.f,{choices:e.isOk?e.value:[],current:null,help:"A person ship or argo. It answers for this party.",refusal:e.isOk?void 0:e.refusal}),(0,b.jsxs)("fieldset",{className:"grid gap-1",children:[(0,b.jsx)("legend",{children:"Scopes"}),j.map(a=>(0,b.jsx)(o,{scope:a,isLocked:!0},a)),c.filter(a=>!j.includes(a)).map(a=>(0,b.jsx)(o,{scope:a,isLocked:!1},a))]}),u?(0,b.jsxs)("fieldset",{className:"grid gap-2",children:[(0,b.jsx)("legend",{children:"The server's credential"}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Credential"}),(0,b.jsx)("select",{name:"credentialKind",value:r,onChange:a=>{s((0,h.C)(a.target.value))},className:n,children:h.x.map(({kind:a,label:c})=>(0,b.jsx)("option",{value:a,children:c},a))})]}),"none"===r?null:"bearer"===r?(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Bearer token"}),(0,b.jsx)("input",{type:"password",name:"token",className:n})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Client id"}),(0,b.jsx)("input",{name:"clientId",className:n})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Client secret"}),(0,b.jsx)("input",{type:"password",name:"clientSecret",className:n})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Issuer"}),(0,b.jsx)("input",{type:"url",name:"issuer",className:n})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Scope"}),(0,b.jsx)("input",{name:"scope-requested",className:n})]})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Calls at once"}),(0,b.jsx)("input",{type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:4,className:n})]})]}):null,void 0===g?null:(0,b.jsx)(m.f,{message:g,isFailure:!0}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(l.i,{type:"submit",variant:"primary","data-testid":"bridge-approve",isPending:"approve"===f,pendingLabel:"Approving...",disabled:void 0!==f,children:"Approve"}),(0,b.jsx)(l.i,{type:"button","data-testid":"bridge-deny",isPending:"deny"===f,pendingLabel:"Denying...",disabled:void 0!==f,onClick:()=>{k({kind:"deny"})},children:"Deny"})]})]})]})}a.s(["DecisionPanel",0,function({fleetId:a,request:e,heldScopes:h,owners:i}){let j=(0,c.useRouter)(),[k,l]=(0,d.useState)(),[m,n]=(0,d.useState)(),[,o]=(0,d.useTransition)();return(0,b.jsx)(q,{request:e,heldScopes:h,owners:i,working:k,failure:m,onDecide:b=>{l(b.kind),n(void 0),o(async()=>{let c=await f({fleet:a,requestId:e.requestId,input:b});c.isOk?j.push(`${g.T}?${new URLSearchParams({fleet:a,decided:b.kind}).toString()}`):(l(void 0),n(c.message))})}})}],20298)}];
1
+ module.exports=[20298,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(72131),e=a.i(5050);let f=(0,e.createServerReference)("40ae33f79052d467a1fba4f152653f3d44ea2f48ab",e.callServer,void 0,e.findSourceMapURL,"decideRequest");var g=a.i(16550),h=a.i(51636),i=a.i(35149);let j=["messages:send","messages:receive"],k={"messages:send":"Send","messages:receive":"Receive","fleet:read":"Read the fleet"};var l=a.i(32043),m=a.i(10039);let n="rounded-md border border-input bg-background px-2 py-1.5";function o({scope:a,isLocked:c}){return(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[c?(0,b.jsx)("input",{type:"checkbox",checked:!0,disabled:!0,"aria-label":k[a]??a}):(0,b.jsx)("input",{type:"checkbox",name:"scope",value:a,"aria-label":k[a]??a}),(0,b.jsx)("span",{children:k[a]??a}),(0,b.jsx)("span",{className:"font-mono text-caption text-muted-foreground",children:a}),c?(0,b.jsx)("span",{className:"text-caption text-muted-foreground",children:"(always)"}):null]})}function p(a,b){let c=a.get(b);return"string"==typeof c?c:""}function q({request:a,heldScopes:c,owners:e,working:f,failure:g,onDecide:k}){let[r,s]=(0,d.useState)("bearer"),t=function(a){switch(a.subject.kind){case"client":return a.subject.clientName;case"server":return URL.canParse(a.subject.url)?new URL(a.subject.url).host:a.subject.url}}(a),u="server"===a.subject.kind;return(0,b.jsxs)("section",{className:"grid gap-3 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm",children:[(0,b.jsxs)("h2",{className:"text-heading font-semibold",children:["Approve ",t]}),(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault();let b=new FormData(a.currentTarget),c=b.getAll("scope").filter(a=>"string"==typeof a);k({kind:"approve",name:p(b,"name"),ownerShipId:p(b,"ownerShipId"),scopes:c,server:u?{credentialKind:(0,h.C)(p(b,"credentialKind")),token:p(b,"token"),clientId:p(b,"clientId"),clientSecret:p(b,"clientSecret"),issuer:p(b,"issuer"),scope:p(b,"scope-requested"),concurrencyLimit:Number(p(b,"concurrencyLimit"))}:void 0})},className:"grid gap-3",children:[(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Proxy ship's name"}),(0,b.jsx)("input",{name:"name",defaultValue:t.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,""),required:!0,className:n})]}),(0,b.jsx)(i.f,{choices:e.isOk?e.value:[],current:null,help:"A person ship or argo. It answers for this party.",refusal:e.isOk?void 0:e.refusal}),(0,b.jsxs)("fieldset",{className:"grid gap-1",children:[(0,b.jsx)("legend",{children:"Scopes"}),j.map(a=>(0,b.jsx)(o,{scope:a,isLocked:!0},a)),c.filter(a=>!j.includes(a)).map(a=>(0,b.jsx)(o,{scope:a,isLocked:!1},a))]}),u?(0,b.jsxs)("fieldset",{className:"grid gap-2",children:[(0,b.jsx)("legend",{children:"The server's credential"}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Credential"}),(0,b.jsx)("select",{name:"credentialKind",value:r,onChange:a=>{s((0,h.C)(a.target.value))},className:n,children:h.x.map(({kind:a,label:c})=>(0,b.jsx)("option",{value:a,children:c},a))})]}),"none"===r?null:"bearer"===r?(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Bearer token"}),(0,b.jsx)("input",{type:"password",name:"token",className:n})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Client id"}),(0,b.jsx)("input",{name:"clientId",className:n})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Client secret"}),(0,b.jsx)("input",{type:"password",name:"clientSecret",className:n})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Issuer"}),(0,b.jsx)("input",{type:"url",name:"issuer",className:n})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Scope"}),(0,b.jsx)("input",{name:"scope-requested",className:n})]})]}),(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Calls at once"}),(0,b.jsx)("input",{type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:4,className:n})]})]}):null,void 0===g?null:(0,b.jsx)(m.f,{message:g,isFailure:!0}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(l.i,{type:"submit",variant:"primary","data-testid":"bridge-approve",isPending:"approve"===f,pendingLabel:"Approving...",disabled:void 0!==f,children:"Approve"}),(0,b.jsx)(l.i,{type:"button","data-testid":"bridge-deny",isPending:"deny"===f,pendingLabel:"Denying...",disabled:void 0!==f,onClick:()=>{k({kind:"deny"})},children:"Deny"})]})]})]})}a.s(["DecisionPanel",0,function({fleetId:a,request:e,heldScopes:h,owners:i}){let j=(0,c.useRouter)(),[k,l]=(0,d.useState)(),[m,n]=(0,d.useState)(),[,o]=(0,d.useTransition)();return(0,b.jsx)(q,{request:e,heldScopes:h,owners:i,working:k,failure:m,onDecide:b=>{l(b.kind),n(void 0),o(async()=>{let c=await f({fleet:a,requestId:e.requestId,input:b});c.isOk?j.push(`${g.T}?${new URLSearchParams({fleet:a,decided:b.kind}).toString()}`):(l(void 0),n(c.message))})}})}],20298)}];
2
2
 
3
3
  //# sourceMappingURL=web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../web/features/bridge/state/decision-panel.tsx","../../../../../web/features/bridge/hooks/data%3A2e3c66%20%3Ctext/javascript%3E","../../../../../web/features/bridge/ui/decision-form.tsx","../../../../../web/features/bridge/services/requests.ts"],"sourcesContent":["'use client';\n\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport type { OwnerChoices } from '../../forms/ui/owner-field';\nimport { decideRequest } from '../hooks/bridge-actions';\nimport { BRIDGE_SETTINGS_PATH } from '../paths';\nimport type { DecisionInput, ShownRequest } from '../services/requests';\nimport { DecisionForm } from '../ui/decision-form';\n\n/** Decides one request as the signed-in approver, then goes back to Bridge's settings, which say nothing more waits here. */\nexport function DecisionPanel({ fleetId, request, heldScopes, owners }: { fleetId: string; request: ShownRequest; heldScopes: readonly string[]; owners: OwnerChoices }) {\n const router = useRouter();\n const [working, setWorking] = useState<DecisionInput['kind'] | undefined>();\n const [failure, setFailure] = useState<string | undefined>();\n const [, startTransition] = useTransition();\n const decide = (decision: DecisionInput) => {\n setWorking(decision.kind);\n setFailure(undefined);\n startTransition(async () => {\n const outcome = await decideRequest({ fleet: fleetId, requestId: request.requestId, input: decision });\n if (outcome.isOk) {\n router.push(`${BRIDGE_SETTINGS_PATH}?${new URLSearchParams({ fleet: fleetId, decided: decision.kind }).toString()}`);\n return;\n }\n setWorking(undefined);\n setFailure(outcome.message);\n });\n };\n return <DecisionForm request={request} heldScopes={heldScopes} owners={owners} working={working} failure={failure} onDecide={decide} />;\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"407f1cedcb3c48d984bacb4b1f06f0744be888950e\":{\"name\":\"decideRequest\"}},\"web/features/bridge/hooks/bridge-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_14=/*#__PURE__*/createServerReference(\"407f1cedcb3c48d984bacb4b1f06f0744be888950e\",callServer,void 0,findSourceMapURL,\"decideRequest\");export{$$RSC_SERVER_ACTION_14 as decideRequest};","'use client';\n\nimport { useState, type SyntheticEvent } from 'react';\n\nimport { CREDENTIAL_KINDS, credentialKindOf } from '../../forms/server-credential';\nimport { OwnerField, type OwnerChoices } from '../../forms/ui/owner-field';\nimport { EVERY_APP_SHIP_SCOPES, scopeLabel, subjectName, suggestedName, type DecisionInput, type ServerCredentialInput, type ShownRequest } from '../services/requests';\nimport { ActionButton } from './action-button';\nimport { Notice } from './notice';\n\nconst CONCURRENCY_LIMIT_DEFAULT = 4;\n\nconst FIELD = 'rounded-md border border-input bg-background px-2 py-1.5';\n\nfunction ScopeRow({ scope, isLocked }: { scope: string; isLocked: boolean }) {\n return (\n <label className=\"flex items-center gap-2\">\n {isLocked ? <input type=\"checkbox\" checked disabled aria-label={scopeLabel(scope)} /> : <input type=\"checkbox\" name=\"scope\" value={scope} aria-label={scopeLabel(scope)} />}\n <span>{scopeLabel(scope)}</span>\n <span className=\"font-mono text-caption text-muted-foreground\">{scope}</span>\n {isLocked ? <span className=\"text-caption text-muted-foreground\">(always)</span> : null}\n </label>\n );\n}\n\nfunction text(form: FormData, name: string): string {\n const value = form.get(name);\n return typeof value === 'string' ? value : '';\n}\n\nfunction serverOf(form: FormData): ServerCredentialInput {\n return {\n credentialKind: credentialKindOf(text(form, 'credentialKind')),\n token: text(form, 'token'),\n clientId: text(form, 'clientId'),\n clientSecret: text(form, 'clientSecret'),\n issuer: text(form, 'issuer'),\n scope: text(form, 'scope-requested'),\n concurrencyLimit: Number(text(form, 'concurrencyLimit')),\n };\n}\n\n/**\n * The decision on a request: approving names the proxy ship and its owner,\n * and offers as scope rows only the scopes the approver holds, messages:send\n * and messages:receive locked on (0046, 0053); a server's credential too.\n * What was typed stays when the API refuses.\n */\nexport function DecisionForm({\n request,\n heldScopes,\n owners,\n working,\n failure,\n onDecide,\n}: {\n request: ShownRequest;\n heldScopes: readonly string[];\n owners: OwnerChoices;\n working: DecisionInput['kind'] | undefined;\n failure: string | undefined;\n onDecide: (decision: DecisionInput) => void;\n}) {\n const [credentialKind, setCredentialKind] = useState<ServerCredentialInput['credentialKind']>('bearer');\n const name = subjectName(request);\n const isServer = request.subject.kind === 'server';\n const approve = (event: SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n const form = new FormData(event.currentTarget);\n const scopes = form.getAll('scope').filter((scope) => typeof scope === 'string');\n onDecide({ kind: 'approve', name: text(form, 'name'), ownerShipId: text(form, 'ownerShipId'), scopes, server: isServer ? serverOf(form) : undefined });\n };\n return (\n <section className=\"grid gap-3 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm\">\n <h2 className=\"text-heading font-semibold\">Approve {name}</h2>\n <form onSubmit={approve} className=\"grid gap-3\">\n <label className=\"grid gap-1\">\n <span>Proxy ship&apos;s name</span>\n <input name=\"name\" defaultValue={suggestedName(name)} required className={FIELD} />\n </label>\n <OwnerField choices={owners.isOk ? owners.value : []} current={null} help=\"A person ship or argo. It answers for this party.\" refusal={owners.isOk ? undefined : owners.refusal} />\n <fieldset className=\"grid gap-1\">\n <legend>Scopes</legend>\n {EVERY_APP_SHIP_SCOPES.map((scope) => (\n <ScopeRow key={scope} scope={scope} isLocked />\n ))}\n {heldScopes\n .filter((scope) => !EVERY_APP_SHIP_SCOPES.includes(scope))\n .map((scope) => (\n <ScopeRow key={scope} scope={scope} isLocked={false} />\n ))}\n </fieldset>\n {isServer ? (\n <fieldset className=\"grid gap-2\">\n <legend>The server&apos;s credential</legend>\n <label className=\"grid gap-1\">\n <span>Credential</span>\n <select name=\"credentialKind\" value={credentialKind} onChange={(event) => { setCredentialKind(credentialKindOf(event.target.value)); }} className={FIELD}>\n {CREDENTIAL_KINDS.map(({ kind, label }) => (\n <option key={kind} value={kind}>\n {label}\n </option>\n ))}\n </select>\n </label>\n {credentialKind === 'none' ? null : credentialKind === 'bearer' ? (\n <label className=\"grid gap-1\">\n <span>Bearer token</span>\n <input type=\"password\" name=\"token\" className={FIELD} />\n </label>\n ) : (\n <>\n <label className=\"grid gap-1\">\n <span>Client id</span>\n <input name=\"clientId\" className={FIELD} />\n </label>\n <label className=\"grid gap-1\">\n <span>Client secret</span>\n <input type=\"password\" name=\"clientSecret\" className={FIELD} />\n </label>\n <label className=\"grid gap-1\">\n <span>Issuer</span>\n <input type=\"url\" name=\"issuer\" className={FIELD} />\n </label>\n <label className=\"grid gap-1\">\n <span>Scope</span>\n <input name=\"scope-requested\" className={FIELD} />\n </label>\n </>\n )}\n <label className=\"grid gap-1\">\n <span>Calls at once</span>\n <input type=\"number\" name=\"concurrencyLimit\" min={1} max={10} defaultValue={CONCURRENCY_LIMIT_DEFAULT} className={FIELD} />\n </label>\n </fieldset>\n ) : null}\n {failure === undefined ? null : <Notice message={failure} isFailure />}\n <div className=\"flex gap-2\">\n <ActionButton type=\"submit\" variant=\"primary\" data-testid=\"bridge-approve\" isPending={working === 'approve'} pendingLabel=\"Approving...\" disabled={working !== undefined}>\n Approve\n </ActionButton>\n <ActionButton type=\"button\" data-testid=\"bridge-deny\" isPending={working === 'deny'} pendingLabel=\"Denying...\" disabled={working !== undefined} onClick={() => { onDecide({ kind: 'deny' }); }}>\n Deny\n </ActionButton>\n </div>\n </form>\n </section>\n );\n}\n","/**\n * How Bridge's settings name and states a request for an outside party (design\n * B, Signal): pure view logic, no React and no API client.\n */\nimport type { inferRouterOutputs } from '@trpc/server';\n\nimport type { GatewayRouter } from '../../../../src/adapters/trpc/router.js';\nimport type { CredentialKind } from '../../forms/server-credential';\n\n/** A request as the API shows it. */\nexport type ShownRequest = inferRouterOutputs<GatewayRouter>['requests']['toDecide'][number];\n\n/** The tones a status shows, from the design tokens; a status always has its words too. */\nexport type Tone = 'waiting' | 'active' | 'ok' | 'attention' | 'ended';\n\nexport interface Status {\n readonly tone: Tone;\n readonly label: string;\n}\n\nconst DAY_MS = 86_400_000;\n\n/** How an outside party is named before it has a proxy ship: a client by its name, a server by its host. */\nexport function subjectName(request: ShownRequest): string {\n switch (request.subject.kind) {\n case 'client':\n return request.subject.clientName;\n case 'server':\n return URL.canParse(request.subject.url) ? new URL(request.subject.url).host : request.subject.url;\n }\n}\n\nexport function subjectKind(request: ShownRequest): string {\n switch (request.subject.kind) {\n case 'client':\n return 'MCP client';\n case 'server':\n return 'MCP server';\n }\n}\n\n/** Days left of the 7 a request is kept, counted up, so its last day reads as such, in the attention tone. */\nexport function daysLeft(request: ShownRequest, now: Date): Status {\n const days = Math.ceil((Date.parse(request.expiresAt) - now.getTime()) / DAY_MS);\n return days <= 1 ? { tone: 'attention', label: 'Last day' } : { tone: 'waiting', label: `${String(days)} d left` };\n}\n\n/** A request's state as the console shows a status; one still pending shows its days left. */\nexport function requestStatus(request: ShownRequest, now: Date): Status {\n switch (request.state) {\n case 'pending':\n return daysLeft(request, now);\n case 'approving':\n return { tone: 'active', label: 'Approving' };\n case 'approved':\n return { tone: 'ok', label: 'Approved' };\n case 'denied':\n return { tone: 'ended', label: 'Denied' };\n case 'expired':\n return { tone: 'ended', label: 'Expired' };\n }\n}\n\n/** A proxy ship's name offered from the party's own: lower case letters, digits and dashes. */\nexport function suggestedName(name: string): string {\n return name\n .toLowerCase()\n .replaceAll(/[^a-z0-9]+/g, '-')\n .replaceAll(/^-+|-+$/g, '');\n}\n\n/** The scopes every app ship gets (0046): shown locked on, and always sent. */\nexport const EVERY_APP_SHIP_SCOPES: readonly string[] = ['messages:send', 'messages:receive'];\n\nconst SCOPE_LABELS: Record<string, string> = {\n 'messages:send': 'Send',\n 'messages:receive': 'Receive',\n 'fleet:read': 'Read the fleet',\n};\n\n/** A scope's plain label, shown beside the scope itself. */\nexport function scopeLabel(scope: string): string {\n return SCOPE_LABELS[scope] ?? scope;\n}\n\n/** The server's credential as the decision form takes it. */\nexport interface ServerCredentialInput {\n readonly credentialKind: CredentialKind;\n readonly token: string;\n readonly clientId: string;\n readonly clientSecret: string;\n readonly issuer: string;\n readonly scope: string;\n readonly concurrencyLimit: number;\n}\n\nexport type DecisionInput = { readonly kind: 'deny' } | { readonly kind: 'approve'; readonly name: string; readonly ownerShipId: string; readonly scopes: readonly string[]; readonly server: ServerCredentialInput | undefined };\n"],"names":["$$RSC_SERVER_ACTION_14"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCH2M,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAoC,CAAA,EAAA,EAAA,kBAAb,GAAa,AAAqB,EAAC,MAAxB,uCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,iBDOjc,IAAA,EAAA,EAAA,CAAA,CAAA,OEHA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCmEO,IAAM,EAA2C,CAAC,gBAAiB,mBAAmB,CAEvF,EAAuC,CAC3C,gBAAiB,OACjB,mBAAoB,UACpB,aAAc,gBAChB,EDvEA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAIA,IAAM,EAAQ,2DAEd,SAAS,EAAS,OAAE,CAAK,UAAE,CAAQ,CAAwC,EACzE,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAM,UAAU,oCACd,EAAW,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CAAM,KAAK,WAAW,OAAO,CAAA,CAAA,EAAC,QAAQ,CAAA,CAAA,EAAC,cAAY,KAAW,IAAa,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CAAM,KAAK,WAAW,KAAK,QAAQ,MAAO,EAAO,cAAY,GCiEhI,EDjE2I,ECiEvI,EDhE1B,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,UCgEE,CDhEI,ACgEQ,CAAC,IDhEE,IAClB,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,wDAAgD,IAC/D,EAAW,CAAA,EAAA,EAAA,GAA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AAS,SAbpG,AAAC,CAa6G,GAZ3H,EAAW,EAAS,IAAI,EACxB,OAAW,GACX,EAAgB,UACd,IAAM,EAAU,MAAM,EAAc,CAAE,MAAO,EAAS,UAAW,EAAQ,SAAS,CAAE,MAAO,CAAS,EACpG,CAAI,EAAQ,IAAI,CACd,CADgB,CACT,IAAI,CAAC,CAAA,EAAG,EAAA,CAAoB,CAAC,CAAC,EAAE,IAAI,gBAAgB,CAAE,MAAO,EAAS,QAAS,EAAS,IAAI,AAAC,GAAG,QAAQ,GAAA,CAAI,GAGrH,EAAW,QACX,EAAW,EAAQ,OAAO,EAC5B,EACF,GAEF"}
1
+ {"version":3,"sources":["../../../../../web/features/bridge/state/decision-panel.tsx","../../../../../web/features/bridge/hooks/data%3A8143fd%20%3Ctext/javascript%3E","../../../../../web/features/bridge/ui/decision-form.tsx","../../../../../web/features/bridge/services/requests.ts"],"sourcesContent":["'use client';\n\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport type { OwnerChoices } from '../../forms/ui/owner-field';\nimport { decideRequest } from '../hooks/bridge-actions';\nimport { BRIDGE_SETTINGS_PATH } from '../paths';\nimport type { DecisionInput, ShownRequest } from '../services/requests';\nimport { DecisionForm } from '../ui/decision-form';\n\n/** Decides one request as the signed-in approver, then goes back to Bridge's settings, which say nothing more waits here. */\nexport function DecisionPanel({ fleetId, request, heldScopes, owners }: { fleetId: string; request: ShownRequest; heldScopes: readonly string[]; owners: OwnerChoices }) {\n const router = useRouter();\n const [working, setWorking] = useState<DecisionInput['kind'] | undefined>();\n const [failure, setFailure] = useState<string | undefined>();\n const [, startTransition] = useTransition();\n const decide = (decision: DecisionInput) => {\n setWorking(decision.kind);\n setFailure(undefined);\n startTransition(async () => {\n const outcome = await decideRequest({ fleet: fleetId, requestId: request.requestId, input: decision });\n if (outcome.isOk) {\n router.push(`${BRIDGE_SETTINGS_PATH}?${new URLSearchParams({ fleet: fleetId, decided: decision.kind }).toString()}`);\n return;\n }\n setWorking(undefined);\n setFailure(outcome.message);\n });\n };\n return <DecisionForm request={request} heldScopes={heldScopes} owners={owners} working={working} failure={failure} onDecide={decide} />;\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"40ae33f79052d467a1fba4f152653f3d44ea2f48ab\":{\"name\":\"decideRequest\"}},\"web/features/bridge/hooks/bridge-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_14=/*#__PURE__*/createServerReference(\"40ae33f79052d467a1fba4f152653f3d44ea2f48ab\",callServer,void 0,findSourceMapURL,\"decideRequest\");export{$$RSC_SERVER_ACTION_14 as decideRequest};","'use client';\n\nimport { useState, type SyntheticEvent } from 'react';\n\nimport { CREDENTIAL_KINDS, credentialKindOf } from '../../forms/server-credential';\nimport { OwnerField, type OwnerChoices } from '../../forms/ui/owner-field';\nimport { EVERY_APP_SHIP_SCOPES, scopeLabel, subjectName, suggestedName, type DecisionInput, type ServerCredentialInput, type ShownRequest } from '../services/requests';\nimport { ActionButton } from './action-button';\nimport { Notice } from './notice';\n\nconst CONCURRENCY_LIMIT_DEFAULT = 4;\n\nconst FIELD = 'rounded-md border border-input bg-background px-2 py-1.5';\n\nfunction ScopeRow({ scope, isLocked }: { scope: string; isLocked: boolean }) {\n return (\n <label className=\"flex items-center gap-2\">\n {isLocked ? <input type=\"checkbox\" checked disabled aria-label={scopeLabel(scope)} /> : <input type=\"checkbox\" name=\"scope\" value={scope} aria-label={scopeLabel(scope)} />}\n <span>{scopeLabel(scope)}</span>\n <span className=\"font-mono text-caption text-muted-foreground\">{scope}</span>\n {isLocked ? <span className=\"text-caption text-muted-foreground\">(always)</span> : null}\n </label>\n );\n}\n\nfunction text(form: FormData, name: string): string {\n const value = form.get(name);\n return typeof value === 'string' ? value : '';\n}\n\nfunction serverOf(form: FormData): ServerCredentialInput {\n return {\n credentialKind: credentialKindOf(text(form, 'credentialKind')),\n token: text(form, 'token'),\n clientId: text(form, 'clientId'),\n clientSecret: text(form, 'clientSecret'),\n issuer: text(form, 'issuer'),\n scope: text(form, 'scope-requested'),\n concurrencyLimit: Number(text(form, 'concurrencyLimit')),\n };\n}\n\n/**\n * The decision on a request: approving names the proxy ship and its owner,\n * and offers as scope rows only the scopes the approver holds, messages:send\n * and messages:receive locked on (0046, 0053); a server's credential too.\n * What was typed stays when the API refuses.\n */\nexport function DecisionForm({\n request,\n heldScopes,\n owners,\n working,\n failure,\n onDecide,\n}: {\n request: ShownRequest;\n heldScopes: readonly string[];\n owners: OwnerChoices;\n working: DecisionInput['kind'] | undefined;\n failure: string | undefined;\n onDecide: (decision: DecisionInput) => void;\n}) {\n const [credentialKind, setCredentialKind] = useState<ServerCredentialInput['credentialKind']>('bearer');\n const name = subjectName(request);\n const isServer = request.subject.kind === 'server';\n const approve = (event: SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n const form = new FormData(event.currentTarget);\n const scopes = form.getAll('scope').filter((scope) => typeof scope === 'string');\n onDecide({ kind: 'approve', name: text(form, 'name'), ownerShipId: text(form, 'ownerShipId'), scopes, server: isServer ? serverOf(form) : undefined });\n };\n return (\n <section className=\"grid gap-3 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm\">\n <h2 className=\"text-heading font-semibold\">Approve {name}</h2>\n <form onSubmit={approve} className=\"grid gap-3\">\n <label className=\"grid gap-1\">\n <span>Proxy ship&apos;s name</span>\n <input name=\"name\" defaultValue={suggestedName(name)} required className={FIELD} />\n </label>\n <OwnerField choices={owners.isOk ? owners.value : []} current={null} help=\"A person ship or argo. It answers for this party.\" refusal={owners.isOk ? undefined : owners.refusal} />\n <fieldset className=\"grid gap-1\">\n <legend>Scopes</legend>\n {EVERY_APP_SHIP_SCOPES.map((scope) => (\n <ScopeRow key={scope} scope={scope} isLocked />\n ))}\n {heldScopes\n .filter((scope) => !EVERY_APP_SHIP_SCOPES.includes(scope))\n .map((scope) => (\n <ScopeRow key={scope} scope={scope} isLocked={false} />\n ))}\n </fieldset>\n {isServer ? (\n <fieldset className=\"grid gap-2\">\n <legend>The server&apos;s credential</legend>\n <label className=\"grid gap-1\">\n <span>Credential</span>\n <select name=\"credentialKind\" value={credentialKind} onChange={(event) => { setCredentialKind(credentialKindOf(event.target.value)); }} className={FIELD}>\n {CREDENTIAL_KINDS.map(({ kind, label }) => (\n <option key={kind} value={kind}>\n {label}\n </option>\n ))}\n </select>\n </label>\n {credentialKind === 'none' ? null : credentialKind === 'bearer' ? (\n <label className=\"grid gap-1\">\n <span>Bearer token</span>\n <input type=\"password\" name=\"token\" className={FIELD} />\n </label>\n ) : (\n <>\n <label className=\"grid gap-1\">\n <span>Client id</span>\n <input name=\"clientId\" className={FIELD} />\n </label>\n <label className=\"grid gap-1\">\n <span>Client secret</span>\n <input type=\"password\" name=\"clientSecret\" className={FIELD} />\n </label>\n <label className=\"grid gap-1\">\n <span>Issuer</span>\n <input type=\"url\" name=\"issuer\" className={FIELD} />\n </label>\n <label className=\"grid gap-1\">\n <span>Scope</span>\n <input name=\"scope-requested\" className={FIELD} />\n </label>\n </>\n )}\n <label className=\"grid gap-1\">\n <span>Calls at once</span>\n <input type=\"number\" name=\"concurrencyLimit\" min={1} max={10} defaultValue={CONCURRENCY_LIMIT_DEFAULT} className={FIELD} />\n </label>\n </fieldset>\n ) : null}\n {failure === undefined ? null : <Notice message={failure} isFailure />}\n <div className=\"flex gap-2\">\n <ActionButton type=\"submit\" variant=\"primary\" data-testid=\"bridge-approve\" isPending={working === 'approve'} pendingLabel=\"Approving...\" disabled={working !== undefined}>\n Approve\n </ActionButton>\n <ActionButton type=\"button\" data-testid=\"bridge-deny\" isPending={working === 'deny'} pendingLabel=\"Denying...\" disabled={working !== undefined} onClick={() => { onDecide({ kind: 'deny' }); }}>\n Deny\n </ActionButton>\n </div>\n </form>\n </section>\n );\n}\n","/**\n * How Bridge's settings name and states a request for an outside party (design\n * B, Signal): pure view logic, no React and no API client.\n */\nimport type { inferRouterOutputs } from '@trpc/server';\n\nimport type { GatewayRouter } from '../../../../src/adapters/trpc/router.js';\nimport type { CredentialKind } from '../../forms/server-credential';\n\n/** A request as the API shows it. */\nexport type ShownRequest = inferRouterOutputs<GatewayRouter>['requests']['toDecide'][number];\n\n/** The tones a status shows, from the design tokens; a status always has its words too. */\nexport type Tone = 'waiting' | 'active' | 'ok' | 'attention' | 'ended';\n\nexport interface Status {\n readonly tone: Tone;\n readonly label: string;\n}\n\nconst DAY_MS = 86_400_000;\n\n/** How an outside party is named before it has a proxy ship: a client by its name, a server by its host. */\nexport function subjectName(request: ShownRequest): string {\n switch (request.subject.kind) {\n case 'client':\n return request.subject.clientName;\n case 'server':\n return URL.canParse(request.subject.url) ? new URL(request.subject.url).host : request.subject.url;\n }\n}\n\nexport function subjectKind(request: ShownRequest): string {\n switch (request.subject.kind) {\n case 'client':\n return 'MCP client';\n case 'server':\n return 'MCP server';\n }\n}\n\n/** Days left of the 7 a request is kept, counted up, so its last day reads as such, in the attention tone. */\nexport function daysLeft(request: ShownRequest, now: Date): Status {\n const days = Math.ceil((Date.parse(request.expiresAt) - now.getTime()) / DAY_MS);\n return days <= 1 ? { tone: 'attention', label: 'Last day' } : { tone: 'waiting', label: `${String(days)} d left` };\n}\n\n/** A request's state as the console shows a status; one still pending shows its days left. */\nexport function requestStatus(request: ShownRequest, now: Date): Status {\n switch (request.state) {\n case 'pending':\n return daysLeft(request, now);\n case 'approving':\n return { tone: 'active', label: 'Approving' };\n case 'approved':\n return { tone: 'ok', label: 'Approved' };\n case 'denied':\n return { tone: 'ended', label: 'Denied' };\n case 'expired':\n return { tone: 'ended', label: 'Expired' };\n }\n}\n\n/** A proxy ship's name offered from the party's own: lower case letters, digits and dashes. */\nexport function suggestedName(name: string): string {\n return name\n .toLowerCase()\n .replaceAll(/[^a-z0-9]+/g, '-')\n .replaceAll(/^-+|-+$/g, '');\n}\n\n/** The scopes every app ship gets (0046): shown locked on, and always sent. */\nexport const EVERY_APP_SHIP_SCOPES: readonly string[] = ['messages:send', 'messages:receive'];\n\nconst SCOPE_LABELS: Record<string, string> = {\n 'messages:send': 'Send',\n 'messages:receive': 'Receive',\n 'fleet:read': 'Read the fleet',\n};\n\n/** A scope's plain label, shown beside the scope itself. */\nexport function scopeLabel(scope: string): string {\n return SCOPE_LABELS[scope] ?? scope;\n}\n\n/** The server's credential as the decision form takes it. */\nexport interface ServerCredentialInput {\n readonly credentialKind: CredentialKind;\n readonly token: string;\n readonly clientId: string;\n readonly clientSecret: string;\n readonly issuer: string;\n readonly scope: string;\n readonly concurrencyLimit: number;\n}\n\nexport type DecisionInput = { readonly kind: 'deny' } | { readonly kind: 'approve'; readonly name: string; readonly ownerShipId: string; readonly scopes: readonly string[]; readonly server: ServerCredentialInput | undefined };\n"],"names":["$$RSC_SERVER_ACTION_14"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCH2M,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAoC,CAAA,EAAA,EAAA,kBAAb,GAAa,AAAqB,EAAC,MAAxB,uCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,iBDOjc,IAAA,EAAA,EAAA,CAAA,CAAA,OEHA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCmEO,IAAM,EAA2C,CAAC,gBAAiB,mBAAmB,CAEvF,EAAuC,CAC3C,gBAAiB,OACjB,mBAAoB,UACpB,aAAc,gBAChB,EDvEA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAIA,IAAM,EAAQ,2DAEd,SAAS,EAAS,OAAE,CAAK,UAAE,CAAQ,CAAwC,EACzE,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAM,UAAU,oCACd,EAAW,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CAAM,KAAK,WAAW,OAAO,CAAA,CAAA,EAAC,QAAQ,CAAA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CAAA,EAAA,EAAA,SAAA,AAAS,IAClB,CAAC,EAAS,EAAW,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,IAChC,CAAC,EAAS,EAAW,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,IAChC,EAAG,EAAgB,CAAG,CAAA,EAAA,EAAA,aAAA,AAAa,IAczC,MAAO,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAa,QAAS,EAAS,WAAY,EAAY,OAAQ,EAAQ,QAAS,EAAS,QAAS,EAAS,SAbpG,AAAC,CAa6G,GAZ3H,EAAW,EAAS,IAAI,EACxB,OAAW,GACX,EAAgB,UACd,IAAM,EAAU,MAAM,EAAc,CAAE,MAAO,EAAS,UAAW,EAAQ,SAAS,CAAE,MAAO,CAAS,EACpG,CAAI,EAAQ,IAAI,CACd,CADgB,CACT,IAAI,CAAC,CAAA,EAAG,EAAA,CAAoB,CAAC,CAAC,EAAE,IAAI,gBAAgB,CAAE,MAAO,EAAS,QAAS,EAAS,IAAI,AAAC,GAAG,QAAQ,GAAA,CAAI,GAGrH,EAAW,QACX,EAAW,EAAQ,OAAO,EAC5B,EACF,GAEF"}
@@ -1,3 +1,3 @@
1
- module.exports=[16563,a=>{"use strict";var b=a.i(87924),c=a.i(97024),d=a.i(73370),e=a.i(72131),f=a.i(5050);let g=(0,f.createServerReference)("60ce27d809d94e7753d994a2637442403a3a82dac6",f.callServer,void 0,f.findSourceMapURL,"readMoreRecord");var h=a.i(12110),i=a.i(32043),j=a.i(99838),k=a.i(11725),l=a.i(42369);function m({question:a,answered:c}){return(0,b.jsx)("ul",{className:"grid gap-2","aria-label":"Options",children:a.options.map(d=>{let e=d.key===c;return(0,b.jsxs)("li",{"data-answered":e,className:`flex items-start gap-3 rounded-md border p-3 ${e?"border-ring ring-1 ring-ring":"border-border text-muted-foreground"}`,children:[(0,b.jsx)("span",{"data-testid":"bridge-done-radio","data-filled":e,"aria-hidden":"true",className:`mt-1 grid size-4 shrink-0 place-items-center rounded-full border ${e?"border-primary":"border-border"}`,children:e?(0,b.jsx)("span",{className:"size-2 rounded-full bg-primary"}):null}),(0,b.jsxs)("span",{className:"grid flex-1 gap-0.5",children:[(0,b.jsxs)("span",{className:"font-medium",children:[d.key,". ",d.label]}),""===d.detail?null:(0,b.jsx)("span",{className:"text-caption text-muted-foreground max-md:hidden",children:d.detail})]}),d.key===a.pick.option?(0,b.jsx)("span",{className:"rounded-sm border border-border px-1.5 text-caption",children:"Their pick"}):null]},d.key)})})}function n({ended:a}){let e=a.isOk?c.f:d.f;return(0,b.jsxs)("div",{"data-testid":"bridge-done-ended",role:"status",className:`flex items-start gap-3 rounded-md border p-3 ${a.isOk?"border-tone-ok-border bg-tone-ok-bg":"border-tone-ended-border bg-tone-ended-bg"}`,children:[(0,b.jsx)(e,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 ${a.isOk?"text-tone-ok-fg":"text-tone-ended-fg"}`}),(0,b.jsxs)("span",{className:"grid gap-0.5",children:[(0,b.jsx)("span",{className:"font-medium",children:a.text}),void 0===a.sent?null:(0,b.jsx)("span",{className:"text-caption text-muted-foreground",children:a.sent})]})]})}function o({item:a,timeZone:c}){return(0,b.jsx)("ol",{"data-testid":"bridge-done-history",className:"grid gap-1.5 text-caption max-md:hidden",children:(0,h.L)(a,c).map(a=>(0,b.jsxs)("li",{className:"grid grid-cols-[3rem_0.5rem_minmax(0,1fr)] items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground tabular-nums",children:a.at}),(0,b.jsx)("i",{"aria-hidden":"true",className:`size-1.5 rounded-full ${a.isEnd?"bg-tone-ok-fg":"bg-border"}`}),(0,b.jsxs)("span",{children:[a.text,void 0===a.detail?null:(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" · ",a.detail]})]})]},`${a.at} ${a.text}`))})}function p({item:a,timeZone:c,bridgeHost:d,onBack:e}){let f=(0,j.N)(a),g=(0,j.R)(a,d),i=(0,h.d)(a,c),q={job:a.job,isAlert:a.isAlert,wasNew:!1};return(0,b.jsxs)("section",{"data-testid":"bridge-done-item",className:"grid min-w-0 content-start gap-3 text-card-foreground md:p-5",children:[(0,b.jsx)(k.g,{opened:q,title:(0,h.c)(a),isWorking:!1,onBack:e}),(0,b.jsx)(k.$,{delivery:a,opened:q,timeZone:c}),(0,b.jsx)("h2",{className:"text-heading font-semibold",children:f?.title??a.title}),void 0!==g?(0,b.jsx)(k.l,{step:g,isStale:!1,isFinished:!0}):void 0===f?(0,b.jsx)(l.f,{text:(0,j.Y)(a)}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:k.R,children:(0,b.jsx)(l.f,{text:f.context})}),(0,b.jsx)(m,{question:f,answered:a.outcome?.option??null})]}),void 0===i?null:(0,b.jsx)(n,{ended:i}),(0,b.jsx)(o,{item:a,timeZone:c})]})}var q=a.i(52560),r=a.i(74352),s=a.i(10039);function t(){return()=>void 0}function u(a){return a.outcome?.at??a.sentAt}function v({item:a}){let e=(0,h.o)(a),f=e.isOk?c.f:d.f;return(0,b.jsxs)("span",{"data-testid":"bridge-done-outcome",className:"flex items-start gap-1.5 text-caption",children:[(0,b.jsx)(f,{"aria-hidden":"true",className:`mt-0.5 size-3.5 shrink-0 ${e.isOk?"text-tone-ok-fg":"text-muted-foreground"}`}),e.text]})}a.s(["DonePanel",0,function({fleetId:a,first:c,now:d}){let f=new Date(d),j=(0,e.useSyncExternalStore)(t,()=>Intl.DateTimeFormat().resolvedOptions().timeZone,()=>"UTC"),[k,l]=(0,e.useState)(c.items),[m,n]=(0,e.useState)(c.nextCursor),[o,w]=(0,e.useState)(),[x,y]=(0,e.useState)(),[z,A]=(0,e.useTransition)(),B=k.find(({deliveryId:a})=>a===x);return(0,b.jsx)(r.f,{list:(0,b.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-done-heading",children:[(0,b.jsxs)("div",{className:void 0===B?"":"md:px-3 md:pt-3",children:[(0,b.jsx)("h1",{id:"bridge-done-heading",className:"text-heading font-semibold",children:"Done"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"Everything that reached you, with what came of it and where. Opening one reads it back whole."})]}),0===k.length?(0,b.jsx)("p",{"data-testid":"bridge-record-empty",className:"rounded-md border border-border bg-card p-3 text-muted-foreground",children:"Nothing is done yet."}):(function(a,b){let c=[];for(let d of a){let a=(0,h.Y)(u(d),b),e=c.at(-1);e?.day===a?e.items.push(d):c.push({day:a,items:[d]})}return c})(k,{now:f,timeZone:j}).map(({day:a,items:c})=>(0,b.jsxs)("div",{className:"grid gap-1.5",children:[(0,b.jsx)("h2",{className:`text-caption text-muted-foreground ${void 0===B?"":"md:px-3"}`,children:a}),(0,b.jsx)("ul",{className:"overflow-hidden rounded-lg border border-border bg-card",children:c.map(a=>(0,b.jsx)(q.f,{item:a,now:f,isNew:!1,isOpen:a.deliveryId===x,outcome:void 0,failure:void 0,time:{at:u(a),said:(0,h.Z)(u(a),j)},detail:(0,b.jsx)(v,{item:a}),onOpen:()=>{y(a.deliveryId)}},a.deliveryId))})]},a)),void 0===o?null:(0,b.jsx)(s.f,{message:o,isFailure:!0}),null===m?null:(0,b.jsx)(i.i,{"data-testid":"bridge-more",className:"justify-self-start",isPending:z,pendingLabel:"Reading...",onClick:()=>{w(void 0),A(async()=>{let b=await g(a,m);b.isOk?(l(a=>[...a,...b.value.items]),n(b.value.nextCursor)):w(b.message)})},children:"Show older"})]}),item:void 0===B?void 0:(0,b.jsx)(p,{item:B,timeZone:j,bridgeHost:window.location.host,onBack:()=>{y(void 0)}})})}],16563)}];
1
+ module.exports=[16563,a=>{"use strict";var b=a.i(87924),c=a.i(97024),d=a.i(73370),e=a.i(72131),f=a.i(5050);let g=(0,f.createServerReference)("606cb6a4b44b6d1f3ee3cb4926fd252ef8c38e6829",f.callServer,void 0,f.findSourceMapURL,"readMoreRecord");var h=a.i(12110),i=a.i(32043),j=a.i(99838),k=a.i(11725),l=a.i(42369);function m({question:a,answered:c}){return(0,b.jsx)("ul",{className:"grid gap-2","aria-label":"Options",children:a.options.map(d=>{let e=d.key===c;return(0,b.jsxs)("li",{"data-answered":e,className:`flex items-start gap-3 rounded-md border p-3 ${e?"border-ring ring-1 ring-ring":"border-border text-muted-foreground"}`,children:[(0,b.jsx)("span",{"data-testid":"bridge-done-radio","data-filled":e,"aria-hidden":"true",className:`mt-1 grid size-4 shrink-0 place-items-center rounded-full border ${e?"border-primary":"border-border"}`,children:e?(0,b.jsx)("span",{className:"size-2 rounded-full bg-primary"}):null}),(0,b.jsxs)("span",{className:"grid flex-1 gap-0.5",children:[(0,b.jsxs)("span",{className:"font-medium",children:[d.key,". ",d.label]}),""===d.detail?null:(0,b.jsx)("span",{className:"text-caption text-muted-foreground max-md:hidden",children:d.detail})]}),d.key===a.pick.option?(0,b.jsx)("span",{className:"rounded-sm border border-border px-1.5 text-caption",children:"Their pick"}):null]},d.key)})})}function n({ended:a}){let e=a.isOk?c.f:d.f;return(0,b.jsxs)("div",{"data-testid":"bridge-done-ended",role:"status",className:`flex items-start gap-3 rounded-md border p-3 ${a.isOk?"border-tone-ok-border bg-tone-ok-bg":"border-tone-ended-border bg-tone-ended-bg"}`,children:[(0,b.jsx)(e,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 ${a.isOk?"text-tone-ok-fg":"text-tone-ended-fg"}`}),(0,b.jsxs)("span",{className:"grid gap-0.5",children:[(0,b.jsx)("span",{className:"font-medium",children:a.text}),void 0===a.sent?null:(0,b.jsx)("span",{className:"text-caption text-muted-foreground",children:a.sent})]})]})}function o({item:a,timeZone:c}){return(0,b.jsx)("ol",{"data-testid":"bridge-done-history",className:"grid gap-1.5 text-caption max-md:hidden",children:(0,h.L)(a,c).map(a=>(0,b.jsxs)("li",{className:"grid grid-cols-[3rem_0.5rem_minmax(0,1fr)] items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground tabular-nums",children:a.at}),(0,b.jsx)("i",{"aria-hidden":"true",className:`size-1.5 rounded-full ${a.isEnd?"bg-tone-ok-fg":"bg-border"}`}),(0,b.jsxs)("span",{children:[a.text,void 0===a.detail?null:(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" · ",a.detail]})]})]},`${a.at} ${a.text}`))})}function p({item:a,timeZone:c,bridgeHost:d,onBack:e}){let f=(0,j.N)(a),g=(0,j.R)(a,d),i=(0,h.d)(a,c),q={job:a.job,isAlert:a.isAlert,wasNew:!1};return(0,b.jsxs)("section",{"data-testid":"bridge-done-item",className:"grid min-w-0 content-start gap-3 text-card-foreground md:p-5",children:[(0,b.jsx)(k.g,{opened:q,title:(0,h.c)(a),isWorking:!1,onBack:e}),(0,b.jsx)(k.$,{delivery:a,opened:q,timeZone:c}),(0,b.jsx)("h2",{className:"text-heading font-semibold",children:f?.title??a.title}),void 0!==g?(0,b.jsx)(k.l,{step:g,isStale:!1,isFinished:!0}):void 0===f?(0,b.jsx)(l.f,{text:(0,j.Y)(a)}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:k.R,children:(0,b.jsx)(l.f,{text:f.context})}),(0,b.jsx)(m,{question:f,answered:a.outcome?.option??null})]}),void 0===i?null:(0,b.jsx)(n,{ended:i}),(0,b.jsx)(o,{item:a,timeZone:c})]})}var q=a.i(52560),r=a.i(74352),s=a.i(10039);function t(){return()=>void 0}function u(a){return a.outcome?.at??a.sentAt}function v({item:a}){let e=(0,h.o)(a),f=e.isOk?c.f:d.f;return(0,b.jsxs)("span",{"data-testid":"bridge-done-outcome",className:"flex items-start gap-1.5 text-caption",children:[(0,b.jsx)(f,{"aria-hidden":"true",className:`mt-0.5 size-3.5 shrink-0 ${e.isOk?"text-tone-ok-fg":"text-muted-foreground"}`}),e.text]})}a.s(["DonePanel",0,function({fleetId:a,first:c,now:d}){let f=new Date(d),j=(0,e.useSyncExternalStore)(t,()=>Intl.DateTimeFormat().resolvedOptions().timeZone,()=>"UTC"),[k,l]=(0,e.useState)(c.items),[m,n]=(0,e.useState)(c.nextCursor),[o,w]=(0,e.useState)(),[x,y]=(0,e.useState)(),[z,A]=(0,e.useTransition)(),B=k.find(({deliveryId:a})=>a===x);return(0,b.jsx)(r.f,{list:(0,b.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-done-heading",children:[(0,b.jsxs)("div",{className:void 0===B?"":"md:px-3 md:pt-3",children:[(0,b.jsx)("h1",{id:"bridge-done-heading",className:"text-heading font-semibold",children:"Done"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"Everything that reached you, with what came of it and where. Opening one reads it back whole."})]}),0===k.length?(0,b.jsx)("p",{"data-testid":"bridge-record-empty",className:"rounded-md border border-border bg-card p-3 text-muted-foreground",children:"Nothing is done yet."}):(function(a,b){let c=[];for(let d of a){let a=(0,h.Y)(u(d),b),e=c.at(-1);e?.day===a?e.items.push(d):c.push({day:a,items:[d]})}return c})(k,{now:f,timeZone:j}).map(({day:a,items:c})=>(0,b.jsxs)("div",{className:"grid gap-1.5",children:[(0,b.jsx)("h2",{className:`text-caption text-muted-foreground ${void 0===B?"":"md:px-3"}`,children:a}),(0,b.jsx)("ul",{className:"overflow-hidden rounded-lg border border-border bg-card",children:c.map(a=>(0,b.jsx)(q.f,{item:a,now:f,isNew:!1,isOpen:a.deliveryId===x,outcome:void 0,failure:void 0,time:{at:u(a),said:(0,h.Z)(u(a),j)},detail:(0,b.jsx)(v,{item:a}),onOpen:()=>{y(a.deliveryId)}},a.deliveryId))})]},a)),void 0===o?null:(0,b.jsx)(s.f,{message:o,isFailure:!0}),null===m?null:(0,b.jsx)(i.i,{"data-testid":"bridge-more",className:"justify-self-start",isPending:z,pendingLabel:"Reading...",onClick:()=>{w(void 0),A(async()=>{let b=await g(a,m);b.isOk?(l(a=>[...a,...b.value.items]),n(b.value.nextCursor)):w(b.message)})},children:"Show older"})]}),item:void 0===B?void 0:(0,b.jsx)(p,{item:B,timeZone:j,bridgeHost:window.location.host,onBack:()=>{y(void 0)}})})}],16563)}];
2
2
 
3
3
  //# sourceMappingURL=web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../web/features/bridge/state/done-panel.tsx","../../../../../web/features/bridge/hooks/data%3Af716aa%20%3Ctext/javascript%3E","../../../../../web/features/bridge/ui/done-card.tsx"],"sourcesContent":["'use client';\n\nimport { CircleCheck, CircleX } from 'lucide-react';\nimport { useState, useSyncExternalStore, useTransition } from 'react';\n\nimport { readMoreRecord } from '../hooks/bridge-actions';\nimport { clockTimeOf, dayOf, doneOutcomeOf, type RecordItem, type RecordPage } from '../services/items';\nimport { ActionButton } from '../ui/action-button';\nimport { DoneCard } from '../ui/done-card';\nimport { ItemRow } from '../ui/item-row';\nimport { ItemSplit } from '../ui/item-split';\nimport { Notice } from '../ui/notice';\n\n/** The time zone a page is read in on the server, before the browser says its own. */\nconst SERVER_TIME_ZONE = 'UTC';\n\nfunction unchanging(): () => void {\n return () => undefined;\n}\n\n/** The person's own time zone, the browser's; the server's until the page runs there, so the first render matches it. */\nfunction useTimeZone(): string {\n return useSyncExternalStore(unchanging, () => Intl.DateTimeFormat().resolvedOptions().timeZone, () => SERVER_TIME_ZONE);\n}\n\n/** When an item was done: when what came of it was kept, or when it arrived for one the fleet ended with none kept. */\nfunction doneAtOf(item: RecordItem): string {\n return item.outcome?.at ?? item.sentAt;\n}\n\n/** The items in their order, a run per day they were done on. */\nfunction byDay(items: readonly RecordItem[], of: { now: Date; timeZone: string }): { day: string; items: RecordItem[] }[] {\n const days: { day: string; items: RecordItem[] }[] = [];\n for (const item of items) {\n const day = dayOf(doneAtOf(item), of);\n const last = days.at(-1);\n if (last?.day === day) {\n last.items.push(item);\n } else {\n days.push({ day, items: [item] });\n }\n }\n return days;\n}\n\n/** What came of an item on its row, on a line of its own, its icon saying whether it ended well (done.html). */\nfunction DoneOutcome({ item }: { item: RecordItem }) {\n const outcome = doneOutcomeOf(item);\n const Icon = outcome.isOk ? CircleCheck : CircleX;\n return (\n <span data-testid=\"bridge-done-outcome\" className=\"flex items-start gap-1.5 text-caption\">\n <Icon aria-hidden=\"true\" className={`mt-0.5 size-3.5 shrink-0 ${outcome.isOk ? 'text-tone-ok-fg' : 'text-muted-foreground'}`} />\n {outcome.text}\n </span>\n );\n}\n\n/**\n * Done (Bridge, CC4; done.html): everything done that reached the person,\n * newest first, under the day it was done, each with the time of day, the\n * places that showed it and what came of it and where. Its title opens it,\n * read back whole beside the list, with nothing acknowledged. The next page\n * is read only when they ask for it.\n */\nexport function DonePanel({ fleetId, first, now }: { fleetId: string; first: RecordPage; now: string }) {\n const readAt = new Date(now);\n const timeZone = useTimeZone();\n const [items, setItems] = useState(first.items);\n const [nextCursor, setNextCursor] = useState(first.nextCursor);\n const [failure, setFailure] = useState<string | undefined>();\n const [openId, setOpenId] = useState<string | undefined>();\n const [isReading, startTransition] = useTransition();\n\n const readMore = (cursor: string) => {\n setFailure(undefined);\n startTransition(async () => {\n const more = await readMoreRecord(fleetId, cursor);\n if (more.isOk) {\n setItems((shown) => [...shown, ...more.value.items]);\n setNextCursor(more.value.nextCursor);\n } else {\n setFailure(more.message);\n }\n });\n };\n\n const open = items.find(({ deliveryId }) => deliveryId === openId);\n return (\n <ItemSplit\n list={\n <section className=\"grid gap-3\" aria-labelledby=\"bridge-done-heading\">\n <div className={open === undefined ? '' : 'md:px-3 md:pt-3'}>\n <h1 id=\"bridge-done-heading\" className=\"text-heading font-semibold\">\n Done\n </h1>\n <p className=\"text-muted-foreground\">Everything that reached you, with what came of it and where. Opening one reads it back whole.</p>\n </div>\n {items.length === 0 ? (\n <p data-testid=\"bridge-record-empty\" className=\"rounded-md border border-border bg-card p-3 text-muted-foreground\">\n Nothing is done yet.\n </p>\n ) : (\n byDay(items, { now: readAt, timeZone }).map(({ day, items: ofDay }) => (\n <div key={day} className=\"grid gap-1.5\">\n <h2 className={`text-caption text-muted-foreground ${open === undefined ? '' : 'md:px-3'}`}>{day}</h2>\n <ul className=\"overflow-hidden rounded-lg border border-border bg-card\">\n {ofDay.map((item) => (\n <ItemRow\n key={item.deliveryId}\n item={item}\n now={readAt}\n isNew={false}\n isOpen={item.deliveryId === openId}\n outcome={undefined}\n failure={undefined}\n time={{ at: doneAtOf(item), said: clockTimeOf(doneAtOf(item), timeZone) }}\n detail={<DoneOutcome item={item} />}\n onOpen={() => { setOpenId(item.deliveryId); }}\n />\n ))}\n </ul>\n </div>\n ))\n )}\n {failure === undefined ? null : <Notice message={failure} isFailure />}\n {nextCursor === null ? null : (\n <ActionButton data-testid=\"bridge-more\" className=\"justify-self-start\" isPending={isReading} pendingLabel=\"Reading...\" onClick={() => { readMore(nextCursor); }}>\n Show older\n </ActionButton>\n )}\n </section>\n }\n item={open === undefined ? undefined : <DoneCard item={open} timeZone={timeZone} bridgeHost={window.location.host} onBack={() => { setOpenId(undefined); }} />}\n />\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"60ce27d809d94e7753d994a2637442403a3a82dac6\":{\"name\":\"readMoreRecord\"}},\"web/features/bridge/hooks/bridge-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"60ce27d809d94e7753d994a2637442403a3a82dac6\",callServer,void 0,findSourceMapURL,\"readMoreRecord\");export{$$RSC_SERVER_ACTION_0 as readMoreRecord};","import { CircleCheck, CircleX } from 'lucide-react';\n\nimport type { Question } from '@aeolus-fleet/common';\n\nimport { bodyOf, questionOf, stepOf } from '../services/deliveries';\nimport { endedOf, endedTitleOf, historyOf, type RecordItem } from '../services/items';\nimport { ItemHeading, PROSE, ScreenBar, StepAsked } from './delivery-card';\nimport { Markdown } from './markdown';\n\n/** A done question's options as they stood: each with its radio, filled on the one answered, framed by the ring; the asker's pick named; none to choose. */\nfunction AnsweredOptions({ question, answered }: { question: Question; answered: number | null }) {\n return (\n <ul className=\"grid gap-2\" aria-label=\"Options\">\n {question.options.map((option) => {\n const isAnswered = option.key === answered;\n return (\n <li key={option.key} data-answered={isAnswered} className={`flex items-start gap-3 rounded-md border p-3 ${isAnswered ? 'border-ring ring-1 ring-ring' : 'border-border text-muted-foreground'}`}>\n <span data-testid=\"bridge-done-radio\" data-filled={isAnswered} aria-hidden=\"true\" className={`mt-1 grid size-4 shrink-0 place-items-center rounded-full border ${isAnswered ? 'border-primary' : 'border-border'}`}>\n {isAnswered ? <span className=\"size-2 rounded-full bg-primary\" /> : null}\n </span>\n <span className=\"grid flex-1 gap-0.5\">\n <span className=\"font-medium\">\n {option.key}. {option.label}\n </span>\n {option.detail === '' ? null : <span className=\"text-caption text-muted-foreground max-md:hidden\">{option.detail}</span>}\n </span>\n {option.key === question.pick.option ? <span className=\"rounded-sm border border-border px-1.5 text-caption\">Their pick</span> : null}\n </li>\n );\n })}\n </ul>\n );\n}\n\n/** What came of it, where and when, in the ok tone when it ended well and the ended tone otherwise, and what was sent as the person (decide.html, do.html). */\nfunction EndedNotice({ ended }: { ended: NonNullable<ReturnType<typeof endedOf>> }) {\n const Icon = ended.isOk ? CircleCheck : CircleX;\n return (\n <div data-testid=\"bridge-done-ended\" role=\"status\" className={`flex items-start gap-3 rounded-md border p-3 ${ended.isOk ? 'border-tone-ok-border bg-tone-ok-bg' : 'border-tone-ended-border bg-tone-ended-bg'}`}>\n <Icon aria-hidden className={`mt-0.5 size-4 shrink-0 ${ended.isOk ? 'text-tone-ok-fg' : 'text-tone-ended-fg'}`} />\n <span className=\"grid gap-0.5\">\n <span className=\"font-medium\">{ended.text}</span>\n {ended.sent === undefined ? null : <span className=\"text-caption text-muted-foreground\">{ended.sent}</span>}\n </span>\n </div>\n );\n}\n\n/** Its history, a line per moment: when it arrived and where it showed, where it was seen, and what came of it (decide.html). */\nfunction History({ item, timeZone }: { item: RecordItem; timeZone: string | undefined }) {\n return (\n <ol data-testid=\"bridge-done-history\" className=\"grid gap-1.5 text-caption max-md:hidden\">\n {historyOf(item, timeZone).map((line) => (\n <li key={`${line.at} ${line.text}`} className=\"grid grid-cols-[3rem_0.5rem_minmax(0,1fr)] items-center gap-2\">\n <span className=\"text-muted-foreground tabular-nums\">{line.at}</span>\n <i aria-hidden=\"true\" className={`size-1.5 rounded-full ${line.isEnd ? 'bg-tone-ok-fg' : 'bg-border'}`} />\n <span>\n {line.text}\n {line.detail === undefined ? null : <span className=\"text-muted-foreground\"> · {line.detail}</span>}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n\n/**\n * A done item opened from Done (decide.html, answered in Slack): read back\n * whole from the record, nothing acknowledged and nothing to send. A\n * question shows its options with the one answered marked, a step why and\n * where it was done, anything else what it says; then what came of it and\n * its history. A phone shows it on its own screen, titled by what came of\n * it, without its history, as drawn.\n */\nexport function DoneCard({ item, timeZone, bridgeHost, onBack }: { item: RecordItem; timeZone: string | undefined; bridgeHost: string; onBack: () => void }) {\n const question = questionOf(item);\n const step = stepOf(item, bridgeHost);\n const ended = endedOf(item, timeZone);\n const opened = { job: item.job, isAlert: item.isAlert, wasNew: false };\n return (\n <section data-testid=\"bridge-done-item\" className=\"grid min-w-0 content-start gap-3 text-card-foreground md:p-5\">\n <ScreenBar opened={opened} title={endedTitleOf(item)} isWorking={false} onBack={onBack} />\n <ItemHeading delivery={item} opened={opened} timeZone={timeZone} />\n <h2 className=\"text-heading font-semibold\">{question?.title ?? item.title}</h2>\n {step !== undefined ? (\n <StepAsked step={step} isStale={false} isFinished />\n ) : question === undefined ? (\n <Markdown text={bodyOf(item)} />\n ) : (\n <>\n <div className={PROSE}>\n <Markdown text={question.context} />\n </div>\n <AnsweredOptions question={question} answered={item.outcome?.option ?? null} />\n </>\n )}\n {ended === undefined ? null : <EndedNotice ended={ended} />}\n <History item={item} timeZone={timeZone} />\n </section>\n );\n}\n"],"names":["$$RSC_SERVER_ACTION_0"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCH4M,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAA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/bridge/hooks/data%3A1f43a7%20%3Ctext/javascript%3E","../../../../../web/features/bridge/ui/done-card.tsx"],"sourcesContent":["'use client';\n\nimport { CircleCheck, CircleX } from 'lucide-react';\nimport { useState, useSyncExternalStore, useTransition } from 'react';\n\nimport { readMoreRecord } from '../hooks/bridge-actions';\nimport { clockTimeOf, dayOf, doneOutcomeOf, type RecordItem, type RecordPage } from '../services/items';\nimport { ActionButton } from '../ui/action-button';\nimport { DoneCard } from '../ui/done-card';\nimport { ItemRow } from '../ui/item-row';\nimport { ItemSplit } from '../ui/item-split';\nimport { Notice } from '../ui/notice';\n\n/** The time zone a page is read in on the server, before the browser says its own. */\nconst SERVER_TIME_ZONE = 'UTC';\n\nfunction unchanging(): () => void {\n return () => undefined;\n}\n\n/** The person's own time zone, the browser's; the server's until the page runs there, so the first render matches it. */\nfunction useTimeZone(): string {\n return useSyncExternalStore(unchanging, () => Intl.DateTimeFormat().resolvedOptions().timeZone, () => SERVER_TIME_ZONE);\n}\n\n/** When an item was done: when what came of it was kept, or when it arrived for one the fleet ended with none kept. */\nfunction doneAtOf(item: RecordItem): string {\n return item.outcome?.at ?? item.sentAt;\n}\n\n/** The items in their order, a run per day they were done on. */\nfunction byDay(items: readonly RecordItem[], of: { now: Date; timeZone: string }): { day: string; items: RecordItem[] }[] {\n const days: { day: string; items: RecordItem[] }[] = [];\n for (const item of items) {\n const day = dayOf(doneAtOf(item), of);\n const last = days.at(-1);\n if (last?.day === day) {\n last.items.push(item);\n } else {\n days.push({ day, items: [item] });\n }\n }\n return days;\n}\n\n/** What came of an item on its row, on a line of its own, its icon saying whether it ended well (done.html). */\nfunction DoneOutcome({ item }: { item: RecordItem }) {\n const outcome = doneOutcomeOf(item);\n const Icon = outcome.isOk ? CircleCheck : CircleX;\n return (\n <span data-testid=\"bridge-done-outcome\" className=\"flex items-start gap-1.5 text-caption\">\n <Icon aria-hidden=\"true\" className={`mt-0.5 size-3.5 shrink-0 ${outcome.isOk ? 'text-tone-ok-fg' : 'text-muted-foreground'}`} />\n {outcome.text}\n </span>\n );\n}\n\n/**\n * Done (Bridge, CC4; done.html): everything done that reached the person,\n * newest first, under the day it was done, each with the time of day, the\n * places that showed it and what came of it and where. Its title opens it,\n * read back whole beside the list, with nothing acknowledged. The next page\n * is read only when they ask for it.\n */\nexport function DonePanel({ fleetId, first, now }: { fleetId: string; first: RecordPage; now: string }) {\n const readAt = new Date(now);\n const timeZone = useTimeZone();\n const [items, setItems] = useState(first.items);\n const [nextCursor, setNextCursor] = useState(first.nextCursor);\n const [failure, setFailure] = useState<string | undefined>();\n const [openId, setOpenId] = useState<string | undefined>();\n const [isReading, startTransition] = useTransition();\n\n const readMore = (cursor: string) => {\n setFailure(undefined);\n startTransition(async () => {\n const more = await readMoreRecord(fleetId, cursor);\n if (more.isOk) {\n setItems((shown) => [...shown, ...more.value.items]);\n setNextCursor(more.value.nextCursor);\n } else {\n setFailure(more.message);\n }\n });\n };\n\n const open = items.find(({ deliveryId }) => deliveryId === openId);\n return (\n <ItemSplit\n list={\n <section className=\"grid gap-3\" aria-labelledby=\"bridge-done-heading\">\n <div className={open === undefined ? '' : 'md:px-3 md:pt-3'}>\n <h1 id=\"bridge-done-heading\" className=\"text-heading font-semibold\">\n Done\n </h1>\n <p className=\"text-muted-foreground\">Everything that reached you, with what came of it and where. Opening one reads it back whole.</p>\n </div>\n {items.length === 0 ? (\n <p data-testid=\"bridge-record-empty\" className=\"rounded-md border border-border bg-card p-3 text-muted-foreground\">\n Nothing is done yet.\n </p>\n ) : (\n byDay(items, { now: readAt, timeZone }).map(({ day, items: ofDay }) => (\n <div key={day} className=\"grid gap-1.5\">\n <h2 className={`text-caption text-muted-foreground ${open === undefined ? '' : 'md:px-3'}`}>{day}</h2>\n <ul className=\"overflow-hidden rounded-lg border border-border bg-card\">\n {ofDay.map((item) => (\n <ItemRow\n key={item.deliveryId}\n item={item}\n now={readAt}\n isNew={false}\n isOpen={item.deliveryId === openId}\n outcome={undefined}\n failure={undefined}\n time={{ at: doneAtOf(item), said: clockTimeOf(doneAtOf(item), timeZone) }}\n detail={<DoneOutcome item={item} />}\n onOpen={() => { setOpenId(item.deliveryId); }}\n />\n ))}\n </ul>\n </div>\n ))\n )}\n {failure === undefined ? null : <Notice message={failure} isFailure />}\n {nextCursor === null ? null : (\n <ActionButton data-testid=\"bridge-more\" className=\"justify-self-start\" isPending={isReading} pendingLabel=\"Reading...\" onClick={() => { readMore(nextCursor); }}>\n Show older\n </ActionButton>\n )}\n </section>\n }\n item={open === undefined ? undefined : <DoneCard item={open} timeZone={timeZone} bridgeHost={window.location.host} onBack={() => { setOpenId(undefined); }} />}\n />\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"606cb6a4b44b6d1f3ee3cb4926fd252ef8c38e6829\":{\"name\":\"readMoreRecord\"}},\"web/features/bridge/hooks/bridge-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"606cb6a4b44b6d1f3ee3cb4926fd252ef8c38e6829\",callServer,void 0,findSourceMapURL,\"readMoreRecord\");export{$$RSC_SERVER_ACTION_0 as readMoreRecord};","import { CircleCheck, CircleX } from 'lucide-react';\n\nimport type { Question } from '@aeolus-fleet/common';\n\nimport { bodyOf, questionOf, stepOf } from '../services/deliveries';\nimport { endedOf, endedTitleOf, historyOf, type RecordItem } from '../services/items';\nimport { ItemHeading, PROSE, ScreenBar, StepAsked } from './delivery-card';\nimport { Markdown } from './markdown';\n\n/** A done question's options as they stood: each with its radio, filled on the one answered, framed by the ring; the asker's pick named; none to choose. */\nfunction AnsweredOptions({ question, answered }: { question: Question; answered: number | null }) {\n return (\n <ul className=\"grid gap-2\" aria-label=\"Options\">\n {question.options.map((option) => {\n const isAnswered = option.key === answered;\n return (\n <li key={option.key} data-answered={isAnswered} className={`flex items-start gap-3 rounded-md border p-3 ${isAnswered ? 'border-ring ring-1 ring-ring' : 'border-border text-muted-foreground'}`}>\n <span data-testid=\"bridge-done-radio\" data-filled={isAnswered} aria-hidden=\"true\" className={`mt-1 grid size-4 shrink-0 place-items-center rounded-full border ${isAnswered ? 'border-primary' : 'border-border'}`}>\n {isAnswered ? <span className=\"size-2 rounded-full bg-primary\" /> : null}\n </span>\n <span className=\"grid flex-1 gap-0.5\">\n <span className=\"font-medium\">\n {option.key}. {option.label}\n </span>\n {option.detail === '' ? null : <span className=\"text-caption text-muted-foreground max-md:hidden\">{option.detail}</span>}\n </span>\n {option.key === question.pick.option ? <span className=\"rounded-sm border border-border px-1.5 text-caption\">Their pick</span> : null}\n </li>\n );\n })}\n </ul>\n );\n}\n\n/** What came of it, where and when, in the ok tone when it ended well and the ended tone otherwise, and what was sent as the person (decide.html, do.html). */\nfunction EndedNotice({ ended }: { ended: NonNullable<ReturnType<typeof endedOf>> }) {\n const Icon = ended.isOk ? CircleCheck : CircleX;\n return (\n <div data-testid=\"bridge-done-ended\" role=\"status\" className={`flex items-start gap-3 rounded-md border p-3 ${ended.isOk ? 'border-tone-ok-border bg-tone-ok-bg' : 'border-tone-ended-border bg-tone-ended-bg'}`}>\n <Icon aria-hidden className={`mt-0.5 size-4 shrink-0 ${ended.isOk ? 'text-tone-ok-fg' : 'text-tone-ended-fg'}`} />\n <span className=\"grid gap-0.5\">\n <span className=\"font-medium\">{ended.text}</span>\n {ended.sent === undefined ? null : <span className=\"text-caption text-muted-foreground\">{ended.sent}</span>}\n </span>\n </div>\n );\n}\n\n/** Its history, a line per moment: when it arrived and where it showed, where it was seen, and what came of it (decide.html). */\nfunction History({ item, timeZone }: { item: RecordItem; timeZone: string | undefined }) {\n return (\n <ol data-testid=\"bridge-done-history\" className=\"grid gap-1.5 text-caption max-md:hidden\">\n {historyOf(item, timeZone).map((line) => (\n <li key={`${line.at} ${line.text}`} className=\"grid grid-cols-[3rem_0.5rem_minmax(0,1fr)] items-center gap-2\">\n <span className=\"text-muted-foreground tabular-nums\">{line.at}</span>\n <i aria-hidden=\"true\" className={`size-1.5 rounded-full ${line.isEnd ? 'bg-tone-ok-fg' : 'bg-border'}`} />\n <span>\n {line.text}\n {line.detail === undefined ? null : <span className=\"text-muted-foreground\"> · {line.detail}</span>}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n\n/**\n * A done item opened from Done (decide.html, answered in Slack): read back\n * whole from the record, nothing acknowledged and nothing to send. A\n * question shows its options with the one answered marked, a step why and\n * where it was done, anything else what it says; then what came of it and\n * its history. A phone shows it on its own screen, titled by what came of\n * it, without its history, as drawn.\n */\nexport function DoneCard({ item, timeZone, bridgeHost, onBack }: { item: RecordItem; timeZone: string | undefined; bridgeHost: string; onBack: () => void }) {\n const question = questionOf(item);\n const step = stepOf(item, bridgeHost);\n const ended = endedOf(item, timeZone);\n const opened = { job: item.job, isAlert: item.isAlert, wasNew: false };\n return (\n <section data-testid=\"bridge-done-item\" className=\"grid min-w-0 content-start gap-3 text-card-foreground md:p-5\">\n <ScreenBar opened={opened} title={endedTitleOf(item)} isWorking={false} onBack={onBack} />\n <ItemHeading delivery={item} opened={opened} timeZone={timeZone} />\n <h2 className=\"text-heading font-semibold\">{question?.title ?? item.title}</h2>\n {step !== undefined ? (\n <StepAsked step={step} isStale={false} isFinished />\n ) : question === undefined ? (\n <Markdown text={bodyOf(item)} />\n ) : (\n <>\n <div className={PROSE}>\n <Markdown text={question.context} />\n </div>\n <AnsweredOptions question={question} answered={item.outcome?.option ?? null} />\n </>\n )}\n {ended === undefined ? null : <EndedNotice ended={ended} />}\n <History item={item} timeZone={timeZone} />\n </section>\n );\n}\n"],"names":["$$RSC_SERVER_ACTION_0"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCH4M,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,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g=a.i(5050);let h=(0,g.createServerReference)("40c10498ec73660294acae9ad3b4501f151b8aaa29",g.callServer,void 0,g.findSourceMapURL,"changeMic"),i=(0,g.createServerReference)("40b780c3cca8c5dbae63623e146e24e089be26f3b1",g.callServer,void 0,g.findSourceMapURL,"contribute"),j={request:{label:"Request the mic",pending:"Requesting..."},withdraw:{label:"Withdraw my request",pending:"Withdrawing..."},release:{label:"Release the mic",pending:"Releasing..."}};a.s(["MeetingControls",0,function({fleetId:a,meetingId:g,controls:k}){let l=(0,c.useRouter)(),[m,n]=(0,d.useState)(""),[o,p]=(0,d.useState)(()=>crypto.randomUUID()),[q,r]=(0,d.useState)(),[s,t]=(0,d.useState)(),[,u]=(0,d.useTransition)(),v=({control:a,action:b,onDone:c})=>{r(a),t(void 0),u(async()=>{let a=await b();r(void 0),a.isOk?(c?.(),l.refresh()):t(a.message)})},w=void 0!==q,x=k.filter(a=>"contribute"!==a);return(0,b.jsxs)("div",{className:"grid gap-3",children:[k.includes("contribute")?(0,b.jsxs)("div",{className:"grid gap-2",children:[(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Your contribution"}),(0,b.jsx)("textarea",{"data-testid":"meeting-text",rows:4,value:m,onChange:a=>{n(a.target.value)},className:"rounded-md border border-input bg-background p-2"})]}),(0,b.jsx)(e.i,{"data-testid":"meeting-contribute",variant:"primary",className:"justify-self-start",isPending:"contribute"===q,pendingLabel:"Sending...",disabled:w,onClick:()=>{v({control:"contribute",action:()=>i({fleet:a,meetingId:g,text:m,idempotencyKey:o}),onDone:()=>{n(""),p(crypto.randomUUID())}})},children:"Contribute"})]}):null,0===x.length?null:(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:x.map(c=>(0,b.jsx)(e.i,{"data-testid":`meeting-${c}`,variant:"request"===c?"primary":"secondary",isPending:q===c,pendingLabel:j[c].pending,disabled:w,onClick:()=>{v({control:c,action:()=>h({fleet:a,meetingId:g,change:c})})},children:j[c].label},c))}),void 0===s?null:(0,b.jsx)(f.f,{message:s,isFailure:!0})]})}],3045)}];
1
+ module.exports=[3045,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(72131),e=a.i(32043),f=a.i(10039),g=a.i(5050);let h=(0,g.createServerReference)("4022e2173a0de3f2bde0a0d2a095ecf8e5f7c0e2ae",g.callServer,void 0,g.findSourceMapURL,"changeMic"),i=(0,g.createServerReference)("40eceea36d09c66186e2e22846958f0580ef0847ad",g.callServer,void 0,g.findSourceMapURL,"contribute"),j={request:{label:"Request the mic",pending:"Requesting..."},withdraw:{label:"Withdraw my request",pending:"Withdrawing..."},release:{label:"Release the mic",pending:"Releasing..."}};a.s(["MeetingControls",0,function({fleetId:a,meetingId:g,controls:k}){let l=(0,c.useRouter)(),[m,n]=(0,d.useState)(""),[o,p]=(0,d.useState)(()=>crypto.randomUUID()),[q,r]=(0,d.useState)(),[s,t]=(0,d.useState)(),[,u]=(0,d.useTransition)(),v=({control:a,action:b,onDone:c})=>{r(a),t(void 0),u(async()=>{let a=await b();r(void 0),a.isOk?(c?.(),l.refresh()):t(a.message)})},w=void 0!==q,x=k.filter(a=>"contribute"!==a);return(0,b.jsxs)("div",{className:"grid gap-3",children:[k.includes("contribute")?(0,b.jsxs)("div",{className:"grid gap-2",children:[(0,b.jsxs)("label",{className:"grid gap-1",children:[(0,b.jsx)("span",{children:"Your contribution"}),(0,b.jsx)("textarea",{"data-testid":"meeting-text",rows:4,value:m,onChange:a=>{n(a.target.value)},className:"rounded-md border border-input bg-background p-2"})]}),(0,b.jsx)(e.i,{"data-testid":"meeting-contribute",variant:"primary",className:"justify-self-start",isPending:"contribute"===q,pendingLabel:"Sending...",disabled:w,onClick:()=>{v({control:"contribute",action:()=>i({fleet:a,meetingId:g,text:m,idempotencyKey:o}),onDone:()=>{n(""),p(crypto.randomUUID())}})},children:"Contribute"})]}):null,0===x.length?null:(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:x.map(c=>(0,b.jsx)(e.i,{"data-testid":`meeting-${c}`,variant:"request"===c?"primary":"secondary",isPending:q===c,pendingLabel:j[c].pending,disabled:w,onClick:()=>{v({control:c,action:()=>h({fleet:a,meetingId:g,change:c})})},children:j[c].label},c))}),void 0===s?null:(0,b.jsx)(f.f,{message:s,isFailure:!0})]})}],3045)}];
2
2
 
3
3
  //# sourceMappingURL=web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../web/features/meeting/state/meeting-controls.tsx","../../../../../web/features/meeting/hooks/data%3Ace02ab%20%3Ctext/javascript%3E","../../../../../web/features/meeting/hooks/data%3A91f7e2%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport { ActionButton } from '../../bridge/ui/action-button';\nimport { Notice } from '../../bridge/ui/notice';\nimport type { ActionOutcome } from '../../bridge/hooks/bridge-actions';\nimport { changeMic, contribute, type OwnMicChange } from '../hooks/meeting-actions';\nimport type { MeetingControl } from '../services/meeting';\n\n/** Each mic control's words, and what it says while it works. */\nconst MIC_CONTROLS: Record<OwnMicChange, { label: string; pending: string }> = {\n request: { label: 'Request the mic', pending: 'Requesting...' },\n withdraw: { label: 'Withdraw my request', pending: 'Withdrawing...' },\n release: { label: 'Release the mic', pending: 'Releasing...' },\n};\n\n/**\n * What the person may do in the meeting now: write a contribution while they\n * hold the mic or moderate, and their own mic calls. A draft keeps one key\n * until it is taken, so a contribution tried again goes once. The page reads\n * itself again after each call.\n */\nexport function MeetingControls({ fleetId, meetingId, controls }: { fleetId: string; meetingId: string; controls: readonly MeetingControl[] }) {\n const router = useRouter();\n const [text, setText] = useState('');\n const [draftKey, setDraftKey] = useState(() => crypto.randomUUID());\n const [working, setWorking] = useState<MeetingControl | undefined>();\n const [failure, setFailure] = useState<string | undefined>();\n const [, startTransition] = useTransition();\n\n const run = ({ control, action, onDone }: { control: MeetingControl; action: () => Promise<ActionOutcome<undefined>>; onDone?: () => void }) => {\n setWorking(control);\n setFailure(undefined);\n startTransition(async () => {\n const outcome = await action();\n setWorking(undefined);\n if (outcome.isOk) {\n onDone?.();\n router.refresh();\n } else {\n setFailure(outcome.message);\n }\n });\n };\n\n const isWorking = working !== undefined;\n const micControls = controls.filter((control): control is OwnMicChange => control !== 'contribute');\n return (\n <div className=\"grid gap-3\">\n {controls.includes('contribute') ? (\n <div className=\"grid gap-2\">\n <label className=\"grid gap-1\">\n <span>Your contribution</span>\n <textarea\n data-testid=\"meeting-text\"\n rows={4}\n value={text}\n onChange={(event) => { setText(event.target.value); }}\n className=\"rounded-md border border-input bg-background p-2\"\n />\n </label>\n <ActionButton\n data-testid=\"meeting-contribute\"\n variant=\"primary\"\n className=\"justify-self-start\"\n isPending={working === 'contribute'}\n pendingLabel=\"Sending...\"\n disabled={isWorking}\n onClick={() => {\n run({\n control: 'contribute',\n action: () => contribute({ fleet: fleetId, meetingId, text, idempotencyKey: draftKey }),\n onDone: () => {\n setText('');\n setDraftKey(crypto.randomUUID());\n },\n });\n }}\n >\n Contribute\n </ActionButton>\n </div>\n ) : null}\n {micControls.length === 0 ? null : (\n <div className=\"flex flex-wrap gap-2\">\n {micControls.map((change) => (\n <ActionButton\n key={change}\n data-testid={`meeting-${change}`}\n variant={change === 'request' ? 'primary' : 'secondary'}\n isPending={working === change}\n pendingLabel={MIC_CONTROLS[change].pending}\n disabled={isWorking}\n onClick={() => { run({ control: change, action: () => changeMic({ fleet: fleetId, meetingId, change }) }); }}\n >\n {MIC_CONTROLS[change].label}\n </ActionButton>\n ))}\n </div>\n )}\n {failure === undefined ? null : <Notice message={failure} isFailure />}\n </div>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"40c10498ec73660294acae9ad3b4501f151b8aaa29\":{\"name\":\"changeMic\"}},\"web/features/meeting/hooks/meeting-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"40c10498ec73660294acae9ad3b4501f151b8aaa29\",callServer,void 0,findSourceMapURL,\"changeMic\");export{$$RSC_SERVER_ACTION_1 as changeMic};","/* __next_internal_action_entry_do_not_use__ [{\"40b780c3cca8c5dbae63623e146e24e089be26f3b1\":{\"name\":\"contribute\"}},\"web/features/meeting/hooks/meeting-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"40b780c3cca8c5dbae63623e146e24e089be26f3b1\",callServer,void 0,findSourceMapURL,\"contribute\");export{$$RSC_SERVER_ACTION_0 as contribute};"],"names":["$$RSC_SERVER_ACTION_1"],"mappings":"uDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCNyM,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,aCAxI,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,cFYzb,EAAyE,CAC7E,QAAS,CAAE,MAAO,kBAAmB,QAAS,eAAgB,EAC9D,SAAU,CAAE,MAAO,sBAAuB,QAAS,gBAAiB,EACpE,QAAS,CAAE,MAAO,kBAAmB,QAAS,cAAe,CAC/D,2BAQO,SAAS,AAAgB,CAAE,SAAO,CAAE,WAAS,UAAE,CAAQ,CAA+E,EAC3I,IAAM,EAAS,CAAA,EAAA,EAAA,SAAS,AAAT,IACT,CAAC,EAAM,EAAQ,CAAG,CAAA,EAAA,EAAA,QAAA,AA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UAAU,GAC/B,CACF,EACF,WACD,kBAID,KACH,AAAuB,MAAX,MAAM,CAAS,KAC1B,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,gCACZ,EAAY,GAAG,CAAC,AAAC,GAChB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAY,CAAA,CAEX,cAAa,CAAC,QAAQ,EAAE,EAAA,CAAQ,CAChC,QAAoB,YAAX,EAAuB,UAAY,YAC5C,UAAW,IAAY,EACvB,aAAc,CAAY,CAAC,EAAO,CAAC,OAAO,CAC1C,SAAU,EACV,QAAS,KAAQ,EAAI,CAAE,QAAS,EAAQ,OAAQ,IAAM,EAAU,CAAE,MAAO,YAAS,SAAW,CAAO,EAAG,EAAI,WAE1G,CAAY,CAAC,EAAO,CAAC,KAAK,EARtB,WAaA,IAAZ,EAAwB,KAAO,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAM,CAAA,CAAC,QAAS,EAAS,SAAS,CAAA,CAAA,MAGzE"}
1
+ {"version":3,"sources":["../../../../../web/features/meeting/state/meeting-controls.tsx","../../../../../web/features/meeting/hooks/data%3A2ed83e%20%3Ctext/javascript%3E","../../../../../web/features/meeting/hooks/data%3Abfe054%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport { ActionButton } from '../../bridge/ui/action-button';\nimport { Notice } from '../../bridge/ui/notice';\nimport type { ActionOutcome } from '../../bridge/hooks/bridge-actions';\nimport { changeMic, contribute, type OwnMicChange } from '../hooks/meeting-actions';\nimport type { MeetingControl } from '../services/meeting';\n\n/** Each mic control's words, and what it says while it works. */\nconst MIC_CONTROLS: Record<OwnMicChange, { label: string; pending: string }> = {\n request: { label: 'Request the mic', pending: 'Requesting...' },\n withdraw: { label: 'Withdraw my request', pending: 'Withdrawing...' },\n release: { label: 'Release the mic', pending: 'Releasing...' },\n};\n\n/**\n * What the person may do in the meeting now: write a contribution while they\n * hold the mic or moderate, and their own mic calls. A draft keeps one key\n * until it is taken, so a contribution tried again goes once. The page reads\n * itself again after each call.\n */\nexport function MeetingControls({ fleetId, meetingId, controls }: { fleetId: string; meetingId: string; controls: readonly MeetingControl[] }) {\n const router = useRouter();\n const [text, setText] = useState('');\n const [draftKey, setDraftKey] = useState(() => crypto.randomUUID());\n const [working, setWorking] = useState<MeetingControl | undefined>();\n const [failure, setFailure] = useState<string | undefined>();\n const [, startTransition] = useTransition();\n\n const run = ({ control, action, onDone }: { control: MeetingControl; action: () => Promise<ActionOutcome<undefined>>; onDone?: () => void }) => {\n setWorking(control);\n setFailure(undefined);\n startTransition(async () => {\n const outcome = await action();\n setWorking(undefined);\n if (outcome.isOk) {\n onDone?.();\n router.refresh();\n } else {\n setFailure(outcome.message);\n }\n });\n };\n\n const isWorking = working !== undefined;\n const micControls = controls.filter((control): control is OwnMicChange => control !== 'contribute');\n return (\n <div className=\"grid gap-3\">\n {controls.includes('contribute') ? (\n <div className=\"grid gap-2\">\n <label className=\"grid gap-1\">\n <span>Your contribution</span>\n <textarea\n data-testid=\"meeting-text\"\n rows={4}\n value={text}\n onChange={(event) => { setText(event.target.value); }}\n className=\"rounded-md border border-input bg-background p-2\"\n />\n </label>\n <ActionButton\n data-testid=\"meeting-contribute\"\n variant=\"primary\"\n className=\"justify-self-start\"\n isPending={working === 'contribute'}\n pendingLabel=\"Sending...\"\n disabled={isWorking}\n onClick={() => {\n run({\n control: 'contribute',\n action: () => contribute({ fleet: fleetId, meetingId, text, idempotencyKey: draftKey }),\n onDone: () => {\n setText('');\n setDraftKey(crypto.randomUUID());\n },\n });\n }}\n >\n Contribute\n </ActionButton>\n </div>\n ) : null}\n {micControls.length === 0 ? null : (\n <div className=\"flex flex-wrap gap-2\">\n {micControls.map((change) => (\n <ActionButton\n key={change}\n data-testid={`meeting-${change}`}\n variant={change === 'request' ? 'primary' : 'secondary'}\n isPending={working === change}\n pendingLabel={MIC_CONTROLS[change].pending}\n disabled={isWorking}\n onClick={() => { run({ control: change, action: () => changeMic({ fleet: fleetId, meetingId, change }) }); }}\n >\n {MIC_CONTROLS[change].label}\n </ActionButton>\n ))}\n </div>\n )}\n {failure === undefined ? null : <Notice message={failure} isFailure />}\n </div>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"4022e2173a0de3f2bde0a0d2a095ecf8e5f7c0e2ae\":{\"name\":\"changeMic\"}},\"web/features/meeting/hooks/meeting-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"4022e2173a0de3f2bde0a0d2a095ecf8e5f7c0e2ae\",callServer,void 0,findSourceMapURL,\"changeMic\");export{$$RSC_SERVER_ACTION_1 as changeMic};","/* __next_internal_action_entry_do_not_use__ [{\"40eceea36d09c66186e2e22846958f0580ef0847ad\":{\"name\":\"contribute\"}},\"web/features/meeting/hooks/meeting-actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"40eceea36d09c66186e2e22846958f0580ef0847ad\",callServer,void 0,findSourceMapURL,\"contribute\");export{$$RSC_SERVER_ACTION_0 as contribute};"],"names":["$$RSC_SERVER_ACTION_1"],"mappings":"uDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCNyM,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,aCAxI,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,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eACZ,KAAM,EACN,MAAO,EACP,SAAU,AAAC,IAAY,EAAQ,EAAM,MAAM,CAAC,KAAK,CAAG,EACpD,UAAU,wDAGd,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAY,CAAA,CACX,cAAY,qBACZ,QAAQ,UACR,UAAU,qBACV,UAAuB,eAAZ,EACX,aAAa,aACb,SAAU,EACV,QAAS,KACP,EAAI,CACF,QAAS,aACT,OAAQ,IAAM,EAAW,CAAE,MAAO,YAAS,OAAW,EAAM,eAAgB,CAAS,GACrF,OAAQ,KACN,EAAQ,IACR,EAAY,OAAO,UAAU,GAC/B,CACF,EACF,WACD,kBAID,KACH,AAAuB,MAAX,MAAM,CAAS,KAC1B,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,gCACZ,EAAY,GAAG,CAAC,AAAC,GAChB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAY,CAAA,CAEX,cAAa,CAAC,QAAQ,EAAE,EAAA,CAAQ,CAChC,QAAoB,YAAX,EAAuB,UAAY,YAC5C,UAAW,IAAY,EACvB,aAAc,CAAY,CAAC,EAAO,CAAC,OAAO,CAC1C,SAAU,EACV,QAAS,KAAQ,EAAI,CAAE,QAAS,EAAQ,OAAQ,IAAM,EAAU,CAAE,MAAO,YAAS,SAAW,CAAO,EAAG,EAAI,WAE1G,CAAY,CAAC,EAAO,CAAC,KAAK,EARtB,WAaA,IAAZ,EAAwB,KAAO,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAM,CAAA,CAAC,QAAS,EAAS,SAAS,CAAA,CAAA,MAGzE"}
@@ -1,3 +1,3 @@
1
- module.exports=[18434,a=>{"use strict";var b=a.i(87924),c=a.i(97024),d=a.i(72131),e=a.i(30587),f=a.i(88412),g=a.i(36855),h=a.i(77237),i=a.i(5050);let j=(0,i.createServerReference)("60ec3c2f6bcae5e138433edd19e88be9eed17cf140",i.callServer,void 0,i.findSourceMapURL,"switchOutsideParties");var k=a.i(47763);a.s(["SwitchCard",0,function({isOn:a,canSwitch:i,fleetId:l}){let[m,n]=(0,d.useActionState)(j,e.Q);return(0,b.jsxs)("section",{className:`${f.E} grid gap-1.5`,"data-testid":"outside-parties-switch",children:[(0,b.jsxs)("h2",{className:"flex items-center gap-2 font-semibold",children:["Outside parties are ",a?"on":"off"," ",a?(0,b.jsx)(k.T,{tone:"ok",label:"On",look:"flat",icon:(0,b.jsx)(c.f,{"aria-hidden":!0,className:"size-3.5"})}):(0,b.jsx)(k.T,{tone:"ended",label:"Off",look:"flat"})]}),(0,b.jsx)("p",{className:"text-meta text-muted-foreground",children:a?"Approved outside MCP servers and clients reach the fleet, as its network rules allow.":"No outside MCP server or client reaches the fleet, and no request for one can be approved."}),"openNetwork"===m.kind?(0,b.jsxs)("form",{action:n,role:"alert",className:"grid gap-3 rounded-md border border-tone-attention-border bg-tone-attention-bg p-4 text-tone-attention-fg",children:[(0,b.jsx)("h3",{className:"font-semibold",children:"Open network"}),(0,b.jsx)("p",{children:m.message}),(0,b.jsx)("input",{type:"hidden",name:e.H,value:l}),(0,b.jsx)("input",{type:"hidden",name:"isOn",value:"true"}),(0,b.jsx)("input",{type:"hidden",name:"isOpenNetworkConfirmed",value:"true"}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(h.f,{kind:"destructive",pending:"Turning on…",testId:"outside-parties-turn-on-anyway",children:"Turn on anyway"}),(0,b.jsx)("a",{className:f.x.secondary,href:"",children:"Keep off"})]})]}):i?(0,b.jsxs)("form",{action:n,children:[(0,b.jsx)("input",{type:"hidden",name:e.H,value:l}),(0,b.jsx)("input",{type:"hidden",name:"isOn",value:String(!a)}),(0,b.jsx)(h.f,{kind:a?"secondary":"primary",pending:a?"Turning off…":"Turning on…",testId:"outside-parties-turn",children:a?"Turn off":"Turn on"})]}):(0,b.jsxs)("p",{className:"text-meta text-muted-foreground",children:["Turning them on or off needs ","fleet:network","."]}),"openNetwork"===m.kind?null:(0,b.jsx)(g.f,{state:m})]})}],18434)}];
1
+ module.exports=[18434,a=>{"use strict";var b=a.i(87924),c=a.i(97024),d=a.i(72131),e=a.i(30587),f=a.i(88412),g=a.i(36855),h=a.i(77237),i=a.i(5050);let j=(0,i.createServerReference)("60ae449a18b0b6dee162a9e39ce03ccba4f6d50d9a",i.callServer,void 0,i.findSourceMapURL,"switchOutsideParties");var k=a.i(47763);a.s(["SwitchCard",0,function({isOn:a,canSwitch:i,fleetId:l}){let[m,n]=(0,d.useActionState)(j,e.Q);return(0,b.jsxs)("section",{className:`${f.E} grid gap-1.5`,"data-testid":"outside-parties-switch",children:[(0,b.jsxs)("h2",{className:"flex items-center gap-2 font-semibold",children:["Outside parties are ",a?"on":"off"," ",a?(0,b.jsx)(k.T,{tone:"ok",label:"On",look:"flat",icon:(0,b.jsx)(c.f,{"aria-hidden":!0,className:"size-3.5"})}):(0,b.jsx)(k.T,{tone:"ended",label:"Off",look:"flat"})]}),(0,b.jsx)("p",{className:"text-meta text-muted-foreground",children:a?"Approved outside MCP servers and clients reach the fleet, as its network rules allow.":"No outside MCP server or client reaches the fleet, and no request for one can be approved."}),"openNetwork"===m.kind?(0,b.jsxs)("form",{action:n,role:"alert",className:"grid gap-3 rounded-md border border-tone-attention-border bg-tone-attention-bg p-4 text-tone-attention-fg",children:[(0,b.jsx)("h3",{className:"font-semibold",children:"Open network"}),(0,b.jsx)("p",{children:m.message}),(0,b.jsx)("input",{type:"hidden",name:e.H,value:l}),(0,b.jsx)("input",{type:"hidden",name:"isOn",value:"true"}),(0,b.jsx)("input",{type:"hidden",name:"isOpenNetworkConfirmed",value:"true"}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(h.f,{kind:"destructive",pending:"Turning on…",testId:"outside-parties-turn-on-anyway",children:"Turn on anyway"}),(0,b.jsx)("a",{className:f.x.secondary,href:"",children:"Keep off"})]})]}):i?(0,b.jsxs)("form",{action:n,children:[(0,b.jsx)("input",{type:"hidden",name:e.H,value:l}),(0,b.jsx)("input",{type:"hidden",name:"isOn",value:String(!a)}),(0,b.jsx)(h.f,{kind:a?"secondary":"primary",pending:a?"Turning off…":"Turning on…",testId:"outside-parties-turn",children:a?"Turn off":"Turn on"})]}):(0,b.jsxs)("p",{className:"text-meta text-muted-foreground",children:["Turning them on or off needs ","fleet:network","."]}),"openNetwork"===m.kind?null:(0,b.jsx)(g.f,{state:m})]})}],18434)}];
2
2
 
3
3
  //# sourceMappingURL=web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../web/features/outside-parties/ui/switch-card.tsx","../../../../../web/features/outside-parties/data%3A87e7e0%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport { CircleCheck } from 'lucide-react';\nimport { useActionState } from 'react';\n\nimport { FLEET_FIELD, IDLE } from '../../forms/form-state';\nimport { BUTTONS, COMPACT_CARD } from '../../forms/ui/look';\nimport { Outcome } from '../../forms/ui/outcome';\nimport { SubmitButton } from '../../forms/ui/submit-button';\nimport { switchOutsideParties } from '../actions';\nimport { StatusBadge } from './status-badge';\n\n/** The scope that turns outside parties on or off (0056). */\nconst SWITCHING_SCOPE = 'fleet:network';\n\n/**\n * Whether the fleet's outside parties are on, and the switch for an account\n * holding fleet:network. An open network's warning asks to confirm, or to\n * keep them off.\n */\nexport function SwitchCard({ isOn, canSwitch, fleetId }: { isOn: boolean; canSwitch: boolean; fleetId: string }) {\n const [state, formAction] = useActionState(switchOutsideParties, IDLE);\n return (\n <section className={`${COMPACT_CARD} grid gap-1.5`} data-testid=\"outside-parties-switch\">\n <h2 className=\"flex items-center gap-2 font-semibold\">\n Outside parties are {isOn ? 'on' : 'off'} {isOn ? <StatusBadge tone=\"ok\" label=\"On\" look=\"flat\" icon={<CircleCheck aria-hidden className=\"size-3.5\" />} /> : <StatusBadge tone=\"ended\" label=\"Off\" look=\"flat\" />}\n </h2>\n <p className=\"text-meta text-muted-foreground\">\n {isOn ? 'Approved outside MCP servers and clients reach the fleet, as its network rules allow.' : 'No outside MCP server or client reaches the fleet, and no request for one can be approved.'}\n </p>\n {state.kind === 'openNetwork' ? (\n <form action={formAction} role=\"alert\" className=\"grid gap-3 rounded-md border border-tone-attention-border bg-tone-attention-bg p-4 text-tone-attention-fg\">\n <h3 className=\"font-semibold\">Open network</h3>\n <p>{state.message}</p>\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"isOn\" value=\"true\" />\n <input type=\"hidden\" name=\"isOpenNetworkConfirmed\" value=\"true\" />\n <div className=\"flex gap-2\">\n <SubmitButton kind=\"destructive\" pending=\"Turning on…\" testId=\"outside-parties-turn-on-anyway\">\n Turn on anyway\n </SubmitButton>\n <a className={BUTTONS.secondary} href=\"\">\n Keep off\n </a>\n </div>\n </form>\n ) : canSwitch ? (\n <form action={formAction}>\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"isOn\" value={String(!isOn)} />\n <SubmitButton kind={isOn ? 'secondary' : 'primary'} pending={isOn ? 'Turning off…' : 'Turning on…'} testId=\"outside-parties-turn\">\n {isOn ? 'Turn off' : 'Turn on'}\n </SubmitButton>\n </form>\n ) : (\n <p className=\"text-meta text-muted-foreground\">Turning them on or off needs {SWITCHING_SCOPE}.</p>\n )}\n {state.kind === 'openNetwork' ? null : <Outcome state={state} />}\n </section>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"60ec3c2f6bcae5e138433edd19e88be9eed17cf140\":{\"name\":\"switchOutsideParties\"}},\"web/features/outside-parties/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"60ec3c2f6bcae5e138433edd19e88be9eed17cf140\",callServer,void 0,findSourceMapURL,\"switchOutsideParties\");export{$$RSC_SERVER_ACTION_0 as switchOutsideParties};"],"names":["$$RSC_SERVER_ACTION_0"],"mappings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../../../../../web/features/outside-parties/data%3A113c73%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport { CircleCheck } from 'lucide-react';\nimport { useActionState } from 'react';\n\nimport { FLEET_FIELD, IDLE } from '../../forms/form-state';\nimport { BUTTONS, COMPACT_CARD } from '../../forms/ui/look';\nimport { Outcome } from '../../forms/ui/outcome';\nimport { SubmitButton } from '../../forms/ui/submit-button';\nimport { switchOutsideParties } from '../actions';\nimport { StatusBadge } from './status-badge';\n\n/** The scope that turns outside parties on or off (0056). */\nconst SWITCHING_SCOPE = 'fleet:network';\n\n/**\n * Whether the fleet's outside parties are on, and the switch for an account\n * holding fleet:network. An open network's warning asks to confirm, or to\n * keep them off.\n */\nexport function SwitchCard({ isOn, canSwitch, fleetId }: { isOn: boolean; canSwitch: boolean; fleetId: string }) {\n const [state, formAction] = useActionState(switchOutsideParties, IDLE);\n return (\n <section className={`${COMPACT_CARD} grid gap-1.5`} data-testid=\"outside-parties-switch\">\n <h2 className=\"flex items-center gap-2 font-semibold\">\n Outside parties are {isOn ? 'on' : 'off'} {isOn ? <StatusBadge tone=\"ok\" label=\"On\" look=\"flat\" icon={<CircleCheck aria-hidden className=\"size-3.5\" />} /> : <StatusBadge tone=\"ended\" label=\"Off\" look=\"flat\" />}\n </h2>\n <p className=\"text-meta text-muted-foreground\">\n {isOn ? 'Approved outside MCP servers and clients reach the fleet, as its network rules allow.' : 'No outside MCP server or client reaches the fleet, and no request for one can be approved.'}\n </p>\n {state.kind === 'openNetwork' ? (\n <form action={formAction} role=\"alert\" className=\"grid gap-3 rounded-md border border-tone-attention-border bg-tone-attention-bg p-4 text-tone-attention-fg\">\n <h3 className=\"font-semibold\">Open network</h3>\n <p>{state.message}</p>\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"isOn\" value=\"true\" />\n <input type=\"hidden\" name=\"isOpenNetworkConfirmed\" value=\"true\" />\n <div className=\"flex gap-2\">\n <SubmitButton kind=\"destructive\" pending=\"Turning on…\" testId=\"outside-parties-turn-on-anyway\">\n Turn on anyway\n </SubmitButton>\n <a className={BUTTONS.secondary} href=\"\">\n Keep off\n </a>\n </div>\n </form>\n ) : canSwitch ? (\n <form action={formAction}>\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"isOn\" value={String(!isOn)} />\n <SubmitButton kind={isOn ? 'secondary' : 'primary'} pending={isOn ? 'Turning off…' : 'Turning on…'} testId=\"outside-parties-turn\">\n {isOn ? 'Turn off' : 'Turn on'}\n </SubmitButton>\n </form>\n ) : (\n <p className=\"text-meta text-muted-foreground\">Turning them on or off needs {SWITCHING_SCOPE}.</p>\n )}\n {state.kind === 'openNetwork' ? null : <Outcome state={state} />}\n </section>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"60ae449a18b0b6dee162a9e39ce03ccba4f6d50d9a\":{\"name\":\"switchOutsideParties\"}},\"web/features/outside-parties/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"60ae449a18b0b6dee162a9e39ce03ccba4f6d50d9a\",callServer,void 0,findSourceMapURL,\"switchOutsideParties\");export{$$RSC_SERVER_ACTION_0 as switchOutsideParties};"],"names":["$$RSC_SERVER_ACTION_0"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCR8M,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAkC,AAArB,EAAsB,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,wBDUnc,IAAA,EAAA,EAAA,C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AA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,uBACb,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAY,CAAA,CAAC,KAAK,cAAc,QAAQ,cAAc,OAAO,0CAAiC,mBAG/F,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CAAE,UAAW,EAAA,CAAO,CAAC,SAAS,CAAE,KAAK,YAAG,mBAK3C,EACF,CAAA,EAAA,EAAA,IAAA,EAAC,OAAA,CAAK,OAAQ,YACZ,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CAAM,KAAK,SAAS,KAAM,EAAA,CAAW,CAAE,MAAO,IAC/C,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CAAM,KAAK,SAAS,KAAK,OAAO,MAAO,OAAO,CAAC,KAChD,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAY,CAAA,CAAC,KAAM,EAAO,YAAc,UAAW,QAAS,EAAO,eAAiB,cAAe,OAAO,gCACxG,EAAO,WAAa,eAIzB,CAAA,EAAA,EAAA,IAAA,EAAC,IAAA,CAAE,UAAU,4CAAkC,gCA1C/B,gBA0C6E,OAE/E,gBAAf,EAAM,IAAI,CAAqB,KAAO,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAO,CAAA,CAAC,MAAO,MAG7D"}
@@ -1,3 +1,3 @@
1
- (()=>{"use strict";module.exports=[69717,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call AgentNeeds() from the server but AgentNeeds is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/tools-table/ui/agent-needs.tsx","AgentNeeds");a.s(["AgentNeeds",0,b])},23626,a=>{var b=a.i(69717);a.n(b)},64256,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call ToolsTable() from the server but ToolsTable is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/tools-table/ui/tools-table.tsx","ToolsTable");a.s(["ToolsTable",0,b])},46736,a=>{var b=a.i(64256);a.n(b)},82555,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call EveryonesSignInsCard() from the server but EveryonesSignInsCard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/everyones-sign-ins-card.tsx","EveryonesSignInsCard");a.s(["EveryonesSignInsCard",0,b])},26977,a=>{var b=a.i(82555);a.n(b)},9181,a=>{var b=a.i(7997),c=a.i(717),d=a.i(55476),e=a.i(66283),f=a.i(29493),g=a.i(49144),h=a.i(60057),i=a.i(72913),j=a.i(1130),k=a.i(98323),l=a.i(23626),m=a.i(46736);async function n({api:a,name:b}){let c=await (0,e.F)(a.parties.approving.query({name:b})),d=c.isOk&&c.value.isApproving,f=d?await (0,e.F)(a.parties.listedScopes.query()):void 0;return{canChange:d&&f?.isOk===!0,listed:f?.isOk===!0?f.value.scopes:null,reason:c.isOk?c.value.isApproving?f?.isOk===!1?f.refusal:null:c.value.reason:c.refusal}}async function o({api:a,fleetId:c,name:d,isApprover:f,isSignIn:g}){let[h,i,j]=await Promise.all([(0,e.F)(a.parties.tools.query({name:d})),(0,e.F)(a.parties.scopeRequirements.query({name:d})),f?n({api:a,name:d}):{canChange:!1,listed:null,reason:null}]);return i.isOk?g&&!h.isOk&&"PRECONDITION_FAILED"===h.code?(0,b.jsx)("p",{className:"text-muted-foreground",children:h.refusal}):(0,b.jsxs)("div",{className:"grid gap-3",children:[null===j.reason?null:(0,b.jsxs)("p",{className:"text-muted-foreground","data-testid":"tools-table-read-only-reason",children:["You see these read-only: ",j.reason]}),(0,b.jsx)(m.ToolsTable,{fleetId:c,party:d,tools:function({read:a,requirements:b}){let c=new Map(b.tools.map(({tool:a,scopes:b})=>[a,b]));return a.isOk?a.value.tools.map(a=>({...a,scopes:c.get(a.name)??[]})):b.tools.map(({tool:a,scopes:b})=>({name:a,isOn:null,isNew:!1,scopes:b}))}({read:h,requirements:i.value}),version:i.value.version,partyScopes:i.value.party,listed:j.listed,canChange:j.canChange,serverRefusal:h.isOk?null:h.refusal})]}):(0,b.jsx)("p",{className:"text-muted-foreground",children:i.refusal})}function p({party:a}){return(0,b.jsxs)("div",{"aria-busy":"true","aria-label":`Reading the tools ${a} lists`,className:"grid gap-2","data-testid":"tools-table-skeleton",children:[(0,b.jsx)("span",{className:"block h-9 w-full animate-pulse rounded-md bg-muted"}),Array.from({length:8},(a,c)=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},c))]})}async function q(a,b){try{return(await a.account.apps.query()).fleets.find(({id:a})=>a===b)?.name??"this fleet"}catch(a){if(void 0===(0,e.U)(a))throw a;return"this fleet"}}async function r({api:a,fleetId:b,name:c}){try{return{kind:"read",own:await a.parties.ownSignIn.query({name:c})}}catch(c){if("FORBIDDEN"===(0,e.U)(c))return{kind:"noPersonShip",fleetName:await q(a,b)};return{kind:"refused",message:(0,e.s)(c)}}}function s({state:a,testId:c}){switch(a.kind){case"idle":return null;case"done":return(0,b.jsx)("p",{role:"status","data-testid":c,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:a.message});case"refused":case"openNetwork":return(0,b.jsx)("p",{role:"alert","data-testid":c,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a.message})}}var t=a.i(60960);let u={signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}};function v(a){return a.personName??a.personShipId}function w({count:a}){return(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("h2",{className:"text-section font-semibold",children:"Everyone's sign-ins"}),null===a?null:(0,b.jsx)("span",{className:"text-muted-foreground",children:a})]})}function x(){return(0,b.jsx)("thead",{className:"max-sm:hidden",children:(0,b.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"Person"}),(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"Account"}),(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"State"}),(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"Last used"}),(0,b.jsx)("th",{className:"h-10 px-2",children:(0,b.jsx)("span",{className:"sr-only",children:"Remove"})})]})})}function y({party:a}){return(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"aria-busy":"true","aria-label":`Reading everyone's sign-ins to ${a}`,"data-testid":"outside-party-sign-ins-skeleton",children:[(0,b.jsx)(w,{count:null}),(0,b.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,b.jsx)(x,{}),(0,b.jsx)("tbody",{className:"max-sm:grid",children:Array.from({length:3},(a,c)=>(0,b.jsxs)("tr",{className:"border-b border-border last:border-b-0 max-sm:grid max-sm:gap-1 max-sm:py-3",children:[(0,b.jsx)("td",{className:"h-12 px-2 max-sm:h-auto max-sm:px-0",children:(0,b.jsx)("span",{className:"block h-3.5 w-20 animate-pulse rounded-md bg-muted max-sm:w-2/5"})}),(0,b.jsx)("td",{className:"h-12 px-2 max-sm:h-auto max-sm:px-0",children:(0,b.jsx)("span",{className:"block h-3.5 w-36 animate-pulse rounded-md bg-muted max-sm:w-3/4"})}),(0,b.jsx)("td",{className:"h-12 px-2 max-sm:hidden",children:(0,b.jsx)("span",{className:"block h-3.5 w-16 animate-pulse rounded-md bg-muted"})}),(0,b.jsx)("td",{className:"h-12 px-2 max-sm:hidden",children:(0,b.jsx)("span",{className:"block h-3.5 w-20 animate-pulse rounded-md bg-muted"})}),(0,b.jsx)("td",{className:"max-sm:hidden"})]},c))})]})]})}function z({signIn:a,party:c,isRemoving:d,onConfirm:e,onKeep:f}){let h=v(a);return(0,b.jsxs)("div",{className:"grid gap-2 rounded-md bg-muted p-3","data-testid":"outside-party-sign-ins-confirm",children:[(0,b.jsxs)("p",{children:["Remove ",h,"'s sign-in? Their ships' calls to ",c," are refused until they sign in again."]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:g.x.destructive,disabled:d,"aria-busy":d,onClick:e,"data-testid":"outside-party-sign-ins-remove-confirmed",children:d?"Removing…":`Remove ${h}'s sign-in`}),(0,b.jsx)("button",{type:"button",className:g.x.secondary,onClick:f,children:"Keep"})]})]})}function A(a){let{party:c,now:d,rows:e,refusal:f,hasMore:h,isLoadingMore:i,confirming:j,removing:l,outcome:m}=a;return(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"data-testid":"outside-party-sign-ins",children:[(0,b.jsx)(w,{count:null===f?e.length:null}),(0,b.jsx)(s,{state:m}),null!==f?(0,b.jsx)(s,{state:{kind:"refused",message:f}}):0===e.length?(0,b.jsx)("p",{className:"text-muted-foreground",children:"Nobody has signed in yet."}):(0,b.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,b.jsx)(x,{}),(0,b.jsx)("tbody",{className:"max-sm:grid",children:e.map(e=>{let f=u[e.state],h=j===e.personShipId,i=null===e.lastUsedAt?"Not yet":(0,t.h)(e.lastUsedAt,new Date(d));return[(0,b.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,b.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:[v(e),e.isYours?(0,b.jsx)("span",{className:"font-normal text-muted-foreground",children:" (you)"}):null]}),(0,b.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:a}){return a.name??a.subject??(0,b.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}(e),(0,b.jsxs)("span",{className:"sm:hidden",children:[" · last used ",null===e.lastUsedAt?"not yet":i]})]}),(0,b.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,b.jsx)(k.T,{tone:f.tone,label:f.label})}),(0,b.jsx)("td",{className:"h-12 px-2 text-muted-foreground max-sm:hidden",children:i}),(0,b.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,b.jsx)("button",{type:"button",className:`${g.x.secondary} ${h?"max-sm:hidden":""}`,onClick:()=>{a.onRemove(e.personShipId)},"data-testid":"outside-party-sign-ins-remove",children:"Remove"})})]},e.personShipId),h?(0,b.jsx)("tr",{className:"border-b border-border last:border-b-0 max-sm:block max-sm:pb-3",children:(0,b.jsx)("td",{colSpan:5,className:"pb-2 max-sm:block max-sm:pb-0",children:(0,b.jsx)(z,{signIn:e,party:c,isRemoving:l===e.personShipId,onConfirm:()=>{a.onConfirm(e)},onKeep:a.onKeep})})},`${e.personShipId}-confirm`):null]})})]}),null===f&&h?(0,b.jsx)("div",{children:(0,b.jsx)("button",{type:"button",className:g.x.secondary,disabled:i,"aria-busy":i,onClick:a.onMore,"data-testid":"outside-party-sign-ins-more",children:i?"Showing more…":"Show more"})}):null]})}var B=a.i(26977);let C=()=>void 0;async function D({api:a,fleetId:c,name:d}){let f=await (0,e.F)(a.parties.signIns.query({name:d,after:null})),g=new Date().toISOString();return f.isOk?(0,b.jsx)(B.EveryonesSignInsCard,{fleetId:c,party:d,now:g,first:f.value}):(0,b.jsx)(A,{party:d,now:g,rows:[],refusal:f.refusal,hasMore:!1,isLoadingMore:!1,confirming:null,removing:null,outcome:{kind:"idle"},onRemove:C,onConfirm:C,onKeep:C,onMore:C})}function E({label:a,children:c}){return(0,b.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[10rem_1fr]",children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:a}),(0,b.jsx)("dd",{className:"flex flex-wrap items-center gap-2",children:c})]})}var F=a.i(45239);let G={notSignedIn:{tone:"ended",label:"Not signed in"},signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}},H={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"};function I({outcome:a,party:c}){let{message:d,tone:e,isAlert:f}=function(a,b){switch(a){case"signedIn":return{message:`You are signed in to ${b}.`,tone:"ok",isAlert:!1};case"removed":return{message:`Your sign-in to ${b} is removed.`,tone:"ok",isAlert:!1};case"failed":return{message:"The sign-in did not finish: press Sign in again.",tone:"attention",isAlert:!0};case"turnedAway":return{message:`That ${b} account is another person's sign-in in this fleet: sign in as your own.`,tone:"attention",isAlert:!0};case"cancelled":return{message:`You are not signed in to ${b}: the sign-in was cancelled or refused there.`,tone:"ended",isAlert:!1};case"unavailable":return{message:`${b}'s sign-in did not answer: try again in a moment.`,tone:"attention",isAlert:!0}}}(a.kind,c);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{role:f?"alert":"status",className:`rounded-md border px-3 py-2 ${H[e]}`,children:d}),null===a.serverError?null:(0,b.jsx)("div",{children:(0,b.jsx)(k.E,{isMono:!0,children:a.serverError})})]})}function J({outsideAccount:a}){return a.name??a.subject??(0,b.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}function K({own:a,fleetId:c,party:d,now:e}){switch(a.state){case"notSignedIn":return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-muted-foreground",children:["Until you sign in, your ships' calls to ",d," are refused."]}),(0,b.jsx)(F.SignInForm,{fleetId:c,party:d,label:"Sign in",kind:"primary"})]});case"signedIn":return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("dl",{className:"grid gap-3",children:[(0,b.jsx)(E,{label:"Account",children:J(a)}),(0,b.jsx)(E,{label:"Signed in",children:(0,t.h)(a.signedInAt,e)}),(0,b.jsx)(E,{label:"Last used",children:null===a.lastUsedAt?"Not yet":(0,t.h)(a.lastUsedAt,e)})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-start gap-2",children:[(0,b.jsx)(F.SignInForm,{fleetId:c,party:d,label:"Sign in again",kind:"secondary"}),(0,b.jsx)(F.RemoveSignInForm,{fleetId:c,party:d})]})]});case"lost":return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{children:[d," refused to refresh it on ",(0,t.x)(a.lost.at),": ",(0,b.jsx)("span",{className:"font-mono text-code",children:a.lost.why}),". Your ships' calls to ",d," are refused."]}),(0,b.jsxs)("dl",{className:"grid gap-3",children:[(0,b.jsx)(E,{label:"Account",children:J(a)}),(0,b.jsx)(E,{label:"Last used",children:null===a.lastUsedAt?"Not yet":(0,t.h)(a.lastUsedAt,e)})]}),(0,b.jsx)(F.SignInForm,{fleetId:c,party:d,label:"Sign in again",kind:"primary"})]})}}function L({fleetId:a,party:c,read:d,outcome:e,now:f}){let h="read"===d.kind?G[d.own.state]:null;return(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"data-testid":"outside-party-sign-in",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("h2",{className:"text-section font-semibold",children:"Your sign-in"}),null===h?null:(0,b.jsx)(k.T,{tone:h.tone,label:h.label})]}),"read"===d.kind&&null!==e?(0,b.jsx)(I,{outcome:e,party:c}):null,"read"===d.kind?(0,b.jsx)(K,{own:d.own,fleetId:a,party:c,now:f}):"noPersonShip"===d.kind?(0,b.jsxs)("p",{className:"text-muted-foreground",children:["Signing in needs a person ship in ",d.fleetName,"."]}):(0,b.jsx)(s,{state:{kind:"refused",message:d.message}})]})}var M=a.i(35670);let N="fleet:owner",O="scopes:grant",P="gateway:approve";function Q({children:a}){return(0,b.jsx)("p",{role:"alert",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a})}let R={mcpServer:"Address",mcpClient:"Client id",a2aClient:"Address",a2aAgent:"Card address"},S=(0,b.jsx)("span",{className:"text-muted-foreground",children:"Not known"});function T({party:a}){let{protocol:c,side:d}=h.G[a.kind],e=h.Y[a.state];return(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("h1",{className:"text-heading-touch font-semibold max-sm:sr-only",children:a.name}),(0,b.jsx)(k.E,{children:c}),(0,b.jsx)(k.E,{children:h.N[d].one}),(0,b.jsx)(k.T,{tone:e.tone,label:e.label})]})}async function U({page:a,name:m,outcome:q}){let{api:s,fleetId:t,scopes:u}=a,v=await (0,e.F)(s.parties.get.query({name:m}));if(!v.isOk)return(0,b.jsx)("div",{className:"grid gap-4",children:(0,b.jsx)(Q,{children:v.refusal})});let w=v.value,x=(0,h.M)(w),z=u.includes(P),A="mcpServer"===w.kind&&w.credentialKind===f.m.kind,[B,C,F]=await Promise.all(["a2aClient"===w.kind?(0,e.F)(s.parties.cardAddresses.query({name:m})):void 0,"a2aAgent"===w.kind?Promise.all([(0,e.F)(s.parties.scopeRequirements.query({name:m})),z?n({api:s,name:m}):{canChange:!1,listed:null,reason:null}]):void 0,A?r({api:s,fleetId:t,name:m}):void 0]),G=(0,b.jsx)("a",{href:(0,d.i)((0,i.N)(w.name,"change"),t),className:"text-primary hover:underline","data-testid":"outside-party-change",children:"Change"});return(0,b.jsxs)("div",{className:"grid gap-4",children:[(0,b.jsx)(T,{party:w}),(0,b.jsxs)("dl",{className:`${g.r} grid gap-3`,children:[(0,b.jsx)(E,{label:"Proxy ship",children:w.proxyShipName??S}),(0,b.jsxs)(E,{label:"Owner",children:[w.ownerName??S,u.includes(N)?G:null]}),(0,b.jsxs)(E,{label:"Scopes",children:[null===w.scopes?S:w.scopes.map(a=>{let c;return(0,b.jsx)(k.E,{children:(c=j.K.safeParse(a)).success?j.q[c.data]:a},a)}),u.includes(O)?G:null]}),"mcpServer"===w.kind||"a2aAgent"===w.kind?(0,b.jsx)(E,{label:"Credential",children:f.a.find(({kind:a})=>a===w.credentialKind)?.label}):null,null===x?null:(0,b.jsx)(E,{label:R[w.kind],children:(0,b.jsx)("span",{className:"font-mono",children:x})}),"a2aAgent"===w.kind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E,{label:"Messages at once",children:w.concurrencyLimit}),(0,b.jsx)(E,{label:"Needs",children:void 0===C?null:C[0].isOk?(0,b.jsx)(l.AgentNeeds,{fleetId:t,party:w.name,version:C[0].value.version,scopes:C[0].value.party,listed:C[1].listed,canChange:C[1].canChange}):(0,b.jsx)("span",{className:"text-muted-foreground",children:C[0].refusal})}),(0,b.jsx)(E,{label:"Repeatable",children:u.includes(P)?(0,b.jsx)(M.RepeatableSwitch,{fleetId:t,party:w.name,isRepeatable:w.isRepeatable}):(0,b.jsx)(k.E,{children:w.isRepeatable?"Repeatable":"Not repeatable"})})]}):null]}),void 0===F?null:(0,b.jsx)(L,{fleetId:t,party:w.name,read:F,outcome:q,now:new Date}),A&&z?(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)(y,{party:w.name}),children:(0,b.jsx)(D,{api:s,fleetId:t,name:w.name})}):null,"mcpServer"===w.kind?(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"data-testid":"outside-party-tools",children:[(0,b.jsx)("h2",{className:"text-section font-semibold",children:"Tools"}),(0,b.jsxs)("p",{className:"text-muted-foreground",children:["The fleet may call only the tools switched on, and a calling ship must hold every scope a tool needs; every ship that may reach ",w.name," reaches the same tools. ",z?null:"Changing them needs gateway:approve."]}),(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)(p,{party:w.name}),children:(0,b.jsx)(o,{api:s,fleetId:t,name:w.name,isApprover:z,isSignIn:A})})]}):null,void 0===B?null:(0,b.jsxs)("section",{className:`${g.r} grid gap-2`,"data-testid":"outside-party-cards",children:[(0,b.jsxs)("h2",{className:"flex justify-between text-section font-semibold",children:[(0,b.jsx)("span",{children:"Card addresses"}),B.isOk?(0,b.jsx)("span",{children:B.value.addresses.length}):null]}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"One per ship its proxy ship reaches now. Its owner hands them to the client."}),B.isOk?0===B.value.addresses.length?(0,b.jsx)("p",{className:"text-muted-foreground",children:"It reaches no ship now."}):(0,b.jsx)("ul",{className:"grid gap-1",children:B.value.addresses.map(a=>(0,b.jsx)("li",{className:"break-all font-mono text-code",children:a},a))}):(0,b.jsx)("p",{className:"text-muted-foreground",children:B.refusal})]}),u.includes("fleet:manage")?(0,b.jsx)("div",{children:(0,b.jsxs)("a",{className:g.x.secondary,href:(0,d.i)((0,i.N)(w.name,"retire"),t),"data-testid":"outside-party-retire",children:["Retire ",w.name,"…"]})}):null]})}a.s(["N",0,P,"p",0,O,"J",0,N,"b",0,U,"y",0,Q],9181)},22870,a=>{var b=a.i(11857);let c=(0,b.registerClientReference)(function(){throw Error("Attempted to call RemoveSignInForm() from the server but RemoveSignInForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/own-sign-in-forms.tsx","RemoveSignInForm"),d=(0,b.registerClientReference)(function(){throw Error("Attempted to call SignInForm() from the server but SignInForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/own-sign-in-forms.tsx","SignInForm");a.s(["RemoveSignInForm",0,c,"SignInForm",0,d])},45239,a=>{var b=a.i(22870);a.n(b)},56786,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call RepeatableSwitch() from the server but RepeatableSwitch is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/repeatable-switch.tsx","RepeatableSwitch");a.s(["RepeatableSwitch",0,b])},35670,a=>{var b=a.i(56786);a.n(b)}]})();
1
+ (()=>{"use strict";module.exports=[69717,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call AgentNeeds() from the server but AgentNeeds is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/tools-table/ui/agent-needs.tsx","AgentNeeds");a.s(["AgentNeeds",0,b])},4741,a=>{var b=a.i(69717);a.n(b)},64256,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call ToolsTable() from the server but ToolsTable is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/tools-table/ui/tools-table.tsx","ToolsTable");a.s(["ToolsTable",0,b])},46736,a=>{var b=a.i(64256);a.n(b)},82555,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call EveryonesSignInsCard() from the server but EveryonesSignInsCard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/everyones-sign-ins-card.tsx","EveryonesSignInsCard");a.s(["EveryonesSignInsCard",0,b])},26977,a=>{var b=a.i(82555);a.n(b)},9181,a=>{var b=a.i(7997),c=a.i(717),d=a.i(55476),e=a.i(66283),f=a.i(29493),g=a.i(49144),h=a.i(60057),i=a.i(72913),j=a.i(1130),k=a.i(98323),l=a.i(4741),m=a.i(46736);async function n({api:a,name:b}){let c=await (0,e.F)(a.parties.approving.query({name:b})),d=c.isOk&&c.value.isApproving,f=d?await (0,e.F)(a.parties.listedScopes.query()):void 0;return{canChange:d&&f?.isOk===!0,listed:f?.isOk===!0?f.value.scopes:null,reason:c.isOk?c.value.isApproving?f?.isOk===!1?f.refusal:null:c.value.reason:c.refusal}}async function o({api:a,fleetId:c,name:d,isApprover:f,isSignIn:g}){let[h,i,j]=await Promise.all([(0,e.F)(a.parties.tools.query({name:d})),(0,e.F)(a.parties.scopeRequirements.query({name:d})),f?n({api:a,name:d}):{canChange:!1,listed:null,reason:null}]);return i.isOk?g&&!h.isOk&&"PRECONDITION_FAILED"===h.code?(0,b.jsx)("p",{className:"text-muted-foreground",children:h.refusal}):(0,b.jsxs)("div",{className:"grid gap-3",children:[null===j.reason?null:(0,b.jsxs)("p",{className:"text-muted-foreground","data-testid":"tools-table-read-only-reason",children:["You see these read-only: ",j.reason]}),(0,b.jsx)(m.ToolsTable,{fleetId:c,party:d,tools:function({read:a,requirements:b}){let c=new Map(b.tools.map(({tool:a,scopes:b})=>[a,b]));return a.isOk?a.value.tools.map(a=>({...a,scopes:c.get(a.name)??[]})):b.tools.map(({tool:a,scopes:b})=>({name:a,isOn:null,isNew:!1,scopes:b}))}({read:h,requirements:i.value}),version:i.value.version,partyScopes:i.value.party,listed:j.listed,canChange:j.canChange,serverRefusal:h.isOk?null:h.refusal})]}):(0,b.jsx)("p",{className:"text-muted-foreground",children:i.refusal})}function p({party:a}){return(0,b.jsxs)("div",{"aria-busy":"true","aria-label":`Reading the tools ${a} lists`,className:"grid gap-2","data-testid":"tools-table-skeleton",children:[(0,b.jsx)("span",{className:"block h-9 w-full animate-pulse rounded-md bg-muted"}),Array.from({length:8},(a,c)=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},c))]})}async function q(a,b){try{return(await a.account.apps.query()).fleets.find(({id:a})=>a===b)?.name??"this fleet"}catch(a){if(void 0===(0,e.U)(a))throw a;return"this fleet"}}async function r({api:a,fleetId:b,name:c}){try{return{kind:"read",own:await a.parties.ownSignIn.query({name:c})}}catch(c){if("FORBIDDEN"===(0,e.U)(c))return{kind:"noPersonShip",fleetName:await q(a,b)};return{kind:"refused",message:(0,e.s)(c)}}}function s({state:a,testId:c}){switch(a.kind){case"idle":return null;case"done":return(0,b.jsx)("p",{role:"status","data-testid":c,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:a.message});case"refused":case"openNetwork":return(0,b.jsx)("p",{role:"alert","data-testid":c,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a.message})}}var t=a.i(60960);let u={signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}};function v(a){return a.personName??a.personShipId}function w({count:a}){return(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("h2",{className:"text-section font-semibold",children:"Everyone's sign-ins"}),null===a?null:(0,b.jsx)("span",{className:"text-muted-foreground",children:a})]})}function x(){return(0,b.jsx)("thead",{className:"max-sm:hidden",children:(0,b.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"Person"}),(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"Account"}),(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"State"}),(0,b.jsx)("th",{className:"h-10 px-2 font-medium",children:"Last used"}),(0,b.jsx)("th",{className:"h-10 px-2",children:(0,b.jsx)("span",{className:"sr-only",children:"Remove"})})]})})}function y({party:a}){return(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"aria-busy":"true","aria-label":`Reading everyone's sign-ins to ${a}`,"data-testid":"outside-party-sign-ins-skeleton",children:[(0,b.jsx)(w,{count:null}),(0,b.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,b.jsx)(x,{}),(0,b.jsx)("tbody",{className:"max-sm:grid",children:Array.from({length:3},(a,c)=>(0,b.jsxs)("tr",{className:"border-b border-border last:border-b-0 max-sm:grid max-sm:gap-1 max-sm:py-3",children:[(0,b.jsx)("td",{className:"h-12 px-2 max-sm:h-auto max-sm:px-0",children:(0,b.jsx)("span",{className:"block h-3.5 w-20 animate-pulse rounded-md bg-muted max-sm:w-2/5"})}),(0,b.jsx)("td",{className:"h-12 px-2 max-sm:h-auto max-sm:px-0",children:(0,b.jsx)("span",{className:"block h-3.5 w-36 animate-pulse rounded-md bg-muted max-sm:w-3/4"})}),(0,b.jsx)("td",{className:"h-12 px-2 max-sm:hidden",children:(0,b.jsx)("span",{className:"block h-3.5 w-16 animate-pulse rounded-md bg-muted"})}),(0,b.jsx)("td",{className:"h-12 px-2 max-sm:hidden",children:(0,b.jsx)("span",{className:"block h-3.5 w-20 animate-pulse rounded-md bg-muted"})}),(0,b.jsx)("td",{className:"max-sm:hidden"})]},c))})]})]})}function z({signIn:a,party:c,isRemoving:d,onConfirm:e,onKeep:f}){let h=v(a);return(0,b.jsxs)("div",{className:"grid gap-2 rounded-md bg-muted p-3","data-testid":"outside-party-sign-ins-confirm",children:[(0,b.jsxs)("p",{children:["Remove ",h,"'s sign-in? Their ships' calls to ",c," are refused until they sign in again."]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:g.x.destructive,disabled:d,"aria-busy":d,onClick:e,"data-testid":"outside-party-sign-ins-remove-confirmed",children:d?"Removing…":`Remove ${h}'s sign-in`}),(0,b.jsx)("button",{type:"button",className:g.x.secondary,onClick:f,children:"Keep"})]})]})}function A(a){let{party:c,now:d,rows:e,refusal:f,hasMore:h,isLoadingMore:i,confirming:j,removing:l,outcome:m}=a;return(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"data-testid":"outside-party-sign-ins",children:[(0,b.jsx)(w,{count:null===f?e.length:null}),(0,b.jsx)(s,{state:m}),null!==f?(0,b.jsx)(s,{state:{kind:"refused",message:f}}):0===e.length?(0,b.jsx)("p",{className:"text-muted-foreground",children:"Nobody has signed in yet."}):(0,b.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,b.jsx)(x,{}),(0,b.jsx)("tbody",{className:"max-sm:grid",children:e.map(e=>{let f=u[e.state],h=j===e.personShipId,i=null===e.lastUsedAt?"Not yet":(0,t.h)(e.lastUsedAt,new Date(d));return[(0,b.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,b.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:[v(e),e.isYours?(0,b.jsx)("span",{className:"font-normal text-muted-foreground",children:" (you)"}):null]}),(0,b.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:a}){return a.name??a.subject??(0,b.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}(e),(0,b.jsxs)("span",{className:"sm:hidden",children:[" · last used ",null===e.lastUsedAt?"not yet":i]})]}),(0,b.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,b.jsx)(k.T,{tone:f.tone,label:f.label})}),(0,b.jsx)("td",{className:"h-12 px-2 text-muted-foreground max-sm:hidden",children:i}),(0,b.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,b.jsx)("button",{type:"button",className:`${g.x.secondary} ${h?"max-sm:hidden":""}`,onClick:()=>{a.onRemove(e.personShipId)},"data-testid":"outside-party-sign-ins-remove",children:"Remove"})})]},e.personShipId),h?(0,b.jsx)("tr",{className:"border-b border-border last:border-b-0 max-sm:block max-sm:pb-3",children:(0,b.jsx)("td",{colSpan:5,className:"pb-2 max-sm:block max-sm:pb-0",children:(0,b.jsx)(z,{signIn:e,party:c,isRemoving:l===e.personShipId,onConfirm:()=>{a.onConfirm(e)},onKeep:a.onKeep})})},`${e.personShipId}-confirm`):null]})})]}),null===f&&h?(0,b.jsx)("div",{children:(0,b.jsx)("button",{type:"button",className:g.x.secondary,disabled:i,"aria-busy":i,onClick:a.onMore,"data-testid":"outside-party-sign-ins-more",children:i?"Showing more…":"Show more"})}):null]})}var B=a.i(26977);let C=()=>void 0;async function D({api:a,fleetId:c,name:d}){let f=await (0,e.F)(a.parties.signIns.query({name:d,after:null})),g=new Date().toISOString();return f.isOk?(0,b.jsx)(B.EveryonesSignInsCard,{fleetId:c,party:d,now:g,first:f.value}):(0,b.jsx)(A,{party:d,now:g,rows:[],refusal:f.refusal,hasMore:!1,isLoadingMore:!1,confirming:null,removing:null,outcome:{kind:"idle"},onRemove:C,onConfirm:C,onKeep:C,onMore:C})}function E({label:a,children:c}){return(0,b.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[10rem_1fr]",children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:a}),(0,b.jsx)("dd",{className:"flex flex-wrap items-center gap-2",children:c})]})}var F=a.i(45239);let G={notSignedIn:{tone:"ended",label:"Not signed in"},signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}},H={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"};function I({outcome:a,party:c}){let{message:d,tone:e,isAlert:f}=function(a,b){switch(a){case"signedIn":return{message:`You are signed in to ${b}.`,tone:"ok",isAlert:!1};case"removed":return{message:`Your sign-in to ${b} is removed.`,tone:"ok",isAlert:!1};case"failed":return{message:"The sign-in did not finish: press Sign in again.",tone:"attention",isAlert:!0};case"turnedAway":return{message:`That ${b} account is another person's sign-in in this fleet: sign in as your own.`,tone:"attention",isAlert:!0};case"cancelled":return{message:`You are not signed in to ${b}: the sign-in was cancelled or refused there.`,tone:"ended",isAlert:!1};case"unavailable":return{message:`${b}'s sign-in did not answer: try again in a moment.`,tone:"attention",isAlert:!0}}}(a.kind,c);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{role:f?"alert":"status",className:`rounded-md border px-3 py-2 ${H[e]}`,children:d}),null===a.serverError?null:(0,b.jsx)("div",{children:(0,b.jsx)(k.E,{isMono:!0,children:a.serverError})})]})}function J({outsideAccount:a}){return a.name??a.subject??(0,b.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}function K({own:a,fleetId:c,party:d,now:e}){switch(a.state){case"notSignedIn":return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-muted-foreground",children:["Until you sign in, your ships' calls to ",d," are refused."]}),(0,b.jsx)(F.SignInForm,{fleetId:c,party:d,label:"Sign in",kind:"primary"})]});case"signedIn":return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("dl",{className:"grid gap-3",children:[(0,b.jsx)(E,{label:"Account",children:J(a)}),(0,b.jsx)(E,{label:"Signed in",children:(0,t.h)(a.signedInAt,e)}),(0,b.jsx)(E,{label:"Last used",children:null===a.lastUsedAt?"Not yet":(0,t.h)(a.lastUsedAt,e)})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-start gap-2",children:[(0,b.jsx)(F.SignInForm,{fleetId:c,party:d,label:"Sign in again",kind:"secondary"}),(0,b.jsx)(F.RemoveSignInForm,{fleetId:c,party:d})]})]});case"lost":return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{children:[d," refused to refresh it on ",(0,t.x)(a.lost.at),": ",(0,b.jsx)("span",{className:"font-mono text-code",children:a.lost.why}),". Your ships' calls to ",d," are refused."]}),(0,b.jsxs)("dl",{className:"grid gap-3",children:[(0,b.jsx)(E,{label:"Account",children:J(a)}),(0,b.jsx)(E,{label:"Last used",children:null===a.lastUsedAt?"Not yet":(0,t.h)(a.lastUsedAt,e)})]}),(0,b.jsx)(F.SignInForm,{fleetId:c,party:d,label:"Sign in again",kind:"primary"})]})}}function L({fleetId:a,party:c,read:d,outcome:e,now:f}){let h="read"===d.kind?G[d.own.state]:null;return(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"data-testid":"outside-party-sign-in",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("h2",{className:"text-section font-semibold",children:"Your sign-in"}),null===h?null:(0,b.jsx)(k.T,{tone:h.tone,label:h.label})]}),"read"===d.kind&&null!==e?(0,b.jsx)(I,{outcome:e,party:c}):null,"read"===d.kind?(0,b.jsx)(K,{own:d.own,fleetId:a,party:c,now:f}):"noPersonShip"===d.kind?(0,b.jsxs)("p",{className:"text-muted-foreground",children:["Signing in needs a person ship in ",d.fleetName,"."]}):(0,b.jsx)(s,{state:{kind:"refused",message:d.message}})]})}var M=a.i(35670);let N="fleet:owner",O="scopes:grant",P="gateway:approve";function Q({children:a}){return(0,b.jsx)("p",{role:"alert",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a})}let R={mcpServer:"Address",mcpClient:"Client id",a2aClient:"Address",a2aAgent:"Card address"},S=(0,b.jsx)("span",{className:"text-muted-foreground",children:"Not known"});function T({party:a}){let{protocol:c,side:d}=h.G[a.kind],e=h.Y[a.state];return(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("h1",{className:"text-heading-touch font-semibold max-sm:sr-only",children:a.name}),(0,b.jsx)(k.E,{children:c}),(0,b.jsx)(k.E,{children:h.N[d].one}),(0,b.jsx)(k.T,{tone:e.tone,label:e.label})]})}async function U({page:a,name:m,outcome:q}){let{api:s,fleetId:t,scopes:u}=a,v=await (0,e.F)(s.parties.get.query({name:m}));if(!v.isOk)return(0,b.jsx)("div",{className:"grid gap-4",children:(0,b.jsx)(Q,{children:v.refusal})});let w=v.value,x=(0,h.M)(w),z=u.includes(P),A="mcpServer"===w.kind&&w.credentialKind===f.m.kind,[B,C,F]=await Promise.all(["a2aClient"===w.kind?(0,e.F)(s.parties.cardAddresses.query({name:m})):void 0,"a2aAgent"===w.kind?Promise.all([(0,e.F)(s.parties.scopeRequirements.query({name:m})),z?n({api:s,name:m}):{canChange:!1,listed:null,reason:null}]):void 0,A?r({api:s,fleetId:t,name:m}):void 0]),G=(0,b.jsx)("a",{href:(0,d.i)((0,i.N)(w.name,"change"),t),className:"text-primary hover:underline","data-testid":"outside-party-change",children:"Change"});return(0,b.jsxs)("div",{className:"grid gap-4",children:[(0,b.jsx)(T,{party:w}),(0,b.jsxs)("dl",{className:`${g.r} grid gap-3`,children:[(0,b.jsx)(E,{label:"Proxy ship",children:w.proxyShipName??S}),(0,b.jsxs)(E,{label:"Owner",children:[w.ownerName??S,u.includes(N)?G:null]}),(0,b.jsxs)(E,{label:"Scopes",children:[null===w.scopes?S:w.scopes.map(a=>{let c;return(0,b.jsx)(k.E,{children:(c=j.K.safeParse(a)).success?j.q[c.data]:a},a)}),u.includes(O)?G:null]}),"mcpServer"===w.kind||"a2aAgent"===w.kind?(0,b.jsx)(E,{label:"Credential",children:f.a.find(({kind:a})=>a===w.credentialKind)?.label}):null,null===x?null:(0,b.jsx)(E,{label:R[w.kind],children:(0,b.jsx)("span",{className:"font-mono",children:x})}),"a2aAgent"===w.kind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E,{label:"Messages at once",children:w.concurrencyLimit}),(0,b.jsx)(E,{label:"Needs",children:void 0===C?null:C[0].isOk?(0,b.jsx)(l.AgentNeeds,{fleetId:t,party:w.name,version:C[0].value.version,scopes:C[0].value.party,listed:C[1].listed,canChange:C[1].canChange}):(0,b.jsx)("span",{className:"text-muted-foreground",children:C[0].refusal})}),(0,b.jsx)(E,{label:"Repeatable",children:u.includes(P)?(0,b.jsx)(M.RepeatableSwitch,{fleetId:t,party:w.name,isRepeatable:w.isRepeatable}):(0,b.jsx)(k.E,{children:w.isRepeatable?"Repeatable":"Not repeatable"})})]}):null]}),void 0===F?null:(0,b.jsx)(L,{fleetId:t,party:w.name,read:F,outcome:q,now:new Date}),A&&z?(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)(y,{party:w.name}),children:(0,b.jsx)(D,{api:s,fleetId:t,name:w.name})}):null,"mcpServer"===w.kind?(0,b.jsxs)("section",{className:`${g.r} grid gap-3`,"data-testid":"outside-party-tools",children:[(0,b.jsx)("h2",{className:"text-section font-semibold",children:"Tools"}),(0,b.jsxs)("p",{className:"text-muted-foreground",children:["The fleet may call only the tools switched on, and a calling ship must hold every scope a tool needs; every ship that may reach ",w.name," reaches the same tools. ",z?null:"Changing them needs gateway:approve."]}),(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)(p,{party:w.name}),children:(0,b.jsx)(o,{api:s,fleetId:t,name:w.name,isApprover:z,isSignIn:A})})]}):null,void 0===B?null:(0,b.jsxs)("section",{className:`${g.r} grid gap-2`,"data-testid":"outside-party-cards",children:[(0,b.jsxs)("h2",{className:"flex justify-between text-section font-semibold",children:[(0,b.jsx)("span",{children:"Card addresses"}),B.isOk?(0,b.jsx)("span",{children:B.value.addresses.length}):null]}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"One per ship its proxy ship reaches now. Its owner hands them to the client."}),B.isOk?0===B.value.addresses.length?(0,b.jsx)("p",{className:"text-muted-foreground",children:"It reaches no ship now."}):(0,b.jsx)("ul",{className:"grid gap-1",children:B.value.addresses.map(a=>(0,b.jsx)("li",{className:"break-all font-mono text-code",children:a},a))}):(0,b.jsx)("p",{className:"text-muted-foreground",children:B.refusal})]}),u.includes("fleet:manage")?(0,b.jsx)("div",{children:(0,b.jsxs)("a",{className:g.x.secondary,href:(0,d.i)((0,i.N)(w.name,"retire"),t),"data-testid":"outside-party-retire",children:["Retire ",w.name,"…"]})}):null]})}a.s(["N",0,P,"p",0,O,"J",0,N,"b",0,U,"y",0,Q],9181)},22870,a=>{var b=a.i(11857);let c=(0,b.registerClientReference)(function(){throw Error("Attempted to call RemoveSignInForm() from the server but RemoveSignInForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/own-sign-in-forms.tsx","RemoveSignInForm"),d=(0,b.registerClientReference)(function(){throw Error("Attempted to call SignInForm() from the server but SignInForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/own-sign-in-forms.tsx","SignInForm");a.s(["RemoveSignInForm",0,c,"SignInForm",0,d])},45239,a=>{var b=a.i(22870);a.n(b)},56786,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call RepeatableSwitch() from the server but RepeatableSwitch is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/outside-party/ui/repeatable-switch.tsx","RepeatableSwitch");a.s(["RepeatableSwitch",0,b])},35670,a=>{var b=a.i(56786);a.n(b)}]})();
2
2
 
3
3
  //# sourceMappingURL=web_features_outside-party_1-lre9nfakki7._.js.map