@aeolus-fleet/console 0.36.1 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/.next/standalone/packages/console/.next/BUILD_ID +1 -1
  2. package/.next/standalone/packages/console/.next/build-manifest.json +3 -3
  3. package/.next/standalone/packages/console/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/packages/console/.next/required-server-files.json +1 -3
  5. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page/server-reference-manifest.json +16 -16
  6. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page.js.nft.json +1 -1
  7. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page/server-reference-manifest.json +16 -16
  9. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page.js.nft.json +1 -1
  10. package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page/server-reference-manifest.json +16 -16
  12. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page.js.nft.json +1 -1
  13. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page/server-reference-manifest.json +16 -16
  15. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page.js.nft.json +1 -1
  16. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page/server-reference-manifest.json +16 -16
  18. package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page.js.nft.json +1 -1
  19. package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page/server-reference-manifest.json +16 -16
  21. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page.js.nft.json +1 -1
  22. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page/server-reference-manifest.json +16 -16
  24. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page.js.nft.json +1 -1
  25. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/packages/console/.next/server/app/(console)/network/page/server-reference-manifest.json +16 -16
  27. package/.next/standalone/packages/console/.next/server/app/(console)/network/page.js.nft.json +1 -1
  28. package/.next/standalone/packages/console/.next/server/app/(console)/network/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/packages/console/.next/server/app/(console)/page/react-loadable-manifest.json +1 -1
  30. package/.next/standalone/packages/console/.next/server/app/(console)/page/server-reference-manifest.json +16 -16
  31. package/.next/standalone/packages/console/.next/server/app/(console)/page.js.nft.json +1 -1
  32. package/.next/standalone/packages/console/.next/server/app/(console)/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page/server-reference-manifest.json +16 -16
  34. package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page.js.nft.json +1 -1
  35. package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page/server-reference-manifest.json +16 -16
  37. package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page.js.nft.json +1 -1
  38. package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page/server-reference-manifest.json +16 -16
  40. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page.js.nft.json +1 -1
  41. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page/server-reference-manifest.json +16 -16
  43. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page.js.nft.json +1 -1
  44. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page/server-reference-manifest.json +16 -16
  46. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page.js.nft.json +1 -1
  47. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page/server-reference-manifest.json +16 -16
  49. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page.js.nft.json +1 -1
  50. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page/server-reference-manifest.json +16 -16
  52. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page.js.nft.json +1 -1
  53. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page/server-reference-manifest.json +16 -16
  55. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page.js.nft.json +1 -1
  56. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page/server-reference-manifest.json +16 -16
  58. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page.js.nft.json +1 -1
  59. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page/server-reference-manifest.json +16 -16
  61. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page.js.nft.json +1 -1
  62. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page_client-reference-manifest.js +1 -1
  63. package/.next/standalone/packages/console/.next/server/app/(console)/usage/page/server-reference-manifest.json +16 -16
  64. package/.next/standalone/packages/console/.next/server/app/(console)/usage/page.js.nft.json +1 -1
  65. package/.next/standalone/packages/console/.next/server/app/(console)/usage/page_client-reference-manifest.js +1 -1
  66. package/.next/standalone/packages/console/.next/server/app/_global-error.html +1 -1
  67. package/.next/standalone/packages/console/.next/server/app/_global-error.rsc +1 -1
  68. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  69. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  70. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  71. package/.next/standalone/packages/console/.next/server/app/_not-found/page.js.nft.json +1 -1
  72. package/.next/standalone/packages/console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  73. package/.next/standalone/packages/console/.next/server/app/api/reads/[read]/route.js.nft.json +1 -1
  74. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/confirm/page.js.nft.json +1 -1
  75. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/confirm/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/refused/page.js.nft.json +1 -1
  77. package/.next/standalone/packages/console/.next/server/app/sign-in/argo/refused/page_client-reference-manifest.js +1 -1
  78. package/.next/standalone/packages/console/.next/server/app/sign-in/failed/page.js.nft.json +1 -1
  79. package/.next/standalone/packages/console/.next/server/app/sign-in/failed/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/packages/console/.next/server/app/sign-in/no-rights/page.js.nft.json +1 -1
  81. package/.next/standalone/packages/console/.next/server/app/sign-in/no-rights/page_client-reference-manifest.js +1 -1
  82. package/.next/standalone/packages/console/.next/server/app/sign-in/nothing-to-manage/page.js.nft.json +1 -1
  83. package/.next/standalone/packages/console/.next/server/app/sign-in/nothing-to-manage/page_client-reference-manifest.js +1 -1
  84. package/.next/standalone/packages/console/.next/server/app/sign-in/page.js.nft.json +1 -1
  85. package/.next/standalone/packages/console/.next/server/app/sign-in/page_client-reference-manifest.js +1 -1
  86. package/.next/standalone/packages/console/.next/server/app/sign-in/unreachable/page.js.nft.json +1 -1
  87. package/.next/standalone/packages/console/.next/server/app/sign-in/unreachable/page_client-reference-manifest.js +1 -1
  88. package/.next/standalone/packages/console/.next/server/app/version/route.js.nft.json +1 -1
  89. package/.next/standalone/packages/console/.next/server/chunks/packages_console_1wbjk69aa7h5_._.js +1 -1
  90. package/.next/standalone/packages/console/.next/server/chunks/ssr/{0ysl_console_features_squadrons_ui_organisms_form-squadron-dialog_tsx_144d-g54fzwf5._.js → 0ysl_console_features_squadrons_ui_organisms_form-squadron-dialog_tsx_0opl-ktw-tbwt._.js} +1 -1
  91. package/.next/standalone/packages/console/.next/server/chunks/ssr/[root-of-the-server]__0hboyqcvqq0d_._.js +1 -1
  92. package/.next/standalone/packages/console/.next/server/chunks/ssr/[root-of-the-server]__1zpkntnj7z-ql._.js +1 -1
  93. package/.next/standalone/packages/console/.next/server/chunks/ssr/_03z2w0nnab8a5._.js +1 -1
  94. package/.next/standalone/packages/console/.next/server/chunks/ssr/_05336owgb-8yx._.js +1 -1
  95. package/.next/standalone/packages/console/.next/server/chunks/ssr/_058_pqh2f2i16._.js +1 -1
  96. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0qf5i7w_3_nfe._.js → _07qai7if161ui._.js} +2 -2
  97. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0a5k9_pc_guhs._.js +1 -1
  98. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0amsxqux3x7s8._.js +1 -1
  99. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0j_t40o3vyixw._.js → _0c941az04acnz._.js} +2 -2
  100. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0ew09hl40f6zb._.js +1 -1
  101. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0fivvfmb21v2n._.js +3 -0
  102. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0m0chyl90h6bp._.js +1 -1
  103. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0m2veo6735tpq._.js +1 -1
  104. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_19bhlkixcukzq._.js → _0n-jb1j7cpm3v._.js} +1 -1
  105. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_19yf0zaip8ttq._.js → _0si445pe0k9pv._.js} +1 -1
  106. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0t_yjo8ns3zrl._.js +3 -0
  107. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0vvb7ypgri_b1._.js +1 -1
  108. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0wo7e7auz11u_._.js +1 -1
  109. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1187kt4tnb_4l._.js +1 -1
  110. package/.next/standalone/packages/console/.next/server/chunks/ssr/_11frr8ir90lcz._.js +1 -1
  111. package/.next/standalone/packages/console/.next/server/chunks/ssr/_11sz8jt_qbq2v._.js +1 -1
  112. package/.next/standalone/packages/console/.next/server/chunks/ssr/_11xzggvm9kffn._.js +1 -1
  113. package/.next/standalone/packages/console/.next/server/chunks/ssr/_12_cjf-irovzl._.js +1 -1
  114. package/.next/standalone/packages/console/.next/server/chunks/ssr/_13cj-l7gszr0d._.js +1 -1
  115. package/.next/standalone/packages/console/.next/server/chunks/ssr/_14yllj18i17xg._.js +1 -1
  116. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1bdulhvcup2jk._.js → _1_y1lesv_mt--._.js} +2 -2
  117. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1ioroqtvdn3-o._.js +1 -1
  118. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1jvdp58suup5v._.js +1 -1
  119. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1k-6jw3jonywq._.js +1 -1
  120. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1mzn_94l00lmb._.js +1 -1
  121. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1p3evmz8-g0hz._.js +1 -1
  122. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1pbga14n8imvg._.js +1 -1
  123. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1rtdo19x3lqle._.js +3 -0
  124. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1rybsf429spdt._.js +1 -1
  125. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1rza0wv838rrv._.js +3 -0
  126. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1tx-daw2toven._.js +1 -1
  127. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1u0h4gj3mw97-._.js +1 -1
  128. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1zrkx99-59d4y._.js +1 -1
  129. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_00qervqi2kriq._.js → _1ztk1avfnf4dw._.js} +1 -1
  130. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_04ic8plreojmd._.js +1 -1
  131. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_1wcexaiy5anav._.js +1 -1
  132. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1u32uzo307gub._.js → packages_console_061u3t3hbf-hl._.js} +2 -2
  133. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0cvxdaq56an-2._.js +1 -1
  134. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0deebkzdrt66k._.js +1 -1
  135. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0fj8fj_dfefer._.js +1 -1
  136. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0g8wuvm9200dx._.js +1 -1
  137. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0gb_ab5wr340f._.js +1 -1
  138. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_19l3jeiptzph8._.js → packages_console_0kcbjq4fez775._.js} +2 -2
  139. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_0-7093xgrbv95._.js → packages_console_0l3eky0dqu89c._.js} +1 -1
  140. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0p9496_ahzf02._.js +1 -1
  141. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0pr_dn_qifobq._.js +1 -1
  142. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0r1j1ff9-r1oq._.js +1 -1
  143. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0spsmrxtu1yv7._.js +1 -1
  144. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0ttup5hu8hmkg._.js +1 -1
  145. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0x3yy4k4kl7e0._.js +1 -1
  146. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0xjtq8amidnlk._.js +3 -0
  147. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0y6ht52r645g9._.js +1 -1
  148. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0ztzijf30jg7m._.js +1 -1
  149. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1-p7c37hzvyl9._.js +1 -1
  150. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_13eoh7dscheba._.js +1 -1
  151. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_14ijvz4m00kwz._.js +1 -1
  152. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1c3b5p3g1fhhe._.js +1 -1
  153. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1dz1wwzmepxz2._.js +1 -1
  154. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1ep4nyq96z4tz._.js +1 -1
  155. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1ltwm3acq1a26._.js +1 -1
  156. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1qohymrp8tz2i._.js +1 -1
  157. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1rkytyhzvvpv7._.js +1 -1
  158. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1xfs-ahyxqs9h._.js +1 -1
  159. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_fleet-health_[cause]_cause-page_tsx_217ovceugq614._.js +1 -1
  160. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_fleet-health_page_tsx_0vcosw11m9gc2._.js +1 -1
  161. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_inbox_inbox-page_tsx_1lm_c0ku1ongx._.js +1 -1
  162. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_network_network-page_tsx_0qc3h-94fvfmt._.js +1 -1
  163. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_overview-page_tsx_15siba6r7o4-o._.js +1 -1
  164. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_sealing_sealing-page_tsx_0rhc98z6n6ucx._.js +1 -1
  165. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_settings_page_tsx_1p8ay871g99mp._.js +1 -1
  166. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_ships_[shipId]_ship-page_tsx_0oahz0rct9hdh._.js +1 -1
  167. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_signed-in-layout_tsx_13vv8foc0-76l._.js +1 -1
  168. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_squadrons_[squadronId]_page_tsx_0f8nmsha3q9lj._.js +1 -1
  169. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_trierarchs_page_tsx_0muip60l89nhu._.js +1 -1
  170. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_usage_usage-page_tsx_02n6z9desy0a0._.js +1 -1
  171. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_components_172iqzqndz81d._.js +1 -1
  172. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_components_atoms_table_tsx_0nc_xdwkvytka._.js +1 -1
  173. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_components_molecules_061em03mmzfjj._.js +3 -0
  174. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_components_molecules_loading-skeleton_tsx_0xxvdd28uq6n0._.js +1 -1
  175. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_components_organisms_crew-line-dialog_tsx_0uu_5c0d1s5a1._.js → packages_console_components_organisms_crew-line-dialog_tsx_1xeq3eu9k_1e0._.js} +1 -1
  176. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_0byb1f-8kevsl._.js → packages_console_features_0c6oar_jfz-j8._.js} +1 -1
  177. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_labels_organisms_0p_wwnzci42p8._.js → packages_console_features_labels_organisms_1_ivo4ghp2wtw._.js} +1 -1
  178. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_features_trierarchs_ui_organisms_026q2ij0q-9wp._.js +3 -0
  179. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_squadrons-api_ts_0-ls9zi1hw-2n._.js +1 -1
  180. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_trierarch-plugin_ts_1yl4g4k1mmd8u._.js +1 -1
  181. package/.next/standalone/packages/console/.next/server/middleware-build-manifest.js +3 -3
  182. package/.next/standalone/packages/console/.next/server/pages/500.html +1 -1
  183. package/.next/standalone/packages/console/.next/server/preview-props.json +3 -3
  184. package/.next/standalone/packages/console/.next/server/server-reference-manifest.js +1 -1
  185. package/.next/standalone/packages/console/.next/server/server-reference-manifest.json +17 -17
  186. package/.next/standalone/packages/console/.next/static/chunks/07zxcuao_g-j6.js +1 -0
  187. package/.next/standalone/packages/console/.next/static/chunks/08frulchhbu0u.js +1 -0
  188. package/.next/standalone/packages/console/.next/static/chunks/0a0iqnk4xveuh.js +1 -0
  189. package/.next/standalone/packages/console/.next/static/chunks/0iyh59t48s9pu.js +1 -0
  190. package/.next/standalone/packages/console/.next/static/chunks/0kpiv0l3e8zvq.js +1 -0
  191. package/.next/standalone/packages/console/.next/static/chunks/0lj01a7p755jp.js +1 -0
  192. package/.next/standalone/packages/console/.next/static/chunks/0lun16sj_mf8h.js +1 -0
  193. package/.next/standalone/packages/console/.next/static/chunks/{0n91bdoc_rfch.js → 0s4wzb2r9in6v.js} +1 -1
  194. package/.next/standalone/packages/console/.next/static/chunks/{0e8c5sn-3wz0d.js → 0sw4znk_5y0-5.js} +1 -1
  195. package/.next/standalone/packages/console/.next/static/chunks/0vxua2ifh6x1e.js +1 -0
  196. package/.next/standalone/packages/console/.next/static/chunks/0wz3vyu87cx1m.js +1 -0
  197. package/.next/standalone/packages/console/.next/static/chunks/{1bz7di_saqnt9.js → 10oojf70su2jy.js} +1 -1
  198. package/.next/standalone/packages/console/.next/static/chunks/{3dpdne0eal8v8.js → 13qwbuwwhj35q.js} +1 -1
  199. package/.next/standalone/packages/console/.next/static/chunks/{15yf3bsbxwgfm.js → 15v_8uloa73qq.js} +1 -1
  200. package/.next/standalone/packages/console/.next/static/chunks/19ts5itq0-amr.js +1 -0
  201. package/.next/standalone/packages/console/.next/static/chunks/1khfta-9_2t0x.js +1 -0
  202. package/.next/standalone/packages/console/.next/static/chunks/1lk375avzg-yl.js +1 -0
  203. package/.next/standalone/packages/console/.next/static/chunks/1r_fveveac_tr.js +1 -0
  204. package/.next/standalone/packages/console/.next/static/chunks/1u1ufja8yzkeh.js +1 -0
  205. package/.next/standalone/packages/console/.next/static/chunks/1y0f54ya3_gtq.js +1 -0
  206. package/.next/standalone/packages/console/.next/static/chunks/25hge4bw-955w.js +1 -0
  207. package/.next/standalone/packages/console/.next/static/chunks/2b1eizrslzxnv.css +3 -0
  208. package/.next/standalone/packages/console/.next/static/chunks/2bgfohyyohonk.js +1 -0
  209. package/.next/standalone/packages/console/.next/static/chunks/2blkwu2ne2g8w.js +1 -0
  210. package/.next/standalone/packages/console/.next/static/chunks/2cmpu95-0ioun.js +1 -0
  211. package/.next/standalone/packages/console/.next/static/chunks/2g6c77rj5yf78.js +1 -0
  212. package/.next/standalone/packages/console/.next/static/chunks/2ggw2v0t-exjk.js +1 -0
  213. package/.next/standalone/packages/console/.next/static/chunks/2gk8m32j2f6ca.js +1 -0
  214. package/.next/standalone/packages/console/.next/static/chunks/{13g15ivvnm-tx.js → 2i0j20xoxltn3.js} +2 -2
  215. package/.next/standalone/packages/console/.next/static/chunks/2iwv_ljtkg4cz.js +1 -0
  216. package/.next/standalone/packages/console/.next/static/chunks/2kl0de87tcio2.js +1 -0
  217. package/.next/standalone/packages/console/.next/static/chunks/2mfb1onzm_3v9.js +1 -0
  218. package/.next/standalone/packages/console/.next/static/chunks/2qqf5z7e2i-ro.js +1 -0
  219. package/.next/standalone/packages/console/.next/static/chunks/2rou9i3ymmeq-.js +1 -0
  220. package/.next/standalone/packages/console/.next/static/chunks/2uju4osnw6qrr.js +1 -0
  221. package/.next/standalone/packages/console/.next/static/chunks/2w-rrmyc4mt7j.js +1 -0
  222. package/.next/standalone/packages/console/.next/static/chunks/{1rccf0c7dfm-r.js → 2wdgsykapoy45.js} +1 -1
  223. package/.next/standalone/packages/console/.next/static/chunks/2x1ybirbu79-c.js +1 -0
  224. package/.next/standalone/packages/console/.next/static/chunks/3-8005wq1okb4.js +1 -0
  225. package/.next/standalone/packages/console/.next/static/chunks/30a-9owrjhira.js +1 -0
  226. package/.next/standalone/packages/console/.next/static/chunks/31fjqnkougp5d.js +1 -0
  227. package/.next/standalone/packages/console/.next/static/chunks/32ow1maf5hab-.js +1 -0
  228. package/.next/standalone/packages/console/.next/static/chunks/35o16kialw2r-.js +1 -0
  229. package/.next/standalone/packages/console/.next/static/chunks/3_1abw2m14rst.js +1 -0
  230. package/.next/standalone/packages/console/.next/static/chunks/3a-1m5bz7yczp.js +1 -0
  231. package/.next/standalone/packages/console/.next/static/chunks/3bk3gi01zulo8.js +1 -0
  232. package/.next/standalone/packages/console/.next/static/chunks/3eo8xlf31tm_l.js +1 -0
  233. package/.next/standalone/packages/console/.next/static/chunks/{1t6l9de3x627m.js → 3k0b_tpdd2xee.js} +1 -1
  234. package/.next/standalone/packages/console/.next/static/chunks/3kcy0nv8zj1ei.js +1 -0
  235. package/.next/standalone/packages/console/.next/static/chunks/3lwhy0lgeonf6.js +1 -0
  236. package/.next/standalone/packages/console/.next/static/chunks/3qflbeaycgaqy.js +1 -0
  237. package/.next/standalone/packages/console/.next/static/chunks/3tvbvl49n38gk.js +1 -0
  238. package/.next/standalone/packages/console/.next/static/chunks/3zn9b9boawt_q.js +1 -0
  239. package/.next/standalone/packages/console/.next/static/chunks/43ac1vd-way6-.js +1 -0
  240. package/.next/standalone/packages/console/package.json +4 -4
  241. package/.next/standalone/packages/console/server.js +1 -1
  242. package/package.json +4 -4
  243. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0733ws5nu54fu._.js +0 -3
  244. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0hx4z4a4cy2ke._.js +0 -3
  245. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0jsk_zejfh-pk._.js +0 -3
  246. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0u48_4oxg4wfr._.js +0 -3
  247. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0urpdaswmxwfp._.js +0 -3
  248. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1t_pzl80a6qm9._.js +0 -3
  249. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_1es1_9vs5wkq0._.js +0 -3
  250. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1n191s0k0o2fh._.js +0 -3
  251. package/.next/standalone/packages/console/.next/static/chunks/0-8pnutvc5zzj.js +0 -1
  252. package/.next/standalone/packages/console/.next/static/chunks/003yl_dayuhhn.js +0 -1
  253. package/.next/standalone/packages/console/.next/static/chunks/01ecs5uhcdnqs.js +0 -1
  254. package/.next/standalone/packages/console/.next/static/chunks/04mdn6inla3ke.js +0 -1
  255. package/.next/standalone/packages/console/.next/static/chunks/05tz4t1x6fyvg.js +0 -1
  256. package/.next/standalone/packages/console/.next/static/chunks/097qdsjiufni6.js +0 -1
  257. package/.next/standalone/packages/console/.next/static/chunks/0cfys0q-gjm7y.js +0 -1
  258. package/.next/standalone/packages/console/.next/static/chunks/0dmpy4_l6htrs.js +0 -1
  259. package/.next/standalone/packages/console/.next/static/chunks/0do_q79nc-748.js +0 -1
  260. package/.next/standalone/packages/console/.next/static/chunks/0inwsj13hc_lk.js +0 -1
  261. package/.next/standalone/packages/console/.next/static/chunks/0j6sqdyidc5jj.js +0 -1
  262. package/.next/standalone/packages/console/.next/static/chunks/0nsige8f707qk.js +0 -1
  263. package/.next/standalone/packages/console/.next/static/chunks/0vn91cfiocwsi.js +0 -1
  264. package/.next/standalone/packages/console/.next/static/chunks/0wy2x142dpkf8.js +0 -1
  265. package/.next/standalone/packages/console/.next/static/chunks/11c-u4u-f__-0.js +0 -1
  266. package/.next/standalone/packages/console/.next/static/chunks/1648dufhq7yyv.js +0 -1
  267. package/.next/standalone/packages/console/.next/static/chunks/19cj1f85d3uzq.js +0 -1
  268. package/.next/standalone/packages/console/.next/static/chunks/1a20fm3vyxps_.js +0 -1
  269. package/.next/standalone/packages/console/.next/static/chunks/1b7rqyad9mem3.js +0 -1
  270. package/.next/standalone/packages/console/.next/static/chunks/1bk332m2sx6ux.js +0 -1
  271. package/.next/standalone/packages/console/.next/static/chunks/1c4-gmfy1e4x6.js +0 -1
  272. package/.next/standalone/packages/console/.next/static/chunks/1njfbrk9vyt7g.js +0 -1
  273. package/.next/standalone/packages/console/.next/static/chunks/1pfj8ktkuax80.js +0 -1
  274. package/.next/standalone/packages/console/.next/static/chunks/1q9_9-a_ky61-.js +0 -1
  275. package/.next/standalone/packages/console/.next/static/chunks/1qwxtd3rle3m_.js +0 -1
  276. package/.next/standalone/packages/console/.next/static/chunks/1wxynt5kaibkl.js +0 -1
  277. package/.next/standalone/packages/console/.next/static/chunks/25v9j33yns7wg.js +0 -1
  278. package/.next/standalone/packages/console/.next/static/chunks/2998udi0v2n63.js +0 -1
  279. package/.next/standalone/packages/console/.next/static/chunks/2ansfdb3r2_l0.js +0 -1
  280. package/.next/standalone/packages/console/.next/static/chunks/2bfyaleopexm2.js +0 -1
  281. package/.next/standalone/packages/console/.next/static/chunks/2brdi1fm_196q.js +0 -1
  282. package/.next/standalone/packages/console/.next/static/chunks/2e0btg9hgzc8_.js +0 -1
  283. package/.next/standalone/packages/console/.next/static/chunks/2g4vt_mwascqs.js +0 -1
  284. package/.next/standalone/packages/console/.next/static/chunks/2goxtoz7fvfa7.js +0 -1
  285. package/.next/standalone/packages/console/.next/static/chunks/2llw_a1fmcaup.js +0 -1
  286. package/.next/standalone/packages/console/.next/static/chunks/2lv5b9cqado3p.js +0 -1
  287. package/.next/standalone/packages/console/.next/static/chunks/2o9j4jxp11-xv.css +0 -3
  288. package/.next/standalone/packages/console/.next/static/chunks/2rc6wq7_ug4i-.js +0 -1
  289. package/.next/standalone/packages/console/.next/static/chunks/2v6ylvww4ndv4.js +0 -1
  290. package/.next/standalone/packages/console/.next/static/chunks/2w754twhr0nv7.js +0 -1
  291. package/.next/standalone/packages/console/.next/static/chunks/35zfx3iz-m36d.js +0 -1
  292. package/.next/standalone/packages/console/.next/static/chunks/3bj--95h9t3m3.js +0 -1
  293. package/.next/standalone/packages/console/.next/static/chunks/3ceqemt0wetvz.js +0 -1
  294. package/.next/standalone/packages/console/.next/static/chunks/3chjwy_my4k01.js +0 -1
  295. package/.next/standalone/packages/console/.next/static/chunks/3vtkletqzdiya.js +0 -1
  296. package/.next/standalone/packages/console/.next/static/chunks/3yw4xze102hj7.js +0 -1
  297. package/.next/standalone/packages/console/.next/static/chunks/3yz0l46tgikv1.js +0 -1
  298. package/.next/standalone/packages/console/.next/static/chunks/40tz6f0kycfw_.js +0 -1
  299. package/.next/standalone/packages/console/.next/static/chunks/44--ms1reiaur.js +0 -1
  300. /package/.next/standalone/packages/console/.next/static/{5wsVXyxldJXu1sbaOzfGL → EK9QlWypUzIcjmiOziwEI}/_buildManifest.js +0 -0
  301. /package/.next/standalone/packages/console/.next/static/{5wsVXyxldJXu1sbaOzfGL → EK9QlWypUzIcjmiOziwEI}/_clientMiddlewareManifest.js +0 -0
  302. /package/.next/standalone/packages/console/.next/static/{5wsVXyxldJXu1sbaOzfGL → EK9QlWypUzIcjmiOziwEI}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,446964,e=>{"use strict";var t=e.i(843476),n=e.i(716327),s=e.i(618566),i=e.i(271645),a=e.i(490262),r=e.i(787964),o=e.i(46929),l=e.i(586413);function d(e){return"question"===e.kind?null===e.question.answer&&null===e.stale:"acknowledged"!==e.state}var c=e.i(718423),m=e.i(296676),x=e.i(678485),u=e.i(681924),h=e.i(341880),p=e.i(298421),f=e.i(509892),g=e.i(485538),b=e.i(976580),j=e.i(994070),v=e.i(849635);function y(e){return e.toSorted((e,t)=>e.sentAt.localeCompare(t.sentAt))}function w(e){return e.toSorted((e,t)=>t.sentAt.localeCompare(e.sentAt))}function k(e){return e.filter(e=>"question"===e.kind)}function N(e){return y(k(e).filter(d))}var S=e.i(508734),I=e.i(386247),q=e.i(456420);let A={name:"mail-open",size:24,node:[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]]};A.node;let C=(0,q.f)(A);var M=e.i(749287),$=e.i(522016),z=e.i(646013);function D({messageId:e,shipId:n,shipName:s,onMarkUnread:i,size:a}){return(0,t.jsxs)(z.DropdownMenu,{children:[(0,t.jsx)(z.DropdownMenuTrigger,{render:(0,t.jsx)(u.f,{variant:"ghost",size:a,isIconOnly:!0,"aria-label":"Message actions",icon:(0,t.jsx)(I.f,{}),"data-testid":"inbox-message-menu"})}),(0,t.jsxs)(z.DropdownMenuContent,{align:"end",children:[void 0===i?null:(0,t.jsxs)(z.DropdownMenuItem,{onClick:i,"data-testid":"inbox-mark-unread",children:[(0,t.jsx)(C,{"aria-hidden":!0}),"Mark as unread"]}),(0,t.jsxs)(z.DropdownMenuItem,{"data-testid":"inbox-copy-message-id",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{(0,h._)({title:"Message id copied"})},()=>{(0,h._)({title:"Couldn’t copy the message id",description:e,tone:"error"})})},children:[(0,t.jsx)(S.f,{"aria-hidden":!0}),"Copy message id"]}),(0,t.jsxs)(z.DropdownMenuItem,{render:(0,t.jsx)($.default,{href:`/ships/${n}`}),"data-testid":"inbox-open-ship",children:[(0,t.jsx)(M.f,{"aria-hidden":!0}),"Open ",s]})]})]})}var P=e.i(285595),R=e.i(462372),_=e.i(67874),O=e.i(817981),T=e.i(188393),F=e.i(812437),K=e.i(766390),L=e.i(60592),E=e.i(152886),U=e.i(821048);let B={name:"replace",size:24,node:[["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]]};B.node;let Q=(0,q.f)(B);var Y=e.i(865713);function V(e){return"keyNotReachable"===e.sealing?"Sealed, key not reachable":e.text.headline}function W({entry:e,now:n}){let{question:s,stale:i}=e,a=s.options.find(({key:e})=>e===s.pick.option);if(null!==s.answer){let e=s.options.find(({key:e})=>e===s.answer?.option);return(0,t.jsxs)("span",{"data-answered":!0,className:"flex min-w-0 items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(P.f,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:void 0===e?"Answered with a note":`Answered: ${String(e.key)}. ${e.label}`})]})}return null!==i?(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:["withdrawn"===i.kind?(0,t.jsx)(U.f,{"aria-hidden":!0}):(0,t.jsx)(Q,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:"withdrawn"===i.kind?"Withdrawn":"Replaced"})]}):(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-meta text-muted-foreground max-sm:text-body [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(E.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 truncate",children:["Not answered, pick: ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:void 0===a?String(s.pick.option):`${String(a.key)}. ${a.label}`})]}),(0,t.jsx)(K.f,{variant:"outline",className:"ml-auto shrink-0 tabular-nums","data-testid":"inbox-row-waiting",children:(0,v.m)(new Date(e.sentAt),n)})]})}function G({entry:e,isSelected:n,onSelect:s,now:i,isNested:a=!1}){let r=new Date(e.sentAt),o=null===e.readAt&&"acknowledged"!==e.state,l="question"===e.kind?e.question.title:V(e),d="keyNotReachable"===e.sealing;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"question"===e.kind?"inbox-question-row":"inbox-row","data-delivery-id":e.deliveryId,"aria-current":n?"true":void 0,onClick:()=>{s(e.deliveryId)},className:(0,F.f)("relative flex w-full min-w-0 flex-col gap-1 border-b border-border py-3 pr-4 pl-7 text-left transition-colors duration-(--duration-fast) outline-none hover:bg-accent focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring aria-[current=true]:bg-accent max-sm:py-3.5",a?"pl-10":void 0),children:[o?(0,t.jsx)("span",{"aria-hidden":!0,className:(0,F.f)("absolute top-[1.15rem] size-2 rounded-full bg-primary",a?"left-5":"left-2.5")}):null,(0,t.jsxs)("span",{className:"flex min-w-0 items-baseline gap-2",children:[(0,t.jsx)("span",{className:(0,F.f)("min-w-0 truncate text-meta text-foreground max-sm:text-body",o?"font-medium":"text-muted-foreground"),children:e.sender.name}),(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1",children:["sealed"===e.sealing?(0,t.jsx)(Y.f,{variant:"icon",testId:"inbox-row-sealed"}):null,(0,t.jsx)("time",{dateTime:e.sentAt,title:(0,v.o)(r),className:"text-meta text-muted-foreground tabular-nums",children:i.getTime()-r.getTime()<864e5?(0,v.w)(r):(0,v.B)(r)})]})]}),(0,t.jsx)("span",{className:(0,F.f)("line-clamp-2 text-body text-foreground [overflow-wrap:anywhere] max-sm:text-body-touch",d?"font-medium text-muted-foreground":o?"font-semibold":"font-medium","question"===e.kind&&null!==e.stale?"text-muted-foreground line-through":void 0),children:""===l?"No text":l}),"question"===e.kind?(0,t.jsx)(W,{entry:e,now:i}):d||""===e.text.summary?null:(0,t.jsx)("span",{className:"truncate text-meta text-muted-foreground max-sm:text-body",children:e.text.summary}),o?(0,t.jsx)("span",{className:"sr-only",children:"Unread"}):null]})})}var H=e.i(689664),J=e.i(841220),X=e.i(890135);function Z({messages:e,isExpanded:s,onToggle:i,selectedId:a,onSelect:r,onDoneAll:o,isPending:l=!1,now:d}){let[c]=e;if(void 0===c)return null;let m=[...new Set(e.map(({sender:e})=>e.name))].join(", "),x=new Date(c.sentAt);return(0,t.jsxs)("li",{"data-testid":"inbox-plugin-group",children:[(0,t.jsxs)("div",{className:"flex items-stretch border-b border-border",children:[(0,t.jsxs)("button",{type:"button","aria-expanded":s,"data-testid":"inbox-plugin-group-toggle",onClick:i,className:"flex min-w-0 grow items-start gap-2 py-3 pr-2 pl-7 text-left transition-colors duration-(--duration-fast) outline-none hover:bg-accent focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsxs)("span",{className:"flex min-w-0 grow flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-baseline gap-2 text-meta text-muted-foreground max-sm:text-body",children:[(0,t.jsx)(J.f,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0 self-center"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:m}),(0,t.jsx)("time",{dateTime:c.sentAt,title:(0,v.o)(x),className:"ml-auto shrink-0 tabular-nums",children:(0,v.w)(x)})]}),(0,t.jsx)("span",{className:"text-body font-medium text-foreground max-sm:text-body-touch",children:(0,X.v)(e.length,{one:"message from a plugin ship",many:"messages from plugin ships"})}),s?null:(0,t.jsx)("span",{className:"line-clamp-2 text-meta text-muted-foreground max-sm:text-body",children:e.map(V).join(" · ")})]}),(0,t.jsx)(n.f,{"aria-hidden":!0,className:(0,F.f)("mt-5 size-(--size-icon) shrink-0 text-muted-foreground transition-transform",s?"rotate-180":void 0)})]}),s&&void 0!==o?(0,t.jsx)("span",{className:"flex shrink-0 items-start py-3 pr-3",children:(0,t.jsx)(u.f,{size:"sm",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),isLoading:l,onClick:o,"data-testid":"inbox-plugin-group-done",children:"Done"})}):null]}),s?(0,t.jsx)("ul",{"aria-label":"Messages from plugin ships",children:e.map(e=>(0,t.jsx)(G,{entry:e,isSelected:e.deliveryId===a,onSelect:r,now:d,isNested:!0},e.deliveryId))}):null]})}let ee=[{value:"open",label:"Open",isDesktopOnly:!1},{value:"done",label:"Done",isDesktopOnly:!1},{value:"all",label:"All",isDesktopOnly:!0}];function et({segment:e,onSegmentChange:n,counts:s}){return(0,t.jsx)(L.i,{value:e,onValueChange:e=>{let t=ee.find(t=>t.value===e);t&&n(t.value)},children:(0,t.jsx)(L.U,{"aria-label":"Show",className:"w-full",children:ee.map(({value:e,label:n,isDesktopOnly:i})=>(0,t.jsxs)(L.k,{value:e,"data-testid":`inbox-filter-${e}`,className:(0,F.f)("grow",i?"max-sm:hidden":void 0),children:[n,void 0===s[e]||"open"!==e&&0===s[e]?null:(0,t.jsx)(L.m,{children:s[e]})]},e))})})}function en({title:e,count:n,isPrimary:s,meta:i}){return(0,t.jsxs)("h2",{className:"flex items-center gap-2 px-4 pt-4 pb-2 text-meta font-semibold text-foreground max-sm:px-1 max-sm:text-body-touch",children:[e,(0,t.jsx)(K.f,{variant:s?"count":"count-neutral",children:n}),void 0===i?null:(0,t.jsx)("span",{className:"ml-auto font-normal text-muted-foreground",children:i})]})}function es({view:e,segment:n,onSegmentChange:s,counts:i,waiting:a,selectedId:r,onSelect:o,isPluginGroupExpanded:l,onTogglePluginGroup:d,onPluginGroupDone:c,isPluginGroupPending:m,more:x,now:u}){let h;return(0,t.jsxs)("div",{"data-slot":"inbox-list",className:"flex flex-col",children:[(0,t.jsx)("div",{className:"p-2.5 max-sm:p-0 max-sm:pb-1",children:(0,t.jsx)(et,{segment:n,onSegmentChange:s,counts:i})}),0===e.questions.length?null:(0,t.jsxs)("section",{"aria-label":"Questions","data-testid":"inbox-questions",children:[(0,t.jsx)(en,{title:"Questions",count:e.questions.length,isPrimary:"open"===n,meta:"open"===n&&void 0!==a?`Oldest waits ${a}`:void 0}),(h=e.questions,(0,t.jsx)("ul",{"aria-label":"Questions to argo",className:"max-sm:overflow-hidden max-sm:rounded-lg max-sm:border max-sm:border-border max-sm:bg-card",children:h.map(e=>(0,t.jsx)(G,{entry:e,isSelected:e.deliveryId===r,onSelect:o,now:u},e.deliveryId))}))]}),e.messages.length+e.pluginMessages.length===0?null:(0,t.jsxs)("section",{"aria-label":"Messages","data-testid":"inbox-messages",children:[(0,t.jsx)(en,{title:"Messages",count:e.messages.length+e.pluginMessages.length,isPrimary:!1}),(0,t.jsxs)("ul",{"aria-label":"Messages to argo",className:"max-sm:overflow-hidden max-sm:rounded-lg max-sm:border max-sm:border-border max-sm:bg-card",children:[e.messages.map(e=>(0,t.jsx)(G,{entry:e,isSelected:e.deliveryId===r,onSelect:o,now:u},e.deliveryId)),(0,t.jsx)(Z,{messages:e.pluginMessages,isExpanded:l,onToggle:d,selectedId:r,onSelect:o,onDoneAll:c,isPending:m,now:u})]})]}),x]})}let ei={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};ei.node;let ea=(0,q.f)(ei);var er=e.i(787703),eo=e.i(730274),el=e.i(559092),ed=e.i(974470),ec=e.i(443988),em=e.i(496755),ex=e.i(631071),eu=e.i(539448);function eh({inline:e}){switch(e.kind){case"text":return e.text;case"strong":return(0,t.jsx)("strong",{className:"font-semibold",children:e.children.map((e,n)=>(0,t.jsx)(eh,{inline:e},`${String(n)}-${e.kind}`))});case"emphasis":return(0,t.jsx)("em",{children:e.children.map((e,n)=>(0,t.jsx)(eh,{inline:e},`${String(n)}-${e.kind}`))});case"delete":return(0,t.jsx)("del",{children:e.children.map((e,n)=>(0,t.jsx)(eh,{inline:e},`${String(n)}-${e.kind}`))});case"code":return(0,t.jsx)("code",{className:"rounded-sm bg-muted px-1 font-mono text-code",children:e.text});case"link":return(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",className:"font-medium text-foreground underline underline-offset-2 [overflow-wrap:anywhere] hover:text-primary focus-visible:outline-2 focus-visible:outline-ring",children:e.children.map((e,n)=>(0,t.jsx)(eh,{inline:e},`${String(n)}-${e.kind}`))});case"break":return(0,t.jsx)("br",{})}}function ep({inlines:e}){return e.map((e,n)=>(0,t.jsx)(eh,{inline:e},`${String(n)}-${e.kind}`))}function ef({block:e}){switch(e.kind){case"paragraph":return(0,t.jsx)("p",{children:(0,t.jsx)(ep,{inlines:e.children})});case"heading":return(0,t.jsx)("p",{className:"font-semibold",children:(0,t.jsx)(ep,{inlines:e.children})});case"list":{let n=e.isOrdered?"ol":"ul";return(0,t.jsx)(n,{start:e.start??void 0,className:(0,F.f)("flex flex-col gap-1 pl-5",e.isOrdered?"list-decimal":"list-disc"),children:e.items.map((e,n)=>(0,t.jsx)("li",{className:"[&>p]:inline",children:(0,t.jsx)(eg,{blocks:e})},`${String(n)}-${String(e.length)}`))})}case"code":return(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md border border-border bg-muted px-3 py-2 font-mono text-code whitespace-pre",children:e.text});case"quote":return(0,t.jsx)("blockquote",{className:"border-l-2 border-border pl-3 text-muted-foreground",children:(0,t.jsx)(eg,{blocks:e.children})});case"table":return(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("table",{className:"text-meta",children:(0,t.jsx)("tbody",{children:e.rows.map((e,n)=>(0,t.jsx)("tr",{className:"border-b border-border",children:e.map((e,n)=>(0,t.jsx)("td",{className:"px-2 py-1 align-top",children:(0,t.jsx)(ep,{inlines:e})},`${String(n)}-${String(e.length)}`))},`${String(n)}-${String(e.length)}`))})})});case"rule":return(0,t.jsx)("hr",{className:"border-border"})}}function eg({blocks:e}){return e.map((e,n)=>(0,t.jsx)(ef,{block:e},`${String(n)}-${e.kind}`))}function eb({blocks:e,lineCount:n,className:s}){let a=n>12,[r,o]=(0,i.useState)(!1);if(0===e.length)return null;let l=a&&!r;return(0,t.jsxs)("div",{className:(0,F.f)("flex flex-col gap-2",s),children:[(0,t.jsx)("div",{"data-testid":"inbox-message-body","data-folded":l?"true":void 0,className:(0,F.f)("flex flex-col gap-3 text-prose text-foreground [overflow-wrap:anywhere] max-sm:text-body-touch",l?"max-h-72 overflow-hidden [mask-image:linear-gradient(to_bottom,black_70%,transparent)]":void 0),children:(0,t.jsx)(eg,{blocks:e})}),l?(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",className:"self-start","data-testid":"inbox-show-all",onClick:()=>{o(!0)},children:["Show all ",n," lines"]}):null]})}function ej({link:e}){return(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":"inbox-link-row",className:"flex max-w-md items-center gap-3 rounded-lg border border-border bg-card px-3.5 py-2.5 transition-colors hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",children:["pull"===e.kind?(0,t.jsx)(er.f,{"aria-hidden":!0,className:"size-(--size-icon) shrink-0"}):(0,t.jsx)(el.f,{"aria-hidden":!0,className:"size-(--size-icon) shrink-0"}),(0,t.jsxs)("span",{className:"flex min-w-0 grow flex-col",children:[(0,t.jsx)("span",{className:"text-meta font-medium text-foreground",children:"pull"===e.kind?"Pull request":"Issue"}),(0,t.jsxs)("span",{className:"truncate font-mono text-id text-muted-foreground",children:[e.repository," #",e.number]})]}),(0,t.jsx)(ea,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0 text-muted-foreground"})]})}function ev({name:e,isArgo:n,sentAt:s,children:i}){let a=new Date(s);return(0,t.jsxs)("li",{"data-testid":"inbox-thread-message",className:(0,F.f)("flex flex-col gap-1 rounded-lg border px-3.5 py-2.5",n?"ml-10 border-transparent bg-muted max-sm:ml-8":"mr-10 border-border bg-card max-sm:mr-0"),children:[(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:n?"argo (you)":e})," ·"," ",(0,t.jsx)("time",{dateTime:s,title:(0,v.o)(a),children:(0,v.B)(a)})]}),i]})}function ey({thread:e,message:n}){return(void 0===e||0===e.length)&&0===n.replies.length?null:(0,t.jsxs)("section",{"aria-label":"In this thread",className:"flex max-w-xl flex-col gap-2",children:[void 0===e||0===e.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h2",{className:"text-meta text-muted-foreground",children:"In this thread"}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:e.map(e=>(0,t.jsxs)(ev,{name:e.sender.name,isArgo:e.isArgo,sentAt:e.sentAt,children:[(0,t.jsx)("p",{className:"text-body font-medium text-foreground [overflow-wrap:anywhere]",children:e.text.headline}),(0,t.jsx)(eb,{blocks:e.text.body,lineCount:e.text.lineCount})]},e.id))})]}),0===n.replies.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h2",{className:"text-meta text-muted-foreground",children:"Your replies"}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:n.replies.map(e=>(0,t.jsxs)(ev,{name:"argo",isArgo:!0,sentAt:e.sentAt,children:[(0,t.jsx)("p",{className:"text-body text-foreground [overflow-wrap:anywhere]",children:e.text.headline}),(0,t.jsx)(eb,{blocks:e.text.body,lineCount:e.text.lineCount})]},e.id))})]})]})}function ew({message:e}){if(null===e.doneAt)return null;let n=new Date(e.doneAt);return(0,t.jsxs)("p",{"data-testid":"inbox-done-notice",className:"flex items-center gap-2 rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-meta text-tone-ok-fg [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(P.f,{"aria-hidden":!0}),"Done at"," ",(0,t.jsx)("time",{dateTime:e.doneAt,title:(0,v.o)(n),children:(0,v.w)(n)}),null===e.repliedWith?".":", when you replied."]})}function ek({message:e,onReply:n,onMarkDone:s,isPending:a,isPhone:r}){let[o,l]=(0,i.useState)(""),d=(0,ed.t)(),c="acknowledged"===e.state,m=""!==o.trim(),x=e.sender.name;return(0,t.jsxs)("form",{"data-testid":"inbox-action-bar",className:"flex items-end gap-2 border-t border-border bg-background px-5 py-3 max-sm:px-4 max-sm:pb-[calc(env(safe-area-inset-bottom)+var(--spacing)*3)]",onSubmit:e=>{e.preventDefault(),m&&!a&&n(o)},children:[(0,t.jsx)(ec.f,{"data-reply-field":!0,rows:m?3:1,size:r?"touch":"md","aria-label":`Reply to ${x}`,placeholder:`Reply to ${x}`,value:o,onChange:e=>{l(e.target.value)},onKeyDown:ed.q,"data-testid":"inbox-reply"}),m||c?(0,t.jsxs)(u.f,{type:"submit",variant:"primary",size:r?"touch":"md",icon:(0,t.jsx)(eo.f,{"aria-hidden":!0}),isLoading:a,disabled:!m&&!a,"aria-keyshortcuts":null===d?void 0:(0,ed.k)(d),"data-testid":"inbox-reply-send",children:["Send reply",null===d||r?null:(0,t.jsx)(ex.f,{platform:d})]}):(0,t.jsxs)(u.f,{type:"button",variant:"primary",size:r?"touch":"md",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),isLoading:a,"aria-keyshortcuts":"E","data-testid":"inbox-mark-done",onClick:s,children:["Done",r?null:(0,t.jsx)(R.f,{"aria-hidden":!0,className:"border-primary-foreground/25 bg-primary-foreground/10 text-primary-foreground",children:"E"})]})]})}function eN({message:e,thread:n,isPhone:s,onReply:i,onMarkDone:a,onMarkUnread:r,isPending:o,isReadOnly:l=!1,replyRefusal:d}){let c=new Date(e.sentAt),{sender:m,text:x}=e,h="acknowledged"===e.state,p="keyNotReachable"===e.sealing,f=p||""===x.headline?`Message from ${m.name}`:x.headline;return(0,t.jsxs)("article",{"aria-label":f,"data-testid":"inbox-message",className:"flex min-h-0 grow flex-col",children:[s?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-5 py-2.5",children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Message"}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[h||l?null:(0,t.jsx)(u.f,{variant:"ghost",size:"sm",disabled:o,onClick:r,"data-testid":"inbox-mark-unread",children:"Mark as unread"}),(0,t.jsx)(D,{messageId:e.messageId,shipId:m.id,shipName:m.name,size:"sm"})]})]}),(0,t.jsxs)("div",{className:"flex min-h-0 grow flex-col gap-5 overflow-y-auto px-5 py-5 max-sm:px-0 max-sm:py-3.5",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-1.5",children:[e.isFromPlugin?(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"inline-flex size-7 items-center justify-center rounded-md bg-muted",children:(0,t.jsx)(J.f,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})}),null===m.type?null:(0,t.jsx)(K.f,{variant:"outline",children:m.type})]}):null,(0,t.jsx)("h2",{className:"text-heading font-semibold [overflow-wrap:anywhere] max-sm:text-title-touch",children:p?f:""===x.headline?"No text":x.headline}),(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-1 text-meta text-muted-foreground",children:[(0,t.jsx)(eu.f,{name:m.name,shipId:m.id,isSuffixShown:m.isNameShared,size:"meta",className:"[&>span:first-child]:text-foreground"}),(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)("time",{dateTime:e.sentAt,title:(0,v.o)(c),children:(0,v.B)(c)}),null===e.model?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)("span",{className:"font-mono text-id",children:e.model})]}),"plain"===e.sealing?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)(Y.f,{testId:"inbox-message-sealed"})]})]})]}),(0,t.jsx)(ew,{message:e}),p?(0,t.jsx)(em.f,{testId:"inbox-message-not-reachable"}):(0,t.jsx)(eb,{blocks:x.body,lineCount:x.lineCount}),0===x.links.length?null:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:x.links.map(e=>(0,t.jsx)(ej,{link:e},e.url))}),(0,t.jsx)(ey,{thread:n,message:e})]}),l?(0,t.jsx)("p",{"data-testid":"inbox-read-only",className:"border-t border-border px-5 py-3 text-meta text-muted-foreground",children:"Read-only: you see argo’s inbox, and can’t reply or mark messages done."}):(0,t.jsxs)("div",{className:s?"sticky bottom-0 -mx-4":void 0,children:[void 0===d?null:(0,t.jsx)(O.f,{title:d.title,description:d.description,className:"mx-5 mb-2 max-sm:mx-4"}),(0,t.jsx)(ek,{message:e,onReply:i,onMarkDone:a,isPending:o,isPhone:s},`${e.deliveryId}-${e.state}`)]})]})}var eS=e.i(867927),eI=e.i(422768),eq=e.i(235056),eA=e.i(515281),eC=e.i(212470),eM=e.i(791727),e$=e.i(152678);function ez({deliveryId:e,title:n,onSelect:s,testId:i}){return(0,t.jsx)("button",{type:"button","data-testid":i,onClick:()=>{s(e)},className:"min-w-0 text-left font-medium text-foreground underline underline-offset-2 [overflow-wrap:anywhere] hover:text-primary focus-visible:outline-2 focus-visible:outline-ring",children:n})}function eD({question:e}){let{answer:n,options:s}=e.question;if(null===n)return null;let i=new Date(n.sentAt),a=s.find(({key:e})=>e===n.option);return(0,t.jsxs)("div",{"data-testid":"inbox-answered",className:"flex flex-col gap-1 rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-meta text-tone-ok-fg max-sm:text-body",children:[(0,t.jsxs)("p",{className:"flex items-start gap-2 [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(P.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["You answered ",void 0===a?"with a note":(0,t.jsx)("span",{className:"font-semibold",children:`${String(a.key)}. ${a.label}`})," at"," ",(0,t.jsx)("time",{dateTime:n.sentAt,title:(0,v.o)(i),children:(0,v.w)(i)}),". ",e.sender.name," receives it as a reply."]})]}),null===n.note?null:(0,t.jsx)("p",{className:"pl-6 whitespace-pre-wrap [overflow-wrap:anywhere]",children:n.note})]})}function eP({question:e,onSelect:n}){let{stale:s}=e;if(null===s)return null;let i=new Date(s.sentAt);return(0,t.jsxs)("div",{role:"status","data-testid":"inbox-stale",className:"flex flex-col gap-1 rounded-md border border-tone-ended-border bg-tone-ended-bg px-3 py-2 text-meta text-tone-ended-fg",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:["withdrawn"===s.kind?(0,t.jsx)(U.f,{"aria-hidden":!0}):(0,t.jsx)(Q,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["withdrawn"===s.kind?"Withdrawn":"Replaced"," by ",e.sender.name," at"," ",(0,t.jsx)("time",{dateTime:s.sentAt,title:(0,v.o)(i),children:(0,v.w)(i)}),". It can’t be answered."]})]}),"replaced"===s.kind?(0,t.jsxs)("p",{className:"flex flex-wrap items-baseline gap-1",children:["Answer the new question: ",(0,t.jsx)(ez,{deliveryId:s.deliveryId,title:s.by.title,onSelect:n,testId:"inbox-replacement"})]}):null]})}function eR({option:e,question:n,isChosen:s,isSuggested:i=!1}){let{pick:a}=n.question,r=e.key===a.option;return(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2 text-body font-medium text-foreground max-sm:text-body-touch",children:[e.label,r?(0,t.jsx)(K.f,{variant:"outline",children:i?`${n.sender.name}’s pick, not sent`:`${n.sender.name}’s pick`}):null]}),""===e.detail?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground max-sm:text-body",children:e.detail}),r&&s?(0,t.jsxs)("span",{className:"mt-1.5 rounded-md bg-muted px-3 py-2 text-meta text-foreground max-sm:text-body",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Why:"})," ",a.why]}):null]})}let e_="flex items-start gap-3 rounded-lg border px-4 py-3.5";function eO({question:e}){let{options:n,answer:s}=e.question;return(0,t.jsx)("ol",{"aria-label":"Options",className:"flex flex-col gap-2",children:n.map(n=>{let i=s?.option===n.key;return(0,t.jsx)("li",{"data-testid":`inbox-option-${String(n.key)}`,className:(0,F.f)(e_,i?"border-2 border-primary bg-card":"border-border bg-card"),children:(0,t.jsx)(eR,{option:n,question:e,isChosen:i})},n.key)})})}function eT({message:e}){return(0,t.jsxs)("p",{role:"alert","data-testid":"inbox-answer-failed",className:"flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3.5 py-2.5 text-meta text-tone-attention-fg max-sm:text-body [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(eI.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["Your answer was not sent: ",e,". Answer again to send it."]})]})}function eF({question:e,isPhone:n,onAnswer:s,isPending:a,failure:r,draft:o,onDraftChange:l}){let d=(0,i.useId)(),c=`${d}-note`,{options:m,pick:x}=e.question,h=function({failure:e,draft:t}){let n=e?.answer;return void 0!==n?{option:"option"in n?n.option:void 0,note:n.note??""}:t}({failure:r,draft:o}),[p,f]=(0,i.useState)(void 0===h?x.option:h.option),[g,b]=(0,i.useState)(h?.note??""),[j,v]=(0,i.useState)(void 0!==h),[y,w]=(0,i.useState)(!n||""!==g),k=e=>{f(e.option),b(e.note),l?.(e.option===x.option&&""===e.note.trim()?void 0:e)},N=e=>{v(!0),k({option:e,note:g})},S=(0,ed.t)(),I=e.sender.name,q=g.trim(),A=m.find(({key:e})=>e===p),C=function({option:e,hasNote:t}){return void 0===e?t?"Send note":void 0:t?`Answer: ${e}, with note`:`Answer: ${e}`}({option:A?.label,hasNote:""!==q});return(0,t.jsxs)("form",{className:"flex min-h-0 grow flex-col",onSubmit:e=>{e.preventDefault(),void 0===C||a||s(void 0===p?{note:q}:{option:p,...""===q?{}:{note:q}})},children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 px-5 pb-5 max-sm:px-0",children:[void 0===r?null:(0,t.jsx)(eT,{message:r.message}),(0,t.jsx)(e$.x,{"aria-label":"Options",value:p??0,onValueChange:e=>{N(e)},onClickCapture:e=>{let t=e.target instanceof Element?e.target.closest("[data-option-key]")?.getAttribute("data-option-key"):void 0;null!=t&&Number(t)===p&&(e.preventDefault(),e.stopPropagation(),N(void 0))},className:"flex flex-col gap-2",children:m.map(n=>{let s=`${d}-option-${String(n.key)}`,i=n.key===p,a=i&&!j;return(0,t.jsxs)("div",{"data-testid":`inbox-option-${String(n.key)}`,"data-option-key":n.key,"data-suggested":a?"true":void 0,className:(0,F.f)(e_,"bg-card",a?"border-2 border-dashed border-primary":i?"border-2 border-primary":"border-border"),children:[(0,t.jsx)(e$.a,{id:s,value:n.key,className:"mt-0.5"}),(0,t.jsx)("label",{htmlFor:s,className:"min-w-0 grow cursor-pointer",children:(0,t.jsx)(eR,{option:n,question:e,isChosen:i,isSuggested:a})})]},n.key)})}),n&&y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)(eM.f,{htmlFor:c,children:["Note to ",I]}),(0,t.jsx)(ec.f,{id:c,rows:3,size:"touch",value:g,onChange:e=>{k({option:p,note:e.target.value})},"data-testid":"inbox-note"}),(0,t.jsx)("p",{className:"text-body text-muted-foreground",children:"Optional with an option. On its own, it asks for more context or says none fits."})]}):null]}),(0,t.jsxs)("div",{className:"mt-auto flex items-center gap-2 border-t border-border bg-background px-5 py-3 max-sm:sticky max-sm:bottom-0 max-sm:-mx-4 max-sm:px-4 max-sm:pb-[calc(env(safe-area-inset-bottom)+var(--spacing)*3)]",children:[n?y?null:(0,t.jsx)(u.f,{type:"button",variant:"ghost",size:"touch",icon:(0,t.jsx)(eA.f,{"aria-hidden":!0}),"data-testid":"inbox-add-note",onClick:()=>{w(!0)},children:"Add a note"}):(0,t.jsx)(eC.e,{id:c,"aria-label":`Note to ${I}`,placeholder:`Add a note to ${I} (optional)`,value:g,onChange:e=>{k({option:p,note:e.target.value})},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),(0,ed.v)(e.nativeEvent)&&e.currentTarget.form?.requestSubmit())},className:"grow","data-testid":"inbox-note"}),(0,t.jsxs)(u.f,{type:"submit",variant:"primary",size:n?"touch":"md",icon:(0,t.jsx)(eo.f,{"aria-hidden":!0}),isLoading:a,disabled:void 0===C&&!a,"aria-keyshortcuts":null===S?void 0:(0,ed.k)(S),className:n?"grow":void 0,"data-testid":"inbox-answer",children:[C??"Pick an option or write a note",null===S||n?null:(0,t.jsx)(ex.f,{platform:S})]})]})]})}function eK({position:e,onSelect:n,isPhone:s}){let{next:i}=e;return void 0===i?null:(0,t.jsxs)("div",{className:"mt-auto flex flex-col items-stretch gap-2 border-t border-border bg-background px-5 py-3 max-sm:sticky max-sm:bottom-0 max-sm:-mx-4 max-sm:px-4 max-sm:pb-[calc(env(safe-area-inset-bottom)+var(--spacing)*3)] sm:flex-row sm:items-center sm:justify-end",children:[(0,t.jsx)("p",{className:"text-center text-meta text-muted-foreground max-sm:text-body",children:(0,X.v)(e.left,{one:"question left",many:"questions left"})}),(0,t.jsxs)(u.f,{variant:"primary",size:s?"touch":"md","data-testid":"inbox-next-question",onClick:()=>{n(i)},children:["Next question",(0,t.jsx)(eS.f,{"aria-hidden":!0})]})]})}function eL({question:e,position:n,isPhone:s,onAnswer:i,onSelect:a,isPending:r,now:o,isReadOnly:l=!1,failure:d,draft:c,onDraftChange:m}){let x=new Date(e.sentAt),{title:u,context:h,answer:p}=e.question,f=null===p&&null===e.stale;return(0,t.jsxs)("article",{"aria-label":u,"data-testid":"inbox-question",className:"flex min-h-0 grow flex-col",children:[(0,t.jsxs)("div",{className:(0,F.f)("flex min-h-0 grow flex-col overflow-y-auto",s?void 0:"pt-5"),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 px-5 pb-5 max-sm:px-0 max-sm:pt-3.5",children:[(0,t.jsx)(eD,{question:e}),(0,t.jsx)(eP,{question:e,onSelect:a}),(0,t.jsxs)("header",{className:"flex flex-col gap-1.5",children:[f?(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsxs)(K.f,{variant:"outline",className:"gap-1",children:[(0,t.jsx)(eq.f,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),"Question"]}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground","data-testid":"inbox-question-status",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Not answered"})," · waiting ",(0,v.m)(x,o)]})]}):null,(0,t.jsx)("h2",{className:"text-heading font-semibold [overflow-wrap:anywhere] max-sm:text-title-touch",children:u}),(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-1 text-meta text-muted-foreground",children:[(0,t.jsx)(eu.f,{name:e.sender.name,shipId:e.sender.id,isSuffixShown:e.sender.isNameShared,size:"meta",className:"[&>span:first-child]:text-foreground"}),"asks ·"," ",(0,t.jsx)("time",{dateTime:e.sentAt,title:(0,v.o)(x),children:(0,v.B)(x)}),"plain"===e.sealing?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)(Y.f,{testId:"inbox-question-sealed"})]})]}),null===e.replaces?null:(0,t.jsxs)("p",{className:"flex flex-wrap items-baseline gap-1 text-meta text-muted-foreground",children:["Replaces ",(0,t.jsx)(ez,{deliveryId:e.replaces.deliveryId,title:e.replaces.title,onSelect:a,testId:"inbox-replaces"})]})]}),""===h?null:(0,t.jsx)("p",{className:"text-body whitespace-pre-wrap text-foreground [overflow-wrap:anywhere] max-sm:text-body-touch",children:h}),!f||l?(0,t.jsx)(eO,{question:e}):null]}),f&&!l?(0,t.jsx)(eF,{question:e,isPhone:s,onAnswer:i,isPending:r,failure:d,draft:c,onDraftChange:m},e.deliveryId):null]}),l&&f?(0,t.jsx)("p",{"data-testid":"inbox-read-only",className:"border-t border-border px-5 py-3 text-meta text-muted-foreground",children:"Read-only: you see argo’s questions, and can’t answer them."}):null,f?null:(0,t.jsx)(eK,{position:n,onSelect:a,isPhone:s})]})}function eE({selected:e,isPhone:n,...s}){let i=s.pendingIds.has(e.deliveryId);return"question"===e.kind?(0,t.jsx)(eL,{question:e,position:s.questionPosition??{number:void 0,count:0,next:void 0,left:0},isPhone:n,onAnswer:t=>{s.onAnswer({deliveryId:e.deliveryId,answer:t})},onSelect:s.onSelect,isPending:i,now:s.now,isReadOnly:s.isReadOnly,failure:s.answerFailures?.get(e.deliveryId),draft:s.answerDrafts?.get(e.deliveryId),onDraftChange:t=>{s.onAnswerDraftChange?.({deliveryId:e.deliveryId,draft:t})}},e.deliveryId):(0,t.jsx)(eN,{message:e,thread:s.thread,isPhone:n,onReply:t=>{s.onReply({deliveryId:e.deliveryId,payload:t})},onMarkDone:()=>{s.onMarkDone(e.deliveryId)},onMarkUnread:()=>{s.onMarkUnread(e.deliveryId)},isPending:i,isReadOnly:s.isReadOnly,replyRefusal:s.replyRefusals?.get(e.deliveryId)},e.deliveryId)}function eU({selected:e,questionPosition:n,onMove:s}){if(e?.kind!=="question")return null;let i=n?.number;return(0,t.jsxs)("div",{className:"flex items-center gap-1 border-b border-border px-5 py-2.5",children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground","data-testid":"inbox-question-position",children:void 0===i?"Question":`Question ${String(i)} of ${String(n?.count??0)}`}),(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",className:"ml-auto","aria-keyshortcuts":"K",onClick:()=>{s("previous")},children:["Previous ",(0,t.jsx)(R.f,{"aria-hidden":!0,children:"K"})]}),(0,t.jsxs)(u.f,{variant:"ghost",size:"sm","aria-keyshortcuts":"J",onClick:()=>{s("next")},children:["Next ",(0,t.jsx)(R.f,{"aria-hidden":!0,children:"J"})]})]})}function eB({segment:e,onSegmentChange:n}){return"open"===e?(0,t.jsx)("div",{"data-testid":"inbox-empty",className:"flex grow items-center justify-center p-6 max-sm:p-0",children:(0,t.jsx)(_.f,{icon:(0,t.jsx)(P.f,{}),title:"Nothing waits for you",description:"New ones show up here as ships send them.",action:(0,t.jsx)(u.f,{variant:"ghost",onClick:()=>{n("done")},children:"See done"})})}):(0,t.jsx)("div",{"data-testid":"inbox-empty",className:"flex grow items-center justify-center p-6 max-sm:p-0",children:(0,t.jsx)(_.f,{icon:(0,t.jsx)(P.f,{}),title:"done"===e?"Nothing done yet":"No messages for you",description:"done"===e?"Questions you answer and messages you mark done show up here.":"When a ship asks argo a question or sends it a message, it shows up here."})})}function eQ(e){return e.questions.length+e.messages.length+e.pluginMessages.length===0}function eY(e){let{state:n,onRetry:s,view:a,segment:r,selected:o,onSelect:l}=e;if(!function({selected:e,onMove:t,onMarkDone:n,isReadOnly:s}){(0,i.useEffect)(()=>{let i=i=>{var a;if(!(i.metaKey||i.ctrlKey||i.altKey||i.isComposing||(a=i.target)instanceof HTMLElement&&(a.isContentEditable||null!==a.closest('input, textarea, select, [role="menu"], [role="dialog"]'))))switch(i.key.toLowerCase()){case"j":i.preventDefault(),t("next");return;case"k":i.preventDefault(),t("previous");return;case"e":e?.kind==="message"&&"acknowledged"!==e.state&&!0!==s&&(i.preventDefault(),n(e.deliveryId));return;case"r":{let e=[...document.querySelectorAll("[data-reply-field]")].find(e=>null!==e.offsetParent);void 0!==e&&(i.preventDefault(),e.focus());return}}};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,t,n,s])}(e),"loading"===n)return(0,t.jsxs)("div",{"data-slot":"operator-inbox","data-state":"loading",className:"grid gap-4 sm:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]",children:[(0,t.jsx)(T.f,{variant:"list",rows:5,label:"Loading your inbox"}),(0,t.jsx)(T.f,{variant:"detail",label:"Loading the message",className:"max-sm:hidden"})]});if("error"===n)return(0,t.jsx)("div",{"data-slot":"operator-inbox","data-state":"error","data-testid":"inbox-error",children:(0,t.jsx)(O.f,{variant:"page",title:"Couldn’t load your inbox",description:"This page couldn’t reach the fleet server. Messages to argo are stored on the server, so nothing is lost.",onRetry:s})});let d=(0,t.jsx)(es,{...e,selectedId:o?.deliveryId,onSelect:e=>{l(e)}});return(0,t.jsxs)("div",{"data-slot":"operator-inbox","data-state":"ready",className:"flex grow flex-col",children:[(0,t.jsxs)("div",{className:"grid h-[calc(100dvh-12rem)] min-h-128 grid-cols-[minmax(20rem,24rem)_minmax(0,1fr)] overflow-hidden rounded-lg border border-border bg-card max-sm:hidden",children:[(0,t.jsxs)("div",{className:"flex min-h-0 flex-col overflow-y-auto border-r border-border",children:[d,eQ(a)&&!e.more?(0,t.jsx)(eB,{segment:r,onSegmentChange:e.onSegmentChange}):null]}),(0,t.jsx)("div",{className:"flex min-h-0 flex-col bg-background",children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eU,{selected:o,questionPosition:e.questionPosition,onMove:e.onMove}),(0,t.jsx)(eE,{...e,selected:o,isPhone:!1})]}):(0,t.jsx)("p",{className:"m-auto text-meta text-muted-foreground",children:eQ(a)?null:!0===e.isReadOnly?"Choose a question or message to read it.":"Choose a question to answer it, or a message to read it. J and K move."})})]}),(0,t.jsx)("div",{className:"flex grow flex-col gap-3 sm:hidden","data-hides-tab-bar":o?"":void 0,children:o?(0,t.jsx)(eE,{...e,selected:o,isPhone:!0}):(0,t.jsxs)(t.Fragment,{children:[d,eQ(a)&&!e.more?(0,t.jsx)(eB,{segment:r,onSegmentChange:e.onSegmentChange}):null]})})]})}function eV(e){return e instanceof Error?e.message:"Try again in a moment."}function eW({filterParameter:e,selectedId:S}){var I,q,A;let C,M,$,z,P,R=(0,s.useRouter)(),_=(0,m.f)(),O=(0,l.b)(e),T=(0,l.s)(O),F=(0,l.O)(),K=(0,l.V)(S),L=(0,l.P)(),E=(0,l.c)(),U=(0,l.W)(),B=(0,l.X)(),Q=(0,c.f)(),Y=(0,r.y)(),V=(0,a.Q)();(0,x.n)([Q.error]);let[W,G]=(0,i.useState)(new Set),[H,J]=(0,i.useState)(!1),[X,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(new Map),[en,es]=(0,i.useState)(new Map),[ei,ea]=(0,i.useState)(new Map),er=(0,i.useRef)(S),eo=T.items??[],el=(C=k(A=eo),M=w(A.filter(e=>"message"===e.kind)),{questions:[...y(C.filter(d)),...w(C.filter(e=>!d(e)))],messages:M.filter(e=>!e.isFromPlugin),pluginMessages:M.filter(e=>e.isFromPlugin)}),ed=[...el.questions,...el.messages,...el.pluginMessages].map(({deliveryId:e})=>e),ec=eo.find(e=>e.deliveryId===S)??K,em=N(eo).map(({deliveryId:e})=>e),ex=ec?.kind==="question"?(I=ec.deliveryId,$=em.indexOf(I),z=em.filter(e=>e!==I),P=-1===$?void 0:em[$+1],{number:-1===$?void 0:$+1,count:em.length,next:P??z[0],left:z.length}):void 0,eu=(q=ec?.kind==="message"?ec.inReplyTo:void 0,(0,b.f)({queryKey:[...l.C,"thread",q],queryFn:()=>null==q?Promise.resolve([]):(0,j.f)({read:"inbox-thread",input:{messageId:q}}),enabled:null!=q}).data),eh=e=>{R.replace((0,l.r)({filter:e.segment??O,deliveryId:e.deliveryId}),{scroll:!1})},ep=e=>{eh({deliveryId:e});let t=eo.find(t=>t.deliveryId===e);t?.readAt===null&&"acknowledged"!==t.state&&V.canReceive&&L.mutate({deliveryId:t.deliveryId,isRead:!0})},ef=({deliveryId:e,run:t,failure:n})=>{G(t=>new Set([...t,e])),t().catch(e=>{(0,h._)({title:n,description:eV(e),tone:"error"})}).finally(()=>{G(t=>new Set([...t].filter(t=>t!==e)))})},eg=(e,t)=>{es(n=>{let s=new Map(n);return void 0===t?s.delete(e):s.set(e,t),s})};(0,i.useEffect)(()=>{let e=er.current;if(er.current=S,void 0===e||e===S||!en.has(e))return;let t=T.items?.find(t=>t.deliveryId===e);t?.kind==="question"&&d(t)&&(0,h._)({title:`Your answer to “${t.question.title}” is not sent`,description:"Your choice and note wait on the question. Answer sends them.",tone:"info"})},[S,en,T.items]);let eb=e=>{ef({deliveryId:e,run:()=>L.mutateAsync({deliveryId:e,isRead:!1}),failure:"Couldn’t mark the message unread"}),eh({})},ej=el.pluginMessages.filter(d),ev=void 0===ec?void 0:(0,t.jsx)(g.f,{title:"",live:Q.live,back:{href:(0,l.r)({filter:O}),label:"Inbox"},actions:"question"===ec.kind?ex?.number===void 0?void 0:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-body-touch text-muted-foreground","data-testid":"inbox-question-position",children:[ex.number," of ",ex.count]}),void 0===ex.next?null:(0,t.jsx)(u.f,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Next question",icon:(0,t.jsx)(n.f,{}),"data-testid":"inbox-next-question-top",onClick:()=>{ep(ex.next)}})]}):(0,t.jsx)(D,{messageId:ec.messageId,shipId:ec.sender.id,shipName:ec.sender.name,size:"touch",onMarkUnread:"acknowledged"!==ec.state&&V.canReceive?()=>{eb(ec.deliveryId)}:void 0})});return(0,t.jsx)(f.f,{...Y,title:"Inbox",live:Q.live,phoneTopBar:ev,children:(0,t.jsx)(eY,{state:T.isFailed?"error":void 0===T.items?"loading":"ready",onRetry:T.retry,view:el,segment:O,onSegmentChange:e=>{eh({segment:e})},counts:void 0===F?{}:{open:F},more:T.hasMore?(0,t.jsx)(p.f,{what:"older messages",isLoading:T.isLoadingMore,isFailed:T.isLoadMoreFailed,onLoad:T.loadMore,area:"inbox"}):null,waiting:function(e,t){let[n]=N(e);return void 0===n?void 0:(0,v.m)(new Date(n.sentAt),t)}(eo,_),selected:ec,thread:eu,questionPosition:ex,order:ed,onSelect:ep,onMove:e=>{let t=function(e,{current:t,direction:n}){let s=void 0===t?-1:e.indexOf(t);return -1===s?e[0]:e[Math.min(Math.max(s+("next"===n?1:-1),0),e.length-1)]}(ed,{current:ec?.deliveryId,direction:e});void 0!==t&&t!==ec?.deliveryId&&ep(t)},isPluginGroupExpanded:H,onTogglePluginGroup:()=>{J(e=>!e)},onPluginGroupDone:V.canReceive&&ej.length>0?()=>{Z(!0),Promise.allSettled(ej.map(({deliveryId:e})=>E.mutateAsync({deliveryId:e}))).then(e=>{let t=e.filter(e=>"rejected"===e.status).length;t>0&&(0,h._)({title:"Couldn’t mark every message done",description:`${String(t)} of ${String(e.length)} were not marked done. Try again in a moment.`,tone:"error"})}).finally(()=>{Z(!1)})}:void 0,isPluginGroupPending:X,onMarkDone:e=>{ef({deliveryId:e,run:()=>E.mutateAsync({deliveryId:e}),failure:"Couldn’t mark the message done"})},onMarkUnread:eb,onReply:({deliveryId:e,payload:t})=>{let n=t=>{ea(n=>{let s=new Map(n);return void 0===t?s.delete(e):s.set(e,t),s})};n(void 0),ef({deliveryId:e,run:()=>U.mutateAsync({deliveryId:e,payload:t,idempotencyKey:`reply-${e}-${crypto.randomUUID()}`}).catch(e=>{let t="KEY_UNAVAILABLE"===(0,o.v)(e)?{title:"Couldn’t send your reply",description:"Your company key is not reachable. Nothing was sent; your reply is kept."}:void 0;if(void 0===t)throw e;n(t)}),failure:"Couldn’t send the reply"})},onAnswer:({deliveryId:e,answer:t})=>{let n=function({previous:e,answer:t,newKey:n}){var s;let i,a=void 0!==e&&(s=e.answer,(i=e=>"option"in e?e.option:void 0)(s)===i(t)&&s.note===t.note)?e.idempotencyKey:n;return{answer:t,idempotencyKey:a,failure:void 0}}({previous:ee.get(e),answer:t,newKey:`answer-${e}-${crypto.randomUUID()}`}),s=t=>{et(n=>{let s=new Map(n);return void 0===t?s.delete(e):s.set(e,t),s})};s(n),eg(e,void 0);let i=eo.find(t=>t.deliveryId===e),a=i?.kind==="question"?i.question.title:"the question";G(t=>new Set([...t,e])),B.mutateAsync({deliveryId:e,answer:t,idempotencyKey:n.idempotencyKey}).then(()=>{s(void 0)}).catch(t=>{s({...n,failure:eV(t)}),er.current!==e&&(0,h._)({title:`Your answer to “${a}” was not sent`,description:eV(t),tone:"error"}),T.retry()}).finally(()=>{G(t=>new Set([...t].filter(t=>t!==e)))})},pendingIds:W,answerFailures:function(e){let t=new Map;for(let[n,{answer:s,failure:i}]of e)void 0!==i&&t.set(n,{answer:s,message:i});return t}(ee),replyRefusals:ei,answerDrafts:en,onAnswerDraftChange:({deliveryId:e,draft:t})=>{eg(e,t)},now:_,isReadOnly:!V.canReceive})})}e.s(["InboxPageFor",0,function({filterParameter:e,selectedId:n}){return(0,t.jsx)(eW,{...void 0===e?{}:{filterParameter:e},...void 0===n?{}:{selectedId:n}})}],446964)}]);
@@ -1,2 +1,2 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,313260,e=>{"use strict";var t=e.i(843476),a=e.i(407921),r=e.i(618566),s=e.i(271645),i=e.i(341880),n=e.i(67874),l=e.i(817981),d=e.i(188393),o=e.i(806537),c=e.i(766390),h=e.i(975867);let u={argo:"You turn it on or off.",rules:"Applying rules turns it off; applying none turns it on again."};function p({rows:e,error:a,onRetry:r,isTurning:s,turnError:i,onViewerReadChange:n}){let m;return m=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read the built-in rules",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"list",rows:3,label:"Loading the built-in rules"}):(0,t.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":"network-built-in-rule",className:"flex items-start justify-between gap-3 py-2 first:pt-0 last:pb-0",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-body font-medium","data-testid":"network-built-in-rule-name",children:e.name}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[e.meaning," ","never"===e.turnedBy?null:u[e.turnedBy]]})]}),"argo"===e.turnedBy?(0,t.jsx)(h.f,{checked:e.isOn,disabled:s,"aria-label":`${e.name}: ${e.isOn?"on":"off"}`,"data-testid":"network-built-in-viewer-read",onCheckedChange:e=>{n(e)}}):(0,t.jsx)(c.f,{variant:"outline","data-testid":"network-built-in-rule-state",children:"never"===e.turnedBy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.f,{"aria-hidden":!0}),"Never off"]}):e.isOn?"On":"Off"})]},e.key))}),(0,t.jsxs)("section",{"aria-labelledby":"network-built-in","data-testid":"network-built-in",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-built-in",className:"text-body font-semibold",children:"Built-in rules"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The fleet’s own rules, beside yours and the declared ones. They hold before any rule below."}),m,void 0===i?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t turn the viewer reading",description:i})]})}var m=e.i(768877),f=e.i(422768),x=e.i(937338),g=e.i(695960);let y=[{side:"from",label:"From ships with"},{side:"to",label:"To ships with"}];function b({declared:e,error:a,onRetry:r,context:s}){let i;return i=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read the declared rules",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"list",rows:2,label:"Loading the declared rules"}):0===e.length?(0,t.jsx)(n.f,{variant:"section",title:"Nothing declares rules."}):(0,t.jsx)("ul",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":"network-declared-plugin",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h3",{className:"text-meta font-medium","data-testid":"network-declared-by",children:["Declared by ",e.declaredBy]}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:e.rules.map(e=>(0,t.jsx)("li",{"data-testid":"network-declared-rule",className:"flex flex-col gap-2 rounded-md border border-border p-3 sm:flex-row sm:items-start sm:gap-3",children:y.map(({side:a,label:r})=>(0,t.jsxs)("div",{className:"flex min-w-0 grow basis-0 items-start gap-3",children:["to"===a?(0,t.jsx)("span",{className:"mt-6 shrink-0 text-meta text-muted-foreground","data-testid":"network-declared-rule-verb",children:x.N[e.verb]}):null,"to"===a?(0,t.jsx)(m.f,{"aria-hidden":!0,className:"mt-6 hidden size-(--size-icon) shrink-0 text-muted-foreground sm:block"}):null,(0,t.jsx)(v,{label:r,terms:e[a],context:s,testId:`network-declared-rule-${a}`})]},a))},JSON.stringify(e)))})]},e.declarerId))}),(0,t.jsxs)("section",{"aria-labelledby":"network-declared","data-testid":"network-declared",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-declared",className:"text-body font-semibold",children:"Declared by plugins and the installation"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Rules plugins and the installation need on the labels they own. The networking plugin adds them to your rules; while every ship may message every ship, they change nothing. Only their declarer changes them, and switching a plugin off withdraws its rules."}),i]})}function v({label:e,terms:a,context:r,testId:i}){let{chips:n,unknown:l}=(0,x.$)(a,r);return(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":i,children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.length+l.length===0?(0,t.jsx)("span",{className:"text-body",children:"Every ship"}):null,n.map((e,a)=>(0,t.jsxs)(s.Fragment,{children:[0===a?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(g.f,{chip:e,testId:`${i}-value`,..."string"==typeof e.term?{}:{meaning:x.q[e.term.value]}})]},(0,x.S)(e.term))),l.map(e=>(0,t.jsxs)("span",{"data-testid":`${i}-unknown`,title:`${(0,x.S)(e)}: no longer in this fleet`,className:"inline-flex h-5.5 items-center gap-1 rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(f.f,{"aria-hidden":!0}),"A removed label"]},(0,x.S)(e)))]})]})}var j=e.i(847211),w=e.i(689664),k=e.i(456420);let N={name:"crosshair",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]};N.node;let $=(0,k.f)(N);var I=e.i(566595),C=e.i(681924),S=e.i(812437);function R(e){return e.send.map(e=>e.shipId)}let O=-Math.PI/2,A=2*Math.PI;function D(e){return e.filter(e=>"retired"!==e.status&&"viewer"!==e.kind).map(e=>({id:e.id,name:e.name,isOperator:"operator"===e.kind})).sort((e,t)=>Number(t.isOperator)-Number(e.isOperator)||e.name.localeCompare(t.name))}function T(e){return Math.round(100*e)/100}var M=e.i(133173),z=e.i(60592),F=e.i(165160);let L=["applied","draft"],B={picked:"picked",reached:"may be messaged",unreached:"out of reach"};function E({ships:e,search:a,sailingShipCount:r,pickedShipId:s,reachableShipIds:i,reachError:n,onPick:d,onRetry:o,against:c="applied",onAgainstChange:h}){var u;let p=(u=void 0===s?void 0:{pickedShipId:s,reachableShipIds:void 0===n?i:void 0},e.map((t,a)=>{var r,s;let i=O+A*a/e.length,n=1===e.length;return{ship:t,x:n?50:T(50+38*Math.cos(i)),y:n?50:T(50+38*Math.sin(i)),mark:(r=t.id,void 0===(s=u)?"none":r===s.pickedShipId?"picked":void 0===s.reachableShipIds?"none":s.reachableShipIds.includes(r)?"reached":"unreached")}})),m=p.find(e=>"picked"===e.mark),f=p.filter(e=>"reached"===e.mark);return(0,t.jsxs)("section",{"aria-labelledby":"network-reach","data-testid":"network-reach",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-reach",className:"text-body font-semibold",children:"Reach"}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["draft"===c?"The fleet as the draft would leave it once applied: pick a ship to see which ships the draft lets it message.":"The fleet as it stands now: pick a ship to see which ships the rules let it message."," ","Argo reaches every ship, and every ship reaches argo."]}),void 0===h?null:(0,t.jsx)(z.i,{value:c,onValueChange:e=>{let t=L.find(t=>t===e);void 0!==t&&h(t)},children:(0,t.jsxs)(z.U,{"aria-label":"Explain reach against",children:[(0,t.jsx)(z.k,{value:"applied","data-testid":"network-reach-applied",children:"Applied rules"}),(0,t.jsx)(z.k,{value:"draft","data-testid":"network-reach-draft",children:"Draft"})]})}),void 0===a?null:(0,t.jsx)(M.f,{options:a.ships.map(e=>({value:e.id,label:e.name})),value:null,onValueChange:e=>{let t=a.ships.find(t=>t.id===e);void 0!==t&&d(t.id)},toQuery:F.I,onQueryChange:a.onQueryChange,groupLabel:"Ships",emptyText:e=>`No ship matches "${e}". Retired ships are not listed.`,leadingIcon:(0,t.jsx)(I.f,{}),placeholder:"Find a ship to pick","aria-label":"Find a ship to pick","data-testid":"network-reach-search"}),(0,t.jsxs)("div",{className:"relative flex flex-wrap gap-2 md:mx-auto md:block md:aspect-square md:w-full md:max-w-xl","data-testid":"network-reach-graph",children:[void 0===m?null:(0,t.jsx)("svg",{"aria-hidden":!0,viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"pointer-events-none absolute inset-0 hidden size-full md:block",children:f.map(e=>(0,t.jsx)("line",{x1:m.x,y1:m.y,x2:e.x,y2:e.y,vectorEffect:"non-scaling-stroke",className:"stroke-muted-foreground",strokeWidth:1.5},e.ship.id))}),p.map(e=>(0,t.jsx)(P,{node:e,onPick:()=>{d("picked"===e.mark?void 0:e.ship.id)}},e.ship.id))]}),void 0===n?(0,t.jsx)("p",{className:"text-body",role:"status","data-testid":"network-reach-summary",children:function(e,t=e.length){let a=e.find(e=>"picked"===e.mark);if(void 0===a)return"Pick a ship to see which ships it may message.";let r=Math.max(t,e.length)-1,s=e.filter(e=>"reached"===e.mark).map(e=>e.ship.name);return e.every(e=>"picked"===e.mark||"none"===e.mark)?0===r?`${a.ship.name} is the only ship of the fleet.`:`Finding the ships ${a.ship.name} may message…`:s.length===r?`${a.ship.name} may message every other ship (${String(r)}).`:0===s.length?`${a.ship.name} may message no other ship.`:`${a.ship.name} may message ${String(s.length)} of ${String(r)} ships: ${s.join(", ")}.`}(p,r)}):(0,t.jsx)(l.f,{title:"Couldn’t explain this ship’s reach",description:n,onRetry:o})]})}function P({node:e,onPick:a}){let{ship:r,mark:s}=e;return(0,t.jsx)(C.f,{size:"sm",variant:"secondary","aria-pressed":"picked"===s,"aria-label":"none"===s?r.name:`${r.name}, ${B[s]}`,icon:function(e){switch(e){case"picked":return(0,t.jsx)($,{"aria-hidden":!0});case"reached":return(0,t.jsx)(w.f,{"aria-hidden":!0});case"unreached":return(0,t.jsx)(j.f,{"aria-hidden":!0});case"none":return}}(s),"data-testid":"network-reach-ship","data-mark":s,style:{left:`${String(e.x)}%`,top:`${String(e.y)}%`},className:(0,S.f)("md:absolute md:-translate-x-1/2 md:-translate-y-1/2","picked"===s&&"bg-accent ring-2 ring-ring","unreached"===s&&"opacity-45"),onClick:a,children:r.name})}var V=e.i(424010),q=e.i(348184);let K={apply:{title:"Apply the draft?",description:"Every send, read and manage is checked against the draft from now on, and the rules before it are gone.",action:"Apply draft"},discard:{title:"Discard the draft?",description:"The draft is gone; the applied rules stay as they are.",action:"Discard draft"}};function Q({draft:e,appliedVersion:a,isApplying:r,applyError:i,onApply:n,isDiscarding:d,discardError:o,onDiscard:c}){let[h,u]=(0,s.useState)(null),p=r||d;return(0,t.jsxs)("section",{"aria-labelledby":"network-rules-apply","data-testid":"network-rules-apply",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-rules-apply",className:"text-body font-semibold",children:"Apply"}),null===e?(0,t.jsx)("p",{className:"text-meta text-muted-foreground","data-testid":"network-rules-apply-state",children:"No draft: the applied rules are the ones above. Save a draft to apply it."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-body","data-testid":"network-rules-apply-state",children:["A draft is saved. Every send, read and manage is checked against the applied rules, at version ",a,", until it is applied."]}),e.savedAgainstVersion===a?null:(0,t.jsxs)("p",{className:"text-meta text-muted-foreground","data-testid":"network-rules-apply-moved",children:["The settings moved from version ",e.savedAgainstVersion," since the draft was saved."]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(C.f,{variant:"primary",isLoading:r,disabled:d,"data-testid":"network-rules-apply-open",onClick:()=>{u("apply")},children:"Apply draft"}),(0,t.jsx)(C.f,{variant:"ghost",isLoading:d,disabled:r,"data-testid":"network-rules-discard-open",onClick:()=>{u("discard")},children:"Discard draft"})]})]}),void 0===i?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t apply the draft",description:i}),void 0===o?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t discard the draft",description:o}),(0,t.jsx)(V.m,{open:null!==h,onOpenChange:e=>{e||p||u(null)},children:null===h?null:(0,t.jsxs)(V.B,{"data-testid":`network-rules-${h}-dialog`,className:q.f.phoneSheet,children:[(0,t.jsxs)(V.O,{children:[(0,t.jsx)(V.g,{children:K[h].title}),(0,t.jsx)(V.I,{children:K[h].description})]}),(0,t.jsxs)(V._,{children:[(0,t.jsx)(V.q,{render:(0,t.jsx)(C.f,{disabled:p}),children:"Cancel"}),(0,t.jsx)(C.f,{variant:"apply"===h?"primary":"destructive",isLoading:p,"data-testid":`network-rules-${h}-confirm`,onClick:()=>{u(null),"apply"===h?n():c()},children:K[h].action})]})]})})]})}var U=e.i(711514);let _={argo:"argo",owner:"Owner",answer:"Answer",pluginRead:"Connected plugins read",meeting:"Meeting",viewerRead:"Viewer reads",installation:"Installation manages",open:"Open"};function J(e){switch(e.rule){case"argo":return{key:e.rule,name:_[e.rule],meaning:"argo sends to, reads and manages every ship, and every ship reaches argo.",isOn:e.isOn,turnedBy:"never"};case"owner":return{key:e.rule,name:_[e.rule],meaning:"A ship’s owner sends to, reads and manages the ships it owns.",isOn:e.isOn,turnedBy:"never"};case"answer":return{key:e.rule,name:_[e.rule],meaning:"A ship may always answer the sender of a message it received.",isOn:e.isOn,turnedBy:"never"};case"pluginRead":return{key:e.rule,name:_[e.rule],meaning:"A plugin argo connected reads every ship, whatever the rules.",isOn:e.isOn,turnedBy:"never"};case"meeting":return{key:e.rule,name:_[e.rule],meaning:"The participants of a meeting reach each other in it, whatever the rules: its owner reached each when it joined.",isOn:e.isOn,turnedBy:"never"};case"viewerRead":return{key:e.rule,name:_[e.rule],meaning:"The viewer reads every ship.",isOn:e.isOn,turnedBy:"argo"};case"installation":return{key:e.rule,name:_[e.rule],meaning:"The installation manages person ships and the ships they own, so a leaver is always released.",isOn:e.isOn,turnedBy:"never"};case"open":return{key:e.rule,name:_[e.rule],meaning:"Every ship may send to, read and manage every ship.",isOn:e.isOn,turnedBy:"rules"}}}function W({changes:e,error:a,onRetry:r}){let s;return s=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read what the draft changes",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"detail",rows:3,label:"Loading what the draft changes"}):e.every(({gained:e,lost:t})=>0===e.length&&0===t.length)?(0,t.jsx)("p",{className:"text-meta text-muted-foreground","data-testid":"network-draft-changes-none",children:"The draft changes no reach."}):e.filter(({gained:e,lost:t})=>e.length+t.length>0).map(({verb:e,gained:a,lost:r})=>(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"network-draft-changes-verb",children:[(0,t.jsx)("h3",{className:"text-meta font-semibold",children:x.N[e]}),(0,t.jsx)(G,{title:"Gains",rows:a,testId:"network-draft-gained"}),(0,t.jsx)(G,{title:"Loses",rows:r,testId:"network-draft-lost"})]},e)),(0,t.jsxs)("section",{"aria-labelledby":"network-draft-changes","data-testid":"network-draft-changes",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-draft-changes",className:"text-body font-semibold",children:"What the draft changes"}),s]})}function G({title:e,rows:a,testId:r}){return 0===a.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[e," ",a.length," ",1===a.length?"pair":"pairs"]}),(0,t.jsx)("ul",{className:"flex flex-col gap-1",children:a.map(e=>(0,t.jsxs)("li",{"data-testid":r,className:"flex flex-wrap items-center gap-x-2 text-body",children:[(0,t.jsx)("span",{children:e.from}),(0,t.jsx)(m.f,{"aria-label":"to",className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:e.to}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.rule})]},e.key))})]})}var H=e.i(77071),X=e.i(759659),Y=e.i(280581),Z=e.i(946033),ee=e.i(765649),et=e.i(263676),ea=e.i(770703),er=e.i(522016),es=e.i(406734);let ei=(0,ea.default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});function en({label:e,picked:a,owners:r,ownerChoices:i,unknown:n,groups:l,max:d,isDisabled:o,problem:c,onAdd:h,onRemove:u,testId:p,popoverTestId:m}){let[y,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),w=a.length+r.length+n.length,k=new Set(r.map(e=>(0,x.S)(e.term))),N=[...["*","#"].map(e=>({term:{owner:e},text:x.J[e]})),...i.map(e=>({term:{owner:e.shipId},text:e.name}))];return(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":p,children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===w?(0,t.jsx)("span",{className:"text-body",children:"Every ship"}):null,a.map((e,a)=>(0,t.jsxs)(s.Fragment,{children:[0===a?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(g.f,{chip:e,testId:`${p}-value`,..."string"==typeof e.term?{}:{meaning:x.q[e.term.value]},...o?{}:{onRemove:()=>{u(e.term)}}})]},(0,x.S)(e.term))),r.map((e,r)=>(0,t.jsxs)(s.Fragment,{children:[0===r&&0===a.length?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(el,{owner:e,testId:`${p}-owner`,...!0===o?{}:{onRemove:()=>{u(e.term)}}})]},(0,x.S)(e.term))),n.map(e=>(0,t.jsxs)("span",{"data-testid":`${p}-unknown`,title:`${(0,x.S)(e)}: no longer in this fleet`,className:"inline-flex h-5.5 items-center gap-1 rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(f.f,{"aria-hidden":!0}),"string"!=typeof e&&"owner"in e?"A removed owner":"A removed label",!0===o?null:(0,t.jsx)("button",{type:"button","aria-label":"string"!=typeof e&&"owner"in e?"Remove the removed owner":"Remove the removed label",onClick:()=>{u(e)},className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(et.X,{"aria-hidden":!0})})]},(0,x.S)(e))),w>=d?null:(0,t.jsxs)(es.V,{open:y,onOpenChange:b,children:[(0,t.jsx)(es.J,{render:(0,t.jsx)(C.f,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(H.f,{}),disabled:o,"data-testid":`${p}-add`}),children:"Add label"}),(0,t.jsxs)(es.T,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":m,children:[(0,t.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:e}),(0,t.jsx)(ei,{groups:l,pickedValueIds:a.flatMap(e=>"string"==typeof e.term?[e.term]:[]),onPick:e=>{b(!1),h(e)},terms:{picked:a.flatMap(e=>"string"==typeof e.term?[]:[e.term]),onPick:e=>{b(!1),h(e)}}}),(0,t.jsxs)("p",{className:"mt-2 flex items-center justify-between gap-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:["All must hold. * is any value, # the same as the other side.",(0,t.jsx)(er.default,{href:"/labels",className:"font-medium text-foreground hover:underline",children:"Manage labels"})]})]})]}),w>=d?null:(0,t.jsxs)(es.V,{open:v,onOpenChange:j,children:[(0,t.jsx)(es.J,{render:(0,t.jsx)(C.f,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(H.f,{}),disabled:o,"data-testid":`${p}-owner-add`}),children:"Add owner"}),(0,t.jsxs)(es.T,{align:"start",sideOffset:6,className:"w-72 p-2","data-testid":`${m}-owner`,children:[(0,t.jsxs)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:[e," the owner"]}),(0,t.jsx)("ul",{className:"flex flex-col",children:N.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",disabled:k.has((0,x.S)(e.term)),"data-testid":`${p}-owner-option`,onClick:()=>{j(!1),h(e.term)},className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-body hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:text-muted-foreground disabled:hover:bg-transparent",children:[(0,t.jsx)(ee.f,{"aria-hidden":!0,className:"size-(--size-icon) shrink-0 text-muted-foreground"}),e.text]})},(0,x.S)(e.term)))}),(0,t.jsx)("p",{className:"mt-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:"An owner is argo or a person’s ship. # is the same owner as the other side."})]})]})]}),void 0===c?null:(0,t.jsx)("p",{role:"status",className:"text-meta text-tone-attention-fg","data-testid":`${p}-problem`,children:c}),0===n.length?null:(0,t.jsx)("p",{role:"alert",className:"text-meta text-tone-attention-fg",children:"A label or owner here was removed from the fleet: this side matches no ship until you remove it."})]})}function el({owner:e,onRemove:a,testId:r}){let{owner:s}=e.term,i="*"===s||"#"===s?`${e.text}. ${x.J[s]}`:`${e.text}: ships it owns`;return(0,t.jsxs)("span",{role:"group","aria-label":i,title:i,"data-testid":r,className:"inline-flex h-5.5 max-w-full min-w-0 shrink-0 items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[(0,t.jsx)(ee.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"owner="}),(0,t.jsx)("span",{className:"font-medium",children:e.text.slice(6)})]}),void 0===a?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${e.text}`,onClick:a,className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(et.X,{"aria-hidden":!0})})]})}let ed=[{side:"from",label:"From ships with"},{side:"to",label:"To ships with"}],eo=()=>crypto.randomUUID();function ec({rules:e,context:a,limits:r,isSaving:i,saveError:n,savedNote:d,onSave:o}){let[c,h]=(0,s.useState)(()=>(0,x.j)(e,eo)),u=(0,Y.H)(a),p=(0,x.w)(a),f=(0,x.C)(c,e);return(0,t.jsxs)("section",{"aria-labelledby":"network-rules","data-testid":"network-rules",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-rules",className:"text-body font-semibold",children:"Rules"}),"all-to-all"===c.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-body","data-testid":"network-rules-state",children:"No rules: every ship may send to, read and manage every ship."}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"With rules, a ship may send to, read or manage another only when a rule of that verb or a built-in rule allows it."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(C.f,{variant:f?"secondary":"primary",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),disabled:i,"data-testid":"network-rules-on",onClick:()=>{h((0,x.i)(c,!0))},children:"Set rules"}),f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.f,{variant:"primary",isLoading:i,"data-testid":"network-rules-save",onClick:()=>{o(null)},children:"Save draft"}),(0,t.jsx)(C.f,{disabled:i,"data-testid":"network-rules-discard",onClick:()=>{h((0,x.j)(e,eo))},children:"Discard changes"})]}):null]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-body","data-testid":"network-rules-state",children:0===c.rules.length?"No rule allows anything yet: once saved, only the built-in rules hold.":"A ship may send to, read or manage another only when a rule of that verb or a built-in rule allows it."}),0===c.rules.length?null:(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:c.rules.map((e,s)=>(0,t.jsxs)("li",{"data-testid":"network-rule",className:"flex flex-col gap-2 rounded-md border border-border p-3 sm:flex-row sm:items-start sm:gap-3",children:[ed.map(({side:n,label:l})=>{let d,o=(0,x.$)(e[n],a);return(0,t.jsxs)("div",{className:"flex min-w-0 grow basis-0 items-start gap-3",children:["to"===n?(0,t.jsxs)("div",{className:"flex shrink-0 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Verb"}),(0,t.jsxs)(Z.d,{items:x.N,value:e.verb,disabled:i,onValueChange:t=>{U.h.some(e=>e===t)&&h((0,x.G)(c,{rule:e.key,verb:t}))},children:[(0,t.jsx)(Z.P,{"aria-label":`Verb of rule ${String(s+1)}`,"data-testid":"network-rule-verb",size:"sm",children:(0,t.jsx)(Z.U,{})}),(0,t.jsx)(Z.r,{children:U.h.map(e=>(0,t.jsx)(Z.T,{value:e,children:x.N[e]},e))})]})]}):null,"to"===n?(0,t.jsx)(m.f,{"aria-hidden":!0,className:"mt-6 hidden size-(--size-icon) shrink-0 text-muted-foreground sm:block"}):null,(0,t.jsx)(en,{label:l,picked:o.chips,owners:o.owners,ownerChoices:p,unknown:o.unknown,groups:u,max:r.selectorMax,isDisabled:i,...void 0===(d=(0,x.Q)(e,{side:n,context:a}))?{}:{problem:d},testId:`network-rule-${n}`,popoverTestId:"network-rule-popover",onAdd:t=>{h((0,x.I)(c,{rule:e.key,side:n,term:t,limits:r}))},onRemove:t=>{h((0,x.e)(c,{rule:e.key,side:n,term:t}))}})]},n)}),(0,t.jsx)(C.f,{variant:"ghost",size:"xs",icon:(0,t.jsx)(X.f,{"aria-hidden":!0}),disabled:i,"aria-label":`Remove rule ${String(s+1)}`,"data-testid":"network-rule-remove",onClick:()=>{h((0,x.K)(c,e.key))}})]},e.key))}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c.rules.length>=r.rulesMax?null:(0,t.jsx)(C.f,{size:"sm",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),disabled:i,"data-testid":"network-rules-add",onClick:()=>{h((0,x.V)(c,{newKey:eo,limits:r}))},children:"Add rule"}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground tabular-nums","data-testid":"network-rules-count",children:[c.rules.length," of ",r.rulesMax," rules"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-border pt-3",children:[(0,t.jsx)(C.f,{variant:"primary",isLoading:i,disabled:!f||(0,x.p)(c),"data-testid":"network-rules-save",onClick:()=>{o((0,x.f)(c))},children:"Save draft"}),f?(0,t.jsx)(C.f,{disabled:i,"data-testid":"network-rules-discard",onClick:()=>{h((0,x.j)(e,eo))},children:"Discard changes"}):null,(0,t.jsx)(C.f,{variant:"ghost",className:"ml-auto",disabled:i,"data-testid":"network-rules-off",onClick:()=>{h((0,x.i)(c,!1))},children:"Remove all rules"})]})]}),void 0===n?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t save the rules",description:n}),void 0===d||f?null:(0,t.jsx)("p",{role:"status",className:"text-meta text-muted-foreground","data-testid":"network-rules-note",children:d})]})}var eh=e.i(285595);let eu={name:"file-up",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};eu.node;let ep=(0,k.f)(eu);var em=e.i(791727),ef=e.i(443988),ex=e.i(923060),eg=e.i(849635),ey=e.i(890135);function eb(e){return"label"in e?`${e.label}=${e.value}`:`owner=${e.owner}`}function ev(e){return"ship"===e.kind?`ship:${e.name}`:`${e.kind}:${e.key}`}var ej=e.i(152678);function ew(e){switch(e.kind){case"definer":return`${e.key} is defined by ${e.fleetDefiner} here, by ${e.fileDefiner} in the file`;case"values":return`${e.key} has ${e.fleetValues.join(", ")} here; the file gives ${e.fileValues.join(", ")}`;case"ship":return`No active ship is named ${e.name}`}}function ek({difference:e,choice:a,ships:r,onShipQueryChange:s,isDisabled:i,onChange:n}){let l=ev(e),d=`network-import-difference-${l.replace(":","-")}`;return(0,t.jsxs)("fieldset",{className:"flex flex-col gap-2 rounded-lg border border-border bg-card p-3","data-testid":"network-import-difference",children:[(0,t.jsx)("legend",{className:"sr-only",children:ew(e)}),(0,t.jsx)("p",{className:"text-body font-medium","aria-hidden":!0,children:ew(e)}),(0,t.jsx)(ej.x,{value:a?.way,disabled:i,onValueChange:t=>{n({difference:e,way:t})},children:e.ways.map(t=>({way:t,text:function(e,t){switch(e.kind){case"definer":return"useExisting"===t?`Use the label ${e.key} as it is, defined by ${e.fleetDefiner}`:`Drop the rules on ${e.key}`;case"values":return"useExisting"===t?`Use the label ${e.key} as it is: it has every value the rules name`:`Drop the rules naming ${e.missingValues.map(t=>`${e.key}=${t}`).join(", ")}`;case"ship":return"pickShip"===t?`Pick an active ship for ${e.name}`:`Drop the rules naming owner=${e.name}`}}(e,t)})).map(({way:e,text:a})=>(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ej.a,{id:`${d}-${e}`,value:e,className:"mt-0.5","data-testid":`network-import-way-${e}`}),(0,t.jsx)("label",{htmlFor:`${d}-${e}`,className:"min-w-0 grow cursor-pointer text-body",children:a})]},e))}),a?.way==="pickShip"?(0,t.jsx)(M.f,{options:r.map(e=>({value:e.id,label:e.name})),value:a.shipId??null,onValueChange:t=>{let a=r.find(e=>e.id===t);n({difference:e,way:"pickShip",...void 0===a?{}:{shipId:a.id}})},onQueryChange:s,groupLabel:"Active ships",placeholder:"Type a ship name","aria-label":`The ship for ${"ship"===e.kind?e.name:""}`,"data-testid":"network-import-pick-ship"}):null]})}let eN=["Attach or paste","Check","Overview","Import"];function e$({current:e}){return(0,t.jsx)("ol",{className:"flex flex-wrap gap-x-3 gap-y-1 text-meta","aria-label":"Import steps","data-testid":"network-import-steps",children:eN.map((a,r)=>(0,t.jsxs)("li",{"aria-current":r===e?"step":void 0,className:r===e?"font-semibold text-foreground":"text-muted-foreground",children:[r+1,". ",a]},a))})}function eI(e){let a,r,{checked:i,isChecking:n,checkError:d,onCheck:o,onFileChange:c,ships:h,onShipQueryChange:u,isImporting:p,importError:m,onImport:f}=e,[x,g]=(0,s.useState)(""),[y,b]=(0,s.useState)([]),v=h.find(e=>e.isOperator),[j,w]=(0,s.useState)(v?.id),[k,N]=(0,s.useState)(!1),$=n||p,I=e=>{g(e),b([]),N(!1),c()};if(void 0===i)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e$,{current:+!!n}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(em.f,{htmlFor:"network-import-attach",children:"Attach the file"}),(0,t.jsx)("input",{id:"network-import-attach",type:"file",accept:"application/json,.json",disabled:$,"data-testid":"network-import-attach",className:"text-body file:mr-3 file:rounded-md file:border file:border-border file:bg-card file:px-3 file:py-1.5",onChange:e=>{let t=e.target.files?.[0];void 0!==t&&t.text().then(I)}})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(em.f,{htmlFor:"network-import-paste",children:"Or paste it"}),(0,t.jsx)(ef.f,{id:"network-import-paste",isMono:!0,rows:8,value:x,disabled:$,placeholder:'{ "format": "aeolus.network-rules", ... }',"data-testid":"network-import-paste",onChange:e=>{I(e.target.value)}})]}),void 0===d?null:(0,t.jsx)(l.f,{title:"The file doesn’t check",description:`${d}. Nothing changed: fix the file and check it again.`}),(0,t.jsxs)(ex.DialogFooter,{children:[(0,t.jsx)(ex.DialogClose,{render:(0,t.jsx)(C.f,{type:"button",disabled:$}),children:"Cancel"}),(0,t.jsx)(C.f,{variant:"primary",isLoading:n,disabled:""===x.trim()||$,"data-testid":"network-import-check",onClick:()=>{o(x)},children:n?"Checking…":"Check file"})]})]});let{file:S,newLabels:R,differences:O}=i,A=S.rules??[],D=O.every(e=>{let t=y.find(t=>ev(t.difference)===ev(e));return void 0!==t&&("pickShip"!==t.way||void 0!==t.shipId)}),T=h.find(e=>e.id===j),z=D&&(0===R.length||void 0!==T)&&!$,F=y.flatMap(e=>(function(e){let{difference:t,way:a}=e;return"ship"===t.kind?"pickShip"===a?void 0===e.shipId?void 0:{kind:"ship",name:t.name,way:a,shipId:e.shipId}:{kind:"ship",name:t.name,way:"dropRules"}:{kind:t.kind,key:t.key,way:"useExisting"===a?"useExisting":"dropRules"}})(e)??[]);return k?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e$,{current:3}),(0,t.jsx)(ex.DialogHeader,{children:(0,t.jsx)(ex.DialogTitle,{children:"Import into the draft?"})}),(0,t.jsxs)("ul",{className:"flex list-disc flex-col gap-1 pl-5 text-body","data-testid":"network-import-consequences",children:[(0,t.jsx)("li",{children:null===S.rules?"The draft becomes all-to-all, every ship reaching every ship.":y.some(e=>"dropRules"===e.way)?`The draft is replaced by the file’s ${String(A.length)} rules, less the ones you chose to drop.`:`The draft is replaced by the file’s ${String(A.length)} rules.`}),0===R.length?null:(0,t.jsxs)("li",{children:[R.join(", ")," ",1===R.length?"is":"are"," defined for ",T?.name??"argo","."]}),(0,t.jsx)("li",{children:"Nothing is in force until you apply the draft."})]}),void 0===m?null:(0,t.jsx)(l.f,{variant:"section",title:"Couldn’t import the file",description:`${m}. Nothing was written.`,onRetry:()=>{N(!1),o(x)}}),(0,t.jsxs)(ex.DialogFooter,{children:[(0,t.jsx)(C.f,{type:"button",disabled:$,onClick:()=>{N(!1)},children:"Back"}),(0,t.jsx)(C.f,{variant:"primary",isLoading:p,disabled:$,"data-testid":"network-import-confirm",onClick:()=>{f({file:x,resolutions:F,...0===R.length||void 0===T||T.isOperator?{}:{definerShipId:T.id}})},children:p?"Importing…":"Import into the draft"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e$,{current:2}),(0,t.jsxs)("p",{className:"flex items-start gap-2 text-body",role:"status","data-testid":"network-import-checked",children:[(0,t.jsx)(eh.f,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-tone-ok-fg"}),(0,t.jsx)("span",{children:(a=null===S.rules?"all-to-all, no rules":(0,ey.v)(S.rules.length,{one:"rule",many:"rules"}),r=(0,ey.v)(S.labels.length,{one:"label",many:"labels"}),`The file checks: ${a} and ${r}, from ${S.fleet.name} at rules version ${String(S.rulesVersion)}, exported ${(0,eg.B)(new Date(S.exportedAt))}.`)})]}),0===O.length?null:(0,t.jsxs)("section",{"aria-labelledby":"network-import-differences",className:"flex flex-col gap-2","data-testid":"network-import-differences",children:[(0,t.jsx)("h3",{id:"network-import-differences",className:"text-body font-semibold",children:1===O.length?"1 difference to resolve":`${String(O.length)} differences to resolve`}),O.map(e=>{let a=ev(e);return(0,t.jsx)(ek,{difference:e,choice:y.find(e=>ev(e.difference)===a),ships:h,onShipQueryChange:u,isDisabled:$,onChange:e=>{b([...y.filter(e=>ev(e.difference)!==a),e])}},a)})]}),0===R.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)(em.f,{htmlFor:"network-import-definer",children:["Define ",R.join(", ")," for"]}),(0,t.jsx)(M.f,{id:"network-import-definer",options:h.map(e=>({value:e.id,label:e.name})),value:j??null,onValueChange:e=>{w(h.find(t=>t.id===e)?.id)},onQueryChange:u,groupLabel:"Active ships",placeholder:"Type a ship name","data-testid":"network-import-definer"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"argo never retires, so its labels never go. Another ship must be within your manage reach."})]}),(0,t.jsxs)("section",{"aria-labelledby":"network-import-rules",className:"flex flex-col gap-1.5",children:[(0,t.jsx)("h3",{id:"network-import-rules",className:"text-body font-semibold",children:"Rules in the file"}),0===A.length?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:null===S.rules?"None: all-to-all.":"None: only the built-in and declared rules."}):(0,t.jsx)("ol",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto font-mono text-code","data-testid":"network-import-rules",children:A.map((e,t)=>{let a,{verb:r,from:s,to:i}=(a=e=>0===e.length?["every ship"]:e.map(eb),{verb:e.verb,from:a(e.from),to:a(e.to)});return{place:t+1,line:`${r}: ${s.join(" ")} → ${i.join(" ")}`}}).map(({place:e,line:a})=>(0,t.jsx)("li",{children:a},e))})]}),(0,t.jsxs)(ex.DialogFooter,{className:"items-center",children:[(0,t.jsx)("span",{className:"mr-auto text-meta text-muted-foreground",children:D?null:"Resolve every difference to import."}),(0,t.jsx)(C.f,{type:"button",disabled:$,onClick:()=>{I(x)},children:"Back"}),(0,t.jsx)(C.f,{variant:"primary",disabled:!z,"data-testid":"network-import-open-confirm",onClick:()=>{N(!0)},children:"Import…"})]})]})}function eC(e){let{isOpen:a,onOpenChange:r,isChecking:s,isImporting:i}=e;return(0,t.jsx)(ex.Dialog,{open:a,onOpenChange:e=>{s||i||r(e)},children:(0,t.jsxs)(ex.DialogContent,{size:"md","data-testid":"network-import-dialog",className:q.f.phoneFullScreen,children:[(0,t.jsxs)(ex.DialogHeader,{children:[(0,t.jsxs)(ex.DialogTitle,{children:[(0,t.jsx)(ep,{"aria-hidden":!0,className:"mr-2 inline size-(--size-icon-sm)"}),"Import network rules"]}),(0,t.jsx)(ex.DialogDescription,{children:"Rules exported from this fleet or another land in the draft; nothing is in force until you apply it."})]}),a?(0,t.jsx)(eI,{...e}):null]})})}let eS={name:"file-down",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]};eS.node;let eR=(0,k.f)(eS);function eO({isExporting:e,exportError:a,onExport:r,exported:s,canImport:i,onImport:n}){return(0,t.jsxs)("section",{"aria-labelledby":"network-rules-file","data-testid":"network-rules-file",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-rules-file",className:"text-body font-semibold",children:"Export and import"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Export writes the applied rules and the labels they use as one file, by name. Import brings a file from this fleet or another into the draft."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(C.f,{icon:(0,t.jsx)(eR,{}),isLoading:e,"data-testid":"network-rules-export",onClick:r,children:e?"Exporting…":"Export"}),i?(0,t.jsx)(C.f,{icon:(0,t.jsx)(ep,{}),disabled:e,"data-testid":"network-rules-import",onClick:n,children:"Import…"}):null]}),void 0===s||0===s.leftOut.length?null:(0,t.jsxs)("div",{role:"status","data-testid":"network-rules-left-out",className:"flex flex-col gap-1 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3.5 py-2.5 text-meta text-tone-waiting-fg",children:[(0,t.jsxs)("p",{children:[s.name," leaves out ",1===s.leftOut.length?"1 applied rule":`${String(s.leftOut.length)} applied rules`,", as each matches no ship:"]}),(0,t.jsx)("ul",{className:"list-disc pl-5",children:s.leftOut.map(({rule:e,reason:a})=>(0,t.jsxs)("li",{children:["rule ",e," ",a]},e))})]}),void 0===a?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t export the rules",description:`${a}. Nothing was downloaded.`})]})}function eA(e){switch(e.kind){case"ship":return e.name;case"account":return`Account ${e.accountId}`;case"installation":return"The installation"}}function eD({refusals:e,error:a,onRetry:r,more:s,context:i,now:o}){let c;return c=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read the refusals",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"list",rows:3,label:"Loading the refusals"}):0!==e.length||s?(0,t.jsx)("ol",{className:"flex flex-col gap-2","data-testid":"network-refusals-list",children:e.map(e=>(0,t.jsx)(eT,{refusal:e,context:i,now:o},e.id))}):(0,t.jsx)(n.f,{variant:"section",title:"No send has been refused."}),(0,t.jsxs)("section",{"aria-labelledby":"network-refusals","data-testid":"network-refusals",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)("h2",{id:"network-refusals",className:"text-body font-semibold",children:"Refusals"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The sends the rules refused, newest first, with both ships’ labels as they were then. The sender was told only that its send was refused."}),c,s]})}function eT({refusal:e,context:a,now:r}){let s=new Date(e.at),{recipient:i}=e,n="ship"===i.kind?[i.ship]:i.ships;return(0,t.jsxs)("li",{"data-testid":"network-refusal",className:"flex flex-col gap-2 rounded-md border border-border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5",children:[(0,t.jsx)("p",{className:"text-body font-medium",children:function(e){let{sender:t,recipient:a}=e,r=`${eA(t)} tried to ${"ship"===t.kind?"message":"reach"}`;switch(a.kind){case"ship":return`${r} ${a.ship.name}.`;case"type":return`${r} the type ${a.type}: ${(0,Y.t)(a.ships.map(e=>e.name))}.`}}(e)}),(0,t.jsx)("time",{dateTime:e.at,title:(0,eg.o)(s),className:"text-meta text-muted-foreground tabular-nums",children:(0,eg.W)(s,r)})]}),(0,t.jsxs)("dl",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(eM,{side:"From",ship:{name:eA(e.sender),labels:"installation"===e.sender.kind?[]:e.sender.labels},context:a}),n.map(e=>(0,t.jsx)(eM,{side:"To",ship:e,context:a},e.id))]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:`Refused by network settings version ${String(e.settingsVersion)}.`})]})}function eM({side:e,ship:a,context:r}){let s=(0,Y.h)(a,r);return(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("dt",{className:"text-meta text-muted-foreground",children:[e," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:a.name})]}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1",children:0===s.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"No labels"}):s.map(e=>(0,t.jsx)(g.f,{chip:e,testId:"network-refusal-label"},e.valueId))})]})}var ez=e.i(509892),eF=e.i(787964),eL=e.i(490262),eB=e.i(34512),eE=e.i(905387),eP=e.i(970597),eV=e.i(419413),eq=e.i(266027),eK=e.i(427702),eQ=e.i(442111),eU=e.i(487483),e_=e.i(718423),eJ=e.i(928459),eW=e.i(954616),eG=e.i(912598);function eH(){let e=(0,eK.I)(),t=(0,eG.d)();return async()=>{await Promise.all([t.invalidateQueries({queryKey:e.fleet.networkRules.queryKey()}),t.invalidateQueries({queryKey:e.fleet.networkRulesDraftChanges.queryKey()}),t.invalidateQueries({queryKey:e.fleet.explainReach.pathKey()})])}}var eX=e.i(296676),eY=e.i(619273);function eZ(e,t="applied"){let a=new URLSearchParams([...void 0===e?[]:[["reach",e]],..."draft"===t?[["against","draft"]]:[]]).toString();return""===a?"/network":`/network?${a}`}var e0=e.i(621482),e2=e.i(731877),e1=e.i(298421),e3=e.i(678485);e.s(["NetworkPageFor",0,function({pickedShipId:e,against:o}){var c,h,u,m;let f,x,g,y,v,j,w,k,N,$,I,C,S,O,A,T,M,z,F,L,B,P,V,q,K,G,H=(0,r.useRouter)(),X=(0,eX.f)(),Y=(0,eF.y)(),Z=(0,eJ.t)(),ee=(0,e_.f)(),et=(0,eL.Q)(),ea=et.canEditNetwork,er=(x=(0,eK.I)(),(0,eq.f)(x.fleet.networkRules.queryOptions(void 0,{enabled:ea}))),es=void 0!==er.data&&null!==er.data.draft,ei=es?o:"applied",en=(c=ea&&es,g=(0,eK.I)(),(0,eq.f)(g.fleet.networkRulesDraftChanges.queryOptions(void 0,{enabled:c}))),el=(0,eE.e)(),ed=(y=(0,eK.I)(),v=(0,eq.f)(y.fleet.list.queryOptions({shipKind:["operator","person"],limit:eV.f},{enabled:ea})),v.data?.items.filter(eP.f)),eo=(h=ea?e:void 0,j=(0,eK.I)(),(0,eq.f)({...j.fleet.explainReach.queryOptions(void 0===h?eY.V:{fromShipId:h,against:ei}),select:R})),eh=(w=(0,eK.I)(),(0,e2.d)((0,e0.f)(w.fleet.reachRefusals.infiniteQueryOptions({limit:e2.q},{enabled:ea,getNextPageParam:e2.J})))),eu=(k=(0,eK.I)(),(0,eq.f)(k.fleet.declaredNetworkRules.queryOptions(void 0,{enabled:ea}))),ep=function(e){let t=e.rules.flatMap(e=>[...e.from,...e.to].flatMap(e=>(0,U.b)(e)&&e.owner!==U.C&&e.owner!==U.B?[e.owner]:[])),a=e.declarers.flatMap(e=>"ship"===e.kind?[e.shipId]:[]),{draftChanges:r}=e;return[...new Set([...t,...a,...void 0===r?[]:U.h.flatMap(e=>[...r[e].gained,...r[e].lost]).flatMap(e=>[e.fromShipId,e.toShipId]),...void 0===e.pickedShipId?[]:[e.pickedShipId,...e.reachableShipIds??[]]])]}({rules:[...er.data?.applied.rules??[],...er.data?.draft?.rules??[]],declarers:eu.data?.map(e=>e.declarer)??[],...void 0===en.data?{}:{draftChanges:en.data},...void 0===e?{}:{pickedShipId:e},...void 0===eo.data?{}:{reachableShipIds:eo.data}}),em=(0,eQ.K)(ep),ef=(0,eQ.U)(ep),ex=[...em?.values()??[]],eg=(N=(0,eK.I)(),$=(0,eq.f)(N.fleet.shipCounts.queryOptions()),$.data?.filter(e=>"viewer"!==e.kind).reduce((e,t)=>e+t.active,0)),[ey,eb]=(0,s.useState)(""),ev=(0,eU.f)("",ea)??[],ej=(0,eU.f)(ey,ea)??[],ew=D([...new Map([...ev.slice(0,1),...ej].map(e=>[e.id,e])).values()]),ek=(I=(0,eK.I)(),(0,eq.f)(I.fleet.builtInRules.queryOptions(void 0,{enabled:ea}))),eN=(C=(0,eK.I)(),S=(0,eG.d)(),{setViewerRead:e=>{O.mutate({rule:"viewerRead",isOn:e})},isPending:(O=(0,eW.f)(C.fleet.setBuiltInRule.mutationOptions({onSuccess:()=>S.invalidateQueries({queryKey:C.fleet.builtInRules.queryKey()})}))).isPending,error:O.error?.message}),e$=(A=(0,eK.I)(),T=eH(),(0,eW.f)(A.fleet.saveNetworkRulesDraft.mutationOptions({onSuccess:T}))),eI=(M=(0,eK.I)(),z=(0,eG.d)(),F=eH(),(0,eW.f)(M.fleet.applyNetworkRules.mutationOptions({onSuccess:async()=>{await Promise.all([F(),z.invalidateQueries({queryKey:M.fleet.builtInRules.queryKey()})])}}))),eS=(L=(0,eK.I)(),B=eH(),(0,eW.f)(L.fleet.discardNetworkRulesDraft.mutationOptions({onSuccess:B}))),eR=(P=(0,eK._)(),(0,eW.f)({mutationFn:async()=>{var e;let t,a,r,{file:s,leftOut:i}=await P.fleet.exportNetworkRules.query(),n=(t=s.fleet.name.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-|-$/g,""),`network-rules-${t}-v${String(s.rulesVersion)}.json`);return e=`${JSON.stringify(s,null,2)}
2
- `,a=URL.createObjectURL(new Blob([e],{type:"application/json"})),(r=document.createElement("a")).href=a,r.download=n,r.click(),URL.revokeObjectURL(a),{name:n,leftOut:i}}})),eA=(V=(0,eK.I)(),(0,eW.f)(V.fleet.checkNetworkRulesFile.mutationOptions())),eT=(q=(0,eK.I)(),K=(0,eG.d)(),G=eH(),(0,eW.f)(q.fleet.importNetworkRules.mutationOptions({onSuccess:async()=>{await Promise.all([G(),K.invalidateQueries({queryKey:q.fleet.labels.queryKey()})])}}))),[eM,e5]=(0,s.useState)(!1),e4=()=>{eA.reset(),eT.reset()},{networkRulesMax:e6,shipLabelsMax:e8}=(0,eB.x)();if((0,e3.n)([Z.error,ee.error]),ea)if(er.isError)f=(0,t.jsx)(l.f,{title:"Couldn’t read the network",description:er.error.message,onRetry:()=>{er.refetch()}});else if(void 0===er.data||void 0===el||void 0===ed)f=(0,t.jsx)(d.f,{variant:"detail",rows:4,label:"Loading the network"});else{let a,r,s,n={...el,ships:[...ex,...ed]};f=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p,{rows:void 0===ek.data?void 0:ek.data.map(J),error:ek.error?.message,onRetry:()=>{ek.refetch()},isTurning:eN.isPending,turnError:eN.error,onViewerReadChange:eN.setViewerRead}),(0,t.jsx)(ec,{rules:(er.data.draft??er.data.applied).rules,context:n,limits:{rulesMax:e6,selectorMax:e8},isSaving:e$.isPending,saveError:e$.error?.message,savedNote:void 0===e$.data?void 0:"Draft saved. Nothing changes until it is applied.",onSave:e=>{e$.mutate({rules:e})}},JSON.stringify(er.data.draft??er.data.applied)),null===er.data.draft?null:(0,t.jsx)(W,{changes:void 0===en.data?void 0:(u=en.data,a=new Map(ex.map(e=>[e.id,e.name])),r=e=>e.map(({fromShipId:e,toShipId:t,rule:r})=>({key:`${e}>${t}`,from:a.get(e)??e,to:a.get(t)??t,rule:function(e,t){if("builtIn"in e)return`Built-in: ${_[e.builtIn]}`;if("rule"in e)return`Rule ${String(e.rule+1)}`;let a="installation"===e.declared.kind?"the installation":t.get(e.declared.shipId)??e.declared.shipId;return`Declared by ${a}, rule ${String(e.index+1)}`}(r,a)})).sort((e,t)=>e.from.localeCompare(t.from)||e.to.localeCompare(t.to)),U.h.map(e=>({verb:e,gained:r(u[e].gained),lost:r(u[e].lost)}))),error:en.error?.message,onRetry:()=>{en.refetch()}}),(0,t.jsx)(Q,{draft:er.data.draft,appliedVersion:er.data.applied.version,isApplying:eI.isPending,applyError:eI.error?.message,onApply:()=>{eI.mutate({version:er.data.applied.version})},isDiscarding:eS.isPending,discardError:eS.error?.message,onDiscard:()=>{eS.mutate()}}),(0,t.jsx)(eO,{isExporting:eR.isPending,exportError:eR.error?.message,exported:eR.data,onExport:()=>{eR.mutate(void 0,{onSuccess:({name:e,leftOut:t})=>{(0,i._)({title:"Rules exported",description:0===t.length?`Saved as ${e}.`:`Saved as ${e}, leaving out ${String(t.length)}: see Export and import.`,tone:"success"})}})},canImport:et.canDefineLabels,onImport:()=>{e4(),e5(!0)}}),(0,t.jsx)(eC,{isOpen:eM,onOpenChange:e=>{e5(e),e||e4()},checked:eA.data,isChecking:eA.isPending,checkError:eA.error?.message,onCheck:e=>{eT.reset(),eA.mutate({file:e})},onFileChange:e4,ships:ew,onShipQueryChange:eb,isImporting:eT.isPending,importError:eT.error?.message,onImport:e=>{eT.mutate(e,{onSuccess:({definedLabels:e})=>{e5(!1),e4(),(0,i._)({title:"Imported into the draft",description:`${0===e.length?"":`Defined ${e.join(", ")}. `}Look at what the draft changes, then apply it.`,tone:"success"})}})}}),(0,t.jsx)(b,{declared:void 0===eu.data?void 0:(m=eu.data,s=new Map([...ef??[]].map(([e,t])=>({id:e,name:t})).map(e=>[e.id,e.name])),m.filter(({rules:e})=>e.length>0).map(({declarer:e,rules:t})=>"installation"===e.kind?{declarerId:"installation",declaredBy:"the installation",rules:t}:{declarerId:e.shipId,declaredBy:s.get(e.shipId)??e.shipId,rules:t}).sort((e,t)=>e.declaredBy.localeCompare(t.declaredBy))),error:eu.error?.message,onRetry:()=>{eu.refetch()},context:n}),(0,t.jsx)(E,{ships:D(ex),search:{ships:ew,onQueryChange:eb},...void 0===eg?{}:{sailingShipCount:eg},pickedShipId:e,reachableShipIds:eo.data,reachError:eo.error?.message,onPick:e=>{H.replace(eZ(e,ei),{scroll:!1})},against:ei,...es?{onAgainstChange:t=>{H.replace(eZ(e,t),{scroll:!1})}}:{},onRetry:()=>{eo.refetch()}}),(0,t.jsx)(eD,{refusals:eh.items,error:eh.isFailed?eh.error?.message:void 0,onRetry:eh.retry,more:eh.hasMore?(0,t.jsx)(e1.f,{what:"older refusals",isLoading:eh.isLoadingMore,isFailed:eh.isLoadMoreFailed,onLoad:eh.loadMore,area:"network-refusals"}):null,context:n,now:X})]})}else f=(0,t.jsx)(n.f,{icon:(0,t.jsx)(a.f,{"aria-hidden":!0}),title:"Only a session holding fleet:network sees the network rules"});return(0,t.jsx)(ez.f,{...Y,title:"Network",description:"Who may send to, read or manage whom. The fleet checks the applied rules on every send; a draft changes nothing until it is applied.",live:ee.live,children:f})}],313260)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,313260,e=>{"use strict";var t=e.i(843476),a=e.i(407921),r=e.i(618566),s=e.i(271645),i=e.i(341880),n=e.i(67874),l=e.i(817981),d=e.i(188393),o=e.i(806537),c=e.i(766390),h=e.i(975867);let u={argo:"You turn it on or off.",rules:"Applying rules turns it off; applying none turns it on again."};function p({rows:e,error:a,onRetry:r,isTurning:s,turnError:i,onViewerReadChange:n}){let m;return m=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read the built-in rules",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"list",rows:3,label:"Loading the built-in rules"}):(0,t.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":"network-built-in-rule",className:"flex items-start justify-between gap-3 py-2 first:pt-0 last:pb-0",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-body font-medium","data-testid":"network-built-in-rule-name",children:e.name}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[e.meaning," ","never"===e.turnedBy?null:u[e.turnedBy]]})]}),"argo"===e.turnedBy?(0,t.jsx)(h.f,{checked:e.isOn,disabled:s,"aria-label":`${e.name}: ${e.isOn?"on":"off"}`,"data-testid":"network-built-in-viewer-read",onCheckedChange:e=>{n(e)}}):(0,t.jsx)(c.f,{variant:"outline","data-testid":"network-built-in-rule-state",children:"never"===e.turnedBy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.f,{"aria-hidden":!0}),"Never off"]}):e.isOn?"On":"Off"})]},e.key))}),(0,t.jsxs)("section",{"aria-labelledby":"network-built-in","data-testid":"network-built-in",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-built-in",className:"text-body font-semibold",children:"Built-in rules"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The fleet’s own rules, beside yours and the declared ones. They hold before any rule below."}),m,void 0===i?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t turn the viewer reading",description:i})]})}var m=e.i(768877),f=e.i(422768),x=e.i(937338),g=e.i(695960);let y=[{side:"from",label:"From ships with"},{side:"to",label:"To ships with"}];function b({declared:e,error:a,onRetry:r,context:s}){let i;return i=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read the declared rules",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"list",rows:2,label:"Loading the declared rules"}):0===e.length?(0,t.jsx)(n.f,{variant:"section",title:"Nothing declares rules."}):(0,t.jsx)("ul",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":"network-declared-plugin",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h3",{className:"text-meta font-medium","data-testid":"network-declared-by",children:["Declared by ",e.declaredBy]}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:e.rules.map(e=>(0,t.jsx)("li",{"data-testid":"network-declared-rule",className:"flex flex-col gap-2 rounded-md border border-border p-3 sm:flex-row sm:items-start sm:gap-3",children:y.map(({side:a,label:r})=>(0,t.jsxs)("div",{className:"flex min-w-0 grow basis-0 items-start gap-3",children:["to"===a?(0,t.jsx)("span",{className:"mt-6 shrink-0 text-meta text-muted-foreground","data-testid":"network-declared-rule-verb",children:x.N[e.verb]}):null,"to"===a?(0,t.jsx)(m.f,{"aria-hidden":!0,className:"mt-6 hidden size-(--size-icon) shrink-0 text-muted-foreground sm:block"}):null,(0,t.jsx)(v,{label:r,terms:e[a],context:s,testId:`network-declared-rule-${a}`})]},a))},JSON.stringify(e)))})]},e.declarerId))}),(0,t.jsxs)("section",{"aria-labelledby":"network-declared","data-testid":"network-declared",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-declared",className:"text-body font-semibold",children:"Declared by plugins and the installation"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Rules plugins and the installation need on the labels they own. The networking plugin adds them to your rules; while every ship may message every ship, they change nothing. Only their declarer changes them, and switching a plugin off withdraws its rules."}),i]})}function v({label:e,terms:a,context:r,testId:i}){let{chips:n,unknown:l}=(0,x.$)(a,r);return(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":i,children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.length+l.length===0?(0,t.jsx)("span",{className:"text-body",children:"Every ship"}):null,n.map((e,a)=>(0,t.jsxs)(s.Fragment,{children:[0===a?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(g.f,{chip:e,testId:`${i}-value`,..."string"==typeof e.term?{}:{meaning:x.q[e.term.value]}})]},(0,x.S)(e.term))),l.map(e=>(0,t.jsxs)("span",{"data-testid":`${i}-unknown`,title:`${(0,x.S)(e)}: no longer in this fleet`,className:"inline-flex h-5.5 items-center gap-1 rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(f.f,{"aria-hidden":!0}),"A removed label"]},(0,x.S)(e)))]})]})}var j=e.i(847211),w=e.i(689664),k=e.i(456420);let N={name:"crosshair",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]};N.node;let $=(0,k.f)(N);var I=e.i(566595),C=e.i(681924),S=e.i(812437);function R(e){return e.send.map(e=>e.shipId)}let O=-Math.PI/2,A=2*Math.PI;function D(e){return e.filter(e=>"retired"!==e.status&&"viewer"!==e.kind).map(e=>({id:e.id,name:e.name,isOperator:"operator"===e.kind})).sort((e,t)=>Number(t.isOperator)-Number(e.isOperator)||e.name.localeCompare(t.name))}function T(e){return Math.round(100*e)/100}var M=e.i(133173),z=e.i(60592),F=e.i(165160);let L=["applied","draft"],B={picked:"picked",reached:"may be messaged",unreached:"out of reach"};function E({ships:e,search:a,sailingShipCount:r,pickedShipId:s,reachableShipIds:i,reachError:n,onPick:d,onRetry:o,against:c="applied",onAgainstChange:h}){var u;let p=(u=void 0===s?void 0:{pickedShipId:s,reachableShipIds:void 0===n?i:void 0},e.map((t,a)=>{var r,s;let i=O+A*a/e.length,n=1===e.length;return{ship:t,x:n?50:T(50+38*Math.cos(i)),y:n?50:T(50+38*Math.sin(i)),mark:(r=t.id,void 0===(s=u)?"none":r===s.pickedShipId?"picked":void 0===s.reachableShipIds?"none":s.reachableShipIds.includes(r)?"reached":"unreached")}})),m=p.find(e=>"picked"===e.mark),f=p.filter(e=>"reached"===e.mark);return(0,t.jsxs)("section",{"aria-labelledby":"network-reach","data-testid":"network-reach",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-reach",className:"text-body font-semibold",children:"Reach"}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["draft"===c?"The fleet as the draft would leave it once applied: pick a ship to see which ships the draft lets it message.":"The fleet as it stands now: pick a ship to see which ships the rules let it message."," ","Argo reaches every ship, and every ship reaches argo."]}),void 0===h?null:(0,t.jsx)(z.i,{value:c,onValueChange:e=>{let t=L.find(t=>t===e);void 0!==t&&h(t)},children:(0,t.jsxs)(z.U,{"aria-label":"Explain reach against",children:[(0,t.jsx)(z.k,{value:"applied","data-testid":"network-reach-applied",children:"Applied rules"}),(0,t.jsx)(z.k,{value:"draft","data-testid":"network-reach-draft",children:"Draft"})]})}),void 0===a?null:(0,t.jsx)(M.f,{options:a.ships.map(e=>({value:e.id,label:e.name})),value:null,onValueChange:e=>{let t=a.ships.find(t=>t.id===e);void 0!==t&&d(t.id)},toQuery:F.I,onQueryChange:a.onQueryChange,groupLabel:"Ships",emptyText:e=>`No ship matches "${e}". Retired ships are not listed.`,leadingIcon:(0,t.jsx)(I.f,{}),placeholder:"Find a ship to pick","aria-label":"Find a ship to pick","data-testid":"network-reach-search"}),(0,t.jsxs)("div",{className:"relative flex flex-wrap gap-2 md:mx-auto md:block md:aspect-square md:w-full md:max-w-xl","data-testid":"network-reach-graph",children:[void 0===m?null:(0,t.jsx)("svg",{"aria-hidden":!0,viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"pointer-events-none absolute inset-0 hidden size-full md:block",children:f.map(e=>(0,t.jsx)("line",{x1:m.x,y1:m.y,x2:e.x,y2:e.y,vectorEffect:"non-scaling-stroke",className:"stroke-muted-foreground",strokeWidth:1.5},e.ship.id))}),p.map(e=>(0,t.jsx)(P,{node:e,onPick:()=>{d("picked"===e.mark?void 0:e.ship.id)}},e.ship.id))]}),void 0===n?(0,t.jsx)("p",{className:"text-body",role:"status","data-testid":"network-reach-summary",children:function(e,t=e.length){let a=e.find(e=>"picked"===e.mark);if(void 0===a)return"Pick a ship to see which ships it may message.";let r=Math.max(t,e.length)-1,s=e.filter(e=>"reached"===e.mark).map(e=>e.ship.name);return e.every(e=>"picked"===e.mark||"none"===e.mark)?0===r?`${a.ship.name} is the only ship of the fleet.`:`Finding the ships ${a.ship.name} may message…`:s.length===r?`${a.ship.name} may message every other ship (${String(r)}).`:0===s.length?`${a.ship.name} may message no other ship.`:`${a.ship.name} may message ${String(s.length)} of ${String(r)} ships: ${s.join(", ")}.`}(p,r)}):(0,t.jsx)(l.f,{title:"Couldn’t explain this ship’s reach",description:n,onRetry:o})]})}function P({node:e,onPick:a}){let{ship:r,mark:s}=e;return(0,t.jsx)(C.f,{size:"sm",variant:"secondary","aria-pressed":"picked"===s,"aria-label":"none"===s?r.name:`${r.name}, ${B[s]}`,icon:function(e){switch(e){case"picked":return(0,t.jsx)($,{"aria-hidden":!0});case"reached":return(0,t.jsx)(w.f,{"aria-hidden":!0});case"unreached":return(0,t.jsx)(j.f,{"aria-hidden":!0});case"none":return}}(s),"data-testid":"network-reach-ship","data-mark":s,style:{left:`${String(e.x)}%`,top:`${String(e.y)}%`},className:(0,S.f)("md:absolute md:-translate-x-1/2 md:-translate-y-1/2","picked"===s&&"bg-accent ring-2 ring-ring","unreached"===s&&"opacity-45"),onClick:a,children:r.name})}var V=e.i(424010),q=e.i(348184);let K={apply:{title:"Apply the draft?",description:"Every send, read and manage is checked against the draft from now on, and the rules before it are gone.",action:"Apply draft"},discard:{title:"Discard the draft?",description:"The draft is gone; the applied rules stay as they are.",action:"Discard draft"}};function Q({draft:e,appliedVersion:a,isApplying:r,applyError:i,onApply:n,isDiscarding:d,discardError:o,onDiscard:c}){let[h,u]=(0,s.useState)(null),p=r||d;return(0,t.jsxs)("section",{"aria-labelledby":"network-rules-apply","data-testid":"network-rules-apply",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-rules-apply",className:"text-body font-semibold",children:"Apply"}),null===e?(0,t.jsx)("p",{className:"text-meta text-muted-foreground","data-testid":"network-rules-apply-state",children:"No draft: the applied rules are the ones above. Save a draft to apply it."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-body","data-testid":"network-rules-apply-state",children:["A draft is saved. Every send, read and manage is checked against the applied rules, at version ",a,", until it is applied."]}),e.savedAgainstVersion===a?null:(0,t.jsxs)("p",{className:"text-meta text-muted-foreground","data-testid":"network-rules-apply-moved",children:["The settings moved from version ",e.savedAgainstVersion," since the draft was saved."]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(C.f,{variant:"primary",isLoading:r,disabled:d,"data-testid":"network-rules-apply-open",onClick:()=>{u("apply")},children:"Apply draft"}),(0,t.jsx)(C.f,{variant:"ghost",isLoading:d,disabled:r,"data-testid":"network-rules-discard-open",onClick:()=>{u("discard")},children:"Discard draft"})]})]}),void 0===i?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t apply the draft",description:i}),void 0===o?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t discard the draft",description:o}),(0,t.jsx)(V.m,{open:null!==h,onOpenChange:e=>{e||p||u(null)},children:null===h?null:(0,t.jsxs)(V.B,{"data-testid":`network-rules-${h}-dialog`,className:q.f.phoneSheet,children:[(0,t.jsxs)(V.O,{children:[(0,t.jsx)(V.g,{children:K[h].title}),(0,t.jsx)(V.I,{children:K[h].description})]}),(0,t.jsxs)(V._,{children:[(0,t.jsx)(V.q,{render:(0,t.jsx)(C.f,{disabled:p}),children:"Cancel"}),(0,t.jsx)(C.f,{variant:"apply"===h?"primary":"destructive",isLoading:p,"data-testid":`network-rules-${h}-confirm`,onClick:()=>{u(null),"apply"===h?n():c()},children:K[h].action})]})]})})]})}var U=e.i(711514);let _={argo:"argo",owner:"Owner",answer:"Answer",pluginRead:"Connected plugins read",meeting:"Meeting",viewerRead:"Viewer reads",installation:"Installation manages",open:"Open"};function J(e){switch(e.rule){case"argo":return{key:e.rule,name:_[e.rule],meaning:"argo sends to, reads and manages every ship, and every ship reaches argo.",isOn:e.isOn,turnedBy:"never"};case"owner":return{key:e.rule,name:_[e.rule],meaning:"A ship’s owner sends to, reads and manages the ships it owns.",isOn:e.isOn,turnedBy:"never"};case"answer":return{key:e.rule,name:_[e.rule],meaning:"A ship may always answer the sender of a message it received.",isOn:e.isOn,turnedBy:"never"};case"pluginRead":return{key:e.rule,name:_[e.rule],meaning:"A plugin argo connected reads every ship, whatever the rules.",isOn:e.isOn,turnedBy:"never"};case"meeting":return{key:e.rule,name:_[e.rule],meaning:"The participants of a meeting reach each other in it, whatever the rules: its owner reached each when it joined.",isOn:e.isOn,turnedBy:"never"};case"viewerRead":return{key:e.rule,name:_[e.rule],meaning:"The viewer reads every ship.",isOn:e.isOn,turnedBy:"argo"};case"installation":return{key:e.rule,name:_[e.rule],meaning:"The installation manages person ships and the ships they own, so a leaver is always released.",isOn:e.isOn,turnedBy:"never"};case"open":return{key:e.rule,name:_[e.rule],meaning:"Every ship may send to, read and manage every ship.",isOn:e.isOn,turnedBy:"rules"}}}function W({changes:e,error:a,onRetry:r}){let s;return s=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read what the draft changes",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"detail",rows:3,label:"Loading what the draft changes"}):e.every(({gained:e,lost:t})=>0===e.length&&0===t.length)?(0,t.jsx)("p",{className:"text-meta text-muted-foreground","data-testid":"network-draft-changes-none",children:"The draft changes no reach."}):e.filter(({gained:e,lost:t})=>e.length+t.length>0).map(({verb:e,gained:a,lost:r})=>(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"network-draft-changes-verb",children:[(0,t.jsx)("h3",{className:"text-meta font-semibold",children:x.N[e]}),(0,t.jsx)(G,{title:"Gains",rows:a,testId:"network-draft-gained"}),(0,t.jsx)(G,{title:"Loses",rows:r,testId:"network-draft-lost"})]},e)),(0,t.jsxs)("section",{"aria-labelledby":"network-draft-changes","data-testid":"network-draft-changes",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-draft-changes",className:"text-body font-semibold",children:"What the draft changes"}),s]})}function G({title:e,rows:a,testId:r}){return 0===a.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[e," ",a.length," ",1===a.length?"pair":"pairs"]}),(0,t.jsx)("ul",{className:"flex flex-col gap-1",children:a.map(e=>(0,t.jsxs)("li",{"data-testid":r,className:"flex flex-wrap items-center gap-x-2 text-body",children:[(0,t.jsx)("span",{children:e.from}),(0,t.jsx)(m.f,{"aria-label":"to",className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:e.to}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.rule})]},e.key))})]})}var H=e.i(77071),X=e.i(759659),Y=e.i(280581),Z=e.i(946033),ee=e.i(765649),et=e.i(263676),ea=e.i(770703),er=e.i(522016),es=e.i(406734);let ei=(0,ea.default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});function en({label:e,picked:a,owners:r,ownerChoices:i,unknown:n,groups:l,max:d,isDisabled:o,problem:c,onAdd:h,onRemove:u,testId:p,popoverTestId:m}){let[y,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),w=a.length+r.length+n.length,k=new Set(r.map(e=>(0,x.S)(e.term))),N=[...["*","#"].map(e=>({term:{owner:e},text:x.J[e]})),...i.map(e=>({term:{owner:e.shipId},text:e.name}))];return(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":p,children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===w?(0,t.jsx)("span",{className:"text-body",children:"Every ship"}):null,a.map((e,a)=>(0,t.jsxs)(s.Fragment,{children:[0===a?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(g.f,{chip:e,testId:`${p}-value`,..."string"==typeof e.term?{}:{meaning:x.q[e.term.value]},...o?{}:{onRemove:()=>{u(e.term)}}})]},(0,x.S)(e.term))),r.map((e,r)=>(0,t.jsxs)(s.Fragment,{children:[0===r&&0===a.length?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(el,{owner:e,testId:`${p}-owner`,...!0===o?{}:{onRemove:()=>{u(e.term)}}})]},(0,x.S)(e.term))),n.map(e=>(0,t.jsxs)("span",{"data-testid":`${p}-unknown`,title:`${(0,x.S)(e)}: no longer in this fleet`,className:"inline-flex h-5.5 items-center gap-1 rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(f.f,{"aria-hidden":!0}),"string"!=typeof e&&"owner"in e?"A removed owner":"A removed label",!0===o?null:(0,t.jsx)("button",{type:"button","aria-label":"string"!=typeof e&&"owner"in e?"Remove the removed owner":"Remove the removed label",onClick:()=>{u(e)},className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(et.X,{"aria-hidden":!0})})]},(0,x.S)(e))),w>=d?null:(0,t.jsxs)(es.V,{open:y,onOpenChange:b,children:[(0,t.jsx)(es.J,{render:(0,t.jsx)(C.f,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(H.f,{}),disabled:o,"data-testid":`${p}-add`}),children:"Add label"}),(0,t.jsxs)(es.T,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":m,children:[(0,t.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:e}),(0,t.jsx)(ei,{groups:l,pickedValueIds:a.flatMap(e=>"string"==typeof e.term?[e.term]:[]),onPick:e=>{b(!1),h(e)},terms:{picked:a.flatMap(e=>"string"==typeof e.term?[]:[e.term]),onPick:e=>{b(!1),h(e)}}}),(0,t.jsxs)("p",{className:"mt-2 flex items-center justify-between gap-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:["All must hold. * is any value, # the same as the other side.",(0,t.jsx)(er.default,{href:"/labels",className:"font-medium text-foreground hover:underline",children:"Manage labels"})]})]})]}),w>=d?null:(0,t.jsxs)(es.V,{open:v,onOpenChange:j,children:[(0,t.jsx)(es.J,{render:(0,t.jsx)(C.f,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(H.f,{}),disabled:o,"data-testid":`${p}-owner-add`}),children:"Add owner"}),(0,t.jsxs)(es.T,{align:"start",sideOffset:6,className:"w-72 p-2","data-testid":`${m}-owner`,children:[(0,t.jsxs)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:[e," the owner"]}),(0,t.jsx)("ul",{className:"flex flex-col",children:N.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",disabled:k.has((0,x.S)(e.term)),"data-testid":`${p}-owner-option`,onClick:()=>{j(!1),h(e.term)},className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-body hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:text-muted-foreground disabled:hover:bg-transparent",children:[(0,t.jsx)(ee.f,{"aria-hidden":!0,className:"size-(--size-icon) shrink-0 text-muted-foreground"}),e.text]})},(0,x.S)(e.term)))}),(0,t.jsx)("p",{className:"mt-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:"An owner is argo or a person’s ship. # is the same owner as the other side."})]})]})]}),void 0===c?null:(0,t.jsx)("p",{role:"status",className:"text-meta text-tone-attention-fg","data-testid":`${p}-problem`,children:c}),0===n.length?null:(0,t.jsx)("p",{role:"alert",className:"text-meta text-tone-attention-fg",children:"A label or owner here was removed from the fleet: this side matches no ship until you remove it."})]})}function el({owner:e,onRemove:a,testId:r}){let{owner:s}=e.term,i="*"===s||"#"===s?`${e.text}. ${x.J[s]}`:`${e.text}: ships it owns`;return(0,t.jsxs)("span",{role:"group","aria-label":i,title:i,"data-testid":r,className:"inline-flex h-5.5 max-w-full min-w-0 shrink-0 items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[(0,t.jsx)(ee.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"owner="}),(0,t.jsx)("span",{className:"font-medium",children:e.text.slice(6)})]}),void 0===a?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${e.text}`,onClick:a,className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(et.X,{"aria-hidden":!0})})]})}let ed=[{side:"from",label:"From ships with"},{side:"to",label:"To ships with"}],eo=()=>crypto.randomUUID();function ec({rules:e,context:a,limits:r,isSaving:i,saveError:n,savedNote:d,onSave:o}){let[c,h]=(0,s.useState)(()=>(0,x.j)(e,eo)),u=(0,Y.H)(a),p=(0,x.w)(a),f=(0,x.C)(c,e);return(0,t.jsxs)("section",{"aria-labelledby":"network-rules","data-testid":"network-rules",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-rules",className:"text-body font-semibold",children:"Rules"}),"all-to-all"===c.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-body","data-testid":"network-rules-state",children:"No rules: every ship may send to, read and manage every ship."}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"With rules, a ship may send to, read or manage another only when a rule of that verb or a built-in rule allows it."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(C.f,{variant:f?"secondary":"primary",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),disabled:i,"data-testid":"network-rules-on",onClick:()=>{h((0,x.i)(c,!0))},children:"Set rules"}),f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.f,{variant:"primary",isLoading:i,"data-testid":"network-rules-save",onClick:()=>{o(null)},children:"Save draft"}),(0,t.jsx)(C.f,{disabled:i,"data-testid":"network-rules-discard",onClick:()=>{h((0,x.j)(e,eo))},children:"Discard changes"})]}):null]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-body","data-testid":"network-rules-state",children:0===c.rules.length?"No rule allows anything yet: once saved, only the built-in rules hold.":"A ship may send to, read or manage another only when a rule of that verb or a built-in rule allows it."}),0===c.rules.length?null:(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:c.rules.map((e,s)=>(0,t.jsxs)("li",{"data-testid":"network-rule",className:"flex flex-col gap-2 rounded-md border border-border p-3 sm:flex-row sm:items-start sm:gap-3",children:[ed.map(({side:n,label:l})=>{let d,o=(0,x.$)(e[n],a);return(0,t.jsxs)("div",{className:"flex min-w-0 grow basis-0 items-start gap-3",children:["to"===n?(0,t.jsxs)("div",{className:"flex shrink-0 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Verb"}),(0,t.jsxs)(Z.d,{items:x.N,value:e.verb,disabled:i,onValueChange:t=>{U.h.some(e=>e===t)&&h((0,x.G)(c,{rule:e.key,verb:t}))},children:[(0,t.jsx)(Z.P,{"aria-label":`Verb of rule ${String(s+1)}`,"data-testid":"network-rule-verb",size:"sm",children:(0,t.jsx)(Z.U,{})}),(0,t.jsx)(Z.r,{children:U.h.map(e=>(0,t.jsx)(Z.T,{value:e,children:x.N[e]},e))})]})]}):null,"to"===n?(0,t.jsx)(m.f,{"aria-hidden":!0,className:"mt-6 hidden size-(--size-icon) shrink-0 text-muted-foreground sm:block"}):null,(0,t.jsx)(en,{label:l,picked:o.chips,owners:o.owners,ownerChoices:p,unknown:o.unknown,groups:u,max:r.selectorMax,isDisabled:i,...void 0===(d=(0,x.Q)(e,{side:n,context:a}))?{}:{problem:d},testId:`network-rule-${n}`,popoverTestId:"network-rule-popover",onAdd:t=>{h((0,x.I)(c,{rule:e.key,side:n,term:t,limits:r}))},onRemove:t=>{h((0,x.e)(c,{rule:e.key,side:n,term:t}))}})]},n)}),(0,t.jsx)(C.f,{variant:"ghost",size:"xs",icon:(0,t.jsx)(X.f,{"aria-hidden":!0}),disabled:i,"aria-label":`Remove rule ${String(s+1)}`,"data-testid":"network-rule-remove",onClick:()=>{h((0,x.K)(c,e.key))}})]},e.key))}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c.rules.length>=r.rulesMax?null:(0,t.jsx)(C.f,{size:"sm",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),disabled:i,"data-testid":"network-rules-add",onClick:()=>{h((0,x.V)(c,{newKey:eo,limits:r}))},children:"Add rule"}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground tabular-nums","data-testid":"network-rules-count",children:[c.rules.length," of ",r.rulesMax," rules"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-border pt-3",children:[(0,t.jsx)(C.f,{variant:"primary",isLoading:i,disabled:!f||(0,x.p)(c),"data-testid":"network-rules-save",onClick:()=>{o((0,x.f)(c))},children:"Save draft"}),f?(0,t.jsx)(C.f,{disabled:i,"data-testid":"network-rules-discard",onClick:()=>{h((0,x.j)(e,eo))},children:"Discard changes"}):null,(0,t.jsx)(C.f,{variant:"ghost",className:"ml-auto",disabled:i,"data-testid":"network-rules-off",onClick:()=>{h((0,x.i)(c,!1))},children:"Remove all rules"})]})]}),void 0===n?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t save the rules",description:n}),void 0===d||f?null:(0,t.jsx)("p",{role:"status",className:"text-meta text-muted-foreground","data-testid":"network-rules-note",children:d})]})}var eh=e.i(285595);let eu={name:"file-up",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};eu.node;let ep=(0,k.f)(eu);var em=e.i(791727),ef=e.i(443988),ex=e.i(923060),eg=e.i(849635),ey=e.i(890135);function eb(e){return"label"in e?`${e.label}=${e.value}`:`owner=${e.owner}`}function ev(e){return"ship"===e.kind?`ship:${e.name}`:`${e.kind}:${e.key}`}var ej=e.i(152678);function ew(e){switch(e.kind){case"definer":return`${e.key} is defined by ${e.fleetDefiner} here, by ${e.fileDefiner} in the file`;case"values":return`${e.key} has ${e.fleetValues.join(", ")} here; the file gives ${e.fileValues.join(", ")}`;case"ship":return`No active ship is named ${e.name}`}}function ek({difference:e,choice:a,ships:r,onShipQueryChange:s,isDisabled:i,onChange:n}){let l=ev(e),d=`network-import-difference-${l.replace(":","-")}`;return(0,t.jsxs)("fieldset",{className:"flex flex-col gap-2 rounded-lg border border-border bg-card p-3","data-testid":"network-import-difference",children:[(0,t.jsx)("legend",{className:"sr-only",children:ew(e)}),(0,t.jsx)("p",{className:"text-body font-medium","aria-hidden":!0,children:ew(e)}),(0,t.jsx)(ej.x,{value:a?.way,disabled:i,onValueChange:t=>{n({difference:e,way:t})},children:e.ways.map(t=>({way:t,text:function(e,t){switch(e.kind){case"definer":return"useExisting"===t?`Use the label ${e.key} as it is, defined by ${e.fleetDefiner}`:`Drop the rules on ${e.key}`;case"values":return"useExisting"===t?`Use the label ${e.key} as it is: it has every value the rules name`:`Drop the rules naming ${e.missingValues.map(t=>`${e.key}=${t}`).join(", ")}`;case"ship":return"pickShip"===t?`Pick an active ship for ${e.name}`:`Drop the rules naming owner=${e.name}`}}(e,t)})).map(({way:e,text:a})=>(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ej.a,{id:`${d}-${e}`,value:e,className:"mt-0.5","data-testid":`network-import-way-${e}`}),(0,t.jsx)("label",{htmlFor:`${d}-${e}`,className:"min-w-0 grow cursor-pointer text-body",children:a})]},e))}),a?.way==="pickShip"?(0,t.jsx)(M.f,{options:r.map(e=>({value:e.id,label:e.name})),value:a.shipId??null,onValueChange:t=>{let a=r.find(e=>e.id===t);n({difference:e,way:"pickShip",...void 0===a?{}:{shipId:a.id}})},onQueryChange:s,groupLabel:"Active ships",placeholder:"Type a ship name","aria-label":`The ship for ${"ship"===e.kind?e.name:""}`,"data-testid":"network-import-pick-ship"}):null]})}let eN=["Attach or paste","Check","Overview","Import"];function e$({current:e}){return(0,t.jsx)("ol",{className:"flex flex-wrap gap-x-3 gap-y-1 text-meta","aria-label":"Import steps","data-testid":"network-import-steps",children:eN.map((a,r)=>(0,t.jsxs)("li",{"aria-current":r===e?"step":void 0,className:r===e?"font-semibold text-foreground":"text-muted-foreground",children:[r+1,". ",a]},a))})}function eI(e){let a,r,{checked:i,isChecking:n,checkError:d,onCheck:o,onFileChange:c,ships:h,onShipQueryChange:u,isImporting:p,importError:m,onImport:f}=e,[x,g]=(0,s.useState)(""),[y,b]=(0,s.useState)([]),v=h.find(e=>e.isOperator),[j,w]=(0,s.useState)(v?.id),[k,N]=(0,s.useState)(!1),$=n||p,I=e=>{g(e),b([]),N(!1),c()};if(void 0===i)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e$,{current:+!!n}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(em.f,{htmlFor:"network-import-attach",children:"Attach the file"}),(0,t.jsx)("input",{id:"network-import-attach",type:"file",accept:"application/json,.json",disabled:$,"data-testid":"network-import-attach",className:"text-body file:mr-3 file:rounded-md file:border file:border-border file:bg-card file:px-3 file:py-1.5",onChange:e=>{let t=e.target.files?.[0];void 0!==t&&t.text().then(I)}})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(em.f,{htmlFor:"network-import-paste",children:"Or paste it"}),(0,t.jsx)(ef.f,{id:"network-import-paste",isMono:!0,rows:8,value:x,disabled:$,placeholder:'{ "format": "aeolus.network-rules", ... }',"data-testid":"network-import-paste",onChange:e=>{I(e.target.value)}})]}),void 0===d?null:(0,t.jsx)(l.f,{title:"The file doesn’t check",description:`${d}. Nothing changed: fix the file and check it again.`}),(0,t.jsxs)(ex.DialogFooter,{children:[(0,t.jsx)(ex.DialogClose,{render:(0,t.jsx)(C.f,{type:"button",disabled:$}),children:"Cancel"}),(0,t.jsx)(C.f,{variant:"primary",isLoading:n,disabled:""===x.trim()||$,"data-testid":"network-import-check",onClick:()=>{o(x)},children:n?"Checking…":"Check file"})]})]});let{file:S,newLabels:R,differences:O}=i,A=S.rules??[],D=O.every(e=>{let t=y.find(t=>ev(t.difference)===ev(e));return void 0!==t&&("pickShip"!==t.way||void 0!==t.shipId)}),T=h.find(e=>e.id===j),z=D&&(0===R.length||void 0!==T)&&!$,F=y.flatMap(e=>(function(e){let{difference:t,way:a}=e;return"ship"===t.kind?"pickShip"===a?void 0===e.shipId?void 0:{kind:"ship",name:t.name,way:a,shipId:e.shipId}:{kind:"ship",name:t.name,way:"dropRules"}:{kind:t.kind,key:t.key,way:"useExisting"===a?"useExisting":"dropRules"}})(e)??[]);return k?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e$,{current:3}),(0,t.jsx)(ex.DialogHeader,{children:(0,t.jsx)(ex.DialogTitle,{children:"Import into the draft?"})}),(0,t.jsxs)("ul",{className:"flex list-disc flex-col gap-1 pl-5 text-body","data-testid":"network-import-consequences",children:[(0,t.jsx)("li",{children:null===S.rules?"The draft becomes all-to-all, every ship reaching every ship.":y.some(e=>"dropRules"===e.way)?`The draft is replaced by the file’s ${String(A.length)} rules, less the ones you chose to drop.`:`The draft is replaced by the file’s ${String(A.length)} rules.`}),0===R.length?null:(0,t.jsxs)("li",{children:[R.join(", ")," ",1===R.length?"is":"are"," defined for ",T?.name??"argo","."]}),(0,t.jsx)("li",{children:"Nothing is in force until you apply the draft."})]}),void 0===m?null:(0,t.jsx)(l.f,{variant:"section",title:"Couldn’t import the file",description:`${m}. Nothing was written.`,onRetry:()=>{N(!1),o(x)}}),(0,t.jsxs)(ex.DialogFooter,{children:[(0,t.jsx)(C.f,{type:"button",disabled:$,onClick:()=>{N(!1)},children:"Back"}),(0,t.jsx)(C.f,{variant:"primary",isLoading:p,disabled:$,"data-testid":"network-import-confirm",onClick:()=>{f({file:x,resolutions:F,...0===R.length||void 0===T||T.isOperator?{}:{definerShipId:T.id}})},children:p?"Importing…":"Import into the draft"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e$,{current:2}),(0,t.jsxs)("p",{className:"flex items-start gap-2 text-body",role:"status","data-testid":"network-import-checked",children:[(0,t.jsx)(eh.f,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-tone-ok-fg"}),(0,t.jsx)("span",{children:(a=null===S.rules?"all-to-all, no rules":(0,ey.v)(S.rules.length,{one:"rule",many:"rules"}),r=(0,ey.v)(S.labels.length,{one:"label",many:"labels"}),`The file checks: ${a} and ${r}, from ${S.fleet.name} at rules version ${String(S.rulesVersion)}, exported ${(0,eg.B)(new Date(S.exportedAt))}.`)})]}),0===O.length?null:(0,t.jsxs)("section",{"aria-labelledby":"network-import-differences",className:"flex flex-col gap-2","data-testid":"network-import-differences",children:[(0,t.jsx)("h3",{id:"network-import-differences",className:"text-body font-semibold",children:1===O.length?"1 difference to resolve":`${String(O.length)} differences to resolve`}),O.map(e=>{let a=ev(e);return(0,t.jsx)(ek,{difference:e,choice:y.find(e=>ev(e.difference)===a),ships:h,onShipQueryChange:u,isDisabled:$,onChange:e=>{b([...y.filter(e=>ev(e.difference)!==a),e])}},a)})]}),0===R.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)(em.f,{htmlFor:"network-import-definer",children:["Define ",R.join(", ")," for"]}),(0,t.jsx)(M.f,{id:"network-import-definer",options:h.map(e=>({value:e.id,label:e.name})),value:j??null,onValueChange:e=>{w(h.find(t=>t.id===e)?.id)},onQueryChange:u,groupLabel:"Active ships",placeholder:"Type a ship name","data-testid":"network-import-definer"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"argo never retires, so its labels never go. Another ship must be within your manage reach."})]}),(0,t.jsxs)("section",{"aria-labelledby":"network-import-rules",className:"flex flex-col gap-1.5",children:[(0,t.jsx)("h3",{id:"network-import-rules",className:"text-body font-semibold",children:"Rules in the file"}),0===A.length?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:null===S.rules?"None: all-to-all.":"None: only the built-in and declared rules."}):(0,t.jsx)("ol",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto font-mono text-code","data-testid":"network-import-rules",children:A.map((e,t)=>{let a,{verb:r,from:s,to:i}=(a=e=>0===e.length?["every ship"]:e.map(eb),{verb:e.verb,from:a(e.from),to:a(e.to)});return{place:t+1,line:`${r}: ${s.join(" ")} → ${i.join(" ")}`}}).map(({place:e,line:a})=>(0,t.jsx)("li",{children:a},e))})]}),(0,t.jsxs)(ex.DialogFooter,{className:"items-center",children:[(0,t.jsx)("span",{className:"mr-auto text-meta text-muted-foreground",children:D?null:"Resolve every difference to import."}),(0,t.jsx)(C.f,{type:"button",disabled:$,onClick:()=>{I(x)},children:"Back"}),(0,t.jsx)(C.f,{variant:"primary",disabled:!z,"data-testid":"network-import-open-confirm",onClick:()=>{N(!0)},children:"Import…"})]})]})}function eC(e){let{isOpen:a,onOpenChange:r,isChecking:s,isImporting:i}=e;return(0,t.jsx)(ex.Dialog,{open:a,onOpenChange:e=>{s||i||r(e)},children:(0,t.jsxs)(ex.DialogContent,{size:"md","data-testid":"network-import-dialog",className:q.f.phoneFullScreen,children:[(0,t.jsxs)(ex.DialogHeader,{children:[(0,t.jsxs)(ex.DialogTitle,{children:[(0,t.jsx)(ep,{"aria-hidden":!0,className:"mr-2 inline size-(--size-icon-sm)"}),"Import network rules"]}),(0,t.jsx)(ex.DialogDescription,{children:"Rules exported from this fleet or another land in the draft; nothing is in force until you apply it."})]}),a?(0,t.jsx)(eI,{...e}):null]})})}let eS={name:"file-down",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]};eS.node;let eR=(0,k.f)(eS);function eO({isExporting:e,exportError:a,onExport:r,exported:s,canImport:i,onImport:n}){return(0,t.jsxs)("section",{"aria-labelledby":"network-rules-file","data-testid":"network-rules-file",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-rules-file",className:"text-body font-semibold",children:"Export and import"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Export writes the applied rules and the labels they use as one file, by name. Import brings a file from this fleet or another into the draft."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(C.f,{icon:(0,t.jsx)(eR,{}),isLoading:e,"data-testid":"network-rules-export",onClick:r,children:e?"Exporting…":"Export"}),i?(0,t.jsx)(C.f,{icon:(0,t.jsx)(ep,{}),disabled:e,"data-testid":"network-rules-import",onClick:n,children:"Import…"}):null]}),void 0===s||0===s.leftOut.length?null:(0,t.jsxs)("div",{role:"status","data-testid":"network-rules-left-out",className:"flex flex-col gap-1 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3.5 py-2.5 text-meta text-tone-waiting-fg",children:[(0,t.jsxs)("p",{children:[s.name," leaves out ",1===s.leftOut.length?"1 applied rule":`${String(s.leftOut.length)} applied rules`,", as each matches no ship:"]}),(0,t.jsx)("ul",{className:"list-disc pl-5",children:s.leftOut.map(({rule:e,reason:a})=>(0,t.jsxs)("li",{children:["rule ",e," ",a]},e))})]}),void 0===a?null:(0,t.jsx)(l.f,{variant:"field",title:"Couldn’t export the rules",description:`${a}. Nothing was downloaded.`})]})}function eA(e){switch(e.kind){case"ship":return e.name;case"account":return`Account ${e.accountId}`;case"installation":return"The installation"}}function eD({refusals:e,error:a,onRetry:r,more:s,context:i,now:o}){let c;return c=void 0!==a?(0,t.jsx)(l.f,{title:"Couldn’t read the refusals",description:a,onRetry:r}):void 0===e?(0,t.jsx)(d.f,{variant:"list",rows:3,label:"Loading the refusals"}):0!==e.length||s?(0,t.jsx)("ol",{className:"flex flex-col gap-2","data-testid":"network-refusals-list",children:e.map(e=>(0,t.jsx)(eT,{refusal:e,context:i,now:o},e.id))}):(0,t.jsx)(n.f,{variant:"section",title:"No send has been refused."}),(0,t.jsxs)("section",{"aria-labelledby":"network-refusals","data-testid":"network-refusals",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)("h2",{id:"network-refusals",className:"text-body font-semibold",children:"Refusals"}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The sends the rules refused, newest first, with both ships’ labels as they were then. The sender was told only that its send was refused."}),c,s]})}function eT({refusal:e,context:a,now:r}){let s=new Date(e.at),{recipient:i}=e,n="ship"===i.kind?[i.ship]:i.ships;return(0,t.jsxs)("li",{"data-testid":"network-refusal",className:"flex flex-col gap-2 rounded-md border border-border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5",children:[(0,t.jsx)("p",{className:"text-body font-medium",children:function(e){let{sender:t,recipient:a}=e,r=`${eA(t)} tried to ${"ship"===t.kind?"message":"reach"}`;switch(a.kind){case"ship":return`${r} ${a.ship.name}.`;case"type":return`${r} the type ${a.type}: ${(0,Y.t)(a.ships.map(e=>e.name))}.`}}(e)}),(0,t.jsx)("time",{dateTime:e.at,title:(0,eg.o)(s),className:"text-meta text-muted-foreground tabular-nums",children:(0,eg.W)(s,r)})]}),(0,t.jsxs)("dl",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(eM,{side:"From",ship:{name:eA(e.sender),labels:"installation"===e.sender.kind?[]:e.sender.labels},context:a}),n.map(e=>(0,t.jsx)(eM,{side:"To",ship:e,context:a},e.id))]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:`Refused by network settings version ${String(e.settingsVersion)}.`})]})}function eM({side:e,ship:a,context:r}){let s=(0,Y.h)(a,r);return(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("dt",{className:"text-meta text-muted-foreground",children:[e," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:a.name})]}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1",children:0===s.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"No labels"}):s.map(e=>(0,t.jsx)(g.f,{chip:e,testId:"network-refusal-label"},e.valueId))})]})}var ez=e.i(509892),eF=e.i(787964),eL=e.i(490262),eB=e.i(34512),eE=e.i(905387),eP=e.i(970597),eV=e.i(419413),eq=e.i(266027),eK=e.i(427702),eQ=e.i(442111),eU=e.i(487483),e_=e.i(718423),eJ=e.i(928459),eW=e.i(954616),eG=e.i(912598);function eH(){let e=(0,eK.I)(),t=(0,eG.d)();return async()=>{await Promise.all([t.invalidateQueries({queryKey:e.fleet.networkRules.queryKey()}),t.invalidateQueries({queryKey:e.fleet.networkRulesDraftChanges.queryKey()}),t.invalidateQueries({queryKey:e.fleet.explainReach.pathKey()})])}}var eX=e.i(296676),eY=e.i(619273);function eZ(e,t="applied"){let a=new URLSearchParams([...void 0===e?[]:[["reach",e]],..."draft"===t?[["against","draft"]]:[]]).toString();return""===a?"/network":`/network?${a}`}var e0=e.i(621482),e2=e.i(731877),e1=e.i(298421),e3=e.i(678485);e.s(["NetworkPageFor",0,function({pickedShipId:e,against:o}){var c,h,u,m;let f,x,g,y,v,j,w,k,N,$,I,C,S,O,A,T,M,z,F,L,B,P,V,q,K,G,H=(0,r.useRouter)(),X=(0,eX.f)(),Y=(0,eF.y)(),Z=(0,eJ.t)(),ee=(0,e_.f)(),et=(0,eL.Q)(),ea=et.canEditNetwork,er=(x=(0,eK.I)(),(0,eq.f)(x.fleet.networkRules.queryOptions(void 0,{enabled:ea}))),es=void 0!==er.data&&null!==er.data.draft,ei=es?o:"applied",en=(c=ea&&es,g=(0,eK.I)(),(0,eq.f)(g.fleet.networkRulesDraftChanges.queryOptions(void 0,{enabled:c}))),el=(0,eE.e)(),ed=(y=(0,eK.I)(),v=(0,eq.f)(y.fleet.list.queryOptions({shipKind:["operator","person"],limit:eV.f},{enabled:ea})),v.data?.items.filter(eP.f)),eo=(h=ea?e:void 0,j=(0,eK.I)(),(0,eq.f)({...j.fleet.explainReach.queryOptions(void 0===h?eY.V:{fromShipId:h,against:ei}),select:R})),eh=(w=(0,eK.I)(),(0,e2.d)((0,e0.f)(w.fleet.reachRefusals.infiniteQueryOptions({limit:e2.q},{enabled:ea,getNextPageParam:e2.J})))),eu=(k=(0,eK.I)(),(0,eq.f)(k.fleet.declaredNetworkRules.queryOptions(void 0,{enabled:ea}))),ep=function(e){let t=e.rules.flatMap(e=>[...e.from,...e.to].flatMap(e=>(0,U.b)(e)&&e.owner!==U.C&&e.owner!==U.B?[e.owner]:[])),a=e.declarers.flatMap(e=>"ship"===e.kind?[e.shipId]:[]),{draftChanges:r}=e;return[...new Set([...t,...a,...void 0===r?[]:U.h.flatMap(e=>[...r[e].gained,...r[e].lost]).flatMap(e=>[e.fromShipId,e.toShipId]),...void 0===e.pickedShipId?[]:[e.pickedShipId,...e.reachableShipIds??[]]])]}({rules:[...er.data?.applied.rules??[],...er.data?.draft?.rules??[]],declarers:eu.data?.map(e=>e.declarer)??[],...void 0===en.data?{}:{draftChanges:en.data},...void 0===e?{}:{pickedShipId:e},...void 0===eo.data?{}:{reachableShipIds:eo.data}}),em=(0,eQ.K)(ep),ef=(0,eQ.U)(ep),ex=[...em?.values()??[]],eg=(N=(0,eK.I)(),$=(0,eq.f)(N.fleet.shipCounts.queryOptions()),$.data?.filter(e=>"viewer"!==e.kind).reduce((e,t)=>e+t.active,0)),[ey,eb]=(0,s.useState)(""),ev=(0,eU.f)("",ea)??[],ej=(0,eU.f)(ey,ea)??[],ew=D([...new Map([...ev.slice(0,1),...ej].map(e=>[e.id,e])).values()]),ek=(I=(0,eK.I)(),(0,eq.f)(I.fleet.builtInRules.queryOptions(void 0,{enabled:ea}))),eN=(C=(0,eK.I)(),S=(0,eG.d)(),{setViewerRead:e=>{O.mutate({rule:"viewerRead",isOn:e})},isPending:(O=(0,eW.f)(C.fleet.setBuiltInRule.mutationOptions({onSuccess:()=>S.invalidateQueries({queryKey:C.fleet.builtInRules.queryKey()})}))).isPending,error:O.error?.message}),e$=(A=(0,eK.I)(),T=eH(),(0,eW.f)(A.fleet.saveNetworkRulesDraft.mutationOptions({onSuccess:T}))),eI=(M=(0,eK.I)(),z=(0,eG.d)(),F=eH(),(0,eW.f)(M.fleet.applyNetworkRules.mutationOptions({onSuccess:async()=>{await Promise.all([F(),z.invalidateQueries({queryKey:M.fleet.builtInRules.queryKey()})])}}))),eS=(L=(0,eK.I)(),B=eH(),(0,eW.f)(L.fleet.discardNetworkRulesDraft.mutationOptions({onSuccess:B}))),eR=(P=(0,eK._)(),(0,eW.f)({mutationFn:async()=>{var e;let t,a,r,{file:s,leftOut:i}=await P.fleet.exportNetworkRules.query(),n=(t=s.fleet.name.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-|-$/g,""),`network-rules-${t}-v${String(s.rulesVersion)}.json`);return e=`${JSON.stringify(s,null,2)}
2
+ `,a=URL.createObjectURL(new Blob([e],{type:"application/json"})),(r=document.createElement("a")).href=a,r.download=n,r.click(),URL.revokeObjectURL(a),{name:n,leftOut:i}}})),eA=(V=(0,eK.I)(),(0,eW.f)(V.fleet.checkNetworkRulesFile.mutationOptions())),eT=(q=(0,eK.I)(),K=(0,eG.d)(),G=eH(),(0,eW.f)(q.fleet.importNetworkRules.mutationOptions({onSuccess:async()=>{await Promise.all([G(),K.invalidateQueries({queryKey:q.fleet.labels.queryKey()})])}}))),[eM,e5]=(0,s.useState)(!1),e6=()=>{eA.reset(),eT.reset()},{networkRulesMax:e8,shipLabelsMax:e4}=(0,eB.x)();if((0,e3.n)([Z.error,ee.error]),ea)if(er.isError)f=(0,t.jsx)(l.f,{title:"Couldn’t read the network",description:er.error.message,onRetry:()=>{er.refetch()}});else if(void 0===er.data||void 0===el||void 0===ed)f=(0,t.jsx)(d.f,{variant:"detail",rows:4,label:"Loading the network"});else{let a,r,s,n={...el,ships:[...ex,...ed]};f=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p,{rows:void 0===ek.data?void 0:ek.data.map(J),error:ek.error?.message,onRetry:()=>{ek.refetch()},isTurning:eN.isPending,turnError:eN.error,onViewerReadChange:eN.setViewerRead}),(0,t.jsx)(ec,{rules:(er.data.draft??er.data.applied).rules,context:n,limits:{rulesMax:e8,selectorMax:e4},isSaving:e$.isPending,saveError:e$.error?.message,savedNote:void 0===e$.data?void 0:"Draft saved. Nothing changes until it is applied.",onSave:e=>{e$.mutate({rules:e})}},JSON.stringify(er.data.draft??er.data.applied)),null===er.data.draft?null:(0,t.jsx)(W,{changes:void 0===en.data?void 0:(u=en.data,a=new Map(ex.map(e=>[e.id,e.name])),r=e=>e.map(({fromShipId:e,toShipId:t,rule:r})=>({key:`${e}>${t}`,from:a.get(e)??e,to:a.get(t)??t,rule:function(e,t){if("builtIn"in e)return`Built-in: ${_[e.builtIn]}`;if("rule"in e)return`Rule ${String(e.rule+1)}`;let a="installation"===e.declared.kind?"the installation":t.get(e.declared.shipId)??e.declared.shipId;return`Declared by ${a}, rule ${String(e.index+1)}`}(r,a)})).sort((e,t)=>e.from.localeCompare(t.from)||e.to.localeCompare(t.to)),U.h.map(e=>({verb:e,gained:r(u[e].gained),lost:r(u[e].lost)}))),error:en.error?.message,onRetry:()=>{en.refetch()}}),(0,t.jsx)(Q,{draft:er.data.draft,appliedVersion:er.data.applied.version,isApplying:eI.isPending,applyError:eI.error?.message,onApply:()=>{eI.mutate({version:er.data.applied.version})},isDiscarding:eS.isPending,discardError:eS.error?.message,onDiscard:()=>{eS.mutate()}}),(0,t.jsx)(eO,{isExporting:eR.isPending,exportError:eR.error?.message,exported:eR.data,onExport:()=>{eR.mutate(void 0,{onSuccess:({name:e,leftOut:t})=>{(0,i._)({title:"Rules exported",description:0===t.length?`Saved as ${e}.`:`Saved as ${e}, leaving out ${String(t.length)}: see Export and import.`,tone:"success"})}})},canImport:et.canDefineLabels,onImport:()=>{e6(),e5(!0)}}),(0,t.jsx)(eC,{isOpen:eM,onOpenChange:e=>{e5(e),e||e6()},checked:eA.data,isChecking:eA.isPending,checkError:eA.error?.message,onCheck:e=>{eT.reset(),eA.mutate({file:e})},onFileChange:e6,ships:ew,onShipQueryChange:eb,isImporting:eT.isPending,importError:eT.error?.message,onImport:e=>{eT.mutate(e,{onSuccess:({definedLabels:e})=>{e5(!1),e6(),(0,i._)({title:"Imported into the draft",description:`${0===e.length?"":`Defined ${e.join(", ")}. `}Look at what the draft changes, then apply it.`,tone:"success"})}})}}),(0,t.jsx)(b,{declared:void 0===eu.data?void 0:(m=eu.data,s=new Map([...ef??[]].map(([e,t])=>({id:e,name:t})).map(e=>[e.id,e.name])),m.filter(({rules:e})=>e.length>0).map(({declarer:e,rules:t})=>"installation"===e.kind?{declarerId:"installation",declaredBy:"the installation",rules:t}:{declarerId:e.shipId,declaredBy:s.get(e.shipId)??e.shipId,rules:t}).sort((e,t)=>e.declaredBy.localeCompare(t.declaredBy))),error:eu.error?.message,onRetry:()=>{eu.refetch()},context:n}),(0,t.jsx)(E,{ships:D(ex),search:{ships:ew,onQueryChange:eb},...void 0===eg?{}:{sailingShipCount:eg},pickedShipId:e,reachableShipIds:eo.data,reachError:eo.error?.message,onPick:e=>{H.replace(eZ(e,ei),{scroll:!1})},against:ei,...es?{onAgainstChange:t=>{H.replace(eZ(e,t),{scroll:!1})}}:{},onRetry:()=>{eo.refetch()}}),(0,t.jsx)(eD,{refusals:eh.items,error:eh.isFailed?eh.error?.message:void 0,onRetry:eh.retry,more:eh.hasMore?(0,t.jsx)(e1.f,{what:"older refusals",isLoading:eh.isLoadingMore,isFailed:eh.isLoadMoreFailed,onLoad:eh.loadMore,area:"network-refusals"}):null,context:n,now:X})]})}else f=(0,t.jsx)(n.f,{icon:(0,t.jsx)(a.f,{"aria-hidden":!0}),title:"Only a session holding fleet:network sees the network rules"});return(0,t.jsx)(ez.f,{...Y,title:"Network",description:"Who may send to, read or manage whom. The fleet checks the applied rules on every send; a draft changes nothing until it is applied.",live:ee.live,children:f})}],313260)}]);
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,469690,875812,381104,e=>{var t=e.i(733332),i=e.i(271645),n=e.i(956789);let r={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},a={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},l={disabled:!1,...a};e.s(["q",0,l,"S",0,a,"t",0,r,"s",0,{valid:e=>null===e?null:e?{"data-valid":""}:{"data-invalid":""}}],875812);let s={invalid:void 0,name:void 0,validityData:{state:r,errors:[],error:"",value:"",initialValue:null},setValidityData:n.x,disabled:void 0,setTouched:n.x,setDirty:n.x,setFilled:n.x,setFocused:n.x,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:l,registerFieldControl:n.x,validation:{getValidationProps:(e,t=n.w)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:n.x,getInputControl:()=>null,commit:async()=>{},change:n.x}},o=i.createContext(s);function d(e=!0){let r=i.useContext(o);if(r.setValidityData===n.x&&!e)throw Error((0,t.f)(28));return r}e.s(["T",0,s,"H",0,o,"U",0,d],469690);var u=e.i(146376),c=e.i(388940);e.s(["f",0,function(e,t,i,n,r=!0,a){let{registerFieldControl:l}=d(),s=(0,c.f)(()=>Symbol());(0,u.f)(()=>{let o=s.current;r?l(o,{controlRef:e,getValue:n,id:t,name:a,value:i}):l(o,void 0)},[e,r,n,t,a,l,s,i]),(0,u.f)(()=>{let e=s.current;return()=>{l(e,void 0)}},[l,s])}],381104)},884708,e=>{e.i(247167);var t=e.i(271645),i=e.i(956789);let n=t.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:i.x,validationMode:"onSubmit",submitCountRef:{current:0}});e.s(["f",0,function(){return t.useContext(n)}])},31421,e=>{var t=e.i(271645),i=e.i(146376),n=e.i(788015);e.s(["f",0,function(e,r,a,l=!0,s){let[o,d]=t.useState(),u=(0,n.f)(s?`${s}-label`:void 0),c=e??r??o;return(0,i.f)(()=>{let t=e||r||!l?void 0:function(e,t){let i=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let i=e.id;if(i){let t=e.nextElementSibling;if(t&&t.htmlFor===i)return t}let n=e.labels;return n&&n[0]}(e);if(i)return!i.id&&t&&(i.id=t),i.id||void 0}(a.current,u);o!==t&&d(t)}),c}])},538489,247778,e=>{var t=e.i(271645),i=e.i(146376),n=e.i(667865),r=e.i(388940),a=e.i(956789),l=e.i(788015);let s=t.createContext({controlId:void 0,registerControlId:a.x,resetControlId:a.x,labelId:void 0,setLabelId:a.x,messageIds:[],setMessageIds:a.x,getDescriptionProps:e=>e});function o(){return t.useContext(s)}e.s(["f",0,o],247778),e.s(["f",0,function(e={}){let{id:s,enabled:d=!0}=e,{controlId:u,registerControlId:c,resetControlId:f}=o(),p=(0,l.f)(),m=(0,r.f)(()=>Symbol()),h=t.useRef(!1),b=t.useRef(!1),v=(0,n.f)(()=>{h.current&&c!==a.x&&(h.current=!1,c(m.current,void 0))});return(0,i.f)(()=>{let e;if(!d||c===a.x)return void v();if(void 0!==s)b.current=!0,e=s;else{if(!b.current)return void f();e=p}void 0===e?v():(h.current=!0,c(m.current,e))},[s,d,c,f,p,m,v]),(0,i.f)(()=>v,[v]),(d?u:void 0)??s??p}],538489)},186698,e=>{e.s(["f",0,function(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}])},590803,e=>{e.s(["f",0,function(e){return null==e||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")}])},713203,265858,484325,42191,868931,e=>{var t=e.i(271645);e.s(["f",0,function(e){let i=t.useRef(!0);i.current&&(i.current=!1,e())}],713203);var i=e.i(229315),n=e.i(883977),r=e.i(146376),a=e.i(388940),l=e.i(990627),s=e.i(46420),o=e.i(156341);e.s(["f",0,function(e){let{open:t=!1,onOpenChange:d,elements:u={}}=e,c=(0,n.f)(),f=null!=(0,s.G)(),p=(0,a.f)(()=>new o.f({open:t,transitionStatus:void 0,onOpenChange:d,referenceElement:u.reference??null,floatingElement:u.floating??null,triggerElements:new l.f,floatingId:c,syncOnly:!1,nested:f})).current;return(0,r.f)(()=>{let e={open:t,floatingId:c};void 0!==u.reference&&(e.referenceElement=u.reference,e.domReferenceElement=(0,i.m)(u.reference)?u.reference:null),void 0!==u.floating&&(e.floatingElement=u.floating),p.update(e)},[t,c,u.reference,u.floating,p]),p.context.onOpenChange=d,p.context.nested=f,p}],265858);let d=(e,t)=>Object.is(e,t);function u(e,t,i){return null==e||null==t?Object.is(e,t):i(e,t)}function c(e,t,i){return!!e&&e.some(e=>void 0!==e&&u(t,e,i))}function f(e,t,i){return e?e.findIndex(e=>void 0!==e&&u(e,t,i)):-1}function p(e,t,i,n){let r=n&&Array.isArray(t)?e.findIndex(function(e,t){if(t!==d)return i=>c(e,i,t);let i=new Set(e);return i.delete(void 0),t=>i.has(t)&&(0!==t||e.some(e=>Object.is(t,e)))}(t,i)):f(e,t,i);return -1===r?null:r}e.s(["i",0,u,"t",0,d,"u",0,f,"m",0,p,"H",0,function(e,t,i){return Array.isArray(e)&&Array.isArray(t)?!function(e,t,i=Object.is){let{length:n}=e;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(!i(e[r],t[r]))return!1;return!0}(e,t,(e,t)=>u(e,t,i)):e!==t},"j",0,function(e,t,i){return e.filter(e=>!u(t,e,i))},"b",0,function(e,t,i,n,r,a){return c(n,t,r)?null!=a&&e>a&&c(n,i[a],r)?a:e:e===a?p(i,n,r,!0):a},"v",0,c],484325);var m=e.i(186698),h=e.i(843476);function b(e){var t;return"object"==typeof(t=e?.[0])&&null!=t&&Array.isArray(t.items)}function v(e){return b(e)?e.flatMap(e=>e.items):e}function g(e,t){if(t&&null!=e)return t(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return(0,m.f)(e)}function z(e,t,i){if(i&&null!=e)return i(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??g(e,i);if(Array.isArray(t)){let n=v(t);if(null==e||"object"!=typeof e){let t=n.find(t=>t.value===e);return t&&null!=t.label?t.label:g(e,i)}if("value"in e){let t=n.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return g(e,i)}e.s(["j",0,v,"Y",0,function(e){if(!Array.isArray(e))return null!=e&&"null"in e;if(b(e)){for(let t of e)for(let e of t.items)if(e&&null==e.value&&null!=e.label)return!0;return!1}for(let t of e)if(t&&null==t.value&&null!=t.label)return!0;return!1},"i",0,b,"u",0,function(e,i,n){return e.reduce((e,r,a)=>(a>0&&e.push(", "),e.push((0,h.jsx)(t.Fragment,{children:z(r,i,n)},a)),e),[])},"b",0,z,"B",0,g,"P",0,function(e,t){return t&&null!=e?t(e)??"":e&&"object"==typeof e&&"value"in e&&"label"in e?(0,m.f)(e.value):(0,m.f)(e)}],42191);var y=e.i(415618);e.s(["f",0,y],868931)},768877,e=>{var t=e.i(456420);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 n=(0,t.f)(i);e.s(["f",0,n],768877)},847211,e=>{var t=e.i(456420);let i={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],847211)},792150,e=>{var t=e.i(456420);let i={name:"boxes",size:24,node:[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],792150)},806537,e=>{var t=e.i(456420);let i={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],806537)},77071,e=>{var t=e.i(456420);let i={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],77071)},759659,e=>{var t=e.i(456420);let i={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],759659)},513907,e=>{var t=e.i(722219);e.s(["z",0,t])},942203,e=>{var t=e.i(722219);e.s(["z",0,t])},477562,868217,488826,e=>{var t=e.i(722219);e.s(["z",0,t],477562),e.s(["z",0,t],868217),e.s(["z",0,t],488826)},282492,e=>{var t=e.i(722219);e.s(["z",0,t])},691113,e=>{var t=e.i(722219);e.s(["z",0,t])},978056,e=>{var t=e.i(722219);e.s(["z",0,t])},240192,619877,e=>{var t=e.i(722219);e.s(["z",0,t],240192),e.s(["z",0,t],619877)},419413,e=>{e.s(["f",0,500])},367795,e=>{let t=/^[a-z0-9:-]+$/,i=`Use 1 to ${String(48)} lowercase letters, digits, hyphens or colons`;e.s(["Z",0,48,"o",0,i,"V",0,t,"C",0,function(e){return e.length<=48&&t.test(e)}])},347664,173332,e=>{var t=e.i(54105),i=e.i(411382),n=e.i(942203),r=e.i(213056),a=e.i(978056),l=e.i(513907),s=e.i(282492);let o=s.z.enum(["messages:send","messages:receive","messages:force","messages:resend","fleet:read","fleet:commission","fleet:manage","crew:assign","crew:run","labels:define","labels:assign","fleet:network","fleet:on-behalf","fleet:person","fleet:owner","fleet:explain","fleet:connect","labels:any","fleet:verify","scopes:declare","scopes:grant","scopes:define","meetings:open","fleet:keys","fleet:alert"]),d=["messages","fleet","crew","labels","scopes","meetings"],u="[a-z][a-z0-9-]{0,31}";RegExp(`^${u}$`);let c=RegExp(`^${u}:${u}$`),f=t.z.string().regex(c,"A scope is <namespace>:<action>").refine(e=>{var t;return t=e.slice(0,e.indexOf(":")),!d.some(e=>e===t)||o.safeParse(e).success},"No such core scope");s.z.enum(["messages:resend","fleet:read","fleet:commission","fleet:manage","crew:assign","crew:run","labels:define","labels:assign","fleet:network","fleet:on-behalf","fleet:person","fleet:owner","fleet:explain","fleet:connect","labels:any","fleet:verify","meetings:open","fleet:alert"]);let p=s.z.enum(["operator","agent","viewer","person","app","plugin"]),m=s.z.enum(["agent","person","app","plugin"]),h=s.z.enum(["DEVICE","CLOUD","SERVER","OTHER"]),b=s.z.enum(["awaitingCrew","crewed","retired"]);s.z.enum(["ship","type","meeting","label"]);let v=s.z.enum(["pending","received","handed","acknowledged","handled","notHandled","undeliverable","dismissed","abandoned"]),g=s.z.enum(["FleetInitialised","ShipCommissioned","OwnerSet","OwnerChanged","ShipClaimed","LeaseRevoked","CredentialRevoked","StartingPromptIssued","OperatorPasswordReset","OperatorLoginSet","MessageAccepted","LeasePushed","DeliveryReceived","DeliveryHanded","DeliveryAcknowledged","DeliveryHandled","DeliveryNotHandled","DeliveryOverdue","DeliveryUndeliverable","DeliveryReturned","ShipRetired","DeliveryAbandoned","DeliveryDismissed","ShipRenamed","ShipReported","StatementSet","TurnReported","SignInTicketIssued","FleetLimitsChanged","ViewerSessionStarted","CrewRequested","CrewRequestRemoved","CrewAssigned","CrewStatusChanged","CrewRequestExplained","CrewRequestGivenBack","LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted","WorktreeClearRequested","WorktreeCleared","WorktreeClearRemoved","NetworkRulesSet","NetworkRulesDeclared","NetworkRulesDraftSaved","NetworkRulesDraftDiscarded","NetworkPluginRegistered","NetworkPluginUnregistered","BuiltInRuleChanged","ScopesDeclared","ScopesChanged","ScopeDefined","ScopeDescribed","ScopeRemoved","PluginConnected","PluginDisconnected","VerifiedFactsSet","VerifiedFactsRemoved","MeetingOpened","ParticipantAdded","MicRequested","MicRequestWithdrawn","MicGiven","MicReleased","MicTaken","MicPatternSet","ParticipantLeft","ParticipantRejoined","ParticipantRevoked","OwnershipTransferred","ModeratorNamed","MeetingEnded","ScheduleCreated","ScheduleCancelled","ScheduledSendRefused","ScheduledSendMissed","SchedulePaused","ScheduleResumed","ScheduleEnded","HistoryPruned","FleetSealingTurnedOn","FleetPayloadsSealed","FleetKeyUnavailable","FleetKeyAvailable","FleetDataKeyCreated","FleetCompanyKeyChanged","FleetRecoveryKeyChanged","FleetKeysRecovered","FeatureFlagTurnedOn","FeatureFlagTurnedOff","AlertRaised","AlertCleared","ExpectationsSet"]);e.s(["$",0,m,"h",0,v,"Q",0,g,"p",0,h,"q",0,f,"v",0,p,"e",0,b],173332);var z=e.i(383615);let y=t.z.string().min(1).max(128).brand();i.z.object({iss:t.z.string(),aud:(0,z.f)("fleet"),sub:y,org:t.z.string().min(1),scope:t.z.string(),group:n.z.array(t.z.string()),person_ship:(0,z.f)("ship").optional(),argo:r.z.boolean().optional(),iat:a.z.number(),exp:a.z.number()}).transform((e,t)=>{let i=e.scope.split(" ").filter(e=>""!==e),r=n.z.array(f).safeParse(i);return r.success?{issuer:e.iss,fleetId:e.aud,accountId:e.sub,organisationId:e.org,scopes:r.data,groupValues:e.group,personShipId:e.person_ship??null,isArgoAllowed:e.argo??!1,issuedAt:new Date(1e3*e.iat),endsAt:new Date(1e3*e.exp)}:(t.addIssue({code:"custom",message:"scope holds a malformed or unknown scope",path:["scope"]}),l.z.NEVER)}),e.s(["f",0,y],347664)},985939,e=>{var t=e.i(240192),i=e.i(54105),n=e.i(619877),r=e.i(282492),a=e.i(411382),l=e.i(691113),s=e.i(980815),o=e.i(214126),d=e.i(942203),u=e.i(213056),c=e.i(383615);new TextEncoder;let f=t.z.record(i.z.string(),n.z.json()),p=["crewing","running","restarting","crashed","releasing"],m=r.z.enum(p),h=["none","needsCrew","crewedByHand",...p],b=r.z.enum(h),v=`A reason is one line of at most ${String(200)} characters`;a.z.object({shipId:(0,c.f)("ship"),settings:f}),a.z.object({settingsVersion:l.z.int().min(1)}),a.z.object({shipId:(0,c.f)("ship")}),s.z.strictObject({});let g=a.z.object({settingsVersion:l.z.int().min(1),requestedAt:o.z.iso.datetime(),assignedTo:a.z.object({id:(0,c.f)("ship"),name:i.z.string()}).nullable(),status:m.nullable(),reason:i.z.string().nullable(),crewedBy:a.z.object({id:(0,c.f)("ship"),name:i.z.string()}).nullable(),attempt:l.z.int().min(0),startedAt:o.z.iso.datetime().nullable(),givenBack:d.z.array(a.z.object({trierarch:a.z.object({id:(0,c.f)("ship"),name:i.z.string()}),settingsVersion:l.z.int().min(1),reason:i.z.string(),givenBackAt:o.z.iso.datetime()}))}),z=g.extend({settings:f});a.z.object({shipId:(0,c.f)("ship"),trierarchShipId:(0,c.f)("ship")}),s.z.strictObject({}),a.z.object({shipId:(0,c.f)("ship"),status:m,attempt:l.z.int().min(0).optional(),startedAt:o.z.iso.datetime().nullable().optional()}),s.z.strictObject({}),a.z.object({shipId:(0,c.f)("ship")}),s.z.strictObject({}),d.z.array(a.z.object({shipId:(0,c.f)("ship"),settings:f,settingsVersion:l.z.int().min(1),requestedAt:o.z.iso.datetime(),status:m.nullable(),isFinal:u.z.boolean(),ownerShipId:(0,c.f)("ship").nullable(),ownerName:i.z.string().nullable()})),a.z.object({shipId:(0,c.f)("ship"),reason:i.z.string().trim().max(200,v).refine(e=>!/[\r\n]/.test(e),v).nullable()}),s.z.strictObject({}),a.z.object({shipId:(0,c.f)("ship"),settingsVersion:l.z.int().min(1),reason:i.z.string().trim().min(1,v).max(200,v).refine(e=>!/[\r\n]/.test(e),v)}),s.z.strictObject({}),e.s(["k",0,b,"M",0,z,"u",0,m,"i",0,g])},998648,e=>{var t=e.i(54105),i=e.i(411382),n=e.i(942203),r=e.i(477562),a=e.i(868217),l=e.i(691113),s=e.i(282492),o=e.i(213056),d=e.i(173332),u=e.i(383615),c=e.i(985939),f=e.i(606811);let p=t.z.string(),m=i.z.object({id:(0,u.f)("labelValue"),value:t.z.string()}),h=i.z.object({labelId:(0,u.f)("label"),key:t.z.string(),valueId:(0,u.f)("labelValue"),value:t.z.string()}),b=s.z.enum(["console","claudeCode","codex","trierarch","plugin","other"]),v=i.z.object({query:t.z.string().optional(),name:t.z.string().optional(),status:n.z.array(d.e).optional(),type:n.z.array(t.z.string()).optional(),shipKind:n.z.array(d.v).optional(),crewRequest:n.z.array(c.k).optional(),assignedTo:n.z.array((0,u.f)("ship")).optional(),needsCrew:s.z.enum(["withTrierarchs","withoutTrierarchs"]).optional(),valueIds:n.z.array((0,u.f)("labelValue")).optional(),shipIds:n.z.array((0,u.f)("ship")).optional(),kind:n.z.array(b).optional(),pluginShipIds:n.z.array((0,u.f)("ship")).optional()});i.z.object({filter:v.optional()}).optional(),i.z.object({status:n.z.array(d.e).optional()}).optional(),n.z.array(t.z.string());let g=i.z.object({column:s.z.enum(["ship","status","report","runsOn","seen","requested"]),direction:s.z.enum(["ascending","descending"])}),z=i.z.object({isEmpty:o.z.boolean(),value:t.z.string(),name:t.z.string(),id:(0,u.f)("ship")}),y=t.z.string().max(4096).transform(function(e){try{let t=atob(e.replaceAll("-","+").replaceAll("_","/"));return JSON.parse(new TextDecoder().decode(Uint8Array.from(t,e=>e.charCodeAt(0))))}catch{return}}).pipe(z);(0,f.G)(y).extend({...v.shape,sort:g.optional()}).optional(),i.z.object({key:p,values:n.z.array(p)}),i.z.object({labelId:(0,u.f)("label"),values:n.z.array(m)}),i.z.object({labelId:(0,u.f)("label"),values:n.z.array(p)}),i.z.object({values:n.z.array(m)}),i.z.object({labelId:(0,u.f)("label")}),i.z.object({key:p,value:p}),i.z.object({labelId:(0,u.f)("label"),valueId:(0,u.f)("labelValue")}),i.z.object({shipId:(0,u.f)("ship"),valueId:(0,u.f)("labelValue")}),i.z.object({});let x=r.z.discriminatedUnion("kind",[i.z.object({kind:a.z.literal("ship"),id:(0,u.f)("ship"),name:t.z.string()}),i.z.object({kind:a.z.literal("installation")})]),k=i.z.object({id:(0,u.f)("label"),key:t.z.string(),values:n.z.array(m),owner:x});n.z.array(k.extend({shipCount:l.z.int().min(0),values:n.z.array(m.extend({shipCount:l.z.int().min(0)}))})),e.s(["b",0,20,"B",0,h])},606811,e=>{var t=e.i(411382),i=e.i(691113),n=e.i(942203),r=e.i(419413);e.s(["G",0,function(e){return t.z.object({cursor:e.optional(),limit:i.z.int().min(1).max(r.f).optional()})},"_",0,function(e,i){return t.z.object({items:n.z.array(e),nextCursor:i.nullable()})}])},424010,e=>{var t=e.i(843476),i=e.i(366250),n=e.i(581239),r=e.i(156736),a=e.i(209793),l=e.i(784324),s=e.i(264951),o=e.i(77173);let d=e.i(313488).f;e.s(["Backdrop",()=>n.f,"Close",()=>r.f,"Description",()=>a.f,"Popup",()=>l.f,"Portal",()=>s.f,"Root",0,function(e){return(0,i.f)("alert-dialog",e)},"Title",()=>o.f,"Trigger",0,d],734604);var u=e.i(734604),u=u,c=u,f=u,p=u,m=u,h=u,b=u,v=e.i(812437),g=e.i(348184);e.s(["m",0,function(e){return(0,t.jsx)(u.Root,{"data-slot":"alert-dialog",...e})},"q",0,function(e){return(0,t.jsx)(c.Close,{"data-slot":"alert-dialog-close",...e})},"B",0,function({className:e,size:i,children:n,...r}){return(0,t.jsxs)(f.Portal,{children:[(0,t.jsx)(p.Backdrop,{"data-slot":"alert-dialog-overlay",className:g.f.overlay}),(0,t.jsx)(m.Popup,{"data-slot":"alert-dialog-content",className:(0,v.f)(g.f.popup({size:i}),e),...r,children:n})]})},"I",0,function({className:e,...i}){return(0,t.jsx)(b.Description,{"data-slot":"alert-dialog-description",className:(0,v.f)(g.f.description,e),...i})},"_",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,v.f)(g.f.footer,e),...i})},"O",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,v.f)(g.f.header,e),...i})},"g",0,function({className:e,...i}){return(0,t.jsx)(h.Title,{"data-slot":"alert-dialog-title",className:(0,v.f)(g.f.title,e),...i})}],424010)},212470,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(951437),r=e.i(146376),a=e.i(108868),l=e.i(667865),s=e.i(439957),o=e.i(469690),d=e.i(381104),u=e.i(884708),c=e.i(247778),f=e.i(538489),p=e.i(875812),m=e.i(552245),h=e.i(606039),b=e.i(675606),v=e.i(380025),g=e.i(584446);let z=i.forwardRef(function(e,t){let{render:z,className:y,id:x,name:k,value:j,disabled:w=!1,onValueChange:R,defaultValue:C,autoFocus:S=!1,style:I,...A}=e,{state:M,name:N,disabled:V,setTouched:O,setDirty:D,validityData:T,setFocused:$,setFilled:P,validationMode:E,validation:F}=(0,o.U)(),{clearErrors:L,elementRef:B,submitCountRef:q}=(0,u.f)(),U=V||w,H=N??k,K={...M,disabled:U},{labelId:_}=(0,c.f)(),G=(0,f.f)({id:x}),[W]=(0,n.f)({controlled:j,default:C,name:"FieldControl",state:"value"}),Z=void 0!==j,J=Z?W:void 0,Q=null==J?void 0:String(J),X=(0,l.f)(()=>F.inputRef.current?.value);(0,d.f)(F.inputRef,G,Q,X,!U,k),(0,r.f)(()=>{let e=Q??F.inputRef.current?.value;void 0!==e&&P(""!==e)},[Q,F.inputRef,P]),(0,h.f)(Q,()=>{void 0!==Q&&(L(H),D(Q!==(T.initialValue??"")),F.change(Q))});let Y=i.useRef(null),ee=(0,s.e)();return(0,r.f)(()=>{S&&Y.current===(0,g.T)((0,a.f)(Y.current))&&$(!0)},[S,$]),(0,m.f)("input",e,{ref:[t,Y],state:K,props:[{id:G,disabled:U,name:H,ref:F.inputRef,"aria-labelledby":_,autoFocus:S,...Z?{value:J}:{defaultValue:C},onChange(e){let t=e.currentTarget.value,i=(0,b.j)(v.f.none,e.nativeEvent);R?.(t,i),!Z&&(D(t!==(T.initialValue??"")),P(""!==t),e.nativeEvent.defaultPrevented||i.isCanceled||(L(H),F.change(t)))},onFocus(){$(!0)},onBlur(e){if(O(!0),$(!1),"onBlur"===E){let t=e.currentTarget.value;F.commit(t),Z&&queueMicrotask(()=>{let e=F.inputRef.current?.value;void 0!==e&&e!==t&&e!==(T.initialValue??"")&&F.commit(e)})}},onKeyDown(e){if("INPUT"===e.currentTarget.tagName&&"Enter"===e.key){O(!0);let t=e.currentTarget.value,i=e.currentTarget.form;if(i&&i===B.current&&!e.defaultPrevented){let t=e.currentTarget,i=q.current;ee.start(0,()=>{q.current===i&&F.commit(t.value)})}else F.commit(t)}}},A,e=>F.getValidationProps(U,e)],stateAttributesMapping:p.s})});e.s(["Control",0,z],305359);var y=e.i(305359),y=y;let x=i.forwardRef(function(e,i){return(0,t.jsx)(y.Control,{ref:i,...e})});var k=e.i(225913),j=e.i(812437);let w=(0,k.f)("w-full min-w-0 rounded-md border border-input bg-card text-foreground shadow-sm transition-[border-color,box-shadow] duration-(--duration-fast) outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/22 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/16 disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 disabled:shadow-none",{variants:{size:{md:"h-(--size-control) px-3 text-body",touch:"h-(--size-control-touch) rounded-lg px-3 text-input-touch"},isMono:{true:"font-mono",false:""}},defaultVariants:{size:"md",isMono:!1}});e.s(["e",0,function({className:e,size:i,isMono:n,leadingIcon:r,trailingIcon:a,...l}){let s=(0,t.jsx)(x,{"data-slot":"input",className:(0,j.f)(w({size:i,isMono:n}),r?"pl-9":void 0,a?"pr-9":void 0,e),...l});return r||a?(0,t.jsxs)("div",{className:"relative w-full [&_svg]:size-(--size-icon)",children:[r?(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:r}):null,s,a?(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-3 flex items-center",children:a}):null]}):s},"B",0,w],212470)},791727,e=>{var t=e.i(843476),i=e.i(812437);e.s(["f",0,function({className:e,htmlFor:n,...r}){return(0,t.jsx)("label",{"data-slot":"label",htmlFor:n,className:(0,i.f)("text-body font-medium text-foreground select-none",e),...r})}])},975867,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(951437),r=e.i(828918),a=e.i(146376),l=e.i(502077),s=e.i(956789),o=e.i(552245),d=e.i(788015),u=e.i(540886),c=e.i(733332);let f=i.createContext(void 0),p={...e.i(875812).s,checked:e=>e?{"data-checked":""}:{"data-unchecked":""}};var m=e.i(64350),h=e.i(469690),b=e.i(381104),v=e.i(884708),g=e.i(247778),z=e.i(31421),y=e.i(538489),x=e.i(675606),k=e.i(380025),j=e.i(606039);let w=i.forwardRef(function(e,c){let{checked:w,className:R,defaultChecked:C,"aria-labelledby":S,form:I,id:A,inputRef:M,name:N,nativeButton:V=!1,onCheckedChange:O,readOnly:D=!1,required:T=!1,disabled:$=!1,render:P,uncheckedValue:E,value:F,style:L,...B}=e,{clearErrors:q}=(0,v.f)(),{state:U,setTouched:H,setDirty:K,validityData:_,setFilled:G,setFocused:W,validationMode:Z,disabled:J,name:Q,validation:X}=(0,h.U)(),{labelId:Y}=(0,g.f)(),ee=J||$,et=Q??N,ei=i.useRef(null),en=(0,r.A)(ei,M,X.inputRef),er=i.useRef(null),ea=(0,d.f)(),el=(0,y.f)({id:A}),es=V?void 0:el,[eo,ed]=(0,n.f)({controlled:w,default:!!C,name:"Switch",state:"checked"});(0,b.f)(er,ea,eo,void 0,!ee,N),(0,a.f)(()=>{G(eo)},[eo,G]),(0,j.f)(eo,()=>{q(et),K(eo!==_.initialValue),X.change(eo)});let{getButtonProps:eu,buttonRef:ec}=(0,u.f)({disabled:ee,native:V}),ef=(0,z.f)(S,Y,ei,!V,es),ep={...X.getValidationProps(ee),checked:eo,disabled:ee,form:I,id:es,name:et,required:T,style:et?l.L:l.p,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:en,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(D)return void e.preventDefault();let t=e.currentTarget.checked,i=(0,x.j)(k.f.none,e.nativeEvent);O?.(t,i),i.isCanceled||ed(t)},onClick(e){e.stopPropagation()},onFocus(){er.current?.focus()},...void 0!==F?{value:F}:s.w},em=i.useMemo(()=>({...U,checked:eo,disabled:ee,readOnly:D,required:T}),[U,eo,ee,D,T]),eh=(0,o.f)("span",e,{state:em,ref:[c,er,ec],props:[{id:V?el:ea,role:"switch","aria-checked":eo,"aria-readonly":D||void 0,"aria-required":T||void 0,"aria-labelledby":ef,onFocus(){ee||W(!0)},onBlur(){let e=ei.current;e&&!ee&&(H(!0),W(!1),"onBlur"===Z&&X.commit(e.checked))},onClick(e){if(D||ee)return;e.preventDefault();let t=ei.current;t&&(0,m.f)(t,e)}},B,eu,e=>X.getValidationProps(ee,e)],stateAttributesMapping:p});return(0,t.jsxs)(f.Provider,{value:em,children:[eh,!eo&&et&&void 0!==E&&(0,t.jsx)("input",{type:"hidden",form:I,name:et,value:E,disabled:ee}),(0,t.jsx)("input",{...ep,suppressHydrationWarning:!0})]})}),R=i.forwardRef(function(e,t){let{render:n,className:r,style:a,...l}=e,s=function(){let e=i.useContext(f);if(void 0===e)throw Error((0,c.f)(63));return e}();return(0,o.f)("span",e,{state:s,ref:t,stateAttributesMapping:p,props:l})});e.s(["Root",0,w,"Thumb",0,R],450994);var C=e.i(450994),C=C,S=C,I=e.i(812437);e.s(["f",0,function({className:e,...i}){return(0,t.jsx)(C.Root,{"data-slot":"switch",className:(0,I.f)("peer inline-flex h-5 w-8.5 shrink-0 items-center rounded-full border border-transparent bg-input p-0.5 transition-colors duration-(--duration-fast) outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-checked:bg-primary data-disabled:opacity-45",e),...i,children:(0,t.jsx)(S.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-full bg-card shadow-sm transition-transform duration-(--duration-fast) data-checked:translate-x-3.5"})})}],975867)},443988,e=>{var t=e.i(843476),i=e.i(225913),n=e.i(812437);let r=(0,i.f)("w-full min-w-0 resize-none rounded-md border border-input bg-card px-3 py-2 text-foreground shadow-sm transition-[border-color,box-shadow] duration-(--duration-fast) outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/22 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/16 disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 disabled:shadow-none",{variants:{size:{md:"text-body",touch:"rounded-lg text-input-touch"},isMono:{true:"font-mono",false:""}},compoundVariants:[{size:"md",isMono:!0,className:"text-code"}],defaultVariants:{size:"md",isMono:!1}});e.s(["f",0,function({className:e,size:i,isMono:a,rows:l=4,...s}){return(0,t.jsx)("textarea",{"data-slot":"textarea",rows:l,className:(0,n.f)(r({size:i,isMono:a}),e),...s})}])},695960,e=>{var t=e.i(843476),i=e.i(792150),n=e.i(749287),r=e.i(586875),a=e.i(456420);let l={name:"tag-x",size:24,node:[["path",{d:"m16.5 6.5-3.914-3.914A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.43 2.43 0 0 0 3.42 0l1.79-1.79",key:"hu94c9"}],["path",{d:"m16.5 10.5 5 5",key:"1jo8bf"}],["path",{d:"m21.5 10.5-5 5",key:"jzei60"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};l.node;let s=(0,a.f)(l);var o=e.i(263676),d=e.i(812437),u=e.i(280581);let c={"trierarch-plugin":r.f,squadrons:i.f,ship:n.f,gone:s};e.s(["f",0,function({chip:e,onRemove:i,testId:n,className:r,trailing:a,meaning:l}){let s="none"===e.mark?null:c[e.mark],f=`${e.key}=${e.value}`,p=void 0===l?(0,u.$)(e):`${(0,u.$)(e)}. ${l}`;return(0,t.jsxs)("span",{role:"group","aria-label":p,"data-slot":"label-chip","data-testid":n,title:p,className:(0,d.f)("inline-flex h-5.5 max-w-full min-w-0 shrink-0 items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-muted-foreground","gone"===e.mark?"border-dashed":null,r),children:[null===s?null:(0,t.jsx)(s,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e.key,"="]}),(0,t.jsx)("span",{className:"font-medium",children:e.value})]}),a,void 0===i?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${f}`,onClick:i,className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(o.X,{"aria-hidden":!0})})]})}],695960)},298421,568290,e=>{var t=e.i(843476),i=e.i(456420);let n={name:"chevrons-down",size:24,node:[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]};n.node;let r=(0,i.f)(n);e.s(["f",0,r],568290);var a=e.i(681924),l=e.i(817981);e.s(["f",0,function({what:e,isLoading:i,isFailed:n,onLoad:s,area:o}){return n?(0,t.jsx)(l.f,{title:`Couldn’t load ${e}`,description:"What is shown stays as it is. Try again in a moment.",onRetry:s,className:"m-3"}):(0,t.jsx)("div",{className:"flex justify-center border-t border-border px-3.5 py-2.5",children:(0,t.jsx)(a.f,{size:"sm",variant:"ghost",icon:(0,t.jsx)(r,{"aria-hidden":!0}),isLoading:i,onClick:s,"data-testid":`${o}-load-more`,children:i?`Loading ${e}...`:`Load ${e}`})})}],298421)},509892,e=>{var t=e.i(843476),i=e.i(819759),n=e.i(681924),r=e.i(577880),a=e.i(485538);e.s(["f",0,function({title:e,description:l,titleMeta:s,primaryAction:o,toolbar:d,live:u,onCompose:c,onSearch:f,switcher:p,account:m,banner:h,phoneTopBar:b,children:v}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.f,{breadcrumb:e,live:u,switcher:p,account:m,onCompose:c,onSearch:f}),h,b??(0,t.jsx)(a.f,{title:e,live:u,switcher:p,account:m,onSearch:f,actions:c?(0,t.jsx)(n.f,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:c,children:(0,t.jsx)(i.f,{"aria-hidden":!0})}):void 0}),(0,t.jsxs)("main",{className:"flex grow flex-col gap-4 px-6 py-5 max-sm:gap-3.5 max-sm:px-4 max-sm:pt-3.5 max-sm:pb-[calc(var(--size-tabbar)+var(--spacing)*4)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 max-sm:gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1",children:[(0,t.jsx)("h1",{className:"text-title font-semibold tracking-tight text-foreground max-sm:text-title-touch",children:e}),s]}),l?(0,t.jsx)("p",{className:"text-meta text-muted-foreground max-sm:text-body-touch",children:l}):null]}),o?(0,t.jsx)("div",{className:"shrink-0 max-sm:w-full max-sm:[&>*]:w-full",children:o}):null]}),d,v]})]})}])},937338,711514,e=>{var t=e.i(942203),i=e.i(411382),n=e.i(282492),r=e.i(691113),a=e.i(214126),l=e.i(213056),s=e.i(477562),o=e.i(868217),d=e.i(54105),u=e.i(488826),c=e.i(383615),f=e.i(347664),p=e.i(998648),m=e.i(606811);let h=u.z.union([(0,c.f)("labelValue"),i.z.object({labelId:(0,c.f)("label"),value:n.z.enum(["*","#"])}),i.z.object({owner:u.z.union([(0,c.f)("ship"),n.z.enum(["*","#"])])})]);function b(e){return"string"!=typeof e&&"owner"in e}let v=t.z.array(h),g=["send","read","manage"],z=i.z.object({verb:n.z.enum(g),from:v,to:v}),y=t.z.array(z).nullable();i.z.object({rules:y}),i.z.object({savedAgainstVersion:r.z.int().min(0)}),i.z.object({version:r.z.int().min(0)}),i.z.object({applied:i.z.object({rules:y,version:r.z.int().min(0)}),draft:i.z.object({rules:y,savedAt:a.z.iso.datetime(),savedAgainstVersion:r.z.int().min(0)}).nullable()}),i.z.object({});let x=["argo","owner","answer","pluginRead","meeting","viewerRead","installation","open"];i.z.object({rule:n.z.enum(x),isOn:l.z.boolean()});let k=i.z.object({rule:n.z.enum(x),isOn:l.z.boolean()});t.z.array(k),i.z.object({version:r.z.int().min(0)}),i.z.object({rules:t.z.array(z)}),i.z.object({rules:r.z.int().min(0)});let j=s.z.discriminatedUnion("kind",[i.z.object({kind:o.z.literal("ship"),shipId:(0,c.f)("ship")}),i.z.object({kind:o.z.literal("installation")})]);t.z.array(i.z.object({declarer:j,rules:t.z.array(z)}));let w=i.z.object({id:(0,c.f)("ship"),name:d.z.string(),labels:t.z.array(p.B),owner:i.z.object({id:(0,c.f)("ship"),name:d.z.string()}).nullable()}),R=s.z.discriminatedUnion("kind",[w.extend({kind:o.z.literal("ship")}),i.z.object({kind:o.z.literal("account"),accountId:f.f,labels:t.z.array(p.B),personShip:i.z.object({id:(0,c.f)("ship"),name:d.z.string()}).nullable()}),i.z.object({kind:o.z.literal("installation")})]),C=i.z.object({id:(0,c.f)("reachRefusal"),at:a.z.iso.datetime(),sender:R,askedBy:w.nullable(),recipient:s.z.discriminatedUnion("kind",[i.z.object({kind:o.z.literal("ship"),ship:w}),i.z.object({kind:o.z.literal("type"),type:d.z.string(),ships:t.z.array(w)})]),verb:n.z.enum(g),settingsVersion:r.z.int().min(1)});(0,m.G)((0,c.f)("reachRefusal")),(0,m._)(C,(0,c.f)("reachRefusal")),i.z.object({fromShipId:(0,c.f)("ship"),toShipId:(0,c.f)("ship").optional(),against:n.z.enum(["applied","draft"]).optional()});let S=u.z.union([i.z.object({builtIn:n.z.enum(x)}),i.z.object({rule:r.z.int().min(0)}),i.z.object({declared:j,index:r.z.int().min(0)})]),I=t.z.array(i.z.object({shipId:(0,c.f)("ship"),rule:S}));i.z.object({send:I,read:I,manage:I});let A=t.z.array(i.z.object({fromShipId:(0,c.f)("ship"),toShipId:(0,c.f)("ship"),rule:S}));i.z.object({send:i.z.object({gained:A,lost:A}),read:i.z.object({gained:A,lost:A}),manage:i.z.object({gained:A,lost:A})}),e.s(["C",0,"*","h",0,g,"B",0,"#","b",0,b],711514);var M=e.i(280581);function N(e){return"all-to-all"===e.kind?null:e.rules.map(e=>({verb:e.verb,from:[...e.from],to:[...e.to]}))}function V(e,t){return"all-to-all"===e.kind?e:{kind:"rules",rules:e.rules.map(e=>e.key===t.key?t.change(e):e)}}function O(e,t){return D(e)===D(t)}function D(e){return"string"==typeof e?e:b(e)?`owner=${e.owner}`:`${e.labelId}=${e.value}`}function T(e,t){let i=e["from"===t?"to":"from"];return e[t].filter(e=>"string"!=typeof e&&!b(e)&&"#"===e.value&&!i.some(t=>O(t,e)))}function $(e,t){let i=e=>e.some(e=>b(e)&&"#"===e.owner);return i(e[t])&&!i(e["from"===t?"to":"from"])}e.s(["J",0,{"*":"Any owner","#":"The same owner as the other side"},"q",0,{"*":"Any value","#":"The same value as the other side"},"N",0,{send:"May send to",read:"May read",manage:"May manage"},"V",0,function(e,t){return"all-to-all"===e.kind||e.rules.length>=t.limits.rulesMax?e:{kind:"rules",rules:[...e.rules,{key:t.newKey(),verb:"send",from:[],to:[]}]}},"I",0,function(e,t){return V(e,{key:t.rule,change:e=>{let i=e[t.side];return i.some(e=>O(e,t.term))||i.length>=t.limits.selectorMax?e:{...e,[t.side]:[...i,t.term]}}})},"j",0,function(e,t){return null===e?{kind:"all-to-all"}:{kind:"rules",rules:e.map(e=>({key:t(),verb:e.verb,from:[...e.from],to:[...e.to]}))}},"p",0,function(e){return"rules"===e.kind&&e.rules.some(e=>T(e,"from").length+T(e,"to").length>0||$(e,"from")||$(e,"to"))},"C",0,function(e,t){return JSON.stringify(N(e))!==JSON.stringify(t)},"w",0,function(e){return e.ships.filter(e=>("operator"===e.kind||"person"===e.kind)&&"retired"!==e.status).map(e=>({shipId:e.id,name:e.name}))},"K",0,function(e,t){return"all-to-all"===e.kind?e:{kind:"rules",rules:e.rules.filter(e=>e.key!==t)}},"e",0,function(e,t){return V(e,{key:t.rule,change:e=>({...e,[t.side]:e[t.side].filter(e=>!O(e,t.term))})})},"f",0,N,"Q",0,function(e,t){let[i]=T(e,t.side);if(void 0===i)return $(e,t.side)?"owner=# needs owner=# on the other side: # matches the same owner there.":void 0;let n=t.context.labels.find(e=>e.id===i.labelId)?.key??i.labelId;return`${n}=# needs ${n}=# on the other side: # matches the same value there.`},"$",0,function(e,t){let i=[],n=[],r=[];for(let a of e){if(b(a)){let e=function(e,t){if("*"===e.owner||"#"===e.owner)return{term:e,text:`owner=${e.owner}`};let i=t.ships.find(t=>t.id===e.owner);return void 0===i?void 0:{term:e,text:`owner=${i.name}`}}(a,t);void 0===e?r.push(a):n.push(e);continue}let e=function(e,t){if("string"==typeof e){let[i]=(0,M.R)([e],t);return void 0===i?void 0:{labelId:i.labelId,key:i.key,value:i.value,mark:i.mark,ownerName:i.ownerName,term:e}}let i=t.labels.find(t=>t.id===e.labelId);if(void 0===i)return;let n=t.ownerOf.get(i.id);return{labelId:i.id,key:i.key,value:e.value,mark:n?.mark??"ship",ownerName:n?.name??(0,M.I)(i.owner),term:e}}(a,t);void 0===e?r.push(a):i.push(e)}return{chips:i,owners:n,unknown:r}},"i",0,function(e,t){return t?"rules"===e.kind?e:{kind:"rules",rules:[]}:{kind:"all-to-all"}},"G",0,function(e,t){return V(e,{key:t.rule,change:e=>({...e,verb:t.verb})})},"S",0,D],937338)},890135,e=>{e.s(["D",0,"argo","z",0,function(e){return e.charAt(0).toUpperCase()+e.slice(1)},"v",0,function(e,t){return`${String(e)} ${1===e?t.one:t.many}`},"X",0,function(e){return{kind:"ship",party:e}},"n",0,function(e){return{kind:"text",text:e}}])},165160,e=>{var t=e.i(367795),i=e.i(890135);let n=`Lowercase letters, digits, hyphens and colons, up to ${String(t.Z)} characters, unique among active ships.`;e.s(["I",0,function(e){return e.toLowerCase()},"L",0,function(e,r){return""===e?{kind:"empty",message:n}:(0,t.C)(e)?e===i.D?{kind:"reserved",message:`${i.D} is reserved for the operator ship.`}:e===r.current?{kind:"unchanged",message:"That is its name now."}:r.activeNames.includes(e)?{kind:"taken",message:`${e} is already used by an active ship.`}:{kind:"available",message:`${e} is available.`}:{kind:"invalid",message:`Use 1 to ${String(t.Z)} lowercase letters, digits, hyphens or colons.`}},"t",0,function(e,t){let i=e.trim();return""===i||void 0===t?"Free text. Pick a type in use or write a new one.":0===t?`No ship uses this type yet. ${i} becomes a new type.`:1===t?"1 ship uses this type.":`${String(t)} ships use this type.`}])}])})();