@aeolus-fleet/gateway 0.37.1 → 0.37.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/adapters/fleet/active-ships.js +24 -1
  2. package/dist/adapters/fleet/active-ships.js.map +1 -1
  3. package/dist/adapters/prisma/changes.d.ts +8 -3
  4. package/dist/adapters/prisma/changes.js +18 -2
  5. package/dist/adapters/prisma/changes.js.map +1 -1
  6. package/dist/app.js +19 -11
  7. package/dist/app.js.map +1 -1
  8. package/dist/core/people/held-deliveries.d.ts +30 -0
  9. package/dist/core/people/held-deliveries.js +42 -0
  10. package/dist/core/people/held-deliveries.js.map +1 -0
  11. package/dist/core/people/opened-of.d.ts +2 -0
  12. package/dist/core/people/opened-of.js.map +1 -1
  13. package/dist/core/people/ports.d.ts +8 -0
  14. package/dist/core/people/read-basket.d.ts +2 -0
  15. package/dist/core/people/read-basket.js.map +1 -1
  16. package/dist/core/people/read-bridge-home.d.ts +2 -0
  17. package/dist/core/people/read-bridge-home.js.map +1 -1
  18. package/dist/core/people/read-inbox.d.ts +16 -8
  19. package/dist/core/people/read-inbox.js +21 -10
  20. package/dist/core/people/read-inbox.js.map +1 -1
  21. package/dist/core/people/send-stored-answers.d.ts +2 -0
  22. package/dist/core/people/send-stored-answers.js +1 -1
  23. package/dist/core/people/send-stored-answers.js.map +1 -1
  24. package/package.json +1 -1
  25. package/web/.next/BUILD_ID +1 -1
  26. package/web/.next/build-manifest.json +3 -3
  27. package/web/.next/diagnostics/route-bundle-stats.json +75 -75
  28. package/web/.next/fallback-build-manifest.json +3 -3
  29. package/web/.next/prerender-manifest.json +3 -3
  30. package/web/.next/server/app/(bridge)/bridge/basket/page/server-reference-manifest.json +10 -10
  31. package/web/.next/server/app/(bridge)/bridge/basket/page.js.nft.json +1 -1
  32. package/web/.next/server/app/(bridge)/bridge/basket/page_client-reference-manifest.js +1 -1
  33. package/web/.next/server/app/(bridge)/bridge/done/page/server-reference-manifest.json +4 -4
  34. package/web/.next/server/app/(bridge)/bridge/done/page.js.nft.json +1 -1
  35. package/web/.next/server/app/(bridge)/bridge/done/page_client-reference-manifest.js +1 -1
  36. package/web/.next/server/app/(bridge)/bridge/fleet/page/server-reference-manifest.json +3 -3
  37. package/web/.next/server/app/(bridge)/bridge/fleet/page.js.nft.json +1 -1
  38. package/web/.next/server/app/(bridge)/bridge/fleet/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/(bridge)/bridge/page/server-reference-manifest.json +9 -9
  40. package/web/.next/server/app/(bridge)/bridge/page.js.nft.json +1 -1
  41. package/web/.next/server/app/(bridge)/bridge/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(bridge)/bridge/settings/page/server-reference-manifest.json +3 -3
  43. package/web/.next/server/app/(bridge)/bridge/settings/page.js.nft.json +1 -1
  44. package/web/.next/server/app/(bridge)/bridge/settings/page_client-reference-manifest.js +1 -1
  45. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page/server-reference-manifest.json +4 -4
  46. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page.js.nft.json +1 -1
  47. package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(bridge)/bridge/settings/routing/page/server-reference-manifest.json +7 -7
  49. package/web/.next/server/app/(bridge)/bridge/settings/routing/page.js.nft.json +1 -1
  50. package/web/.next/server/app/(bridge)/bridge/settings/routing/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/(bridge)/bridge/stay-aware/page/server-reference-manifest.json +9 -9
  52. package/web/.next/server/app/(bridge)/bridge/stay-aware/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(bridge)/bridge/stay-aware/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page/server-reference-manifest.json +18 -18
  55. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page.js.nft.json +1 -1
  56. package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
  57. package/web/.next/server/app/(bridge)/outside-parties/[name]/page/server-reference-manifest.json +10 -10
  58. package/web/.next/server/app/(bridge)/outside-parties/[name]/page.js.nft.json +1 -1
  59. package/web/.next/server/app/(bridge)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page/server-reference-manifest.json +18 -18
  61. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page.js.nft.json +1 -1
  62. package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/(bridge)/outside-parties/add/page/server-reference-manifest.json +12 -12
  64. package/web/.next/server/app/(bridge)/outside-parties/add/page.js.nft.json +1 -1
  65. package/web/.next/server/app/(bridge)/outside-parties/add/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +4 -4
  67. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page.js.nft.json +1 -1
  68. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +1 -1
  69. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page/server-reference-manifest.json +4 -4
  70. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page.js.nft.json +1 -1
  71. package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/(bridge)/outside-parties/page/server-reference-manifest.json +4 -4
  73. package/web/.next/server/app/(bridge)/outside-parties/page.js.nft.json +1 -1
  74. package/web/.next/server/app/(bridge)/outside-parties/page_client-reference-manifest.js +1 -1
  75. package/web/.next/server/app/(console)/gateway-off/page/server-reference-manifest.json +1 -1
  76. package/web/.next/server/app/(console)/gateway-off/page.js.nft.json +1 -1
  77. package/web/.next/server/app/(console)/gateway-off/page_client-reference-manifest.js +1 -1
  78. package/web/.next/server/app/(console)/meetings/[meetingId]/page/server-reference-manifest.json +3 -3
  79. package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.nft.json +1 -1
  80. package/web/.next/server/app/(console)/meetings/[meetingId]/page_client-reference-manifest.js +1 -1
  81. package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +8 -8
  82. package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
  83. package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
  85. package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
  86. package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
  87. package/web/.next/server/app/(console)/slack/disconnect/page/server-reference-manifest.json +10 -10
  88. package/web/.next/server/app/(console)/slack/disconnect/page.js.nft.json +1 -1
  89. package/web/.next/server/app/(console)/slack/disconnect/page_client-reference-manifest.js +1 -1
  90. package/web/.next/server/app/(console)/slack/expose/page/server-reference-manifest.json +10 -10
  91. package/web/.next/server/app/(console)/slack/expose/page.js.nft.json +1 -1
  92. package/web/.next/server/app/(console)/slack/expose/page_client-reference-manifest.js +1 -1
  93. package/web/.next/server/app/(console)/slack/page/server-reference-manifest.json +10 -10
  94. package/web/.next/server/app/(console)/slack/page.js.nft.json +1 -1
  95. package/web/.next/server/app/(console)/slack/page_client-reference-manifest.js +1 -1
  96. package/web/.next/server/app/(console)/slack/remove/page/server-reference-manifest.json +10 -10
  97. package/web/.next/server/app/(console)/slack/remove/page.js.nft.json +1 -1
  98. package/web/.next/server/app/(console)/slack/remove/page_client-reference-manifest.js +1 -1
  99. package/web/.next/server/app/_global-error.html +1 -1
  100. package/web/.next/server/app/_global-error.rsc +1 -1
  101. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  102. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  103. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  104. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  105. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  106. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  107. package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
  108. package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
  109. package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
  110. package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
  111. package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
  112. package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
  113. package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
  114. package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
  115. package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
  116. package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js +1 -1
  117. package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js +1 -1
  119. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js.map +1 -1
  120. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js +1 -1
  121. package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js +1 -1
  123. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js +1 -1
  125. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js +1 -1
  127. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js +1 -1
  129. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js +1 -1
  131. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js +1 -1
  133. package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ipo8r1s1ntds._.js +1 -1
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js +1 -1
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js +1 -1
  138. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/[root-of-the-server]__0xurmpdv5uqfl._.js +1 -1
  140. package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js +1 -1
  141. package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js +1 -1
  143. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.js +1 -1
  147. package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.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/{_0d9el5z4r07h8._.js → _0phqji_8-1g8r._.js} +2 -2
  155. package/web/.next/server/chunks/ssr/{_0nmqkf1y-qsc2._.js.map → _0phqji_8-1g8r._.js.map} +1 -1
  156. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
  157. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
  158. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
  159. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
  160. package/web/.next/server/chunks/ssr/{_0nmqkf1y-qsc2._.js → _0yt_0nnqp7qsf._.js} +2 -2
  161. package/web/.next/server/chunks/ssr/{_0d9el5z4r07h8._.js.map → _0yt_0nnqp7qsf._.js.map} +1 -1
  162. package/web/.next/server/chunks/ssr/{_0msh_lv5ns4e9._.js → _12yl1q5vpvmnf._.js} +2 -2
  163. package/web/.next/server/chunks/ssr/{_1a-gh-psko_2f._.js.map → _12yl1q5vpvmnf._.js.map} +1 -1
  164. package/web/.next/server/chunks/ssr/{_1a-gh-psko_2f._.js → _15oq7v7za6xc0._.js} +2 -2
  165. package/web/.next/server/chunks/ssr/{_0msh_lv5ns4e9._.js.map → _15oq7v7za6xc0._.js.map} +1 -1
  166. package/web/.next/server/chunks/ssr/_19gyfcgdw7y22._.js +57 -0
  167. package/web/.next/server/chunks/ssr/_19gyfcgdw7y22._.js.map +1 -0
  168. package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js +1 -1
  169. package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
  171. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
  172. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
  173. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
  174. package/web/.next/server/chunks/ssr/_1whn-m68y_cvc._.js +57 -0
  175. package/web/.next/server/chunks/ssr/_1whn-m68y_cvc._.js.map +1 -0
  176. package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js +1 -1
  177. package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js.map +1 -1
  178. package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js +1 -1
  179. package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js +1 -1
  181. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js.map +1 -1
  182. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js +1 -1
  183. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js.map +1 -1
  184. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js +1 -1
  185. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js.map +1 -1
  186. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js +1 -1
  187. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js.map +1 -1
  188. package/web/.next/server/chunks/ssr/{web_features_11rwm0rhf5957._.js → web_features_05tyk8t8uz71m._.js} +2 -2
  189. package/web/.next/server/chunks/ssr/{web_features_11rwm0rhf5957._.js.map → web_features_05tyk8t8uz71m._.js.map} +1 -1
  190. package/web/.next/server/chunks/ssr/{web_features_0cgvngtsgzu24._.js → web_features_0hnjtl8jg_qhq._.js} +2 -2
  191. package/web/.next/server/chunks/ssr/{web_features_0cgvngtsgzu24._.js.map → web_features_0hnjtl8jg_qhq._.js.map} +1 -1
  192. package/web/.next/server/chunks/ssr/{web_features_1loqabdanp8wi._.js → web_features_1_648zpxn76jp._.js} +2 -2
  193. package/web/.next/server/chunks/ssr/{web_features_1loqabdanp8wi._.js.map → web_features_1_648zpxn76jp._.js.map} +1 -1
  194. package/web/.next/server/chunks/ssr/{web_features_1r2u065j-hgrq._.js → web_features_1uzz6jypukhkx._.js} +2 -2
  195. package/web/.next/server/chunks/ssr/{web_features_1r2u065j-hgrq._.js.map → web_features_1uzz6jypukhkx._.js.map} +1 -1
  196. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +1 -1
  197. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -1
  198. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +1 -1
  199. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -1
  200. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
  201. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
  202. package/web/.next/server/chunks/ssr/{web_features_bridge_17dx2edv4zsex._.js → web_features_bridge_0ldot9q_-xh4o._.js} +2 -2
  203. package/web/.next/server/chunks/ssr/{web_features_bridge_17dx2edv4zsex._.js.map → web_features_bridge_0ldot9q_-xh4o._.js.map} +1 -1
  204. package/web/.next/server/chunks/ssr/web_features_bridge_hooks_bridge-actions_ts_0h-_xm2rcb-ij._.js +1 -1
  205. package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js +1 -1
  206. package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js.map +1 -1
  207. package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js +1 -1
  208. package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js.map +1 -1
  209. package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js +1 -1
  210. package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js.map +1 -1
  211. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js +1 -1
  212. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map +1 -1
  213. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
  214. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
  215. package/web/.next/server/chunks/ssr/web_features_outside-party_1-lre9nfakki7._.js +1 -1
  216. package/web/.next/server/chunks/ssr/web_features_outside-party_1-lre9nfakki7._.js.map +1 -1
  217. package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
  218. package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
  219. package/web/.next/server/chunks/ssr/web_features_slack_actions_ts_1l3yg9vl20_vu._.js +1 -1
  220. package/web/.next/server/middleware-build-manifest.js +3 -3
  221. package/web/.next/server/pages/500.html +1 -1
  222. package/web/.next/server/preview-props.json +3 -3
  223. package/web/.next/server/server-reference-manifest.js +1 -1
  224. package/web/.next/server/server-reference-manifest.json +49 -49
  225. package/web/.next/static/chunks/{3nqasvqr8d81s.js → 037n80h9g7uj9.js} +1 -1
  226. package/web/.next/static/chunks/{0klu03tcnjzsm.js → 07m-_glbqp-37.js} +1 -1
  227. package/web/.next/static/chunks/0aa4uzjjhyqka.js +1 -0
  228. package/web/.next/static/chunks/{3bvcgvk4m3hxh.js → 10irrhgnj6fen.js} +1 -1
  229. package/web/.next/static/chunks/{12kwix3z2z-fs.js → 13wwvyhf3sngt.js} +1 -1
  230. package/web/.next/static/chunks/15n0w5axo2pz9.js +1 -0
  231. package/web/.next/static/chunks/{1oipnf2j_m8oy.js → 1zz_y28tujbue.js} +1 -1
  232. package/web/.next/static/chunks/{2ztqsnh1sq5f9.js → 2bdw63_s9xtu_.js} +1 -1
  233. package/web/.next/static/chunks/{0d0fsf26a1ep_.js → 2v9rmbrsi3gic.js} +1 -1
  234. package/web/.next/static/chunks/{1az8wx3bt0tc-.js → 3-1jjh1cn7c8-.js} +1 -1
  235. package/web/.next/static/chunks/{3c2whoiify4hd.js → 37he-4csbzq66.js} +1 -1
  236. package/web/.next/static/chunks/{3q_d1vlm22cy0.js → 3ce0mcxr613x9.js} +1 -1
  237. package/web/.next/static/chunks/3q96u74uhyutq.js +1 -0
  238. package/web/.next/static/chunks/{3po7blcdi5_y6.js → 3qdxrlqdxsqgz.js} +1 -1
  239. package/web/.next/static/chunks/{0jqdvhip5x6im.js → 3tjpz6bq80t74.js} +1 -1
  240. package/web/.next/trace +1 -1
  241. package/web/.next/trace-build +1 -1
  242. package/web/.next/server/chunks/ssr/_1e720g1qty0xj._.js +0 -57
  243. package/web/.next/server/chunks/ssr/_1e720g1qty0xj._.js.map +0 -1
  244. package/web/.next/server/chunks/ssr/_1xjxj1ur-j87t._.js +0 -57
  245. package/web/.next/server/chunks/ssr/_1xjxj1ur-j87t._.js.map +0 -1
  246. package/web/.next/static/chunks/04r-53h_fb5rq.js +0 -1
  247. package/web/.next/static/chunks/2fjzmc7-5sf_m.js +0 -1
  248. package/web/.next/static/chunks/38w8690okopia.js +0 -1
  249. /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → LxcgnSJuKSN0rA6kJgwr6}/_buildManifest.js +0 -0
  250. /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → LxcgnSJuKSN0rA6kJgwr6}/_clientMiddlewareManifest.js +0 -0
  251. /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → LxcgnSJuKSN0rA6kJgwr6}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70812,71136,96315,28623,e=>{var a=e.i(56420);let i={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};i.node;let t=(0,a.f)(i);e.s(["f",0,t],70812);let n={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};n.node;let s=(0,a.f)(n);e.s(["f",0,s],71136);let r={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};r.node;let o=(0,a.f)(r);e.s(["f",0,o],96315);let l={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};l.node;let d=(0,a.f)(l);e.s(["f",0,d],28623)},51481,e=>{var a=e.i(75043);e.s(["f",()=>a.f])},59381,e=>{var a=e.i(56420);let i={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};i.node;let t=(0,a.f)(i);e.s(["f",0,t],59381)},87765,31714,e=>{var a=e.i(95187);let i=(0,a.createServerReference)("40b105461ed5180c1e4e9f65c6e5ee21504611accd",a.callServer,void 0,a.findSourceMapURL,"turnRoute");e.s(["f",0,i],87765);var t=e.i(70812),n=e.i(51481),s=e.i(59381),r=e.i(71136),o=e.i(96315),l=e.i(56420);let d={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};d.node;let c=(0,l.f)(d);var u=e.i(49287),m=e.i(28623);let h={decide:{Icon:n.f,tone:"text-tone-active-fg"},do:{Icon:s.f,tone:"text-tone-waiting-fg"},"stay-aware":{Icon:t.f,tone:"text-muted-foreground"},"everything-else":{Icon:c,tone:"text-muted-foreground"}},p=u.f,f={slack:r.f,chat:m.f,"web-push":t.f,email:o.f};e.s(["x",0,p,"c",0,h,"U",0,f],31714)},31785,e=>{let a={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},i={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},t=["decide","do"],n="Bridge keeps every item.",s={label:"Not offered",isOk:!1},r={label:"Off",isOk:!1},o="Says only that something waits, with a link here.",l=`${o} Nothing is on until you turn it on.`,d="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,a,"k",0,i,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${d}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${d}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:a}){return e?a?{state:{label:"On",isOk:!0},description:o,action:"turnOff"}:{state:r,description:l,action:"turnOn"}:{state:s,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,a){return e.jobs.filter(({job:e,places:i})=>i.email!==a&&(!a||t.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:a}))},"r",0,function(e){let a=["Bridge",...e.map(e=>c[e])],i=a.at(-1),t=1===a.length?"Bridge":`${a.slice(0,-1).join(", ")} and ${String(i)}`;return`Shows in ${t}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:a,link:i}=e;return null===i?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${a} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${i.slackName} in ${a}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:t,place:s,isOn:r,waiting:o,isChatOn:l}=e,{name:d,item:c,items:u}=a[t],m=`${i[s]} is ${r?"on":"off"} for ${d}`;return r?"chat"===s?{title:m,detail:`A chat lists every ${c} not done when you ask it.`}:{title:m,detail:`${i[s]} shows ${u} that arrive from now on.${void 0===o||0===o?"":` The ${String(o)} already waiting ${1===o?"stays":"stay"} ${l?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:m,detail:"everything-else"===t&&"slack"===s?`Bots only: a bot ship's messages and replies to Slack still show there. ${n}`:n}},"B",0,function(e){if(!e.isOffered)return{state:s,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:r,description:"This browser takes no web push.",action:"none"};let a=e.browsers.find(({endpoint:a,isGone:i})=>a===e.ownEndpoint&&!i);return void 0===a?{state:r,description:l,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${a.browser}. ${o}`,action:"remove"}}])},41398,e=>{var a=e.i(43476),i=e.i(71645),t=e.i(87765),n=e.i(95187);let s=(0,n.createServerReference)("40f4b4eb49279e8395359781351dbbf28623530f37",n.callServer,void 0,n.findSourceMapURL,"unlinkSlack"),r=[[/Edg\//,"Edge"],[/Firefox\//,"Firefox"],[/Chrome\//,"Chrome"],[/Safari\//,"Safari"]],o=[[/iPhone|iPad/,"iOS"],[/Android/,"Android"],[/Mac OS X/,"macOS"],[/Windows/,"Windows"],[/Linux/,"Linux"]],l=(e,a)=>a.find(([a])=>a.test(e))?.[1],d=(0,n.createServerReference)("6050542061a8722cadd772f635ab49f34ca8df98f3",n.callServer,void 0,n.findSourceMapURL,"turnOffWebPush"),c=(0,n.createServerReference)("607f1c42ea803f083c89d5ded23c2d6843d246b62d",n.callServer,void 0,n.findSourceMapURL,"turnOnWebPush"),u="/wake-worker.js";async function m(){let e=await navigator.serviceWorker.getRegistration(u);return await e?.pushManager.getSubscription()??null}async function h(e){let a;if(await Notification.requestPermission()!=="granted")return{isOk:!1,message:"Your browser did not allow notifications from this site: allow them, then turn web push on again"};let i=await navigator.serviceWorker.register(u);return await navigator.serviceWorker.ready,{isOk:!0,value:await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:(a=atob(e.replaceAll("-","+").replaceAll("_","/")),Uint8Array.from(a,e=>e.charCodeAt(0)))})}}var p=e.i(31785),f=e.i(55070),g=e.i(63132),b=e.i(85595),x=e.i(56420);let k={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};k.node;let y=(0,x.f)(k);function v({place:e,name:i,Icon:t,card:n,children:s}){let r=n.state.isOk?b.f:y;return(0,a.jsxs)("div",{"data-testid":`bridge-place-${e}`,className:"flex flex-col gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,a.jsx)(t,{"aria-hidden":!0,className:"size-4 shrink-0"}),i,(0,a.jsxs)("span",{"data-testid":`bridge-place-${e}-state`,className:`ml-auto inline-flex items-center gap-1 text-caption font-medium ${n.state.isOk?"text-tone-ok-fg":"text-muted-foreground"}`,children:[(0,a.jsx)(r,{"aria-hidden":!0,className:"size-3.5"}),n.state.label]})]}),(0,a.jsx)("span",{className:"text-caption text-muted-foreground",children:n.description}),void 0===s?null:(0,a.jsx)("span",{className:"mt-auto flex flex-col items-start gap-1.5",children:s})]})}var w=e.i(31714);function j({fleetId:e,slackLink:t}){let[n,r]=(0,i.useTransition)(),[o,l]=(0,i.useState)(),d=(0,p.H)(t);return(0,a.jsxs)(v,{place:"slack",name:p.k.slack,Icon:w.U.slack,card:d,children:["link"===d.action?(0,a.jsx)("a",{href:`/slack/link?${new URLSearchParams({fleet:e}).toString()}`,"data-testid":"bridge-slack-link",className:"inline-flex h-7 items-center rounded-md bg-primary px-2.5 text-caption font-medium text-primary-foreground hover:bg-primary-hover",children:"Link Slack"}):null,"unlink"===d.action?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-slack-unlink",isPending:n,pendingLabel:"Unlinking...",onClick:()=>{l(void 0),r(async()=>{let a=await s(e);a.isOk||l(a.message)})},children:"Unlink"}):null,void 0===o?null:(0,a.jsx)(g.f,{message:o,isFailure:!0})]})}function N({fleetId:e,webPush:t}){let n=t?.browsers??[],{isTaken:s,ownEndpoint:u,working:b,failure:x,turnOn:k,remove:y}=function({fleetId:e,webPushKey:a}){let[t,n]=(0,i.useState)(!0),[s,u]=(0,i.useState)(),[p,f]=(0,i.useState)(),[g,b]=(0,i.useState)(),[,x]=(0,i.useTransition)();return(0,i.useEffect)(()=>{"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window?m().then(e=>{u(e?.endpoint)}):n(!1)},[]),{isTaken:t,ownEndpoint:s,working:p,failure:g,turnOn:()=>{null!==a&&(f("on"),b(void 0),x(async()=>{try{var i;let t,n,s=await h(a);if(!s.isOk)return void b(s.message);let d=function(e,a){let{endpoint:i,keys:t}=e,n=t?.p256dh,s=t?.auth;return void 0===i||void 0===n||void 0===s?void 0:{endpoint:i,keys:{p256dh:n,auth:s},browser:a}}(s.value.toJSON(),(i=navigator.userAgent,t=l(i,r),n=l(i,o),void 0===t?"A browser":void 0===n?t:`${t} on ${n}`));if(void 0===d)return void b("Your browser gave no push subscription: try again");let m=await c(e,d);m.isOk?u(d.endpoint):b(m.message)}catch{b("Your browser could not turn web push on: try again")}finally{f(void 0)}}))},remove:a=>{f(a),b(void 0),x(async()=>{a===s&&(await (await m())?.unsubscribe(),u(void 0));let i=await d(e,a);f(void 0),i.isOk||b(i.message)})}}}({fleetId:e,webPushKey:t?.publicKey??null}),j=(0,p.B)({isOffered:void 0!==t&&null!==t.publicKey,isTaken:s,ownEndpoint:u,browsers:n}),O=n.filter(({endpoint:e})=>"remove"!==j.action||e!==u);return(0,a.jsxs)(v,{place:"web-push",name:p.k["web-push"],Icon:w.U["web-push"],card:j,children:["remove"===j.action&&void 0!==u?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-web-push-remove",isPending:b===u,pendingLabel:"Removing...",disabled:void 0!==b,onClick:()=>{y(u)},children:"Remove"}):null,"turnOn"===j.action?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-web-push-on",isPending:"on"===b,pendingLabel:"Turning on...",disabled:void 0!==b,onClick:k,children:"Turn on"}):null,O.map(({endpoint:e,browser:i,isGone:t})=>(0,a.jsxs)("span",{"data-testid":"bridge-web-push-browser",className:"flex w-full items-center gap-2 text-caption text-muted-foreground",children:[(0,a.jsx)("span",{className:"min-w-0 flex-1",children:t?`${i}: no longer takes wakes`:`Also on in ${i}`}),(0,a.jsx)("button",{type:"button","data-testid":"bridge-web-push-remove-other",disabled:void 0!==b,onClick:()=>{y(e)},className:"underline hover:text-foreground disabled:opacity-50",children:b===e?"Removing...":"Remove"})]},e)),void 0===x?null:(0,a.jsx)(g.f,{message:x,isFailure:!0})]})}function O({fleetId:e,routing:n}){let[s,r]=(0,i.useTransition)(),[o,l]=(0,i.useState)(),d=(0,p.t)({isOffered:n.offered.email,isOnForAnyJob:n.jobs.some(({places:e})=>e.email)});return(0,a.jsxs)(v,{place:"email",name:p.k.email,Icon:w.U.email,card:d,children:["turnOn"===d.action||"turnOff"===d.action?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-email-turn",isPending:s,pendingLabel:"turnOn"===d.action?"Turning on...":"Turning off...",onClick:()=>{var a;a="turnOn"===d.action,l(void 0),r(async()=>{for(let i of(0,p.T)(n,a)){let a=await (0,t.f)({fleet:e,...i});if(!a.isOk)return void l(a.message)}})},children:"turnOn"===d.action?"Turn on":"Turn off"}):null,void 0===o?null:(0,a.jsx)(g.f,{message:o,isFailure:!0})]})}e.s(["PlacesPanel",0,function({fleetId:e,routing:i,slackLink:t,chats:n,webPush:s}){return(0,a.jsxs)("section",{"aria-label":"The places",className:"grid gap-2.5 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsx)(j,{fleetId:e,slackLink:t}),(0,a.jsx)(v,{place:"chat",name:p.k.chat,Icon:w.U.chat,card:(0,p.g)(n)}),(0,a.jsx)(N,{fleetId:e,webPush:s}),(0,a.jsx)(O,{fleetId:e,routing:i})]})}],41398)},85678,e=>{var a=e.i(43476),i=e.i(85595),t=e.i(71645),n=e.i(87765),s=e.i(31785),r=e.i(63132),o=e.i(31714);function l({isOn:e,label:i,isDisabled:t,isBusy:n=!1,aside:s,testId:r,onTurn:o}){return(0,a.jsxs)("span",{className:"inline-flex items-center gap-2.5",children:[(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,"aria-busy":n,disabled:t,"data-testid":r,onClick:o,className:"group inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-input p-0.5 aria-checked:bg-primary disabled:cursor-not-allowed disabled:opacity-50",children:(0,a.jsx)("span",{"aria-hidden":!0,className:"size-3 rounded-full bg-card shadow-sm transition-transform group-aria-checked:translate-x-3"})}),void 0===s?null:(0,a.jsx)("span",{className:"text-caption text-muted-foreground",children:s})]})}let d="sm:grid sm:grid-cols-[1.6fr_repeat(5,1fr)] sm:items-center sm:gap-3";function c({toast:e}){return(0,a.jsxs)("div",{role:"status","data-testid":"bridge-routing-toast",className:"flex max-w-[720px] gap-3 rounded-lg border border-border bg-popover py-3.5 pr-3.5 pl-4 text-popover-foreground shadow-lg",children:[(0,a.jsx)(i.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0 text-tone-ok-fg"}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.title}),(0,a.jsx)("span",{className:"text-caption text-muted-foreground",children:e.detail})]})]})}function u({name:e,children:i}){return(0,a.jsxs)("span",{className:"flex items-center justify-between sm:block",children:[(0,a.jsx)("span",{className:"sm:hidden",children:e}),i]})}e.s(["RoutingPanel",0,function({fleetId:e,routing:i,isSlackLinked:m,waitingByJob:h}){let[p,f]=(0,t.useTransition)(),[g,b]=(0,t.useState)(),[x,k]=(0,t.useState)(),[y,v]=(0,t.useState)();return(0,a.jsxs)("section",{className:"grid gap-3","aria-label":"Per job",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:gap-0 sm:overflow-hidden sm:rounded-lg sm:border sm:border-border sm:bg-card",children:[(0,a.jsxs)("div",{"aria-hidden":!0,className:`hidden min-h-8 bg-muted px-4 text-caption font-medium text-muted-foreground ${d}`,children:[(0,a.jsx)("span",{children:"Job"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)(o.x,{className:"size-3.5"}),"Bridge"]}),s.N.map(e=>{let i=o.U[e];return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)(i,{className:"size-3.5"}),s.k[e]]},e)})]}),i.jobs.map(({job:t,places:r})=>{let{Icon:c,tone:x}=o.c[t];return(0,a.jsxs)("div",{"data-testid":"bridge-routing-job",className:`flex flex-col gap-2 rounded-lg border border-border bg-card p-3 sm:min-h-[52px] sm:rounded-none sm:border-0 sm:border-t sm:px-4 sm:py-1.5 ${d}`,children:[(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-semibold sm:font-medium",children:[(0,a.jsx)(c,{"aria-hidden":!0,className:`size-4 shrink-0 ${x}`}),s.I[t].name]}),(0,a.jsx)("span",{className:"text-caption text-muted-foreground max-sm:hidden",children:s.I[t].holds})]}),(0,a.jsx)(u,{name:"Bridge",children:(0,a.jsx)(l,{isOn:!0,label:`Bridge for ${s.I[t].name}`,isDisabled:!0,aside:"Always",testId:`bridge-routing-${t}-bridge`})}),s.N.map(o=>{let d=r[o],c=`${t}-${o}`;return(0,a.jsx)(u,{name:s.k[o],children:(0,a.jsx)(l,{isOn:d,label:`${s.k[o]} for ${s.I[t].name}`,isDisabled:p||!d&&(!i.offered[o]||"slack"===o&&!m),isBusy:p&&g===c,..."everything-else"===t&&"slack"===o&&!d?{aside:"Bots only"}:{},testId:`bridge-routing-${c}`,onTurn:()=>{var a;a={job:t,place:o,isOn:!d,isChatOn:r.chat},k(void 0),v(void 0),b(`${a.job}-${a.place}`),f(async()=>{let{isChatOn:i,...t}=a,r=await (0,n.f)({fleet:e,...t});r.isOk?k((0,s.b)({...t,waiting:h[t.job],isChatOn:i})):v(r.message)})}})},o)})]},t)})]}),void 0===x?null:(0,a.jsx)(c,{toast:x}),void 0===y?null:(0,a.jsx)(r.f,{message:y,isFailure:!0}),(0,a.jsx)("p",{className:"text-caption text-muted-foreground max-sm:hidden",children:"While a Bridge page is open in focus, web push and email do not wake you. Slack still posts: you turned it on, and the views stay in step."})]})}],85678)},55070,e=>{var a=e.i(43476);let i={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},t={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:n,variant:s="secondary",size:r="regular",children:o,className:l="",disabled:d,...c}){return(0,a.jsx)("button",{...c,disabled:!0===d||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${t[r]} ${i[s]} ${l}`,children:e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),n]}):o})},"o",0,t])},63132,e=>{var a=e.i(43476);e.s(["f",0,function({message:e,isFailure:i}){return i?(0,a.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,a.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70812,71136,96315,28623,e=>{var a=e.i(56420);let i={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};i.node;let t=(0,a.f)(i);e.s(["f",0,t],70812);let n={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};n.node;let s=(0,a.f)(n);e.s(["f",0,s],71136);let r={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};r.node;let o=(0,a.f)(r);e.s(["f",0,o],96315);let l={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};l.node;let d=(0,a.f)(l);e.s(["f",0,d],28623)},51481,e=>{var a=e.i(75043);e.s(["f",()=>a.f])},59381,e=>{var a=e.i(56420);let i={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};i.node;let t=(0,a.f)(i);e.s(["f",0,t],59381)},63620,31714,e=>{var a=e.i(95187);let i=(0,a.createServerReference)("40bc7c96fce86cf783b7afa9934b227b20832bc648",a.callServer,void 0,a.findSourceMapURL,"turnRoute");e.s(["f",0,i],63620);var t=e.i(70812),n=e.i(51481),s=e.i(59381),r=e.i(71136),o=e.i(96315),l=e.i(56420);let d={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};d.node;let c=(0,l.f)(d);var u=e.i(49287),m=e.i(28623);let h={decide:{Icon:n.f,tone:"text-tone-active-fg"},do:{Icon:s.f,tone:"text-tone-waiting-fg"},"stay-aware":{Icon:t.f,tone:"text-muted-foreground"},"everything-else":{Icon:c,tone:"text-muted-foreground"}},p=u.f,f={slack:r.f,chat:m.f,"web-push":t.f,email:o.f};e.s(["x",0,p,"c",0,h,"U",0,f],31714)},31785,e=>{let a={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},i={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},t=["decide","do"],n="Bridge keeps every item.",s={label:"Not offered",isOk:!1},r={label:"Off",isOk:!1},o="Says only that something waits, with a link here.",l=`${o} Nothing is on until you turn it on.`,d="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,a,"k",0,i,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${d}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${d}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:a}){return e?a?{state:{label:"On",isOk:!0},description:o,action:"turnOff"}:{state:r,description:l,action:"turnOn"}:{state:s,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,a){return e.jobs.filter(({job:e,places:i})=>i.email!==a&&(!a||t.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:a}))},"r",0,function(e){let a=["Bridge",...e.map(e=>c[e])],i=a.at(-1),t=1===a.length?"Bridge":`${a.slice(0,-1).join(", ")} and ${String(i)}`;return`Shows in ${t}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:a,link:i}=e;return null===i?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${a} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${i.slackName} in ${a}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:t,place:s,isOn:r,waiting:o,isChatOn:l}=e,{name:d,item:c,items:u}=a[t],m=`${i[s]} is ${r?"on":"off"} for ${d}`;return r?"chat"===s?{title:m,detail:`A chat lists every ${c} not done when you ask it.`}:{title:m,detail:`${i[s]} shows ${u} that arrive from now on.${void 0===o||0===o?"":` The ${String(o)} already waiting ${1===o?"stays":"stay"} ${l?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:m,detail:"everything-else"===t&&"slack"===s?`Bots only: a bot ship's messages and replies to Slack still show there. ${n}`:n}},"B",0,function(e){if(!e.isOffered)return{state:s,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:r,description:"This browser takes no web push.",action:"none"};let a=e.browsers.find(({endpoint:a,isGone:i})=>a===e.ownEndpoint&&!i);return void 0===a?{state:r,description:l,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${a.browser}. ${o}`,action:"remove"}}])},41398,e=>{var a=e.i(43476),i=e.i(71645),t=e.i(63620),n=e.i(95187);let s=(0,n.createServerReference)("401795dbe980817c7febb7a9ef452e6d25af298560",n.callServer,void 0,n.findSourceMapURL,"unlinkSlack"),r=[[/Edg\//,"Edge"],[/Firefox\//,"Firefox"],[/Chrome\//,"Chrome"],[/Safari\//,"Safari"]],o=[[/iPhone|iPad/,"iOS"],[/Android/,"Android"],[/Mac OS X/,"macOS"],[/Windows/,"Windows"],[/Linux/,"Linux"]],l=(e,a)=>a.find(([a])=>a.test(e))?.[1],d=(0,n.createServerReference)("6009cf875fb9980a91d32c680f626ff2a624e4de0e",n.callServer,void 0,n.findSourceMapURL,"turnOffWebPush"),c=(0,n.createServerReference)("604799c2332415c201ae5795b6deef4ea921c69b40",n.callServer,void 0,n.findSourceMapURL,"turnOnWebPush"),u="/wake-worker.js";async function m(){let e=await navigator.serviceWorker.getRegistration(u);return await e?.pushManager.getSubscription()??null}async function h(e){let a;if(await Notification.requestPermission()!=="granted")return{isOk:!1,message:"Your browser did not allow notifications from this site: allow them, then turn web push on again"};let i=await navigator.serviceWorker.register(u);return await navigator.serviceWorker.ready,{isOk:!0,value:await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:(a=atob(e.replaceAll("-","+").replaceAll("_","/")),Uint8Array.from(a,e=>e.charCodeAt(0)))})}}var p=e.i(31785),f=e.i(55070),g=e.i(63132),b=e.i(85595),x=e.i(56420);let k={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};k.node;let y=(0,x.f)(k);function v({place:e,name:i,Icon:t,card:n,children:s}){let r=n.state.isOk?b.f:y;return(0,a.jsxs)("div",{"data-testid":`bridge-place-${e}`,className:"flex flex-col gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,a.jsx)(t,{"aria-hidden":!0,className:"size-4 shrink-0"}),i,(0,a.jsxs)("span",{"data-testid":`bridge-place-${e}-state`,className:`ml-auto inline-flex items-center gap-1 text-caption font-medium ${n.state.isOk?"text-tone-ok-fg":"text-muted-foreground"}`,children:[(0,a.jsx)(r,{"aria-hidden":!0,className:"size-3.5"}),n.state.label]})]}),(0,a.jsx)("span",{className:"text-caption text-muted-foreground",children:n.description}),void 0===s?null:(0,a.jsx)("span",{className:"mt-auto flex flex-col items-start gap-1.5",children:s})]})}var w=e.i(31714);function j({fleetId:e,slackLink:t}){let[n,r]=(0,i.useTransition)(),[o,l]=(0,i.useState)(),d=(0,p.H)(t);return(0,a.jsxs)(v,{place:"slack",name:p.k.slack,Icon:w.U.slack,card:d,children:["link"===d.action?(0,a.jsx)("a",{href:`/slack/link?${new URLSearchParams({fleet:e}).toString()}`,"data-testid":"bridge-slack-link",className:"inline-flex h-7 items-center rounded-md bg-primary px-2.5 text-caption font-medium text-primary-foreground hover:bg-primary-hover",children:"Link Slack"}):null,"unlink"===d.action?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-slack-unlink",isPending:n,pendingLabel:"Unlinking...",onClick:()=>{l(void 0),r(async()=>{let a=await s(e);a.isOk||l(a.message)})},children:"Unlink"}):null,void 0===o?null:(0,a.jsx)(g.f,{message:o,isFailure:!0})]})}function N({fleetId:e,webPush:t}){let n=t?.browsers??[],{isTaken:s,ownEndpoint:u,working:b,failure:x,turnOn:k,remove:y}=function({fleetId:e,webPushKey:a}){let[t,n]=(0,i.useState)(!0),[s,u]=(0,i.useState)(),[p,f]=(0,i.useState)(),[g,b]=(0,i.useState)(),[,x]=(0,i.useTransition)();return(0,i.useEffect)(()=>{"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window?m().then(e=>{u(e?.endpoint)}):n(!1)},[]),{isTaken:t,ownEndpoint:s,working:p,failure:g,turnOn:()=>{null!==a&&(f("on"),b(void 0),x(async()=>{try{var i;let t,n,s=await h(a);if(!s.isOk)return void b(s.message);let d=function(e,a){let{endpoint:i,keys:t}=e,n=t?.p256dh,s=t?.auth;return void 0===i||void 0===n||void 0===s?void 0:{endpoint:i,keys:{p256dh:n,auth:s},browser:a}}(s.value.toJSON(),(i=navigator.userAgent,t=l(i,r),n=l(i,o),void 0===t?"A browser":void 0===n?t:`${t} on ${n}`));if(void 0===d)return void b("Your browser gave no push subscription: try again");let m=await c(e,d);m.isOk?u(d.endpoint):b(m.message)}catch{b("Your browser could not turn web push on: try again")}finally{f(void 0)}}))},remove:a=>{f(a),b(void 0),x(async()=>{a===s&&(await (await m())?.unsubscribe(),u(void 0));let i=await d(e,a);f(void 0),i.isOk||b(i.message)})}}}({fleetId:e,webPushKey:t?.publicKey??null}),j=(0,p.B)({isOffered:void 0!==t&&null!==t.publicKey,isTaken:s,ownEndpoint:u,browsers:n}),O=n.filter(({endpoint:e})=>"remove"!==j.action||e!==u);return(0,a.jsxs)(v,{place:"web-push",name:p.k["web-push"],Icon:w.U["web-push"],card:j,children:["remove"===j.action&&void 0!==u?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-web-push-remove",isPending:b===u,pendingLabel:"Removing...",disabled:void 0!==b,onClick:()=>{y(u)},children:"Remove"}):null,"turnOn"===j.action?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-web-push-on",isPending:"on"===b,pendingLabel:"Turning on...",disabled:void 0!==b,onClick:k,children:"Turn on"}):null,O.map(({endpoint:e,browser:i,isGone:t})=>(0,a.jsxs)("span",{"data-testid":"bridge-web-push-browser",className:"flex w-full items-center gap-2 text-caption text-muted-foreground",children:[(0,a.jsx)("span",{className:"min-w-0 flex-1",children:t?`${i}: no longer takes wakes`:`Also on in ${i}`}),(0,a.jsx)("button",{type:"button","data-testid":"bridge-web-push-remove-other",disabled:void 0!==b,onClick:()=>{y(e)},className:"underline hover:text-foreground disabled:opacity-50",children:b===e?"Removing...":"Remove"})]},e)),void 0===x?null:(0,a.jsx)(g.f,{message:x,isFailure:!0})]})}function O({fleetId:e,routing:n}){let[s,r]=(0,i.useTransition)(),[o,l]=(0,i.useState)(),d=(0,p.t)({isOffered:n.offered.email,isOnForAnyJob:n.jobs.some(({places:e})=>e.email)});return(0,a.jsxs)(v,{place:"email",name:p.k.email,Icon:w.U.email,card:d,children:["turnOn"===d.action||"turnOff"===d.action?(0,a.jsx)(f.i,{size:"xs","data-testid":"bridge-email-turn",isPending:s,pendingLabel:"turnOn"===d.action?"Turning on...":"Turning off...",onClick:()=>{var a;a="turnOn"===d.action,l(void 0),r(async()=>{for(let i of(0,p.T)(n,a)){let a=await (0,t.f)({fleet:e,...i});if(!a.isOk)return void l(a.message)}})},children:"turnOn"===d.action?"Turn on":"Turn off"}):null,void 0===o?null:(0,a.jsx)(g.f,{message:o,isFailure:!0})]})}e.s(["PlacesPanel",0,function({fleetId:e,routing:i,slackLink:t,chats:n,webPush:s}){return(0,a.jsxs)("section",{"aria-label":"The places",className:"grid gap-2.5 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsx)(j,{fleetId:e,slackLink:t}),(0,a.jsx)(v,{place:"chat",name:p.k.chat,Icon:w.U.chat,card:(0,p.g)(n)}),(0,a.jsx)(N,{fleetId:e,webPush:s}),(0,a.jsx)(O,{fleetId:e,routing:i})]})}],41398)},85678,e=>{var a=e.i(43476),i=e.i(85595),t=e.i(71645),n=e.i(63620),s=e.i(31785),r=e.i(63132),o=e.i(31714);function l({isOn:e,label:i,isDisabled:t,isBusy:n=!1,aside:s,testId:r,onTurn:o}){return(0,a.jsxs)("span",{className:"inline-flex items-center gap-2.5",children:[(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,"aria-busy":n,disabled:t,"data-testid":r,onClick:o,className:"group inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-input p-0.5 aria-checked:bg-primary disabled:cursor-not-allowed disabled:opacity-50",children:(0,a.jsx)("span",{"aria-hidden":!0,className:"size-3 rounded-full bg-card shadow-sm transition-transform group-aria-checked:translate-x-3"})}),void 0===s?null:(0,a.jsx)("span",{className:"text-caption text-muted-foreground",children:s})]})}let d="sm:grid sm:grid-cols-[1.6fr_repeat(5,1fr)] sm:items-center sm:gap-3";function c({toast:e}){return(0,a.jsxs)("div",{role:"status","data-testid":"bridge-routing-toast",className:"flex max-w-[720px] gap-3 rounded-lg border border-border bg-popover py-3.5 pr-3.5 pl-4 text-popover-foreground shadow-lg",children:[(0,a.jsx)(i.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0 text-tone-ok-fg"}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.title}),(0,a.jsx)("span",{className:"text-caption text-muted-foreground",children:e.detail})]})]})}function u({name:e,children:i}){return(0,a.jsxs)("span",{className:"flex items-center justify-between sm:block",children:[(0,a.jsx)("span",{className:"sm:hidden",children:e}),i]})}e.s(["RoutingPanel",0,function({fleetId:e,routing:i,isSlackLinked:m,waitingByJob:h}){let[p,f]=(0,t.useTransition)(),[g,b]=(0,t.useState)(),[x,k]=(0,t.useState)(),[y,v]=(0,t.useState)();return(0,a.jsxs)("section",{className:"grid gap-3","aria-label":"Per job",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:gap-0 sm:overflow-hidden sm:rounded-lg sm:border sm:border-border sm:bg-card",children:[(0,a.jsxs)("div",{"aria-hidden":!0,className:`hidden min-h-8 bg-muted px-4 text-caption font-medium text-muted-foreground ${d}`,children:[(0,a.jsx)("span",{children:"Job"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)(o.x,{className:"size-3.5"}),"Bridge"]}),s.N.map(e=>{let i=o.U[e];return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)(i,{className:"size-3.5"}),s.k[e]]},e)})]}),i.jobs.map(({job:t,places:r})=>{let{Icon:c,tone:x}=o.c[t];return(0,a.jsxs)("div",{"data-testid":"bridge-routing-job",className:`flex flex-col gap-2 rounded-lg border border-border bg-card p-3 sm:min-h-[52px] sm:rounded-none sm:border-0 sm:border-t sm:px-4 sm:py-1.5 ${d}`,children:[(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-semibold sm:font-medium",children:[(0,a.jsx)(c,{"aria-hidden":!0,className:`size-4 shrink-0 ${x}`}),s.I[t].name]}),(0,a.jsx)("span",{className:"text-caption text-muted-foreground max-sm:hidden",children:s.I[t].holds})]}),(0,a.jsx)(u,{name:"Bridge",children:(0,a.jsx)(l,{isOn:!0,label:`Bridge for ${s.I[t].name}`,isDisabled:!0,aside:"Always",testId:`bridge-routing-${t}-bridge`})}),s.N.map(o=>{let d=r[o],c=`${t}-${o}`;return(0,a.jsx)(u,{name:s.k[o],children:(0,a.jsx)(l,{isOn:d,label:`${s.k[o]} for ${s.I[t].name}`,isDisabled:p||!d&&(!i.offered[o]||"slack"===o&&!m),isBusy:p&&g===c,..."everything-else"===t&&"slack"===o&&!d?{aside:"Bots only"}:{},testId:`bridge-routing-${c}`,onTurn:()=>{var a;a={job:t,place:o,isOn:!d,isChatOn:r.chat},k(void 0),v(void 0),b(`${a.job}-${a.place}`),f(async()=>{let{isChatOn:i,...t}=a,r=await (0,n.f)({fleet:e,...t});r.isOk?k((0,s.b)({...t,waiting:h[t.job],isChatOn:i})):v(r.message)})}})},o)})]},t)})]}),void 0===x?null:(0,a.jsx)(c,{toast:x}),void 0===y?null:(0,a.jsx)(r.f,{message:y,isFailure:!0}),(0,a.jsx)("p",{className:"text-caption text-muted-foreground max-sm:hidden",children:"While a Bridge page is open in focus, web push and email do not wake you. Slack still posts: you turned it on, and the views stay in step."})]})}],85678)},55070,e=>{var a=e.i(43476);let i={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},t={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:n,variant:s="secondary",size:r="regular",children:o,className:l="",disabled:d,...c}){return(0,a.jsx)("button",{...c,disabled:!0===d||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${t[r]} ${i[s]} ${l}`,children:e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),n]}):o})},"o",0,t])},63132,e=>{var a=e.i(43476);e.s(["f",0,function({message:e,isFailure:i}){return i?(0,a.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,a.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])}])})();
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55070,e=>{var r=e.i(43476);let t={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},a={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:n,variant:i="secondary",size:d="regular",children:s,className:o="",disabled:l,...c}){return(0,r.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${a[d]} ${t[i]} ${o}`,children:e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),n]}):s})},"o",0,a])},63132,e=>{var r=e.i(43476);e.s(["f",0,function({message:e,isFailure:t}){return t?(0,r.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,r.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},17433,e=>{var r=e.i(43476),t=e.i(18566),a=e.i(71645),n=e.i(55070),i=e.i(63132),d=e.i(95187);let s=(0,d.createServerReference)("40c10498ec73660294acae9ad3b4501f151b8aaa29",d.callServer,void 0,d.findSourceMapURL,"changeMic"),o=(0,d.createServerReference)("40b780c3cca8c5dbae63623e146e24e089be26f3b1",d.callServer,void 0,d.findSourceMapURL,"contribute"),l={request:{label:"Request the mic",pending:"Requesting..."},withdraw:{label:"Withdraw my request",pending:"Withdrawing..."},release:{label:"Release the mic",pending:"Releasing..."}};e.s(["MeetingControls",0,function({fleetId:e,meetingId:d,controls:c}){let u=(0,t.useRouter)(),[b,g]=(0,a.useState)(""),[p,m]=(0,a.useState)(()=>crypto.randomUUID()),[x,h]=(0,a.useState)(),[f,v]=(0,a.useState)(),[,y]=(0,a.useTransition)(),j=({control:e,action:r,onDone:t})=>{h(e),v(void 0),y(async()=>{let e=await r();h(void 0),e.isOk?(t?.(),u.refresh()):v(e.message)})},S=void 0!==x,R=c.filter(e=>"contribute"!==e);return(0,r.jsxs)("div",{className:"grid gap-3",children:[c.includes("contribute")?(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsxs)("label",{className:"grid gap-1",children:[(0,r.jsx)("span",{children:"Your contribution"}),(0,r.jsx)("textarea",{"data-testid":"meeting-text",rows:4,value:b,onChange:e=>{g(e.target.value)},className:"rounded-md border border-input bg-background p-2"})]}),(0,r.jsx)(n.i,{"data-testid":"meeting-contribute",variant:"primary",className:"justify-self-start",isPending:"contribute"===x,pendingLabel:"Sending...",disabled:S,onClick:()=>{j({control:"contribute",action:()=>o({fleet:e,meetingId:d,text:b,idempotencyKey:p}),onDone:()=>{g(""),m(crypto.randomUUID())}})},children:"Contribute"})]}):null,0===R.length?null:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:R.map(t=>(0,r.jsx)(n.i,{"data-testid":`meeting-${t}`,variant:"request"===t?"primary":"secondary",isPending:x===t,pendingLabel:l[t].pending,disabled:S,onClick:()=>{j({control:t,action:()=>s({fleet:e,meetingId:d,change:t})})},children:l[t].label},t))}),void 0===f?null:(0,r.jsx)(i.f,{message:f,isFailure:!0})]})}],17433)}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55070,e=>{var r=e.i(43476);let t={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},a={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:n,variant:i="secondary",size:d="regular",children:s,className:o="",disabled:l,...c}){return(0,r.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${a[d]} ${t[i]} ${o}`,children:e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),n]}):s})},"o",0,a])},63132,e=>{var r=e.i(43476);e.s(["f",0,function({message:e,isFailure:t}){return t?(0,r.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,r.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},17433,e=>{var r=e.i(43476),t=e.i(18566),a=e.i(71645),n=e.i(55070),i=e.i(63132),d=e.i(95187);let s=(0,d.createServerReference)("400a167596537c1d4356c79e2370ce70ba2addb829",d.callServer,void 0,d.findSourceMapURL,"changeMic"),o=(0,d.createServerReference)("40d10b0cadcf824ce92234cbd2d3d3c65b107b0230",d.callServer,void 0,d.findSourceMapURL,"contribute"),l={request:{label:"Request the mic",pending:"Requesting..."},withdraw:{label:"Withdraw my request",pending:"Withdrawing..."},release:{label:"Release the mic",pending:"Releasing..."}};e.s(["MeetingControls",0,function({fleetId:e,meetingId:d,controls:c}){let u=(0,t.useRouter)(),[b,g]=(0,a.useState)(""),[p,m]=(0,a.useState)(()=>crypto.randomUUID()),[x,h]=(0,a.useState)(),[f,v]=(0,a.useState)(),[,y]=(0,a.useTransition)(),j=({control:e,action:r,onDone:t})=>{h(e),v(void 0),y(async()=>{let e=await r();h(void 0),e.isOk?(t?.(),u.refresh()):v(e.message)})},S=void 0!==x,R=c.filter(e=>"contribute"!==e);return(0,r.jsxs)("div",{className:"grid gap-3",children:[c.includes("contribute")?(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsxs)("label",{className:"grid gap-1",children:[(0,r.jsx)("span",{children:"Your contribution"}),(0,r.jsx)("textarea",{"data-testid":"meeting-text",rows:4,value:b,onChange:e=>{g(e.target.value)},className:"rounded-md border border-input bg-background p-2"})]}),(0,r.jsx)(n.i,{"data-testid":"meeting-contribute",variant:"primary",className:"justify-self-start",isPending:"contribute"===x,pendingLabel:"Sending...",disabled:S,onClick:()=>{j({control:"contribute",action:()=>o({fleet:e,meetingId:d,text:b,idempotencyKey:p}),onDone:()=>{g(""),m(crypto.randomUUID())}})},children:"Contribute"})]}):null,0===R.length?null:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:R.map(t=>(0,r.jsx)(n.i,{"data-testid":`meeting-${t}`,variant:"request"===t?"primary":"secondary",isPending:x===t,pendingLabel:l[t].pending,disabled:S,onClick:()=>{j({control:t,action:()=>s({fleet:e,meetingId:d,change:t})})},children:l[t].label},t))}),void 0===f?null:(0,r.jsx)(i.f,{message:f,isFailure:!0})]})}],17433)}])})();
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},94984,e=>{var t=e.i(43476);e.s(["f",0,function({state:e,testId:n}){switch(e.kind){case"idle":return null;case"done":return(0,t.jsx)("p",{role:"status","data-testid":n,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,t.jsx)("p",{role:"alert","data-testid":n,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},58107,e=>{var t=e.i(43476),n=e.i(74080),o=e.i(30402);e.s(["f",0,function({children:e,pending:r,kind:i="primary",testId:d}){let a=(0,n.useFormStatus)();return(0,t.jsx)("button",{type:"submit",className:o.x[i],disabled:a.pending,"aria-busy":a.pending,"data-testid":d,children:a.pending?r:e})}])},97e3,e=>{var t=e.i(43476);let n={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},o={waiting:"text-tone-waiting-fg",active:"text-tone-active-fg",ok:"text-tone-ok-fg",attention:"rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-tone-attention-fg",ended:"text-tone-ended-fg"};e.s(["T",0,function({tone:e,label:r,look:i="pill",icon:d}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-caption ${"pill"===i?`rounded-full border px-2 ${n[e]}`:`h-5.5 px-0.5 font-medium ${o[e]}`}`,children:[d,r]})},"E",0,function({children:e,isMono:n=!1}){return(0,t.jsx)("span",{className:`inline-flex h-5.5 items-center rounded-sm border border-border px-1.5 text-caption font-medium ${n?"font-mono":""}`,children:e})}])},17018,e=>{var t=e.i(43476),n=e.i(85595),o=e.i(71645),r=e.i(28008),i=e.i(30402),d=e.i(94984),a=e.i(58107),s=e.i(95187);let l=(0,s.createServerReference)("60ec3c2f6bcae5e138433edd19e88be9eed17cf140",s.callServer,void 0,s.findSourceMapURL,"switchOutsideParties");var c=e.i(97e3);e.s(["SwitchCard",0,function({isOn:e,canSwitch:s,fleetId:u}){let[f,g]=(0,o.useActionState)(l,r.Q);return(0,t.jsxs)("section",{className:`${i.E} grid gap-1.5`,"data-testid":"outside-parties-switch",children:[(0,t.jsxs)("h2",{className:"flex items-center gap-2 font-semibold",children:["Outside parties are ",e?"on":"off"," ",e?(0,t.jsx)(c.T,{tone:"ok",label:"On",look:"flat",icon:(0,t.jsx)(n.f,{"aria-hidden":!0,className:"size-3.5"})}):(0,t.jsx)(c.T,{tone:"ended",label:"Off",look:"flat"})]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e?"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"===f.kind?(0,t.jsxs)("form",{action:g,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,t.jsx)("h3",{className:"font-semibold",children:"Open network"}),(0,t.jsx)("p",{children:f.message}),(0,t.jsx)("input",{type:"hidden",name:r.H,value:u}),(0,t.jsx)("input",{type:"hidden",name:"isOn",value:"true"}),(0,t.jsx)("input",{type:"hidden",name:"isOpenNetworkConfirmed",value:"true"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.f,{kind:"destructive",pending:"Turning on…",testId:"outside-parties-turn-on-anyway",children:"Turn on anyway"}),(0,t.jsx)("a",{className:i.x.secondary,href:"",children:"Keep off"})]})]}):s?(0,t.jsxs)("form",{action:g,children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:u}),(0,t.jsx)("input",{type:"hidden",name:"isOn",value:String(!e)}),(0,t.jsx)(a.f,{kind:e?"secondary":"primary",pending:e?"Turning off…":"Turning on…",testId:"outside-parties-turn",children:e?"Turn off":"Turn on"})]}):(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["Turning them on or off needs ","fleet:network","."]}),"openNetwork"===f.kind?null:(0,t.jsx)(d.f,{state:f})]})}],17018)}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},94984,e=>{var t=e.i(43476);e.s(["f",0,function({state:e,testId:n}){switch(e.kind){case"idle":return null;case"done":return(0,t.jsx)("p",{role:"status","data-testid":n,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,t.jsx)("p",{role:"alert","data-testid":n,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},58107,e=>{var t=e.i(43476),n=e.i(74080),o=e.i(30402);e.s(["f",0,function({children:e,pending:r,kind:i="primary",testId:d}){let a=(0,n.useFormStatus)();return(0,t.jsx)("button",{type:"submit",className:o.x[i],disabled:a.pending,"aria-busy":a.pending,"data-testid":d,children:a.pending?r:e})}])},97e3,e=>{var t=e.i(43476);let n={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},o={waiting:"text-tone-waiting-fg",active:"text-tone-active-fg",ok:"text-tone-ok-fg",attention:"rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-tone-attention-fg",ended:"text-tone-ended-fg"};e.s(["T",0,function({tone:e,label:r,look:i="pill",icon:d}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-caption ${"pill"===i?`rounded-full border px-2 ${n[e]}`:`h-5.5 px-0.5 font-medium ${o[e]}`}`,children:[d,r]})},"E",0,function({children:e,isMono:n=!1}){return(0,t.jsx)("span",{className:`inline-flex h-5.5 items-center rounded-sm border border-border px-1.5 text-caption font-medium ${n?"font-mono":""}`,children:e})}])},17018,e=>{var t=e.i(43476),n=e.i(85595),o=e.i(71645),r=e.i(28008),i=e.i(30402),d=e.i(94984),a=e.i(58107),s=e.i(95187);let l=(0,s.createServerReference)("6026e3b3dbb068da98f61988cab6a37183349cfed7",s.callServer,void 0,s.findSourceMapURL,"switchOutsideParties");var c=e.i(97e3);e.s(["SwitchCard",0,function({isOn:e,canSwitch:s,fleetId:u}){let[f,g]=(0,o.useActionState)(l,r.Q);return(0,t.jsxs)("section",{className:`${i.E} grid gap-1.5`,"data-testid":"outside-parties-switch",children:[(0,t.jsxs)("h2",{className:"flex items-center gap-2 font-semibold",children:["Outside parties are ",e?"on":"off"," ",e?(0,t.jsx)(c.T,{tone:"ok",label:"On",look:"flat",icon:(0,t.jsx)(n.f,{"aria-hidden":!0,className:"size-3.5"})}):(0,t.jsx)(c.T,{tone:"ended",label:"Off",look:"flat"})]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e?"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"===f.kind?(0,t.jsxs)("form",{action:g,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,t.jsx)("h3",{className:"font-semibold",children:"Open network"}),(0,t.jsx)("p",{children:f.message}),(0,t.jsx)("input",{type:"hidden",name:r.H,value:u}),(0,t.jsx)("input",{type:"hidden",name:"isOn",value:"true"}),(0,t.jsx)("input",{type:"hidden",name:"isOpenNetworkConfirmed",value:"true"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.f,{kind:"destructive",pending:"Turning on…",testId:"outside-parties-turn-on-anyway",children:"Turn on anyway"}),(0,t.jsx)("a",{className:i.x.secondary,href:"",children:"Keep off"})]})]}):s?(0,t.jsxs)("form",{action:g,children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:u}),(0,t.jsx)("input",{type:"hidden",name:"isOn",value:String(!e)}),(0,t.jsx)(a.f,{kind:e?"secondary":"primary",pending:e?"Turning off…":"Turning on…",testId:"outside-parties-turn",children:e?"Turn off":"Turn on"})]}):(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["Turning them on or off needs ","fleet:network","."]}),"openNetwork"===f.kind?null:(0,t.jsx)(d.f,{state:f})]})}],17018)}])})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51481,e=>{var t=e.i(75043);e.s(["f",()=>t.f])},59381,e=>{var t=e.i(56420);let n={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};n.node;let i=(0,t.f)(n);e.s(["f",0,i],59381)},42774,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("601f20d58885510639cdb9c1e160334e405f3688cf",t.callServer,void 0,t.findSourceMapURL,"removeFromBasket");e.s(["f",0,n])},31785,e=>{let t={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},n={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},i=["decide","do"],s="Bridge keeps every item.",a={label:"Not offered",isOk:!1},r={label:"Off",isOk:!1},d="Says only that something waits, with a link here.",o=`${d} Nothing is on until you turn it on.`,l="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,t,"k",0,n,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${l}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${l}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:t}){return e?t?{state:{label:"On",isOk:!0},description:d,action:"turnOff"}:{state:r,description:o,action:"turnOn"}:{state:a,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,t){return e.jobs.filter(({job:e,places:n})=>n.email!==t&&(!t||i.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:t}))},"r",0,function(e){let t=["Bridge",...e.map(e=>c[e])],n=t.at(-1),i=1===t.length?"Bridge":`${t.slice(0,-1).join(", ")} and ${String(n)}`;return`Shows in ${i}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:t,link:n}=e;return null===n?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${t} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${n.slackName} in ${t}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:i,place:a,isOn:r,waiting:d,isChatOn:o}=e,{name:l,item:c,items:u}=t[i],h=`${n[a]} is ${r?"on":"off"} for ${l}`;return r?"chat"===a?{title:h,detail:`A chat lists every ${c} not done when you ask it.`}:{title:h,detail:`${n[a]} shows ${u} that arrive from now on.${void 0===d||0===d?"":` The ${String(d)} already waiting ${1===d?"stays":"stay"} ${o?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:h,detail:"everything-else"===i&&"slack"===a?`Bots only: a bot ship's messages and replies to Slack still show there. ${s}`:s}},"B",0,function(e){if(!e.isOffered)return{state:a,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:r,description:"This browser takes no web push.",action:"none"};let t=e.browsers.find(({endpoint:t,isGone:n})=>t===e.ownEndpoint&&!n);return void 0===t?{state:r,description:o,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${t.browser}. ${d}`,action:"remove"}}])},22141,e=>{var t=e.i(43476),n=e.i(56420);let i={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};i.node;let s=(0,n.f)(i);var a=e.i(47211),r=e.i(89664),d=e.i(22768),o=e.i(85595),l=e.i(51481);let c={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};c.node;let u=(0,n.f)(c);var h=e.i(11568);let p={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};p.node;let f=(0,n.f)(p);var m=e.i(32645),g=e.i(30274),b=e.i(47130),v=e.i(63676),x=e.i(71645),k=e.i(42774),w=e.i(95187);let y=(0,w.createServerReference)("40782571a3d14714151f0e9ee3d153d9c227e67e85",w.callServer,void 0,w.findSourceMapURL,"sendBasket");function j(e){return`${new Date(e).toISOString().slice(11,16)} UTC`}let S={bridge:"in Bridge",chat:"in a chat",slack:"in Slack",gateway:"by the gateway"};function $(e){return{desktop:e,phone:e}}function N(e){return 1===e?"1 answer":`${String(e)} answers`}function I(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)??""}`}function R(e){return[...new Set(e.map(({from:e})=>e))]}var O=e.i(55070),z=e.i(63132),T=e.i(3523);let B={sent:o.f,sending:h.f,next:u,unanswered:h.f,refused:d.f,withdrawn:a.f,replaced:m.f,elsewhere:r.f},L={ok:"text-tone-ok-fg",waiting:"text-tone-waiting-fg",attention:"text-tone-attention-fg",off:"text-muted-foreground"};function A({words:e}){return e.desktop===e.phone?(0,t.jsx)("span",{children:e.desktop}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:e.desktop}),(0,t.jsx)("span",{className:"sm:hidden",children:e.phone})]})}function M({line:e}){let n=B[e.icon];return(0,t.jsxs)("p",{"data-testid":"bridge-basket-standing",className:"col-span-2 col-start-2 flex items-start gap-1.5 text-meta",children:[(0,t.jsx)(n,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 ${L[e.tone]}`}),(0,t.jsx)("span",{children:(0,t.jsx)(A,{words:e.words})})]})}function P({entry:e,line:n,opening:i,working:a,onRemove:r}){let{standing:d}=e,o="withdrawn"===d.kind||"replaced"===d.kind||"dealtElsewhere"===d.kind,c=void 0!==a||void 0!==i.openingId,u=a?.kind==="remove"&&a.questionId===e.questionId,h="replaced"===d.kind?d.replacementId:null,p=o?"line-through decoration-muted-foreground":"";return(0,t.jsxs)("li",{"data-testid":"bridge-basket-entry","data-standing":d.kind,className:`grid grid-cols-[18px_1fr_auto] items-start gap-x-2.5 gap-y-1.5 border-t border-border p-3 first:border-t-0 sm:px-3.5 ${o?"bg-muted":""}`,children:[(0,t.jsx)(l.f,{"aria-hidden":!0,className:"mt-0.5 size-4 text-tone-active-fg"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:`font-medium ${p}`,children:e.title}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsxs)("span",{children:["to ",(0,t.jsx)("b",{className:"font-medium text-foreground",children:e.from})]}),(0,t.jsx)("span",{"aria-hidden":!0,className:"hidden text-border sm:inline",children:"·"}),(0,t.jsxs)("span",{className:"hidden sm:inline",children:["asked at ",(0,t.jsx)("time",{dateTime:e.sentAt,children:j(e.sentAt)})]})]}),(0,t.jsxs)("span",{className:`${o?"hidden sm:flex":"flex"} items-center gap-1.5 text-meta ${p}`,children:[(0,t.jsx)(s,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-primary"}),null===e.option?"Note alone":null===e.optionLabel?`Option ${String(e.option)}`:`${String(e.option)}. ${e.optionLabel}`]}),null===e.note?null:(0,t.jsxs)("span",{className:"text-caption italic text-muted-foreground",children:['"',e.note,'"']})]}),"waiting"===d.kind?(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(O.i,{"data-testid":"bridge-basket-change",size:"small","aria-label":"Change",isPending:i.openingId===e.deliveryId,pendingLabel:"Opening...",disabled:c,onClick:()=>{i.open({deliveryId:e.deliveryId,job:"decide",inBasket:{option:e.option,note:e.note}})},children:[(0,t.jsx)(f,{"aria-hidden":!0,className:"size-3.5"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Change"})]}),(0,t.jsxs)(O.i,{"data-testid":"bridge-basket-remove",size:"small",variant:"ghost","aria-label":"Remove",isPending:u,pendingLabel:"Removing...",disabled:c,onClick:()=>{r(e.questionId)},children:[(0,t.jsx)(v.X,{"aria-hidden":!0,className:"size-4 sm:hidden"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Remove"})]})]}):(0,t.jsx)("span",{}),void 0===n?null:(0,t.jsx)(M,{line:n}),i.failure?.deliveryId===e.deliveryId?(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:(0,t.jsx)(z.f,{message:i.failure.message,isFailure:!0})}):null,"withdrawn"===d.kind||"replaced"===d.kind||"dealtElsewhere"===d.kind||"refused"===d.kind?(0,t.jsxs)("div",{className:"col-span-2 col-start-2 flex flex-wrap items-center gap-1.5",children:[null===h?null:(0,t.jsxs)(O.i,{"data-testid":"bridge-replacement",size:"small",isPending:i.openingId===h,pendingLabel:"Opening...",disabled:c,onClick:()=>{i.open({deliveryId:h,job:"decide"})},children:[(0,t.jsx)(s,{"aria-hidden":!0,className:"size-3.5"}),"Answer the new question"]}),(0,t.jsx)(O.i,{"data-testid":"bridge-basket-remove",size:"small",variant:"replaced"===d.kind?"ghost":"secondary",isPending:u,pendingLabel:"Removing...",disabled:c,onClick:()=>{r(e.questionId)},children:"refused"===d.kind?"Remove and mark done":"Remove"})]}):null]})}function U({foot:e,isSending:n,isWorking:i,onSend:s}){return"none"===e.kind?null:(0,t.jsxs)("div",{"data-testid":"bridge-basket-foot",className:"flex flex-col items-stretch gap-2 border-t border-border bg-card p-3 sm:flex-row sm:items-center sm:gap-3 sm:px-3.5",children:[(0,t.jsx)("p",{className:"flex-1 text-caption text-muted-foreground",children:(0,t.jsx)(A,{words:e.words})}),"send"===e.kind?(0,t.jsxs)(O.i,{"data-testid":"bridge-basket-send",variant:"primary",className:"justify-center",isPending:n,pendingLabel:"Sending...",disabled:i,onClick:s,children:[(0,t.jsx)(g.f,{"aria-hidden":!0,className:"size-4"}),e.label]}):null,"sending"===e.kind?(0,t.jsxs)("button",{type:"button","data-testid":"bridge-basket-sending",disabled:!0,"aria-busy":"true",className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-border bg-card px-4 font-medium text-card-foreground",children:[(0,t.jsx)(h.f,{"aria-hidden":!0,className:"size-4 animate-spin"}),e.progress]}):null]})}function C({summary:e}){return(0,t.jsxs)("div",{"data-testid":"bridge-basket-sent",role:"status",className:"flex max-w-[620px] items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(o.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0 text-tone-ok-fg"}),(0,t.jsxs)("span",{className:"grid gap-1",children:[(0,t.jsx)("span",{className:"font-medium",children:e.title}),(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e.description})]})]})}function D(){return(0,t.jsxs)("div",{"data-testid":"bridge-basket-empty",className:"grid max-w-[820px] justify-items-center gap-3 rounded-lg border border-dashed border-border bg-card px-6 py-10 text-center",children:[(0,t.jsx)("span",{className:"inline-flex size-11 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,t.jsx)(b.f,{"aria-hidden":!0,className:"size-5"})}),(0,t.jsx)("span",{className:"text-heading font-semibold",children:"The basket is empty"}),(0,t.jsx)("span",{className:"max-w-[360px] text-muted-foreground",children:"Pick an option on a question and put it in the basket; it waits here until you send it."})]})}e.s(["BasketPanel",0,function({fleetId:e,basket:n}){let i,s,[a,r]=(0,x.useState)(),[d,o]=(0,x.useState)(),[,l]=(0,x.useTransition)(),c=(i=n.entries.some(({standing:e})=>"sent"===e.kind),s=n.entries.find(({standing:e})=>"sending"===e.kind&&!e.isUnanswered),n.entries.map(e=>(function(e,t){let{standing:n,from:i}=e;switch(n.kind){case"waiting":return;case"sent":{let e=j(n.at);return{icon:"sent",tone:"ok",words:{desktop:`Sent at ${e} and stored. Done.`,phone:`Sent at ${e}. Done.`}}}case"sending":if(n.isUnanswered)return{icon:"unanswered",tone:"waiting",words:{desktop:"The fleet did not answer. Sending again with the same key until it is stored; it arrives once.",phone:"No answer from the fleet. Sending again, same key."}};return t.isSendingNow?{icon:"sending",tone:"waiting",words:$("Sending...")}:{icon:"next",tone:"waiting",words:{desktop:"Next, in the order you added it",phone:"Next"}};case"refused":{let e=`Not sent: ${n.reason}.`,[i=n.reason]=n.reason.split(", so ");return{icon:"refused",tone:"attention",words:{desktop:t.isAnySent?`${e} The others were sent.`:e,phone:`Not sent: ${i}.`}}}case"withdrawn":return{icon:"withdrawn",tone:"off",words:{desktop:`Withdrawn by ${i} at ${j(n.at)}. Not sent; Send skips it.`,phone:`Withdrawn by ${i}. Not sent.`}};case"replaced":{let e=null===n.replacementTitle?".":` with "${n.replacementTitle}"`;return{icon:"replaced",tone:"off",words:{desktop:`Replaced by ${i} at ${j(n.at)}${e} Not sent: its options differ, so answer the new one.`,phone:`Replaced by ${i}. Not sent.`}}}case"dealtElsewhere":return{icon:"elsewhere",tone:"off",words:$(null===n.option?`Done ${S[n.place]}. Nothing is sent from it.`:`Answered ${S[n.place]}: option ${String(n.option)}. Nothing is sent from it.`)}}})(e,{isAnySent:i,isSendingNow:e===s}))),u=function(e){let{entries:t}=e;if(0===t.length||t.some(({standing:e})=>"sent"!==e.kind))return;let n=`To ${I(R(t))}, as you;`;return{title:`${N(t.length)} sent`,description:1===t.length?`${n} stored, and in Done.`:`${n} each stored, each in Done.`}}(n),h=t=>{r({kind:"remove",questionId:t}),o(void 0),l(async()=>{let n=await (0,k.f)(e,t);r(void 0),o(n.isOk?void 0:n.message)})},p=()=>{r({kind:"send"}),o(void 0),l(async()=>{let t=await y(e);r(void 0),o(t.isOk?void 0:t.message)})};return(0,t.jsx)(T.f,{fleetId:e,children:e=>(0,t.jsxs)("section",{className:"grid gap-4","aria-labelledby":"bridge-basket-heading",children:[(0,t.jsxs)("div",{className:"hidden sm:block",children:[(0,t.jsxs)("h1",{id:"bridge-basket-heading",className:"text-heading font-semibold",children:["Basket ",(0,t.jsx)("span",{"data-testid":"bridge-basket-count",className:"text-primary",children:n.count})]}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:"Answers you picked in Bridge, not sent yet. Nothing goes until you press Send."})]}),void 0===d?null:(0,t.jsx)(z.f,{message:d,isFailure:!0}),void 0===u?null:(0,t.jsx)(C,{summary:u}),0===n.entries.length||void 0!==u?(0,t.jsx)(D,{}):(0,t.jsxs)("div",{className:"max-w-[820px] overflow-hidden rounded-lg border border-border bg-card",children:[(0,t.jsx)("ul",{children:n.entries.map((n,i)=>(0,t.jsx)(P,{entry:n,line:c[i],opening:e,working:a,onRemove:h},n.questionId))}),(0,t.jsx)(U,{foot:function(e){if(e.toSend>0)return function(e){var t;let n=function(e){let t=t=>e.filter(({standing:e})=>e.kind===t).length,n=["withdrawn","replaced"].map(e=>({kind:e,count:t(e)})).filter(({count:e})=>e>0),i=n.map(({kind:e,count:t},i)=>t>1?`the ${String(t)} ${e}`:i===n.length-1?`the ${e} one`:`the ${e}`),s=t("dealtElsewhere"),a=0===s?i:[...i,1===s?"the one answered elsewhere":`the ${String(s)} answered elsewhere`];if(0===a.length)return;let r=I(a),d=1===n.reduce((e,{count:t})=>e+t,s);return`${r.charAt(0).toUpperCase()}${r.slice(1)} ${d?"is":"are"} not sent.`}(e.entries),i=(t=e.toSend,`Send ${N(t)}`);if(void 0!==n)return{kind:"send",words:{desktop:`${String(e.toSend)} to send. ${n}`,phone:n},label:i};let s=e.entries.filter(({standing:e})=>"waiting"===e.kind),a=R(s),r=a.length>1?"each receive their own answer":s.length>1?"receives its own answer to each":"receives its own answer";return{kind:"send",words:{desktop:`${I(a)} ${r}, as you, as if sent one by one.`,phone:"Each asker receives its own answer."},label:i}}(e);let t=e.entries.map(({standing:e})=>e),n=t.filter(({kind:e})=>"sent"===e).length,i=t.filter(({kind:e})=>"sending"===e).length,s=t.filter(({kind:e})=>"refused"===e).length,a=t.some(e=>"sending"===e.kind&&e.isUnanswered);if(i>0&&0===s&&!a)return{kind:"sending",words:{desktop:"You can close Bridge: the gateway keeps sending what is stored as sending.",phone:"You can close Bridge; the gateway keeps sending."},progress:`Sending ${String(n+1)} of ${String(n+i)}`};if(0===i&&0===s)return{kind:"none"};let r=(e,t)=>0===e?[]:[`${String(e)} ${t}`];return{kind:"summary",words:{desktop:`${[...r(n,"sent"),...r(i,"still sending"),...r(s,"not sent")].join(", ")}.`,phone:`${[...r(n,"sent"),...r(i,"sending"),...r(s,"not sent")].join(", ")}.`}}}(n),isSending:a?.kind==="send",isWorking:void 0!==a||void 0!==e.openingId,onSend:p})]})]})})}],22141)},94528,e=>{var t=e.i(43476),n=e.i(17904),i=e.i(29039);e.s(["FadedAsLastRead",0,function({children:e}){let s=(0,i.useLastReadAt)();return void 0===s?e:(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsx)("div",{inert:!0,className:"opacity-60 [&_button:not([data-testid=bridge-item-title])]:hidden",children:e}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:`Shown as last read, at ${(0,n.C)(s)}.`})]})}])},3523,e=>{var t=e.i(43476),n=e.i(58487),i=e.i(5654),s=e.i(71645),a=e.i(73459),r=e.i(65894),d=e.i(74175),o=e.i(20794),l=e.i(49100),c=e.i(65398),u=e.i(98404),h=e.i(42774),p=e.i(57228),f=e.i(34244),m=e.i(43328),g=e.i(27538),b=e.i(77826),v=e.i(80734),x=e.i(60296),k=e.i(66734),w=e.i(47130);function y(){let{toasts:e}=i.f.useToastManager();return(0,t.jsx)(m.f.Portal,{children:(0,t.jsx)(g.f.Viewport,{className:"fixed bottom-4 left-4 z-50 hidden w-[min(24rem,calc(100vw-2rem))] gap-2 sm:grid",children:e.map(e=>(0,t.jsxs)(b.f.Root,{toast:e,"data-testid":"bridge-basket-toast",className:"flex items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(w.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0"}),(0,t.jsxs)(v.f.Content,{className:"grid flex-1 gap-1",children:[(0,t.jsx)(x.f.Title,{className:"font-medium"}),(0,t.jsx)(k.f.Description,{className:"text-caption text-muted-foreground"})]})]},e.id))})})}var j=e.i(54235),S=e.i(62579),$=e.i(63132),N=e.i(75103),I=e.i(52021);function R({fleetId:e,decidePlaces:n,consoleUrl:m,children:g}){let b=i.f.useToastManager(),v=(0,N.P)(),[x,k]=(0,s.useState)(),[w,y]=(0,s.useState)(""),[O,z]=(0,s.useState)(),[T,B]=(0,s.useState)(),[L,A]=(0,s.useState)(),[M,P]=(0,s.useState)(),[U,C]=(0,s.useState)(),[D,q]=(0,s.useState)(),[,F]=(0,s.useTransition)(),[E,Y]=(0,s.useState)(0);(0,I.R)(void 0===x?void 0:(0,f.u)(x.opened.job),()=>{k(void 0)});let W=t=>{z(t.deliveryId),P(void 0),q(void 0),F(async()=>{let n=await (0,l.f)(e,t.deliveryId);if(z(void 0),n.isOk){let e=t.inBasket??null;k({delivery:n.value,opened:{job:t.job,isAlert:t.isAlert??!1,wasNew:"seen"!==t.state},inBasket:e,finished:null}),y(e?.note??""),C(void 0)}else P({deliveryId:t.deliveryId,message:n.message})})},H=({control:e,action:t,onSettled:n})=>{A(e),C(void 0),F(async()=>{let e=await t();A(void 0),e.isOk?n(e.value):C(e.message)})},V=e=>()=>{k(void 0),q(e)},_=void 0===x?void 0:{deliveryId:x.delivery.deliveryId,job:x.opened.job};return(0,t.jsx)(S.f,{list:(0,t.jsxs)("div",{className:"grid gap-4",children:[void 0===D?null:(0,t.jsx)($.f,{message:D,isFailure:!1}),g({open:W,openingId:O,putPick:(t,n)=>{B(t.deliveryId),P(void 0),q(void 0),F(async()=>{let i=await (0,u.f)({fleet:e,deliveryId:t.deliveryId,option:n});B(void 0),i.isOk?(q(`Option ${String(n)} is in the basket, not sent: ${t.from} receives it when you send the basket.`),Y(e=>e+1)):P({deliveryId:t.deliveryId,message:i.message})})},puttingId:T,failure:M,opened:_})]},E),item:void 0===x?void 0:(({delivery:i,inBasket:s,opened:l,finished:u})=>{let f=i.question?.id;return(0,t.jsx)(j.u,{delivery:i,opened:l,meetingHref:void 0===i.meetingId?void 0:(0,a.f)({fleetId:e,meetingId:i.meetingId}),consoleUrl:m,basketHref:(0,r.f)(p.H,e),inBasket:s,finished:u,places:n,note:w,working:L,failure:U,onNoteChange:y,onAnswer:t=>{H({control:void 0===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,d.f)({fleet:e,deliveryId:i.deliveryId,input:{questionId:i.question?.id,option:t,note:w}}),onSettled:V(`Your answer went to ${i.from}.`)})},onPut:t=>{H({control:null===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,c.f)({fleet:e,deliveryId:i.deliveryId,option:t,optionLabel:i.question?.options.find(({key:e})=>e===t)?.label??null,note:w}),onSettled:e=>{var t;k({delivery:i,opened:l,finished:u,inBasket:e}),b.add({title:null===(t=e.option)?"Your note alone in the basket":`Option ${String(t)} in the basket`,description:"Not sent. Still waiting on you until you send it."})}})},onSend:t=>{H({control:{kind:"send"},action:()=>(0,d.f)({fleet:e,deliveryId:i.deliveryId,input:{questionId:f,option:t??void 0,note:w}}),onSettled:V(`Your answer went to ${i.from}.`)})},onRemove:()=>{void 0!==f&&H({control:{kind:"remove"},action:()=>(0,h.f)(e,f),onSettled:V(`Your answer to “${i.title}” is out of the basket; the question still waits on you.`)})},onDone:()=>{H({control:{kind:"done"},action:()=>(0,o.f)({fleet:e,deliveryId:i.deliveryId}),onSettled:V(`Done with “${i.title}”.`)})},onFinishStep:t=>{H({control:{kind:t},action:()=>(0,o.f)({fleet:e,deliveryId:i.deliveryId,step:{outcome:t,note:w}}),onSettled:()=>{k({delivery:i,inBasket:s,opened:l,finished:{outcome:t,note:w.trim(),at:new Date().toISOString()}})}})},onOpen:e=>{W({deliveryId:e,job:l.job})},onSendMessage:void 0===i.alertShip||void 0===v?void 0:e=>{v({alertShip:e})},onBack:()=>{k(void 0)}},i.deliveryId)})(x)})}e.s(["f",0,function({fleetId:e,decidePlaces:i,consoleUrl:s,children:a}){return(0,t.jsxs)(n.f.Provider,{children:[(0,t.jsx)(R,{fleetId:e,decidePlaces:i,consoleUrl:s,children:a}),(0,t.jsx)(y,{})]})}],3523)},55070,e=>{var t=e.i(43476);let n={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},i={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:s,variant:a="secondary",size:r="regular",children:d,className:o="",disabled:l,...c}){return(0,t.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${i[r]} ${n[a]} ${o}`,children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),s]}):d})},"o",0,i])},63132,e=>{var t=e.i(43476);e.s(["f",0,function({message:e,isFailure:n}){return n?(0,t.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,t.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},73459,74175,20794,49100,65398,98404,e=>{e.s(["f",0,function(e){let t=new URLSearchParams({fleet:e.fleetId,...void 0===e.cursor?{}:{cursor:e.cursor}});return`/meetings/${encodeURIComponent(e.meetingId)}?${t.toString()}`}],73459);var t=e.i(95187);let n=(0,t.createServerReference)("406b7f07eedaeed4fd555b667f17f87127627eaee6",t.callServer,void 0,t.findSourceMapURL,"answerDelivery");e.s(["f",0,n],74175);let i=(0,t.createServerReference)("400b37ebb0a90a0f73cb1978ec8c9e4c4a171c9ecc",t.callServer,void 0,t.findSourceMapURL,"doneDelivery");e.s(["f",0,i],20794);let s=(0,t.createServerReference)("60298acc1cc947c4fd5df829eef7f60ac01f66426f",t.callServer,void 0,t.findSourceMapURL,"openDelivery");e.s(["f",0,s],49100);let a=(0,t.createServerReference)("40f5769695179d460f57ef659223c7bbc4c7cf4e5d",t.callServer,void 0,t.findSourceMapURL,"putInBasket");e.s(["f",0,a],65398);let r=(0,t.createServerReference)("40e0e357a857fdaa7a9ce19fdf8f13562b3a39d45c",t.callServer,void 0,t.findSourceMapURL,"putPickInBasket");e.s(["f",0,r],98404)}])})();
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25621,e=>{var t=e.i(43476);e.s(["f",0,function({isOn:e,label:n,isPending:s=!1,type:r="button",onClick:a,testId:l}){return(0,t.jsx)("button",{type:r,role:"switch","aria-checked":e,"aria-label":n,"aria-busy":s,disabled:s,onClick:a,"data-testid":l,className:`inline-flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition-colors disabled:opacity-60 ${e?"border-primary bg-primary":"border-input bg-muted"}`,children:(0,t.jsx)("span",{className:`size-3.5 rounded-full bg-background shadow-sm transition-transform ${e?"translate-x-4":"translate-x-0"} ${s?"animate-pulse":""}`})})}])},37018,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("60c6954ee32ef0da770b4a80d316382eb6c0a4c980",t.callServer,void 0,t.findSourceMapURL,"signInToParty");e.s(["f",0,n])},27055,19407,17779,35671,44047,90218,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("4055624bd11ca2ade15b378b28829dee0ac23423c1",t.callServer,void 0,t.findSourceMapURL,"setPartyScopes");function s(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)??""}`}function r(e){return`${String(e)} ${1===e?"tool":"tools"}`}function a(e,t){return null===t?e:`${e}; the fleet sees it at the proxy ship's next statement: ${t}`}e.s(["f",0,n],27055),e.s(["B",0,function({party:e,scopes:t}){return 0===t.length?`Every message to ${e} needs nothing beyond reaching it`:`Every message to ${e} needs ${s(t)}`},"G",0,function({party:e,scopes:t}){return 0===t.length?`Every tool of ${e} needs nothing beyond reaching it`:`Every tool of ${e} needs ${s(t)}`},"y",0,function({scopes:e,how:t,count:n}){return"remove"===t?`${s(e)} removed from ${r(n)}`:0===e.length?`${r(n)} need${1===n?"s":""} nothing of ${1===n?"its":"their"} own`:`${s(e)} set on ${r(n)}`},"I",0,a,"q",0,function(e){return e.map(({scopes:e,count:t})=>`${s(e)} set on ${r(t)}`).join("; ")},"g",0,function({count:e,isOn:t,statementRefusal:n}){return a(`${r(e)} switched ${t?"on":"off"}`,n)}],19407);var l=e.i(43476);e.s(["f",0,function({party:e=[],own:t,listed:n}){if(0===e.length&&0===t.length)return(0,l.jsx)("span",{className:"text-muted-foreground",children:"Nothing"});let s=(e,t)=>{let s=null!==n&&!n.has(e);return(0,l.jsxs)("span",{className:`inline-flex items-center rounded-md border px-2 font-mono text-caption ${s?"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg":t?"border-transparent bg-muted text-muted-foreground":"border-border"}`,"data-testid":t?"tools-table-party-scope":"tools-table-scope",title:s?"No longer defined in the fleet":t?"Every tool needs it":void 0,children:[e,s?(0,l.jsx)("span",{className:"ml-1 font-sans",children:"(no longer defined)"}):null]},`${t?"party":"own"}-${e}`)};return(0,l.jsxs)("span",{className:"flex flex-wrap gap-1",children:[e.map(e=>s(e,!0)),t.filter(t=>!e.includes(t)).map(e=>s(e,!1))]})}],17779);var i=e.i(24189),i=i,o=e.i(93976),d=e.i(37134),c=i,u=i,p=i,f=i,m=e.i(62050),h=e.i(45017),g=e.i(47125),x=e.i(10030),b=e.i(58998),v=e.i(94313),w=e.i(53535),y=i;let S=({scope:e,description:t})=>({value:e,label:e,description:t});e.s(["f",0,function({label:e,listed:t,picked:n,onPick:s,isDisabled:r=!1,testId:a}){let{contains:j}=i.useFilter(),N=[...t.map(S),...n.filter(e=>!t.some(t=>t.scope===e)).map(e=>({value:e,label:e,description:"No longer defined in the fleet"}))],R=N.filter(e=>n.includes(e.value));return(0,l.jsxs)(o.f.Root,{multiple:!0,items:N,value:R,disabled:r,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{"escape-key"===t.reason?t.cancel():s(e.map(e=>e.value))},filter:(e,t)=>j(e.label,t)||j(e.description,t),children:[(0,l.jsxs)("div",{className:"grid gap-1","data-testid":a,children:[(0,l.jsx)(d.f.Label,{className:"font-medium",children:e}),(0,l.jsx)(c.InputGroup,{className:"flex min-h-9 flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1",children:(0,l.jsxs)(u.Chips,{className:"contents",children:[R.map(e=>(0,l.jsxs)(p.Chip,{className:"inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 font-mono text-caption","aria-label":e.value,children:[e.value,(0,l.jsx)(f.ChipRemove,{className:"text-muted-foreground hover:text-foreground","aria-label":`Remove ${e.value}`,children:"×"})]},e.value)),(0,l.jsx)(m.f.Input,{placeholder:0===R.length?"Search the fleet's scopes":"",className:"h-7 min-w-32 flex-1 bg-transparent outline-none"})]})})]}),(0,l.jsx)(h.f.Portal,{children:(0,l.jsx)(g.f.Positioner,{sideOffset:4,className:"z-50",children:(0,l.jsxs)(x.f.Popup,{className:"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",children:[(0,l.jsx)(b.f.Empty,{className:"px-2 py-1 text-muted-foreground",children:"No scope listed matches."}),(0,l.jsx)(v.f.List,{children:e=>(0,l.jsxs)(w.f.Item,{value:e,className:"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded px-2 py-1 data-highlighted:bg-accent",children:[(0,l.jsx)(y.ItemIndicator,{className:"row-span-2",children:"✓"}),(0,l.jsx)("span",{className:"col-start-2 font-mono text-code",children:e.value}),(0,l.jsx)("span",{className:"col-start-2 text-caption text-muted-foreground",children:e.description})]},e.value)})]})})})]})}],35671);var j=e.i(26323),N=e.i(9977),R=e.i(41708),C=e.i(93480),k=e.i(9169),$=e.i(52744),P=e.i(30402),T=e.i(55070);e.s(["G",0,function({isOpen:e,onClose:t,title:n,description:s,children:r,appliesTo:a,action:i,isSaving:o,refusal:d,onReload:c,isReloading:u,testId:p}){return(0,l.jsx)(j.f.Root,{open:e,onOpenChange:e=>{e||o||t()},children:(0,l.jsxs)(N.f.Portal,{children:[(0,l.jsx)(R.f.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,l.jsxs)(C.f.Popup,{className:"fixed top-1/2 left-1/2 z-50 grid max-h-[90vh] w-[min(36rem,calc(100vw-2rem))] -translate-1/2 gap-4 overflow-auto rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-lg","data-testid":p,children:[(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(k.f.Title,{className:"text-heading font-semibold",children:n}),(0,l.jsx)($.f.Description,{className:"text-muted-foreground",children:s})]}),(0,l.jsx)("fieldset",{disabled:o,className:"grid gap-4",children:r}),null===d?null:(0,l.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-dialog-refusal",children:[(0,l.jsx)("span",{children:d.message}),d.isConflict?(0,l.jsx)(T.i,{isPending:u,pendingLabel:"Reloading…",onClick:c,"data-testid":"tools-table-reload",children:"Reload"}):null]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)("span",{className:"text-muted-foreground","data-testid":"tools-table-applies-to",children:a}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",className:P.x.secondary,disabled:o,onClick:t,children:"Cancel"}),(0,l.jsx)(T.i,{variant:"primary",isPending:o,pendingLabel:i.pending,disabled:i.isDisabled||u,onClick:i.onPress,"data-testid":"tools-table-dialog-action",children:i.label})]})]})]})]})})},"V",0,function(e,t){return e?.isConflict===!0&&t>e.version?null:e}],44047);var O=e.i(5654),I=e.i(43328),M=e.i(27538),D=e.i(77826),A=e.i(80734),E=e.i(60296),F=e.i(88941);e.s(["f",0,function(){let{toasts:e}=O.f.useToastManager();return(0,l.jsx)(I.f.Portal,{children:(0,l.jsx)(M.f.Viewport,{className:"fixed right-4 bottom-4 z-50 grid w-[min(24rem,calc(100vw-2rem))] gap-2",children:e.map(e=>(0,l.jsx)(D.f.Root,{toast:e,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-4 py-3 text-tone-ok-fg shadow-md","data-testid":"tools-table-toast",children:(0,l.jsxs)(A.f.Content,{className:"flex items-start justify-between gap-3",children:[(0,l.jsx)(E.f.Title,{}),(0,l.jsx)(F.f.Close,{"aria-label":"Dismiss",children:"×"})]})},e.id))})})}],90218)},12589,e=>{var t=e.i(43476),n=e.i(58487),s=e.i(5654),r=e.i(18566),a=e.i(71645),l=e.i(27055),i=e.i(19407),o=e.i(17779),d=e.i(35671),c=e.i(44047),u=e.i(90218);function p({fleetId:e,party:n,version:u,scopes:f,listed:m,canChange:h}){let g=(0,r.useRouter)(),x=s.f.useToastManager(),[,b]=(0,a.useTransition)(),[v,w]=(0,a.useTransition)(),[y,S]=(0,a.useState)(!1),[j,N]=(0,a.useState)([]),[R,C]=(0,a.useState)(!1),[k,$]=(0,a.useState)(null),[P,T]=(0,a.useState)(null),[O,I]=(0,a.useState)(0),[M,D]=(0,a.useState)(null),A=M?.basis===f?M.scopes:f;return(0,t.jsxs)("div",{className:`flex flex-wrap items-center gap-2 rounded-md ${O>0?"animate-highlight":""}`,"data-testid":"agent-needs",children:[(0,t.jsx)(o.f,{own:A,listed:null===m?null:new Set(m.map(({scope:e})=>e))}),h&&null!==m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-primary hover:underline",onClick:()=>{N([...A]),$(null),S(!0)},"data-testid":"agent-needs-change",children:"Change…"}),(0,t.jsx)(c.G,{isOpen:y,onClose:()=>{S(!1)},title:"Every message needs",description:`The scopes a calling ship must hold to message ${n}.`,appliesTo:`Applies to every message to ${n}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{C(!0),$(null);let t=Math.max(u,P??0);b(async()=>{let s=await (0,l.f)({fleetId:e,name:n,version:t,party:j,tools:[]});(C(!1),s.isOk)?(T(s.version),D({basis:f,scopes:j}),S(!1),I(e=>e+1),x.add({title:(0,i.I)((0,i.B)({party:n,scopes:j}),s.statementRefusal)}),g.refresh()):$({message:s.message,isConflict:s.isConflict,version:t})})}},isSaving:R,refusal:(0,c.V)(k,Math.max(u,P??0)),isReloading:v,onReload:()=>{w(()=>{g.refresh()})},testId:"agent-needs-dialog",children:(0,t.jsx)(d.f,{label:"Scopes",listed:m,picked:j,onPick:N,isDisabled:R,testId:"agent-needs-picker"})})]}):null]},O)}e.s(["AgentNeeds",0,function(e){return(0,t.jsxs)(n.f.Provider,{children:[(0,t.jsx)(p,{...e}),(0,t.jsx)(u.f,{})]})}])},54418,e=>{var t,n,s=e.i(43476),r=e.i(71645),a=e.i(8821),l=e.i(52245),i=e.i(79938);let o="--drawer-height",d="--drawer-swipe-movement-x",c="--drawer-swipe-movement-y",u="--drawer-snap-point-offset",p="--drawer-swipe-strength",f="--drawer-swipe-progress",m=r.forwardRef(function(e,t){let{render:n,className:s,style:r,forceRender:o=!1,...d}=e,c=(0,a.x)(),u=c.useState("open"),m=c.useState("nested"),h=c.useState("mounted"),g=c.useState("transitionStatus");return(0,l.a)("div",e,{state:{open:u,transitionStatus:g},ref:[c.context.backdropRef,t],stateAttributesMapping:i.M,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[f]:"0",[p]:"1"}},d],enabled:o||!m})}),h=e.i(56736).f,g="data-drawer-content",x=r.forwardRef(function(e,t){let{render:n,className:s,style:r,...i}=e;return(0,a.x)(),(0,l.a)("div",e,{ref:t,props:[{[g]:""},i]})});var b=e.i(46376),v=e.i(67865),w=e.i(56789),y=e.i(61487),S=e.i(35890),j=e.i(64938),N=e.i(80829),R=e.i(6640);S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;let C="data-swipe-dismiss",k="data-swiping";var $=e.i(25834),P=e.i(37584),T=e.i(73327),O=e.i(33332);let I=r.createContext(void 0);function M(e){let t=r.useContext(I);if(!0!==e&&void 0===t)throw Error((0,O.f)(90));return t}var D=e.i(8868),A=e.i(24429);function E(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function F(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if("number"==typeof e)return Number.isFinite(e)?e<=1?(0,A.f)(e,0,1)*t:e:null;let s=e.trim();if(s.endsWith("px")){let e=Number.parseFloat(s);return Number.isFinite(e)?e:null}if(s.endsWith("rem")){let e=Number.parseFloat(s);return Number.isFinite(e)?e*n:null}return null}function U(e,t){let n=-1,s=1/0;for(let r=0;r<e.length;r+=1){let a=Math.abs(e[r]-t);a<s&&(s=a,n=r)}return n}function z(){let e=(0,a.x)(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l}=M(),i=e.useState("viewportElement"),[o,d]=r.useState(0),[c,u]=r.useState(16),p=(0,v.f)(()=>{let e=(0,D.f)(i).documentElement;d(i?i.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});(0,b.f)(()=>{if(p(),!i||"function"!=typeof ResizeObserver)return;let e=new ResizeObserver(p);return e.observe(i),()=>{e.disconnect()}},[p,i]);let f=r.useMemo(()=>{if(!t||0===t.length||o<=0||l<=0)return[];let e=Math.min(l,o),n=t.map(t=>{let n=F(t,o,c);if(null===n)return null;let s=(0,A.f)(n,0,e);return{value:t,height:s,offset:Math.max(0,l-s)}}).filter(e=>!!e);if(n.length<=1)return n;let s=[],r=[];for(let e=n.length-1;e>=0;e-=1){let t=n[e];r.some(e=>1>=Math.abs(e-t.height))||(r.push(t.height),s.push(t))}return s.reverse(),s},[l,c,t,o]),m=r.useMemo(()=>{if(null===n)return;let e=f.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(l,o),s=F(n,o,c);if(null===s)return;let r=(0,A.f)(s,0,t);return f[U(f.map(e=>e.height),r)]},[n,l,f,c,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l,viewportHeight:o,resolvedSnapPoints:f,activeSnapPointOffset:m?.offset??null}}let H=r.createContext(null);var L=e.i(64111);let Y=!1,X={...i.M,expanded:e=>e?{"data-expanded":""}:null,nestedDrawerOpen:e=>e?{"data-nested-drawer-open":""}:null,nestedDrawerSwiping:e=>e?{"data-nested-drawer-swiping":""}:null,swipeDirection:e=>({"data-swipe-direction":e}),swiping:e=>e?{[k]:""}:null},V=r.forwardRef(function(e,t){let n,{render:i,className:m,style:h,finalFocus:g,initialFocus:x,...S}=e,j=(0,a.x)(),N=j.context.popupRef,{swipeDirection:R,frontmostHeight:C,hasNestedDrawer:k,nestedSwiping:O,nestedSwipeProgressStore:I,onPopupHeightChange:D,notifyParentFrontmostHeight:A,notifyParentHasNestedDrawer:F}=M(),U=j.useState("descriptionElementId"),V=j.useState("disablePointerDismissal"),G=j.useState("floatingRootContext"),W=j.useState("popupProps"),B=j.useState("modal"),K=j.useState("mounted"),q=j.useState("nested"),J=j.useState("nestedOpenDrawerCount"),Q=j.useState("transitionStatus"),Z=j.useState("open"),_=j.useState("openMethod"),ee=j.useState("titleElementId"),et=j.useState("role"),en=G.useState("floatingId"),es=S.id??en,er=r.useContext(H);(0,$.Z)();let{snapPoints:ea,activeSnapPoint:el,activeSnapPointOffset:ei}=z(),eo=J>0,ed=er?.swiping??!1,ec=er?.swipeStrength??null,[eu,ep]=r.useState(0),ef=r.useRef(0),em=(0,v.f)(()=>{let e=N.current;if(!e)return;let t=e.offsetHeight;if(!(ef.current>0)||!(C>ef.current)||!(t>ef.current)){if(ef.current>0&&k){let e=ef.current;ep(e),D(e);return}t!==ef.current&&(ef.current=t,ep(t),D(t))}});(0,b.f)(()=>{if(!K){ef.current=0,ep(0),D(0);return}let e=N.current;if(!e||(Y||("u">typeof CSS&&"registerProperty"in CSS&&([d,c,u].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:f,initialValue:"0"},{name:p,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),Y=!0),em(),"function"!=typeof ResizeObserver))return;let t=new ResizeObserver(em);return t.observe(e),()=>{t.disconnect()}},[em,K,eo,D,N]),(0,b.f)(()=>{let e=()=>{let e=N.current;if(!e)return;let t=I.getSnapshot();t>0?e.style.setProperty(f,`${t}`):e.style.setProperty(f,"0")};e();let t=I.subscribe(e),n=N.current;return()=>{t(),n&&n.style.setProperty(f,"0")}},[I,N]),(0,b.f)(()=>{if(Z)return A?.(C),()=>{A?.(0)}},[C,Z,A]),(0,b.f)(()=>{if(F)return F(Z||"ending"===Q),()=>{F(!1)}},[F,Z,Q]),(0,P.f)({open:Z,ref:N,onComplete(){Z&&j.context.onOpenChangeComplete?.(!0)}});let eh=void 0===x?N:x,eg=j.useStateSetter("popupElement"),ex=!k&&"ending"!==Q;eu&&!ex&&(n=`${eu}px`);let eb=ea&&ea.length>0&&("down"===R||"up"===R),ev=null;eb&&null!==ei&&(ev="up"===R?-ei:ei);let ew=er?er.getDragStyles():w.w;if(eb&&"down"===R){let e=Number.parseFloat(String(ew[c]));ew=ed&&Number.isFinite(e)?{...ew,transform:void 0,[c]:`${E(ei??0,e)}px`}:{...ew,transform:void 0}}let ey=(0,l.a)("div",e,{state:{open:Z,nested:q,transitionStatus:Q,expanded:1===el,nestedDrawerOpen:eo,nestedDrawerSwiping:O,swipeDirection:R,swiping:ed},props:[W,{id:es,"aria-labelledby":ee,"aria-describedby":U,role:et,...L.X,hidden:!K,onKeyDown(e){T.f.has(e.key)&&e.stopPropagation()},style:{...ew,[f]:"0","--nested-drawers":J,[o]:n,[u]:"number"==typeof ev?`${ev}px`:"0px","--drawer-frontmost-height":C?`${C}px`:void 0,[p]:"number"==typeof ec&&Number.isFinite(ec)&&ec>0?`${ec}`:"1"}},S],ref:[t,N,eg],stateAttributesMapping:X});return(0,s.jsx)(y.f,{context:G,openInteractionType:_,disabled:!K,closeOnFocusOut:!V,initialFocus:eh,returnFocus:g,modal:!1!==B,restoreFocus:"popup",children:ey})}),G=e.i(64951).f;var W=e.i(74735),B=e.i(51437),K=e.i(33848),q=e.i(22162),J=e.i(75606),Q=e.i(80025),Z=e.i(16856),Z=Z,_=e.i(66250);let ee=r.createContext(void 0);function et(){return r.useContext(ee)}function en(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let s=Number.isFinite(n)?n:0;s!==e&&(e=s,t.forEach(e=>{e()}))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}function es(){let e=et(),t=(0,a.x)(!1),n=e?.setDrawerOpen,s=e?.removeDrawer,l=t.useState("open"),i=t.useState("nestedOpenDialogCount"),o=t.useState("popupElement"),d=0===i;return(0,b.f)(()=>{if(s)return()=>{s(t)}},[s,t]),(0,b.f)(()=>{n?.(t,l)},[l,n,t]),r.useEffect(()=>{if(!l||!d||!q.f.os.android)return;let e=(0,K.f)(o).CloseWatcher;if(!e)return;let n=new e,s=(0,W.f)(n,"cancel",function(e){if(!t.select("open"))return;let n=(0,J.j)(Z.closeWatcher,e);e.cancelable||(n.cancel=w.x),t.setOpen(!1,n),n.isCanceled&&e.preventDefault()});return()=>{s(),n.destroy()}},[t,d,l,o]),null}let er=e.i(77173).f,ea=e.i(13488).f;var el=e.i(74080),ei=e.i(29315),eo=e.i(8445),ed=e.i(10199);let ec=r.forwardRef(function(e,t){let{render:n,className:s,style:r,children:i,...o}=e,d=(0,$.Z)(),c=(0,a.x)(),u=c.useState("open"),p=c.useState("nested"),f=c.useState("transitionStatus"),m=c.useState("nestedOpenDialogCount"),h=c.useState("mounted"),g=c.useStateSetter("viewportElement");return(0,l.a)("div",e,{enabled:d||h,state:{open:u,nested:p,transitionStatus:f,nestedDialogOpen:m>0},ref:[t,g],stateAttributesMapping:ed.f,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none"},children:i},o]})});S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;var eu=e.i(76782),ep=e.i(8760),ef=Z,em=e.i(84446),eh=e.i(24166),eg=e.i(96545),ex=e.i(38396),eb=e.i(2410);let ev=r.createContext(void 0),ew=`[${g}]`,ey={horizontal:`[${ex.a}="x"]`,vertical:`[${ex.a}="y"]`},eS=r.forwardRef(function(e,t){let{render:n,className:l,style:i,children:u,...p}=e,m=(0,a.x)(),h=m.context.popupRef,g=m.context.backdropRef,{swipeDirection:x,notifyParentSwipingChange:w,notifyParentSwipeProgressChange:y,frontmostHeight:S,snapToSequentialPoints:j,swipeAreaActiveRef:N}=M(),R=et(),{snapPoints:k,resolvedSnapPoints:$,activeSnapPoint:P,activeSnapPointOffset:T,setActiveSnapPoint:O,popupHeight:I}=z(),F=m.useState("open"),L=m.useState("mounted"),Y=m.useState("nested"),X=m.useState("nestedOpenDrawerCount"),V=m.useState("viewportElement"),G=m.useState("popupElement"),B=R?.visualStateStore,q=X>0,Q="left"===x||"right"===x?"horizontal":"vertical",Z="vertical"===Q,_=Z?"horizontal":"vertical",[ee,en]=r.useState(null),es=r.useRef(void 0),er=r.useRef(null),ea=(0,eo.z)(),ed=r.useRef(!1),eS=r.useRef(!1),eT=r.useRef(""),eO=r.useRef(!1),eI=r.useRef(!1),eM=r.useRef(null),eD=r.useContext(ev),eA=r.useMemo(()=>{if(!k||k.length<2||$.length<2||"down"!==x&&"up"!==x)return null;let e=$.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[$,k,x]),eE=r.useMemo(()=>eA&&null!==T?(0,A.f)((T-eA.minOffset)/eA.range,0,1):null,[T,eA]),eF=r.useMemo(()=>k&&k.length>0&&("down"===x||"up"===x)?"down"===x?["down","up"]:["up","down"]:[x],[k,x]),eU=(0,v.f)(e=>{h.current?.toggleAttribute(C,e),g.current?.toggleAttribute(C,e)}),ez=(0,v.f)(()=>{eU(!1),h.current?.removeAttribute(eh.f.endingStyle),en(null)}),eH=(0,v.f)(()=>{eS.current&&(eS.current=!1,w?.(!1))}),eL=(0,v.f)((e,t,n)=>{let s=F&&!Y&&t,r=s?e:0,a=F&&t?e:0;n&&y&&(y(a),a<=0&&eH()),B?.set({swipeProgress:r,frontmostHeight:r>0?S:0});let l=g.current;if(!l)return;let i=s&&r>0;l.style.setProperty(f,i?`${r}`:"0"),i&&S>0?l.style.setProperty(o,`${S}px`):l.style.removeProperty(o)}),eY=(0,ep.w)({enabled:L&&!q,directions:eF,elementRef:m.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:d,y:c},onSwipeStart(e){if("touches"in e||"touch"===e.pointerType)return;let t=h.current,n=(0,D.f)(t),s=n.getSelection?.();if(!s||s.isCollapsed)return;let r=(0,ei.m)(s.anchorNode)?s.anchorNode:s.anchorNode?.parentElement,a=(0,ei.m)(s.focusNode)?s.focusNode:s.focusNode?.parentElement;((0,em.I)(t,r)||(0,em.I)(t,a))&&s.removeAllRanges()},onSwipingChange(e){ed.current=e,ej(m.context.backdropRef.current,e),e||y||eH()},swipeThreshold:({element:e,direction:t})=>eR(e,t),canStart(e,t){let n=m.context.popupRef.current;if(!n)return!1;let s=t.nativeEvent,r="touches"in s||"touch"===s.pointerType,a=r?eM.current:null,l=n.ownerDocument,i=(0,eb.f)(n.getRootNode(),e.x,e.y);return!(!a?.startedInPopup&&!(0,em.I)(n,i)||r&&eC(l,n)||a?.hasCrossAxisGestureTarget&&!a.drawerAxisAttributed&&!0!==a.allowSwipe)},onProgress(e,t){let n=ed.current;n&&function(e){if(eS.current||!e)return;let t=e.direction??x;10>Math.abs((0,ep.R)(t,e.deltaX,e.deltaY))||(eS.current=!0,w?.(!0))}(t);let s=!!(k&&k.length>0);if(n&&"down"===x&&s&&t){let e=m.context.popupRef.current;e&&(e.style.removeProperty("transform"),e.style.setProperty(c,`${E(T??0,t.deltaY)}px`))}let r=e;if(eA&&I>0){let e=T??eA.minOffset;if(n&&t&&Number.isFinite(t.deltaY)){let n;n=(0,A.f)(e+t.deltaY,0,I),r=(0,A.f)((n-eA.minOffset)/eA.range,0,1)}else null!==eE&&(r=eE)}n||(y?.(0),eH()),eL(r,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:s,velocityX:r,velocityY:a,releaseVelocityX:l,releaseVelocityY:i}){let o=m.context.popupRef.current;if(!o)return void ez();function d(e){eH(),eU(!0),o.style.removeProperty("transition"),o.setAttribute(eh.f.endingStyle,""),el.flushSync(()=>{en(function(e,t,n,s,r,a,l,i){let o=eN(e,t);if(o<=0)return null;let d=Math.max(0,o-((("down"===t||"up"===t)&&k&&k.length>0?T??0:0)+(0,ep.R)(t,n,s)));if(d<=0)return null;let c=(0,ep.R)(t,l,i),u=Math.abs(c)>0?c:(0,ep.R)(t,r,a);if(u<=.2)return null;let p=(0,A.f)(u,.2,4);return .1+((0,A.f)(d/p,80,360)-80)/280*.9}(o,e,t,n,r,a,l,i))})}if(!k||0===k.length){if(!s)return void ez();let e=(0,ep.R)(s,t,n);if(e<=0)return ez(),!1;if((0,ep.R)(s,r,a)>=.5)return d(s),!0;let l=e>eR(o,s);return l?d(s):ez(),l}if("down"!==x&&"up"!==x)return void ez();if(!I)return ez(),!1;if(0===$.length)return void ez();let c="down"===x?n:-n,u=Math.sign(c),p="down"===x?i:-i,f="down"===x?a:-a,h=p;if(0!==u&&Math.abs(c)>=10){let e=Math.sign(h);0!==e&&e!==u&&(h=f)}let g=T??0,b=(0,A.f)(g+c,0,I),v=Math.abs(h)>=.5?300*(0,A.f)(h,-4,4):0,w=j?b:(0,A.f)(b+v,0,I),y=(0,J.j)(ef.swipe,e),S=()=>(eL(0,!0,!0),ez(),!1),N=e=>(O(e.value,y),S()),R=e=>s?(O(null,y),y.isCanceled)?S():(es.current=P,d(x),!0):N(e);if(j){let e=[...$].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=U(t,g),s=e[U(t,w)],r=Math.sign(h),a=w;if(0!==u&&0!==r&&r===u&&Math.abs(h)>=.5){let t=(0,A.f)(n+u,0,e.length-1);if(t!==n){let n=e[t];(u>0?w<n.offset:w>n.offset)&&(s=n,a=n.offset)}else if(u>0)return R(s)}return Math.abs(a-I)<Math.abs(a-s.offset)?R(s):N(s)}let C=$[U($.map(e=>e.offset),w)];return h>=.5&&c>0||Math.abs(w-I)<Math.abs(w-C.offset)?R(C):N(C)},onDismiss(e){B?.set({swipeProgress:0,frontmostHeight:0});let t=m.context.backdropRef.current;t&&(t.style.setProperty(f,"0"),t.style.removeProperty(o));let n=(0,J.j)(ef.swipe,e);if(m.setOpen(!1,n),n.isCanceled){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,er.current?.(),ez();return}m.select("open")?ea.request(()=>{if(m.select("open")){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,ez(),er.current?.()}else es.current=void 0}):(es.current=void 0,eU(!0))}}),eX=eY.getPointerProps(),eV=eY.getTouchProps(),{moveNative:eG,reset:eW}=eY;er.current=eW,r.useEffect(()=>{let e=V??G;if(!e||!F||!L)return;let t=(0,D.f)(e);return(0,W.f)(t,"touchmove",function(n){var s,r;if(eD?.onTouchMove(n),eI.current)return;let a=eM.current,l=n.touches[0];l&&a&&(!function(n,s,r){let a=Z?r.clientY-s.lastY:r.clientX-s.lastX;if(2===n.touches.length||eC(t,e)||q||function(e,t,n,s){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||!0===e.allowSwipe||!e.hasCrossAxisGestureTarget)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let r=s?n.clientY-e.startY:n.clientX-e.startX,a=s?n.clientX-e.startX:n.clientY-e.startY,l=Math.abs(r),i=Math.abs(a);return i>=6&&i>l+2?(e.preserveNativeCrossAxisScroll=!0,!0):!(l>=6)||(e.drawerAxisAttributed=!0,!1)}(s,n,r,Z))return;let l=s.scrollTarget;if(!l||l===t.documentElement||l===t.body){n.cancelable&&n.preventDefault(),n.stopPropagation(),eG(n,e);return}if(!(ek(l,Q).max>0)){n.cancelable&&n.preventDefault(),n.stopPropagation();return}if(0!==a){var i,o,d,c;let e=(i=l,o=Q,d=x,c=a,!!(eP(d,o)?c>0:c<0)&&e$(i,o,d));s.allowSwipe?n.cancelable&&n.preventDefault():n.cancelable&&e?(s.allowSwipe=!0,n.preventDefault()):s.allowSwipe=!1}!0===s.allowSwipe&&(n.stopPropagation(),eG(n,e))}(n,a,l),(s=a).lastX=(r=l).clientX,s.lastY=r.clientY)},{passive:!1,capture:!0})},[L,q,F,G,Z,Q,x,eG,V,eD]),(0,b.f)(()=>{eA&&!eY.swiping&&eL(!F||Y?0:eE??0,!0,!1)},[eL,S,Y,y,F,eE,eA,eY.swiping,m,B]),(0,b.f)(()=>{if(y)return F||y(0),()=>{y(0)}},[y,F]),(0,b.f)(()=>{F&&(N.current||eW(),ez())},[ez,F,eW,N]),(0,b.f)(()=>{let e=g.current;return()=>{B?.set({swipeProgress:0,frontmostHeight:0}),ej(e,!1);let t=g.current;t!==e&&ej(t,!1),eH()}},[g,eH,B]);let eB=r.useMemo(()=>({swiping:eY.swiping,getDragStyles:eY.getDragStyles,swipeStrength:ee??null,setSwipeDismissed:eU}),[eU,eY.getDragStyles,eY.swiping,ee]);function eK(e){eI.current=e,eM.current=null}function eq(){eK(!1),eT.current="",eO.current=!1}function eJ(e){return eT.current="","touch"!==e.pointerType}return(0,s.jsx)(ec,{ref:t,className:l,style:i,render:n,...(0,eu.w)(p,{onPointerDown(e){var t,n;if(eT.current=e.pointerType,eO.current="pen"===e.pointerType,!F||!L||q)return;let s=(0,eb.f)(e.currentTarget.getRootNode(),e.clientX,e.clientY);t=s,(0,em.h)(t,ex.u)||(n=s,(0,em.h)(n,ew))||"touch"!==e.pointerType&&eX.onPointerDown?.(e)},onPointerMove(e){"touch"!==e.pointerType&&eX.onPointerMove?.(e)},onPointerUp(e){eJ(e)&&eX.onPointerUp?.(e)},onPointerCancel(e){eJ(e)&&eX.onPointerCancel?.(e)},onTouchStart(e){var t,n,s;if("pen"===eT.current&&eO.current){eO.current=!1,eK(!1);return}if(!F||!L||q)return void eK(!1);let r=e.touches[0];if(!r)return;if(n=(t=e).nativeEvent,s=(0,K.f)(t.currentTarget),n.composedPath().some(e=>e instanceof s.HTMLInputElement&&"range"===e.type))return void eK(!1);let a=e.currentTarget,l=(0,eb.f)(a.getRootNode(),r.clientX,r.clientY),i=(0,em.Z)(e.nativeEvent),o=(0,ei.m)(i)?i:a;if(!(0,em.I)(a,o)||(eD?.onTouchStart(e),(0,em.h)(l,`${ex.u}:not(${ey[_]})`)))return void eK(!0);eI.current=!1;let d=(0,eg.U)(o,a,Q),c=null!=(0,eg.U)(o,a,_)||null!=(0,em.h)(l,ey[_]),u=null;d&&(u=!!e$(d,Q,x)&&null),eM.current={startX:r.clientX,startY:r.clientY,lastX:r.clientX,lastY:r.clientY,startedInPopup:(0,em.I)(h.current,l),scrollTarget:d,hasCrossAxisGestureTarget:c,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},eV.onTouchStart?.(e)},onTouchEnd(e){eD?.onTouchEnd(e),eq(),eV.onTouchEnd?.(e)},onTouchCancel(e){eD?.onTouchCancel(),eq(),eV.onTouchCancel?.(e)},"data-nested-dialog-open":void 0}),children:(0,s.jsx)(H.Provider,{value:eB,children:u})})});function ej(e,t){e?.toggleAttribute(k,t)}function eN(e,t){return"left"===t||"right"===t?e.offsetWidth:e.offsetHeight}function eR(e,t){return Math.max(.5*eN(e,t),10)}function eC(e,t){let n,s,r=(0,em.T)(e);if(r&&(0,em.I)(t,r)&&("INPUT"===r.tagName||"TEXTAREA"===r.tagName)){let{selectionStart:e,selectionEnd:t}=r;if(null!=e&&null!=t&&e<t)return!0}let a=e.getSelection?.();return!!a&&!a.isCollapsed&&(n=(0,ei.m)(a.anchorNode)?a.anchorNode:a.anchorNode?.parentElement,s=(0,ei.m)(a.focusNode)?a.focusNode:a.focusNode?.parentElement,a.containsNode(t,!0)||(0,em.I)(t,n)||(0,em.I)(t,s))}function ek(e,t){if("vertical"===t){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function e$(e,t,n){let s=eP(n,t),{offset:r,max:a}=ek(e,t);return s?r<=0:r>=a}function eP(e,t){return"vertical"===t?"down"===e:"right"===e}e.s(["Backdrop",0,m,"Close",0,h,"Content",0,x,"Popup",0,V,"Portal",0,G,"Root",0,function(e){let{children:a,open:l,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:d,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h=null,swipeDirection:g="down",snapToSequentialPoints:x=!1,snapPoints:b,snapPoint:w,defaultSnapPoint:y,onSnapPointChange:S}=e,j=M(!0),N=j?.onNestedSwipeProgressChange,R=j?.onNestedFrontmostHeightChange,C=j?.onNestedSwipingChange,k=j?.onNestedDrawerPresenceChange,[$,P]=r.useState(0),[T,O]=r.useState(0),[D,A]=r.useState(!1),[E,F]=r.useState(!1),[U]=r.useState(en),z=void 0!==y?y:b?.[0]??null,H=void 0!==w,[L,Y]=(0,B.f)({controlled:w,default:z,name:"Drawer",state:"snapPoint"}),X=r.useRef(!1),V=r.useRef(!1),G=(0,v.f)((e,t)=>{let n=t??(0,J.j)(Q.f.none);S?.(e,n),n.isCanceled||Y(e)}),W=r.useMemo(()=>H||!b||0===b.length||null!==L&&b.some(e=>Object.is(e,L))?L:z,[L,H,z,b]),K=(0,v.f)(e=>{P(e),!X.current&&e>0&&O(e)}),q=(0,v.f)(e=>{if(e>0){X.current=!0,O(e);return}X.current=!1,$>0&&O($)}),Z=(0,v.f)(e=>{A(e)}),ee=(0,v.f)(e=>{U.set(e),N?.(e)}),et=(0,v.f)(e=>{F(e),C?.(e)}),er=(0,v.f)((e,t)=>{o?.(e,t),!t.isCanceled&&!e&&b&&b.length>0&&G(z,(0,J.j)(t.reason,t.event,t.trigger))}),ea=r.useMemo(()=>({swipeDirection:g,swipeAreaActiveRef:V,snapToSequentialPoints:x,snapPoints:b,activeSnapPoint:W,setActiveSnapPoint:G,frontmostHeight:T,popupHeight:$,hasNestedDrawer:D,nestedSwiping:E,nestedSwipeProgressStore:U,onNestedDrawerPresenceChange:Z,onPopupHeightChange:K,onNestedFrontmostHeightChange:q,onNestedSwipingChange:et,onNestedSwipeProgressChange:ee,notifyParentFrontmostHeight:R,notifyParentSwipingChange:C,notifyParentSwipeProgressChange:N,notifyParentHasNestedDrawer:k}),[W,T,D,E,U,k,N,C,R,Z,q,ee,et,K,$,G,b,x,V,g]),el="function"==typeof a?e=>(0,s.jsxs)(r.Fragment,{children:[t||(t=(0,s.jsx)(es,{})),a(e)]}):(0,s.jsxs)(r.Fragment,{children:[n||(n=(0,s.jsx)(es,{})),a]}),ei=(0,_.f)("drawer",{open:l,defaultOpen:i,onOpenChange:er,onOpenChangeComplete:d,disablePointerDismissal:c,modal:u,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h,children:el});return(0,s.jsx)(I.Provider,{value:ea,children:ei})},"Title",0,er,"Trigger",0,ea,"Viewport",0,eS],58954);var eT=e.i(58954),eT=eT,eO=eT,eI=eT,eM=eT,eD=eT,eA=eT,eE=eT,eF=eT,eU=eT,ez=e.i(58487),eH=e.i(5654),eL=e.i(18566),eY=e.i(30402),eX=e.i(25621),eV=e.i(55070),eG=e.i(97e3),eW=e.i(27055),eB=e.i(95187);let eK=(0,eB.createServerReference)("408b7585197882a44a3cc8c0b1c3280e3806171563",eB.callServer,void 0,eB.findSourceMapURL,"switchPartyTools"),eq=[{how:"add",label:"Add to each"},{how:"remove",label:"Remove from each"},{how:"replace",label:"Replace with these"}];var eJ=e.i(19407);let eQ=[{state:"all",label:"All"},{state:"on",label:"On"},{state:"off",label:"Off"},{state:"new",label:"New"},{state:"needsNothing",label:"Needs nothing"}];var eZ=e.i(17779),e_=e.i(35671),e0=e.i(44047),e1=e.i(90218);function e2(e){return e?.split("\n").find(e=>""!==e.trim())?.trim()??""}function e4({fleetId:e,party:t,tools:n,version:a,partyScopes:l,listed:i,canChange:o,serverRefusal:d}){var c;let u,p,f=(0,eL.useRouter)(),m=eH.f.useToastManager(),[,h]=(0,r.useTransition)(),[g,x]=(0,r.useTransition)(),[b,v]=(0,r.useState)(""),[w,y]=(0,r.useState)("all"),[S,j]=(0,r.useState)(new Set),[N,R]=(0,r.useState)(null),[C,k]=(0,r.useState)([]),[$,P]=(0,r.useState)("add"),[T,O]=(0,r.useState)({readOnly:[],other:[]}),[I,M]=(0,r.useState)(!1),[D,A]=(0,r.useState)(null),[E,F]=(0,r.useState)(null),[U,z]=(0,r.useState)(null),[H,L]=(0,r.useState)({names:new Set,round:0}),[Y,X]=(0,r.useState)(null),[V,G]=(0,r.useState)(!1),[W,B]=(0,r.useState)(null),K=W?.basis===n?W:null,q=null===K?n:n.map(e=>({...e,scopes:K.scopes.get(e.name)??e.scopes,isOn:null===e.isOn?null:K.switches.get(e.name)??e.isOn})),J=K?.party??l,Q=Math.max(a,Y??0),Z=null===i?null:new Set(i.map(({scope:e})=>e)),_=(u=(c={name:b,state:w,partyScopes:J}).name.trim().toLowerCase(),q.filter(e=>e.name.toLowerCase().includes(u)&&function(e,{state:t,partyScopes:n}){switch(t){case"all":return!0;case"on":return!0===e.isOn;case"off":return!1===e.isOn;case"new":return e.isNew;case"needsNothing":return 0===n.length&&0===e.scopes.length}}(e,c))),ee=q.filter(({name:e})=>S.has(e)),et=null===d,en=_.length>0&&_.every(({name:e})=>S.has(e)),es=function(e){let t={readOnly:[],other:[],withoutHints:[]};for(let n of e.filter(({scopes:e})=>0===e.length))!0===n.isDestructive||!1===n.isReadOnly?t.other.push(n.name):!0===n.isReadOnly?t.readOnly.push(n.name):t.withoutHints.push(n.name);return t}(q),er=[...(p=(e,t)=>0===t.length?[]:e.map(e=>({tool:e,scopes:[...t]})))(es.readOnly,T.readOnly),...p(es.other,T.other)],ea=({outcome:e,changed:t,message:s,change:r})=>{B({basis:n,party:r.party??K?.party??null,scopes:new Map([...K?.scopes??[],...(r.scopes??[]).map(({tool:e,scopes:t})=>[e,t])]),switches:new Map([...K?.switches??[],...r.switches??[]])}),null!==e.version&&X(e.version),L(e=>({names:new Set(t),round:e.round+1})),m.add({title:(0,eJ.I)(s,e.statementRefusal)}),f.refresh()},el=e=>{A(null),G(!1),k("party"===e?[...J]:[]),P("add"),O({readOnly:[],other:[]}),R(e)},ei=()=>{R(null),A(null)},eo=({change:n,changed:s,message:r})=>{M(!0),A(null),h(async()=>{let a=await (0,eW.f)({fleetId:e,name:t,version:Q,...n});(M(!1),a.isOk)?(R(null),j(new Set),ea({outcome:a,changed:s,message:r,change:{...void 0===n.party?{}:{party:n.party},scopes:n.tools}})):A({message:a.message,isConflict:a.isConflict,version:Q})})},ed=({names:n,isOn:s,working:r})=>{F(r),z(null),G(!1),h(async()=>{let r=await eK({fleetId:e,name:t,tools:[...n],isOn:s});if(F(null),!r.isOk)return void z(r.message);let[a]=n;ea({outcome:r,changed:n,change:{switches:new Map(n.map(e=>[e,s]))},message:1===n.length&&void 0!==a?function({tool:e,isOn:t,statementRefusal:n}){let s=`${e} is ${t?"on":"off"}`;return null!==n?`${s}; the fleet sees it at the proxy ship's next statement: ${n}`:t?`${s}: the fleet may call it.`:`${s}: the fleet sees it no more, and a call to it is refused.`}({tool:a,isOn:s,statementRefusal:null}):(0,eJ.g)({count:n.length,isOn:s,statementRefusal:null})})})},ec=()=>{x(()=>{f.refresh()})},eu=null!==E||I,ep=(0,s.jsxs)("div",{className:"grid gap-3 sm:flex sm:flex-wrap sm:items-center","data-testid":"tools-table-toolbar",children:[(0,s.jsxs)("label",{className:"grid gap-1 sm:w-56",children:[(0,s.jsx)("span",{className:"sr-only",children:"Filter by name"}),(0,s.jsx)("input",{className:eY.w,type:"search",placeholder:"Filter by name",value:b,onChange:e=>{v(e.target.value)},"data-testid":"tools-table-name-filter"})]}),(0,s.jsx)("div",{role:"group","aria-label":"Filter by state",className:"flex flex-wrap gap-1",children:eQ.map(({state:e,label:t})=>(0,s.jsx)("button",{type:"button","aria-pressed":w===e,onClick:()=>{y(e)},className:`h-8 rounded-md border px-3 ${w===e?"border-primary bg-primary text-primary-foreground":"border-border bg-card hover:bg-accent"}`,"data-testid":`tools-table-state-${e}`,children:t},e))}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:en,onChange:()=>{j(e=>{let t=new Set(e);for(let{name:e}of _)en?t.delete(e):t.add(e);return t})},disabled:0===_.length,"data-testid":"tools-table-select-shown"}),"Select all shown"]}),(0,s.jsxs)("span",{className:"text-muted-foreground","data-testid":"tools-table-selected",children:[S.size," selected"]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:0===S.size||eu||null===i,onClick:()=>{el("scopes")},"data-testid":"tools-table-set-scopes",children:"Set scopes…"}),(0,s.jsx)(eV.i,{isPending:"on"===E,pendingLabel:"Switching on…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!0,working:"on"})},"data-testid":"tools-table-switch-on",children:"Switch on"}),(0,s.jsx)(eV.i,{isPending:"off"===E,pendingLabel:"Switching off…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!1,working:"off"})},"data-testid":"tools-table-switch-off",children:"Switch off"}),(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:eu||!et||null===i,onClick:()=>{el("suggest")},"data-testid":"tools-table-suggest",children:"Suggest from hints…"})]})]}):null]});return(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"tools-table-party-needs",children:[(0,s.jsx)("span",{className:"font-medium",children:"Every tool needs"}),(0,s.jsx)(eZ.f,{party:J,own:[],listed:Z}),o?(0,s.jsx)("button",{type:"button",className:"text-primary hover:underline disabled:opacity-60",disabled:eu||null===i,onClick:()=>{el("party")},"data-testid":"tools-table-party-change",children:"Change…"}):null]}),null===d?null:(0,s.jsxs)("p",{role:"status",className:"rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-tone-waiting-fg","data-testid":"tools-table-server-down",children:["The server did not answer, so this shows the scopes kept per tool name; they can still be changed. ",d]}),(0,s.jsx)("div",{className:"hidden sm:block",children:ep}),(0,s.jsx)("div",{className:"sm:hidden",children:(0,s.jsxs)(eT.Root,{open:V,onOpenChange:G,children:[(0,s.jsxs)(eO.Trigger,{className:eY.x.secondary,"data-testid":"tools-table-sheet-open",children:["Filters and actions",o?` (${String(S.size)} selected)`:""]}),(0,s.jsxs)(eI.Portal,{children:[(0,s.jsx)(eM.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,s.jsx)(eD.Viewport,{className:"fixed inset-0 z-50 flex items-end",children:(0,s.jsx)(eA.Popup,{className:"w-full rounded-t-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:(0,s.jsxs)(eE.Content,{className:"grid gap-3",children:[(0,s.jsx)(eF.Title,{className:"text-heading font-semibold",children:"Filters and actions"}),ep,(0,s.jsx)(eU.Close,{className:eY.x.secondary,children:"Done"})]})})})]})]})}),null===U?null:(0,s.jsx)("p",{role:"alert",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-switch-refusal",children:U}),(0,s.jsxs)("table",{className:"w-full border-collapse max-sm:block","data-testid":"tools-table",children:[(0,s.jsx)("thead",{className:"max-sm:hidden",children:(0,s.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[o?(0,s.jsx)("th",{className:"w-8 py-2",children:(0,s.jsx)("span",{className:"sr-only",children:"Selected"})}):null,(0,s.jsx)("th",{className:"py-2 font-medium",children:"Tool"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Hints"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"On"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Needs"})]})}),(0,s.jsx)("tbody",{className:"max-sm:grid max-sm:gap-2",children:_.map(e=>{let t=H.names.has(e.name);return(0,s.jsxs)("tr",{className:`border-b border-border align-top last:border-b-0 max-sm:grid max-sm:grid-cols-[auto_1fr] max-sm:gap-x-2 max-sm:rounded-md max-sm:border max-sm:p-2 ${t?"animate-highlight":""}`,"data-testid":"tools-table-row","data-tool":e.name,children:[o?(0,s.jsx)("td",{className:"py-2 pr-2 max-sm:row-span-4",children:(0,s.jsx)("input",{type:"checkbox","aria-label":`Select ${e.name}`,checked:S.has(e.name),onChange:()=>{var t;t=e.name,j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},"data-testid":"tools-table-select"})}):null,(0,s.jsxs)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:[(0,s.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono",children:e.name}),e.isNew?(0,s.jsx)(eG.T,{tone:"attention",label:"New"}):null]}),""===e2(e.description)?null:(0,s.jsx)("span",{className:"block text-muted-foreground",children:e2(e.description)})]}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:(0,s.jsxs)("span",{className:"flex flex-wrap gap-1",children:[!0===e.isReadOnly?(0,s.jsx)(eG.E,{children:"Read only"}):null,!0===e.isDestructive?(0,s.jsx)(eG.E,{children:"Destructive"}):null]})}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:null===e.isOn?(0,s.jsx)("span",{className:"text-muted-foreground",children:"Not known"}):o?(0,s.jsx)(eX.f,{isOn:e.isOn,label:e.name,isPending:E===e.name,onClick:()=>{ed({names:[e.name],isOn:!0!==e.isOn,working:e.name})},testId:"tools-table-switch"}):(0,s.jsx)(eG.E,{children:e.isOn?"On":"Off"})}),(0,s.jsx)("td",{className:"py-2 max-sm:col-start-2",children:(0,s.jsx)(eZ.f,{party:J,own:e.scopes,listed:Z})})]},t?`${e.name}-${String(H.round)}`:e.name)})})]}),0===_.length?(0,s.jsx)("p",{className:"text-muted-foreground","data-testid":"tools-table-empty",children:0===q.length?et?`${t} lists no tools.`:"No tool needs a scope of its own yet.":"No tool matches the filters."}):null,null===i?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e0.G,{isOpen:"scopes"===N,onClose:ei,title:"Set scopes",description:"The scopes a calling ship must hold for each selected tool, beside what every tool needs.",appliesTo:`Applies to ${String(ee.length)} ${1===ee.length?"tool":"tools"}`,action:{label:"Set scopes",pending:"Setting…",isDisabled:0===C.length&&"replace"!==$,onPress:()=>{var e;eo({change:{tools:(e={scopes:C,how:$},ee.map(({name:t,scopes:n})=>{switch(e.how){case"add":return{tool:t,scopes:[...new Set([...n,...e.scopes])]};case"remove":return{tool:t,scopes:n.filter(t=>!e.scopes.includes(t))};case"replace":return{tool:t,scopes:[...new Set(e.scopes)]}}}))},changed:ee.map(({name:e})=>e),message:(0,eJ.y)({scopes:C,how:$,count:ee.length})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-scopes-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-scopes-picker"}),(0,s.jsxs)("fieldset",{className:"grid gap-1",children:[(0,s.jsx)("legend",{className:"font-medium",children:"On each selected tool"}),eq.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"how",value:e.how,checked:$===e.how,onChange:()=>{P(e.how)},"data-testid":`tools-table-how-${e.how}`}),e.label]},e.how))]})]}),(0,s.jsx)(e0.G,{isOpen:"party"===N,onClose:ei,title:"Every tool needs",description:`The scopes a calling ship must hold for every tool of ${t}, beside each tool's own.`,appliesTo:`Applies to every tool of ${t}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{eo({change:{party:C,tools:[]},changed:q.map(({name:e})=>e),message:(0,eJ.G)({party:t,scopes:C})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-party-dialog",children:(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-party-picker"})}),(0,s.jsxs)(e0.G,{isOpen:"suggest"===N,onClose:ei,title:"Suggest from hints",description:"Scopes for each tool with no scope of its own, by what the server says of it. Hints are the server's claim: nothing applies until you confirm.",appliesTo:`Applies to ${String(er.length)} ${1===er.length?"tool":"tools"}`,action:{label:"Apply",pending:"Applying…",isDisabled:0===er.length,onPress:()=>{let e=[{scopes:T.readOnly,count:0===T.readOnly.length?0:es.readOnly.length},{scopes:T.other,count:0===T.other.length?0:es.other.length}].filter(({count:e})=>e>0);eo({change:{tools:er},changed:er.map(({tool:e})=>e),message:(0,eJ.q)(e)})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-suggest-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes for read-only tools",listed:i,picked:T.readOnly,onPick:e=>{O(t=>({...t,readOnly:e}))},isDisabled:I,testId:"tools-table-suggest-read-only"}),(0,s.jsx)(e_.f,{label:"Scopes for the other tools",listed:i,picked:T.other,onPick:e=>{O(t=>({...t,other:e}))},isDisabled:I,testId:"tools-table-suggest-other"}),(0,s.jsx)(e5,{title:"Read-only tools",names:es.readOnly,testId:"tools-table-suggest-read-only-tools"}),(0,s.jsx)(e5,{title:"Other tools",names:es.other,testId:"tools-table-suggest-other-tools"}),(0,s.jsx)(e5,{title:"Without hints, left as they are",names:es.withoutHints,testId:"tools-table-suggest-without-hints"})]})]})]})}function e5({title:e,names:t,testId:n}){return(0,s.jsxs)("details",{className:"rounded-md border border-border px-3 py-2","data-testid":n,children:[(0,s.jsxs)("summary",{className:"cursor-pointer",children:[e," (",t.length,")"]}),0===t.length?(0,s.jsx)("p",{className:"text-muted-foreground",children:"None"}):(0,s.jsx)("p",{className:"font-mono text-code break-words",children:t.join(", ")})]})}e.s(["ToolsTable",0,function(e){return(0,s.jsxs)(ez.f.Provider,{children:[(0,s.jsx)(e4,{...e}),(0,s.jsx)(e1.f,{})]})}],54418)},15327,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(95187);let a=(0,r.createServerReference)("40a9ad5c4ced811b2e1b944591f45e2bdec3885949",r.callServer,void 0,r.findSourceMapURL,"readMoreSignIns"),l=(0,r.createServerReference)("4004ce1d46e14c5c2150455347d2c7a8d5d86a444d",r.callServer,void 0,r.findSourceMapURL,"removePersonSignIn");function i(e,t){let n=new Set(e.map(({personShipId:e})=>e));return[...e,...t.filter(({personShipId:e})=>!n.has(e))]}var o=e.i(30402),d=e.i(94984),c=e.i(97e3);let u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p=e=>String(e).padStart(2,"0"),f={signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}};function m(e){return e.personName??e.personShipId}function h({count:e}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Everyone's sign-ins"}),null===e?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:e})]})}function g(){return(0,t.jsx)("thead",{className:"max-sm:hidden",children:(0,t.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Person"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Account"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"State"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Last used"}),(0,t.jsx)("th",{className:"h-10 px-2",children:(0,t.jsx)("span",{className:"sr-only",children:"Remove"})})]})})}function x({signIn:e,party:n,isRemoving:s,onConfirm:r,onKeep:a}){let l=m(e);return(0,t.jsxs)("div",{className:"grid gap-2 rounded-md bg-muted p-3","data-testid":"outside-party-sign-ins-confirm",children:[(0,t.jsxs)("p",{children:["Remove ",l,"'s sign-in? Their ships' calls to ",n," are refused until they sign in again."]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:o.x.destructive,disabled:s,"aria-busy":s,onClick:r,"data-testid":"outside-party-sign-ins-remove-confirmed",children:s?"Removing…":`Remove ${l}'s sign-in`}),(0,t.jsx)("button",{type:"button",className:o.x.secondary,onClick:a,children:"Keep"})]})]})}function b(e){let{party:n,now:s,rows:r,refusal:a,hasMore:l,isLoadingMore:i,confirming:b,removing:v,outcome:w}=e;return(0,t.jsxs)("section",{className:`${o.r} grid gap-3`,"data-testid":"outside-party-sign-ins",children:[(0,t.jsx)(h,{count:null===a?r.length:null}),(0,t.jsx)(d.f,{state:w}),null!==a?(0,t.jsx)(d.f,{state:{kind:"refused",message:a}}):0===r.length?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Nobody has signed in yet."}):(0,t.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,t.jsx)(g,{}),(0,t.jsx)("tbody",{className:"max-sm:grid",children:r.map(r=>{var a;let l,i,d=f[r.state],h=b===r.personShipId,g=null===r.lastUsedAt?"Not yet":(a=r.lastUsedAt,(i=new Date(s).getTime()-new Date(a).getTime())<6e4?"Just now":i<36e5?`${String(Math.floor(i/6e4))} min ago`:(l=new Date(a),`${String(l.getUTCDate())} ${u[l.getUTCMonth()]??""}, ${p(l.getUTCHours())}:${p(l.getUTCMinutes())}`));return[(0,t.jsxs)("tr",{className:`border-b border-border max-sm:grid max-sm:grid-cols-[1fr_auto] max-sm:gap-1 max-sm:py-3 ${h?"border-b-0":"last:border-b-0"}`,"data-testid":"outside-party-sign-ins-row",children:[(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-start-1 max-sm:row-start-1 max-sm:h-auto max-sm:px-0 max-sm:font-medium",children:[m(r),r.isYours?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" (you)"}):null]}),(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-span-2 max-sm:row-start-2 max-sm:h-auto max-sm:px-0 max-sm:text-muted-foreground",children:[function({outsideAccount:e}){return e.name??e.subject??(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}(r),(0,t.jsxs)("span",{className:"sm:hidden",children:[" · last used ",null===r.lastUsedAt?"not yet":g]})]}),(0,t.jsx)("td",{className:"h-12 px-2 max-sm:col-start-2 max-sm:row-start-1 max-sm:h-auto max-sm:px-0",children:(0,t.jsx)(c.T,{tone:d.tone,label:d.label})}),(0,t.jsx)("td",{className:"h-12 px-2 text-muted-foreground max-sm:hidden",children:g}),(0,t.jsx)("td",{className:"h-12 px-2 text-right max-sm:col-span-2 max-sm:row-start-3 max-sm:h-auto max-sm:px-0 max-sm:text-left",children:(0,t.jsx)("button",{type:"button",className:`${o.x.secondary} ${h?"max-sm:hidden":""}`,onClick:()=>{e.onRemove(r.personShipId)},"data-testid":"outside-party-sign-ins-remove",children:"Remove"})})]},r.personShipId),h?(0,t.jsx)("tr",{className:"border-b border-border last:border-b-0 max-sm:block max-sm:pb-3",children:(0,t.jsx)("td",{colSpan:5,className:"pb-2 max-sm:block max-sm:pb-0",children:(0,t.jsx)(x,{signIn:r,party:n,isRemoving:v===r.personShipId,onConfirm:()=>{e.onConfirm(r)},onKeep:e.onKeep})})},`${r.personShipId}-confirm`):null]})})]}),null===a&&l?(0,t.jsx)("div",{children:(0,t.jsx)("button",{type:"button",className:o.x.secondary,disabled:i,"aria-busy":i,onClick:e.onMore,"data-testid":"outside-party-sign-ins-more",children:i?"Showing more…":"Show more"})}):null]})}e.s(["EveryonesSignInsCard",0,function({fleetId:e,party:r,now:o,first:d}){let[c,u]=(0,n.useState)([]),[p,f]=(0,n.useState)(d.next),[h,g]=(0,n.useState)(new Set),[x,v]=(0,n.useState)(null),[w,y]=(0,n.useState)(null),[S,j]=(0,n.useState)(s.Q),[N,R]=(0,n.useTransition)(),[,C]=(0,n.useTransition)(),k=i(d.grants,c).filter(({personShipId:e})=>!h.has(e));return(0,t.jsx)(b,{party:r,now:o,rows:k,refusal:null,hasMore:null!==p,isLoadingMore:N,confirming:x,removing:w,outcome:S,onRemove:e=>{v(e),j(s.Q)},onConfirm:t=>{y(t.personShipId),C(async()=>{let n=await l({fleetId:e,name:r,personShipId:t.personShipId});y(null),v(null),n.isOk?(g(e=>new Set([...e,t.personShipId])),j({kind:"done",message:function({person:e,party:t,isRevoked:n}){return n?`${e}'s sign-in is removed, and revoked at ${t}.`:`${e}'s sign-in is removed.`}({person:m(t),party:r,isRevoked:n.isRevoked})})):j({kind:"refused",message:n.message})})},onKeep:()=>{v(null)},onMore:()=>{let t=p??k.at(-1)?.personShipId;void 0!==t&&R(async()=>{let n=await a({fleetId:e,name:r,after:t});n.isOk?(u(e=>i(e,n.grants)),f(n.next)):j({kind:"refused",message:n.message})})}})}],15327)},52979,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(94984),a=e.i(58107),l=e.i(95187);let i=(0,l.createServerReference)("60f6ca9b179e3a54d5ed0f11cdb52aaa1f537bc553",l.callServer,void 0,l.findSourceMapURL,"removeOwnSignIn");var o=e.i(37018);function d({fleetId:e,party:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"hidden",name:s.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:n})]})}e.s(["RemoveSignInForm",0,function({fleetId:e,party:l}){let[o,c]=(0,n.useActionState)(i,s.Q);return(0,t.jsxs)("form",{action:c,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:o}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:"secondary",pending:"Removing…",testId:"outside-party-sign-in-remove",children:"Remove"})})]})},"SignInForm",0,function({fleetId:e,party:l,label:i,kind:c}){let[u,p]=(0,n.useActionState)(o.f,s.Q);return(0,t.jsxs)("form",{action:p,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:u}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:c,pending:`Opening ${l}…`,testId:"outside-party-sign-in-start",children:i})})]})}],52979)},12137,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(74080),r=e.i(28008),a=e.i(25621),l=e.i(95187);let i=(0,l.createServerReference)("60fc44c5251aea4e8cf6a11329208266754ef56a78",l.callServer,void 0,l.findSourceMapURL,"markA2aAgent"),o={kind:"idle"};function d({isRepeatable:e}){let n=(0,s.useFormStatus)();return(0,t.jsx)(a.f,{type:"submit",isOn:e,label:"Repeatable",isPending:n.pending,testId:"outside-party-repeatable-switch"})}e.s(["RepeatableSwitch",0,function({fleetId:e,party:s,isRepeatable:a}){let[l,c]=(0,n.useActionState)(i,o),u="marked"===l.kind?l.isRepeatable:a;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{action:c,className:"contents",children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:s}),(0,t.jsx)("input",{type:"hidden",name:"isRepeatable",value:String(!u)}),(0,t.jsx)(d,{isRepeatable:u})]}),"idle"===l.kind?null:(0,t.jsx)("span",{role:"refused"===l.kind?"alert":"status",className:`basis-full text-caption ${"refused"===l.kind?"text-tone-attention-fg":"text-tone-ok-fg"}`,"data-testid":"outside-party-repeatable-outcome",children:l.message})]})}],12137)}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25621,e=>{var t=e.i(43476);e.s(["f",0,function({isOn:e,label:n,isPending:s=!1,type:r="button",onClick:a,testId:l}){return(0,t.jsx)("button",{type:r,role:"switch","aria-checked":e,"aria-label":n,"aria-busy":s,disabled:s,onClick:a,"data-testid":l,className:`inline-flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition-colors disabled:opacity-60 ${e?"border-primary bg-primary":"border-input bg-muted"}`,children:(0,t.jsx)("span",{className:`size-3.5 rounded-full bg-background shadow-sm transition-transform ${e?"translate-x-4":"translate-x-0"} ${s?"animate-pulse":""}`})})}])},16293,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("60a17908e3b22eb1b4a494def6f12126d6cf55c66d",t.callServer,void 0,t.findSourceMapURL,"signInToParty");e.s(["f",0,n])},62275,19407,17779,35671,44047,90218,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("401284c106092aed666ad781af234d01577ff2b95e",t.callServer,void 0,t.findSourceMapURL,"setPartyScopes");function s(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)??""}`}function r(e){return`${String(e)} ${1===e?"tool":"tools"}`}function a(e,t){return null===t?e:`${e}; the fleet sees it at the proxy ship's next statement: ${t}`}e.s(["f",0,n],62275),e.s(["B",0,function({party:e,scopes:t}){return 0===t.length?`Every message to ${e} needs nothing beyond reaching it`:`Every message to ${e} needs ${s(t)}`},"G",0,function({party:e,scopes:t}){return 0===t.length?`Every tool of ${e} needs nothing beyond reaching it`:`Every tool of ${e} needs ${s(t)}`},"y",0,function({scopes:e,how:t,count:n}){return"remove"===t?`${s(e)} removed from ${r(n)}`:0===e.length?`${r(n)} need${1===n?"s":""} nothing of ${1===n?"its":"their"} own`:`${s(e)} set on ${r(n)}`},"I",0,a,"q",0,function(e){return e.map(({scopes:e,count:t})=>`${s(e)} set on ${r(t)}`).join("; ")},"g",0,function({count:e,isOn:t,statementRefusal:n}){return a(`${r(e)} switched ${t?"on":"off"}`,n)}],19407);var l=e.i(43476);e.s(["f",0,function({party:e=[],own:t,listed:n}){if(0===e.length&&0===t.length)return(0,l.jsx)("span",{className:"text-muted-foreground",children:"Nothing"});let s=(e,t)=>{let s=null!==n&&!n.has(e);return(0,l.jsxs)("span",{className:`inline-flex items-center rounded-md border px-2 font-mono text-caption ${s?"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg":t?"border-transparent bg-muted text-muted-foreground":"border-border"}`,"data-testid":t?"tools-table-party-scope":"tools-table-scope",title:s?"No longer defined in the fleet":t?"Every tool needs it":void 0,children:[e,s?(0,l.jsx)("span",{className:"ml-1 font-sans",children:"(no longer defined)"}):null]},`${t?"party":"own"}-${e}`)};return(0,l.jsxs)("span",{className:"flex flex-wrap gap-1",children:[e.map(e=>s(e,!0)),t.filter(t=>!e.includes(t)).map(e=>s(e,!1))]})}],17779);var i=e.i(24189),i=i,o=e.i(93976),d=e.i(37134),c=i,u=i,p=i,f=i,m=e.i(62050),h=e.i(45017),g=e.i(47125),x=e.i(10030),b=e.i(58998),v=e.i(94313),w=e.i(53535),y=i;let S=({scope:e,description:t})=>({value:e,label:e,description:t});e.s(["f",0,function({label:e,listed:t,picked:n,onPick:s,isDisabled:r=!1,testId:a}){let{contains:j}=i.useFilter(),N=[...t.map(S),...n.filter(e=>!t.some(t=>t.scope===e)).map(e=>({value:e,label:e,description:"No longer defined in the fleet"}))],R=N.filter(e=>n.includes(e.value));return(0,l.jsxs)(o.f.Root,{multiple:!0,items:N,value:R,disabled:r,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{"escape-key"===t.reason?t.cancel():s(e.map(e=>e.value))},filter:(e,t)=>j(e.label,t)||j(e.description,t),children:[(0,l.jsxs)("div",{className:"grid gap-1","data-testid":a,children:[(0,l.jsx)(d.f.Label,{className:"font-medium",children:e}),(0,l.jsx)(c.InputGroup,{className:"flex min-h-9 flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1",children:(0,l.jsxs)(u.Chips,{className:"contents",children:[R.map(e=>(0,l.jsxs)(p.Chip,{className:"inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 font-mono text-caption","aria-label":e.value,children:[e.value,(0,l.jsx)(f.ChipRemove,{className:"text-muted-foreground hover:text-foreground","aria-label":`Remove ${e.value}`,children:"×"})]},e.value)),(0,l.jsx)(m.f.Input,{placeholder:0===R.length?"Search the fleet's scopes":"",className:"h-7 min-w-32 flex-1 bg-transparent outline-none"})]})})]}),(0,l.jsx)(h.f.Portal,{children:(0,l.jsx)(g.f.Positioner,{sideOffset:4,className:"z-50",children:(0,l.jsxs)(x.f.Popup,{className:"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",children:[(0,l.jsx)(b.f.Empty,{className:"px-2 py-1 text-muted-foreground",children:"No scope listed matches."}),(0,l.jsx)(v.f.List,{children:e=>(0,l.jsxs)(w.f.Item,{value:e,className:"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded px-2 py-1 data-highlighted:bg-accent",children:[(0,l.jsx)(y.ItemIndicator,{className:"row-span-2",children:"✓"}),(0,l.jsx)("span",{className:"col-start-2 font-mono text-code",children:e.value}),(0,l.jsx)("span",{className:"col-start-2 text-caption text-muted-foreground",children:e.description})]},e.value)})]})})})]})}],35671);var j=e.i(26323),N=e.i(9977),R=e.i(41708),C=e.i(93480),k=e.i(9169),$=e.i(52744),P=e.i(30402),T=e.i(55070);e.s(["G",0,function({isOpen:e,onClose:t,title:n,description:s,children:r,appliesTo:a,action:i,isSaving:o,refusal:d,onReload:c,isReloading:u,testId:p}){return(0,l.jsx)(j.f.Root,{open:e,onOpenChange:e=>{e||o||t()},children:(0,l.jsxs)(N.f.Portal,{children:[(0,l.jsx)(R.f.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,l.jsxs)(C.f.Popup,{className:"fixed top-1/2 left-1/2 z-50 grid max-h-[90vh] w-[min(36rem,calc(100vw-2rem))] -translate-1/2 gap-4 overflow-auto rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-lg","data-testid":p,children:[(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(k.f.Title,{className:"text-heading font-semibold",children:n}),(0,l.jsx)($.f.Description,{className:"text-muted-foreground",children:s})]}),(0,l.jsx)("fieldset",{disabled:o,className:"grid gap-4",children:r}),null===d?null:(0,l.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-dialog-refusal",children:[(0,l.jsx)("span",{children:d.message}),d.isConflict?(0,l.jsx)(T.i,{isPending:u,pendingLabel:"Reloading…",onClick:c,"data-testid":"tools-table-reload",children:"Reload"}):null]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)("span",{className:"text-muted-foreground","data-testid":"tools-table-applies-to",children:a}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",className:P.x.secondary,disabled:o,onClick:t,children:"Cancel"}),(0,l.jsx)(T.i,{variant:"primary",isPending:o,pendingLabel:i.pending,disabled:i.isDisabled||u,onClick:i.onPress,"data-testid":"tools-table-dialog-action",children:i.label})]})]})]})]})})},"V",0,function(e,t){return e?.isConflict===!0&&t>e.version?null:e}],44047);var O=e.i(5654),I=e.i(43328),M=e.i(27538),D=e.i(77826),A=e.i(80734),E=e.i(60296),F=e.i(88941);e.s(["f",0,function(){let{toasts:e}=O.f.useToastManager();return(0,l.jsx)(I.f.Portal,{children:(0,l.jsx)(M.f.Viewport,{className:"fixed right-4 bottom-4 z-50 grid w-[min(24rem,calc(100vw-2rem))] gap-2",children:e.map(e=>(0,l.jsx)(D.f.Root,{toast:e,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-4 py-3 text-tone-ok-fg shadow-md","data-testid":"tools-table-toast",children:(0,l.jsxs)(A.f.Content,{className:"flex items-start justify-between gap-3",children:[(0,l.jsx)(E.f.Title,{}),(0,l.jsx)(F.f.Close,{"aria-label":"Dismiss",children:"×"})]})},e.id))})})}],90218)},12589,e=>{var t=e.i(43476),n=e.i(58487),s=e.i(5654),r=e.i(18566),a=e.i(71645),l=e.i(62275),i=e.i(19407),o=e.i(17779),d=e.i(35671),c=e.i(44047),u=e.i(90218);function p({fleetId:e,party:n,version:u,scopes:f,listed:m,canChange:h}){let g=(0,r.useRouter)(),x=s.f.useToastManager(),[,b]=(0,a.useTransition)(),[v,w]=(0,a.useTransition)(),[y,S]=(0,a.useState)(!1),[j,N]=(0,a.useState)([]),[R,C]=(0,a.useState)(!1),[k,$]=(0,a.useState)(null),[P,T]=(0,a.useState)(null),[O,I]=(0,a.useState)(0),[M,D]=(0,a.useState)(null),A=M?.basis===f?M.scopes:f;return(0,t.jsxs)("div",{className:`flex flex-wrap items-center gap-2 rounded-md ${O>0?"animate-highlight":""}`,"data-testid":"agent-needs",children:[(0,t.jsx)(o.f,{own:A,listed:null===m?null:new Set(m.map(({scope:e})=>e))}),h&&null!==m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-primary hover:underline",onClick:()=>{N([...A]),$(null),S(!0)},"data-testid":"agent-needs-change",children:"Change…"}),(0,t.jsx)(c.G,{isOpen:y,onClose:()=>{S(!1)},title:"Every message needs",description:`The scopes a calling ship must hold to message ${n}.`,appliesTo:`Applies to every message to ${n}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{C(!0),$(null);let t=Math.max(u,P??0);b(async()=>{let s=await (0,l.f)({fleetId:e,name:n,version:t,party:j,tools:[]});(C(!1),s.isOk)?(T(s.version),D({basis:f,scopes:j}),S(!1),I(e=>e+1),x.add({title:(0,i.I)((0,i.B)({party:n,scopes:j}),s.statementRefusal)}),g.refresh()):$({message:s.message,isConflict:s.isConflict,version:t})})}},isSaving:R,refusal:(0,c.V)(k,Math.max(u,P??0)),isReloading:v,onReload:()=>{w(()=>{g.refresh()})},testId:"agent-needs-dialog",children:(0,t.jsx)(d.f,{label:"Scopes",listed:m,picked:j,onPick:N,isDisabled:R,testId:"agent-needs-picker"})})]}):null]},O)}e.s(["AgentNeeds",0,function(e){return(0,t.jsxs)(n.f.Provider,{children:[(0,t.jsx)(p,{...e}),(0,t.jsx)(u.f,{})]})}])},54418,e=>{var t,n,s=e.i(43476),r=e.i(71645),a=e.i(8821),l=e.i(52245),i=e.i(79938);let o="--drawer-height",d="--drawer-swipe-movement-x",c="--drawer-swipe-movement-y",u="--drawer-snap-point-offset",p="--drawer-swipe-strength",f="--drawer-swipe-progress",m=r.forwardRef(function(e,t){let{render:n,className:s,style:r,forceRender:o=!1,...d}=e,c=(0,a.x)(),u=c.useState("open"),m=c.useState("nested"),h=c.useState("mounted"),g=c.useState("transitionStatus");return(0,l.a)("div",e,{state:{open:u,transitionStatus:g},ref:[c.context.backdropRef,t],stateAttributesMapping:i.M,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[f]:"0",[p]:"1"}},d],enabled:o||!m})}),h=e.i(56736).f,g="data-drawer-content",x=r.forwardRef(function(e,t){let{render:n,className:s,style:r,...i}=e;return(0,a.x)(),(0,l.a)("div",e,{ref:t,props:[{[g]:""},i]})});var b=e.i(46376),v=e.i(67865),w=e.i(56789),y=e.i(61487),S=e.i(35890),j=e.i(64938),N=e.i(80829),R=e.i(6640);S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;let C="data-swipe-dismiss",k="data-swiping";var $=e.i(25834),P=e.i(37584),T=e.i(73327),O=e.i(33332);let I=r.createContext(void 0);function M(e){let t=r.useContext(I);if(!0!==e&&void 0===t)throw Error((0,O.f)(90));return t}var D=e.i(8868),A=e.i(24429);function E(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function F(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if("number"==typeof e)return Number.isFinite(e)?e<=1?(0,A.f)(e,0,1)*t:e:null;let s=e.trim();if(s.endsWith("px")){let e=Number.parseFloat(s);return Number.isFinite(e)?e:null}if(s.endsWith("rem")){let e=Number.parseFloat(s);return Number.isFinite(e)?e*n:null}return null}function U(e,t){let n=-1,s=1/0;for(let r=0;r<e.length;r+=1){let a=Math.abs(e[r]-t);a<s&&(s=a,n=r)}return n}function z(){let e=(0,a.x)(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l}=M(),i=e.useState("viewportElement"),[o,d]=r.useState(0),[c,u]=r.useState(16),p=(0,v.f)(()=>{let e=(0,D.f)(i).documentElement;d(i?i.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});(0,b.f)(()=>{if(p(),!i||"function"!=typeof ResizeObserver)return;let e=new ResizeObserver(p);return e.observe(i),()=>{e.disconnect()}},[p,i]);let f=r.useMemo(()=>{if(!t||0===t.length||o<=0||l<=0)return[];let e=Math.min(l,o),n=t.map(t=>{let n=F(t,o,c);if(null===n)return null;let s=(0,A.f)(n,0,e);return{value:t,height:s,offset:Math.max(0,l-s)}}).filter(e=>!!e);if(n.length<=1)return n;let s=[],r=[];for(let e=n.length-1;e>=0;e-=1){let t=n[e];r.some(e=>1>=Math.abs(e-t.height))||(r.push(t.height),s.push(t))}return s.reverse(),s},[l,c,t,o]),m=r.useMemo(()=>{if(null===n)return;let e=f.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(l,o),s=F(n,o,c);if(null===s)return;let r=(0,A.f)(s,0,t);return f[U(f.map(e=>e.height),r)]},[n,l,f,c,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l,viewportHeight:o,resolvedSnapPoints:f,activeSnapPointOffset:m?.offset??null}}let H=r.createContext(null);var L=e.i(64111);let Y=!1,X={...i.M,expanded:e=>e?{"data-expanded":""}:null,nestedDrawerOpen:e=>e?{"data-nested-drawer-open":""}:null,nestedDrawerSwiping:e=>e?{"data-nested-drawer-swiping":""}:null,swipeDirection:e=>({"data-swipe-direction":e}),swiping:e=>e?{[k]:""}:null},V=r.forwardRef(function(e,t){let n,{render:i,className:m,style:h,finalFocus:g,initialFocus:x,...S}=e,j=(0,a.x)(),N=j.context.popupRef,{swipeDirection:R,frontmostHeight:C,hasNestedDrawer:k,nestedSwiping:O,nestedSwipeProgressStore:I,onPopupHeightChange:D,notifyParentFrontmostHeight:A,notifyParentHasNestedDrawer:F}=M(),U=j.useState("descriptionElementId"),V=j.useState("disablePointerDismissal"),G=j.useState("floatingRootContext"),W=j.useState("popupProps"),B=j.useState("modal"),K=j.useState("mounted"),q=j.useState("nested"),J=j.useState("nestedOpenDrawerCount"),Q=j.useState("transitionStatus"),Z=j.useState("open"),_=j.useState("openMethod"),ee=j.useState("titleElementId"),et=j.useState("role"),en=G.useState("floatingId"),es=S.id??en,er=r.useContext(H);(0,$.Z)();let{snapPoints:ea,activeSnapPoint:el,activeSnapPointOffset:ei}=z(),eo=J>0,ed=er?.swiping??!1,ec=er?.swipeStrength??null,[eu,ep]=r.useState(0),ef=r.useRef(0),em=(0,v.f)(()=>{let e=N.current;if(!e)return;let t=e.offsetHeight;if(!(ef.current>0)||!(C>ef.current)||!(t>ef.current)){if(ef.current>0&&k){let e=ef.current;ep(e),D(e);return}t!==ef.current&&(ef.current=t,ep(t),D(t))}});(0,b.f)(()=>{if(!K){ef.current=0,ep(0),D(0);return}let e=N.current;if(!e||(Y||("u">typeof CSS&&"registerProperty"in CSS&&([d,c,u].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:f,initialValue:"0"},{name:p,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),Y=!0),em(),"function"!=typeof ResizeObserver))return;let t=new ResizeObserver(em);return t.observe(e),()=>{t.disconnect()}},[em,K,eo,D,N]),(0,b.f)(()=>{let e=()=>{let e=N.current;if(!e)return;let t=I.getSnapshot();t>0?e.style.setProperty(f,`${t}`):e.style.setProperty(f,"0")};e();let t=I.subscribe(e),n=N.current;return()=>{t(),n&&n.style.setProperty(f,"0")}},[I,N]),(0,b.f)(()=>{if(Z)return A?.(C),()=>{A?.(0)}},[C,Z,A]),(0,b.f)(()=>{if(F)return F(Z||"ending"===Q),()=>{F(!1)}},[F,Z,Q]),(0,P.f)({open:Z,ref:N,onComplete(){Z&&j.context.onOpenChangeComplete?.(!0)}});let eh=void 0===x?N:x,eg=j.useStateSetter("popupElement"),ex=!k&&"ending"!==Q;eu&&!ex&&(n=`${eu}px`);let eb=ea&&ea.length>0&&("down"===R||"up"===R),ev=null;eb&&null!==ei&&(ev="up"===R?-ei:ei);let ew=er?er.getDragStyles():w.w;if(eb&&"down"===R){let e=Number.parseFloat(String(ew[c]));ew=ed&&Number.isFinite(e)?{...ew,transform:void 0,[c]:`${E(ei??0,e)}px`}:{...ew,transform:void 0}}let ey=(0,l.a)("div",e,{state:{open:Z,nested:q,transitionStatus:Q,expanded:1===el,nestedDrawerOpen:eo,nestedDrawerSwiping:O,swipeDirection:R,swiping:ed},props:[W,{id:es,"aria-labelledby":ee,"aria-describedby":U,role:et,...L.X,hidden:!K,onKeyDown(e){T.f.has(e.key)&&e.stopPropagation()},style:{...ew,[f]:"0","--nested-drawers":J,[o]:n,[u]:"number"==typeof ev?`${ev}px`:"0px","--drawer-frontmost-height":C?`${C}px`:void 0,[p]:"number"==typeof ec&&Number.isFinite(ec)&&ec>0?`${ec}`:"1"}},S],ref:[t,N,eg],stateAttributesMapping:X});return(0,s.jsx)(y.f,{context:G,openInteractionType:_,disabled:!K,closeOnFocusOut:!V,initialFocus:eh,returnFocus:g,modal:!1!==B,restoreFocus:"popup",children:ey})}),G=e.i(64951).f;var W=e.i(74735),B=e.i(51437),K=e.i(33848),q=e.i(22162),J=e.i(75606),Q=e.i(80025),Z=e.i(16856),Z=Z,_=e.i(66250);let ee=r.createContext(void 0);function et(){return r.useContext(ee)}function en(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let s=Number.isFinite(n)?n:0;s!==e&&(e=s,t.forEach(e=>{e()}))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}function es(){let e=et(),t=(0,a.x)(!1),n=e?.setDrawerOpen,s=e?.removeDrawer,l=t.useState("open"),i=t.useState("nestedOpenDialogCount"),o=t.useState("popupElement"),d=0===i;return(0,b.f)(()=>{if(s)return()=>{s(t)}},[s,t]),(0,b.f)(()=>{n?.(t,l)},[l,n,t]),r.useEffect(()=>{if(!l||!d||!q.f.os.android)return;let e=(0,K.f)(o).CloseWatcher;if(!e)return;let n=new e,s=(0,W.f)(n,"cancel",function(e){if(!t.select("open"))return;let n=(0,J.j)(Z.closeWatcher,e);e.cancelable||(n.cancel=w.x),t.setOpen(!1,n),n.isCanceled&&e.preventDefault()});return()=>{s(),n.destroy()}},[t,d,l,o]),null}let er=e.i(77173).f,ea=e.i(13488).f;var el=e.i(74080),ei=e.i(29315),eo=e.i(8445),ed=e.i(10199);let ec=r.forwardRef(function(e,t){let{render:n,className:s,style:r,children:i,...o}=e,d=(0,$.Z)(),c=(0,a.x)(),u=c.useState("open"),p=c.useState("nested"),f=c.useState("transitionStatus"),m=c.useState("nestedOpenDialogCount"),h=c.useState("mounted"),g=c.useStateSetter("viewportElement");return(0,l.a)("div",e,{enabled:d||h,state:{open:u,nested:p,transitionStatus:f,nestedDialogOpen:m>0},ref:[t,g],stateAttributesMapping:ed.f,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none"},children:i},o]})});S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;var eu=e.i(76782),ep=e.i(8760),ef=Z,em=e.i(84446),eh=e.i(24166),eg=e.i(96545),ex=e.i(38396),eb=e.i(2410);let ev=r.createContext(void 0),ew=`[${g}]`,ey={horizontal:`[${ex.a}="x"]`,vertical:`[${ex.a}="y"]`},eS=r.forwardRef(function(e,t){let{render:n,className:l,style:i,children:u,...p}=e,m=(0,a.x)(),h=m.context.popupRef,g=m.context.backdropRef,{swipeDirection:x,notifyParentSwipingChange:w,notifyParentSwipeProgressChange:y,frontmostHeight:S,snapToSequentialPoints:j,swipeAreaActiveRef:N}=M(),R=et(),{snapPoints:k,resolvedSnapPoints:$,activeSnapPoint:P,activeSnapPointOffset:T,setActiveSnapPoint:O,popupHeight:I}=z(),F=m.useState("open"),L=m.useState("mounted"),Y=m.useState("nested"),X=m.useState("nestedOpenDrawerCount"),V=m.useState("viewportElement"),G=m.useState("popupElement"),B=R?.visualStateStore,q=X>0,Q="left"===x||"right"===x?"horizontal":"vertical",Z="vertical"===Q,_=Z?"horizontal":"vertical",[ee,en]=r.useState(null),es=r.useRef(void 0),er=r.useRef(null),ea=(0,eo.z)(),ed=r.useRef(!1),eS=r.useRef(!1),eT=r.useRef(""),eO=r.useRef(!1),eI=r.useRef(!1),eM=r.useRef(null),eD=r.useContext(ev),eA=r.useMemo(()=>{if(!k||k.length<2||$.length<2||"down"!==x&&"up"!==x)return null;let e=$.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[$,k,x]),eE=r.useMemo(()=>eA&&null!==T?(0,A.f)((T-eA.minOffset)/eA.range,0,1):null,[T,eA]),eF=r.useMemo(()=>k&&k.length>0&&("down"===x||"up"===x)?"down"===x?["down","up"]:["up","down"]:[x],[k,x]),eU=(0,v.f)(e=>{h.current?.toggleAttribute(C,e),g.current?.toggleAttribute(C,e)}),ez=(0,v.f)(()=>{eU(!1),h.current?.removeAttribute(eh.f.endingStyle),en(null)}),eH=(0,v.f)(()=>{eS.current&&(eS.current=!1,w?.(!1))}),eL=(0,v.f)((e,t,n)=>{let s=F&&!Y&&t,r=s?e:0,a=F&&t?e:0;n&&y&&(y(a),a<=0&&eH()),B?.set({swipeProgress:r,frontmostHeight:r>0?S:0});let l=g.current;if(!l)return;let i=s&&r>0;l.style.setProperty(f,i?`${r}`:"0"),i&&S>0?l.style.setProperty(o,`${S}px`):l.style.removeProperty(o)}),eY=(0,ep.w)({enabled:L&&!q,directions:eF,elementRef:m.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:d,y:c},onSwipeStart(e){if("touches"in e||"touch"===e.pointerType)return;let t=h.current,n=(0,D.f)(t),s=n.getSelection?.();if(!s||s.isCollapsed)return;let r=(0,ei.m)(s.anchorNode)?s.anchorNode:s.anchorNode?.parentElement,a=(0,ei.m)(s.focusNode)?s.focusNode:s.focusNode?.parentElement;((0,em.I)(t,r)||(0,em.I)(t,a))&&s.removeAllRanges()},onSwipingChange(e){ed.current=e,ej(m.context.backdropRef.current,e),e||y||eH()},swipeThreshold:({element:e,direction:t})=>eR(e,t),canStart(e,t){let n=m.context.popupRef.current;if(!n)return!1;let s=t.nativeEvent,r="touches"in s||"touch"===s.pointerType,a=r?eM.current:null,l=n.ownerDocument,i=(0,eb.f)(n.getRootNode(),e.x,e.y);return!(!a?.startedInPopup&&!(0,em.I)(n,i)||r&&eC(l,n)||a?.hasCrossAxisGestureTarget&&!a.drawerAxisAttributed&&!0!==a.allowSwipe)},onProgress(e,t){let n=ed.current;n&&function(e){if(eS.current||!e)return;let t=e.direction??x;10>Math.abs((0,ep.R)(t,e.deltaX,e.deltaY))||(eS.current=!0,w?.(!0))}(t);let s=!!(k&&k.length>0);if(n&&"down"===x&&s&&t){let e=m.context.popupRef.current;e&&(e.style.removeProperty("transform"),e.style.setProperty(c,`${E(T??0,t.deltaY)}px`))}let r=e;if(eA&&I>0){let e=T??eA.minOffset;if(n&&t&&Number.isFinite(t.deltaY)){let n;n=(0,A.f)(e+t.deltaY,0,I),r=(0,A.f)((n-eA.minOffset)/eA.range,0,1)}else null!==eE&&(r=eE)}n||(y?.(0),eH()),eL(r,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:s,velocityX:r,velocityY:a,releaseVelocityX:l,releaseVelocityY:i}){let o=m.context.popupRef.current;if(!o)return void ez();function d(e){eH(),eU(!0),o.style.removeProperty("transition"),o.setAttribute(eh.f.endingStyle,""),el.flushSync(()=>{en(function(e,t,n,s,r,a,l,i){let o=eN(e,t);if(o<=0)return null;let d=Math.max(0,o-((("down"===t||"up"===t)&&k&&k.length>0?T??0:0)+(0,ep.R)(t,n,s)));if(d<=0)return null;let c=(0,ep.R)(t,l,i),u=Math.abs(c)>0?c:(0,ep.R)(t,r,a);if(u<=.2)return null;let p=(0,A.f)(u,.2,4);return .1+((0,A.f)(d/p,80,360)-80)/280*.9}(o,e,t,n,r,a,l,i))})}if(!k||0===k.length){if(!s)return void ez();let e=(0,ep.R)(s,t,n);if(e<=0)return ez(),!1;if((0,ep.R)(s,r,a)>=.5)return d(s),!0;let l=e>eR(o,s);return l?d(s):ez(),l}if("down"!==x&&"up"!==x)return void ez();if(!I)return ez(),!1;if(0===$.length)return void ez();let c="down"===x?n:-n,u=Math.sign(c),p="down"===x?i:-i,f="down"===x?a:-a,h=p;if(0!==u&&Math.abs(c)>=10){let e=Math.sign(h);0!==e&&e!==u&&(h=f)}let g=T??0,b=(0,A.f)(g+c,0,I),v=Math.abs(h)>=.5?300*(0,A.f)(h,-4,4):0,w=j?b:(0,A.f)(b+v,0,I),y=(0,J.j)(ef.swipe,e),S=()=>(eL(0,!0,!0),ez(),!1),N=e=>(O(e.value,y),S()),R=e=>s?(O(null,y),y.isCanceled)?S():(es.current=P,d(x),!0):N(e);if(j){let e=[...$].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=U(t,g),s=e[U(t,w)],r=Math.sign(h),a=w;if(0!==u&&0!==r&&r===u&&Math.abs(h)>=.5){let t=(0,A.f)(n+u,0,e.length-1);if(t!==n){let n=e[t];(u>0?w<n.offset:w>n.offset)&&(s=n,a=n.offset)}else if(u>0)return R(s)}return Math.abs(a-I)<Math.abs(a-s.offset)?R(s):N(s)}let C=$[U($.map(e=>e.offset),w)];return h>=.5&&c>0||Math.abs(w-I)<Math.abs(w-C.offset)?R(C):N(C)},onDismiss(e){B?.set({swipeProgress:0,frontmostHeight:0});let t=m.context.backdropRef.current;t&&(t.style.setProperty(f,"0"),t.style.removeProperty(o));let n=(0,J.j)(ef.swipe,e);if(m.setOpen(!1,n),n.isCanceled){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,er.current?.(),ez();return}m.select("open")?ea.request(()=>{if(m.select("open")){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,ez(),er.current?.()}else es.current=void 0}):(es.current=void 0,eU(!0))}}),eX=eY.getPointerProps(),eV=eY.getTouchProps(),{moveNative:eG,reset:eW}=eY;er.current=eW,r.useEffect(()=>{let e=V??G;if(!e||!F||!L)return;let t=(0,D.f)(e);return(0,W.f)(t,"touchmove",function(n){var s,r;if(eD?.onTouchMove(n),eI.current)return;let a=eM.current,l=n.touches[0];l&&a&&(!function(n,s,r){let a=Z?r.clientY-s.lastY:r.clientX-s.lastX;if(2===n.touches.length||eC(t,e)||q||function(e,t,n,s){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||!0===e.allowSwipe||!e.hasCrossAxisGestureTarget)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let r=s?n.clientY-e.startY:n.clientX-e.startX,a=s?n.clientX-e.startX:n.clientY-e.startY,l=Math.abs(r),i=Math.abs(a);return i>=6&&i>l+2?(e.preserveNativeCrossAxisScroll=!0,!0):!(l>=6)||(e.drawerAxisAttributed=!0,!1)}(s,n,r,Z))return;let l=s.scrollTarget;if(!l||l===t.documentElement||l===t.body){n.cancelable&&n.preventDefault(),n.stopPropagation(),eG(n,e);return}if(!(ek(l,Q).max>0)){n.cancelable&&n.preventDefault(),n.stopPropagation();return}if(0!==a){var i,o,d,c;let e=(i=l,o=Q,d=x,c=a,!!(eP(d,o)?c>0:c<0)&&e$(i,o,d));s.allowSwipe?n.cancelable&&n.preventDefault():n.cancelable&&e?(s.allowSwipe=!0,n.preventDefault()):s.allowSwipe=!1}!0===s.allowSwipe&&(n.stopPropagation(),eG(n,e))}(n,a,l),(s=a).lastX=(r=l).clientX,s.lastY=r.clientY)},{passive:!1,capture:!0})},[L,q,F,G,Z,Q,x,eG,V,eD]),(0,b.f)(()=>{eA&&!eY.swiping&&eL(!F||Y?0:eE??0,!0,!1)},[eL,S,Y,y,F,eE,eA,eY.swiping,m,B]),(0,b.f)(()=>{if(y)return F||y(0),()=>{y(0)}},[y,F]),(0,b.f)(()=>{F&&(N.current||eW(),ez())},[ez,F,eW,N]),(0,b.f)(()=>{let e=g.current;return()=>{B?.set({swipeProgress:0,frontmostHeight:0}),ej(e,!1);let t=g.current;t!==e&&ej(t,!1),eH()}},[g,eH,B]);let eB=r.useMemo(()=>({swiping:eY.swiping,getDragStyles:eY.getDragStyles,swipeStrength:ee??null,setSwipeDismissed:eU}),[eU,eY.getDragStyles,eY.swiping,ee]);function eK(e){eI.current=e,eM.current=null}function eq(){eK(!1),eT.current="",eO.current=!1}function eJ(e){return eT.current="","touch"!==e.pointerType}return(0,s.jsx)(ec,{ref:t,className:l,style:i,render:n,...(0,eu.w)(p,{onPointerDown(e){var t,n;if(eT.current=e.pointerType,eO.current="pen"===e.pointerType,!F||!L||q)return;let s=(0,eb.f)(e.currentTarget.getRootNode(),e.clientX,e.clientY);t=s,(0,em.h)(t,ex.u)||(n=s,(0,em.h)(n,ew))||"touch"!==e.pointerType&&eX.onPointerDown?.(e)},onPointerMove(e){"touch"!==e.pointerType&&eX.onPointerMove?.(e)},onPointerUp(e){eJ(e)&&eX.onPointerUp?.(e)},onPointerCancel(e){eJ(e)&&eX.onPointerCancel?.(e)},onTouchStart(e){var t,n,s;if("pen"===eT.current&&eO.current){eO.current=!1,eK(!1);return}if(!F||!L||q)return void eK(!1);let r=e.touches[0];if(!r)return;if(n=(t=e).nativeEvent,s=(0,K.f)(t.currentTarget),n.composedPath().some(e=>e instanceof s.HTMLInputElement&&"range"===e.type))return void eK(!1);let a=e.currentTarget,l=(0,eb.f)(a.getRootNode(),r.clientX,r.clientY),i=(0,em.Z)(e.nativeEvent),o=(0,ei.m)(i)?i:a;if(!(0,em.I)(a,o)||(eD?.onTouchStart(e),(0,em.h)(l,`${ex.u}:not(${ey[_]})`)))return void eK(!0);eI.current=!1;let d=(0,eg.U)(o,a,Q),c=null!=(0,eg.U)(o,a,_)||null!=(0,em.h)(l,ey[_]),u=null;d&&(u=!!e$(d,Q,x)&&null),eM.current={startX:r.clientX,startY:r.clientY,lastX:r.clientX,lastY:r.clientY,startedInPopup:(0,em.I)(h.current,l),scrollTarget:d,hasCrossAxisGestureTarget:c,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},eV.onTouchStart?.(e)},onTouchEnd(e){eD?.onTouchEnd(e),eq(),eV.onTouchEnd?.(e)},onTouchCancel(e){eD?.onTouchCancel(),eq(),eV.onTouchCancel?.(e)},"data-nested-dialog-open":void 0}),children:(0,s.jsx)(H.Provider,{value:eB,children:u})})});function ej(e,t){e?.toggleAttribute(k,t)}function eN(e,t){return"left"===t||"right"===t?e.offsetWidth:e.offsetHeight}function eR(e,t){return Math.max(.5*eN(e,t),10)}function eC(e,t){let n,s,r=(0,em.T)(e);if(r&&(0,em.I)(t,r)&&("INPUT"===r.tagName||"TEXTAREA"===r.tagName)){let{selectionStart:e,selectionEnd:t}=r;if(null!=e&&null!=t&&e<t)return!0}let a=e.getSelection?.();return!!a&&!a.isCollapsed&&(n=(0,ei.m)(a.anchorNode)?a.anchorNode:a.anchorNode?.parentElement,s=(0,ei.m)(a.focusNode)?a.focusNode:a.focusNode?.parentElement,a.containsNode(t,!0)||(0,em.I)(t,n)||(0,em.I)(t,s))}function ek(e,t){if("vertical"===t){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function e$(e,t,n){let s=eP(n,t),{offset:r,max:a}=ek(e,t);return s?r<=0:r>=a}function eP(e,t){return"vertical"===t?"down"===e:"right"===e}e.s(["Backdrop",0,m,"Close",0,h,"Content",0,x,"Popup",0,V,"Portal",0,G,"Root",0,function(e){let{children:a,open:l,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:d,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h=null,swipeDirection:g="down",snapToSequentialPoints:x=!1,snapPoints:b,snapPoint:w,defaultSnapPoint:y,onSnapPointChange:S}=e,j=M(!0),N=j?.onNestedSwipeProgressChange,R=j?.onNestedFrontmostHeightChange,C=j?.onNestedSwipingChange,k=j?.onNestedDrawerPresenceChange,[$,P]=r.useState(0),[T,O]=r.useState(0),[D,A]=r.useState(!1),[E,F]=r.useState(!1),[U]=r.useState(en),z=void 0!==y?y:b?.[0]??null,H=void 0!==w,[L,Y]=(0,B.f)({controlled:w,default:z,name:"Drawer",state:"snapPoint"}),X=r.useRef(!1),V=r.useRef(!1),G=(0,v.f)((e,t)=>{let n=t??(0,J.j)(Q.f.none);S?.(e,n),n.isCanceled||Y(e)}),W=r.useMemo(()=>H||!b||0===b.length||null!==L&&b.some(e=>Object.is(e,L))?L:z,[L,H,z,b]),K=(0,v.f)(e=>{P(e),!X.current&&e>0&&O(e)}),q=(0,v.f)(e=>{if(e>0){X.current=!0,O(e);return}X.current=!1,$>0&&O($)}),Z=(0,v.f)(e=>{A(e)}),ee=(0,v.f)(e=>{U.set(e),N?.(e)}),et=(0,v.f)(e=>{F(e),C?.(e)}),er=(0,v.f)((e,t)=>{o?.(e,t),!t.isCanceled&&!e&&b&&b.length>0&&G(z,(0,J.j)(t.reason,t.event,t.trigger))}),ea=r.useMemo(()=>({swipeDirection:g,swipeAreaActiveRef:V,snapToSequentialPoints:x,snapPoints:b,activeSnapPoint:W,setActiveSnapPoint:G,frontmostHeight:T,popupHeight:$,hasNestedDrawer:D,nestedSwiping:E,nestedSwipeProgressStore:U,onNestedDrawerPresenceChange:Z,onPopupHeightChange:K,onNestedFrontmostHeightChange:q,onNestedSwipingChange:et,onNestedSwipeProgressChange:ee,notifyParentFrontmostHeight:R,notifyParentSwipingChange:C,notifyParentSwipeProgressChange:N,notifyParentHasNestedDrawer:k}),[W,T,D,E,U,k,N,C,R,Z,q,ee,et,K,$,G,b,x,V,g]),el="function"==typeof a?e=>(0,s.jsxs)(r.Fragment,{children:[t||(t=(0,s.jsx)(es,{})),a(e)]}):(0,s.jsxs)(r.Fragment,{children:[n||(n=(0,s.jsx)(es,{})),a]}),ei=(0,_.f)("drawer",{open:l,defaultOpen:i,onOpenChange:er,onOpenChangeComplete:d,disablePointerDismissal:c,modal:u,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h,children:el});return(0,s.jsx)(I.Provider,{value:ea,children:ei})},"Title",0,er,"Trigger",0,ea,"Viewport",0,eS],58954);var eT=e.i(58954),eT=eT,eO=eT,eI=eT,eM=eT,eD=eT,eA=eT,eE=eT,eF=eT,eU=eT,ez=e.i(58487),eH=e.i(5654),eL=e.i(18566),eY=e.i(30402),eX=e.i(25621),eV=e.i(55070),eG=e.i(97e3),eW=e.i(62275),eB=e.i(95187);let eK=(0,eB.createServerReference)("40c18db91023b8f8bfeedd193b1b60a0bdaa9f8dbe",eB.callServer,void 0,eB.findSourceMapURL,"switchPartyTools"),eq=[{how:"add",label:"Add to each"},{how:"remove",label:"Remove from each"},{how:"replace",label:"Replace with these"}];var eJ=e.i(19407);let eQ=[{state:"all",label:"All"},{state:"on",label:"On"},{state:"off",label:"Off"},{state:"new",label:"New"},{state:"needsNothing",label:"Needs nothing"}];var eZ=e.i(17779),e_=e.i(35671),e0=e.i(44047),e1=e.i(90218);function e2(e){return e?.split("\n").find(e=>""!==e.trim())?.trim()??""}function e4({fleetId:e,party:t,tools:n,version:a,partyScopes:l,listed:i,canChange:o,serverRefusal:d}){var c;let u,p,f=(0,eL.useRouter)(),m=eH.f.useToastManager(),[,h]=(0,r.useTransition)(),[g,x]=(0,r.useTransition)(),[b,v]=(0,r.useState)(""),[w,y]=(0,r.useState)("all"),[S,j]=(0,r.useState)(new Set),[N,R]=(0,r.useState)(null),[C,k]=(0,r.useState)([]),[$,P]=(0,r.useState)("add"),[T,O]=(0,r.useState)({readOnly:[],other:[]}),[I,M]=(0,r.useState)(!1),[D,A]=(0,r.useState)(null),[E,F]=(0,r.useState)(null),[U,z]=(0,r.useState)(null),[H,L]=(0,r.useState)({names:new Set,round:0}),[Y,X]=(0,r.useState)(null),[V,G]=(0,r.useState)(!1),[W,B]=(0,r.useState)(null),K=W?.basis===n?W:null,q=null===K?n:n.map(e=>({...e,scopes:K.scopes.get(e.name)??e.scopes,isOn:null===e.isOn?null:K.switches.get(e.name)??e.isOn})),J=K?.party??l,Q=Math.max(a,Y??0),Z=null===i?null:new Set(i.map(({scope:e})=>e)),_=(u=(c={name:b,state:w,partyScopes:J}).name.trim().toLowerCase(),q.filter(e=>e.name.toLowerCase().includes(u)&&function(e,{state:t,partyScopes:n}){switch(t){case"all":return!0;case"on":return!0===e.isOn;case"off":return!1===e.isOn;case"new":return e.isNew;case"needsNothing":return 0===n.length&&0===e.scopes.length}}(e,c))),ee=q.filter(({name:e})=>S.has(e)),et=null===d,en=_.length>0&&_.every(({name:e})=>S.has(e)),es=function(e){let t={readOnly:[],other:[],withoutHints:[]};for(let n of e.filter(({scopes:e})=>0===e.length))!0===n.isDestructive||!1===n.isReadOnly?t.other.push(n.name):!0===n.isReadOnly?t.readOnly.push(n.name):t.withoutHints.push(n.name);return t}(q),er=[...(p=(e,t)=>0===t.length?[]:e.map(e=>({tool:e,scopes:[...t]})))(es.readOnly,T.readOnly),...p(es.other,T.other)],ea=({outcome:e,changed:t,message:s,change:r})=>{B({basis:n,party:r.party??K?.party??null,scopes:new Map([...K?.scopes??[],...(r.scopes??[]).map(({tool:e,scopes:t})=>[e,t])]),switches:new Map([...K?.switches??[],...r.switches??[]])}),null!==e.version&&X(e.version),L(e=>({names:new Set(t),round:e.round+1})),m.add({title:(0,eJ.I)(s,e.statementRefusal)}),f.refresh()},el=e=>{A(null),G(!1),k("party"===e?[...J]:[]),P("add"),O({readOnly:[],other:[]}),R(e)},ei=()=>{R(null),A(null)},eo=({change:n,changed:s,message:r})=>{M(!0),A(null),h(async()=>{let a=await (0,eW.f)({fleetId:e,name:t,version:Q,...n});(M(!1),a.isOk)?(R(null),j(new Set),ea({outcome:a,changed:s,message:r,change:{...void 0===n.party?{}:{party:n.party},scopes:n.tools}})):A({message:a.message,isConflict:a.isConflict,version:Q})})},ed=({names:n,isOn:s,working:r})=>{F(r),z(null),G(!1),h(async()=>{let r=await eK({fleetId:e,name:t,tools:[...n],isOn:s});if(F(null),!r.isOk)return void z(r.message);let[a]=n;ea({outcome:r,changed:n,change:{switches:new Map(n.map(e=>[e,s]))},message:1===n.length&&void 0!==a?function({tool:e,isOn:t,statementRefusal:n}){let s=`${e} is ${t?"on":"off"}`;return null!==n?`${s}; the fleet sees it at the proxy ship's next statement: ${n}`:t?`${s}: the fleet may call it.`:`${s}: the fleet sees it no more, and a call to it is refused.`}({tool:a,isOn:s,statementRefusal:null}):(0,eJ.g)({count:n.length,isOn:s,statementRefusal:null})})})},ec=()=>{x(()=>{f.refresh()})},eu=null!==E||I,ep=(0,s.jsxs)("div",{className:"grid gap-3 sm:flex sm:flex-wrap sm:items-center","data-testid":"tools-table-toolbar",children:[(0,s.jsxs)("label",{className:"grid gap-1 sm:w-56",children:[(0,s.jsx)("span",{className:"sr-only",children:"Filter by name"}),(0,s.jsx)("input",{className:eY.w,type:"search",placeholder:"Filter by name",value:b,onChange:e=>{v(e.target.value)},"data-testid":"tools-table-name-filter"})]}),(0,s.jsx)("div",{role:"group","aria-label":"Filter by state",className:"flex flex-wrap gap-1",children:eQ.map(({state:e,label:t})=>(0,s.jsx)("button",{type:"button","aria-pressed":w===e,onClick:()=>{y(e)},className:`h-8 rounded-md border px-3 ${w===e?"border-primary bg-primary text-primary-foreground":"border-border bg-card hover:bg-accent"}`,"data-testid":`tools-table-state-${e}`,children:t},e))}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:en,onChange:()=>{j(e=>{let t=new Set(e);for(let{name:e}of _)en?t.delete(e):t.add(e);return t})},disabled:0===_.length,"data-testid":"tools-table-select-shown"}),"Select all shown"]}),(0,s.jsxs)("span",{className:"text-muted-foreground","data-testid":"tools-table-selected",children:[S.size," selected"]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:0===S.size||eu||null===i,onClick:()=>{el("scopes")},"data-testid":"tools-table-set-scopes",children:"Set scopes…"}),(0,s.jsx)(eV.i,{isPending:"on"===E,pendingLabel:"Switching on…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!0,working:"on"})},"data-testid":"tools-table-switch-on",children:"Switch on"}),(0,s.jsx)(eV.i,{isPending:"off"===E,pendingLabel:"Switching off…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!1,working:"off"})},"data-testid":"tools-table-switch-off",children:"Switch off"}),(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:eu||!et||null===i,onClick:()=>{el("suggest")},"data-testid":"tools-table-suggest",children:"Suggest from hints…"})]})]}):null]});return(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"tools-table-party-needs",children:[(0,s.jsx)("span",{className:"font-medium",children:"Every tool needs"}),(0,s.jsx)(eZ.f,{party:J,own:[],listed:Z}),o?(0,s.jsx)("button",{type:"button",className:"text-primary hover:underline disabled:opacity-60",disabled:eu||null===i,onClick:()=>{el("party")},"data-testid":"tools-table-party-change",children:"Change…"}):null]}),null===d?null:(0,s.jsxs)("p",{role:"status",className:"rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-tone-waiting-fg","data-testid":"tools-table-server-down",children:["The server did not answer, so this shows the scopes kept per tool name; they can still be changed. ",d]}),(0,s.jsx)("div",{className:"hidden sm:block",children:ep}),(0,s.jsx)("div",{className:"sm:hidden",children:(0,s.jsxs)(eT.Root,{open:V,onOpenChange:G,children:[(0,s.jsxs)(eO.Trigger,{className:eY.x.secondary,"data-testid":"tools-table-sheet-open",children:["Filters and actions",o?` (${String(S.size)} selected)`:""]}),(0,s.jsxs)(eI.Portal,{children:[(0,s.jsx)(eM.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,s.jsx)(eD.Viewport,{className:"fixed inset-0 z-50 flex items-end",children:(0,s.jsx)(eA.Popup,{className:"w-full rounded-t-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:(0,s.jsxs)(eE.Content,{className:"grid gap-3",children:[(0,s.jsx)(eF.Title,{className:"text-heading font-semibold",children:"Filters and actions"}),ep,(0,s.jsx)(eU.Close,{className:eY.x.secondary,children:"Done"})]})})})]})]})}),null===U?null:(0,s.jsx)("p",{role:"alert",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-switch-refusal",children:U}),(0,s.jsxs)("table",{className:"w-full border-collapse max-sm:block","data-testid":"tools-table",children:[(0,s.jsx)("thead",{className:"max-sm:hidden",children:(0,s.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[o?(0,s.jsx)("th",{className:"w-8 py-2",children:(0,s.jsx)("span",{className:"sr-only",children:"Selected"})}):null,(0,s.jsx)("th",{className:"py-2 font-medium",children:"Tool"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Hints"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"On"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Needs"})]})}),(0,s.jsx)("tbody",{className:"max-sm:grid max-sm:gap-2",children:_.map(e=>{let t=H.names.has(e.name);return(0,s.jsxs)("tr",{className:`border-b border-border align-top last:border-b-0 max-sm:grid max-sm:grid-cols-[auto_1fr] max-sm:gap-x-2 max-sm:rounded-md max-sm:border max-sm:p-2 ${t?"animate-highlight":""}`,"data-testid":"tools-table-row","data-tool":e.name,children:[o?(0,s.jsx)("td",{className:"py-2 pr-2 max-sm:row-span-4",children:(0,s.jsx)("input",{type:"checkbox","aria-label":`Select ${e.name}`,checked:S.has(e.name),onChange:()=>{var t;t=e.name,j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},"data-testid":"tools-table-select"})}):null,(0,s.jsxs)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:[(0,s.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono",children:e.name}),e.isNew?(0,s.jsx)(eG.T,{tone:"attention",label:"New"}):null]}),""===e2(e.description)?null:(0,s.jsx)("span",{className:"block text-muted-foreground",children:e2(e.description)})]}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:(0,s.jsxs)("span",{className:"flex flex-wrap gap-1",children:[!0===e.isReadOnly?(0,s.jsx)(eG.E,{children:"Read only"}):null,!0===e.isDestructive?(0,s.jsx)(eG.E,{children:"Destructive"}):null]})}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:null===e.isOn?(0,s.jsx)("span",{className:"text-muted-foreground",children:"Not known"}):o?(0,s.jsx)(eX.f,{isOn:e.isOn,label:e.name,isPending:E===e.name,onClick:()=>{ed({names:[e.name],isOn:!0!==e.isOn,working:e.name})},testId:"tools-table-switch"}):(0,s.jsx)(eG.E,{children:e.isOn?"On":"Off"})}),(0,s.jsx)("td",{className:"py-2 max-sm:col-start-2",children:(0,s.jsx)(eZ.f,{party:J,own:e.scopes,listed:Z})})]},t?`${e.name}-${String(H.round)}`:e.name)})})]}),0===_.length?(0,s.jsx)("p",{className:"text-muted-foreground","data-testid":"tools-table-empty",children:0===q.length?et?`${t} lists no tools.`:"No tool needs a scope of its own yet.":"No tool matches the filters."}):null,null===i?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e0.G,{isOpen:"scopes"===N,onClose:ei,title:"Set scopes",description:"The scopes a calling ship must hold for each selected tool, beside what every tool needs.",appliesTo:`Applies to ${String(ee.length)} ${1===ee.length?"tool":"tools"}`,action:{label:"Set scopes",pending:"Setting…",isDisabled:0===C.length&&"replace"!==$,onPress:()=>{var e;eo({change:{tools:(e={scopes:C,how:$},ee.map(({name:t,scopes:n})=>{switch(e.how){case"add":return{tool:t,scopes:[...new Set([...n,...e.scopes])]};case"remove":return{tool:t,scopes:n.filter(t=>!e.scopes.includes(t))};case"replace":return{tool:t,scopes:[...new Set(e.scopes)]}}}))},changed:ee.map(({name:e})=>e),message:(0,eJ.y)({scopes:C,how:$,count:ee.length})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-scopes-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-scopes-picker"}),(0,s.jsxs)("fieldset",{className:"grid gap-1",children:[(0,s.jsx)("legend",{className:"font-medium",children:"On each selected tool"}),eq.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"how",value:e.how,checked:$===e.how,onChange:()=>{P(e.how)},"data-testid":`tools-table-how-${e.how}`}),e.label]},e.how))]})]}),(0,s.jsx)(e0.G,{isOpen:"party"===N,onClose:ei,title:"Every tool needs",description:`The scopes a calling ship must hold for every tool of ${t}, beside each tool's own.`,appliesTo:`Applies to every tool of ${t}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{eo({change:{party:C,tools:[]},changed:q.map(({name:e})=>e),message:(0,eJ.G)({party:t,scopes:C})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-party-dialog",children:(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-party-picker"})}),(0,s.jsxs)(e0.G,{isOpen:"suggest"===N,onClose:ei,title:"Suggest from hints",description:"Scopes for each tool with no scope of its own, by what the server says of it. Hints are the server's claim: nothing applies until you confirm.",appliesTo:`Applies to ${String(er.length)} ${1===er.length?"tool":"tools"}`,action:{label:"Apply",pending:"Applying…",isDisabled:0===er.length,onPress:()=>{let e=[{scopes:T.readOnly,count:0===T.readOnly.length?0:es.readOnly.length},{scopes:T.other,count:0===T.other.length?0:es.other.length}].filter(({count:e})=>e>0);eo({change:{tools:er},changed:er.map(({tool:e})=>e),message:(0,eJ.q)(e)})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-suggest-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes for read-only tools",listed:i,picked:T.readOnly,onPick:e=>{O(t=>({...t,readOnly:e}))},isDisabled:I,testId:"tools-table-suggest-read-only"}),(0,s.jsx)(e_.f,{label:"Scopes for the other tools",listed:i,picked:T.other,onPick:e=>{O(t=>({...t,other:e}))},isDisabled:I,testId:"tools-table-suggest-other"}),(0,s.jsx)(e5,{title:"Read-only tools",names:es.readOnly,testId:"tools-table-suggest-read-only-tools"}),(0,s.jsx)(e5,{title:"Other tools",names:es.other,testId:"tools-table-suggest-other-tools"}),(0,s.jsx)(e5,{title:"Without hints, left as they are",names:es.withoutHints,testId:"tools-table-suggest-without-hints"})]})]})]})}function e5({title:e,names:t,testId:n}){return(0,s.jsxs)("details",{className:"rounded-md border border-border px-3 py-2","data-testid":n,children:[(0,s.jsxs)("summary",{className:"cursor-pointer",children:[e," (",t.length,")"]}),0===t.length?(0,s.jsx)("p",{className:"text-muted-foreground",children:"None"}):(0,s.jsx)("p",{className:"font-mono text-code break-words",children:t.join(", ")})]})}e.s(["ToolsTable",0,function(e){return(0,s.jsxs)(ez.f.Provider,{children:[(0,s.jsx)(e4,{...e}),(0,s.jsx)(e1.f,{})]})}],54418)},15327,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(95187);let a=(0,r.createServerReference)("40453b580ccdd09578e88f323f0a6362beb9d7d45d",r.callServer,void 0,r.findSourceMapURL,"readMoreSignIns"),l=(0,r.createServerReference)("40094ca59cc39534e76a0c0ec939f97c2759b691cd",r.callServer,void 0,r.findSourceMapURL,"removePersonSignIn");function i(e,t){let n=new Set(e.map(({personShipId:e})=>e));return[...e,...t.filter(({personShipId:e})=>!n.has(e))]}var o=e.i(30402),d=e.i(94984),c=e.i(97e3);let u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p=e=>String(e).padStart(2,"0"),f={signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}};function m(e){return e.personName??e.personShipId}function h({count:e}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Everyone's sign-ins"}),null===e?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:e})]})}function g(){return(0,t.jsx)("thead",{className:"max-sm:hidden",children:(0,t.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Person"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Account"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"State"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Last used"}),(0,t.jsx)("th",{className:"h-10 px-2",children:(0,t.jsx)("span",{className:"sr-only",children:"Remove"})})]})})}function x({signIn:e,party:n,isRemoving:s,onConfirm:r,onKeep:a}){let l=m(e);return(0,t.jsxs)("div",{className:"grid gap-2 rounded-md bg-muted p-3","data-testid":"outside-party-sign-ins-confirm",children:[(0,t.jsxs)("p",{children:["Remove ",l,"'s sign-in? Their ships' calls to ",n," are refused until they sign in again."]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:o.x.destructive,disabled:s,"aria-busy":s,onClick:r,"data-testid":"outside-party-sign-ins-remove-confirmed",children:s?"Removing…":`Remove ${l}'s sign-in`}),(0,t.jsx)("button",{type:"button",className:o.x.secondary,onClick:a,children:"Keep"})]})]})}function b(e){let{party:n,now:s,rows:r,refusal:a,hasMore:l,isLoadingMore:i,confirming:b,removing:v,outcome:w}=e;return(0,t.jsxs)("section",{className:`${o.r} grid gap-3`,"data-testid":"outside-party-sign-ins",children:[(0,t.jsx)(h,{count:null===a?r.length:null}),(0,t.jsx)(d.f,{state:w}),null!==a?(0,t.jsx)(d.f,{state:{kind:"refused",message:a}}):0===r.length?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Nobody has signed in yet."}):(0,t.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,t.jsx)(g,{}),(0,t.jsx)("tbody",{className:"max-sm:grid",children:r.map(r=>{var a;let l,i,d=f[r.state],h=b===r.personShipId,g=null===r.lastUsedAt?"Not yet":(a=r.lastUsedAt,(i=new Date(s).getTime()-new Date(a).getTime())<6e4?"Just now":i<36e5?`${String(Math.floor(i/6e4))} min ago`:(l=new Date(a),`${String(l.getUTCDate())} ${u[l.getUTCMonth()]??""}, ${p(l.getUTCHours())}:${p(l.getUTCMinutes())}`));return[(0,t.jsxs)("tr",{className:`border-b border-border max-sm:grid max-sm:grid-cols-[1fr_auto] max-sm:gap-1 max-sm:py-3 ${h?"border-b-0":"last:border-b-0"}`,"data-testid":"outside-party-sign-ins-row",children:[(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-start-1 max-sm:row-start-1 max-sm:h-auto max-sm:px-0 max-sm:font-medium",children:[m(r),r.isYours?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" (you)"}):null]}),(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-span-2 max-sm:row-start-2 max-sm:h-auto max-sm:px-0 max-sm:text-muted-foreground",children:[function({outsideAccount:e}){return e.name??e.subject??(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}(r),(0,t.jsxs)("span",{className:"sm:hidden",children:[" · last used ",null===r.lastUsedAt?"not yet":g]})]}),(0,t.jsx)("td",{className:"h-12 px-2 max-sm:col-start-2 max-sm:row-start-1 max-sm:h-auto max-sm:px-0",children:(0,t.jsx)(c.T,{tone:d.tone,label:d.label})}),(0,t.jsx)("td",{className:"h-12 px-2 text-muted-foreground max-sm:hidden",children:g}),(0,t.jsx)("td",{className:"h-12 px-2 text-right max-sm:col-span-2 max-sm:row-start-3 max-sm:h-auto max-sm:px-0 max-sm:text-left",children:(0,t.jsx)("button",{type:"button",className:`${o.x.secondary} ${h?"max-sm:hidden":""}`,onClick:()=>{e.onRemove(r.personShipId)},"data-testid":"outside-party-sign-ins-remove",children:"Remove"})})]},r.personShipId),h?(0,t.jsx)("tr",{className:"border-b border-border last:border-b-0 max-sm:block max-sm:pb-3",children:(0,t.jsx)("td",{colSpan:5,className:"pb-2 max-sm:block max-sm:pb-0",children:(0,t.jsx)(x,{signIn:r,party:n,isRemoving:v===r.personShipId,onConfirm:()=>{e.onConfirm(r)},onKeep:e.onKeep})})},`${r.personShipId}-confirm`):null]})})]}),null===a&&l?(0,t.jsx)("div",{children:(0,t.jsx)("button",{type:"button",className:o.x.secondary,disabled:i,"aria-busy":i,onClick:e.onMore,"data-testid":"outside-party-sign-ins-more",children:i?"Showing more…":"Show more"})}):null]})}e.s(["EveryonesSignInsCard",0,function({fleetId:e,party:r,now:o,first:d}){let[c,u]=(0,n.useState)([]),[p,f]=(0,n.useState)(d.next),[h,g]=(0,n.useState)(new Set),[x,v]=(0,n.useState)(null),[w,y]=(0,n.useState)(null),[S,j]=(0,n.useState)(s.Q),[N,R]=(0,n.useTransition)(),[,C]=(0,n.useTransition)(),k=i(d.grants,c).filter(({personShipId:e})=>!h.has(e));return(0,t.jsx)(b,{party:r,now:o,rows:k,refusal:null,hasMore:null!==p,isLoadingMore:N,confirming:x,removing:w,outcome:S,onRemove:e=>{v(e),j(s.Q)},onConfirm:t=>{y(t.personShipId),C(async()=>{let n=await l({fleetId:e,name:r,personShipId:t.personShipId});y(null),v(null),n.isOk?(g(e=>new Set([...e,t.personShipId])),j({kind:"done",message:function({person:e,party:t,isRevoked:n}){return n?`${e}'s sign-in is removed, and revoked at ${t}.`:`${e}'s sign-in is removed.`}({person:m(t),party:r,isRevoked:n.isRevoked})})):j({kind:"refused",message:n.message})})},onKeep:()=>{v(null)},onMore:()=>{let t=p??k.at(-1)?.personShipId;void 0!==t&&R(async()=>{let n=await a({fleetId:e,name:r,after:t});n.isOk?(u(e=>i(e,n.grants)),f(n.next)):j({kind:"refused",message:n.message})})}})}],15327)},52979,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(94984),a=e.i(58107),l=e.i(95187);let i=(0,l.createServerReference)("604dd8193dbf8404c214de2b04259fef11650543b4",l.callServer,void 0,l.findSourceMapURL,"removeOwnSignIn");var o=e.i(16293);function d({fleetId:e,party:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"hidden",name:s.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:n})]})}e.s(["RemoveSignInForm",0,function({fleetId:e,party:l}){let[o,c]=(0,n.useActionState)(i,s.Q);return(0,t.jsxs)("form",{action:c,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:o}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:"secondary",pending:"Removing…",testId:"outside-party-sign-in-remove",children:"Remove"})})]})},"SignInForm",0,function({fleetId:e,party:l,label:i,kind:c}){let[u,p]=(0,n.useActionState)(o.f,s.Q);return(0,t.jsxs)("form",{action:p,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:u}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:c,pending:`Opening ${l}…`,testId:"outside-party-sign-in-start",children:i})})]})}],52979)},12137,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(74080),r=e.i(28008),a=e.i(25621),l=e.i(95187);let i=(0,l.createServerReference)("604043d009b1b0f58f8fe209d3f0ea9e38582341c8",l.callServer,void 0,l.findSourceMapURL,"markA2aAgent"),o={kind:"idle"};function d({isRepeatable:e}){let n=(0,s.useFormStatus)();return(0,t.jsx)(a.f,{type:"submit",isOn:e,label:"Repeatable",isPending:n.pending,testId:"outside-party-repeatable-switch"})}e.s(["RepeatableSwitch",0,function({fleetId:e,party:s,isRepeatable:a}){let[l,c]=(0,n.useActionState)(i,o),u="marked"===l.kind?l.isRepeatable:a;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{action:c,className:"contents",children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:s}),(0,t.jsx)("input",{type:"hidden",name:"isRepeatable",value:String(!u)}),(0,t.jsx)(d,{isRepeatable:u})]}),"idle"===l.kind?null:(0,t.jsx)("span",{role:"refused"===l.kind?"alert":"status",className:`basis-full text-caption ${"refused"===l.kind?"text-tone-attention-fg":"text-tone-ok-fg"}`,"data-testid":"outside-party-repeatable-outcome",children:l.message})]})}],12137)}])})();